function ImageCollection(context) {
    var images = [];
    var img = null;
    var periodical_executer = null;
    var current_img = null;
    var current_index = 0;

    for(i=0; i < context.images.length; i++) {
        img = $(context.image_id);
        images[i] = new Image();
        images[i].src = context.url + context.images[i]
    }
    var rotate = function(pe) {
        if(!images[++current_index]) {
            current_index = 0;
        }
        current_img = images[current_index];
        img.src = current_img.src;
    };
    var stop = function(e) {
        periodical_executer.stop();
    };
    var start = function(e) {
        rotate();
        periodical_executer = new PeriodicalExecuter(rotate, 1);
    };

    Event.observe(img, 'mouseover', start, false);
    Event.observe(img, 'mouseout', stop, false);
}
