// JavaScript Document
 
	var status=0;
	var status2=0;
	var status3=0;
	var status4=0;
	var status5=0;
	var status6=0;
	
	function loadPopup(value){
		//alert("loadpop >>"+ value);
		var val=value;
		if(val=="stuff"){
			if(status==0){
				$("#backgroundPopup").css({"opacity": "0.7"});				
				$("#backgroundPopup").fadeIn("slow");
				$("#popupContainer").fadeIn("slow");
				status=1;
			}	
		}
		
		if(val=="magic"){
			if(status2==0){
				$("#backgroundPopup").css({"opacity": "0.7"});				
				$("#backgroundPopup").fadeIn("slow");
				$("#popupContainer2").fadeIn("slow");
				status2=1;
			}
		}
		
		if(val=="safetyImg"){
			if(status3==0){
				$("#backgroundPopup").css({"opacity": "0.7"});				
				$("#backgroundPopup").fadeIn("slow");
				$("#popupContainer3").fadeIn("slow");
				status3=1;
			}
		}
		
        if(val=="jazzActive"){
//            alert(val);
            $("#backgroundPopup").css({"opacity": "0.7"});				
			$("#backgroundPopup").fadeIn("slow");
			$("#popupContainer4").fadeIn("slow"); 
			status4=1;   
        }//endif
        
        if(val=="jazzMode"){
            $("#backgroundPopup").css({"opacity": "0.7"});				
			$("#backgroundPopup").fadeIn("slow");
			$("#popupContainer5").fadeIn("slow"); 
			status5=1;
        }//endif
        
        if(val=="jazzX"){
            $("#backgroundPopup").css({"opacity": "0.7"});				
			$("#backgroundPopup").fadeIn("slow");
			$("#popupContainer6").fadeIn("slow"); 
			status6=1;
        }//endif		
		
		
	}
	function disablePop(){
		//alert("disablePop");
		if(status==1){
			$("#backgroundPopup").fadeOut("slow");
			//$("#popupContainer").fadeOut("slow");
			$("#popupContainer").hide();
			status=0;
		}
		if(status2==1){
			$("#backgroundPopup").fadeOut("slow");
			//$("#popupContainer2").fadeOut("slow");
			$("#popupContainer2").hide();
			status2=0;
		}
		
		if(status3==1){
			$("#backgroundPopup").fadeOut("slow");
			//$("#popupContainer2").fadeOut("slow");
			$("#popupContainer3").hide();
			status3=0;
		}
		
		if(status4==1){
			$("#backgroundPopup").fadeOut("slow");
			//$("#popupContainer2").fadeOut("slow");
			$("#popupContainer4").hide();
			status4=0;
		}
		
		if(status5==1){
			$("#backgroundPopup").fadeOut("slow");
			//$("#popupContainer2").fadeOut("slow");
			$("#popupContainer5").hide();
			status5=0;
		}
		
		if(status6==1){
			$("#backgroundPopup").fadeOut("slow");
			//$("#popupContainer2").fadeOut("slow");
			$("#popupContainer6").hide();
			status6=0;
		}
		
	}
	function centerpop(){
		//alert("centerpop");	 
		var clientWidth = document.documentElement.clientWidth;
		var clientHeight = document.documentElement.clientHeight;
		var popHeight = $("#popupContainer").height();
		var popWidth =$("#popupContainer").width();

		$("#popupContainer").css({
			"position":"absolute", "top": clientHeight/2 - popHeight/2, "left": clientWidth/2-popWidth/2		
		});
		
		$("#backgroundPopup").css({"height": clientHeight});
		
		loadPopup();
	}
	
	
 
