//=====================================================================||
//               NOP Design JavaScript Shopping Cart                   ||
//                                                                     ||
// For more information on SmartSystems, or how NOPDesign can help you ||
// Please visit us on the WWW at http://www.nopdesign.com              ||
//                                                                     ||
// Javascript portions of this shopping cart software are available as ||
// freeware from NOP Design.  You must keep this comment unchanged in  ||
// your code.  For more information contact FreeCart@NopDesign.com.    ||
//                                                                     ||
// JavaScript Shop Module, V.4.2.1                                     ||
//=====================================================================||

//---------------------------------------------------------------------||
//                       Global Options                                ||
//                      ----------------                               ||
// Shopping Cart Options, you can modify these options to change the   ||
// the way the cart functions.                                         ||
//                                                                     ||
// Options For Everyone:                                               ||
// =====================                                               ||
// * DisplayNotice: true/false, controls whether the user is provided  ||
//   with a popup letting them know their product is added to the cart ||
// * DisplayShippingColumn: true/false, controls whether the managecart||
//   and checkout pages display shipping cost column.                  ||
// * DisplayShippingRow: true/false, controls whether the managecart   ||
//   and checkout pages display shipping cost total row.               ||
// * DisplayTaxRow: true/false, controls whether the managecart        ||
//   and checkout pages display tax cost total row.                    ||
// * TaxRate: number, your area's current tax rate, ie: if your tax    ||
//   rate was 7.5%, you would set TaxRate = 0.075                      ||
// * MonetarySymbol: string, the symbol which represents dollars/euro, ||
//   in your locale.                                                   ||
// * Language: string, the two digit language code to display user     ||
//   messages in.  Supported languages:                                ||
//    * English  (en)    * French   (fr)                               ||
//    * Dutch    (nl)    * Spanish  (sp)                               ||
//    * German   (ge)    * Finish   (fi)                               ||
//                                                                     ||
// Options For Programmers:                                            ||
// ========================                                            ||
// * OutputItem<..>: string, the name of the pair value passed at      ||
//   checkouttime.  Change these only if you are connecting to a CGI   ||
//   script and need other field names, or are using a secure service  ||
//   that requires specific field names.                               ||
// * AppendItemNumToOutput: true/false, if set to true, the number of  ||
//   each ordered item will be appended to the output string.  For     ||
//   example if OutputItemId is 'ID_' and this is set to true, the     ||
//   output field name will be 'ID_1', 'ID_2' ... for each item.       ||
//---------------------------------------------------------------------||
DisplayNotice         = true;
DisplayShippingColumn = false;
DisplayShippingRow    = true;
DisplayTaxRow         = true;
TaxRate               = 0.15;
MonetarySymbol        = '£';
Language              = 'en';


OutputItemId          = 'ID_';
OutputItemQuantity    = 'QUANTITY_';
OutputItemPrice       = 'PRICE_';
OutputItemName        = 'NAME_';
OutputItemShipping    = 'SHIPPING_';
OutputItemAddtlInfo   = 'ADDTLINFO_';
OutputOrderSubtotal   = 'SUBTOTAL';
OutputOrderShipping   = 'SHIPPING';
OutputOrderTax        = 'TAX';
OutputOrderTotal      = 'TOTAL';
AppendItemNumToOutput = true;


//---------------------------------------------------------------------||
//                      Language Strings                               ||
//                     ------------------                              ||
// Strings displayed to end users, in language specific encoding.      ||
// only modify these strings if you wish to change language specific   ||
// wording for your site.  If you add a new language, please send it   ||
// back to NOP Design (FreeCart@NopDesign.com) so we can add it to the ||
// distribution.                                                       ||
//---------------------------------------------------------------------||
bLanguageDefined = false;
if ( Language == 'fr' ) {
   strSorry  = "D\351sol\351, votre Caddie est plein !!!";
   strAdded  = " a \351t\351 ajout\351 \340 votre Caddie";
   strRemove = "Cliquez sur 'Ok' pour retirer le produit de votre Caddie";
   strILabel = "Code";
   strDLabel = "D\351signation";
   strQLabel = "Quantit\351";
   strPLabel = "Prix unitaire";
   strSLabel = "Autres Frais";
   strRLabel = "Retirer du Caddie";
   strRButton= "Supprimer l'article !";
   strSUB    = "Sous Total";
   strSHIP   = "Frais de port";
   strTAX    = "Imposition";
   strTOT    = "TOTAL";
   strErrQty = "Quantit\351 Inadmissible";
   strNewQty = 'Veuillez \351crire la nouvelle quantit\351:';
   bLanguageDefined = true;
}
if ( Language == 'nl' ) {
   strSorry  = "Sorry, Uw winkelwagen is vol, gaat u aub naar de Kassa !!!";
   strAdded  = " aan uw winkelwagen toegevoegd.";
   strRemove = "Klik op 'Ok' om dit product uit uw winkelwagen te verwijderen.";
   strILabel = "Bestelcode";
   strQLabel = "Aantal";
   strDLabel = "Product Omschrijving";
   strPLabel = "Prijs";
   strSLabel = "Verzendkosten";
   strRLabel = "Verwijder";
   strRButton= "Verwijder";
   strSUB    = "SUBTOTAAL";
   strSHIP   = "VERZENDKOSTEN";
   strTAX    = "BTW";
   strTOT    = "TOTAAL";
   strErrQty = "Ongeldig Aantal.";
   strNewQty = 'Voer een nieuw aantal in aub:';
   bLanguageDefined = true;
} 
if ( Language == 'sp' ) {
   strSorry  = "Lo siento, el carro está lleno. Proceda con la compra";
   strAdded  = " añadido al carro de compra.";
   strRemove = "Pulse 'Aceptar' para eliminar este producto del carro de la compra.";
   strILabel = "Referencia";
   strDLabel = "Descripción";
   strQLabel = "Cantidad";
   strPLabel = "Precio Unit.";
   strSLabel = "Gastos Envío";
   strRLabel = "Eliminar";
   strRButton= "Eliminar";
   strSUB    = "SUBTOTAL";
   strSHIP   = "GASTOS DE ENVÍO";
   strTAX    = "IVA";
   strTOT    = "TOTAL";
   strErrQty = "Cantidad incorrecta";
   strNewQty = 'Por favor, introduzca una nueva cantidad:';
   bLanguageDefined = true;
}
if ( Language == 'ge' ) {
   strSorry  = "Entschuldigung, Ihre Bestellung ist vol, bitte zum Kasse gehen !!!";
   strAdded  = " an Ihre Bestellung hinzu gefügt.";
   strRemove = "Bitte Drücken sie 'Ok' um das Produkt zu entfernen.";
   strILabel = "Bestelnummer";
   strQLabel = "Anzahl";
   strDLabel = "Produkt Beschreibung";
   strPLabel = "Prijs";
   strSLabel = "Versandkosten";
   strRLabel = "Entfernen";
   strRButton= "Entfernen";
   strSUB    = "SUBTOTAAL";
   strSHIP   = "VERSANDKOSTEN";
   strTAX    = "MWSt";
   strTOT    = "TOTAAL";
   strErrQty = "Ungültiges Anzahl.";
   strNewQty = 'Bitte geben sie ein neues Anzahl ein:';
   bLanguageDefined = true;
}
if ( Language == 'fi' ) {
   strSorry  = "Ostoskorisi on täynnä,ole hyvä ja jatka kassalle.";
   strAdded  = " lisätty ostoskoriisi.";
   strRemove = "Paina 'Ok' poistaaksesi tämän tuotteen ostoskoristasi.";
   strILabel = "Tuote Koodi";
   strDLabel = "Tuotteen Nimi/Kuvaus";
   strQLabel = "Määrä";
   strPLabel = "Hinta";
   strSLabel = "Kuljetusmaksu";
   strRLabel = "Poista ostoskorista";
   strRButton= "Poista";
   strSUB    = "Yhteensä";
   strSHIP   = "Kuljetusmaksu";
   strTAX    = "ALV";
   strTOT    = "Yhteensä";
   strErrQty = "Kpl määrä ei sallituissa rajoissa.";
   strNewQty = 'Ole hyvä, anna uusi kpl määrä:';
   bLanguageDefined = true;
}
if ( Language == 'en' || !bLanguageDefined ) {
   strSorry  = "I'm Sorry, your list is full, please proceed to checkout.";
   strAdded  = " added to your shopping cart.";
   strRemove = "Click 'Ok' to remove this product from your list.";
   strback = "Click OK to clear your shopping cart";
   strILabel = "Product Code";
   strDLabel = "Product Name/Description";
   strQLabel = "Quantity";
   strPLabel = "Price";
   strSLabel = "Postage and Packaging";
   strRLabel = "Remove From List";
   strRButton= "Remove";
   strSUB    = "Total Cart Value";
   strSHIP   = "Shipping";
   strTAX    = "TAX";
   strTOT    = "";
   strErrQty = "Invalid Quantity.";
   strNewQty = 'Please enter new quantity:';
   bLanguageDefined = true;
}


//=====================================================================||
//---------------------------------------------------------------------||
//    YOU DO NOT NEED TO MAKE ANY MODIFICATIONS BELOW THIS LINE        ||
//---------------------------------------------------------------------||
//=====================================================================||

//---------------------------------------------------------------------||
// FUNCTION:    CKquantity                                             ||
// PARAMETERS:  Quantity to                                            ||
// RETURNS:     Quantity as a number, and possible alert               ||
// PURPOSE:     Make sure quantity is represented as a number          ||
//---------------------------------------------------------------------||
function CKquantity(checkString) {
   var strNewQuantity = "";

   for ( i = 0; i < checkString.length; i++ ) {
      ch = checkString.substring(i, i+1);
      if ( (ch >= "0" && ch <= "9") || (ch == '.') )
         strNewQuantity += ch;
   }

   if ( strNewQuantity.length < 1 )
      strNewQuantity = "1";

   return(strNewQuantity);
}


//---------------------------------------------------------------------||
// FUNCTION:    AddToCart                                              ||
// PARAMETERS:  Form Object                                            ||
// RETURNS:     Cookie to user's browser, with prompt                  ||
// PURPOSE:     Adds a product to the user's shopping cart             ||
//---------------------------------------------------------------------||
function AddToCart(thisForm) {
   var iNumberOrdered = 0;
   var bAlreadyInCart = false;
   var notice = "";
   iNumberOrdered = GetCookie("NumberOrdered");

   if( iNumberOrdered == null )
       iNumberOrdered = 0;

   if ( thisForm.ID_NUM == null )
      strID_NUM    = "";
   else
      strID_NUM    = thisForm.ID_NUM.value;

   if ( thisForm.QUANTITY == null )
      strQUANTITY  = "1";
   else
      strQUANTITY  = thisForm.QUANTITY.value;

   if ( thisForm.PRICE == null )
      strPRICE     = "0.00";
   else
      strPRICE     = thisForm.PRICE.value;

   if ( thisForm.NAME == null )
      strNAME      = "";
   else
      strNAME      = thisForm.NAME.value;

   if ( thisForm.SHIPPING == null )
      strSHIPPING  = "10.00";
   else
      strSHIPPING  = "10.00";
 
   if ( thisForm.ADDITIONALINFO == null )
      strADDTLINFO = "";
   else
      strADDTLINFO = thisForm.ADDITIONALINFO[thisForm.ADDITIONALINFO.selectedIndex].value;

   //Is this product already in the cart?  If so, increment quantity instead of adding another.
   for ( i = 1; i <= iNumberOrdered; i++ ) {
      NewOrder = "Order." + i;
      database = "";
      database = GetCookie(NewOrder);
 
      Token0 = database.indexOf("|", 0);
      Token1 = database.indexOf("|", Token0+1);
      Token2 = database.indexOf("|", Token1+1);
      Token3 = database.indexOf("|", Token2+1);
      Token4 = database.indexOf("|", Token3+1);
 
      fields = new Array;
      fields[0] = database.substring( 0, Token0 );
      fields[1] = database.substring( Token0+1, Token1 );
      fields[2] = database.substring( Token1+1, Token2 );
      fields[3] = database.substring( Token2+1, Token3 );
      fields[4] = database.substring( Token3+1, Token4 );
      fields[5] = database.substring( Token4+1, database.length );
 
//      if ( fields[0] == strID_NUM &&
//           fields[2] == strPRICE  &&
//           fields[3] == strNAME   &&
//           fields[5] == strADDTLINFO
//         ) {
if (fields[0] == strID_NUM) {
         bAlreadyInCart = true;
         dbUpdatedOrder = strID_NUM    + "|" +
                          (parseInt(strQUANTITY)+parseInt(fields[1]))  + "|" +
                          strPRICE     + "|" +
                          strNAME      + "|" +
                          strSHIPPING  + "|" +
                          strADDTLINFO;
         strNewOrder = "Order." + i;
         DeleteCookie(strNewOrder, "/");
         SetCookie(strNewOrder, dbUpdatedOrder, null, "/");
         notice = strQUANTITY + " " + strNAME + strAdded;
         break;
      }
   }


   if( !bAlreadyInCart ) {
      iNumberOrdered++;

      if ( iNumberOrdered > 60 )
         alert( strSorry );
      else {
         dbUpdatedOrder = strID_NUM    + "|" + 
                          strQUANTITY  + "|" +
                          strPRICE     + "|" +
                          strNAME      + "|" +
                          strSHIPPING  + "|" +
                          strADDTLINFO;

         strNewOrder = "Order." + iNumberOrdered;
         SetCookie(strNewOrder, dbUpdatedOrder, null, "/");
         SetCookie("NumberOrdered", iNumberOrdered, null, "/");
         notice = strQUANTITY + " " + strNAME + strAdded;
      }
   }

   if( DisplayNotice )
      alert(notice);
}


//---------------------------------------------------------------------||
// FUNCTION:    getCookieVal                                           ||
// PARAMETERS:  offset                                                 ||
// RETURNS:     URL unescaped Cookie Value                             ||
// PURPOSE:     Get a specific value from a cookie                     ||
//---------------------------------------------------------------------||
function getCookieVal (offset) {
   var endstr = document.cookie.indexOf (";", offset);

   if ( endstr == -1 )
      endstr = document.cookie.length;
   return(unescape(document.cookie.substring(offset, endstr)));
}


//---------------------------------------------------------------------||
// FUNCTION:    FixCookieDate                                          ||
// PARAMETERS:  date                                                   ||
// RETURNS:     date                                                   ||
// PURPOSE:     Fixes cookie date, stores back in date                 ||
//---------------------------------------------------------------------||
function FixCookieDate (date) {
   var base = new Date(0);
   var skew = base.getTime();

   date.setTime (date.getTime() - skew);
}


//---------------------------------------------------------------------||
// FUNCTION:    GetCookie                                              ||
// PARAMETERS:  Name                                                   ||
// RETURNS:     Value in Cookie                                        ||
// PURPOSE:     Retrieves cookie from users browser                    ||
//---------------------------------------------------------------------||
function GetCookie (name) {
   var arg = name + "=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;

   while ( i < clen ) {
      var j = i + alen;
      if ( document.cookie.substring(i, j) == arg ) return(getCookieVal (j));
      i = document.cookie.indexOf(" ", i) + 1;
      if ( i == 0 ) break;
   }

   return(null);
}


//---------------------------------------------------------------------||
// FUNCTION:    SetCookie                                              ||
// PARAMETERS:  name, value, expiration date, path, domain, security   ||
// RETURNS:     Null                                                   ||
// PURPOSE:     Stores a cookie in the users browser                   ||
//---------------------------------------------------------------------||
function SetCookie (name,value,expires,path,domain,secure) {
   document.cookie = name + "=" + escape (value) +
                     ((expires) ? "; expires=" + expires.toGMTString() : "") +
                     ((path) ? "; path=" + path : "") +
                     ((domain) ? "; domain=" + domain : "") +
                     ((secure) ? "; secure" : "");
}


//---------------------------------------------------------------------||
// FUNCTION:    DeleteCookie                                           ||
// PARAMETERS:  Cookie name, path, domain                              ||
// RETURNS:     null                                                   ||
// PURPOSE:     Removes a cookie from users browser.                   ||
//---------------------------------------------------------------------||
function DeleteCookie (name,path,domain) {
   if ( GetCookie(name) ) {
      document.cookie = name + "=" +
                        ((path) ? "; path=" + path : "") +
                        ((domain) ? "; domain=" + domain : "") +
                        "; expires=Thu, 01-Jan-70 00:00:01 GMT";
   }
}


//---------------------------------------------------------------------||
// FUNCTION:    MoneyFormat                                            ||
// PARAMETERS:  Number to be formatted                                 ||
// RETURNS:     Formatted Number                                       ||
// PURPOSE:     Reformats Dollar Amount to #.## format                 ||
//---------------------------------------------------------------------||
function moneyFormat(input) {
   var dollars = Math.floor(input);
   var tmp = new String(input);

   for ( var decimalAt = 0; decimalAt < tmp.length; decimalAt++ ) {
      if ( tmp.charAt(decimalAt)=="." )
         break;
   }

   var cents  = "" + Math.round(input * 100);
   cents = cents.substring(cents.length-2, cents.length)
           dollars += ((tmp.charAt(decimalAt+2)=="9")&&(cents=="00"))? 1 : 0;

   if ( cents == "0" )
      cents = "00";

   return(dollars + "." + cents);
}


//---------------------------------------------------------------------||
// FUNCTION:    RemoveFromCart                                         ||
// PARAMETERS:  Order Number to Remove                                 ||
// RETURNS:     Null                                                   ||
// PURPOSE:     Removes an item from a users shopping cart             ||
//---------------------------------------------------------------------||
function RemoveFromCart(RemOrder) {
   if ( confirm( strRemove ) ) {
      NumberOrdered = GetCookie("NumberOrdered");
      for ( i=RemOrder; i < NumberOrdered; i++ ) {
         NewOrder1 = "Order." + (i+1);
         NewOrder2 = "Order." + (i);
         database = GetCookie(NewOrder1);
         SetCookie (NewOrder2, database, null, "/");
      }
      NewOrder = "Order." + NumberOrdered;
      SetCookie ("NumberOrdered", NumberOrdered-1, null, "/");
      DeleteCookie(NewOrder, "/");
      location.href=location.href;
   }
}

function BackPressed(RemOrder) {
   if ( confirm( strback ) ) {
      NumberOrdered = GetCookie("NumberOrdered");
      for ( i=RemOrder; i < NumberOrdered; i++ ) {
         NewOrder1 = "Order." + (i+1);
         NewOrder2 = "Order." + (i);
         database = GetCookie(NewOrder1);
         SetCookie (NewOrder2, database, null, "/");
      }
      NewOrder = "Order." + NumberOrdered;
      SetCookie ("NumberOrdered", NumberOrdered-1, null, "/");
      DeleteCookie(NewOrder, "/");
//      location.href=location.href;
   }
}

//---------------------------------------------------------------------||
// FUNCTION:    ChangeQuantity                                         ||
// PARAMETERS:  Order Number to Change Quantity                        ||
// RETURNS:     Null                                                   ||
// PURPOSE:     Changes quantity of an item in the shopping cart       ||
//---------------------------------------------------------------------||
function ChangeQuantity(QtyOrder,CurrQty) {
   var newQty;

//   newQty=prompt(strNewQty,CurrQty);
newQty=CurrQty
//   if( isNaN(newQty) ) {
//      alert( strErrQty );
//   } else {
      NewOrder = "Order." + QtyOrder;
      database = "";
      database = GetCookie(NewOrder);
 
      Token0 = database.indexOf("|", 0);
      Token1 = database.indexOf("|", Token0+1);
      Token2 = database.indexOf("|", Token1+1);
      Token3 = database.indexOf("|", Token2+1);
      Token4 = database.indexOf("|", Token3+1);
 
      fields = new Array;
      fields[0] = database.substring( 0, Token0 );
      fields[1] = database.substring( Token0+1, Token1 );
      fields[2] = database.substring( Token1+1, Token2 );
      fields[3] = database.substring( Token2+1, Token3 );
      fields[4] = database.substring( Token3+1, Token4 );
      fields[5] = database.substring( Token4+1, database.length );
 
      dbUpdatedOrder = fields[0] + "|" +
                       newQty    + "|" +
                       fields[2] + "|" +
                       fields[3] + "|" +
                       fields[4] + "|" +
                       fields[5];
      strNewOrder = "Order." + QtyOrder;
      DeleteCookie(strNewOrder, "/");
      SetCookie(strNewOrder, dbUpdatedOrder, null, "/");

 //     return true;
  // }

//   return false;
}


//---------------------------------------------------------------------||
// FUNCTION:    GetFromCart                                            ||
// PARAMETERS:  Null                                                   ||
// RETURNS:     Product Table Written to Document                      ||
// PURPOSE:     Draws current cart product table on HTML page          ||
//---------------------------------------------------------------------||
function GetFromCart( fShipping ) {
   if( fShipping )
      WriteToForm( true, fShipping );
   else
      WriteToForm( true, 0 );
}


//---------------------------------------------------------------------||
// FUNCTION:    WriteToForm                                            ||
// PARAMETERS:  Null                                                   ||
// RETURNS:     Product hidden fields Written to Document              ||
// PURPOSE:     Draws current cart product hidden fields on HTML form  ||
//              if bDisplay == true, shows cart output as HTML table   ||
//---------------------------------------------------------------------||
function WriteToForm( bDisplay, fShipping ) {
   var iNumberOrdered = 0;
   var fTotal         = 0;
   var fTax           = 0;
   var order="";
   var strTotal       = "";
   var strTax         = "";
   var strShipping    = "";
   var strOutput      = "";
   iNumberOrdered = GetCookie("NumberOrdered");

   if( iNumberOrdered == null ) 
    iNumberOrdered = 0;
if (iNumberOrdered != 0) {
   if ( bDisplay )
      strOutput = "<TABLE CLASS=\"nopcart\" width='100%'><TR>" +
                  "<TD colspan='2' style='font-size=10pt; font-family=Trebuchet MS;'>"+strILabel+"</TD>" +
                  "<TD style='font-size=10pt; font-family=Trebuchet MS;'>"+strDLabel+"</TD>" +
                  "<TD style='font-size=10pt; font-family=Trebuchet MS;'>"+strQLabel+"</TD>" +
                  "<TD align='right' style='font-size=10pt; font-family=Trebuchet MS;'>"+strPLabel+"</TD>" +
  //                (DisplayShippingColumn?"<TD CLASS=\"nopheader\"><B>"+strSLabel+"</B></TD>":"") +
                  "<TD align='right' style='font-size=10pt; font-family=Trebuchet MS;'>"+strRLabel+"</TD></TR>"+
                  "<tr><td colspan='6'><hr><td></tr>";

   for ( i = 1; i <= iNumberOrdered; i++ ) {
      NewOrder = "Order." + i;
      database = "";
      database = GetCookie(NewOrder);

      Token0 = database.indexOf("|", 0);
      Token1 = database.indexOf("|", Token0+1);
      Token2 = database.indexOf("|", Token1+1);
      Token3 = database.indexOf("|", Token2+1);
      Token4 = database.indexOf("|", Token3+1);

      fields = new Array;
      fields[0] = database.substring( 0, Token0 );
      fields[1] = database.substring( Token0+1, Token1 );
      fields[2] = database.substring( Token1+1, Token2 );
      fields[3] = database.substring( Token2+1, Token3 );
      fields[4] = database.substring( Token3+1, Token4 );
      fields[5] = database.substring( Token4+1, database.length );
      order=order+fields[1]+"x"+fields[3]+"("+fields[0]+" - £"+fields[2]+"ea.) / ";
      fTotal     += (parseInt(fields[1]) * parseFloat(fields[2]) );
      fShipping  = 12.00;
      fTax        = (fTotal * TaxRate);
      strTotal    = moneyFormat(fTotal);
gross=fTotal*1.15;
strgross=moneyFormat(gross);
netvalue=fTotal + 12.00;
vat=netvalue*0.15;
grandtotal=netvalue+vat;
nicegrandtotal=moneyFormat(grandtotal)

      strTax      = moneyFormat(fTax);
      strShipping = moneyFormat(fShipping);

      if ( bDisplay ) {
         strOutput += "<tr><TD colspan='2' style='font-size=8pt; font-family=Trebuchet MS; font-weight=normal;'>"  + fields[0] + "</TD>";
         if ( fields[5] == "" )
            strOutput += "<TD style='font-size=8pt; font-family=Trebuchet MS; font-weight=normal;'>"  + fields[3] + "</TD>";
         else
            strOutput += "<TD style='font-size=8pt; font-family=Trebuchet MS; font-weight=normal;'>"  + fields[3] + " - <I>"+ fields[5] + "</I></TD>";

         strOutput += "<TD style='font-family: Trebuchet MS; font-size: 8pt;'><INPUT TYPE=TEXT NAME=Q SIZE=2 VALUE=\"" + fields[1] + "\" onChange=\"ChangeQuantity("+i+", this.value);\"><a href='javascript:refresh();'><img src='cartupdate.gif' border=0></a></TD>";
         strOutput += "<TD align='right' style='font-size=8pt; font-family=Trebuchet MS; font-weight=normal;'>"+ MonetarySymbol + moneyFormat(fields[2]) + " ea.</TD>";

         if ( DisplayShippingColumn ) {
            if ( parseFloat(fields[4]) > 0 )
               strOutput += "<TD style='font-size=10pt; font-family=Trebuchet MS;'>"+ MonetarySymbol + moneyFormat(fields[4]) + "/ea</TD>";
            else
               strOutput += "<TD style='font-size=10pt; font-family=Trebuchet MS;'>N/A</TD>";
         }

         strOutput += "<TD align='right' style='font-size=10pt; font-family=Trebuchet MS;'><img src='cartremove.gif' border=0 onClick=\"RemoveFromCart("+i+")\"></TD></TR>";
      }
      if( AppendItemNumToOutput ) {
         strFooter = i;
      } else {
         strFooter = "";
      }
      strOutput += "<input type=hidden name=\"" + OutputItemId        + strFooter + "\" value=\"" + fields[0] + "\">";
      strOutput += "<input type=hidden name=\"" + OutputItemQuantity  + strFooter + "\" value=\"" + fields[1] + "\">";
      strOutput += "<input type=hidden name=\"" + OutputItemPrice     + strFooter + "\" value=\"" + fields[2] + "\">";
      strOutput += "<input type=hidden name=\"" + OutputItemName      + strFooter + "\" value=\"" + fields[3] + "\">";
  //    strOutput += "<input type=hidden name=\"" + OutputItemShipping  + strFooter + "\" value=\"" + fields[4] + "\">";
  //    strOutput += "<input type=hidden name=\"" + OutputItemAddtlInfo + strFooter + "\" value=\"" + fields[5] + "\">";

   }

   if ( bDisplay ) {
      strOutput += "<tr><td colspan='6'><hr><td></tr>";
if (strTotal=="") strTotal="0.00"
      strOutput += "<TR><TD style='font-size=10pt; font-family=Trebuchet MS;' COLSPAN=4>"+strSUB+"</TD>";
      strOutput += "<TD align='right' style='font-size=10pt; font-family=Trebuchet MS;'>" + MonetarySymbol + strTotal + "</TD><td></td>";
      strOutput += "</TR>";
      strOutput += "<tr><td colspan='6'><hr><td></tr>";

//      strOutput += "<TR><TD style='font-size=10pt; font-family=Trebuchet MS;' COLSPAN=4>TOTAL Including VAT at 17.5%</TD>";
//      strOutput += "<TD align='right' style='font-size=10pt; font-family=Trebuchet MS;'>" + MonetarySymbol + strgross + "</TD><td></td>";
//      strOutput += "</TR>";
//      strOutput += "<tr><td colspan='6'><hr><td></tr>";


         strOutput += "<TR><TD style='font-size=10pt; font-family=Trebuchet MS;' COLSPAN=4>"+strSHIP+"</TD>";
         strOutput += "<TD align='right' style='font-size=10pt; font-family=Trebuchet MS;'>" + MonetarySymbol + "12.00" + "</TD>";
         strOutput += "</TR>";
         strOutput += "<TR><TD style='font-size=10pt; font-family=Trebuchet MS;' COLSPAN=4>VAT @ 15%</TD>";
         strOutput += "<TD align='right' style='font-size=10pt; font-family=Trebuchet MS;'>" + MonetarySymbol + moneyFormat(vat) + "</B></TD>";
         strOutput += "</TR>";
         strOutput += "<TR><TD style='font-size=10pt; font-family=Trebuchet MS;' COLSPAN=4>Total including VAT</TD>";
         strOutput += "<TD align='right' style='font-size=10pt; font-family=Trebuchet MS;'>" + MonetarySymbol + nicegrandtotal + "</B></TD>";
         strOutput += "</TR>";



      strOutput += "</TABLE>";

//      strOutput += "<input type=hidden name=\""+OutputOrderSubtotal+"\" value=\""+ MonetarySymbol + strTotal + "\">";
//      strOutput += "<input type=hidden name=\""+OutputOrderShipping+"\" value=\""+ MonetarySymbol + strShipping + "\">";
//      strOutput += "<input type=hidden name=\""+OutputOrderTax+"\"      value=\""+ MonetarySymbol + strTax + "\">";
      strOutput += "<input type=hidden name=\""+OutputOrderTotal+"\"    value=\""+ MonetarySymbol + moneyFormat((fTotal + fShipping + fTax)) + "\">";
order=order.substring(0,order.length-3);
//if (fTotal>350) strOutput +="<font size='2' face='Arial, Helvetica, sans-serif'><input type='checkbox' name='checkbox' value='checkbox' onClick='addcoolbag();'>Please include my free USB Pen with this order</font>"

      strOutput += "<input type=hidden name='desc' value=\""+ order + "\">";
      strOutput += "<input type=hidden name='MC_order' value=\""+ order + "\">";
      strOutput += "<input type=hidden name='amount' value=\""+ nicegrandtotal+ "\">";
      strOutput += "<input type=hidden name='MC_costofitems' value=\""+ strTotal+ "\">";
      strOutput += "<input type=hidden name='MC_VAT' value=\""+ moneyFormat(vat)+ "\">";
      strOutput += "<input type=hidden name='nettotal' value=\""+ moneyFormat(fTotal)+ "\">";

   }

   document.write(strOutput);
//	  if (strTotal=="0.00") 

   document.close();
}
if (iNumberOrdered==0) document.write("<br>You have nothing in your shopping basket at moment.  To add items to your basket:<br>For HP, Canon, Epson and other printers, use the 'Printers' link<br>For Media and Supplies for your printer, use the 'Media & Supplies' link<br>For drawing equipment and furniture, use the 'Design Equipment' link");
}
//cpp cart
//=====================================================================||
//               END NOP Design SmartPost Shopping Cart                ||
//=====================================================================||

document.write("");
