/*function fenetre(){
	
	var Body = getStyle('Body','height');
	var g = getStyle('Design_g','height');
	var d = getStyle('Design_d','height');
	var menud = getStyle('menud','height');
	var nbody;
	var nmenu;
	g = (parseInt(g) - (169+30)).toString()+"px";
	if(parseInt(menud) >= parseInt(Body)){
		if((parseInt(menud) - parseInt(Body)) < 53){
			nmenu = (parseInt(menud)).toString()+"px";
			nmenu2 = (parseInt(menud)+53).toString()+"px";
			document.getElementById('menud').style.height = nmenu2;
		}else{
			nmenu = (parseInt(menud) - (40)).toString()+"px";
		}
		document.getElementById('Body').style.height = nmenu;
		if((parseInt(menud) - parseInt(Body)) < 53){
			nmenu = (parseInt(menud) + (169+53)).toString()+"px";
		}else{
			nmenu = (parseInt(menud) + (169)).toString()+"px";
		}
		document.getElementById('Design_g').style.height = nmenu;
		document.getElementById('Design_d').style.height = nmenu;	
	}else if(parseInt(menud) < parseInt(Body)){
		nmenu = (parseInt(Body) + 93).toString()+"px";
		document.getElementById('menud').style.height = nmenu;
		nmenu = (parseInt(Body) + (262)).toString()+"px";
		document.getElementById('Design_g').style.height = nmenu;
		document.getElementById('Design_d').style.height = nmenu;
		
	}
	gg = getStyle('menud','height');
	if((parseInt(menud) - parseInt(Body)) < 53){
			gg = (parseInt(gg) + 169 - 53).toString()+"px";
	}else{
			gg = (parseInt(gg) + 169 - 53).toString()+"px";
	}

	
	document.getElementById('Design_g').style.position = "absolute";
	document.getElementById('Design_d').style.position = "absolute";
	document.getElementById('copyright').style.position = "absolute";
    document.getElementById('copyright').style.top = gg;
	document.getElementById('copyright').style.height = "53px";
}

// Récuperer la propriété CSS du div
function getStyle(el,styleProp)
{
	var x = document.getElementById(el);

	if (window.getComputedStyle){

		var y = window.getComputedStyle(x,null).getPropertyValue(styleProp);

	}else if (x.currentStyle){
		var y = document.getElementById(el).offsetHeight;		
	}
	return y;

}*/

function Rebour()
	{
	if (document.getElementById)
		{
	
	var jj = document.getElementById('jj').value;
	var mm = (parseInt(document.getElementById('mm').value - 1)).toString();
	var aaaa = document.getElementById('aaaa').value;
	Maintenant = new Date;
	TempMaintenant = Maintenant.getTime();
	Future = new Date(aaaa,mm,jj);
	TempFuture = Future.getTime();
	DiffSec = Math.floor((TempFuture-TempMaintenant)/1000);
	DiffMin = Math.floor(DiffSec/60);
	Diffheure = Math.floor(DiffMin/60);
	DiffJour = Math.floor(Diffheure/24);
	var bool = false;
	while (DiffMin>=60){
		DiffMin = DiffMin-60;
	}
	while (Diffheure>=24){
		Diffheure = Diffheure-24;
	}
	while (DiffSec>=60){
		DiffSec = DiffSec-60;
	}
	if (DiffJour <= 0 && Diffheure <= 0 && DiffMin <= 0 && DiffSec <= 0){
		bool = true;
	}
	if(Diffheure < 10){
		Diffheure = "0"+Diffheure;
	}
	if(DiffMin < 10){
		DiffMin = "0"+DiffMin;
	}
	if(DiffSec < 10){
		DiffSec = "0"+DiffSec;
	}
	if(DiffJour == 0){
		DiffJour = "";
	}else if(DiffJour == 1 || DiffJour == 0){
		DiffJour = DiffJour + " jour ";
	}else{
		DiffJour = DiffJour + " jours ";
	}
	if(Diffheure == 0){
		Diffheure = "00 : ";
	}else{
		Diffheure = Diffheure + " : ";
	}
	if(DiffMin == 0){
		DiffMin = "00 : ";
	}else{
		DiffMin = DiffMin + " : ";
	}
	if(DiffSec == 0){
		DiffSec = DiffSec + ".";
	}else{
		DiffSec = DiffSec + ".";
	}
	if(bool == false){
		DinaHeure = DiffJour + Diffheure + DiffMin + DiffSec;
	}else{
		DinaHeure = "En cours !";
	}
		document.getElementById("comptarebour").innerHTML=document.getElementById("lan").value+" <b>"+DinaHeure+"</b>";
	}
	temporebour = setTimeout("Rebour()", 1000)
}

function disableEnterKey(event) {
	var event = event || window.event;
	if(event.keyCode==13) {
		if (event.preventDefault) {
			event.preventDefault();
			event.stopPropagation();
		} else {
			event.returnValue = false;
			event.cancelBubble = true;
		}		
	}
}
window.onload = function() {
	Rebour();
	var champs = document.getElementsByTagName('input');
	for(var i=0;i<champs.length;i++) {	
		if(champs[i].type=='text') {
			champs[i].onkeypress = disableEnterKey;
		}
	}
}

