var modalWindow = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,
	close:function()
	{
		$(".modal-window").remove();
		$(".modal-overlay").remove();
		$("div.flashobject").css("visibility", "visible");
		
		$(".sIFR-flash").css("visibility", "visible");
	},
	open:function()
	{
	    $("div.flashobject").css("visibility", "hidden");
		$(".sIFR-flash").css("visibility", "hidden");

		var modal = "";
		modal += "<div class=\"modal-overlay\" style=\"z-index: 100\"></div>";
		modal += "<div id=\"" + this.windowId + "\" class=\"modal-window\" 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);

		$(".modal-window").append("<a class=\"close-window\"></a>");
		$(".close-window").click(function(){modalWindow.close();});
		$(".modal-overlay").click(function(){modalWindow.close();});
	}
};

var openMyModal = function(source)
{
	modalWindow.windowId = "myModal";
	modalWindow.width = 500;
	modalWindow.height = 350;
	modalWindow.content = "<iframe width='500' height='350' style='border: 2px solid #FFFFFF;' scrolling='no' allowtransparency='true' src='" + source + "'>&lt/iframe>";
	modalWindow.open();
};	
