jQuery(document).ready(function(){
	
	var sections = $(".pic");
	var loading  = $("#loading");
	var content  = $("#page");
	

	
	//Manage click events
sections.click(function(){
	//show the loading bar

	switch(this.id){
			case "start":
				content.fadeOut("slow",function(){
					showLoading();
				});
				content.load("/video/ .art-PostContent", function(){
					hideLoading();
					content.fadeIn("slow");
				});
				break;		
			case "haus":
				content.fadeOut("slow",function(){
					showLoading();
				});
				content.load("/haus/ .art-PostContent", function(){
					hideLoading();
					content.fadeIn("slow");
				});
				break;		
			case "kueche":
				content.fadeOut("slow",function(){
					showLoading();
				});
				content.load("/kueche/ .art-PostContent", function(){
					hideLoading();
					content.fadeIn("slow");
				});
				break;		
			case "car":
				content.fadeOut("slow",function(){
					showLoading();
				});
				content.load("/auto/ .art-PostContent", function(){
					hideLoading();
					content.fadeIn("slow");
				});
				break;		
			case "lkw":
				content.fadeOut("slow",function(){
					showLoading();
				});
				content.load("/lkw/ .art-PostContent", function(){
					hideLoading();
					content.fadeIn("slow");
				});
				break;		
			case "bus":
				content.fadeOut("slow",function(){
					showLoading();
				});
				content.load("/bus/ .art-PostContent", function(){
					hideLoading();
					content.fadeIn("slow");
				});
				break;		
			case "camper":
				content.fadeOut("slow",function(){
					showLoading();
				});
				content.load("/camper/ .art-PostContent", function(){
					hideLoading();
					content.fadeIn("slow");
				});
				break;		
			case "zelt":
				content.fadeOut("slow",function(){
					showLoading();
				});
				content.load("/zelt/ .art-PostContent", function(){
					hideLoading();
					content.fadeIn("slow");
				});
				break;		
			case "hammer":
				content.fadeOut("slow",function(){
					showLoading();
				});
				content.load("/hammer/ .art-PostContent", function(){
					hideLoading();
					content.fadeIn("slow");
				});
				break;		
			case "kinderwagen":
				content.fadeOut("slow",function(){
					showLoading();
				});
				content.load("/kinderwagen/ .art-PostContent", function(){
					hideLoading();
					content.fadeIn("slow");
				});
				break;		
			default:
				hideLoading();
				break;
				
		}
	});

	//show loading bar
	function showLoading(){
		loading
			.css({visibility:"visible"})
			.css({opacity:"1"})
			.css({display:"block"})
		;
	}
	//hide loading bar
	function hideLoading(){
		loading
			.css({visibility:"hidden"})
			.css({display:"none"})
		;
	}

});


	