function CambiarPwd(){
    bool = false; 
    if(document.getElementById('adm_pwd').value != document.getElementById('adm_pwd2').value) {
        bool = false;
        alert("Las contraseñas no coinciden");
        document.getElementById('adm_pwd2').focus();
    }
    else{
        bool = true;
    }        
    if(bool){
        document.getElementById('frmdatos').submit();
    }
}
function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "','width=800,height=600');");
}
function AceptarCon(){
    if(document.getElementById('realizar').style.display=="block"){
        document.getElementById('realizar').style.display="none";
    }
    else{
        document.getElementById('realizar').style.display="block";
    }
}
function RealizarPedido(){
    bool = false;
    if(document.getElementById('nombre').value == "" || document.getElementById('nombre').value == "nombre") {
        bool = false;
        alert("El nombre es obligatorio");
        document.getElementById('nombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){
        if(document.getElementById('direccion').value == "" || document.getElementById('direccion').value == "calle") {
            bool = false;
            alert("La dirección es obligatoria");
            document.getElementById('direccion').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){
        if(document.getElementById('cp').value == "" || document.getElementById('cp').value == "cp") {
            bool = false;
            alert("El C.P. es obligatorio");
            document.getElementById('cp').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){
        if(document.getElementById('localidad').value == "" || document.getElementById('localidad').value == "localidad") {
            bool = false;
            alert("La localidad es obligatoria");
            document.getElementById('localidad').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){
        if(document.getElementById('provincia').value == "" || document.getElementById('provincia').value == "provincia") {
            bool = false;
            alert("La provincia es obligatoria");
            document.getElementById('provincia').focus();
        }
        else{
            bool = true;
        }
    } 
    if(bool){
        if(document.getElementById('email').value == "" || document.getElementById('email').value == "email") {
            bool = false;
            alert("El email es obligatorio");
            document.getElementById('email').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){
        if(document.getElementById('telefono').value == "" || document.getElementById('telefono').value == "tfno") {
            bool = false;
            alert("El teléfono es obligatorio");
            document.getElementById('telefono').focus();
        }
        else{
            bool = true;
        }
    }       
    if(bool){
        document.getElementById('frmdatos').submit();
    }
}