/* * 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 wideAdUnit1 = ""; var wideAdUnit2 = ""; var wideAdUnit3 = ""; 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++; // render a wide ad wideAds+='
' + '' + google_ads[i].line1 + '
' + '' + google_ads[i].line2 + ' ' + '' + '' + google_ads[i].visible_url + '
'; number++; } else { // render a narrow ad narrowAds+='
' + '' + google_ads[i].line1 + '
' + '' + google_ads[i].line2 + '
' + '' + google_ads[i].line3 + '
' + '' + '' + google_ads[i].visible_url + '

'; if (number > 1) number=1; else number++; } // Write HTML for wide and narrow ads to the proper
elements if (i < 5) { wideAdUnit1 += wideAds; wideAds = ''; } else if (i > 4 && i < 10) { wideAdUnit2 += wideAds; wideAds = ''; } else if (i > 9) { wideAdUnit3 += wideAds; wideAds = ''; } if (tel == 5) { tel = 0; } } if (wideAdUnit1 != "") { wideAdUnit1 = '
'; document.getElementById("wide_ad_unit1").innerHTML = wideAdUnit1; } if (wideAdUnit2 != "") { wideAdUnit2 = '
'; document.getElementById("wide_ad_unit2").innerHTML = wideAdUnit2; } if (wideAdUnit3 != "") { wideAdUnit3 = '
'; document.getElementById("wide_ad_unit3").innerHTML = wideAdUnit3; } } google_max_num_ads = ''; google_ad_type = "text"; google_feedback = 'on'; google_afs_query = ''; google_hints = ''; google_afs_ad = 'w'; // specify the number of ads you are requesting google_analytics_uacct = ""; // adsense tracking google_afs_client = 'pub-6480656561724574'; // substitute your client ID google_afs_channel = ''; // enter your custom channel ID google_afs_hl = 'nl'; // enter your interface language if not English google_afs_ie = 'utf8'; // select input encoding scheme google_afs_oe = 'utf8'; // select output encoding scheme