$(function(){
	//$("#floatTip").css({left:document.documentElement.clientWidth-95 + "px", top:"280px"}).css("position", "absolute").show();
	//floating();
	$("#floatTip").floatdiv({left:document.documentElement.clientWidth-95 + "px", top:"280px"});
});
function floating()
{
	var id		= "floatTip";
	var left	= (document.documentElement && document.documentElement.clientWidth) ? document.documentElement.clientWidth-document.getElementById(id).offsetWidth : document.body.clientWidth-document.getElementById(id).offsetWidth;
	var top		= 280;
	var amount	= 10;
	var timeout	= 10;
	
	var obj = document.getElementById("floatTip");
	
	var startPoint = parseInt(obj.style.top.replace("px",""));
	var endPoint = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
	if (endPoint < 0) endPoint = 0;
	endPoint += top;
	if (startPoint != endPoint )
	{
		var scrollAmount = Math.ceil( Math.abs( endPoint - startPoint ) / amount );
		obj.style.top = parseInt(obj.style.top) + ( ( endPoint < startPoint ) ? -scrollAmount : scrollAmount )+"px";
	}
	
	startPoint = parseInt(obj.style.left.replace("px",""));
	endPoint = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
	if (endPoint < 0) endPoint = 0;
	endPoint += left;
	if (startPoint != endPoint )
	{
		var scrollAmount = Math.ceil( Math.abs( endPoint - startPoint ) / amount );
		obj.style.left = parseInt(obj.style.left) + ( ( endPoint < startPoint ) ? -scrollAmount : scrollAmount )+"px";
	}
	setTimeout("floating()", timeout);
}
//备用
//用法：$("#floatTip").floatdiv({left:document.documentElement.clientWidth-95 + "px", top:"280px"});
jQuery.fn.floatdiv=function(location){
	if(location.right=="0px") location.right="18px";
	$(this).css(location).css("position", "absolute").show();
	var obj = $(this);
	var timeoutflag;
	$(window).scroll(function(){
		if(timeoutflag){window.clearTimeout(timeoutflag);}timeoutflag=window.setTimeout(function(){$(obj).animate({top:parseInt(location.top.replace("px", ""))+$(window).scrollTop()})},200);
	});
};
$("#web_loading").floatdiv({left:document.documentElement.clientWidth-95 + "px", top:"0px"});
$(document).ready(function(){
	insertCopyURL();
});
window.onload=function(){$("#web_loading").hide()};
//window.onbeforeunload=function(){$("#web_loading").show()};
function insertCopyURL()
{
	var flashvars = {};
	var params = {};
	params.wmode = "opaque";
	var attributes = {};
	attributes.name = "CopyURL";
	swfobject.embedSWF("/swf/CopyURL.swf?ver=0.0.1", "CopyURL", "72", "16", "10.0.0", "/swf/expressInstall.swf", flashvars, params, attributes);
}
function goTop(a, t)
{
	a = a || 0.1;
	t = t || 16;

	var x1 = 0;
	var y1 = 0;
	var x2 = 0;
	var y2 = 0;
	var x3 = 0;
	var y3 = 0;

	if (document.documentElement) {
		x1 = document.documentElement.scrollLeft || 0;
		y1 = document.documentElement.scrollTop || 0;
	}
	if (document.body) {
		x2 = document.body.scrollLeft || 0;
		y2 = document.body.scrollTop || 0;
	}
	var x3 = window.scrollX || 0;
	var y3 = window.scrollY || 0;

	var x = Math.max(x1, Math.max(x2, x3));
	var y = Math.max(y1, Math.max(y2, y3));

	var speed = 0.5 + a;
	window.scrollTo(Math.floor(x / speed), Math.floor(y / speed));
	if(x > 0 || y > 0) {
		var f = "goTop(" + a + ", " + t + ")";
		window.setTimeout(f, t);
	}
}
//找出页面内所有重复的Id
function chkid(){ 
    var did={},tmpid; 
    divs = document.getElementsByTagName("*"); 
    for (var i=divs.length-1; i+1; i--){ 
        (tmpid=divs[i].id) 
            &&did[tmpid]===undefined 
                ?did[tmpid]=0 
                :did[tmpid]++; 
    } 
    for (var i in did) { 
        did[i]&&alert("URL:\t" + document.URL + "\nID:\t\t"+i+"\nRepeat:\t"+(did[i]+1)+"\n请复制以上内容并通知管理员！谢谢合作！"); 
    } 
}
chkid();
