$(document).ready(function(){
						  
	var ContentVis = 0;

	$('#page-width, #middle').css({	'overflow':'hidden'});
	$('.content-close-link, #p404').show();	

	$('#home,#top').hide();	
	$('#group-dining').hide();
	$('#brasserie').hide();
	$('#cellars').hide();
	$('#menus').hide();
	$('#bookings').hide();
	$('#location').hide();
	$('#joinus').hide();
	$('#p404').hide();
	$('#competition').hide();
	$('#special-offers').hide();
	
	$.urlParam = function(name){ 
	var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); 
	if (!results) { return 0; } 
	return results[1] || 0;} 
	
	var pageval = $.urlParam('page');
	
	if (pageval == '') {
		pageval = "home"
		$('#top').animate({'top': '190px'}, 10);
		$('#nav').animate({'marginTop': '310px'}, 10);
		$('.home').removeClass('nav-off');
		$(".homefooter").show();
	} else {
		$(".homefooter").hide();
	}
	
	if ($('#'+pageval).size() == 1) {	
			$('#'+pageval).show(0);
			$('.'+pageval).addClass(pageval+'-on');
			$('.home').addClass('nav-off');
	} else {
			$('#p404').show(0);
	}
	
	$('.toggleButton').click(function() {
		$(".homefooter").hide();
		if (ContentVis == 0) {
			$('.content').animate({'marginTop': '-355px'}, 400);
			$('.content').animate({'marginTop': '-350px'}, 50);
			$('.content').animate({'marginTop': '-355px'}, 50);
			ContentVis = 1
			$('.toggleText').text('Show Text');
		} else {
			$('.content').animate({'marginTop': '0px'}, 400);
			$('.content').animate({'marginTop': '-5px'}, 50);
			$('.content').animate({'marginTop': '0px'}, 50);
			ContentVis = 0
			$('.toggleText').text('Show Photo');
		}
	});
	
	$('.toggleCellar').click(function() {
		$(".homefooter").hide();
		if (ContentVis == 0) {
			$('.content').animate({'marginTop': '+325px'}, 400);
			$('.content').animate({'marginTop': '+320px'}, 50);
			$('.content').animate({'marginTop': '+325px'}, 50);
			ContentVis = 1
			$('.toggleText').text('Show Text');
		} else {
			$('.content').animate({'marginTop': '0px'}, 400);
			$('.content').animate({'marginTop': '-5px'}, 50);
			$('.content').animate({'marginTop': '0px'}, 50);
			ContentVis = 0
			$('.toggleText').text('Hide Text');
		}
	});

	$('.home').click(function() {
		$(".homefooter").show();
		if (ContentVis == 1) {
			$('.content').animate({'marginTop': '0px'}, 250);
			$('.content').animate({'marginTop': '-5px'}, 50);
			$('.content').animate({'marginTop': '0px'}, 50);
			ContentVis = 0
			$('.toggleText').text('Hide Text');
		}
			$('#top').fadeOut();
			$('.content:not("#home")').hide(350);
			$('#home').delay(250).show("slide", { direction: "right" }, 550);
			$('#top').delay(650).animate({'top': '190px'}, 600);
			$('#middle').animate({'marginTop': '170px', 'marginBottom': '20px'}, 600);
			$('#nav').delay(650).animate({'marginTop': '310px'}, 600);
			$('#page-width').delay(600).animate({backgroundPosition:"(0 0)"}, {duration:1500})

			
			$('.home').removeClass('nav-off');
			$('.brasserie').removeClass('brasserie-on');
			$('.cellar').removeClass('cellar-on');
			$('.menus').removeClass('menus-on');
			$('.bookings').removeClass('bookings-on');
			$('.location').removeClass('location-on');
			$('.joinus').removeClass('special-offers-on');
			$('.group-dining').removeClass('brasserie-on');
			return false;
	});
	
	$('.group-dining').click(function() {
		$(".homefooter").hide();
		if (ContentVis == 1) {
			$('.content').animate({'marginTop': '0px'}, 250);
			$('.content').animate({'marginTop': '-5px'}, 50);
			$('.content').animate({'marginTop': '0px'}, 50);
			ContentVis = 0
			$('.toggleText').text('Hide Text');
		}
			
		$('.content:not("#group-dining")').hide(350);
		$('#group-dining').delay(250).show("slide", { direction: "right" }, 550);
		$('#top').animate({'top': '0px'}, 600).fadeIn();
		$('#middle').animate({'marginTop': '170px', 'marginBottom': '20px'}, 400);
		$('#nav').animate({'marginTop': '120px'}, 600);
		$('#page-width').delay(650).animate({backgroundPosition:"(0 -573px)"}, {duration:1500})
					
		$('.home').addClass('nav-off');
		$('.group-dining').addClass('brasserie-on');
		$('.brasserie').removeClass('brasserie-on');		
		$('.cellar').removeClass('cellar-on');
		$('.menus').removeClass('menus-on');
		$('.bookings').removeClass('bookings-on');
		$('.location').removeClass('location-on');
		$('.joinus').removeClass('special-offers-on');

		$('#image-group-dining').coinslider({
			width: 330,
			height: 220,
			'effect':'straight',
			'spw':'1',
			'sph': '25'
		});
			
			return false;
	});

	$('.brasserie').click(function() {
		$(".homefooter").hide();
		if (ContentVis == 1) {
			$('.content').animate({'marginTop': '0px'}, 250);
			$('.content').animate({'marginTop': '-5px'}, 50);
			$('.content').animate({'marginTop': '0px'}, 50);
			ContentVis = 0
			$('.toggleText').text('Hide Text');
		}
			
		$('.content:not("#brasserie")').hide(350);
		$('#brasserie').delay(250).show("slide", { direction: "right" }, 550);
		$('#top').animate({'top': '0px'}, 600).fadeIn();
		$('#middle').animate({'marginTop': '170px', 'marginBottom': '20px'}, 400);
		$('#nav').animate({'marginTop': '120px'}, 600);
		$('#page-width').delay(650).animate({backgroundPosition:"(0 -573px)"}, {duration:1500})
					
		$('.home').addClass('nav-off');
		$('.brasserie').addClass('brasserie-on');
		$('.cellar').removeClass('cellar-on');
		$('.menus').removeClass('menus-on');
		$('.bookings').removeClass('bookings-on');
		$('.location').removeClass('location-on');
		$('.group-dining').removeClass('brasserie-on');
		$('.joinus').removeClass('special-offers-on');
		$('.group-dining').removeClass('brasserie-on');
		$('#image-brasserie').coinslider({'effect':'straight','spw':'1','sph': '25'});
			
			return false;
	});

	$('.cellar').click(function() {
		$(".homefooter").hide();
		if (ContentVis == 1) {
			$('.content').animate({'marginTop': '0px'}, 250);
			$('.content').animate({'marginTop': '-5px'}, 50);
			$('.content').animate({'marginTop': '0px'}, 50);
			ContentVis = 0
			$('.toggleText').text('Hide Text');
		}
			
		$('.content:not("#cellars")').hide(350);
		$('#cellars').delay(250).show("slide", { direction: "right" }, 550);
		$('#top').animate({'top': '0px'}, 600).fadeIn();
		$('#middle').animate({'marginTop': '120px', 'marginBottom': '70px'}, 600);
		$('#nav').animate({'marginTop': '502px'}, 600);
		$('#page-width').delay(650).animate({backgroundPosition:"(0 -1146px)"}, {duration:1500})
		
		$('.home').addClass('nav-off');
		$('.brasserie').removeClass('brasserie-on');
		$('.cellar').addClass('cellar-on');
		$('.menus').removeClass('menus-on');
		$('.bookings').removeClass('bookings-on');
		$('.location').removeClass('location-on');
		$('.joinus').removeClass('special-offers-on');

		$('.group-dining').removeClass('brasserie-on');
		
		$('#image-cellars').coinslider({
			width: 330,
			height: 220,
			'effect':'straight',
			'spw':'1',
			'sph': '25'
		});
			
			return false;
	});
	
	$('.menus').click(function() {
		$(".homefooter").hide();
		if (ContentVis == 1) {
			$('.content').animate({'marginTop': '0px'}, 250);
			$('.content').animate({'marginTop': '-5px'}, 50);
			$('.content').animate({'marginTop': '0px'}, 50);
			ContentVis = 0
			$('.toggleText').text('Hide Text');
		}
		
			$('.content:not("#menus")').hide(350);
			$('#menus').delay(250).show("slide", { direction: "right" }, 550);
			$('#top').animate({'top': '0px'}, 600).fadeIn();
			$('#middle').animate({'marginTop': '170px', 'marginBottom': '20px'}, 600);
			$('#nav').animate({'marginTop': '120px'}, 600);
			$('#page-width').delay(650).animate({backgroundPosition:"(0 -1719px)"}, {duration:1500})
			
			$('.home').addClass('nav-off');
			$('.brasserie').removeClass('brasserie-on');
			$('.cellar').removeClass('cellar-on');
			$('.menus').addClass('menus-on');
			$('.bookings').removeClass('bookings-on');
			$('.location').removeClass('location-on');
			$('.joinus').removeClass('special-offers-on');
	
		$('.group-dining').removeClass('brasserie-on');
			$('#image-menus').coinslider({
				width: 330, 
				height: 220,
				'effect':'straight',
				'spw':'1',
				'sph': '25'
			});
			
			return false;
	});
	
	$('.bookings').click(function() {
		$(".homefooter").hide();
		if (ContentVis == 1) {
			$('.content').animate({'marginTop': '0px'}, 250);
			$('.content').animate({'marginTop': '-5px'}, 50);
			$('.content').animate({'marginTop': '0px'}, 50);
			ContentVis = 0
			$('.toggleText').text('Hide Text');
		}

		
			$('.content:not("#bookings")').hide(350);
			$('#bookings').delay(250).show("slide", { direction: "right" }, 550);
			$('#top').animate({'top': '0px'}, 600).fadeIn();
			$('#middle').animate({'marginTop': '170px', 'marginBottom': '20px'}, 600);
			$('#nav').animate({'marginTop': '120px'}, 600);
			$('#page-width').delay(650).animate({backgroundPosition:"(0 -2292px)"}, {duration:1500})
			
			$('.home').addClass('nav-off');
			$('.brasserie').removeClass('brasserie-on');
			$('.cellar').removeClass('cellar-on');
			$('.menus').removeClass('menus-on');
			$('.bookings').addClass('bookings-on');
			$('.location').removeClass('location-on');
			$('.joinus').removeClass('special-offers-on');
			$('.group-dining').removeClass('brasserie-on');
			$('#image-bookings').coinslider({
				width: 330,
				height: 220,
				'effect':'straight',
				'spw':'1',
				'sph': '25'
			});
			
			return false;
	});
	
	$('.location').click(function() {
		$(".homefooter").hide();
		if (ContentVis == 1) {
			$('.content').animate({'marginTop': '0px'}, 250);
			$('.content').animate({'marginTop': '-5px'}, 50);
			$('.content').animate({'marginTop': '0px'}, 50);
			ContentVis = 0
			$('.toggleText').text('Hide Text');
		}
			
		
			$('.content:not("#location")').hide(350);
			$('#location').delay(250).show("slide", { direction: "right" }, 550);
			$('#top').animate({'top': '0px'}, 600).fadeIn();
			$('#middle').animate({'marginTop': '120px', 'marginBottom': '70px'}, 600);
			$('#nav').animate({'marginTop': '502px'}, 600);
			$('#page-width').delay(650).animate({backgroundPosition:"(0 -2865px)"}, {duration:1500})
			
			$('.home').addClass('nav-off');
			$('.brasserie').removeClass('brasserie-on');
			$('.cellar').removeClass('cellar-on');
			$('.menus').removeClass('menus-on');
			$('.bookings').removeClass('bookings-on');
			$('.location').addClass('location-on');
			$('.joinus').removeClass('special-offers-on');
			$('.group-dining').removeClass('brasserie-on');
			return false;
	});
	
	$('.special-offers').click(function() {
		$(".homefooter").hide();
		if (ContentVis == 1) {
			$('.content').animate({'marginTop': '0px'}, 250);
			$('.content').animate({'marginTop': '-5px'}, 50);
			$('.content').animate({'marginTop': '0px'}, 50);
			ContentVis = 0
			$('.toggleText').text('Hide Text');
		}

		
			$('.content:not("#special-offers")').hide(350);
			$('#special-offers').delay(250).show("slide", { direction: "right" }, 550);
			$('#top').animate({'top': '0px'}, 400).fadeIn();;
			$('#middle').animate({'marginTop': '170px', 'marginBottom': '20px'}, 600);
			$('#nav').animate({'marginTop': '120px'}, 600);
			$('#page-width').delay(650).animate({backgroundPosition:"(0 -3438px)"}, {duration:1500})
			
			$('.home').addClass('nav-off');
			$('.brasserie').removeClass('brasserie-on');
			$('.cellar').removeClass('cellar-on');
			$('.menus').removeClass('menus-on');
			$('.bookings').removeClass('bookings-on');
			$('.location').removeClass('location-on');
			$('.joinus').removeClass('special-offers-on');
			$('.special-offers').addClass('special-offers-on');
			$('.group-dining').removeClass('brasserie-on');
			return false;
	});
	
	$('.joinus').click(function() {
		$(".homefooter").hide();
		if (ContentVis == 1) {
			$('.content').animate({'marginTop': '0px'}, 250);
			$('.content').animate({'marginTop': '-5px'}, 50);
			$('.content').animate({'marginTop': '0px'}, 50);
			ContentVis = 0
			$('.toggleText').text('Hide Text');
		}

		
			$('.content:not("#joinus")').hide(350);
			$('#joinus').delay(250).show("slide", { direction: "right" }, 550);
			$('#top').animate({'top': '0px'}, 400).fadeIn();;
			$('#middle').animate({'marginTop': '170px', 'marginBottom': '20px'}, 600);
			$('#nav').animate({'marginTop': '120px'}, 600);
			$('#page-width').delay(650).animate({backgroundPosition:"(0 -3438px)"}, {duration:1500})
			
			$('.home').addClass('nav-off');
			$('.brasserie').removeClass('brasserie-on');
			$('.cellar').removeClass('cellar-on');
			$('.menus').removeClass('menus-on');
			$('.bookings').removeClass('bookings-on');
			$('.location').removeClass('location-on');
			$('.joinus').addClass('special-offers-on');
			$('.group-dining').removeClass('brasserie-on');
			return false;
	});
	
}); 
