	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) {

        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 de " + year + " não tem " + day + " dias!");
                dt.focus();
                return false;
            }
        }
        return true; 
    }
