<!--
function imgSwap(d,id,i){
	document.getElementById(id).src= d + "images/" + i;
}

function buildDimmerDiv(){			
		//document.getElementById('dimmer-wrap').innerHTML = "&nbsp;";
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		//	alert("window.innerHeight: "+ window.innerHeight +"\nwindow.scrollMaxY: "+ window.scrollMaxY +"\n_______________\nScroll Height: "+ (window.innerHeight + window.scrollMaxY) );
			
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;

		}
		
		//alert("yScroll: "+ yScroll);
		
		var windowWidth, windowHeight;
		if (self.innerHeight) {	// all except Explorer
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		//	alert("windowHeight: "+ windowHeight);
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}			
		
	//	windowHeight = 300
	//	windowWidth = 300
		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		//	alert("scroll is less than window");
		} else { 
			pageHeight = yScroll;
		//	alert("scroll is greater than window");
		}	
		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){	
			pageWidth = windowWidth;
		} else {
			pageWidth = xScroll;
		}	
		
//		try{
//			document.getElementById('dimmer').style.width = 0;	
//			document.getElementById('dimmer').style.height = 0;	
//		}
//		catch(error){
//			alert("here!");	
//		}
		if(!document.getElementById('dimmer')){
			//	alert("no dimmer!");	
			//this works but don't know how useful it is...
			//document.getElementById('dimmer').style.width = 0;	
			//document.getElementById('dimmer').style.height = 0;
			//clearDimmerSize()
		}
		//alert("pageWidth: "+ pageWidth +"\nPageHeight: "+ pageHeight )
		//document.getElementById('dimmer-wrap').style.width = pageWidth;
		//document.getElementById('dimmer-wrap').style.height = pageHeight;
		//document.getElementById('dimmer-wrap').innerHTML = '<div id="dimmer" class="dimmer" style="width:'+ pageWidth + 'px; height:' + pageHeight +'px; "></div>'
		setDimmerSize(pageWidth, pageHeight);
	}

//function clearDimmerSize(){
//	document.getElementById('dimmer').style.width = 0;	
//	document.getElementById('dimmer').style.height = 0;	
//}

function setDimmerSize(pageWidth, pageHeight){
	//alert("pageWidth: "+ pageWidth +"\npageHeight: "+ pageHeight);
	document.getElementById('dimmer-wrap').innerHTML = '<div id="dimmer" class="dimmer" style="width:'+ pageWidth + 'px; height:' + pageHeight +'px; "></div>'
}

function displayPhoto(photoPos){
	scroll(0,0);
	//document.getElementById('dimmer').style.width = 0;	
	//document.getElementById('dimmer').style.height = 0;	
	
	document.getElementById('dimmer-wrap').style.visibility = "visible";	
	document.getElementById('galPhoto-wrap').style.visibility = "visible";	
	document.getElementById('galPhoto-wrap').style.width = pageWidth;	
	document.getElementById('galPhoto-wrap').style.zIndex = 130;	
		
	previous_id = parseInt(photoPos) - 1
	next_id = parseInt(photoPos) + 1
		
	if(previous_id < 0){
		previous_id = (PHOTO_ID_ARR.length - 1);
	}
	if(next_id > (PHOTO_ID_ARR.length - 1)){
		next_id = 0;
	}
	
	thisPhotoName = PHOTO_NAME_ARR[photoPos];
	thisPhotoNum = PHOTO_NUM_ARR[photoPos];
	var nameDisplayString = ""
	
	if(thisPhotoName.length > 0){
		nameDisplayString = thisPhotoName 	
	}
	if(thisPhotoNum.length > 0){
		if(nameDisplayString.length > 0){
			nameDisplayString += " : "+ thisPhotoNum
		}else{
			nameDisplayString = thisPhotoNum	
		}
	}
	
	if(nameDisplayString.length == 0){	
		nameDisplayString = "cake"	
	}
	
	
	displayStr = "<div id=\"galPhoto\" class=\"galPhoto\"></div>"
	displayStr = displayStr + "<div class=\"galleryTitle\">"+ galleryName +"</div>"
	displayStr = displayStr + "<div class=\"galleryNav\">"
	displayStr = displayStr + "<div class=\"prev\"><a href=\"javascript:displayPhoto("+ previous_id +");\"><img src=\"../images/arrow_prev.gif\"> Previous Photo</a></div>"
	displayStr = displayStr + "<div class=\"close\"><a href=\"javascript:removeDimmer(); \"><img src=\"../images/close.gif\"> Close</a></div>"
	displayStr = displayStr + "<div class=\"next\"><a href=\"javascript:displayPhoto("+ next_id +");\">Next Photo <img src=\"../images/arrow_next.gif\"> </a></div>"
	displayStr = displayStr + "</div>"
	//displayStr = displayStr + "<span class=\"galleryName\">"+ nameDisplayString +"</span>"
	displayStr = displayStr + "<div class=\"photofloatwrap\"><a href=\"javascript:removeDimmer(); \"><img src=\"../images/gallery-images/"+ PHOTO_IMG_ARR[photoPos] +"\" alt=\""+ PHOTO_NAME_ARR[photoPos]+"\" onload=\"initDimmer();\"></a></div>"
	displayStr = displayStr + "</div>"
	document.getElementById('galPhoto-wrap').innerHTML = displayStr;
	initDimmer();
}


function displayDimmer(){		
	document.getElementById('dimmer-wrap').style.visibility = "visible";	
	document.getElementById('galPhoto-wrap').style.visibility = "visible";	
	document.getElementById('galPhoto-wrap').style.width = pageWidth;	
	document.getElementById('galPhoto-wrap').style.zIndex = 130;	
}
function removeDimmer(){
	document.getElementById('dimmer-wrap').style.visibility = "hidden";		
	//document.getElementById('dimmer-wrap').style.display = "none";	
	document.getElementById('dimmer').style.width = 0;	
	document.getElementById('dimmer').style.height = 0;	
	document.getElementById('galPhoto-wrap').style.visibility = "hidden";	
	//document.getElementById('galPhoto-wrap').style.width = 0;	
}

function initDimmer(){
	buildDimmerDiv();	
}

-->