function google_ad_request_done(google_ads) {
var google_ads;
/*
* Esta función es obligatoria y se utiliza para mostrar
* los anuncios obtenidos como respuesta a la solicitud de
* JavaScript. Deberá modificar los comandos
* document.write a fin de que el código HTML que escriba se ajuste
* a la disposición del anuncio.
*/
var s = '';
var i;
/*
* Verifique que hay anuncios para publicar.
*/
if (google_ads.length == 0) {
return;
}
/*
* Si se ofrece como resultado un anuncio gráfico, muestre ese anuncio.
* De lo contrario, cree una cadena que contenga todos los anuncios y,
* a continuación, utilice un comando document.write() para imprimir la cadena.
*/
if (google_ads[0].type == "image") {
   s += '<span style="color:000000;font-size:10px;margin-bottom:5px;display:block;">Anuncios Google</span>' +
'<a href="' + google_ads[0].url +
'" target="_top" title="go to ' + google_ads[0].visible_url +
'"><img border="0" src="' + google_ads[0].image_url +
'"width="' + google_ads[0].image_width +
'"height="' + google_ads[0].image_height + '"></a>';
} else {
	if (google_ads.length == 1) {
	/*
	* Los sitios asociados deberán ajustar el tamaño del texto
	* de modo que los anuncios ocupen la mayor parte del espacio publicitario.
	*/
	   s += '<span style="color:000000;font-size:10px;margin-bottom:5px;display:block;">Anuncios Google</span>' +
	'<a href="' + google_ads[0].url + '" ' +
	'onmouseout="window.status=\'\'" ' +
	'onmouseover="window.status=\'go to ' +
	google_ads[0].visible_url + '\'" ' +
	'style="text-decoration:underline;font-size:16px;font-weight:bold;color:#E72A85;">' + google_ads[0].line1 + '</a><br>' +
	'<span style="color:#000000;margin-top:4px;display:block;font-size:14px;">' +
	google_ads[0].line2 + '&nbsp;' +
	google_ads[0].line3 + '<br></span>' +
	'<a href="' + google_ads[0].url + '" ' +
	'onmouseout="window.status=\'\'" ' +
	'onmouseover="window.status=\'go to ' +
	google_ads[0].visible_url + '\'" ' +
	'style="text-decoration:none;font-size:12px;color:#E72A85;">' +	
	google_ads[0].visible_url + '</a><br>';	
	}
	else if (google_ads.length > 1) {

   s += '<span style="color:000000;font-size:10px;margin-bottom:5px;display:block;">Anuncios Google</span><ul id="google_afc">'
	  /*
	  * En el caso de los anuncios de texto, añada cada uno de ellos a la cadena.
	  */
		for(i = 0; i < google_ads.length; ++i) {
		s += '<li class="afc' + i + '"><a href="' + google_ads[i].url + '" ' +
		'onmouseout="window.status=\'\'" ' +
		'onmouseover="window.status=\'go to ' +
		google_ads[i].visible_url + '\'" ' +
		'style="text-decoration:underline;font-size:13px;font-weight:bold;">' + google_ads[i].line1 + '</a><br>' +
		'<span style="color:#000000;margin-top:4px;display:block;">' +
		google_ads[i].line2 + '<br>' +
		google_ads[i].line3 + '<br></span>' +
		'<a href="' + google_ads[i].url + '" ' +
		'onmouseout="window.status=\'\'" ' +
		'onmouseover="window.status=\'go to ' +
		google_ads[i].visible_url + '\'" ' +
		'style="text-decoration:none;font-size:10px;">' +
		google_ads[i].visible_url + '</a></li>';
		}
	}
	
}
        s+= '<style>'
        s+= 'div#g_afc_advernet {width:950px; padding: 15px; margin-bottom: 15px;}'
        s+= 'div#g_afc_advernet ul {list-style-type: none;; margin: 0px; padding: 0px}'
        s+= 'ul#google_afc li {float: left; list-style-type: none; width: 230px; margin: 0px; padding: 0px}'
        s+= 'div#g_afc_advernet ul li a {color: #E72A85; font-size: 11px; }'
        s+= '</style>'

        document.write(s + '</ul>');
        return;
  }  

/*Publuicidad para BQP Resultados*/
function google_ad_request_done_BQP(google_ads) {
var google_ads = '';
/*
* Esta función es obligatoria y se utiliza para mostrar
* los anuncios obtenidos como respuesta a la solicitud de
* JavaScript. Deberá modificar los comandos
* document.write a fin de que el código HTML que escriba se ajuste
* a la disposición del anuncio.
*/
var s = '';
var i;
/*
* Verifique que hay anuncios para publicar.
*/
if (google_ads.length == 0) {
return;
}
/*
* Si se ofrece como resultado un anuncio gráfico, muestre ese anuncio.
* De lo contrario, cree una cadena que contenga todos los anuncios y,
* a continuación, utilice un comando document.write() para imprimir la cadena.
*/
if (google_ads[0].type == "image") {
   s += '<span style="color:000000;font-size:10px;margin-bottom:5px;display:block;">Anuncios Google</span>' +
'<a href="' + google_ads[0].url +
'" target="_top" title="go to ' + google_ads[0].visible_url +
'"><img border="0" src="' + google_ads[0].image_url +
'"width="' + google_ads[0].image_width +
'"height="' + google_ads[0].image_height + '"></a>';

} else {
	if (google_ads.length == 1) {
	/*
	* Los sitios asociados deberán ajustar el tamaño del texto
	* de modo que los anuncios ocupen la mayor parte del espacio publicitario.
	*/
	   s += '<span style="color:000000;font-size:10px;margin-bottom:5px;display:block;">Anuncios Google</span>' +
	'<a href="' + google_ads[0].url + '" ' +
	'onmouseout="window.status=\'\'" ' +
	'onmouseover="window.status=\'go to ' +
	google_ads[0].visible_url + '\'" ' +
	'style="text-decoration:underline;font-size:16px;font-weight:bold;color:#E72A85;">' + google_ads[0].line1 + '</a><br>' +
	'<span style="color:#000000;margin-top:4px;display:block;font-size:14px;">' +
	google_ads[0].line2 + '&nbsp;' +
	google_ads[0].line3 + '<br></span>' +
	'<a href="' + google_ads[0].url + '" ' +
	'onmouseout="window.status=\'\'" ' +
	'onmouseover="window.status=\'go to ' +
	google_ads[0].visible_url + '\'" ' +
	'style="text-decoration:none;font-size:12px;color:#E72A85;">' +	
	google_ads[0].visible_url + '</a><br>';	
	}
	else if (google_ads.length > 1) {

   s += '<span style="color:000000;font-size:10px;margin-bottom:5px;display:block;">Anuncios Google</span><ul id="google_afc">'
	  /*
	  * En el caso de los anuncios de texto, añada cada uno de ellos a la cadena.
	  */
		for(i = 0; i < google_ads.length; ++i) {
		s += '<li class="afc' + i + '"><a href="' + google_ads[i].url + '" ' +
		'onmouseout="window.status=\'\'" ' +
		'onmouseover="window.status=\'go to ' +
		google_ads[i].visible_url + '\'" ' +
		'style="text-decoration:underline;font-size:13px;font-weight:bold;">' + google_ads[i].line1 + '</a><br>' +
		'<span style="color:#d5d5d5;margin-top:4px;display:block;">' +
		google_ads[i].line2 + '<br>' +
		google_ads[i].line3 + '<br></span>' +
		'<a href="' + google_ads[i].url + '" ' +
		'onmouseout="window.status=\'\'" ' +
		'onmouseover="window.status=\'go to ' +
		google_ads[i].visible_url + '\'" ' +
		'style="text-decoration:none;font-size:10px;">' +
		google_ads[i].visible_url + '</a></li>';
		//AFC Google 728 pie -->
		}
	}	
}
        s+= '<style>'
        s+= 'div#g_afc_advernet {width:960px; padding: 15px; margin-bottom: 15px;}'
        s+= 'div#g_afc_advernet ul {list-style-type: none;; margin: 0px; padding: 0px}'
        s+= 'ul#google_afc li {float: left; list-style-type: none; width: 230px; margin: 0px; padding: 0px; margin-bottom: 27px;}'
        s+= 'div#g_afc_advernet ul li a {color: #E72A85; font-size: 11px; }'
        s+= '</style>'
    
        document.write(s + '</ul>');    
        return; 
  }
  
  
  /*************************************AFS Google**************************************/
  function google_afs_request_done(google_ads) {
     /*
     * Verify that there are actually ads to display.
     */
   
    var google_num_ads = google_ads.length;
    var query = ''
    if (google_num_ads <= 0)
      return;

    var wideAds = "";   //wide ad unit html text
    var narrowAds = "";   //narrow ad unit html text
    var headerText = '<div class="ad_header" style="text-align: right;">Anuncios Google</div>';
 
    for(i = 0; i < google_num_ads; i++){
      if (google_ads[i].type=="text/wide"){ 
      //** render a wide ad 
        wideAds+='<a href="' + google_ads[i].url + '" ' +
          'onmouseout="window.status=\'\';return true" ' +
          'onmouseover="window.status=\'go to ' +
          google_ads[i].visible_url + '\';return true" ' +
          'style="text-decoration:none;font-size:13px;">' +
          '<span style="text-decoration:underline">' +
          '<b>' + google_ads[i].line1 + '</b><br></span>' +
          '<span style="color:#000000;font-size:11px;">' +
          google_ads[i].line2 + '<br></span>' +
          '<span style="font-size:11px">' +
          google_ads[i].visible_url + '</span></a><BR><BR>';
      } else {
        //render a narrow ad
        narrowAds+='<div style="width:49%; float: left;"><a href="' + google_ads[i].url + '" ' +
          'onmouseout="window.status=\'\';return true" ' +
          'onmouseover="window.status=\'go to ' +
          google_ads[i].visible_url + '\';return true" ' +
          'style="text-decoration:none;font-size:13px">' +
          '<span style="text-decoration:underline;font-weight:bold;">' +
          google_ads[i].line1 + '<br></span>' +
          '<span style="color:#000000;font-size:11px;">' +
          google_ads[i].line2 + '<br></span>' +
          '<span style="color:#000000;font-size:11px;">' +
          google_ads[i].line3 + '<br></span>' +
          '<span style="font-size:11px;">' +
          google_ads[i].visible_url + '</span></a></div>';
      }
    }   
    if (narrowAds != "") {
		narrowAds = '<div>' + headerText + '</div><div style="padding: 7px 0;">' + narrowAds + '<div class="clear"></div></div>';
//      narrowAds = '<div class="ad_header" style="text-align:left;>' + 
//                  '</div>' + narrowAds + '</div>';
      document.write(narrowAds);
    }
    if (wideAds != "") {
	  wideAds = '<div>' + headerText + '</div>' + wideAds ;
//      wideAds = '<div class="ad_header" style="text-align:right">' +
//                  '</div>' + wideAds + '</div>';
      document.write(wideAds);
    }
    //** Write HTML for wide and narrow ads to the proper <div> elements
    document.getElementById("wide").innerHTML = wideAds;
    document.getElementById("narrow").innerHTML = narrowAds;
   
  }
/*<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_ads.js"></script>

/*************************************AFS Google**************************************/

/*Publicidad de Google para Busquedas*/
function Publicidad_Google()
{ 
  var  query = ''//meter busque usuario
  var url= location.href;
  var Param_Url=  url.split('/');
  var pagina=1;
   for (var i=0;i<Param_Url.length;i++)
   {  
       if (Param_Url[i].indexOf('palabra_')!= -1| Param_Url[i].indexOf('tematica_')!= -1 | Param_Url[i].indexOf('en_')!= -1  |   Param_Url[i].indexOf('pagina_')!= -1   |   Param_Url[i].indexOf('area-de-empresa_')!= -1 )  
       {
        if(  Param_Url[i].indexOf('pagina_')!= -1)
        {
        pagina= (Param_Url[i].split('_'))[1];
        }
        else
         query= query+'+'+(Param_Url[i].split('_'))[1];
       }
   }
        query = query.replace("-","+");
        query = query.replace("nn","ñ");
        
    if(query == ''){
		if(url.indexOf('/cursos/') == -1 ) {
			query = 'trabajo';
		}
 		else {
        query = 'formacion';
		}
    }
	
    google_afs_query = query;
	google_afs_qry_lnk = query;
	google_afs_qry_ctxt = '';
    google_afs_ad = 'w4n2';
    google_afs_client = 'ozu-clasificados';
    google_afs_channel = 'infoempleo';
    google_afs_ie = 'latin1';
    google_afs_oe = 'latin1';
    google_afs_adsafe = 'high';
    google_afs_adtest = 'off';
    google_afs_hl = 'es';
    google_afs_adpage = pagina; //meter pagina

} 
   