		   
var status = 0;

function loadPopup(){
	if(status==0){
		$("#popup-background").css({"opacity" : "0.7"});
		$("#popup-background").fadeIn("normal");
		$("#popup").fadeIn("normal");
		status = 1;
	}  
}

function loadPopup2(){
	if(status==0){
		$("#popup-background2").css({"opacity" : "0.7"});
		$("#popup-background2").fadeIn("normal");
		$("#popup2").fadeIn("normal");
		status = 1;
	}  
}

function disablePopup(){
	if(status==1){
		$("#popup-background").fadeOut("normal");
		$("#popup").fadeOut("normal");
		status = 0;
	}
}

function disablePopup2(){
	if(status==1){
		$("#popup-background2").fadeOut("normal");
		$("#popup2").fadeOut("normal");
		status = 0;
	}
}

function centerPopup(){
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popup").height();
	var popupWidth = $("#popup").width();

	$("#popup").css({
		"position": "fixed",
		"top": (windowHeight/2)-(popupHeight/2),
		"left": (windowWidth/2)-(popupWidth/2)
	});

	$("#popup-background").css({
		"height": windowHeight
	});
}

function centerPopup2(){
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#popup2").height();
	var popupWidth = $("#popup2").width();

	$("#popup2").css({
		"position": "fixed",
		"top": (windowHeight/2)-(popupHeight/2),
		"left": (windowWidth/2)-(popupWidth/2)
	});

	$("#popup-background2").css({
		"height": windowHeight
	});
}
