﻿/*备*/

function FloatLiteS(d1,pos,pageW)
{var _=this;
	_.d=document;
	_.de=_.d.documentElement;
	_.b=_.d.body;
	_.w=window;
	_.pos=pos.toUpperCase();

	_.d1=I(d1);
	//_.d2=I(d2);
	//_.bt=I(bt);


	_.d1x=null;
	_.d1y=null;
	
	
	_.x=0;
	_.y=0;
	
	_.wd=0;
	
	_.x1=0;
	_.y1=0;
	_.dy1=0;
	_.dyy=0;
	
	
	_.interval=10;
	_.ismoving=0;
	_.it0=null;
	
	_.pageW=(pageW==null)?920:pageW;
	_.d1d=0;

	_.moved1=function()
	{
			//_.d1.S().display="block";
			//_.hided2w();
			var d1y=_.d1y==null?(_.d1.WH()-_.d1.OH())/2:_.d1y;
			var wd=0;
			
			wd=_.pos=="R"?_.d1.WW()-(_.d1.WW()-_.pageW)*.5+5:wd;
			wd=_.pos=="L"?((_.d1.WW()-_.pageW)/2)-_.d1.OW()-5:wd;
			wd=_.pos=="C"?(_.d1.WW()-_.d1.OW())*.5:wd;
			_.wd=wd;
			_.dyy=(_.d1.WH()-_.d1.OH())*.5;
			
			
			var y=_.de.scrollTop+d1y;
			
			
			_.y=y;
			
			//_.dy2=_.de.scrollTop;
			//_.d1.xy(wd,y);
			_.dy2=_.de.scrollTop;
			_.dy=(_.dy2-_.dy1);
			//_.stopM();
			setTimeout(_.startM1,1);
	}
	
	_.startM1=function()
	{
			//_.d1.xy(wd,y);
			_.dy0=0;
			_.startM();
			_.dy1=_.dy2;
	}
	
	_.startM=function()
	{
		_.stopM();
		//if(_.ismoving==1){return;}
		_.it0=setInterval(_.doM,_.interval);
	}
	_.stopM=function()
	{
		 clearInterval(_.it0);
	}
	
	_.doM=function()
	{
		_.ismoving=1;
		var y=_.de.scrollTop;
		
		if(Math.abs(_.dy0)<Math.abs(_.dy)/2)
		{
			if(_.dy>0){
			_.dy0+=(10+_.dy0)*.17;
			}else
			{
				_.dy0-=(10-_.dy0)*.17;
			}
			
		}else
		{
			_.dy0+=(_.dy-_.dy0)*.17;
			
		}
			
			
			
			_.d1.xy(_.wd+_.d1d,y+_.dy0-_.dy+_.dyy);
			//if(_.dy0>_.dy*.999){_.dy0=_.dy;_.d1.xy(_.wd,y+_.dy0-_.dy+_.dyy);_.stopM();}
			if(Math.abs(_.dy0)>=Math.abs(_.dy)*.999){_.ismoving=0;_.dy0=_.dy;_.d1.xy(_.wd+_.d1d,y+_.dy0-_.dy+_.dyy);_.stopM();}
				//document.title=_.dy0+":"+_.dy+":"+_.de.scrollTop;
	}
	
	
	_.init=function()
	{
		//_.de.onscroll=_.moved1;
		
		_.dy1=_.de.scrollTop;
		_.d1H=_.d1.OH();
		
		I.E(window,"scroll",_.moved1);
		I.E(window,"resize",_.moved1);
		I.E(window,"load",_.moved1);
		
		_.d1.S().display="block";
	//_.hided2w();
		//_.d1.S().display="none";
	}

	
	_.init();
}
