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 MM_effectBlind(targetElement, duration, from, to, toggle)
{
    Spry.Effect.DoBlind(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
}

function CambiarFamilia(id,pagina){
    location.href = pagina+".php?idfamilia="+id;
}
function CambiarGenero(id,pagina){
    location.href = pagina+".php?idfamilia="+document.getElementById('idfamilia').value+"&idgenero="+id;
}
function CambiarEspecie(id,pagina){
    location.href = pagina+".php?idfamilia="+document.getElementById('idfamilia').value+"&idgenero="+document.getElementById('idgenero').value+"&idespecie="+id;
}
function CambiarSubespecie(id,pagina){
    location.href = pagina+".php?idfamilia="+document.getElementById('idfamilia').value+"&idgenero="+document.getElementById('idgenero').value+"&idespecie="+document.getElementById('idespecie').value+"&idsubespecie="+id;
}
function CambiarVariedad(id,pagina){
    location.href = pagina+".php?idfamilia="+document.getElementById('idfamilia').value+"&idgenero="+document.getElementById('idgenero').value+"&idespecie="+document.getElementById('idespecie').value+"&idsubespecie="+document.getElementById('idsubespecie').value+"&idvariedad="+id;
}


function Contacto(){
    bool = false; 
    if(document.getElementById('nombre').value == '' || document.getElementById('nombre').value == 'Nombre y apellidos') {
        bool = false;
        alert('Nombre y apellidos obligatorios');
        document.getElementById('nombre').focus();
    }
    else{
        bool = true;
    }
    if(bool){
        if(document.getElementById('email').value == '' || document.getElementById('email').value == 'Correo electrónico') {
            bool = false;
            alert('Email obligatorio');
            document.getElementById('email').focus();
        }
        else{
            bool = true;
        }
    }
    if(bool){
        if(document.getElementById('Comentario').value == '' || document.getElementById('Comentario').value == 'Escriba su comentario') {
            bool = false;
            alert('Comentario obligatorio');
            document.getElementById('Comentario').focus();
        }
        else{
            bool = true;
        }
    } 
    if(bool){
        document.getElementById('frmdatos').submit();
    }   
}
