// 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;
	document.write("<div id=\"googleAd\" style=\"width:100%\"><h1><div class=\"mleft\">Ads by Google</div><div class=\"mright\"><a href=\"javascript:commonPopup('../googlePopup.jhtml', '320', '330')\">What's This?</a></div></h1>");
 
    // 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) {
        document.write("<h2>" +
          "<a href=\"" +  google_ads[i].url + "\" target=\"_blank\">" +
          google_ads[i].line1 + "</a></h2>" + "<h3>" +
          google_ads[i].line2  + 
		  google_ads[i].line3 +  "</h3>" + "<h4>" +
          "<a href=\"" + google_ads[i].url + "\" target=\"_blank\">" + 
          google_ads[i].visible_url +
          "</a><br></h4>"); 
      }
    }

    // For an image ad, display the image; there will be only one .
    if (google_ads[0].type == 'image') {
      document.write("<tr><td align=\"center\">" +
        "<a href=\"" + google_ads[0].url + "\" target=\"_blank\">" +
        "<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
    document.write ("</div>");
}


// This script sets the attributes for requesting ads.
google_ad_client = "ca-reuters_js";         
google_ad_output = "js";         
google_max_num_ads = 3;         
google_safe     = "medium";
google_feedback = "on";
google_ad_type  = "text_image";
google_color_line = "ff0000";    
