    $.googleAdsense = {
            init: function(google_ads){
                    this.google_ads = google_ads;
            },

            startPosition: 0,

            defaultOptions:{
                    position: 'locationTable',
                    rows: 2,
                    cols: 2,
                    googleText: 'Ads by Google',
                    zebra: true,
                    extraClass: false,
                    lineBreak: true,
                    tableClass: 'googleAdsTable'
            },

            display: function(options){

                    if(this.google_ads.length == 0){
                            document.write('geen google ads aanwezig...');
                    }

                    this.options = $.extend({},this.defaultOptions,options);


                    switch(this.options.position){
                            case 'locationTable':
                                    this.showTable();
                                    break;
                            case 'locationLine':
                                    this.showLines();
                                    break;
                            case 'locationSingleLine':
                                    this.showSingleLine();
                                    break;
                    }


            },

            //function to display the google ads in a table.
            showTable: function(){

                    var end = this.startPosition+(this.options.rows*this.options.cols);
                    var tdClass = '';
                    var s = '';
                    var width = (100/this.options.cols);
                    width = Math.floor(width);

                    s += '<br/><a class="googleLinkUrl" href="https://www.google.com/adsense/support/bin/request.py?contact=afs_violation&" style=" text-decoration:none;color:000000; float:left;">' + this.options.googleText + '</a><br/>';
                    s += '<table cellpadding="0" cellspacing="0" border="0" class="' + this.options.tableClass + '" style="padding-top: 5px;">';

                    var j = 0;
                    for(var i = this.startPosition; i < end; i++){
                            if(i%this.options.cols == 0){
                                    s += '<tr>';
                                    j++;
                            }

                            if(this.options.zebra){
                                    if(j%2 == 0){
                                            tdClass = 'oneven';
                                    } else {
                                            tdClass = '';
                                    }
                            }

                            if(this.options.extraClass){
                                    tdClass = ' ' + this.options.extraClass;
                            }

                            s += '<td class="' + tdClass + '" width="' + width + '%">';

                            s += '<h2><a style="text-decoration:none; color: #0000FF" href="';
                            s += this.google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'ga naar ';
                            s += this.google_ads[i].visible_url + '\';return true" target="_blank"> <span style="text-decoration:underline"> <b>';
                            s += this.google_ads[i].line1 + '</b><br></span></a></h2> <span style="color:#000000">';
                            s += this.google_ads[i].line2;

                            if(this.options.lineBreak){
                                    s += '<br/>';
                            }

                            s += this.google_ads[i].line3 + '<br></span> <span><a style="color:#a4a4a4;text-decoration:none" href="';
                            s += this.google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'ga naar ';
                            s += this.google_ads[i].visible_url + '\';return true" target="_blank">';
                            s += this.google_ads[i].visible_url + '</span></a>';

                            s += '</td>';

                            if((i+1)%this.options.cols == 0){
                                    s += '</tr>';
                            }

                    }

                    s += '</table>';

                    document.write(s);
                    this.startPosition = (end);
            },

            //function to display the google ads in a line-style table.
            showLines: function(){

                    var end = this.startPosition+(this.options.rows*this.options.cols);
                    var tdClass = '';
                    var s = '';

                    s += '<br/><br/><a class="googleLinkUrl" href="https://www.google.com/adsense/support/bin/request.py?contact=afs_violation&" style="text-decoration:none;color:000000; float:left;">' + this.options.googleText + '</a>';
                    s += '<table cellpadding="0" cellspacing="0" border="0" class="' + this.options.tableClass + '" width="100%" style="padding-top: 5px;">';

                    var j = 0;
                    for(var i = this.startPosition; i < end; i++){

                            if(i%this.options.cols == 0){
                                    s += '<tr>';
                                    j++;
                            }

                            if(this.options.zebra){
                                    if(j%2 == 0){
                                            tdClass = 'oneven';
                                    } else {
                                            tdClass = '';
                                    }
                            }

                            if(this.options.extraClass){
                                    tdClass = ' ' + this.options.extraClass;
                            }


                            s += '<td class="' + tdClass + '" width="100%" style="padding-bottom: 10px;">';


                            s += '<h2 style="clear:none; float: left; padding-right: 5px; vertical-align: middle;">';
                            s += '<a style="text-decoration:none; color: #0000FF" href="';
                            s += this.google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'ga naar ';
                            s += this.google_ads[i].visible_url + '\';return true" target="_blank">';
                            s += this.google_ads[i].line1 + '</a></h2>';
                            s += '<div style="padding-left: 0px; padding-top: 8px;float: left;"><a style="color:#4182A2;text-decoration:underline; font-size: 12px;" href="';
                            s += this.google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'ga naar ';
                            s += this.google_ads[i].visible_url + '\';return true" target="_blank">';
                            s += this.google_ads[i].visible_url + '</a></div>';

                            s += '<span style="clear: both; display: block; color: #000; font-size: 13px;">';
                            s += this.google_ads[i].line2 + ' ';
                            s += this.google_ads[i].line3 + '</span>';

                            s += '</td>';

                            if((i+1)%this.options.cols == 0){
                                    s += '</tr>';
                            }

                    }

                    s += '</table>';

                    document.write(s);
                    this.startPosition = (end);
            },

            //function to display the google ads in a line-style table.
            showSingleLine: function(){

                    var end = this.startPosition+(this.options.rows*this.options.cols);
                    var tdClass = '';
                    var s = '';

                    s += '<a class="googleLinkUrl" href="https://www.google.com/adsense/support/bin/request.py?contact=afs_violation&" style="text-decoration:none;color:000000; position: absolute; left: 5px;">' + this.options.googleText + '</a>';
                    s += '<table cellpadding="0" cellspacing="0" border="0" class="' + this.options.tableClass + '" width="100%" style="padding: 0px; margin: 0px;padding-top: 5px;">';

                    var j = 0;
                    for(var i = this.startPosition; i < end; i++){
                            lineLength = (this.google_ads[i].line2 + ' ' + this.google_ads[i].line3).length;

                            if(i%this.options.cols == 0){
                                    s += '<tr>';
                                    j++;
                            }

                            if(this.options.zebra){
                                    if(j%2 == 1){
                                            tdClass = 'oneven';
                                    } else {
                                            tdClass = '';
                                    }
                            }

                            if(this.options.extraClass){
                                    tdClass = ' ' + this.options.extraClass;
                            }


                            s += '<td class="' + tdClass + '" width="100%" style="padding-bottom: 5px;">';

                            s += '<h2 style="clear:none; float: left; padding-right: 5px; vertical-align: middle;">';
                            s += '<a style="text-decoration:none; color: #0000FF;" href="';
                            s += this.google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'ga naar ';
                            s += this.google_ads[i].visible_url + '\';return true" target="_blank">';
                            s += this.google_ads[i].line1 + '</a></h2>';
                            s += '<div style="padding-left: 0px; padding-top: 8px;float: left;"><a style="color:#4182A2;text-decoration:underline; font-size: 12px;" href="';
                            s += this.google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'ga naar ';
                            s += this.google_ads[i].visible_url + '\';return true" target="_blank">';
                            s += this.google_ads[i].visible_url + '</a></div>';

                            if(lineLength > 65){
                                s += '<br style="clear: both;" />';
                            }

                            s += '<div style="color: #000; font-size: 13px; float: left; '

                            if(lineLength <= 65){
                                s += 'margin-top: 8px; margin-left: 3px;';
                            }

                            s += '">';
                            s += this.google_ads[i].line2 + ' ';
                            s += this.google_ads[i].line3 + '</div>';

                            s += '</td>';

                            if((i+1)%this.options.cols == 0){
                                    s += '</tr>';
                            }

                    }

                    s += '</table>';

                    document.write(s);
                    this.startPosition = (end);
            }
    }

