//***************************
//Funciones generales, accesibles desde cualquier página
//FECHA: 16/01/2001
//***************************
function searchoption(sidinput,sidoption){
	oselect=document.forms["alta_user"].elements[sidinput];
//	alert(sidinput)
//	alert(sidoption)
//	alert('long '+oselect.options.length)
	for(var ni=0; ni< oselect.options.length; ni++){    
		if (oselect.options[ni].id == sidoption){
		oselect.selectedIndex = ni; 
		break;
		}
	}	

}
function m4submitjs(id){
	if (typeof(document.forms[id]) != "undefined"){
		document.forms[id].submit();
	}
	else{
		alert("Formulario no definido");
	}
}
function get_val2(sidinput){
	var oobje = document.forms["alta_user"].elements[sidinput];
	for (i=0; i<oobje.length; i++) {
   		if (oobje[i].checked == true){
   			oobje = oobje[i];
		}
   	}

	return(oobje.value);

}
function get_val(sidinput){
	var oobje = document.forms["alta_user"].elements[sidinput];
	return(oobje.value);

}
function check_campo(sidinput,serr){
	var scont_nulos = comprobar_espacios("alta_user",sidinput);
	if (scont_nulos  == 0){
		alert(serr);
		var oobjeto = document.forms["alta_user"].elements[sidinput];
		oobjeto.focus();
		  return(0);
	}
	 return(1);		
}
function check_campo2(sidinput,serr){
	var scont_nulos = comprobar_espacios2("alta_user",sidinput);
	if (scont_nulos  == 0){
		alert(serr);
		var oobjeto = document.forms["alta_user"].elements[sidinput];
		oobjeto.focus();
		  return(0);
	}
	 return(1);		
}
function comprobar_formato_fecha(fecha)
	{
	 var longfecha=fecha.length;
	 var caracterseparador=fecha.charAt(2);
	 var poscarsep = fecha.indexOf(caracterseparador);
	 if (poscarsep==-1){
	 return (0);
	 }else{
	   var anio=fecha.substring(6,longfecha);
	   if((anio<1900)||(anio>2100)){
	  return(0);
	   }// cierre if((annio<1900)||(annio>2100))
	   var poscarsepj = fecha.indexOf(caracterseparador,poscarsep+1);
	  if ((poscarsepj==-1)||(poscarsepj!=5)){
		return(0);
		}else{
		 var mes=fecha.substring(3,5);
		 if((mes<0)||(mes>12)){
		 return(0);
		 }//cierre if((mes<0)||(mes>12))
		 var dia=fecha.substring(0,2);
			 for (var i=0;i<2;i++){
				j=dia.substring(i,i+1);
				if(j==""){return (0);}
			 }
		 if((dia<1)||(dia>31)){
		 return(0);
		 }//cierre if((dia<1)||(dia>31))
		}//cierre if (poscarsepj==-1)
	 }//cierre if (poscarsep==-1)
	 return(1);
	
}//cierre funcion




 //***************************
//Funciones de la pagina de alta de usuarios alta_usuarios_nuevos.jsp
//FECHA: 28/11/2000
//***************************


function filtrar_alta_user(numero){
			
		if (numero == 1)
		{

			document.list_anidadas.pais.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;
			document.list_anidadas.com.value = "";
			document.list_anidadas.prov.value = "";
			document.list_anidadas.place.value = "";
			document.list_anidadas.pais1.value = document.alta_user.STD_ID_COUNTRY_1.options[document.alta_user.STD_ID_COUNTRY_1.selectedIndex].value;
			document.list_anidadas.com1.value = document.alta_user.STD_ID_GEO_DIV_1.options[document.alta_user.STD_ID_GEO_DIV_1.selectedIndex].value;
			document.list_anidadas.prov1.value = document.alta_user.STD_ID_SUB_GEO_DIV_1.options[document.alta_user.STD_ID_SUB_GEO_DIV_1.selectedIndex].value;
			document.list_anidadas.place1.value = document.alta_user.STD_ID_GEO_PLACE_1.options[document.alta_user.STD_ID_GEO_PLACE_1.selectedIndex].value;
			document.list_anidadas.lis.value = 1;
		}
		if (numero == 2)
		{

			document.list_anidadas.pais.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;
			document.list_anidadas.com.value = document.alta_user.STD_ID_GEO_DIV.options[document.alta_user.STD_ID_GEO_DIV.selectedIndex].value;
			document.list_anidadas.prov.value = "";
			document.list_anidadas.place.value = "";
			document.list_anidadas.pais1.value = document.alta_user.STD_ID_COUNTRY_1.options[document.alta_user.STD_ID_COUNTRY_1.selectedIndex].value;
			document.list_anidadas.com1.value = document.alta_user.STD_ID_GEO_DIV_1.options[document.alta_user.STD_ID_GEO_DIV_1.selectedIndex].value;
			document.list_anidadas.prov1.value = document.alta_user.STD_ID_SUB_GEO_DIV_1.options[document.alta_user.STD_ID_SUB_GEO_DIV_1.selectedIndex].value;
			document.list_anidadas.place1.value = document.alta_user.STD_ID_GEO_PLACE_1.options[document.alta_user.STD_ID_GEO_PLACE_1.selectedIndex].value;
			document.list_anidadas.lis.value = 1;
		}

		if (numero == 3)
		{

			document.list_anidadas.pais.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;
			document.list_anidadas.com.value = document.alta_user.STD_ID_GEO_DIV.options[document.alta_user.STD_ID_GEO_DIV.selectedIndex].value;
			document.list_anidadas.prov.value = document.alta_user.STD_ID_SUB_GEO_DIV.options[document.alta_user.STD_ID_SUB_GEO_DIV.selectedIndex].value;
			document.list_anidadas.place.value = "";
			document.list_anidadas.pais1.value = document.alta_user.STD_ID_COUNTRY_1.options[document.alta_user.STD_ID_COUNTRY_1.selectedIndex].value;
			document.list_anidadas.com1.value = document.alta_user.STD_ID_GEO_DIV_1.options[document.alta_user.STD_ID_GEO_DIV_1.selectedIndex].value;
			document.list_anidadas.prov1.value = document.alta_user.STD_ID_SUB_GEO_DIV_1.options[document.alta_user.STD_ID_SUB_GEO_DIV_1.selectedIndex].value;
			document.list_anidadas.place1.value = document.alta_user.STD_ID_GEO_PLACE_1.options[document.alta_user.STD_ID_GEO_PLACE_1.selectedIndex].value;
			document.list_anidadas.lis.value = 1;

		}
		if (numero == 7)
		{

			document.list_anidadas.pais.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;
			document.list_anidadas.com.value = document.alta_user.STD_ID_GEO_DIV.options[document.alta_user.STD_ID_GEO_DIV.selectedIndex].value;
			document.list_anidadas.prov.value = document.alta_user.STD_ID_SUB_GEO_DIV.options[document.alta_user.STD_ID_SUB_GEO_DIV.selectedIndex].value;
			document.list_anidadas.place.value = document.alta_user.STD_ID_GEO_PLACE.options[document.alta_user.STD_ID_GEO_PLACE.selectedIndex].value;
			document.list_anidadas.pais1.value = document.alta_user.STD_ID_COUNTRY_1.options[document.alta_user.STD_ID_COUNTRY_1.selectedIndex].value;
			document.list_anidadas.com1.value = document.alta_user.STD_ID_GEO_DIV_1.options[document.alta_user.STD_ID_GEO_DIV_1.selectedIndex].value;
			document.list_anidadas.prov1.value = document.alta_user.STD_ID_SUB_GEO_DIV_1.options[document.alta_user.STD_ID_SUB_GEO_DIV_1.selectedIndex].value;
			document.list_anidadas.place1.value = document.alta_user.STD_ID_GEO_PLACE_1.options[document.alta_user.STD_ID_GEO_PLACE_1.selectedIndex].value;
			document.list_anidadas.lis.value = 1;

		}


		if (numero == 4)
		{

			document.list_anidadas.pais1.value = document.alta_user.STD_ID_COUNTRY_1.options[document.alta_user.STD_ID_COUNTRY_1.selectedIndex].value;
			document.list_anidadas.com1.value = "";
			document.list_anidadas.prov1.value = "";
			document.list_anidadas.place1.value = "";
			document.list_anidadas.pais.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;
			document.list_anidadas.com.value = document.alta_user.STD_ID_GEO_DIV.options[document.alta_user.STD_ID_GEO_DIV.selectedIndex].value;
			document.list_anidadas.prov.value = document.alta_user.STD_ID_SUB_GEO_DIV.options[document.alta_user.STD_ID_SUB_GEO_DIV.selectedIndex].value;
			document.list_anidadas.place.value = document.alta_user.STD_ID_GEO_PLACE.options[document.alta_user.STD_ID_GEO_PLACE.selectedIndex].value;
			document.list_anidadas.lis.value = 2;
		}
		if (numero == 5)
		{

			document.list_anidadas.pais1.value = document.alta_user.STD_ID_COUNTRY_1.options[document.alta_user.STD_ID_COUNTRY_1.selectedIndex].value;
			document.list_anidadas.com1.value = document.alta_user.STD_ID_GEO_DIV_1.options[document.alta_user.STD_ID_GEO_DIV_1.selectedIndex].value;
			document.list_anidadas.prov1.value = "";
			document.list_anidadas.place1.value = "";
			document.list_anidadas.pais.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;
			document.list_anidadas.com.value = document.alta_user.STD_ID_GEO_DIV.options[document.alta_user.STD_ID_GEO_DIV.selectedIndex].value;
			document.list_anidadas.prov.value = document.alta_user.STD_ID_SUB_GEO_DIV.options[document.alta_user.STD_ID_SUB_GEO_DIV.selectedIndex].value;
			document.list_anidadas.place.value = document.alta_user.STD_ID_GEO_PLACE.options[document.alta_user.STD_ID_GEO_PLACE.selectedIndex].value;
			document.list_anidadas.lis.value = 2;
		}
		if (numero == 6)
		{

			document.list_anidadas.pais1.value = document.alta_user.STD_ID_COUNTRY_1.options[document.alta_user.STD_ID_COUNTRY_1.selectedIndex].value;
			document.list_anidadas.com1.value = document.alta_user.STD_ID_GEO_DIV_1.options[document.alta_user.STD_ID_GEO_DIV_1.selectedIndex].value;
			document.list_anidadas.prov1.value = document.alta_user.STD_ID_SUB_GEO_DIV_1.options[document.alta_user.STD_ID_SUB_GEO_DIV_1.selectedIndex].value;
			document.list_anidadas.place1.value = "";
			document.list_anidadas.pais.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;
			document.list_anidadas.com.value = document.alta_user.STD_ID_GEO_DIV.options[document.alta_user.STD_ID_GEO_DIV.selectedIndex].value;
			document.list_anidadas.prov.value = document.alta_user.STD_ID_SUB_GEO_DIV.options[document.alta_user.STD_ID_SUB_GEO_DIV.selectedIndex].value;
			document.list_anidadas.place.value = document.alta_user.STD_ID_GEO_PLACE.options[document.alta_user.STD_ID_GEO_PLACE.selectedIndex].value;
			document.list_anidadas.lis.value = 2;
		}

		if (numero == 8)
		{

			document.list_anidadas.pais1.value = document.alta_user.STD_ID_COUNTRY_1.options[document.alta_user.STD_ID_COUNTRY_1.selectedIndex].value;
			document.list_anidadas.com1.value = document.alta_user.STD_ID_GEO_DIV_1.options[document.alta_user.STD_ID_GEO_DIV_1.selectedIndex].value;
			document.list_anidadas.prov1.value = document.alta_user.STD_ID_SUB_GEO_DIV_1.options[document.alta_user.STD_ID_SUB_GEO_DIV_1.selectedIndex].value;
			document.list_anidadas.place1.value = document.alta_user.STD_ID_GEO_PLACE_1.options[document.alta_user.STD_ID_GEO_PLACE_1.selectedIndex].value;
			document.list_anidadas.pais.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;
			document.list_anidadas.com.value = document.alta_user.STD_ID_GEO_DIV.options[document.alta_user.STD_ID_GEO_DIV.selectedIndex].value;
			document.list_anidadas.prov.value = document.alta_user.STD_ID_SUB_GEO_DIV.options[document.alta_user.STD_ID_SUB_GEO_DIV.selectedIndex].value;
			document.list_anidadas.place.value = document.alta_user.STD_ID_GEO_PLACE.options[document.alta_user.STD_ID_GEO_PLACE.selectedIndex].value;
			document.list_anidadas.lis.value = 2;
		}


			document.list_anidadas.docum.value = document.alta_user.SSP_ID_TP_DOC.options[document.alta_user.SSP_ID_TP_DOC.selectedIndex].value;
			document.list_anidadas.nom.value= document.alta_user.nombre.value;
			document.list_anidadas.ape.value = document.alta_user.apellido.value;
			document.list_anidadas.ape2.value = document.alta_user.apellido_2.value;
			document.list_anidadas.nif.value = document.alta_user.nif.value;
			document.list_anidadas.sig.value = document.alta_user.SSP_ID_SIGLA_DOMIC.value;
			document.list_anidadas.dir.value = document.alta_user.STD_ADDRESS_LINE_1.value;
			document.list_anidadas.codig.value = document.alta_user.SSP_DISTRIT_POSTAL.value;
			document.list_anidadas.bloq.value = document.alta_user.SSP_BLOQUE.value;
			document.list_anidadas.escal.value = document.alta_user.SSP_ESCALERA.value;
			document.list_anidadas.num.value = document.alta_user.SSP_NUM_VIA.value;
			document.list_anidadas.piso.value = document.alta_user.SSP_PISO.value;
			document.list_anidadas.puerta.value = document.alta_user.SSP_PUERTA.value;
			document.list_anidadas.t_linea.value = document.alta_user.STD_ID_LINE_TYPE.value;
			document.list_anidadas.loc.value = document.alta_user.STD_ID_LOCATION_TYPE.value;
			document.list_anidadas.loc1.value = document.alta_user.STD_ID_LOCATION_TYPE_1.value;
			document.list_anidadas.nac.value = document.alta_user.SCO_DT_BIRTH.value;
			document.list_anidadas.corr.value = document.alta_user.EMAIL.value;
			document.list_anidadas.tel.value = document.alta_user.TELEFONO.value;
			m4submitjs("list_anidadas");

	}

		function comprobar_espacios(formulario,elemento)
		{
		 var dato_comprobar = document.forms[formulario].elements[elemento].value;
		 var long_dato_comprobar = dato_comprobar.length;
		 var indicador = 0;
		 for (i=0; i<long_dato_comprobar;i++)
		  {
 		   var valor = dato_comprobar.charAt(i)
		   if (valor != " ")
		    indicador = 1;
		  }
         if (indicador == 0)
		  return(0);
		 else
		  return(1);
		}
	function comprobar_alta_user()
		{

		   var pais_nulo = comprobar_espacios("alta_user","STD_ID_COUNTRY")
			if (pais_nulo == 0)
			{
			alert(msg_1);
			document.alta_user.STD_ID_COUNTRY.focus();
			return;
			}

		   var geo_div_nulo = comprobar_espacios("alta_user","STD_ID_GEO_DIV")
			if (geo_div_nulo == 0)
			{
			alert(msg_2);
			document.alta_user.STD_ID_GEO_DIV.focus();
			return;
			}

		   var sub_div_nulo = comprobar_espacios("alta_user","STD_ID_SUB_GEO_DIV")
			if (sub_div_nulo == 0)
			{
			alert(msg_3);
			document.alta_user.STD_ID_SUB_GEO_DIV.focus();
			return;
			}

		   var geo_place_nulo = comprobar_espacios("alta_user","STD_ID_GEO_PLACE")
			if (geo_place_nulo == 0)
			{
			alert(msg_4);
			document.alta_user.STD_ID_GEO_PLACE.focus();
			return;
			}

		   var pais_nulo_1 = comprobar_espacios("alta_user","STD_ID_COUNTRY_1")
			if (pais_nulo_1 == 0)
			{
			alert(msg_5);
			document.alta_user.STD_ID_COUNTRY_1.focus();
			return;
			}

		   var geo_div_nulo_1 = comprobar_espacios("alta_user","STD_ID_GEO_DIV_1")
			if (geo_div_nulo_1 == 0)
			{
			alert(msg_6);
			document.alta_user.STD_ID_GEO_DIV_1.focus();
			return;
			}

		   var sub_div_nulo_1 = comprobar_espacios("alta_user","STD_ID_SUB_GEO_DIV_1")
			if (sub_div_nulo_1 == 0)
			{
			alert(msg_7);
			document.alta_user.STD_ID_SUB_GEO_DIV_1.focus();
			return;
			}

		   var geo_place_nulo_1 = comprobar_espacios("alta_user","STD_ID_GEO_PLACE_1")
			if (geo_place_nulo_1 == 0)
			{
			alert(msg_8);
			document.alta_user.STD_ID_GEO_PLACE_1.focus();
			return;
			}

		   var nombre_nulo = comprobar_espacios("alta_user","nombre")
			if (nombre_nulo == 0)
			{
			alert(msg_9);
			document.alta_user.nombre.focus();
			return;
			}

		   var apellido_nulo = comprobar_espacios("alta_user","apellido")
			if (apellido_nulo == 0)
			{
			alert(msg_10);
			document.alta_user.apellido.focus();
			return;
			}

		   var nif_nulo = comprobar_espacios("alta_user","nif")
			if (nif_nulo == 0)
			{
			alert(msg_11);
			document.alta_user.nif.focus();
			return;
			}
	var hoy = new Date();
	var mes_hoy = hoy.getMonth() + 1;
	var dia_hoy = hoy.getDate();
	var anio_hoy = hoy.getYear()-16;
	if (mes_hoy < "9") mes_hoy = "0" + mes_hoy;
	if (dia_hoy < "9") dia_hoy = "0" + dia_hoy;
	fecha_hoy = anio_hoy + "-" + mes_hoy + "-" + dia_hoy;
	var nac_nulo = comprobar_espacios("alta_user","SCO_DT_BIRTH")
	if (nac_nulo == 0)
	{
		alert(msg_12);
		document.alta_user.SCO_DT_BIRTH.focus();
		return;
		}else{

			fecha_nacimiento = comprobar_formato_fecha(document.alta_user.SCO_DT_BIRTH.value)
			if (fecha_nacimiento == 0)
			{
			alert(msg_13);
			document.alta_user.SCO_DT_BIRTH.focus();
			return;
			}else{
			var fec_nac = document.alta_user.SCO_DT_BIRTH.value;
			if (fecha_hoy <= fec_nac)
				{
				alert(msg_14);
				document.alta_user.SCO_DT_BIRTH.focus();
				return;
				}//cierre if (fecha_hoy <= fecha_nacimiento)
			}//cierre if (fecha_nacimiento == 0)
		}//cierre if (nac_nulo == 0)
		   var calle_nulo = comprobar_espacios("alta_user","STD_ADDRESS_LINE_1")
			if (calle_nulo == 0)
			{
			alert(msg_15);
			document.alta_user.STD_ADDRESS_LINE_1.focus();
			return;
			}
			var numero_nulo = comprobar_espacios("alta_user","SSP_NUM_VIA")
			if (numero_nulo == 0)
			{
			alert(msg_16);
			document.alta_user.SSP_NUM_VIA.focus();
			return;
			}
	var codigo_nulo = comprobar_espacios("alta_user","SSP_DISTRIT_POSTAL")
	if (codigo_nulo == 0)
	{
		alert(msg_17);
		document.alta_user.SSP_DISTRIT_POSTAL.focus();
		return;
		}else{
		cod_postal = document.alta_user.SSP_DISTRIT_POSTAL.value;
		if (isNaN(cod_postal))
		{
			alert(msg_18);
			document.alta_user.SSP_DISTRIT_POSTAL.focus();
			return;
		}else{
			num_dig_cod_postal = cod_postal.length;
			if (num_dig_cod_postal!= 5)
			{
				alert(msg_19);
				document.alta_user.cod_postal.focus();
				return;
			}//cierre if (num_dig_cod_postal!= 5)
		}//cierre if (isNaN(cod_postal))
	}//cierre if (codigo_nulo == 0)
	var tel_nulo = comprobar_espacios("alta_user","TELEFONO")
	if (tel_nulo == 0)
	{
	alert(msg_20);
	document.alta_user.TELEFONO.focus();
	return;
	}else{
	var tel_valid = document.alta_user.TELEFONO.value;
			var l_tel_valid = tel_valid.length;
			var indicador_tel = 0;
			var numeros = "0123456789";
			for (idx_tel=0; idx_tel<l_tel_valid; idx_tel++)
			{
	 		   var valor_tel = tel_valid.charAt(idx_tel);
			   if (valor_tel == " ")
			   {
			    alert(msg_21)
				document.alta_user.TELEFONO.focus();
				return;
			   }
				if (-1 == numeros.indexOf(valor_tel))
				 indicador_tel = 1;
			}
			if (indicador_tel == 1)
		    {
			    alert(msg_22)
				document.alta_user.TELEFONO.focus();
				return;
			}
	}//cierre if (tel_nulo == 0)

	var mail_nulo = comprobar_espacios("alta_user","EMAIL")
	if (mail_nulo == 0)
		{
		alert(msg_23);
		document.alta_user.EMAIL.focus();
		return;
		}else{
		var email_valid = document.alta_user.EMAIL.value;
		var l_email_valid = email_valid.length;
		var indicador_email = 0;
		for (idx=0; idx<l_email_valid; idx++)
			{
	 		   var valor_mail = email_valid.charAt(idx);
			   if (valor_mail == " ")
			   {
			    alert(msg_24)
				document.alta_user.EMAIL.focus();
				return;
			   }
			   if (valor_mail == "@")
				 indicador_email = 1;
		}//cierre for
		if (indicador_email == 0)
		{
		    alert(msg_25)
			document.alta_user.EMAIL.focus();
			return;
		}//cierre if (indicador_email == 0)

	}//cierre if (mail_nulo == 0)


		  
		   var user_nulo = comprobar_espacios("alta_user","usuario")
			if (user_nulo == 0)
			{
			alert(msg_26);
			document.alta_user.usuario.focus();
			return;
			}

		   var cont_nulo = comprobar_espacios("alta_user","contrasenia")
			if (cont_nulo == 0)
			{
			alert(msg_27);
			document.alta_user.contrasenia.focus();
			return;
			}

		   var cont_conf_nulo = comprobar_espacios("alta_user","contrasenia_conf")
			if (cont_conf_nulo == 0)
			{
			alert(msg_28);
			document.alta_user.contrasenia_conf.focus();
			return;
			}else{
				if (document.alta_user.contrasenia.value != document.alta_user.contrasenia_conf.value)
			{
				alert(msg_29);
				document.alta_user.contrasenia_conf.focus();
				return;
  		    }
			
			
			}

		   var pre_nulo = comprobar_espacios("alta_user","pregunta")
			if (pre_nulo == 0)
			{
			alert(msg_30);
			document.alta_user.pregunta.focus();
			return;
			}

		   var re_nulo = comprobar_espacios("alta_user","respuesta")
			if (re_nulo == 0)
			{
			alert(msg_31);
			document.alta_user.respuesta.focus();
			return;
			}

	m4submitjs("alta_user");			
			

		}

//***************************
//Funciones de la pagina de datos direccion js_datos_direccion.jsp
//FECHA: 28/11/2000
//***************************

	function filtrar_datos_direccion(numero){
	if (numero==1)
	document.list_anidadas.zSTD_ID_COUNTRY.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;

	if (numero==2)
	{
	document.list_anidadas.zSTD_ID_COUNTRY.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;

	document.list_anidadas.zSTD_ID_GEO_DIV.value = 
	document.alta_user.STD_ID_GEO_DIV.options[document.alta_user.STD_ID_GEO_DIV.selectedIndex].value;
	}
	if (numero==3)
	{
	document.list_anidadas.zSTD_ID_COUNTRY.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;

	document.list_anidadas.zSTD_ID_GEO_DIV.value = 
	document.alta_user.STD_ID_GEO_DIV.options[document.alta_user.STD_ID_GEO_DIV.selectedIndex].value;

	document.list_anidadas.zSTD_ID_SUB_GEO_DIV.value = 
	document.alta_user.STD_ID_SUB_GEO_DIV.options[document.alta_user.STD_ID_SUB_GEO_DIV.selectedIndex].value;
	}

	if (numero==4)
	{
	document.list_anidadas.zSTD_ID_COUNTRY.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;

	document.list_anidadas.zSTD_ID_GEO_DIV.value = 
	document.alta_user.STD_ID_GEO_DIV.options[document.alta_user.STD_ID_GEO_DIV.selectedIndex].value;

	document.list_anidadas.zSTD_ID_SUB_GEO_DIV.value = 
	document.alta_user.STD_ID_SUB_GEO_DIV.options[document.alta_user.STD_ID_SUB_GEO_DIV.selectedIndex].value;

	document.list_anidadas.zSTD_ID_GEO_PLACE.value = 
	document.alta_user.STD_ID_GEO_PLACE.options[document.alta_user.STD_ID_GEO_PLACE.selectedIndex].value;
	}
	
	filter_address();
	m4submitjs("list_anidadas");


	}

		function comprobar_espacios(formulario,elemento)
		{
	
		 var dato_comprobar = document.forms[formulario].elements[elemento].value;
		 var long_dato_comprobar = dato_comprobar.length;
		 var indicador = 0;
		 for (i=0; i<long_dato_comprobar;i++)
		  {
 		   var valor = dato_comprobar.charAt(i)
		   if (valor != " ")
		    indicador = 1;
		  }
         if (indicador == 0)
		  return(0);
		 else
		  return(1);
		}


function comprobar_datos_direccion(){
	vckdata =check_address()
	if (vckdata==0){return}
	var informacion = "";
	var informacion = "";
    informacion = "_NODO=SCO_CURR_ADDRESS{_ACCION=UPDATE{_REGISTRO=0{";
	var celementos = document.forms["alta_user"].elements;
	for (var ni = 0; ni < celementos.length; ni++){
		var sid = celementos[ni].getAttribute("id");	
		var valor=get_val(sid);
		informacion = informacion +sid+ "="+valor+"{";
	}
	document.forma_parametro.parametro.value = informacion;

	m4submitjs("forma_parametro");
}

		
		function comprobar_mail_datos_direccion(contador_reg)
		{
					
		    var num_registros = contador_reg;
			var informacion = "";
			var num_borrados = 0;
				for (i=0;i<num_registros;i++)
				{
					if (informacion != "")
						{informacion += "{";}
						
					var idx_check = "DEL_REG" + i;
					var val_check = document.alta_telef[idx_check].checked;

					if (num_registros == 1)					
						if (val_check == true)
						{
							var email = document.forms["alta_telef"].elements["STD_EMAIL"].value;
							if ((email==null)||(email=="")){
							alert(msg_39);
							document.alta_telef[idx_check].checked = false;
							return;
							}//cierr if(email==null)||(email=="")
						}


					var idx_mail = "STD_EMAIL" + i;
					var idx_location = "STD_ID_LOCATION_TYPE" + i;
					var idn_location = "STD_N_LOCATION_TYPE" + i;
					var idx_num_reg = "NUM_REG" + i;
					var val_mail = document.alta_telef[idx_mail].value;
					var val_location = document.alta_telef[idx_location].value;
					var val_n_location = document.alta_telef[idx_location].options[document.alta_telef[idx_location].selectedIndex].text;

					var val_num_reg = document.alta_telef[idx_num_reg].value;
					var accion = "";
					if ((val_mail == "") || (val_mail == null))
					{
					 alert(msg_40);
					 document.alta_telef[idx_mail].focus();
					 return;
					}else{
						if(i!=num_registros-1){
							for(var j=i+1;j<num_registros;j++){
							var indexEmailMov="STD_EMAIL" + j;
							var valEmailMov = document.alta_telef[indexEmailMov].value;
								if(val_mail==valEmailMov){
								alert(msg_41);
								document.alta_telef[idx_mail].focus();
								return;
								}//cierre if (val_mail==valEmailMov
							}//cierre for j
						}//cierre if i!=num_registros-1
						
					
					}//cierre if ((val_mail == "") || (val_mail == null))
					var l_email_valid = val_mail.length;
					var indicador_email = 0;
					for (idx=0; idx<l_email_valid; idx++)
					{
	 					var valor_mail = val_mail.charAt(idx);
					    if (valor_mail == " ")
					   {
						alert(msg_42)
						document.alta_telef[idx_mail].focus();
						return;
					   }
					   if (valor_mail == "@")
						 indicador_email = 1;
					}//cierre for idx=0; i
					if (indicador_email == 0)
					{
				    alert(msg_43)
					document.alta_telef[idx_mail].focus();
					return;
					}

					if (val_check == true)
					{
						accion = "DELETE";
						num_borrados = num_borrados + 1;
					}
					else
						accion = "UPDATE";

					informacion += "_NODO*" + i + "=SCO_CURR_EMAIL{_ACCION*" + i + "=" + accion + "{_REGISTRO*" + i + "=" + val_num_reg + "{";
					informacion += "STD_EMAIL*" + i + "=" + val_mail + "{STD_ID_LOCATION_TYPE*" + i + "=" + val_location + "{STD_N_LOCATION_TYPE*" + i+ "=" + val_n_location;
				}//cierre for i

				if (num_borrados == num_registros)
				{

				   var email = document.forms["alta_telef"].elements["STD_EMAIL"].value;
				   if ((email==null)||(email==""))
				    {
					   alert(msg_39);
					   document.forms["alta_telef"].elements["STD_EMAIL"].focus();
					   return;
					}
				}//cierre if (num_borrados == num_registros)

				var mail_nuevo = document.alta_telef.STD_EMAIL.value

				if ((mail_nuevo != null) && (mail_nuevo != ""))
				{
					var l_email_valid = mail_nuevo.length;
					var indicador_email = 0;
					for (idx=0; idx<l_email_valid; idx++)
					{
	 					var valor_mail = mail_nuevo.charAt(idx);
					    if (valor_mail == " ")
					   {
						alert(msg_42)
						document.alta_telef.STD_EMAIL.focus();
						return;
					   }
					   if (valor_mail == "@")
						 indicador_email = 1;
					}//cierre for (idx=0; idx<l_email_valid; idx++)
					if (indicador_email == 0)
					{
				    alert(msg_43)
					document.alta_telef.STD_EMAIL.focus();
					return;
					}
					//comprobamos que el correo e nuevo no esta duplicado
					
					if(num_registros!=0){
						for(var i=0;i<num_registros;i++){
						var correo_exist = "STD_EMAIL" + i;
						var val_correo_exist = document.alta_telef[correo_exist].value;
							if(mail_nuevo==val_correo_exist){
							alert(msg_41);
							document.alta_telef.STD_EMAIL.focus();
							return;
							}//cierre if
						}//cierre for
					}//cierre if(num_registros!=0)
					if ((document.alta_telef.STD_ID_LOCATION_TYPE.value == "") || (document.alta_telef.STD_ID_LOCATION_TYPE.value == null))
					{
						alert(msg_44);
						return;
				    }

					informacion += "{_NODO=SCO_CURR_EMAIL{_ACCION=INSERT{_REGISTRO={STD_EMAIL=" + mail_nuevo + "{STD_ID_LOCATION_TYPE=" + document.alta_telef.STD_ID_LOCATION_TYPE.value + "{STD_N_LOCATION_TYPE=" + document.alta_telef.STD_ID_LOCATION_TYPE.options[document.alta_telef.STD_ID_LOCATION_TYPE.selectedIndex].text;
				}
				document.forma_parametro.parametro.value = informacion; 

				m4submitjs("forma_parametro");

		}

//***************************
//Funciones de la pagina de datos personales js_datos_personales.jsp
//FECHA: 28/11/2000
//***************************

	function filtrar_datos_personales(numero){
	var numeros = "0123456789";
	if (numero==1)
	document.list_anidadas.zSTD_ID_COUNTRY.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;

	if (numero==2)
	{
	document.list_anidadas.zSTD_ID_COUNTRY.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;

	document.list_anidadas.zSTD_ID_GEO_DIV.value = 
	document.alta_user.STD_ID_GEO_DIV.options[document.alta_user.STD_ID_GEO_DIV.selectedIndex].value;
	}
	if (numero==3)
	{
	document.list_anidadas.zSTD_ID_COUNTRY.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;

	document.list_anidadas.zSTD_ID_GEO_DIV.value = 
	document.alta_user.STD_ID_GEO_DIV.options[document.alta_user.STD_ID_GEO_DIV.selectedIndex].value;

	document.list_anidadas.zSTD_ID_SUB_GEO_DIV.value = 
	document.alta_user.STD_ID_SUB_GEO_DIV.options[document.alta_user.STD_ID_SUB_GEO_DIV.selectedIndex].value;
	}

	if (numero==4)
	{
	document.list_anidadas.zSTD_ID_COUNTRY.value = document.alta_user.STD_ID_COUNTRY.options[document.alta_user.STD_ID_COUNTRY.selectedIndex].value;

	document.list_anidadas.zSTD_ID_GEO_DIV.value = 
	document.alta_user.STD_ID_GEO_DIV.options[document.alta_user.STD_ID_GEO_DIV.selectedIndex].value;

	document.list_anidadas.zSTD_ID_SUB_GEO_DIV.value = 
	document.alta_user.STD_ID_SUB_GEO_DIV.options[document.alta_user.STD_ID_SUB_GEO_DIV.selectedIndex].value;

	document.list_anidadas.zSTD_ID_GEO_PLACE.value = 
	document.alta_user.STD_ID_GEO_PLACE.options[document.alta_user.STD_ID_GEO_PLACE.selectedIndex].value;
	}

	document.list_anidadas.zSTD_N_FIRST_NAME.value = document.alta_user.STD_N_FIRST_NAME.value;
	filter_pd();
	


	document.list_anidadas.zSTD_ID_GENDER.value = document.alta_user.STD_ID_GENDER.value;
	//document.list_anidadas.zSTD_ID_MARITAL_STAT.value = document.alta_user.STD_ID_MARITAL_STAT.value;
	document.list_anidadas.zSCO_PERS_CONSIDE.value = document.alta_user.SCO_PERS_CONSIDE.value;
	m4submitjs("list_anidadas");

}


function comprobar_datos_personales()
{
	vckdata =check_datos_personales()
	if (vckdata==0){return}
	var informacion = "";
    informacion = "_NODO=SCO_CURR_PERSON{_ACCION=UPDATE{_REGISTRO=0{";
	var celementos = document.forms["alta_user"].elements;
	for (var ni = 0; ni < celementos.length; ni++){
		var sid = celementos[ni].getAttribute("id");	
		var valor=get_val(sid);
		informacion = informacion +sid+ "="+valor+"{";

	}

	document.forma_parametro.parametro.value = informacion;
	m4submitjs("forma_parametro");

}




		function comprobar_telefono_datos_personales(contador_reg)
		{
			    var num_registros = contador_reg;
				var informacion = "";
				var numeros = "0123456789";
				var num_borrados = 0;
				for (i=0; i<num_registros;i++)
				{
					if (informacion != "")
						informacion += "{"
					var idx_check = "DEL_REG" + i;
					var val_check = document.alta_telef[idx_check].checked;

					if (num_registros == 1)					
						if (val_check == true)
						{
							
							var telefono = document.forms["alta_telef"].elements["STD_PHONE"].value;
							if ((telefono==null)||(telefono=="")){
							alert(msg_46);
							document.alta_telef[idx_check].checked = false;
							return;
							}//cierre if 
						}

					var idx_telefono = "STD_PHONE" + i;
					var idx_location = "STD_ID_LOCATION_TYPE" + i;
					var idx_linea = "STD_ID_LINE_TYPE" + i;
					var idx_num_reg = "NUM_REG" + i;
					var val_telefono = document.alta_telef[idx_telefono].value;
					var val_linea = document.alta_telef[idx_linea].value;
					var val_n_linea = document.alta_telef[idx_linea].options[document.alta_telef[idx_linea].selectedIndex].text;
					var val_location = document.alta_telef[idx_location].value;
					var val_n_location = document.alta_telef[idx_location].options[document.alta_telef[idx_location].selectedIndex].text; 

					var val_num_reg = document.alta_telef[idx_num_reg].value;

					if ((val_telefono == "") || (val_telefono == null))
					{
					alert(msg_47);
					document.alta_telef[idx_telefono].focus();
					return;
					}else{
					if(i!=num_registros-1){
						for(var j=i+1;j<num_registros;j++){
						var indexTelMov="STD_PHONE" + j;
						var valTelMov = document.alta_telef[indexTelMov].value;
						if(val_telefono==valTelMov){
						alert(msg_48);
						document.alta_telef[idx_telefono].focus();
						return;
						}//cierre if (valTelefFijo==valTelMov
						
						}//cierre j
					}//cierre if
					}
					var accion = "";

					var l_tel_valid = val_telefono.length;
					var indicador_tel = 0;
					var numeros = "0123456789";
					for (idx_tel=0; idx_tel<l_tel_valid; idx_tel++)
					{
			 		   var valor_tel = val_telefono.charAt(idx_tel);
					   if (valor_tel == " ")
					   {
					    alert(msg_21)
						return;
					   }
						if (-1 == numeros.indexOf(valor_tel))
						 indicador_tel = 1;
					}
					if (indicador_tel == 1)
				    {
					    alert(msg_22)
						return;
					}
					
					if (val_check == true)
					{
						accion = "DELETE";
						num_borrados = num_borrados + 1;
					}
					else
						accion = "UPDATE";
					informacion += "_NODO*" + i + "=SCO_CURR_PHONE{_ACCION*" + i + "=" + accion + "{_REGISTRO*" + i + "=" + val_num_reg + "{";
					informacion += "STD_PHONE*" + i + "=" + val_telefono + "{STD_ID_LOCATION_TYPE*" + i + "=" + val_location + "{STD_N_LOCATION_TYPE*" + i + "=" + val_n_location + "{";
					informacion += "STD_ID_LINE_TYPE*" + i + "=" + val_linea + "{STD_N_LINE_TYPE*" + i + "=" + val_n_linea;
				}
				if (num_borrados == num_registros)
				{
					var telefono = document.forms["alta_telef"].elements["STD_PHONE"].value;
					if ((telefono==null)||(telefono==""))
					{
					  alert(msg_46);

					  for (j=0; j<num_registros;j++)
 					  document.alta_telef[j].checked = false;
					  return;
				    }
				}

				var telef_nuevo = document.alta_telef.STD_PHONE.value;
				if ((telef_nuevo != null) && (telef_nuevo != ""))
				{
					var l_tel_valid = telef_nuevo.length;
					var indicador_tel = 0;
					var numeros = "0123456789";
					for (idx_tel=0; idx_tel<l_tel_valid; idx_tel++)
					{
			 		   var valor_tel = telef_nuevo.charAt(idx_tel);
					   if (valor_tel == " ")
					   {
					    alert(msg_21)
						document.alta_telef.STD_PHONE.focus();
						return;
					   }
						if (-1 == numeros.indexOf(valor_tel))
						 indicador_tel = 1;
					}
					if (indicador_tel == 1)
				    {
					    alert(msg_22)
						document.alta_telef.STD_PHONE.focus();
						return;
					}
					//comprobamos que el telefono nuevo no esta duplicado
					
					if(num_registros!=0){
						for(var i=0;i<num_registros;i++){
						var telefono_exist = "STD_PHONE" + i;
						var val_telefono_exist = document.alta_telef[telefono_exist].value;
							if(telef_nuevo==val_telefono_exist){
							alert(msg_48);
							document.alta_telef.STD_PHONE.focus();
							return;
							}//cierre if
						}//cierre for
					}//cierre if(num_registros!=0)
					if ((document.alta_telef.STD_ID_LOCATION_TYPE.value == "") || (document.alta_telef.STD_ID_LOCATION_TYPE.value == null))
					{
					   alert(msg_49);
					   return;
					}

					if ((document.alta_telef.STD_ID_LINE_TYPE.value == "") || (document.alta_telef.STD_ID_LINE_TYPE.value == null))
					{
					   alert(msg_50);
					   return;
					}

					informacion += "{_NODO=SCO_CURR_PHONE{_ACCION=INSERT{_REGISTRO={STD_PHONE=" + telef_nuevo + "{STD_ID_LOCATION_TYPE=" + document.alta_telef.STD_ID_LOCATION_TYPE.value + "{STD_ID_LINE_TYPE=" + document.alta_telef.STD_ID_LINE_TYPE.value + "{STD_N_LOCATION_TYPE=" + document.alta_telef.STD_ID_LOCATION_TYPE.options[document.alta_telef.STD_ID_LOCATION_TYPE.selectedIndex].text + "{STD_N_LINE_TYPE=" + document.alta_telef.STD_ID_LINE_TYPE.options[document.alta_telef.STD_ID_LINE_TYPE.selectedIndex].text;
				}
				document.forma_parametro.parametro.value = informacion; 
					m4submitjs("forma_parametro");
				
			}

//***************************
//Funciones de la pagina de historial academico js_historial_academico.jsp
//FECHA: 28/11/2000
//***************************

	function selectedradio_hist_acad()
	{
		
		var valorseleccionado="";
		var long=document.historial_acad.SCO_CK_END_DIP.length;
		var i=0;
		for(i=0;i<long;i++)
		{
			if(document.historial_acad.SCO_CK_END_DIP[i].checked)
			{
			valorseleccionado=document.historial_acad.SCO_CK_END_DIP[i].value;
			document.historial_acad.SCO_CK_END_DIP_V.value=valorseleccionado;
			return;
			
			}
		}
    }	


    function selectedradioex_hist_acad()
    {
		
		var valorseleccionadoex="";
		var longex=document.forms["historial_existente"].elements["SCO_CK_END_DIP*1"].length;
		var i=0;
		for(i=0;i<longex;i++)
		{
			if(document.forms["historial_existente"].elements["SCO_CK_END_DIP*1"][i].checked)
			{
				valorseleccionadoex=document.forms["historial_existente"].elements["SCO_CK_END_DIP*1"][i].value;
				document.forms["historial_existente"].elements["SCO_CK_END_DIP_V*1"].value=valorseleccionadoex;
				return;
			
			}
		}
    }	


function comprobar_hist_acad(accion_a_tomar)
	{	var action = accion_a_tomar;
		var informacion = "";
	 
   	    if (informacion != "")
	   	    informacion += "{";

   	    var n_nodo = "_NODO*" + "0";
		var n_registro = "_REGISTRO*" + "0";
		
		if (action == 2)
		{
			informacion="_NODO=SCO_CURR_ACAD_BACK{_ACCION=DELETE{_REGISTRO=";
			informacion+=document.forms["historial_existente"].elements["_REGISTRO*1"].value;
		    document.forms["forma_parametro"].elements["parametro"].value=informacion;
			m4submitjs("forma_parametro");			

			return;
		}
  
		var id_diploma = "STD_ID_DIPLOMA*" + "0";
		var n_diploma = "STD_N_DIPLOMA*" + "0";
		var id_edu_sp = "STD_ID_EDU_SP*" + "0";
		var n_edu_sp = "STD_N_EDU_SP*" + "0";
		var id_educ_center = "STD_ID_EDU_CENTER*" + "0";
		var n_educ_center = "STD_N_EXT_ORG*" + "0";
		var id_edu_type = "STD_ID_EDU_TYPE*" + "0";
		var n_edu_type = "STD_N_EDU_TYPE*" + "0";
		var dt_start = "STD_DT_START*" + "0";
		var dt_earned_expe = "STD_DT_EARNED_EXPE*" +"0";
		var total_years_dip = "STD_TOTAL_YEARS_DIP*" +"0";
		var ck_end_dip = "SCO_CK_END_DIP*" +"0";
		var completed_years = "STD_COMPLETED_YEARS*" +"0";
		var comment = "STD_COMMENT*" +"0";
		var v_nodo = document.forms["historial_acad"].elements["_NODO*0"].value;
		var formulario = "";
		var n_OTROS = "CSP_OTROS*" +"0";

		var n_OTROSCF = "CSP_OTROS_CF*" +"0";
		var n_OTROSESP = "CSP_OTROS_ESP*" +"0";
		var n_OTROSTIT = "CSP_OTROS_TIT*" +"0";


		if (action == 1)
		{
			var v_registro = document.forms["historial_existente"].elements["_REGISTRO*1"].value;
			var v_accion_canal = "UPDATE";
			formulario = "historial_existente";
			var v_id_edu_type=document.forms[formulario].elements["STD_ID_EDU_TYPE*1"].value;
			var v_n_edu_type=document.forms[formulario].elements["STD_ID_EDU_TYPE*1"].options[document.forms[formulario].elements["STD_ID_EDU_TYPE*1"].selectedIndex].text; 
			var v_id_diploma=document.forms[formulario].elements["STD_ID_DIPLOMA*1"].value; 
			var v_n_diploma=document.forms[formulario].elements["STD_ID_DIPLOMA*1"].options[document.forms[formulario].elements["STD_ID_DIPLOMA*1"].selectedIndex].text; 
			var v_id_edu_sp=document.forms[formulario].elements["STD_ID_EDU_SP*1"].value; 
			var v_n_edu_sp=document.forms[formulario].elements["STD_ID_EDU_SP*1"].options[document.forms[formulario].elements["STD_ID_EDU_SP*1"].selectedIndex].text; 
			var v_id_educ_center=document.forms[formulario].elements["STD_ID_EDU_CENTER*1"].value; 
			var v_n_educ_center=document.forms[formulario].elements["STD_ID_EDU_CENTER*1"].options[document.forms[formulario].elements["STD_ID_EDU_CENTER*1"].selectedIndex].text; 
			var v_dt_start=document.forms[formulario].elements["STD_DT_START*1"].value; 
			var v_dt_earned_expe=document.forms[formulario].elements["STD_DT_EARNED_EXPE*1"].value; 
			var v_total_years_dip=document.forms[formulario].elements["STD_TOTAL_YEARS_DIP*1"].value; 
			var v_completed_years=document.forms[formulario].elements["STD_COMPLETED_YEARS*1"].value;
			var v_ck_end_dip=document.forms[formulario].elements["SCO_CK_END_DIP_V*1"].value;
			var v_comment=document.forms[formulario].elements["STD_COMMENT*1"].value;
			var v_OTROS=document.forms[formulario].elements["CSP_OTROS*1"].value;

			var v_OTROSCF=document.forms[formulario].elements["CSP_OTROS_CF*1"].value;
			var v_OTROSESP=document.forms[formulario].elements["CSP_OTROS_ESP*1"].value;
			var v_OTROSTIT=document.forms[formulario].elements["CSP_OTROS_TIT*1"].value;

		}
		if (action == 3)
		{
			var v_registro =0
			var v_accion_canal = "INSERT";
			formulario = "historial_acad";
			var v_id_edu_type = document.forms[formulario].elements["STD_ID_EDU_TYPE"].value;
			var v_n_edu_type = document.forms[formulario].elements["STD_ID_EDU_TYPE"].options[document.forms[formulario].elements["STD_ID_EDU_TYPE"].selectedIndex].text; 
			var v_id_diploma =  document.forms[formulario].elements["STD_ID_DIPLOMA"].value; 
			var v_n_diploma = document.forms[formulario].elements["STD_ID_DIPLOMA"].options[document.forms[formulario].elements["STD_ID_DIPLOMA"].selectedIndex].text; 
			var v_id_edu_sp = document.forms[formulario].elements["STD_ID_EDU_SP"].value; 
			var v_n_edu_sp = document.forms[formulario].elements["STD_ID_EDU_SP"].options[document.forms[formulario].elements["STD_ID_EDU_SP"].selectedIndex].text; 
			var v_id_educ_center = document.forms[formulario].elements["STD_ID_EDU_CENTER"].value; 
			var v_n_educ_center = document.forms[formulario].elements["STD_ID_EDU_CENTER"].options[document.forms[formulario].elements["STD_ID_EDU_CENTER"].selectedIndex].text; 
			var v_dt_start = document.forms[formulario].elements["STD_DT_START"].value; 
			var v_dt_earned_expe = document.forms[formulario].elements["STD_DT_EARNED_EXPE"].value; 
			var v_total_years_dip = document.forms[formulario].elements["STD_TOTAL_YEARS_DIP"].value; 
			var v_completed_years=document.forms[formulario].elements["STD_COMPLETED_YEARS"].value; 
			var v_ck_end_dip = document.forms[formulario].elements["SCO_CK_END_DIP_V"].value;
			var v_comment = document.forms[formulario].elements["STD_COMMENT"].value;
			var v_OTROS = document.forms[formulario].elements["CSP_OTROS"].value;

			var v_OTROSCF=document.forms[formulario].elements["CSP_OTROS_CF"].value;
			var v_OTROSESP=document.forms[formulario].elements["CSP_OTROS_ESP"].value;
			var v_OTROSTIT=document.forms[formulario].elements["CSP_OTROS_TIT"].value;

		}
		 informacion += n_nodo + "=" + v_nodo + "{_ACCION*0="+ v_accion_canal +"{";
		 informacion += n_registro + "=" + v_registro + "{";
		 informacion += id_diploma + "=" + v_id_diploma + "{" + id_edu_sp + "=" + v_id_edu_sp + "{"+ id_edu_type + "=" + v_id_edu_type + "{"; 
		 informacion += n_diploma + "=" + v_n_diploma + "{";
		 informacion += n_edu_sp + "=" + v_n_edu_sp + "{";
		 informacion += n_edu_type + "=" + v_n_edu_type + "{";
		 informacion += id_educ_center + "=" + v_id_educ_center + "{" + dt_start + "=" + v_dt_start + "{"; 
		 informacion += n_educ_center + "=" + v_n_educ_center + "{"+ comment + "=" + v_comment + "{";
		 if ((v_dt_earned_expe =="") || (v_dt_earned_expe == null))
			 informacion += dt_earned_expe + "=4000-01-01{";
		 else
			 informacion += dt_earned_expe + "=" + v_dt_earned_expe + "{";  		 
		 informacion += total_years_dip + "=" + v_total_years_dip + "{" ; 
		 informacion += completed_years + "=" + v_completed_years + "{"; 
		 informacion += ck_end_dip + "=" + v_ck_end_dip	+ "{"; 
		 informacion += n_OTROS + "=" + v_OTROS + "{"; 
		 informacion += n_OTROSCF + "=" + v_OTROSCF + "{"; 
		 informacion += n_OTROSESP + "=" + v_OTROSESP + "{"; 
		 informacion += n_OTROSTIT + "=" + v_OTROSTIT ; 
	
	     document.forms["forma_parametro"].elements["parametro"].value = informacion;
		 m4submitjs("forma_parametro");   
    }



/////////////////////////


function formato_fecha_AAAAMMDD(fecha)
{
	 var dia=fecha.substring(0,2);
	 var mes=fecha.substring(3,5);
	 var anio = fecha.substring(6,10)
	 var fechaformato= anio+"-"+mes+"-"+dia;
	 return(fechaformato);
	
}//cierre funcion

////////////////////////


function validar_datos_form_acad(accion){
	var accion_bbdd = accion;
	var numeros = "0123456789";
		
	if (accion == 3)
	{
		var o_total_years_dip = document.forms["historial_acad"].elements["STD_TOTAL_YEARS_DIP"].value; 
		var o_completed_years=document.forms["historial_acad"].elements["STD_COMPLETED_YEARS"].value; 
		var o_dt_earned_expe = document.forms["historial_acad"].elements["STD_DT_EARNED_EXPE"].value; 
		var o_dt_start = document.forms["historial_acad"].elements["STD_DT_START"].value;
		var o_ck_dip = document.forms["historial_acad"].elements["SCO_CK_END_DIP_V"].value;
		var o_id_diploma = document.forms["historial_acad"].elements["STD_ID_DIPLOMA"].value;
		var o_id_edu_sp = document.forms["historial_acad"].elements["STD_ID_EDU_SP"].value;
		var o_id_edu_center = document.forms["historial_acad"].elements["STD_ID_EDU_CENTER"].value;
		var o_id_edu_type = document.forms["historial_acad"].elements["STD_ID_EDU_TYPE"].value;

		var anios_nulo = comprobar_espacios("historial_acad","STD_TOTAL_YEARS_DIP")
		if (anios_nulo == 0)
		{
		alert(msg_51);
		document.forms["historial_acad"].elements["STD_TOTAL_YEARS_DIP"].focus();
		return;
		}else{
			if (isNaN(o_total_years_dip))
			{
			alert(msg_52);
			document.forms["historial_acad"].elements["STD_COMPLETED_YEARS"].focus();
			return;
			}//cierre if (isNaN(o_total_years_dip))
		}//cierre if (anios_nulo == 0)


			if (o_completed_years>o_total_years_dip)
			{
			alert('El Num. de años completados no puede ser superior al número de años de titulación');
			document.forms["historial_acad"].elements["STD_TOTAL_YEARS_DIP"].focus();
			return;
			}//cierre if 
		var fechafin_nula = comprobar_espacios("historial_acad","STD_DT_EARNED_EXPE");
		var fecha_nula = comprobar_espacios("historial_acad","STD_DT_START");
		if (fecha_nula == 0)
			{
			alert(msg_53);
			document.forms["historial_acad"].elements["STD_DT_START"].focus();
			return;
			}else{
				var formato_fecha_inicio = comprobar_formato_fecha(o_dt_start);
				if(formato_fecha_inicio!=1){
				alert(msg_54);
				document.forms["historial_acad"].elements["STD_DT_START"].focus();
				return;
				}//cierre if(formato_fecha_inicio!=1)
		}//cierre if (fecha_nula == 0)
		if ((o_ck_dip != 0)&&(fechafin_nula==0))
			{
			alert(msg_55);
			document.forms["historial_acad"].elements["STD_DT_EARNED_EXPE"].focus();
			return;
			}
			
		var anioscomp_nulo = comprobar_espacios("historial_acad","STD_COMPLETED_YEARS")
		if (anioscomp_nulo == 0)
		{
		alert(msg_56);
		document.forms["historial_acad"].elements["STD_COMPLETED_YEARS"].focus();
		return;
		}else{
			if (isNaN(o_completed_years))
			{
			alert(msg_52);
			document.forms["historial_acad"].elements["STD_COMPLETED_YEARS"].focus();
			return;
			}//cierre if (isNaN(o_completed_years))
		}//cierre if (anioscomp_nulo == 0)	
		if (fechafin_nula!=0)
		{
			var formato_fecha_fin = comprobar_formato_fecha(o_dt_earned_expe);
			if(formato_fecha_fin!=1){
			alert(msg_57);
			document.forms["historial_acad"].elements["STD_DT_EARNED_EXPE"].focus();
			return;
			}else{
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				var o_dt_earned_expeAUx = formato_fecha_AAAAMMDD(o_dt_earned_expe)
				var o_dt_startAUx = formato_fecha_AAAAMMDD(o_dt_start)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				if (o_dt_startAUx>o_dt_earned_expeAUx)
				{
				alert(msg_58);
				document.forms["historial_acad"].elements["STD_DT_START"].focus();
				return;
				}// cierre if (o_dt_start>o_dt_earned_expe)
			}//cierre if(formato_fecha_fin!=1)
		}//cierre if (fechafin_nula!=0)
	}//cierre accion = 3

	if (accion == 1)
		{
		var o_total_years_dip = document.forms["historial_existente"].elements["STD_TOTAL_YEARS_DIP*1"].value; 
		var o_completed_years=document.forms["historial_existente"].elements["STD_COMPLETED_YEARS*1"].value; 
		var o_dt_earned_expe = document.forms["historial_existente"].elements["STD_DT_EARNED_EXPE*1"].value; 
	    var o_id_diploma =  document.forms["historial_existente"].elements["STD_ID_DIPLOMA*1"].value;
		var o_dt_start = document.forms["historial_existente"].elements["STD_DT_START*1"].value; 
		var o_id_educ_center = document.forms["historial_existente"].elements["STD_ID_EDU_CENTER*1"].value; 
		var o_id_edu_type = document.forms["historial_existente"].elements["STD_ID_EDU_TYPE*1"].value;
		var o_ck_dip = document.forms["historial_existente"].elements["SCO_CK_END_DIP_V*1"].value;

		var anios_nulo = comprobar_espacios("historial_existente","STD_TOTAL_YEARS_DIP*1")

			if (o_completed_years>o_total_years_dip)
			{
			alert('El Num. de años completados no puede ser superior al número de años de titulación');
			document.forms["historial_acad"].elements["STD_TOTAL_YEARS_DIP"].focus();
			return;
			}//cierre if 

		if (anios_nulo == 0)
		{
		alert(msg_59);
		document.forms["historial_existente"].elements["STD_TOTAL_YEARS_DIP*1"].focus();
		return;
		}else{
			if (isNaN(o_total_years_dip))
			{
			alert(msg_52);
			document.forms["historial_existente"].elements["STD_TOTAL_YEARS_DIP*1"].focus();
			return;
			}//cierre if (isNaN(o_total_years_dip))
		}//cierre if (anios_nulo == 0)
		var fechafin_nula = comprobar_espacios("historial_existente","STD_DT_EARNED_EXPE*1");
		var fecha_nula = comprobar_espacios("historial_existente","STD_DT_START*1")
		if (fecha_nula == 0)
		{
		alert(msg_60);
		document.forms["historial_existente"].elements["STD_DT_START*1"].focus();
		return;
		}else{
			var formato_fecha_inicio = comprobar_formato_fecha(o_dt_start);
			if(formato_fecha_inicio!=1){
			alert(msg_61);
			document.forms["historial_existente"].elements["STD_DT_START*1"].focus();
			return;
			}//cierre if(formato_fecha_inicio!=1)
		}//cierre if (fecha_nula == 0)
		if ((o_ck_dip != 0)&&(fechafin_nula==0))
		{
		alert(msg_55);
		document.forms["historial_existente"].elements["STD_DT_EARNED_EXPE*1"].focus();
		return;
		}
		var anioscomp_nulo = comprobar_espacios("historial_existente","STD_COMPLETED_YEARS*1")
		if (anioscomp_nulo == 0)
		{
		alert(msg_62);
		document.forms["historial_existente"].elements["STD_COMPLETED_YEARS*1"].focus();
		return;
		}else{
			if (isNaN(o_completed_years))
			{
			alert(msg_52);
			document.forms["historial_existente"].elements["STD_COMPLETED_YEARS*1"].focus();
			return;
			}//cierre if (isNaN(o_completed_years))
		}//cierre if (anioscomp_nulo == 0)
		if (fechafin_nula!=0){
			var formato_fecha_fin = comprobar_formato_fecha(o_dt_earned_expe);
			if(formato_fecha_fin!=1){
			alert(msg_57);
			document.forms["historial_existente"].elements["STD_DT_EARNED_EXPE*1"].focus();
			return;
			}else{


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				var o_dt_earned_expeAUx = formato_fecha_AAAAMMDD(o_dt_earned_expe)
				var o_dt_startAUx = formato_fecha_AAAAMMDD(o_dt_start)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
				if (o_dt_startAUx>o_dt_earned_expeAUx)
				{
				alert(msg_58);
				document.forms["historial_existente"].elements["STD_DT_START*1"].focus();
				return;
				}//fin del if (o_dt_start>o_dt_earned_expe)
			}// cierre if(formato_fecha_fin!=1)
		}//cierre if (fechafin_nula!=0)

	}// fin accion = 1
	comprobar_hist_acad(accion_bbdd);
}//function validar_datos_form_acad(accion)


//***************************
//Funciones de la pagina de formacion complementaria js_formacion_complementaria.jsp
//FECHA: 28/11/2000
//***************************

	function comprobar_form_complem(accion_a_tomar)
	{
		var action = accion_a_tomar;
		var informacion = "";
	 
   	    if(informacion != "")
   	    { informacion += "{";}
  
		var n_nodo = "_NODO*" + "0";
		var n_registro = "_REGISTRO*" + "0";
		
		if (action == 2)
		{
			informacion = "_NODO=SCO_CURR_COMP_BACKGROUND{_ACCION=DELETE{_REGISTRO=";
			informacion += document.forms["formacion_existente"].elements["_REGISTRO*1"].value;
			document.forms["forma_parametro"].elements["parametro"].value = informacion;		
			m4submitjs("forma_parametro");
			return;
		}

		var id_country = "STD_ID_COUNTRY*" +"0";
		var n_country = "STD_N_COUNTRY*" +"0";
		var n_course = "SCO_N_COURSE*" + "0";
		var n_center = "SCO_N_CENTER*" + "0";
		var number_hours = "SCO_NUMBER_HOURS*" + "0";
		var dt_start = "SCO_DT_START*" + "0";
		var dt_end = "SCO_DT_END*" +"0";
		var grants = "SCO_GRANTS*" +"0";
		var coment = "SCO_COMMENT*" +"0";

		var form_esp = "CSP_FORM_ESPC_SECT*" +"0";
		var id_area = "CSP_ID_AREA_CONOC*" +"0";
		var n_area = "CSP_NM_AREA_CO*" +"0";
		var id_nivel = "CSP_ID_NIVEL*" +"0";
		var n_nivel = "CSP_NM_NIVEL*" +"0";


		//var v_nodo = document.forms["formacion_comp"].elements["_NODO*0"].value;
		var v_nodo = "SCO_CURR_COMP_BACKGROUND"
		//alert(v_nodo)
		var formulario = "";

		if (action == 1)
		{
			var v_registro = document.forms["formacion_existente"].elements["_REGISTRO*1"].value;
			var v_accion_canal = "UPDATE";
			formulario = "formacion_existente";

			var v_id_country = document.forms[formulario].elements["STD_ID_COUNTRY*1"].value;
			var v_n_country = document.forms[formulario].elements["STD_ID_COUNTRY*1"].options[document.forms[formulario].elements["STD_ID_COUNTRY*1"].selectedIndex].text;
			var v_n_course = 	document.forms[formulario].elements["SCO_N_COURSE*1"].value;
			var v_n_center = document.forms[formulario].elements["SCO_N_CENTER*1"].value;
			var v_number_hours = document.forms[formulario].elements["SCO_NUMBER_HOURS*1"].value;
			var v_dt_start = document.forms[formulario].elements["SCO_DT_START*1"].value;
			var v_dt_end = document.forms[formulario].elements["SCO_DT_END*1"].value;
			var v_grants = document.forms[formulario].elements["SCO_GRANTS*1"].value;
			var v_coment = document.forms[formulario].elements["SCO_COMMENT*1"].value;
			var v_form_esp=document.forms[formulario].elements["CSP_FORM_ESPC_SECT_V*1"].value;
			if (v_form_esp=='0'){
					v_form_esp = '0';
					var v_id_area = '';
					var v_id_nivel = '';
				}else{
					v_form_esp = '1';
					var v_id_area = document.forms[formulario].elements["CSP_ID_AREA_CONOC*1"].value;
					var v_id_nivel = document.forms[formulario].elements["CSP_ID_NIVEL*1"].value;
					var v_n_area = document.forms[formulario].elements["CSP_ID_AREA_CONOC*1"].options[document.forms[formulario].elements["CSP_ID_AREA_CONOC*1"].selectedIndex].text;
					var v_n_nivel = document.forms[formulario].elements["CSP_ID_NIVEL*1"].options[document.forms[formulario].elements["CSP_ID_NIVEL*1"].selectedIndex].text;

				}

		}

		if (action == 3)
		{
			var v_registro =0
			var v_accion_canal = "INSERT";
			formulario = "formacion_comp";
		
			var v_id_country = document.forms[formulario].elements["STD_ID_COUNTRY"].value;
			var v_n_country = document.forms[formulario].elements["STD_ID_COUNTRY"].options[document.forms[formulario].elements["STD_ID_COUNTRY"].selectedIndex].text;
			var v_n_course = document.forms[formulario].elements["SCO_N_COURSE"].value;
			var v_n_center = document.forms[formulario].elements["SCO_N_CENTER"].value;
			var v_number_hours = document.forms[formulario].elements["SCO_NUMBER_HOURS"].value;
			var v_dt_start = document.forms[formulario].elements["SCO_DT_START"].value;
			var v_dt_end = document.forms[formulario].elements["SCO_DT_END"].value;
			var v_grants = document.forms[formulario].elements["SCO_GRANTS"].value;
			var v_coment = document.forms[formulario].elements["SCO_COMMENT"].value;
	//					if(document.historial_acad.SCO_CK_END_DIP[i].checked)

			var v_form_esp=document.forms[formulario].elements["CSP_FORM_ESPC_SECT_V"].value;

			if (v_form_esp=='0')
				{
					v_form_esp = '0';
					var v_id_area = '';
					var v_id_nivel = '';
					var v_n_area = '';
					var v_n_nivel = '';
			}else{
					v_form_esp = '1';
					var v_id_area = document.forms[formulario].elements["CSP_ID_AREA_CONOC"].value;
					var v_id_nivel = document.forms[formulario].elements["CSP_ID_NIVEL"].value;
					var v_n_area = document.forms[formulario].elements["CSP_ID_AREA_CONOC"].options[document.forms[formulario].elements["CSP_ID_AREA_CONOC"].selectedIndex].text;
					var v_n_nivel = document.forms[formulario].elements["CSP_ID_NIVEL"].options[document.forms[formulario].elements["CSP_ID_NIVEL"].selectedIndex].text;

				}
		}

		 informacion += n_nodo + "=" + v_nodo + "{_ACCION*0="+ v_accion_canal + "{";
		 informacion += n_registro + "=" + v_registro + "{";
		 informacion += id_country + "=" + v_id_country +  "{"; 
		 informacion += n_country + "=" + v_n_country +  "{"; 
		 informacion += n_course + "=" + v_n_course + "{"; 
		 informacion += n_center + "=" + v_n_center + "{"; 
		 informacion += number_hours + "=" + v_number_hours + "{"; 
		 informacion += dt_start + "=" + v_dt_start + "{"; 
		 informacion += grants + "=" + v_grants + "{";
		 informacion += coment + "=" + v_coment + "{"; 
		 informacion += form_esp + "=" + v_form_esp + "{"; 
		 informacion += id_area + "=" + v_id_area + "{";
		 informacion += n_area + "=" + v_n_area + "{";
		 informacion += id_nivel + "=" + v_id_nivel + "{"; 
		 informacion += n_nivel + "=" + v_n_nivel + "{"; 

		 if ((v_dt_end =="") || (v_dt_end == null)){
			 informacion += dt_end + "=4000-01-01";
		 }else{
			 informacion += dt_end + "=" + v_dt_end;
		}
			 document.forms["forma_parametro"].elements["parametro"].value = informacion;		
			 //alert(informacion)
			 m4submitjs("forma_parametro");
   	}


	function validar_datos_form_compl(accion){
		var accion_bbdd = accion;
		var numeros = "0123456789";

		if (accion == 3)
		{
			var num_horas = document.forms["formacion_comp"].elements["SCO_NUMBER_HOURS"].value; 
			var fec_ini=document.forms["formacion_comp"].elements["SCO_DT_START"].value; 
			var fec_fin = document.forms["formacion_comp"].elements["SCO_DT_END"].value;  
			var form_espc = document.forms["formacion_comp"].elements["CSP_FORM_ESPC_SECT_1"].checked;
			var v_area_conoc = document.forms["formacion_comp"].elements["CSP_ID_AREA_CONOC"].value;
			var v_nivel_conoc = document.forms["formacion_comp"].elements["CSP_ID_NIVEL"].value;

			if(v_area_conoc=='null' && form_espc==true){
				alert('Debe indicar el área de conocimiento y nivel');
				return;
			}
			if(v_nivel_conoc=='null' && form_espc==true){
				alert('Debe indicar el área de conocimiento y nivel');
				return;
			}			
			var curso_nulo = comprobar_espacios("formacion_comp","SCO_N_COURSE")
			if (curso_nulo == 0)
			{
				alert(msg_63);
				document.forms["formacion_comp"].elements["SCO_N_COURSE"].focus();
				return;
			}
			
			var centro_nulo = comprobar_espacios("formacion_comp","SCO_N_CENTER")
			if (centro_nulo == 0)
			{
				alert(msg_64);
				document.forms["formacion_comp"].elements["SCO_N_CENTER"].focus();
			return;
			}
			
			if ((num_horas !="") && (isNaN(num_horas)))
			{
				alert(msg_65);
				document.forms["formacion_comp"].elements["SCO_NUMBER_HOURS"].focus();
				return;
			}
		    var fecha_nula = comprobar_espacios("formacion_comp","SCO_DT_START")
			if (fecha_nula == 0)
			{
				alert(msg_60);
				document.forms["formacion_comp"].elements["SCO_DT_START"].focus();
			return;
			}else{
				var formato_fecha=comprobar_formato_fecha(document.forms["formacion_comp"].elements["SCO_DT_START"].value);
				if(formato_fecha==0){
				alert(msg_61);
				document.forms["formacion_comp"].elements["SCO_DT_START"].focus();
				return;
				}//cierre if (formato_fecha==0)
			}//cierre if (fecha_nula == 0)
			if (fec_fin != "")
			{
				var formato_fecha=comprobar_formato_fecha(document.forms["formacion_comp"].elements["SCO_DT_END"].value);
				if(formato_fecha==0)
				{
					alert(msg_61);
					document.forms["formacion_comp"].elements["SCO_DT_END"].focus();
					return;
				}
				else
				{


	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
					var fec_iniAUx = formato_fecha_AAAAMMDD(fec_ini)
					var fec_finAUx = formato_fecha_AAAAMMDD(fec_fin)
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
					if (fec_iniAUx>fec_finAUx)
					{
						alert(msg_58);
						document.forms["formacion_comp"].elements["SCO_DT_END"].focus();
						return;
					}//cierre if (fec_ini>fec_fin)
				}//cierre if (formato_fecha==0)
			}//cierre (fechafin_nula != "")

		}//cierre if accion =3 

		if (accion == 1)
		{

			var num_horas = document.forms["formacion_existente"].elements["SCO_NUMBER_HOURS*1"].value; 
			var fec_ini=document.forms["formacion_existente"].elements["SCO_DT_START*1"].value; 
			var fec_fin = document.forms["formacion_existente"].elements["SCO_DT_END*1"].value;  
			var curso_nulo = comprobar_espacios("formacion_existente","SCO_N_COURSE*1")
			var form_espc = document.forms["formacion_existente"].elements["CSP_FORM_ESPC_SECT_1*1"].checked
			var v_area_conoc = document.forms["formacion_existente"].elements["CSP_ID_AREA_CONOC*1"].value;
			var v_nivel_conoc = document.forms["formacion_existente"].elements["CSP_ID_NIVEL*1"].value;
			if(v_area_conoc=='null' && form_espc==true){
				alert('Debe indicar el área de conocimiento y nivel');
				return;
			}
			if(v_nivel_conoc=='null' && form_espc==true){
				alert('Debe indicar el área de conocimiento y nivel');
				return;
			}

			if (curso_nulo == 0)
			{
			alert(msg_63);
			document.forms["formacion_existente"].elements["SCO_N_COURSE*1"].focus();
			return;
			}
		    var centro_nulo = comprobar_espacios("formacion_existente","SCO_N_CENTER*1")
			if (centro_nulo == 0)
			{
			alert(msg_64);
			document.forms["formacion_existente"].elements["SCO_N_CENTER*1"].focus();
			return;
			}
			if ((num_horas !="") && (isNaN(num_horas)))
			{
				alert(msg_66);
				document.forms["formacion_existente"].elements["SCO_NUMBER_HOURS*1"].focus();
				return;
			}
		    var fecha_nula = comprobar_espacios("formacion_existente","SCO_DT_START*1")
			if (fecha_nula == 0)
			{
			alert(msg_60);
			document.forms["formacion_existente"].elements["SCO_DT_START*1"].focus();
			return;
			}else{
				var formato_fecha=comprobar_formato_fecha(document.forms["formacion_existente"].elements["SCO_DT_START*1"].value);
				if(formato_fecha==0){
				alert(msg_61);
				document.forms["formacion_existente"].elements["SCO_DT_START*1"].focus();
				return;
				}//cierre if (formato_fecha==0)
			}//cierre if (fecha_nula == 0)

			if (fec_fin != "")
			{
				var formato_fecha=comprobar_formato_fecha(document.forms["formacion_existente"].elements["SCO_DT_END*1"].value);
				if(formato_fecha==0)
				{
					alert(msg_67);
					document.forms["formacion_existente"].elements["SCO_DT_END*1"].focus();
					return;
				}
				else
				{


	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
					var fec_iniAUx = formato_fecha_AAAAMMDD(fec_ini)
					var fec_finAUx = formato_fecha_AAAAMMDD(fec_fin)
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
					if (fec_iniAUx>fec_finAUx)
					{
						alert(msg_58);
						document.forms["formacion_existente"].elements["SCO_DT_END*1"].focus();
						return;
					}//cierre if (fec_ini>fec_fin)
				}//cierre if (formato_fecha==0)
			}//cierre fec_fin != ""
		}//cierre if accion = 1
	comprobar_form_complem(accion_bbdd);
}//cierre funcion



//***************************
//Funciones de la pagina de js_idiomas.jsp
//FECHA: 09/01/2000
//***************************
function insertar(cadena)
	{
	var informacion = cadena;
	var formulario="idiomas";
		if (informacion != "")
			{informacion += "{";}
		var n_registro_new = "_REGISTRO";
		var id_language_new = "STD_ID_LANGUAGE";
		var n_language_new = "STD_N_LANGUAGE";
		var id_write_new = "STD_ID_WRITE_LEVEL";
		var n_write_new = "STD_N_WRITE_LEVEL";
		var id_speak_new = "STD_ID_SPEAK_LEVEL";
		var n_speak_new = "STD_N_SPEAK_LEVEL";
		var id_listen_new = "STD_ID_LISTEN_LEVEL";
		var n_listen_new = "STD_N_LISTEN_LEVEL";
		var prefered_new = "STD_PREFERED";
		var otroidioma_new = "CSP_OTRO_IDIOMA";
		var vn_registro_new = "";
		var vid_language_new = document.forms[formulario].elements["STD_ID_LANGUAGE"].value;
		var vn_language_new = document.forms[formulario].elements["STD_ID_LANGUAGE"].options[document.forms[formulario].elements["STD_ID_LANGUAGE"].selectedIndex].text;
		var vid_write_new = document.forms[formulario].elements["STD_ID_WRITE_LEVEL"].value;
		var vn_write_new = document.forms[formulario].elements["STD_ID_WRITE_LEVEL"].options[document.forms[formulario].elements["STD_ID_WRITE_LEVEL"].selectedIndex].text;
		var vid_speak_new = document.forms[formulario].elements["STD_ID_SPEAK_LEVEL"].value;
		var vn_speak_new = document.forms[formulario].elements["STD_ID_SPEAK_LEVEL"].options[document.forms[formulario].elements["STD_ID_SPEAK_LEVEL"].selectedIndex].text;
		var vid_listen_new = document.forms[formulario].elements["STD_ID_LISTEN_LEVEL"].value;
		var vn_listen_new = document.forms[formulario].elements["STD_ID_LISTEN_LEVEL"].options[document.forms[formulario].elements["STD_ID_LISTEN_LEVEL"].selectedIndex].text;
		var vprefered_new = document.forms[formulario].elements["STD_PREFERED"].value;
		var votroidioma_new = document.forms[formulario].elements["CSP_OTRO_IDIOMA"].value;

		informacion += "_NODO" + "=SCO_CURR_LANGUAGE{_ACCION" + "=" + "INSERT" + "{";
		informacion += n_registro_new + "=" + vn_registro_new +"{" + id_language_new + "=" + vid_language_new + "{";
		informacion += n_language_new +"=" + vn_language_new + "{" + id_write_new + "=" + vid_write_new + "{";
		informacion += n_write_new + "=" + vn_write_new +"{" + id_speak_new + "=" + vid_speak_new + "{";
		informacion += n_speak_new +"=" + vn_speak_new + "{" + id_listen_new + "=" + vid_listen_new + "{";
		informacion += n_listen_new + "=" + vn_listen_new+ "{" + prefered_new + "=" + vprefered_new ;
		informacion += "{" + otroidioma_new + "=" + votroidioma_new ;
	if (informacion == "")
  			 { alert(msg_68);}
	 else
		 {
	  document.forms["forma_parametro"].elements["parametro"].value = informacion;		
	  
	  m4submitjs("forma_parametro");
	 }
	}//cierro insertar


//***************************
//Funciones de la pagina de js_areas.jsp
//FECHA: 09/01/2000
//***************************
function insertar_area(cadena)
	{
	var informacion = cadena;
	var formulario="idiomas";
		if (informacion != "")
			{informacion += "{";}
		var n_registro_new = "_REGISTRO";
		var id_language_new = "CSP_ID_AREA_INFL";
		var n_language_new = "CSP_NM_AREA_INFL";
		var otrocomentario_new = "CSP_COMENTARIO";
		var vn_registro_new = "";
		var vid_language_new = document.forms[formulario].elements["CSP_ID_AREA_INFL"].value;
		var vn_language_new = document.forms[formulario].elements["CSP_ID_AREA_INFL"].options[document.forms[formulario].elements["CSP_ID_AREA_INFL"].selectedIndex].text;
		var votrocomentario_new = document.forms[formulario].elements["CSP_COMENTARIO"].value;

		informacion += "_NODO" + "=CSP_AREAS_INFL{_ACCION" + "=" + "INSERT" + "{";
		informacion += n_registro_new + "=" + vn_registro_new +"{" + id_language_new + "=" + vid_language_new + "{"+ n_language_new + "=" + vn_language_new + "{";
		informacion += otrocomentario_new + "=" + votrocomentario_new ;
	if (informacion == "")
  			 { alert(msg_68);}
	 else
		 {
	  document.forms["forma_parametro"].elements["parametro"].value = informacion;		
	  
	  m4submitjs("forma_parametro");
	 }
	}//cierro insertar



//***************************
//Funciones de la pagina de otros datos js_otros_datos.jsp
//FECHA: 28/11/2000
//***************************

	function selectedradio_otros_datos(argradio){
	if (argradio==0){
	
		var valorseleccionado_0="";
		var long=document.otros_datos_exist.SCO_CK_TRAVEL_DISPO.length;
		var i=0;
		for(i=0;i<long;i++)
		{
			if(document.otros_datos_exist.SCO_CK_TRAVEL_DISPO[i].checked)
			{
			valorseleccionado_0=document.otros_datos_exist.SCO_CK_TRAVEL_DISPO[i].value;
			document.otros_datos_exist.SCO_CK_TRAVEL_DISPO_V.value=valorseleccionado_0;
			return;
			
			}
		}
	}
	if (argradio==1){
		var valorseleccionado_1="";
		var long=document.otros_datos_exist.SCO_CK_MOV_NAC.length;
		var i=0;
		for(i=0;i<long;i++)
		{
			if(document.otros_datos_exist.SCO_CK_MOV_NAC[i].checked)
			{
			valorseleccionado_1=document.otros_datos_exist.SCO_CK_MOV_NAC[i].value;
			document.otros_datos_exist.SCO_CK_MOV_NAC_V.value=valorseleccionado_1;

			return;			
			}
		}
	}
	if (argradio==2){
		var valorseleccionado_2="";
		var long=document.otros_datos_exist.SCO_CK_MOV_INTER.length;
		var i=0;
		for(i=0;i<long;i++)
		{
			if(document.otros_datos_exist.SCO_CK_MOV_INTER[i].checked)
			{
			valorseleccionado_2=document.otros_datos_exist.SCO_CK_MOV_INTER[i].value;
			document.otros_datos_exist.SCO_CK_MOV_INTER_V.value=valorseleccionado_2;
			return;			
			}
		}

	}

	if (argradio==3){
		var valorseleccionado_3="";
		var long=document.otros_datos_exist.CSP_CK_CARNET.length;
		var i=0;
		for(i=0;i<long;i++)
		{
			if(document.otros_datos_exist.CSP_CK_CARNET[i].checked)
			{
			valorseleccionado_3=document.otros_datos_exist.CSP_CK_CARNET[i].value;
			document.otros_datos_exist.CSP_CK_CARNET_V.value=valorseleccionado_3;
			return;			
			}
		}

	}

	if (argradio==4){
		var valorseleccionado_4="";
		var long=document.otros_datos_exist.CSP_CK_VEHICULO.length;
		var i=0;
		for(i=0;i<long;i++)
		{
			if(document.otros_datos_exist.CSP_CK_VEHICULO[i].checked)
			{
			valorseleccionado_4=document.otros_datos_exist.CSP_CK_VEHICULO[i].value;
			document.otros_datos_exist.CSP_CK_VEHICULO_V.value=valorseleccionado_4;
			return;			
			}
		}

	}

}
	


//***************************
//Funciones de la pagina de procesos de seleccion js_proces.jsp
//FECHA: 28/11/2000
//***************************

	function visible_procesos(indice)
	{
		
		if ((document.job_enrollment.indice_visible.value != "") && (document.job_enrollment.indice_visible.value != null))
		{
		   invisible_procesos(document.job_enrollment.indice_visible.value);
		}
		document.job_enrollment.indice_visible.value = indice;
		cadena = "CAPA"+indice;
		document.all[cadena].className="tablaestados";


	}
	function invisible_procesos(indice)
	{
		
		if (indice=="CAPA")
			document.all.CAPA.className="invisible2";
		else
		{
			cadena = "CAPA"+indice;
			document.all[cadena].className="invisible2";
		}
	}

	function borrar_valores_prosesos(indice,valor)
	{
	   var cadena = "SCO_OR_RECRUIT_PR*"+indice;	   
	   var valor_actual = document.all[cadena].value;	  
	   var cadena_acc = "_ACCION*"+indice;

	   if (valor_actual == "no_selected")
	   {
	    document.all[cadena].value = valor;
		document.all[cadena_acc].value = "INSERT";
	
	   }
       else
	   {
		document.all[cadena].value = "no_selected";
		document.all[cadena_acc].value = "no_aplica";
	   }

	}


	function comprobar_filtro(formulario)
	{
		
	    if (formulario == "filtro")
		{
			document.filtro.nombre_valor.value = 	document.filtro.valor.options[document.filtro.valor.selectedIndex].text;
			m4submitjs("filtro");
		}

	    if (formulario == "filtro_1")
		{
			document.filtro_1.nombre_valor.value = document.filtro_1.valor.options[document.filtro_1.valor.selectedIndex].text;
			m4submitjs("filtro_1");
		}
		
		if (formulario == "area")
		{
			document.area.nombre_valor.value = document.area.valor.options[document.area.valor.selectedIndex].text;
			m4submitjs("area");
		}
		if (formulario == "region")
		{
			document.region.nombre_valor.value = document.region.valor.options[document.region.valor.selectedIndex].text;
			m4submitjs("region")
		}
		if (formulario == "areafuncional")
		{
			
			document.areafuncional.nombre_valor.value = document.areafuncional.valor.options[document.areafuncional.valor.selectedIndex].text;
			m4submitjs("areafuncional");
		}

	}


	function deshacer_filtro(formulario)
	{
		
		m4submitjs("filtro_deshacer");
	}

	function cambia_formulario(destino)
	{
		
		//alert(destino);
	    if (destino == "STD_JOB_ACAD_BACKGROUND")
		{
		   document.filtro_1.className="";
		   document.filtro_1.nodo.value = "STD_JOB_ACAD_BACKGROUND"
		   document.filtro.className="invisible2";
		   document.area.className="invisible2";
		   document.region.className="invisible2";
		   document.areafuncional.className="invisible2";
		}

	    if (destino == "SCO_JOB_PREV_JOBS")
		{
		   document.filtro.className="";
		   document.filtro.nodo.value = "SCO_JOB_PREV_JOBS"
		   document.filtro_1.className="invisible2";
		   document.area.className="invisible2";
		   document.region.className="invisible2";
		   document.areafuncional.className="invisible2";
		
		}
	
	    if (destino == "SCO_RECRUIT_PRO")
		{
		   document.area.className="";
		   document.area.nodo.value = "SCO_RECRUIT_PRO"
   		   document.filtro.className="invisible2";
		   document.filtro_1.className="invisible2";
		   document.region.className="invisible2";
		   document.areafuncional.className="invisible2";
		}
	    if (destino == "STD_SUB_GEO_DIV")
		{
		   document.region.className="";
		   document.region.nodo.value = "STD_SUB_GEO_DIV"
   		   document.filtro.className="invisible2";
		   document.filtro_1.className="invisible2";
		   document.area.className="invisible2";
		   document.areafuncional.className="invisible2";
		}
		if (destino == "STD_WORK_LOCATION")
		{
		   document.areafuncional.className="";
		   document.areafuncional.nodo.value = "STD_WORK_LOCATION"
   		   document.filtro.className="invisible2";
		   document.filtro_1.className="invisible2";
		   document.area.className="invisible2";
		   document.region.className="invisible2";
		}
	}

	function comprobar_procesos(tienecv)
	{
	
	var cv = tienecv;
	if (cv==0)
	{alert('Para solicitar la incorporación a un proceso de selección, debes tener cumplimentado el Curriculum con tu Formación académica, Experiencia profesional, Formación, Conocimiento de Idiomas y Otros datos de interés.')
	}else{

	 var num_reg = document.job_enrollment.NUM_MAX_REG.value
	 var num_reg_ent = 0;
	if (num_reg > 0)
	{
		 var resto = num_reg%10;
		 if (resto != 0)
			num_reg_ent = num_reg - resto
		 else
			num_reg_ent = num_reg - 10
	}

	 var informacion = "";

//	 for (contador=num_reg_ent; contador<=num_reg; contador++)
	 for (contador=0; contador<=num_reg; contador++)
	 {

   	    var tipo_accion = "_ACCION";
		tipo_accion = tipo_accion + "*" + contador;

		accion = document.job_enrollment[tipo_accion].value

		if (accion != "no_aplica")

		{
			if (informacion != "")
	  	       informacion += "{";

			 var n_nodo = "_NODO*" + contador;
			 var n_registro = "_REGISTRO*" + contador;
			 var or_recruit = "SCO_OR_RECRUIT_PR*" + contador;
			 var reg_number = "SCO_REF_NUMBER_REC*" + contador;
			 var id_source = "SCO_ID_SOURCE*" + contador;
			 var id_status = "SCO_ID_STATUS_REF*" + contador;
			 var nm_status = "SCO_NM_STATUS_REF*" + contador;
			 var organization = "ID_ORGANIZATION*" + contador;

			 var v_nodo = document.job_enrollment[n_nodo].value; 
			 var v_registro = document.job_enrollment[n_registro].value;
			 var v_or_recruit = document.job_enrollment[or_recruit].value;
			 var v_reg_number = document.job_enrollment[reg_number].value;
			 var v_id_source = document.job_enrollment[id_source].value;
			 var v_id_status = document.job_enrollment[id_status].value;
			 var v_nm_status =document.job_enrollment[nm_status].value;
			 var v_organization = document.job_enrollment[organization].value;

			 informacion += n_nodo + "=" + v_nodo + "{" + tipo_accion + "=" + accion + "{";
			 informacion += n_registro + "=" + v_registro + "{";
			 informacion += or_recruit + "=" + v_or_recruit + "{" + reg_number + "=" + v_reg_number + 	"{"; 
			 informacion += id_source + "=" + v_id_source + "{" + id_status + "=" + v_id_status + "{"; 
			 informacion += organization + "=" + v_organization +"{" + nm_status + "=" + v_nm_status ; 

		}

	}

       if (informacion == "")
  		  alert(msg_69);
	   else
	   {
	  	   document.forma_parametro.parametro.value = informacion;
		   m4submitjs("forma_parametro");
	   }
	}
	}


//***************************
//Funciones de la pagina de procesos de seleccion del candidato js_proces_selec.jsp
//FECHA: 28/11/2000
//***************************

	function visible_proc_candidato(indice)
	{
		if ((document.delete_proces_selec.indice_visible.value != "") && (document.delete_proces_selec.indice_visible.value != null))
		{
		   invisible_proc_candidato(document.delete_proces_selec.indice_visible.value);
		}
		document.delete_proces_selec.indice_visible.value = indice;
		cadena = "CAPA"+indice;
		document.all[cadena].className="tablaestados";


	}
	function invisible_proc_candidato(indice)
	{
		if (indice=="CAPA")
			document.all.CAPA.className="invisible2";
		else
		{
			cadena = "CAPA"+indice;
			document.all[cadena].className="invisible2";
		}
	}

	function comprobar_delete_proc_candidato(registro,estado)
	{

		if(estado=='02'){
			alert('No es posible eliminar la solicitud. Se encuentra ya aceptada por el departamento de selección.')
		}else{
		var informacion = "_NODO=SCO_CURR_RECRUITMENT{_ACCION=DELETE{_REGISTRO="
		informacion += registro
		document.forma_parametro.parametro.value = informacion;
		m4submitjs("forma_parametro");}
	}


//***************************
//Funciones de la pagina de experiencia profesiona js_experiencia_profesional.jsp
//FECHA: 28/11/2000
//***************************


	function comprobar_experiencia(accion_a_tomar)
	{
		var action = accion_a_tomar;
		var informacion = "";
	 
   	    if (informacion != "")
   	    { informacion += "{";}
  
		var n_nodo = "_NODO*" + "0";
		var n_registro = "_REGISTRO*" + "0";
		
		if (action == 2)
		{
		informacion = "_NODO=SCO_CURR_PREV_JOBS{_ACCION=DELETE{_REGISTRO=";
		informacion += document.forms["experiencia_existente"].elements["_REGISTRO*1"].value;
	    document.forms["forma_parametro"].elements["parametro"].value = informacion;		
		m4submitjs("forma_parametro");
		return;
		}

		var id_area = "SCO_ID_AREA*" + "0";
		var n_area = "SCO_N_AREA*" + "0";
		var id_currency = "ID_CURRENCY*" + "0";
		var n_currency = "NM_CURRENCY*" + "0";
		var id_curr_salary = "STD_CURR_SALARY*" + "0";
		var id_developed_activities = "STD_DEVELOPED_ACTIVITIES*" + "0";
		var dt_start = "STD_DT_START*" + "0";
		var dt_end = "STD_DT_END*" +"0";
		var employer = "STD_EMPLOYER*" +"0";
		var id_country = "STD_ID_COUNTRY*" +"0";
		var n_country = "STD_N_COUNTRY*" +"0";
		var id_sector = "STD_ID_SECTOR*" +"0";
		var n_sector = "STD_N_SECTOR*" +"0";
		var initial_job = "STD_INITIAL_JOB*" +"0";
		var number_employees = "STD_NUMBER_EMPLOYEES*" +"0";
		var empresa_sector = "CSP_ID_EMPRESA_SECT*" +"0";
		var n_empresa_sector = "CSP_NM_EMPRESA_SECT*" +"0";
		var n_CSP_EMPRESA_SECTOR = "CSP_EMPRESA_SECTOR*" +"0";
		var v_nodo = document.forms["exp_profesional"].elements["_NODO*0"].value; 
		var formulario = "";

		var id_motivo = "CSP_ID_MOT_BAJA*" +"0";
		var n_motivo = "CSP_NM_MOT_BAJA*" +"0";

		var n_OTROSEMPRESA = "CSP_OTRA_EMPRESA*" +"0";
		var n_OTROSAREA = "CSP_AREA_TRAB_OTRO*" +"0";
		var n_OTROSSECTOR = "CSP_SECTOR_OTRO*" +"0";

		if (action == 1)
		{
			var v_registro = document.forms["experiencia_existente"].elements["_REGISTRO*1"].value;
			var v_accion_canal = "UPDATE";
			formulario = "experiencia_existente";
			var v_id_area = document.forms[formulario].elements["SCO_ID_AREA*1"].value;
			if (v_id_area != "")
			  {
			    var v_n_area = document.forms[formulario].elements["SCO_ID_AREA*1"].options[document.forms[formulario].elements["SCO_ID_AREA*1"].selectedIndex].text;
			  }
			else
			  {
			    var v_n_area = "";
			  }

			var v_id_currency = document.forms[formulario].elements["ID_CURRENCY*1"].value;
			var v_n_currency = document.forms[formulario].elements["ID_CURRENCY*1"].options[document.forms[formulario].elements["ID_CURRENCY*1"].selectedIndex].text;

			var v_id_curr_salary = document.forms[formulario].elements["STD_CURR_SALARY*1"].value;
			var v_id_developed_activities = 	document.forms[formulario].elements["STD_DEVELOPED_ACTIVITIES*1"].value;
			var v_dt_start = document.forms[formulario].elements["STD_DT_START*1"].value;
			var v_dt_end = document.forms[formulario].elements["STD_DT_END*1"].value;
			var v_employer = document.forms[formulario].elements["STD_EMPLOYER*1"].value;
			var v_id_country = document.forms[formulario].elements["STD_ID_COUNTRY*1"].value;
			var v_n_country = document.forms[formulario].elements["STD_ID_COUNTRY*1"].options[document.forms[formulario].elements["STD_ID_COUNTRY*1"].selectedIndex].text;

			var v_id_sector = document.forms[formulario].elements["STD_ID_SECTOR*1"].value;
			var v_n_sector = document.forms[formulario].elements["STD_ID_SECTOR*1"].options[document.forms[formulario].elements["STD_ID_SECTOR*1"].selectedIndex].text;

			var v_initial_job = document.forms[formulario].elements["STD_INITIAL_JOB*1"].value;
			var v_number_employees =document.forms[formulario].elements["STD_NUMBER_EMPLOYEES*1"].value;
			var v_empresa_sector =document.forms[formulario].elements["CSP_ID_EMPRESA_SECT*1"].value;
			var v_n_empresa_sector =document.forms[formulario].elements["CSP_ID_EMPRESA_SECT*1"].options[document.forms[formulario].elements["CSP_ID_EMPRESA_SECT*1"].selectedIndex].text;
			var v_CSP_EMPRESA_SECTOR=document.forms[formulario].elements["CSP_EMPRESA_SECTOR_V*1"].value;

			var v_id_motivo = document.forms[formulario].elements["CSP_ID_MOT_BAJA*1"].value;
			var v_n_motivo = document.forms[formulario].elements["CSP_ID_MOT_BAJA*1"].options[document.forms[formulario].elements["CSP_ID_MOT_BAJA*1"].selectedIndex].text;

		var v_OTROSEMPRESA = document.forms[formulario].elements["CSP_OTRA_EMPRESA*1"].value;
		var v_OTROSAREA = document.forms[formulario].elements["CSP_AREA_TRAB_OTRO*1"].value;
		var v_OTROSSECTOR = document.forms[formulario].elements["CSP_SECTOR_OTRO*1"].value;			

		}

		if (action == 3)
		{
			var v_registro =0
			var v_accion_canal = "INSERT";
			formulario = "exp_profesional";
		
			var v_id_area = document.forms[formulario].elements["SCO_ID_AREA"].value;
			if (v_id_area != "")
			  {
			    var v_n_area = document.forms[formulario].SCO_ID_AREA.options[document.forms[formulario].SCO_ID_AREA.selectedIndex].text;
			  }
			else
			  {
			    var v_n_area = "";
			  }

			var v_id_currency = document.forms[formulario].elements["ID_CURRENCY"].value;
			var v_n_currency = document.forms[formulario].ID_CURRENCY.options[document.forms[formulario].ID_CURRENCY.selectedIndex].text;

			var v_id_curr_salary = document.forms[formulario].elements["STD_CURR_SALARY"].value;
			var v_id_developed_activities = 	document.forms[formulario].elements["STD_DEVELOPED_ACTIVITIES"].value;
			var v_dt_start = document.forms[formulario].elements["STD_DT_START"].value;
			var v_dt_end = document.forms[formulario].elements["STD_DT_END"].value;
			var v_employer = document.forms[formulario].elements["STD_EMPLOYER"].value;
			var v_id_country = document.forms[formulario].elements["STD_ID_COUNTRY"].value;
			var v_n_country = document.forms[formulario].STD_ID_COUNTRY.options[document.forms[formulario].STD_ID_COUNTRY.selectedIndex].text;

			var v_id_sector = document.forms[formulario].elements["STD_ID_SECTOR"].value;
			var v_n_sector = document.forms[formulario].STD_ID_SECTOR.options[document.forms[formulario].STD_ID_SECTOR.selectedIndex].text;

			var v_initial_job = document.forms[formulario].elements["STD_INITIAL_JOB"].value;
			var v_number_employees =document.forms[formulario].elements["STD_NUMBER_EMPLOYEES"].value;
			var v_empresa_sector =document.forms[formulario].elements["CSP_ID_EMPRESA_SECT"].value;
			var v_n_empresa_sector =document.forms[formulario].elements["CSP_ID_EMPRESA_SECT"].options[document.forms[formulario].elements["CSP_ID_EMPRESA_SECT"].selectedIndex].text;
			var v_CSP_EMPRESA_SECTOR=document.forms[formulario].elements["CSP_EMPRESA_SECTOR_V"].value;

			var v_id_motivo = document.forms[formulario].elements["CSP_ID_MOT_BAJA"].value;
			var v_n_motivo = document.forms[formulario].elements["CSP_ID_MOT_BAJA"].options[document.forms[formulario].elements["CSP_ID_MOT_BAJA"].selectedIndex].text;

		var v_OTROSEMPRESA = document.forms[formulario].elements["CSP_OTRA_EMPRESA"].value;
		var v_OTROSAREA = document.forms[formulario].elements["CSP_AREA_TRAB_OTRO"].value;
		var v_OTROSSECTOR = document.forms[formulario].elements["CSP_SECTOR_OTRO"].value;			
		}

		 informacion += n_nodo + "=" + v_nodo + "{_ACCION*0="+ v_accion_canal + "{";
		 informacion += n_registro + "=" + v_registro + "{";
		 informacion += id_area + "=" + v_id_area +  "{"; 
		 informacion += n_area + "=" + v_n_area +  "{"; 
		 informacion += id_curr_salary + "=" + v_id_curr_salary + "{" + id_developed_activities + "=" + v_id_developed_activities + "{"; 
		 informacion += dt_start + "=" + v_dt_start + "{" + number_employees + "=" + v_number_employees + "{" ; 
		 informacion += employer + "=" + v_employer + "{" + id_country + "=" + v_id_country + "{"; 
		 informacion += n_country + "=" + v_n_country + "{"; 
		 informacion += id_sector + "=" + v_id_sector + "{" + initial_job + "=" + v_initial_job + "{" ; 
		 informacion += n_sector + "=" + v_n_sector + "{"; 
         informacion += n_CSP_EMPRESA_SECTOR + "=" + v_CSP_EMPRESA_SECTOR + "{"; 

		 if ((v_dt_end!="")&&((v_id_curr_salary!="")||(v_id_curr_salary!=null)))
		 {
			informacion += dt_end + "=" + v_dt_end + "{" + id_currency + "=" + v_id_currency + "{";  
			informacion += n_currency + "=" + v_n_currency;  
	 	 }

		 if ((v_dt_end!="")&&((v_id_curr_salary=="")||(v_id_curr_salary==null)))
		 {
		    informacion += dt_end + "=" + v_dt_end;
		 }

		 if ((v_dt_end=="")&&((v_id_curr_salary!="")||(v_id_curr_salary!=null)))
		 {
		    informacion += id_currency + "=" + v_id_currency + "{";
			informacion += n_currency + "=" + v_n_currency + "{"; 
		    informacion += dt_end + "=4000-01-01";

		 }

		 if ((v_empresa_sector!="")||(v_empresa_sector!=null))
		 {
		    informacion +="{"+ empresa_sector + "=" + v_empresa_sector +"{" ;
			informacion += n_empresa_sector + "=" + v_n_empresa_sector + "{"; 
			

		 }

		informacion += id_motivo + "=" + v_id_motivo+ "{";
		informacion += n_motivo + "=" + v_n_motivo+ "{"; 

		informacion += n_OTROSAREA + "=" + v_OTROSAREA+ "{";
		informacion += n_OTROSEMPRESA + "=" + v_OTROSEMPRESA+ "{";
		informacion += n_OTROSSECTOR + "=" + v_OTROSSECTOR;


		 if (informacion == "")
  			 { alert(msg_68);}
		 else
			 {
			  document.forms["forma_parametro"].elements["parametro"].value = informacion;		
			  m4submitjs("forma_parametro");
		   
			 }
    	}

	
function maxLengthToPaste(texto,maxlong) { 
	var in_value, out_value, total, clip_board; 
	clip_board = window.clipboardData.getData("text");
	total = clip_board.length + texto.value.length;
	if (total > maxlong) {
		in_value = texto.value + clip_board;
		out_value = in_value.substring(0,maxlong); 
		texto.value = out_value;
		alert(msg_100);
		return false; 
	} 
	return true; 
}


///////////////////////////

function validar_datos_experiencia(accion){

	var accion_bbdd = accion;
	var numeros = "0123456789";

	if (accion == 3)
	{
	var v_baja = document.forms["exp_profesional"].elements["CSP_ID_MOT_BAJA"].value;
	var ffin_nulo = comprobar_espacios("exp_profesional","STD_DT_END")
	if((v_baja=='null'||v_baja=='')&&ffin_nulo!=0){
				alert('Debes indicar un motivo de baja');
				return;
	}

	var vOtros1 = exp_profesional.CSP_ID_EMPRESA_SECT.options[exp_profesional.CSP_ID_EMPRESA_SECT.selectedIndex].text
	if (vOtros1.substring(0,3)=='OTR'||vOtros1.substring(0,3)=='Otr'||vOtros1.substring(0,3)=='otr'){
		var otros1 = comprobar_espacios("exp_profesional","CSP_OTRA_EMPRESA")
		
		if (otros1==0)
			{
				alert('Debes indicar otras empresa del sector');
				document.forms["exp_profesional"].elements["CSP_OTRA_EMPRESA"].focus();
				return;
			}		
	}

	var vOtros2 = exp_profesional.STD_ID_SECTOR.options[exp_profesional.STD_ID_SECTOR.selectedIndex].text
	if (vOtros2.substring(0,3)=='OTR'||vOtros2.substring(0,3)=='Otr'||vOtros2.substring(0,3)=='otr'){
		var otros2 = comprobar_espacios("exp_profesional","CSP_SECTOR_OTRO")
		
		if (otros2==0)
			{
				alert('Debes indicar otro sector');
				document.forms["exp_profesional"].elements["CSP_SECTOR_OTRO"].focus();
				return;
			}		
	}

	var vOtros3 = exp_profesional.SCO_ID_AREA.options[exp_profesional.SCO_ID_AREA.selectedIndex].text
	if (vOtros3.substring(0,3)=='OTR'||vOtros3.substring(0,3)=='Otr'||vOtros3.substring(0,3)=='otr'){
		var otros3 = comprobar_espacios("exp_profesional","CSP_AREA_TRAB_OTRO")
		
		if (otros3==0)
			{
				alert('Debes indicar otra área de trabajo');
				document.forms["exp_profesional"].elements["CSP_AREA_TRAB_OTRO"].focus();
				return;
			}		
	}
	var empresa_nulo = comprobar_espacios("exp_profesional","STD_EMPLOYER")

	if (empresa_nulo == 0&&document.forms["exp_profesional"].elements["CSP_EMPRESA_SECTOR_0"].checked==true)
	{

		var empresa_sector = comprobar_espacios("exp_profesional","STD_ID_SECTOR")

				alert(msg_70);
				document.forms["exp_profesional"].elements["STD_EMPLOYER"].focus();
				return;


	}


	//comprobación no nulo empresa del sector....

	var empresa_sector = comprobar_espacios("exp_profesional","STD_ID_SECTOR")
	if (empresa_sector == 0)
	{
		var empresa_nulo = comprobar_espacios("exp_profesional","STD_EMPLOYER")
	
		if (empresa_nulo==0&&document.forms["exp_profesional"].elements["CSP_EMPRESA_SECTOR_0"].checked==true)
			{
				alert(msg_70);
				document.forms["exp_profesional"].elements["STD_EMPLOYER"].focus();
				return;
			}

	}

//fin comprobación...
	var o_number_employees 	=document.forms["exp_profesional"].elements["STD_NUMBER_EMPLOYEES"].value;
	if (o_number_employees!="")
	{
		if (isNaN(o_number_employees))
		{
		alert(msg_71);
		document.forms["exp_profesional"].elements["STD_NUMBER_EMPLOYEES"].focus();
		return;	
		}
	}
	var inicio_nulo = comprobar_espacios("exp_profesional","STD_DT_START")
	if (inicio_nulo == 0)
	{
	alert(msg_60);
	document.exp_profesional.STD_DT_START.focus();
	return;
	}else{
		var formato_fecha=comprobar_formato_fecha(document.forms["exp_profesional"].elements["STD_DT_START"].value);
		if(formato_fecha==0){
			alert(msg_67);
			document.forms["exp_profesional"].elements["STD_DT_START"].focus();
			return;
		}//cierre if (formato_fecha==0)
	}//cierre if (inicio_nulo == 0)
			
	fec_fin = document.forms["exp_profesional"].elements["STD_DT_END"].value;
	fec_ini = document.forms["exp_profesional"].elements["STD_DT_START"].value;

	if (fec_fin!="")
	{
		var formato_fecha=comprobar_formato_fecha(document.forms["exp_profesional"].elements["STD_DT_END"].value);
		if(formato_fecha==0)
		{
			alert(msg_67);
			document.forms["exp_profesional"].elements["STD_DT_END"].focus();
			return;
		}
		else
		{


	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			var fec_iniAUx = formato_fecha_AAAAMMDD(fec_ini)
			var fec_finAUx = formato_fecha_AAAAMMDD(fec_fin)
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			if (fec_iniAUx>fec_finAUx)

			{
				alert(msg_58);
				document.forms["exp_profesional"].elements["STD_DT_END"].focus();
				return;
			}//cierre if (fec_ini>fec_fin)
		}//cierre if (formato_fecha==0)
	}//cierre if (fechafin_nula == 0)
		
   var puesto_nulo = comprobar_espacios("exp_profesional","STD_INITIAL_JOB")
   if (puesto_nulo == 0)
	{
		alert(msg_72);
		document.forms["exp_profesional"].elements["STD_INITIAL_JOB"].focus();
		return;
	}

	var actividades_nulo = comprobar_espacios("exp_profesional","STD_DEVELOPED_ACTIVITIES")
	if (actividades_nulo == 0)
	{
	alert(msg_73);
	document.forms["exp_profesional"].elements["STD_DEVELOPED_ACTIVITIES"].focus();
	return;
	}


	var salario_nulo = comprobar_espacios("exp_profesional","STD_CURR_SALARY")
	if (salario_nulo == 0)
	{
	alert(msg_74);
	document.forms["exp_profesional"].elements["STD_CURR_SALARY"].focus();
	return;
	}

	var o_id_curr_salary = document.forms["exp_profesional"].elements["STD_CURR_SALARY"].value;

	if (isNaN(o_id_curr_salary))
	{
	alert(msg_75);
	document.forms["exp_profesional"].elements["STD_CURR_SALARY"].focus();
	return;	
	}
}//cierre accion=3

if (accion == 1)/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
{

	var v_baja = document.forms["experiencia_existente"].elements["CSP_ID_MOT_BAJA*1"].value;
	var ffin_nulo = comprobar_espacios("experiencia_existente","STD_DT_END*1");
	if((v_baja=='null'||v_baja=='')&&ffin_nulo!=0){
				alert('Debes indicar un motivo de baja');
				return;
	}

//////////////////////////////////////////

	var vOtros1 = document.forms["experiencia_existente"].elements["CSP_ID_EMPRESA_SECT*1"].options[document.forms["experiencia_existente"].elements["CSP_ID_EMPRESA_SECT*1"].selectedIndex].text;
	if (vOtros1.substring(0,3)=='OTR'||vOtros1.substring(0,3)=='Otr'||vOtros1.substring(0,3)=='otr'){
		var otros1 = comprobar_espacios("experiencia_existente","CSP_OTRA_EMPRESA*1")
		
		if (otros1==0)
			{
				alert('Debes indicar otras empresa del sector');
				document.forms["experiencia_existente"].elements["CSP_OTRA_EMPRESA*1"].focus();
				return;
			}		
	}

	var vOtros2 = document.forms["experiencia_existente"].elements["STD_ID_SECTOR*1"].options[document.forms["experiencia_existente"].elements["STD_ID_SECTOR*1"].selectedIndex].text;
	if (vOtros2.substring(0,3)=='OTR'||vOtros2.substring(0,3)=='Otr'||vOtros2.substring(0,3)=='otr'){
		var otros2 = comprobar_espacios("experiencia_existente","CSP_SECTOR_OTRO*1")
		
		if (otros2==0)
			{
				alert('Debes indicar otro sector');
				document.forms["experiencia_existente"].elements["CSP_SECTOR_OTRO*1"].focus();
				return;
			}		
	}

	var vOtros3 = document.forms["experiencia_existente"].elements["SCO_ID_AREA*1"].options[document.forms["experiencia_existente"].elements["SCO_ID_AREA*1"].selectedIndex].text;
	if (vOtros3.substring(0,3)=='OTR'||vOtros3.substring(0,3)=='Otr'||vOtros3.substring(0,3)=='otr'){
		var otros3 = comprobar_espacios("experiencia_existente","CSP_AREA_TRAB_OTRO*1")
		
		if (otros3==0)
			{
				alert('Debes indicar otra área de trabajo');
				document.forms["experiencia_existente"].elements["CSP_AREA_TRAB_OTRO*1"].focus();
				return;
			}		
	}

////////////////////

	var empresa_nulo = comprobar_espacios("experiencia_existente","STD_EMPLOYER*1")

	if (empresa_nulo == 0&&document.forms["experiencia_existente"].elements["CSP_EMPRESA_SECTOR_0*1"].checked==true)
	{

		var empresa_sector = comprobar_espacios("experiencia_existente","STD_ID_SECTOR*1")
		
		if (empresa_sector==0)
			{
				alert(msg_70);
				document.forms["experiencia_existente"].elements["STD_EMPLOYER*1"].focus();
				return;
			}
	}



	var empresa_sector = comprobar_espacios("experiencia_existente","STD_ID_SECTOR*1")
	if (empresa_sector == 0)
	{
		var empresa_nulo = comprobar_espacios("experiencia_existente","STD_EMPLOYER*1")
	
		if (empresa_nulo==0&&document.forms["experiencia_existente"].elements["CSP_EMPRESA_SECTOR_0*1"].checked==true)
			{
				alert(msg_76);
				document.forms["experiencia_existente"].elements["STD_EMPLOYER*1"].focus();
				return;
			}

	}



	var o_number_employees 	=document.forms["experiencia_existente"].elements["STD_NUMBER_EMPLOYEES*1"].value;
	if (o_number_employees!="")
	{
		if (isNaN(o_number_employees))
		{
		alert(msg_71);
		document.forms["experiencia_existente"].elements["STD_NUMBER_EMPLOYEES*1"].focus();
		return;	
		}
	}
	var inicio_nulo = comprobar_espacios("experiencia_existente","STD_DT_START*1")
	if (inicio_nulo == 0)
	{
		alert(msg_60);
		document.forms["experiencia_existente"].elements["STD_DT_START*1"].focus();
		return;
	}else{
		var formato_fecha=comprobar_formato_fecha(document.forms["experiencia_existente"].elements["STD_DT_START*1"].value);
		if(formato_fecha==0){
			alert(msg_67);
			document.forms["experiencia_existente"].elements["STD_DT_START*1"].focus();
			return;
		}//cierre if (formato_fecha==0)
	}//cierre if (inicio_nulo == 0)

	var fec_fin = document.forms["experiencia_existente"].elements["STD_DT_END*1"].value;
	var fec_ini = document.forms["experiencia_existente"].elements["STD_DT_START*1"].value;

	if (fec_fin !="")
	{
		var formato_fecha=comprobar_formato_fecha(document.forms["experiencia_existente"].elements["STD_DT_END*1"].value);
		if(formato_fecha==0)
		{
			alert(msg_67);
			document.forms["experiencia_existente"].elements["STD_DT_END*1"].focus();
			return;
		}
		else
		{

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			var fec_iniAUx = formato_fecha_AAAAMMDD(fec_ini)
			var fec_finAUx = formato_fecha_AAAAMMDD(fec_fin)
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			if (fec_iniAUx>fec_finAUx)
			{
				alert(msg_58);
				document.forms["experiencia_existente"].elements["STD_DT_END*1"].focus();
				return;
			}//cierre if (fec_ini>fec_fin)
		}//cierre if (formato_fecha==0)
	}//cierre if (fec_fin !="")

		   var puesto_nulo = comprobar_espacios("experiencia_existente","STD_INITIAL_JOB*1")

			if (puesto_nulo == 0&& document.forms["experiencia_existente"].elements["CSP_EMPRESA_SECTOR_1*1"].checked==true)
			{
			document.forms["experiencia_existente"].elements["STD_INITIAL_JOB*1"].focus();
			return;
			}

		   var actividades_nulo = comprobar_espacios("experiencia_existente","STD_DEVELOPED_ACTIVITIES*1")
			if (actividades_nulo == 0)
			{
			alert(msg_78);
			document.forms["experiencia_existente"].elements["STD_DEVELOPED_ACTIVITIES*1"].focus();
			return;
			}


		   var salario_nulo = comprobar_espacios("experiencia_existente","STD_CURR_SALARY*1")
			if (salario_nulo == 0)
			{
			alert(msg_74);
			document.forms["experiencia_existente"].elements["STD_CURR_SALARY*1"].focus();
			return;
			}

			var o_id_curr_salary = document.forms["experiencia_existente"].elements["STD_CURR_SALARY*1"].value;

			if (isNaN(o_id_curr_salary))
			{
			alert(msg_75);
			document.forms["experiencia_existente"].elements["STD_CURR_SALARY*1"].focus();
			return;	
			}

		}
	comprobar_experiencia(accion_bbdd);
	}

