/**
 * @author spollard
 */

whatson = {
	init: function() {
		$$('.event').each(whatson.process);
		
	},
	
	process: function(el) {
		el.addEvent('click', whatson.event.click.bindWithEvent(el));
		if (window.ie6) {
			el.addEvent('mouseenter', whatson.event.enter.bindWithEvent(el));
			el.addEvent('mouseleave', whatson.event.leave.bindWithEvent(el));
		}
	},
	
	event: {
		click: function() {
			var link = this.getElement('a').getProperty("href");
			document.location = link;
		},
		enter: function() {
			this.addClass("hover");
		},
		leave: function() {
			this.removeClass("hover");
		}
	}
	
};

window.addEvent("domready", whatson.init);

