var images = new Array();

$(function() {
    $('.over').each(function(i) {
        var source = $(this).attr('src');
        var overSource = source.replace(/Off/, "On");
        var overImage = new Image();
        overImage.src = overSource;
        this.id = this.id ? this.id + ' i_' + i : 'i_' + i;
        images[this.id] = {"offSrc": source, "onSrc": overSource};
    });
});

$(document).ready(function() {
    $('.over').mouseover(function() {
        this.src = images[this.id].onSrc;
    });
    
    $('.over').mouseout(function() {
        this.src = images[this.id].offSrc;
    });
});