var modalWindow = {
	 parent:"body",
	 windowId:null,
	 content:null,
	 width:null,
	 height:null,
	 close:function()
	 {
		  $(".modal-window").remove();
	  	$(".modal-overlay").remove();
	 },
	 open:function()
	 {
		  var modal = "";
		  modal += "<div class=\"modal-overlay\"></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 open_modal = function(source)
{
	source='<embed style="background:#FFF;" wmode="transparent" type="application/x-shockwave-flash" src="pageflipzoom.swf?'+source+'"  name="plugin" height="630" width="900px">'
	 modalWindow.windowId = "myModal";
	 modalWindow.width = 950;
	 modalWindow.height = 630;
	// modalWindow.content = "<iframe id='iframeloco' width='900' height='610' frameborder='0' scrolling='no' allowtransparency='true' src='pageflipzoom.swf?" + source + "'>&lt/iframe>";
	  modalWindow.content = source;
	 modalWindow.open();

};
