function google_afs_request_done(google_ads)
{
	/*
	 * Verify that there are actually ads to display.
	 */
	var google_num_ads = google_ads.length;
	var count_w1 = 0;
	var count_w2 = 0;
	var count_n1 = 0;

	if (google_num_ads <= 0)
	{
		return;
	}

	var wideAds_1 = ""; // wide ad unit html text
	var wideAds_2 = ""; // wide ad unit html text
	var narrowAds = ""; // narrow ad unit html text

	for(i = 0; i < google_num_ads; i++)
	{
		if (!google_ads[i].line3)
			google_ads[i].line3 ="";
		else
			google_ads[i].line3 =" "+google_ads[i].line3;

		if (google_ads[i].type=="text/wide")
		{

			 if (count_w1>=numads_w1)
			 {
			 	if (count_w2>=numads_w2)
			 		continue;
					// render a wide ad
					wideAds_2 +='<li class="ADS_title"><h1><a href="' + google_ads[i].url+ '" class="top" target="_blank" onclick="trackClick(\'AFS middle\')">' +google_ads[i].line1 + '</a></h1><li>' +
					'<li class="ADS_text"><h2>' + google_ads[i].line2 + google_ads[i].line3 + '</h2></li>' +
					'<li class="ADS_link"><h3><a href="' + google_ads[i].url + '" class="link" target="_blank" onclick="trackClick(\'AFS middle\')">' + google_ads[i].visible_url + '</a></h3></li>';
					count_w2++;
			 } else
			 {
			 	// render a wide ad
					wideAds_1 +='<li class="ADS_title"><h1><a href="' + google_ads[i].url+ '" class="top" target="_blank" onclick="trackClick(\'AFS top\')">' +google_ads[i].line1 + '</a></h1><li>' +
					'<li class="ADS_text"><h2>' + google_ads[i].line2 + google_ads[i].line3 + '</h2></li>' +
					'<li class="ADS_link"><h3><a href="' + google_ads[i].url + '" class="link" target="_blank" onclick="trackClick(\'AFS top\')">' + google_ads[i].visible_url + '</a></h3></li>';
					count_w1++;
			 }
		} else
		{
			if (count_n1>=numads_n1)
			 		continue;
			// render a narrow ad
			narrowAds+='<li class="ADS_title"><h1><a href="' + google_ads[i].url+ '" class="top" target="_blank" onclick="trackClick(\'AFS right\')">' +google_ads[i].line1 + '</a></h1><li>' +
					'<li class="ADS_text"><h2>' + google_ads[i].line2 + google_ads[i].line3 + '</h2></li>' +
					'<li class="ADS_link"><h3><a href="' + google_ads[i].url + '" class="link" target="_blank" onclick="trackClick(\'AFS right\')">' + google_ads[i].visible_url + '</a></h3></li>';
			count_n1++;
		}
	}

	if (document.getElementById("narrow_ad_unit_1") && narrowAds != "")
	{
		narrowAds = '<div class="ADS_bygoogle"><a href="http://services.google.com/feedback/online_hws_feedback">'+
				'Ads by Google</a></div><ul>' + narrowAds+'</ul>';
		document.getElementById("narrow_ad_unit_1").innerHTML = narrowAds;
	} else if (document.getElementById("narrow_ad_unit_1"))
	{
		document.getElementById("narrow_ad_unit_1").style.display = "none";
	}

	if (document.getElementById("wide_ad_unit_1"))
	{
		if (count_w1>0)
		{
			wideAds_1 = '<div class="ADS_bygoogle"><a href="http://services.google.com/feedback/online_hws_feedback">'+
						'Ads by Google</a></div><ul>'+wideAds_1 +'</ul>';
			document.getElementById("wide_ad_unit_1").innerHTML = wideAds_1;
		} else
		{
			document.getElementById("wide_ad_unit_1").style.display = "none";
		}
	}

	if (document.getElementById("wide_ad_unit_2"))
	{
		if (document.getElementById("wide_ad_unit_2") && count_w2>0)
		{
			wideAds_2 = '<div class="ADS_bygoogle"><a href="http://services.google.com/feedback/online_hws_feedback">'+
						'Ads by Google</a></div><ul>'+wideAds_2 +'</ul>';
			document.getElementById("wide_ad_unit_2").innerHTML = wideAds_2;
		} else
		{
			document.getElementById("wide_ad_unit_2").style.display = "none";
		}
	}
	return;
}