var rollover = Class.create();

rollover.prototype = {
	
	initialize: function() {
		this.setEvents();
	},
	
	setEvents: function() {
		var self = this;

		$A($$('img[rel="rollover"]')).each(function(img) {  
			
			img.onmouseover = function() {
				var hsrc = this.getAttribute('hsrc');
				this.hsrc = this.src;
				this.src  = hsrc;
			}
			
			img.onmouseout = function() {
				var src = this.getAttribute('src');
				this.src = this.hsrc;
				this.hsrc  = src;
			}
			
			img.onclick = function() {
				location.href = this.getAttribute('href');
			}
			
		});
	}
}



Event.observe(window, 'load', function() {
	new rollover;
});

