var captions = new Array();var oneBigDiary = true; 							// Assume one big trip journal - instad of multiple pages which only comes into existence 3/111/2003var cssBased = false;var defaultTextColor = "white";				// used with styles related to the View Caption button (\) --9/8/03var MSIE = false;if ( navigator.userAgent.indexOf("MSIE") >= 0 ) {	MSIE = true;} else {	MSIE = false;}function IsNumber(value) /* Return TRUE if the value passed is a number; FALSE if it is not.	 value:		a value of some sort to test.*/{/*	if ( typeof(value) == "number" ) {		return true;	} else {		return false;	}*/	if ( isFinite(value) == true ) {		return true;	} else {		return false;	}	} // IsNumberfunction show_props(obj, obj_name, asHTML, withType) {	var result = "";	for (var i in obj) {  	if ( asHTML == true ) {			result += "<p>" + obj_name + "." + i + " = " + obj[i] + " ";			if ( withType == true ) {				result += "object type = " + typeof(obj[i]) + "</p>";			}		} else {			result += obj_name + "." + i + " = " + obj[i] + " ";			if ( withType == true ) {				result += "object type = " + typeof(obj[i]) + " ";			}		}	}	return result;} // show_propsfunction OpenNewURL(url)/* Opens the specified URL in the parent window and closes the window where the link was	 clicked.	 	 url:		string. An URL.*/{	 parent.window.opener.location = url;	 top.window.close();	 return false;} // OpenNewURLfunction OpenImageNamed(imageName, width, height, isMovie)/* Open specified image. 	 Images are expected to be in images/<imageName> format.   imageName:	string.   width:			Optional. Integer. Width of window to open image in.	 height:		Optional. Integer. Height of window to open image in.	 isMovie:		Optional. Boolean. TRUE if you want to open a QuickTime file. Default FALSE.*/{	var theWindow;	var str;	var offset;	var isMovie = (isMovie == null )	? false : true;	var ww = (width == null )	? 400 : width + 32;	var wh = (height == null ) ? 300 : height + 36;	var userAgent = navigator.userAgent;	if (isMovie) {//		ww += 30;		wh += 16;	}	offset = 0;	// Make sure the window will fit on the screen. If it won't shrink it down somewhat.	if ( screen.availWidth <= ww ) { ww = screen.availWidth * 0.9 };	if ( screen.thewindow	<= wh ) { wh = screen.availHeight * 0.9 };		str = "scrollbars=yes,toolbar=no,height=" + wh + ",width=" + ww;	theWIndow = window.open("", "Picture", str);	with(theWIndow.document) {		write("<html><head><style type='text/css'> .text {margin-top: -1em;margin-bottom: -2em;color:red;} .caption {text-align:center;font-size:10px;font-family:helvetica,sans-serif;font-weight:bold;}</style><title>A Lovely Picture</title></head><body bgcolor=#FFFFFF><div align=center style=\"vertical-align: middle\">");		if ( !isMovie ) {			write("<img alt='' src=images/");			write(imageName);		} else {			write("<embed autoplay='true' width='" + (ww - 32) +"' height='" + (wh - (36+16) + 24) + "' controller='true' src='images/" + imageName + "' pluginspace='http://www.apple.com/quicktime/download'><\/embed");		}		write("></div>");		write("</body></html>");	}} // OpenImageNamedfunction OpenImage1(ref)/* Opens the specified image in its own window. Images are assumed to be in	 a directory called "images" that is at the same level as the referring document.	 Image file names are taken from the "ref" component of the image object. A ".jpg"	 extension is added (e.g, ref = "14"; image name = "14.jpg").	 	ref:			String. Image object reference ID.*/{	var theWindow;	var str;	var theImage = -1;	var copyright = "";	var objectString;	var objectType = "";				if ( navigator.userAgent.indexOf("MSIE") >= 0 ) {		MSIE = true;	} else {		MSIE = false;	}	if ( navigator.userAgent.indexOf("Netscape") >= 0 ) {		ns = true;	} else {		ns = false;	}// Is the browser CSS2 aware? CSS2 required for "View Caption" button to work. // Browsers prior to Version 5 are assumed not CSS 2 aware though they may be moderately CSS compliant	if ( navigator.appVersion.split(" ")[0] < 4 ) {		noVC = true;	} else {		noVC = false;	}	for (i=0; i < slides.length; i++) {		if ( slides[i].ref == ref) {			theImage = slides[i];			break;		}	}	if ( theImage == -1) { return }				// If the image object can't be found just return.	if (theImage.objectType == "movie") {		wh = theImage.height + 70;		if ( MSIE == true ) {			wh += 8;		}	} else 	if (theImage.objectType == "panorama") {		wh = theImage.height + 68;		if ( MSIE == true ) {			wh += 20		}	} else {		wh = theImage.height + 38;		if ( MSIE == true ) {			wh += 20		}	}	ww = theImage.width + 40;	copyright = theImage.copyright;	objectType = theImage.objectType;	if ( ( noVC == false) && ( theImage.caption != "" ) ) {		viewCaption = "<a id='cap' href='#' >View Caption<span>" + theImage.caption + "</span></a>";	} else {		viewCaption = "";	}// Make sure the window will fit on the screen. If it won't shrink it down somewhat.	if ( screen.availWidth <= ww ) { ww = screen.availWidth * 0.9 };	if ( theImage.width >= ww) { wh += 8; }	if ( screen.availHeight <= wh ) { wh = screen.availHeight * 0.9 };	ww = Math.floor(ww);	wh = Math.floor(wh);// compute left margin for caption	ml =  (ww - theImage.width) + 10;	if (ml <= 0) { ml=40; }// compute left margin for view-caption button	vcml = Math.floor( ( ww / 2) - 50 );		str = "statusbar=yes,status=true,scrollbars=yes,toolbar=no,height=" + wh + ",width=" + ww;// temporarily removing the WIDTH and HEIGHT tags from the <IMG> object - width=" + theImage.width + " height=" + theImage.height + "	objectString = "<img style='clear:both; padding:0px; margin: -1em 0px' alt='' src=images/" + theImage.ref + ".jpg width=" + theImage.width + " height=" + theImage.height + ">";	if ( objectType == "movie" ) {		// for Quicktime movies		objectString = "<embed autoplay='true' width='" + theImage.width +"' height='" + (24 + theImage.height) + "' controller='true' src='images/" + theImage.ref + ".mov' pluginspace='http://www.apple.com/quicktime/download'><\/embed>";	}		if ( objectType == "panorama" ) {		// for Quicktime VR panoramas		objectString = "<embed  controller=true width='" + theImage.width +"' height='" + (24 + theImage.height) + "' src='images/" + theImage.ref + ".mov' pluginspace='http://www.apple.com/quicktime/download'></embed>";	}//alert(str);	theWIndow = window.open("", "Picture", str);	with(theWIndow.document) {		write("<html><head><title>A Lovely Picture</title> \r");		write("<style type='text/css'>\r");		write("   span#hide { display: none; }\r");		write("   a#hide { display: none; }\r");		write("   a#cap:hover span#hide { display: none; }\r");		write("   a#cap { margin-left: " + vcml + "px; margin-top: -1em; display: block; text-align: center; width: 100px; font: bold; color: blue; background: white; text-decoration: none; border: double 3px black; }\r");		write("   a#cap:hover { color: yellow; background: black;  }\r");		write("   a#cap span { display: none }\r");		write("   a#cap:hover span { display: block; position: absolute; top: 30px; left: " + ml + "px; margin: 10px; font-weight: 900; font-size: 12pt; color: " + theImage.textColor + "; text-align: justify; width: " + Math.floor(ww - (ml + 40)) + "px; }\r");		write(" </style></head><body bgcolor=#FFFFFF>\r");//		if ( !(MSIE) ) {			write("<div style='float: left; font-size: 10px; '>&copy;&nbsp;"+copyright+"&nbsp;Kenneth Knight</div>\r");//		}			write("<p align=center>\r");//		if ( !(MSIE) ) {			if ( objectType == ".jpg") {				write(viewCaption + "<br >\r");			}//		}		write(objectString);write("</p>\r");/*		if ( MSIE ) {			if ( objectType == ".jpg") {				write("<p align='center'>");				write(viewCaption);			}			write("<p style='font-size: 9px; margin-top: -1.5em; margin-bottom: 0em;'>&copy;&nbsp;"+copyright+"&nbsp;Kenneth Knight\r");		}*/		write("</body></html>\r");	}} // OpenImage1function JumpTo(docNumber)/* Jump to the specified part in the document. --3/11/03	 docNumber:	Optinal integer. Concatenated to an anchor reference this number is used to tell	 						the browser where to jump within the current document. If the passed	 						number is greater than the maximun number of document parts (set in maxDoc)	 						no change is made. If the passed number is less than 1 the document is reset	 						to the top.	 							 						if docNumber is a string then the string is assumed to be the name (relative URL) of the document to open --3/19/03	 							 						If not supplied the value in currentDoc is used.	 The function REQUIRES that the "docName", "currentDoc", "maxDoc", and "docAnchors" variables be defined.*/{//alert(docNumber + " " + IsNumber(docNumber) + "type: " + typeof(docNumber));	if ( IsNumber(docNumber) ) {		docNumber = ( docNumber == null ) ? currentDoc : docNumber;		if ( ( docNumber >= 1) && ( docNumber <= maxDoc) ) {			if ( docAnchors == true ) {				window.location = "#Day%20" + docNumber;			} else {				if ( IsNumber(docNumber) ) {					window.location = docName + docNumber + ".html";				} else {					window.location = docNumber;				}			}			currentDoc = docNumber;				}	} else {		// docNumber is actually a document name - just jump to that.		window.location = docNumber;	}} // JumpTofunction Slide(ref, caption, width, height, copyright, objectType, thumbWidth, thumbType)/* Creates a slide slide image object. The object contains the following properties:				ref:				the image number. E.g. 9 --> 09.jpg (the .jpg is added by OpenImage1)		height:			the image height.		width:			the image width.		caption:		the image caption.		link:				the caption plus associated link text if any is present. Link text is marked by the a								marker string, "<link>", within the text.		copyright:	the copyright date for the image.		objectType:	The type of object to display (image, movie, panorama)		thumbWidth:	The width of the associated thumbnail.		thumbType:	Type of object to display. Either "image" or "movie". Default is "image" --6/3/2003*/{	var str = new String(caption);	var refStr1 = "<a href=\"javascript:OpenImage1('"+ref+"')\">";	var refStr2 = "</a>";	this.ref = ref;	this.width = (width != null) ? width : defaultSlideWidth;	this.height = (height != null) ? height : defaultSlideHeight;	this.copyright = (copyright != null) ? copyright : defaultSlideCopyright;	this.objectType = (objectType != null) ? objectType : ".jpg";	this.thumbWidth = (thumbWidth != null) ? thumbWidth : defaultThumbWidth;	this.thumbType = (thumbType != null) ? thumbType : "image";	this.caption = str.replace(/<ref>/gi, "");							// remove <ref> tags.	this.caption = this.caption.replace(/<\/ref>/gi, "");		// remove </ref> tags.	//	str = caption;	this.link = str.replace(/<ref>/gi, refStr1);						// change to start of link tag.	this.link = this.link.replace(/<\/ref>/, refStr2);		// change to end of link tag.	this.textColor = defaultTextColor;			// color of text that's displayed by OpenImage1		this;} // Slidefunction OpenImage(imageNum)/* Opens the specified image in its own window. Images are assumed to be in	 a directory called "images" that is at the same level as the referring document.	 Image file names are to take the form image<imageNum>.jpg.	 	 This function expects to find images in a directory called images/ and be named	 following the convention image##.jpg (e.g., image05.jpg, image99.jpg).   imageNum: String. The image number. E.g., 9 --> image9.jpg.*/{	var theWindow;	var str;	var offset, wh, ww;		offset = 0;	var userAgent = navigator.userAgent;/*	if (userAgent.indexOf("Mozilla") >= 0) { offset = 20};	if (userAgent.indexOf("MSIE") >= 0) { offset = -10};	if (userAgent.indexOf("iCab") >= 0) { offset = -25};*/	wh = winHeight + offset;	ww = winWidth + offset;	//	wh = slides[imageNum - 1].height;//	ww = slides[imageNum - 1].width;	// Make sure the window will fit on the screen. If it won't shrink it down somewhat.	if ( screen.availWidth <= ww ) { ww = screen.availWidth * 0.9 };	if ( screen.availHeight <= wh ) { wh = screen.availHeight * 0.9 };		str = "scrollbars=yes,toolbar=no,height=" + wh + ",width=" + ww;	theWIndow = window.open("", "Picture", str);	with(theWIndow.document) {		write("<html><head><style type='text/css'> .text {margin-top: -1em;margin-bottom: -2em;color:red;} .caption {text-align:center;font-size:10px;font-family:helvetica,sans-serif;font-weight:bold;}</style><title>A Lovely Picture</title></head><body bgcolor=#FFFFFF>");		write("<p align=center><img alt='' src=images/image");		write( imageNum);write(".jpg></p>");		write("</body></html>");	}} // OpenImagefunction MoreInfo(info, theTitle, isURL, theBase, width, height)/* Open a window with additional information presented in it.	 info:			string. The additional information to present or a URL to the page.	 theTitle: 	string. Document and window title. The WIndow title will have have spaces (e.g., "my title" -> "my-title")	 isURL:			boolean. If TRUE the string in INFO is a URL that points to a page to open.	 theBase:		string. If present it represents a base URL to use in the document being opened. Only	 						applies to documents where isURL is false.	 width:			integer. Window width. Default 640	 height:		integer. Window height. Defalt 480*/{	var theWindow;	var str;	var offset, wh, ww;	var userAgent = navigator.userAgent;	var theWindowTitle = new String(theTitle);		theWindowTitle = theWindowTitle.replace(/ /g, "_");	/*	if (userAgent.indexOf("Mozilla") >= 0) { offset = 20};	if (userAgent.indexOf("MSIE") >= 0) { offset = -10};	if (userAgent.indexOf("iCab") >= 0) { offset = -25};*/	wh = ( height != null ) ? height : 480 /* + offset */;	ww = ( width != null ) ? width : 640 /* + offset */;// Make sure the window will fit on the screen. If it won't shrink it down somewhat.	if ( screen.availWidth <= ww ) { ww = screen.availWidth * 0.9 };	if ( screen.availHeight <= wh ) { wh = screen.availHeight * 0.9 };	str = "toolbar=yes,resizable=yes,scrollbars=yes,height=" + wh + ",width=" + ww + ",outerheight=" + wh + ",outerwidth=" + ww;	if ( isURL == true ) {		theWindow = window.open(info, theWindowTitle, str);	} else {		theWIndow = window.open("", "MoreInfo", str);		with(theWIndow.document) {			write("<html><head><title>");write(theTitle);			write("</title>");			if ( theBase != null ) {				write("<base href=" + theBase + "</base>");			}			write("</head><body bgcolor=#FFFFFF>");			write(info);			write("<p></p><p align=center><a href='javascript:close()'>Close The Window</a></p></body></html>");		}	}}/*********************************************************************************																																								**	This file contains the strings that are used to provide the captions for the	** pictures for this trip. Each string is complete unto itself and therefore			** contains the text to dispaly as well as the necessary HTML code to generate		**	the hypertext link.																														**																																								**	The strings must be stored in an array called "captions". The Whilte the 			**	array is 0-based the funciton called to generate the HTML code for each pict-	**	ure expects the images to start at 1 (1-based).																**																																								** The function, MakeCaptions, will generate the proper code for either a trip		**	journal (diary) or trip photo gallery based on the supplied parameters.				**																																								*********************************************************************************/function MakeCaptions3(type, ids, day, alignment, maxPerRow, widthAsPercent, fudgeFactor, alwaysBreak)/* Return HTML code to display captions and hypertext links for the specified	 pictures.	 	 Added support for thumbnails of different widths and QuickTime movie thumbnails. --06/07/03	 	 type:				Required string. The type of code to genreate. The default action	 							is to generate code for a trip diary. However, you should supply	 							the proper string even if genreating diary code even though technically	 							an empty string would work.	 								"diary"			Generate trip diary code.	 								"gallery"		Generate trip photo gallery code.		ids:				Required string. A sequence of image reference IDs. Either a single image 								reference or a sequence of references can be specified. If the latter the								 sequence must take the form of "[starting reference]-[ending reference]"								 (e.g. "01-10"). The sequence is inclusive.		day:				Optional string. Required if generating code for a photo gallery page.								The value should corrospond to the day number that the pictures belong								too. 		alignment:	Optional string. Default is "right". Alignment of the captions/link text								relative to the image. 								Legal values:  "top", "below"																Note: if defaultAlignment is defined and alignment is not passed (e.g., is null)								defaultAlignment will override the built-in default value.		maxPerRow:	Optional integer. Default is 1. Specifies the maximun number of image/captions								that can be display per row. If a single image is passed the default behavior is								to not force a line break after the image. This can be overidden by setting								the "alwaysBreak" parameter to TRUE.																Note: if defaultMaxPerRow is defined and maxPerRow is not passed (e.g., is null)								defaultMaxPerRow will override the built-in default value.		widthAsPercent:																		Optional number. If supplied this overrides internal image-caption paragraph widths. The normal								behavior is to compute a paragraph width based on an image's thumb width (.thumbWidth) and then								add a small margin to that value. If the resulting value is too small a pre-defined (minParaWidth)								value is used. If, however, the widthAsPercent parameter is defined (1-99) then that value is used								to establish a width. The width will be recorded as an approximate pixel (px) value that must be at								least as large as the default width.										fudgeFactor:								Optional integer. To be used in combination with the WidthAsPercent paraemeter. 								Default value: 0.								When supplied it is assumed that it represents and additional width limiting factor. For example, if								MakeCaptions3 is called within a <DIV> that has left and right margins set at 10% and 15% the fudgeFactor								should be set to 25.		alwaysBreaK:								Optional Boolean. Default FALSE. When TRUE a line break after every row will be								appended. */{	var prefix, suffix, body;	var thumbID = new String("");	var anImage;																// The image object to retrieve	var tempArray = new Array(2);	var localIDs = new Array();	var linBreak = "";	var paraWidth;	var minParaWidth = 200;	var oldBrowser = false;		var imageObjectHead1 = "";	var newParaLine = 0;						// 1 when we want to force a new paragraph line regardless of FLOAT; else 0.	var newParaLineValue = new Array();	// values for newParaLine	var count = 1; 	var breakOnSecondNextPara = false;	var extraThumbCode;		newParaLineValue[0] = " ";	newParaLineValue[1] = " clear: both; ";	// compute main content width.	if ( document.getElementsByTagName ) {		theWidth = Math.min(document.getElementsByTagName("BODY")[0].offsetWidth, document.documentElement.offsetWidth) - 10;	} else {		if ( window.innerWidth) {			theWidth = window.innerWidth;		}	else {			theWidth = screen.width;					// worst case fallback			oldBrowser = true;		}	}	if ( fudgeFactor == null) { fudgeFactor = 0; }						if ( alignment == null ) {		if ( type == "diary") {			if ( defaultAlignment != null ) {				alignment = defaultAlignment;			} else {				alignment = "below";			}		} else {			alignment = "right";								// default alignment for a gallery.			widthAsPercent = 90;								// 90% width		}	}	if ( maxPerRow == null ) {		if ( defaultMaxPerRow != null ) {			maxPerRow = defaultMaxPerRow;		} else {			maxPerRow = 1;		}	}	if ( alwaysBreak == null) { alwaysBreak == false; }// add in any extra padding that's needed to deal padding-right issues with left/right alignment// decode the image reference sequence.	if ( typeof(ids) == "object" ) {		localIDs = ids;	} else {		tempStr = new String(ids);		tempArray = tempStr.split("-");				if ( !(isNaN (tempArray[0]) ) ) {			firstNum = 1 *(tempArray[0]);			if (tempArray.length == 2) {				lastNum = 1 * (tempArray[1]);			} else {				lastNum = firstNum;			}					for (i=0; i < (lastNum - firstNum) + 1; i++) {				localIDs[i] = firstNum + i;			}		} else {		// the thing being passed is not a number. Just assign the refernece.			localIDs[0] = tempArray[0];		}	}		body = ""; prefix = ""; suffix = "";  thumbMiddle = ""; 	thumbSuffix = ""; thumbPart = ""; paraHead = "";	// build thumbnail part.	bottomMargin = "";	if ( type == "gallery" ) {		bottomMargin = "margin-bottom: -0.25em; ";	}	imageObjectHead = "<p ";	imageObjectStyleHead = "style=' float: left; background-color: inherit; text-align: justify; " + bottomMargin;	imageObjectStyleHead += " padding-right: 5px; width: ";	imageObjectTail = "</p>";		thumbAnchorHead = "<a class=\"imagelink\" href=\"javascript:OpenImage1('";	thumbAnchorSuffix = ".jpg\"></a>";	if ( type == "gallery" ) {	// need to modify the imageObjectHead and tail		if ( oneBigDiary == true) {			if ( cssBased == true ) {			// BIG KLUDGE				imageObjectHead1 = "<a href='diary1.html#Day " + day + "'><img alt='' src='../target.jpg' border='0' height='21' width='60' align='left' alt='diary'></a><br>";			} else {				imageObjectHead1 = "<a href='diaryContent.html#Day " + day + "' target='content'><img alt='' src='../target.jpg' border='0' height='21' width='60' align='left' alt='diary'></a><br>";			}		} else {			imageObjectHead1 = "<a href='diary"+day+".html'><img alt='' src='../target.jpg' border='0' height='21' width='60' align='left' alt='diary'></a><br>";		}	}		for (i=0; i < localIDs.length; i++) {		if ( typeof(localIDs[i]) == "string") {			for (j=0; j < slides.length; j++) {				if ( slides[j].ref == localIDs[i]) {					anImage = slides[j];					break;				}			}		} else {			anImage = slides[ localIDs[i] - 1 ];		}//		tempStr = anImage.ref//		tempArray = tempStr.split(".");	// Determine extra code (i.e., display movie camera icon)		extraThumbCode = "";		if (anImage.objectType != ".jpg") {			extraThumbCode = "<img id=\"movie\" style=\"margin-left: 5px\" src=\"../movie.jpg\" width=16 height=15 alt=''>";		}	// If the image doesn't have a reference number - perhaps it's not associated with a picture, movie, or qtvr yet	// than skip it.		if ( anImage.ref == "" ) {		} else {			thumbID = anImage.ref;					// compute the width for an image/caption object.			imagePadding = Math.floor(anImage.thumbWidth / 10);			paraWidth = anImage.thumbWidth + ( Math.floor( imagePadding * 2 ) );		// min. width for the image-caption object.			paraWidth = ( paraWidth >= minParaWidth ) ? paraWidth : minParaWidth;			// make sure it's the minimum width for the object.			paraWidth = (anImage.link != "" ) ? anImage.thumbWidth + ( Math.floor( imagePadding * 2 ) ) : thumbWidth;		// min. width for the image-caption object.			paraWidth = ( paraWidth >= minParaWidth ) ? paraWidth : minParaWidth;			// make sure it's the minimum width for the object.			if ( type == "gallery" ) {	//			paraWidth += 75;			}						a = Math.floor(theWidth * (fudgeFactor/100));			if ( (oldBrowser) || ((navigator.userAgent.indexOf("MSIE") >= 0) && (navigator.appVersion.split(" ")[0] < 5)) ) {				 b = theWidth * 0.2;			} else {				b = 0;			}			imgMarginLeft = 0;																// 0 padding is the starting point.			if ( ( widthAsPercent != null) && ( ( widthAsPercent > 0) && ( widthAsPercent <= 99) ) ) {			// width is based on a percentage value. Same value regardless of alignment.				if ( (oldBrowser) || ((navigator.userAgent.indexOf("MSIE") >= 0) && (navigator.appVersion.split(" ")[0] < 5)) ){				// if using MSIE (mozilla 4 compatible) then offsetWidth = window width so adjust for it					tmp = (theWidth - a - b) * ( widthAsPercent / 100);				} else {				// using a real version 5 browser that we believe works properly (NS 7, KDHTML engine)					tmp = (theWidth - a) * ( widthAsPercent / 100 );				}				if ( type == "gallery" ) {	//				tmp += 75;				}				tmp = ( tmp > paraWidth) ? tmp : paraWidth;				paraWidth = Math.floor(tmp);				if ( (alignment == "below") || (alignment == "top") ) {				// only adjust the image's left "margin" for top/below alignment.					imgMarginLeft =  Math.floor(paraWidth / 2) - ( anImage.thumbWidth / 2);					imgMarginLeft = ( imgMarginLeft >= 0) ? imgMarginLeft + "px; ": 0 + "px; ";				}				totalWidth = paraWidth * maxPerRow;				paraWidth += "px; ";			} else {			// using default behavior.				if ( (alignment == "below") || (alignment == "top") ) {				// only adjust the image's left "margin" for top/below alignment.					imgMarginLeft =  Math.floor(paraWidth / 2) - ( anImage.thumbWidth / 2);					imgMarginLeft = ( imgMarginLeft >= 0) ? imgMarginLeft + "px; ": 0 + "px; ";				} else {				// alignment is "left" or "right" so we need to expand the paragraph width to allow for osme text					paraWidth = paraWidth * 2;					paraWidth = (paraWidth <= ( theWidth - b)) ? paraWidth : theWidth - b;				}				totalWidth = paraWidth * maxPerRow;				paraWidth += "px; ";			}				thumbMiddle = "')\"><img style=' padding-left:" + imgMarginLeft + "; padding-right:" + imgMarginLeft + "' alt=\"thumbnail\" src=\"thumbnails\/";			thumbMovieMiddle = "')\"><embed class=\"imagelink\" href='javascript:OpenImage1(\"" + anImage.ref + "\")' loop=true height=105 width=140 type='video/quicktime' style=' padding-left:" + imgMarginLeft + "; padding-right:" + imgMarginLeft + "' autoplay='true' width='" + anImage.thumbWidth +"' height='" + Math.floor((anImage.height *4) / 3) + "' controller='false' src='thumbnails/" + anImage.ref + ".mov' pluginspace='http://www.apple.com/quicktime/download' alt='thumbnail'>";			paraHead =  imageObjectHead + imageObjectStyleHead + paraWidth +  newParaLineValue[newParaLine] + "'>";			newParaLine = 0;			thumbPart = imageObjectHead1 + thumbAnchorHead + thumbID;			if (anImage.thumbType == "image") {				thumbPart += thumbMiddle + anImage.ref + thumbAnchorSuffix + extraThumbCode;			} else {				thumbPart += thumbMovieMiddle + "</a>" + extraThumbCode;			}			if ( alignment == "top" ) {				body += paraHead + "<span class=image>" + anImage.link + "</span><br>";				body += thumbPart;			}			if ( alignment == "below" ) {				body += paraHead + thumbPart + "<br>";				body += "<span class=image>" + anImage.link + "</span>";			}			if ( alignment == "right" ) {					body += paraHead + "<table><tr><td>" + thumbPart + "</td>";				body += "<td><span class=image>" + anImage.link + "</span></td></tr></table>";			}				if ( alignment == "left" ) {					body += paraHead + "<table><tr><td><span class=image>" + anImage.link + "</span></td>";				body += "<td>" + thumbPart + "</td></tr></table>";			}				body += imageObjectTail;			count = count + 1;						if ( breakOnSecondNextPara == true ) {				newParaLine = 1;				breakOnSecondNextPara = false;			}				if ( ( alwaysBreak == true ) && ( ( (i+1) % maxPerRow) == 0) ) {//					body += "<br clear=all style='clear: both'>";//					breakOnSecondNextPara = true;				} else if ( ( maxPerRow > 1 ) && ( ((i+1) != localIDs.length) && ( ( count % maxPerRow) == 0) )) {//					body += "<br clear=all>";					breakOnSecondNextPara = true;				}								if ( ( localIDs.length > 1)  && ( maxPerRow == 1) ) {//					body += "<br clear=all>";					breakOnSecondNextPara = true;				}			}	} // for loop	body = prefix + body + suffix;// Set a hard width in the enclosing DIVs style attributes. 	if ( (type =="gallery") && (document.getElementsByTagName) ) {		tmp = ( navigator.userAgent.indexOf("MSIE") >= 0) ? (totalWidth + (5 * maxPerRow * 2) + 25 + "px") : (totalWidth + (5 * maxPerRow) + "px"); 		document.getElementsByTagName("DIV")[ document.getElementsByTagName("DIV").length - 2 ].style.width = tmp; 	}	return body;} // MakeCaptions3function MakeCaptions1(type, ids, day, thumbs, caption)/* Return HTML code to display captions and hypertext links for the specified	 pictures.	 	 Added support for thumbnails of varous withs and QuickTime movie thumbnails. --06/07/03	 	 type:		Required string. The type of code to genreate. The default action	 					is to generate code for a trip diary. However, you should supply	 					the proper string even if genreating diary code even though technically	 					an empty string would work.	 						"diary"			Generate trip diary code.	 						"gallery"		Generate trip photo gallery code.		ids:		Required array. An array of numbers. Each number identifies the picture						and its associated caption to generate code for.		day:		Optional string. Required if generating code for a photo gallery page.						The value should corrospond to the day number that the pictures belong						too. 		thumbs:	Optional boolean. Default FALSE. If TRUE code will be generated to include						thumbnail images of the requested image within the caption string.		caption:	Optional Boolean. Default FALSE. If TRUE a CAPTION tag is created. This assumes							the MakeCaptions1 call was made within a table. The caption is the first string in the							IDs objects array. So, this is only applicable to single calls of the function.							It's a hack to save time. If the caption flag is TRUE it supersedes putting text next							to the image as is normally done.*/{	var extraThumbCode;	var prefix, suffix, body;	var thumbID = new String("");	var anImage;																// The image object to retrieve	var tempArray = new Array(2);	var localIDs = new Array();	if ( caption == null ) { caption = false };	if ( typeof(ids) == "object" ) {		localIDs = ids;	} else {		tempStr = new String(ids);		tempArray = tempStr.split("-");		var firstNum = 1 *(tempArray[0]);		var lastNum = 1 * (tempArray[1]);		for (i=0; i < (lastNum - firstNum) + 1; i++) {			localIDs[i] = firstNum + i;		}	}				body = ""; thumbPrefix = ""; thumbMiddle = ""; thumbSuffix = ""; thumbPart = "";	// assume trip journal	prefix = "<tr>"; suffix = "</td></tr>";	if ( thumbs == true ) {		if ( caption != true ) {			thumbPrefix = "<td style='padding-bottom: 0.5em;' valign=top><a class=\"imagelink\" href=\"javascript:OpenImage1('";			thumbMiddle = "')\"><img alt=\"thumbnail\" src=\"thumbnails\/";			thumbMovieMiddle = "')\"><embed class=\"imagelink\" loop=true height=105 width=140 type='video/quicktime' autoplay='true'  controller='false' pluginspace='http://www.apple.com/quicktime/download' alt='thumbnail' src=\"thumbnails\/";			thumbMovieMiddle1 = " href='javascript:OpenImage1(\"";			thumbEnd = "</td>";			thumbMovieSuffix1 = "\")'</a>";			thumbMovieSuffix = ".mov\" ";			thumbSuffix = ".jpg\"></a>";		} else {			thumbPrefix = "<td style='padding-bottom: 0.5em;' align=center valign=top><a class=\"imagelink\" href=\"javascript:OpenImage1('";			thumbMiddle = "')\"><img alt=\"thumbnail\" src=\"thumbnails\/";			thumbMovieMiddle = "')\"><embed class=\"imagelink\" loop=true height=105 width=140 type='video/quicktime' autoplay='true'  controller='false' pluginspace='http://www.apple.com/quicktime/download' alt='thumbnail' src=\"thumbnails\/";			thumbMovieMiddle1 = " href='javascript:OpenImage1(\"";			thumbEnd = "</td>";			thumbMovieSuffix1 = "\")'</a>";			thumbMovieSuffix = ".mov\" ";			thumbSuffix = ".jpg\"></a>";		}	}			if ( type == "gallery" ) {		if ( oneBigDiary == true) {			if ( cssBased == true ) {				prefix = "<tr><td valign=\"top\"><a href='diary1.html#Day " + day + "'><img alt='' src='../target.jpg' border='0' height='21' width='60' align='left' alt='diary'></a></td><td>";			} else {				prefix = "<tr><td valign=\"top\"><a href=\"diaryContent.html#Day "+day+"\" target=\"content\"><img alt='' src=\"../target.jpg\" border=\"0\" height=\"21\" width=\"60\" align=\"left\" alt=\"diary\"></a></td><td>";			}		} else {			prefix = "<tr><td valign=\"top\"><a href=\"diary"+day+".html\"><img alt='' src=\"../target.jpg\" border=\"0\" height=\"21\" width=\"60\" align=\"left\" alt=\"diary\"></a></td><td>";		}	}	for (i=0; i < localIDs.length; i++) {//		var tempStr = new String( localIDs[i] );//		anImage = slides[ tempStr.split(".")[0] - 1];			// The image object to retrieve	if ( typeof(localIDs[i]) == "string") {		for (j=0; j < slides.length; j++) {			if ( slides[j].ref == localIDs[i]) {				anImage = slides[j];				break;			}		} 	}else {		anImage = slides[ localIDs[i] - 1 ];	}		tempStr = anImage.ref;		tempArray = tempStr.split(".");	// If the image doesn't have a reference number - perhaps it's not associated with a picture, movie, or qtvr yet	// than skip it.		if ( anImage.ref == "" ) {			} else {				thumbID = anImage.ref;		//		if ( anImage.objectType != ".jpg") {	//			thumbID = tempArray[0];	//		}						if ( thumbs == true ) {	//			if ( thumbID < 10 ) {  if ( thumbID[0] != "0" thumbID = "0" + thumbID };				thumbPart = thumbPrefix + thumbID;				extraThumbCode = "";				if (anImage.objectType != ".jpg") {					extraThumbCode = "<img id=\"movie\" style=\"margin-left:5px\" src=\"../movie.jpg\" width=16 height=15 alt=''>";				}				if (anImage.thumbType == "image") {					thumbPart += thumbMiddle + anImage.ref + thumbSuffix + extraThumbCode + thumbEnd;				} else {					thumbPart += thumbMovieMiddle + anImage.ref + thumbMovieSuffix + thumbMovieMiddle1 + anImage.ref + thumbMovieSuffix1 + extraThumbCode + thumbEnd;				}			}			body += prefix + thumbPart;			if ( caption != true ) {				body += "<td style='padding-bottom: 0.5em;' valign=top>" + anImage.link + suffix;			}		}			if ( caption == true ) {			body = "<caption align=bottom class=image>" + slides[ localIDs[0] - 1 ].link + "</caption> " + body + "</tr>";		}	}	return body;} // MakeCaptions1function MakeCaptions(type, ids, day, thumbs)/* Return HTML code to display captions and hypertext links for the specified	 pictures.	 	 type:		Required string. The type of code to genreate. The default action	 					is to generate code for a trip diary. However, you should supply	 					the proper string even if genreating diary code even though technically	 					an empty string would work.	 						"diary"			Generate trip diary code.	 						"gallery"		Generate trip photo gallery code.		ids:		Required array. An array of numbers. Each number identifies the picture						and its associated caption to generate code for.		day:		Optional string. Required if generating code for a photo gallery page.						The value should corrospond to the day number that the pictures belong						too. 		thumbs:	Optional boolean. Default FALSE. If TRUE code will be generated to include						thumbnail images of the requested image within the caption string.*/{	var prefix, suffix, body;		body = ""; thumbPrefix = ""; thumbMiddle = ""; thumbSuffix = ""; thumbID = ""; thumbPart = "";	// assume trip journal	prefix = "<tr>"; suffix = "</td></tr>";	if ( thumbs == true ) {		thumbPrefix = "<td valign=top><a class=\"imagelink\" href=\"javascript:OpenImage('";		thumbMiddle = "')\"><img alt=\"thumbnail\" src=\"thumbnails\/image";		thumbSuffix = ".jpg\"></a></td>";	}			if ( type == "gallery" ) {		prefix = "<tr><td valign=\"top\"><a href=\"diaryContent.html#Day "+day+"\" target=\"content\"><img alt='' src=\"../target.jpg\" border=\"0\" height=\"21\" width=\"60\" align=\"left\" alt=\"diary\"></a></td><td>";	}	for (i=0; i < ids.length; i++) {		if ( thumbs == true ) {			thumbID = ids[i];			if ( thumbID < 10 ) { thumbID = "0" + thumbID };			thumbPart = thumbPrefix + thumbID + thumbMiddle + thumbID + thumbSuffix;		}		body += prefix + thumbPart + "<td valign=top>" + captions[ ids[i] - 1] + suffix;	}		return body;}function SetActiveStyleSheet(title) {   var i, a;   for(i=0; ( a = document.getElementsByTagName("link")[i]); i++) {     if(a.getAttribute("rel").indexOf("style") != -1        && a.getAttribute("title")) {       a.disabled = true;       if(a.getAttribute("title") == title) a.disabled = false;     }   }} // MakeCaptions/****************************************************************************************************************************//*																													Slide Show Routes																								*//****************************************************************************************************************************/var kFadeInterval = 5;							// Interval, in milliseconds, between fade-in(out) actions - that is increase/decrease of opacity.var kFudgeFactor = 25;							// a fudge factor for use in sizing widths.var kMaxOpacity = 5;								// The number of steps between 0 and 100 to use for incrementing (decrementing) the opacity value.var kMinCaptionWidth = 130;					// The min size - more or less - we'll except for the caption and footer objects.var kMinFooterWidth = 140;					// Min footer/pageEnd widthvar gDoEffects = false;							// TRUE when we want to run effects; FALSE otherwisevar gCanFadeIn = false;							// TRUE when fading in is to happen; FALSE otherwisevar gCurrentSlide = 0;							// current slide.var gWindowWidth, gWindowHeight;var gOpacityCount = 0;							// Runs from 0 to kMaxOpacity for changing opacity in kMaxOpacity steps in incrments of 0.5 (5%).var gTimer;function SetOpacity(objectID, value)/* Set the opacity value (from value) of the HTML element identified by objectID.	 objectID:	String. ID of an HTML object.	 value:			integer from 0 to 100 (though this will be changed to a fraction from 0 to 1 for non-IE browsers).*/{	var theObject = document.getElementById(objectID);	if (theObject.style) {		theObject.style.opacity = ( value / 100 );										// CSS3 compatible browsers		theObject.style.MozOpacity = ( value / 100 );									// for Mozilla		theObject.style.filter = "alpha(opacity=" + value + ")";		// for MSIE 	}} // SetOpacityfunction ChangeOpacity(objectID) {/* Called to change the opacity of the object with ID referenced in "objectID". 	 This function is called repeated by setInterval (establsiehd from FadeIn() ) until the opacity reaches 100 at which time the	 interval call is cleared.	 	 objectID: 	string. An HTML ID that refernces a specific object.*/	SetOpacity(objectID, (gOpacityCount * (100 / kMaxOpacity) ) );	if ( gOpacityCount < kMaxOpacity ) {		gOpacityCount++;	} else {		clearInterval(gTimer);	}} // ChangeOpacityfunction SetupFadeIn(sourceID, finishID, containerID)/* Set up the fade in.	 sourceID:		strong. HTML object ID that references the image to fade from.	 finishID:		string. HTML object ID that references the image to fade to.	 containerID:	string. HTML object ID that references the object that contains the sourceID and finishID objects.*/{	var backgroundImageObj = document.getElementById(sourceID);	var imageObj = document.getElementById(finishID);	var imageContainerObj = document.getElementById(containerID);		SetOpacity(finishID, 0);	imageObj.style.display = "block";	with (backgroundImageObj) {		src =  imageObj.src;		style.width = imageContainerObj.style.width;					// set width to the width of the about-to-show image		style.height = imageContainerObj.style.height;				// set hieght to the height of the about-to-show image.		style.display = "block";	}	gCanFadeIn = true;} // SetupFadeInfunction FadeIn(sourceID, finishID, containerID)/* Fade the overlaying image held in "finishID" into view. This is done by increasing the opacity value of the image referenced by	 "finishID". The image in "finishID" slowly covers the background image that has been established in the object referenced by	 "soourceID"	 sourceID:		string. HTML object ID that references the background image (what we fade from).	 finishID:		string. HTML object ID that references the image we are fading to.	 containerID:	string. HTML object ID that references the object that contains tsourceID and finishID images*/{	gOpacityCount = 0;	document.getElementById(finishID).style.display = "block";		// make sure it's visible.	gTimer = window.setInterval("ChangeOpacity('" + finishID + "')", kFadeInterval);} // FadeInfunction EffectsOnOff ()/* Turn visual effects, the fade-ins, on and off. Default is off. */{	gDoEffects = !(gDoEffects);	document.getElementById("effectsonoffbutton").innerHTML = ( gDoEffects) ? "Effects off" : "Effects on";	if ( gDoEffects ) {		SetupFadeIn("theslidebackground", "theslide", "slide_div");		gCanFadeIn = true;	} else {		gCanFadeIn = false;		document.getElementById("theslidebackground").style.display = "none";	}} // EffectsOnOfffunction GetWindowWidthAndHeight()/* Return window width and height (or maybe document width and height in IE which would give odd results). I really want the viewable	 region - the viewport width and height.	 	 Returns an object with properties "width" and "height" which are both integers.*/{	var x,y;	if ( self.innerHeight ) { // all except Explorer		x = self.innerWidth;		y = self.innerHeight;	} else  // Explorer 6 Strict Mode		if ( document.documentElement && document.documentElement.clientHeight ) {			x = document.documentElement.clientWidth;			y = document.documentElement.clientHeight;		}  else { // other Explorers		if ( document.body ) {			x = document.body.clientWidth;			y = document.body.clientHeight;		}	}		this.width = x;	this.height = y;	return this;} // GetWindowWidthAndHeightfunction SaveObjectSizes()/* Establsh object sizes which will be stored in the gWindowWithd and gWindowHeight global variables. 	 useSlideDiv:		Boolean. Optional. Default is true.*/{	var temp;// compute main content width.	gWindowWidth = GetWindowWidthAndHeight().width;	gWindowHeight = GetWindowWidthAndHeight().height;		// Figure out the max width the slide container can have. If we can't get a precise value then guess using 130./*	temp = document.getElementById("caption_div").offsetWidth;	if ( temp) {		gWindowWidth = gWindowWidth - (temp + 5);	} else {		gWindowWidth = gWindowWidth - 7;	}*/	gWindowWidth = gWindowWidth - (kFudgeFactor + kMinFooterWidth);	// Figure out the max height the slide container can have. If we can't get a precise value then guess using 100.	temp = document.getElementById("slide_div").offsetTop;	if ( temp ) {		gWindowHeight = gWindowHeight - (temp + 12 + 5);	} else {		gWindowHeight = gWindowHeight - 100;	}} // SaveObjectSizesfunction ImageResize() /* Called in response to an document resizing event.  */{	var temp = gDoEffects;	var temp1 = document.getElementById("theslidebackground").style.display;		if ( gDoEffects )	{		document.getElementById("theslidebackground").style.display = "block";		gDoEffects = false;	}	gDoEffects = false;	SaveObjectSizes();	gWindowRatio = ComputeImageToWindowRatio(defaultSlideWidth, defaultSlideHeight);	DisplaySlide(gCurrentSlide);	gDoEffects = temp;	document.getElementById("theslidebackground").style.display = temp1;} // ImageResizefunction ComputeImageToWindowRatio(imageWidth, imageHeight)/* Figure out the windowRatio that will be used to potentially shrink the slide container.	 imageWidth, imageHeight:		Integer. Thw width and height of an image.*/{	wRatio = Math.floor( 100 * (gWindowWidth / imageWidth) ) / 100;			// ratio of widths of the slide object (based on window width) width versus the slide (image) width	hRatio = Math.floor( 100 * (gWindowHeight / imageHeight) ) / 100;		// ratio of heights of the slide object (based on windowheight) height versus the slide (image) height	wRatio = ( wRatio > 1 ) ? 1 : wRatio;		// If >= 1 then the window can contain the slide's width	hRatio = ( hRatio > 1 ) ? 1 : hRatio;		// If >= 1 then the window can contain the slide's height		if ( (wRatio == 1) && (hRatio == 1) ) {		return wRatio;	} else {	// Use the smaller ratio to ensure the image can completely fit.		return Math.min(wRatio, hRatio);	}} // ComputeImageToWindowRatiofunction SetContainerSizes(ratio, width, height)/* Set the sizes for the slide and caption objects. */{	var imageObj = document.getElementById("slide_div");	var captionObj = document.getElementById("caption_div");	var tempWidth = Math.floor(width * ratio);		imageObj.style.height = Math.floor(height * ratio) + "px";	imageObj.style.width = tempWidth + "px";	captionObj.style.width = ( GetWindowWidthAndHeight().width - ( tempWidth + kFudgeFactor )) + "px";	document.getElementById("footer").style.margin = "0px";	document.getElementById("pageEnd").style.position = "absolute";	document.getElementById("footer").style.position = "absolute";	document.getElementById("pageEnd").style.clear = "none";	document.getElementById("pageEnd").style.width =  ( GetWindowWidthAndHeight().width - ( tempWidth +  10)) + "px"; 	document.getElementById("footer").style.width = ( GetWindowWidthAndHeight().width - ( tempWidth  + 10)) + "px";	document.getElementById("pageEnd").style.left = tempWidth + 3  + "px";	document.getElementById("footer").style.left = tempWidth  + 3 + "px";	document.getElementById("pageEnd").style.top = (captionObj.offsetHeight + captionObj.offsetTop + 5) + "px";	document.getElementById("footer").style.top = (document.getElementById("pageEnd").offsetHeight + document.getElementById("pageEnd").offsetTop ) + "px";} // SetContainerSizesfunction SetupSlideShowPage(slideshowTitle)/* This function takes the display window and adjusts the size of the slide container and the caption container to 	 best fit the current display window. The function is only called once.	 	 slideShowTitle:	string. Title of slide show.*/{	var newMenuCodeHead = "<form action='' method='get'> \		<select name='GotoSlide' onChange='DisplaySlide(this.options[this.selectedIndex].value);this.selectedIndex=0;'> \			<option value=0>Go To</option>\r";	var newMenuCodeEnd = "</select></form>";	gCurrentSlide = 0;	SaveObjectSizes();	gWindowRatio = ComputeImageToWindowRatio(defaultSlideWidth, defaultSlideHeight);	with (document) {		getElementById("trip").style.margin = "2px";		getElementById("photo_container").style.display = "none";		getElementById("slideshow_container").style.display = "block";		getElementById("slideshowtitle").innerHTML = slideshowTitle;		getElementById("prevpagelink").href= "javascript:PreviousSlide()";		getElementById("nextpagelink").href= "javascript:NextSlide()";				// Now build the slide show menu.		for (i = 0; i < slides.length; i++ ) {			if ( slides[i].ref != "") {				newMenuCodeHead = newMenuCodeHead + "<option value=" + (i) + ">" + (i + 1) + "</caption>\r";			}		}		getElementById("slidemenu").innerHTML = newMenuCodeHead + newMenuCodeEnd;			getElementById("theslideinfo").style.display = "block";	}	// Now capture resize events. 	if ( window.captureEvents ) {		window.captureEvents(Event.RESIZE);		window.onresize = ImageResize;	}	DisplaySlide(gCurrentSlide);} // SetupSlideShowPagefunction GetSlide(slideID)/* Return the slide to work with. If the reference passed in slideID is not found return the first slide object.	 returns a slide object.*/{	var theImage =  -1;/*	for (i=0; i < slides.length; i++) {		if ( slides[i].ref == slideID) {			theImage = slides[i];			break;		}	}	if ( theImage == -1 ) {		theImage = slides[0];	}*/	if ( slides[slideID].ref == "") {		theImage = slides[gCurrentSlide];	} else {		gCurrentSlide = slideID;		theImage = slides[slideID];	}		return theImage;} // GetSlidefunction DisplaySlide(slideID)/* Display the current slide and associated caption.	 slideID: Integer. The ID for the slide to display. */{	var imageContainerObj = document.getElementById("slide_div");	var backgroundImageObj = document.getElementById("theslidebackground");	var imageObj = document.getElementById("theslide");	var imageLinkObj = document.getElementById("theslidelink");	var captionObj = document.getElementById("thecaption");	// Get the referenced image	gCurrentSlide = slideID;	var theImage = GetSlide(slideID);	var windowRatio = ComputeImageToWindowRatio(theImage.width, theImage.height);	var imageSourceName = ( theImage.objectType == ".jpg" ) ? "images/" + theImage.ref + ".jpg" : "../showing-a-movie.jpg";		SetContainerSizes(windowRatio, theImage.width, theImage.height);	if ( gDoEffects && gCanFadeIn ) {		SetupFadeIn("theslidebackground", "theslide", "slide_div");	}	if ( theImage.objectType == ".jpg" ) {		// Is it a picture?		if (gDoEffects) {			imageObj.style.display = "none";			// Don't show full opacity object as it loads in.		}		imageObj.src = imageSourceName; 		imageObj.style.height = imageContainerObj.style.height;		imageObj.style.width = imageContainerObj.style.width;		imageObj.alt = "the slide";	} else {		// It's not a picture, but a QT movie or QTVR pano.			if (gDoEffects) {			imageObj.style.display = "none";			// Don't show full opacity object as it loads in.		}		imageObj.alt = "Click me to view the " + theImage.objectType;		imageObj.src = imageSourceName; 		imageObj.width = 300;		imageObj.height = 300;		imageObj.style.height = "300px";		imageObj.style.width = "300px";	}	imageLinkObj.href = "javascript:OpenImage1('" + theImage.ref + "')";						// Create Link to full-size image/movie	document.getElementById("scalenumber").innerHTML = Math.round( (100 * windowRatio) );	document.getElementById("actualslidenumber").innerHTML = theImage.ref + " of " + slides.length;		// Fill in slide number info	captionObj.innerHTML = theImage.caption;																				// Provide caption.	if ( document.getElementById("caption_div").scrollTop ) {		document.getElementById("caption_div").scrollTop = 0;		document.getElementById("caption_div").scrollLeft = 0;	}	if ( gDoEffects ) {		if (gCanFadeIn) {			FadeIn("theslidebackground", "theslide", "slide_div");							// Fade the new image into view.		} else {								// An image has been displayed and so gCanFadeIn can be set to true and we can start fasdes			gCanFadeIn = true;			imageObj.style.display = "block";		}	}} // DisplaySlidefunction NextSlide()/* Display the next slide. */{	gCurrentSlide++;	if ( gCurrentSlide > slides.length ) {		gCurrentSlide = 0;		// wrap-around slides	}// Definite hack to skip blank image. Assumes just one blank. Not smart at all.	if ( slides[gCurrentSlide].ref == "") {		gCurrentSlide++	}	var theImage = GetSlide( gCurrentSlide );	/*	// If the requested slide is not an actual slide then find the next slide (non-slides are "movie" and "pano")	if (theImage.objectType != ".jpg") {		for (i=gCurrentSlide; i < slides.length; i++ ) {			theImage = GetSlide(i);				if (theImage.objectType == ".jpg") {					gCurrentSlide = i;					break;				}			}		}*/		//	clearInterval	DisplaySlide(gCurrentSlide);//	gSlideTimer = setInterval("NextSlide()", 6000);} // NextSlidefunction PreviousSlide()/* Display the previous slide. */{	gCurrentSlide--;	if ( gCurrentSlide < 0 ) {		gCurrentSlide = slides.length - 1;		// wrap-around slides	}// Definite hack to skip blank image. Assumes just one blank. Not smart at all.	if ( slides[gCurrentSlide].ref == "") {		gCurrentSlide++	}	var theImage = GetSlide(gCurrentSlide);	/*	// If the requested slide is not an actual slide then find the next slide (non-slides are "movie" and "pano")	if (theImage.objectType != ".jpg") {		for (i=gCurrentSlide; i < slides.length; i++ ) {			theImage = GetSlide(i);				if (theImage.objectType == ".jpg") {					gCurrentSlide = i;					break;				}			}		}*/	DisplaySlide(gCurrentSlide);//	gSlideTimer = setInterval("PreviousSlide()", 6000);} // PreviousSlidefunction MakeTitles(titleNum)/* Create the titles line.  Used in documentst that are single-day related but may havemultiple items. E.g., Michigan_Dayhikes/glh2004/ files.   titleNum:	integer, index into tht titles array that notes the elemt that does not get a hyperlink.*/{	var str = "";	var result = "";	var indexSuffix = "";	titleSuffix = " | ";	for (i = 0; i < titles.length; i++ ) {		if ( i != 0 ) {			indexSuffix = i + 1;		}		if ( i == ( titles.length - 1 ) ) {			titleSuffix = "";		}		if ( i != titleNum ) {			str = "<a href=\"index" + indexSuffix + ".html\">" + titles[i] + "</a>" + titleSuffix;		} else {			str = titles[i] + titleSuffix;		}		result = result + str;	}	return result;} // MakeTitlesfunction AddRelatedLinks()/* Build related links list, if any exists. The function uses the RelatedLinks	 that must be defined in theCaptions.js.*/{	var str = "";	var titleSuffix = "";	if (( relatedLinks ) && ( relatedLinks.length > 0 ) ) {		str = "<div id='relatedLinks' ><p style='font-weight: bold; margin-left: 0;margin-top: 0.25em'>Related Pages (hardly exhaustive):</p><p style='margin-left: 0.75em; '>";		for (i = 0; i < relatedLinks.length; i++ ) {			if ( i == ( relatedLinks.length - 1 ) ) {				titleSuffix = "";			}			str = str + relatedLinks[i] + titleSuffix;		}		str = str + "</p></div>";	}	return str;} AddRelatedLinksfunction AddRelatedLinksTableVersion()/* Build related links list, if any exists. The function uses the RelatedLinks	 that must be defined in theCaptions.js.*/{	var str = "";	var titleSuffix = "";	if (( relatedLinks ) && ( relatedLinks.length > 0 ) ) {		str = "<div id='relatedLinks' ><p style='font-weight: bold; margin-left: 0;margin-top: 0.25em'>Related Pages (hardly exhaustive):</p><div style='margin-left: 0.75em; '>";		for (i = 0; i < relatedLinks.length; i++ ) {			if ( i == ( relatedLinks.length - 1 ) ) {				titleSuffix = "";			}			if ( ( i % 3) == 0 ) {				str = str + "<p style=''><span style=\"padding: 3px; width: 30%; display: table-cell\">" + relatedLinks[i] + titleSuffix + "</span>";			} else {				if ( ( i % 3) == 1 ) { 					str = str + "<span style=\"width: 30%; padding: 3px; display: table-cell\">" + relatedLinks[i] + titleSuffix + "</span>";				} else {					str = str + "<span style=\"padding: 3px; width: 30%; display: table-cell\">" + relatedLinks[i] + titleSuffix + "</span></p>";				}			}		}		if ( (relatedLinks.length % 3) != 0 ) {			str = str + "</p>";		}		str = str + "</div></div>";	}	return str;} AddRelatedLinksTableVersionfunction OpenLightbox() {	var div = this.parentNode.parentNode;				// enlcosing inilne_image-* DIV element	var img = this.getElementsByTagName('img')[0];			var theText = this.parentNode.innerText || this.parentNode.textContent;	var lightbox = document.getElementById("lightbox");	lightbox.innerHTML = "<div  style='text-align: left; padding-left: 1em; padding-right: 1em' ><span style='font-size: 66%; padding: 1px; margin:0px;  margin-left: -0.9em;  color: white; border: outset 2px white; cursor: pointer' onclick='CloseLightbox()'>Close</span><span style='font-size: 66%; padding: 1px; margin-top: 0; margin-bottom: 0; margin-left: 4px; font-style: italic;  color: white; border: outset 2px white; cursor: pointer' onclick='ToggleInfo();return true'>i</span><div><div id='info' style=' z-index: 96; display: none;  position: absolute; color: white; background-color: gray '><p id='infotext'>"+theText+"</p></div><p style='margin: 0; margin-top: 3px; padding: 0; color:white;'><img onload=\"LightboxImageFinishedLoading(this)\" id=\"lightboximage\"  src=\"\"   alt=\"\" smallWidth=\""+img.width+"\" largeWidth=\""+img.largeWidth+"\" largeHeight=\""+img.largeHeight+"\" smallHeight=\""+img.height+"\"  ></p></div></div>";	document.getElementById("lightboximage").src = img.largeSrc;	lightbox.style.width = Math.min(32 + img.largeWidth, GetObjectWidthAndHeight(window).width - 32 )+ "px";	lightbox.style.height = Math.min(32 + img.largeHeight, GetObjectWidthAndHeight(window).height - 32 )+ "px";	lightbox.style.top = Math.max(0, parseInt((GetObjectWidthAndHeight(window).height / 2) - (img.largeHeight / 2)));	lightbox.style.left = Math.max(0, parseInt((GetObjectWidthAndHeight(window).width / 2) - (img.largeWidth / 2)));	var p = position(img);	with (document.getElementById("loadData")) {		style.left = p.x;		style.top = p.y;		style.display="block";	}	return false;} // OpenLightboxfunction position(el)	{	var p = { x: el.offsetLeft, y: el.offsetTop };	while (el.offsetParent)	{		el = el.offsetParent;		p.x += el.offsetLeft;		p.y += el.offsetTop;		if (el != document.body && el != document.documentElement) {			p.x -= el.scrollLeft;			p.y -= el.scrollTop;		}	}	return p;} // positionfunction LightboxImageFinishedLoading(img) {	var width = document.getElementById("lightboximage").getAttribute("largewidth");	var height = document.getElementById("lightboximage").getAttribute("largeheight");		document.getElementById("loadData").style.display = "none";//	document.getElementById("lightbox").style.width = (32+width) + "px";//	document.getElementById("lightbox").style.height = (32+height) + "px";	document.getElementById("lightbox").style.display = "block";//	document.getElementById("lightbox").style.top = parseInt( (GetObjectWidthAndHeight(window).height / 2) - (height / 2));//	document.getElementById("lightbox").style.left = parseInt( (GetObjectWidthAndHeight(window).width / 2) - (width / 2));	document.getElementById("info").style.width = width;	SetOpacity("info", 75);	SetOpacity("container", 60);} // LightboxImageFinishedLoadingfunction CloseLightbox() {	lightbox.style.display = "none";	SetOpacity("container", 100);	return true;} // CloseLightboxfunction GetObjectWidthAndHeight(theObject)/* Return  width and height of theObject.(or maybe document width and height in IE which would give odd results). 	I really want the viewable region - the viewport width and height.	 	 Returns an object with properties "width" and "height" which are both integers.*/{	var x,y;	if ( theObject.innerHeight ) { // all except Explorer		this.width = theObject.innerWidth;		this.height = theObject.innerHeight;		return this;	} 	if (theObject.offsetHeight) {		this.width = theObject.offsetWidth;		this.height = theObject.offsetHeight;		return this;	}		if ( document.documentElement && document.documentElement.clientHeight ) {			x = document.documentElement.clientWidth;			y = document.documentElement.clientHeight;		}  else { // other Explorers			if ( document.body ) {				x = document.body.clientWidth;				y = document.body.clientHeight;			}		}		this.width = x;	this.height = y;	return this;} // GetObjectWidthAndHeightfunction ToggleInfo() {// Show/Hide info for photo	gInfoVisible = !gInfoVisible;	document.getElementById("info").style.display = (gInfoVisible == true ) ? "block" : "none";	return false;	} // ToggleInfo