var matchStr = "IEMobile|Windows CE|NetFront|PlayStation|PLAYSTATION|like Mac OS X|MIDP|UP\.Browser|Symbian|Nintendo|Android";
var isMobile = navigator.userAgent.match(matchStr) != null;
//alert(isMobile);	
		
$(document).ready(function(){
		if (isMobile){
			$("#parallax>div").addClass("mobile");
			$("#mslogo").addClass("mobile");
		}
		
		/*
		$("#emailSignup").show();
		
		$(".side").sidecontent({
		    classmodifier: "sidecontent",
		    attachto: "leftside",
		    width: "300px",
		    opacity: "1",
		    pulloutpadding: "5",
		    textdirection: "vertical"
		});
		*/
		
		$.history.init(function(url) {});
          
		$(".menu a").click(function(){
			$(".menu a").removeClass('active');
			$(this).addClass("active");
			
			$("body,#parallax>div").clearQueue();
			$.scrollTo($(this).attr("href"),1400, {easing:'swing', offset: {top:-96, left:0}});
			
			if (!isMobile)
			{
				$("#par3").animate({top:"-=180px"},2000, "swing"); 
				$("#par2").animate({top:"+=100px"},2000, "swing");
				$("#par1").animate({top:"+=40px"},2000, "swing");
			}
			$.history.load($(this).attr('href').replace(/^.*#/, ''));
			return false;	
		});

		$("body").bind('mousewheel', function(event, delta) {
			if (!isMobile)
			{
				$("#parallax>div").stop();
				$("#par3").animate({top:"-=18px"},50);
				$("#par2").animate({top:"+=10px"},50);
				$("#par1").animate({top:"+=4px"},50);
			}
			$(".menu a").removeClass('active');
        });

		
		
		var scribd_doc;
		if ($('.foodmenu').length){
			//load the scribd js
			$.getScript('http://www.scribd.com/javascripts/view.js', function(){
				$(".foodmenu a").click(function(obj){
					obj.preventDefault();
					
					var url = $(this).attr('href');
					
					var prefix = '';
					if (url.indexOf('http')<0){
						prefix = 'http://' + document.location.host;
					}
					scribd_doc = scribd.Document.getDocFromUrl(prefix+url,'pub-53568874855958149577' );
					scribd_doc.addParam( 'height', ($(window).height()*.95)-30 );
					scribd_doc.addParam( 'width', ($(window).width()*.8)-30 );

					scribd_doc.addParam( 'jsapi_version', 1 );
					scribd_doc.addParam( 'disable_related_docs', false );
					scribd_doc.addParam( 'hide_disabled_buttons', true );
				
					$.colorbox(	{width:"80%", height:"95%", inline:true, href:"#menuviewer" });
					scribd_doc.write('menuviewer');
								
					return false;
				});
			});
		}
	});
