function Noticia() 
{
	this.popup_excluir = false;
	this.popup_impressao = '';
	this.popup_indique = '';
}

Noticia.prototype.flashPlayerVideo = function(urlPlayerVideo)
{
	jan = window.open("","janela","toolbar=no,location=no,menubar=no,scrollbars=no,resizable=no,width=317,height=356,top=0,left=0");
	jan.focus();
	jan.location = urlPlayerVideo;
}

Noticia.prototype.excluir = function(urlExcluir)
{
	if(!this.popup_excluir)
	{
		this.popup_excluir = document.getElementById('layerGeral_popup').innerHTML;
	}	
	else
	{
		document.getElementById('layerGeral_popup').innerHTML = this.popup_excluir;
	}	
	
	document.getElementById('link_excluir').onclick = function (){LinkAjax.send(urlExcluir, 'miolo-excluir', 'carregando-excluir');}//""

	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';
}

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

Noticia.prototype.indique = function(idNoticia, urlIndique)
{
    if(!this.popup_indique)
    {
        this.popup_indique = document.getElementById('layerGeral_popup').innerHTML;
    }   
    else
    {
        document.getElementById('layerGeral_popup').innerHTML = this.popup_indique;
    }   
    
    LinkAjax.send(urlIndique + '/index/indique?idNoticia=' + idNoticia + '&alterar=1', 'miolo-indique', 'carregando-indique', '', 'Noticia.atualizarPopup()');
    
    /*
    document.getElementById('idNoticia_indique').value = idNoticia;
    document.getElementById('imagem_indique').src = urlImagemFoto;
    document.getElementById('titulo_indique').innerHTML = titulo;
    document.getElementById('resumo_indique').innerHTML = resumo;
    document.getElementById('data_indique').innerHTML = dataNoticia;

	if(document.getElementById('field_leiaMais')) // Verifica se o Objeto existe.
		document.getElementById('field_leiaMais').setAttribute("onClick", "Noticia.indiqueFechar();LinkAjax.send('"+ urlLeiaMaisNoticia +"', 'container', 'carregando');");
    */
    
    document.getElementById('layerGeral_popup').style.display = '';
    document.getElementById('layerOpaco_popup').style.display = '';
}

Noticia.prototype.atualizarPopup = function()
{
	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';
}

Noticia.prototype.versaoImpressao = function(idNoticia, urlLeiaMaisNoticia, urlImagemFoto, titulo, texto, dataNoticia)
{
    if(!this.popup_impressao)
    {
        this.popup_impressao = document.getElementById('layerGeral_impressao').innerHTML;
    }   
    else
    {
        document.getElementById('layerGeral_impressao').innerHTML = this.popup_impressao;
    }   
    
    if(urlImagemFoto)
    document.getElementById('imagem_impressao').src = urlImagemFoto;
    if(titulo)
    document.getElementById('titulo_impressao').innerHTML = titulo;
    if(texto)
    document.getElementById('texto_impressao').innerHTML = texto;
    if(dataNoticia)
    document.getElementById('data_impressao').innerHTML = dataNoticia;
	
    document.getElementById('layerGeral_impressao').style.display = '';
    document.getElementById('layerOpaco_impressao').style.display = '';
    
    var pagina = Diversos.getPageSize();
	
	document.getElementById('layerGeral_impressao').style.height = pagina.pageHeight + 'px';
	document.getElementById('layerGeral_impressao').style.width = pagina.pageWidth + 'px';
	
	document.getElementById('layerOpaco_impressao').style.height = pagina.pageHeight + 'px';
	document.getElementById('layerOpaco_impressao').style.width = pagina.pageWidth + 'px';
}

Noticia.prototype.indiqueFechar = function()
{
    document.getElementById('layerOpaco_popup').style.display = 'none';
    document.getElementById('layerGeral_popup').style.display = 'none';
    document.getElementById('layerOpaco_impressao').style.display = 'none';
    document.getElementById('layerGeral_impressao').style.display = 'none';
}

var Noticia = new Noticia();