window.addEvent('domready', function(){
	// The same as before: adding events
	var myAccordion = new Accordion($('accordion'), 'h3.toggler', 'div.element', {
		opacity: false,
		onActive: function(toggler, element){
			toggler.setStyle('color', '#41464D');
		},
		onBackground: function(toggler, element){
			toggler.setStyle('color', '#528CE0');
		}
	});


	if ($('home')) {
		$('home').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:100}).tween('margin-top', '-5px');
			},
			'mouseleave': function(){
				// Resets the tween and changes the element back to its original size
				this.set('tween', {duration:100}).tween('margin-top', '0px');
			}
		});
		}
	// The same as before: adding events
	if ($('observador')) {
		$('observador').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:100}).tween('margin-top', '-5px');
			},
			'mouseleave': function(){
				// Resets the tween and changes the element back to its original size
				this.set('tween', {duration:100}).tween('margin-top', '0px');
			}
		});
		}
	// The same as before: adding events
	if ($('registe-se')) {
		$('registe-se').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:100}).tween('margin-top', '-5px');
			},
			'mouseleave': function(){
				// Resets the tween and changes the element back to its original size
				this.set('tween', {duration:100}).tween('margin-top', '0px');
			}
		});
		}
	// The same as before: adding events
	if ($('observador-internacional')) {
	$('observador-internacional').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:100}).tween('margin-top', '-5px');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			this.set('tween', {duration:100}).tween('margin-top', '0px');
		}
	});}
	// The same as before: adding events
	if ($('forum')) {
		$('forum').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:100}).tween('margin-top', '-5px');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			this.set('tween', {duration:100}).tween('margin-top', '0px');
		}
	});
	}	// The same as before: adding events
	if ($('imprensa')) {
	$('imprensa').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:100}).tween('margin-top', '-5px');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			this.set('tween', {duration:100}).tween('margin-top', '0px');
		}
	});
	}
	// The same as before: adding events
	if ($('contactos')) {
	$('contactos').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:100}).tween('margin-top', '-5px');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			this.set('tween', {duration:100}).tween('margin-top', '0px');
		}
	});}
	 $$('.tips').each(function(element,index) {  
         var content = element.get('title').split('::');  
         element.store('tip:title', content[0]);  
         element.store('tip:text', content[1]);  
     });  
       
     //create the tooltips  
     var tips = new Tips('.tips',{  
         className: 'tips',  
         fixed: true,  
         hideDelay: 50,  
         showDelay: 50
     });

    tips.addEvents({  
        'show': function(tip) {  
            tip.fade('in');  
			tip.style.zIndex="12";

        },  
        'hide': function(tip) {  
            tip.fade('out');  
        }  
    }); 


});
			
function makeScrollbar(content,scrollbar,handle,horizontal,ignoreMouse){
	var steps = (horizontal?(content.getScrollSize().x - content.getSize().x):(content.getScrollSize().y - content.getSize().y))
	var slider = new Slider(scrollbar, handle, {	
		steps: steps,
		mode: (horizontal?'horizontal':'vertical'),
		onChange: function(step){
			// Scrolls the content element in x or y direction.
			var x = (horizontal?step:0);
			var y = (horizontal?0:step);
			content.scrollTo(x,y);
		}
	}).set(0);
	if( !(ignoreMouse) ){
		// Scroll the content element when the mousewheel is used within the 
		// content or the scrollbar element.
		$$(content, scrollbar).addEvent('mousewheel', function(e){	
			e = new Event(e).stop();
			var step = slider.step - e.wheel * 30;	
			slider.set(step);					
		});
	}
	// Stops the handle dragging process when the mouse leaves the document body.
	$(document.body).addEvent('mouseleave',function(){slider.drag.stop()});
}
function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
   var obj = document.layers ? document.layers[szDivID] :
   document.getElementById ?  document.getElementById(szDivID).style :
   document.all[szDivID].style;
   obj.visibility = document.layers ? (iState ? "show" : "hide") :
   (iState ? "visible" : "hidden");
   
   
}

