function backward() {
	if( photos.length > 0 ) {
		if (index == 0)
			index = photos.length-1;
		else 
			index--;
			
		window.status = '';
		document.images.imgPhotoslider.src = photos[index][0];
		document.images.imgPhotoslider.alt = photos[index][1];
		
		if (document.layers)
			ns4Write();
		else if (document.getElementById)
			ns6Write();
		else
			domWrite();
	}
}

function forward() {
	if( photos.length > 0 ) {
		if (index == photos.length-1) 
			index = 0;
		else 
			index++;
			
		window.status = '';
		document.images.imgPhotoslider.src = photos[index][0];
		document.images.imgPhotoslider.alt = photos[index][1];
		
		if (document.layers)
			ns4Write();
		else if (document.getElementById)
			ns6Write();	
		else
			domWrite();
	}
}

function slideLoad() {
/* Sets the initial image, accompanying text and image index */
	if( photos.length > 0 ) {
		index = 0;
		document.images.imgPhotoslider.src = photos[index][0];
		document.images.imgPhotoslider.alt = photos[index][1];
	
		if (document.layers)
			ns4Write();	
		else if (document.getElementById)
			ns6Write();
		else
			domWrite();
	}
}

// Set the slideshow speed (in milliseconds)
var slideShowSpeed = 5000;
var tss;

function runSlideShow()
{ 
	if (photos.length > 0)
	{
		window.status = '';
		document.images.imgPhotoslider.src = photos[index][0];
		document.images.imgPhotoslider.alt = photos[index][1];
		
		if (document.layers)
			ns4Write();
		else if (document.getElementById)
			ns6Write();
		else
			domWrite();
	
		if (index == photos.length-1) 
			index = 0;
		else 
			index++;
	
		tss = setTimeout('runSlideShow()', slideShowSpeed);
	}
}

function slideLoadPrint(){
/* Sets the initial image and accompanying text for Print Articles */
	if( photos.length > 0 ) {
		index = 0;
		document.images.imgPhotoslider.src = photos[index][0];
		
		if (document.layers){
			x = document.layers["phototext"];
			x.document.open();
			x.document.write(photos[index][1]);
			x.document.close();
		}
		else if (document.getElementById) {
			document.getElementById("phototext").innerHTML = photos[index][1];
		}
		else {
			document.all.phototext.innerHTML = photos[index][1];
		}
	}
}

function ns4Write(){
/* Writes the accompanying text and image index for NS4 */
		x = document.layers["phototext"];
		x.document.open();
		x.document.write(photos[index][1]);
		x.document.close();
}

function ns6Write(){
/* Writes the accompanying text and image index for NS6 */
	document.getElementById("phototext").innerHTML = photos[index][1];
}

function domWrite(){
/* Writes the accompanying text and image index for DOM Browsers */
	document.all.phototext.innerHTML = photos[index][1];
}

