//home
$(function(){
		
			$("#button-two").css({
				opacity: 0.3
			});
			$("#button-three").css({
				opacity: 0.3
			});
$("#button-four").css({
				opacity: 0.3
			});
$("#button-five").css({
				opacity: 0.3
			});
$("#button-six").css({
				opacity: 0.3
			});
		
            $("#topPanel div.button").click(function(){
            	
            	$clicked = $(this);
            	
            	// if the button is not already "transformed" AND is not animated
            	if ($clicked.css("opacity") != "1" && $clicked.is(":not(animated)")) {
            		
            		$clicked.animate({
            			opacity: 1,
            			borderWidth: 5
            		}, 600 );
            		
            		// each button div MUST have a "xx-button" and the target div must have an id "xx" 
            		var idToLoad = $clicked.attr("id").split('-');
            		
            		//we search trough the content for the visible div and we fade it out
            		$("#rightPanel").find("div:visible").fadeOut("fast", function(){
            			//once the fade out is completed, we start to fade in the right div
            			$(this).parent().find("#"+idToLoad[0]).fadeIn();
            		})
            	}
            	
            	//we reset the other buttons to default style
            	$clicked.siblings(".button").animate({
            		opacity: 0.5,
            		borderWidth: 1
            	}, 600 );
            	
            });
		});
//header
$(document).ready(function(){

	$(".menuxx a").hover(function() {
		$(this).next("em").animate({opacity: "show", top: "-8"}, "slow");
	}, function() {
		$(this).next("em").animate({opacity: "hide", top: "-25"}, "fast");
	});


});



//rooms
$(document).ready(function() {
						   
	var hash = window.location.hash.substr(1);
	var href = $('#leftPanel_inner a').each(function(){
		var href = $(this).attr('href');
		if(hash==href.substr(0,href.length-11)){
			var toLoad = hash+'.html #rightPanel_inner';
			$('#rightPanel_inner').load(toLoad)
		}											
	});

	$('#leftPanel_inner a').click(function(){
								  
		var toLoad = $(this).attr('href')+' #rightPanel_inner';
		$('#rightPanel_inner').hide('fast',loadContent);
		$('#load').remove();
		$('#rightPanel_inner').append('<span id="load">LOADING...</span>');
		$('#load').fadeIn('normal');
		window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-11);
		function loadContent() {
			$('#rightPanel_inner').load(toLoad,'',showNewContent())
		}
		function showNewContent() {
			$('#rightPanel_inner').show('normal',hideLoader());
		}
		function hideLoader() {
			$('#rightPanel_inner').fadeOut('normal');
		}
		return false;
		
	});

});
//food
$(function(){
		
$("#food-ftwo").css({
				opacity: 0.3
			});
$("#food-fthree").css({
				opacity: 0.3
			});
		
            $("#inner_left li.fbutton").click(function(){
            	
            	$clicked = $(this);
            	
            	// if the button is not already "transformed" AND is not animated
            	if ($clicked.css("opacity") != "1" && $clicked.is(":not(animated)")) {
            		
            		$clicked.animate({
            			opacity: 1,
            			borderWidth: 5
            		}, 600 );
            		
            		// each button div MUST have a "xx-button" and the target div must have an id "xx" 
            		var idToLoad = $clicked.attr("id").split('-');
            		
            		//we search trough the content for the visible div and we fade it out
            		$("#inner_right").find("div:visible").fadeOut("fast", function(){
            			//once the fade out is completed, we start to fade in the right div
            			$(this).parent().find("#"+idToLoad[0]).fadeIn();
            		})
            	}
            	
            	//we reset the other buttons to default style
            	$clicked.siblings(".fbutton").animate({
            		opacity: 0.5,
            		borderWidth: 1
            	}, 600 );
            	
            });
		});

