/**
 * load javascript library (using JQuery FrameWork) for crabs.com
 * @author Hugo Gomez Mac Gregor hugo@pymenta.com
 */

$().ready(function() {

	var url="/home.aspx";
	$('#splashScreen').jqm({
		overlay:100,
		onHide: function(h) {
			$("#divVideo embed").remove(),
			h.o.fadeOut(666),
			$('#splashScreen').fadeOut(666,function(){window.location=url;})
			
		}
	});
	
	var i =0;
	

	var topShop = 419;
	var topVideo = 378;
	var topResto = 329;
	
	
	function jump(){
		while(i<1){
			$(this).effect("bounce", { times: 4, distance: 25 }, 300,function(){$(this).attr("style","");});
			i++;
		}
	}
	
	function dontJump(){
		$(this).stop(true,true);
		i=0;
		if($(this).parent().get(0).tagName!="A"){
			$(this).animate({"top": "0px"},250,"linear");
		}
	}
	
	$('#splashScreen').jqmShow();
	$("#aspnetForm").show();
	$("#HomePage").removeClass("bodyHomePageWhite");
	$("#divPlato img.shop, #divPlato img.video, #divPlato img.resto").hover(jump,dontJump);

	$("a.shop").click(function(){url="/Departments/Compare-Dinner-Packages.aspx";$('#splashScreen').jqmHide();});
	$("a.video").click(function(){$("#divPlato").fadeOut(500,function(){$("#divVideo").fadeIn(500);});});
	$("a.resto").click(function(){url="/home.aspx";$('#splashScreen').jqmHide();});
	$("#background").click(function(){$('#splashScreen').jqmHide();});
	
	/*$("a.shop").hover(function(){$("h5.shop").show();},function(){$("h5.shop").hide();});
	$("a.video").hover(function(){$("h5.video").show();},function(){$("h5.video").hide();});
	$("a.resto").hover(function(){$("h5.resto").show();},function(){$("h5.resto").hide();});*/

	$("#divVideo a.shop, #divVideo a.resto").click(function(){$("#divVideo embed").remove();});

	
});


