function mycarousel_initCallback(carousel) {
    $('.jcarousel-control a img').bind('click', function() {      
		carousel.scroll($.jcarousel.intval($(this).attr("id")));
		$('.jcarousel-control a img').attr("src", "/images/bgvisualnav.png" );
		$(this).attr("src", "/images/bgvisualnavaktiv.png") ;
        return false;
    });

};


$(document).ready(function() {
		 
		 
    $('#projektitemimagesdetail').after('<ul id="nav">').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav',
        pagerAnchorBuilder: function(idx, slide) {
            return '<li><a href="#"><img src="' + slide.src + '" width="50" height="50" /></a></li>';
        }
    });
 

		
		$('#navigation').accordion({
			active: '.selected', 
			header: '.head',
			navigation: true,
			event: '', 
			autoHeight: true  
			 
		});

		
		$('#slideshow').cycle({
        	fx:     'fade',
        	speed:  3000,
        	timeout: 3000,
        	pager:  '#slideshownav',
			slideExpr: 'img'
    	});
		
		$("#mycarousel").jcarousel({
		// This tells jCarousel NOT to autobuild prev/next buttons
        scroll: 1,
        initCallback: mycarousel_initCallback,

		buttonNextHTML: null,
        buttonPrevHTML: null
   		 });

		 
		 
		 $(function() {
         	$('.imagesdetail a').lightBox({
                  txtImage: 'Bild',
                  txtOf: 'von',
                  maxWidth: 960,
                  maxHeight: 640,
                  imageLoading: 'images/loading.gif',
                  imageBtnClose: 'images/close.gif',
                  imageBtnPrev: 'images/prev.gif',
                  imageBtnNext: 'images/next.gif',
         });
  });
  
});


 




