function cargaPagina(div, pagina){
    var nombreDiv=document.getElementById(div);

    ajax=nuevoAjax();
    //ajax.open("GET", pagina, true);
    ajax.open("POST", pagina, true);
    ajax.onreadystatechange=function() 
        { 
            if (ajax.readyState==1)
            { 
                nombreDiv.innerHTML="Cargando...";
            }
            if (ajax.readyState==4)
            { 
                nombreDiv.innerHTML=ajax.responseText;
            } 
	}
    ajax.send(null);	
}

function nuevoAjax()
{ 
    /* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por
    lo que se puede copiar tal como esta aqui */
    var xmlhttp=false; 
    try 
    { 
        // Creacion del objeto AJAX para navegadores no IE
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
    }
    catch(e)
    { 
        try
	{ 
            // Creacion del objet AJAX para IE 
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
	} 
	catch(E) { xmlhttp=false; }
    }
    if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); } 
    return xmlhttp; 
}


function nuevaVentana() {
    open("http://chat.empleover.gob.mx/livehelp.php?department=1","Ayuda en Linea","scrollbars=no,resizable=no,width=600,height=450,status=no,location=no,toolbar=no");
}

function soloNumeros(e) {
    tecla = (document.all) ? e.keyCode : e.which;
    if (tecla==8 || tecla == 0) return true; //Tecla de retroceso (para poder borrar)
    patron = /\d/;
    te = String.fromCharCode(tecla);
    return patron.test(te);
} 


function cargaCP(valor) {
    if (valor == '1')
        document.location = 'registroDatosDomicilio.jsp?cp='+document.getElementById('textCP').value;
    else
        document.location = 'modificaDatosDomicilio.jsp?cp='+document.getElementById('textCP').value;
}

function validaFormaContacto() {
    if ( (document.getElementById('textContactoNombre').value != '' && !cadenaVacia(document.getElementById('textContactoNombre').value)) &&
        (document.getElementById('textContactoMail').value != '' && !cadenaVacia(document.getElementById('textContactoMail').value)) &&
        (document.getElementById('textContactoMensaje').value != '' && !cadenaVacia(document.getElementById('textContactoMensaje').value))) {
        if (validaMail(document.getElementById('textContactoMail').value))
            document.formaContacto.submit();
        else 
            alert('Formato de correo electrónico incorrecto');
    }
    else {
        alert('Debe llenar todos los campos');
    }
}

function validaFormaRecuperaReactivaCuenta() {
    if (validaMail(document.getElementById('textCorreoElectronico').value))
        document.formaSolicitaNuevoPass.submit();
    else
        alert ('Formato de correo electrónico incorrecto');
}

function cargaCPCol(valor) {
    if (valor == '1')
        document.location = 'registroDatosDomicilio.jsp?col='+document.getElementById('comboColonias').value;
    else
        document.location = 'modificaDatosDomicilio.jsp?col='+document.getElementById('comboColonias').value;
}

function validaMail(txt){
	
	//expresion regular
        //var b=/^[^@\s]+@[^@\.\s]+(\.[^@\.\s]+)+$/
        
        var b=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
        
        //comentar la siguiente linea si no se desea que aparezca el alert()
        //alert("Email " + (b.test(txt)?"":"no ") + "válido.")
        
        //devuelve verdadero si validacion OK, y falso en caso contrario
        return b.test(txt)
}


function soloLetras(e) {
    tecla = (document.all) ? e.keyCode : e.which;
    if (tecla==8 || tecla == 0) return true; //Tecla de retroceso (para poder borrar)
    patron = /[A-Za-z\sáéíóúüñÁÉÍÓÚÜÑ]/;
    te = String.fromCharCode(tecla);
    return patron.test(te);
}

function cadenaVacia(cadena) {

        var partesCadena = cadena.split(' ');
        for (i = 0; i <= partesCadena.length; i++) {
            if ((partesCadena[i] != null) && (partesCadena[i].length > 0))
                return false;
        }
    return true;
}

function validaFormaReferenciaLaboralPrestador() {
    valor = FCKeditorAPI.__Instances['textDescripcion'].GetHTML();
    if (( (document.getElementById('textSolicitador').value != '') && (!cadenaVacia(document.getElementById('textSolicitador').value))) &&
          ( (valor != '') && (!cadenaVacia(valor))) )
        {
             document.formaReferenciaLaboralPrestador.submit();
         }
    else {
        alert('Debe llenar los campos marcados como obligatorios');
    }
}

function validaFormaRegistroVacante() {
    descripcion = FCKeditorAPI.__Instances['textDescripcionPuestoVacante'].GetHTML();
    actividades = FCKeditorAPI.__Instances['textActividadesPuestoVacante'].GetHTML();
    habilidades = FCKeditorAPI.__Instances['textHabilidadesRequeridasVacante'].GetHTML();
    if ( ((document.getElementById('textPuestoVacante').value != '') && (!cadenaVacia(document.getElementById('textPuestoVacante').value))) &&
         (document.getElementById('comboAreaLaboral').selectedIndex != 0) &&
         ((descripcion != '') && (!cadenaVacia(descripcion))) &&
         ((actividades != '') && (!cadenaVacia(actividades))) &&
         ((habilidades != '') && (!cadenaVacia(habilidades))) &&
         (document.getElementById('comboNivelExperiencia').selectedIndex != 0) &&
         (document.getElementById('comboGenero').selectedIndex != 0) &&
         (document.getElementById('comboNivelEstudios').selectedIndex != 0) &&
         (document.getElementById('comboEstadoCivil').selectedIndex != 0) &&
         (document.getElementById('comboTipoVacante').selectedIndex != 0) &&
         (document.getElementById('comboFormaPago').selectedIndex != 0) &&
         (document.getElementById('comboEstados').selectedIndex != 0) &&
         (document.getElementById('comboMunicipios').selectedIndex != 0) &&
         ((document.getElementById('textCiudadVacante').value != '') && (!cadenaVacia(document.getElementById('textCiudadVacante').value)))
        ) {
            if (document.getElementById('textPlazasVacante').value != '')
            {
                var plazas = document.getElementById('textPlazasVacante').value;
                if (plazas < 1) {
                    alert('El campo de puestos disponibles debe ser mayor o igual con 1');
                }else {
                 document.formaRegistraVacante.submit();   
                }
            }
            else {
                alert('El campo de puestos disponibles no puede estar vacío');
            }
    }
    else {
        alert('Debe llenar todos los campos marcados como obligatorios');
    }
}

function validaDatosPersonales() {
    if (((document.getElementById('textNombre').value != '') && (!cadenaVacia(document.getElementById('textNombre').value))) &&
        ((document.getElementById('textApPaterno').value != '') && (!cadenaVacia(document.getElementById('textApPaterno').value))) &&
        (document.getElementById('comboGenero').selectedIndex != 0) &&
        (document.getElementById('comboEstadoCivil').selectedIndex != 0) &&
        (document.getElementById('textFechaNacimiento').value != '') &&
        (document.getElementById('textCorreoElectronico').value != '')) {
            Correo = document.getElementById('textCorreoElectronico').value;
            //Correo2 = Correo;
            //partesCorreo = Correo.split('.');
            
            //parteArroba = partesCorreo[0].split('@');
            
            /*if (parteArroba.length > 1 )
            {
                if (cadenaVacia(parteArroba[0]) || cadenaVacia(parteArroba[1])) {
                    alert('El formato de la dirección de correo electrónico es incorrecto');
                    return;
                }
            }
            else {
                alert('El formato de la dirección de correo electrónico es incorrecto');
                    return;
            }*/
            
            if ((document.getElementById('textNumeroTelefonico').value != '') || (document.getElementById('textLadaTelefonica').value != '')) {
                if ((document.getElementById('textNumeroTelefonico').value != '') && (document.getElementById('textLadaTelefonica').value == ''))   {
                    alert("Si ha introducido el número telefónico no puede dejar vacío el campo de lada");
                    return;
                }
                
                if ((document.getElementById('textNumeroTelefonico').value == '') && (document.getElementById('textLadaTelefonica').value != ''))   {
                    alert("Si ha introducido la lada no puede dejar vacío el campo de número telefónico");
                    return;
                }
                
                var lada = document.getElementById('textLadaTelefonica').value;
                var tel = document.getElementById('textNumeroTelefonico').value;
                
                if (lada.length == 3 && (tel.length < 7 || tel.length > 7)) {
                    alert('Si su lada telefónica es de 3 dígitos su número telefónico debe de ser de 7 dígitos');
                    return;
                }
                
                if (lada.length == 2 && tel.length < 8 ) {
                    alert('Si su lada telefónica es de 2 dígitos su número telefónico debe de ser de 8 dígitos');
                    return;
                }
                
                if (lada.length == 1) {
                    alert('Lada inválida');
                    return;
                }
            }
            
            if ((document.getElementById('textNumeroCelular').value != '') && (!cadenaVacia(document.getElementById('textNumeroCelular').value))) {
                var celular = document.getElementById('textNumeroCelular').value;
                if (celular.length < 10) {
                    alert('El número celular que introduciste es incorrecto, debe tener 10 digitos');
                    return;
                }
            }
            
            //if ((document.getElementById('')))
            
            /*for (var i = 1; i < partesCorreo.length; i++) {
                if (cadenaVacia(partesCorreo[i])) {
                        alert('El formato de la dirección de correo electrónico es incorrecto');
                        return;
                    }
            }*/
            
            if (validaMail(Correo)/*(partesCorreo.length >= 2) && (Correo2.indexOf('@') != -1)  /*&& (Correo2.indexOf('@') < Correo2.lastIndexOf('.'))*/)
            {
                var fecha = document.getElementById('textFechaNacimiento').value;
                var partesFecha = fecha.split('-');
                var fechaActual = new Date();
                if ((fechaActual.getFullYear() - partesFecha[0]) >= 16)
                    if ((fechaActual.getFullYear() - partesFecha[0]) <= 75)
                        document.formaDatosPersonales.submit();
                    else
                        alert('La fecha de nacimiento no es la adecuada para EmpleoVer');
                else
                    alert('Debes ser mayor de edad');
            }
            else
            {
                alert ('El formato de la dirección de correo electronico es incorrecto');
            }
        }
    else {
        alert('Debe ingresar todos los campos que esten marcados como obligatorios');
    }
}

function validaDatosDomicilio() {
    if (((document.getElementById('textCalle').value != '') && (!cadenaVacia(document.getElementById('textCalle').value))) &&
        ((document.getElementById('textNumeroExterior').value != '') && (!cadenaVacia(document.getElementById('textNumeroExterior').value)) )&&
        (document.getElementById('comboEstados').selectedIndex != 0) &&
        (document.getElementById('comboMunicipios') != null && document.getElementById('comboMunicipios').selectedIndex != 0) &&
        (document.getElementById('comboColonias') != null && document.getElementById('comboColonias').selectedIndex != 0)) {
            document.formaDatosDomicilio.submit();
        }
    else {
        alert('Debe llenar los campos obligatorios');
    }
}

function validaDatosLogueo() {
    if ((document.getElementById('textCorreoElectronico').value != '') &&
        (document.getElementById('textContrasenia').value == document.getElementById('textConfirmaContrasenia').value) &&
        ((document.getElementById('textContrasenia').value != '') && (!cadenaVacia(document.getElementById('textContrasenia').value)))){ //&&
        //(document.getElementById('textPalabraSecreta').value == document.getElementById('textConfirmaPalabraSecreta').value) &&
        //(document.getElementById('textPreguntaSecreta').value != '') &&
        //((document.getElementById('textRespuestaAPregunta').value != '') && (!cadenaVacia(document.getElementById('textRespuestaAPregunta').value)))) {
            var passwd = document.getElementById('textContrasenia').value;
            if (passwd.length < 6) {
                alert('Tu contraseña debe tener al menos 6 caracteres');
            }
            else
                document.registroLogueo.submit();
        }
    else {
        alert('Debe ingresar los campos marcados como obligatorios y debe verificar que las confirmaciones sean identicas a las que puso en el campo anterior');
    }
}

function validaDatosLogueoModifica() {
    if ((document.getElementById('textCorreoElectronico').value != '')  &&
        ((document.getElementById('textContraseniaOriginal').value != '') && (!cadenaVacia(document.getElementById('textContraseniaOriginal').value))) &&
        ((document.getElementById('textContrasenia').value != '') && (!cadenaVacia(document.getElementById('textContrasenia').value))) &&
        ((document.getElementById('textConfirmaContrasenia').value != '') && (!cadenaVacia(document.getElementById('textConfirmaContrasenia').value)))) {
            var passwd = document.getElementById('textContrasenia').value;
            var passwdConfirma = document.getElementById('textConfirmaContrasenia').value;
            if (passwd.length < 6 || passwdConfirma.length < 6)
                alert('La contraseña debe tener al menos 6 caracteres');
            else
            {
                if (passwd != passwdConfirma)
                    alert('La contraseña nueva y la de confirmación no coinciden');
                else
                    document.registroLogueo.submit();
            }
        }
    else {
        alert('Debe ingresar los campos marcados como obligatorios y debe verificar que las confirmaciones sean identicas a las que puso en el campo anterior');
    }
}

function validaDatosInfoProfesional() {
    if ((document.getElementById('comboNivelExperiencia').selectedIndex != 0) &&
        (document.getElementById('comboAreaLaboral').selectedIndex != 0) &&
        (document.getElementById('comboOcupaciones').selectedIndex != 0) &&
        (document.getElementById('comboNivelEstudios').selectedIndex != 0)) {
        if (document.datosInformacionProfesional.opcionRegistro != null )
        {
            if ((document.datosInformacionProfesional.opcionRegistro[1].checked) && (document.getElementById('textUltimoEmailEmpresa').value != ''))
            {
                Correo = document.getElementById('textUltimoEmailEmpresa').value;
                //Correo2 = Correo;
                //partesCorreo = Correo.split('.');
                if (validaMail(Correo)/*(partesCorreo.length >= 2) && (Correo2.indexOf('@') != -1) /*&& (Correo2.indexOf('@') < Correo2.lastIndexOf('.'))*/)
                {
                    document.datosInformacionProfesional.submit();
                }
                else {
                    alert('El formato del correo electrónico es incorrecto');
                }
            }
            else if (document.datosInformacionProfesional.opcionRegistro[0].checked)
            {
                //Ponemos en blanco los demas campos
                document.getElementById('textUltimoNombreEmpresa').value = '';
                document.getElementById('textUltimoPuesto').value = '';
                document.getElementById('textUltimoActividadesDesarrolladas').value = '';
                document.getElementById('textUltimoNombreJefeInmediato').value = '';
                document.getElementById('textUltimoPuestoJefe').value = '';
                document.getElementById('textUltimoTelefonoEmpresa').value = '';
                document.getElementById('textUltimoEmailEmpresa').value = '';
                document.getElementById('textUltimoSalarioPercibido').value = '';
                document.datosInformacionProfesional.submit();
            }
            else
                document.datosInformacionProfesional.submit();
        }
        else
            document.datosInformacionProfesional.submit();
        }
        else {
            alert ('Debe ingresar todos los campos marcados como obligatorios');
        }
}

function validaDatosUltimoEmpleo() {
    if ((document.datosUltimoEmpleo.opcionRegistro[1].checked) && (document.getElementById('textUltimoEmailEmpresa').value != ''))
    {
        Correo = document.getElementById('textUltimoEmailEmpresa').value;
        //Correo2 = Correo;
        //partesCorreo = Correo.split('.');
        if (validaMail(Correo)/*(partesCorreo.length >= 2) && (Correo2.indexOf('@') != -1) /*&& (Correo2.indexOf('@') < Correo2.lastIndexOf('.'))*/)
        {
            document.datosUltimoEmpleo.submit();
        }
        else {
            alert('El formato del correo electrónico es incorrecto');
        }
    }
    else if (document.datosUltimoEmpleo.opcionRegistro[0].checked)
    {
        //Ponemos en blanco los demas campos
        document.getElementById('textUltimoNombreEmpresa').value = '';
        document.getElementById('textUltimoPuesto').value = '';
        document.getElementById('textUltimoActividadesDesarrolladas').value = '';
        document.getElementById('textUltimoNombreJefeInmediato').value = '';
        document.getElementById('textUltimoPuestoJefe').value = '';
        document.getElementById('textUltimoTelefonoEmpresa').value = '';
        document.getElementById('textUltimoEmailEmpresa').value = '';
        document.getElementById('textUltimoSalarioPercibido').value = '';
        document.datosUltimoEmpleo.submit();
    }
    else
        document.datosUltimoEmpleo.submit();
}

function clickTrabajoAnterior() {
    if (document.datosInformacionProfesional.opcionRegistro[0].checked)
    //if (document.datosUltimoEmpleo.opcionRegistro[0].checked)
        document.getElementById('formaUltimoEmpleo').style.display = 'none';
    else if (document.datosInformacionProfesional.opcionRegistro[1].checked)
    //else if (document.datosUltimoEmpleo.opcionRegistro[1].checked)
        document.getElementById('formaUltimoEmpleo').style.display = 'block';
}

function validaInfoProPrestador() {
    if ((document.getElementById('comboAreaLaboral').selectedIndex != 0) &&
        (document.getElementById('comboOcupaciones').selectedIndex != 0) &&
        (document.getElementById('textInfoProfesionalPrestadorEspecialidad').value != '')) {
        document.datosInfoProfesionalPrestador.submit();
    }
    else {
        alert('debe ingresar todos los campos marcados como abligatorios');
    }
}

function validaDatosEmpresa() {
    valor = FCKeditorAPI.__Instances['textEmpresaServicios'].GetHTML();
    if (((document.getElementById('textNombreEmpresa').value != '') && (!cadenaVacia(document.getElementById('textNombreEmpresa').value)) )&&
        (document.getElementById('comboCategoriasEmpresa').selectedIndex != 0) &&
        ((document.getElementById('comboGiros') != null) && (document.getElementById('comboGiros').selectedIndex != 0)) &&
        ((document.getElementById('textEmpresaRFC').value != '') && (!cadenaVacia(document.getElementById('textEmpresaRFC').value))) &&
        ((valor != '') && (!cadenaVacia(valor)) )&&
        ((document.getElementById('textEmpresaLada').value != '') && (!cadenaVacia(document.getElementById('textEmpresaLada').value))) &&
        ((document.getElementById('textEmpresaNumeroTelefonico').value != '') && (!cadenaVacia(document.getElementById('textEmpresaNumeroTelefonico').value)))&&
        ((document.getElementById('textEmpresaEmailContacto').value != '') && (!cadenaVacia(document.getElementById('textEmpresaEmailContacto').value))) &&
        ((document.getElementById('textEmpresaNombreContacto').value != '')) && (!cadenaVacia(document.getElementById('textEmpresaNombreContacto').value))) {
        
        
        if ((document.getElementById('textEmpresaNumeroTelefonico').value != '') || (document.getElementById('textEmpresaLada').value != '')) {
                if ((document.getElementById('textEmpresaNumeroTelefonico').value != '') && (document.getElementById('textEmpresaLada').value == ''))   {
                    alert("Si ha introducido el número telefónico no puede dejar vacío el campo de lada");
                    return;
                }
                
                if ((document.getElementById('textEmpresaNumeroTelefonico').value == '') && (document.getElementById('textEmpresaLada').value != ''))   {
                    alert("Si ha introducido la lada no puede dejar vacío el campo de número telefónico");
                    return;
                }
                
                var lada = document.getElementById('textEmpresaLada').value;
                var tel = document.getElementById('textEmpresaNumeroTelefonico').value;
                
                if (lada.length == 3 && (tel.length < 7 || tel.length > 7)) {
                    alert('Si su lada telefónica es de 3 dígitos su número telefónico debe de ser de 7 dígitos');
                    return;
                }
                
                if (lada.length == 2 && tel.length < 8 ) {
                    alert('Si su lada telefónica es de 2 dígitos su número telefónico debe de ser de 8 dígitos');
                    return;
                }
                
                if (lada.length == 1) {
                    alert('Lada inválida');
                    return;
                }
            }
        
        
            Correo = document.getElementById('textEmpresaEmailContacto').value;
            //Correo2 = Correo;
            //partesCorreo = Correo.split('.');
            
            //parteArroba = partesCorreo[0].split('@');
            /*if (cadenaVacia(parteArroba[0]) || cadenaVacia(parteArroba[1])) {
                alert('El formato de la dirección de correo electrónico es incorrecto');
                return;
            }*/
            
            if (validaMail(Correo)/*(partesCorreo.length >= 2) && (Correo2.indexOf('@') != -1) /*&& (Correo2.indexOf('@') < Correo2.lastIndexOf('.'))*/)
            {
                document.formaRegistraDatosEmpresa.submit();
            }
            else {
                alert('El formato del correo electrónico es incorrecto');
            }

        }
        else {
            alert('debe ingresar todos los campos marcados como obligatorios');
        }
    
}

function validaFormaVacantes() {
    if (((document.getElementById('textPuestoVacante').value != '' ) && (!cadenaVacia(document.getElementById('textPuestoVacante').value))) &&
        //((document.getElementById('textDescripcionPuestoVacante').value != '') && (!cadenaVacia(document.getElementById('textDescripcionPuestoVacante').value)) )&&
        //((document.getElementById('textHabilidadesRequeridasVacante').value != '') && (!cadenaVacia(document.getElementById('textHabilidadesRequeridasVacante').value)) )&&
        (document.getElementById('comboAreaLaboral').selectedIndex != 0) &&
        (document.getElementById('comboNivelExperiencia').selectedIndex != 0) &&
        (document.getElementById('comboGenero').selectedIndex != 0) &&
        (document.getElementById('comboNivelEstudios').selectedIndex != 0) &&
        (document.getElementById('comboTipoVacante').selectedIndex != 0) &&
        (document.getElementById('comboFormaPago').selectedIndex != 0) &&
        (document.getElementById('comboEstados').selectedIndex != 0) &&
        (document.getElementById('comboMunicipios').selectedIndex != 0)) {
            document.formaRegistraVacante.submit();
        }
        else {
            alert('Debe llenar todos los campos marcados como obligatorios');
        }
}

function cargaPaginaEniFrame(pagina) {
    //Stand alone
    window.top.parent.ifPrincipal.location.href = pagina;
    //Portal
    //window.top.frames[0].frames[0].location.href = pagina;
    //top.parent.ifPrincipal.location.href = pagina;
}

function cargaPaginaEniFrameRegistro(pagina) {
    window.parent.frames["ifPrincipal"].ifRegistro.location.href = pagina;
    //document.ifRegistro.location.href = pagina;
}

function eliminaReferenciaPrestador (idReferencia) {
    if (confirm("Esta seguro de querer eliminar esta referencia?"))
        document.location = 'ServletAccionesReferenciasLaboralesPrestador?accion=3&idReferencia='+ idReferencia;
}

function eliminaVacanteEmpresa(idVacante) {
    if (confirm("Esta seguro de querer eliminar la vacante?"))
        document.location = 'listaVacantes.jsp?idVacante='+idVacante;
}

function eliminaMensajeBuzon(idMensaje) {
    if (confirm("Esta seguro de querer eliminar el mensaje, no podra ser recuperado?"))
        document.location = 'miBuzon.jsp?tipoAccion=3&idMsj='+idMensaje;
}

function validaFormaEnvioMensaje() {
    contenidoMensaje = FCKeditorAPI.__Instances['FCKeditor1'].GetHTML();
    if (((contenidoMensaje != '') && (!cadenaVacia(contenidoMensaje))) &&
        (document.getElementById('textAsunto').value != '') && (!cadenaVacia(document.getElementById('textAsunto').value)))
        document.formaEnviaMensaje.submit();
    else
        alert('El campo de asunto y mensaje no pueden estar vacíos');
}

function vacanteFiniquitacionCambiada() {
    if (document.getElementById('comboTipoFiniquitacion').selectedIndex == 3) {
        document.getElementById('otraFormaFiniquitacion').style.display = 'block';
        document.getElementById('contenedorPostulados').style.display = 'none';
    }
    else if (document.getElementById('comboTipoFiniquitacion').selectedIndex == 0) {
        document.getElementById('otraFormaFiniquitacion').style.display = 'none';
        document.getElementById('contenedorPostulados').style.display = 'block';
    }
    else {
        document.getElementById('otraFormaFiniquitacion').style.display = 'none';
        document.getElementById('contenedorPostulados').style.display = 'none';
    }
}

function validaFormaFiniquitar() {
    if (document.getElementById('comboTipoFiniquitacion').selectedIndex != 0) {
            document.formaFiniquitacionVacante.submit();
    }
    else {
        document.getElementById('otraFormaFiniquitacion').value = '';
        if (document.getElementById('comboPostulados').selectedIndex == 0) {
            alert('Debe seleccionar a que usuario contrato');
        }
        else
        {
            document.formaFiniquitacionVacante.submit();
        }
    }
}

function validaFormaComentaPrestador() {
    valor = FCKeditorAPI.__Instances['FCKeditor1'].GetHTML();
    if ((valor != '') && (!cadenaVacia(valor)))
        document.formaComentaPrestador.submit();
    else
        alert('El campo del contenido del mensaje no puede estar vacío');
}



function validaSeleccionCrop() {
    if (document.getElementById('x').value != '')
        document.formaCrop.submit();
    else
        alert('Debe realizar una selección del área a cortar');
}