if (top.location.href.indexOf("autorun.htm") == -1) {document.write("<span id=\"mainContent\" onmouseover=\"if (pageLoadTF) {rollover(mainHighl);}\">");}

// *** 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='#CC3333';
	}
	if (subHighl != "") {if (subHighl != 'null'){
		document.getElementById("sub" + mainHighl + subHighl).style.color='#000000';
		document.getElementById("sub" + mainHighl + subHighl).style.background='#CCCC99';
	}}

//	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) {
	for (var i=0; i<=9; i++) {
		if (i <= 9) {itxt = '0' + i;} else {itxt = i;}
			if (i != 0){ document.getElementById("main" + itxt).style.background='#003366'; }
			document.getElementById("subNav" + itxt).style.display = 'none';
	}
	if (num != "00"){ document.getElementById("main" + num).style.background='#CC3333'; }
	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";
}

function goWebURL() {
	var path = top.location.href;
		end = path.indexOf ( "#" , path );
		if ( end == -1 ) {
			end = path.length
		}
	find = path.indexOf("/scouting/");
	if (find != -1) {return unescape ( "http://www.crossroadsbsa.org" + path.substring(find, end) );}
	find = path.indexOf("/activities/");
	if (find != -1) {return unescape ( "http://www.crossroadsbsa.org" + path.substring(find, end) );}
	find = path.indexOf("/camping/");
	if (find != -1) {return unescape ( "http://www.crossroadsbsa.org" + path.substring(find, end) );}
	find = path.indexOf("/fundraising/");
	if (find != -1) {return unescape ( "http://www.crossroadsbsa.org" + path.substring(find, end) );}
	find = path.indexOf("/training/");
	if (find != -1) {return unescape ( "http://www.crossroadsbsa.org" + path.substring(find, end) );}
	find = path.indexOf("/resources/");
	if (find != -1) {return unescape ( "http://www.crossroadsbsa.org" + path.substring(find, end) );}
	find = path.indexOf("/council/");
	if (find != -1) {return unescape ( "http://www.crossroadsbsa.org" + path.substring(find, end) );}
	find = path.indexOf("/links/");
	if (find != -1) {return unescape ( "http://www.crossroadsbsa.org" + path.substring(find, end) );}
}
