// JavaScript Document


// Rotation logos sur page d'accueil
function theRotator() {	
	$('div#rotator ul li').hide();
	$('div#rotator ul li:first').show();
	setInterval('rotate()',3000);
}

function rotate() {	
	var current = ($('div#rotator ul li.show')?  $('div#rotator ul li.show') : $('div#rotator ul li:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#rotator ul li:first') :current.next()) : $('div#rotator ul li:first'));	
	next.hide().addClass('show').slideDown('slow');
	current.slideUp('slow').removeClass('show');
}

// Menu programme 
function navProgramme() { 
    $('ul.tabs').tabs('div.panes > div'); 
}

// Mise en vidence lieu d'animations sur carte
function localMap() {
	 $(".prg-animation li.clearfix").hover(
			function() {
				carte_src = $(this).children("h2").text();
				$(this).addClass("prg-on");
				if(carte_src) {
					$("#carte").attr("src","/templates/1/images/carte/"+carte_src+".png");
				}
			},
			function() {
				$(this).removeClass("prg-on");
				$("#carte").attr("src","images/carte/vide.png");
		}
		).click(
			function() {
			  window.location = $(this).find('a').attr("href");
			}
		);
}

//Affichage slideshow Galerie Photo
function slideFlux() {
	$("#flux-content").easySlider({		
		auto: true,
		continuous: true,
		pause: 4000
	});
}

// Valeur indicative dans les input + password
function inputIndice() {
	$('.inputIndice').each(function() {
		var default_value = this.value;
		$(this).focus(function() {
			if(this.value == default_value) {
				this.value = '';
			}
		});
		$(this).blur(function() {
			if(this.value == '') {
				this.value = default_value;
			}
		});
	});
	$('#password-clear').show();
	$('#password-password').hide();
	$('#password-clear').focus(function() {					
		$('#password-clear').hide();
		$('#password-password').show();
		$('#password-password').focus();
	});
	$('#password-password').blur(function() {
		if($('#password-password').val() == '') {
			$('#password-clear').show();
			$('#password-password').hide();
		}
	});
}

