

$(document).ready(function(){
	
	// fix IE flicker
	if (document.attachEvent) {
			try {
			  document.execCommand("BackgroundImageCache", false, true);
			} catch(err) {}
	}


	//target blank
	$("a[@href^='http://']").attr('target','_blank');
	$("a[@href^='http://']").addClass('extern');
	
	
	$("a[@href$=.pdf]").addClass('pdf');
	$("a[@href$=.doc]").addClass('doc');
	$("a[@href$=.xls]").addClass('xls');
	$("a[@href$=.docx]").addClass('docx');
	$("a[@href^=mailto]").addClass('mailto');
	
	
	//fix the menu
	// add classes to the ul elements to get rid of lines
	$('ul li:first-child').addClass('first');
	$('ul li:last-child').addClass('last');
	$('ul li:last-child ul').addClass('last');
	
	// deactivate the first level elements of the menu
//	$("#navwrp ul:first > li > a").attr('href','').css('cursor','default').click(function(){
//		$(this).blur();
//		return false
//	});
	
	// make the menu hide any submenus on mouseover + show target menu
/*	$("#navwrp ul:first > li").mouseover(function(){
		$("#navwrp ul ul").css('display','none');
		/*$(this).addClass('sfhover');	*/	
		/*$(this).children('ul').css('display','block'); 
		$("#navwrp li.active ul").css('display','block');
	}); */
	/*
	// make the menu hide any submenus on mouseover + show target menu
	$("#navwrp ul:first > li").mouseover(function(){
		//$("#navwrp ul ul").css('display','none');
		$(this).addClass('sfhover');
		$(this).css('background','orange');		
		$(this).children('ul').css('display','block');
		$("#navwrp li.active ul").css('display','block');
	});
	// hide menus on mouseout
	$("#navwrp ul:first > li").mouseout(function(){
		$(this).removeClass('sfhover');
		$("#navwrp ul ul").css('display','none');
		$("#navwrp li.active ul").css('display','block');
		$(this).css('background','none');
	});	
		*/
	
	// IE 
	if (jQuery.browser.msie && jQuery.browser.version=="6.0") {
		$("#navwrp ul li ul li a").mouseover(function(){
			$(this).addClass('ienavfix');
		});	
		
		$("#navwrp ul li ul li a").mouseout(function(){
			$(this).removeClass('ienavfix');
		});	
	}

	
});

/******		GOOGLE ANALYTICS 			********/
function executeAnalytics1(){
	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"));
}

function executeAnalytics2(){
	try {
		var pageTracker = _gat._getTracker("UA-2417173-19");
		pageTracker._trackPageview();
	} catch(err) {}
}
