// ********************************************************* //
// Application vars                                          //
// ********************************************************* //

// 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_Type           = new Array();
var PaySystem_Type           = new Array();
var Discounts                = new Array();
var ShipweightPrices         = new Array();
// Const
var CurrName                 = 'euro';
var SecCurrRate              = StringToFloat('1');
var SecCurrName              = 'Unknown currency';
var bgColorDark              = '#000000';
var bgColorLight             = '#FFFFFF';
var EncOrderSeparator        = '<~>';            // Encoded Order Separator
var CGIScriptAddress         = 'sendorder3.php';
var OrderID                  =  new Date();
var Decimals                 =  2;

// Buttons text
var txtBack                  = '&lt;&lt; Terug';
var txtOrder                 = 'Bestellen &gt;&gt;';
var txtCancelOrder           = 'Bestelling annuleren';
var txtSendOrder             = 'Bestelling verzenden';
var txtCalculate             = 'Bereken';
// Text text
var txtSubTotal              = 'Subtotaal';
var txtDelivery              = 'Verzending';
var txtWayOfDelivery         = 'Verzendwijze';
var txtWayOfPayment          = 'Betalingswijze'
var txtVAT                   = 'BTW';
var txtVATTotal              = 'BTW totaal';
var txtTotal                 = 'Totaal incl. BTW';
var txtTotalIncVAT           = 'Totaal incl. BTW';
var txtData                  = 'Gegevens';
var txtMessage               = 'Bericht';
var txtOrderFor              = 'Bestelling voor';
var txtWebShopName           = 'anita chamel_0';
var txtOrderedOn             = 'Besteld op';
var txtAOrder                = 'Bestelling';
var txtConfirmation          = 'Bevestiging';
var txtNone                  = 'Geen';
var txtSendOrderToEMail      = 'bestelling@anita-chamel.nl';
var txtPayMethodCost         = 'Kosten van betaling';
var txtPayMethodInfo         = 'Informatie bij betaling';
var txtDeliveryAddress       = 'Afleveradres';
var txtCommon                = 'Algemeen';
var txtRegisteredCustomer     = 'Geregistreerde klant';
// Field text
var txtMr                    = 'De heer';
var txtMrs                   = 'Mevrouw';
var txtFirstName             = 'Voornaam';
var txtLastName              = 'Naam';
var txtCompany               = 'Bedrijf';
var txtCompanyNr             = 'Klantcode';
var txtCompanyPassword       = 'Wachtwoord';
var txtStreetAndNr           = 'Straat/Nr';
var txtZipcodeTown           = 'Postcode/Plaats';
var txtZipcode               = 'Postcode';
var txtTown                  = 'Plaats';
var txtCountry               = 'Land';
var txtPhone                 = 'Telefoon';
var txtEMail                 = 'E-mail';
var txtRemarks               = 'Opmerkingen';
var txtName                  = 'Naam';
var txtWantToReceiveNewsletter = 'Ik ontvang graag uw nieuwsbrief';
var txtVATnr                 = 'BTW-nummer';
var txtAcceptConditions      = 'Ik ga akkoord met de algemene voorwaarden';
<!-- new 3.5.0.0 begin -->
var txtDeliveryAddressEqual  = 'Afleveradres gelijk aan factuuradres';
var txtInvoiceAddress        = 'Factuuradres';
var txtConditions            = 'Algemene leveringsvoorwaarden';
<!-- new 3.5.0.0 end -->


// Object
var oCustomer            = new Customer('','','','','','','','','','','','','','','','','','',0,'',0,0,'',0,'','','','');
var oOrder               = new Order(0,'',0,'','','','','','','','','',0,0,0);

// Discount

    Discounts[1] = new discount(2,1);
  
    Discounts[1].ranges[1] = new discountRange(5, 10, 0);
  


// ShipweightRange

    ShipweightPrices[0] = new shipweightPrice(0);
    ShipweightPrices[1] = new shipweightPrice(0);
    ShipweightPrices[2] = new shipweightPrice(0);
    ShipweightPrices[3] = new shipweightPrice(0);
    ShipweightPrices[4] = new shipweightPrice(0);
    ShipweightPrices[5] = new shipweightPrice(0);
    ShipweightPrices[6] = new shipweightPrice(0);
    ShipweightPrices[7] = new shipweightPrice(0);


// Array
var aVATItems = new Array();

    aVATItems[aVATItems.length] = new VAT(1,'hoog','19',0);
    aVATItems[aVATItems.length] = new VAT(2,'laag','6',0);


// ********************************************************* //
// Common functions                                          //
// ********************************************************* //

<!-- new 3.5.0.3 begin -->
function htmlToJS(htmlString) {
  returnString = htmlString;
  
  returnString = returnString.replace(/&iexcl;/g,"¡");   returnString = returnString.replace(/&cent;/g,"¢");
  returnString = returnString.replace(/&pound;/g,"£");   returnString = returnString.replace(/&curren;/g,"¤");
  returnString = returnString.replace(/&yen;/g,"¥");     returnString = returnString.replace(/&brvbar;/g,"¦");
  returnString = returnString.replace(/&sect;/g,"§");    returnString = returnString.replace(/&uml;/g,"¨");
  returnString = returnString.replace(/&copy;/g,"©");    returnString = returnString.replace(/&ordf;/g,"ª");
  returnString = returnString.replace(/&laquo;/g,"«");   returnString = returnString.replace(/&not;/g,"¬");
  returnString = returnString.replace(/&shy;/g,"­");     returnString = returnString.replace(/&reg;/g,"®");
  returnString = returnString.replace(/&macr;/g,"¯");    returnString = returnString.replace(/&deg;/g,"°");
  returnString = returnString.replace(/&plusmn;/g,"±");  returnString = returnString.replace(/&sup2;/g,"²");
  returnString = returnString.replace(/&sup3;/g,"³");    returnString = returnString.replace(/&acute;/g,"´");
  returnString = returnString.replace(/&micro;/g,"µ");   returnString = returnString.replace(/&para;/g,"¶");
  returnString = returnString.replace(/&middot;/g,"·");  returnString = returnString.replace(/&cedil;/g,"¸");
  returnString = returnString.replace(/&sup1;/g,"¹");    returnString = returnString.replace(/&ordm;/g,"º");
  returnString = returnString.replace(/&raquo;/g,"»");   returnString = returnString.replace(/&frac14;/g,"¼");
  returnString = returnString.replace(/&frac12;/g,"½");  returnString = returnString.replace(/&frac34;/g,"¾");
  returnString = returnString.replace(/&iquest;/g,"¿");  returnString = returnString.replace(/&Agrave;/g,"À");
  returnString = returnString.replace(/&Aacute;/g,"Á");  returnString = returnString.replace(/&Acirc;/g,"Â");
  returnString = returnString.replace(/&Atilde;/g,"Ã");  returnString = returnString.replace(/&Auml;/g,"Ä");
  returnString = returnString.replace(/&Aring;/g,"Å");   returnString = returnString.replace(/&AElig;/g,"Æ");
  returnString = returnString.replace(/&Ccedil;/g,"Ç");  returnString = returnString.replace(/&Egrave;/g,"È");
  returnString = returnString.replace(/&Eacute;/g,"É");  returnString = returnString.replace(/&Ecirc;/g,"Ê");
  returnString = returnString.replace(/&Euml;/g,"Ë");    returnString = returnString.replace(/&Igrave;/g,"Ì");
  returnString = returnString.replace(/&Iacute;/g,"Í");  returnString = returnString.replace(/&Icirc;/g,"Î");
  returnString = returnString.replace(/&Iuml;/g,"Ï");    returnString = returnString.replace(/&ETH;/g,"Ð");
  returnString = returnString.replace(/&Ntilde;/g,"Ñ");  returnString = returnString.replace(/&Ograve;/g,"Ò");
  returnString = returnString.replace(/&Oacute;/g,"Ó");  returnString = returnString.replace(/&Ocirc;/g,"Ô");
  returnString = returnString.replace(/&Otilde;/g,"Õ");  returnString = returnString.replace(/&Ouml;/g,"Ö");
  returnString = returnString.replace(/&times;/g,"×");   returnString = returnString.replace(/&Oslash;/g,"Ø");
  returnString = returnString.replace(/&Ugrave;/g,"Ù");  returnString = returnString.replace(/&Uacute;/g,"Ú");
  returnString = returnString.replace(/&Ucirc;/g,"Û");   returnString = returnString.replace(/&Uuml;/g,"Ü");
  returnString = returnString.replace(/&Yacute;/g,"Ý");  returnString = returnString.replace(/&THORN;/g,"Þ");
  returnString = returnString.replace(/&szlig;/g,"ß");   returnString = returnString.replace(/&agrave;/g,"à");
  returnString = returnString.replace(/&aacute;/g,"á");  returnString = returnString.replace(/&acirc;/g,"â");
  returnString = returnString.replace(/&atilde;/g,"ã");  returnString = returnString.replace(/&auml;/g,"ä");
  returnString = returnString.replace(/&aring;/g,"å");   returnString = returnString.replace(/&aelig;/g,"æ");
  returnString = returnString.replace(/&ccedil;/g,"ç");  returnString = returnString.replace(/&egrave;/g,"è");
  returnString = returnString.replace(/&eacute;/g,"é");  returnString = returnString.replace(/&ecirc;/g,"ê");
  returnString = returnString.replace(/&euml;/g,"ë");    returnString = returnString.replace(/&igrave;/g,"ì");
  returnString = returnString.replace(/&iacute;/g,"í");  returnString = returnString.replace(/&icirc;/g,"î");
  returnString = returnString.replace(/&iuml;/g,"ï");    returnString = returnString.replace(/&eth;/g,"ð");
  returnString = returnString.replace(/&ntilde;/g,"ñ");  returnString = returnString.replace(/&ograve;/g,"ò");
  returnString = returnString.replace(/&oacute;/g,"ó");  returnString = returnString.replace(/&ocirc;/g,"ô");
  returnString = returnString.replace(/&otilde;/g,"õ");  returnString = returnString.replace(/&ouml;/g,"ö");
  returnString = returnString.replace(/&divide;/g,"÷");  returnString = returnString.replace(/&oslash;/g,"ø");
  returnString = returnString.replace(/&ugrave;/g,"ù");  returnString = returnString.replace(/&uacute;/g,"ú");
  returnString = returnString.replace(/&ucirc;/g,"û");   returnString = returnString.replace(/&uuml;/g,"ü");
  returnString = returnString.replace(/&yacute;/g,"ý");  returnString = returnString.replace(/&thorn;/g,"þ");
  returnString = returnString.replace(/&yuml;/g,"ÿ");    returnString = returnString.replace(/&yuml;/g,"ÿ");
  
  return returnString;
}
<!-- new 3.5.0.3 end -->

function showInvFieldMessage(message) {
<!-- new 3.5.0.3 begin -->
  alert(htmlToJS(message));
<!-- new 3.5.0.3 end -->
  inptField.focus();
  inptField.select();
  return false;
}

function validMailString(mailString) {
  for (var i = 0; i < mailString.length; i++) {
    var ch                   = mailString.substring(i, i + 1);
    if (ch != "." && ch != "_" && ch != "-") {
      if (ch < "0" || ch > "z") {
        return false;
      } else if ((ch > "9" && ch < "A") || (ch > "Z" && ch < "a")) {
        return false;
      }
    }
  }

  return true;
}

function validateField(frame, form, field, method, fielddesc) {
  inptField              = eval("window." + frame.name + ".document." + form.name + "." + field.name);
  inputFieldName         = fielddesc;

  if (method == "isNotEmpty") {
    if (inptField.value == "" || inptField.value == null) {
      return showInvFieldMessage("Het veld '" + inputFieldName + "' moet ingevuld worden!");
      
      
      
      

      return false;
    }
  } else if  (method == "isValidEmail") {
    var email                  = inptField.value;
    if (email == null || email == "") return true;
    var atPos                  = email.indexOf('@');
    if (atPos < 0) return showInvFieldMessage("Ongeldig e-mailadres!");
    var username               = email.substring(0,atPos).toLowerCase();
    var hostname               = email.substring(atPos+1,email.length).toLowerCase();
    if (!validMailString(username))
      return showInvFieldMessage("Ongeldig e-mailadres!");
    if (!validMailString(hostname))
      return showInvFieldMessage("Ongeldig e-mailadres!");
    if (hostname.indexOf('.') < 0)
      return showInvFieldMessage("Ongeldig e-mailadres!");
  }
  return true;
}

function StringToFloat(str) {
  var s                      = new String("");

  if (str.indexOf(",") >= 0) {
    s = str.substring(0, str.indexOf(",")) + "." + str.substring(str.indexOf(",")+1, str.length);
  }
  else {
    s = str;
  }
  return(parseFloat(s));
}

function checkNum(str) {
  if (str == "") {
    alert("Voer a.u.b. een getal in.");
    
    
    
    
    return false;
  }
  for (var i = 0; i < str.length; i++) {
    var ch                   = str.substring(i, i + 1);
    if (ch < "0" || ch > "9") {
      alert("Voer a.u.b. een getal in.");
      
      
      
      
      return false;
    }
  }
  return true;
}

function convDec(str) {
  var strtmp = str * 100;
  var s = "" + Math.round(strtmp);
  if (s.length < (Decimals+1)) {
    for (var i = 0; i = ((Decimals+1)-s.length); i++) {
      s = "0"+s;
    }
  }
  if ("00" == "") {
    return(s);
  } else {
    return(s.substring(0, s.length-Decimals) + "," + s.substring(s.length-Decimals, s.length));
  }
}

<!-- new 3.5.0.8 begin -->
function convDecExt(str) {
  var strtmp = str * 10000;
  var s = "" + Math.round(strtmp);
  if (s.length < ((Decimals*2)+1)) {
    for (var i = 0; i = (((Decimals*2)+1)-s.length); i++) {
      s = "0"+s;
    }
  }
  if ("0000" == "") {
    return(s);
  } else {
    return(s.substring(0, s.length-(Decimals*2)) + "," + s.substring(s.length-(Decimals*2), s.length));
  }
}
<!-- new 3.5.0.8 end -->

function convEuropeanDec(str) {
  var strtmp = StringToFloat(str) * 100;
  var s = "" + Math.round(strtmp);
  if (s.length < (3)) {
    for (var i = 0; i = ((3)-s.length); i++) {
      s = "0"+s;
    }
  }
  return(s.substring(0, s.length-2) + "," + s.substring(s.length-2, s.length));
}

<!-- new 3.5.0.0 begin -->
function localSubString(str,startIndex,endIndex) {
  var strtmp = new String(str);
  return strtmp.substring(startIndex,endIndex);
}
<!-- new 3.5.0.0 end -->

function showPrice(priceIncVAT, VAT) {
  var localPrice = priceIncVAT;
  
  return(localPrice);
}

// ********************************************************* //
// Application functions                                     //
// ********************************************************* //

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;
}

<!-- new 3.5.0.0 begin -->
function discountPrice(price, discType, quantity, SecAmount, SecPrice) {
  var returnPrice = price;
  if ((SecAmount == 0) || (quantity < SecAmount)) {
    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 {
    returnPrice = SecPrice;
  }
  return returnPrice;
}
<!-- new 3.5.0.0 end -->

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 = "N_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, SecAmount, SecPrice,
			  ArticleSalesCode) {
  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.SecAmount             = SecAmount;
  this.SecPrice              = SecPrice;
  this.ArticleSalesCode      = ArticleSalesCode;
}

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) {
  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;
}

function Order(PayMethodCost, PayMethodText, PayMethodVAT,
               ItemsReadable, Items, SubTotal, Delivery,
               Total, SecCurr, VAT, VATtotal, PayMethodshort, ShipType,
               PayMethodType, PaySystemType) {
  this.PayMethodCost         = PayMethodCost;
  this.PayMethodText         = PayMethodText;
  this.PayMethodVAT          = PayMethodVAT;
  this.ItemsReadable         = ItemsReadable;
  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;
}

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("");
<!-- new 3.5.0.0 begin -->
	var StopAddToCart		 = new String("N");
<!-- new 3.5.0.0 end -->

    if (typeof(form.SecAmount)!= 'undefined' && form.SecAmount != null) {
      ArtSecAmount           = StringToFloat(form.SecAmount.value);
    } else {
      ArtSecAmount           = 0;
    }
    if (typeof(form.SecPrice)!= 'undefined' && form.SecAmount != null) {
      ArtSecPrice            = StringToFloat(form.SecPrice.value);
    } else {
      ArtSecPrice            = 0;
    }

<!-- new 3.5.0.0 begin -->
	<!-- 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)) {
        return alert("Het veld '" + form.Opt1a.value + "' moet ingevuld worden!");
        
        
        
        	  
		StopAddToCart = "Y";
		return false;
	  }
	}
	if ((StopAddToCart == "N") && (typeof(form.Opt2c)!= 'undefined' && form.Opt2c != null)) {
	  if ((form.Opt2c.value == 'required') && (form.Opt2b.selectedIndex == 0)) {
        return alert("Het veld '" + form.Opt2a.value + "' moet ingevuld worden!");
        
        
        
        	  
		StopAddToCart = "Y";
		return false;
	  }
	}
	if ((StopAddToCart == "N") && (typeof(form.Opt3c)!= 'undefined' && form.Opt3c != null)) {
	  if ((form.Opt3c.value == 'required') && (form.Opt3b.selectedIndex == 0)) {
        return alert("Het veld '" + form.Opt3a.value + "' moet ingevuld worden!");
        
        
        
        	  
		StopAddToCart = "Y";
		return false;
	  }
	}
	if ((StopAddToCart == "N") && (typeof(form.Opt4c)!= 'undefined' && form.Opt4c != null)) {
	  if ((form.Opt4c.value == 'required') && (form.Opt4b.selectedIndex == 0)) {
        return alert("Het veld '" + form.Opt4a.value + "' moet ingevuld worden!");
        
        
        
        	  
		StopAddToCart = "Y";
		return false;
	  }
	}
	if ((StopAddToCart == "N") && (typeof(form.Opt5c)!= 'undefined' && form.Opt5c != null)) {
	  if ((form.Opt5c.value == 'required') && (form.Opt5b.selectedIndex == 0)) {
        return alert("Het veld '" + form.Opt5a.value + "' moet ingevuld worden!");
        
        
        
        	  
		StopAddToCart = "Y";
		return false;
	  }
	}
<!-- new 3.5.0.0 end -->
	
<!-- new 3.5.0.0 begin -->
	if (StopAddToCart == "N") {
<!-- new 3.5.0.0 end -->
		// Article option 1
		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);
		  }
		}
		// Article option 2
		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);
		  }
		}
<!-- new 3.5.0.0 begin -->
		// Article option 3
		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);
		  }
		}
		// Article option 4
		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);
		  }
		}
		// Article option 5
		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);
		  }
		}
	
		ArtName += ArtOptionsText;
		for (var i=0; i<Items.length; i++) {
		  if ((Items[i].ArticleCode == ArtArticleCode) && (Items[i].Name == ArtName)) {
            Items[i].Quantity += ArtQuantity;
            Items[i].Price     = discountPrice(Items[i].OriginalPrice, Items[i].DiscountType, Items[i].Quantity, 
			                                   Items[i].SecAmount, Items[i].SecPrice);
			ArtInOrder         = 1;
		  }
		}
		if (ArtInOrder == 0) {
          Items[Items.length] = new Item(ArtArticleCode,ArtName,
                                         discountPrice(ArtPrice, ArtDiscountType, ArtQuantity, ArtSecAmount, ArtSecPrice),
										 ArtQuantity,ArtVAT,
										 ArtDiscountType,ArtPrice,ArtWeight,ArtShipPrice, ArtOptionsText,
										 ArtSecAmount, ArtSecPrice, ArtArticleSalesCode);
		}
	  return true;
	}
<!-- new 3.5.0.0 end -->	
}

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 = "N_cart.html";
}

function emptyCart() {
  for (var i = 0; i < Items.length; i++) {
    Items[i].Quantity = 0;
  }
  window.frame_body.location = 'N_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 ) {
      Items[pos].Quantity = ArtQuantity;
<!-- new 3.5.0.0 begin -->
      Items[pos].Price     = discountPrice(Items[pos].OriginalPrice, Items[pos].DiscountType, Items[pos].Quantity, 
	                                       Items[pos].SecAmount, Items[pos].SecPrice);
<!-- new 3.5.0.0 end -->
    }
  }
  window.frame_body.location = "N_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 = 'N_home.html';
  }
  alert("Uw winkelwagen is leeggemaakt!");
}

function showCartItems() {
  var Text                   = new String("");
  var SubTotal               = 0;
  var Total                  = 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" class="delete">'+
               '    <a href="javascript:parent.deleteFromCart(\'' + Items[i].ArticleCode + '\',\''+Items[i].OptionsText+'\')"><img src="delete.gif" bOrder="0" alt="Verwijderen" align="middle"></a>'+
               '  </td>'+
               '  <td valign="middle" align="right" class="waarden">'+
               '    <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 + '" class="textField" style="width:50px;" maxlength="10" onChange="if (!parent.checkNum(this.value)) {this.focus(); this.select()}">'+
               '  </td>'+
               '  <td valign="middle" align="right" class="waarden" colspan="3">'+
               '    ' + Items[i].Name +
               '  </td>'+
               '  <td align="right" valign="middle" class="waarden">'+
               '    ' + convDec(showPrice(Items[i].Price, Items[i].VAT)) +
               '  </td>'+
               '  <td align="right" valign="middle" class="waarden">'+
               '    ' + convDec(SubTotal) +
               '  </TD>'+
               '</TR>';
    }
  }
  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" class="button" VALUE="'+ txtCalculate +'" onClick="parent.updateCart(this.form)"></form>'+
          '  </td>'+
          '  <td colspan="5" height="40"></td>'+
          '</tr>'+
          '<tr valign="baseline">'+
          '  <td></td>'+
          '  <td></td>'+
          '  <td></td>'+
          '  <td></td>'+
          '  <td colspan="2" align="right" class="benamingen"><b>'+txtSubTotal+'</b></td>'+
          '  <td align="right" class="benamingen"><b>' + convDec(Total) + '</b></td>'+
          
          '</tr>';
  return Text;
}

function showCartItemsShort() {
  var Text                   = new String("");
  var SubTotal               = 0;
  var Total                  = 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" class="waarden">'+
               '    <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" class="waarden">'+
               '    ' + Items[i].Name +
               '  </td>'+
               '</TR>';
    }
  }
  var SecCurrTotal           = Total / SecCurrRate;
  Text += '<tr valign="baseline">'+
          '  <td class="benamingen">&nbsp;</td>'+
          '  <td align="right" class="benamingen"><b>' + CurrName +' '+  convDec(Total) + '</b></td>'+
          
          '</tr>';
  return Text;
}


function cart_Step1(form) {
  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];

  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;

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

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 = form.FirstName.value;
  oCustomer.LastName = form.LastName.value;
  oCustomer.Company = form.Company.value;
  oCustomer.CompanyCode = form.CompanyCode.value;
  oCustomer.CompanyPassword = form.CompanyPassword.value;
  oCustomer.Street = form.Street.value;
  oCustomer.ZipCode = form.ZipCode.value;
  oCustomer.Town = form.Town.value;
  oCustomer.Country = form.Country.value;
  oCustomer.Phone = form.Phone.value;
  oCustomer.DelName = form.DelName.value;
  oCustomer.DelStreet = form.DelStreet.value;
  oCustomer.DelZipCode = form.DelZipCode.value;
  oCustomer.DelTown = form.DelTown.value;
  oCustomer.DelCountry = form.DelCountry.value;
  oCustomer.DelPhone = form.DelPhone.value;
  oCustomer.EMail = form.EMail.value;
  oCustomer.Memo = form.Memo.value;
  
  oCustomer.Newsletter = form.Newsletter.checked;
  
  
  
  oCustomer.VATnr = form.VATnr.value;
  
  
  if (oOrder.PayMethodType == 5) {
    oCustomer.PayMethodMemo = '' 
  }

  window.frame_body.location = 'N_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;
  oOrder.Items = '';
  oOrder.ItemsReadable = '';
  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" class="waarden">'+
              '    '+ Items[i].Quantity +
              '  </td>'+
              '  <td valign="middle" colspan="3" class="waarden">'+
              '    '+ Items[i].Name +
              '  </td>'+
              '  <td valign="middle" align="right" class="waarden">'+
              '    ' + convDec(showPrice(Items[i].Price, Items[i].VAT)) +
              '  </td>'+
              '  <td valign="middle" align="right" class="waarden">'+
              '    ' + convDec(showPrice(SubTotal, Items[i].VAT)) +
              '  </td>'+
              '</tr>';
      if (oOrder.Items != '') {oOrder.Items += '~';}
      if (oOrder.ItemsReadable != '') {oOrder.ItemsReadable += '\n';}
      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));
<!-- new 3.5.0.8 begin -->	  
      oOrder.Items += Items[i].Quantity + '|' + Items[i].ArticleCode + '|' + convDecExt(Items[i].Price) + '|' + Items[i].OptionsText;
<!-- new 3.5.0.8 end -->
    }
  }
  oOrder.SubTotal = convDec(Total);
  // 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.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);
  // Total amount in SecCurr
  var SecCurrTotal          = (Total+ShipCost+PayMethodCost) / SecCurrRate;
  Text += '<tr>'+
          '  <td colspan="5" class="subtotaal"></td>'+
          '  <td class="subtotaal"></td>'+
          '</tr>'+
          '<tr>'+
          '  <td class="subtotaal"></td>'+
          '  <td class="subtotaal"></td>'+
          '  <td  class="subtotaal" valign="top" align="right" colspan="3">'+
          '    '+ txtSubTotal +
          '  </td>'+
          '  <td class="subtotaal" valign="top" align="right">'+
          '    ' + convDec(showTotal) +
          '  </td>'+
          '</tr>'+
          '<tr>'+
          '  <td class="subtotaal"></td>'+
          '  <td class="subtotaal"></td>'+
          '  <td class="subtotaal" valign="top" align="right" colspan="3">'+
          '    '+ txtDelivery +
          '  </td>'+
          '  <td class="subtotaal" valign="top" align="right">'+
          '    ' + convDec(showPrice(ShipCost, oCustomer.ShipVAT)) +
          '  </td>'+
          '</tr>'+
          '<tr>'+
          '  <td class="subtotaal"></td>'+
          '  <td class="subtotaal"></td>'+
          '  <td class="subtotaal" valign="top" align="right" colspan="3">'+
          '    '+ txtPayMethodCost +
          '  </td>'+
          '  <td class="subtotaal" valign="top" align="right">'+
          '    ' + convDec(showPrice(PayMethodCost, oCustomer.PayMethodVAT)) +
          '  </td>'+
          '</tr>'+
          '<tr>'+
          '  <td class="subtotaal" colspan="5"></td>'+
          '  <td class="subtotaal"></td>'+
          '</tr>'+
          '<tr>'+
          '  <td class="subtotaal"></td>'+
          '  <td class="subtotaal"></td>'+
          '  <td class="subtotaal" valign="top" align="right" colspan="3">'+
          '    <b>'+ txtTotal +'</b>'+
          '  </td>'+
          '  <td class="subtotaal" valign="top" align="right">'+
          '    <b>' + convDec(showTotal+showPrice(ShipCost, oCustomer.ShipVAT)+showPrice(PayMethodCost, oCustomer.PayMethodVAT)) + '</b>'+
          '  </td>'+
          '</tr>'+
          
          '<tr>'+
          '  <td colspan="5" class="subtotaal"></td>'+
          '  <td class="subtotaal"></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 class="subtotaal"></td>'+
                '  <td class="subtotaal"></td>'+
                '  <td class="subtotaal" valign="top" align="right" colspan="3">'+
                '    '+txtVAT+' (' + aVATItems[j].VValue + '%)' +
                '  </td>'+
                '  <td class="subtotaal" 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 class="subtotaal"></td>'+
          '  <td class="subtotaal"></td>'+
          '  <td class="subtotaal" valign="top" align="right" colspan="3">'+
          '    <b>' + txtVATTotal + '</b>'+
          '  </td>'+
          '  <td class="subtotaal" 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" class="subtotaal"><b>'+txtWayOfDelivery+'</b></td>'+
          '</tr>'+
          '<tr>'+
          '  <td align="center" class="subtotaal">'+
          '    <select name="Ship" class="dropdown">';
  
  Ship_VAT[0] = 1;
  Text += '      <option value="3">1:Binnen Nederland 0 - 3 kg (euro 3,00)</option>';
  Ship_VAT[1] = 1;
  Text += '      <option value="6.2">2: Binnen Nederland pas niet in de brievenbus (euro 6,20)</option>';
  Ship_VAT[2] = 1;
  Text += '      <option value="6.2">3:Binnen Nederland pakket 0-10 kg (euro 6,20)</option>';
  Ship_VAT[3] = 1;
  Text += '      <option value="10.25">4:Binnen Nederland pakket 10 - 30 kg (euro 10,25)</option>';
  Ship_VAT[4] = 1;
  Text += '      <option value="11">5. Europa (niet Nederland) 1 - 2 kg (euro 11,00)</option>';
  Ship_VAT[5] = 1;
  Text += '      <option value="7.5">6:Europa (niet Nederland) 0 - 1 kg (euro 7,50)</option>';
  Ship_VAT[6] = 1;
  Text += '      <option value="0">7:Boven € 125,- geen verzendkosten</option>';
  Ship_VAT[7] = 1;
  Text += '      <option value="0">8:ik haal de artikelen zelf op</option>';
  

  Text += '    </select>'+
          '  </td>'+
          '</tr>'+
          '<tr>'+
          '  <td>&nbsp;</td>'+
          '</tr>'+
  // Way of payment
          '<tr>'+
          '  <td align="left" class="subtotaal"><b>'+txtWayOfPayment+'</b></td>'+
          '</tr>'+
          '<tr>'+
          '  <td class="subtotaal" align="center">'+
          '    <select name="PayMethod" class="dropdown">';
  
  PayMethod_VAT[0] = 1;
  PayMethod_Type[0] = 5;
  PaySystem_Type[0] = 0;
  Text += '      <option value="0">Betaling vooraf</option>';
  


  Text += '    </select>'+
          '  </td>'+
          '</tr>'+
          '<tr>'+
          '  <td>&nbsp;</td>'+
          '</tr>';

  return Text;
}

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

<!-- new 3.5.0.0 begin --> 
  
  
  // 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" class="bodyTxtFormBeschrijving"><b>'+txtInvoiceAddress+'</b></td>'+
          '       </tr>'+
          // Salutation
          '       <tr valign="baseline">'+
          '         <td></td>'+
          '         <td></td>'+
          '         <td class="bodyTxtForm">'+
          '           <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 class="bodyTxtFormBeschrijving">'+ txtFirstName +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="FirstName" class="textField" style="width:180px;" value="'        + oCustomer.FirstName + '">'+
          '         </td>'+
          '       </tr>'+
          // LastName
          '       <tr>'+
          
          '         <td class="bodyTxt">*</td>'+
          
          
          '         <td class="bodyTxtFormBeschrijving">'+ txtLastName +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="LastName" class="textField" style="width:180px;" value="'        + oCustomer.LastName + '">'+
          '         </td>'+
          '       </tr>'+
          // Company
          '       <tr>'+
          
          
          '         <td></td>'+
          
          '         <td class="bodyTxtFormBeschrijving">'+ txtCompany +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="Company" class="textField" style="width:180px;" value="'        + oCustomer.Company + '">'+
          '         </td>'+
          '       </tr>';
          // VATnr
  
  Text += '       <tr>'+
          '         <td></td>'+
          '         <td class="bodyTxtFormBeschrijving">'+ txtVATnr +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="VATnr" class="textField" style="width:180px;" value="'        + oCustomer.VATnr + '">'+
          '         </td>'+
          '       </tr>';
  
          // Street
  Text += '       <tr>'+
          
          '         <td class="bodyTxt">*</td>'+
          
          
          '         <td class="bodyTxtFormBeschrijving">'+ txtStreetAndNr +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="Street" class="textField" style="width:180px;" value="'        + oCustomer.Street + '">'+
          '         </td>'+
          '       </tr>'+
          // ZipCode
          '       <tr>'+
          
          '         <td class="bodyTxt">*</td>'+
          
          
          '         <td class="bodyTxtFormBeschrijving">'+ txtZipcode +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="ZipCode" class="textField" style="width:180px;" maxlength="10" value="'        + oCustomer.ZipCode + '">'+
          '         </td>'+
          '       </tr>'+
          // Town
          '       <tr>'+
          
          '         <td class="bodyTxt">*</td>'+
          
          
          '         <td class="bodyTxtFormBeschrijving">'+ txtTown +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="Town" class="textField" style="width:180px;" value="'        + oCustomer.Town + '">'+
          '         </td>'+
          '       </tr>'+
          // Country
          '       <tr>'+
          
          '         <td class="bodyTxt">*</td>'+
          
          
          '         <td class="bodyTxtFormBeschrijving">'+ txtCountry +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="Country" class="textField" style="width:180px;" value="'        + oCustomer.Country + '">'+
          '         </td>'+
          '       </tr>'+
          // Phone
          '       <tr>'+
          
          
          '         <td></td>'+
          
          '         <td class="bodyTxtFormBeschrijving">'+ txtPhone +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="Phone" class="textField" style="width:180px;" value="'        + oCustomer.Phone + '">'+
          '         </td>'+
          '       </tr>'+
          // E-Mail
          '       <tr>'+
          
          '         <td class="bodyTxt">*</td>'+
          
          
          '         <td class="bodyTxtFormBeschrijving">'+ txtEMail +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="EMail" class="textField" style="width:180px;" value="'        + oCustomer.EMail + '">'+
          '         </td>'+
          '       </tr>'+
		  '      </table>'+
		  '    </td>'+
		  '    <td>'+
		  '      <table border="0">'+
          // Delivery
          '       <tr>'+
          '         <td colspan="3" class="bodyTxtFormBeschrijving"><b>'+ txtDeliveryAddress +'</b></td>'+
          '       </tr>'+
          // Delivery equals invoice
          '       <tr>'+
          '         <td></td>'+
          '         <td colspan="2" class="bodyTxtFormBeschrijving"><input type="checkbox" name="copy" OnClick="javascript:DelToInvAdd();" value="checkbox">'+txtDeliveryAddressEqual+'</td>'+
          '       </tr>'+
          // Delivery Name
          '       <tr>'+
          '         <td></td>'+
          '         <td class="bodyTxtFormBeschrijving">'+ txtName +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="DelName" class="textField" style="width:180px;" value="' + oCustomer.DelName + '">'+
          '         </td>'+
          '       </tr>'+
          // Delivery Street
          '       <tr>'+
          '         <td></td>'+
          '         <td class="bodyTxtFormBeschrijving">'+ txtStreetAndNr +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="DelStreet" class="textField" style="width:180px;" value="' + oCustomer.DelStreet + '">'+
          '         </td>'+
          '       </tr>'+
          // Delivery ZipCode
          '       <tr>'+
          '         <td></td>'+
          '         <td class="bodyTxtFormBeschrijving">'+ txtZipcode +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="DelZipCode" style="width:180px;" class="textField" maxlength="10" value="' + oCustomer.DelZipCode + '">'+
          '         </td>'+
          '       </tr>'+
          // Delivery own
          '       <tr>'+
          '         <td></td>'+
          '         <td class="bodyTxtFormBeschrijving">'+ txtTown +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="DelTown" class="textField" style="width:180px;" value="' + oCustomer.DelTown + '">'+
          '         </td>'+
          '       </tr>'+
          // Delivery Country
          '       <tr>'+
          '         <td></td>'+
          '         <td class="bodyTxtFormBeschrijving">'+ txtCountry +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="DelCountry" class="textField" style="width:180px;" value="' + oCustomer.DelCountry + '">'+
          '         </td>'+
          '       </tr>'+
          // Delivery Phone
          '       <tr>'+
          '         <td></td>'+
          '         <td class="bodyTxtFormBeschrijving">'+ txtPhone +'</td>'+
          '         <td class="bodyTxtForm">'+
          '           <input type="text" name="DelPhone" class="textField" 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" class="bodyTxtFormBeschrijving"><b>'+ txtRemarks +'</b></td>'+
          '</tr>'+
  // Memo
          '<tr>'+
          '  <td colspan="2"><textarea name="Memo" class="textField" style="width:100%;height:100px;" wrap="VIRTUAL">' + oCustomer.Memo + '</textarea></td>'+
          '</tr>';
  // Newsletter
  
  Text += '<tr>'+
          '  <td colspan="2" class="bodyTxtForm">'+
          '    <input type="checkbox" name="Newsletter"> '+
               txtWantToReceiveNewsletter +
          '  </td>'+
          '</tr>';
  
  Text += '<tr>'+
          '  <td colspan="2"></td>'+
          '</tr>'+
  
          '<tr>'+
          '  <td colspan="2" class="bodyTxtForm">'+
		  '    <IFRAME SRC="N_supcond.html" WIDTH="100%" HEIGHT=100>'+
          '      <a href="N_xp_1.html">'+txtConditions+'</a>'+
          '    </IFRAME>'+
          '  </td>'+
          '</tr>'+
  
		  '<tr>'+
          '  <td colspan="2" class="bodyTxtForm">'+
          '    <input type="checkbox" name="Conditions"> * '+
               txtAcceptConditions +
          '  </td>'+
          '</tr>';
<!-- new 3.5.0.0 end -->
  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" class="bodyTxt"><b>'+ txtData +'<b></td>'+
          '    <td class="bodyTxtForm"><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" class="bodyTxt"><b>'+ txtPhone +'<b></td><td class="bodyTxtForm">' + oCustomer.Phone + '</td></tr>';
  }
  // E-Mail
  if (oCustomer.EMail != '') {
    Text += '<tr><td align="left" class="bodyTxt"><b>'+ txtEMail +'<b></td><td class="bodyTxtForm">' + oCustomer.EMail + '</td></tr>';
  }
  Text += '<tr><td align="left" class="bodyTxt">&nbsp;</td><td class="bodyTxtForm">&nbsp;</td></tr>'+
  // Sending
          '  <tr>'+
          '    <td align="left" class="bodyTxt"><b>'+ txtWayOfDelivery +'<b></td>'+
          '    <td class="bodyTxtForm">' + oCustomer.ShipText + '</td>'+
          '  </tr>'+
          '  <tr>'+
          '    <td align="left" class="bodyTxt">&nbsp;</td>'+
          '    <td class="bodyTxtForm">&nbsp;</td>'+
          '  </tr>';
  // Paymethod
  Text += '  <tr>'+
          '    <td align="left" class="bodyTxt"><b>'+ txtWayOfPayment +'<b></td>'+
          '    <td class="bodyTxtForm">'+ oCustomer.PayMethodText +'</td>'+
          '</tr>';
  oOrder.PayMethodCost = oCustomer.PayMethodCost;
  oOrder.PayMethodText = oCustomer.PayMethodText;
  oOrder.PayMethodVAT = oCustomer.PayMethodVAT;
  oOrder.PayMethodshort = oCustomer.PayMethodText;

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

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

function printEmailBody(DateStr) {
  var ShipCost               = StringToFloat(oCustomer.ShipCost);
  var Text                   = new String("");
  Text += '\n'+
          txtAOrder+' '+OrderID.valueOf()+'\n'+
          txtOrderFor+' '+txtWebShopName+' - '+txtOrderedOn+' '+DateStr + '\n'+
          '\n'+
          txtData+': \n'+
          '\n';
  if (oCustomer.Company != '') {Text += oCustomer.Company + '\n';}
  if (oCustomer.VATnr != '') {Text += oCustomer.VATnr + '\n';}
  Text += oCustomer.Salutation + ' '+oCustomer.FirstName + ' ' + oCustomer.LastName + '\n'+
          oCustomer.Street + '\n'+
          oCustomer.ZipCode + ' ' + oCustomer.Town + '\n'+
          oCustomer.Country + '\n'+
          '\n'+
          oCustomer.Phone + '\n'+
          oCustomer.EMail + '\n'+
          '\n'+
          oCustomer.DelName + '\n'+
          oCustomer.DelStreet + '\n'+
          oCustomer.DelZipCode + ' ' + oCustomer.DelTown + '\n'+
          oCustomer.DelCountry + '\n'+
          '\n'+
          oCustomer.DelPhone + '\n'+
          '\n'+'\n'+
          txtAOrder+':\n'+
          '\n'+
          oOrder.ItemsReadable + '\n';
  if (StringToFloat(oOrder.Delivery) > 0) Text += '1 x '+txtDelivery+': '+convDec(showPrice(StringToFloat(oOrder.Delivery), oCustomer.ShipVAT))+' = '+convDec(showPrice(StringToFloat(oOrder.Delivery), oCustomer.ShipVAT))+'\n';
  if (StringToFloat(oOrder.PayMethodCost) > 0) Text += '1 x '+txtPayMethodCost+': '+convDec(showPrice(StringToFloat(oOrder.PayMethodCost), oCustomer.PayMethodVAT))+' = '+convDec(showPrice(StringToFloat(oOrder.PayMethodCost), oCustomer.PayMethodVAT))+'\n';
  
  Text += '===============================\n'+
          txtTotalIncVAT + ':  ' + oOrder.Total +'\n'+
          '\n\n'+
          txtVAT + ':\n'+
          oOrder.VAT + '\n'+
          '\n'+
          '\n';

  if (oOrder.PayMethodText != '') Text += txtWayOfPayment+': '+oOrder.PayMethodText + '\n';

  Text += txtWayOfDelivery+': '+oCustomer.ShipText +'\n'+
          '\n'+
          txtRemarks+':\n';
  if (oCustomer.Memo == '') Text += txtNone
  else Text += oCustomer.Memo;
  if ('' == '') {
    if ((oCustomer.PayMethodMemo == '') || ((oCustomer.PayMethodMemo == 'undefined')))
      Text += '';
    else
      Text += '\n\n'+txtPayMethodInfo+':\n'+ oCustomer.PayMethodMemo;
  }

  Text += '\n\n';

  return Text;
}

function printEmailAttachment(DateStr) {
  var Text                   = new String("");

  Text += '<!DOCTYPE LV_ELECTRONIC_ORDER>\n'+
          '==== ENCODED ORDER - BEGIN ====\n'+
          'OV=1'+ EncOrderSeparator+                                // Order program Version
          'OSV=1'+ EncOrderSeparator+                               // Order program SubVersion
          'SN=' + txtWebShopName +EncOrderSeparator+                // ShopName
          'ID=' + OrderID.valueOf() +EncOrderSeparator+             // OrderID
          'DT=' + DateStr + EncOrderSeparator+                      // Date
          'ST=' + oCustomer.Salutation + EncOrderSeparator+         // Salutation
          'FN=' + oCustomer.FirstName + EncOrderSeparator+          // FirstName
          'LN=' + oCustomer.LastName + EncOrderSeparator+           // LastName
          'CP=' + oCustomer.Company + EncOrderSeparator+            // Company
          'VAT='+ oCustomer.VATnr + EncOrderSeparator+                // VATnr
          'CC=' + oCustomer.CompanyCode + EncOrderSeparator+        // CompanyCode
          'CW=' + oCustomer.CompanyPassword + EncOrderSeparator+    // CompanyPassword
          'SR=' + oCustomer.Street + EncOrderSeparator+             // Street
          'ZP=' + oCustomer.ZipCode + EncOrderSeparator+            // Zipcode
          'CT=' + oCustomer.Town + EncOrderSeparator+               // City
          'CO=' + oCustomer.Country + EncOrderSeparator+            // Country
          'PH=' + oCustomer.Phone + EncOrderSeparator+              // Phone
          'EM=' + oCustomer.EMail + EncOrderSeparator+              // EMail
          'NL=' + oCustomer.Newsletter + EncOrderSeparator+         // Newsletter
          'DLN=' + oCustomer.DelName + EncOrderSeparator+           // Delivery name
          'DLSR=' + oCustomer.DelStreet + EncOrderSeparator+        // Delivery street
          'DLZP=' + oCustomer.DelZipCode + EncOrderSeparator+       // Delivery zipcode
          'DLT=' + oCustomer.DelTown + EncOrderSeparator+           // Delivery town
          'DLCO=' + oCustomer.DelCountry + EncOrderSeparator+        // Delivery country
          'DLPH=' + oCustomer.DelPhone + EncOrderSeparator+         // Delivery phone
          'SHC=' + oCustomer.ShipCost + EncOrderSeparator+           // ShipCost
          'SHT=' + oCustomer.ShipText + EncOrderSeparator+          // ShipText
          'PMS=' + oOrder.PayMethodshort + EncOrderSeparator+       // PayMethodShort
          'PMT=' + oOrder.PayMethodText + EncOrderSeparator+             // PayMethodText
          'PMC=' + oOrder.PayMethodCost + EncOrderSeparator+             // PayMethodCost
          'OI=' + oOrder.Items + EncOrderSeparator+                 // OrderItems
          'OST=' + oOrder.SubTotal + EncOrderSeparator+             // SubTotal
          'OD=' + oOrder.Delivery + EncOrderSeparator+              // Delivery
          'OT=' + oOrder.Total + EncOrderSeparator+                 // Total
          '\n'+
          'MEMO=\n' + oCustomer.Memo +                              // Memo
          '\n';

  if ((oCustomer.PayMethodMemo == '') || ((oCustomer.PayMethodMemo == 'undefined')))
    Text += txtPayMethodInfo+':\n' + txtNone
  else
    Text += txtPayMethodInfo+':\n' + oCustomer.PayMethodMemo;

  Text += '\n'+
          '==== ENCODED ORDER - END ====';
  return Text;
}

<!-- new 3.5.0.0 begin -->
function PSPPayment() {
  var Text                   = new String("");

  if (oOrder.PaySystemType != 0) {
  <!-- position changed 3.5.0.5 begin -->
  
  <!-- position changed 3.5.0.5 end -->

    document.close();
	document.open();
	document.write("<HTML><TITLE>PSP</TITLE>");
	document.write("<BODY onload=\"document.form1.submit()\">");
	<!-- position changed 3.5.0.5 begin, moved to top of statement -->
	<!-- position changed 3.5.0.5 end -->
	document.write(Text);
	document.write("</BODY></HTML>");
	document.close();
  }

  OrderID = new Date();
  Items   = new Array();
  
  return true;
}
<!-- new 3.5.0.0 end -->

<!-- new 3.5.0.8 begin -->
function printOrder() {
  var    Text                   = new String("");
  var    Now                    = new Date();
  var    DateStr                = Now.getDate() + '.';
  var    year                   = Now.getYear();
  if (year < 2000) year += 1900;
  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(); 
  } 
}
<!-- new 3.5.0.8 end -->

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();
  if (year < 2000) year += 1900;
  if ((Now.getMonth()+1) < 10) DateStr += '0' + (Now.getMonth()+1) + '.' + year
  else DateStr += (Now.getMonth()+1) + '.' + year;
  EmailBody  = printEmailBody(DateStr);
  Attachment = printEmailAttachment(DateStr);
  if (oCustomer.EMail != "") {mailfrom = oCustomer.EMail;} else {mailfrom = "Unknown";}

<!-- new 3.5.0.0 begin -->
  Text += '<form method="post" action="'+CGIScriptAddress+'" ';
<!-- new 3.5.0.0 end -->
  Text += '>'+
          '<input type="hidden" name="From" value="' + mailfrom + '">'+
          '<input type="hidden" name="To" value="'+txtSendOrderToEMail+'">'+
          '<input type="hidden" name="Subject" value="'+txtAOrder+' - '+txtWebShopName+'">'+
          '<input type="hidden" name="SubjectMailClient" value="'+txtConfirmation+' - '+txtAOrder+' - '+txtWebShopName+'">'+
          '<input type="hidden" name="Message" value="' + EmailBody + '">'+
          '<input type="hidden" name="Attachment" value="' +  Attachment + '">'+
          '<input type="hidden" name="OrderID" value="' +  OrderID.valueOf() + '">'+
          '<input type="hidden" name="redirect" value="http://www.anita-chamel.nl/webshop/N_cart_step4.html">'+
          '<p align="center">'+
          '  <input class="button" type="button" value="'+ txtBack +'" onClick="history.back()">&nbsp;'+
          '  <input class="button" type="button" value="'+ txtCancelOrder +'" onClick="parent.cancelOrder()">&nbsp;'+
          '  <input class="button" type="submit" value="'+ txtSendOrder +'">'+
          '</p>'+
          '</form>';

<!-- new 3.5.0.0 begin -->
  <!-- deleted -> OrderID =  new Date(); -->
<!-- new 3.5.0.0 end -->

  return Text;
}

isCatalogELoaded = true;
