function CambiarPwd(){
    bool = false; 
    if(document.getElementById('admpwd').value != document.getElementById('admpwd2').value) {
        bool = false;
        alert("Las contraseñas no coinciden");
        document.getElementById('admpwd2').focus();
    }
    else{
        bool = true;
    }        
    if(bool){
        document.getElementById('frmdatos').submit();
    }
}

function contacto(){
    bool = false; 
    if(document.getElementById('Nombre').value == '' || document.getElementById('Nombre').value == 'Nombre') {
        bool = false;
        alert("Nombre obligatorio");
        document.getElementById('Nombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){ 
        if(document.getElementById('Telefono').value == '' || document.getElementById('Telefono').value == 'Tfno') {
            bool = false;
            alert("Telefono obligatorio");
            document.getElementById('Telefono').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){ 
        if(document.getElementById('Observaciones').value == '' || document.getElementById('Observaciones').value == 'Observaciones') {
            bool = false;
            alert("Observaciones obligatorias");
            document.getElementById('Observaciones').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){
        if(document.getElementById('Check').checked != 1){
            alert('Debes aceptar la Ley de Protección de Datos');
        }
        else{
            document.getElementById('frmdatos').submit();
        }
    } 
}
function pedido(){
    bool = false; 
    if(document.getElementById('pedcantidad').value == '') {
        bool = false;
        alert("Cantidad obligatoria");
        document.getElementById('pedcantidad').focus();
    }
    else{
        bool = true;
    }
    if(bool){
        valor = parseInt(document.getElementById('pedcantidad').value);
        if(isNaN(valor)){
            bool = false;
            alert('La cantidad tiene que ser numérica');
            document.getElementById('pedcantidad').focus();
        }
        else{
            document.getElementById('frmpedido').submit();
        }
    } 
}
function consultas(){
    bool = false; 
    if(document.getElementById('contexto').value == '' || document.getElementById('contexto').value == 'Observaciones') {
        bool = false;
        alert("Observaciones obligatorias");
        document.getElementById('contexto').focus();
    }
    else{
        document.getElementById('frmpedido').submit();
    } 
}
function documentacion(){
    bool = false; 
    if(document.getElementById('docnombre').value == '' || document.getElementById('docnombre').value == 'texto') {
        bool = false;
        alert("Nombre obligatorio");
        document.getElementById('docnombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){
        if(document.getElementById('docarchivo').value == '') {
            bool = false;
            alert("Archivo obligatorio");
            document.getElementById('docarchivo').focus();
        }
        else{
            document.getElementById('frmpedido').submit();
        }
    } 
}

function imprSelec(){
    window.print();
    window.history.back();
} 