function PopupManager()
{
	PopupManager.instance = this;
	this.listener = new Array();
}

PopupManager.instance = null;

PopupManager.prototype =  new EventDispatcher();

PopupManager.prototype.name = null;

PopupManager.getInstance = function()
{
	if(PopupManager.instance == null)
	{
		PopupManager.instance = new PopupManager();
	}
	return PopupManager.instance;
}

PopupManager.prototype.windowInstance = null;

PopupManager.prototype.createWindow = function(url, name, params)
{
	if(url.search (/\?{1}/)==-1)
		url+="?popup=1";
	else
		url+="&popup=1";
	this.windowInstance = window.open(url, name, params);
	this.name = name;
	this.windowInstance.focus();
	
}

PopupManager.prototype.dispatchCloseEvent = function()
{
	var event = new Object();
	event.target = this.windowInstance;
	this.dispatchEvent(Event.CLOSE, event);
}



