autoPlaymode = 0;
imgIndex = -1;
maxImgs = 0;
ImageArray = new Array();

function NewImage(autoPlay)
{
if (autoPlay)
{
if (++imgIndex==maxImgs)
imgIndex=0;
}
else
{
if (imgIndex==0)
imgIndex=maxImgs;
imgIndex--;
}
imageChange();
}

function getobject(obj){
if (document.getElementById)
return document.getElementById(obj)
else if (document.all)
return document.all[obj]
}

function imageChange() {
getobject("pictureno").src = ImageArray[imgIndex][0];
getobject("caption").innerHTML = ImageArray[imgIndex][1];
getobject("imgno").innerHTML = imgIndex + 1;
getobject("noimgs").innerHTML = maxImgs;
}


function Slideshow()
{
autoPlaymode = !autoPlaymode;
if (autoPlaymode)
{
getobject("prevbtn").disabled = getobject("nextbtn").disabled = true;
getobject("prevbtn").src = "images/previous-off.gif";
getobject("nextbtn").src = "images/next-off.gif";

Nextimage();
}
else 
{
getobject("prevbtn").disabled = getobject("nextbtn").disabled = false;
getobject("prevbtn").src = "images/previous-on.gif";
getobject("nextbtn").src = "images/next-on.gif";

}
}
function firstImg()
{
if (autoPlaymode)
window.setTimeout("Tick()", 5000);
}
function Tick() 
{
if (autoPlaymode)
Nextimage();
}
function Previousimage()
{
NewImage(false);
}
function Nextimage()
{
NewImage(true);
}

//array containing images and desriptions 

//End configuration


if (document.getElementById||document.all)
window.onload=Nextimage;
