
var SwapImage = Class.create();

SwapImage.prototype = {
  preloadImages: {},

  initialize: function() {
    var images = $$('img.highlightable');
    images.each(
      function ( image ) {
        var file   = image.src;
        var hlfile = file.replace( /\.(\w+)$/, '_hl.$1' );
        image.onmouseover = function () {
          this.src = hlfile;
        };
        image.onmouseout = function () {
          this.src = file;
        };
        var img = new Image();
        img.src = file;
        img.src = hlfile;
      }
    );
  }
}


function initSwapImage() { mySwapImage = new SwapImage(); }
Event.observe(window, 'load', initSwapImage, false);