function photoSlide(containerId,navLinkId,timeout)
{
	this.oCon=document.getElementById(containerId);
	this.oNav=document.getElementById(navLinkId);
	
	var _oItems = this.oCon.getElementsByTagName('DIV');
	this.oItems = [];
	for(var i=0;i<_oItems.length;i++){
		if(_oItems[i].className=="item"){
			this.oItems[this.oItems.length]=_oItems[i];
		}
	}
	this.timeout = timeout;
	
	this.currIndex=0;
	window[containerId+"_"]=this;
	
	var links='';
	for(i=0;i<this.oItems.length;i++)
	{
		links += '<a'+ (i==0?' class="current" ':' ') +'onclick="window.' +containerId+ '_.go('+ i +')" href="javascript:void(0)">'+(i+1)+'</a>';
	}
	this.oNav.innerHTML=links;
	this._indexChanged=function(prevIndex,currIndex)
	{
		this.oNav.childNodes[prevIndex].className="";
		this.oNav.childNodes[currIndex].className="current";
	};
	this.next=function()
	{
		var prevIndex=this.currIndex;
		this.oItems[this.currIndex].style.display="none";
		this.currIndex++;
		if(this.currIndex>=this.oItems.length)
			this.currIndex=0;
		this.oItems[this.currIndex].style.display="block";
		this._indexChanged(prevIndex,this.currIndex);
	};
	this._play=function()
	{
		this.next();
		this.timerId = window.setTimeout(containerId+'_._play()',this.timeout);
		
	};
	this.play=function()
	{
		this.timerId=window.setTimeout(containerId+'_._play()',this.timeout);
	};
	this.stop=function()
	{
		window.clearTimeout(this.timerId);
	};
	this.go=function(index)
	{
		this.stop();
		this.oItems[this.currIndex].style.display="none";
		this.oItems[index].style.display="block";
		this._indexChanged(this.currIndex,index);
		this.currIndex=index;
		this.play();
	}
}