/*;jQuery.preloadCssImages=function(settings){settings=jQuery.extend({statusTextEl:null,statusBarEl:null,errorDelay:999,simultaneousCacheLoading:2},settings);var allImgs=[],loaded=0,imgUrls=[],thisSheetRules,errorTimer;function onImgComplete(){clearTimeout(errorTimer);if(imgUrls&&imgUrls.length&&imgUrls[loaded]){loaded++;if(settings.statusTextEl){var nowloading=(imgUrls[loaded])?'Now Loading: <span>'+imgUrls[loaded].split('/')[imgUrls[loaded].split('/').length-1]:'Loading complete';jQuery(settings.statusTextEl).html('<span class="numLoaded">'+loaded+'</span> of <span class="numTotal">'+imgUrls.length+'</span> loaded (<span class="percentLoaded">'+(loaded/imgUrls.length*100).toFixed(0)+'%</span>) <span class="currentImg">'+nowloading+'</span></span>');}
if(settings.statusBarEl){var barWidth=jQuery(settings.statusBarEl).width();jQuery(settings.statusBarEl).css('background-position',-(barWidth-(barWidth*loaded/imgUrls.length).toFixed(0))+'px 50%');}
loadImgs();}}
function loadImgs(){if(imgUrls&&imgUrls.length&&imgUrls[loaded]){var img=new Image();img.src=imgUrls[loaded];if(!img.complete){jQuery(img).bind('error load onreadystatechange',onImgComplete);}else{onImgComplete();}
errorTimer=setTimeout(onImgComplete,settings.errorDelay);}}
function parseCSS(sheets,urls){var w3cImport=false,imported=[],importedSrc=[],baseURL;var sheetIndex=sheets.length;while(sheetIndex--){var cssPile='';if(urls&&urls[sheetIndex]){baseURL=urls[sheetIndex];}else{var csshref=(sheets[sheetIndex].href)?sheets[sheetIndex].href:'window.location.href';var baseURLarr=csshref.split('/');baseURLarr.pop();baseURL=baseURLarr.join('/');if(baseURL){baseURL+='/';}}
if(sheets[sheetIndex].cssRules||sheets[sheetIndex].rules){thisSheetRules=(sheets[sheetIndex].cssRules)?sheets[sheetIndex].cssRules:sheets[sheetIndex].rules;var ruleIndex=thisSheetRules.length;while(ruleIndex--){if(thisSheetRules[ruleIndex].style&&thisSheetRules[ruleIndex].style.cssText){var text=thisSheetRules[ruleIndex].style.cssText;if(text.toLowerCase().indexOf('url')!=-1){cssPile+=text;}}else if(thisSheetRules[ruleIndex].styleSheet){imported.push(thisSheetRules[ruleIndex].styleSheet);w3cImport=true;}}}
var tmpImage=cssPile.match(/[^\("]+\.(gif|jpg|jpeg|png)/g);if(tmpImage){var i=tmpImage.length;while(i--){var imgSrc=(tmpImage[i].charAt(0)=='/'||tmpImage[i].match('://'))?tmpImage[i]:baseURL+tmpImage[i];if(jQuery.inArray(imgSrc,imgUrls)==-1){imgUrls.push(imgSrc);}}}
if(!w3cImport&&sheets[sheetIndex].imports&&sheets[sheetIndex].imports.length){for(var iImport=0,importLen=sheets[sheetIndex].imports.length;iImport<importLen;iImport++){var iHref=sheets[sheetIndex].imports[iImport].href;iHref=iHref.split('/');iHref.pop();iHref=iHref.join('/');if(iHref){iHref+='/';}
var iSrc=(iHref.charAt(0)=='/'||iHref.match('://'))?iHref:baseURL+iHref;importedSrc.push(iSrc);imported.push(sheets[sheetIndex].imports[iImport]);}}}
if(imported.length){parseCSS(imported,importedSrc);return false;}
var downloads=settings.simultaneousCacheLoading;while(downloads--){setTimeout(loadImgs,downloads);}}
parseCSS(document.styleSheets);return imgUrls;};
*/


/*Innerfade Call*/    
/*function displayInnerfade() {
		//document.getElementById("homePlaceHolder").style.display = "none";
    document.getElementById("homeContent").style.display = "block";
}				
setTimeout("displayInnerfade()", 1000 );
*/


/* Begin load when document is ready */    
$(document).ready(function(){
    
    /*preload images call for above plugin 	
		$.preloadCssImages();
    preload images call for above plugin*/ 
 
 
 		/*Main Menu*/
	  $("#menu ul li").hover(
	  		function () {
	        $(this).css("background", "#000000");
	        $(this).css("cursor", "pointer");
	      }, 
	      function () {
	        $(this).css("background", "#7E3817");   
	      }
	      );
	      $("#menu ul li").click(function() {
	      	$("#menu ul li").css("color", "#FFF");
	      	$(this).css("color", "#E6A846");
	      	}
	  ); 
     	
    function clearMainContent() {
	  		//document.getElementById("homeContent").style.display = "none";
	  		document.getElementById("aboutContent").style.display = "none";
	      //document.getElementById("takeoutContent").style.display = "none";
	      document.getElementById("nightlyMusicContent").style.display = "none";
	      document.getElementById("cateringContent").style.display = "none";
	      document.getElementById("directionsContent").style.display = "none";
	      document.getElementById("mediaContent").style.display = "none";
	  }
      	
    $("#menu ul li").each(function(){
	  		$(this).click(function(){
	      		var currentId = $(this).attr('id');
	      		selectedContent = currentId + "Content";
	      		clearMainContent();
	      		if ($("#homeContent").css("display", "block")) {
	      				$("#homeContent").css("display", "none")
	      		}
	      		$("#" + selectedContent).css("display", "block");
	      });
	  });	      
	  /*Main Menu*/   



/*Banner Slider*/
timedBannerToggle = "";

	  $(".bannerSlider").hover(function(){
	  		$(this).animate({
	  			  "right": "-1900px"
				}, "slow");
	  		$(this).next().animate({
	  			  "right": "0px"
				}, "slow");

	  });	 

	  $(".sliderBanner").mouseout(function(){
				openTimer();
	  });	 

	  $(".sliderBanner").mouseover(function(){
				closeTimer();
	  });	

	  $(".bannerContentWrapper").mouseover(function(){
				closeTimer();
	  });	 

		function openTimer() {
				timedBannerToggle = window.setTimeout(showBannerToggle, 500);
		}
		
		function closeTimer() {
				window.clearTimeout(timedBannerToggle);
		}

		function showBannerToggle() {
				if (document.getElementById("bannerContentSlider1").style.right == "0px") {
				  	$("#bannerContentSlider1").prev(".bannerSlider").animate({
			  			  "right": "0px"
						}, "slow");
			  		$("#bannerContentSlider1").animate({
			  			  "right": "-1900px"
						}, "slow");
				}
				if (document.getElementById("bannerContentSlider2").style.right == "0px") {
				  	$("#bannerContentSlider2").prev(".bannerSlider").animate({
			  			  "right": "0px"
						}, "slow");
			  		$("#bannerContentSlider2").animate({
			  			  "right": "-1900px"
						}, "slow");
				}
				if (document.getElementById("bannerContentSlider3").style.right == "0px") {
				  	$("#bannerContentSlider3").prev(".bannerSlider").animate({
			  			  "right": "0px"
						}, "slow");
			  		$("#bannerContentSlider3").animate({
			  			  "right": "-1900px"
						}, "slow");
				}
				if (document.getElementById("bannerContentSlider4")) {
						if (document.getElementById("bannerContentSlider4").style.right == "0px") {
						  	$("#bannerContentSlider4").prev(".bannerSlider").animate({
					  			  "right": "0px"
								}, "slow");
					  		$("#bannerContentSlider4").animate({
					  			  "right": "-1900px"
								}, "slow");
						}
				}
		}

/*Banner Slider*/




	  $("#welcomeTour").click(function(){
	  		$("#homeContent").css("display", "none");
	  		clearMainContent();
	  		$("#welcomeTourContent").css("display", "block");
	  });	 

	  
	  $("#italianFestival").click(function(){
	  		$("#homeContent").css("display", "none");
	  		clearMainContent();
	  		$("#italianFestivalContent").css("display", "block");
	  });	  
	  
	  
	  $("#brunchBanner").click(function(){
	  		$("#homeContent").css("display", "none");
	  		clearMainContent();
	  		$("#BrunchBuffetContent").css("display", "block");
	  });
	  
	  
	  /*Video Menu*/    
	  $("#videoMenu ul li").hover(
	      function () {
	        $(this).css("list-style-type", "circle");
	        $(this).css("cursor", "pointer");
	      }, 
	      function () {
	        $(this).css("list-style-type", "none");  
	      }
	  );
	            
	  function clearVideo() {
	  		document.getElementById("videoTourPlayer").style.display = "none";
	      document.getElementById("videoBreakingBreadPlayer").style.display = "none";
	      document.getElementById("videoGMNewyorkPlayer").style.display = "none";
	  }	      
	      
	  $("#videoMenu ul li").each(function(){
	  		$(this).click(function(){
			      var currentId = $(this).attr('id');
			      selectedContent = currentId + "Player";
			      clearVideo();
			      $("#videoMenu ul li").css("color", "#FFF");
			      $(this).css("color", "red");
			      $("#" + selectedContent).css("display", "block"); 
	  		});
	  }); 
		/*Video Menu*/  	
		
		/*Food Menu*/
		$("#cateringContent ul li").hover( 
	      function () {
	        $(this).css("list-style-type", "circle");
	      }, 
	      function () {
	        $(this).css("list-style-type", "none");   
	      }
	  );
	  /*Food Menu*/  
	      
});
