// adds a highlight/roll over effect to an image
// example
// html: <img src="the_pic.png" id="main">
// JS: switchImage('main','the_pic_over.png', 'the_pic.png');
// switchImage

// requires mootools 1.11 (other version may work, too)

// author: Henrik Horneber
// permission granted to use, copy and modify as you like,
// as long as you do it at your own risk

function switchImage( id, light_src, dark_src) {
  window.addEvent('domready', function(){    
    var img = $(id);	    
    var preload_img = new Image();
    preload_img.src=light_src;
    img.addEvents({
	    'mouseenter': function() {
		    img.src=light_src;
	    },
	    'mouseleave': function() {
		    img.src=dark_src;
	    }
    });
  }); 
};