$(document).ready(function() {
	
	$('#photos').innerfade({ speed: 'slow', timeout: 3000, type: 'sequence', containerheight: '220px' }); 
	
	$("table.triable").tablesorter({sortList: [[0,0]]});

	$(".accordeon").accordion({
		active: '.selectionne',
		selectedClass: 'actif',
		header: 'dt',
		autoheight: false
	});

	// Lightbox
	$(function() {
		var lightbox1 = $(".singleLightbox").ariaLightbox({
			altText: function() {
				// $(this) is the triggered element (in this case the link element)
				return $(this).find("img").attr("alt");
			},
			descText: function() {
				return $(this).attr("rel");
			},
			useDimmer: false,
			closeText: i18n[lang].close,
			pos: "auto",
			em: false
		});
		var lightbox2 = $("#gallery").ariaLightbox({
			imageArray: "a.seriesLightbox",
			altText: function() {
				// $(this) is the triggered element (in this case the link element)
				return $(this).find("img").attr("alt");
			},
			descText: function() {
				return $(this).attr("rel");
			},
			useDimmer: true,
			closeText: i18n[lang].close,
			pictureText: i18n[lang].image,
			ofText:i18n[lang].of,
			prevText: i18n[lang].prevImage,
			nextText: i18n[lang].nextImage,
			pos: "auto",
			em: false
		});	
	});
	
	// Initialisation date de départ du calendrier - délibérations à reporter ds templates si calendrier spécifique selon client..
	$('#date1').datePicker();
	$('#date1').dpSetStartDate('01/01/2000');
	$('#date2').datePicker();
	$('#date2').dpSetStartDate('01/01/2000');
	
});
