﻿Util.PopUp = {
	gPopUps: null,
	
	showPopUp : function(aTitle, aSrcURL) {
		if (Util.PopUp.gPopUps == null)
			Util.PopUp.gPopUps = new Array();
		
		if (Util.PopUp.gPopUps[aTitle] == null) {
			Util.PopUp.gPopUps[aTitle] = new Util.PopUp.cPopUp(aTitle, aSrcURL);
		}
		
		Util.PopUp.gPopUps[aTitle].show();
	}
}
/*=======================================================================*/

Util.PopUp.cPopUp = function (aTitle, aSrcURL) {

	this.mWindow = null;
	this.mTitle = aTitle;
	this.mSrcURL = aSrcURL;
	/*
		Currently, hard code window options, but this could be done
		in code.
	*/

/*-------------------------------------------------------------*/

	this.show = function() {
		if (!this.mWindow || this.mWindow.closed){
			this.mWindow = window.open(
				this.mSrcURL,
				this.mTitle,
				"status,height=475,width=600,scrollbars,resizable,menubar"
			)

		} else {
			this.mWindow.focus()	
		}
	}
	
/*-------------------------------------------------------------*/

	this.Test = function(aMsg) {
		alert(aMsg);
	}

/*=======================================================================*/


	
/*=======================================================================*/
} //Util.PopUp.cPopUp


