window.addEvent('domready', function(){
	//First Example
	var el = $('myElement'),
		color = el.getStyle('backgroundColor');
	
	// 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,
				backgroundColor: '#af060d'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			
			this.morph({
				'opacity': 1,
				'background-color': '#ed1c24'
			});
		}
	});
	
	var el2 = $('myElement2'),
		color = el2.getStyle('backgroundColor');
	
	// 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,
				backgroundColor: '#af060d'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			
			this.morph({
				'opacity': 1,
				'background-color': '#ed1c24'
			});
		}
	});
	
	var el3 = $('myElement3'),
		color = el3.getStyle('backgroundColor');
	
	// 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,
				backgroundColor: '#af060d'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			
			this.morph({
				'opacity': 1,
				'background-color': '#ed1c24'
			});
		}
	});
	
	var el4 = $('myElement4'),
		color = el4.getStyle('backgroundColor');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$('myElement4').set('opacity', 1).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				opacity: 1,
				backgroundColor: '#af060d'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			
			this.morph({
				'opacity': 1,
				'background-color': '#ed1c24'
			});
		}
	});
	
	var el5 = $('myElement5'),
		color = el5.getStyle('backgroundColor');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$('myElement5').set('opacity', 1).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				opacity: 1,
				backgroundColor: '#af060d'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			
			this.morph({
				'opacity': 1,
				'background-color': '#ed1c24'
			});
		}
	});
	
	var el6 = $('myElement6'),
		color = el6.getStyle('backgroundColor');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$('myElement6').set('opacity', 1).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				opacity: 0.8,
				backgroundColor: '#af060d'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			
			this.morph({
				'opacity': 1,
				'background-color': '#ed1c24'
			});
		}
	});
	
	var el7 = $('myElement7'),
		color = el7.getStyle('backgroundColor');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$('myElement7').set('opacity', 1).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				opacity: 0.8,
				backgroundColor: '#af060d'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			
			this.morph({
				'opacity': 1,
				'background-color': '#ed1c24'
			});
		}
	});

	// 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', '80px');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			this.set('tween', {}).tween('height', '22px');
		}
	});
});





