function PopUpMsg(id){
	this.content = id + " #popUpContent";
	this.bg = id + " #popUpBG";
	this.closePopUp = id + " #popUpClose";
	this.id = id;
	this.popupStatus = 0;
	this.setPosition = true;
	
	this.loadPopup = function(){
		if(this.popupStatus==0){
			this.centerPopup();
			$(this.bg).css({
				"opacity": "0.7"
			});
			$(this.bg).fadeIn("slow");
			$(this.content).fadeIn("slow");
			this.popupStatus = 1;
		}
	}
	
	this.disablePopup = function(){
		//disables popup only if it is enabled
		if(this.popupStatus==1){
			$(this.bg).fadeOut("slow");
			$(this.content).fadeOut("slow");
			this.popupStatus = 0;
		}
	}
	
	this.centerPopup = function(){
		//request data for centering
		var windowWidth = document.documentElement.clientWidth;
		var windowHeight = document.documentElement.clientHeight;
		var popupHeight = $(this.content).height();
		var popupWidth = $(this.content).width();
		//centering
		///*
		if(this.setPosition == true){
			$(this.content).css({
				"position": "absolute",
				"top": windowHeight/2-popupHeight/2,
				"left": windowWidth/2-popupWidth/2
			});
		}
		//*/
		//only need force for IE6
		
		$(this.bg).css({
			"height": windowHeight
		});
		
	}
}
// Use this.loadPupup();
/*
$(document).ready(function(){
	PP = new PopUpMsg("#popUpTest");
	$(PP.closePopUp).click(function(){
		PP.disablePopup();
	});
	$(PP.bg).click(function(){
		PP.disablePopup();
	});
});
*/