//alert($$('.vinImg').get('id'));
function Click (inc, statut) {

	var slide = new Fx.Slide('vin_description_'+inc);
	var morph = new Fx.Morph('imgMorph_'+inc);
	
	if (statut == 'close') {
		
		slide.slideIn();
		morph.start({
			height: '180px'
		});
	}
	else if (statut == 'open') {
		slide.slideOut();
		morph.start({
			height: '100px'
		});
	}
}
window.addEvent('domready', function() {
	//--------------------------------------------
	var i = 1;
	$$('.shop').each(function (item) {
		new Fx.Slide('vin_description_'+i+'').hide();
		i++;
		item.addEvent('click', function () {
			var a = item.id;
			var b = a.split('_');
			var result = b[1];
			
			var img = $('imgMorph_'+result).getStyle('height');
			var statut = 'close';
			
			if (img == '100px')
				statut='close';
				
			if (img == '180px')
				statut='open';
				
			Click(result, statut);
		});						   
	});
	//--------------------------------------------
	var j = 1;
	$$('.imgVin').each(function (item) {
		new Fx.Slide('vin_description_'+j+'').hide();
		j++;
		item.addEvent('click', function () {
			var a = item.id;
			var b = a.split('_');
			var result = b[1];
			
			var img = $('imgMorph_'+result).getStyle('height');
			var statut = 'close';
			
			if (img == '300px')
				statut='open';
			if (img == '100px')
				statut='close';
				
			Click(result, statut);
		});						   
	});
	//--------------------------------------------
});
