// JavaScript Document

function showDiv(div) {
	document.getElementById(div).style.display = 'block';
}

function hideDiv(div) {
	document.getElementById(div).style.display = 'none';
}

function testJquery() {
	var name = document.getElementById("CommentName").value;
	var comment = document.getElementById("CommentText").value;
	
	$.get("/ajax/test.php", { name: name, comment: comment }, function(data){
		alert("Data Loaded: " + data);
	});

}

function testquery() {
	var name = document.getElementById("CommentName").value;
	var comment = document.getElementById("CommentText").value;
	$.post("/ajax/test.php", { name: name, comment: comment }, function(data){
		//$("div#testdiv").fadeIn("slow").before("<p>TEST</p>");
		$("div#newComment").append(data).hide().show("slow");
		//alert("Data Loaded: " + data);
	});
}

function submit_form(form) {
	switch (form) {
		case "kontakt":
			$.post("/ajax/kontakt.php", $("#kontakt_form").serialize(), function(data) { 
				$("div#response").empty();
				$("div#response").html(data).slideDown("slow");
			});
			//alert("Test");
			break;
		default:
			
			break;
	}
}

function doMenuMagic() {
	var windowWidth;
	var windowHeight;
	
	if(window.addEventListener) {
		windowWidth = window.innerWidth;
		windowHeight = document.body.innerHeight;
	}
	else {
		windowWidth = document.documentElement.clientWidth || document.body.clientWidth;
		windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
	}
	
	windowHeight = windowHeight-75;
	document.getElementById("leftMenu").style.height = $(document).height() + 'px'; /*'100%'; /*windowHeight + 'px';*/
}

