(function($){
 $.fn.swapper = function() {
	 return this.each(function() {  
		var obj = $(this);
		//console.log("created swap of "+obj.attr('id'));
		obj.offsrc = src = this.src;
		obj.onsrc = obj.offsrc.replace(/off/,'on');
		
		pload = new Image(57,54);
		pload.src = obj.onsrc;
		
		//console.log(pload);
		
		obj.mouseover(function() {
				this.src = obj.onsrc;
				obj.attr('src',obj.onsrc);
				//console.log('src = '+obj.onsrc+ ' '+obj.attr('id'));
				return true;
		});
		
		obj.mouseout(function() {
				this.src = obj.offsrc;
				return true;
		});
  });  
 };
})(jQuery);

$(document).ready(function() {
  $('.swap').swapper();
});

