try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
       xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
       try{
          xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
       }catch(E){
          xmlhttp = false;
       }
    }
}

function exibeAmigo(id_noticia){
    //Abre a conexão
    xmlhttp.open("GET","amigo.php?id_noticia="+id_noticia,true);
    //Função para tratamento do retorno
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4){
            //Mostra mensagem
            var mensagem    = xmlhttp.responseText;
            mensagem        = mensagem.replace(/\+/g," ");
            mensagem        = unescape(mensagem);
			document.getElementById('noticia-content-opcoes-conteudo').innerHTML=mensagem;
			window.scrollBy(0,250);
			document.frmAmigo.nome.select();
        }
    }
	//Executa
	xmlhttp.send(null);
    return false;
}

function enviaAmigo()
{
    //Abre a conexão
	var id_noticia = document.frmAmigo.id_noticia.value;
	var email = document.frmAmigo.email.value;
	var nome = document.frmAmigo.nome.value;
	var para = document.frmAmigo.para.value;
    xmlhttp.open("GET","envia_amigo.php?id_noticia="+id_noticia+"&email="+email+"&nome="+nome+"&para="+para,true);
    //Função para tratamento do retorno
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4){
            //Mostra mensagem
            var mensagem    = xmlhttp.responseText;
            mensagem        = mensagem.replace(/\+/g," ");
            mensagem        = unescape(mensagem);
			document.getElementById('noticia-content-opcoes-conteudo').innerHTML=mensagem;
        }
    }
	//Executa
	xmlhttp.send(null);
    return false;
}

function exibeContato(id_noticia){
    //Abre a conexão
    xmlhttp.open("GET","noticia_contato.php?id_noticia="+id_noticia,true);
    //Função para tratamento do retorno
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4){
            //Mostra mensagem
            var mensagem    = xmlhttp.responseText;
            mensagem        = mensagem.replace(/\+/g," ");
            mensagem        = unescape(mensagem);
			document.getElementById('noticia-content-opcoes-conteudo').innerHTML=mensagem;
			window.scrollBy(0,380);
			document.frmContato.nome.select();
        }
    }
	//Executa
	xmlhttp.send(null);
    return false;
}

function enviaContato()
{
    //Abre a conexão
	var id_noticia = document.frmContato.id_noticia.value;
	var email = document.frmContato.email.value;
	var nome = document.frmContato.nome.value;
	var cidade = document.frmContato.cidade.value;
	var estado = document.frmContato.estado.value;
	var assunto = document.frmContato.assunto.value;
	var sexo = document.frmContato.sexo.value;
	var mensagem = document.frmContato.mensagem.value;
    xmlhttp.open("GET","envia_noticia_contato.php?id_noticia="+id_noticia+"&email="+email+"&nome="+nome+"&cidade="+cidade+"&estado="+estado+"&assunto="+assunto+"&sexo="+sexo+"&mensagem="+mensagem,true);
    //Função para tratamento do retorno
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4){
            //Mostra mensagem
            var mensagem    = xmlhttp.responseText;
            mensagem        = mensagem.replace(/\+/g," ");
            mensagem        = unescape(mensagem);
			document.getElementById('noticia-content-opcoes-conteudo').innerHTML=mensagem;
        }
    }
	//Executa
	xmlhttp.send(null);
    return false;
}