
function countdown(annee,mois,jour,heure,minute,langue){
	
	
	var montharray = new Array(
		"Jan",
		"Feb",
		"Mar",
		"Apr",
		"May",
		"Jun",
		"Jul",
		"Aug",
		"Sep",
		"Oct",
		"Nov",
		"Dec"
	);
	
	var now = new Date();
	var nowAnnee = now.getYear();
	if (nowAnnee < 1000){nowAnnee+=1900;}
	
	var nowMois=now.getMonth();
	var nowJour=now.getDate();
	var nowHeure=now.getHours()
	var nowMin=now.getMinutes()
	var nowSec=now.getSeconds()
	
	var todaystring = montharray[nowMois]+" "+nowJour+", "+nowAnnee+" "+nowHeure+":"+nowMin+":"+nowSec;
	var futurestring = montharray[mois-1]+" "+jour+", "+annee+" "+heure+":"+minute+":00";
	
	//calcul de la difference en millisec entre les deux dates
	var dd =		Date.parse(futurestring)-Date.parse(todaystring);
	
	//alert(now.getDay());
	var difJour = 	Math.floor(dd/(60*60*1000*24)*1);
	var difHeure =	Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1);
	var difMin =	Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1);
	var difSec =	Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1);
	
	
	
	var motjour = '';
		
	if (langue == "fr"){
		if(difJour > 1){
			motjour = 'Jours';
		}
		else{
			motjour = 'Jour';
		}
	}
	else{
		if(difJour > 1){
			motjour = 'Days';
		}
		else{
			motjour = 'Day';
		}
	}
	
	
	if(dd < 1){
		$('p#countdown').html(
			'0 '+motjour+' 00h 00mn 00s'			  
		);
	}
	else{
		
		if (difHeure < 10){
			difHeure = String(difHeure);
			difHeure = "0"+difHeure;
		}
		if (difMin < 10){
			difMin = String(difMin);
			difMin = "0"+difMin;
		}
		if (difSec < 10){
			difSec = String(difSec);
			difSec = "0"+difSec;
		}
		
		
		$('p#countdown').html(difJour+' '+motjour+' '+difHeure+'h '+difMin+'mn '+difSec+"s");
	}
	
	setTimeout("countdown("+annee+","+mois+","+jour+","+heure+","+minute+",\""+langue+"\")",1000);
}

