var ImgMnu = {
	
	start: function(){
		
		if ($('imgmnu')) ImgMnu.parseKwicks();
		
	},
	
	parseKwicks: function(){
		var kwicks = $$('#imgmnu .boton');
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 200, transition: Fx.Transitions.quadOut});
		kwicks.each(function(kwick, i){
			kwick.addEvent('mouseover', function(e){
				e = new Event(e).stop();
				var obj = {};
				obj[i] = {
					'width': [kwick.getStyle('width').toInt(), 90]
				};
				kwicks.each(function(other, j){
					if (other != kwick){
						var w = other.getStyle('width').toInt();
						if (w != 25) obj[j] = {'width': [w, 25]};
					}
				});
				fx.start(obj);
			});
		});
		
		document.addEvent('mouseover', function(e){
			e = new Event(e);
			var rel = e.relatedTarget;
			if (!rel) return;
			if (rel.hasClass && (rel.hasClass('boton') || rel.id == 'imgmnu')){
				var obj = {};
				kwicks.each(function(other, j){
					obj[j] = {'width': [other.getStyle('width').toInt(), 25]};
				});
				fx.start(obj);
			};
		});
	}
};

window.addEvent('domready', ImgMnu.start);