
function showElement(id) {
	hideDefaultMenu();
	document.getElementById(id).style.display="block";
}
function hideElement(id) {
	document.getElementById(id).style.display="none";
}
function showDefaultMenu() {
	if(menu_stick!='sub_none' && menu_stick!='sub_none') {
		document.getElementById(menu_stick).style.display="block";
	}
}
function hideDefaultMenu() {
	if(menu_stick=='sub_none' || menu_stick=='sub_'){}
	else if(document.getElementById(menu_stick).style.display == "none"){}
	else {
		document.getElementById(menu_stick).style.display="none";
	}
}
$(document).ready(function() {
	showDefaultMenu();
	$("#login").click(function() {
		$("#overlay").css("opacity", 0.8).fadeIn("slow");
		$("#box").fadeIn("slow");
		document.login_form.email.focus();
	});
	$("#cancel").click(function() {
		$("#overlay").fadeOut("slow");
		$("#box").fadeOut("slow");
	});
	$("#overlay").click(function() {
		$(this).fadeOut("slow");
		$("#box").fadeOut("slow");
	});
	$("#login_table").corner();
	$(".sub_menu").hover(function() {
		showElement($(this).attr('id'));
	}, function() {
		hideElement($(this).attr('id'));
		showDefaultMenu();
	});
	$(".menu_item").hover(function() {
		showElement("sub_" + $(this).attr('id'));
	}, function() {
		hideElement("sub_" + $(this).attr('id'));
		showDefaultMenu();
	});
});