
window.addEvent('domready', function() {
	var szNormal = 5, szSmall = 5, szFull = 2;
	var currSzNormal = 2, currSzSmall = 2, currSzFull = 2;
	 
	var kwicks = $$("#tabs .tb");
	var fx = new Fx.Elements(kwicks, {wait: false, duration: 1000, transition: Fx.Transitions.Elastic.easeOut});
	kwicks.each(function(kwick, i) {
		kwick.addEvent("mouseenter", function(event) {
			var o = {};
			if(kwick.id != "curr")
			{
				o[i] = {'margin-top': [kwick.getStyle("margin-top").toInt(), szFull]}
			} 
			else 
			{
				o[i] = {'margin-top': [kwick.getStyle("margin-top").toInt(), currSzFull]}
			}
			kwicks.each(function(other, j) {
				if(i != j) {
					var w = other.getStyle("margin-top").toInt();
					if(other.id != "curr")
					{
						if(w != szSmall) o[j] = {'margin-top': [w, szSmall]};
					}
					else
					{
						if(w != currSzSmall) o[j] = {'margin-top': [w, currSzSmall]};
					}
				}
			});
			fx.start(o);
		});
	});
	 
	$$("#tabs .tb").addEvent("mouseleave", function(event) {
		var o = {};
		kwicks.each(function(kwick, i) {
			if(kwick.id != "curr")
			{
				o[i] = {'margin-top': [kwick.getStyle("margin-top").toInt(), szNormal]}
			}
			else
			{
				o[i] = {'margin-top': [kwick.getStyle("margin-top").toInt(), currSzNormal]}				
			}
		});
		fx.start(o);
	});
	
	
	
	
	
});

function toggleInfo(showPanel) {
	
	var panel = $("infoPanel");
	
	if (showPanel) {	
		var startHeight = panel.getSize()['size']['y'];;
		var height = panel.getSize()['scrollSize']['y'];
	} else {
		var startHeight = panel.getSize()['size']['y'];
		var height = 0;
	}
	
	var changeHeight = new Fx.Style(panel, 'height', {wait: false, duration: 1000, transition: Fx.Transitions.Cubic.easeOut});
	changeHeight.start(startHeight, height);
}