﻿// JScript File
var timers;
var time=50;
var speed=2;
var silderW;
var w;
var obj;


function newsSilder(objName,silderW){
    this.obj=document.getElementById(objName)
    this.w=parseInt(obj.style.width);
    this.silderW=silderW;
    this.obj.style.left=silderW.toString()+"px";
    
    startSilder();
    
}

function startSilder(){
    this.timers=setTimeout("moveSilder()",time);
    
    this.obj.onmouseover = function(){
        speed=0;
    };
    this.obj.onmouseout = function(){
        speed=2;
    };

}

function moveSilder(){
   
    if(parseInt(this.obj.style.left)+this.w<0){
        this.obj.style.left=silderW.toString()+"px";
    }else{
         var i=parseInt(this.obj.style.left)-speed;
        this.obj.style.left=i.toString()+"px";
    }
   this.timers=setTimeout("moveSilder()",time);
}

