// JavaScript Documentvar nInx=0;
var nInx=0;
var iInterval = 0;
var aImgData=new Array();
function ImgData( path, capt, crdt, wdth, hght )
{
	this.path = path;
	this.capt = capt;
	this.crdt = crdt;
	this.wdth = wdth;
	this.hght = hght;
}

function play()
{
	getObj('playdiv').style.display="none";
	getObj('pausediv').style.display="block";
	
	if(iInterval != 0)
	clearInterval(iInterval);
	
	iInterval = setInterval("next()", 5000);
	next();
}
function pause()
{
	getObj('pausediv').style.display="none";
	getObj('playdiv').style.display="block";

	clearInterval(iInterval);
	iInterval = 0;
}
function prev()
{
	nInx = nInx > 0 ? nInx-1 : 4;
	
	applyeffect(aImgData[nInx]);
	
}
function next()
{
	nInx = nInx < 4 ? nInx+1 : 0;
	
	applyeffect(aImgData[nInx]);
	
}	
function applyeffect(oImg)
{
	imgcontainer.filters[0].apply();
	var oSlides=document.images.slides;

	oSlides.src	= oImg.path;
	imgcontainer.filters[0].play();
	
	oSlides.width	= oImg.wdth;
	oSlides.height	= oImg.hght;

	if(typeof(scnt) != "undefined") scnt.innerText	= (nInx+1);
	if(typeof(cptn) != "undefined") cptn.innerHTML	= oImg.capt;
	if(typeof(crdt) != "undefined") crdt.innerHTML	= "(" + oImg.crdt + ")";
}