var modalWindow = {
	parent:"body",
	windowId:null,
	content:null,
	source:"",
	width:null,
	height:null,
	close:function()
	{
	},
	open:function()
	{
		{
			this.width = 952
		}
		if(!this.height) {
			this.height= 570;
		}
		
		var wUrl = this.source;
		var wName = this.windowId;
		var wFeatures = "resizable=1,scrollbars=0,location=0,width=" + this.width + ",height=" + this.height;
		
		this.content = window.open(wUrl, wName, wFeatures);
		this.content.focus();
	}
};


var modalFreeWindow = {
	parent:"body",
	windowId:null,
	content:null,
	modalClass:"modal-window",
	//width:null,
	//height:null,
	close:function()
	{
		$("." + this.modalClass).remove();
		$(".modal-overlay").remove();
	},
	open:function()
	{
		var modal = "";
		modal += "<div class=\"modal-overlay\"></div>";
		modal += "<div id=\"" + this.windowId + "\" class=\"" + this.modalClass + "\" style=\"width: 100%; height: 100%;\">";
		modal += this.content;
		modal += "</div>";	

		$(this.parent).append(modal);
	},
	openCentered:function()
	{
		var modal = "";
		modal += "<div class=\"modal-overlay\"></div>";
		modal += "<div id=\"" + this.windowId + "\" class=\"" + this.modalClass + "\" style=\"width:" + this.width + "px; height:" + this.height + "px; margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px;\">";
		modal += this.content;
		modal += "</div>";	

		$(this.parent).append(modal);	
	}
};
