function abrir_ventana_tamanio(ventana, ancho, alto) {
    open(ventana, "", "toolbar=no,location=no,directories=no,menubar=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=" + ancho + ",height=" + alto + ", left=" + (screen.width - ancho) / 2 + " , top=" + (screen.height - 50 - alto) / 2 + ",alwaysraised=yes , z-lock=yes , outerwidth=0, outerheight=0");
}

function iSubmitEnter(oEvento, oFormulario){ 
//Copyright © McAnam.com 
     var iAscii; 

     if (oEvento.keyCode) 
         iAscii = oEvento.keyCode; 
     else if (oEvento.which) 
         iAscii = oEvento.which; 
     else 
         return false; 

     if (iAscii == 13) oFormulario.submit(); 

     return true; 
} 

function validar_identificacion(f, idioma) {
    for (var i = 0; i < 2; i++) {
        if (f.elements[i].value == "") {
            if (idioma == "e")
                alert("Mesedez, bete itzazu eremu guztiak.");
            else
                alert("Rellene los campos obligatorios, por favor.");

            f.elements[i].focus();
            return false;
        }
    }
    f.submit();
}

function validar_nueva_actividad(f, idioma) {
    for (var i = 0; i < 5; i++) {
        if (f.elements[i].value == "") {
            if (idioma == "e")
                alert("Mesedez, bete itzazu eremu guztiak.");
            else
                alert("Rellene los campos obligatorios, por favor.");

            f.elements[i].focus();
            return false;
        }
    }
    return true;
}

function eliminar_actividad(id) {
    if (confirm("¿Confirma que desea anular esta actividad?")) {
        document.location.href = "area-privada-actividad-eliminar.asp?ACT_Id=" + id;
    }
}

function validar_busqueda(f, idioma) {
    for (var i = 0; i < 1; i++) {
        if (f.elements[i].value == "") {
            if (idioma == "e")
                alert("Mesedez, bete itzazu eremu guztiak.");
            else
                alert("Rellene los campos obligatorios, por favor.");

            f.elements[i].focus();
            return false;
        }
    }
    f.submit();
}

function validar_contacto(f, idioma) {
    for (var i = 0; i < 5; i++) {
        if (f.elements[i].value == "") {
            if (idioma == "e")
                alert("Mesedez, bete itzazu eremu guztiak.");
            else
                alert("Rellene los campos obligatorios, por favor.");

            f.elements[i].focus();
            return false;
        }
    }
    f.submit();
}

function validar_formulario_proyecto(f, idioma) {
    for (var i = 0; i < 5; i++) {
        if (f.elements[i].value == "") {
            if (idioma == "e")
                alert("Mesedez, bete itzazu eremu guztiak.");
            else
                alert("Rellene los campos obligatorios, por favor.");

            f.elements[i].focus();
            return false;
        }
    }
    f.submit();
}
