// JavaScript Document
function desplegar(i){
switch(i){
	case 1:		
		document.getElementById("Usuarios").style.visibility="visible";
		break;	
	case 2:		
		document.getElementById("Concursos").style.visibility="visible";		
		break;
	case 3:		
		document.getElementById("Comite_Seleccion").style.visibility="visible";		
		break;
	case 4:		
		document.getElementById("ABM_Reparticion").style.visibility="visible";		
		break;
	case 5:			
		document.getElementById("Admin_Turnos").style.visibility="visible";			
		break;
	case 6:		
		document.getElementById("Veedores").style.visibility="visible";		
		break;
	case 7:		
		document.getElementById("Estadisticas").style.visibility="visible";		
		break;
	case 8:		
		document.getElementById("Adm_Exp").style.visibility="visible";		
		break;
	}
}
function plegar(i){
switch(i){
	case 1:
		document.getElementById("Usuarios").style.visibility="hidden";
		break;	
	case 2:
		document.getElementById("Concursos").style.visibility="hidden";		
		break;
	case 3:		
		document.getElementById("Comite_Seleccion").style.visibility="hidden";		
		break;
	case 4:		
		document.getElementById("ABM_Reparticion").style.visibility="hidden";		
		break;
	case 5:					
		document.getElementById("Admin_Turnos").style.visibility="hidden";
		break;
	case 6:		
		document.getElementById("Veedores").style.visibility="hidden";		
		break;
	case 7:		
		document.getElementById("Estadisticas").style.visibility="hidden";		
		break;
	case 8:		
		document.getElementById("Adm_Exp").style.visibility="hidden";		
		break;
	}
}
function plegarAll(){
	if(document.getElementById("Usuarios")!=null){
		document.getElementById("Usuarios").style.visibility="hidden";
		}
	if(document.getElementById("Concursos")!=null){
		document.getElementById("Concursos").style.visibility="hidden";		
		}
	if(document.getElementById("Comite_Seleccion")!=null){
		document.getElementById("Comite_Seleccion").style.visibility="hidden";		
		}		
	if(document.getElementById("ABM_Reparticion")!=null){
		document.getElementById("ABM_Reparticion").style.visibility="hidden";		
		}	
	if(document.getElementById("Admin_Turnos")!=null){		
		document.getElementById("Admin_Turnos").style.visibility="hidden";			
		}		
    if(document.getElementById("Veedores")!=null){
		document.getElementById("Veedores").style.visibility="hidden";
	    }		
    if(document.getElementById("Estadisticas")!=null){
		document.getElementById("Estadisticas").style.visibility="hidden";	
		}
	if(document.getElementById("Adm_Exp")!=null){
		document.getElementById("Adm_Exp").style.visibility="hidden";	
		}	

}

function validarRegistroPostulantes(){	
if (document.FrmPostulantesRegistrar.nombre.value==""){
	alert('Debe ingresar el Nombre');
	document.FrmPostulantesRegistrar.nombre.focus();
	return false;
	}
if (document.FrmPostulantesRegistrar.apellido.value==""){
	alert('Debe ingresar el Apellido');
	document.FrmPostulantesRegistrar.apellido.focus();
	return false;
	}
if (document.FrmPostulantesRegistrar.tipo_documento.value=="0"){
	alert('Debe seleccionar el Tipo de Documento');
	document.FrmPostulantesRegistrar.tipo_documento.focus();
	return false;
	}
if (document.FrmPostulantesRegistrar.numero_documento.value==""){
	alert('Debe ingresar el N\u00f3mero de Documento');
	document.FrmPostulantesRegistrar.numero_documento.focus();
	return false;
	}
if(document.FrmPostulantesRegistrar.numero_documento.value.indexOf('.', 0)!=-1){
	alert('Debe ingresar el N\u00f3mero de Documento sin puntos');
	document.FrmPostulantesRegistrar.numero_documento.focus();
	return false;
	}
if (isNaN(document.FrmPostulantesRegistrar.numero_documento.value)){
	alert('Debe ingresar un dato Num\u00e9rico');
	document.FrmPostulantesRegistrar.numero_documento.focus();
	return false;
	}
if (document.FrmPostulantesRegistrar.cuit_cuil.value==""){
	alert('Debe ingresar el CUIT/CUIL');
	document.FrmPostulantesRegistrar.cuit_cuil.focus();
	return false;
	}
if(document.FrmPostulantesRegistrar.cuit_cuil.value.indexOf('-', 0)!=-1){
	alert('Debe ingresar el CUIT/CUIL sin quiones');
	document.FrmPostulantesRegistrar.cuit_cuil.focus();
	return false;
	}
if (isNaN(document.FrmPostulantesRegistrar.cuit_cuil.value)){
	alert('Debe ingresar un dato Num\u00e9rico');
	document.FrmPostulantesRegistrar.cuit_cuil.focus();
	return false;
	}
if(document.FrmPostulantesRegistrar.cuit_cuil.value.length!=11){
	alert('El CUIT/CUIL debe contener 11 d\u00edgitos');
	document.FrmPostulantesRegistrar.cuit_cuil.focus();
	return false;
	}
if (document.FrmPostulantesRegistrar.email.value==""){
	alert('Debe ingresar el email');
	document.FrmPostulantesRegistrar.email.focus();
	return false;
	}	
if (document.FrmPostulantesRegistrar.email.value.indexOf('@', 0) == -1 || document.FrmPostulantesRegistrar.email.value.indexOf('.', 0) == -1){	
	alert('El Email ingresado no es v\u00e1lido');
	document.FrmPostulantesRegistrar.email.focus();
	return false;
	}
if ((document.FrmPostulantesRegistrar.email.value)!=(document.FrmPostulantesRegistrar.repetir_email.value)){
	alert('El email y la repetici\u00f3n son distintos');
	document.FrmPostulantesRegistrar.email.focus();
	return false;
	}
	
with (window.frames["Terminos"])
if (!document.forms["FrmAceptaTerminos"]["acepta_terminos"].checked){
	alert('Debe aceptar los T\u00e9rminos y Condiciones');	
	return false;
	}	
document.FrmPostulantesRegistrar.submit();
}
function validarLogin(){
if (document.FrmLogin.tipo_documento.value=="0"){
	alert('Debe seleccionar el Tipo de Documento');
	document.FrmLogin.tipo_documento.focus();
	return false;
	}
if (document.FrmLogin.numero_documento.value==""){
	alert('Debe ingresar el N\u00famero de Documento');
	document.FrmLogin.numero_documento.focus();
	return false;
	}
if(document.FrmLogin.numero_documento.value.indexOf('.', 0)!=-1){
	alert('Debe ingresar el N\u00famero de Documento sin puntos');
	document.FrmLogin.numero_documento.focus();
	return false;
	}
if (isNaN(document.FrmLogin.numero_documento.value)){
	alert('Debe ingresar un dato Num\u00e9rico');
	document.FrmLogin.numero_documento.focus();
	return false;
	}
if (document.FrmLogin.password.value==""){
	alert('Debe ingresar la Contrase\u00f1a');
	document.FrmLogin.password.focus();
	return false;
	}
document.FrmLogin.submit();
}
function validarCambiarPass(){
if(document.FrmCambiarPass.password_actual.value==""){
	alert('Debe ingresar la Contrase\u00f1a Actual');
	document.FrmCambiarPass.password_actual.focus();
	return false;	
	}
if(hex_md5(document.FrmCambiarPass.password_actual.value)!=pass){
	alert('La Contrase\u00f1a Actual ingresada no es correcta');
	document.FrmCambiarPass.password_actual.focus();
	return false;	
	}
if(document.FrmCambiarPass.password_nueva.value==""){
	alert('Debe ingresar la Contrase\u00f1a Nueva');
	document.FrmCambiarPass.password_nueva.focus();
	return false;	
	}
if(document.FrmCambiarPass.password_nueva.value.length<4){
	alert('La Contrase\u00f1a debe tener 4 caracteres como minimo');
	document.FrmCambiarPass.password_nueva.focus();
	return false;	
	}	
if((document.FrmCambiarPass.password_nueva.value)!=(document.FrmCambiarPass.password_repetir.value)){
	alert('Contrase\u00f1a Nueva y la repetici\u00f3n son distintas');
	document.FrmCambiarPass.password_nueva.focus();
	return false;	
	}
document.FrmCambiarPass.submit();
}
function mostrarConstituido(){
if (document.FrmDatosPersonalesIngresar.provincia.value!=1){
	document.getElementById("constituido0").style.display="";
	document.getElementById("constituido1").style.display="";
	document.getElementById("constituido2").style.display="";
	document.getElementById("constituido3").style.display="";
	}
	else{
		document.getElementById("constituido0").style.display="none";
		document.getElementById("constituido1").style.display="none";
		document.getElementById("constituido2").style.display="none";
		document.getElementById("constituido3").style.display="none";
		}
}
function validarDatosPersonales(){	
if (document.FrmDatosPersonalesIngresar.nombre.value==""){
	alert('Debe ingresar el Nombre');
	document.FrmDatosPersonalesIngresar.nombre.focus();
	return false;
	}
if (document.FrmDatosPersonalesIngresar.apellido.value==""){
	alert('Debe ingresar el Apellido');
	document.FrmDatosPersonalesIngresar.apellido.focus();
	return false;
	}
if (document.FrmDatosPersonalesIngresar.tipo_documento2.value=="0"){
	alert('Debe seleccionar el Tipo de Documento');
	document.FrmDatosPersonalesIngresar.tipo_documento2.focus();
	return false;
	}
if (document.FrmDatosPersonalesIngresar.numero_documento2.value==""){
	alert('Debe ingresar el N\u00f3mero de Documento');
	document.FrmDatosPersonalesIngresar.numero_documento2.focus();
	return false;
	}
if(document.FrmDatosPersonalesIngresar.numero_documento2.value.indexOf('.', 0)!=-1){
	alert('Debe ingresar el N\u00f3mero de Documento sin puntos');
	document.FrmDatosPersonalesIngresar.numero_documento2.focus();
	return false;
	}
if (isNaN(document.FrmDatosPersonalesIngresar.numero_documento2.value)){
	alert('Debe ingresar un dato Num\u00e9rico');
	document.FrmDatosPersonalesIngresar.numero_documento2.focus();
	return false;
	}

document.FrmDatosPersonalesIngresar.tipo_documento.value=document.FrmDatosPersonalesIngresar.tipo_documento2.value;
document.FrmDatosPersonalesIngresar.numero_documento.value=document.FrmDatosPersonalesIngresar.numero_documento2.value;

if (document.FrmDatosPersonalesIngresar.fecha_nacimiento.value==""){
	alert('Debe ingresar la Fecha de nacimiento');
	document.FrmDatosPersonalesIngresar.fecha_nacimiento.focus();
	return false;
	}
if (!ValidateDate(document.FrmDatosPersonalesIngresar.fecha_nacimiento.value)){
	alert('La Fecha de nacimiento no es v\u00e1lida');
	document.FrmDatosPersonalesIngresar.fecha_nacimiento.focus();
	return false;
	}
if (document.FrmDatosPersonalesIngresar.pais_nacimiento.value=="0"){
	alert('Debe seleccionar el Pa\u00eds de Nacimiento');
	document.FrmDatosPersonalesIngresar.pais_nacimiento.focus();
	return false;
	}
if (document.FrmDatosPersonalesIngresar.sexo.value=="0"){
	alert('Debe seleccionar el Sexo');
	document.FrmDatosPersonalesIngresar.sexo.focus();
	return false;
	}
if (document.FrmDatosPersonalesIngresar.estado_civil.value=="0"){
	alert('Debe seleccionar el Estado Civil');
	document.FrmDatosPersonalesIngresar.estado_civil.focus();
	return false;
	}
if (document.FrmDatosPersonalesIngresar.direccion_calle.value==""){
	alert('Debe ingresar la Calle');
	document.FrmDatosPersonalesIngresar.direccion_calle.focus();
	return false;
	}	
if (document.FrmDatosPersonalesIngresar.direccion_numero.value==""){
	alert('Debe ingresar el N\u00famero');
	document.FrmDatosPersonalesIngresar.direccion_numero.focus();
	return false;
	}
if (document.FrmDatosPersonalesIngresar.codigo_postal.value==""){
	alert('Debe ingresar el Codigo Postal');
	document.FrmDatosPersonalesIngresar.codigo_postal.focus();
	return false;
	}
if (document.FrmDatosPersonalesIngresar.provincia.value=="0"){
	alert('Debe seleccionar la Provincia');
	document.FrmDatosPersonalesIngresar.provincia.focus();
	return false;
	}
if ((document.FrmDatosPersonalesIngresar.telefono.value=="")&&(document.FrmDatosPersonalesIngresar.celular.value=="")){
	alert('Debe ingresar un Tel\u00e9fono o un Celular');
	document.FrmDatosPersonalesIngresar.telefono.focus();
	return false;
	}
	
if (document.FrmDatosPersonalesIngresar.email.value==""){
	alert('Debe ingresar el email');
	document.FrmDatosPersonalesIngresar.email.focus();
	return false;
	}	
if (document.FrmDatosPersonalesIngresar.email.value.indexOf('@', 0) == -1 || document.FrmDatosPersonalesIngresar.email.value.indexOf('.', 0) == -1){	
	alert('El Email ingresado no es v\u00e1lido');
	document.FrmDatosPersonalesIngresar.email.focus();
	return false;
	}
if (document.FrmDatosPersonalesIngresar.cuit_cuil.value==""){
	alert('Debe ingresar el CUIT/CUIL');
	document.FrmDatosPersonalesIngresar.cuit_cuil.focus();
	return false;
	}
if(document.FrmDatosPersonalesIngresar.cuit_cuil.value.indexOf('-', 0)!=-1){
	alert('Debe ingresar el CUIT/CUIL sin quiones');
	document.FrmDatosPersonalesIngresar.cuit_cuil.focus();
	return false;
	}
if (isNaN(document.FrmDatosPersonalesIngresar.cuit_cuil.value)){
	alert('Debe ingresar un dato Num\u00e9rico');
	document.FrmDatosPersonalesIngresar.cuit_cuil.focus();
	return false;
	}
if(document.FrmDatosPersonalesIngresar.cuit_cuil.value.length!=11){
	alert('El CUIT/CUIL debe contener 11 d\u00edgitos');
	document.FrmDatosPersonalesIngresar.cuit_cuil.focus();
	return false;
	}
if(document.FrmDatosPersonalesIngresar.provincia.value!=1){
	if (document.FrmDatosPersonalesIngresar.constituido_calle.value==""){
		alert('Debe ingresar la Calle del domicilio constituido');
		document.FrmDatosPersonalesIngresar.constituido_calle.focus();
		return false;
		}	
	if (document.FrmDatosPersonalesIngresar.constituido_numero.value==""){
		alert('Debe ingresar el N\u00famero del domicilio constituido');
		document.FrmDatosPersonalesIngresar.constituido_numero.focus();
		return false;
		}
	if (document.FrmDatosPersonalesIngresar.constituido_codigo_postal.value==""){
		alert('Debe ingresar el Codigo Postal del domicilio constituido');
		document.FrmDatosPersonalesIngresar.constituido_codigo_postal.focus();
		return false;
		}
	}
	
document.FrmDatosPersonalesIngresar.submit()
}
function validarPostUniv(){
if(document.FrmPostUnivIngresar.tipo_estudio.value=="0"){
	alert('Debe Seleccionar el Tipo de estudio');
	document.FrmPostUnivIngresar.tipo_estudio.focus();
	return false;
	}
if(document.FrmPostUnivIngresar.universidad.value=="0"){
	alert('Debe Seleccionar la Instituci\u00f3n');
	document.FrmPostUnivIngresar.universidad.focus();
	return false;
	}
if(document.FrmPostUnivIngresar.titulo.value=="0"){
	alert('Debe Seleccionar el Titulo');
	document.FrmPostUnivIngresar.titulo.focus();
	return false;
	}
if(document.FrmPostUnivIngresar.fecha_ingreso.value==""){
	alert('Debe Ingresar la Fecha de Ingreso');
	document.FrmPostUnivIngresar.fecha_ingreso.focus();
	return false;
	}
if(!ValidateDate(document.FrmPostUnivIngresar.fecha_ingreso.value)){
	alert('La Fecha de Ingreso no es v\u00e1lida');
	document.FrmPostUnivIngresar.fecha_ingreso.focus();
	return false;
	}
if((document.FrmPostUnivIngresar.fecha_egreso.value!="")&&(!ValidateDate(document.FrmPostUnivIngresar.fecha_egreso.value))){
	alert('La Fecha de Egreso no es v\u00e1lida');
	document.FrmPostUnivIngresar.fecha_egreso.focus();
	return false;
	}
if((document.FrmPostUnivIngresar.fecha_egreso.value!="")&&(!diffDate(document.FrmPostUnivIngresar.fecha_ingreso.value,document.FrmPostUnivIngresar.fecha_egreso.value))){
	alert('La Fecha de Egreso no puede ser menor que la de Ingreso');
	document.FrmPostUnivIngresar.fecha_egreso.focus();
	return false;
	}
if(document.FrmPostUnivIngresar.lugar.value==""){
	alert('Debe Ingresar el Lugar');
	document.FrmPostUnivIngresar.lugar.focus();
	return false;
	}
document.FrmPostUnivIngresar.submit();
}
function validarTerSec(){
if(document.FrmTerSecIngresar.tipo_estudio.value=="0"){
	alert('Debe Seleccionar el Tipo de estudio');
	document.FrmTerSecIngresar.tipo_estudio.focus();
	return false;
	}
if(document.FrmTerSecIngresar.institucion.value==""){
	alert('Debe Ingresar la Instituci\u00f3n');
	document.FrmTerSecIngresar.institucion.focus();
	return false;
	}
if(document.FrmTerSecIngresar.titulo.value==""){
	alert('Debe Ingresar el Titulo');
	document.FrmTerSecIngresar.titulo.focus();
	return false;
	}
if(document.FrmTerSecIngresar.fecha_ingreso.value==""){
	alert('Debe Ingresar la Fecha de Ingreso');
	document.FrmTerSecIngresar.fecha_ingreso.focus();
	return false;
	}
if(!ValidateDate(document.FrmTerSecIngresar.fecha_ingreso.value)){
	alert('La Fecha de Ingreso no es v\u00e1lida');
	document.FrmTerSecIngresar.fecha_ingreso.focus();
	return false;
	}
if((document.FrmTerSecIngresar.fecha_egreso.value!="")&&(!ValidateDate(document.FrmTerSecIngresar.fecha_egreso.value))){
	alert('La Fecha de Egreso no es v\u00e1lida');
	document.FrmTerSecIngresar.fecha_egreso.focus();
	return false;
	}
if((document.FrmTerSecIngresar.fecha_egreso.value!="")&&(!diffDate(document.FrmTerSecIngresar.fecha_ingreso.value,document.FrmTerSecIngresar.fecha_egreso.value))){
	alert('La Fecha de Egreso no puede ser menor que la de Ingreso');
	document.FrmTerSecIngresar.fecha_egreso.focus();
	return false;
	}
if(document.FrmTerSecIngresar.lugar.value==""){
	alert('Debe Ingresar el Lugar');
	document.FrmTerSecIngresar.lugar.focus();
	return false;
	}
document.FrmTerSecIngresar.submit();
}
function validarCapacitaciones(){
if(document.FrmCapacitaciones.nombre_curso.value==""){
	alert('Debe Ingresar el Nombre del Curso');
	document.FrmCapacitaciones.nombre_curso.focus();
	return false;
	}
if(document.FrmCapacitaciones.organismo.value==""){
	alert('Debe Ingresar el Organismo');
	document.FrmCapacitaciones.organismo.focus();
	return false;
	}
if(document.FrmCapacitaciones.fecha.value==""){
	alert('Debe Ingresar la Fecha');
	document.FrmCapacitaciones.fecha.focus();
	return false;
	}
if(!ValidateDate(document.FrmCapacitaciones.fecha.value)){
	alert('La Fecha de Ingreso no es v\u00e1lida');
	document.FrmCapacitaciones.fecha.focus();
	return false;
	}
if(document.FrmCapacitaciones.nro_horas.value==""){
	alert('Debe Ingresar el Nro. de Horas');
	document.FrmCapacitaciones.nro_horas.focus();
	return false;
	}
if(document.FrmCapacitaciones.lugar.value==""){
	alert('Debe Ingresar el Lugar');
	document.FrmCapacitaciones.lugar.focus();
	return false;
	}
document.FrmCapacitaciones.submit();
}
function activarRespuesta(){
if (document.FrmFuncionarioPublico.respuesta[0].checked){
	document.FrmFuncionarioPublico.ministerio.disabled=false;	
	document.FrmFuncionarioPublico.subsecretaria.disabled=false;
	document.FrmFuncionarioPublico.direccion_gral.disabled=false;
	}
	else{
		document.FrmFuncionarioPublico.ministerio.disabled=true;	
		document.FrmFuncionarioPublico.subsecretaria.disabled=true;	
		document.FrmFuncionarioPublico.direccion_gral.disabled=true;
		}
}
function validarRespuesta(){
if((!document.FrmFuncionarioPublico.respuesta[0].checked)&&(!document.FrmFuncionarioPublico.respuesta[1].checked)){
	alert('Debe seleccionar una opci\u00f3n');
	document.FrmFuncionarioPublico.respuesta[0].focus();
	return false;
	}
/*	
if (document.FrmFuncionarioPublico.respuesta[0].checked){
	if (document.FrmFuncionarioPublico.ministerio.value==0){
		alert('Debe seleccionar un Ministerio');
		document.FrmFuncionarioPublico.ministerio.focus();
		return false;
		}
	if (document.getElementById("subsecretaria").value==0){
		alert('Debe seleccionar una Subsecretaria');
		document.FrmFuncionarioPublico.subsecretaria.focus();
		return false;
		}
	if (document.getElementById("direccion_gral").value==0){
		alert('Debe seleccionar una Direcci\u00f3n Gral.');
		document.FrmFuncionarioPublico.direccion_gral.focus();
		return false;
		}
	}
*/
document.FrmFuncionarioPublico.subsecretaria2.value=document.getElementById("subsecretaria").value;
document.FrmFuncionarioPublico.direccion_gral2.value=document.getElementById("direccion_gral").value;

document.FrmFuncionarioPublico.submit();
}
function validarExperiencia(){
if (contesto==0){
	alert('Debe contestar si es Funcionario P\u00fablico');
	document.FrmFuncionarioPublico.respuesta[0].focus();
	return false;
}
if (document.FrmExperiencias.empresa.value==""){
	alert('Debe ingresar la Empresa');
	document.FrmExperiencias.empresa.focus();
	return false;
	}
	
var cantidad_rubros=0;
for (i=0;i<document.FrmExperiencias.rubro.length;i++){
	if(document.FrmExperiencias.rubro[i].selected){
		cantidad_rubros=cantidad_rubros+1;
		}
	}
if (cantidad_rubros==0){
	alert('Debe Seleccionar el Rubro');
	document.FrmExperiencias.rubro.focus();
	return false;
	}
if (cantidad_rubros>3){
	alert('Puede Seleccionar 3 Rubros como m\u00e1ximo');
	document.FrmExperiencias.rubro.focus();
	return false;	
	}

if (document.FrmExperiencias.lugar.value==""){
	alert('Debe ingresar el Lugar');
	document.FrmExperiencias.lugar.focus();
	return false;
	}
	
cantidad_areas=0;
for (i=0;i<document.FrmExperiencias.area.length;i++){
	if(document.FrmExperiencias.area[i].selected){
		cantidad_areas=cantidad_areas+1;
		}
	}
if (cantidad_areas==0){
	alert('Debe Seleccionar el Area');
	document.FrmExperiencias.area.focus();
	return false;
	}
if (cantidad_areas>3){
	alert('Puede Seleccionar 3 Areas como m\u00e1ximo');
	document.FrmExperiencias.area.focus();
	return false;	
	}	
	
if (document.FrmExperiencias.puesto.value==""){
	alert('Debe ingresar el \u00daltimo Puesto');
	document.FrmExperiencias.puesto.focus();
	return false;
	}
if(document.FrmExperiencias.fecha_ingreso.value==""){
	alert('Debe Ingresar la Fecha de Ingreso');
	document.FrmExperiencias.fecha_ingreso.focus();
	return false;
	}
if(!ValidateDate(document.FrmExperiencias.fecha_ingreso.value)){
	alert('La Fecha de Ingreso no es v\u00e1lida');
	document.FrmExperiencias.fecha_ingreso.focus();
	return false;
	}
if((document.FrmExperiencias.fecha_egreso.value!="")&&(!ValidateDate(document.FrmExperiencias.fecha_egreso.value))){
	alert('La Fecha de Egreso no es v\u00e1lida');
	document.FrmExperiencias.fecha_egreso.focus();
	return false;
	}
if((document.FrmExperiencias.fecha_egreso.value!="")&&(!diffDate(document.FrmExperiencias.fecha_ingreso.value,document.FrmExperiencias.fecha_egreso.value))){
	alert('La Fecha de Egreso no puede ser menor que la de Ingreso');
	document.FrmExperiencias.fecha_egreso.focus();
	return false;
	}
if(document.FrmExperiencias.descripcion.value==""){
	alert('Debe Ingresar la Descripci\u00f3n');
	document.FrmExperiencias.descripcion.focus();
	return false;
	}
if(document.FrmExperiencias.descripcion.value.length>500){
	alert('Ha superado los 500 caracteres m\u00e1ximos');
	document.FrmExperiencias.descripcion.focus();
	return false;
	}
if(document.FrmExperiencias.personal_cargo.value==""){
	alert('Debe Ingresar el Personal a Cargo');
	document.FrmExperiencias.personal_cargo.focus();
	return false;
	}
if(document.FrmExperiencias.logros.value==""){
	alert('Debe Ingresar los Logros / Resultados');
	document.FrmExperiencias.logros.focus();
	return false;
	}
if(document.FrmExperiencias.logros.value.length>500){
	alert('Ha superado los 500 caracteres m\u00e1ximos');
	document.FrmExperiencias.logros.focus();
	return false;
	}
if(document.FrmExperiencias.referencias.value==""){
	alert('Debe Ingresar las Referencias');
	document.FrmExperiencias.referencias.focus();
	return false;
	}
document.FrmExperiencias.submit();
}
function validarExpDocente(){	
var fecha = new Date();
var anio = fecha. getFullYear();

if(document.FrmExpDocente.institucion.value==""){
	alert('Debe ingresar la Instituci\u00f3n');
	document.FrmExpDocente.institucion.focus();
	return false;
	}
if(document.FrmExpDocente.cargo.value==""){
	alert('Debe ingresar el Cargo');
	document.FrmExpDocente.cargo.focus();
	return false;
	}
/*	
	
if(document.FrmExpDocente.anio.value==""){
	alert('Debe ingresar el A\u00f1o');
	document.FrmExpDocente.anio.focus();
	return false;
	}
if(isNaN(document.FrmExpDocente.anio.value)){
	alert('El A\u00f1o debe ser un dato num\u00e9rico');
	document.FrmExpDocente.anio.focus();
	return false;
	}
if((document.FrmExpDocente.anio.value)>anio){
	alert('El A\u00f1o no puede ser mayor que el a\u00f1o actual');
	document.FrmExpDocente.anio.focus();
	return false;
	}
*/
if(document.FrmExpDocente.lugar.value==""){
	alert('Debe ingresar el Lugar');
	document.FrmExpDocente.lugar.focus();
	return false;
	}
if((document.FrmExpDocente.fecha_ingreso.value!="")&&(!ValidateDate(document.FrmExpDocente.fecha_ingreso.value))){
	alert('La Fecha de Ingreso no es v\u00e1lida');
	document.FrmExpDocente.fecha_ingreso.focus();
	return false;
	}
if((document.FrmExpDocente.fecha_egreso.value!="")&&(!ValidateDate(document.FrmExpDocente.fecha_egreso.value))){
	alert('La Fecha de Egreso no es v\u00e1lida');
	document.FrmExpDocente.fecha_egreso.focus();
	return false;
	}
document.FrmExpDocente.submit();
}
function validarCursosGCABA(){
/*
var cantidad=0;
document.FrmCursosGCABA.cursos_gcba[0].selected=false;
for (i=0;i<document.FrmCursosGCABA.cursos_gcba.length;i++){
	if(document.FrmCursosGCABA.cursos_gcba[i].selected){
		cantidad=cantidad+1;
		}
	}
if (cantidad==0){
	alert('Debe Seleccionar al menos un Curso');
	document.FrmCursosGCABA.cursos_gcba.focus();
	return false;
	}*/
document.FrmCursosGCABA.submit();
}
function validarConferencias(){
var fecha = new Date();
var anio = fecha. getFullYear();
if(document.FrmConferencias.titulo.value==""){
	alert('Debe ingresar el T\u00edtulo');
	document.FrmConferencias.titulo.focus();
	return false;
	}
if(document.FrmConferencias.institucion.value==""){
	alert('Debe ingresar la Instituci\u00f3n');
	document.FrmConferencias.institucion.focus();
	return false;
	}
if(document.FrmConferencias.anio.value==""){
	alert('Debe ingresar el A\u00f1o');
	document.FrmConferencias.anio.focus();
	return false;
	}
if(isNaN(document.FrmConferencias.anio.value)){
	alert('El A\u00f1o debe ser un dato num\u00e9rico');
	document.FrmConferencias.anio.focus();
	return false;
	}
if((document.FrmConferencias.anio.value)>anio){
	alert('El A\u00f1o no puede ser mayor que el a\u00f1o actual');
	document.FrmConferencias.anio.focus();
	return false;
	}
if(document.FrmConferencias.lugar.value==""){
	alert('Debe ingresar el Lugar');
	document.FrmConferencias.lugar.focus();
	return false;
	}
document.FrmConferencias.submit();
}
function validarPublicaciones(){	
var fecha = new Date();
var anio = fecha. getFullYear();

if(document.FrmPublicaciones.tipo.value==""){
	alert('Debe ingresar la tipo');
	document.FrmPublicaciones.tipo.focus();
	return false;
	}
if(document.FrmPublicaciones.titulo.value==""){
	alert('Debe ingresar la T\u00edtulo');
	document.FrmPublicaciones.titulo.focus();
	return false;
	}
if(document.FrmPublicaciones.institucion.value==""){
	alert('Debe ingresar la Instituci\u00f3n');
	document.FrmPublicaciones.institucion.focus();
	return false;
	}
if(document.FrmPublicaciones.anio.value==""){
	alert('Debe ingresar el A\u00f1o');
	document.FrmPublicaciones.anio.focus();
	return false;
	}
if(isNaN(document.FrmPublicaciones.anio.value)){
	alert('El A\u00f1o debe ser un dato num\u00e9rico');
	document.FrmPublicaciones.anio.focus();
	return false;
	}
if((document.FrmPublicaciones.anio.value)>anio){
	alert('El A\u00f1o no puede ser mayor que el a\u00f1o actual');
	document.FrmPublicaciones.anio.focus();
	return false;
	}
if(document.FrmPublicaciones.lugar.value==""){
	alert('Debe ingresar el Lugar');
	document.FrmPublicaciones.lugar.focus();
	return false;
	}
document.FrmPublicaciones.submit();
}
function validarIdiomas(){
if (document.FrmIdiomas.idioma1.value=="0"){
	alert('Debe seleccionar un Idioma');
	document.FrmIdiomas.idioma1.focus();
	return false
	}
if (document.FrmIdiomas.idioma1_nivel.value=="0"){
	alert('Debe seleccionar el Nivel');
	document.FrmIdiomas.idioma1_nivel.focus();
	return false
	}	
if ((document.FrmIdiomas.idioma2.value!="0")&&(document.FrmIdiomas.idioma2_nivel.value=="0")){
	alert('Debe seleccionar el Nivel');
	document.FrmIdiomas.idioma2_nivel.focus();
	return false
	}
if ((document.FrmIdiomas.idioma3.value!="0")&&(document.FrmIdiomas.idioma3_nivel.value=="0")){
	alert('Debe seleccionar el Nivel');
	document.FrmIdiomas.idioma3_nivel.focus();
	return false
	}
document.FrmIdiomas.submit();
}
function diffDate(a,b){
var fecha_ingreso=String(a.substring(6,10))+String(a.substring(3,5))+String(a.substring(0,2));
var fecha_egreso=String(b.substring(6,10))+String(b.substring(3,5))+String(b.substring(0,2));
if (parseInt(fecha_egreso)<parseInt(fecha_ingreso)){
	return false;
	}
	else
		return true;
}
function validarDatosInteres(){
if(document.FrmDatosInteres.hobbies.value==""){
	alert('Debe ingresar alguno de los items');
	document.FrmDatosInteres.hobbies.value;
	return false;
	}	
if(document.FrmDatosInteres.hobbies.value.length>255){
	alert('No puede ingresar más de 255 caracteres');
	document.FrmDatosInteres.hobbies.value;
	return false;
	}	
document.FrmDatosInteres.submit();	
}
function validarAdminLogin(){
	if (document.FrmLogin.usuario.value==""){
		alert('Ingrese el Usuario');
		document.FrmLogin.usuario.focus();
		return false
		}
	if (document.FrmLogin.password.value==""){
		alert('Ingrese el Password');
		document.FrmLogin.password.focus();
		return false
		}
document.FrmLogin.submit();			
}
function subirArchivo(){
window.open('upload.asp','new','top=150,left=150,width=250,height=10,scrollbars=no,status=no,location=no,resizable=no');
}
function mailJueces(id_concurso){
window.open('concurso_jueces_enviar_mail.asp?id_concurso='+id_concurso,'new','top=150,left=150,width=300,height=250,scrollbars=no,status=no,location=no,resizable=no');
}

function juecesValidarEnvio(){
s=0
for(i=0;i<document.FrmConcursoJuecesEnviarMail.id_juez.length;i++){				
	if(document.FrmConcursoJuecesEnviarMail.id_juez[i].checked){
		s=1;
		break
		}
	}
if (s==0){
	alert('Debe seleccionar al menos un juez')
	return false;
	}
document.FrmConcursoJuecesEnviarMail.submit()
}
		
function validarConcursoVeedor(){
if(document.FrmConcursosVeedorAsignar.id_veedor.value==0){	
	alert('Debe seleccionar un veedor')
	return false;
	}
if(document.FrmConcursosVeedorAsignar.id_concurso.value==0){	
	alert('Debe seleccionar un concurso')
	return false;
	}

document.FrmConcursosVeedorAsignar.submit()
}

function validarConcurso(){
if(document.FrmConcursosIngresar.titulo.value==""){
	alert('Debe ingresar el T\u00edtulo');
	document.FrmConcursosIngresar.titulo.focus();
	return false;
	}


var n=0;
for(i=0;i<document.FrmConcursosIngresar.nivel.length;i++){
	if(document.FrmConcursosIngresar.nivel[i].checked){
		n=1;
		}	
	}
if(n==0){
	alert('Debe elegir el Nivel requerido');
	document.FrmConcursosIngresar.nivel[0].focus();
	return false;
	}

var tr=0
for(i=0;i<document.FrmConcursosIngresar.carrera.length;i++){
	if(document.FrmConcursosIngresar.carrera.options[i].selected){
		tr=tr+1
		}
	}
if((tr>1)&&(document.FrmConcursosIngresar.carrera.options[0].selected)){
	document.FrmConcursosIngresar.carrera.options[0].selected=false;
	mostrarCantidad(document.FrmConcursosIngresar.carrera,document.getElementById('carrera_cantidad'));
	}

if (((document.FrmConcursosIngresar.nivel[1].checked)||(document.FrmConcursosIngresar.nivel[2].checked))&&((document.FrmConcursosIngresar.carrera.value=="0")||(document.FrmConcursosIngresar.carrera.value==""))){
	alert('Debe seleccionar el T\u00edtulo requerido');
	document.FrmConcursosIngresar.carrera.focus();
	return false;
	}
	
if(document.FrmConcursosIngresar.descripcion.value==""){
	alert('Debe ingresar la Descripci\u00f3n');
	document.FrmConcursosIngresar.descripcion.focus();
	return false;
	}
if(document.FrmConcursosIngresar.descripcion.value.length>255){
	alert('La Descripci\u00f3n no puede \nsuperar lo 255 caracteres');
	document.FrmConcursosIngresar.descripcion.focus();
	return false;
	}	
if(document.FrmConcursosIngresar.ministerio.value==0){
	alert('Debe Seleccionar el Ministerio');
	document.FrmConcursosIngresar.ministerio.focus();
	return false;
	}
//if(document.FrmConcursosIngresar.subsecretaria.value==0){
if(document.getElementById("subsecretaria").value==0){	
	alert('Debe Seleccionar la Subsecretaria');
	document.FrmConcursosIngresar.subsecretaria.focus();
	return false;
	}
document.FrmConcursosIngresar.subsecretaria2.value=document.getElementById("subsecretaria").value;

//if(document.FrmConcursosIngresar.direccion_gral.value==0){
if(document.getElementById("direccion_gral").value==0){		
	alert('Debe Seleccionar la Direcci\u00f3nn Gral.');
	document.FrmConcursosIngresar.direccion_gral.focus();
	return false;
	}
document.FrmConcursosIngresar.direccion_gral2.value=document.getElementById("direccion_gral").value;	
	
if(document.FrmConcursosIngresar.fecha_apertura.value==""){
	alert('Debe ingresar la Fecha de Apertura');
	document.FrmConcursosIngresar.fecha_apertura.focus();
	return false;
	}
if(!ValidateDate(document.FrmConcursosIngresar.fecha_apertura.value)){
	alert('La Fecha de Apertura no es v\u00e1lida');
	document.FrmConcursosIngresar.fecha_apertura.focus();
	return false;
	}
if(document.FrmConcursosIngresar.fecha_cierre.value==""){
	alert('Debe ingresar la Fecha de Cierre');
	document.FrmConcursosIngresar.fecha_cierre.focus();
	return false;
	}
if(!ValidateDate(document.FrmConcursosIngresar.fecha_cierre.value)){
	alert('La Fecha de Cierre no es v\u00e1lida');
	document.FrmConcursosIngresar.fecha_cierre.focus();
	return false;
	}
if(!diffDate(document.FrmConcursosIngresar.fecha_apertura.value,document.FrmConcursosIngresar.fecha_cierre.value)){
	alert('La Fecha de Apertura no puede ser \nmayor que la Fecha de Cierre');
	document.FrmConcursosIngresar.fecha_apertura.focus();
	return false;
	}	
var cantidad=0;
document.FrmConcursosIngresar.jueces[0].selected=false;
for (i=0;i<document.FrmConcursosIngresar.jueces.length;i++){
	if(document.FrmConcursosIngresar.jueces[i].selected){
		cantidad=cantidad+1;
		}
	}
if (cantidad==0){
	alert('Debe Seleccionar los Jueces');
	document.FrmConcursosIngresar.jueces.focus();
	return false;
	}
if (cantidad>3){
	alert('Debe Seleccionar 3 Jueces como m\u00e1ximo');
	document.FrmConcursosIngresar.jueces.focus();
	return false;	
	}
var cantidad_suplentes=0;
document.FrmConcursosIngresar.jueces_suplentes[0].selected=false;
for (i=0;i<document.FrmConcursosIngresar.jueces_suplentes.length;i++){
	if(document.FrmConcursosIngresar.jueces_suplentes[i].selected){
		cantidad_suplentes=cantidad_suplentes+1;
		}
	}
if (cantidad_suplentes==0){
	alert('Debe Seleccionar los Jueces Suplentes');
	document.FrmConcursosIngresar.jueces_suplentes.focus();
	return false;
	}
if (cantidad_suplentes>3){
	alert('Debe Seleccionar 3 Jueces Suplentes como m\u00e1ximo');
	document.FrmConcursosIngresar.jueces_suplentes.focus();
	return false;	
	}

for (i=0;i<document.FrmConcursosIngresar.jueces.length;i++){
	if(document.FrmConcursosIngresar.jueces[i].selected){
		for (j=0;j<document.FrmConcursosIngresar.jueces_suplentes.length;j++){
			if(document.FrmConcursosIngresar.jueces_suplentes[j].selected){
				if(document.FrmConcursosIngresar.jueces[i].value==document.FrmConcursosIngresar.jueces_suplentes[j].value){
					alert('No puede seleccionar un Juez como titular y suplente');
					return false;
					}
				}
			}		
		}
	}

if(document.FrmConcursosIngresar.estado.value==0){
	alert('Debe seleccionar el estado del Concurso');
	document.FrmConcursosIngresar.estado.focus();
	return false;
	}	
if(document.FrmConcursosIngresar.nombre_pdf.value==""){
	alert('Debe cargar el Documento PDF');
	document.FrmConcursosIngresar.nombre_pdf.focus();
	return false;
	}
document.FrmConcursosIngresar.submit();
}

function cambiarEstado(f){
//alert(document.getElementById(f).id_estado.value);
//alert(document.getElementById(f).estado_actual.value);

if (!confirm('¿Está seguro que desea cambiar de estado a este concurso?\nRecuerde que enviará correos a los participantes')){
	document.getElementById(f).id_estado.value=document.getElementById(f).estado_actual.value;
	return false;
	}

if((document.getElementById(f).id_estado.value!=3)&&(document.getElementById(f).id_estado.value!=4)){	
	if ((parseInt(document.getElementById(f).id_estado.value)<parseInt(document.getElementById(f).estado_actual.value))&&(document.getElementById(f).estado_actual.value!=3)&&(document.getElementById(f).estado_actual.value!=4)&&(document.getElementById(f).estado_actual.value!=12)&&(document.getElementById(f).estado_actual.value!=13)){
		alert('No puede cambiar el estado del concurso a uno anterior');
		document.getElementById(f).id_estado.focus();	
		for(i=0;i<document.getElementById(f).id_estado.length;i++){			
			if(document.getElementById(f).id_estado[i].value==document.getElementById(f).estado_actual.value){				
				document.getElementById(f).id_estado[i].selected=true;
				}
			}
		return false;
		}		
	}

if(document.getElementById(f).id_estado.value==12){
	document.getElementById(f).submit();
	return false;
	}
	
window.open('upload_actas.asp','new','top=200,left=200,width=400,height=260,scrollbars=no,status=no,location=no,resizable=no');
document.getElementById("frm_name").formulario.value=f;

}

function ValidateDate(f){ 
var f
var dia=(f.substring(0,2));
var mes=(f.substring(3,5));
var anio=(f.substring(6,10));
if (f.length!==10){
	return false;
	}
	else{
		if ((isNaN(dia)) || (isNaN(mes)) || (isNaN(anio))){
			return false;
			}
			else{
				if(dia>31){
					return false;
					}
					else{
						if(mes>12){
							return false;
							}
							else{
								if((anio%4!=0) && (mes==2) && (dia==29)){
									return false;							
									}
									else{
										if((dia==31)&&((mes==2)||(mes==4)||(mes==6)||(mes==9)||(mes==11))){
											return false;
											}									
											else{
												return true;
												}										
										}
								}
						}
				}
		}
}
function mostrarOtro(m){	
if(m=='rubro'){
	if (document.FrmExperiencias.rubro.value==999){
		document.getElementById("otro_rubro").style.visibility="visible";
		}
		else{
			document.getElementById("otro_rubro").style.visibility="hidden";
			}
	}
if(m=='area'){
	if (document.FrmExperiencias.area.value==999){
		document.getElementById("otra_area").style.visibility="visible";
		}
		else{
			document.getElementById("otra_area").style.visibility="hidden";
			}
	}
if(m=='universidad'){
	if (document.FrmPostUnivIngresar.universidad.value==373){				
		document.getElementById("otra_universidad").style.visibility="visible";
		}
		else{
			document.getElementById("otra_universidad").style.visibility="hidden";	
			}
	}
if(m=='carrera'){
	if (document.FrmPostUnivIngresar.titulo.value==117){
		document.getElementById("otra_carrera").style.visibility="visible";	
		}
		else{
			document.getElementById("otra_carrera").style.visibility="hidden";	
			}
	}
}
function validarBusquedaDocumentacion(){
if(document.FrmPostulanteConcursoDocumentacionBuscar.concurso.value==0){
	alert('Debe seleccionar el Concurso');
	document.FrmPostulanteConcursoDocumentacionBuscar.concurso.focus();
	return false;
	}
if(document.FrmPostulanteConcursoDocumentacionBuscar.tipo_documento.value==0){
	alert('Debe ingresar el Tipo de Documento');
	document.FrmPostulanteConcursoDocumentacionBuscar.tipo_documento.focus();
	return false;
	}
if(document.FrmPostulanteConcursoDocumentacionBuscar.nro_documento.value==""){
	alert('Debe ingresar el Nro. de Documento');
	document.FrmPostulanteConcursoDocumentacionBuscar.nro_documento.focus();
	return false;	
	}
if(document.FrmPostulanteConcursoDocumentacionBuscar.nro_documento.value.indexOf('.', 0)!=-1){
	alert('Debe ingresar el Nro. de Documento sin puntos');
	document.FrmPostulanteConcursoDocumentacionBuscar.nro_documento.focus();
	return false;
	}
if (isNaN(document.FrmPostulanteConcursoDocumentacionBuscar.nro_documento.value)){
	alert('Debe ingresar un dato Num\u00e9rico');
	document.FrmPostulanteConcursoDocumentacionBuscar.nro_documento.focus();
	return false;
	}
	
document.FrmPostulanteConcursoDocumentacionBuscar.submit();
}

function validarJueces(){
if (document.FrmJuecesIngresar.nombre.value==""){
	alert('Debe ingresar el Nombre');
	document.FrmJuecesIngresar.nombre.focus();
	return false;
	}
if (document.FrmJuecesIngresar.apellido.value==""){
	alert('Debe ingresar el Apellido');
	document.FrmJuecesIngresar.apellido.focus();
	return false;
	}	
if (document.FrmJuecesIngresar.email.value==""){
	alert('Debe ingresar el Email');
	document.FrmJuecesIngresar.email.focus();
	return false;
	}	
if (document.FrmJuecesIngresar.email.value.indexOf('@', 0) == -1 || document.FrmJuecesIngresar.email.value.indexOf('.', 0) == -1){	
	alert('El Email ingresado no es v\u00e1lido');
	document.FrmJuecesIngresar.email.focus();
	return false;
	}
if (document.FrmJuecesIngresar.bio.value==""){
	alert('Debe ingresar la Bio');
	document.FrmJuecesIngresar.bio.focus();
	return false;
	}	
if (document.FrmJuecesIngresar.bio.value.length>500){
	alert('La Bio no puede superar los 500 caracteres');
	document.FrmJuecesIngresar.bio.focus();
	return false;
	}		
document.FrmJuecesIngresar.submit()	
}

function validarVeedor(){
if (document.FrmVeedorIngresar.nombre.value==""){
	alert('Debe ingresar el Nombre');
	document.FrmVeedorIngresar.nombre.focus();
	return false;
	}
if (document.FrmVeedorIngresar.apellido.value==""){
	alert('Debe ingresar el Apellido');
	document.FrmVeedorIngresar.apellido.focus();
	return false;
	}	
if (document.FrmVeedorIngresar.email.value==""){
	alert('Debe ingresar el Email');
	document.FrmVeedorIngresar.email.focus();
	return false;
	}	
if (document.FrmVeedorIngresar.email.value.indexOf('@', 0) == -1 || document.FrmVeedorIngresar.email.value.indexOf('.', 0) == -1){	
	alert('El Email ingresado no es v\u00e1lido');
	document.FrmVeedorIngresar.email.focus();
	return false;
	}
document.FrmVeedorIngresar.submit()	
}


function validarUsuarios(){
if (document.FrmUsuariosIngresar.nombre.value==""){
	alert('Debe ingresar el Nombre');
	document.FrmUsuariosIngresar.nombre.focus();
	return false;
	}
if (document.FrmUsuariosIngresar.apellido.value==""){
	alert('Debe ingresar el Apellido');
	document.FrmUsuariosIngresar.apellido.focus();
	return false;
	}	
if (document.FrmUsuariosIngresar.email.value==""){
	alert('Debe ingresar el Email');
	document.FrmUsuariosIngresar.email.focus();
	return false;
	}	
if (document.FrmUsuariosIngresar.email.value.indexOf('@', 0) == -1 || document.FrmUsuariosIngresar.email.value.indexOf('.', 0) == -1){	
	alert('El Email ingresado no es v\u00e1lido');
	document.FrmUsuariosIngresar.email.focus();
	return false;
	}	
if (document.FrmUsuariosIngresar.perfil.value=="0"){
	alert('Debe selecccionar el Perfil');
	document.FrmUsuariosIngresar.perfil.focus();
	return false;
	}		
document.FrmUsuariosIngresar.submit()	
}

function validarMinisterios(){
if (document.FrmMinisterios.ministerio.value==""){
	alert('Debe ingresar el Ministerio');
	document.FrmMinisterios.ministerio.focus();
	return false;
	}
document.FrmMinisterios.submit()	
}

function validarSubsecretarias(){
if (document.FrmSubsecretarias.subsecretaria.value==""){
	alert('Debe ingresar la Subsecretar\u00eda');
	document.FrmSubsecretarias.subsecretaria.focus();
	return false;
	}
if (document.FrmSubsecretarias.id_ministerio.value=="0"){
	alert('Debe seleccionar el Ministerio');
	document.FrmSubsecretarias.id_ministerio.focus();
	return false;
	}
document.FrmSubsecretarias.submit()
}
function validarDireccionesGrales(){
	if (document.FrmDireccionGral.direccion_gral.value==""){
	alert('Debe ingresar la Direcci\u00f3n Gral.');
	document.FrmSubsecretarias.direccion_gral.focus();
	return false;
	}
if (document.FrmDireccionGral.id_subsecretaria.value=="0"){
	alert('Debe seleccionar la Subsecretar\u00eda');
	document.FrmDireccionGral.id_subsecretaria.focus();
	return false;
	}
document.FrmDireccionGral.submit()
}
function datosOlvidoclave(){
if (document.FrmLogin.tipo_documento.value=="0"){
	alert('Debe seleccionar el Tipo de Documento');
	document.FrmLogin.tipo_documento.focus();
	return false;
	}
if (document.FrmLogin.numero_documento.value==""){
	alert('Debe ingresar el N\u00famero de Documento');
	document.FrmLogin.numero_documento.focus();
	return false;
	}
document.FrmOlvidoClave.tipo.value=document.FrmLogin.tipo_documento.value;
document.FrmOlvidoClave.documento.value=document.FrmLogin.numero_documento.value;	
document.FrmOlvidoClave.submit();
}
function validarPreguntaSeguridad(){
var o=parseInt(document.FrmPreguntaSeguridad.opcion.value);
var op1=option1-9876;
var op2=option2-9876;
var op3=option3-9876;
switch(o){
	case 1:			
		if(document.FrmPreguntaSeguridad.dia_nacimiento.value==""){
			alert('Debe ingresar el d\u00eda de nacimiento');
			document.FrmPreguntaSeguridad.dia_nacimiento.focus();	
			return false;
			}
		if(document.FrmPreguntaSeguridad.dia_nacimiento.value!=op1){
			alert('El d\u00eda ingresado no es correcto');
			document.FrmPreguntaSeguridad.anio_nacimiento.focus();	
			intento=intento+1;			
			if (intento>2){
				document.getElementById('intentos').style.display='';
				}
			return false;
			}	
		break;	
	case 2:			
		if(document.FrmPreguntaSeguridad.anio_nacimiento.value==""){
			alert('Debe ingresar el A\u00f1o de nacimiento');
			document.FrmPreguntaSeguridad.anio_nacimiento.focus();				
			return false;
			}
		if(document.FrmPreguntaSeguridad.anio_nacimiento.value!=op2){
			alert('El A\u00f1o ingresado no es correcto');
			document.FrmPreguntaSeguridad.anio_nacimiento.focus();	
			intento=intento+1;			
			if (intento>2){
				document.getElementById('intentos').style.display='';
				}
			return false;
			}	
		break;	
	case 3:	
		
		if(document.FrmPreguntaSeguridad.cuit.value==""){
			alert('Debe ingresar el CUIT/CUIL');
			document.FrmPreguntaSeguridad.cuit.focus();			
			return false;
			}
		if(document.FrmPreguntaSeguridad.cuit.value!=op3){
			alert('El CUIT/CUIL ingresado no es correcto');
			document.FrmPreguntaSeguridad.cuit.focus();	
			intento=intento+1;			
			if (intento>2){
				document.getElementById('intentos').style.display='';
				}			
			return false;
			}	
		break;	
	}
document.getElementById('pregunta_seg').style.display='none';
document.getElementById('cambiar_mail').style.display='';
}
function cambiarMailValidar(){
if (document.FrmCambiarMail.email.value==document.FrmCambiarMail.email_actual.value){
	alert('El email que ha ingresado es igual a su email actual');
	document.FrmCambiarMail.email.focus();
	return false;
	}		
if (document.FrmCambiarMail.email.value==""){
	alert('Debe ingresar el email');
	document.FrmCambiarMail.email.focus();
	return false;
	}	
if (document.FrmCambiarMail.email.value.indexOf('@', 0) == -1 || document.FrmCambiarMail.email.value.indexOf('.', 0) == -1){	
	alert('El Email ingresado no es v\u00e1lido');
	document.FrmCambiarMail.email.focus();
	return false;
	}
if ((document.FrmCambiarMail.email.value)!=(document.FrmCambiarMail.repetir_email.value)){
	alert('El email y la repetici\u00f3n son distintos');
	document.FrmCambiarMail.email.focus();
	return false;
	}
document.FrmCambiarMail.submit()	
}
function alinearColumnas(){
    //values
    var c2_val = document.getElementById('contenido').offsetHeight;
    var c1_val = document.getElementById('menu_izquierdo').offsetHeight;   

    //id
    var c1_id = document.getElementById('menu_izquierdo');
    var c2_id = document.getElementById('contenido');   

    var maximo = Math.max(c1_val,c2_val);  
	document.getElementById('menu_izquierdo').style.height=maximo+'px';
	document.getElementById('contenido').style.height=(maximo)+'px';
}
function aceptarPostulacion(){
with (window.frames["Terminos"])
if (!document.forms["FrmAceptaTerminosConcurso"]["acepta_terminos"].checked){
	alert('Debe aceptar los T\u00e9rminos y Condiciones');	
	return false;
	}	
document.FrmConcursoPostular.submit();
}
function validarVerTodos(){
if (document.FrmBuscar.estado.value=="0"){
	alert('Debe seleccionar un estado');
	document.FrmBuscar.estado.focus();
	return false;
	}
document.FrmBuscar.submit()
}

function validarAdminCambiarPassword(){
	if(document.FrmAdminCambiarPassword.password_actual.value==""){
		alert('Debe ingresar su Password Actual');
		document.FrmAdminCambiarPassword.password_actual.focus();
		return false;
		}
	if(document.FrmAdminCambiarPassword.password_old.value!=document.FrmAdminCambiarPassword.password_actual.value){			
		alert('La Password Actual ingresada no es correcta');
		document.FrmAdminCambiarPassword.password_actual.focus();
		return false;
		}	
	if(document.FrmAdminCambiarPassword.password_nueva.value==""){
		alert('Debe ingresar su Password Nueva');
		document.FrmAdminCambiarPassword.password_nueva.focus();
		return false;		
		}
	if(document.FrmAdminCambiarPassword.repite_password_nueva.value==""){
		alert('Debe reingresar su Password Nueva');
		document.FrmAdminCambiarPassword.repite_password_nueva.focus();
		return false;		
		}
	if(document.FrmAdminCambiarPassword.password_nueva.value!=document.FrmAdminCambiarPassword.repite_password_nueva.value){			
		alert('La Passwrod Nueva ingresada y la retipeada son distintas');
		document.FrmAdminCambiarPassword.password_nueva.focus();
		return false;
		}		
document.FrmAdminCambiarPassword.submit();
}

function olvidoClaveValidar(){
var u=0;
if (document.FrmLogin.usuario.value==""){
	alert('Debe ingresar el usuario');
	document.FrmLogin.usuario.focus();
	return false;
	}	
	for(i=0;i<aUsuarios.length;i++){				
	if(aUsuarios[i].usuario==document.FrmLogin.usuario.value){	
		document.FrmOlvidoClave.id_usuario.value=aUsuarios[i].id_usuario;		
		u=1;
		break;
		}					
	}
if (u==0){
	alert('El Usuario ingresado es inexistente');
	document.FrmLogin.usuario.focus();
	return false;
	}
document.FrmOlvidoClave.submit();
}

function confirmarDocumentacion(){
if (confirm('¿El Postulante dió conformidad de lo entregado?')){	
	var id_postulante=document.FrmPostulanteDocumentacionMostrar.id_postulante.value;
	var id_concurso=document.FrmPostulanteDocumentacionMostrar.id_concurso.value;
	document.location.href='postulante_documentacion_confirmar.asp?id_postulante='+id_postulante+'&id_concurso='+id_concurso;
	}	
}

function validarRehabilitarDoc(){
if(document.FrmRehabilitarDoc.id_concurso.value=="0"){
	alert('Debe seleccionar un Concurso');
	document.FrmRehabilitarDoc.concurso.focus();
	return false
	}
document.FrmRehabilitarDoc.submit();
}

function validarExportarCVS(){
var s=0;
for(i=0; i<document.FrmCVSExportar.id_postulante.length;i++){
	if(document.FrmCVSExportar.id_postulante[i].checked){
		s=s+1;
		}
	}
if(s==0){
	alert('Debe seleccionar los postulantes');
	document.FrmCVSExportar.id_postulant.focus();
	return false
	}
document.FrmCVSExportar.submit();
}
function abrirXLS(){
window.open('/regimengerencial/concursos/pdfs/exportacion/cvs_estudios_concurso.xls');
window.open('/regimengerencial/concursos/pdfs/exportacion/cvs_experiencia_concurso.xls');
window.open('/regimengerencial/concursos/pdfs/exportacion/cvs_otros_concurso.xls');
window.open('/regimengerencial/concursos/pdfs/exportacion/modelo.xlsm');
}

function informeActa1Validar(){
for (i=0; i<document.FrmInfroemActa1.id_postulante.length; i++){	
	if(document.FrmInfroemActa1.excluyenteCH[i].checked){
		document.FrmInfroemActa1.excluyente[i].value=1;
		}
		else{
			document.FrmInfroemActa1.excluyente[i].value=0;			
			}	
	if(document.FrmInfroemActa1.preferentementeCH[i].checked){
		document.FrmInfroemActa1.preferentemente[i].value=1;
		}
		else{
			document.FrmInfroemActa1.preferentemente[i].value=0;
			}
	if(document.FrmInfroemActa1.publico[i].value==""){
		alert('Debe ingresar el texto para P\u00fablico');
		document.FrmInfroemActa1.publico[i].focus();
		return false;
		}
	if(document.FrmInfroemActa1.publico[i].value.length>100){
		alert('El campo P\u00fablico no puede superar los 100 caracteres');
		document.FrmInfroemActa1.publico[i].focus();
		return false;
		}
	if(document.FrmInfroemActa1.privado[i].value==""){
		alert('Debe ingresar el texto para Privado');
		document.FrmInfroemActa1.privadoo[i].focus();
		return false;
		}
	if(document.FrmInfroemActa1.privado[i].value.length>100){
		alert('El campo Privado no puede superar los 100 caracteres');
		document.FrmInfroemActa1.privado[i].focus();
		return false;
		}
	if(document.FrmInfroemActa1.observaciones[i].value.length>200){
		alert('El campo Observaciones no puede superar los 200 caracteres');
		document.FrmInfroemActa1.observaciones[i].focus();
		return false;
		}

	document.FrmInfroemActa1.publico[i].value=document.FrmInfroemActa1.publico[i].value.replace(",", "&sbquo;");
	document.FrmInfroemActa1.publico[i].value=document.FrmInfroemActa1.publico[i].value.replace("'", "''");
	document.FrmInfroemActa1.privado[i].value=document.FrmInfroemActa1.privado[i].value.replace(",", "&sbquo;");
	document.FrmInfroemActa1.privado[i].value=document.FrmInfroemActa1.privado[i].value.replace("'", "''");
	document.FrmInfroemActa1.observaciones[i].value=document.FrmInfroemActa1.observaciones[i].value.replace(",", "&sbquo;");
	document.FrmInfroemActa1.observaciones[i].value=document.FrmInfroemActa1.observaciones[i].value.replace("'", "''");
	}
document.FrmInfroemActa1.submit();
}

function limita(obj,elEvento, maxi)  
{  
  var elem = obj;  
  
  var evento = elEvento || window.event;  
  var cod = evento.charCode || evento.keyCode;  
  
    // 37 izquierda  
    // 38 arriba  
    // 39 derecha  
    // 40 abajo  
    // 8  backspace  
    // 46 suprimir  
  
  if(cod == 37 || cod == 38 || cod == 39  
  || cod == 40 || cod == 8 || cod == 46)  
  {  
    return true;  
  }  
  
  if(elem.value.length < maxi )  
  {  
    return true;  
  }  
  
  return false;  
}  
  
function cuenta(obj,evento,maxi,div)  
{  
    var elem = obj.value;  
    var info = document.getElementById(div);
	var cantidad = maxi-elem.length.toString()  
    info.innerHTML = 'Restan ' + cantidad +' caracteres';  
}   


function mostrarCantidad(aContar, elTexto) {
	var i;
	var cantidad =0;
	var texto = '';	
	for (i=0; i < aContar.options.length; i++)
		if (aContar.options[i].selected) {
			if (cantidad>0)
				texto=texto+', '+aContar.options[i].text;
			else
				texto=aContar.options[i].text;
			cantidad++;
		}
	if (cantidad==1)
		elTexto.innerHTML = '<strong>' + cantidad + ' opci&oacute;n seleccionada</strong><br>'+texto;
	else
		if (cantidad==0)
			elTexto.innerHTML = '<strong>Ninguna opci&oacute;n seleccionada</strong>';
		else
			elTexto.innerHTML = '<strong>'+ cantidad +' opciones seleccionadas </strong><br>' + texto;
}

