var config2 = {	over: showTable,	timeout: 320,	out: hideTable	};
function hidePopups(){$("#facebook").hide(); $("#twitter").hide();	$("#youtube").hide(); $("#yelp").hide(); $("#flickr").hide();}
function hidePopup(){hidePopups();}
function showTable(){$(this).find("#nutritiontable").fadeIn(600);}
function hideTable(){$(this).find("#nutritiontable").fadeOut(350);}
 
$(document).ready(function(){
 
  $("ul#navigation li").hover(
	function () {if($(this).find("ul.subholder").length > 0){$(this).find("ul.subholder").show();}}, 
	function () {if($(this).find("ul.subholder").length > 0){	$(this).find("ul.subholder").hide();}}
  );
  $("#nutritbtn").hoverIntent( config2 );	

	$("img.icon").hover(
	function() { hidePopups();
			var idstripped = $(this).attr('id').replace('link', '');
			$("#" + idstripped).fadeIn(500);
			$("#" + idstripped).hover(
				function () { }, function () {$(this).fadeOut(300);}
			);},
	function() {
		this.src = this.src.replace("_hover.png",".png");
		}
	);
	
	$("ul#featuredlogos > li").hover(		
		function () {$(this).children('.quotebox').fadeIn(500);}, 
		function () {$(this).children('.quotebox').hide(0);}
	);
	
	$(".box_gallery .box_img").hover(function(){$(this).children("h5").slideDown(200);},function(){$(this).children("h5").slideUp(100);})
    $(".recipeul .li:has(> .subul)").hover(function(){$(this).children(".subul").fadeIn(300);},function(){$(this).children(".subul").stop(true,true).hide(0);})
	$(".opquescreen").click(function(){$(".popupx").hide(0); $(this).hide(0)})
 });
function openpopup(el,ifopaq)
{	
	if(ifopaq==1) $(".opquescreen").show(0); 
	$(".opquescreen").height($("html").height());
	$(el).show(0);
	var eloffset=$(el).offset();
	var verdis=0;
	if($(el).height()<$(window).height())
	{
		verdis=$(window).height()-$(el).height();
		verdis=parseInt(verdis/2,10);
	}
	verdis=verdis+$("html").scrollTop();
	$(el).css("top",verdis);
} 
