Event.observe(window,'load',cargaEventosSlider);

var enlaces = new Array();
var textos = new Array();
var contenidoActual = 0;

function cargaEventosSlider() {
	$$('.slider_enlace').each(function(s,index) {
		enlaces.push(s);
	});
	$$('.slider_contenido').each(function(s,index) {
		textos.push(s);
		contenidoActual = ( s.style.display != 'none' ) ? parseInt(s.getAttribute('s_id')) : contenidoActual;
		enlaces[index].style.cursor = 'pointer';
		Event.observe(enlaces[index],'mouseover', function(e) { muestraSlider(parseInt(enlaces[index].getAttribute('s_id'))) });
	});
	if (contenidoActual != 0) {
		enlaces[contenidoActual-1].style.textDecoration = 'underline';
	}
}

function muestraSlider(i) {
	//var queue = Effect.Queues.get('sliderscope');
	//queue.each(function(e) { e.cancel() });
	
	if ( i != contenidoActual ) {
		if (contenidoActual != 0) {
			ocultaId(contenidoActual);
		}
		muestraId(i);
		contenidoActual = i;
	}
}

function ocultaId(mes) {
	enlaces[mes-1].style.textDecoration = 'none';
//	Effect.Fade(textos[mes-1], { queue: 'end'});
//	Effect.DropOut(textos[mes-1], { queue: {position:'end', scope: 'sliderscope'}, duration: 0.5 });
//	Effect.DropOut(textos[mes-1], { queue: {position:'end', scope: 'sliderscope', limit: 2} });
	textos[mes-1].style.display = 'none';
}

function muestraId(mes) {
	enlaces[mes-1].style.textDecoration = 'underline';
//	Effect.BlindDown(textos[mes-1], { queue: 'end'});
//	Effect.Appear(textos[mes-1], { queue: {position:'end', scope: 'sliderscope'}, duration: 0.5 });
//	Effect.Appear(textos[mes-1], { queue: {position:'end', scope: 'sliderscope', limit: 2} });
	Effect.Appear(textos[mes-1]);
}