// Var
var Items                    = new Array();      
var ShipCost                 = 0;
var OrderItems               = new String("");   
var OrderPayMethod           = new String("");
var OrderWindow              = new Array();      
var Ship_VAT                 = new Array();
var PayMethod_VAT            = new Array();
var PayMethod_Supp           = new Array();      
var PayMethod_Type           = new Array();
var PaySystem_Type           = new Array();      
var Discounts                = new Array();
var ShipweightPrices         = new Array();
var OldOrderID               = new String("");   
var	OldOrderTotal            = new String("");
// Const
var CurrName                 = 'EUR';
var SecCurrRate              = StringToFloat('0.714285714285714');
var SecCurrName              = 'USD';
var bgColorDark              = '#000000';
var bgColorLight             = '#FFFFFF';
var EncOrderSeparator        = '<~>';            // Encoded Order Separator
var CGIScriptAddress         = 'http://webboutique.microapp.com/cgi-bin/sendorder4.cgi';
var OrderID                  =  new Date();
var Decimals                 =  2;
// Buttons text
var txtBack                  = '&lt;&lt; Retour';                      
var txtOrder                 = 'Commander &gt;&gt;';
var txtCancelOrder           = 'Annuler la commande';               
var txtSendOrder             = 'Valider la commande';
var txtCalculate             = 'Calculer';
// Text text
var txtSubTotal              = 'Sous-total';                      
var txtDelivery              = 'Envoi';
var txtWayOfDelivery         = 'Mode d`envoi';                 
var txtWayOfPayment          = 'Mode de r&egrave;glement';
var txtVAT                   = 'T.V.A.';
var txtVATTotal              = 'Total de la T.V.A.';
var txtTotal                 = 'Total';                         
var txtTotalIncVAT           = 'Total (avec T.V.A.)';
var txtData                  = 'Données';                          
var txtMessage               = 'Message';
var txtOrderFor              = 'Commande pour';                      
var txtWebShopName           = 'auzoma';
var txtOrderedOn             = 'Commandé le';                     
var txtAOrder                = 'Commande';
var txtConfirmation          = 'Confirmation';                  
var txtNone                  = 'Aucun';
var txtSendOrderToEMail      = 'commande.auzoma@yahoo.fr';         
var txtPayMethodCost         = 'Frais d`encaissement';
var txtPayMethodInfo         = 'Informations sur le paiement';                 
var txtDeliveryAddress       = 'Adresse de livraison';
var txtCommon                = 'Général';                        
var txtRegisteredCustomer    = 'Client enregistré';
var txtDeliveryAddressEqual  = 'Adresse de livraison identique à l`adresse de facturation';          
var txtDate                  = 'Date';
var txtInvoiceAddress        = 'Adresse de facturation';                
var txtConditions            = 'Conditions générales de vente';
var txtIsArtMinimumQuantity  = 'La quantité minimale de commande est';          
var txtOutOfStock            = 'L`article n`est plus en stock';	
var txtMoreThanStock         = 'L`article demandé n`est plus en stock';                 
var txtDiscountOnTotal       = 'Remise sur montant total';
var txtCouponDiscount        = 'Bon de réduction';                
var txtOrderNumber           = 'Numéro de commande';
var txtAmount                = 'Quantité';                        
var txtArticlecode           = 'Code de l`article';
var txtDescription           = 'Description';                   
var txtProductPriceIn        = 'Prix unitaire en';
var txtTotalPriceIn          = 'Total en';
// Field text
var txtMr                    = 'M.';                          
var txtMrs                   = 'Mme';
var txtFirstName             = 'Prénom';                   
var txtLastName              = 'Nom';
var txtCompany               = 'Société';                     
var txtCompanyNr             = 'Code client';
var txtCompanyPassword       = 'Mot de passe';
var txtStreetAndNr           = 'N° et rue';
var txtZipcodeTown           = 'Code postal/Ville';
var txtZipcode               = 'Code postal';
var txtTown                  = 'Ville';
var txtCountry               = 'Pays';
var txtPhone                 = 'Téléphone';
var txtEMail                 = 'E-mail';
var txtRemarks               = 'Remarques';
var txtName                  = 'Nom';
var txtWantToReceiveNewsletter = 'Je souhaite recevoir votre lettre d`informations';
var txtVATnr                 = 'N°  T.V.A.';
var txtAcceptConditions      = 'J`accepte les conditions générales de vente';
// Object
var oCustomer                = new Customer('','','','','','','','','','','','','','','','','','',0,'',0,0,'',0,'','','','',0,0);
var oOrder                   = new Order(0,'',0,'','','','','','','','','','',0,0,0,'',0,0);

// Discount

    Discounts[1] = new discount(1,1);
  
    Discounts[1].ranges[1] = new discountRange(1, 999999999, 20);
  
    Discounts[2] = new discount(3,1);
  
    Discounts[2].ranges[1] = new discountRange(5, 9, 10);
  
    Discounts[3] = new discount(4,1);
  
    Discounts[3].ranges[1] = new discountRange(1, 999999999, 30);
  
    Discounts[4] = new discount(5,1);
  
    Discounts[4].ranges[1] = new discountRange(1, 999999999, 40);
  
    Discounts[5] = new discount(6,1);
  
    Discounts[5].ranges[1] = new discountRange(1, 999999999, 15);
  
    Discounts[6] = new discount(7,1);
  
    Discounts[6].ranges[1] = new discountRange(1, 999999999, 5);
  


// ShipweightRange

    ShipweightPrices[0] = new shipweightPrice(20);
  
    ShipweightPrices[0].ranges[1] = new shipweightPriceRange(1, 19, 0.56);
    ShipweightPrices[0].ranges[2] = new shipweightPriceRange(20, 49, 0.9);
    ShipweightPrices[0].ranges[3] = new shipweightPriceRange(50, 69, 1.35);
    ShipweightPrices[0].ranges[4] = new shipweightPriceRange(70, 109, 2.22);
    ShipweightPrices[0].ranges[5] = new shipweightPriceRange(110, 499, 6.5);
    ShipweightPrices[0].ranges[6] = new shipweightPriceRange(500, 999, 7.7);
    ShipweightPrices[0].ranges[7] = new shipweightPriceRange(1000, 1999, 8.75);
    ShipweightPrices[0].ranges[8] = new shipweightPriceRange(2000, 2999, 9.6);
    ShipweightPrices[0].ranges[9] = new shipweightPriceRange(3000, 3999, 11.5);
    ShipweightPrices[0].ranges[10] = new shipweightPriceRange(4000, 4999, 10.5);
    ShipweightPrices[0].ranges[11] = new shipweightPriceRange(5000, 5999, 12.4);
    ShipweightPrices[0].ranges[12] = new shipweightPriceRange(6000, 6999, 12.4);
    ShipweightPrices[0].ranges[13] = new shipweightPriceRange(7000, 7999, 15.25);
    ShipweightPrices[0].ranges[14] = new shipweightPriceRange(8000, 8999, 15.25);
    ShipweightPrices[0].ranges[15] = new shipweightPriceRange(9000, 9999, 15.25);
    ShipweightPrices[0].ranges[16] = new shipweightPriceRange(10000, 14999, 17.25);
    ShipweightPrices[0].ranges[17] = new shipweightPriceRange(15000, 19999, 23.25);
    ShipweightPrices[0].ranges[18] = new shipweightPriceRange(20000, 24999, 23.25);
    ShipweightPrices[0].ranges[19] = new shipweightPriceRange(25000, 29999, 23.25);
    ShipweightPrices[0].ranges[20] = new shipweightPriceRange(30000, 99999999999, 50);
  
    ShipweightPrices[1] = new shipweightPrice(20);
  
    ShipweightPrices[1].ranges[1] = new shipweightPriceRange(1, 19, 0.56);
    ShipweightPrices[1].ranges[2] = new shipweightPriceRange(20, 49, 1.85);
    ShipweightPrices[1].ranges[3] = new shipweightPriceRange(50, 69, 3.47);
    ShipweightPrices[1].ranges[4] = new shipweightPriceRange(70, 109, 5.52);
    ShipweightPrices[1].ranges[5] = new shipweightPriceRange(110, 499, 8.35);
    ShipweightPrices[1].ranges[6] = new shipweightPriceRange(500, 999, 12.55);
    ShipweightPrices[1].ranges[7] = new shipweightPriceRange(1000, 1999, 21.75);
    ShipweightPrices[1].ranges[8] = new shipweightPriceRange(2000, 2999, 21.75);
    ShipweightPrices[1].ranges[9] = new shipweightPriceRange(3000, 3999, 26.35);
    ShipweightPrices[1].ranges[10] = new shipweightPriceRange(4000, 4999, 30.95);
    ShipweightPrices[1].ranges[11] = new shipweightPriceRange(5000, 5999, 35.55);
    ShipweightPrices[1].ranges[12] = new shipweightPriceRange(6000, 6999, 40.15);
    ShipweightPrices[1].ranges[13] = new shipweightPriceRange(7000, 7999, 44.75);
    ShipweightPrices[1].ranges[14] = new shipweightPriceRange(8000, 8999, 49.35);
    ShipweightPrices[1].ranges[15] = new shipweightPriceRange(9000, 9999, 53.95);
    ShipweightPrices[1].ranges[16] = new shipweightPriceRange(10000, 14999, 76.95);
    ShipweightPrices[1].ranges[17] = new shipweightPriceRange(15000, 19999, 99.95);
    ShipweightPrices[1].ranges[18] = new shipweightPriceRange(20000, 24999, 122.95);
    ShipweightPrices[1].ranges[19] = new shipweightPriceRange(25000, 29999, 145.95);
    ShipweightPrices[1].ranges[20] = new shipweightPriceRange(30000, 99999999999, 210);
  
    ShipweightPrices[2] = new shipweightPrice(20);
  
    ShipweightPrices[2].ranges[1] = new shipweightPriceRange(0, 19, 0.56);
    ShipweightPrices[2].ranges[2] = new shipweightPriceRange(20, 49, 2.45);
    ShipweightPrices[2].ranges[3] = new shipweightPriceRange(50, 69, 5.52);
    ShipweightPrices[2].ranges[4] = new shipweightPriceRange(70, 109, 8.52);
    ShipweightPrices[2].ranges[5] = new shipweightPriceRange(110, 499, 10);
    ShipweightPrices[2].ranges[6] = new shipweightPriceRange(500, 999, 15);
    ShipweightPrices[2].ranges[7] = new shipweightPriceRange(1000, 1999, 26.5);
    ShipweightPrices[2].ranges[8] = new shipweightPriceRange(2000, 2999, 38);
    ShipweightPrices[2].ranges[9] = new shipweightPriceRange(3000, 3999, 49.5);
    ShipweightPrices[2].ranges[10] = new shipweightPriceRange(4000, 4999, 61);
    ShipweightPrices[2].ranges[11] = new shipweightPriceRange(5000, 5999, 72.5);
    ShipweightPrices[2].ranges[12] = new shipweightPriceRange(6000, 6999, 84);
    ShipweightPrices[2].ranges[13] = new shipweightPriceRange(7000, 7999, 95.5);
    ShipweightPrices[2].ranges[14] = new shipweightPriceRange(8000, 8999, 107);
    ShipweightPrices[2].ranges[15] = new shipweightPriceRange(9000, 9999, 118.5);
    ShipweightPrices[2].ranges[16] = new shipweightPriceRange(10000, 14999, 176.5);
    ShipweightPrices[2].ranges[17] = new shipweightPriceRange(15000, 19999, 234.5);
    ShipweightPrices[2].ranges[18] = new shipweightPriceRange(20000, 24999, 292.5);
    ShipweightPrices[2].ranges[19] = new shipweightPriceRange(25000, 29999, 350.5);
    ShipweightPrices[2].ranges[20] = new shipweightPriceRange(30000, 99999999999, 600);
  
    ShipweightPrices[3] = new shipweightPrice(20);
  
    ShipweightPrices[3].ranges[1] = new shipweightPriceRange(1, 19, 1.33);
    ShipweightPrices[3].ranges[2] = new shipweightPriceRange(20, 49, 2.3);
    ShipweightPrices[3].ranges[3] = new shipweightPriceRange(50, 69, 5.52);
    ShipweightPrices[3].ranges[4] = new shipweightPriceRange(70, 109, 9.1);
    ShipweightPrices[3].ranges[5] = new shipweightPriceRange(110, 499, 12.6);
    ShipweightPrices[3].ranges[6] = new shipweightPriceRange(500, 999, 15.9);
    ShipweightPrices[3].ranges[7] = new shipweightPriceRange(1000, 1999, 17.45);
    ShipweightPrices[3].ranges[8] = new shipweightPriceRange(2000, 2999, 21.05);
    ShipweightPrices[3].ranges[9] = new shipweightPriceRange(3000, 3999, 24.65);
    ShipweightPrices[3].ranges[10] = new shipweightPriceRange(4000, 4999, 28.25);
    ShipweightPrices[3].ranges[11] = new shipweightPriceRange(5000, 5999, 31.85);
    ShipweightPrices[3].ranges[12] = new shipweightPriceRange(6000, 6999, 35.45);
    ShipweightPrices[3].ranges[13] = new shipweightPriceRange(7000, 7999, 39.05);
    ShipweightPrices[3].ranges[14] = new shipweightPriceRange(8000, 8999, 42.65);
    ShipweightPrices[3].ranges[15] = new shipweightPriceRange(9000, 9999, 46.25);
    ShipweightPrices[3].ranges[16] = new shipweightPriceRange(10000, 14999, 53.25);
    ShipweightPrices[3].ranges[17] = new shipweightPriceRange(15000, 19999, 60.25);
    ShipweightPrices[3].ranges[18] = new shipweightPriceRange(20000, 24999, 67.25);
    ShipweightPrices[3].ranges[19] = new shipweightPriceRange(25000, 29999, 74.25);
    ShipweightPrices[3].ranges[20] = new shipweightPriceRange(30000, 99999999999, 120);
  
    ShipweightPrices[4] = new shipweightPrice(20);
  
    ShipweightPrices[4].ranges[1] = new shipweightPriceRange(1, 19, 2.3);
    ShipweightPrices[4].ranges[2] = new shipweightPriceRange(20, 49, 3.3);
    ShipweightPrices[4].ranges[3] = new shipweightPriceRange(50, 69, 6.1);
    ShipweightPrices[4].ranges[4] = new shipweightPriceRange(70, 109, 9.5);
    ShipweightPrices[4].ranges[5] = new shipweightPriceRange(110, 499, 15.6);
    ShipweightPrices[4].ranges[6] = new shipweightPriceRange(500, 999, 19.2);
    ShipweightPrices[4].ranges[7] = new shipweightPriceRange(1000, 1999, 21.1);
    ShipweightPrices[4].ranges[8] = new shipweightPriceRange(2000, 2999, 25.5);
    ShipweightPrices[4].ranges[9] = new shipweightPriceRange(3000, 3999, 29.9);
    ShipweightPrices[4].ranges[10] = new shipweightPriceRange(4000, 4999, 34.3);
    ShipweightPrices[4].ranges[11] = new shipweightPriceRange(5000, 5999, 38.7);
    ShipweightPrices[4].ranges[12] = new shipweightPriceRange(6000, 6999, 43.1);
    ShipweightPrices[4].ranges[13] = new shipweightPriceRange(7000, 7999, 47.5);
    ShipweightPrices[4].ranges[14] = new shipweightPriceRange(8000, 8999, 51.9);
    ShipweightPrices[4].ranges[15] = new shipweightPriceRange(9000, 9999, 56.3);
    ShipweightPrices[4].ranges[16] = new shipweightPriceRange(10000, 14999, 66.4);
    ShipweightPrices[4].ranges[17] = new shipweightPriceRange(15000, 19999, 76.5);
    ShipweightPrices[4].ranges[18] = new shipweightPriceRange(20000, 24999, 86.6);
    ShipweightPrices[4].ranges[19] = new shipweightPriceRange(25000, 29999, 96.7);
    ShipweightPrices[4].ranges[20] = new shipweightPriceRange(30000, 99999999999, 120);
  
    ShipweightPrices[5] = new shipweightPrice(20);
  
    ShipweightPrices[5].ranges[1] = new shipweightPriceRange(1, 19, 3.3);
    ShipweightPrices[5].ranges[2] = new shipweightPriceRange(20, 49, 5.52);
    ShipweightPrices[5].ranges[3] = new shipweightPriceRange(50, 69, 9.1);
    ShipweightPrices[5].ranges[4] = new shipweightPriceRange(70, 109, 15.6);
    ShipweightPrices[5].ranges[5] = new shipweightPriceRange(110, 499, 19.8);
    ShipweightPrices[5].ranges[6] = new shipweightPriceRange(500, 999, 22.1);
    ShipweightPrices[5].ranges[7] = new shipweightPriceRange(1000, 1999, 29.5);
    ShipweightPrices[5].ranges[8] = new shipweightPriceRange(2000, 2999, 38.7);
    ShipweightPrices[5].ranges[9] = new shipweightPriceRange(3000, 3999, 47.9);
    ShipweightPrices[5].ranges[10] = new shipweightPriceRange(4000, 4999, 57.1);
    ShipweightPrices[5].ranges[11] = new shipweightPriceRange(5000, 5999, 66.3);
    ShipweightPrices[5].ranges[12] = new shipweightPriceRange(6000, 6999, 75.5);
    ShipweightPrices[5].ranges[13] = new shipweightPriceRange(7000, 7999, 84.7);
    ShipweightPrices[5].ranges[14] = new shipweightPriceRange(8000, 8999, 93.9);
    ShipweightPrices[5].ranges[15] = new shipweightPriceRange(9000, 9999, 103.1);
    ShipweightPrices[5].ranges[16] = new shipweightPriceRange(10000, 14999, 126.1);
    ShipweightPrices[5].ranges[17] = new shipweightPriceRange(15000, 19999, 149.1);
    ShipweightPrices[5].ranges[18] = new shipweightPriceRange(20000, 24999, 172.1);
    ShipweightPrices[5].ranges[19] = new shipweightPriceRange(25000, 29999, 195.1);
    ShipweightPrices[5].ranges[20] = new shipweightPriceRange(30000, 99999999999, 250);
  
    ShipweightPrices[6] = new shipweightPrice(20);
  
    ShipweightPrices[6].ranges[1] = new shipweightPriceRange(1, 19, 3.3);
    ShipweightPrices[6].ranges[2] = new shipweightPriceRange(20, 49, 5.52);
    ShipweightPrices[6].ranges[3] = new shipweightPriceRange(50, 69, 12.1);
    ShipweightPrices[6].ranges[4] = new shipweightPriceRange(70, 109, 16.6);
    ShipweightPrices[6].ranges[5] = new shipweightPriceRange(110, 499, 22.8);
    ShipweightPrices[6].ranges[6] = new shipweightPriceRange(500, 999, 24.4);
    ShipweightPrices[6].ranges[7] = new shipweightPriceRange(1000, 1999, 36.6);
    ShipweightPrices[6].ranges[8] = new shipweightPriceRange(2000, 2999, 48.8);
    ShipweightPrices[6].ranges[9] = new shipweightPriceRange(3000, 3999, 61);
    ShipweightPrices[6].ranges[10] = new shipweightPriceRange(4000, 4999, 73.2);
    ShipweightPrices[6].ranges[11] = new shipweightPriceRange(5000, 5999, 85.4);
    ShipweightPrices[6].ranges[12] = new shipweightPriceRange(6000, 6999, 97.6);
    ShipweightPrices[6].ranges[13] = new shipweightPriceRange(7000, 7999, 109.8);
    ShipweightPrices[6].ranges[14] = new shipweightPriceRange(8000, 8999, 122);
    ShipweightPrices[6].ranges[15] = new shipweightPriceRange(9000, 9999, 134.2);
    ShipweightPrices[6].ranges[16] = new shipweightPriceRange(10000, 14999, 158.6);
    ShipweightPrices[6].ranges[17] = new shipweightPriceRange(15000, 19999, 183);
    ShipweightPrices[6].ranges[18] = new shipweightPriceRange(20000, 24999, 231.8);
    ShipweightPrices[6].ranges[19] = new shipweightPriceRange(25000, 29999, 280.6);
    ShipweightPrices[6].ranges[20] = new shipweightPriceRange(30000, 99999999999, 350);
  
    ShipweightPrices[7] = new shipweightPrice(0);


// Array
var aVATItems = new Array();

    aVATItems[aVATItems.length] = new VAT(1,'Export','0',0);


function discount(discountType, ranges) {
  this.discountType = discountType;
  this.ranges       = new Array(ranges);
  return this;
}

function discountRange(min, max, perc) {
  this.min   = parseFloat(min);
  this.max   = parseFloat(max);
  this.perc  = parseFloat(perc);
  return this;
}

function discountPrice(price, discType, quantity,
        SecAmount1, SecPrice1, SecAmount2, SecPrice2, SecAmount3, SecPrice3,
					   SecAmount4, SecPrice4, SecAmount5, SecPrice5, SecAmount6, SecPrice6,
					   SecAmount7, SecPrice7, SecAmount8, SecPrice8, SecAmount9, SecPrice9,
					   SecAmount10, SecPrice10) {
  var returnPrice = price;
  if ((SecAmount1 == 0) || (quantity < SecAmount1)) {
    for (var i = 1; i < Discounts.length; i++){
      if (Discounts[i].discountType == discType) {
        for (var y = 1; y < Discounts[i].ranges.length; y++) {
          if (quantity > Discounts[i].ranges[y].min-1) {
            returnPrice = (price/100) * (100-Discounts[i].ranges[y].perc);
          }
        }
      }
    }
  } else { 
    if ((SecAmount10 == 0) || (quantity < SecAmount10) ) {
		if ((SecAmount9 == 0) || (quantity < SecAmount9) ) {
			if ((SecAmount8 == 0) || (quantity < SecAmount8) ) {
				if ((SecAmount7 == 0) || (quantity < SecAmount7) ) {
					if ((SecAmount6 == 0) || (quantity < SecAmount6) ) {
						if ((SecAmount5 == 0) || (quantity < SecAmount5) ) {
							if ((SecAmount4 == 0) || (quantity < SecAmount4) ) {
								if ((SecAmount3 == 0) || (quantity < SecAmount3) ) {
									if ((SecAmount2 == 0) || (quantity < SecAmount2) ) {
										if ((SecAmount1 == 0) || (quantity < SecAmount1) ) {
										} else { returnPrice = SecPrice1; }
									} else { returnPrice = SecPrice2; }
								} else { returnPrice = SecPrice3; }
							} else { returnPrice = SecPrice4; }
						} else { returnPrice = SecPrice5; }
					} else { returnPrice = SecPrice6; }
				} else { returnPrice = SecPrice7; }
			} else { returnPrice = SecPrice8; }
		} else { returnPrice = SecPrice9; }
	} else { returnPrice = SecPrice10; }
  }
  return returnPrice;
}

function discountOnTotalPrice(totalPrice) {
  var returnDiscount = 0;
		
		
		
		return returnDiscount;
}

function shipweightPrice(ranges) {
  this.ranges       = new Array(ranges);
  return this;
}

function shipweightPriceRange(min, max, price) {
  this.min   = parseFloat(min);
  this.max   = parseFloat(max);
  this.price = parseFloat(price);
  return this;
}

function showCart(location) {
  window.frame_body.location = "F_cart.html";
}

function position(ArticleCode, OptionsText) {
  var j = -1;
  for (var i = 0; i < Items.length; i++) {
    if ((Items[i].ArticleCode == ArticleCode) && (Items[i].OptionsText == OptionsText)) {
      j = i;
    }
  }
  return j;
}

function VAT(VID, VName, VValue, VTotal) {
  this.VID    = VID;
  this.VName  = VName;
  this.VValue = StringToFloat(VValue);
  this.VTotal = VTotal;
}

function Item(ArticleCode, Name, Price, Quantity, VAT, DiscountType, OriginalPrice,
              Weight, ShipPrice, OptionsText,
              SecAmount1, SecPrice1, SecAmount2, SecPrice2, SecAmount3, SecPrice3,
              SecAmount4, SecPrice4, SecAmount5, SecPrice5, SecAmount6, SecPrice6,
              SecAmount7, SecPrice7, SecAmount8, SecPrice8, SecAmount9, SecPrice9,
              SecAmount10, SecPrice10,
              ArticleSalesCode, MinimumQuantity, StockQuantity, ExtraInfo) {
  this.ArticleCode      = ArticleCode;       this.Name            = Name;
  this.Price            = Price;             this.Quantity        = Quantity;
  this.VAT              = VAT;               this.DiscountType    = DiscountType;
  this.OriginalPrice    = OriginalPrice;     this.Weight          = Weight;
  this.ShipPrice        = ShipPrice;         this.OptionsText     = OptionsText;
  this.SecAmount1       = SecAmount1;        this.SecPrice1       = SecPrice1;
  this.SecAmount2       = SecAmount2;        this.SecPrice2       = SecPrice2;
  this.SecAmount3       = SecAmount3;        this.SecPrice3       = SecPrice3;
  this.SecAmount4       = SecAmount4;        this.SecPrice4       = SecPrice4;
  this.SecAmount5       = SecAmount5;        this.SecPrice5       = SecPrice5;
  this.SecAmount6       = SecAmount6;        this.SecPrice6       = SecPrice6;
  this.SecAmount7       = SecAmount7;        this.SecPrice7       = SecPrice7;
  this.SecAmount8       = SecAmount8;        this.SecPrice8       = SecPrice8;
  this.SecAmount9       = SecAmount9;        this.SecPrice9       = SecPrice9;
  this.SecAmount10      = SecAmount10;       this.SecPrice10      = SecPrice10;
  this.ArticleSalesCode = ArticleSalesCode;  this.MinimumQuantity	= MinimumQuantity;
  this.StockQuantity	  = StockQuantity;     this.ExtraInfo    		= ExtraInfo;
}

function Customer(Salutation, FirstName, LastName, Company, CompanyCode, CompanyPassword,
                  Street, ZipCode, Town, Country, Phone, DelName, DelStreet, DelZipCode,
                  DelTown, DelCountry, DelPhone, EMail, ShipCost, ShipText, ShipVAT,
                  PayMethodCost, PayMethodText, PayMethodVAT, Memo, Newsletter,
                  PayMethodMemo, VATnr, DiscountOnTotalVAT,	CouponDiscountVAT,
																		PayMethodSupp) {
  this.Salutation         = Salutation;         this.FirstName         = FirstName;
  this.LastName           = LastName;           this.Company           = Company;
  this.CompanyCode        = CompanyCode;        this.CompanyPassword   = CompanyPassword;
  this.Street             = Street;             this.ZipCode           = ZipCode;
  this.Town               = Town;               this.Country           = Country;
  this.Phone              = Phone;              this.DelName           = DelName;
  this.DelStreet          = DelStreet;          this.DelZipCode        = DelZipCode;
  this.DelTown            = DelTown;            this.DelCountry        = DelCountry;
  this.DelPhone           = DelPhone;           this.EMail             = EMail;
  this.ShipCost           = ShipCost;           this.ShipText          = ShipText;
  this.ShipVAT            = ShipVAT;            this.PayMethodCost     = PayMethodCost;
  this.PayMethodText      = PayMethodText;      this.PayMethodVAT      = PayMethodVAT;
  this.Memo               = Memo;               this.NewsLetter        = Newsletter;
  this.PayMethodMemo      = PayMethodMemo;      this.VATnr             = VATnr;
  this.DiscountOnTotalVAT = DiscountOnTotalVAT; this.CouponDiscountVAT = CouponDiscountVAT;
		this.PayMethodSupp      = PayMethodSupp;
}

function Order(PayMethodCost, PayMethodText, PayMethodVAT, ItemsReadable,
               ItemsReadableHTML, Items, SubTotal, Delivery, Total, SecCurr, VAT, VATtotal,
               PayMethodshort, ShipType, PayMethodType, PaySystemType, DiscountOnTotal,
               Coupon, CouponDiscount, CouponDiscountAmount) {
  this.PayMethodCost = PayMethodCost; this.PayMethodText     = PayMethodText;
  this.PayMethodVAT  = PayMethodVAT;
  this.ItemsReadable = ItemsReadable; this.ItemsReadableHTML = ItemsReadableHTML;
  this.Items         = Items;         this.SubTotal          = SubTotal;
  this.Delivery      = Delivery;      this.Total             = Total;
  this.SecCurr       = SecCurr;       this.VAT               = VAT;
  this.VATtotal      = VATtotal;      this.PayMethodshort    = PayMethodshort;
  this.ShipType      = ShipType;      this.PayMethodType     = PayMethodType;
  this.PaySystemType = PaySystemType; this.DiscountOnTotal   = DiscountOnTotal;
  this.Coupon        = Coupon;        this.CouponDiscount    = CouponDiscount;
		this.CouponDiscountAmount    = CouponDiscountAmount;
}

function addToCart(form) {
  var ArtArticleCode       = form.Articlecode.value;
  var ArtArticleSalesCode  = form.Articlesalescode.value;
  var ArtName              = form.Name.value;
  var ArtPrice             = StringToFloat(form.Price.value);
  var ArtVAT               = form.VAT.value;
  var ArtQuantity          = parseInt(form.Quantity.value,10);
  var ArtDiscountType      = form.DiscountType.value;
  var ArtWeight            = StringToFloat(form.Weight.value);
  var ArtShipPrice         = StringToFloat(form.TransportPrice.value);
  var ArtInOrder           = 0;
  var ArtOptionsText       = new String("");
  var ArtTextsText         = new String("");
  var StopAddToCart	       = new String("N");
  var ArtMinimumQuantity   = StringToFloat(form.MinimumQuantity.value);
 	var ArtStockQuantity     = 0;



  SiteURL;

  if (typeof(form.SecAmount1)!= 'undefined' && form.SecAmount1 != null) {
           ArtSecAmount1  = StringToFloat(form.SecAmount1.value);
  } else { ArtSecAmount1  = 0; }
  if (typeof(form.SecAmount2)!= 'undefined' && form.SecAmount2 != null) {
           ArtSecAmount2  = StringToFloat(form.SecAmount2.value);
  } else { ArtSecAmount2  = 0; }
	if (typeof(form.SecAmount3)!= 'undefined' && form.SecAmount3 != null) {
           ArtSecAmount3  = StringToFloat(form.SecAmount3.value);
  } else { ArtSecAmount3  = 0; }
	if (typeof(form.SecAmount4)!= 'undefined' && form.SecAmount4 != null) {
           ArtSecAmount4  = StringToFloat(form.SecAmount4.value);
  } else { ArtSecAmount4  = 0; }
	if (typeof(form.SecAmount5)!= 'undefined' && form.SecAmount5 != null) {
           ArtSecAmount5  = StringToFloat(form.SecAmount5.value);
  } else { ArtSecAmount5  = 0; }
	if (typeof(form.SecAmount6)!= 'undefined' && form.SecAmount6 != null) {
           ArtSecAmount6  = StringToFloat(form.SecAmount6.value);
  } else { ArtSecAmount6  = 0; }
	if (typeof(form.SecAmount7)!= 'undefined' && form.SecAmount7 != null) {
           ArtSecAmount7  = StringToFloat(form.SecAmount7.value);
  } else { ArtSecAmount7  = 0; }
	if (typeof(form.SecAmount8)!= 'undefined' && form.SecAmount8 != null) {
           ArtSecAmount8  = StringToFloat(form.SecAmount8.value);
  } else { ArtSecAmount8  = 0; }
	if (typeof(form.SecAmount9)!= 'undefined' && form.SecAmount9 != null) {
           ArtSecAmount9  = StringToFloat(form.SecAmount9.value);
  } else { ArtSecAmount9  = 0; }
	if (typeof(form.SecAmount10)!= 'undefined' && form.SecAmount10 != null) {
           ArtSecAmount10 = StringToFloat(form.SecAmount10.value);
  } else { ArtSecAmount10 = 0; }

 if (typeof(form.SecPrice1)!= 'undefined' && form.SecPrice1 != null) {
           ArtSecPrice1  = StringToFloat(form.SecPrice1.value);
  } else { ArtSecPrice1  = 0; }
	if (typeof(form.SecPrice2)!= 'undefined' && form.SecPrice2 != null) {
           ArtSecPrice2  = StringToFloat(form.SecPrice2.value);
  } else { ArtSecPrice2  = 0; }
	if (typeof(form.SecPrice3)!= 'undefined' && form.SecPrice3 != null) {
           ArtSecPrice3  = StringToFloat(form.SecPrice3.value);
  } else { ArtSecPrice3  = 0; }
	if (typeof(form.SecPrice4)!= 'undefined' && form.SecPrice4 != null) {
           ArtSecPrice4  = StringToFloat(form.SecPrice4.value);
  } else { ArtSecPrice4  = 0; }
	if (typeof(form.SecPrice5)!= 'undefined' && form.SecPrice5 != null) {
           ArtSecPrice5  = StringToFloat(form.SecPrice5.value);
  } else { ArtSecPrice5  = 0; }
	if (typeof(form.SecPrice6)!= 'undefined' && form.SecPrice6 != null) {
           ArtSecPrice6  = StringToFloat(form.SecPrice6.value);
  } else { ArtSecPrice6  = 0; }
	if (typeof(form.SecPrice7)!= 'undefined' && form.SecPrice7 != null) {
           ArtSecPrice7  = StringToFloat(form.SecPrice7.value);
  } else { ArtSecPrice7  = 0; }
	if (typeof(form.SecPrice8)!= 'undefined' && form.SecPrice8 != null) {
           ArtSecPrice8  = StringToFloat(form.SecPrice8.value);
  } else { ArtSecPrice8  = 0; }
	if (typeof(form.SecPrice9)!= 'undefined' && form.SecPrice9 != null) {
           ArtSecPrice9  = StringToFloat(form.SecPrice9.value);
  } else { ArtSecPrice9  = 0; }
	if (typeof(form.SecPrice10)!= 'undefined' && form.SecPrice10 != null) {
           ArtSecPrice10 = StringToFloat(form.SecPrice10.value);
  } else { ArtSecPrice10 = 0; }

	<!-- Check if required options are not empty -->
	

	if ((StopAddToCart == "N") && (typeof(form.Opt1c)!= 'undefined' && form.Opt1c != null)) {
	  if ((form.Opt1c.value == 'required') && (form.Opt1b.selectedIndex == 0)) {
      alert("Le champ '" + form.Opt1a.value + "' est obligatoire !");
      StopAddToCart = "Y";
      return false;
	  }
	}
	

	if ((StopAddToCart == "N") && (typeof(form.Opt2c)!= 'undefined' && form.Opt2c != null)) {
	  if ((form.Opt2c.value == 'required') && (form.Opt2b.selectedIndex == 0)) {
      alert("Le champ '" + form.Opt2a.value + "' est obligatoire !");
      StopAddToCart = "Y";
      return false;
	  }
	}
	

	if ((StopAddToCart == "N") && (typeof(form.Opt3c)!= 'undefined' && form.Opt3c != null)) {
	  if ((form.Opt3c.value == 'required') && (form.Opt3b.selectedIndex == 0)) {
      alert("Le champ '" + form.Opt3a.value + "' est obligatoire !");
      StopAddToCart = "Y";
      return false;
	  }
	}
	

	if ((StopAddToCart == "N") && (typeof(form.Opt4c)!= 'undefined' && form.Opt4c != null)) {
	  if ((form.Opt4c.value == 'required') && (form.Opt4b.selectedIndex == 0)) {
      alert("Le champ '" + form.Opt4a.value + "' est obligatoire !");
      StopAddToCart = "Y";
      return false;
	  }
	}
	

	if ((StopAddToCart == "N") && (typeof(form.Opt5c)!= 'undefined' && form.Opt5c != null)) {
	  if ((form.Opt5c.value == 'required') && (form.Opt5b.selectedIndex == 0)) {
      alert("Le champ '" + form.Opt5a.value + "' est obligatoire !");
      StopAddToCart = "Y";
      return false;
	  }
	}
	

	<!-- Check if required texts are not empty -->
	

	if ((StopAddToCart == "N") && (typeof(form.Text1c)!= 'undefined' && form.Text1c != null)) {
	  if ((form.Text1c.value == 'required') && (form.Text1b.value == '')) {
      alert("Le champ '" + form.Text1a.value + "' est obligatoire !");
      StopAddToCart = "Y";
      return false;
	  }
	}
	


	if (StopAddToCart == "N") {
	  

    if (form.Opt1a.value != '') {
		  if (form.Opt1b.selectedIndex != 0) {
 		    ArtOptionsText  += ' (' + form.Opt1a.value;
		    ArtOptionsText  += ': ' + form.Opt1b.options[form.Opt1b.selectedIndex].text+')';
		    ArtPrice        += StringToFloat(form.Opt1b.options[form.Opt1b.selectedIndex].value);
		  }
		}
	  

    if (form.Opt2a.value != '') {
		  if (form.Opt2b.selectedIndex != 0) {
 		    ArtOptionsText  += ' (' + form.Opt2a.value;
		    ArtOptionsText  += ': ' + form.Opt2b.options[form.Opt2b.selectedIndex].text+')';
		    ArtPrice        += StringToFloat(form.Opt2b.options[form.Opt2b.selectedIndex].value);
		  }
		}
	  

    if (form.Opt3a.value != '') {
		  if (form.Opt3b.selectedIndex != 0) {
 		    ArtOptionsText  += ' (' + form.Opt3a.value;
		    ArtOptionsText  += ': ' + form.Opt3b.options[form.Opt3b.selectedIndex].text+')';
		    ArtPrice        += StringToFloat(form.Opt3b.options[form.Opt3b.selectedIndex].value);
		  }
		}
	  

    if (form.Opt4a.value != '') {
		  if (form.Opt4b.selectedIndex != 0) {
 		    ArtOptionsText  += ' (' + form.Opt4a.value;
		    ArtOptionsText  += ': ' + form.Opt4b.options[form.Opt4b.selectedIndex].text+')';
		    ArtPrice        += StringToFloat(form.Opt4b.options[form.Opt4b.selectedIndex].value);
		  }
		}
	  

    if (form.Opt5a.value != '') {
		  if (form.Opt5b.selectedIndex != 0) {
 		    ArtOptionsText  += ' (' + form.Opt5a.value;
		    ArtOptionsText  += ': ' + form.Opt5b.options[form.Opt5b.selectedIndex].text+')';
		    ArtPrice        += StringToFloat(form.Opt5b.options[form.Opt5b.selectedIndex].value);
		  }
		}
	  

    

    if (form.Text1a.value != '') {
		  if (form.Text1b.value != '') {
        if (ArtTextsText != '') {ArtTextsText += '  -  '}
        ArtTextsText  += form.Text1a.value + ':  ' + form.Text1b.value;
      }
    }
	  

		ArtName += ArtOptionsText;

    for (var i=0; i<Items.length; i++) {
      if ((Items[i].ArticleCode == ArtArticleCode) && (Items[i].Name == ArtName) &&
			   (((Items[i].ExtraInfo.length == 0 ) && (ArtTextsText.length == 0)) || (Items[i].ExtraInfo == ArtTextsText))) {
		    if (ArtMinimumQuantity > (Items[i].Quantity + ArtQuantity)) {
          alert(txtIsArtMinimumQuantity+": '" + ArtMinimumQuantity + "'");
		      return false;
        
   			} else {
				  Items[i].Quantity += ArtQuantity;
				  Items[i].Price     = discountPrice(Items[i].OriginalPrice, Items[i].DiscountType, Items[i].Quantity,
												   Items[i].SecAmount1, Items[i].SecPrice1, Items[i].SecAmount2, Items[i].SecPrice2,
												   Items[i].SecAmount3, Items[i].SecPrice3, Items[i].SecAmount4, Items[i].SecPrice4,
												   Items[i].SecAmount5, Items[i].SecPrice5, Items[i].SecAmount6, Items[i].SecPrice6,
												   Items[i].SecAmount7, Items[i].SecPrice7, Items[i].SecAmount8, Items[i].SecPrice8,
												   Items[i].SecAmount9, Items[i].SecPrice9, Items[i].SecAmount10, Items[i].SecPrice10);
				  ArtInOrder         = 1;
        }
		  }
		}

		if (ArtInOrder == 0) {
      if (ArtMinimumQuantity > ArtQuantity) {
        alert(txtIsArtMinimumQuantity+": '" + ArtMinimumQuantity + "'");
        return false;
      
      } else {
        Items[Items.length] = new Item(ArtArticleCode,ArtName,
             discountPrice(ArtPrice, ArtDiscountType, ArtQuantity,
										   ArtSecAmount1, ArtSecPrice1, ArtSecAmount2, ArtSecPrice2, ArtSecAmount3, ArtSecPrice3,
										   ArtSecAmount4, ArtSecPrice4, ArtSecAmount5, ArtSecPrice5, ArtSecAmount6, ArtSecPrice6,
										   ArtSecAmount7, ArtSecPrice7, ArtSecAmount8, ArtSecPrice8, ArtSecAmount9, ArtSecPrice9,
										   ArtSecAmount10, ArtSecPrice10),
  										 ArtQuantity,ArtVAT,
		  								 ArtDiscountType,ArtPrice,ArtWeight,ArtShipPrice, ArtOptionsText,
				  						 ArtSecAmount1, ArtSecPrice1, ArtSecAmount2, ArtSecPrice2, ArtSecAmount3, ArtSecPrice3,
						  				 ArtSecAmount4, ArtSecPrice4, ArtSecAmount5, ArtSecPrice5, ArtSecAmount6, ArtSecPrice6,
								  		 ArtSecAmount7, ArtSecPrice7, ArtSecAmount8, ArtSecPrice8, ArtSecAmount9, ArtSecPrice9,
										   ArtSecAmount10, ArtSecPrice10,
										   ArtArticleSalesCode, ArtMinimumQuantity, ArtStockQuantity, ArtTextsText);
		  }
		}
	  return true;
	}
}

function printSalutation() {
  var Text                   = new String("");
  Text = oCustomer.Salutation +'&nbsp;' + oCustomer.FirstName +'&nbsp;' + oCustomer.LastName + ',';
  return Text;
}

function deleteFromCart(ArticleCode, OptionsText) {
  var pos                    = position(ArticleCode, OptionsText);
  Items[pos].Quantity = 0;
  window.frame_body.location = "F_cart.html";
}

function emptyCart() {
  for (var i = 0; i < Items.length; i++) {
    Items[i].Quantity = 0;
  }
  window.frame_body.location = 'F_cart_step4.html';
  return true;
}

function updateCart(form) {
  for (var posArtArticleCode = 0; posArtArticleCode < form.elements.length-1;  posArtArticleCode += 3) {
    var posArtOptionsText    = posArtArticleCode + 1;
    var posArtQuantity       = posArtArticleCode + 2;
    var ArtArticleCode       = form.elements[posArtArticleCode].value;
    var ArtOptionsText       = form.elements[posArtOptionsText].value;
    var ArtQuantity          = parseInt(form.elements[posArtQuantity].value,10);
    var pos                  = position(ArtArticleCode, ArtOptionsText);
    // Article allready in order
    if (pos >= 0 ) {
      if (Items[pos].MinimumQuantity > ArtQuantity) {
        alert(txtIsArtMinimumQuantity+": '" + Items[pos].MinimumQuantity + "'");
        return false;
      
      } else {
        Items[pos].Quantity = ArtQuantity;
        Items[pos].Price     = discountPrice(Items[pos].OriginalPrice, Items[pos].DiscountType, Items[pos].Quantity,
	                                       Items[pos].SecAmount1, Items[pos].SecPrice1, Items[pos].SecAmount2, Items[pos].SecPrice2,
										   Items[pos].SecAmount3, Items[pos].SecPrice3, Items[pos].SecAmount4, Items[pos].SecPrice4,
										   Items[pos].SecAmount5, Items[pos].SecPrice5, Items[pos].SecAmount6, Items[pos].SecPrice6,
										   Items[pos].SecAmount7, Items[pos].SecPrice7, Items[pos].SecAmount8, Items[pos].SecPrice8,
										   Items[pos].SecAmount9, Items[pos].SecPrice9, Items[pos].SecAmount10, Items[pos].SecPrice10);
	    }
    }
  }
  window.frame_body.location = "F_cart.html";
}

function cancelOrder() {
  if (document.location.protocol == 'https:') {
    self.location = '';
  } else {
    for (var i = 0; i < Items.length; i++) {
      Items[i].Quantity = 0;
    }
    window.frame_body.location = 'F_home.html';
  }
  alert("Votre panier est vide!");
}

function showCartItems() {
  var Text                   = new String("");
  var SubTotal               = 0;
  var Total                  = 0;
  var DiscountOnTotal        = 0;

  for (var i=0; i<Items.length; i++) {
    if (Items[i].Quantity > 0) {
      SubTotal = Items[i].Quantity * showPrice(Items[i].Price, Items[i].VAT);
      Total += SubTotal;
      Text  += '<TR>'+
               '  <td width="15">'+
               '    <a href="javascript:parent.deleteFromCart(\'' + Items[i].ArticleCode + '\',\''+Items[i].OptionsText+'\')"><img src="delete.gif" bOrder="0" alt="Supprimer" align="middle"></a>'+
               '  </td>'+
               '  <td valign="middle" align="right">'+
               '    <input type="hidden" name="ArticleCode" value="' + Items[i].ArticleCode + '" >'+
               '    <input type="hidden" name="OptionsText" value="' + Items[i].OptionsText + '" >'+
               '    <input type="text" name="quantity" VALUE="' + Items[i].Quantity + '" style="width:50px;" maxlength="10" onChange="if (!parent.checkNum(this.value)) {this.focus(); this.select()}">&nbsp;'+
               '  </td>'+
               '  <td valign="middle" align="left" colspan="3">'+
               '    ' + Items[i].Name +
               '  </td>'+
               '  <td align="right" valign="middle">'+
               '    ' + convDec(showPrice(Items[i].Price, Items[i].VAT)) +
               '  </td>'+
               '  <td align="right" valign="middle">'+
               '    ' + convDec(SubTotal) +
               '  </TD>'+
               '</TR>';
      if (Items[i].ExtraInfo != '')	{
        Text+= '<tr><td colspan="2"></td><td valign="middle" align="left" colspan="3">'+
               Items[i].ExtraInfo+'</td><td colspan="2"></td></tr>';
      }
    }
  }

  DiscountOnTotal = discountOnTotalPrice(Total);
  if (DiscountOnTotal != 0) {
    Total -= DiscountOnTotal;
  }

  var SecCurrTotal           = Total / SecCurrRate;
  Text += '<tr valign="baseline">'+
          '  <td height="40"></td>'+
          '  <td valign="middle" align="center" height="40" style="padding-left:10px;">'+
          '    <form><INPUT TYPE="button" VALUE="'+ txtCalculate +'" class="button" onClick="parent.updateCart(this.form)"></form>'+
          '  </td>'+
          '  <td colspan="5" height="40"></td>'+
          '</tr>';
  if (DiscountOnTotal != 0) {
    Text += '<tr valign="baseline">'+
            '  <td colspan="6" align="right">'+txtDiscountOnTotal+'</td>'+
            '  <td align="right">- ' + convDec(DiscountOnTotal) + '</td>'+
            '</tr>';
	}
  Text += '<tr valign="baseline">'+
          '  <td colspan="6" align="right"><b>'+txtSubTotal+'</b></td>'+
          '  <td align="right"><b>' + convDec(Total) + '</b></td>'+
          
          '</tr>'+
          '<tr valign="baseline">'+
          '  <td colspan="6" align="right"><i>'+SecCurrName+'</i></td>'+
          '  <td align="right"><i>' + convDec(SecCurrTotal) + '</i></td>'+
          
          '</tr>';
  return Text;
}

function showCartItemsShort() {
  var Text                   = new String("");
  var SubTotal               = 0;
  var Total                  = 0;
  var DiscountOnTotal        = 0;

  for (var i=0; i<Items.length; i++) {
    if (Items[i].Quantity > 0) {
      SubTotal = Items[i].Quantity * showPrice(Items[i].Price, Items[i].VAT);
      Total += SubTotal;
      Text  += '<tr>'+
               '  <td valign="middle" align="right">'+
               '    <input type="hidden" name="ArticleCode" value="' + Items[i].ArticleCode + '" >'+
               '    <input type="hidden" name="OptionsText" value="' + Items[i].OptionsText + '" >'+
               '    ' + Items[i].Quantity +
               '  </td>'+
               '  <td valign="middle" align="right">'+
               '    ' + Items[i].Name +
               '  </td>'+
               '</tr>';
    }
  }

  DiscountOnTotal = discountOnTotalPrice(Total);
  if (DiscountOnTotal != 0) {
    Total -= DiscountOnTotal;
  }
  var SecCurrTotal           = Total / SecCurrRate;
  Text += '<tr valign="baseline">'+
          '  <td>&nbsp;</td>'+
          '  <td align="right"><b>' + CurrName +' '+  convDec(Total) + '</b></td>'+
          
          '</tr>'+
          '<tr valign="baseline">'+
      		  '  <td>&nbsp;</td>'+
          '  <td align="right"><i>' + SecCurrName +' '+ convDec(SecCurrTotal) + '</i></td>'+
          
          '</tr>';
  return Text;
}


function cart_Step1(form) {
  var DiscountCoupon      = form.DiscountCoupon.value;

  oCustomer.PayMethodCost = form.PayMethod.options[form.PayMethod.selectedIndex].value;
  oCustomer.PayMethodText = form.PayMethod.options[form.PayMethod.selectedIndex].text;
  oCustomer.PayMethodVAT  = PayMethod_VAT[form.PayMethod.selectedIndex];
		oCustomer.PayMethodSupp = PayMethod_Supp[form.PayMethod.selectedIndex];

  oOrder.PayMethodType    = PayMethod_Type[form.PayMethod.selectedIndex];
  oOrder.PaySystemType    = PaySystem_Type[form.PayMethod.selectedIndex];

  oCustomer.ShipCost = form.Ship.options[form.Ship.selectedIndex].value;
  oCustomer.ShipText = form.Ship.options[form.Ship.selectedIndex].text;
  oCustomer.ShipVAT  = Ship_VAT[form.Ship.selectedIndex];

  oOrder.ShipType    = form.Ship.selectedIndex;
  oOrder.Coupon      = form.DiscountCoupon.value;

  window.frame_body.location = 'F_cart_step2.php';
}

function cart_Step2(form) {
  for (var i=0; i<form.Salutation.length; i++) {
    if (form.Salutation[i].checked) {oCustomer.Salutation = form.Salutation[i].value;}
  }
  oCustomer.FirstName = ci(form.FirstName.value);
  oCustomer.LastName = ci(form.LastName.value);
  oCustomer.Company = ci(form.Company.value);
  oCustomer.CompanyCode = ci(form.CompanyCode.value);
  oCustomer.CompanyPassword = ci(form.CompanyPassword.value);
  oCustomer.Street = ci(form.Street.value);
  oCustomer.ZipCode = ci(form.ZipCode.value);
  oCustomer.Town = ci(form.Town.value);
  oCustomer.Country = ci(form.Country.value);
  oCustomer.Phone = ci(form.Phone.value);
  oCustomer.DelName = ci(form.DelName.value);
  oCustomer.DelStreet = ci(form.DelStreet.value);
  oCustomer.DelZipCode = ci(form.DelZipCode.value);
  oCustomer.DelTown = ci(form.DelTown.value);
  oCustomer.DelCountry = ci(form.DelCountry.value);
  oCustomer.DelPhone = ci(form.DelPhone.value);
  oCustomer.EMail = ci(form.EMail.value);
  oCustomer.Memo = ci(form.Memo.value);
  
  oCustomer.Newsletter = form.Newsletter.checked;
  
  
  
  
  oCustomer.VATnr = '';
  
  if (oOrder.PayMethodType == 5) {
    oCustomer.PayMethodMemo = '' 
  }
  else if (oOrder.PayMethodType == 6) {
    oCustomer.PayMethodMemo = '' 
  }
  else if (oOrder.PayMethodType == 7) {
    oCustomer.PayMethodMemo = '' 
  }
  else if (oOrder.PayMethodType == 9) {
    oCustomer.PayMethodMemo = '' 
  }
  else if (oOrder.PayMethodType == 10) {
    oCustomer.PayMethodMemo = '' 
  }

  window.frame_body.location = 'F_cart_step3.html';
}

function showItemsInCart() {
  var Text                   = new String("");
  var ShipCost               = StringToFloat(oCustomer.ShipCost);
  var PayMethodCost          = StringToFloat(oCustomer.PayMethodCost);
  var SubTotal               = 0;
  var showSubTotal           = 0;
  var Total                  = 0;
  var showTotal              = 0;
  var TotalWeight            = 0;
  var TotalShipPrice         = 0;
  var DiscountOnTotal        = 0;
  var CouponDiscount         = 0;

  oOrder.Items = '';
  oOrder.ItemsReadable = '';
  oOrder.ItemsReadableHTML = '';

  for (var i=0; i<aVATItems.length; i++) {aVATItems[i].VTotal = 0}
  for (var i=0; i<Items.length; i++) {
    if (Items[i].Quantity > 0) {
      SubTotal = Items[i].Quantity * Items[i].Price;
      showSubTotal = showPrice(SubTotal, Items[i].VAT);
      if (Items[i].VAT > 0) {
        for (var j=0; j<aVATItems.length; j++) {
          if (aVATItems[j].VID == Items[i].VAT) {
            aVATItems[j].VTotal += SubTotal - (SubTotal / (1+(aVATItems[j].VValue / 100)));
          }
        }
      }
      Total += SubTotal;
      showTotal += showSubTotal;
      TotalWeight += Items[i].Quantity * Items[i].Weight;
      TotalShipPrice += Items[i].Quantity * Items[i].ShipPrice;
      Text += '<tr>'+
              '  <td valign="middle" align="center">'+ Items[i].Quantity +'</td>'+
              '  <td valign="middle" colspan="3">'+Items[i].Name +'</td>'+
              '  <td valign="middle" align="right">'+convDec(showPrice(Items[i].Price, Items[i].VAT))+'</td>'+
              '  <td valign="middle" align="right">'+convDec(showPrice(SubTotal, Items[i].VAT))+'</td>'+
              '</tr>';
			if (Items[i].ExtraInfo != '') {
			  Text+='<tr><td></td><td valign="middle" colspan="3">'+Items[i].ExtraInfo +'</td><td colspan="2"></td></tr>';
			}
      if (oOrder.ItemsReadable != '') {oOrder.ItemsReadable += '\n';}
      if (oOrder.Items != '') {oOrder.Items += '~';}
      oOrder.ItemsReadable += Items[i].Quantity + ' x ' + Items[i].ArticleSalesCode + ' - ' + Items[i].Name + ': ' + convDec(showPrice(Items[i].Price, Items[i].VAT)) + ' :: ' + convDec(showPrice(SubTotal, Items[i].VAT));
			oOrder.ItemsReadableHTML += '<tr><td>'+Items[i].Quantity+'</td><td>'+Items[i].ArticleSalesCode+'</td><td>'+Items[i].Name+'</td><td align<LV_061/><LV_034/>right<LV_034/>>'+convDec(showPrice(Items[i].Price, Items[i].VAT))+'</td><td align<LV_061/><LV_034/>right<LV_034/>>'+convDec(showPrice(SubTotal, Items[i].VAT))+'</td></tr>\n';
      oOrder.Items += Items[i].Quantity + '|' + Items[i].ArticleCode + '|' + convDecExt(Items[i].Price) + '|' + Items[i].OptionsText + '|' + encodeString(Items[i].ExtraInfo) + '|' + Items[i].ArticleSalesCode;
			if (Items[i].ExtraInfo != '') {
			  oOrder.ItemsReadable += '\n'+Items[i].ExtraInfo;
				oOrder.ItemsReadableHTML += '<tr><td></td><td></td><td>'+Items[i].ExtraInfo+'</td><td></td><td></td></tr>\n';
			}
    }
  }
  oOrder.SubTotal = convDec(Total);

  DiscountOnTotal = discountOnTotalPrice(Total);
  oOrder.DiscountOnTotal = convDec(DiscountOnTotal);
  oCustomer.DiscountOnTotalVAT = 0;
  if (oCustomer.DiscountOnTotalVAT > 0) {
    if (DiscountOnTotal != 0) {
      for (var j=0; j<aVATItems.length; j++) {
        if (aVATItems[j].VID == oCustomer.DiscountOnTotalVAT) {
          aVATItems[j].VTotal -= DiscountOnTotal - (DiscountOnTotal / (1+(aVATItems[j].VValue / 100)));
          break;
        }
      }
    }
  }

  CouponDiscount = 0;
  
		
		CouponDiscount = ((Total / 100) * StringToFloat(oOrder.CouponDiscount));
		
		oOrder.CouponDiscountAmount = convDec(CouponDiscount);
  oCustomer.CouponDiscountVAT = -1;
  if (oCustomer.CouponDiscountVAT > 0) {
    if (CouponDiscount != 0) {
      for (var j=0; j<aVATItems.length; j++) {
        if (aVATItems[j].VID == oCustomer.CouponDiscountVAT) {
          aVATItems[j].VTotal -= CouponDiscount - (CouponDiscount / (1+(aVATItems[j].VValue / 100)));
          break;
        }
      }
    }
  }
  // Sending
  ShipCost += TotalShipPrice;
  for (var i = 1; i < ShipweightPrices[oOrder.ShipType].ranges.length; i++) {
    
    if ((TotalWeight > ShipweightPrices[oOrder.ShipType].ranges[i].min-1) && (TotalWeight < ShipweightPrices[oOrder.ShipType].ranges[i].max+1)) {
    
    
      ShipCost += ShipweightPrices[oOrder.ShipType].ranges[i].price;
      break;
    }
  }
  if (oCustomer.ShipVAT > 0) {
    if (ShipCost != 0) {
      for (var j=0; j<aVATItems.length; j++) {
        if (aVATItems[j].VID == oCustomer.ShipVAT) {
          aVATItems[j].VTotal += ShipCost - (ShipCost / (1+(aVATItems[j].VValue / 100)));
          break;
        }
      }
    }
  }
  oOrder.Delivery = convDec(ShipCost);

  // PayMethod
		if (oCustomer.PayMethodSupp > 0) {
		  PayMethodCost += (Total * (oCustomer.PayMethodSupp / 100));
		}
  oOrder.PayMethodCost = convDec(PayMethodCost);
		
  if (oCustomer.PayMethodVAT > 0) {
    if (PayMethodCost != 0) {
      for (var j=0; j<aVATItems.length; j++) {
        if (aVATItems[j].VID == oCustomer.PayMethodVAT) {
          aVATItems[j].VTotal += PayMethodCost - (PayMethodCost / (1+(aVATItems[j].VValue / 100)));
        }
      }
    }
  }

  oOrder.Total = convDec(Total+ShipCost+PayMethodCost-DiscountOnTotal-CouponDiscount);
  // Total amount in SecCurr
  var SecCurrTotal          = (Total+ShipCost+PayMethodCost-DiscountOnTotal-CouponDiscount) / SecCurrRate;
  Text += '<tr>'+
          '  <td colspan="6"></td>'+
          '</tr>'+
          '<tr>'+
          '  <td colspan="2"></td>'+
          '  <td valign="top" align="right" colspan="3">'+txtSubTotal+'</td>'+
          '  <td valign="top" align="right">'+convDec(showTotal)+'</td>'+
          '</tr>'+
          '<tr>'+
          '  <td colspan="6">&nbsp;</td>'+
          '</tr>'										;
  if (DiscountOnTotal != 0) {
    Text += '<tr>'+
            '  <td colspan="2"></td>'+
            '  <td valign="top" align="right" colspan="3">'+txtDiscountOnTotal+'</td>'+
            '  <td valign="top" align="right"> - '+convDec(showPrice(DiscountOnTotal, oCustomer.DiscountOnTotalVAT))+'</td>'+
            '</tr>';
	}
  if (CouponDiscount != 0) {
    Text += '<tr>'+
            '  <td colspan="2"></td>'+
            '  <td valign="top" align="right" colspan="3">'+txtCouponDiscount+' (' + oOrder.Coupon + ')</td>'+
            '  <td valign="top" align="right"> - '+convDec(showPrice(CouponDiscount, oCustomer.CouponDiscountVAT))+'</td>'+
            '</tr>';
  }
  Text += '<tr>'+
          '  <td colspan="2"></td>'+
          '  <td valign="top" align="right" colspan="3">'+txtDelivery+'</td>'+
          '  <td valign="top" align="right">'+convDec(showPrice(ShipCost, oCustomer.ShipVAT))+'</td>'+
          '</tr>'+
          '<tr>'+
          '  <td colspan="2"></td>'+
          '  <td valign="top" align="right" colspan="3">'+txtPayMethodCost+'</td>'+
          '  <td valign="top" align="right">'+convDec(showPrice(PayMethodCost, oCustomer.PayMethodVAT))+'</td>'+
          '</tr>'+
          '<tr>'+
          '  <td colspan="6"></td>'+
          '</tr>'+
          '<tr>'+
          '  <td colspan="2"></td>'+
          '  <td valign="top" align="right" colspan="3"><b>'+txtTotal+'</b></td>'+
          '  <td valign="top" align="right">'+
          '    <b>' + convDec(showTotal+showPrice(ShipCost, oCustomer.ShipVAT)+showPrice(PayMethodCost, oCustomer.PayMethodVAT)-showPrice(DiscountOnTotal, oCustomer.DiscountOnTotalVAT)-showPrice(CouponDiscount, oCustomer.CouponDiscountVAT)) + '</b>'+
          '  </td>'+
          '</tr>'+
          
          '<tr>'+
          '  <td colspan="2"></td>'+
          '  <td valign="top" align="right" colspan="3"><i>'+SecCurrName+'</i></td>'+
          '  <td valign="top" align="right">'+
          '    <i>' + convDec((showTotal+showPrice(ShipCost, oCustomer.ShipVAT)+showPrice(PayMethodCost, oCustomer.PayMethodVAT)-showPrice(DiscountOnTotal, oCustomer.DiscountOnTotalVAT)-showPrice(CouponDiscount, oCustomer.CouponDiscountVAT)) / SecCurrRate) + '</i>'+
          '  </td>'+
          '</tr>'+
          
          '<tr>'+
          '  <td colspan="6"></td>'+
          '</tr>';
  oOrder.SecCurr = convDec(SecCurrTotal);
  // VAT
  oOrder.VAT = '';
  oOrder.VATtotal = '';

  var VATTotal               = 0;
  for (var j=0; j<aVATItems.length; j++) {
    if (aVATItems[j].VID > 0) {
      if (aVATItems[j].VTotal != 0) {
        Text += '<tr>'+
                '  <td colspan="2"></td>'+
                '  <td valign="top" align="right" colspan="3">'+txtVAT+' (' + aVATItems[j].VValue + '%)</td>'+
                '  <td valign="top" align="right">'+convDec(aVATItems[j].VTotal) +'</td>'+
                '</tr>';
        VATTotal += aVATItems[j].VTotal;
        if (oOrder.VAT != '') {oOrder.VAT += '\n';}
        oOrder.VAT += aVATItems[j].VName + ' ' + convDec(aVATItems[j].VTotal);
      }
    }
  }
  // Total VAT
  Text += '<tr>'+
          '  <td colspan="2"></td>'+
          '  <td valign="top" align="right" colspan="3"><b>' + txtVATTotal + '</b></td>'+
          '  <td valign="top" align="right"><b>' + convDec(VATTotal) + '</b></td>'+
          '</tr>';
  if (oOrder.VAT != '') {oOrder.VAT += '\n'+txtVATTotal+': ';}
  oOrder.VAT += convDec(VATTotal);
  oOrder.VATtotal = convDec(VATTotal);
  

  return Text;
}

function showCartStep1Form() {
  var Text                   = new String("");

  // Way of delivery
  Text += '<tr>'+
          '  <td align="left"><b>'+txtWayOfDelivery+'</b></td>'+
          '</tr>'+
          '<tr>'+
          '  <td align="center">'+
          '    <select name="Ship">';
  
  Ship_VAT[0] = 1;
  Text += '      <option value="0">Livraison France moins 30 kg</option>';
  Ship_VAT[1] = 1;
  Text += '      <option value="0">Livraison Outre-Mer 1 moins de 25kgs</option>';
  Ship_VAT[2] = 1;
  Text += '      <option value="0">Livraison Outre-Mer 2 moins de 25kgs</option>';
  Ship_VAT[3] = 1;
  Text += '      <option value="0">Livraison Zone A CEE, Suisse et Norvège</option>';
  Ship_VAT[4] = 1;
  Text += '      <option value="0">Livraison Zone B Europe-Est hors CEE - Maghreb</option>';
  Ship_VAT[5] = 1;
  Text += '      <option value="0">Livraison Zone C Afrique-USA-Canada-Moyen Orient</option>';
  Ship_VAT[6] = 1;
  Text += '      <option value="0">Livraison Zone D Autres destinations</option>';
  Ship_VAT[7] = 1;
  Text += '      <option value="3.3">Madagascar (EUR 3,30)</option>';
  
  Text += '    </select>'+
          '  </td>'+
          '</tr>'+
          '<tr>'+
          '  <td>&nbsp;</td>'+
          '</tr>'+
  // Way of payment
          '<tr>'+
          '  <td align="left"><b>'+txtWayOfPayment+'</b></td>'+
          '</tr>'+
          '<tr>'+
          '  <td align="center">'+
          '    <select name="PayMethod">';
  
  PayMethod_VAT[0] = 1;
		PayMethod_Supp[0] = 0;
  PayMethod_Type[0] = 5;
  PaySystem_Type[0] = 0;
  Text += '      <option value="0">Cheque &agrave; la commande</option>';
  PayMethod_VAT[1] = 1;
		PayMethod_Supp[1] = 0;
  PayMethod_Type[1] = 6;
  PaySystem_Type[1] = 2;
  Text += '      <option value="0">Visa,  Mastercard, ou Paypal</option>';
  PayMethod_VAT[2] = 1;
		PayMethod_Supp[2] = 0;
  PayMethod_Type[2] = 7;
  PaySystem_Type[2] = 0;
  Text += '      <option value="0">Virement Bancaire</option>';
  PayMethod_VAT[3] = 1;
		PayMethod_Supp[3] = 0;
  PayMethod_Type[3] = 9;
  PaySystem_Type[3] = 0;
  Text += '      <option value="14">Contre remboursement postal (EUR 14,00)</option>';
  PayMethod_VAT[4] = 1;
		PayMethod_Supp[4] = 6;
  PayMethod_Type[4] = 10;
  PaySystem_Type[4] = 2;
  Text += '      <option value="0">Cofidis, Aurore, Cofinoga ou Paypal</option>';
  
  Text += '    </select>'+
          '  </td>'+
          '</tr>'+
          '<tr>'+
          '  <td>&nbsp;</td>'+
          '</tr>';
  // Discount coupon
  
  Text += '<tr> <td>&nbsp;</td></tr>'+
          '<tr> <td align="left"><b>'+txtCouponDiscount+'</b></td></tr>'+
          '<tr> <td align="center"><input name="DiscountCoupon" type="text" value="" size="30" maxlength="50"></td></tr>';
  
  

  return Text;
}

function showCartStep2Form() {
  var Text                   = new String("");

  
  
  // Empty Row
  Text += '<tr valign="baseline">'+
          '  <td>&nbsp;</td>'+
          '  <td><input type="hidden" name="CompanyCode" value=""><input type="hidden" name="CompanyPassword" value=""></td>'+
          '</tr>';
  

  Text += '  <tr valign="top">'+
          '    <td>'+
          '      <table border="0">'+
  // Common
          '       <tr valign="baseline">'+
          '         <td colspan="3"><b>'+txtInvoiceAddress+'</b></td>'+
          '       </tr>'+
  // Salutation
          '       <tr valign="baseline">'+
          '         <td></td>'+
          '         <td></td>'+
          '         <td><input type="radio" name="Salutation" value="'+ txtMr +'" checked="true"> '+ txtMr +
          '             <input type="radio" name="Salutation" value="'+ txtMrs +'"> '+ txtMrs +
          '         </td>'+
          '       </tr>'+
  // FirstName
          '       <tr valign="baseline">'+
          
          '         <td>*</td>'+
          
          
          '         <td>'+ txtFirstName +'</td>'+
          '         <td><input type="text" name="FirstName" style="width:180px;" value="'+oCustomer.FirstName+'"></td>'+
          '       </tr>'+
  // LastName
          '       <tr>'+
          
          '         <td>*</td>'+
          
          
          '         <td>'+ txtLastName +'</td>'+
          '         <td><input type="text" name="LastName" style="width:180px;" value="'+oCustomer.LastName+'"></td>'+
          '       </tr>'+
  // Company
          '       <tr>'+
          
          
          '         <td></td>'+
          
          '         <td>'+ txtCompany +'</td>'+
          '         <td><input type="text" name="Company" style="width:180px;" value="'+oCustomer.Company+'"></td>'+
          '       </tr>';
  // VATnr
  
  // Street
  Text += '       <tr>'+
          
          '         <td>*</td>'+
          
          
          '         <td>'+ txtStreetAndNr +'</td>'+
          '         <td><input type="text" name="Street" style="width:180px;" value="'+oCustomer.Street+'"></td>'+
          '       </tr>'+
  // ZipCode
          '       <tr>'+
          
          '         <td>*</td>'+
          
          
          '         <td>'+ txtZipcode +'</td>'+
          '         <td><input type="text" name="ZipCode" style="width:180px;" maxlength="10" value="'+oCustomer.ZipCode+'"></td>'+
          '       </tr>'+
  // Town
          '       <tr>'+
          
          '         <td>*</td>'+
          
          
          '         <td>'+ txtTown +'</td>'+
          '         <td><input type="text" name="Town" style="width:180px;" value="'+oCustomer.Town+'"></td>'+
          '       </tr>'+
  // Country
          '       <tr>'+
          
          '         <td>*</td>'+
          
          
          '         <td>'+ txtCountry +'</td>'+
          '         <td><input type="text" name="Country" style="width:180px;" value="'+oCustomer.Country+'"></td>'+
          '       </tr>'+
  // Phone
          '       <tr>'+
          
          '         <td>*</td>'+
          
          
          '         <td>'+ txtPhone +'</td>'+
          '         <td><input type="text" name="Phone" style="width:180px;" value="'+oCustomer.Phone+'"></td>'+
          '       </tr>'+
  // E-Mail
          '       <tr>'+
          
          '         <td>*</td>'+
          
          
          '         <td>'+ txtEMail +'</td>'+
          '         <td><input type="text" name="EMail" style="width:180px;" value="'+oCustomer.EMail+'"></td>'+
          '       </tr>'+
      		  '      </table>'+
      		  '    </td>'+
      		  '    <td>'+
      		  '      <table border="0">'+
  // Delivery
          '       <tr>'+
          '         <td colspan="3"><b>'+ txtDeliveryAddress +'</b></td>'+
          '       </tr>'+
  // Delivery equals invoice
          '       <tr>'+
          '         <td></td>'+
          '         <td colspan="2"><input type="checkbox" name="copy" OnClick="javascript:DelToInvAdd();" value="checkbox">'+txtDeliveryAddressEqual+'</td>'+
          '       </tr>'+
  // Delivery Name
          '       <tr>'+
          '         <td></td>'+
          '         <td>'+txtName+'</td>'+
          '         <td><input type="text" name="DelName" style="width:180px;" value="'+oCustomer.DelName+'"></td>'+
          '       </tr>'+
  // Delivery Street
          '       <tr>'+
          '         <td></td>'+
          '         <td>'+txtStreetAndNr+'</td>'+
          '         <td><input type="text" name="DelStreet" style="width:180px;" value="'+oCustomer.DelStreet+'"></td>'+
          '       </tr>'+
  // Delivery ZipCode
          '       <tr>'+
          '         <td></td>'+
          '         <td>'+txtZipcode+'</td>'+
          '         <td><input type="text" name="DelZipCode" style="width:180px;" maxlength="10" value="'+oCustomer.DelZipCode+'"></td>'+
          '       </tr>'+
  // Delivery Town
          '       <tr>'+
          '         <td></td>'+
          '         <td>'+txtTown+'</td>'+
          '         <td><input type="text" name="DelTown" style="width:180px;" value="'+oCustomer.DelTown+'"></td>'+
          '       </tr>'+
  // Delivery Country
          '       <tr>'+
          '         <td></td>'+
          '         <td>'+txtCountry+'</td>'+
          '         <td><input type="text" name="DelCountry" style="width:180px;" value="'+oCustomer.DelCountry+'"></td>'+
          '       </tr>'+
  // Delivery Phone
          '       <tr>'+
          '         <td></td>'+
          '         <td>'+txtPhone+'</td>'+
          '         <td><input type="text" name="DelPhone" style="width:180px;" value="'+oCustomer.DelPhone+'"></td>'+
          '       </tr>'+
          '      </table>'+
          '    </td>'+
          '  </tr>'+
          '  <tr>'+
          '    <td colspan="2">'+
          '      <table border="0">';
  
  Text += '      </table>'+
          '    </td>'+
          '  </tr>';

  // Empty Row
  Text += '<tr valign="baseline">'+
          '  <td colspan="2">&nbsp;</td>'+
          '</tr>'+
  // Remarks
          '<tr>'+
          '  <td colspan="2"><b>'+ txtRemarks +'</b></td>'+
          '</tr>'+
  // Memo
          '<tr>'+
          '  <td colspan="2"><textarea name="Memo" style="width:100%;height:100px;" wrap="VIRTUAL">' + oCustomer.Memo + '</textarea></td>'+
          '</tr>';
  // Newsletter
  
  Text += '<tr>'+
          '  <td colspan="2"><input type="checkbox" name="Newsletter">'+txtWantToReceiveNewsletter+'</td>'+
          '</tr>';
  
  Text += '<tr>'+
          '  <td colspan="2"></td>'+
          '</tr>'+
  
          '<tr>'+
          '  <td colspan="2">'+
          '    <IFRAME SRC="F_supcond.html" WIDTH="100%" HEIGHT=100>'+
          '      <a href="FConditions_g_n_rales_de_vente__xp_1.html">'+txtConditions+'</a>'+
          '    </IFRAME>'+
          '  </td>'+
          '</tr>'+
  
          '<tr>'+
          '  <td colspan="2"><input type="checkbox" name="Conditions"> * '+txtAcceptConditions+'</td>'+
          '</tr>';
  return Text;
}

function showCustomerData() {
  var Text                      = new String("");
  Text += '<table border="0" cellspacing="1" cellpadding="1">'+
  // Customer data
          '  <tr valign="top" align="left">'+
          '    <td valign="top"><b>'+ txtData +'<b></td>'+
          '    <td><p>'+
          oCustomer.Salutation + '&nbsp;'+oCustomer.FirstName + '&nbsp;' + oCustomer.LastName + '<br>';
  if (oCustomer.Company != '') {Text += oCustomer.Company + '<br>';}
  if (oCustomer.CompanyCode != '') {Text += '('+ txtCompanyNr +' ' + oCustomer.CompanyCode + ')<br>';}
  Text += oCustomer.Street + '<br>'+
          oCustomer.ZipCode + '&nbsp;' + oCustomer.Town+'<br><br>'+
          oCustomer.Country +'</p>'+
          '    </td>'+
          '  </tr>';
  // Phone
  if (oCustomer.Phone != '') {
    Text += '<tr><td align="left"><b>'+ txtPhone +'<b></td><td>' + oCustomer.Phone + '</td></tr>';
  }
  // E-Mail
  if (oCustomer.EMail != '') {
    Text += '<tr><td align="left"><b>'+ txtEMail +'<b></td><td>' + oCustomer.EMail + '</td></tr>';
  }
  Text += '<tr><td align="left">&nbsp;</td><td>&nbsp;</td></tr>'+
  // Sending
          '  <tr>'+
          '    <td align="left"><b>'+ txtWayOfDelivery +'<b></td>'+
          '    <td>' + oCustomer.ShipText + '</td>'+
          '  </tr>'+
          '  <tr>'+
          '    <td align="left">&nbsp;</td>'+
          '    <td>&nbsp;</td>'+
          '  </tr>';
  // Paymethod
  Text += '  <tr>'+
          '    <td align="left"><b>'+ txtWayOfPayment +'<b></td>'+
          '    <td>'+ oCustomer.PayMethodText +'</td>'+
          '</tr>';
  oOrder.PayMethodText = oCustomer.PayMethodText;
  oOrder.PayMethodVAT = oCustomer.PayMethodVAT;
  oOrder.PayMethodshort = oCustomer.PayMethodText;

  // Memo
  if (oCustomer.Memo != '') {
    Text += '<tr><td align="left" valign="top"><b>'+ txtRemarks +'<b></td><td>'+oCustomer.Memo+'</td></tr>';
  }
  Text += '</table>';
  return Text;
}

function printOrderButton() {
  var Text                   = new String("");
  Text += '<form name="form2" method="post">'+
          '  <input type="button" class="button" value="'+txtBack+'" onClick="history.back()">&nbsp;'+
          '  <input type="button" class="button" value="'+txtOrder+'" onClick="self.location=\'F_cart_step1.html\';">'+
          '</form>';
  return Text;
}

function printButtonCartStep1Form() {
  var Text                   = new String("");
  Text += '<input name="button" type="button" class="button" value="&lt;&lt; Retour" onClick="history.back()">'+
          '&nbsp; <input name="button" type="button" class="button" value="Annuler la commande" onClick="parent.cancelOrder()">'+
		        '&nbsp; <input name="submit" type="submit" class="button" value="Commander &gt;&gt;">';
  return Text;
}

function printButtonCartStep2Form() {
  var Text                   = new String("");
  Text += '<input name="button" type="button" class="button" value="&lt;&lt; Retour" onClick="history.back()">'+
          '&nbsp;<input name="button" type="button" class="button" value="Annuler la commande" onClick="parent.cancelOrder()">'+
          '&nbsp;<input name="submit" type="submit" class="button" value="Commander &gt;&gt;">';
  return Text;
}

function updateStock() {
  var StockData            = new String("");

  processPSPPayment = 2;

  

  if (StockData != "") {
//    self.frame_body.location.replace("stock4.php?stockdata="+StockData+"&redirect="+SiteURL()+"/F_cart_step4.html");
    self.frame_body.location.replace("stock4.php?stockdata="+StockData+"&redirect=F_cart_step4.html");
  }
  else {
    self.frame_body.location.replace("F_cart_step4.html");
  }
}

function updateCoupon() {
  processPSPPayment = 3;

  if (StringToFloat(oOrder.CouponDiscount) != 0) {
//    self.frame_body.location.replace("couponupdate4.php?coupon="+oOrder.Coupon+"&redirect="+SiteURL()+"/F_cart_step4.html");
    self.frame_body.location.replace("couponupdate4.php?coupon="+oOrder.Coupon+"&redirect=F_cart_step4.html");
  }
  else {
    self.frame_body.location.replace("F_cart_step4.html");
  }
}

function PSPPayment() {
  var Text = new String("");

  if (typeof(processPSPPayment)!= 'undefined' && processPSPPayment != null) {
    if (processPSPPayment == 1) {
      updateStock();
    } else
    if (processPSPPayment == 2) {
      updateCoupon();
    } else
    if (processPSPPayment == 3) {
      if (oOrder.PaySystemType != 0) {
        OrderID = OldOrderID;

        

        if (oOrder.PaySystemType == 2) {
          Text = '<FORM METHOD="post" ACTION="https://www.paypal.com/cgi-bin/webscr" target="_top" id=form1 name=form1>'+
'<INPUT type="hidden" NAME="cmd" value="_xclick">'+
'<INPUT type="hidden" NAME="business" value="commande@auzoma.com">'+
'<INPUT type="hidden" NAME="return" value="http://www.auzoma.com/F_home.html">'+
'<INPUT type="hidden" NAME="undefined_quantity" value="0">'+
'<INPUT type="hidden" NAME="item_name" value="'+txtAOrder+': '+OrderID.valueOf()+'">'+
'<INPUT type="hidden" NAME="item_number" value="'+OrderID.valueOf()+'">'+
'<INPUT type="hidden" NAME="amount" value="' + StringToFloat(oOrder.Total) + '">'+
'<INPUT type="hidden" NAME="no_shipping" value="1">'+
'<INPUT type="hidden" NAME="cancel_return" value="http://www.auzoma.com/F_home.html">'+
'<INPUT type="hidden" NAME="no_note" value="1">'+
'<INPUT type="hidden" NAME="currency_code" value="EUR">'+
'<INPUT type="hidden" NAME="lc" value="FR">'+
'<INPUT type="hidden" NAME="first_name" value="'+oCustomer.FirstName+'">'+
'<INPUT type="hidden" NAME="last_name" value="'+oCustomer.LastName+'">'+
'<INPUT type="hidden" NAME="address1" value="'+oCustomer.Street+'">'+
'<INPUT type="hidden" NAME="city" value="'+oCustomer.Town+'">'+
'<INPUT type="hidden" NAME="zip" value="'+oCustomer.ZipCode+'">'+
'<INPUT type="hidden" NAME="night_phone_a" value="'+oCustomer.Phone+'">'+
'</form>';
        }
        

        document.close();
       	document.open();
     	  document.write("<HTML><TITLE>PSP</TITLE>");
       	document.write("<BODY onload=\"document.form1.submit()\">");
     	  document.write(Text);
     	  document.write("</BODY></HTML>");
       	document.close();
      }

      processPSPPayment = 0;
      OrderID = new Date();
      Items   = new Array();
    }
  }

  OrderID = new Date();
  Items   = new Array();

  return true;
}

function printOrder() {
  var    Text                   = new String("");
  var    Now                    = new Date();
  var    DateStr                = Now.getDate() + '.';
  var    year                   = Now.getYear();
  if ((Now.getMonth()+1) < 10) {
    DateStr += '0' + (Now.getMonth()+1) + '.' + year
  } else {
    DateStr += (Now.getMonth()+1) + '.' + year;
  }
  Text  = printEmailBody(DateStr);
  winId = window.open('','newwin');
  with (winId.document) {
    write('<body onLoad="window.focus();window.print()"><pre>'+Text+'</pre><\/body>');
    close();
  }
}

function printEMail() {
  var    Text                   = new String("");
  var    EmailBody              = new String("");
  var    att                    = new String("");
  var    mailfrom               = new String("");
  var    Now                    = new Date();
  var    DateStr                = Now.getDate() + '.';
  var    year                   = Now.getYear();

  processPSPPayment = 1;
  if ((Now.getMonth()+1) < 10) {
    DateStr += '0' + (Now.getMonth()+1) + '.' + year
  } else {
    DateStr += (Now.getMonth()+1) + '.' + year;
  }
  EmailBody  = printEmailBody(DateStr);
  EmailHTMLBody  = printEmailHTMLBody(DateStr);
  Attachment = printEmailAttachment(DateStr);
  if (oCustomer.EMail != "") {
    mailfrom = oCustomer.EMail;
  } else {
    mailfrom = "Unknown";
  }

  Text += '<form method="post" action="'+CGIScriptAddress+'" ';
  Text += '>'+
          '<input type="hidden" name="From" value="' + mailfrom + '">'+
          '<input type="hidden" name="To" value="'+txtSendOrderToEMail+'">'+
          '<input type="hidden" name="Subject" value="'+txtWebShopName+'">'+
          '<input type="hidden" name="SubjectMailClient" value="'+txtConfirmation+' - '+txtWebShopName+'">'+
          '<input type="hidden" name="Message" value="' + EmailBody + '">'+
          '<input type="hidden" name="Messagehtml" value="' + EmailHTMLBody + '">'+
          '<input type="hidden" name="Attachment" value="' +  Attachment + '">'+
          '<input type="hidden" name="OrderID" value="' + OrderID.valueOf() + '">'+
          '<input type="hidden" name="redirect" value="'+SiteURL()+'/F_cart_step4.html">'+
          '<p align="center">'+
          '  <input type="button" value="'+ txtBack +'" class="button" onClick="history.back()">&nbsp;'+
          '  <input type="button" value="'+ txtCancelOrder +'" class="button" onClick="parent.cancelOrder()">&nbsp;'+
          '  <input type="submit" value="'+ txtSendOrder +'" class="button">'+
          '</p>'+
          '</form>';

  OldOrderID = OrderID.valueOf();
  OldOrderTotal = StringToFloat(oOrder.Total);

  return Text;
}
