// *** CROSS-BROWSER COMPATIBILITY ***

var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isDyn = (isDOM || isIE4 || isNS4);

function getRef(id)
{
 if (isDOM) return document.getElementById(id);
 if (isIE4) return document.all[id];
 if (isNS4) return document.layers[id];
}
// *** End
if (top.location.href.indexOf("autorun.htm") == -1) {
	if (isDOM) {window.onload = pageLoad;}
}
var pageLoadTF

function pageLoad() {	// STARTUP SCRIPT
	pageLoadTF = true;
	var framesetQuery = "?main=00&sub=";
	if ( this.location.search != 0 ) {
		framesetQuery = this.location.search;
	}
	
	mainHighl = getParameter(framesetQuery, "main");
	subHighl = getParameter(framesetQuery, "sub");
	if (thisMain.length == 2) { mainHighl = thisMain; }
	if (thisSub.length == 2) { subHighl = thisSub; }
	if (mainHighl != "00") {
		document.getElementById("main" + mainHighl).style.color='#FFFF00';
		document.getElementById("main" + mainHighl).style.background='#7b8a52';
	}
	if (subHighl != "") {if (subHighl != 'null'){
		document.getElementById("sub" + mainHighl + subHighl).style.color='#000000';
		document.getElementById("sub" + mainHighl + subHighl).style.background='#FFFFFF';
	}}

//	if (document.all) {	// Internet Explorer
//		document.all["subNav" + mainHighl].style.display = '';
//	} else if (document.layers) {	// Netscape <=5
//		document.layers.eval("subNav" + mainHighl).style.display = '';
//	} else if (document.getElementById) {	//Netscape 6
	    document.getElementById("subNav" + mainHighl).style.display = '';
//	}
	
}

function rollover(num) {
if (pageLoadTF) {
// change next two lines to 8 for additional main header item
	for (var i=0; i<=7; i++) {
		if (i <= 7) {itxt = '0' + i;} else {itxt = i;}
			if (i != 0){ document.getElementById("main" + itxt).style.background='#a5a273'; }
			document.getElementById("subNav" + itxt).style.display = 'none';
	}
	if (num != "00"){ document.getElementById("main" + num).style.background='#7b8a52'; }
	document.getElementById("subNav" + num).style.display = '';
}}

function rollout(num) {
if (pageLoadTF) {
	if (mainHighl != num) {
		//document.getElementById("main" + num).style.color='#FFFFFF';
	}
}}

function subRollout(subNav) {
if (pageLoadTF) {
	subNav.style.color='#FFFFFF';
	if (subHighl != ""){if (subHighl != 'null'){ document.getElementById("sub" + mainHighl + subHighl).style.color='#000000'; }}
}}

function getParameter ( queryString, parameterName ) {
	// Add "=" to the parameter name (i.e. parameterName=value)
	var parameterName = parameterName + "=";
	if ( queryString.length > 0 ) {
		// Find the beginning of the string
		begin = queryString.indexOf ( parameterName );
		// If the parameter name is not found, skip it, otherwise return the value
		if ( begin != -1 ) {
			// Add the length (integer) to the beginning
			begin += parameterName.length;
			// Multiple parameters are separated by the "&" sign
			end = queryString.indexOf ( "&" , begin );
			if ( end == -1 ) {
				end = queryString.length
			}
		// Return the string
		return unescape ( queryString.substring ( begin, end ) );
		}
	// Return "null" if no parameter has been found
	return "null";
	}
}

function getParameter ( queryString, parameterName ) {
	// Add "=" to the parameter name (i.e. parameterName=value)
	var parameterName = parameterName + "=";
	if ( queryString.length > 0 ) {
		// Find the beginning of the string
		begin = queryString.indexOf ( parameterName );
		// If the parameter name is not found, skip it, otherwise return the value
		if ( begin != -1 ) {
			// Add the length (integer) to the beginning
			begin += parameterName.length;
			// Multiple parameters are separated by the "&" sign
			end = queryString.indexOf ( "&" , begin );
			if ( end == -1 ) {
				end = queryString.length
			}
		// Return the string
		return unescape ( queryString.substring ( begin, end ) );
		}
	// Return "null" if no parameter has been found
	return "null";
	}
}

function viewPrintable() {
	document.body.style.background = "#FFFFFF";
	document.getElementById("mainTable").style.background = "#FFFFFF";
	document.getElementById("header").style.display = "none";
	document.getElementById("topRow").style.height = "0";
	document.getElementById("footer").style.display = "none";
	document.getElementById("leftSide").style.background = "#FFFFFF";
	document.getElementById("rightSide").style.background = "#FFFFFF";
	document.getElementById("curvegfc1").style.display = "none";
	document.getElementById("curvegfc2").style.display = "none";
}
