var imgAboutOn = new Image();
var imgAboutOff = new Image();
var imgProgramsOn = new Image();
var imgProgramsOff = new Image();
var imgClaimsOn = new Image();
var imgClaimsOff = new Image();
var imgPolicyOn = new Image();
var imgPolicyOff = new Image();
var imgContactOn = new Image();
var imgContactOff = new Image();

imgAboutOn.src = strPageRoot + "img/nav/img_about_on.jpg";
imgAboutOff.src = strPageRoot + "img/nav/img_about_off.jpg";
imgProgramsOn.src = strPageRoot + "img/nav/img_programs_on.jpg";
imgProgramsOff.src = strPageRoot + "img/nav/img_programs_off.jpg";
imgClaimsOn.src = strPageRoot + "img/nav/img_claims_on.jpg";
imgClaimsOff.src = strPageRoot + "img/nav/img_claims_off.jpg";
imgPolicyOn.src = strPageRoot + "img/nav/img_policy_on.jpg";
imgPolicyOff.src = strPageRoot + "img/nav/img_policy_off.jpg";
imgContactOn.src = strPageRoot + "img/nav/img_contact_on.jpg";
imgContactOff.src = strPageRoot + "img/nav/img_contact_off.jpg";






oTimer = null;
strCurrentMenu = "";
strCurrentBio = "";
boolHideForms = false;

var arrMenus = new Array("About", "Programs");
var oTimer = null;
var oFadeInTimer = null;
var strSection;

function fShowMenu(strMenuName) {
	fKeepMenus();
	if (oParentRow) {
		oParentRow.className = 'cssMenuItemOff';
		
	}
	for (i=0;i<arrMenus.length;i++) {
		if (arrMenus[i] != strMenuName) {
			if (document.getElementById("divMenu" + arrMenus[i])) {
				document.getElementById("divMenu" + arrMenus[i]).style.visibility = "hidden";
			}
			if (arrMenus[i].toLowerCase() != strSection) {
				if (eval(document.images["img" + arrMenus[i]])) {
					//fImageSwap("img" + arrMenus[i], "Off");
				}
			}
		} else {
			if (document.getElementById("divMenu" + arrMenus[i])) {
				if (document.getElementById("divMenu" + arrMenus[i]).style.visibility != "visible") {
					fAlphaInMenu("divMenu" + arrMenus[i], 0);
				} else {
					document.getElementById("divMenu" + arrMenus[i]).style.MozOpacity = "0.9";
					document.getElementById("divMenu" + arrMenus[i]).style.filter = "alpha(Opacity=90)";
				}
			}
			if (eval(document.images["img" + arrMenus[i]])) {
				//fImageSwap("img" + arrMenus[i], "On");
			}
		}
	}
}

function fHideMenus() {
	oTimer = window.setTimeout("fHideAllMenus();", 500);
}

function fHideAllMenus() {
	window.clearTimeout(oTimer);
	for (i=0;i<arrMenus.length;i++) {
		if (document.getElementById("divMenu" + arrMenus[i])) {
			document.getElementById("divMenu" + arrMenus[i]).style.visibility = "hidden";
		}
		if (arrMenus[i].toLowerCase() != strSection) {
			//fImageSwap("img" + arrMenus[i], "Off");
		}
	}	
	
}


function fKeepMenus() {
	window.clearTimeout(oTimer);
}

function fAlphaInMenu(strMenu, intAlpha) {
	var strStyleChange = "";
	if (intAlpha == 0) {
		document.getElementById(strMenu).style.visibility = "visible";
	}
	strStyleChange = "alpha(Opacity=" + intAlpha + ")"; // -moz-opacity: " + (intAlpha / 100) + ";"
	document.getElementById(strMenu).style.MozOpacity = intAlpha / 100;
	document.getElementById(strMenu).style.filter = strStyleChange;
	if (intAlpha < 90) { 
		if ((intAlpha + 10) > 90) {
			oFadeInTimer = window.setTimeout("fAlphaInMenu(\"" + strMenu + "\", 90);", 1);
		} else {
			oFadeInTimer = window.setTimeout("fAlphaInMenu(\"" + strMenu + "\", " + (intAlpha + 10) + ");", 1);
		}
	} else {
		oFadeInTimer = null;
		window.clearTimeout(oFadeInTimer);	
	}	
}

var oParentRow, iParentNumber

function fMouseOverItem(oRow, iNumber) {
	fKeepMenus();
	if (oParentRow) {
		oParentRow.className = 'cssMenuItemOff';
	}
	oRow.className='cssMenuItemOn';
	oParentRow = oRow;
}

function fMouseOutItem(oRow, iNumber) {
	fHideMenus();
}

function fShowDropdown(strID) {
	if(strCurrentMenu != "") {
		fHideDiv(strCurrentMenu);
	}
	if(boolHideForms && (strID == "divClaims" || strID == "divPrograms")) {
		document.getElementById("Select1").style.visibility = "hidden";
		document.getElementById("Select2").style.visibility = "hidden";
	}
	strCurrentMenu = strID;
	var oDiv = document.getElementById(strID);
	oDiv.style.visibility = "visible";
	oDiv.style.display = "block";
	if(oTimer != null) {
		clearTimeout(oTimer);
	}
}

function fHideDropdown(strID) {
	oTimer = setTimeout('fHideDiv(\"' + strID + '\");', 1000);
}

function fHideDiv(strID) {
	var oDiv = document.getElementById(strID);
	oDiv.style.display = "none";
	oDiv.style.visibility = "hidden";
	if(boolHideForms && (strID == "divClaims" || strID == "divPrograms")) {
		document.getElementById("Select1").style.visibility = "visible";
		document.getElementById("Select2").style.visibility = "visible";
	}	
}

function fShowDiv(strID) {
	var oDiv = document.getElementById(strID);
	oDiv.style.display = "block";
	oDiv.style.visibility = "visible";
}

function fShowFlash() {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="709" height="248" id="027779_HomeFlash" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="flash/027779_HomeFlash.swf" /><param name="wmode" value="transparent" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="flash/027779_HomeFlash.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="709" height="248" name="027779_HomeFlash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

function popBioWin(strID) {
	if(strCurrentBio != "") {
		fHideDiv("biosWin"+strCurrentBio);
	}
	strCurrentBio = strID;
	fShowDiv("biosWin"+strID);
}

function popRegionalWin(sElement) {
	if(document.getElementById(sElement).style.display == 'none' || document.getElementById(sElement).style.display == '') {
		fShowDiv(sElement);
	} else {
		fHideDiv(sElement);
	}
}

function showContact(sElementId) {
	var iDescriptionCount = 7;
	for(var i = 0; i < iDescriptionCount; i++) {
		if(i == sElementId) {
			//alert('changed to block');
			document.getElementById('divContacts_' + i).style.display = 'block';
		} else {
			//alert('changed to none');
			document.getElementById('divContacts_' + i).style.display = 'none';
		}
	}	
}
