<!--
imageShowClassCollection = new Array();
imageShowClassTimeout = setInterval('multipleImageShowHandler()',100)
function multipleImageShowHandler()
{
	
	for(var i=0; i<imageShowClassCollection.length;i++)
	{
	//document.forms[0][i].value = imageShowClassCollection[i].delay;

		if(imageShowClassCollection[i].playing)
		{
			if(imageShowClassCollection[i].delay <= 0)
			{
				imageShowClassCollection[i].moveNext();
				imageShowClassCollection[i].delay = imageShowClassCollection[i].showSpeed;
			}
			else
			{
				imageShowClassCollection[i].delay -= 100;
			}
		}
	}
				
}

function imageShowClass(pImageName)
{
	if(document.images)
	{
		
		// initialize the member function references 
		// for the class prototype
		if (typeof(_imageShowClass_prototype_called) == 'undefined')
		{
		  _imageShowClass_prototype_called = true;
		  //imageShowClass.prototype.addImage = addImage;
		  imageShowClass.prototype.addImage = function addImage(pImageSource,pAltTag,pLinkPath,pTextAccompany)
												{
													var totalImages = this.imagesArray.length;
													this.imagesArray[totalImages] = new Array();
													this.imagesArray[totalImages][0] = pImageSource;
													this.imagesArray[totalImages][1] = pAltTag;
													this.imagesArray[totalImages][2] = pLinkPath;
													this.imagesArray[totalImages][3] = pTextAccompany;
													this.preloadImage(pImageSource);
												}
		  imageShowClass.prototype.moveNext = function moveNext()
												{
													var imgGoTo = this.currentImage + 1;
													var imgNext = imgGoTo + 1;
													if(imgGoTo >= this.loadedImages.length)
													{
														imgGoTo = 0;
														imgNext = 1;	
													}
													this.currentImage = imgGoTo;
													
													document.images[this.imageName].src = this.loadedImages[imgGoTo].src;
													showDisplay('A',this.imagesArray[this.currentImage][3]);
													this.setButtons();	
												}
		  imageShowClass.prototype.movePrevious = function movePrevious()
												{
													var imgGoTo = this.currentImage - 1;
													var imgNext = imgGoTo + 1;
													if(imgGoTo < 0)
													{
														imgGoTo = this.loadedImages.length - 1;
														imgNext = 0;	
													}
													this.currentImage = imgGoTo;
													
													document.images[this.imageName].src = this.loadedImages[imgGoTo].src;
													showDisplay('A',this.imagesArray[this.currentImage][3]);
													this.setButtons();
												}
		  imageShowClass.prototype.moveFirst = function moveFirst()
												{
													document.images[this.imageName].src = this.loadedImages[0].src;
													this.currentImage = 0;
													this.nextImage = 1;
													showDisplay('A',this.imagesArray[this.currentImage][3]);
													this.setButtons();
												}
		  imageShowClass.prototype.moveLast = function moveLast()
												{
													document.images[this.imageName].src = this.loadedImages[this.loadedImages.length - 1].src;
													this.currentImage = this.loadedImages.length - 1;
													this.NextImage = 0;
													showDisplay('A',this.imagesArray[this.currentImage][3]);
													this.setButtons();
												}
		  imageShowClass.prototype.insertShow = function insertShow()
												{
													
													if(this.linksStyle == "buttons")
													{
														document.write('<form name="' + this.imageName + 'Form" onsubmit="return false;">');
														document.write('<input type="button" name="play" value="Play" class="imageShowButton" disabled="true" onclick="Javascript:doImgMethod(\'' + this.imageName + '\',\'play\')" />&nbsp;');
														document.write('<input type="button" name="pause" value="Pause" class="imageShowButton" disabled="true" onclick="Javascript:doImgMethod(\'' + this.imageName + '\',\'pause\');" />&nbsp;&nbsp;&nbsp;');
														document.write('<input type="button" name="first" value="First" class="imageShowButton" disabled="true" onclick="Javascript:doImgMethod(\'' + this.imageName + '\',\'first\');" />&nbsp;');
														document.write('<input type="button" name="previous" value="Previous" class="imageShowButton" disabled="true" onclick="Javascript:doImgMethod(\'' + this.imageName + '\',\'previous\');" />&nbsp;');
														document.write('<input type="button" name="next" value="Next" class="imageShowButton" disabled="true" onclick="Javascript:doImgMethod(\'' + this.imageName + '\',\'next\');" />&nbsp;');
														document.write('<input type="button" name="last" value="Last" class="imageShowButton" disabled="true" onclick="Javascript:doImgMethod(\'' + this.imageName + '\',\'last\');" />');
														document.write('</form>');
														this.setButtons();
													}
													else if(this.linksStyle == "links" || this.linksStyle != "buttons")
													{
														document.write('<a href="Javascript:doImgMethod(\'' + this.imageName + '\',\'play\');">play</a>&nbsp;');
														document.write('<a href="Javascript:doImgMethod(\'' + this.imageName + '\',\'pause\');">pause</a>&nbsp;&nbsp;&nbsp;');
														document.write('<a href="Javascript:doImgMethod(\'' + this.imageName + '\',\'first\')">first</a>&nbsp;');
														document.write('<a href="Javascript:doImgMethod(\'' + this.imageName + '\',\'previous\');">previous</a>&nbsp;');
														document.write('<a href="Javascript:doImgMethod(\'' + this.imageName + '\',\'next\');">next</a>&nbsp;');
														document.write('<a href="Javascript:doImgMethod(\'' + this.imageName + '\',\'last\');">last</a><br />');
														
													}
													document.write('<a href="Javascript:' + this.imageName + '.linkHandler();"><img name="' + this.imageName + '" src="' + this.imagesArray[0][0] + '"');
													if ((nameCode == 2) && (versionCode >= 4) && (versionCode < 6) && navigator.userAgent.indexOf('Firefox') == -1)
													{
														document.write(' width="250" height="172"');
													}
													if(this.CSSClassName != "") 
													{
														document.write(' class="' + this.CSSClassName  + '"');
													}
													
													document.write(' /></a>' );
													document.write('<div id="A" style="position:absolute;left:155px;top:475px;width:530px">');
													document.write('<p>&nbsp;</p><p>&nbsp;</p>');
													document.write('</div>')
													document.images[this.imageName].src = this.loadedImages[0].src;
													showDisplay('A',this.imagesArray[this.currentImage][3]);
												}
		  imageShowClass.prototype.playShow = function playShow()
												{
													this.playing = true;
													this.setButtons();
												}
		  imageShowClass.prototype.pauseShow = function pauseShow()
												{
													this.playing = false;
													this.setButtons();
												}
		  imageShowClass.prototype.stopShow = function stopShow()
												{
												
												}
		  imageShowClass.prototype.preloadImage = function preloadImage(pImageSource)
												{
													newImg = new Image();
													newImg.src = pImageSource
													this.loadedImages[this.loadedImages.length] = newImg;
												}
		  imageShowClass.prototype.setSpeed = function setSpeed(speedInSeconds)
												{
													//if(speedInSeconds.isNaN() || speedInSeconds < 0 || speedInSeconds=="") speedInSeconds = 2;
													
													speedInMilliseconds = speedInSeconds * 1000;
													this.showSpeed = speedInMilliseconds;
													this.delay = speedInMilliseconds;
												}
		  imageShowClass.prototype.addCSSClass = function addCSSClass(pClassName)
												{
													this.CSSClassName = pClassName;	
												}
		  imageShowClass.prototype.setButtons = function setButtons()
												{
													if(this.linksStyle=="buttons")
													{
														var frm = eval("document.forms['" + this.imageName + "Form']");
														// set play and pause buttons to disabled depending on current state
														if(this.playing)
														{
															frm.play.disabled = true;
															frm.pause.disabled = false;
															//alert("playing" + frm.play.disabled)	
														}
														else
														{
															frm.play.disabled = false;
															frm.pause.disabled = true;	
														}
														// set first and previous
														if(this.currentImage == 0)
														{
															frm.first.disabled = true;
															frm.previous.disabled = true;
														}
														else if(this.loadedImages.length > 1)
														{
															frm.first.disabled = false;
															frm.previous.disabled = false;
														}
														// set next and last
														if(this.currentImage == (this.loadedImages.length - 1))
														{
															frm.next.disabled = true;
															frm.last.disabled = true;
														}
														else
														{
															frm.next.disabled = false;
															frm.last.disabled = false;
														}
													}
												}
		  imageShowClass.prototype.linkHandler = function linkHandler()
												{
													eval(this.imagesArray[this.currentImage][2]);
												}
		}
		
		// properties
		this.imageName = pImageName;
		this.currentImage = 0;
		this.nextImage = 1;
		this.transitionEffect;
		this.sizeWidth;
		this.sizeHeight;
		this.positionLeft;
		this.positionTop;
		this.showSpeed = 2000;
		this.delay = 2000;
		this.imagesArray = new Array();
		this.loadedImages = new Array();
		this.collectionIndex = imageShowClassCollection.length;
		this.playing = false;
		this.CSSClassName = "";
		this.linksStyle = "buttons";
		
		// workaround?
		imageShowClassCollection[imageShowClassCollection.length] = this;
	}
}

function doImgMethod(pClassName,pMethod)
{
	
	switch(pMethod)
	{
		case "play":
			method = ".playShow()";
			break;
		case "pause":
			method = ".pauseShow()";
			break;
		case "next":
			method = ".moveNext()";
			break;
		case "previous":
			method = ".movePrevious()";
			break;
		case "first":
			method = ".moveFirst()";
			break;
		case "last":
			method = ".moveLast()";
			break;
		default: return false;
	}
	eval(pClassName + method);
}

function popPhoto(pImg,pOrientation)
{
	var width = 415;
	var height = 415;
	var winProps = "resizable=yes";
	var winLoc = "images/mac/hi_res/" + pImg; 
	
	if(pOrientation=="landscape")
	{
		width=431;
		height=331;
	}
	else if(pOrientation=="portrait")
	{
		width=307;
		height=454;
	}
	
	var popPhotoWin = window.open(winLoc, 'popPhotoWin', winProps);
  	popPhotoWin.resizeTo(width, height);
	popPhotoWin.focus();

}

function showDisplay(theLayer, theDisplay){
if (!document.layers && !document.all && !document.getElementById) 
return;
if (document.layers) { 
	document.layers[theLayer].document.write(theDisplay); 
	document.layers[theLayer].document.close();} 
else if (document.all) { 
	document.all[theLayer].innerHTML = theDisplay;} 
else if (document.getElementById) { 
	document.getElementById(theLayer).innerHTML = theDisplay;} 
}

//-->
