//New window links
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;

jQuery(document).ready(function(){
	//Accordian sub-menus
	$('#accordion .head').click(function(){
		$(this).next().animate({height: 'toggle'});
		return false;
	}).next().hide();
	$('#accordion .parent a').next().hide();
	$('#accordion ul ul li:last-child').css({'border-bottom':'none'});
	//Gallery menu hover
	$("li.gmenu").hover(function(){
		$(this).find("ul").css({'left':'auto', 'opacity':0}).animate({opacity: 1}, {queue:false, duration: 200});
	}, function(){
		$(this).find("ul").css({'left':'auto'}).animate(
			{opacity: 0},
			{queue:false, duration: 100, complete:
				function(){
					$(this).css({'left':'-9999px'});
				}
			}
		);
	});
});
