var $jM = jQuery.noConflict();

var modalWindow = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,
	close:function()
	{
		$jM(".modal-window").remove();
		$jM(".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>";	

		$jM(this.parent).append(modal);

		$jM(".modal-window").append("<a class=\"close-window\"></a>");
		$jM(".close-window").click(function(){modalWindow.close();});
		$jM(".modal-overlay").click(function(){modalWindow.close();});
	}
};

var openMyModal = function()
{
	source = 'ajaxEmail/index.php';
	modalWindow.windowId = "myModal";
	modalWindow.width = 480;
	modalWindow.height = 450;
	modalWindow.content = "<iframe width='480' height='450' frameborder='0' scrolling='no' allowtransparency='true' src='" + source + "'></iframe>";
	modalWindow.open();
};

var openMyModalRevista = function(edicao)
{
	source = 'revista/index.php?edicao='+edicao;
	modalWindow.windowId = "Revista Cay" + edicao;
	modalWindow.width = 1070;
	modalWindow.height = 570;
	modalWindow.content = "<iframe width='1070' height='570' frameborder='0' scrolling='no' allowtransparency='true' src='" + source + "'></iframe>";
	modalWindow.open();
};

var openMyModalHino = function()
{
	modalWindow.windowId = "Hino";
	modalWindow.width = 650;
	modalWindow.height = 380;
	modalWindow.content = "<iframe width='650' height='380' frameborder='0' scrolling='no' allowtransparency='true' src='hino.html'></iframe>";
	modalWindow.open();
};


var closeMyModal = function()
{
$jM(".close-window").click();
};



