Rollover = Class.create({
	initialize: function(element){
		
		this.element = $(element);
		this.normal = this.element.src;
		this.rollSrc = this.element.src.substr(0, this.element.src.length - 7) + '.png';
		this.image = new Image();
		this.image.src = this.rollSrc;
		this.addObservers();
		
		
	},
	
	addObservers: function(){
		this.observers = {
			mouseOverThis: this.mouseOverThis.bind(this),
			mouseOutThis: this.mouseOutThis.bind(this)
		}
		
		this.element.observe("mouseover",this.observers.mouseOverThis);
		this.element.observe("mouseleave",this.observers.mouseOutThis);
	},
	
	mouseOverThis: function(e){			
		
		this.element.src = this.image.src;
		e.stop();
		
	},
	
	mouseOutThis: function(e){			
		
		this.element.src = this.normal;
		e.stop();
		
	}
	
});

function initRollovers(){
	
	$$(".clientRollover").each(function(roll){
		
		var x = new Rollover($(roll));		
				  
	});
}


Event.observe(window,'load',initRollovers);
