<!--

function agb(theURL,winName,features) { 
	window.open(theURL,winName,features);
}

 // calcul du total de la commande
function Total() {
    var etot = 0;
	var tot = 0;
	etot += (120.00 * document.order.qty1.value);
    etot += (127.50 * document.order.qty2.value);
    etot += (142.50 * document.order.qty3.value);
    etot += (142.50 * document.order.qty4.value);
    etot += (157.50 * document.order.qty5.value);
    etot += (157.50 * document.order.qty6.value);
    etot += (172.50 * document.order.qty7.value);
    etot += (120.00 * document.order.qty8.value);
    etot += (13.50 * document.order.qty13.value);
    etot += (21.00 * document.order.qty14.value);
    etot += (21.00 * document.order.qty15.value);
    etot += (28.50 * document.order.qty16.value);
    etot += (18.00 * document.order.qty33.value);
    etot += (142.50 * document.order.qty997.value);
    etot += (33.75 * document.order.qty999.value);
	 
	tot += (160.00 * document.order.qty1.value);
	tot += (170.00 * document.order.qty2.value);
	tot += (190.00 * document.order.qty3.value);
	tot += (190.00 * document.order.qty4.value);
	tot += (210.00 * document.order.qty5.value);
	tot += (210.00 * document.order.qty6.value);
	tot += (230.00 * document.order.qty7.value);
	tot += (160.00 * document.order.qty8.value);
	tot += (18.00 * document.order.qty13.value);
	tot += (28.00 * document.order.qty14.value);
	tot += (28.00 * document.order.qty15.value);
	tot += (38.00 * document.order.qty16.value);
	tot += (24.00 * document.order.qty33.value);
	tot += (190.00 * document.order.qty997.value);
	tot += (45.00 * document.order.qty999.value);

	//tot += (1 * document.order.versand.value);
	document.order.totalcost.value = cent(tot);
	document.order.etotalcost.value = cent(etot);
	//document.order.total_eur.value = cent(tot/1.57);
}

 // Funktion zur Kontrolle der Eingaben
   function ValidLength(item,len) {
     return (item.length >= len);
   }
   function ValidEmail(item) {
     if (!ValidLength(item, 5)) return false;
	 if (item.indexOf ('@', 0)== -1) return false;
	 return true;
   }
   
 // Beenden des Kontrollvorgangs falls ein Fehler gefunden wird
   function error(elem, text) {
     if (errfound) return;
	 window.alert(text);
	 elem.select();
	 elem.focus();
	 errfound = true;
   }

// Hauptkontrollroutine aller Felder   
   function Validate() {
     errfound = false;
	 if (!ValidLength(document.order.nom.value,6))
	    error(document.order.nom, "Veuillez spécifier votre nom et prénom");
	 if (!ValidLength(document.order.adresse.value,3))
	    error(document.order.adresse, "Veuillez spécifier votre adresse complète");
	 if (!ValidLength(document.order.lieu.value,6))
	    error(document.order.lieu, "Veuillez spécifier votre code postal et le lieu");
	 if (!ValidLength(document.order.telephone.value,7))
	    error(document.order.telephone, "Veuillez spécifier votre numéro de téléphone");
	 if (!ValidEmail(document.order.email.value))
	    error(document.order.email, "Veuillez spécifier votre adresse e-mail");
	 if (document.order.totalcost.value == "0.00")
	    error(document.order.totalcost, "Veuillez sélectionner un article");
		if (document.order.conditions.checked == false)
	    error(document.order.conditions, "Veuillez lire les conditions générales et les accepter");
	 return !errfound; /* true if there are no errors */
   }


 // Funktion zur Aktualisierung der Positionssumme, wenn Menge geändert wird
   function UpdateCost(number, unitcost, eunitcost) {
     costname = "cost" + number;
	 ecostname = "ecost" + number;
     qtyname = "qty" + number;
     var q = document.order[qtyname].value;
     document.order[costname].value = cent(q * unitcost);
     document.order[ecostname].value = cent(q * eunitcost);
     Total();
   }

 // Funktion zur Aktualisierung der Positionssumme, wenn Menge geändert wird
   function UpdateCost2(number, unitcost) {
     costname = "cost2" + number;
     qtyname = "qty2" + number;
     var q = document.order[qtyname].value;
     document.order[costname].value = cent(q * unitcost);
     Total2();
   }
   
 // Funktion zur Rundung der Kommastellen
   
  function cent(amount) {
    amount -= 0;
    amount = (Math.round(amount*100))/100;
    return (amount == Math.floor(amount)) ? amount + '.00' : (  (amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
  }


// -->

