Event.observe(window,"load",function() {
    hCarousel = new UI.Carousel("gallery_carousel",{container:'.gallery'});
});

var activePicture      = 0;
var bildwechsel        = false;

function changePIC(p){
       p = Math.round(p / 0.01) * 0.01 ;
       var bildmax    = ($$("div.gallery li").length)-1;
       activePicture = (activePicture>=bildmax)?0:(activePicture+1);
       // Zeitintervall stoppen
       window.clearTimeout(bildwechsel);
       // Aktivität der anderen Links zurücksetzen
       $$("div#gallery_carousel div.archiv a").each(function(el){
              $(el).removeClassName('active');
       });
       // Aktiver Punkt
       $('pic_'+(p-1)+'').addClassName('active');
       // Autoaufruf
       bildwechsel = window.setTimeout("hCarousel.scrollTo('" + activePicture + "')", 3000);
}

