function GetParam(name)
{
var match = new RegExp(name + "=(.+)[&]","i").exec(location.search);
if (match==null)
{
match = new RegExp(name + "=(.+)","i").exec(location.search);
}
if (match==null)
{
return null;
}
match = match + "";
result = match.split(",");
return result[1];
}
function google_afs_request_done(google_ads)
{
/*
* Vérifiez qu'il existe bien des annonces à afficher.
*/
var google_num_ads = google_ads.length;
if (google_num_ads <= 0)
{
return;
}
var wideAds = ""; // texte html d'ensemble d'annonces grand format
var narrowAds = ""; // texte html d'ensemble d'annonces petit format
for(i = 0; i < google_num_ads; i++)
{
if (google_ads[i].type=="text/wide"){
// render a wide ad
wideAds+='' +
'' + google_ads[i].line1 + '
' +
'' + google_ads[i].line2 + '
' +
'' +
'' + google_ads[i].visible_url + '
';
} else {
// produire une annonce petit format
narrowAds+='' +
'' + google_ads[i].line1 + '
' +
'' + google_ads[i].line2 + '
' +
'' + google_ads[i].line3 + '
' +
'' +
'' + google_ads[i].visible_url + '
';
}
}
if (narrowAds != ""){
narrowAds = '' +
' Annonces Google
' + narrowAds;
}
if (wideAds != ""){
wideAds = '' +
' Annonces Google
' + wideAds;
}
// Écrire du code HTML pour des annonces grand format ou petit format dans les éléments