
var c=0;
var t;
var data1="";
var data2=0;
var stopped=Boolean();
picLocation="";	//Location of the gallery files
picCount=0;	//Number of pictures in the gallery
picExt=""	//File extension - normally .jpg or .JPG

function selectGallery(data1,data2,data3,data4)
{
clearTimeout(t);

picLocation=data1;
picCount=data2;
picExt=data3;
picCopyright=data4;

picNumber=c%picCount+1;
picFile=picLocation+picNumber+picExt;
picID="photoGallery";
galleryID="selectedGallery";
copyrightID="copyright";

document.getElementById(picID).alt=picFile;
document.getElementById(picID).src=picFile;
document.getElementById(galleryID).alt=picFile;
document.getElementById(copyrightID).alt=picCopyright;

c=c+1;
t=setTimeout("selectGallery(picLocation,picCount,picExt,picCopyright)",2200);
}

function pauseGallery()
{
if (stopped)
 {
 t=setTimeout("selectGallery(picLocation,picCount,picExt,picCopyright)",500);
 stopped=Boolean();
 }
 else
 {
 clearTimeout(t)
 stopped=Boolean(1);
 }
}