$(document).ready( function() {
	fluidpaddingtop();
	//checkforcookie();
});

$(window).resize( function() {
	fluidpaddingtop();
});

// fluid padding of the body tag towards the flash movie
	function fluidpaddingtop() {
		var maxpaddingtop = 70;
	
		var bodypaddingtop = $('body').css('padding-top');
		bodypaddingtop = parseInt(bodypaddingtop);
		
		var footerlineheight = $('ul#footer a').css('line-height');
		footerlineheight = parseInt(footerlineheight);
	
		var innerheight = $(window).height();
		var flashheight = $('#flash').height();
		
		var contentheight = parseInt(flashheight) + footerlineheight;
		
		if (innerheight > contentheight + maxpaddingtop) {
			$('body').css('padding-top', maxpaddingtop + 'px');
		} else {
			if (innerheight > contentheight + bodypaddingtop) {
				var newbodypaddingtop = innerheight - contentheight;
				$('body').css('padding-top', newbodypaddingtop);
			}
		}	
	}

// flash cookies
	var d = new Date();
	d = new Date(d.getTime() +1000*60*60*24*365*2);
	
	function checkforcookie() {
		if (document.cookie == "") {
			document.cookie = 'wert1=nu1ll; expires='+d.toGMTString()+';';
			document.cookie = 'wert2=nu1ll; expires='+d.toGMTString()+';';
			document.cookie = 'wert3=nu1ll; expires='+d.toGMTString()+';';
			document.cookie = 'wert4=nu1ll; expires='+d.toGMTString()+';';
			document.cookie = 'wert5=nu1ll; expires='+d.toGMTString()+';';
		}
		a = document.cookie;
		var cookievalues = a.split("; ");
		for each (var entry in cookievalues) {
			var entries = entry.split("=");
			if (entries[0] == "wert1") wert1 = entries[1];
			if (entries[0] == "wert2") wert2 = entries[1];
			if (entries[0] == "wert3") wert3 = entries[1];
			if (entries[0] == "wert4") wert4 = entries[1];
			if (entries[0] == "wert5") wert5 = entries[1];
		}
	}
	function newcookievalue(key, value) {
		var d = new Date();
		d = new Date(d.getTime() +1000*60*60*24*365*2);
		document.cookie = key + "=" + value + '; expires='+d.toGMTString()+';';
	}
