// JavaScript Document
window.addEvent("load", function() {
	var slider = new Fx.Slide("barra_idiomas");
	slider.hide();
	$("deslizar").addEvent("click", function(ev)
	{
		new Event(ev).stop();
		slider.toggle();
	});
});

window.addEvent("domready", function() {   
    var Carousel_foto = new iCarousel("ultimos_trabajos_container", {
        idPrevious: "carousel_previous",
        idNext: "carousel_next",
        idToggle: "undefined",
        item: {   
            klass: "ultimos_trabajos_container",
            size: 300
        },   
       animation: {   
            type: "scroll", 
            duration: 700,   
            amount: 1   
		}
    });
	
	var Carousel_texto = new iCarousel("ultimos_trabajos_texto_galeria", {
	idPrevious: "carousel_previous",
	idNext: "carousel_next",
	idToggle: "undefined",
	item: {
			klass: "ultimos_trabajos_texto_item",
			size: 250
		},
	animation: {
		type: 'scroll',
		direction: "top",  		
		duration: 700,
		amount: 1
		}
	}); 
  
	$("imagen1").addEvent("click", function(event)
	{
		new Event(event).stop();
		Carousel_foto.goTo(0);
		
		new Event(event).stop();
		Carousel_texto.goTo(0);

		this.className = 'seleccion';
		$("imagen2").className = '';
		$("imagen3").className = '';
		$("imagen4").className = '';
		$("imagen5").className = '';		
	});
 
 	$("imagen2").addEvent("click", function(event)
	{
		new Event(event).stop();
		Carousel_foto.goTo(1);
			
		new Event(event).stop();
		Carousel_texto.goTo(1);

		this.className = 'seleccion';
		$("imagen1").className = '';
		$("imagen3").className = '';
		$("imagen4").className = '';
		$("imagen5").className = '';
	});    
	
	$("imagen3").addEvent("click", function(event)
	{
		new Event(event).stop();
		Carousel_foto.goTo(2);
		
		new Event(event).stop();
		Carousel_texto.goTo(2);

		this.className = 'seleccion';
		$("imagen1").className = '';
		$("imagen2").className = '';
		$("imagen4").className = '';
		$("imagen5").className = '';
	});  
	
	$("imagen4").addEvent("click", function(event)
	{
		new Event(event).stop();
		Carousel_foto.goTo(3);
		
		new Event(event).stop();
		Carousel_texto.goTo(3);

		this.className = 'seleccion';
		$("imagen1").className = '';
		$("imagen2").className = '';
		$("imagen3").className = '';
		$("imagen5").className = '';
	});  
		
	$("imagen5").addEvent("click", function(event)
	{
		new Event(event).stop();
		Carousel_foto.goTo(4);
		
		new Event(event).stop();
		Carousel_texto.goTo(4);

		this.className = 'seleccion';
		$("imagen1").className = '';
		$("imagen2").className = '';
		$("imagen3").className = '';
		$("imagen4").className = '';
	});  
}); 