<!--
/*Buscador Index*/
	function ValidoBuscadorRSS(){
		if ( (document.forms["frmBuscar"].elements["palabraClave"].value.length<3 || document.forms["frmBuscar"].elements["palabraClave"].value=="(Delineante, Comercial...)") && document.forms["frmBuscar"].elements["Provincia"].value=="0" && document.forms["frmBuscar"].elements["Sector"].value=="0" && document.forms["frmBuscar"].elements["comunidades"].value=="0"){
			alert("Debe seleccionar al menos 1 criterio de BUSQUEDA");
			document.forms["frmBuscar"].elements["comunidades"].focus();
			return false;
		}
		else
			return true;
	}
	function ValidoBuscador(){
		if ( (document.forms["frmBuscar"].elements["palabraClave"].value.length<3 || document.forms["frmBuscar"].elements["palabraClave"].value=="(Delineante, Comercial...)") && document.forms["frmBuscar"].elements["Provincia"].value=="0" && document.forms["frmBuscar"].elements["Sector"].value=="0"){
			alert("Debe seleccionar al menos 1 criterio de BUSQUEDA");
			document.forms["frmBuscar"].elements["palabraClave"].focus();
			return false;
		}
		else
			return true;
	}
	function BorrarBuscador(){
		document.forms["frmBuscar"].elements["palabraClave"].value="";
	}

var bHome=true;
/*Menus y pestanas******************************************/
function home(estado,ruta){
	if (bHome!=true){
		if (estado=="on"){
			document.getElementById('homeEnlace').style.background='url('+ruta+'graficos/pestanaOn25.png) no-repeat';
			document.getElementById("imgHome").src=ruta+"graficos/homeOn.gif";
		}
		else{
			document.getElementById('homeEnlace').style.background='url('+ruta+'graficos/pestanaOff25.png) no-repeat';
			document.getElementById("imgHome").src=ruta+"graficos/homeOff.gif";
		}
	}
}

function muestra(ID,tipo){
		for (var i = 1; i <= 20; i++ )
		{
			if (tipo=="sectoresProvincias"){
				
				if (document.getElementById("sectoresProvincias"+i) ){
				
					if ( (ID==i) )
					{
						document.getElementById("sectoresProvincias"+i).style.display="block";
						document.getElementById("sectoresProvincias"+i).style.visibility="visible";
						//document.getElementById(i).style.height="100%";
					}
					else{
						document.getElementById("sectoresProvincias"+i).style.visibility="hidden";
						//document.getElementById(i).style.height="0";
						document.getElementById("sectoresProvincias"+i).style.display="none";	
					}
				}
			}
			else{
				if (document.getElementById(i) ){
				
					if ( (ID==i) )
					{
						document.getElementById(i).style.display="block";
						document.getElementById(i).style.visibility="visible";
						//document.getElementById(i).style.height="100%";
					}
					else
					{
						document.getElementById(i).style.visibility="hidden";
						//document.getElementById(i).style.height="0";
						document.getElementById(i).style.display="none";	
					}
				}
			}
			
			
		}
	}
	
function FJSmenu(menuId){
	for (var i = 1; i <= 20; i++ )
	{
		if (document.getElementById("menu" + i) && document.getElementById("submenu" + i)){
		
			if ( (menuId==("menu"+i)) && (document.getElementById("submenu" + i).style.visibility=="hidden") )
			{
				document.getElementById(menuId).className="menu3";
				document.getElementById("submenu" + i).style.display="Inline";
				document.getElementById("submenu" + i).style.visibility="visible";
				document.getElementById("submenu" + i).style.height="100%";
			}
			else
			{
				document.getElementById("menu"+ i).className="menu1";
				document.getElementById("submenu" + i).style.visibility="hidden";
				document.getElementById("submenu" + i).style.height="0";
				document.getElementById("submenu" + i).style.display="none";	
			}
		
		}
		
	}
}
 
/*Ventanas******************************************/
function AbrirVentana(tipo,cod,cargo) {
	var win= null;
	var w=320;
	var h=260;
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=auto,resizable=yes'
	win=window.open("amigo.asp?tipo="+tipo+"&cod="+cod+"&cargo="+cargo,tipo,settings)
}

function Zoom(identificador,identificador2){
	var win= null;
	var w=800;
	var h=640;
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=auto,fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=auto,resizable=no'
	win=window.open("galeriaImagenes.asp?id="+identificador+"&id2="+identificador2,"imagenes",settings)
}

function ayuda(pagina,ancho,alto){
	//window.open('estados.html','estados','width=300,height=320,menubar=no,toolbar=no,resizable=yes,top=100,left=300')
	var win= null;
		var w=ancho;
		var h=alto;
		var winl = (screen.width-w-10)/2;
		var wint = (screen.height-h)/2;
		//window.open('ejemplo.html')
		window.open(pagina,'Ayuda','width='+w+',height='+h+',top='+wint+',left='+winl+',menubar=no,status=yes,toolbar=no,scrollbars=yes,resizable=yes')
}

/*ejemplo.html desde bonosInfo*/
function AbrirVentanaE(){
		var win= null;
		var w=780;
		var h=520;
		var winl = (screen.width-w-10)/2;
		var wint = (screen.height-h)/2;
		//window.open('ejemplo.html')
		window.open('ejemplo.html','ejemplo','width='+w+',height='+h+',top='+wint+',left='+winl+',menubar=no,status=yes,toolbar=no,scrollbars=no,resizable=yes')
	}
/*Varios******************************************/

//window.defaultStatus="Bienvenidos a Empleo.net";

function FJSfechaLarga(){
	var mydate=new Date();
	var year=mydate.getYear();
	
	if (year < 1000){year+=1900;}
	
	var day=mydate.getDay();
	var month=mydate.getMonth();
	var daym=mydate.getDate();

	if (daym<10){daym = "0" + daym;}
	
	var dayarray=new Array("Domingo","Lunes","Martes","Mi&eacute;rcoles","Jueves","Viernes","S&aacute;bado");
	var montharray=new Array("enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre");
	var fecha =  dayarray[day]+" "+daym+" de "+montharray[month]+" del "+year;
	
	return fecha;
}

function Ffavoritos() {
	var shtml ="" ;
	if (navigator.appVersion >= 4 || navigator.appName=="Microsoft Internet Explorer") {
		var shtml = "&nbsp;|&nbsp;<a href='javascript:window.external.AddFavorite(\"http://www.empleo.net\",\"Empleo.NET\");' class='grisOscu'>Favoritos</a>";
	}
	document.write(shtml);
}

/*Formularios******************************************/
/*Copiada de verOferta*/
	function Inscribirse(codigoEmpresa,empresa,cargo,fecha,localidad,idOferta,ocultarNombre) {
		location.href="inscribirse.asp?codEmpresa="+codigoEmpresa+"&empresa="+empresa+"&cargo="+cargo+"&fecha="+fecha+"&localidad="+localidad+"&idOferta="+idOferta+"&bNombre="+ocultarNombre;
	}

/*Copiada de modOferta */
	browserName = navigator.appName;
		if (browserName.indexOf("Netscape")!=-1) 
			IE = false;
		else
			IE = true;
/*Cop&igrave;adas de inOferta*/
function mostra() {
	if (IE) 
		{
		confirmarIE.style.visibility="visible";
		confirmarIE.style.display="block";
		eliminarIE.style.visibility="hidden";
		eliminarIE.style.display="none";

		}
	else
		{
		document.layers["confirmarNS"].visibility="visible";
		document.layers["confirmarNS"].display="block";
		document.layers["eliminarNS"].visibility="hide";
		document.layers["eliminarNS"].display="none";

		}
}

function oculta() {
	if (IE) 
		{
		confirmarIE.style.visibility="hidden";
		confirmarIE.style.display="none";
		eliminarIE.style.visibility="visible";
		eliminarIE.style.display="block";

		}
	else
		{
		document.layers["confirmarNS"].visibility="hide";
		document.layers["confirmarNS"].display="none";
		document.layers["eliminarNS"].visibility="visible";
		document.layers["eliminarNS"].display="block";

		}
}
	var InicioContador=0;
	function Contar(){
		sLongitud=document.getElementById("texto").value.length
		InicioContador=200;
			if (sLongitud >= InicioContador){
				event.keyCode=0;
			}
		document.getElementById("contador").innerHTML= (InicioContador - document.getElementById("texto").value.length);
	}
	function Cortar(){
		sLongitud=document.getElementById("texto").value.length;
		sTexto=document.getElementById("texto").value;
		document.getElementById("texto").value=sTexto.substring(0, 200);
		Contar()
	}
	
		
	function CambiaComillaPegado(NombreForm){
	//Prop&oacute;sito:	Substuir la comilla simple por el acento cuando pegan en todos los campos del formulario.
	//Efectos:		Si se pega la comilla['] se reemplazar&aacute; por el acento[&acute;].
	
		var iNumCampos = document.forms[NombreForm].length-1
		for (i=0;i<=iNumCampos;i++)
		{
			if (document.forms[NombreForm].elements[i].type!="select-multiple"){
				sTexto=document.forms[NombreForm].elements[i].value;
				while (sTexto.search("'") != -1){
					sTexto=sTexto.replace("'", "&acute;");
					}
				while (sTexto.search('"') != -1){
					sTexto=sTexto.replace('"', '&acute;');
					}
				//alert(document.forms[formulario].elements[i].name)
				document.forms[NombreForm].elements[i].value=sTexto;
			}
			
		}
	
}
function ValidoFormulario(NombreForm,TxtEmail,tipoForm) {
	CambiaComillaPegado(NombreForm);
	var i;
	var sFormulario=document.forms[NombreForm];
	var validado = true;
	
	for (i=0; i<= sFormulario.length-1; i++){
	  if (sFormulario.elements[i].attributes["validationmsg"]){
		if (sFormulario.elements[i].attributes["validationmsg"].value != "" && sFormulario.elements[i].style.visibility != "hidden"){
			switch (sFormulario.elements[i].type) {  
				case "select-multiple" :  
					if (sFormulario.elements[i].options.length =="0"){
						alert(sFormulario.elements[i].attributes["validationmsg"].value);
						sFormulario.elements[i].focus();
						return false;
					}
					break;
				case "textarea" :  
					if (sFormulario.elements[i].value.length > sFormulario.elements[i].maxlength){validado=false;}
					if (sFormulario.elements[i].value.length == "0" ){validado=false;}
					if (validado==false){
						alert(sFormulario.elements[i].attributes["validationmsg"].value);
						return false;
					}
					break;
				default :  
					if (sFormulario.elements[i].type !="image" && sFormulario.elements[i].type !="select-multiple" &&
					 sFormulario.elements[i].type !="textarea" && sFormulario.elements[i].type !="checkbox" && 
					 sFormulario.elements[i].type !="radio" && sFormulario.elements[i].attributes["validationmsg"].value != "0" && 
					 sFormulario.elements[i].attributes["validationmsg"] != "undefined" && sFormulario.elements[i].disabled == false && 
					 (sFormulario.elements[i].value =="" || sFormulario.elements[i].value =="0" )){
						alert(sFormulario.elements[i].attributes["validationmsg"].value);
						sFormulario.elements[i].focus();
						return false;
					}
					break;
			}  
			if (sFormulario.elements[i].minlength){
				if (sFormulario.elements[i].value.length < sFormulario.elements[i].minlength){validado=false;}
			}
			if (validado==false){
				alert(sFormulario.elements[i].attributes["validationmsg"].value);
				sFormulario.elements[i].focus();
				return false;
			}
		 }
	  }
	}
	if (TxtEmail!=""){
		/* Verificar si el email tiene el formato user@dominio. */
		var emailPat=/^(.+)@(.+)$/
	
		var emailStr = document.getElementById(TxtEmail).value
		
		if (!emailStr.match(emailPat)) {
			alert("El campo Email parece incorrecto (compruebe @ y .'s)")
			document.getElementById(TxtEmail).focus();
			return false
		}
	}
	//empresas 
	if (tipoForm=="modificarEmpresa"){
				
		sFormulario.elements["cif"].value
		bCif=true;
		bDNI=true;
		if (sFormulario.elements["cif"].value.length>=1){
			
			var pares = 0; 
	        var impares = 0; 
	        var suma; 
	        var ultima; 
	        var unumero; 
	        var uletra = new Array("J", "A", "B", "C", "D", "E", "F", "G", "H", "I"); 
	        var xxx; 
	        texto=sFormulario.elements["cif"].value;
	        texto = texto.toUpperCase(); 
	         
	        var regular = new RegExp(/^[ABCDEFGHKLMNPQS]\d\d\d\d\d\d\d[0-9,A-J]$/g); 
	         if (!regular.exec(texto)){
			 	// alert("El CIF es incorrecto")
				// sFormulario.elements["cif"].focus();
				 // return false; 
				 bCif=false;
			  }
	              
	         ultima = texto.substr(8,1); 
	
	         for (var cont = 1 ; cont < 7 ; cont ++){ 
	             xxx = (2 * parseInt(texto.substr(cont++,1))).toString() + "0"; 
	             impares += parseInt(xxx.substr(0,1)) + parseInt(xxx.substr(1,1)); 
	             pares += parseInt(texto.substr(cont,1)); 
	         } 
	         xxx = (2 * parseInt(texto.substr(cont,1))).toString() + "0"; 
	         impares += parseInt(xxx.substr(0,1)) + parseInt(xxx.substr(1,1)); 
	          
	         suma = (pares + impares).toString(); 
	         unumero = parseInt(suma.substr(suma.length - 1, 1)); 
	         unumero = (10 - unumero).toString(); 
	         if(unumero == 10) unumero = 0; 
	          
	         if ((ultima == unumero) || (ultima == uletra[unumero])){ 
	             //cif incorrecto
				 }
	         else {
				// alert("El CIF es incorrecto")
				// sFormulario.elements["cif"].focus();
	            // return false; 
				bCif=false;
				}
		}
		dni=sFormulario.elements["cif"].value;
		dni = dni.toUpperCase(); 
	 	numero = dni.substr(0,dni.length-1);
	  	let = dni.substr(dni.length-1,1);
	  	numero = numero % 23;
	  	letra='TRWAGMYFPDXBNJZSQVHLCKET';
	  	letra=letra.substring(numero,numero+1);
	  if (letra!=let) {
	  	bDNI=false;
		}
		if (bDNI==false && bCif==false){
			alert("El CIF/DNI es incorrecto. Escriba SOLO LETRAS Y NUMEROS. Sin puntos, guiones ni espacios.")
		 	sFormulario.elements["cif"].focus();
          	 return false;
		}
		
	}
	if (tipoForm=="altaEmpresa2"){
		if (sFormulario.elements["movil"].value.length!=9 && sFormulario.elements["movil"].value.length!=0){
			alert("El MOVIL debe tener 9 NUMEROS");
			sFormulario.elements["movil"].focus();
			return false;
		}
		if (sFormulario.elements["email"].value!=sFormulario.elements["emailRepetir"].value){
			alert("No coinciden los EMAILS");
			sFormulario.elements["email"].focus();
			return false;
		}
	}
	
	if (tipoForm=="altaEmpresa1"){
		if (sFormulario.elements["usuario"].value.length<4){
			alert("El CODIDO DE USUARIO debe ser de 4 caracteres como MINIMO");
			sFormulario.elements["usuario"].focus();
			return false;
		}
		if (sFormulario.elements["contrasena"].value.length<4){
			alert("La CONTRASENA debe ser de 4 caracteres como MINIMO");
			sFormulario.elements["contrasena"].focus();
			return false;
		}
		if (sFormulario.elements["contrasena"].value!=sFormulario.elements["rcontrasena"].value){
			alert("No coinciden las CONTRASENAS");
			sFormulario.elements["contrasena"].focus();
			return false;
		}
		
		if (sFormulario.elements["usuario"].value == sFormulario.elements["contrasena"].value){
			alert("La CONTRASENA no puede ser igual al USUARIO");
			sFormulario.elements["contrasena"].focus();
			return false;
		}
		
		var sCampo;
		var checkOK = "0123456789" + "ABCDEFGHIJKLMNÑOPQRSTUVWXYZ" + "abcdefghijklmnñopqrstuvwxyz";
		if (navigator.appVersion.indexOf("MSIE 6.0")==-1){
			  //var checkStr = sFormulario.elements["subdominio"].value;
			  var checkStr1 = sFormulario.elements["usuario"].value;
			  var checkStr2 = sFormulario.elements["contrasena"].value;
			  var allValid = true; 
			   for (i = 0; i < checkStr1.length; i++) {
				ch = checkStr1.charAt(i); 
				for (j = 0; j < checkOK.length; j++)
				  if (ch == checkOK.charAt(j))
					break;
				if (j == checkOK.length) { 
				  allValid = false;
				  sCampo="usuario"
				  break; 
				}
			  }
			   for (i = 0; i < checkStr2.length; i++) {
				ch = checkStr2.charAt(i); 
				for (j = 0; j < checkOK.length; j++)
				  if (ch == checkOK.charAt(j))
					break;
				if (j == checkOK.length) { 
				  allValid = false;
				  sCampo="contrasena"
				  break; 
				}
			  }
			  
			  if (!allValid) { 
				alert("Escriba SOLO LETRAS (las vocales sin acentuar) y NUMEROS en el campo \""+sCampo+"\"."); 
				sFormulario.elements[sCampo].focus(); 
				return false; 
			  }
		}
		
		
		sFormulario.elements["cif"].value
		bCif=true;
		bDNI=true;
		if (sFormulario.elements["cif"].value.length>=1){
			
			var pares = 0; 
	        var impares = 0; 
	        var suma; 
	        var ultima; 
	        var unumero; 
	        var uletra = new Array("J", "A", "B", "C", "D", "E", "F", "G", "H", "I"); 
	        var xxx; 
	        texto=sFormulario.elements["cif"].value;
	        texto = texto.toUpperCase(); 
	         
	        var regular = new RegExp(/^[ABCDEFGHKLMNPQS]\d\d\d\d\d\d\d[0-9,A-J]$/g); 
	         if (!regular.exec(texto)){
			 	// alert("El CIF es incorrecto")
				// sFormulario.elements["cif"].focus();
				 // return false; 
				 bCif=false;
			  }
	              
	         ultima = texto.substr(8,1); 
	
	         for (var cont = 1 ; cont < 7 ; cont ++){ 
	             xxx = (2 * parseInt(texto.substr(cont++,1))).toString() + "0"; 
	             impares += parseInt(xxx.substr(0,1)) + parseInt(xxx.substr(1,1)); 
	             pares += parseInt(texto.substr(cont,1)); 
	         } 
	         xxx = (2 * parseInt(texto.substr(cont,1))).toString() + "0"; 
	         impares += parseInt(xxx.substr(0,1)) + parseInt(xxx.substr(1,1)); 
	          
	         suma = (pares + impares).toString(); 
	         unumero = parseInt(suma.substr(suma.length - 1, 1)); 
	         unumero = (10 - unumero).toString(); 
	         if(unumero == 10) unumero = 0; 
	          
	         if ((ultima == unumero) || (ultima == uletra[unumero])){ 
	             //cif incorrecto
				 }
	         else {
				// alert("El CIF es incorrecto")
				// sFormulario.elements["cif"].focus();
	            // return false; 
				bCif=false;
				}
		}
		dni=sFormulario.elements["cif"].value;
		dni = dni.toUpperCase(); 
	 	numero = dni.substr(0,dni.length-1);
	  	let = dni.substr(dni.length-1,1);
	  	numero = numero % 23;
	  	letra='TRWAGMYFPDXBNJZSQVHLCKET';
	  	letra=letra.substring(numero,numero+1);
	  if (letra!=let) {
	  	bDNI=false;
		}
		if (bDNI==false && bCif==false){
			alert("El CIF/DNI es incorrecto. Escriba SOLO LETRAS Y NUMEROS. Sin puntos, guiones ni espacios.")
		 	sFormulario.elements["cif"].focus();
          	 return false;
		}
		
		
		if (sFormulario.elements["acepto"].checked==false){
			alert("Debe aceptar las CONDICIONES DE USO Y POLITICA DE PRIVACIDAD para continuar.");
			sFormulario.elements["acepto"].focus();
			return false;
		}
	}
	if (tipoForm=="altaEmpresa2"){
		if (sFormulario.elements["movil"].value.length!=9 && sFormulario.elements["movil"].value.length!=0){
			alert("El MOVIL debe tener 9 NUMEROS");
			sFormulario.elements["movil"].focus();
			return false;
		}
		if (sFormulario.elements["email"].value!=sFormulario.elements["emailRepetir"].value){
			alert("No coinciden los EMAILS");
			sFormulario.elements["email"].focus();
			return false;
		}
	}
	
	if (tipoForm=="altaEmpresa3" || tipoForm=="modificarEmpresa"){
		if (navigator.appVersion.indexOf("MSIE 6.0")==-1){
			var sCampo;
			var checkOK = "0123456789-" + "ABCDEFGHIJKLMNÑOPQRSTUVWXYZ" + "abcdefghijklmnñopqrstuvwxyz";
		 	var checkStr = sFormulario.elements["subdominio"].value;
		  	var allValid = true; 
		   for (i = 0; i < checkStr.length; i++) {
		    ch = checkStr.charAt(i); 
		    for (j = 0; j < checkOK.length; j++)
		      if (ch == checkOK.charAt(j))
		        break;
		    if (j == checkOK.length) { 
		      allValid = false;
			  	sCampo="subdominio"
		      break; 
		    }
		  }
		  if (!allValid) { 
		    alert("Escriba solo letras (vocales sin acentuar) y numeros en el cammpo SUBDOMINIO."); 
		    sFormulario.elements[sCampo].focus(); 
		    return false; 
		  } 
	  }
	}
	
	
	
	//cancelacion de usuario
	if (tipoForm=="cancelacionUsuario"){
		if (sFormulario.elements["acepto"].checked == false){
			alert("Debes confirmar la ELIMINACION");
			return false;
		}
	}
	
	//cancelacion de usuario o validaci&oacute;n de usuarario autorizado para empresas
	if (tipoForm=="usuarioAutorizado" || tipoForm=="cancelacionUsuario" || tipoForm=="modificarContraUsuario"){
		if (tipoForm=="modificarContraUsuario"){
			if (sFormulario.elements["contraNueva2"].value!=sFormulario.elements["contraNueva1"].value){
				alert("No coinciden las CONTRASENAS");
				sFormulario.elements["contraNueva2"].focus();
				return false;
			}
		}
		else{
			if (sFormulario.elements["contrasena"].value!=sFormulario.elements["rcontrasena"].value){
				alert("No coinciden las CONTRASENAS");
				sFormulario.elements["contrasena"].focus();
				return false;
			}
		}
		
		var sCampo;
		var checkOK = "0123456789" + "ABCDEFGHIJKLMN&Ntilde;OPQRSTUVWXYZ" + "abcdefghijklmn&ntilde;opqrstuvwxyz";
	
	 	if (tipoForm=="modificarContraUsuario"){
			var checkStr = sFormulario.elements["contraNueva2"].value;
		}
		else{
			var checkStr = sFormulario.elements["contrasena"].value;
		}
	  	var allValid = true; 
	   for (i = 0; i < checkStr.length; i++) {
	    ch = checkStr.charAt(i); 
	    for (j = 0; j < checkOK.length; j++)
	      if (ch == checkOK.charAt(j))
	        break;
	    if (j == checkOK.length) { 
	      allValid = false;
		  	if (tipoForm=="modificarContraUsuario"){
				sCampo="contraNueva2"
			}
			else{
				sCampo="contrasena"
			}
		  
	      break; 
	    }
	  }
	  if (!allValid) { 
	    alert("Escriba solo letras (vocales sin acentuar) y numeros en los campos de CONTRASENA."); 
	    sFormulario.elements[sCampo].focus(); 
	    return false; 
	  } 
	}
	//Candidatos
	if (tipoForm=="altaCandidatos1"){
		if (sFormulario.elements["usuario"].value.length<4){
			alert("El CODIGO DE USUARIO debe ser de al menos 4 caracteres");
			sFormulario.elements["usuario"].focus();
			return false;
		}
		if (sFormulario.elements["usuario"].value == sFormulario.elements["contrasena"].value){
			alert("El USUARIO no puede ser igual que la CONTRASENA");
			sFormulario.elements["contrasena"].focus();
			return false;
		}
		if (sFormulario.elements["contrasena"].value.length<4){
			alert("La CONTRASENA debe ser de 4 caracteres como MINIMO");
			sFormulario.elements["contrasena"].focus();
			return false;
		}
		if (sFormulario.elements["contrasena"].value!=sFormulario.elements["rcontrasena"].value){
			alert("No coinciden las CONTRASENAS");
			sFormulario.elements["contrasena"].focus();
			return false;
		}
		
		if (sFormulario.elements["telefono1"].value.length!=9){
			alert("El campo TELEFONO MOVIL debe tener 9 DIGITOS.");
			sFormulario.elements["telefono1"].focus();
			return false;
		}
		if (sFormulario.elements["email"].value!=sFormulario.elements["emailRepetir"].value){
			alert("No coinciden los EMAILS");
			sFormulario.elements["email"].focus();
			return false;
		}
		
		var sCampo;
		var checkOK = "0123456789" + "ABCDEFGHIJKLMN&Ntilde;OPQRSTUVWXYZ" + "abcdefghijklmn&ntilde;opqrstuvwxyz";
		  //var checkStr = sFormulario.elements["subdominio"].value;
		  var checkStr1 = sFormulario.elements["usuario"].value;
		  var checkStr2 = sFormulario.elements["contrasena"].value;
		  var allValid = true; 
		   for (i = 0; i < checkStr1.length; i++) {
			ch = checkStr1.charAt(i); 
			for (j = 0; j < checkOK.length; j++)
			  if (ch == checkOK.charAt(j))
				break;
			if (j == checkOK.length) { 
			  allValid = false;
			  sCampo="usuario"
			  break; 
			}
		  }
		   for (i = 0; i < checkStr2.length; i++) {
			ch = checkStr2.charAt(i); 
			for (j = 0; j < checkOK.length; j++)
			  if (ch == checkOK.charAt(j))
				break;
			if (j == checkOK.length) { 
			  allValid = false;
			  sCampo="contrasena"
			  break; 
			}
		  }
		  if (!allValid) { 
			alert("Escriba SOLO LETRAS (las vocales sin acentuar) y NUMEROS en el campo \""+sCampo+"\"."); 
			sFormulario.elements[sCampo].focus(); 
			return false; 
		  }
		  if (sFormulario.elements["acepto"].checked==false){
			alert("Debe aceptar las CONDICIONES DE USO Y LA P0LITICA DE PRIVACIDAD para continuar.");
			sFormulario.elements["acepto"].focus();
			return false;
		}
		
	}
	if ((tipoForm=="altaCandidatos3") || (tipoForm=="modificaCandidatos")){
		for(i=0;i<sFormulario.elements["perfilesExperiencia"].options.length;i++){
			sFormulario.elements["perfilesExperiencia"].options[i].selected=true;
		}
		for(i=0;i<sFormulario.elements["idiomasTotal"].options.length;i++){
			sFormulario.elements["idiomasTotal"].options[i].selected=true;
		}
		if (sFormulario.elements["perfilesExperiencia"].options.length==0){
			alert("Es necesario elegir al menos 1 PERFIL PROFESIONAL es obligatorio");
			sFormulario.elements["experiencia"].focus();
			return false;
		}
		if (bEspecificar==true){
			if (sFormulario.elements["especificar1"].value==0){
				alert("El campo ESPECIFICAR es obligatorio");
				sFormulario.elements["especificar1"].focus();
				return false;
			}
			if (sFormulario.elements["centro1"].value==0){
				alert("El campo CENTRO es obligatorio");
				sFormulario.elements["centro1"].focus();
				return false;
			}
		}
		for (i=1;i<=4;i++)
		{
			if (sFormulario.elements["horas"+i].value.length>0){
				//alert(isNaN(sFormulario.elements["horas1"].value))
				if(isNaN(sFormulario.elements["horas"+i].value)){
					alert("El campo HORAS "+i+" debe ser un NUMERO");
					sFormulario.elements["horas"+i].focus();
					return false;
				}
			}
		}
	}
	
	if ((tipoForm=="altaCandidatos4") || (tipoForm=="modificaCandidatos")){
		if (sFormulario.elements["cambiar"].value!=1 && sFormulario.elements["cambiar"].value!=6)
			{if (sFormulario.elements["motivos"].value.length==0){
				alert("El campo MOTIVOS es obligatorio");
				sFormulario.elements["motivos"].focus();
				return false;
			}
		}
		bChecked=false;
		for(i = 1; i <= sFormulario.elements["contrato"].value; i++) {
			if(sFormulario.elements["contrato"+i].checked==true){
				bChecked=true;
			}
		}
		if (bChecked==false){
			alert("Es necesario elegir LOS TIPOS de contrato.");
			sFormulario.elements["contrato1"].focus();
			return false;
		}
		if (sFormulario.elements["telefonos"].checked==true && sFormulario.elements["email"].checked==true ){
			alert("Para que las empresas puedan contactar contigo, es necesario que muestres el EMAIL o los TELEFONOS en tu CV");
			sFormulario.elements["telefonos"].focus();
			return false;
		}
		var sCampo;
		var checkOK = "0123456789" + "ABCDEFGHIJKLMN&Ntilde;OPQRSTUVWXYZ" + "abcdefghijklmn&ntilde;opqrstuvwxyz";
		  var checkStr = sFormulario.elements["subdominio"].value;
		 // var checkStr1 = sFormulario.elements["usuario"].value;
		  //var checkStr2 = sFormulario.elements["contrasena"].value;
		  var allValid = true; 
		  for (i = 0; i < checkStr.length; i++) {
			ch = checkStr.charAt(i); 
			for (j = 0; j < checkOK.length; j++)
			  if (ch == checkOK.charAt(j))
				break;
			if (j == checkOK.length) { 
			  allValid = false;
			  sCampo="subdominio"
			  break; 
			}
		  }
		  if (!allValid) { 
			alert("Escriba SOLAMENTE LETRAS (las vocales sin acentuar) y NUMEROS en el campo \""+sCampo+"\"."); 
			sFormulario.elements[sCampo].focus(); 
			return false; 
		  } 
	}
	
	
	return true
}

function Aviso(tipoForm){
	if (document.forms[tipoForm].privacidad[0].checked)
	{
		alert('AVISO: las empresas cuando busquen candidatos NO PODRAN acceder a tu CV.')
	}
}
function AvisoT(tipoForm){
	if (document.forms[tipoForm].elements["telefonos"].checked)
	{
		alert('AVISO: el 95% de las empresas, SOLO se ponen en contacto con el candidato, si es a TRAVES DE UN TELEFONO, y rehusan el EMAIL.')
	}
}
	
function Comprobar(campo,empresa){
	var sCampo=document.getElementById(campo);
	if (sCampo.value==""){
		alert("Introduzca texto para REALIZAR LA COMPROBACION");
		sCampo.focus()
	}
	else{
		var win= null;
		var w=600;
		var h=105;
		var winl = (screen.width-w)/2;
		var wint = (screen.height-h)/2;
		settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=auto,resizable=yes'
		win=window.open("comprobarDuplicidad.asp?campo="+sCampo.value+"&tipo="+campo+"&empresa="+empresa,"comprobarDuplicidad",settings)
		if (win == null){
			alert("Tienes las pop-ups bloqueadas, debes permitirlas para poder realizar la comprobacion correctamente.")
		}
	}
}
		
/*Copiadas de modEmpresa*/
function SoloNum(){
	//Prop&oacute;sito:	Evitar que se escriban letras en los campos num&eacute;ricos.
	//Efectos:		Si se pulsa una tecla de texto no ocurrir&aacute; nada.
		if (event.keyCode!=13&&(event.keyCode<48||event.keyCode>57))
			event.keyCode=0;
	}

function CheckEmpresa(sLogo){
	sLogo=document.forms["frmModEmpre"].elements["archivo"].value;
	marcado=document.forms["frmModEmpre"].elements["mostrar"].checked
	//marcado=document.all.susDatos.checked
		if (marcado==false){
			document.forms["frmModEmpre"].elements["foto"].value=sLogo;
		}
		else{
			document.forms["frmModEmpre"].elements["foto"].value="";
		}
	}
	
function Upload(formulario,campo,directorio) {
		window.open("upload.asp?dir="+directorio+"&formulario="+formulario+"&campo="+campo,"upload","left=300,top=250,fullscreen=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width=420,height=195");
	}
function UploadJPEG(formulario,campo,directorio,resizeImg,resizeImgAncho) {
			window.open("uploadJPEG.asp?dir="+directorio+"&formulario="+formulario+"&campo="+campo+"&resizeImg="+resizeImg+"&resizeImgAncho="+resizeImgAncho+"","upload","left=300,top=250,fullscreen=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width=420,height=150");
		}
		
function cambioOtros(sFormulario){
		intActual4 = document.forms[sFormulario].elements["industria"].selectedIndex;
		intValorSel4 = document.forms[sFormulario].elements["industria"].options[intActual4].text;
		if (intValorSel4 != "Otros"){
			document.forms[sFormulario].elements["txtOtros"].value="";
			document.getElementById("otroTipo").innerHTML="&nbsp;&nbsp;<b>Otro Tipo de Industria:&nbsp;</b>";
			document.forms[sFormulario].elements["txtOtros"].disabled=true;
		}
		else{
			document.forms[sFormulario].elements["txtOtros"].disabled=false;
			document.getElementById("otroTipo").innerHTML="&nbsp;&nbsp;<b>Otro Tipo de Industria:</b><span class=naranja>*</span>";
			document.forms[sFormulario].elements["txtOtros"].focus();
		}
	}
	
	
/*Copiada de altacandi2*/
function cambioPaises(){
	intActual4 = document.getElementById("paises").selectedIndex;
	intValorSel4 = document.getElementById("paises").options[intActual4].text;
	if (intActual4 != 5){
		document.getElementById("provincias").selectedIndex=0;
		document.getElementById("provincias").disabled=true;
		document.getElementById("provincias").validationmsg="";
		document.all.asterisco.innerHTML="";
		bEspana=false;
	}
	else{
		//alert(intValorSel4)
		document.getElementById("provincias").disabled=false;
		document.getElementById("provincias").validationmsg="El campo PROVINCIA es obligatorio";
		document.all.asterisco.innerHTML="*";
		bEspana=true;
	}
}

function cambioProvincias(){
	intActual6 = document.getElementById("provincias").selectedIndex;
	intValorSel6 = document.getElementById("provincias").options[intActual6].text;
	if (intActual6 != 0){
		//document.forms["frmAltaCandi"].elements["paises"].selectedIndex="Espa&ntilde;a";
	}
}	

function cambioPerfil(idSector,tamano){
	//alert(tamano)
	 for (i = 1; i <= tamano; i++) {
	 	document.getElementById("divPerfiles"+i).style.visibility="hidden";
		document.getElementById("divPerfiles"+i).style.display="none";
		document.getElementById("idPerfiles"+i).name="perfilesOculto";
	 }
	if (idSector!=0){
		document.getElementById("divPerfiles"+idSector).style.visibility="visible";
		document.getElementById("divPerfiles"+idSector).style.display="inline";
		document.getElementById("idPerfiles"+idSector).name="perfiles";
	}
}

var bEspecificar=false;
function CambioNivel(nombreForm){
	if (document.forms[nombreForm].elements["nivelEstudios1"].value<=2){
		document.all.asterisco.innerHTML="";
		document.all.asterisco1.innerHTML="";
		bEspecificar=false;
	}
	else{
		document.all.asterisco.innerHTML="<span class='naranja'>*</span>";
		document.all.asterisco1.innerHTML="<span class='naranja'>*</span>";
		bEspecificar=true;
	}
}
	
function cambiaMotivos(){
		var sFormulario=document.forms["frmAltaCandi"];
		if (sFormulario.elements["cambiar"].value!=1>0 && sFormulario.elements["cambiar"].value!=1 && sFormulario.elements["cambiar"].value!=6)
			{
				document.getElementById("motivos").style.visibility='visible'
				document.getElementById("objetivos").style.visibility='visible'
			}else{
				document.getElementById("motivos").style.visibility='hidden'
				document.getElementById("objetivos").style.visibility='hidden'
			}
		
	}
function ValidoSMS(formulario){
		//ValidoFormulario(formulario)
		var sFormulario=document.forms[formulario];
		//alert(sFormulario.elements["servicio"][0].checked)
		//if (sFormulario.elements["servicio"][0].checked)
		//{
			if (sFormulario.elements["claveSms"].value.length!=4){
				alert("El CODIGO SMS no es correcto");
				sFormulario.elements["claveSms"].focus();
				return false;
			}
		//}
	}
function AbrirActiva() {
	var win= null;
	var w=320;
	var h=260;
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=auto,resizable=yes'
	win=window.open('activa.html','activa',settings)
}
	
	
/*Copiada de verInscripcionesCandi.asp */
function envia(que,id){
	if (que.length !=4){
		alert("El CODIGO no es correcto")
	}
	else{
	document.frmBusca.sms.value = que
	document.frmBusca.id.value = id
	frmBusca.submit()
	}

}
/*Copiada de alertas*/
	var Contenido;
	function CargaContenido(){
		Contenido=document.getElementById("espana").innerHTML;
	}
	/*Copiada de verAlertas.asp (cambiamos el nombre)*/
	function CargaContenido2(){
		Contenido=document.getElementById("espana").innerHTML;
		cambioPaises();
	}


/*Copiada de verAlertaEmail cambio nombre*/
	function eliminarAlerta(idAlerta) {
		if (confirm("ESTAS SEGURO de que deseas ELIMINAR esta ALERTA?")) {
			document.location.href="alertaEmailEliminar.asp?idAlerta="+idAlerta;
		}
	}
	
/*Login*/
function ValidoRegistro(){
	if (document.forms["frmRegistro"].elements["usuario"].value.length<3 || document.forms["frmRegistro"].elements["contrasena"].value.length<3){
		alert("Debe introducir al menos 3 caracteres para el Usuario y la Contrasena.");
		document.forms["frmRegistro"].elements["usuario"].focus();
		return false;
	}
	if (document.forms["frmRegistro"].elements["usuario"].value=="usuario") {
			alert("Debe escribir su nombre de Usuario.");
			document.forms["frmRegistro"].elements["usuario"].focus();
			return false;
		}
	else
		return true;
}
function BorrarRegistro(campo){
	document.forms["frmRegistro"].elements[campo].value="";
}
function ValidoRegistroCabecera(){
	if (document.forms["frmRegistroCabecera"].elements["usuarioCabecera"].value.length<3 || document.forms["frmRegistroCabecera"].elements["contrasenaCabecera"].value.length<3){
		alert("Debe introducir al menos 3 caracteres para el Usuario y la Contrasena.");
		document.forms["frmRegistroCabecera"].elements["usuarioCabecera"].focus();
		return false;
	}
	if (document.forms["frmRegistroCabecera"].elements["usuarioCabecera"].value=="usuario") {
			alert("Debe escribir su nombre de Usuario.");
			document.forms["frmRegistroCabecera"].elements["usuarioCabecera"].focus();
			return false;
		}
	else
		return true;
}
function BorrarRegistroCabecera(campo){
	document.forms["frmRegistroCabecera"].elements[campo].value="";
}

function BorrarBoletin(campo){
	document.forms["frmBoletines"].elements[campo].value="";
}



function Upload(formulario,campo,directorio) {
	window.open("upload.asp?dir="+directorio+"&formulario="+formulario+"&campo="+campo,"upload","left=300,top=250,fullscreen=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width=420,height=195");
}

function Texto(tit,num){
		document.getElementById("titulo").innerHTML=tit;			
	//	alert(num)
		switch (num) {
		   case "1" :
		      txt="Secci&oacute;n en donde se pueden modificar los datos de la empresa.";
			  break;
		   case "2" :
		      txt="Secci&oacute;n de b&uacute;squeda y consulta de las activaciones realizadas por parte de la empresa.";
			   break;
		  case "3" :
		      txt="Secci&oacute;n de consulta de los pedidos realizados por la empresa y las facturas asociadas.";
			  break;
		   case "4" :
		      txt="Secci&oacute;n en donde se meten ofertas relacionadas con la empresa.";
			   break;
		   case "5" :
		      txt="Secci&oacute;n en donde se pueden realizar b&uacute;squedas avanzadas de demandantes de empleo.";
			  break;
		   case "6" :
		      txt="Secci&oacute;n que permite comprar Bonos de C&oacute;digos de Activaci&oacute;n para la consulta de CV.";
			   break;
		 case "7" :
		      txt="Secci&oacute;n en donde se pueden almacenar demandantes de empleo que interesan a la empresa.";
			  break;
		   case "8" :
		      txt="Secci&oacute;n en donde se gestionan las ofertas introducidas por la empresa y los candidatos inscritos.";
			   break;
			 case "9" :
		      txt="Secci&oacute;n en donde se gestionan los Planes de Selecci&oacute;n de Personal asociados a la empresa. ";
			   break;
			 case "10" :
		      txt="Secci&oacute;n en donde se gestiona el Anuncio Personalizado en Google con Enlace a su MicroWeb de Empresa de Empleo.NET con todas sus ofertas.";
			   break;
		default  :
     		 txt="";

		} 
		document.getElementById("texto").innerHTML=txt;
	}
	

function Cesta(){
		nBono10=document.getElementById("Bono10").value;
		nBono25=document.getElementById("Bono25").value;
		nBono50=document.getElementById("Bono50").value;
		nBono150=document.getElementById("Bono150").value;
		nBono500=document.getElementById("Bono500").value;
		nBono1000=document.getElementById("Bono1000").value;
		for (i=0;i<nBono10;i++){
			Anadir(10,8.00)
		}
		for (i=0;i<nBono25;i++){
			Anadir(25,18.75)
		}
		for (i=0;i<nBono50;i++){
			Anadir(50,35.00)
		}
		for (i=0;i<nBono150;i++){
			Anadir(150,97.50)
		}
		for (i=0;i<nBono500;i++){
			Anadir(500,300.00)
		}
		for (i=0;i<nBono1000;i++){
			Anadir(1000,500.00)
		}
		document.getElementById("Bono10").value=nBono10;
		document.getElementById("Bono25").value=nBono25;
		document.getElementById("Bono50").value=nBono50;
		document.getElementById("Bono150").value=nBono150;
		document.getElementById("Bono500").value=nBono500;
		document.getElementById("Bono1000").value=nBono1000;
		
	}
	function Seguridad() {
			var win= null;
			var w=800;
			var h=570;
			var winl = (screen.width-w)/2;
			var wint = (screen.height-h)/2;
			settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=auto,resizable=yes'
			win=window.open("seguridad.asp","politica",settings)
		}
function selloDigital() {
			var win= null;
			var w=800;
			var h=570;
			var winl = (screen.width-w)/2;
			var wint = (screen.height-h)/2;
			settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=auto,resizable=yes'
			win=window.open("selloDigital.asp","sello",settings)
		}
function Pago(tipo,privado){
		document.forms["frmPedido"].action="pago.asp?menuPrivado="+privado+"&tipo="+tipo;
	}

	function Factura(sCod){
		var win= null;
		var w=790;
		var h=500;
		var winl = (screen.width-w-10)/2;
		var wint = (screen.height-h)/2;
		//window.open('ejemplo.html')
		window.open('factura.asp?cod='+sCod,'factura','width='+w+',height='+h+',top='+wint+',left='+winl+',menubar=no,status=yes,toolbar=no,scrollbars=yes,resizable=yes')
	}

	
// variable global a la que se puede acceder desde Javascript
var fecha_correcta = "";

	function isDateString(stringValue) {


		// this function is designed to mimic the "date" portion of the
		// VBScript IsDate() function, allowing dates to be validated
		// with JavaScript in browsers before you run into a problem
		// in ASP pages with date database columns or the VBScript
		// CDate() function; an exception is that string months
		// ("Jan," etc.) are not accepted
		
		// this function does not handle BC dates or dates past 12/31/9999
		
		// you obviously want to strip the comments from production scripts
		
		// create a String object
		var theString = new String(stringValue);
		
		// determine the delimiter character (must be "/" "-" or space)
		var delimiterCharacter
		if ( theString.indexOf('/') > 0 )
			delimiterCharacter = '/';
		else
			if ( theString.indexOf('-') > 0 )
				delimiterCharacter = '-';
			else
				if ( theString.indexOf(' ') > 0 )
					delimiterCharacter = ' ';
				else
					return false;
					
		// split the string into an array of tokens
		var theTokens = theString.split(delimiterCharacter);
		
		// there must be either two or three tokens
		if ( theTokens.length < 2 || theTokens.length > 3 )
			return false;
		
		// convert the tokens to String objects, which will be needed later,
		// stripping a single leading 0
		var tokenIndex, fecha, ano;
		for ( tokenIndex = 0; tokenIndex < theTokens.length; tokenIndex++ ) {
			theTokens[tokenIndex] = new String(theTokens[tokenIndex])			
			if ( theTokens[tokenIndex].charAt(0) == '0' )
				theTokens[tokenIndex] = theTokens[tokenIndex].substring(1, theTokens[tokenIndex].length);
		}

		// si el 3.er token existe es el a&ntilde;o y si est&aacute; en formato de 2 d&iacute;gitos (aa) se
		// convierte a 4 d&iacute;g. (aaaa)
		if ( theTokens.length > 2 )
		{
			ano = parseInt(theTokens[2]);
			
			if ( ano < 100 )
			{
				ano = 1900 + parseInt(theTokens[2]);
				theTokens[2] = ano.toString();
			}
		}
		else
		{
			fecha = new Date();
			theTokens[2] = fecha.getFullYear().toString();
		}
		
		// all of the tokens must be positive integers
		for ( tokenIndex = 0; tokenIndex < theTokens.length; tokenIndex++ ) {
			if ( ! isNonnegativeInteger(theTokens[tokenIndex]) )
				return false;
		}
		
		// we need to identify the year, month, and day tokens
		var numericValue;
		var yearTokenIndex = -1;
		var monthTokenIndex = -1;
		var dayTokenIndex = -1;
		for ( tokenIndex = 0; tokenIndex < theTokens.length; tokenIndex++ ) {
					
			// convert the value
			numericValue = parseInt(theTokens[tokenIndex], 10);
					
			// could this token be a month?
			if ( numericValue <= 12 ) {
					
				// yes; do we already have a month?
				if ( monthTokenIndex == -1 ) {
						
					// no; assign this token to the month and continue
					monthTokenIndex = tokenIndex;
					continue;
				}
				else {
							
					// we already have a month; this token could
					// also be the day; do we already have a day?
					if ( dayTokenIndex == -1 ) {
						
						// no; assign this token to the day and continue
						dayTokenIndex = tokenIndex;
						continue;
					}
					else {
							
						// we already have a day; this token could
						// also be the year; do we alreay have a year?
						if ( yearTokenIndex == -1 ) {
						
							// no; assign this token to the year and continue
							dayTokenIndex = tokenIndex;
							continue;
						}
					}
				}
			}
			else {
						
				// the value is too large for a month;
				// could this token be a day?
				if ( numericValue <= 31 ) {
						
					// yes; do we already have a day?
					if ( dayTokenIndex == -1 ) {
						
						// no; assign this token to the day and continue
						dayTokenIndex = tokenIndex;
						continue;
					}
					else {
							
						// we already have a day; this token could
						// also be the year; do we alreay have a year?
						if ( yearTokenIndex == -1 ) {
						
							// no; assign this token to the year and continue
							dayTokenIndex = tokenIndex;
							continue;
						}
					}
				}
				else {
						
					// the value is too large for a day;
					// could this token be a year?
					if ( numericValue <= 9999 ) {
					
						// yes; do we already have a year?
						if ( yearTokenIndex == -1 ) {
						
							// no; assign this token to the year
							yearTokenIndex = tokenIndex;
						}
					}
				}
			}
		}	// end of for loop
		
		// evaluate, based on the number of tokens
		if ( theTokens.length == 2 ) {
			
			// two tokens can be either a month/year combination or a month/day
			// combination with the current year assumed; either way, we must have
			// a month
			if ( monthTokenIndex == -1 )
				
				// no month
				return false;
				
			// do we have a year?
			if ( ! (yearTokenIndex == -1) ) {
			
				// yes; month/year combination; must be okay
				fecha_correcta = theTokens[0] + "-" + theTokens[1] + "-" + theTokens[2];
				return true;
			}
			else
				
				// no year; do we have a day?
				if ( ! (dayTokenIndex == -1) ) {
				
					// yes; month/day combination; get the current year
					var today = new Date();
					var currentYear = today.getYear();

					// make sure it's a valid date (we were testing days using
					// 31, and that might be too many for the month)
					return isDate(currentYear, theTokens[monthTokenIndex], theTokens[dayTokenIndex]);
				}
				else
				
					// we have neither a year nor a day
					return false;
		}
		else {
			
			// three tokens; we should have found tokens for year, month, and day
			if ( yearTokenIndex == -1 || monthTokenIndex == -1 || dayTokenIndex == -1 )
				
				// missing one or more
				return false;
			else
				
				// found all; however, VBScript can only handle the following sequences
				if ( monthTokenIndex == 0 ) {
				
					// must be m/d/y
					if ( dayTokenIndex != 1 || yearTokenIndex != 2)
						return false;
				}
				else
					if ( dayTokenIndex == 0 ) {
				
						// must be d/m/y
						if ( monthTokenIndex != 1 || yearTokenIndex != 2)
							return false;
					}
					else
						if ( yearTokenIndex == 0 ) {
				
							// must be y/m/d
							if ( monthTokenIndex != 1 || dayTokenIndex != 2)
								return false;
						}
						else
						
							// something is wrong
							return false;
				
				// make sure it's a valid date (we were testing days using a value
				// of 31, and that might be too many for the actual month)
				fecha_correcta = theTokens[0] + "/" + theTokens[1] + "/" + theTokens[2];
				return isDate(theTokens[yearTokenIndex], theTokens[monthTokenIndex], theTokens[dayTokenIndex]);
		}
	}

	function isTimeString(stringValue) {

		// this function is designed to mimic the "time" portion of the
		// VBScript IsDate() function, allowing times to be validated
		// with JavaScript in browsers before you run into a problem
		// in ASP pages with date database columns or the VBScript
		// CDate() function
		
		// you obviously want to strip the comments from production scripts
		// and place this function in the library file

		// create a String object
		var theString = new String(stringValue);
		
		// the string must have either two (hours and minutes) or three
		// (hours, minutes and seconds) tokens, delimited by ":";
		// split the string into an array of tokens
		var theTokens = theString.split(':');
		if ( theTokens.length < 2 || theTokens.length > 3 )
			return false;
		
		// convert the tokens to String objects, which will be needed later,
		// stripping whitespace
		var firstToken = new String(theTokens[0])
		firstToken = trim(firstToken);
		var middleToken;
		if ( theTokens.length == 3 ) {
			middleToken = new String(theTokens[1])
			middleToken = trim(middleToken);
		}
		var lastToken = new String(theTokens[theTokens.length - 1])
		lastToken = trim(lastToken);

		// the first token (hours) must be an integer between 0 and 23
		if ( ! isInteger(firstToken) )
			return false;
		if ( ! isIntegerInRange(firstToken, 0, 23) )
			return false;
		
		// are there three tokens?
		if ( theTokens.length == 3 ){
		
			// the middle token (minutes) must be an integer between 0 and 59
			if ( ! isInteger(middleToken) )
				return false;
			if ( ! isIntegerInRange(middleToken, 0, 59) )
				return false;
		}
			
		// the first one or two characters of the last token (either minutes
		// and optional am/pm indicator or seconds and am/pm indicator) must
		// be digits
		if ( ! isDigit(lastToken.charAt(0)) )
			return false;
		
		// the first character is a digit; split the last token into the minutes
		// or seconds value and the indicator; depending on the second character
		var lastValue;
		var ampmIndicator;
		if ( isDigit(lastToken.charAt(1)) ) {
			lastValue = new String(lastToken.substring(0, 2));
			if ( lastToken.length >= 3 )
				ampmIndicator = new String(trim(lastToken.substring(2, lastToken.length)));
			else
				ampmIndicator = new String();
		}
		else {
			lastValue = new String(lastToken.substring(0, 1));
			if ( lastToken.length >= 2 )
				ampmIndicator = new String(trim(lastToken.substring(1, lastToken.length)));
			else
				ampmIndicator = new String();
		}
		ampmIndicator = ampmIndicator.toUpperCase();
		
		// the last value must be between 0 and 59
		if ( ! isIntegerInRange(lastValue, 0, 59) )
			return false;
		
		// check the am/pm indicator, if there is one
		if ( ampmIndicator.length > 0 )
			if ( ! ( ampmIndicator == "AM" || ampmIndicator == "PM" ) )
				return false;
				
		// valid time
		return true;
	}

	// most of the following was derived from Netscape's FormChek.js
	// library, which should be reviewed for documentation and comments

	var daysInMonth = makeArray(12);
	daysInMonth[1] = 31;
	daysInMonth[2] = 29;
	daysInMonth[3] = 31;
	daysInMonth[4] = 30;
	daysInMonth[5] = 31;
	daysInMonth[6] = 30;
	daysInMonth[7] = 31;
	daysInMonth[8] = 31;
	daysInMonth[9] = 30;
	daysInMonth[10] = 31;
	daysInMonth[11] = 30;
	daysInMonth[12] = 31;

	var whitespace = " \t\n\r";

	function charInString(c, s) {
		for (i = 0; i < s.length; i++) {
			if (s.charAt(i) == c)
				return true;
	    }
	    return false
	}

	function daysInFebruary(year) {
	    return ( ((year % 4 == 0) && ((!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
	}

	function isDate(year, month, day) {
	    if ( ! ( isYear(year) && isMonth(month) && isDay(day) ) ) return false;
	    var intYear = parseInt(year);
	    var intMonth = parseInt(month);
	    var intDay = parseInt(day);
	    if ( intDay > daysInMonth[intMonth] ) return false; 
	    if ( ( intMonth == 2 ) && ( intDay > daysInFebruary(intYear) ) ) return false;
	    return true;
	}

	function isDay(s) {
	    return isIntegerInRange(s, 1, 31);
	}

	function isDigit(c) {
		return ( ( c >= "0" ) && ( c <= "9" ) )
	}

	function isInteger(s) {
		var i;
	    for ( i = 0; i < s.length; i++ )
	    {   
	        var c = s.charAt(i);
	        if ( ! isDigit(c) ) return false;
	    }
	    return true;
	}

	function isIntegerInRange(s, a, b) {
	    if ( ! isInteger(s) ) return false;
	    var num = parseInt (s);
	    return ( ( num >= a ) && ( num <= b ) );
	}

	function isMonth(s) {
	    return isIntegerInRange (s, 1, 12);
	}

	function isNonnegativeInteger(s) {
	    return ( isSignedInteger(s) && ( parseInt(s) >= 0 ) );
	}

	function isSignedInteger(s) {
	    var startPos = 0;
	    if ( ( s.charAt(0) == "-" ) || ( s.charAt(0) == "+" ) )
	       startPos = 1;    
	    return ( isInteger(s.substring(startPos, s.length)) )
	}

	function isYear(s) {
		if ( ! isNonnegativeInteger(s) ) return false;
	    return ( (s.length == 2) || (s.length == 4) );
	}

	function lTrim(s) {
		var i = 0;
	    while ( (i < s.length) && charInString(s.charAt(i), whitespace) )
	       i++;
	    return s.substring(i, s.length);
	}

	function makeArray(n) {
	   for ( var i = 1; i <= n; i++ ) {
	      this[i] = 0
	   } 
	   return this
	}

	function rTrim(s) {
		var i = 0;
	    while ( (i < s.length) && charInString(s.charAt(i), whitespace) )
	       i++;
	    return s.substring(i, s.length);
	}

	function trim(s) {
		return lTrim(rTrim(s));
	}
	function FechaBuena(parametro,formulario)
	// valida la fecha que est&aacute; en el INPUT o elemento del formulario pasado como par&aacute;metro
	{
		if(document.forms(formulario).elements(parametro).value!="")
		{
			if (isDateString(document.forms(formulario).elements(parametro).value)==false)
			{
				alert("Fecha incorrecta. Debe ser de la forma dd/mm/aaaa");
				document.forms(formulario).elements(parametro).focus();
			}
			else
			{
				document.forms(formulario).elements(parametro).value = fecha_correcta;
			}
		}
	}

function marcar(pestana,pestanaOfertas,ruta){
	if (ruta)
		{ruta=ruta}
	else
		{ruta=""}
	//alert (ruta)
    document.getElementById(pestana).className = "menuOn";
	if(pestana!="homeEnlace"){
		document.getElementById("imgHome").src=ruta+"graficos/homeOff.gif";
		document.getElementById("homeEnlace").style.background="url("+ruta+"graficos/pestanaOff25.png) no-repeat";
		bHome=false;
	}
	else{
		document.getElementById('homeEnlace').style.background='url('+ruta+'graficos/pestanaOn25.png) no-repeat';
		document.getElementById("imgHome").src=ruta+"graficos/homeOn.gif";
	}
	if (pestanaOfertas){
		document.getElementById(pestanaOfertas).className = "menuOn";
	}
 }

	sortitems = 1;  // Automatically sort items within lists? (1 or 0)
		function move(fbox,tbox) {
			//alert(tbox.name)
			//alert(fbox.name)
			
			if (tbox.name == "perfilesExperiencia"){
				var contador = 0 
				for(var i=0; i<fbox.options.length; i++) {
					if(fbox.options[i].selected && fbox.options[i].value != "") {									
					contador++
					}
				}
				
				if( tbox.options.length + contador > 10){
					alert("SOLO se pueden introducir hasta 10 PERFILES")
					return
				}
						
			}
			var haySelec = 0 //si hay alguno seleccionado
			var sFormu = fbox.form
			var contador = 0
			
			//la experiencia es obligatoria para los perfiles
			if (fbox.name == "perfiles"){
				if(sFormu.experiencia.options[sFormu.experiencia.selectedIndex].value==0){
					alert("Debes seleccionar la experiencia")
					return false
				
				}
			}
			if (fbox.name == "idiomas"){
				if(sFormu.escrito.selectedIndex==0){
					alert("Debes seleccionar el nivel escrito")
					sFormu.escrito.focus()
					return false
				}
				if(sFormu.hablado.selectedIndex==0){
					alert("Debes seleccionar el nivel hablado")
					sFormu.hablado.focus()
					return false
				}
			}
			for(var i=0; i<fbox.options.length; i++) {
			if(fbox.options[i].selected && fbox.options[i].value != "") {
				var no = new Option();
				haySelec = 1
				no.value = fbox.options[i].value;
				no.text = fbox.options[i].text;
					//mostramos tambien el texto de escrito y hablado, en caso de a&ntilde;adir
					if (fbox.name == "idiomas"){
						no.value += "-"+sFormu.escrito.options[sFormu.escrito.selectedIndex].value+"-"+sFormu.hablado.options[sFormu.hablado.selectedIndex].value
						no.text +=  "("+sFormu.escrito.options[sFormu.escrito.selectedIndex].text+","+sFormu.hablado.options[sFormu.hablado.selectedIndex].text+")"
					}							
					else if (fbox.name == "perfiles"){//si es para la caja de perfiles seleccionados mostramos la experiencia
						no.value += "-"+sFormu.experiencia.options[sFormu.experiencia.selectedIndex].value
						no.text +=  "("+sFormu.experiencia.options[sFormu.experiencia.selectedIndex].text+")"
					}							
					else{
						//se quita, en funcion del primer parentesis.
						no.text = no.text.substring(0,no.text.indexOf("("))
						no.value =no.value.substring(0,no.value.indexOf("-"))
					}

				tbox.options[tbox.options.length] = no;
				fbox.options[i].value = "";
				fbox.options[i].text = "";

					
			   }
			}		

			

			if (fbox.name == "idiomasTotal" || fbox.name == "idiomas"){
			 	literalTipo = " idioma"
				
			}							
			else if (fbox.name == "perfilesExperiencia" || fbox.name =="perfiles"){
			 	literalTipo = " perfil"
			}
			else{
			}
			if (!haySelec) alert("Debes SELECCIONAR ALGUN "+literalTipo)				
			
		BumpUp(fbox);
		if (sortitems) SortD(tbox);
		}
		function BumpUp(box)  {
			for(var i=0; i<box.options.length; i++) {
				if(box.options[i].value == "")  {
				for(var j=i; j<box.options.length-1; j++)  {
				box.options[j].value = box.options[j+1].value;
				box.options[j].text = box.options[j+1].text;
				box.options[j+1].text
				
			}
		var ln = i;
		break;
		   }
		}
		if(ln < box.options.length)  {
			box.options.length -= 1;
			BumpUp(box);
		   }
		}
		
		function SortD(box)  {
			var sFormu = box.form
			var temp_opts = new Array();
			var temp = new Object();
			for(var i=0; i<box.options.length; i++)  {
			temp_opts[i] = box.options[i];
			}

			for(var x=0; x<temp_opts.length-1; x++)  {
		     for(var y=(x+1); y<temp_opts.length; y++)  {
				if(temp_opts[x].text > temp_opts[y].text)  {
					
					temp = temp_opts[x].text;
					temp_opts[x].text = temp_opts[y].text;
					temp_opts[y].text = temp;
					temp = temp_opts[x].value;
					temp_opts[x].value = temp_opts[y].value;
					temp_opts[y].value = temp;

					
			  	}
	          }
			}

			for(var i=0; i<box.options.length; i++)  {
				box.options[i].value = temp_opts[i].value;
				
					box.options[i].text = temp_opts[i].text

			   }

					if (box.name == "idiomasTotal" || box.name == "idiomas"){
					 	idiomaSel(sFormu)	   
						
					}							
					else if (box.name == "perfilesExperiencia" || box.name =="perfiles"){
						perfilSel(sFormu)
					}
					else{
					}
					
		}

	function perfilSel(sFormu){

			document.getElementById("perfilSel").innerHTML= sFormu.perfilesExperiencia.options.length
	
	}

	function idiomaSel(sFormu){

			document.getElementById("idiomaSel").innerHTML= sFormu.idiomasTotal.options.length
	
	}
	function AjaxGenerica(){
			/* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por
			lo que se puede copiar tal como esta aqui */
			var xmlhttp=false; 
			try 
			{ 
				// Creacion del objeto AJAX para navegadores no IE
				xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
			}
			catch(e)
			{ 
				try
				{ 
					// Creacion del objet AJAX para IE 
					xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
				} 
				catch(E) { xmlhttp=false; }
			}
			if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); } 
			return xmlhttp; 
		}
		
		function AjaxSectores(sector){
			if (sector){
				// Obtendo la capa donde se muestran las respuestas del servidor
				var capa=document.getElementById("resultadoPerfiles");
				// Creo el objeto AJAX
				var ajax=AjaxGenerica();
				// Coloco el mensaje "Cargando..." en la capa
				capa.innerHTML="Cargando perfiles...";
				// Abro la conexión, envío cabeceras correspondientes al uso de POST y envío los datos con el método send del objeto AJAX
				ajax.open("POST", "consultaPerfiles.asp", true);
				ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				ajax.send("idSector="+sector);
				//'campo1='+document.getElementById('campo1').value+'&campo2='+document.getElementById('campo2').value
				//ajax.send("composicion="+document.getElementById("composicion").value);
				ajax.onreadystatechange=function()
				{
					
					if (ajax.readyState==4)
					{
						// Respuesta recibida. Coloco el texto plano en la capa correspondiente
						capa.innerHTML=ajax.responseText;
						//alert(ajax.responseText)
						//capa.innerHTML="<option>Opcion2</option>"; 
					}
				}
			}
		}
		function AjaxSectoresOferta(sector){
			if (sector){
				// Obtendo la capa donde se muestran las respuestas del servidor
				var capa=document.getElementById("resultadoPerfiles");
				// Creo el objeto AJAX
				var ajax=AjaxGenerica();
				// Coloco el mensaje "Cargando..." en la capa
				capa.innerHTML="Cargando perfiles...";
				// Abro la conexión, envío cabeceras correspondientes al uso de POST y envío los datos con el método send del objeto AJAX
				ajax.open("POST", "consultaPerfilesOferta.asp", true);
				ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				ajax.send("idSector="+sector);
				//'campo1='+document.getElementById('campo1').value+'&campo2='+document.getElementById('campo2').value
				//ajax.send("composicion="+document.getElementById("composicion").value);
				ajax.onreadystatechange=function()
				{
					
					if (ajax.readyState==4)
					{
						// Respuesta recibida. Coloco el texto plano en la capa correspondiente
						capa.innerHTML=ajax.responseText;
						//alert(ajax.responseText)
						//capa.innerHTML="<option>Opcion2</option>"; 
					}
				}
			}
		}
		
		function ValidoAlerta(NombreForm,sms){
		bPerfil=false;
		bProvincia=false;
		CambiaComillaPegado(NombreForm);
		var sFormulario=document.forms[NombreForm];
		if (sFormulario.elements["nombre"].value.length==0){
			alert("El campo Nombre de la alerta es obligatorio");
			sFormulario.elements["nombre"].focus();
			return false;
		}
		intActual4 = document.forms["frmAlerta"].elements["paises"].selectedIndex;
		intValorSel4 = document.forms["frmAlerta"].elements["paises"].options[intActual4].text;
		if (intActual4  != 5){
		
			for (i=1;i<=document.getElementById("provincia").value;i++)
			{
				//alert(document.getElementById("provincia").value)
				if (document.getElementById("provincia"+i).checked){
					bProvincia=true;
				}
				else{
					if (bProvincia==false){
						bProvincia=false;
					}
				}
			}
			if (bProvincia==false){
				alert("Es obligatorio elegir al menos una provincia");
				sFormulario.elements["provincia1"].focus();
				return false;
			}	
		
		}
		
		for (i=1;i<=document.getElementById("perfil").value;i++)
		{
			if (document.getElementById("perfil"+i).checked){
				bPerfil=true;
			}
			else{
				if (bPerfil==false){
					bPerfil=false;
				}
			}
		}

		if (bPerfil==false){
			alert("Es obligatorio elegir al menos un perfil");
			sFormulario.elements["perfil1"].focus();
			return false;
		}	
		//alert(sms)
		if (sms=="SMS"){
			// validaciones SMS
			if (sFormulario.elements["sms"].value.length!=4){
				alert("El CODIGO SMS no es correcto");
				sFormulario.elements["sms"].focus();
				return false;
			}
		}
	}
	
	function Check(tipo){
		if (tipo=="P"){
			iNumero=document.getElementById("provincia").value;
			marcadoF=document.getElementById("todasProvincias").checked;
			sCampo="provincia";
		}
		else
		{
			iNumero=document.getElementById("perfil").value;
			marcadoF=document.getElementById("todosPerfiles").checked;
			sCampo="perfil";
		}
		for (i=1;i<=iNumero;i++)
		{
			if (marcadoF==true){
				marcado=false;
			}
			else{
				marcado=true;
			}
			
			document.getElementById(sCampo+i).checked=marcado;
		}
	
	}
function CheckFoto(formulario){
	sLogo=document.forms[formulario].elements["archivo"].value;
	marcado=document.forms[formulario].elements["mostrar"].checked
	//marcado=document.all.susDatos.checked
		if (marcado==false){
			document.forms[formulario].elements["foto"].value=sLogo;
			if(document.getElementById("fotor")){
				document.getElementById("fotor").style.visibility="visible"
			}
			else
			{	if (sLogo=="") {
				alert("No se ha adjuntado ningun archivo")
			}
				
			}
		}
		else{
			document.forms[formulario].elements["foto"].value="";
			if(document.getElementById("fotor"))
				document.getElementById("fotor").style.visibility="hidden"
		}
	}
	
	
	var Contenido;
	function CargaContenido(){
		Contenido=document.getElementById("espana").innerHTML;
	}
	function cambioPaisesAlertas(){
		intActual4 = document.forms["frmAlerta"].elements["paises"].selectedIndex;
		intValorSel4 = document.forms["frmAlerta"].elements["paises"].options[intActual4].text;
		if (intActual4 != 4){
			document.getElementById("espana").innerHTML="";
		}
		else{
			document.getElementById("espana").innerHTML=Contenido;
		}
	}
	function eliminar(idAlerta) {
		if (confirm("Seguro de que deseas eliminar esta alerta?")) {
			document.location.href="verAlertaEmail.asp?accion=eliminar&id="+idAlerta;
		}
	}
	function eliminarOferta(idOferta){
		if (confirm("Seguro de que deseas ELIMINAR esta OFERTA?")) {
			document.location.href="eliOferta.asp?idOferta1="+idOferta+"&iRegistros=1";
		}
	}
	function ocultarNombreOferta(identificador){
		if(document.getElementById(identificador).checked){
			document.getElementById("LG").checked=false;
			document.getElementById("TX").checked=false;
			document.getElementById("UR").checked=true;
			document.getElementById("LG").disabled=true;
			document.getElementById("TX").disabled=true;
		}
		else{
			//document.getElementById("LG").checked=false;
			//document.getElementById("TX").checked=false;
			//document.getElementById("UR").checked=true;
			document.getElementById("LG").disabled=false;
			document.getElementById("TX").disabled=false;
		}
	}
	function muestraEstado(identificador,total){
		ocultarAviso(total);
		document.getElementById("estado"+identificador).style.visibility="visible";
		document.getElementById("estado"+identificador).style.display="inline";
		}
	function ocultarAviso(total){
		for (i=1;i<=total;i++){
			document.getElementById("estado"+i).style.visibility="hidden";
			document.getElementById("estado"+i).style.display="none";
			}
		}
	function muestraEstadoVarios(){
		ocultarAviso();
		document.getElementById("estadoVarios").style.visibility="visible";
		document.getElementById("estadoVarios").style.display="inline";
	}
	function ocultarAvisoVarios(){
		document.getElementById("estadoVarios").style.visibility="hidden";
		document.getElementById("estadoVarios").style.display="none";
	}
	function seleccionarTodo(formu,marca){
		formulario=document.forms[formu];
		if (document.getElementById(marca).checked){
			for (i=0; i<= formulario.length-1; i++){
				if (formulario.elements[i].type=="checkbox") {
					formulario.elements[i].checked=true;				
				}
			}
		}
		else{
			for (i=0; i<= formulario.length-1; i++){
				if (formulario.elements[i].type=="checkbox") {
					formulario.elements[i].checked=false;				
				}
			}
		}
	}
function ImpresionMultiple(identificador,oferta,formulario){
	bMarcada=false;
	for (i=0; i<= document.forms[formulario].length-1; i++){
		if (document.forms[formulario].elements[i].type=="checkbox") {
			if (document.forms[formulario].elements[i].checked){
				bMarcada=true;
			}				
		}
	}
	if (bMarcada==true){
		document.getElementById("varios").value="si";
		document.forms[formulario].target="_blank";
		document.forms[formulario].action="imprimirCV.asp?sOferta="+oferta;
		document.forms[formulario].submit();
	}
	else{
		alert("Debe SELECCIONAR algun CV para imprimir")
	}
	
}
function QuitarBuzon(formulario){
	
	
	bMarcada=false;
	for (i=0; i<= document.forms[formulario].length-1; i++){
		if (document.forms[formulario].elements[i].type=="checkbox") {
			if (document.forms[formulario].elements[i].checked){
				bMarcada=true;
			}				
		}
	}
	if (bMarcada==true){
		if (confirm("Seguro de que deseas quitar estos CV de entre los Seleccionados?")) {
			document.forms[formulario].target="_self";
			document.forms[formulario].action="eliBuzon.asp";
			document.forms[formulario].submit();
		}
	}
	else{
		alert("Debe SELECCIONAR algun CV para Eliminar")
	}
	
}
function cambioCIF(){
		if (document.getElementById("paises").value=="1"){
			document.getElementById("cif").disabled=false;
			document.getElementById("obligaCif").style.visibility="visible";
		}
		else{
			document.getElementById("cif").disabled=true;
			document.getElementById("obligaCif").style.visibility="hidden";
		}
	}
 //-->