var google_oben = '';
var google_mitte = '';
var google_unten = '';
var google_afs_client = 'pub-4371102386427414'; // substitute your client ID
//var google_afs_adsafe = 'medium'; // specify level for filtering non-family-safe ads
//var google_afs_hl = 'de';

function google_afs_request_done(google_ads) {
	if (google_ads.length > 0 ) {
		google_oben = '<table class="googlebox">';
		google_oben += '<tr><th><a href="https://www.google.com/adsense/support/bin/request.py?contact=afs_violation" target="_blank">Google-Anzeigen</a></th></tr>';
		kw += " ";
		Ergebnis = kw.match(/([^ ]*) /g);
		for(i = 0; i < anzahl_oben; ++i) {
			if (google_ads[i] && google_ads[i].line1 && google_ads[i].line2) {
				line1 = google_ads[i].line1;
				line2 = google_ads[i].line2;
				if (google_ads[i].line3)
					line3 = google_ads[i].line3;
				else
					line3 = '';
				if (Ergebnis)
				google_oben += '<tr>' +
					'<td onmouseover="this.style.backgroundColor=\'#D0E5FB\';"'+
					' onmouseout="this.style.backgroundColor=\'#FFFFFF\';">' +
						'<a class="googlebox_title" id=\'gtd'+i+'\' href="' + google_ads[i].url + '" onmouseover="'+
						'return window.status = \''+google_ads[i].visible_url+'\';" target="_blank"> '+ line1 + '</a> &nbsp; ' + line2 + '&nbsp;' + line3 +
						'<a class="googlebox_url" id="gtdl'+i+'" href="' + google_ads[i].url + '" onmouseover="'+
						'return window.status = \''+google_ads[i].visible_url+'\';" target="_blank">' + google_ads[i].visible_url + '</a>' +
					'</td>' +
					'</tr>';
			}
		}
		google_oben += '</table>';
	}
	if (google_ads.length > 5 ) {
		google_mitte = '<table class="googlebox">';
		google_mitte += '<tr><th><a href="https://www.google.com/adsense/support/bin/request.py?contact=afs_violation" target="_blank">Google-Anzeigen</a></th></tr>';
		kw += " ";
		Ergebnis = kw.match(/([^ ]*) /g);
		for(i = i; i < anzahl_mitte; ++i) {
			if (google_ads[i] && google_ads[i].line1 && google_ads[i].line2) {
				line1 = google_ads[i].line1;
				line2 = google_ads[i].line2;
				if (google_ads[i].line3)
					line3 = google_ads[i].line3;
				else
					line3 = '';
				if (Ergebnis)
				google_mitte += '<tr>' +
					'<td onmouseover="this.style.backgroundColor=\'#D0E5FB\';"'+
					' onmouseout="this.style.backgroundColor=\'#FFFFFF\';">' +
						'<a class="googlebox_title" id=\'gtd'+i+'\' href="' + google_ads[i].url + '" onmouseover="'+
						'return window.status = \''+google_ads[i].visible_url+'\';" target="_blank"> '+ line1 + '</a> &nbsp; ' + line2 + '&nbsp;' + line3 +
						'<a class="googlebox_url" id="gtdl'+i+'" href="' + google_ads[i].url + '" onmouseover="'+
						'return window.status = \''+google_ads[i].visible_url+'\';" target="_blank">' + google_ads[i].visible_url + '</a>' +
					'</td>' +
					'</tr>';
			}
		}
		google_mitte += '</table>';
	}
	if (google_ads.length > 7 ) {
		google_unten = '<table class="googlebox">';
		google_unten += '<tr><th><a href="https://www.google.com/adsense/support/bin/request.py?contact=afs_violation" target="_blank">Google-Anzeigen</a></th></tr>';
		kw += " ";
		Ergebnis = kw.match(/([^ ]*) /g);
		for(i = i; i < anzahl_unten; ++i) {
			if (google_ads[i] && google_ads[i].line1 && google_ads[i].line2) {
				line1 = google_ads[i].line1;
				line2 = google_ads[i].line2;
				if (google_ads[i].line3)
					line3 = google_ads[i].line3;
				else
					line3 = '';
				if (Ergebnis)
				google_unten += '<tr>' +
					'<td onmouseover="this.style.backgroundColor=\'#D0E5FB\';"'+
					' onmouseout="this.style.backgroundColor=\'#FFFFFF\';">' +
						'<a class="googlebox_title" id=\'gtd'+i+'\' href="' + google_ads[i].url + '" onmouseover="'+
						'return window.status = \''+google_ads[i].visible_url+'\';" target="_blank"> '+ line1 + '</a> &nbsp; ' + line2 + '&nbsp;' + line3 +
						'<a class="googlebox_url" id="gtdl'+i+'" href="' + google_ads[i].url + '" onmouseover="'+
						'return window.status = \''+google_ads[i].visible_url+'\';" target="_blank">' + google_ads[i].visible_url + '</a>' +
					'</td>' +
					'</tr>';
			}
		}
		google_unten += '</table>';
	}
	return;
}

