function Add_Event(obj_,event_,func_,mode_){if(obj_.addEventListener)
obj_.addEventListener(event_,func_,mode_?mode_:false);else
obj_.attachEvent('on'+event_,func_);}
function GetScrollPage(){var Left;var Top;var DocRef;if(window.innerWidth){with(window){Left=pageXOffset;Top=pageYOffset;}}
else{if(document.documentElement&&document.documentElement.clientWidth)
DocRef=document.documentElement;else
DocRef=document.body;with(DocRef){Left=scrollLeft;Top=scrollTop;}}
return({top:Top,left:Left});}
function ObjGetPosition(obj_){var PosX=0;var PosY=0;if(typeof(obj_)=='object')
var Obj=obj_;else
var Obj=document.getElementById(obj_);if(Obj){PosX=Obj.offsetLeft;PosY=Obj.offsetTop;if(Obj.offsetParent){while(Obj=Obj.offsetParent){if(Obj.offsetParent){PosX+=Obj.offsetLeft;PosY+=Obj.offsetTop;}}}}
return({left:PosX,top:PosY});}
var IdTimer_1;var IdTimer_2;var O_DivScroll;var Rapport=1.0/20.0;var Mini=2*Rapport;function DIV_Scroll(id_){var Obj=document.getElementById(id_);this.Obj=Obj;if(Obj){Obj.style.position="absolute";var Pos=ObjGetPosition(id_);this.PosX=Pos.left;this.PosY=Pos.top;this.DebX=this.PosX;this.DebY=this.PosY;this.NewX=0;this.NewY=0;this.Move=DIV_Deplace;}}
function DIV_Deplace(x_,y_){if(arguments[0]!=null){this.PosX=x_;this.Obj.style.left=parseInt(x_)+"px";}
if(arguments[1]!=null){this.PosY=y_;this.Obj.style.top=parseInt(y_)+"px";}}
function DIV_Replace(x_,y_){var Delta_X=(x_-O_DivScroll.PosX)*Rapport;var Delta_Y=(y_-O_DivScroll.PosY)*Rapport;if(((Delta_Y<Mini)&&(Delta_Y>-Mini))&&((Delta_X<Mini)&&(Delta_X>-Mini))){clearInterval(IdTimer_1);O_DivScroll.Move(x_,y_);}
else{O_DivScroll.Move(O_DivScroll.PosX+Delta_X,O_DivScroll.PosY+Delta_Y);}}
function DIV_CheckScroll(){var Scroll=GetScrollPage();O_DivScroll.NewX=Scroll.left+O_DivScroll.DebX;O_DivScroll.NewY=Scroll.top+O_DivScroll.DebY;if((O_DivScroll.PosY!=O_DivScroll.NewY)||(O_DivScroll.PosX!=O_DivScroll.NewX)){clearInterval(IdTimer_1);IdTimer_1=setInterval("DIV_Replace("+O_DivScroll.NewX+","+O_DivScroll.NewY+")",10);}
return(true);}
function DIV_InitScroll(){O_DivScroll=new DIV_Scroll('DIV_MOVE');if(O_DivScroll.Obj)
IdTimer_2=setInterval('DIV_CheckScroll()',100);}
Add_Event(window,'load',DIV_InitScroll);
