function fValidar(){
    // Varibles de campos y secciones
    var tr_sec_21=document.getElementById("tr_sec_21");
    var cmb_diri_home=document.forms[0].LST_21_124;
    var nombres=document.getElementById("NOMBRES");
    var email=document.getElementById("EMAIL");
    var nombreempresa=document.getElementById("NOMBREEMPRESA");
    var cargoempresa=document.getElementById("CARGOEMPRESA");
    var consulta=document.getElementById("CONSULTA");

    // validar formulario
    if(tr_sec_21!=null){
    if (esVisible('tr_sec_21')){
    if (document.getElementById("hid_valida_124").value=="R"){
    if(cmb_diri_home!=null){
    if (cmb_diri_home.options[cmb_diri_home.selectedIndex].value==-1){
        alert("Ingrese el dirigido a:");
        cmb_diri_home.focus();
        return false;
    }
    }
    }// end if hid_valida_...
    if (document.getElementById("hid_valida_91").value=="R"){
    if(nombres!=null){
    if (!trim(nombres.value)){
        alert("Ingrese el nombres y apellidos:");
        nombres.focus();
        return false;
    }
    }
    }// end if hid_valida_...
    if (document.getElementById("hid_valida_94").value=="R"){
    if(email!=null){
    if (!trim(email.value)){
        alert("Ingrese el e-mail:");
        email.focus();
        return false;
    }
    }
    if(email!=null){
    if (!esCorreo(email.value)){
        alert("Ingrese un correo válido");
        email.focus();
        return false;
    }
    }
    }// end if hid_valida_...
    else if (document.getElementById("hid_valida_94").value=="N"){
    var email=document.getElementById("EMAIL");
    if(email!=null){
    if (trim(email.value)){
    if(email!=null){
    if (!esCorreo(email.value)){
        alert("Ingrese un correo válido");
        email.focus();
        return false;
    }
    }
    }
    }
    }// end else if hid_valida_...
    if (document.getElementById("hid_valida_98").value=="R"){
    if(nombreempresa!=null){
    if (!trim(nombreempresa.value)){
        alert("Ingrese el nombre de la empresa:");
        nombreempresa.focus();
        return false;
    }
    }
    }// end if hid_valida_...
    if (document.getElementById("hid_valida_99").value=="R"){
    if(cargoempresa!=null){
    if (!trim(cargoempresa.value)){
        alert("Ingrese el cargo de la empresa:");
        cargoempresa.focus();
        return false;
    }
    }
    }// end if hid_valida_...
    if (document.getElementById("hid_valida_100").value=="R"){
    if(consulta!=null){
    if (!trim(consulta.value)){
        alert("Ingrese el consulta:");
        consulta.focus();
        return false;
    }
    }
    }// end if hid_valida_...
    }
    }

    // Asigna texto a valor de listas
    if(cmb_diri_home!=null) document.getElementById("hid_lista_124").value=cmb_diri_home.options[cmb_diri_home.selectedIndex].text;

   // Limpiar texto de ayuda


    __doPostBack('ctl00$PortalPlaceHolder$ctl00$btn_Enviar','');
}


