/*
The variables
MsIExplorer, currentphoto and maxphotos
must be defined in the calling code

photoview is an image object
phototext is a div text tag
*/

function MyPhotoViewer(cPhotoFile)
	{
	//window.open("myphotoviewer.asp?file="+cPhotoFile,"myphotoviewer","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=790,height=500,resizable=yes");
	window.open("../Library/myphotoviewer.asp?file="+cPhotoFile,"myphotoviewer","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,fullscreen,resizable=yes");
	}

function previousphoto()
	{ 
		if(document.images) { 
			currentphoto--; 
			if(currentphoto<1) currentphoto=maxphotos; 
			document.images['photoview'].src=photo[currentphoto].src; 

			if (MsIExplorer)
			{
				document.all['phototext'].innerText = Imagetext[currentphoto]; 
			}
			else
			{
				document.getElementById('phototext').removeChild(document.getElementById('phototext').childNodes[0]);
				var newText=document.createTextNode(Imagetext[currentphoto]);
				document.getElementById('phototext').appendChild(newText);							
			}							

		} 
	} 

function nextphoto()
	{ 
		if(document.images) { 
			currentphoto++; 
			if(currentphoto>maxphotos) currentphoto=1; 
			document.images['photoview'].src=photo[currentphoto].src; 						

			if (MsIExplorer)
			{
				document.all['phototext'].innerText = Imagetext[currentphoto]; 
			}
			else
			{
				document.getElementById('phototext').removeChild(document.getElementById('phototext').childNodes[0]);
				var newText=document.createTextNode(Imagetext[currentphoto]);
				document.getElementById('phototext').appendChild(newText);							
			}							


		}
	}


