window.addEvent('domready', function(){
	//First Example
	var el = $('myElement'),
		image = el.getStyle('backgroundImage');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$('myElement').set('opacity', 1).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'background-position': [0, 115],
				'background-image': 'url(img/1z2.gif)'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 1,
				'background-position': [0, 0],
				backgroundImage: image
			});
		}
	});

//------------------------------------
	//First Example
	var el1 = $('myElement1'),
		image1 = el1.getStyle('backgroundImage');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$('myElement1').set('opacity', 1).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'background-position': [0, 115],
				'background-image': 'url(img/3p2.gif)'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 1,
				'background-position': [0, 0],
				backgroundImage: image1
				
			});
		}
	});
	
		//First Example
	var el2 = $('myElement2'),
		image2 = el2.getStyle('backgroundImage');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$('myElement2').set('opacity', 1).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'background-position': [0, 115],
				'background-image': 'url(img/4g2.gif)'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 1,
				'background-position': [0, 0],
				backgroundImage: image2
			});
		}
	});
	
		//First Example
	var el3 = $('myElement3'),
		image3 = el3.getStyle('backgroundImage');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$('myElement3').set('opacity', 1).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'background-position': [0, 115],
				'background-image': 'url(img/5k2.gif)'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 1,
				'background-position': [0, 0],
				backgroundImage: image3
			});
		}
	});


	// 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.Bounce.easeOut // This could have been also 'bounce:out'
			}).tween('height', '150px');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			this.set('tween', {}).tween('height', '20px');
		}
	});
});
