var modalWindow = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,
	close:function()
	{
	$(".modal-window").fadeOut('slow');
	$(".modal-window").remove();
		$(".modal-overlay").fadeOut('fast');
		$(".modal-overlay").remove();
			location.reload(true);
	},
	open:function()
	{
		var modal = "";
		modal += "<div class=\"modal-overlay\"></div>";
		modal += "<div id=\"" + this.windowId + "\" class=\"modal-window\" style=\"width:" + this.widthplus + "px; height:" + this.height + "px; margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px;\">";
		modal += "<div class=\"icb\"><div class=\"ibt\"><div></div></div><div class=\"ii1\"><div class=\"ii2\"><div class=\"ii3\">                                <div class=\"icbb cursormove\"><h1 >" + this.title + "</h1>                  </div>";
		modal += this.content;
		modal +="</div>           </div>         </div>        <div class=\"ibb\">            <div></div>        </div>    </div>";		
		modal += "</div>";	

		$(this.parent).append(modal);
		$(".modal-overlay").hide();
		$('.modal-window').hide();
				$(".modal-overlay").fadeIn('fast');
				$(".modal-window").fadeIn('fast');	
		$(".modal-window").append("<a class=\"close-window\"></a>");
		$(".close-window").click(function(){modalWindow.close();});
		$(".modal-overlay").click(function(){modalWindow.close();});
$(".modal-window").draggable();

	}
};



var openMWwh = function(source, width, height , titel)
{
	modalWindow.windowId = "myModal";
	modalWindow.width = width;
	modalWindow.height = height;
	modalWindow.widthplus =eval(width)+40;
	modalWindow.title = titel;
	modalWindow.content = source;
	modalWindow.open();
};

