/*Copyright(c) http://hi.baidu.com/anrin 2008/12/06*/
(function(){var AnrinFloat=window.AnrinFloat=function(a,b){if(typeof a=='string'){var e=document.getElementById(a);if(e==null) return false;this.e=e;}else if(typeof a=='object'&&a.nodeType===1){this.e=a;}else{return false;}var f=this.constructor;if(f.l){for(var _p in f.l){if(f.l[_p].e==this.e){return false;}}}else{f.l=[];}this.i=f.l.length;f.l.push(this);if(typeof b=='number'&&b>= 3&&b<=10){this.p=parseInt(b);}else{this.p=8;}var pos=f.cs(this.e,'position');if(pos=='static'){this.e.style.position='relative';}else if(pos=='fixed'){this.e.style.position='absolute';}var top=parseInt(f.cs(this.e,'top'));if(!top){this.e.style.top='0px';this.top=0;}else{this.top=top;}var _this=this;this.toScroll=function(){if(this.scrolling)return;this.scrolling=true;this.timer=setInterval('AnrinFloat.l['+_this.i+'].scroll()',30);};this.scroll=function(){var top=parseInt(f.cs(this.e,'top'));var st=f.getScrollTop();if(top==this.top+st){clearInterval(this.timer);this.scrolling=false;return true;}var pl=10;if(st+this.top>top){pl=Math.ceil((st+this.top-top)/this.p);}else{pl=-Math.ceil((top-st-this.top)/this.p);}this.e.style.top=top+pl+'px';};var handle=function(){_this.toScroll();};if(window.attachEvent){window.attachEvent('onscroll',handle);}else if(window.addEventListener){window.addEventListener('scroll',handle,false);}else{window.onscroll=handle;}};AnrinFloat.cs=function(e,k){if(typeof e.currentStyle!='undefined'){return e.currentStyle[k];}else{return document.defaultView.getComputedStyle(e,null)[k];}};AnrinFloat.b=(document.compatMode&&document.compatMode=='CSS1Compat'&&!(/KHTML|Opera/.test(navigator.userAgent)));AnrinFloat.getScrollTop=function(){if(this.b)return document.documentElement.scrollTop;return document.body.scrollTop;};AnrinFloat.add=function(e,p){return new this(e,p);};})();

