var modalWindow = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,
	close:function()
	{
		$('.modal-window').fadeOut(function() { 
											$(".modal-window").remove();
											$(".modal-overlay").remove();
											$('embed, object, select').css({ 'visibility' : 'visible' });
											});
	},
	open:function()
	{
		$('embed, object, select').css({ 'visibility' : 'hidden' });
		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:20px; margin-left:-" + (this.width / 2) + "px;\">";
		//modal += "<div id=\"" + this.windowId + "\" class=\"modal-window\" style=\"width:" + this.width + "px; height:" + this.height + "px;top:100px; left:100px;\">";
		modal += this.content;
		modal += "</div>";	
		$(this.parent).append(modal);
		window.scrollTo(0,document.body.scrollTop + 3);
//		$(".modal-window").append("<a class=\"close-window\"></a>");
//		$(".close-window").click(function(){modalWindow.close();});
//		$(".modal-overlay").click(function(){modalWindow.close();});
	}		
};
var modalWindow2 = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,
	close:function()
	{
		$('.modal-window2').fadeOut(function() { 
											$(".modal-window2").remove();
											$(".modal-overlay2").remove();
											$('embed, object, select').css({ 'visibility' : 'visible' });
											});
	},
	open:function()
	{
		$('embed, object, select').css({ 'visibility' : 'hidden' });
		var modal = "";
		modal += "<div class=\"modal-overlay2\"></div>";
		modal += "<div id=\"" + this.windowId + "\" class=\"modal-window2\" style=\"width:" + this.width + "px; height:" + this.height + "px;\">";
		//modal += "<div id=\"" + this.windowId + "\" class=\"modal-window\" style=\"width:" + this.width + "px; height:" + this.height + "px;top:100px; left:100px;\">";
		modal += this.content;
		modal += "</div>";
		$(this.parent).append(modal);
		window.scrollTo(0,document.body.scrollTop + 3);
		var x = parseInt((screen.width - document.getElementById(this.windowId).offsetWidth)/2);

		$(".modal-window2").css({'top':'50px'});
		$(".modal-window2").css({'left':x});
//		$(".modal-window").append("<a class=\"close-window\"></a>");
//		$(".close-window").click(function(){modalWindow.close();});
//		$(".modal-overlay").click(function(){modalWindow.close();});
	}		
};
var modalWindows = function(content)
	{
		modalWindow.windowId = "modalWindows";
		modalWindow.width = "auto";
		modalWindow.height = "auto";
		modalWindow.content = content;
		modalWindow.open();
	};
var modalWindows2 = function(content)
	{
		modalWindow2.windowId = "modalWindows2";
		modalWindow2.width = "auto";
		modalWindow2.height = "auto";
		modalWindow2.content = content;
		modalWindow2.open();
	};

