document.write("<style type='text/css'>");
document.write("div#floatTips_WebChat");
document.write("{position:absolute;top:150px;right:12px;display:block;width:112px;cursor:pointer;}");
document.write("</style>");

document.write("<div id='floatTips_WebChat'>" + "\n");
document.write("<label name=\"FpsSmallIconUser\" id=\"FpsSmallIconUser\" offlineimg=\"http://www.sdzhizao.com/UploadFile/gradepic/zixun_0.jpg\" recguest=\"true\" onlineimg=\"http://www.sdzhizao.com/UploadFile/gradepic/zixun_1.jpg\" userid=\"1253864772241\"></label>" + "\n");
document.write("</div>" + "\n");

var tips;
var pos;
var theTop = 150;
var old = theTop;

function initFloatTips() {
  tips = document.getElementById('floatTips_WebChat');
  moveTips();
}
function moveTips() {
  var tt=50;
  if (window.innerHeight) {
    pos = window.pageYOffset
  }
  else if (document.documentElement && document.documentElement.scrollTop) {
    pos = document.documentElement.scrollTop
  }
  else if (document.body) {
    pos = document.body.scrollTop;
  }
  pos=pos-tips.offsetTop+theTop;
  pos=tips.offsetTop+pos/10;
  if (pos < theTop) pos = theTop;
  if (pos != old) {
    tips.style.top = pos+"px";
    tt=10;
  }
  old = pos;
  setTimeout(moveTips,tt);
}

document.onreadystatechange = subSomething;//当页面加载状态改变的时候执行这个方法. 
function subSomething() 
{ 
if(document.readyState == "complete") //当页面加载状态为完全结束时进入
initFloatTips(); //这是你的操作
}
