function RollOverImage(img){
	this.img = img;
	this.originalPath = this.img.src;
}


RollOverImage.prototype.setMouseOverImage = function( filepath ){
	this.mouseoverImg = new Image();
	this.mouseoverImg.src = filepath;

	RollOverImage.setHandler(this.img, filepath, "mouseover");
	RollOverImage.setHandler(this.img, this.originalPath, "mouseout");
};

RollOverImage.prototype.setMouseDownImage = function( filepath ){
	this.mousedownImg = new Image();
	this.mousedownImg.src = filepath;
	
	RollOverImage.setHandler(this.img, filepath, "mousedown");
	RollOverImage.setHandler(this.img, this.originalPath, "mouseup");
};


RollOverImage.setHandler = function( obj, file, ev ) {
	var handler = function(e) {
		obj.src = file;
	};
	
	if (obj.addEventListener) {
		obj.addEventListener(ev, handler, true);
	} else {
		obj.attachEvent("on" + ev, handler);
	}
};
