function getURL(href) {
	document.cookie = "menuSelection=" + escape(href) + "; path=/";
	location.href = href;
	window.event.cancelBubble = true;
}
var activeSub = readCookie("activeSub", 0);
function showSub(n, focusEl) {
	document.cookie = "activeSub=" + n + "; path=/";
	if (n != activeSub && activeSub != 0) {
		document.getElementById("sub" + activeSub).style.display = "none";
		document.getElementById("menu_" + activeSub).style.backgroundColor = "transparent";
		document.getElementById("arrow_" + activeSub).className = "arrow";

	}
	activeSub = n;
	document.getElementById("sub" + activeSub).style.display = "block";
	activateSub(n);
	if (!focusEl) {
		document.body.focus();
	} else {
		focusEl.focus();
	}
}
function activateSub(n) {
	document.getElementById("menu_" + n).style.backgroundColor = "#F15A20";
	document.getElementById("arrow_" + n).className = "arrow_active";
}
function deactivateSub(n) {
	if (n != activeSub) {
		document.getElementById("arrow_" + n).className = "arrow";
	} 
	if (!(n == activeSub && n == 5)) {
		document.getElementById("menu_" + n).style.backgroundColor = "transparent";
	}
	
}
function openSub(n, focusEl) {
	if (n != activeSub && activeSub != 0) {
		try {
			document.getElementById("sub" + activeSub).style.display = "none";
			document.getElementById("arrow_" + activeSub).className = "arrow";
			document.getElementById("menu_" + activeSub).style.backgroundColor = "transparent";
		} catch (e) {		
		}
	}
	activeSub = n;
	document.getElementById("sub" + activeSub).style.display = "block";
	document.getElementById("arrow_" + activeSub).className = "arrow_active";
	if (!focusEl) {
		document.body.focus();
	} else {
		focusEl.focus();
	}
}

function readCookie(name, def) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return def;
}
