window.addEvent('domready', function(){
	var szSmall = 45, szFull = 525;
	var accordion = $$("#accordion .stretcher");
	
	var fx = new Fx.Elements(accordion, {wait:false, duration:300, transition:Fx.Transitions.Expo.easeInOut});
	
	accordion.each(function(stretcher, i) {
		stretcher.addEvent("click", function(event) {
			var o = {};
			o[i] = {width: [stretcher.getStyle("width").toInt(), szFull]}
			
			var numi = i+1;
			tab = stretcher.getElementById("tab"+numi);
			//tab.style.display = "none";
			module = stretcher.getElementById("module"+numi);
			module.style.display = "block";
			
			accordion.each(function(other, j) {
				if(i != j) {
					var w = other.getStyle("width").toInt();
					if(w != szSmall) 
						o[j] = {width: [w, szSmall]};
					var numj = j+1;
					tabs = other.getElementById("tab"+numj);
					tabs.style.display = "inline-block";
					modules = other.getElementById("module"+numj);
					modules.style.display = "none";
				}
			});
			fx.start(o);
		});
	});
});	
