$(document).ready(function(){

	//Menu déroulant
	$(function() {
    	$('#menu_niveau_un').droppy({speed: 100});
	});
	
	//Formulaire newsletter
	$('#bt_valid_newsletter').click(function(){
		
		var nom 	= $('#nom').val();
	    var prenom 	= $('#prenom').val();
	    var email 	= $('#email').val();	    
	    var choix 	= $('input[type=radio][name=choix_news]:checked').attr('value');
	    
	    $.post('/cgi/inscription-newsletter.php', {'email': email, 'choix': choix, 'nom': nom, 'prenom': prenom}, function(data){
	    	$('#message_validation').css('opacity', 1);
	    	$('#message_validation').empty();
	    	$('#message_validation').append(data);
	    	setTimeout(function(){
				$('#message_validation').animate({opacity: 0}, 500);
    		}, 5000);
	    });
    });
	
	//Calendrier
	$.datepicker.regional['fr'];
	$('.champ_date').datepicker({
		showOn: 'both', 
		buttonImage: '/image/interface/calendar.png', 
		buttonImageOnly: true
	});
	
	//Lightbox prettyPhoto
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'normal', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: 0.40, /* Value betwee 0 and 1 */
		showTitle: false, /* true/false */
		allowresize: true, /* true/false */
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'dark_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
		hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
		modal: false, /* If set to true, only the close button will close the window */
		changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
		callback: function(){} /* Called when prettyPhoto is closed */
	});
});

