window.addEvent('load', function()
{
  var titulines = $$('#acercade h2') 
  var listados = $$('#acercade .listas')
  var paracebra = $$('#listados li')
  
  var tipo = "uno";
  var actualh;
  var cont = 1;
  paracebra.each(function(elemento)
  {
  		if (actualh == undefined)
			actualh = elemento.getParent();
		if (tipo == "uno")
			{
				tipo = "dos";
			}
		else
			{
				tipo = "uno";
			}
		if (elemento.getParent() != actualh)	
			{
				cont ++;
			}
		actualh = elemento.getParent();
		elemento.addClass(tipo + cont);
		
		elemento.addEvent('mouseover',function()
		{
			this.setStyle('background-color','#e7e7e7');
		});
		elemento.addEvent('mouseout',function()
		{
			this.setStyle('background-color','');
		});
  });
  
  var a = 1;
  var actual;
  var h2actual;
  listados.each(function(elemento)
		{
			var slider1 = new Fx.Slide(elemento);
			slider1.hide();
			if (actual == undefined)
				{
					actual = slider1;
					h2actual = titulines[1];
				}
			titulines[a].getFirst().addClass("nova");
			titulines[a].addEvent('click', function(ev)
  		    {
				if (h2actual == this)
					return;
				cerrar();
				new Event(ev).stop();
				slider1.toggle();
				actual = slider1;
				//this.getFirst().removeClass(this.id  + "va");
				this.getFirst().setStyle('background-position','left bottom');
				h2actual = this;

			});
			a ++;
		});
	function cerrar()
	{
		if (actual != undefined)
		 	{
				actual.toggle();
				h2actual.getFirst().setStyle('background-position','left top');
				//h2actual.getFirst().removeClass("nova");
				//h2actual.getFirst().addClass(h2actual.id + "va");
			}
	}
 actual.show()
 //h2actual.getFirst().removeClass(h2actual.id + "va");
 h2actual.getFirst().setStyle('background-position','left bottom');
});
