	function cancelaAssinatua()
	{   
	    sEmail = frmGeral1.str_email.value;
	    strServiceInstUID = frmGeral.strServiceInstUID.value;	
	    
	    if(sEmail==""){
	    alert("Para cancelar sua assinatura preencha seu e-mail.");
		return false;		
	    }
	    //if(confirm('Tem certeza que deseja cancelar sua assinatura?'))
	    frmGeral1.action="services/Websites/NewsLetter/CancelarAssinatura_acao.asp?sServiceInstUID="+strServiceInstUID+"&sEmail="+sEmail+"";
		frmGeral1.submit();
	}
		
	function SomenteNumero()
    {	    
	    if ((event.keyCode != 37) && (event.keyCode != 39) && (event.keyCode != 46) && (event.keyCode != 36) && (event.keyCode != 35))
	    {
		    if  ((event.keyCode != 8) && (event.keyCode != 127) && (event.keyCode !=9))
		    {
			    if (  !((event.keyCode > 47) && (event.keyCode < 58)) && !((event.keyCode > 95) && (event.keyCode < 106)) || event.shiftKey )
			    {
		 		    event.returnValue = false;
			    }
		    }
	    }
    }	
	
	function possuiCartao(id){
    
        frmGeral.cbo_cartaocredito.disabled = true;
    
        if (id == "S")
        {
		    frmGeral.cbo_cartaocredito.disabled = false;
        }
	}
	
	function tipoCartao(id){
	    frmGeral.tipocartao.disabled = true;
	     if (id == 6)
        {
		    frmGeral.tipocartao.disabled = false;
        }
    }
    
    function listaCategoria() {
	 	var f = document.frmGeral
        var div = document.getElementById("listaCat");
        var categoria = f.document.getElementById("cbo_recebeinfo");		
        if (f.cbo_recebeinfo.value == "N" || f.cbo_recebeinfo.value == "") {
           div.className = "some";
        } else {            
             div.className = "mostra";           
        }
    }
    
    function tipoCartao() {
	 	var f = document.frmGeral
        var div = document.getElementById("cartaoCredito");
        var categoria = f.document.getElementById("cbo_possuicartao");		
        if (f.cbo_possuicartao.value == "N") {
           div.className = "some";
        } else {            
           div.className = "mostra";           
        }
    }
  
    function isDate(dateStr) {
        
        if(dateStr != ""){
            var datePat = /^(\d{1,2})(\/)(\d{1,2})(\/)(\d{4})$/;       
            var matchArray = dateStr.match(datePat);
            var dt=document.frmGeral.str_datanascimento;

            if (matchArray == null) {
                alert("Digite a data no seguintte formato: dd/mm/aaaa.");
                dt.focus();
                return false;
            }

            month = matchArray[3]; 
            day = matchArray[1];
            year = matchArray[5];

            if (month < 1 || month > 12) { 
                alert("Digite um mês entre 1 e 12.");
                dt.focus();
                return false;
            }

            if (day < 1 || day > 31) {
                alert("Digite um dia entre 1 e 31.");
                dt.focus();
                return false;
            }

            if ((month==4 || month==6 || month==9 || month==11) && day==31) {
                alert("O Mês "+month+" não tem 31 dias!")
                dt.focus();
                return false;
            }

            if (month == 2) { 
            var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
                if (day > 29 || (day==29 && !isleap)) {
                    alert("O mês de Fevereiro não tem " + day + " dias!");
                    dt.focus();
                    return false;
                }
            }
            return true;
        } 
    }
    
    	
    function mascara(o,f){
     
    v_obj=o
     
    v_fun=f
     
    setTimeout("execmascara()",1)
     
    }
     
     
     
    function execmascara(){
     
        v_obj.value=v_fun(v_obj.value)
     
    }
     
     
     
    function leech(v){
     
        v=v.replace(/o/gi,"0")
     
        v=v.replace(/i/gi,"1")
     
        v=v.replace(/z/gi,"2")
     
        v=v.replace(/e/gi,"3")
     
        v=v.replace(/a/gi,"4")
     
        v=v.replace(/s/gi,"5")
     
        v=v.replace(/t/gi,"7")
     
        return v
     
    }
      
     
    function Ncpf(v){
     
        v=v.replace(/\D/g,"")                    //Remove tudo o que não é dígito
     
        v=v.replace(/(\d{3})(\d)/,"$1.$2")       //Coloca um ponto entre o terceiro e o quarto dígitos
     
        v=v.replace(/(\d{3})(\d)/,"$1.$2")       //Coloca um ponto entre o terceiro e o quarto dígitos
     
                                                 //de novo (para o segundo bloco de números)
     
        v=v.replace(/(\d{3})(\d{1,2})$/,"$1-$2") //Coloca um hífen entre o terceiro e o quarto dígitos
     
        return v
     
    }