function parrilla_ofertas_home(enlace,puesto,logo_empresa,enlace_empresa,empresa,lugar,ultimo,altLogoEmpresa,titleLogoEmpresa)
{
document.write("<ul><li><div class='bloque'>")
document.write(enlace_empresa + "<img width = '99' height='45' src='" + logo_empresa + "' alt='" + altLogoEmpresa + "' title='" + titleLogoEmpresa + "'></a>")
document.write("<h6 class='titulo'><a HREF=" + enlace + " class='titulo' title='" + puesto + ". Ofertas de empleo'><b>" + puesto + "</b></a></h6>" + empresa.replace(/\r|\n|\r\n/g, "|"))
document.write("</div></li></ul>")
}


function cargar_publicidad() 
{     	        	        	        	        	             	        	        
    if(typeof(v_randomnumber)=="undefined"){	        	        	        
    var v_randomnumber=Math.floor(Math.random()*10000000000)}
    if(typeof(v_tile)=="undefined"){var v_tile=1}else{v_tile++}            
    txtscript = '<scr'+'ipt src="http://ad.es.doubleclick.net/adj/vocento.infoempleo/portada;dcopt=;pos=robapaginas;ageo=;afun=;sz=300x250,200x200;kw=;tile='+v_tile+';ord='+v_randomnumber+'?"><\/scr'+'ipt>'
    document.write(txtscript);                                  
}   

function cargar_publicidad01() 
{     	        	        	        	        	             	        	        
   var m3_u = (location.protocol=='https:'?'https://d1.openx.org/ajs.php':'http://d1.openx.org/ajs.php');
   var m3_r = Math.floor(Math.random()*99999999999);
   if (!document.MAX_used) document.MAX_used = ',';
   document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
   document.write ("?zoneid=88144&amp;block=1");
   document.write ('&amp;cb=' + m3_r);
   if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
   document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
   document.write ("&amp;loc=" + escape(window.location));
   if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
   if (document.context) document.write ("&context=" + escape(document.context));
   if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
   document.write ("'><\/scr"+"ipt>");                             
}   

function cargar_publicidad02() 
{     	        	        	      	        	             	        	        
   var m3_u = (location.protocol=='https:'?'https://d1.openx.org/ajs.php':'http://d1.openx.org/ajs.php');
   var m3_r = Math.floor(Math.random()*99999999999);
   if (!document.MAX_used) document.MAX_used = ',';
   document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
   document.write ("?zoneid=88144&amp;block=1");
   document.write ('&amp;cb=' + m3_r);
   if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
   document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
   document.write ("&amp;loc=" + escape(window.location));
   if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
   if (document.context) document.write ("&context=" + escape(document.context));
   if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
   document.write ("'><\/scr"+"ipt>");
         
}   

function publi()
{    

    capa01 = document.getElementById("div_publicidad_");                              
    capa02 = document.getElementById("div_publicidad");    
                                    
    yLef = capa02.offsetLeft  + capa02.offsetParent.offsetLeft;
    xTop = capa02.offsetTop;            
    capa01.style.display = "block" 
                                    
    capa01.style.top = xTop +'px';
    capa01.style.left = yLef +'px';    
    
    capa01 = document.getElementById("div_publicidad01_");                              
    capa02 = document.getElementById("div_publicidad01");    
                                    
    yLef = capa02.offsetLeft  + capa02.offsetParent.offsetLeft;
    xTop = capa02.offsetTop;            
    capa01.style.display = "block" 
                                    
    capa01.style.top = xTop +'px';
    capa01.style.left = yLef +'px';   
    
    capa01 = document.getElementById("div_publicidad02_");                              
    capa02 = document.getElementById("div_publicidad02");    
                                    
    yLef = capa02.offsetLeft + capa02.offsetParent.offsetLeft;
    xTop = capa02.offsetTop;            
    capa01.style.display = "block" 
                                    
    capa01.style.top = xTop +'px';
    capa01.style.left = yLef +'px';
                                        
} 		   	 


function ver_botones (id)
{
	if (document.getElementById("botones_"+id).style.display=='none')
	{
		document.getElementById("botones_"+id).style.display='block'
		document.getElementById("bot_"+id).style.display='none'
	}

else
	{
	document.getElementById("botones_"+id).style.display='none'
				document.getElementById("bot_"+id).style.display='block'
	}	

}
function Cambiar(tipo,ids, area)
{
	var cadena_busca="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr><td><table cellspacing=\"0\" cellpadding=\"5\" border=\"0\" width=\"100%\" class=\"contenido\">"
		cadena_busca=cadena_busca+"<tr>"
		cadena_busca=cadena_busca+"<td align=\"CENTER\" class=\"texto\" height=\"30\"><img src=\"/images/candidato/busqueda.gif\" border=\"0\"></td>"
		cadena_busca=cadena_busca+"</tr>"
		cadena_busca=cadena_busca+"</table>"
		cadena_busca=cadena_busca+"</td>"
		cadena_busca=cadena_busca+"</tr>"
		cadena_busca=cadena_busca+"</table>"
		http.open("GET", "/servicios/ofertasHome/asp/ofertas.asp?tipo="+tipo+"&ids="+ids+"&area="+area+"&pincha_pest=1", true);
	http.onreadystatechange = function () 
	{
		if (http.readyState == 4) 
		{
			var kk= document.getElementById(ids);
			kk.innerHTML =http.responseText
		}
	}
	
	http.send(null);
}
    function UrlFullEncode(str) {
		 str = escape(str);
		 str = str.replace('%','%*');
		 return str;
	 }
	 function UrlFullDecode(str) {
		 str = str.replace('%*','%');
		 str = unescape(str);
		 return str;
	 }
/*function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}*/
function promocion() 
{
	 window.open( 'http://ilead.itrack.it/clients/Nokia/camp152/login.asp?campaignid=152&websiteid=337&language=es','','width=440,height=440,status=no,menubar=no,toolbar=no,resizable=no,scrollbars=no,hotkeys=no');
}
function agregar_valores_str(seleccionado){
	var str='';
	var x= 0;
	var hacer = false;
	var objeto;

	while ((x<document.formulario.length)&&(!hacer))
	{
		if (document.formulario.elements[x].name==seleccionado)
		{
		hacer = true;
		objeto = document.formulario.elements[x];
		}
		x = ++x;
	}
	if (hacer){
		
		for (i=0;i<objeto.length;i++){
			
			if ((objeto.options[i].selected==true)&&(objeto.options[i].value!=0)){
				
				if (str!=''){
					str = str + ', '; 
				}
			str = str + cadena_sin_vacios_en_cabecera(objeto.options[i].text);
					
			}
		}
	}
return str;
}
function buscar(){
    document.formulario.txt_Ageografica.value	= agregar_valores_str('F_AGeografica');
	document.formulario.txt_Afuncional.value	= agregar_valores_str('F_AFuncional');
	document.formulario.busqueda.value		= 1;
	if (document.formulario.F_PClave.value == 'Empresa/Puesto')
	{
		document.formulario.F_PClave.value = '';
	}
	document.formulario.sel_Ageografica.value=document.formulario.F_AGeografica.selectedIndex;
	document.formulario.sel_Afuncional.value=document.formulario.F_AFuncional.selectedIndex;
	document.formulario.submit();
}
function cadena_sin_vacios_en_cabecera(cadena){
	var i=0;
	var nofin=true;
	var temporal = new String(cadena);
	var longitud = temporal.length;
	do
	{
			if (temporal.charCodeAt(0)!=160)
				{
				nofin = false;
				}	
			else
				{
				temporal = temporal.substring(1,longitud);
				longitud = temporal.length;
				i++;
				}
	}
	while (nofin);
	return temporal;
}
function infoempleo_promocional(AG,AF,SAG,SAF,tit){
	document.formulario.txt_Ageografica.value	= AG;
	document.formulario.txt_Afuncional.value	= AF;
	document.formulario.busqueda.value		= 1;
	document.formulario.sel_Ageografica.value	= SAG;
	document.formulario.sel_Afuncional.value	= SAF;
	document.formulario.F_AFuncional.value    = SAF;
	document.formulario.F_AGeografica.value	= SAG;
	document.formulario.tit.value = tit;
	document.formulario.submit();	
}
function ver_oferta(referencia){
	document.formulario.action="../../../Candidato42/asp/oferta/oferta.asp?Id_Oferta=" + referencia;
	document.formulario.method='post';
	document.formulario.submit();
}
function desplegar(strCapa)
	{
	if (strCapa != '')
		{
		if (document.getElementById(strCapa).style.display=='none')
			{document.getElementById(strCapa).style.display='block';}
		else
			{document.getElementById(strCapa).style.display='none';}	
		}
	
	}
function valida_formulario()
{
	this.form_activo=document.forms[0]

	if (!this.form_activo.CIF)	// Si no contiene el CIF cogemos el siguiente formulario
	{
		this.form_activo=document.forms[1]
	}

	if (this.form_activo.CIF.value == "") 
	{
		alert("Campo CIF vacio, por favor introduzca su CIF.");
		this.form_activo.CIF_izq.focus();
		return false;
	}
	else if (this.form_activo.emp_login.value == "") 
	{
		alert("Campo usuario vacio, por favor introduzca su usuario.");
		this.form_activo.emp_login_izq.focus();
		return false;
	}
	else
	if (this.form_activo.emp_pass.value == "") 
	{
		alert("Campo contraseña vacio, por favor introduzca su contraseña.");
		this.form_activo.emp_pass_izq.focus();
		return false;
	}
	else 
	{
		this.form_activo.action='/Empresa/contenidos/asp/portada.asp';
		this.form_activo.submit();
	}
}
function SubmitEnter(oEvento, oLado, oFormulario)
{
	if (oEvento.keyCode==13)
	{
		window.event.keyCode = 0;
		form_emp(oLado);
	}
		
}
/*function MM_reloadPage(init) {  //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);*/
function vacia_datos(nombre,valor)
{
	if (eval('document.getElementById("'+nombre+'").value=="' + valor + '";'))
	{
		eval('document.getElementById("'+nombre+'").value="";')
	}
}
var pesVerdeHomeActual = 'particulareshome';  // Almacena la pestana verde visible actualmente en la home
function conmutaPesVerdeHome(objId){
	if(pesVerdeHomeActual != null && pesVerdeHomeActual != objId){
		var actual = document.getElementById(pesVerdeHomeActual);
		actual.style.display="none";		
	}
	var objeto = document.getElementById(objId);
	if(objeto.style.display == "none"){
		objeto.style.display = "block";
	}else{
		objeto.style.display = "none";
	}
	pesVerdeHomeActual = objId;
}

var pesRosaHomeActual = 'ofertasdestacadashome';  // Almacena la pestana rosa visible actualmente en la home
function conmutaPesRosaHome(objId){
	
	if(pesRosaHomeActual != null && pesRosaHomeActual != objId){
		var actual = document.getElementById(pesRosaHomeActual);
		actual.style.display="none";		
	}
	var objeto = document.getElementById(objId);
	if(objeto.style.display == "none"){
		objeto.style.display = "block";
	}else{
		objeto.style.display = "none";
	}
	pesRosaHomeActual = objId;
}

function conmutaPesRosaHomeTres(obj1Visible, obj2, obj3)
{
	if (obj1Visible== "formacionhome")
	    document.getElementById("cajahome").className = 'cajahomeazul';
	   else
	        document.getElementById("cajahome").className = 'cajahomerosa';
	
	document.getElementById(obj2).style.display = 'none';
	document.getElementById(obj2+'_Div').style.display = 'none';
	document.getElementById(obj3).style.display = 'none';
	document.getElementById(obj3+'_Div').style.display = 'none';
	document.getElementById(obj1Visible).style.display = 'block';
	document.getElementById(obj1Visible+'_Div').style.display = 'block';
	
	
}
function conmutaPesRosaHomeCuatro(objVisible, obj2,obj3)
{
	if (objVisible== "formacionhome")
	{
	    document.getElementById("cajahome").className = 'cajahomeazul';
	    //if(document.getElementById("buscoformacionparthome").style.display !='block')
	    //{
	        //conmutaPesBuscPart('buscoformacionparthome');
	    //}
	}else
	{
	    document.getElementById("cajahome").className = 'cajahomerosa';	    
	}
	document.getElementById(obj2).style.display = 'none';
	document.getElementById(obj2+'_Div').style.display = 'none';
	document.getElementById(obj3).style.display = 'none';
	document.getElementById(obj3+'_Div').style.display = 'none';
	document.getElementById(objVisible).style.display = 'block';
	document.getElementById(objVisible+'_Div').style.display = 'block';
}
var pesBuscPartActual = 'buscotrabajoparthome';  // Almacena la pestana visible actualmente en el buscador de particulares
function conmutaPesBuscPart(objId){
	if(pesBuscPartActual != null && pesBuscPartActual != objId){	
		var actual = document.getElementById(pesBuscPartActual);
		actual.style.display="none";		
	}	
	var objeto = document.getElementById(objId);	
	if(objeto.style.display == "none" || objeto.style.display == "")
	{	
		objeto.style.display = "block";
		if(objId=='buscoformacionparthome')
		{
		    conmutaPesRosaHomeCuatro('formacionhome','ofertasdestacadashome','internacionalhome')
		}else
		{
		    conmutaPesRosaHomeCuatro('ofertasdestacadashome','formacionhome','internacionalhome')
		}
	}else
	{
		objeto.style.display = "none";		
	}
	pesBuscPartActual = objId;	
}
//]]>
function abrir(cadena) 
{
	var a, cad,tam;
	cad='/candidato/ayuda/asp/ayuda_infoempleo2.asp?pagina=' + cadena
	a=window.open(cad ,'ayuda', 'width=550,height=400,,scrollbars=1, left=110, top=50');
	}
function envia_form(event, tipo, entorno)
{
	
	var key= (document.all) ? event.keyCode : event.which; //código de la tecla; 13 es el INTRO o ENTER
	
	if (key == 13)
	{
	    if (tipo == 'ofertas')
	    {
		   carga_previa(entorno);
		}
		if (tipo == 'formacion')
	    {
		    buscarFormacion(entorno);
		}
		if (tipo == 'personas')
		{
		    buscarPersonas(entorno);
		}
	}
}
function cambio()
{
	document.formulario.cambie.value=1
}
function q_tex(cc_text)
{
	if (cc_text=='Empresa/Puesto/Referencia')
	{
		document.formulario.F_PClave.value='';
	}
	if (cc_text=='Nombre o palabras clave')
	{
		document.formulario.referenciaPersona.value='';
	}
}

function vaciarCaja(Texto, obj)
{	
	if(Texto=='Nombre del curso, centro, palabra clave' || Texto=='Busca por provincia' || Texto=='Empresa/Puesto/Referencia'
	|| Texto=='Nombre o palabras clave' )
	{
		document.getElementById(obj).value='';

	}
}

function carga_previa( entorno )
{
	document.formulario.action=entorno
	document.formulario.buscar.value=1;
	document.formulario.busco_desde_oferta.value=1;
	Cargo_Seleccion();
}


function buscarFormacion(entorno)
{

 document.formulario.action =entorno + 'cursos/';
 document.formulario.method = 'post';
 
 if ( document.getElementById('F_Descripcion').value !="" &&
    document.getElementById('F_Descripcion').value != "Nombre del curso, centro, palabra clave")
   {
     document.formulario.action =entorno + 'cursos/'+"palabra_"+escapeUtf8( document.getElementById('F_Descripcion').value) +"/";
   }



 document.formulario.submit();
 
}



function buscarPersonas(entorno)
{
    document.formulario.action = entorno+'persona/asp/busqueda-personas/bqp-personas.asp';
    document.formulario.method = 'post';
	if ((document.getElementById("referenciaPersona").value!='Nombre o palabras clave' && document.getElementById("referenciaPersona").value!='') || document.getElementById("areaFuncionalPersona").value!=-1 || document.getElementById("areaGeograficaPersona").value!=-1)
	{
		document.formulario.submit();
	}
	else
	{
		if (document.getElementById("id_cand"))
		{
			if (document.getElementById("id_cand").value=="nfl")
			{
				document.formulario.submit();
			}
	    	else
			{
				ayudaFiltrado();
			}
		}
		else
		{
			ayudaFiltrado();
		}
	}
}
function buscadorAvanzado(entorno)
{
    document.formulario.action = entorno+'candidato42/asp/oferta/buscador_ofertas/buscador_avanzado.asp';
    document.formulario.submit();
}
function buscadorAvanzadoFormacion(entorno)
{
    document.formulario.action =entorno+ 'personas/formacion/BusquedaAvanzada.aspx';
    document.formulario.submit();
}

function ayudaFiltrado()
{
    document.getElementById('ref-popup-filtro').style.display='block';
}

function ayudaReferencia()
{
    document.getElementById('home-popup-ayuda').style.display = 'block';
    document.formulario.referenciaPersona.focus();
}
function form_emp(Lado)
{ 
	valida_formulario('menuLogin');	
}
function recordar()
{
	document.formulario.action='/default.asp?recordatorio=1';
    document.formulario.method = 'post';
    document.formulario.submit();		
}
function limpiar_cif()
{
    if (document.getElementById('CIF').value == 'C.I.F.')
    {
        document.getElementById('CIF').value = '';
    }
}

function limpiar_usuario()
{
    if(document.getElementById('emp_login').value == 'usuario')
    {
        document.getElementById('emp_login').value = '';
    }
}

//Limpia usuarioParticular 
function limpiar_usuarioP()
{
    if(document.getElementById('pre_login').value == 'usuario')
    {
        document.getElementById('pre_login').value = '';
    }
}

function limpiar_password()
{
    if(document.getElementById('emp_pass').value == 'contrasenia')
    {
        document.getElementById('emp_pass').value = '';
    }
}	

//Limpmia Contraseña del Particular
function limpiar_passwordP()
{
    if(document.getElementById('pre_pass').value == 'contrasenia')
    {
        document.getElementById('pre_pass').value = '';
    }
}

function limpiar_cif2()
{
    if(document.getElementById('cif_empresa').value == 'Tu C.I.F.')
    {
        document.getElementById('cif_empresa').value = '';
    }
}
function limpiar_email()
{
    if(document.getElementById('email_emp').value == 'Tu correo')
    {
        document.getElementById('email_emp').value = '';
    }
}
		 
function activacapa()
{	
    if (document.getElementById('capa_mensaje').style.display=='block')
    {
       conmutaPesVerdeHome('empresashome');
    }	 
}
function pestanaempresa()
{
	if (document.getElementById("empresashome").style.display=='none')
	{
		conmutaPesVerdeHome('empresashome')
	}
}
function buscarPrimerEmpleo()
{
    document.formulario.action="/trabajo/puesto-de-trabajo_Sin-especificar"
	document.formulario.buscar.value=1;
	document.formulario.busco_desde_oferta.value=1;
	if (document.formulario.F_PClave.value == 'Empresa/Puesto/Referencia')
    {
        document.formulario.F_PClave.value = '';
    }
	document.formulario.submit();
}
function redimensionarIframeFormacion(objeto)
{
    objeto.height ="100%" //objeto.contentWindow.document.body.scrollHeight;
	objeto.width ="100%" //objeto.contentWindow.document.body.scrollWidth;	
}