var Actualizar = false;

function ActivarCarnetConducir ()
{
	Desactivado = (document.DatosCandidato.CarnetConducir[1].checked);
	document.DatosCandidato.TipoCarnet.disabled  = Desactivado;
}


function ActivarEstudios ()
{
	Desactivado = (document.DatosCandidato.Estudios.value <= 3);
	document.DatosCandidato.Titulacion.disabled  = Desactivado;
	document.DatosCandidato.Universidad.disabled = Desactivado;
	Desactivado = (document.DatosCandidato.Estudios.value <= 2);
	document.DatosCandidato.Convalidado[0].disabled = Desactivado;
	document.DatosCandidato.Convalidado[1].disabled = Desactivado;
	document.DatosCandidato.Convalidado[2].disabled = Desactivado;
}


function ActivarNivelInformatica ()
{
	Desactivado = (document.DatosCandidato.Informatica[1].checked);
	document.DatosCandidato.NivelInformatica.disabled  = Desactivado;
}


function ActivarOtrosIdiomas ()
{
	Desactivado = (document.DatosCandidato.Idiomas[1].checked);
	document.DatosCandidato.OtrosIdiomas.disabled  = Desactivado;
}


function AvisoInscripcion ()
{
	var Ventana = new TVentana ();

	Ventana.Ancho       = 500;
	Ventana.Alto        = 400;
	Ventana.Nombre      = 'AvisoInscripcion';
	Ventana.URL         = '/plantillas/avisoinscripcion.html';
	Ventana.Open (true);
}


function Actividades (Ident)
{
	var Ventana = new TVentana ();

	Ventana.Ancho  = 580;
	Ventana.Alto   = 500;
	Ventana.Nombre = 'Servicio';
	Ventana.URL    = '/fuentes/actividades.php?Opc=' + Opc + '&Lng=' + Lng + '&Id=' + Ident;
	Ventana.Open (true);
}


function AvisoLegal ()
{
	var Ventana = new TVentana ();

	Ventana.Ancho       = 550;
	Ventana.Alto        = 400;
	Ventana.Nombre      = 'AvisoLegal';
	Ventana.URL         = '/fuentes/avisolegal.php';
	Ventana.Open (true);
}


function Ayudanos ()
{
	var Ventana = new TVentana ();

	Ventana.Ancho  = 540;
	Ventana.Alto   = 500;
	Ventana.Nombre = 'Ayudanos';
	Ventana.URL    = '/fuentes/ayudanos.php?Lng=' + Lng;
	Ventana.Open (true);
}


function CambiarIdioma (Idioma)
{
	Lng = Idioma;

	if (Opc >= 200 && Opc < 300) Par1 = 0;
	CargarPagina ();
}


function CargarPagina ()
{
	var Pars = '?Opc=' + Opc;

	if (Lng)  Pars += '&Lng='  + Lng;
	if (Par1) Pars += '&Par1=' + Par1;
	if (Par2) Pars += '&Par2=' + Par2;
	if (Par4) Pars += '&Par4=' + Par4;

	window.location = '/index.php' + Pars;
}


function comprueba_curriculum (archivo)
{
	var extensiones_permitidas = new Array(".doc", ".pdf");
	if (archivo != '') return (comprueba_extension (archivo, extensiones_permitidas));
}


function comprueba_extension(archivo, extensiones_permitidas)
{
	 mierror = "";

   //recupero la extensión de este nombre de archivo
   extension = (archivo.substring(archivo.lastIndexOf("."))).toLowerCase();
   //compruebo si la extensión está entre las permitidas
   permitida = false;
   for (var i = 0; i < extensiones_permitidas.length; i++)
   {	if (extensiones_permitidas[i] == extension)
   		{	permitida = true;
    		break;
   		}
   }
   if (!permitida)
   {	alert("Compruebe la extensión de los archivos a subir. \nSólo se pueden subir archivos con extensiones: " + extensiones_permitidas.join());
   		archivo.focus;
   }  else return (true);

   return (false);
}



function comprueba_foto (archivo)
{
	var extensiones_permitidas = new Array(".gif", ".jpg");
	if (archivo != '') return (comprueba_extension (archivo, extensiones_permitidas));
}


function DescargarCurriculum (Ident)
{
	window.location = '/fuentes/descargarcurriculum.php?Id=' + Ident;
}


function DescargarDocumento (Documento)
{
	window.location = '/fuentes/descargardocumento.php?Fichero=' + Documento;
}


function DesconectarCandidato (iOpc)
{
	var	Ajax = new TAjax ();
	Ajax.onCargar = function (oPeticion) {	Main (oPeticion.Opcion)}; //OnDesconectarCandidato;
	Ajax.Opcion   = iOpc;
	Ajax.Cargar ('/fuentes/desconectarcandidato.php');
}


function DesconectarEmpleador (iOpc)
{
	var	Ajax 			= new TAjax ();
	Ajax.Opcion   = iOpc;
	Ajax.onCargar = function (oPeticion) {	Main (oPeticion.Opcion)};
	Ajax.Cargar ('/fuentes/desconectarempleador.php');
}


function Entrevista ()
{
	var Ventana = new TVentana ();

	Ventana.Ancho  = 500;
	Ventana.Alto   = 500;
	Ventana.Nombre = 'Entrevista';
	Ventana.URL    = '/fuentes/entrevista.php?Lng=' + Lng;
	Ventana.Open (true);
}


function EnviarEntrevista (Formulario)
{
	var Ajax = new TAjax ();

	if (ValidarFormulario (Formulario))
	{	Ajax.onCargar = onEnviarFormulario;
		Ajax.Formulario (Formulario);
		Ajax.Cargar ('/fuentes/enviarentrevista.php');
	}
}


function EnviarInscribete (Formulario)
{
	var Ajax = new TAjax ();

	if (ValidarFormulario (Formulario))
	{	Ajax.onCargar = onEnviarFormulario;
		Ajax.Formulario (Formulario);
		Ajax.Cargar ('/fuentes/enviarinscribete.php');
	}
}


function EnviarSugerencias (Formulario)
{
	var Ajax = new TAjax ();

	if (ValidarFormulario (Formulario))
	{	Ajax.onCargar = onEnviarFormulario;
		Ajax.Formulario (Formulario);
		Ajax.Cargar ('/fuentes/enviarsugerencias.php');
	}
}


function EnviarContacto ()
{
	var Ajax = new TAjax ();

	if (ValidarFormulario (document.Formulario))
	{	Ajax.onCargar = onEnviarFormulario;
		Ajax.Formulario (document.Formulario);
		Ajax.Cargar ('/fuentes/enviarcontacto.php');
	}
}

function ErrorCampo (oControl, Mensaje)
{
	oControl.className = 'Error';
	alert (Mensaje);
	if (typeof (oControl) != 'undefined') oControl.focus ();
}


function FlashMenu (Ruta, Opcion)
{
	document.write ('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"');
	document.write ('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
	document.write ('width="200" height="450" id="/' + Ruta + '/swf/menu.swf?Opc=' + Opcion + '" align="middle">');
	document.write ('<param name="allowScriptAccess" value="sameDomain" />');
	document.write ('<param name="movie" value="/' + Ruta + '/swf/menu.swf?Opc=' + Opcion + '" />');
	document.write ('<param name="quality" value="high" /><param name="wmode" value="transparent" />');
	document.write ('<param name="bgcolor" value="#ffffff" />');
	document.write ('<embed src="/' + Ruta + '/swf/menu.swf?Opc=' + Opcion + '" quality="high" wmode="transparent" bgcolor="#ffffff"');
	document.write ('width="200" height="450" name="/' + Ruta + '/swf/menu.swf?Opc=' + Opcion + '" align="middle" ');
	document.write ('allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write ('</object>');
}


function FundirTop ()
{
	var Fundido = new TFundido (document.getElementById ('idFotoTop'))

	Fundido.Incremento = 5;
	Fundido.Intervalo  = 80;
	Fundido.Fundir ();
}


function IdentificarCandidato (oFormulario, iOpc)
{
	var Ajax 	 = new TAjax ();

	if (ValidarFormulario (oFormulario))
	{ Ajax.onCargar = function (oPeticion)
		                {	if (oPeticion.asText () == 'OK') Main (oPeticion.Opcion);
											else Idioma (1);
										};
		Ajax.Opcion   = iOpc;
		Ajax.Formulario (oFormulario);
		Ajax.Cargar ('/fuentes/identificarcandidato.php');
	}
}


function IdentificarEmpleador (oFormulario, iOpc)
{
	var Ajax 	 = new TAjax ();
	
	if (ValidarFormulario (oFormulario))
	{ Ajax.onCargar = function (oPeticion)
		                {	if (oPeticion.asText () == 'OK') Main (oPeticion.Opcion);
											else Idioma (1);
										};
		Ajax.Opcion   = iOpc;
		Ajax.Formulario (oFormulario);
		Ajax.Cargar ('/fuentes/identificarempleador.php');
	}
}


function Inscribete (Ident)
{
	var Ventana = new TVentana ();

	Ventana.Ancho  = 580;
	Ventana.Alto   = 500;
	Ventana.Nombre = 'Inscríbete';
	Ventana.URL    = '/fuentes/inscribete.php?Lng=' + Lng + '&Id=' + Ident;
	Ventana.Open (true);
}


function InicializarControl (Control, Texto)
{
	var i = Control.length - 1;

	while (i >= 0 && Control.options [i].value != Texto) i--;
	if (i >= 0) Control.selectedIndex = i;
}


function InscripcionCurso (Curso)
{
	var Ajax 	 = new TAjax ();

  Ajax.onCargar = InscripcionOn;
  Ajax.Vars.Curso = Curso;
	Ajax.Cargar ('/fuentes/inscripcioncurso.php', 'Cargando');
}



function InscripcionOferta (Oferta)
{
	var Ajax 	 = new TAjax ();

  Ajax.onCargar = InscripcionOn;
  Ajax.Vars.Oferta = Oferta;
	Ajax.Cargar ('/fuentes/inscripcionoferta.php', 'Cargando');
}


function InscripcionOn (Peticion)
{
	var Result = Peticion.asText ();
	
	if (Result == 'OK')
	{	$ ('idInscripcion', 'style.display', 		'none');
		$ ('idInscripcionPie', 'style.display',	'none');
		$ ('idInscripcionOK', 'style.display',  'block');
		SetActualizar (true);
	}	else alert ('No se ha podido realizar la inscripción.\n' + Result);
}



function LimpiarParametros ()
{
	Par1 = 0;
	Par2 = 0;
	Par4 = '';
}


function Main (Opcion)
{
	LimpiarParametros ();
	Opc = Opcion;
	CargarPagina ();
}


function MarcarLeido ()
{
	var Ajax 	 = new TAjax ();

	Ajax.onCargar = MarcarLeidoOn;
	Ajax.Formulario (document.FichaCandidato);
	Ajax.Cargar ('/fuentes/marcarinscripcion.php', 'Cargando');
}


function MarcarLeidoOn (Peticion)
{
	var Result = Peticion.asText ();

	if (Result == 'NOOK') alert ('No se ha podido marcar como leído.');
	else
	{	Result = Result.split (";");
		Leido  = Result [1];
		SetActualizar (true);
		window.close ();

		if (! Es_IE)
		{	if (Leido == 1) alert ('La ficha del candidato ha sido leída.');
			else alert ('Ha desmacardo la ficha del candidato.');
		}
	}
}


function ModificarEmpleador ()
{
	var Ajax = new TAjax ();
	if (ValidarFormulario (document.DatosEmpleador))
	{	Ajax.Formulario (document.DatosEmpleador);
		Ajax.onCargar = function (oPeticion)
		                {	if (oPeticion.asText () == 'OK') {
		                		$ ('idAltaEmpleadores',   'style.display', 	'none');
												$ ('idAltaEmpleadoresOk', 'style.display',  'block');
											}	else alert ('No se ha podido actualizar o registrar los datos del empleador.');											
										};
		Ajax.Cargar ('/fuentes/datosempleador.php', 'Cargando');
	}
}


function ModificarOferta (Ident)
{
	var Ajax = new TAjax ();
	if (ValidarFormulario (document.DatosOferta))
	{	Ajax.onCargar = function (oPeticion)
		                { if (oPeticion.asText () == 'OK') window.back ();
											else alert ('No se ha podido actualizar o registrar los datos de la oferta.');
										};
		Ajax.Formulario (document.DatosOferta);
		Ajax.Cargar ('/fuentes/datosoferta.php', 'Cargando');
	}
}


function onEnviarFormulario (Peticion)
{
	$ ('idFormulario', 'style.display', 'none');
	$ ('idEnvioOK', 'style.display', 'block');
}


function onRollOutFila (Fila)
{
	Fila.style.backgroundColor = '';
}


function onRollOverFila (Fila)
{
	Fila.style.backgroundColor = '#efefef';
}



function PedirClave (oFormulario)
{
	var Ajax = new TAjax ();

	if (ValidarFormulario (oFormulario))
	{	Ajax.onCargar = function (oPeticion)
		                {	if (oPeticion.asText () == 'OK')
											{	$ ('idRecordarClave', 'style.display', 'none');
												$ ('idEnvioOK', 'style.display', 'block');
											} else alert ('No hay ningún usuario con esa dirección de correo electrónico.');
										}
		Ajax.Vars.Email = oFormulario.Email.value.Trim ();
		Ajax.Cargar ('/fuentes/recordarclave.php');
	}
}


function Punto (iId)
{
	if (idEfecto ('idPunto' + iId).Vertical() > 0)
		$ ('imgPunto' + iId, 'src', '/imagenes/simbolo_desplegable_on.gif');
	else $ ('imgPunto' + iId, 'src', '/imagenes/simbolo_desplegable.gif');
}


function RollOut(img) {
	img.src = img.src.substr(0,img.src.length - 8) + ".gif";
}


function RollOver(img)
{
	img.src = img.src.substr(0,img.src.length - 4) + "_off.gif";
}


function RecordarClave (Usuario)
{
	var Ventana        = new TVentana ()
	Ventana.Ancho      = 600;
	Ventana.Alto       = 420;
	Ventana.ScrollBars = false;
	Ventana.Nombre     = 'Recordar';
	Ventana.URL        = '/fuentes/recordarclave.php?Usuario='+Usuario;
	Ventana.Open (true);
}


function Refrescar ()
{ if (window.Actualizar)
	{	window.Actualizar = false;
		window.location.replace (window.location);
	}
}


function RegistrarEmpleador ()
{
	var Ajax = new TAjax ();

	if (ValidarFormulario (document.DatosEmpleador) && ValidarContrasena (document.DatosEmpleador))
	{	
		Ajax.onCargar = RegistrarEmpleadorOn;
		Ajax.Formulario (document.DatosEmpleador);
		Ajax.Vars.Opc = Opc;
		Ajax.Cargar ('/fuentes/datosempleador.php', 'Cargando');
	}
}


function RegistrarEmpleadorOn (Peticion)
{
	var Result = Peticion.asText ();

	if (Result == 'OK')
	{	$ ('idAltaEmpleadores', 'style.display', 	'none');
		$ ('idAltaEmpleadoresOk', 'style.display', 'block');
	} else if (Result == 'NOLOGIN') alert ('El nombre de usuario no es correcto.');
	else if (Result == 'NOCLAVE') alert ('La contraseña no es correcta.');
	else if (Result == 'NOEMAIL') alert ('El email no es correcto.');
	else if (Result == 'LOGINDUPLICADO') alert ('Ya existe un empleador con ese código.');
	else if (Result == 'EMAILDUPLICADO') alert ('Ya existe un contacto con ese email.');
	else alert ('No se ha podido actualizar o registrar los datos del empleador.');
}


function RegistrarOferta ()
{
	var Ajax = new TAjax ();

	if (ValidarFormulario (document.DatosOferta))
	{	Ajax.onCargar = RegistrarOfertaOn;
		Ajax.Formulario (document.DatosOferta);
		Ajax.Vars.Opc = Opc;
		Ajax.Cargar ('/fuentes/datosoferta.php', 'Cargando');
	}
}


function RegistrarOfertaOn (Peticion)
{
	var Result = Peticion.asText ();

	if (Result == 'OK') {
		$ ('idAltaOferta', 	 'style.display',   'none');
		$ ('idAltaOfertaOk', 'style.display',   'block');
	}	else alert ('No se ha podido actualizar o registrar los datos de la oferta.');
}


function RegistroCandidato (Actual, Siguiente)
{
	var Ajax 	 = new TAjax ();
	
//BLANCA NO QUIERE VALIDACIONES 
	
	//if (ValidarFormulario (document.DatosCandidato) && ValidarContrasena (document.DatosCandidato)) { 
		Ajax.Formulario (document.DatosCandidato);
		Ajax.onCargar 	 = RegistroCandidatoOn;
		Ajax.Vars.Opc    = Opc;
		Ajax.Vars.Opcion = Actual;
		Ajax.Par1        = Siguiente;
		Ajax.Cargar ('/fuentes/datoscandidato.php', 'Cargando');
	//}
}


function RegistroCandidatoOn (Peticion)
{
	var Result = Peticion.asText ();

	switch (Result)
	{ case 'OK': 							Par1 = Peticion.Par1; CargarPagina (); break;
		case 'NOLOGIN': 				alert ('Tiene que indicar un código de usuario'); break; 
		case 'NOCLAVE': 				alert ('La contraseña debe contener al menos 5 caracteres.'); break;
		case 'NOEMAIL': 				alert ('Debe indicarnos su e-mail.'); break;
		case 'LOGINDUPLICADO': 	alert ('Ya existe un candidato con ese nombre de usuario.'); break;
		case 'EMAILDUPLICADO': 	alert ('Ya existe un candidato con ese email.'); break;
		default: 								alert ('No se ha podido actualizar o registrar los datos del candidato.\n'+Result); break;
	}
}


function SerVoluntario (Formulario)
{
	var Ajax = new TAjax ();

	if (ValidarFormulario (Formulario))
	{	Ajax.onCargar = onEnviarFormulario;
		Ajax.Formulario (Formulario);
		Ajax.Cargar ('/fuentes/voluntarioenviar.php');
	}
}


function SetActualizar (Valor)
{
	if (Valor != Actualizar)
	{	Actualizar = Valor;
		if (window.opener && ! window.opener.closed)
		{	window.opener.Refrescar ();
			window.opener.SetActualizar (Valor);
		}
	}
}


function Voluntario ()
{
	var Ventana = new TVentana ();

	Ventana.Ancho  = 500;
	Ventana.Alto   = 500;
	Ventana.Nombre = 'Voluntario';
	Ventana.URL    = '/fuentes/voluntario.php?Lng=' + Lng;
	Ventana.Open (true);
}



function VerCurso(Ident)
{
	var Ventana = new TVentana ();

	Ventana.Ancho  = 580;
	Ventana.Alto   = 500;
	Ventana.Nombre = 'Curso';
	Ventana.URL    = '/fuentes/vercurso.php?Opc=' + Opc + '&Id=' + Ident;
	Ventana.Open (true);
}


function VerDatosCandidato(IdInscripcion, IdCandidato, bInscribir)
{
	var Ventana = new TVentana ();

	SetActualizar (true);

	Ventana.Ancho  = 580;
	Ventana.Alto   = 600;
	Ventana.Nombre = 'Candidato';
	Ventana.URL    = '/fuentes/verdatoscandidato.php?IdInscripcion=' + IdInscripcion + '&IdCandidato='+ IdCandidato +
									 '&Inscribir=' + bInscribir;
	Ventana.Open (true);
}


function VerOferta (Ident)
{
	var Ventana = new TVentana ();

	SetActualizar (true);

	Ventana.Ancho  = 580;
	Ventana.Alto   = 500;
	Ventana.Nombre = 'Oferta';
	Ventana.URL    = '/fuentes/veroferta.php?Opc=' + Opc + '&Id=' + Ident;
	Ventana.Open (true);
}


function VerDeberes (Tipo)
{
	var Aux = $ ('idDeberes' + Tipo);

	if (Aux)
		Aux.style.display = Aux.style.display == 'none' ? 'block' : 'none';
}


function VerDerechos (Tipo)
{
	var Aux = $ ('idDerechos' + Tipo);

	if (Aux)
		Aux.style.display = Aux.style.display == 'none' ? 'block' : 'none';
}


function ValidarContrasena (Formulario)
{
	/*Result = Formulario.Clave == Formulario.Repetir;
	if (! Result) ErrorCampo (Formulario.Repetir, 'La contraseña y su confirmación son distintas.');*/
	return (true);
	
}


function ValidarFormulario2 (bInsertar)
{
	var Curriculum = document.DatosCandidato.Curriculum.value;
	var	Foto       = document.DatosCandidato.Foto.value;
	

	if (bInsertar && ! document.DatosCandidato.avisolegal.checked)
	{	alert ('Tiene que leer y aceptar nuestra política de privacidad y confidencialidad');
		document.DatosCandidato.avisolegal.focus ();
	} else if ((Curriculum != '') && (! comprueba_curriculum (document.DatosCandidato.Curriculum.value)))
		document.DatosCandidato.Curriculum.focus ();
	else if ((Foto != '') && (! comprueba_foto (document.DatosCandidato.Foto.value)))
		document.DatosCandidato.Foto.focus ();
	else document.DatosCandidato.submit ();
}


//===========================================================================================
//===========================================================================================
//===========================================================================================





/*

function onPedirClave (Peticion)
{
	if (Peticion.asText () == 'OK')
	{	$ ('idRecordarClave', 'style.display', 'none');
		$ ('idEnvioOK', 'style.display', 'block');
	} else alert ('No tenemos registrado ningún usuario con ese email.');
}
*/

/*function ValidarCandidato ()
{
	var Result = false;

	switch (Par1)
	{ case 1: if ((Opc == OPC_INSERTARCANDIDATO) && (document.DatosCandidato.Codigo.value == ''))
							ErrorCampo (document.DatosCandidato.Codigo, 'Tiene que indicar su nombre de usuario.');
						else if (document.DatosCandidato.Codigo.length < 5)
							ErrorCampo (document.DatosCandidato.Codigo, 'El nombre de usuario debe tener al menos 5 caracteres.');
						else if (document.DatosCandidato.Clave.value == '')
							ErrorCampo (document.DatosCandidato.Clave, 'Tiene que indicar una contraseña.');
						else if (document.DatosCandidato.Clave.length < 5)
							ErrorCampo (document.DatosCandidato.Clave, 'La contraseña debe tener al menos 5 caracteres.');
						else if (document.DatosCandidato.Repetir.value != document.DatosCandidato.Clave.value)
							ErrorCampo (document.DatosCandidato.Repetir, 'La contraseña y su confirmación son distintas.');
						else if (document.DatosCandidato.Nombre.value == '')
							ErrorCampo (document.DatosCandidato.Nombre, 'Tiene que indicar su nombre.');
						else if (document.DatosCandidato.Telefono.value == '')
							ErrorCampo (document.DatosCandidato.Telefono, 'Tiene que indicar un teléfono.');
						else if (document.DatosCandidato.Movil.value == '')
							ErrorCampo (document.DatosCandidato.Movil, 'Tiene que indicar su teléfono móvil.');
						else if ((document.DatosCandidato.FecNacimiento.value != '') && (! FechaCorrecta (document.DatosCandidato.FecNacimiento.value)))
							ErrorCampo (document.DatosCandidato.FecNacimiento, 'La fecha de Nacimiento no es válida.');
						else if ((document.DatosCandidato.Email.value != '') && (! EmailCorrecto (document.DatosCandidato.Email.value)))
							ErrorCampo (document.DatosCandidato.Email, 'El email indicado no es correcto.');
						else if ((document.DatosCandidato.FecEntrada.value != '') && (! FechaCorrecta (document.DatosCandidato.FecEntrada.value)))
							ErrorCampo (document.DatosCandidato.FecEntrada, 'La fecha de llegada a España no es válida.');
						else Result=true;
						break;
		default: Result = true; break;
	}
	return (Result);
}

*/



/*function CambiarPais ()
{
	var Valor 		 = document.getElementById ('selPais');
	var Provincia  = document.getElementById ('selProvincia');

	$ ('idTRProvincia1', 'style.display', (Valor.value == 'ES') ? 'none' : '');
	$ ('idTRProvincia2', 'style.display', (Valor.value == 'ES') ? '' : 'none');

	if (Valor.value != 'ES') Provincia.value = '';
	document.getElementById ('Provincia').value = '';
}
*/


/*function ValidarDatosOferta ()
{
	var Oferta   			= Trim (document.DatosOferta.Oferta.value);
	var Residencia		= Trim (document.DatosOferta.Residencia.value);

	if (Oferta == '')
		ErrorCampo (document.DatosOferta.Oferta, 'Tiene que indicar una descripción del puesto a cubrir.');
	else if (Residencia == '')
		ErrorCampo (document.DatosOferta.Residencia, 'Tiene que indicar un lugar de residencia.');
	else if ((document.DatosOferta.Incorporacion.value != '') && (! FechaCorrecta (document.DatosOferta.Incorporacion.value)))
		ErrorCampo (document.DatosOferta.Incorporacion, 'La fecha de incorporación no es válida.');
	else return (true);
}


function InicializarPais (Control, Pais)
{
	var i = Control.length - 1;
	var Valor = document.getElementById ('selPais');

	while (i >= 0 && Control.options [i].value != Pais) i--;
	if (i >= 0) Control.selectedIndex = i;

	$ ('idTRProvincia1', 'style.display', (Valor.value == 'ES') ? 'none' : '');
	$ ('idTRProvincia2', 'style.display', (Valor.value == 'ES') ? '' : 'none');
}


function InicializarProvincia (Control, Provincia)
{
	var i = Control.length - 1;

	while (i >= 0 && Control.options [i].value != Provincia) i--;
	if (i >= 0) Control.selectedIndex = i;
}
*/