/*
* This function is required. It processes the google_ads JavaScript object,
* which contains AFS ads relevant to the user's search query. The name of
* this function must be google_afs_request_done. If this
* function is not named correctly, your page will not display AFS ads.
*/
function google_afs_request_done(google_ads)
{
/*
* Verify that there are actually ads to display.
*/
var google_num_ads = google_ads.length;
if (google_num_ads <= 0)
{
return;
}
var wideAds = ""; // wide ad unit html text
var wideFooterAds = ""; // wide ad unit html text
var narrowAds = ""; // narrow ad unit html text
var number = "1"; // narrow ad unit html text
var tel = "0"; // narrow ad unit html text
for(i = 0; i < google_num_ads; i++)
{
if (google_ads[i].type == "image") {
narrowAds += '' +
'' +
'
';
}
else if (google_ads[i].type=="text/wide")
{
tel++;
if (tel>6)
{
// render a wide footerad
wideFooterAds+='