window.addEvent('domready', function(){
	$('menu_el_club').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', '120px');//120px
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			this.set('tween', {}).tween('height', '20px');
		}
	});
	
	$('menu_competiciones').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', '140px');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			this.set('tween', {}).tween('height', '20px');
		}
	});
	
	$('menu_otros').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', '20px');
		}
	});
	
		var MenuMultiBox = new multiBox({
		mbClass: '.competiciones_multiBox',//class you need to add links that you want to trigger multiBox with (remember and update CSS files)
		container: $(document.body),//where to inject multiBox
		descClassName: 'multiBoxDesc',//the class name of the description divs
		useOverlay: true,//use a semi-transparent background. default: false;
		recalcTop: true, //subtract the height of controls panel from top position
		showNumbers: false,//show numbers such as "4 of 12"
		showControls: true, //show the previous/next, title, download etc
		onlyDesc: true
	});
	
	var TipsColaboradores =new Tips(
			$$(".colaboradores"),{
				className:"colaboradoresTip"
				});
	
	cargar_eventos_calendario();
});
	
	
function cargar_eventos_calendario(){
	
	$('calendar_wrap_sig').addEvent(
		'click', function(){
			var dir = $('calendar_wrap_sig').href;
			var D=$("calendar_wrap").empty().addClass("ajax-loading");
			var req = new Request.HTML({
				url: dir,
				method:"get",
				update:$("calendar_wrap"),
				onComplete:function(){
					D.removeClass("ajax-loading");
					cargar_eventos_calendario.delay(200);
				},
				onFailure: function() {
					D.empty().addClass("error");
				}
			});
			req.send();
			return false;
		}
	);
	
	$('calendar_wrap_ant').addEvent(
		'click', function(){
			var dir = $('calendar_wrap_ant').href;
			var D=$("calendar_wrap").empty().addClass("ajax-loading");
			var req = new Request.HTML({
				url: dir,
				method:"get",
				update:$("calendar_wrap"),
				onComplete:function(){
					D.removeClass("ajax-loading");
					cargar_eventos_calendario.delay(200);
				},
				onFailure: function() {
					D.empty().addClass("error");
				}
			});
			req.send();
			return false;
		}
	);
	
	var A=new Tips(
		$$(".compe",".cumple",".compe_hoy",".cumple_hoy",".compe_cumple",".compe_cumple_hoy"),
		{offsets:{x:10,y:-33},
		showDelay:200,
		hideDelay:0,
		tipo:1,
		className:"diaTip"});
	
	var Z=new Tips(
		$$(".info_calendario"),
		{offsets:{x:10,y:-33},
			showDelay:200,
			hideDelay:0,
			tipo:2,
			className:"info_c"})
}

function cargar_accordion(){
	window.addEvent("domready",function(){
		var A=new Accordion("div.toggler","div.element",{opacity:false,onActive:function(E,D){
			E.setStyle("color","#ff3300")},onBackground:function(E,D){E.setStyle("color","#222")},show:-1},$("accordion"))
		});
}

function cargar_piscinaBox(){
	window.addEvent("domready",function(){
		var PiscinasBox = new multiBox({
			mbClass: '.piscina',//class you need to add links that you want to trigger multiBox with (remember and update CSS files)
			container: $(document.body),//where to inject multiBox
			descClassName: false,//the class name of the description divs
			useOverlay: true,//use a semi-transparent background. default: false;
			recalcTop: true, //subtract the height of controls panel from top position
			showNumbers: false,//show numbers such as "4 of 12"
			showControls: false, //show the previous/next, title, download etc
			onlyDesc: false,
			initialSize: {w:500, h:450}
		});
	});
}


