/* $Id: twp.js 19 2011-12-01 19:13:40Z mawerick $ */

/*
 * Log function, for debugging purposes.
 */
$.fn.log = function(msg) {
    console.log("%s: %o", msg, this);
    return this;
}

/*
 * Function for randomizing the banner add on each page, independent of page creation.
 */
$.fn.getRandomBanner = function() {
    var banners = ['ai', 'ai2', 'clan', 'keeper', 'nasc', 'ergo', 'fgrid'];
    var image = 'images/banners/160x600_' + banners[Math.floor(Math.random() * banners.length)] + '.png';
    $(this).attr('src', image);
}

/*
 * Body script execution area... 
 */
$(document).ready(function() {
    $('#banner a img').getRandomBanner();
});

