/**
 * @author Kevin Thompson
 * @version 1.0.1
 * @copyright 2007 theAutomaters
 */
var rollover = Class.create();
rollover.prototype = {
	initialize: function(el){
		this.el = $(el);
		this.img = this.el.down('img');
		
		if(!this.img) return;
		
		var re = /(.*?)(m?)(\..{3,4})$/
		var m = this.img.src.match(re);

		if(m[2]=='m'){
			this.imageOut = m[1]+'m'+m[3];
			this.imageOver = m[1]+'m'+m[3];	
		}else{
			this.imageOut = m[1]+m[3]; 
			this.imageOver = m[1]+'m'+m[3];
		}
		

		var temp = new Image();
		temp.src = this.imageOver;
		
		Event.observe(this.el,'mouseover',this.mouseover.bind(this));
		Event.observe(this.el,'mouseout',this.mouseout.bind(this));
	},
	mouseover: function(e){
		this.img.src = this.imageOver;
	},
	mouseout: function(e){
		this.img.src = this.imageOut;
	}	
};