
function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

jQuery(document).ready(function() {
	$("a.fancyBox").fancybox();
    jQuery('.carouselGal').jcarousel({
        auto: 0,
		scroll: 7,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });
});



function external(path) { // pass in the correct path to the function so we only need one <a> for infinite amount of calls 
//from  flash                
// if the lightbox does not exist we will make it  
if ($('a#lightbox').length == 0) {
   $("body").append('<a id="lightbox" style="visibility: hidden; position: absolute; left: -9999px;" href="'+path+'"></a>');                  
   $('a#lightbox') .lightBox();             
 // if it already exists but the path is different we will set the new path                
  } else if ($('a#lightbox').attr("href") != path) {                   
   $('a#lightbox').attr("href", path);             
  }        
 // now we will simulate the click here.               
  $('a#lightbox').trigger("click");        
 }
