﻿//平滑滚动到顶部
toTop = {
	init:function(){
		document.getElementById("toTop").onclick=function(e){
			toTop.set();
			return false;
		}		
	},
	waitTimer:null,
	set:function(){
		var d_st=document.documentElement.scrollTop;
		if(window.navigator.userAgent.indexOf("MSIE")>=1){
			for (var i=d_st; i>10; i-=Math.floor(i/6)){
			window.scrollTo(0,i);
			}
			window.scrollTo(0,10);
		}
		else{
		window.scrollTo(0,Math.floor(d_st / 2));
		
		 if(d_st>10){
				 waitTimer=setTimeout("toTop.set()",40);
		  }
			else{
				  clearTimeout(waitTimer);
			}
		}
	}
}
window.onload = function(){toTop.init();}


lastScrollY=0;
function heartBeat(){ 
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
    diffY = document.documentElement.scrollTop;
else if (document.body)
    diffY = document.body.scrollTop
else
    {/*Netscape stuff*/}

percent=.1*(diffY-lastScrollY); 
if(percent>0)percent=Math.ceil(percent); 
else percent=Math.floor(percent); 
document.getElementById("full").style.top=parseInt(document.getElementById("full").style.top)+percent+"px";

lastScrollY=lastScrollY+percent; 
}
suspendcode="<style type='text/css'>#full{background:url(images/kefu_middle.gif) center bottom;width:110px;overflow:hidden;text-align:center;font-size:12px;}#full .qq_top{background:url(images/kefu_up.gif) no-repeat center top;height:70px;}#full .qq_bottom{background:url(images/kefu_down.gif) no-repeat center top;height:50px;}.qq_top a#toTop{height:34px;display:block;outline:none;blr:expression(this.onFocus=this.blur());}.qq_bottom a#toTop{height:50px;display:block;outline:none;blr:expression(this.onFocus=this.blur());}#full .qq_bottom{height:50px;font-size:0}#full ul{margin:0;padding:0;list-style:none;}#full li{}#full span{display:block;height:16px;line-height:16px;margin-bottom:6px;}#full img{CURSOR:pointer;border:0;width:77px;height:17px;}</style><div id=\"full\" style='right:0px;top:180px;position:absolute;z-index:1000;'><ul><div class=\"qq_top\"><a id='toTop' href='#top'> </a></div><li><img onclick=\"javascript:window.open('tencent://message/?uin=547593794&amp;websiteName=wwww.whyonglang.com　在线','_self');\" src='images/qq.gif' alt='点击QQ与在线客服交流'/><span>在线客服</span></li><li><img onclick=\"javascript:window.open('tencent://message/?uin=1512274748&amp;websiteName=wwww.whyonglang.com　在线','_self');\" src='images/qq.gif' alt='点击QQ与在线客服交流'/><span>在线客服</span></li><div class=\"qq_bottom\"><a id='toTop' href='#top'> </a></div></ul></div>"

document.write(suspendcode);
window.setInterval("heartBeat()",1);

