window.addEvent('domready', function () {

	var arrayRadio = $$('.radiobox');

	$each(arrayRadio, function(myRadio) {
		myRadio.addEvents({
			'change': function(evento) {
				document.forms[0].action = this.value;
				if (this.id == 'google') {
					document.forms[0].target = '_blank';
					document.forms[0].method = 'get';
					document.forms[0].elements[0].name = 'q';
				} else {
					document.forms[0].target = '_self';
					document.forms[0].elements[0].name = 'searchword';
					document.forms[0].method = 'post';
				}
			}
		});
	});

	$('cicle').setStyle('display', 'block');
	var fx = new Fx.Cycle.fade('cicle', {steps: 5000, duration: 2500});

	$('drop_down_menu').getElements('li.menu').each(function(elem){
		var list = elem.getElement('ul.links');
		var myFx = new Fx.Slide(list).hide();
		elem.addEvents({
			'mouseenter' : function(){
				myFx.cancel();
				myFx.slideIn();
			},
			'mouseleave' : function(){
				myFx.cancel();
				myFx.slideOut();
			}
		});
	})

	var linksSlide = new Fx.Slide($('links'), {
		link: 'cancel',
		transition: 'sine:in'
	}).hide();

	$('toggler').addEvents({
		'click' : function(){
			linksSlide.toggle();
		},
		'mouseleave' : function(){
			linksSlide.slideOut();
		}
	});

	$$('.botonadmision').addEvents({
		'mouseenter' : function(){
			this.fade(.6);
		},
		'mouseleave' : function(){
			this.fade(1);
		}
	});

	var arrayTrigger = $$('.trigger');
	var arrayContent = $$('.content');

	var AccordionObject = new Accordion(arrayTrigger, arrayContent, {
		display: false,
		height : true,
		width : false,
		opacity: true,
		fixedHeight: false,
		fixedWidth: true,
		alwaysHide: true,
		//onComplete: function(){ },
		onActive: function(toggler, element) {
			toggler.tween('background-color', '#7D7E6E');
			toggler.setStyle('color', '#FFFFFF');
		},
		onBackground: function(toggler, element) {
			toggler.tween('background-color', '#EEEEE7');
			toggler.setStyle('color', '#7D7E6E');
		}
	});

/*
	var arrayEnlace = $$('.enlace');
	$each(arrayEnlace, function(myEnlace) {
		myEnlace.addEvents({
			'mouseenter': function() { this.fade(.5); },
			'mouseleave': function() { this.fade(1); }
		});
	});*/

});