Cufon.replace('h2', { fontFamily: 'Lubalin' });
Cufon.replace('h3', { fontFamily: 'Lubalin' });


$(document).ready(function(){
						   
	$("div#menu ul.superfish").superfish({ 
		autoArrows:    false, 
		//animation: {width:'show'},   // slide-down effect without fade-in 
		delay:1              // 1.2 second delay on mouseout 
	}); 
	
	// Scrollpane
	if ( $('div#content_text').length > 0 )
    {
        $('div#content_text div.inner').jScrollPane({
            showArrows:true,
            scrollbarWidth : 16
        });
    }
	
	// Thumbnailzoom in projecten
	if ( $('a.thumbzoom').length > 0 )
    {
        $('a.thumbzoom').mouseover(function($e){
			$e.preventDefault();
			var $filename = $(this).find('img').attr('src');
			$('div#menu').hide();
			$('div#content_image').css({'background-image':'url('+$filename+')'});				
		});
    }
	
        $('div#content_image').mouseover(function($e){
			$('div#menu').show('fast');
		});
		
    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() {

//        $('#mycarousel li').each(function(){
//            width = $(this).width()+20+'px;' ;
//            $(this).attr('style', 'width:'+width+'px;');
//            $(this).width(width) ;
//        });
//       
        
        jQuery('#mycarousel').jcarousel({
            scroll: 1,
            auto: 1,
            wrap: 'circular',
            animation: 5000,
            initCallback: mycarousel_initCallback
        });
    });

});
