<!--
var Carousel = {
    
    CurrentItem : 1,
    
    Init : function(){
    			
		Carousel.CurrentItem = 1;
		
		items = $$('a.CarouselNavi');

		// Add event listener to every article image we find.
		items.each(function (a) {
			a.observe('click',Carousel.Slide,false);
		});
		
		$('back').setOpacity(0.5);
		
		FirstArtItems = $$('div.CarouselItems');
	    
	    var FirstCntItems = FirstArtItems.length;
	    
	    if( FirstCntItems == 1 )
	    {
	    	$('next').setStyle({
				display: 'none'
			});
			$('back').setStyle({
				display: 'none'
			});
	    }
    
    },
    
    Slide : function()
	{	   
		/*if( $('ImageDescription'+Carousel.CurrentItem) )
		{
			//$('ImageDescription'+Carousel.CurrentItem).style.display = 'none';  
			new Effect.BlindUp($('ImageDescription'+Carousel.CurrentItem));
		}*/
		
		ArtItems = $$('div.CarouselItems');
	    
	    var CntItems = ArtItems.length;
	    var width = 345;
	    
	    //Buttons Opacity
	    if( Carousel.CurrentItem-1 <= 1
		&& this.id == 'back' )
	    {
	    	$('back').setOpacity(0.5);
		}
		else
		{
			$('back').setOpacity(1.0);
		}
		
		if( Carousel.CurrentItem+1 >= CntItems
		&& this.id == 'next' )
		{
			$('next').setOpacity(0.5);
		}
		else
		{
			$('next').setOpacity(1.0);
		}
		
	    var x = ($('MyCarousel').getStyle('left') == null) ? '0px' : $('MyCarousel').getStyle('left');
	    x = String(x.substring(0, (x.length - 2)));
	      
	    if (this.id  == 'next') {
	    var item = (x == 0) ? 2 : ((Math.abs(x) / width) + 2);
	
	    } else if (this.id  == 'back') {
	        var item = (Math.abs(x) / width);
	    } else {
	        return false;
	    }
	        
	    if (!$(ArtItems[item - 1])) {
	        return false;
	    }

  
     //alert($('MyCarousel').style.left);
      
      var last = CntItems*345-345;
      var first = CntItems*345-345;
      
	  if( this.id == 'next')
	   {
		   if(Carousel.CurrentItem == CntItems )
           {
                Carousel.CurrentItem = 1;
                new Effect.MoveBy( $('MyCarousel'), 0, 0 , { x: first, y: 0, duration: 0.5,  transition: Effect.Transitions.sinoidal});
           }
           else
           {	
                Carousel.CurrentItem = Carousel.CurrentItem+1;                
                new Effect.MoveBy( $('MyCarousel'), 0, -0 , { x: '-'+width, y: 0, duration: 0.5,  transition: Effect.Transitions.sinoidal});
           }

       }
       if( this.id == 'back')
       {
           if(Carousel.CurrentItem == '1' )
           {
               Carousel.CurrentItem = CntItems;
               new Effect.MoveBy( $('MyCarousel'), 0, 0 , { x: '-'+last, y: 0, duration: 0.5,  transition: Effect.Transitions.sinoidal}); 
           }
           else
           {
               Carousel.CurrentItem = Carousel.CurrentItem-1;
               new Effect.MoveBy( $('MyCarousel'), 0, 0 , { x: width, y: 0, duration: 0.5,  transition: Effect.Transitions.sinoidal}); 
           }
       }
       
		if( Carousel.CurrentItem-1 <= 1
		&& this.id == 'back' )
	    {
		}
		else
		{
			$('numbers').update(Carousel.CurrentItem + ' / ' + CntItems); 
		}
		
		if( Carousel.CurrentItem+1 >= CntItems
		&& this.id == 'next' )
		{			
		}
		else
		{
			$('numbers').update(Carousel.CurrentItem + ' / ' + CntItems); 
		}
       
       		
	}

}
-->

