/** This is the namespace */
if(!window.com) { var com = {}; }
if(!com.rebeccarolfe) { com.rebeccarolfe = {}; }
if(!com.rebeccarolfe.util) { com.rebeccarolfe.util = {}; }

/**
	Causes an element to remove or add the class name to itself. 
	Example: 
		before hover: <a href...></a> 
		after hover: <a class="hover"...></a>
	@param evnt The event object returned by prototype.
	@returns nothing
*/
com.rebeccarolfe.util.hover = function(evnt) {
	var elmnt = evnt.element();
	elmnt.up().toggleClassName('hover');
}

/**
	This adds the hover functionality to any element (tag on the page)--that lives in
	an element that has an id of content and the element itself has a class of 
	rr-mdl-piece--when the page loads 
*/
document.observe("dom:loaded", function() {
	var util = com.rebeccarolfe.util;
	$$('#content .piece').invoke('observe', 'mouseover', util.hover);
	$$('#content .piece').invoke('observe', 'mouseout', util.hover);
});
