/******************************************************************************
* jQuery: PEPS Rollover
/*****************************************************************************/

PEPS = {}; 
PEPS.rollover = { init: function() { this.preload(); $(".hover").hover(function() { $(this).attr('src', PEPS.rollover.newimage($(this).attr('src'))) }, function() { $(this).attr('src', PEPS.rollover.oldimage($(this).attr('src'))) }) }, preload: function() { $(window).bind('load', function() { $('.hover').each(function(a, b) { $('<img>').attr('src', PEPS.rollover.newimage($(this).attr('src'))) }) }) }, newimage: function(a) { return a.substring(0, a.search(/(\.[a-z]+)/)) + '_hover' + a.match(/(\.[a-z]+)/)[0] }, oldimage: function(a) { return a.replace(/_hover/, '') } };