// 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\" class=\"textAd\"><div class=\"textAdHeader\"><h3>Ads by Google</h3><div class=\"headerLink\"><a href=\"javascript:commonPopup('/helpandinfo/GoogleWhatsThis.aspx', '320', '330')\">What's This?</a></div></div><div class=\"textAdBody\">");
	
	// 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("<p>" + 
		"<a href=\"" + google_ads[i].url + "\"target=_blank\"" + "\">" +
		google_ads[i].line1 + "</a><br />" + 
		google_ads[i].line2  + 
		google_ads[i].line3 +  "<br />" +
		"<a href=\"" + google_ads[i].url + "\"target=_blank\"" + "\">" +
		google_ads[i].visible_url +
		"</a></p>"); 
	}
	}

	// 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>"); //end of textAdBody
	document.write ("</div>"); //end of textAd
	document.write ("</div>"); //end of textAdHeader
	google_encoding = "utf8";
}

