var isNav, isIE, isMac
var coll = ""
var styleObj = ""
var endStr = ""
if (parseInt(navigator.appVersion) >= 4) {
	if ((navigator.appName) == "Netscape") { 
		if (parseInt(navigator.appVersion) >= 5) { 
			isIE = true //it appears that most other parameters of Netscape 6 mirror IE
			coll = "getElementById('"
			endStr = "')"
			styleObj = "').style"
		}
		else { isNav = true }
	}
	else {	isIE = true
			coll = "all."
			styleObj = ".style"	}
}

if ((navigator.appVersion.indexOf("Mac") != -1)) {
		isMac = 1;
	}
	

function blurry(obj) {
	if (!isNav) obj.blur();
}

function shiftTo(obj, x, y) {
	if (isNav) { obj.moveTo(x, y) }
	else {
		if ((navigator.appName) == "Netscape") { 
			obj.left = x
			obj.top = y
		}
		else {
			obj.pixelLeft = x
			obj.pixelTop = y
		}
	}
}

function findX(obj){
	if (isNav || (navigator.appName)=="Netscape") { return obj.left }
	else { return obj.pixelLeft }
}

function findY(obj){
	if (isNav || (navigator.appName)=="Netscape") { 
		tmp = obj.top;
		retStr = tmp;
		if (isIE) { // this only needs to be done for netscape 6
			if (retStr.indexOf('pt') != -1) retStr = tmp.substring(0,tmp.indexOf('pt'));
			if (retStr.indexOf('px') != -1) retStr = tmp.substring(0,tmp.indexOf('px'));
		}
		retStr = retStr * 1;
		return retStr 
	}
	else { return obj.pixelTop }
}

function getObjHeight(obj) {
	if (isNav || (navigator.appName)=="Netscape") { return obj.clip.height }
	else { return obj.clientHeight }
}

function getObjWidth(obj) {
	if (isNav || (navigator.appName)=="Netscape") { return obj.clip.width }
	else { return obj.clientWidth }
}

numNavItems = 8; //The number of items in the main navigation area
navLoc = "images/";

imgsrc = new Array();
numElements = numNavItems * 2;
for (i=0; i<numNavItems; i++) {
	imgNum = i;
	imgsrc[((i+1)*2-2)] = (navLoc + "nav" + (imgNum+1) + "-off.gif");
	imgsrc[((i+1)*2-1)] = (navLoc + "nav" + (imgNum+1) + "-on.gif");
}

img = new Array();
for (i=0; i<imgsrc.length; i++) {
	img[i] = new Image();
	img[i].src = imgsrc[i];
}

var lastNav = 1;
function swtch(num) {
	if (num == -1) {
		obj = eval('document.images[\'nav' + lastNav + '\']');
		arrayNum = (lastNav * 2 - 1) - 1;
	}
	else {
		obj = eval('document.images[\'nav' + num + '\']');
		arrayNum = (num * 2 - 1);
		lastNav = num;
	}
	obj.src = img[arrayNum].src;
}


function simpSwtch(img,path,state) {
	divStr = '';
	if (isNav && state == 2) divStr = 'document.thmScroll.';
	obj = eval(divStr + 'document.images[\'' + img + '\']');

	// The state variable allows for some flexibility the possible states are:
	//	1 : we're displaying a large shot, so show the loading... image
	//  2 : we're switching a thumbnail to a rolled state, so account for
	//		the fact that Netscape 4 requires an extra div reference
	// If there's no state variable present, the script will just switch
	// the images without anything else
	if (state==1) obj.src = loadingImg.src;
	obj.src = "images/" + path;
}


loadingImg = new Image(400,300);
loadingImg.src = "images/port-loading.gif";
