$(document).ready(function() {

/* MOTEUR DE RECHERCHE */


/*
console.log('-- debut de script --');

$('.TS_type_dossier').hide();
$('.TS_dossier').hide();
$('.TS_type_contenu').hide();

$('#TS_thematique').change(function(){
	$('.TS_type_dossier').show();
});


console.log('-- fin de script --');

*/




	$('#myRoundabout').css({
		'top':'115px',
		'left':'240px',
		'width':'120px'		
	});
	$('#showcase').height(290);
	
	$('ul#myRoundabout').roundabout({
			duration: 500,
			minOpacity: 0,
			minScale:0.615
	});
	var interval;
	
	$('ul#myRoundabout').hover(function() {
		clearInterval(interval);
	},function() {
		interval = startAutoPlay();
	});
	
	interval = startAutoPlay();
	

	function startAutoPlay() {
		return setInterval(function() {
			$('ul#myRoundabout').roundabout_animateToNextChild();
		}, 6000);
	}



	$('.slideshow').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		timeout: 3000
	});
	  
	$("[placeholder]").textPlaceholder();
		
	$("table.triable").tablesorter({sortList: [[0,0]]});

	$(".accordeon").accordion({
		active: '.selectionne',
		selectedClass: 'actif',
		header: 'dt',
		autoheight: false
	});

	// Lightbox
	$(function() {
		var lightbox1 = $(".singleLightbox").ariaLightbox({
			altText: function() {
				return $(this).find("img").attr("alt");
			},
			descText: function() {
				return $(this).attr("rel");
			},
			useDimmer: false,
			closeText: i18n[lang].close,
			pos: "auto",
			em: false,
			imgClose: '/extension/iagutils/design/ezwebin/images/contenu/fermer01.gif'
		});
		var lightbox2 = $("#gallery").ariaLightbox({
			imageArray: "a.seriesLightbox",
			altText: function() {
				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,
			imgClose: '/extension/iagutils/design/ezwebin/images/contenu/fermer01.gif'
		});	
	});
	
	// 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');
	
});
