var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

$(document).ready(function() {
	$("#" + activeMenuId).children(".activeImage").children("img").show();

	$(".menuItem").bind("mouseover", function() {
		//if it's the active menu item then leave it as active. If not give it rollover effect
//		if (activeMenuId != $(this).attr("id")) {
			$(this).children(".activeImage").children("img").show();
			//alert('here');
//		}
	});
	$(".menuItem").bind("mouseout", function() {
		//if it's the active menu item then leave it as active. If not give it rollover effect
		if (activeMenuId != $(this).attr("id")) {
			$(this).children(".activeImage").children("img").hide();
		}
	});

	$(".menuItem").bind("click", function() {
		//get the current id
		var menuId = $(this).attr("id");
	 	//send the data to google analytics
	 		//get the page name
		 	var sPath = window.location.pathname;
			var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
		pageTracker._trackPageview('/' + sPage + '/' + menuId);
		
		//hide all the body text
		$(".bodyText").hide();
		//show the body text that relates to the menu item that was clicked
		$("#" + menuId + "Text").show();
		//hide all of the green bars
		$(".activeImage").children("img").hide();
		//show the green bar that we just clicked
		$(this).children(".activeImage").children("img").show();
		//set the menu item we just clicked as active
		activeMenuId = $(this).attr("id");
		//stop the browser from jumping to the top
		return false;
	});

});
