$(function(){
	if(!$.cookie("rotlichtmobi")) {
		StartPopup();
	}

});


function setRotlichtmobi18Cookie() {
	var $cookieOptions = { path: "/" };
	var $cookieName = "rotlichtmobi";
	$.cookie($cookieName, "aelter18", $cookieOptions);
	AusschaltenPopup();
}



function StartPopup() {  
	if($popupStatus==0) {  
		$("#backgroundPopAltersabfrage").css({  
			"opacity": "0.7" 
		});
		$("#backgroundPopAltersabfrage").fadeIn("slow");  
		$("#PopupAltersabfrage").fadeIn("slow");  
		$popupStatus = 1;  
		MittigPopup();
	}
}

function AusschaltenPopup() {  
	if($popupStatus==1){  
		$("#backgroundPopAltersabfrage").fadeOut("slow");  
		$("#PopupAltersabfrage").fadeOut("slow");  
		$popupStatus = 0;  
	}
}

function MittigPopup() {
	if($.browser.msie && parseInt(jQuery.browser.version) < 7) {
		var windowWidth = $("body").innerWidth();
		var windowHeight = $("body").innerHeight();
	} else {
		var windowWidth = document.documentElement.clientWidth;
		var windowHeight = document.documentElement.clientHeight;
	}
	var popupHeight = $("#PopupAltersabfrage").height();  
	var popupWidth = $("#PopupAltersabfrage").width();  
	$("#PopupAltersabfrage").css({  
		"position": "absolute",
		"top": 50,
		"left": windowWidth/2-popupWidth/2  
	});  
	$("#backgroundPopAltersabfrage").css({  
		"height": windowHeight  
	});  
}



var $stop = false;
var $popupStatus = 0;  


