<!--



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 calculatempo(dia,mes,ano){

    var meio=document.getElementById("futuro")
    meio.innerHTML='Calculando '+ dia.value+'/'+mes.value+'/'+ano.value ;

    //Guarda a página escolhida na variável atual

    xmlhttp.open("GET", "/calculatempo.asp?data="+dia.value+'/'+mes.value+'/'+ano.value,true);

    //Executada quando o navegador obtiver o código
    xmlhttp.onreadystatechange=function() {

        if (xmlhttp.readyState==4){

            //Lê o texto
            var texto=xmlhttp.responseText

            //Desfaz o urlencode
            texto=texto.replace(/\+/g," ")
            texto=unescape(texto)
            texto=unescape(texto);

            //Exibe o texto no div conteúdo
            var meio=document.getElementById("futuro")
            meio.innerHTML=texto

        }
    }
    xmlhttp.send(null);

        return false;

}

function SalvaEnquete(voce,qual,como,nota,nome,ip){

   document.getElementById("enviar").value = 'Salvando... Aguarde!';

    xmlhttp.open("GET", "/SalvaEnquete.asp?voce="+voce.value+"&como="+como.value+"&qual="+qual.value+"&nota="+nota.value+"&nome="+nome.value+"&ip="+ip,true);

    //Executada quando o navegador obtiver o código
    xmlhttp.onreadystatechange=function() {

        if (xmlhttp.readyState==4){

            //Lê o texto
            var texto=xmlhttp.responseText

            //Desfaz o urlencode
            texto=texto.replace(/\+/g," ")
            texto=unescape(texto)
            texto=unescape(texto);

            //Exibe o texto no div conteúdo
            var meio=document.getElementById("enquete")
            meio.innerHTML=texto
            minuto=5000
            setTimeout("timer001()",1.00*minuto)

        }
    }
    xmlhttp.send(null);

        return false;

}

function timer001(){
   top.window.location.href='/';
}


function DeletaMensagem(cod_email){

   var name=confirm("Ao clicar em OK a Mensagem será removida permanentemente.\nTem certeza disso?")
   if (name==true)
   {
   } else {
      return false;
   }

    var meio=document.getElementById(cod_email)
    meio.innerHTML='Removendo...';

    //Guarda a página escolhida na variável atual

    xmlhttp.open("GET", "/ApagarMensagem.asp?codemail="+cod_email,true);

    //Executada quando o navegador obtiver o código
    xmlhttp.onreadystatechange=function() {

        if (xmlhttp.readyState==4){

            //Lê o texto
            var texto=xmlhttp.responseText

            //Desfaz o urlencode
            texto=texto.replace(/\+/g," ")
            texto=unescape(texto)
            texto=unescape(texto);

            //Exibe o texto no div conteúdo
            var meio=document.getElementById(cod_email)
            meio.innerHTML=texto

        }
    }
    xmlhttp.send(null);

        return false;

}

function esconde(campo){
   //document.getElementById(campo).style.width= 0 ; 
   //document.getElementById(campo).style.height= 0 ; 
}


function LerMensagem(cod_email){

    var meio=document.getElementById(cod_email)
    meio.innerHTML='Carregando ...';


    xmlhttp.open("GET", "/LerMensagem.asp?codemail="+cod_email,true);

    //Executada quando o navegador obtiver o código
    xmlhttp.onreadystatechange=function() {

        if (xmlhttp.readyState==4){

            //Lê o texto
            var texto=xmlhttp.responseText

            //Desfaz o urlencode
            texto=texto.replace(/\+/g," ")
            texto=unescape(texto)
            texto=unescape(texto);

            //Exibe o texto no div conteúdo
            var meio=document.getElementById(cod_email)
            meio.innerHTML=texto

        }
    }
    xmlhttp.send(null);

        return false;

}


function inverteMensagem(cod_email,tipo){

   if (tipo == '1') {

      var name=confirm("Ao clicar em OK a Mensagem ficará Pública. Todos poderam vê-la.\nTem certesa disso?")
      if (name==true)
      {
      } else {
         return false;
      }
   }


    var meio=document.getElementById('tipo_'+cod_email)
    meio.innerHTML='Alterando...';


    xmlhttp.open("GET", "/PerfilInverteMensagem.asp?codemail="+cod_email+"&tipo="+tipo,true);

    //Executada quando o navegador obtiver o código
    xmlhttp.onreadystatechange=function() {

        if (xmlhttp.readyState==4){

            //Lê o texto
            var texto=xmlhttp.responseText

            //Desfaz o urlencode
            texto=texto.replace(/\+/g," ")
            texto=unescape(texto)
            texto=unescape(texto);

            meio.innerHTML=texto

        }
    }
    xmlhttp.send(null);

        return false;

}

function disableme (what) {
	what = document.getElementById(what);
	what.disabled = true;
	what.value="uploading...";
}


var none = new Image();
none.src = "/imagens/s0.gif";
var one = new Image();
one.src = "/imagens/s1.gif";
var two = new Image();
two.src = "/imagens/s2.gif";
var three = new Image();
three.src = "/imagens/s3.gif";
var four = new Image();
four.src = "/imagens/s4.gif";
var five = new Image();
five.src = "/imagens/s5.gif";

var clicked = false;

function over (img) {
	if (document.images)
     document.images["stars"].src = eval(img + ".src");
}

function out () {
	if (document.images)
     document.images["stars"].src = eval("none.src");
}

function down (img, rating) {

	//do the remote server call rating from the include file
	if (callToServer(rating)) {
			return true;
		} else {
			if (document.images)
     			none.src = eval(img + ".src");
     			document.images["stars"].src = eval(img + ".src");
			return false;
	}
}

function mostraoculta(obj){

	if(document.getElementById(obj).style.display == 'none'){
		document.getElementById(obj).style.display = '';

        if (obj=='cartaosim') {
         document.novoaniversario.cartao[0].checked==true;
}
        if (obj=='avisarsim') {
         document.novoaniversario.avisar[0].checked==true;
}

	}
	else{
           document.getElementById(obj).style.display = 'none';

           if (obj=='cartaosim') {
              document.novoaniversario.cartao[0].checked==false;
           }
           if (obj == 'avisarsim') {
              document.novoaniversario.avisar[0].checked==false;
           }
}

       // return false;
}


function Deletaaniversario(cod_cal){

   var name=confirm("Ao clicar em OK removerá o aniversariante.\nTem certeza disso?")
   if (name==true)
   {
   } else {
      return false;
   }
    var meio=document.getElementById('aniver_'+cod_cal)
    meio.innerHTML='Removendo...';
    xmlhttp.open("GET", "/Apagaraniversario.asp?codcal="+cod_cal,true);
    xmlhttp.onreadystatechange=function() {

        if (xmlhttp.readyState==4){
            var texto=xmlhttp.responseText
            texto=texto.replace(/\+/g," ")
            texto=unescape(texto)
            texto=unescape(texto);
            meio.innerHTML=texto
        }
    }
    xmlhttp.send(null);

        return false;

}


//-->
