$(document).ready(function() {

		// Nécessite jcarousellite (http://gmarwaha.com/jquery/jcarousellite/index.php)
            //add theme thumbnails
		    var thumbs = '';
		    
		    if(gal_th.length > 3) {
	            for (x in gal_th) {
	                thumbs = thumbs + gal_th[x] + '\n';
	            }
        		
		        $('#autresGaleries ul').html(thumbs)

			    $(".galContainer").jCarouselLite({
				    btnNext: "#test .next",
				    btnPrev: "#test .prev",
				    circular: true,
				    visible: 3,
				    vertical: false
			    });
			    
			    //fix because apparently the previous button got hidden behind the carroussel
			    var stijl = $('.galContainer').attr('style')
			    $('.galContainer').attr('style', stijl + ' z-index: 1;');
			    $('#test .prev').attr('style', 'z-index: 2;');
			}
			
			
			//add img thumbnails
		    var thumbs2 = '';
		    
		    if(gal_img_thumb.length > 3) {
	            for (x in gal_img_thumb) {
	                thumbs2 = thumbs2 + gal_img_thumb[x] + '\n';
	            }
        		
		        $('#portfolio ul').html(thumbs2)
    			

			    $("#scroll").jCarouselLite({
				    btnNext: "#portfolio .next",
				    btnPrev: "#portfolio .prev",
				    circular: true,
				    visible :4,
				    vertical: true
			    });
			}
			
			
			$('#scroll ul li a').click(function(event) {
                var id = $(this).attr("id");
                $('#affiche').html(gal_img[id]);
			    
			    $('#scroll ul li a').removeClass('current');
			    $(this).addClass('current');
			    event.preventDefault();
			});
		
		$('#autresGaleries').css({overflow: 'hidden'})
	
	
});
