function ValidateForm(eForm){

    //Campos de asesoramiento-------------------------------------------------------------------------
    if (eForm.asesoramiento){
        box=new Array();
        box=eForm.elements['u[]'];
        myOption = -1;
        for (i=0; i<eForm.tipo.length; i++) {
            if (eForm.tipo[i].checked) {
                myOption = i;
            }
        }
        if (myOption == -1) {
            alert("\nPor favor,\nSeleccione el tipo de obra");
            eForm.tipo[0].focus();
            return false;
        }
        myOption = -1;
        for (i=0; i<eForm.requiere.length; i++) {
            if (eForm.requiere[i].checked) {
                myOption = i;
            }
        }
        if (myOption == -1) {
            alert("\nPor favor,\nSeleccione el tipo de servicio que requiere");
            eForm.requiere[0].focus();
            return false;
        }
        myOption = -1;
        for (i=0; i<eForm.cuando.length; i++) {
            if (eForm.cuando[i].checked) {
                myOption = i;
            }
        }
        if (myOption == -1) {
            alert("\nPor favor,\nIndique el momento de implementación");
            eForm.cuando[0].focus();
            return false;
        }
        myOption = -1;
        for (i=0; i<eForm.porque.length; i++) {
            if (eForm.porque[i].checked) {
                myOption = i;
            }
        }
        if (myOption == -1) {
            alert("\nPor favor,\nIndique la causa de su consulta");
            eForm.porque[0].focus();
            return false;
        }
        if (!box[0].checked && !box[1].checked && !box[2].checked && !box[3].checked && !box[4].checked && !box[5].checked && !box[6].checked){
            window.alert("Indique el area de especialización de su consulta");
            box[0].focus();
            return false;
        }
        if (eForm.necesidad.value.length  < 20) {
            window.alert("Ingrese su consulta o necesidad");
            eForm.necesidad.focus();
            return false;
        }
        if (eForm.nombre.value.length < 2) {
            window.alert("Por favor ingrese su Nombre.");
            eForm.nombre.focus();
            return false;
        }
        if (eForm.apellido.value.length < 2) {
            window.alert("Por favor ingrese su Apellido.");
            eForm.apellido.focus();
            return false;
        }
        if (eForm.direccion.value.length < 4) {
            window.alert("Por favor ingrese su Dirección.");
            eForm.direccion.focus();
            return false;
        }
        //  if (eForm.numero.value.length < 1) {
        //     window.alert("Por favor ingrese la Altura.");
        //     eForm.numero.focus();
        //     return false;
        //  }
        if (eForm.codigopostal.value.length < 4) {
            window.alert("Por favor ingrese su Código Postal.");
            eForm.codigopostal.focus();
            return false;
        }
        if (eForm.localidad.value.length < 4) {
            window.alert("Por favor ingrese su Localidad.");
            eForm.localidad.focus();
            return false;
        }
        //   if (eForm.provincia.value.length < 4) {
        //     window.alert("Por favor ingrese su Provincia.");
        //     eForm.provincia.focus();
        //     return false;
        //   }
        if (eForm.telefono.value.length < 10) {
            window.alert("Por favor ingrese su Teléfono, con código de area.");
            eForm.telefono.focus();
            return false;
        }
        if (eForm.mail.value < 7) {
            window.alert("Ingrese su dirección de mail.    ");
            eForm.mail.focus();
            return false;
        }
        if (isEmail(eForm.mail.value) == false) {
            alert("Ingrese una dirección de mail válida.");
            eForm.mail.focus();
            return false;
        }
        if (eForm.empresa.value.length  < 5) {
            window.alert("Ingrese el nombre de su empresa.    ");
            eForm.empresa.focus();
            return false;
        }
        if (eForm.cargo.value.length < 4) {
            window.alert("Por favor ingrese su posición o cargo en la organización a la que pertenece.");
            eForm.cargo.focus();
            return false;
        }

        document.asesoramiento.enviar.disabled = "true";
        document.asesoramiento.enviar.value = "Enviando...";
        setTimeout("document.asesoramiento.submit()", 100);

    }
    //Fin de Campos de asesoramiento-------------------------------------------------------------------------

    //Campos pedidos de cd-------------------------------------------------------------------------
    if (eForm.pida_cd){
        if (eForm.nombre.value.length < 2) {
            window.alert("Por favor ingrese su Nombre.");
            eForm.nombre.focus();
            return false;
        }
        if (eForm.apellido.value.length < 2) {
            window.alert("Por favor ingrese su Apellido.");
            eForm.apellido.focus();
            return false;
        }
        if (eForm.direccion.value.length < 4) {
            window.alert("Por favor ingrese su Dirección.");
            eForm.direccion.focus();
            return false;
        }
        //  if (eForm.numero.value.length < 1) {
        //     window.alert("Por favor ingrese la Altura.");
        //     eForm.numero.focus();
        //     return false;
        //  }
        if (eForm.codigopostal.value.length < 2) {
            window.alert("Por favor ingrese su Código Postal.");
            eForm.codigopostal.focus();
            return false;
        }
        if (eForm.localidad.value.length < 4) {
            window.alert("Por favor ingrese su Localidad.");
            eForm.localidad.focus();
            return false;
        }
        //   if (eForm.provincia.value.length < 4) {
        //     window.alert("Por favor ingrese su Provincia.");
        //     eForm.provincia.focus();
        //     return false;
        //   }
        if (eForm.telefono.value.length < 10) {
            window.alert("Por favor ingrese su Teléfono, con código de area.");
            eForm.telefono.focus();
            return false;
        }
        if (eForm.mail.value < 7) {
            window.alert("Ingrese su dirección de mail.    ");
            eForm.mail.focus();
            return false;
        }
        if (isEmail(eForm.mail.value) == false) {
            alert("Ingrese una dirección de mail válida.");
            eForm.mail.focus();
            return false;
        }
        if (eForm.empresa.value.length  < 5) {
            window.alert("Ingrese el nombre de su empresa.    ");
            eForm.empresa.focus();
            return false;
        }
        if (eForm.cargo.value.length < 4) {
            window.alert("Por favor ingrese su posición o cargo en la organización a la que pertenece.");
            eForm.cargo.focus();
            return false;
        }

        document.pida_cd.enviar.disabled = "true";
        document.pida_cd.enviar.value = "Enviando...";
        setTimeout("document.pida_cd.enviar.submit()", 100);

    }
    //Fin de campos pedidos de cd-------------------------------------------------------------------------

    //Campo de servicio al client y mensaje sencillo------------------------------------------------------------------------
    if (eForm.mensaje_sencillo || eForm.servicio_al_cliente ){
        if (eForm.nombre.value.length < 2) {
            window.alert("Por favor ingrese su Nombre.");
            eForm.nombre.focus();
            return false;
        }
        //  if (eForm.apellido.value.length < 2) {
        //     window.alert("Por favor ingrese su Apellido.");
        //     eForm.apellido.focus();
        //     return false;
        //  }
        if (eForm.mail.value < 7) {
            window.alert("Ingrese su dirección de mail.    ");
            eForm.mail.focus();
            return false;
        }
        if (isEmail(eForm.mail.value) == false) {
            alert("Ingrese una dirección de mail válida.");
            eForm.mail.focus();
            return false;
        }
        if (eForm.telefono.value.length < 10) {
            window.alert("Por favor ingrese su Teléfono, con cdigo de area.");
            eForm.telefono.focus();
            return false;
        }
        if (eForm.mensaje.value.length < 17) {
            window.alert("Por favor ingrese su Mensaje.");
            eForm.mensaje.focus();
            return false;
        }

        if (eForm.mensaje_sencillo){
            document.mensaje_sencillo.enviar.disabled = "true";
            document.mensaje_sencillo.enviar.value = "Enviando...";
            setTimeout("document.mensaje_sencillo.submit()", 100);
        }else{
            document.servicio_al_cliente.enviar.disabled = "true";
            document.servicio_al_cliente.enviar.value = "Enviando...";
            setTimeout("document.servicio_al_cliente.submit()", 100);
        }

    }
//Fin de campo de servicio al client y mensaje sencillo------------------------------------------------------------------------

}
//-------------------------------------------------------------------------------------------------
function isEmail(string) {
    if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}
function SetInitialFocus()
{
    if ("object" == typeof(formu) && "object" == typeof(formu.name))

    {
        formu.name.focus();
    }
}

function click(e) {
    if (document.all) {
        if (event.button==2||event.button==3) {
            alert('Sorry, no right click here!');
            return false;
        }
    }
    if (document.layers) {
        if (e.which == 3) {
            alert(message);
            return false;
        }
    }
}
if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN);
}

document.onmousedown=click;
window.onload = SetInitialFocus;

function mOvr(src,clrOver) {
    if (!src.contains(event.fromElement)) {
        src.style.cursor = 'hand';
        src.bgColor = clrOver;
    }
}
function mOut(src,clrIn) {
    if (!src.contains(event.toElement)) {
        src.style.cursor = 'default';
        src.bgColor = clrIn;
    }
}
function mClk(src) {
    if(event.srcElement.tagName=='TD'){
        src.children.tags('a')[0].click();
    }
}

