// Google Adsense
// 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;

// Display ads in a table
document.write("<table class=\"google_adcolumn\" cellspacing=\"0\">");

// Print "Ads By Google" -- include link to Google feedback page if available
document.write("<tr><td>");
document.write("<div class=\"adsby\">");
if (google_info.feedback_url) {
  document.write("<a href=\"" + google_info.feedback_url + 
	"\">Ads by Google</a>");
} else {
  document.write("Ads By Google");
}
document.write("</div>");  

// 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) {// google_ads.length; ++i) {
	document.write("<div class=\"adsense\">" +
	  "<a href=\"" +  google_ads[i].url + "\">" +
	  google_ads[i].line1 + "</a><br/> " +
	  google_ads[i].line2 + " " +
	  google_ads[i].line3 + "<br/>" + 
	  "<span class=\"url\">" + 
	  google_ads[i].visible_url +
	  "</span></div>"); 
  }
}

// For an image ad, display the image; there will be only one .
if (google_ads[0].type == 'image') {
  document.write("<div class=\"adsense\">" +
	"<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></div>");
}

// Finish up anything that needs finishing up
document.write ("</td></tr></table>");
} 

google_hints = "San Jose, California";