//<![CDATA[

$(document).ready(function() {

	var userAgent = navigator.userAgent.toLowerCase();

	//Removes hover text from navigation
	$('#horizontalNav a').removeAttr("title");
	$('#leftNav a').removeAttr("title");
	
	//Adds contentFooter container
	$('#topLevelContainer').after("\<div id=\"contentFooter\"\>\<!-- end \#contentFooter --\>\<\/div\>");

	//Adds first and last class name for styling
	$('#horizontalNav ul.level1nav li:first-child').addClass("first");
	$('#horizontalNav ul.level1nav li:last-child').addClass("last");
	
	//Gives home channel class of selected
	if (jQuery.url.attr("path") == '/portal/site/ipcareers') {
			$('#horizontalNav ul.level1nav li:first-child a.level1').addClass("selected");
	}

	if (jQuery.url.attr("path") == '/portal/site/ipcareers/') {
			$('#horizontalNav ul.level1nav li:first-child a.level1').addClass("selected");
	}

	if (jQuery.url.attr("path") == '/portal/site/ipcareers/home/') {
			$('#horizontalNav ul.level1nav li:first-child a.level1').addClass("selected");
	}
	
	
	//removes _HIDE_GLOBAL_NAV leftNav title
	if ($('#leftNav h1#leftNavTitle').html() =='_HIDE_GLOBAL_NAV') {
		$('#leftNav h1#leftNavTitle').css("display","none");
	}
	
	//removes _HIDE_GLOBAL_NAV breadcrumb
	if ($('#breadcrumbs a:nth-child(2)').html() == '_HIDE_GLOBAL_NAV') {
		$('#breadcrumbs').css("display","none");
	}
	//Old jquery.corners.js method of rounding corners - doesn't work in IE
	//$('#horizontalNav ul.level1nav li a.level1').corners('top');
	//$('#leftNav h1#leftNavTitle').corners('top');
	
	//New DD_Roundies method of rounding corners for IE only
	//DD_roundies.addRule('#horizontalNav ul.level1nav li a.level1', '5px 5px 0 0');
	//DD_roundies.addRule('#leftNav h1#leftNavTitle', '5px 5px 0 0');
	
	//$('#horizontalNav ul.level1nav a.hasSubmenu').after("\<span class=\"showArrow\"\>\<\/span\>");
	
	//$('#leftNav').height($(document).height() - 200);

	function addMega(){
      	$(this).addClass("hovering");
		
		$('#horizontalNav li.hovering div ul.level2nav li').width($('#horizontalNav li.hovering div').width()/$('#horizontalNav li.hovering div a.level2').size() - 1);
		
		
		
		$('#horizontalNav li.hovering div').bgiframe();
	}
      
	function removeMega(){
		$(this).removeClass("hovering");
	}
    
	var megaConfig = {
		interval: 250,
		sensitivity: 4,
		over: addMega,
		timeout: 250,
		out: removeMega
	};
	
	$("a.hasSubmenu").parent().hoverIntent(megaConfig)
});

//]]>
