$(document).ready(function(){
	$('#kontakl').css('width', '80px');
	$('#kontakl').css('padding-left', '10px');
	/*
	* Load index page data
	*/
	//---------- 
	$("#Startseite").click(function(){
		//get images top
		var query_img="id=1";
		$.post("?CaseAction=getImages",query_img,
			function(data){
				var imgs = data.split(";");
				if(imgs.length > 1) {
					$('#img_top1').attr('src', 'upload/'+imgs[0]);
					$('#img_top2').attr('src', 'upload/'+imgs[1]);
					$('#img_top3').attr('src', 'upload/'+imgs[2]);
					$('#img_top4').attr('src', 'upload/'+imgs[3]);
				}
			},"html"
		);
		
		/*
		* Load contakt form
		*/
		$('.middle_center').html('<div style="margin:auto; text-align:center;"><img src="templates/default/images/loading.gif" alt="Waiting . . ." /></div>');

		var query="id=1";
		$.post("?CaseAction=showContent",query,
			function(data){
				$('.middle_center').html(data);
			},"html"
		);
	});
	
	$("#backerei").click(function(){
		
		//get images top
		var query_img="id=2";
		$.post("?CaseAction=getImages",query_img,
			function(data){
				var imgs = data.split(";");
				if(imgs.length > 1) {
					$('#img_top1').attr('src', 'upload/'+imgs[0]);
					$('#img_top2').attr('src', 'upload/'+imgs[1]);
					$('#img_top3').attr('src', 'upload/'+imgs[2]);
					$('#img_top4').attr('src', 'upload/'+imgs[3]);
				}
			},"html"
		);
		
		/*
		* Load contakt form
		*/
		$('.middle_center').html('<div style="margin:auto; text-align:center;"><img src="templates/default/images/loading.gif" alt="Waiting . . ." /></div>');

		var query="id=2";
		$.post("?CaseAction=showContent",query,
			function(data){
				$('.middle_center').html(data);
			},"html"
		);
		
	});
	
	$("#konditorei").click(function(){
		
		//get images top
		var query_img="id=3";
		$.post("?CaseAction=getImages",query_img,
			function(data){
				var imgs = data.split(";");
				if(imgs.length > 1) {
					$('#img_top1').attr('src', 'upload/'+imgs[0]);
					$('#img_top2').attr('src', 'upload/'+imgs[1]);
					$('#img_top3').attr('src', 'upload/'+imgs[2]);
					$('#img_top4').attr('src', 'upload/'+imgs[3]);
				}
			},"html"
		);
		
		/*
		* Load contakt form
		*/
		$('.middle_center').html('<div style="margin:auto; text-align:center;"><img src="templates/default/images/loading.gif" alt="Waiting . . ." /></div>');

		var query="id=3";
		$.post("?CaseAction=showContent",query,
			function(data){
				$('.middle_center').html(data);
			},"html"
		);
		
	});
	
	$("#confiserie").click(function(){
		
		//get images top
		var query_img="id=4";
		$.post("?CaseAction=getImages",query_img,
			function(data){
				var imgs = data.split(";");
				if(imgs.length > 1) {
					$('#img_top1').attr('src', 'upload/'+imgs[0]);
					$('#img_top2').attr('src', 'upload/'+imgs[1]);
					$('#img_top3').attr('src', 'upload/'+imgs[2]);
					$('#img_top4').attr('src', 'upload/'+imgs[3]);
				}
			},"html"
		);
		
		
		/*
		* Load contakt form
		*/
		$('.middle_center').html('<div style="margin:auto; text-align:center;"><img src="templates/default/images/loading.gif" alt="Waiting . . ." /></div>');

		var query="id=4";
		$.post("?CaseAction=showContent",query,
			function(data){
				$('.middle_center').html(data);
			},"html"
		);
		
	});
	
	$("#catering").click(function(){
		
		//get images top
		var query_img="id=5";
		$.post("?CaseAction=getImages",query_img,
			function(data){
				var imgs = data.split(";");
				if(imgs.length > 1) {
					$('#img_top1').attr('src', 'upload/'+imgs[0]);
					$('#img_top2').attr('src', 'upload/'+imgs[1]);
					$('#img_top3').attr('src', 'upload/'+imgs[2]);
					$('#img_top4').attr('src', 'upload/'+imgs[3]);
				}
			},"html"
		);
		
		
		/*
		* Load contakt form
		*/
		$('.middle_center').html('<div style="margin:auto; text-align:center;"><img src="templates/default/images/loading.gif" alt="Waiting . . ." /></div>');

		var query="id=5";
		$.post("?CaseAction=showContent",query,
			function(data){
				$('.middle_center').html(data);
			},"html"
		);
		
	});
	
	$("#znuni_bus").click(function(){
		
		//get images top
		var query_img="id=6";
		$.post("?CaseAction=getImages",query_img,
			function(data){
				var imgs = data.split(";");
				if(imgs.length > 1) {
					$('#img_top1').attr('src', 'upload/'+imgs[0]);
					$('#img_top2').attr('src', 'upload/'+imgs[1]);
					$('#img_top3').attr('src', 'upload/'+imgs[2]);
					$('#img_top4').attr('src', 'upload/'+imgs[3]);
				}
			},"html"
		);
		
		
		/*
		* Load contakt form
		*/
		$('.middle_center').html('<div style="margin:auto; text-align:center;"><img src="templates/default/images/loading.gif" alt="Waiting . . ." /></div>');

		var query="id=6";
		$.post("?CaseAction=showContent",query,
			function(data){
				$('.middle_center').html(data);
			},"html"
		);
		
	});
	
	$("#uber_uns").click(function(){
		
		//get images top
		var query_img="id=7";
		$.post("?CaseAction=getImages",query_img,
			function(data){
				var imgs = data.split(";");
				if(imgs.length > 1) {
					$('#img_top1').attr('src', 'upload/'+imgs[0]);
					$('#img_top2').attr('src', 'upload/'+imgs[1]);
					$('#img_top3').attr('src', 'upload/'+imgs[2]);
					$('#img_top4').attr('src', 'upload/'+imgs[3]);
				}
			},"html"
		);
		
		
		/*
		* Load contakt form
		*/
		$('.middle_center').html('<div style="margin:auto; text-align:center;"><img src="templates/default/images/loading.gif" alt="Waiting . . ." /></div>');

		var query="id=7";
		$.post("?CaseAction=showContent",query,
			function(data){
				$('.middle_center').html(data);
			},"html"
		);
		
	});
	
	$("#offene_stellen").click(function(){
		
		//get images top
		var query_img="id=8";
		$.post("?CaseAction=getImages",query_img,
			function(data){
				var imgs = data.split(";");
				if(imgs.length > 1) {
					$('#img_top1').attr('src', 'upload/'+imgs[0]);
					$('#img_top2').attr('src', 'upload/'+imgs[1]);
					$('#img_top3').attr('src', 'upload/'+imgs[2]);
					$('#img_top4').attr('src', 'upload/'+imgs[3]);
				}
			},"html"
		);
		
		
		/*
		* Load contakt form
		*/
		$('.middle_center').html('<div style="margin:auto; text-align:center;"><img src="templates/default/images/loading.gif" alt="Waiting . . ." /></div>');

		var query="id=8";
		$.post("?CaseAction=showContent",query,
			function(data){
				$('.middle_center').html(data);
			},"html"
		);
		
	});
	
	$("#kontakt").click(function(){
		
		//get images top
		var query_img="id=9";
		$.post("?CaseAction=getImages",query_img,
			function(data){
				var imgs = data.split(";");
				if(imgs.length > 1) {
					$('#img_top1').attr('src', 'upload/'+imgs[0]);
					$('#img_top2').attr('src', 'upload/'+imgs[1]);
					$('#img_top3').attr('src', 'upload/'+imgs[2]);
					$('#img_top4').attr('src', 'upload/'+imgs[3]);
				}
			},"html"
		);
		
		/*
		* Load contakt form
		*/
		$('.middle_center').html('<div style="margin:auto; text-align:center;"><img src="templates/default/images/loading.gif" alt="Waiting . . ." /></div>');

		var query="";
		$.post("?CaseAction=contact",query,
			function(data){
				$('.middle_center').html(data);
			},"html"
		);
		
	});
		
});

/*
* Go home page
*/
function goHome() {
	
	var query="";
	$.post("?CaseAction=home",query,
		function(data){
			/*
			* Reload data of home page
			*/
			$(".body_center").html(data);
			$("img").css("border", "0");
			
		},"html"
	);
}

