var ua = navigator.userAgent.toLowerCase();
var macIE4 = (ua.indexOf("mac") != -1 && ua.indexOf("msie") != -1)?true:false;
var macSafari = (ua.indexOf("mac") != -1 && ua.indexOf("safari") != -1)?true:false;
var macNetscape = (ua.indexOf("mac") != -1 && ua.indexOf("netscape") != -1)?true:false;
var pcIE = (ua.indexOf("windows") != -1 && ua.indexOf("msie") != -1)?true:false;

var CS_Sniffer = new Object();
CS_Sniffer.needFlashVersion = 6;

var d = document; 
function over(imgId, imgSrc) {
d[imgId].src = imgSrc;
}
function out(imgId, imgSrc) {
d[imgId].src = imgSrc;
}
function preLoadMyImages() {
arg=preLoadMyImages.arguments;
imgs=new Array();
i=imgs.length
for(i=0; i<arg.length; i++)
if (arg[i]!=0) {
imgs[i]=new Image;
imgs[i].src=location.host + arg[i];
}
}


	
function popWin(URL,NAME,WIDTH,HEIGHT,RESIZE,SCROLL) {
 window.open(URL,NAME,'width='+WIDTH+',height='+HEIGHT+',resizable='+RESIZE+',scrollbars='+SCROLL+',menubar=no,toolbar=no,location=no,directories=no,status=no');
}

//--- photo_display code start ---

photoArray    = new Array("hp3_1.jpg", "hp3_2.jpg", "hp3_3.jpg", "hp3_4.jpg", "hp3_5.jpg","hp3_6.jpg", "hp3_7.jpg", "hp3_8.jpg", "hp3_9.jpg", "hp3_10.jpg");   //photo names go here in order
photoPath     = "img/";					   //relative path to where the photos are stored	
pageName      = "photo_display.html"			   //the name of this page						

function requestQueryString(requestedVariable) {
	searchString = window.location.search;                 //retrieves the querystring in the URL document in the form ?var1=value1&var2=value2
	varLength    = requestedVariable.length + 1;           //length of variable name plus the "=" for seach purposes          
	pos          = searchString.search(requestedVariable + "=");  //find the position in the search string of the variable
	variableString = ""
	


	if (pos != -1) {									   //ie, if the variable is actually located in the string
		
		for(a = pos + varLength;a <= searchString.length; a++) {
		
			if (searchString.substr(a,1) != "&") {
				variableString += searchString.substr(a,1);
			} else {
				break;
			}
		}
	}

return variableString;

}

//calculate all the image numbers

if (requestQueryString("img") == "") {
	currentImage      = 1;
} else {
	currentImage      = parseInt(requestQueryString("img"));
}

totalImages       = photoArray.length;



if (currentImage == totalImages) {
	nextImage     = 1;
} else {
	nextImage     = currentImage + 1;
}



if (currentImage == 1) {
	lastImage     = totalImages;
} else {
	lastImage     = currentImage - 1;
}


currentImageName = photoPath + photoArray[currentImage - 1]   //compensate for a 0 index of arrays

// -- END PHOTO DISPLAY --


