/* 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;
	});
	
});

/* New Menu code for squares 
 $(document).ready(function () {  
   
     //Append a div with hover class to all the LI  
     $('#navMenu li').append('<div class="hover"><\/div>');  
   
   
     $('#navMenu li').hover(  
           
         //Mouseover, fadeIn the hidden hover class    
         function() {  
               
             $(this).children('div').stop(true,true).fadeIn('1000');   
           
         },   
       
         //Mouseout, fadeOut the hover class  
         function() {  
           
             $(this).children('div').stop(true,true).fadeOut('1000');      
           
     }).click (function () {  
       
         //Add selected class if user clicked on it  
         $(this).addClass('selected');  
           
     });  
   
 });  
*/
	
	
	//Code for Sliding Shop description
	
$(document).ready(function(){
	
	$.fn.pause = function(duration) {
    $(this).animate({ dummy: 1 }, duration);
    return this;
	};
	
	$speedy = 500;
	
	$("#productDescription").fadeTo(0, 0);
	$(".menuFader").fadeTo("fast", 0.6);	

	$(".menuFader").hover(function(){
	
				$(".menuFader").stop(true).fadeTo($speedy, 0.9);

			}, function() {

				$(".menuFader").stop(true).pause(3000).fadeTo($speedy, 0.6);
			
	});
	
	$(".productInfoButton").toggle(function(){
				$(this).text('Close Information');
				$("#henMenu, .productTable").removeClass('menuFader');
				$("#productDescription").stop(true).fadeTo($speedy, 0.9);
				
			}, function() {
				$(this).text('Product Information');				
				$("#henMenu, .productTable").addClass('menuFader');
				$("#productDescription").stop(true).fadeTo($speedy, 0);
				});
			
	});	

