$(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');
	});
	// hide menus on mouseout
	$("#navwrp ul:first > li").mouseout(function(){
		$(this).removeClass('sfhover');
		$("#navwrp ul ul").css('display','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');
		});	
	}

	
});
