// JavaScript Document
function headerNav()
{
var eId;
//hiding and showing of wellpath_header tabs     
 $("#wellpath_header #tabs li").mouseenter(function(){
	eId = this.id;
	$("#wellpath_header ul #" + eId + "Nav").show();

 });
 $("#wellpath_header #tabs li").mouseleave(function(){
	eId = this.id;
	$("#wellpath_header ul #" + eId + "Nav").hide();
 });
}


function switchTabs(e)
{
	//hiding and showing of panels
	$('#wellpath_content').each(function(panel) {
		$('#wellpath_content div.panel').hide();
	});
	$('#'+ e.id +'Tab').show();
return false;
}

function sideNav()
{
	var cssID,childID, parID;
	cssID = document.getElementById("wellpath_chewy").className;
	var arrayNames = cssID.split(" ");

	parID = arrayNames[0]; //parent
	childID = arrayNames[1]; //child

	removeActiveMenu();
	$("#menu li.menu a#"+ parID).addClass("hilite");
	$("#menu li.menu ul."+ parID).show();
	$("#"+ childID).addClass("selected");


	//animate Nav
	$("#menu li.menu a.parentmenu").click(function(e) {

	$("#menu li.menu ul").hide();
	var parentMenu = this.id;
	$("#menu li.menu ul."+ parentMenu).slideDown("slow");
	return false;

	});
	
	//toggle Nav
	$("#menu li.menu a.parentmenu").click(function(e) {
	$("#menu li.menu a").removeClass("hilite");
	$(this).toggleClass("hilite");
	return;
  	});

	$("#menu li.childmenu a").click(function(e)
	{
	var childHref = this.href;
	document.location=childHref;
	return false;

	});

	//remove sideNav state
	function removeActiveMenu()
	{
		$("#menu a").each(function()
		{
			$("#menu a").removeClass("selected");
		});
	}
}