var google_adnum = 0;

function google_ad_request_done(google_ads) {

	var s = '';
	var i;

	if (google_ads.length == 0) {
		return;
	}

	if (google_ads[0].type == "image") {

		s += '<div class="google-image"><span class="by-google"><a target=_blank href=\"' +
		google_info.feedback_url + '\">Ads by Google</a></span> <br /><a target=_blank href="' +
		google_ads[0].url + '" target="_top" title="go to ' +
		google_ads[0].visible_url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
		google_ads[0].visible_url + '\';return true"><img border="0" src="' +
		google_ads[0].image_url + '"width="' +
		google_ads[0].image_width + '"height="' +
		google_ads[0].image_height + '"></a></div>';

	}
	else
	{

		if (google_ads.length == 1) {

			/*
			* Partners should adjust text sizes
			* so ads occupy the majority of ad space.
			*/

			s += '<div class="google-txt"><span class="by-google"><a target=_blank href=\"' + google_info.feedback_url + '\">Ads by Google</a></span>';

			s += '<br><a target=_blank class="google-title" href="' +
			google_ads[0].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
			google_ads[0].visible_url + '\';return true">' +
			google_ads[0].line1 + '</a> - <a target=_blank class="google-url" href="' +
			google_ads[0].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
			google_ads[0].visible_url + '\';return true">' +
			google_ads[0].visible_url + '</a>&nbsp;&nbsp; ' +
			google_ads[0].line2 + ' ' +
			google_ads[0].line3 + '<br /></div>';

		} else if (google_ads.length > 1) {

			s += '<div class="google-txt"><span class="by-google"><a target=_blank href=\"' + google_info.feedback_url + '\">Ads by Google</a></span><ul>'

			/*
			* For text ads, append each ad to the string.
			*/

			for(i = 0; i < google_ads.length; ++i) {

				s += '<li><a target=_blank class="google-title" href="' +
				google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
				google_ads[i].visible_url + '\';return true">' +
				google_ads[i].line1 + '</a> - ' +
				google_ads[i].line2 + ' ' +
				google_ads[i].line3 + '<br /> ' + '<a target=_blank class="google-url" href="' +
				google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
				google_ads[i].visible_url + '\';return true">' +
				google_ads[i].visible_url + '</a>&nbsp;&nbsp; </li>';
			}

			s += '</ul></div>';
		}
	}


	if (google_ads[0].bidtype == "CPC") { /* insert this snippet for each ad call */
		google_adnum = google_adnum + google_ads.length;
	}

	document.write(s);
	return;
}
