// JavaScript Document
// 电子商务：界面设计制作部
// 日期：2008-12-30


//1.变量声明
var tips; 
var theTop = 80 /*theTop值是用来控制默认高度位置的，值越大位置越靠下*/; 
var old = theTop;

//2.判断浏览器
function initFloatTips() {
  tips = document.getElementById('floatTips');
  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;
  }
  
//3.浮动效果
  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);
}

