/*my own fx 1313 */
function linkOver(elemento, propiedad, min, max, duracion){
	$$(elemento).each(function(element){ 
	
	/*	var duracion = 500;
		var propiedad = 'opacity';
		var min = '0.2';
		var max= '1';
		*/
	
		//mouseenter
		element.addEvent('mouseenter',function(){
		
			this.set('tween',  {
				duration: duracion,
				transition: Fx.Transitions.Bounce.easeOut
			}).tween(propiedad, max);
			
		});	
		
		//mouseout
		element.addEvent('mouseout',function(){
		this.set('tween',  {
				duration: duracion,
				transition: Fx.Transitions.Bounce.easeOut
			}).tween(propiedad, min);
			
		});
		
	});
}

function linkOverBtn(elemento){
	$$(elemento).each(function(element){ 
	
		var duracion = 200;

	
		//mouseenter
		element.addEvent('mouseenter',function(){
		
			var myEffect = new Fx.Morph(this, {duration: 'short', transition: Fx.Transitions.Quad.easeOut});
 
			myEffect.start({
  			  'margin-top': 0, //Morphs the height from the current to 100px.
			   'opacity': 1   //Morphs the width from the current to 300px.
			});

						
		});	
		
		//mouseout
		element.addEvent('mouseout',function(){
			
			var myEffect = new Fx.Morph(this, {duration: 'short', transition: Fx.Transitions.Bounce.easeOut});
 
			myEffect.start({
  			  'margin-top': 10, //Morphs the height from the current to 100px.
			   'opacity': 0.2   //Morphs the width from the current to 300px.
			});
						
		});
		
	});
}

window.addEvent('domready', function(){
	linkOverBtn('#header li a', 'opacity' );
	
	linkOver('#sidebar_menu a', 'padding-left', 0, 20, 200 );
	var myTips = new Tips('#header li a', {
		fixed: true,
		offset: {x: -35, y: -35},
		text: '',
		className: 'ToolTip'
	
	});
	
	$$('#header li a').set('opacity', 0.2);

	
	$$('#searchform a').addEvent('click', function(){
		document.getElementById('searchform').submit();
		return false;
	});
	 

});
