window.addEvent('domready', function(){
	// Second Example
	
	// The same as before: adding events
	$('myOtherElement').addEvents({
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.set('tween', {
				duration: 1000,
				transition: Fx.Transitions.Quart.easeOut // This could have been also 'bounce:out'
			}).tween('height', '223px');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			this.set('tween', {}).tween('height', '20px');
		}
	
     });

   $('myOtherElement1').addEvents({
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.set('tween', {
				duration: 1000,
				transition: Fx.Transitions.Quart.easeOut // This could have been also 'bounce:out'
			}).tween('height', '223px');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			this.set('tween', {}).tween('height', '20px');
		}
	});
	
exampleFx =new Fx.Tween('header_tekst1', {
	duration: 3000,
	property: 'opacity',
	transition: Fx.Transitions.Quart.easeInOut
})
exampleFx1 =new Fx.Tween('header_tekst2', {
	duration: 3000,
	property: 'opacity',
	transition: Fx.Transitions.Quart.easeInOut
}) 
exampleFx2 =new Fx.Tween('header_tekst3', {
	duration: 3000,
	property: 'opacity',
	transition: Fx.Transitions.Quart.easeInOut
})
exampleFx3 =new Fx.Tween('header_tekst4', {
	duration: 3000,
	property: 'opacity',
	transition: Fx.Transitions.Quart.easeInOut
})
exampleFxfoto1 =new Fx.Tween('top_pic1', {
	duration: 3000,
	property: 'opacity',
	transition: Fx.Transitions.Quart.easeInOut
})
exampleFxfoto2=new Fx.Tween('top_pic2', {
	duration: 3000,
	property: 'opacity',
	transition: Fx.Transitions.Quart.easeInOut
}) 
exampleFxfoto3 =new Fx.Tween('top_pic3', {
	duration: 3000,
	property: 'opacity',
	transition: Fx.Transitions.Quart.easeInOut
})
exampleFxfoto4 =new Fx.Tween('top_pic4', {
	duration: 3000,
	property: 'opacity',
	transition: Fx.Transitions.Quart.easeInOut
})

function rotacja(){
exampleFx.start(0,1)
exampleFx.start.pass([1,0], exampleFx).delay(5000); 
exampleFx1.start.pass([0,1], exampleFx1).delay(5000);
exampleFx1.start.pass([1,0], exampleFx1).delay(10000);
exampleFx2.start.pass([0,1], exampleFx2).delay(10000);
exampleFx2.start.pass([1,0], exampleFx2).delay(15000); 
exampleFx3.start.pass([0,1], exampleFx3).delay(15000);
exampleFx3.start.pass([1,0], exampleFx3).delay(20000);
exampleFxfoto1.start(0,1)
exampleFxfoto1.start.pass([1,0], exampleFxfoto1).delay(5000); 
exampleFxfoto2.start.pass([0,1], exampleFxfoto2).delay(5000);
exampleFxfoto2.start.pass([1,0], exampleFxfoto2).delay(10000);
exampleFxfoto3.start.pass([0,1], exampleFxfoto3).delay(10000);
exampleFxfoto3.start.pass([1,0], exampleFxfoto3).delay(15000); 
exampleFxfoto4.start.pass([0,1], exampleFxfoto4).delay(15000);
exampleFxfoto4.start.pass([1,0], exampleFxfoto4).delay(20000);
}
rotacja();
var rotator = rotacja.periodical(20000, null, $(''));
});


