var modalWindow = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,
	close:function()
	{
		fnClose();
		$(".new-modal-window").remove();
		$(".new-modal-overlay").remove();
	},
	open:function()
	{
		var modal = "";
		modal += "<div class=\"new-modal-overlay\"></div>";
		//modal += "<div id=\"" + this.windowId + "\" class=\"new-modal-window\" style=\"idth:" + this.width + "px; eight:" + this.height + "px; margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px; \">";
		modal += "<div id=\"" + this.windowId + "\" class=\"new-modal-window\" style=\"margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px; \">";
		modal += this.content;
		modal += "</div>";	

		$(this.parent).append(modal);

		$(".new-modal-window").append("<a class=\"new-close-window\"></a>");
		$(".new-close-window").click(function(){modalWindow.close();});
		//$(".new-modal-overlay").click(function(){modalWindow.close();});
	}
};


var modalWindowComment = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,
	close:function()
	{
		$(".new-modal-window").remove();
		$(".new-modal-overlay").remove();
	},
	open:function()
	{
		var modal = "";
		modal += "<div class=\"new-modal-overlay\"></div>";
		//modal += "<div id=\"" + this.windowId + "\" class=\"new-modal-window\" style=\"idth:" + this.width + "px; eight:" + this.height + "px; margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px; \">";
		modal += "<div id=\"" + this.windowId + "\" class=\"new-modal-window\" style=\"margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px; \">";
		modal += this.content;
		modal += "</div>";	

		$(this.parent).append(modal);

		$(".new-modal-window").append("<a class=\"new-close-window\"></a>");
		$(".new-close-window").click(function(){modalWindow.close();});
		//$(".new-modal-overlay").click(function(){modalWindow.close();});
	}
};

var modalWindowNoClose = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,
	close:function()
	{
		$(".new-modal-window").remove();
		$(".new-modal-overlay").remove();
	},
	open:function()
	{
		var modal = "";
		modal += "<div class=\"new-modal-overlay\"></div>";
		//modal += "<div id=\"" + this.windowId + "\" class=\"new-modal-window\" style=\"idth:" + this.width + "px; eight:" + this.height + "px; margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px; \">";
		modal += "<div id=\"" + this.windowId + "\" class=\"new-modal-window\" style=\"margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px; \">";
		modal += this.content;
		modal += "</div>";	

		$(this.parent).append(modal);
	}
};


var modalWindowCVV = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,
	close:function()
	{
		$(".new-modal-window").remove();
		$(".new-modal-overlay").remove();
	},
	open:function()
	{
		var modal = "";
		modal += "<div class=\"new-modal-overlay\"></div>";
		//modal += "<div id=\"" + this.windowId + "\" class=\"new-modal-window\" style=\"idth:" + this.width + "px; eight:" + this.height + "px; margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px; \">";
		modal += "<div id=\"" + this.windowId + "\" class=\"new-modal-window\" style=\"margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px; \">";
		modal += this.content;
		modal += "</div>";	

		$(this.parent).append(modal);

		$(".new-modal-window").append("<a class=\"new-close-window\"></a>");
		$(".new-close-window").click(function(){modalWindow.close();});
		//$(".new-modal-overlay").click(function(){modalWindow.close();});
	}
};

var modalWindowEvent = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,
	close:function()
	{
		$(".new-modal-window").remove();
		$(".new-modal-overlay").remove();
	},
	open:function()
	{
		var modal = "";
		modal += "<div class=\"new-modal-overlay\"></div>";
		//modal += "<div id=\"" + this.windowId + "\" class=\"new-modal-window\" style=\"idth:" + this.width + "px; eight:" + this.height + "px; margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px; \">";
		modal += "<div id=\"" + this.windowId + "\" class=\"new-modal-window\" style=\"margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px; \">";
		modal += this.content;
		modal += "</div>";	

		$(this.parent).append(modal);

		$(".new-modal-window").append("<a class=\"new-close-window\"></a>");
		$(".new-close-window").click(function(){modalWindow.close();});
		//$(".new-modal-overlay").click(function(){modalWindow.close();});
	}
};
function fnClose(){
	var post_vars = {
		'action' 		: "close_request"
	};
	$.post('request_tutor.php', post_vars,
		function(content){
		}
	);
}
