// Created by Joseph Gallagher
// July 2010

$(document).ready(function () {

// Calculate the height of each drop-down of the primary nav and store it for later
		$("ul#nav li:not(ul#nav li.home)").each(function () {
			if (siteTextSize == "mTxt"){
				var depth1 = 55;
				var depth2 = 130;
			}
			else if (siteTextSize == "lTxt"){
				var depth1 = 80;
				var depth2 = 150;
			}
			else {
				var depth1 = 55;
				var depth2 = 80;
			}
			$(this).data("navHeight", (parseInt(($(this).find("li").size() - 1) / 4) * depth1) + depth2);
		});
		
		//when a menu item is hovered over.
		$("ul#nav li:not(ul#nav li.home)").mouseover(function () {
			$(this).find("ul").fadeIn(1000);
			$("li.navWrapper").animate({ height: $(this).data("navHeight") + "px" }, { queue: false }, 400);
//			$("div.media").hide();
//			$('object:not(:div.mspSearchTertiaryContent object), embed, div.media').parent().addClass('objectHide');
		});
		
		$("ul#nav li").mouseout(function () {
			$("li.navWrapper").animate({ height: "0px" }, { queue: false }, 400);
//			$('.objectHide').removeClass('objectHide');
//			$("div.media").show();
		});
});
