// JavaScript Document
$(".geral").corner();

function SomenteNumero(e) {
    var tecla = (window.event) ? event.keyCode : e.which;
    if ((tecla > 47 && tecla < 58)) return true;
    else {
        if (tecla != 8) return false;
        else return true;
    }
}


function Formatadata(Campo, teclapres) {
    var tecla = teclapres.keyCode;
    var vr = new String(Campo.value);
    vr = vr.replace("/", "");
    vr = vr.replace("/", "");
    vr = vr.replace("/", "");
    tam = vr.length + 1;
    if (tecla != 8 && tecla != 8) {
        if (tam > 0 && tam < 2)
            Campo.value = vr.substr(0, 2);
        if (tam > 2 && tam < 4)
            Campo.value = vr.substr(0, 2) + '/' + vr.substr(2, 2);
        if (tam > 4 && tam < 7)
            Campo.value = vr.substr(0, 2) + '/' + vr.substr(2, 2) + '/' + vr.substr(4, 7);
    }
}




function valida_form() {
    with (document.forms[0]) {

        //validacao de radio buttons sem saber quantos sao
        marcado = -1
        for (i = 0; i < aspnetForm.ctl00$ContentPlaceHolder1$radioHoteis.length; i++) {
            if (aspnetForm.ctl00$ContentPlaceHolder1$radioHoteis[i].checked) {
                marcado = i
                resposta = aspnetForm.ctl00$ContentPlaceHolder1$radioHoteis[i].value
            }
        }

        if (marcado == -1) {
            alert("Selecione um tipo de Cromia.");
            aspnetForm.ctl00$ContentPlaceHolder1$radioHoteis[0].focus();
            return false;
        }


    }
}
