$(document).ready(function(){	
						   
	// ALBUM PHOTO carousel
	$(".feat_projects").jCarouselLite({
        visible: 5,  
        auto:4000,  
        speed:1000,
		scroll:2,
		easing:'swing',
       	btnNext: ".next",
       	btnPrev: ".prev"
    });
	
	// Testimonials carousel
	$(".testimonials").jCarouselLite({
		vertical:false,									 
        visible: 1,  
        auto:7000,  
        speed:1000,
		scroll:1,
		easing:'swing',
       	btnNext: ".next2",
       	btnPrev: ".prev2"
    });	
	
	// STAFF HOME carousel
	$(".staff_members").jCarouselLite({
        visible: 5,  
        auto:4000,  
        speed:1000,
		scroll:2,
		easing:'swing',
       	btnNext: ".next3",
       	btnPrev: ".prev3"
    });
	
	// NEWS UPDATE carousel
	$(".news_update").jCarouselLite({
		vertical:false,									 
        visible: 1,  
        auto:8000,  
        speed:1000,
		scroll:1,
		easing:'swing',
       	btnNext: ".next4",
       	btnPrev: ".prev4"
    });	
	
	// TANDEM carousel
	$(".tandem_main").jCarouselLite({
		vertical:false,									 
        visible: 2,  
        auto:4000,  
        speed:1000,
		scroll:1,
		easing:'swing',
       	btnNext: ".next5",
       	btnPrev: ".prev5"
    });		
	//Subscribe Field Text disappearance
	//-------------------------------
	$('#subscribe_field').example(function() {
		return $(this).attr('title');
	});
	
	//lightbox on images
	//-------------------
	$("a[rel^='lightbox[tandem]']").lightBox();
	$("a[rel^='lightbox[skydivers]']").lightBox();
	$("a[rel^='lightbox[solos]']").lightBox();
//	$("a[rel^='lightbox[group3]']").lightBox();
//	$("a[rel^='lightbox[feat]']").lightBox({showNumbers:false});
	
	
	//PHOTO ALBUM  FRANCAIS
	//-----------------	
	$('ul.photo-album-holder-fr').before('<ul id="port_filter"><li class="active"><a href="#">Toutes categories</a></li><li><a href="#">Photos Tandem</a></li><li><a href="#">Photos Parachutistes</a></li><li><a href="#">Gradues Solo</a></li></ul>');  
	
	$('ul#port_filter a').click(function() {  
		$(this).css('outline','none');  
		$('ul#port_filter .active').removeClass('active');  
		$(this).parent().addClass('active');  
		
		var cats = $(this).text().toLowerCase().replace(' ','-');  
		var count1 = 1;
		var count2 = 1;
		if(cats == 'toutes-categories') {  
			$('ul.photo-album-holder-fr li.hidden').fadeIn('fast').removeClass('hidden');  
			$('ul.photo-album-holder-fr li').each(function() { 
							if(count1 % 4 == 0)
							{
								if(!$(this).hasClass('last'))
									{
										$(this).addClass('last');
									}
							}
							else
							{
								if($(this).hasClass('last'))
								{
									$(this).removeClass('last'); 
								}
							}
							count1++;

					});  
		} 
		else {  
					$('ul.photo-album-holder-fr li').each(function() { 
							if(!$(this).hasClass(cats)) {  
								$(this).fadeOut('fast').addClass('hidden');  
							} 
							else {  
								$(this).fadeIn('fast').removeClass('hidden');
								
							
							if(count2 % 4 == 0)
							{
								if(!$(this).hasClass('last'))
									{
										$(this).addClass('last');
									}
							}
							else
							{
								if($(this).hasClass('last'))
								{
									$(this).removeClass('last'); 
								}
							}
							count2++;
					} 
					});  
			}  
		
		return false;  
	}); 
	
	//PHOTO ALBUM  ANGLAIS
	//-----------------	
	$('ul.photo-album-holder-en').before('<ul id="port_filter"><li class="active"><a href="#">All categories</a></li><li><a href="#">Tandem skydives</a></li><li><a href="#">Licensed skydivers</a></li><li><a href="#">PFF Graduates</a></li></ul>');  
	
	$('ul#port_filter a').click(function() {  
		$(this).css('outline','none');  
		$('ul#port_filter .active').removeClass('active');  
		$(this).parent().addClass('active');  
		
		var cats = $(this).text().toLowerCase().replace(' ','-');  
		var count1 = 1;
		var count2 = 1;
		if(cats == 'all-categories') {  
			$('ul.photo-album-holder-en li.hidden').fadeIn('fast').removeClass('hidden');  
			$('ul.photo-album-holder-en li').each(function() { 
							if(count1 % 4 == 0)
							{
								if(!$(this).hasClass('last'))
									{
										$(this).addClass('last');
									}
							}
							else
							{
								if($(this).hasClass('last'))
								{
									$(this).removeClass('last'); 
								}
							}
							count1++;

					});  
		} 
		else {  
					$('ul.photo-album-holder-en li').each(function() { 
							if(!$(this).hasClass(cats)) {  
								$(this).fadeOut('fast').addClass('hidden');  
							} 
							else {  
								$(this).fadeIn('fast').removeClass('hidden');
								
							
							if(count2 % 4 == 0)
							{
								if(!$(this).hasClass('last'))
									{
										$(this).addClass('last');
									}
							}
							else
							{
								if($(this).hasClass('last'))
								{
									$(this).removeClass('last'); 
								}
							}
							count2++;
					} 
					});  
			}  
		
		return false;  
	}); 
	
}) // end document.ready call
