/*
Class :: SSRSJS_slider
Developer :: Tajinder Singh Namdhari
Developed On :: 09-05-2008
License :: GPL
*/
function SSRSJS_slider(preTxt,ttlNum,looped)
{
	var pre=preTxt;
	var ttl=ttlNum;
	var isLoop=looped;
	var currNum=0;
	
	this.showSlide=function(trgtNum)
	{//alert(trgtNum);
		var cnt=0;
		for(cnt=0;cnt<ttl;cnt++)
		{	document.getElementById(pre+cnt).style.display='none';	}
		document.getElementById(pre+trgtNum).style.display='block';
		currNum=trgtNum;
	}
	
	this.nextSlide=function()
	{
		if((isLoop==1)&&(currNum==ttl-1))
		{	currNum=-1;	}
		
		if(currNum!=ttl-1)
		{	this.showSlide(++currNum);	}
	}
	
	this.prevSlide=function()
	{
		if((isLoop==1)&&(currNum==0))
		{	currNum=ttl;	}
		
		if(currNum!=0)
		{	this.showSlide(--currNum);	}
	}
}