// JavaScript Document

$(document).ready(function(){
	$("ul#nav li").hover(
		function(){ $(this).addClass("hoverclass"); },
		function(){ $(this).removeClass("hoverclass");;}
	);
	$("#masthead ul li").hover(
		function(){ $(this).addClass("hovering"); },
		function(){ $(this).removeClass("hovering");}
	);
	$("li.drop").hover(
		function(){ $(this).children().fadeIn("fast"); },
		function(){ $(this).children().fadeOut("fast"); }
	);
	$("li.drop2").hover(
		function(){ $(this).children().show("fast"); },
		function(){ $(this).children().hide("fast"); }
	);
	
});

function showImage(classToAdd){
	$("#masthead").removeClass("noHover");
	$("#masthead").removeClass("corporate");
	$("#masthead").removeClass("engineering");
	$("#masthead").removeClass("fieldservices");
	$("#masthead").addClass(classToAdd);
}

corporate = new Image();
engineering = new Image();
fieldservices = new Image();

corporate.src = "images/corporate.jpg";
engineering.src = "images/corporate.jpg";
fieldservices.src = "images/corporate.jpg";

function goto(URL, target){
	if(target == '_blank'){
		window.open(URL);	
	}
	else{
		window.location=URL;
	}
}