function Slider(oDiv,ocDiv,oSpeed,oSteps){
this.pDiv=oDiv;
this.cDiv=ocDiv;
this.currentPos=0;
var cg=this.pDiv.style.width;
if(oSteps)
this.steps=oSteps;
else
this.steps=4;
this.change=cg.substr(0,cg.length-2);
var ms=this.cDiv.style.width;
this.maxSlide=ms.substr(0,ms.length-2);
this.speed=oSpeed;
this.flag=true;
}
Slider.prototype.moveForward=function(){

	if(this.flag){
	this.flag=false;
	this.pos=this.cDiv.style.left;
	this.currentPos=this.pos.substr(0,this.pos.length-2);
	
	//if(stepPos==currentPos){
	this.newPos=this.currentPos-this.change;
	//}
	oThis=this;
	if(this.newPos>=(-1*this.maxSlide)){
	this.sid=setInterval(function(){oThis.moveF()},this.speed);
	}else{
		this.flag=true;	
			}
	}
}

Slider.prototype.moveF=function(){

	 this.pos=this.currentPos-(this.change/this.steps);
	this.cDiv.style.left=this.pos+"px";
	this.currentPos=this.pos;
	
	if(this.currentPos==this.newPos){
		clearInterval(this.sid);
		this.flag=true;
		//document.onclick=null;
		}
}

Slider.prototype.moveBack=function(){
	//document.onclick=blank;
	if(this.flag){
 	this.flag=false;
	this.pos=this.cDiv.style.left;
	this.currentPos=new Number(this.pos.substr(0,this.pos.length-2));
	this.newPos=this.currentPos+new Number(this.change);
	var oThis=this;
	if(this.newPos<=0){
	
	this.sid=setInterval(function(){oThis.moveB()},this.speed);
	
			}else{
		this.flag=true;	
			}
	}
	}
	
Slider.prototype.moveB=function(){
	this.pos=this.currentPos+(this.change/this.steps);
	this.cDiv.style.left=this.pos+"px";
	this.currentPos=this.pos;
	//alert(pos+"  "+newPos);
	if(this.currentPos==this.newPos){
		clearInterval(this.sid);
		this.flag=true;
		}
}
