var modalWindow = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,
	close:function()
	{
		$(".modal-window").remove();
		$(".modal-overlay").remove();
		$(".modal-overlay-trans").remove();
	},
	open:function()
	{
		var modal = "";
		modal += "<div class=\"modal-overlay-trans\"></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();});
		$(".modal-overlay-trans").click(function(){modalWindow.close();});
}
};

var openMyModal = function(source)
{
	modalWindow.windowId = "myModal";
	modalWindow.width = 1040;
	modalWindow.height = 640;
	modalWindow.content = "<iframe width='1040' height='640' frameborder='0' scrolling='no' allowtransparency='true' src='" + source + "'></iframe>";
	modalWindow.open();
};
var openMyModal_min = function(source)
{
	modalWindow.windowId = "myModal";
	modalWindow.width = 800;
	modalWindow.height = 600;
	modalWindow.content = "<iframe width='800' height='600' frameborder='0' scrolling='no' allowtransparency='true' src='" + source + "'></iframe>";
	modalWindow.open();
};	
var openMyModal_imgupl = function(source)
{
	modalWindow.windowId = "myModal";
	modalWindow.width = 400;
	modalWindow.height = 300;
	modalWindow.content = "<iframe width='400' height='300' frameborder='0' scrolling='no' allowtransparency='true' src='" + source + "'></iframe>";
//	modalWindow.content = "<div style='width:400px;height:300px;background-color:#fff;' src='http://www.vg.no'>";
//	modalWindow.content += 
//	modalWindow.content += "</div>"


modalWindow.open();
};	
