window.addEvent('domready', function(){
	
	/*var list = $$('#idList li');
	list.each(function(element) {
 
		var fx = new Fx.Morph(element, {duration:200, wait:false});
 
		element.addEvent('mouseenter', function(){
			fx.start({
				'margin-left': 5,
				'background-color': '#666',
				color: '#ff8'
			});
		});
 
		element.addEvent('mouseleave', function(){
			fx.start({
				'margin-left': 0,
				'background-color': '#333',
				'color': '#888'
			});
		});
 
	});*/
	
	$$('img.tipz').each(function(element,index) {
		var content = element.get('title').split('--');
		element.store('tip:title', content[0]);
		element.store('tip:text', content[1]);
	});
	
	var tipz = new Tips('.tipz',{
		className: 'tipz',
		fixed: false,
		hideDelay: 50,
		showDelay: 50
	});
	
	
	tipz.addEvents({
	'show': function(tip) {
		tip.fade('in');
	},
	'hide': function(tip) {
		tip.fade('out');
	}
});
	
	
	/*var el = $('canap1'),
		color = el.getStyle('backgroundImage');
	
	// We are setting the opacity of the element to 0.1 and adding two events
	$('canap1').set('opacity', 0.1).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'background-color': '#00000'

			});
			
		},
		
		mouseleave: function(){
			
			this.morph({
				'opacity': 0.1
				
			});
		}
	});*/
	
var link = $$('#block div a');
link.each(function(element) {
	element.getParent().addEvent('click', function(){
		window.location = element.get('href');
		// on click, background color and border will turn to a different color
		 this.morph({
			'border': '1px solid #000000',
			'background-image': 'none',
			'background-color': '#000000'
			});
		 });
	});

var link = $$('.lang div a');
link.each(function(element) {
	element.getParent().addEvent('click', function(){
		window.location = element.get('href');
		
		 });
	});
var link = $$('#logo div a');
link.each(function(element) {
	element.getParent().addEvent('click', function(){
		window.location = element.get('href');
		
		 });
	});

    
    
	//First Example
	/*var el = $('canap4'),
		color = el.getStyle('backgroundImage');
	
	// We are setting the opacity of the element to 0.1 and adding two events
	$('canap4').set('opacity', 0.1).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'background-color': '#000000'
			});
			
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				'opacity': 0.1
			});
		}
	});*/
	//First Example
	/*var el = $('canap3'),
		color = el.getStyle('backgroundImage');
	
	// We are setting the opacity of the element to 0.1 and adding two events
	$('canap3').set('opacity', 0.1).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 1,
				'background-color': '#000000'
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				'opacity': 0.1
			});
		}
	});
	//First Example
	var el = $('canap2'),
		color = el.getStyle('backgroundImage');
	
	// We are setting the opacity of the element to 0.1 and adding two events
	$('canap2').set('opacity', 0.1).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
		this.morph({
				'opacity': 1,
				'background-color': '#000000'
			});
			
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				'opacity': 0.1
			});
		}
	});*/
	

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

