var popupStatus = 0;

function loadPopup(popupId) {
	/*
	$("#disabledBackground").css({
		"opacity": "0.7"
	});
	
	$("#disabledBackground").fadeIn("fast");*/
	$(popupId).fadeIn("fast");
}

function unloadPopup(popupId) {
	$("#disabledBackground").fadeOut("fast");
	$(popupId).fadeOut("fast");
}

function centerPopup(popupId){
	//request data for centering

	var windowWidth = 0;
	var windowHeight = 0;

	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
 		var ieversion=new Number(RegExp.$1)
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	} else {
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	}

	var popupHeight = $(popupId).height();
	var popupWidth = $(popupId).width();
	
	//centering
	$(popupId).css({
		"position": "absolute",
		"top": 250, //windowHeight / 2 - popupHeight / 2,
		"left": windowWidth / 2 - popupWidth / 2
	});

	//only need for for IE6
	$("#disabledBackground").css({
		"height": windowHeight
	});
}
