jQuery(function( $ ){  
		$('#main-container').attr('open' , 'true');
		//$("#reserve-now a").fancybox();
		
		/*
		var height = $('#main-container').height();
		
		if(height < 570) {
			if($.browser.msie == true && $.browser.version <= 6) {
				$('#main-container').height(520);	
			} else {
				$('#main-container').height(490);
			}
		} else {
			if($.browser.msie == true && $.browser.version <= 6) {
				$('#main-container').height(height-50);	
			} else {
				$('#main-container').height(height);
			}
		}
		*/
		
		$('#toggle-btn').click(function() {
			if($('#main-container').attr('open') == 'true') {
				var position = $('#footer-100').position();
				var offset = position.top;
				var offsetpos = offset - 750;

				$('#main-container').slideUp('slow');
				$('html, body').animate({scrollTop:0}, 'slow');
				$('#top-100').height(offset);
				$('#main-container').attr('open' , 'false');
				$('#header-right-container div').fadeOut('slow');	
				$('#toggle-btn').css('background-position', '0px 0px');
			} else {
				$('#main-container').slideDown('slow');
				$('#main-container').attr('open' , 'true');
				$('#header-right-container div').fadeIn('slow');
				$('#toggle-btn').css('background-position', '0px -53px');
			}	
		});	
	  	$('#nav-container ul li a').css('position' , 'relative');
	  	$('#nav-container ul li').hover(function () {
			$(this).find('a').stop().animate({ 
				left: "12"
			}, 200 );
		}, function () {
			$(this).find('a').stop().animate({ 
				left: "0"
			}, 200 );
		});
	  
	  if($('#landing-page').size() > 0){

			function checkPositions() {

				$('#landing-page').height($(document).height());
				$('#left-animation').css(
						'margin-left',($(window).width() / 2) - $('#left-animation').width() + ($('#left-animation .door').width() /2)
				);
					$('#right-animation').css(
						'margin-right',($(window).width() / 2) - $('#right-animation').width() + ($('#right-animation .door').width() /2)
				);
			}

			checkPositions();
			$(window).bind('resize',checkPositions);

			function runAnimation() {
				$('#left-animation,#right-animation').fadeIn(function(){
					$('#landing-page').css('background','none');
				});
				checkPositions()
				setTimeout(function(){
					$('#left-animation').animate({
						'marginLeft': -($('#left-animation').width())
					},2000);
					$('#right-animation').animate({
						'marginRight': -($('#right-animation').width())
					},2000,function(){
						$('#landing-page').remove();
					});
				},2000)
			}
	  		$('#landing-page img').preload({
    			placeholder:'images/loader.gif',
    			onFinish:runAnimation
    		});
	  }
	  
	$('.first-floor').click(function() {
		$('#first-floor-container-right').fadeIn('slow', function() {
		});
		$('#ground-floor-container-right').fadeOut('slow');
		$('#lower-floor-container-right').fadeOut('slow');
	});
	
	$('.ground-floor').click(function() {
		$('#ground-floor-container-right').fadeIn('slow', function() {
		});
		$('#first-floor-container-right').fadeOut('slow');
		$('#lower-floor-container-right').fadeOut('slow');
	});
	
	$('.lower-floor').click(function() {
		$('#lower-floor-container-right').fadeIn('slow', function() {
		});
		$('#ground-floor-container-right').fadeOut('slow');
		$('#first-floor-container-right').fadeOut('slow');
	});

	
	// !!! fix for IE6 !!!
	$('#main-container').slideUp(50);
	$('html, body').animate({scrollTop:0}, 50);
	$('#main-container').slideDown(50);
	
	
});
