/*
* This function retrieves the search query from the URL.
*/

function GetParam(name) {
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var tmpURL = window.location.href;
  var results = regex.exec( tmpURL );
  if( results == null )
    return "";
  else
    return results[1];
}



/*
 * 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 <i>must</i> be <b>google_afs_request_done</b>. 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 narrowAds = "";   // narrow ad unit html text

    for(i = 0; i < google_num_ads; i++)
    {
        if (google_ads[i].type=="text/wide")
        {
            // render a wide ad
            wideAds+='<p style="margin:5px;"><a class="ad_line1" target="_blank" onmouseover="javascript:window.status=\'' +
                    google_ads[i].url + '\';return true;" ' +
                    'onmouseout="javascript:window.status=\'\';return true;" ' +
                    'href="' + google_ads[i].url + '">' +

                    google_ads[i].line1 + '</a><br>' +
                    
                    '<a class="ad_line2" href="' + google_ads[i].url + '" target="_blank"><span class="ad_text">' + google_ads[i].line2 + '</span></a><br>' +
                    
                    '<a class="ad_url" target="_blank" onmouseover="javascript:window.status=\'' +
                    google_ads[i].url + '\';return true;" ' +
                    'onmouseout="javascript:window.status=\'\';return true;" ' +
                    'href="' + google_ads[i].url + '">' +
                    
                     google_ads[i].visible_url + '<br/>&nbsp;</a></p>';
        }

        else
        {
            // render a narrow ad
            narrowAds+='<p class="p_b_lijn"><p class="p_b_0">' +
            		'<a target="_blank" style="text-decoration:underline;" onmouseover="javascript:window.status=\'' +
                    google_ads[i].url + '\';return true;" ' +
                    'onmouseout="javascript:window.status=\'\';return true;" ' +
                    'href="' + google_ads[i].url + '">' +
                    '<span class="ad_line1">' + google_ads[i].line1 + '</span></a><br>' +
                    '<span class="ad_text">' + google_ads[i].line2 + '</span><br>' +
                    '<span class="ad_text">' + google_ads[i].line3 + '</span><br>' +
                    '<a target="_blank" style="text-decoration:none; font-size:90%; font-weight:normal;" onmouseover="javascript:window.status=\'' +
                    google_ads[i].url + '\';return true;" ' +
                    'onmouseout="javascript:window.status=\'\';return true;" ' +
                    'href="' + google_ads[i].url + '">' + google_ads[i].visible_url + '</a></p>';
        }
    }

    if (narrowAds != "")
    {
        narrowAds = '<p class="p_ban_kop"><a style="text-decoration:none" ' +
                    'href="http://services.google.com/feedback/online_hws_feedback">' +
                    'Gesponsorde Koppelingen</span></a></p>' + narrowAds;
    }

    if (wideAds != "")
    {
        wideAds = '<p class="p_blok_m_geel_balk"><a target="_blank" style="text-decoration:none" ' +
                  'href="http://services.google.com/feedback/online_hws_feedback">' +
                  '<span class="ad_header" style="text-align:left">Advertenties door Google</span></a></p>' + wideAds;
    }

    // Write HTML for wide and narrow ads to the proper <div> elements
    document.getElementById("wide_ad_unit").innerHTML = wideAds;
    document.getElementById("narrow_ad_unit").innerHTML = narrowAds;
}

google_afs_client = 'pub-1772393173576368'
google_afs_hl = 'nl';

