function Popup()
{
	this.popup_visualizar = false;
}

Popup.prototype.visualizar = function(url)
{
	if(!this.popup_visualizar)
	{
		this.popup_visualizar = document.getElementById('layerGeral_popup').innerHTML;
	}	
	else
	{
		document.getElementById('layerGeral_popup').innerHTML = this.popup_visualizar;
	}	
	
	document.getElementById('layerGeral_popup').style.display = '';
	document.getElementById('layerOpaco_popup').style.display = '';
	
	var pagina = Diversos.getPageSize();
	
	document.getElementById('layerGeral_popup').style.height = pagina.pageHeight + 'px';
	document.getElementById('layerGeral_popup').style.width = pagina.pageWidth + 'px';
	
	document.getElementById('layerOpaco_popup').style.height = pagina.pageHeight + 'px';
	document.getElementById('layerOpaco_popup').style.width = pagina.pageWidth + 'px';
	
	if(url)
	LinkAjax.send(url, 'principal', 'carregando_principal');
	
	setTimeout("Popup.redimensionar()", 1000)
}

Popup.prototype.redimensionar = function()
{
	var pagina = Diversos.getPageSize();
	document.getElementById('layerOpaco_popup').style.height = pagina.pageHeight + 'px';
	document.getElementById('layerOpaco_popup').style.width = pagina.pageWidth + 'px';
}	

Popup.prototype.visualizarFechar = function()
{
	document.getElementById('layerOpaco_popup').style.display = 'none';
	document.getElementById('layerGeral_popup').style.display = 'none';
}

Popup.prototype.iframe = function(url)
{
	var html  = '<div id="modulo_download">';
		html += '<div class="fechar" align="right" style="padding-right: 10px;">';
		html += '	<a onclick="Popup.visualizarFechar();" class="fechar">Fechar X</a>';
		html += '</div>';
		html += '<iframe scrolling="no" src="'+url+'" height="400px" width="688px" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" frameborder="0" style="border: 0;">';
		html += '</iframe></div>';
	document.getElementById('principal').innerHTML = html;
	
	document.getElementById('layerGeral_popup').style.display = '';
	document.getElementById('layerOpaco_popup').style.display = '';
	
	var pagina = Diversos.getPageSize();
	
	document.getElementById('layerGeral_popup').style.height = pagina.pageHeight + 'px';
	document.getElementById('layerGeral_popup').style.width = pagina.pageWidth + 'px';
	
	document.getElementById('layerOpaco_popup').style.height = pagina.pageHeight + 'px';
	document.getElementById('layerOpaco_popup').style.width = pagina.pageWidth + 'px';
}

var Popup = new Popup();
