$(document).ready(function() {
	
	$(".primaryNavAnchor").hover(function () {
		$(this).parent().css({'border-bottom' : '2px solid #ec008c'});
	}, 
	function () {
		$(this).parent().css({'border' : 'none'});
	});
	
	
	popup();
	
	$('.galleryImageLink').bind('click', function(){
		//window.location = 'http://somelocation.com';
		// Or, we can grab the HREF from the first anchor:
	    //window.location = $(this).parent().parent().parent('a').attr('href');
	    window.location = $(this).parent().parent().parent().parent('a').attr('href');
	    alert(newUrl);
	});
	
//	 $('#image_rotate').innerfade({
//	 	speed: 'slow',
//	 	timeout: 4000,
//	 	type: 'sequence',
//	 	containerheight: '365px'
//	 });
	 
	 $('.answer').hide();
	 $('.ingredients').hide();
	 
	 $('.question p').hover(function () {
	 	 $(this).css({'text-decoration' : 'underline'});
	 }, 
	 function () {
	     $(this).css({'text-decoration' : 'none'});
	 });
	       	            
	 
	 $('.question').bind("click", function(){
	 	$(this).siblings(".answer").toggle();
	  });
	  
	  $('.ingredLink').bind("click", function(){
	 	$(this).siblings(".ingredients").toggle();
	  });
	  
	
});

function popupWindow(url, name, attributes){
	var newWindow = window.open(url, name, attributes);
	newWindow.focus();
} 


function popup() {
	$('a.popupLink').bind('click', function(e) { popupWindow($(this).attr('href'), $(this).attr('title').replace(/[^A-z]/ig, ''),'width=500, height=500, scrollbars'); e.preventDefault(); });
};

         
         
