$(document).ready(function(){
	
	$("#contactform").validate();
	$('#contactform').submit(function(){
		$("#maincontent").css("right", "3840px")
	});
	//add active class to menu items clicked
	$("ul.nav-menu li a").click(function(e){
		e.preventDefault();
		$("ul.nav-menu li a").removeClass('active');
		$(this).addClass('active');
	});
	
	//move the #maincontainer to show #home
	$("ul.nav-menu li a#linkhome").click(function(){
		$("#maincontainer").animate({
			right:'0',
			opacity:0.5
		}, 300, function(){
			$('#maincontainer').animate({opacity:1},300);});
			
		//animate the height of the div to bring the footer up or down
		var mainheight = $("#home").height();
		$("#main").animate({height:mainheight + "px"},300);});
	
	//move the #maincontainer to show #prices
	$("ul.nav-menu li a#linkprices").click(function(){
		$("#maincontainer").animate({
			right:'960px',
			opacity:0.5
		}, 300, function(){
			$('#maincontainer').animate({opacity:1},300);});
			
		//animate the height of the div to bring the footer up or down
		var mainheight = $("#prices").height();
		$("#main").animate({height: mainheight + "px"}, 300);});
	
	//move the #maincontainer to show #about
	$("ul.nav-menu li a#linkabout").click(function(){
		$("#maincontainer").animate({
			right:'1920px',
			opacity:0.5
		}, 300, function(){
			$('#maincontainer').animate({opacity:1},300);});
			
		//animate the height of the div to bring the footer up or down
		var mainheight = $("#about").height();
		$("#main").animate({height: mainheight + "px"}, 300);});
		
	//move the #maincontainer to show #gallery
	$("ul.nav-menu li a#linkgallery").click(function(){
		$("#maincontainer").animate({
			right:'2880px',
			opacity:0.5
		}, 300, function(){
			$('#maincontainer').animate({opacity:1},300);});
			
		//animate the height of the div to bring the footer up or down
		var mainheight = $("#gallery").height();
		$("#main").animate({height: mainheight + "px"},300);});
		
	//move the #maincontainer
	$("ul.nav-menu li a#linkcontact").click(function(){
		$("#maincontainer").animate({
			right:'3840px',
			opacity:0.5
			}, 300, function()
		{$('#maincontainer').animate({opacity:1},300);
		});
		var mainheight = $("#contact").height();
		$("#main").animate({height: mainheight + "px"},300);		
	});
	

});
