	var ref   = "Les Carottes Sont Cuites et Archi-cuites mais les pommes de terres sont crus.";
	var mail = "zut@pigeons.fr";
	
	function decode(init){		
		res="";		
		var tb = init.split(';');
		for (i=0; i < (tb.length ); i++){
			y = ref.charCodeAt(i);		
			res += String.fromCharCode(tb[i] ^ y);
		}		
		return res;
	}

	function fenetreCentX(url,nom,largeur,hauteur,options) {
		//var haut=(screen.height-hauteur)/2;
		var haut=0;
		var Gauche=(screen.width-largeur)/2;
		fencent=window.open(url,nom,"top="+haut+",left="+Gauche+",width="+largeur+",height="+hauteur+","+options);
	}

	function fenetreCentXY(url,nom,largeur,hauteur,options) {
		var haut=(screen.height-hauteur)/2;		
		var Gauche=(screen.width-largeur)/2;
		fencent=window.open(url,nom,"top="+haut+",left="+Gauche+",width="+largeur+",height="+hauteur+","+options);
	}

	function recalcul(){
		var msie = false;
		var max = document.commande.choix.length;		
		var zz = 0;		
		var resul = 0;	
		if (navigator.userAgent.toUpperCase().indexOf("MSIE") != -1) msie = true;
		
		do{				
			if (msie){
				resul += document.commande.choix[zz].selectedIndex * document.commande.choix[zz].prix;			
			}else{
				resul += document.commande.choix[zz].selectedIndex * document.commande.choix[zz].getAttribute("prix");				
			}				
			zz++;
		}while(zz < max)
	
	
		var aff = Math.round((resul * 100)) .toString();
		var lg =  aff.length;			
		if (Math.round((resul * 100)) != 0){		
			document.commande.total.value = aff.substr(0, lg-2) + "." + aff.substr(lg-2, 2) ;
		}else{
			document.commande.total.value = "0.00";
		}
	
	}


	function ValideCommande(){	
		recalcul();
		var msie = false;
		if (navigator.userAgent.toUpperCase().indexOf("MSIE") != -1) msie = true;
	
		if (document.commande.total.value <= 0){
			alert("Votre commande ne comporte aucune caisse.");
		}else{		
			var off=0;
		for (var i=0 ; i < document.commande.length ; i++ ){
			if(msie){
				if (document.commande.elements[i].ob == '1'){
					if (document.commande.elements[i].ob == '1' && (document.commande.elements[i].value +"") == ""){					
						off ++ ;				
					}		 
				}		 
			}else{
				if (document.commande.elements[i].getAttribute("ob") == '1'){
					if (document.commande.elements[i].getAttribute("ob") == '1' && (document.commande.elements[i].value +"") == ""){
						off ++ ;				
					}		 
				}		 
			}			
		} 	
		if (off > 0){
			alert("Les champs suivants sont obligatoires : \n - Nom \n - Prenom \n - Adresse \n - Code Postal \n - Ville \n - Telephone. \n Ces renseignements sont necessaires pour traiter correctement votre commande.");
		}else{
			window.print();			
		}				
	} 	
	return false;
}
