function Slider(width, rightpos, prefix){
	this.width = width;
	this.rightpos = rightpos;
	this.leftpos = this.rightpos - this.width;
	this.prefix = prefix;
	this.index = Slider.currentindex++;
	
	this.stepping = false;
	this.stepindex = 0;
	this.stepdistanceleft = 0;
	this.stepdirection = 0;
	this.speed = 40;
	this.issliding = false;
	
	// find parts of the slider
	this.sliderdiv = document.getElementById(this.prefix+'slider');
	this.paneldiv = document.getElementById(this.prefix+'panel');
	this.button = document.getElementById(this.prefix+'button');
	this.buttonlink = document.getElementById(this.prefix+'buttonlink');
	
	this.obj = 'Slider'+this.index;
	eval(this.obj+'=this;');
}

Slider.prototype.isopen = function(){
	return this.sliderdiv.style.left == this.leftpos + 'px'; 
}

Slider.prototype.Open = function(){
	if(!this.stepping && !this.isopen()){
		this.stepping = true;
		this.stepdistanceleft = this.width;
		this.stepdirection = -1;
		this.paneldiv.style.zIndex = 999;
		this.interval = setInterval(this.obj+'._stepincrement()',this.speed);
	}else if(!this.stepping){
		this.Close();
	}
}

Slider.prototype.Close = function(){
	if(!this.stepping && this.isopen()){
		this.stepping = true;
		this.stepdistanceleft = this.width;
		this.stepdirection = 1;
		this.interval = setInterval(this.obj+'._stepincrement()',this.speed);
	}
}

Slider.prototype._stepincrement = function(){
	if(this.stepdistanceleft){
		var inc = Math.round(Math.min(this.stepdistanceleft,Math.max(this.stepdistanceleft/2,2)));
		if(this.stepdirection > 0){
			this.sliderdiv.style.left = (this.rightpos - inc) + 'px';
		}else{
			this.sliderdiv.style.left = (this.leftpos + inc) + 'px';
		}
		this.stepdistanceleft -= inc;
	}else{
		clearInterval (this.interval);
		if(this.stepdirection > 0){
			this.sliderdiv.style.left = this.rightpos + 'px';
			this.button.src = openbutton.src;
			this.buttonlink.href = 'javascript:BackIssuesSlider.Open();';
			this.paneldiv.style.zIndex = -1;
		}else{
			this.sliderdiv.style.left = this.leftpos + 'px';
			this.button.src = closebutton.src;
			this.buttonlink.href = 'javascript:BackIssuesSlider.Close();';
		}
		this.interval = null;
		this.stepping = false;
	}
}
openbutton = new Image();
openbutton.src = '/images/openslider.gif';
closebutton = new Image();
closebutton.src = '/images/closeslider.gif';

BackIssuesSlider = new Slider(736,736,'bi_');
