	function ss(w) {
		window.status = w;
		return true;
	}
	function cs(){
		window.status='';
	}
	function ca(dir) {
	  window.open(dir,'','');	  
	 }	
	// This function displays the ad results.
    // It must be defined above the script that calls show_ads.js
    // to guarantee that it is defined when show_ads.js makes the call-back.

    function google_ad_request_done(google_ads) {
        // Proceed only if we have ads to display!
        if (google_ads.length < 1 ) {
            return;
        }
		
        var texto_google = "";
        // Display ads in a table
		//para lateral arriba:             texto_google = texto_google  + "<div class='google' id='google' style='width: 144px; position:absolute; top:1px; left:958px;'>";
        if (google_sitio == 'home') {
            texto_google = texto_google  + "<div id='googlehome' style='width: 300px; position:relative;'>";
            texto_google = texto_google  + "<table width=300>";
        }else if (google_sitio == 'videos') {	
            texto_google = texto_google  + "<div id='googlehome' style='width: 416px; position:relative;'>";
            texto_google = texto_google  + "<table width=416>";	
        }else if (google_sitio == 'photo') {				
            texto_google = texto_google  + "<div id='googlehome' style='width: 809px; position:relative;'>";
            texto_google = texto_google  + "<table width=809>";	
        }else if (google_sitio == 'pie') {				
            texto_google = texto_google  + "<div id='googlehome' style='width: 809px; position:relative;'>";
            texto_google = texto_google  + "<table width=809>";				
		}else if (google_sitio == 'newsb') {			
            texto_google = texto_google  + "<div id='googlehome' style='width: 416px; position:relative;'>";
            texto_google = texto_google  + "<table width=416>";	
			//alert('motogp');
		
		}else if (google_sitio == 'news') {			
            texto_google = texto_google  + "<div id='googlehome' style='width: 484px; position:relative;'>";
            texto_google = texto_google  + "<table width=484>";
            //texto_google = texto_google  + "<div class='google' id='google' style='width: 144px; position:absolute; top:1px; left:958px;'>";
            //texto_google = texto_google  + "<table>";			
        } else if (google_sitio == 'results') {
            texto_google = texto_google  + "<div class='google' id='google' style='width: 668px; position:absolute; top:2px; left:400px;'>";
            texto_google = texto_google  + "<table width= 468>";
        } else {
            texto_google = texto_google  + "<div class='google' id='google' style='width: 144px; position:absolute; top:2px; left:955; float:left;'>";
            texto_google = texto_google  + "<table>";
        }
//////////////////////
		// Print "Ads By Google" -- include link to Google feedback page if available
        texto_google = texto_google + "<div class='adg'>";
        if (google_info.feedback_url) {
            texto_google = texto_google + "<a target='_new' href='" + google_info.feedback_url + "' class='linkadg'>Ads by Google</a>";
        } else {
            texto_google = texto_google + "Ads by Google";
        }
        texto_google = texto_google + "</div>";

        for(i = 0; i < google_ads.length; ++i) {
            if (google_ads[i].type == 'text') {
                if (google_sitio == 'home' || google_sitio == 'videos' || google_sitio == 'photo' || google_sitio == 'pie') {
                    texto_google = texto_google + "<div class='item'><a href='" + google_ads[i].url + "' style='text-decoration:none' target='_blank'><span class='ppal'>" +
                    google_ads[i].line1 + "</span></a>";
                    texto_google = texto_google + "<span class='line2'>" + google_ads[i].line2 + "<br />" + google_ads[i].line3;
                    texto_google = texto_google + "</span><a href='" + google_ads[i].url+ "' style='text-decoration:none' target='_blank'>" +
                    "<span class='enlace'/>" +
                    google_ads[i].visible_url +
                    "</span></a></div>";
                } else if ((google_sitio == 'news') || (google_sitio == 'results')) {
                    texto_google = texto_google  + "<tr><td style='cursor:pointer; cursor:hand' onFocus=\"ss('"+  google_ads[i].visible_url+ "')\" onMouseOver=\"ss('"+  google_ads[i].visible_url+ "')\" onMouseOut=\"cs()\" onClick=\"ca('"+  google_ads[i].url + "')\" >" +
                    "<font class='ppal'/>" + google_ads[i].line1 + "</font>" + " - " + 
                    "<font class='enlace'/>" +
                    google_ads[i].visible_url +
                    "</font><br>" +
                    google_ads[i].line2 + " " + google_ads[i].line3 + 
                    "</td></tr>";
                }
            } else if (google_ads[i].type == 'image') {
                // For an image ad, display the image; there will be only one .
                texto_google = texto_google  + "<tr><td align=\"center\">" +
                "<a target='_new' href='" + google_ads[i].url + "\">" +
                "<img src='" + google_ads[i].image_url +
                "' height='" + google_ads[i].height +
                "' width='" + google_ads[i].width +
                "' border='0'></a></td></tr>";
            }
        }
        texto_google = texto_google  +"</table>";
        texto_google = texto_google  +"</div>";
        document.write(texto_google);

    }

    function google_ad_set_params(lang, cant, sitio) {
        if (sitio == undefined) {
            google_sitio = 'home';
        } else {
            google_sitio = sitio;
        }
        
        google_adtest = 'off'; // para pruebas
        google_ad_client = "pub-9498798600460979";
//        google_ad_channel = lang;

        google_ad_output = "js";
        if (cant > 0) { google_max_num_ads = cant; } 
        else { google_max_num_ads = 4; }
        
        // google_encoding = 'sjis'
        if (lang == "es")      { google_language = "es"; google_encoding = "utf8"; google_ad_channel ="1606830551"; } 
        else if (lang == "de") { google_language = "de"; google_encoding = "utf8"; google_ad_channel ="4815398017"; } 
        else if (lang == "fr") { google_language = "fr"; google_encoding = "utf8"; google_ad_channel ="4755396255"; } 
        else if (lang == "it") { google_language = "it"; google_encoding = "utf8"; google_ad_channel ="4606265826"; }
        else if (lang == "nl") { google_language = "nl"; google_encoding = "utf8"; google_ad_channel ="7374605741"; }
        else if (lang == "ja") { google_language = "ja"; google_encoding = 'utf8'; google_ad_channel ="2553084830"; }
        else if (lang == "pt") { google_language = "pt"; google_encoding = "utf8"; google_ad_channel ="3932831397"; }
        else                   { google_language = "en"; google_encoding = "utf8"; google_ad_channel ="1251781548"; }
        
        

        google_safe     = "medium";
        google_feedback = "on";
        google_ad_type  = "text";
        google_color_line = "ff0000";

        google_ad_width = 728;
        google_ad_height = 90;
        google_ad_format = "728x90_as";
        google_ad_type = "text_image";
    }
    
