

//Popupvariable
//0=disabled, 1=enabled


var anfahrtStatus= 0;
var textStatus = 0;

//popup laden
function loadAnfahrt(){
      var div = document.getElementById("popupAnfahrt");
	  alert(div.id);
	  $("div.id").fadeIn("slow");
	if(anfahrtStatus==0){
         centerAnfahrt();
  	     $("#popupBackground").css({
		"opacity": "0.7"
	     });
	     $("#popupBackground").fadeIn("slow");
	     
         anfahrtStatus = 1;
	}
}

function disableAnfahrt(){
	if(anfahrtStatus==1){
	     $("#popupAnfahrt").fadeOut("slow");
	     $("#popupBackground").fadeOut("slow");
             anfahrtStatus = 0;
	}
}

//popup zentrieren
function centerAnfahrt(){
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popupAnfahrt").height();
	var popupWidth = $("#popupAnfahrt").width();
	//centering
	$("#popupAnfahrt").css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
	//only need force for IE6
	
	$("#popupBackground").css({
		"height": windowHeight
	});
}

function disableBackground(){
	if(anfahrtStatus==1){
		disableAnfahrt();
	}
}
					var locationStatus = 0;
					$(function() {
						$("ul.tabs").tabs("div.panes > div");
					});
					
					function bildLaden (bild) {
 						$.get('request.php', {'pic' : bild }, function(data) {
  							$("#grossesBild").html(data);
							showPic();
						});
					}
					
					function showPic(){
						if(locationStatus==0){
            
  	     				$("#locationBackground").css({
							"opacity": "0.7"
	    				 });
						 var windowWidth = document.documentElement.clientWidth;
						 var windowHeight = document.documentElement.clientHeight;
						 var popupHeight = $("#grossesBild").height();
						 var popupWidth = $("#grossesBild").width();
						//centering
						$("#grossesBild").css({
						"position": "absolute",
						"top": windowHeight/2-popupHeight/2,
						"left": windowWidth/2-popupWidth/2
						});
	    				 $("#locationBackground").fadeIn("slow");
	     				 $("#grossesBild").fadeIn("slow");
						 locationStatus = 1; 
						}
					}
					
					function disableLocation(){
						if(locationStatus==1){
	    					$("#grossesBild").fadeOut("slow");
	     					$("#locationBackground").fadeOut("slow");
             				locationStatus = 0;
						}
					}
			



