

  
  // 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 s = '';
      
    // Display ads in a table
    s += '<table cellpadding="6" width="100%" align="left">';
 
    // Print "Ads By Google" -- include link to Google feedback page if available
    s += '<tr><td align="right">' +
      '<div style="text-align:right;font-size:10pt">';
    
    if (google_info.feedback_url) {
      s += '<a href="' + google_info.feedback_url + '">Annonces Google</a>';
    } else {
      s += 'Annonces Google';
    }
        
    s += '</div></td></tr>';


    // For text ads, display each ad in turn.
    // In this example, each ad goes in a new row in the table.
    if (google_ads[0].type == 'text') { 
      for(i = 0; i < google_ads.length; ++i) {
       s += '<tr><td nowrap style="cursor:pointer;" onclick="javascript:top.location.href=\'' + google_ads[i].url + '\'" onmouseover="this.style.backgroundColor=\'#FFFFFF\';"  onmouseout="this.style.backgroundColor=\'\';" style="text-align:left;">' +
         '<a style="cursor:pointer;cursor:hand;text-decoration:none" onclick="javascript:top.location.href=\'' + google_ads[i].url + '\'" onmouseover="window.status=\'Afficher la page' + google_ads[i].visible_url + '\'" onmouseout="window.status=\'\'">' +
         '<span style="color:#000099;text-decoration:underline;font-size:10pt;font-weight:bold;">' + google_ads[i].line1 + '<br></span>' +
         '<span style="color:#000000;font-size:8pt">'  + google_ads[i].line2 + '&nbsp;' + google_ads[i].line3 + '<br></span>' +
         '<span style="color:#008000;font-size:7pt">' + google_ads[i].visible_url +
         '</span></a><br></td></tr>';
          
      }
    }


    // For an image ad, display the image; there will be only one .
    if (google_ads[0].type == 'image') {
      s += '<tr><td align="center">' +
        '<a href="' + google_ads[0].url + '"style="text-decoration: none">' +
        '<img src="' + google_ads[0].image_url + 
        '" height="' + google_ads[0].height + 
        '" width="' + google_ads[0].width +
        '" border="0"></a></td></tr>';
    }


    // Finish up anything that needs finishing up
    s += '</table>';
    
    document.write(s);
    return;
  }



