preloadflag = true;

// Browser Detection
var V = navigator.appVersion.substring(0,1);
var brsr = 0;
if (V < 4) {
	top.alert("This site uses java to support its major navigation.\n You may have trouble viewing the site");
} else if (navigator.appName.indexOf("Netscape") > -1) {

} else if (navigator.appName.indexOf("Explorer") > -1) {
		var T = navigator.appVersion.indexOf("MSIE");
		T += 5;
		V = navigator.appVersion.substring(T,eval(T+1));
}
if (navigator.appName.indexOf("Netscape") > -1) {
	brsr = 1;
} else if (navigator.appName.indexOf("Explorer") > -1) {
	if (V < 5) {

	} else {
		brsr = 2;
	}
}


function getElmById(aID){
	var rv = null;

	if (document.getElementById) {
		//alert("byId");
		rv = document.getElementById(aID)
	} else if (document.layers) {
		//alert("layers");
		rv = document.layers[aID]
	} else if (document.all) {
		//alert("all");
		rv = document.all[aID];
	}

	return rv;
}


function alignContent () {

	//top.alert(getElmById("mainFraming").offsetHeight);
	contentBottom = getElmById("mainFraming").offsetHeight;
	if ((contentBottom) % 6 != 0) {
		contentBottom = ((Math.ceil((contentBottom)/6)) * 6);
	//	top.alert(contentBottom);
		getElmById("mainFraming").style.height = contentBottom;
	//	top.alert(getElmById("mainFraming").offsetHeight);
	}
	// getElmById("sizeMe").style.height = getElmById('footerPage').offsetHeight + maxBottom;

}

function openPhotoCredit () {
	showHideLayers('','photoCreditClosed','hidden','photoCreditOpen','visible');
}

function closePhotoCredit () {
	showHideLayers('','photoCreditClosed','visible','photoCreditOpen','hidden');
}


function getElementById(id){
	var el = null;

	if (document.getElementById) {
		// isMozilla || isIE5
		el = document.getElementById(id)
	} else if (document.layers) {
		// isNetscape4
		el = document.layers[id]
	} else if (document.all) {
		// isIE4
		el = document.all[id];
	}

	return el;
}



// Email Spam hiding.
function popMail(host,user) {
	var acct = user +'@'+ host;
	self.location.href = 'mailto:'+ acct;
}
function linkMail(host,user,cls) {
	document.write('<a href="javascript:popMail(\''+ host +'\',\''+ user +'\');"');
	if (cls) {
		document.write(' class="'+ cls +'"');
	}
	document.write('>');
	showMail(host,user);
	document.write('</a>');
}
function showMail(host,user) {
	var acct = user +'@'+ host;
	document.write(acct);
}


function centerPop(page,w,h,args){
	if (w > 0) {
	} else {
		w = 650
	}
	if (h > 0) {
	} else {
		h = 550
	}
	var width
	var height
	var leftdist
	var topdist
	width = screen.width;
	height = screen.height;
	leftdist = Math.round((width - w) / 2);
	topdist = Math.round((height - h) / 2);
	if (args = '') {
		args = 'resizable=1,menubar=0,location=0,scrollbars=1,status=1,toolbar=0';
	}
	cpw = window.open(page,'cpw','width='+ w +',height='+ h +',top='+topdist+',left='+leftdist+','+ args);
	cpw.focus();
}


function centerPopMenu(page,w,h){

if (w > 0) {
} else {
 w = 650
}
if (h > 0) {
} else {
 h = 550
}

var width
var height
var leftdist
var topdist
width = screen.width;
height = screen.height;
leftdist = Math.round((width - w) / 2);
topdist = Math.round((height - h) / 2);

gwin = window.open(page,'gwin','width='+ w +',height='+ h +',top='+topdist+',left='+leftdist+',resizable=1,menubar=1,location=0,scrollbars=1,status=1,toolbar=0');
gwin.focus();

}


	function PopWin(HEIGHT,WIDTH,URL) {
		var PopWin = window.open(URL,'PopWin',"width="+ WIDTH +",height="+ HEIGHT +",scrollbars=0,toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0");
		PopWin.focus()
	}

	function newImage(arg) {
		if (document.images) {
			rslt = new Image();
			rslt.src = arg;
			return rslt;
		}

		//img_on	= newImage("/pics/index_nav/index_con.gif");
		//img_off	= newImage("/pics/index_nav/index_con.gif");
	}

	function resWin(page) {
		var resWin = window.open(page,'resWIn',"width=499,height=333,scrollbars=0,toolbar=1,location=0,directories=0,status=1,menubar=0,resizable=1");
		resWin.open
	}

	function changeImages() {
	//	if (document.images && (preloadFlag == true)) {
			for (var i=0; i<changeImages.arguments.length; i+=3) {
			//  top.alert (document.layers[i].document[changeImages.arguments[i+1]].name)
			//document.layers[changeImages.arguments[i]].document[changeImages.arguments[i+1]].src = eval(changeImages.arguments[i+2]+".src");
				if (brsr == 1) {
			//		if (changeImages.arguments[i] != '') {
			//			document[changeImages.arguments[i+1]].src = eval(changeImages.arguments[i+2]+".src")
			//		} else {
						if (document[changeImages.arguments[i+1]]) document[changeImages.arguments[i+1]].src = eval(changeImages.arguments[i+2]+".src")
			//		}
				}
				if (brsr == 2) {
					if (document[changeImages.arguments[i+1]]) document[changeImages.arguments[i+1]].src = eval(changeImages.arguments[i+2]+".src")
				}
			}
	//	}
	}
	function changeImagesStr() {
			for (var i=0; i<changeImagesStr.arguments.length; i+=3) {
				if (brsr == 1) {
						document[changeImagesStr.arguments[i+1]].src = changeImagesStr.arguments[i+2]
				}
				if (brsr == 2) {
					document[changeImagesStr.arguments[i+1]].src = changeImagesStr.arguments[i+2]
				}
			}
	}

	function rollOver (item,state) {
		if (state) {
			changeImages('','i'+item,'i'+item+'_on');
		} else {
			changeImages('','i'+item,'i'+item+'_off');
		}
	}

	function setClass() {
		var args=setClass.arguments;
		var ston = 0;

		if (brsr != 0) {
			for (i = ston; i<(args.length-1); i+=2) {
				var obj = args[i];
				var cls = args[i+1];
				if (brsr == 1 && V >= 5) {
					document.getElementById(obj).className = cls;
				}
				if (brsr == 2) {
					if (document.all[obj]) {
						document.all[obj].className = cls;
					}
				}
			}
		}
	}

	function showHideLayers() {
		var args=showHideLayers.arguments;
		var ston = 1;
		var baser = args[0];

		if (brsr != 0) {
			for (i = ston; i<(args.length-1); i+=2) {
				var obj = args[i];
				var vis = args[i+1];
				if (brsr == 1 && V < 5) {
						if (document.layers[obj]) document.layers[obj].visibility = vis;
				}
				if (brsr == 1 && V >= 5) {
					if (document.getElementById(obj)) {
						document.getElementById(obj).style.visibility = vis;
					}
				}
				if (brsr == 2) {
					if (document.all[obj]) {
						document.all[obj].style.visibility = vis;
					}
				}
			}
		}
	}



	function delayHide() {
			if (t==0) {
					removeall();
					lCount = 0;
			}
			if (t==2) {
					lCount = 0;
			}
			if (t==1) {
					lCount = lCount + 1;
					if (lDelay <= lCount) {
							t = 0;
					}
					if (lDelay >= lCount) {
							setTimeout('delayHide(' + t + ')',pause);
					}
			}
			return false;
	}


