// JavaScript Document

function doSomething() {

	if( $(window).height() > ($("#design").height()+38) ) {
		$("#footer").css("margin-top", $(window).height()-$("#design").height()-38);	
	}
	
	$("#pagecontent_background").css("height", $("#pagecontent").height()+60);
	$("#pagecontent_background").css("top", 150+41+$("#topcontent").height()+40);
	$("#footer").css("top", $(document).height());
	$("#topcontent_background").css("height", $("#topcontent").height()+40);
	
}

$(document).ready(
	function() {
		
		$("#navigation li").click(
			function() {
				window.location.href = $(this).attr("id");	
			}
		);
		
		$(".tooltip").tooltip({
			showURL: false,
			showBody: "::",
			delay: 100
   		});
		
		doSomething();

	}
);

var resizeTimer = null;
$(window).bind('resize',
	function() {
		if (resizeTimer) clearTimeout(resizeTimer);
		resizeTimer = setTimeout(doSomething, 1);
	}
);


function uhrzeit() {
	var date = new Date();
	var year = date.getYear();
	var month = date.getMonth();
	var day = date.getDate();
	var hour = date.getHours();
	var minute = date.getMinutes();
	var second = date.getSeconds();
	var months = new Array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12");
	
	var monthname = months[month];
	
	if (minute < 10) {
	  minute = "0" + minute;
	}
	
	if (second < 10) {
	  second = "0" + second;
	}
	
	if (year < 1900) {
		year += 1900;
	}
	
	$("#aktuellesdatum").text(day+"."+monthname+"."+year);
	$("#aktuelleuhrzeit").text(hour+":"+minute+":"+second);
	setTimeout("uhrzeit()", 1000);
}
uhrzeit();
