

window.addEvent('domready', function() {
 
// sktypt do mneu

var szNormal = 117, szSmall  = 100, szFull   = 150;
 
var kwicks = $$("#kwicks .kwick");
var fx = new Fx.Elements(kwicks, {wait: false, duration: 300, transition: Fx.Transitions.Back.easeOut});
kwicks.each(function(kwick, i) {
	kwick.addEvent("mouseenter", function(event) {
		var o = {};
		o[i] = {width: [kwick.getStyle("width").toInt(), szFull], 'background-color': '#4B5D8F', 'color': '#FFFFFF'};
		kwicks.each(function(other, j) {
			if(i != j) {
				var w = other.getStyle("width").toInt();
				if(w != szSmall) 
				{
				o[j] = {width: [w, szSmall],'background-color': '#E8ECEE', 'color': '#4B5D8F'};
				}
			}
		});
		fx.start(o);
	});
});
 
$("kwicks").addEvent("mouseleave", function(event) {
	var o = {};
	kwicks.each(function(kwick, i) {
		o[i] = {width: [kwick.getStyle("width").toInt(), szNormal],'background-color': '#E8ECEE', 'color': '#4B5D8F'}
	});
	fx.start(o);
})



//skrypt do animacji 
 
 
var a1 = $('anim_1'), a2 = $('anim_2'), a3 = $('anim_3'), apasek = $('anim_pasek');

var fx1 = a1.effects({duration: 1000, transition: Fx.Transitions.Quart.easeOut});
var fx2 = a2.effects({duration: 1000, transition: Fx.Transitions.Quart.easeOut});
var fx3 = a3.effects({duration: 1000, transition: Fx.Transitions.Quart.easeOut}); 

var fxpasek = apasek.effects({duration: 2000, transition: Fx.Transitions.Quart.easeOut}); 
 
 	fx1.start({'opacity': [1,0]});	
	fx2.start({'opacity': [1,0]});	
	fx3.start({'opacity': [1,0]});	
 

 
fxpasek.start({'width': 500}).chain(function(){

	a1.style.display='block';
	a2.style.display='block';
	a3.style.display='block';		
	
	fx1.start.delay(100, fx1, {
			'opacity': 1
	}); 

	fx2.start.delay(500, fx2, {
			'opacity': 1
	});

	fx3.start.delay(1000, fx3, {
			'opacity': 1
	});
	


	
	
});


});



