var t
var currentpage = location.pathname

function show_submenu(id) {
	clearTimeout(t)
	document.getElementById("sub_banking").style.display = "none"
	document.getElementById("sub_about").style.display = "none"
	document.getElementById("menu_index").style.background= "#AB6704 url(images/menubak.png) center center repeat-x"
	document.getElementById("menu_banking").style.background= "#AB6704 url(images/menubak.png) center center repeat-x"
	document.getElementById("menu_loans").style.background= "#AB6704 url(images/menubak.png) center center repeat-x"
	document.getElementById("menu_about").style.background= "#AB6704 url(images/menubak.png) center center repeat-x"
	document.getElementById("menu_rates").style.background= "#AB6704 url(images/menubak.png) center center repeat-x"
	document.getElementById("menu_"+id).style.background= "#041B44 url(images/menuhover.png) center center repeat-x"
	if (document.getElementById("sub_"+id) != undefined) {
		document.getElementById("sub_"+id).style.display = "block"
	}
	else
		document.getElementById("sub_blank").style.display = "block"
}

function mouseout() {
	t=setTimeout("return_default()",2000)
}

function return_default() {
	document.getElementById("sub_banking").style.display = "none"
	document.getElementById("sub_about").style.display = "none"
	document.getElementById("menu_index").style.background= "#AB6704 url(images/menubak.png) center center repeat-x"
	document.getElementById("menu_banking").style.background= "#AB6704 url(images/menubak.png) center center repeat-x"
	document.getElementById("menu_loans").style.background= "#AB6704 url(images/menubak.png) center center repeat-x"
	document.getElementById("menu_about").style.background= "#AB6704 url(images/menubak.png) center center repeat-x"
	document.getElementById("menu_rates").style.background= "#AB6704 url(images/menubak.png) center center repeat-x"
	if (currentpage == "/index.php" || currentpage == "/") {
		document.getElementById("menu_index").style.background= "#041B44 url(images/menuhover.png) center center repeat-x"
	}
	else if (currentpage == "/banking.php" || currentpage == "/checking.php" || currentpage == "/savings.php" || currentpage == "/cd.php" || currentpage == "/moneymarket.php" || currentpage == "/ira.php") {
		document.getElementById("menu_banking").style.background= "#041B44 url(images/menuhover.png) center center repeat-x"
		document.getElementById("sub_banking").style.display = "block"
	}
	else if (currentpage == "/loans.php") {
		document.getElementById("menu_loans").style.background= "#041B44 url(images/menuhover.png) center center repeat-x"
	}
	else if (currentpage == "/about.php" || currentpage == "/history.php" || currentpage == "/locations.php" || currentpage == "/careers.php" || currentpage == "/contact.php") {
		document.getElementById("menu_about").style.background= "#041B44 url(images/menuhover.png) center center repeat-x"
		document.getElementById("sub_about").style.display = "block"
	}
	else if (currentpage == "/rates.php") {
		document.getElementById("menu_rates").style.background= "#041B44 url(images/menuhover.png) center center repeat-x"
	}
}