/*
 * Dependencies:
 * EventObject - for attaching events
 * Prototype - for $()
 */
var Rollover = new Object();

/*
 * attachRollover
 * 
 * elem			The IMG element
 * imgOvrSrc	The URL of the image to show on mouse over
 * 
 * The image to show on mouse out is implicit - and the current 
 * SRC property of the image will be used.
 * 
 * It currently attaches the mouse over effect on the <A> tag that is used to 
 * work with this IMG and not the IMG itself for more cross-browser 
 * compatibility
 */
Rollover.attachRollover = function(elem, imgOvrSrc) {
	var imgObj = $(elem);				/* Get the IMG tag */
	var imgOutSrc = imgObj.src;			/* Get IMG SRC */
	var linkObj = imgObj.parentNode;	/* Get the A node containing the IMG */

	var onMouseOverFnc = function(evt) {
		imgObj.setAttribute('src', imgOvrSrc);
	};
	EventObject.attachEvent(imgObj, 'mouseover', onMouseOverFnc);
	
	var onMouseOutFnc = function(evt) {
		imgObj.setAttribute('src', imgOutSrc);
	};
	EventObject.attachEvent(imgObj, 'mouseout', onMouseOutFnc);
};