var randomizer = function(){
};
randomizer.prototype.random_images = [];
randomizer.prototype.current_index = 0;
randomizer.prototype.target = "#banner";
randomizer.prototype.delay = 4000;
randomizer.prototype.init = function(data){
    this.random_images = data;
};
randomizer.prototype.set_banner_image = function(){
    var self = this;
    var img = $(self.random_images[self.current_index]);
    img.appendTo(self.target).show().click(function(){
        document.location.href = $(this).attr("title");
    });
};
randomizer.prototype.random_banner = function(){
    var self = this;
    self.current_index += 1;
    if (self.current_index > self.random_images.length - 1) {
        self.current_index = 0;
    }
    $(self.target).find("img").fadeOut().remove();
    self.set_banner_image();
    setTimeout(function(){
        self.random_banner();
    }, self.delay);
};
randomizer = new randomizer();

