window.addEvent('domready', function(){
	var profundidad1 = 500;
	var profundidad2 = 400;
	var profundidad3 = 400;
	var	profundidad4 = 400;
	var profundidad5 = 350;

    $('inicio').setStyle('zIndex',profundidad1);
	$('libros').setStyle('zIndex',profundidad2);
	$('prensa').setStyle('zIndex',profundidad3);
	$('novedades').setStyle('zIndex',profundidad4);
	$('contacto').setStyle('zIndex',profundidad5);

	// We are setting the opacity of the element to 0.5 and adding two events
	$('inicio').set('opacity', 0.75).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 0.9,
				'zIndex': profundidad1.toInt()+500
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 0.75,
				zIndex: profundidad1
			});
		}
	});
	$('libros').set('opacity', 0.65).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 0.9,
				'zIndex': profundidad2.toInt()+500
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 0.65,
				zIndex: profundidad2
			});
		}
	});
	$('prensa').set('opacity', 0.65).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 0.9,
				'zIndex': profundidad3.toInt()+500
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 0.65,
				zIndex: profundidad3
			});
		}
	});
	$('novedades').set('opacity', 0.65).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 0.9,
				'zIndex': profundidad4.toInt()+500
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 0.65,
				zIndex: profundidad4
			});
		}
	});
	$('contacto').set('opacity', 0.65).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 0.9,
				zIndex: profundidad5.toInt()+500
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 0.65,
				zIndex: profundidad5
			});
		}
	});
	
	

	
});
