$(function() {

  // plain image rollovers
  $('.rollover').hover(function() {

    // grab the img src attribute
    var curr = $(this).attr('src');

    // insert _on before the .extension
    var image = curr.substring(0, curr.search(/(\.[-_1-9a-zA-Z]+)$/)) + '_on' + curr.match(/(\.[a-zA-Z]+)$/)[0];

    // set the source
    $(this).attr('src', image);
  }, function() {

    // get the img src attribute, replace _on. with .
    var curr = $(this).attr('src');
    var image = curr.replace(/_on\./, '.');
   
    // set the source
    $(this).attr('src', image);
  });
  // end image rollovers

});
