var page = location.pathname.slice(1,location.pathname.lastIndexOf("."));
if (page == "") { page = "index"; }
$(document).ready(function(){
	$("#nav").css("background-image","url(images/"+page+"_nav_bg.jpg)");
	if ($("#estForm").length > 0) { $("#estForm").validate(); }
	var left = $("#menu-services").width();
	var top = $("#menu-services").height();
	$('#menu-other').css("left",left+"px").css("top",top-25+"px").css("width",left-25+"px");
	var browser = navigator.userAgent; 
	if (browser.indexOf('MSIE 7') > 0) {
        $('#menu-services').css("margin","30px 0 0 -"+left+14+"px");
		$("#nav").css("margin","-5px 0 0 0");
		if (page == "index") {
			$("#headers-home").css("margin","-5px 0 0 0");
		} else {
			$("#content").css("margin","-5px 0 0 0");
		}
	}	
});

function navmenu(what,title) {
	if (what == "show") {
		$("#menu-"+title).show();
	} else {
		$("#menu-"+title).hide();
	}
}
 
function gtfo(page)
{
	window.location = page+".php";
}

function removeAttr(id) {
	$("#"+id).removeAttr("onclick");	
}

function addAttr(id) {
	$("#"+id).attr("onclick","gtfo(this.id)");	
}
