function makeMailObfusque(){
	coded = "8326tZ-tIXx@8326tZ.X2"
	  key = "Nxp0UL6zw8r9SaEYWhn4tefJTlMkjPs2yC3HDAvImKoXgQZdFRcuV1bB5q7GOi"
	  shift=coded.length
	  link=""
	  for (i=0; i<coded.length; i++) {
	    if (key.indexOf(coded.charAt(i))==-1) {
	      ltr = coded.charAt(i)
	      link += (ltr)
	    }
	    else {     
	      ltr = (key.indexOf(coded.charAt(i))-shift+key.length) % key.length
	      link += (key.charAt(ltr))
	    }
	  }
		document.location = 'mailto:' + link;
}

$(document).ready(function(){
	/* Permet de faire fonctionner le dropdown menu avec IE6 */
	$('ul.navmenu li.partenaires').hover(
		function() { $('ul', this).css('display', 'block'); },
		function() { $('ul', this).css('display', 'none'); });
	$('ul.navmenu li.procedures').hover(
		function() { $('ul', this).css('display', 'block'); },
		function() { $('ul', this).css('display', 'none'); });
	
	/* Fonctionnement du tableau des options sur les fiches Vehicule */
	$(".tabContent").hide();
	$("ul.tabs li:first").addClass("activeTab").show(); 
	$(".tabContent:first").show();

	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("activeTab"); 
		$(this).addClass("activeTab"); 
		$(".tabContent").hide();

		var activeTab = $(this).find("a").attr("href");
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});

	// jQuery Tooltip	
	$('.helpBTN').tooltip({
		delay: 0,
		showURL: false
	});

	// jQuery Fancybox
	$(".fancyDetails").fancybox({
		'width'				: '50%',
		'height'			: '50%',
	    'autoScale'     	: false,
	    'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'ajax' : {
	    'type'	: "GET"
		}
	});
	
	if($('#datepicker').val() != null){
		// jQuery DatePicker

		$.datepicker.regional['fr'] = {
			closeText: 'Fermer',
			prevText: '&#x3c;Préc',
			nextText: 'Suiv&#x3e;',
			currentText: 'Courant',
			monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',	'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
			monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',	'Jul','Aoû','Sep','Oct','Nov','Déc'],
			dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
			dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
			dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
			weekHeader: 'Sm',
			dateFormat: 'dd/mm/yy',
			firstDay: 1,
			isRTL: false,
			showMonthAfterYear: false,
			yearSuffix: ''};
		$.datepicker.setDefaults($.datepicker.regional['fr']);
		
		var currentDate = new Date().getFullYear();
		var minDate =  currentDate - 18;
		var maxDate =  currentDate - 80;
		
		$('#datepicker').datepicker({
			changeMonth: true,
			changeYear: true,
			yearRange: maxDate + ':' + minDate
		});
	}
});

