var goto_top_type = -1;
var goto_top_itv = 0;
function goto_top_timer()
{
	var y = goto_top_type == 1 ? document.documentElement.scrollTop : document.body.scrollTop;
	//var e = y<1000?y:1000
	var moveby = 20;
	y -= Math.ceil((y*moveby/100)+5);
	if (y < 0) {
		y = 0;
	}
	if (goto_top_type == 1) {
		document.documentElement.scrollTop = y;
	}
	else {
		document.body.scrollTop = y;
	}
	if (y == 0) {
		clearInterval(goto_top_itv);
		goto_top_itv = 0;
		window.onscroll = fix;
		window.onresize = fix;
		document.getElementById('ReferList').style.display='block';
	}
}
function goto_top()
{
	window.onscroll = null;
	window.onresize = null;
	document.getElementById('topbar').style.display='none';
	document.getElementById('ReferList').style.display='none';
	if (goto_top_itv == 0) {
		if (document.documentElement && document.documentElement.scrollTop) {
			goto_top_type = 1;
		}
		else if (document.body && document.body.scrollTop) {
			goto_top_type = 2;
		}
		else {
			goto_top_type = 0;
		}
		if (goto_top_type > 0) {
			goto_top_itv = setInterval('goto_top_timer()', 10);
		}
	}
}

var browser=navigator.appName 
var b_version=navigator.appVersion 
var version=b_version.split(";"); 
var trim_Version=version[1].replace(/[ ]/g,""); 
var IE_Lv="";
/*if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE7.0") 
{ 
	IE_Lv="IE 7.0"; 
} */
if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE6.0") 
{ 
	IE_Lv="IE 6.0";
}else{
	IE_Lv="IE 7.0";
}
function ReferListShow(isshow){
	dc=document.getElementById('ReferList');
	if (isshow=="true" || isshow==null){
		QQShow = isshow;
		dc.style.bottom='28px';
		isshow="true";
	}else{
		QQShow = isshow;
		dc.style.bottom=26-dc.offsetHeight+'px';
	}
	SetCookie("QQShow",isshow);//set cookies for ReferList isshow
	if(IE_Lv=="IE 6.0"){
		fix();
	}
}
function fix(){
	var b1=document.getElementById('topbar');
	var b2=document.getElementById('ReferList');
	if(b1){
		if (document.documentElement.scrollTop ==0)b1.style.display="none";
		else b1.style.display="block";
		if(IE_Lv=="IE 6.0"){
			var a=document.documentElement.scrollTop+document.documentElement.clientHeight-b1.offsetHeight;
			b1.style.top = a+"px";
		}
	}
	if(b2 && IE_Lv=="IE 6.0"){//set ReferList Add in IE6
		if (QQShow=='true' || QQShow==null){
			var QQbottom=b2.offsetHeight+28;
		}else{
			var QQbottom=26;
		}
		var a=document.documentElement.scrollTop+document.documentElement.clientHeight-QQbottom;
		b2.style.top = a+"px";
	}
}
window.onscroll = fix;
window.onresize = fix;