function MM_preloadImages() { //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_swapImgRestore() { //v3.0  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}function MM_findObj(n, d) { //v4.01  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}function MM_swapImage() { //v3.0  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}function toggleSection(sectionName){    var elementHnd;    elementHnd = document.getElementById(sectionName + "Section");    imageHnd = document.images[sectionName + "Arrow"];    if (elementHnd)    {        if (elementHnd.style.display == "none")        {            elementHnd.style.display = "";            if (imageHnd)            {                imageHnd.src = "/images/arrow_open.gif";            }        }        else        {            elementHnd.style.display = "none";            if (imageHnd)            {                imageHnd.src = "/images/arrow_closed.gif";            }        }    }}var imageArray = new Array();imageArray.push("afternoonShower|Afternoon Shower");imageArray.push("algaeOnTheRocks|Algae On The Rocks");imageArray.push("ancientEyes|Ancient Eyes");imageArray.push("aStudyInSpeed|A Study In Speed");imageArray.push("aStudyInTexture|A Study In Texture");imageArray.push("aTreeApart|A Tree Apart");imageArray.push("beachAbstraction|Beach Abstraction");imageArray.push("boatyard|Boatyard");imageArray.push("buntzenFog|Buntzen Fog");imageArray.push("buntzenWinter|Christmas Frost");imageArray.push("desertMoonrise|Desert Moonrise");imageArray.push("fishingAtSunset|Fishing at Sunset");imageArray.push("flowerInDetail|Flower in Detail");imageArray.push("forestPath|Forest Path");imageArray.push("galianoSunset|Galiano Sunset");imageArray.push("granvilleIsland|Granville Island");imageArray.push("greenLakeInRed|Green Lake in Red");imageArray.push("heavenlyLight|Heavenly Light");imageArray.push("juanDeFucaSunset|Juan de Fuca Sunset");imageArray.push("leavesEnjoined|Leaves Enjoined");imageArray.push("liquidSun|Liquid Sun");imageArray.push("nightOcean|Night Ocean");imageArray.push("nightWalk1|Night Walk 1");imageArray.push("nightWalk2|Night Walk 2");imageArray.push("oceanView|Ocean View");imageArray.push("pacificShore|Pacific Shore");imageArray.push("ripples|Ripples");imageArray.push("shipwreck|Shipwreck");imageArray.push("snowyOutlook|Snowy Outlook");imageArray.push("surfAndSand|Surf and Sand");imageArray.push("treeMoss|Tree Moss");imageArray.push("viewTowardsTheSky|View Towards the Sky");imageArray.push("whiteLanding|White Landing");imageArray.push("wildWest|Wild West");imageArray.push("winterInVancouver|Winter in Vancouver");function getQueryString(){	var queryString = document.location.search.substring(1);	var queryStringArray = new Array();	if (queryString != "") {		queryStringArray = queryString.split("&");		currentIndex = queryStringArray[0].split("=")[1];		currentPage = queryStringArray[1].split("=")[1];		generateMenu(currentIndex,currentPage);	} else {		generateMenu(1,0);	}}function buildQueryString(index,page){	return "?currentIndex=" + index + "&currentPage=" + page;}function generateMenu(currentIndex, currentPage){	var outputString = "";	var numPreviousImages = 0;	var numNextImages = 0;	var numPerPage = 6;	var startImage = currentPage * numPerPage;	var endImage = currentPage * numPerPage + numPerPage - 1;	var numPages = Math.ceil(imageArray.length / numPerPage);	// Check end condition if the last page is only partially filled	if (endImage >= imageArray.length) {		endImage = imageArray.length - 1;	}		// Check to see if there are images before the ones being displayed	if ((imageArray.length > numPerPage) && (currentPage > 0)) {		numPreviousImages = numPerPage;	}		// Check to see if there are images after the ones being displayed	var imagesAlreadyShown = (parseInt(currentPage)+1) * numPerPage;//	alert(currentPage + ":" + numPerPage);//	alert(imagesAlreadyShown);	numNextImages = imageArray.length - imagesAlreadyShown;	if (numNextImages > numPerPage)	{		numNextImages = numPerPage;	} else if (numNextImages > 0) {		;	} else {		numNextImages = 0;	}		outputString += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td height=\"" + (60*numPerPage) + "\" valign=\"top\">";	outputString += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";	for (var i=startImage;i<=endImage;i++)	{		pageName = imageArray[i].split("|")[0];		pageDescription = imageArray[i].split("|")[1];		outputString += "<tr>";		if (i == currentIndex) {			outputString += "<td><img src=\"/photography/images/" + pageName + "_off.jpg\" alt=\"\" name=\"" + pageName + "\" width=\"50\" height=\"50\" border=\"0\" id=\"" + pageName + "\" /></a></td>";		} else {			outputString += "<td><a href=\"/photography/" + pageName + ".shtml" + buildQueryString(i,currentPage) + "\" onMouseOver=\"MM_swapImage('" + pageName + "','','/photography/images/" + pageName + "_over.jpg',1)\" onMouseOut=\"MM_swapImgRestore()\">";			outputString += "<img src=\"/photography/images/" + pageName + "_off.jpg\" alt=\"\" name=\"" + pageName + "\" width=\"50\" height=\"50\" border=\"0\" id=\"" + pageName + "\" /></a></td>";		}		outputString += "<td><img src=\"/images/spacer.gif\" width=\"8\" height=\"1\" alt=\"\" /></td>";		if (i == currentIndex)	{			outputString += "<td style=\"font-weight:bold;\" class=\"annotationText\">" + pageDescription + "</td>";		} else {			outputString += "<td class=\"annotationText\"><a href=\"/photography/" + pageName + ".shtml" + buildQueryString(i,currentPage) + "\" onMouseOver=\"MM_swapImage('" + pageName + "','','/photography/images/" + pageName + "_over.jpg',1)\" onMouseOut=\"MM_swapImgRestore()\">" + pageDescription + "</a></td>";		}		outputString += "</tr><tr>";		outputString += "<td colspan=\"3\"><img src=\"/images/spacer.gif\" width=\"1\" height=\"10\" alt=\"\" /></td>";		outputString += "</tr>";	}	outputString += "</table>";	outputString += "</td></tr></table>";	outputString += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"140\">";	outputString += "<tr>";	if (numPreviousImages > 0) {		outputString += "<td class=\"annotationText\"><a href=\"javascript:generateMenu(" + currentIndex + ", " + (currentPage - 1) + ");\"><img src=\"/images/icon_leftArrowActive.gif\" width=\"4\" height=\"7\" alt=\"\" border=\"0\" />&nbsp;Previous</a>&nbsp;&nbsp;</td>";	} else {		outputString += "<td class=\"annotationText\"><img src=\"/images/icon_leftArrowInactive.gif\" width=\"4\" height=\"7\" alt=\"\" border=\"0\" />&nbsp;Previous&nbsp;&nbsp;</td>";	}		outputString += "<td class=\"annotationText\">&nbsp;" + (parseInt(currentPage) + 1) + "/" + numPages + "&nbsp;</td>";	if (numNextImages > 0) {		outputString += "<td align=\"right\" class=\"annotationText\">&nbsp;&nbsp;<a href=\"javascript:generateMenu(" + currentIndex + ", " + (parseInt(currentPage) + parseInt(1)) + ");\">Next&nbsp;<img src=\"/images/icon_rightArrowActive.gif\" width=\"4\" height=\"7\" alt=\"\" border=\"0\" /></a></td>";	} else {		outputString += "<td align=\"right\" class=\"annotationText\">&nbsp;&nbsp;Next&nbsp;<img src=\"/images/icon_rightArrowInactive.gif\" width=\"4\" height=\"7\" alt=\"\" border=\"0\" /></td>";	}	outputString += "</tr>";//	outputString += "<tr><td class=\"annotationText\" align=\"center\" colspan=\"3\" class=\"bodyText\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";//	for (var i=0;i<=numPages-1;i++)//	{//		if (i == (parseInt(currentPage))) {//			outputString += "<b>&lt;" + (i+1) + "&gt;</b>&nbsp;";//		} else {//			outputString += "<a href=\"javascript:generateMenu(" + currentIndex + ", " + i + ");\">" + (i+1) + "</a>&nbsp;";//		}//	}//	outputString += "</td></tr>";		// Insert the html into the page	if (document.getElementById) {		document.getElementById("photoMenu").innerHTML = outputString;	}}