﻿var peaPods = {
    cache: []
};

$(function() {
    peaPods.rollOvers();
});

peaPods.preLoad = function(path) {
    peaPods.cache.push($("<img src='" + path + "' />"));
}

peaPods.rollOvers = function() {
    $(".roll-over").each(function() {
        var before = $(this).attr("src");
        var after = before.replace(/\./, "-over.");
        
        peaPods.preLoad(after);
    
        $(this).hover(function() {
            $(this).attr("src", after);
        }, function() {
            $(this).attr("src", before);
        });
    });
};
