/* Script to launch link whilst still being strict compliant */
function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externalLinks;

/* Add href to entire li so all is clickable */

$(document).ready(function(){

	$("#nav li").click(function(){
	  window.location=$(this).find("a").attr("href"); return false;
	});
	
});

/* apply the colour of the link to a when hovering over li*/

$(function(){
    $('#nav li').hover(function(){
        $(this).find("a").css({'color':'#333'}); return false;
    },function(){
        $(this).find("a").css({'color':'#999'}); return false;
    });
});


/* Fade out nav bar when user first enters page */

$(document).ready(function(){
						   
	$("#nav a").animate({opacity: 1}, 3000).fadeTo("slow", 0.3);
	
});


/* Fade in Nav bar */
					   
$(document).ready(function(){
						   
	$("#nav").hover(function(){
		$("#nav a").stop().fadeTo("fast", 1.0);
	
	},function(){
		$("#nav a").stop().fadeTo("slow", 0.3);
	});	
	
	
});



