var malsy = {};

document.observe('dom:loaded', function(ev)
{
	malsy.init();
});

malsy.init = function( )
{
	malsy.initThumbnails();
}

malsy.initThumbnails = function() 
{
	$$('.thumbnail').each(function(el)
	{
		var src;
		var img;
		var oldImg;
		if((img=el.down('img')) && (src = el.readAttribute('rel')))
		{
			oldImg = img.src;
			el.observe('mouseover', function(ev)
			{
				Event.stop(ev);
				img.src = src;
			});
			
			el.observe('mouseout', function(ev)
			{
				Event.stop(ev);
				img.src = oldImg;
			});
		}
	});
}
