var ProductImages = new Class(
{
	options:
	{
		
	},	
	
	initialize:	function(options)
	{	
		this.setOptions(options);
		this.setEvents();
	},
	
	setEvents: function()
	{
		var productImages = $('products').getElements('.image');
		productImages.each(function(image)
		{
			image.addEvent('mouseenter', function()
			{
				image.effect('opacity',
				{
					duration: 200
				}).start(0.7, 1);
			}.bind(this));
			
			image.addEvent('mouseleave', function()
			{
				image.effect('opacity',
				{
					duration: 200
				}).start(1, 0.7);				
			}.bind(this));	
			
			image.addEvent('click', function()
			{
				//alert(image.parentNode.getElement(".product_link").href);
				var prev = image.getParent();
				var product_link = $(prev).getElement(".product_link");
				location.href = product_link;
			}.bind(this));
			
		}.bind(this));
	}
});
ProductImages.implement(new Options, new Events);