//=====================================================================||
//               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.4.0                                     ||
//=====================================================================||

//---------------------------------------------------------------------||
//                       Global Options                                ||
//                      ----------------                               ||
// Shopping Cart Options, you can modify these options to change the   ||
// the way the cart functions.                                         ||
//                                                                     ||
// Language Packs                                                      ||
// ==============                                                      ||
// You may include any language pack before nopcart.js in your HTML    ||
// pages to change the language.  Simply include a language pack with  ||
// a script src BEFORE the <SCRIPT SRC="nopcart.js">... line.          ||
//  For example: <SCRIPT SRC="language-en.js"></SCRIPT>                ||
//                                                                     ||
// Options For Everyone:                                               ||
// =====================                                               ||
// * MonetarySymbol: string, the symbol which represents dollars/euro, ||
//   in your locale.                                                   ||
// * 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                      ||
// * TaxByRegion: true/false, when set to true, the user is prompted   ||
//   with TaxablePrompt to determine if they should be charged tax.    ||
//   In the USA, this is useful to charge tax to those people who live ||
//   in a particular state, but no one else.                           ||
// * TaxPrompt: string, popup message if user has not selected either  ||
//   taxable or nontaxable when TaxByRegion is set to true.            ||
// * TaxablePrompt: string, the message the user is prompted with to   ||
//   select if they are taxable.  If TaxByRegion is set to false, this ||
//   has no effect. Example: 'Arizona Residents'                       ||
// * NonTaxablePrompt: string, same as above, but the choice for non-  ||
//   taxable people.  Example: 'Other States'                          ||
// * MinimumOrder: number, the minium dollar amount that must be       ||
//   purchased before a user is allowed to checkout.  Set to 0.00      ||
//   to disable.                                                       ||
// * MinimumOrderPrompt: string, Message to prompt users with when     ||
//   they have not met the minimum order amount.                       ||
//                                                                     ||
// Payment Processor Options:                                          ||
// ==========================                                          ||
// * PaymentProcessor: string, the two digit payment processor code    ||
//   for support payment processor gateways.  Setting this field to    ||
//   anything other than an empty string will override your OutputItem ||
//   settings -- so please be careful when receiving any form data.    ||
//   Support payment processor gateways are:                           ||
//    * Authorize.net (an)                                             ||
//    * Worldpay      (wp)                                             ||
//    * LinkPoint     (lp)                                             ||
//                                                                     ||
// 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.       ||
// * HiddenFieldsToCheckout: true/false, if set to true, hidden fields ||
//   for the cart items will be passed TO the checkout page, from the  ||
//   ManageCart page.  This is set to true for CGI/PHP/Script based    ||
//   checkout pages, but should be left false if you are using an      ||
//   HTML/Javascript Checkout Page. Hidden fields will ALWAYS be       ||
//   passed FROM the checkout page to the Checkout CGI/PHP/ASP/Script  ||
//---------------------------------------------------------------------||

//Options for Everyone:
MonetarySymbol        = '$';
DisplayNotice         = true;
DisplayShippingColumn = true;
DisplayShippingRow    = true;
DisplayTaxRow         = true;
TaxRate               = 0.0875;
TaxByRegion           = true;
TaxPrompt             = 'For tax purposes, please select if you are a California resident before continuing';
TaxablePrompt         = 'California Residents';
NonTaxablePrompt      = 'Not in California';
MinimumOrder          = 0.00;
MinimumOrderPrompt    = 'Your order is below our minimum order, please order more before checking out.';
CountryPrompt         = 'Please specify the country to which your order will be shipped. If you have already specified a country and changed the sales tax status, you must reselect the country.';

//Payment Processor Options:
PaymentProcessor      = '';

//Options for Programmers:
OutputItemId           = 'ID_';
OutputItemQuantity     = 'QUANTITY_';
OutputItemPrice        = 'PRICE_';
OutputItemName         = 'NAME_';
OutputItemShipping     = 'SHIPPING_';
OutputItemAddtlInfo    = 'ADDTLINFO_';
OutputOrderSubtotal    = 'SUBTOTAL';
OutputOrderShipping    = 'SHIPPING';
OutputOrderTax         = 'TAX';
OutputOrderTotal       = 'TOTAL';
OutputOrderCountry     = 'COUNTRY';
AppendItemNumToOutput  = true;
HiddenFieldsToCheckout = false;

//=====================================================================||
//---------------------------------------------------------------------||
//    YOU DO NOT NEED TO MAKE ANY MODIFICATIONS BELOW THIS LINE        ||
//---------------------------------------------------------------------||
//=====================================================================||


//---------------------------------------------------------------------||
//                      Language Strings                               ||
//                     ------------------                              ||
// These strings will not be used unless you have not included a       ||
// language pack already.  You should NOT modify these, but instead    ||
// modify the strings in language-**.js where ** is the language pack  ||
// you are using.                                                      ||
//---------------------------------------------------------------------||
if ( !bLanguageDefined ) {
   strSorry  = "I'm Sorry, your cart contains 20 items and that is as many as it can hold. Please proceed to checkout. If there are other items you wish to buy, continue with another order after checking out. We will combine shipping costs to minimize the amount you spend.";
   strAdded  = " added to your shopping cart.";
   strRemove = "Click 'Ok' to remove this product from your shopping cart.";
   strILabel = "Product Id";
   strDLabel = "Product Name/Description";
   strQLabel = "Quantity";
   strPLabel = "Price";
   strSLabel = "Shipping";
   strRLabel = "Remove From Cart";
   strRButton= "Remove";
   strSUB    = "SUBTOTAL";
   strSHIP   = "SHIPPING";
   strTAX    = "TAX";
   strTOT    = "TOTAL";
   strErrQty = "Invalid Quantity.";
   strNewQty = 'Please enter new quantity:';
   bLanguageDefined = true;
}
   strCountry= "COUNTRY";

//---------------------------------------------------------------------||
// 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  = "0.00";
   else
      strSHIPPING  = thisForm.SHIPPING.value;

   if ( thisForm.ADDITIONALINFO == null ) {
      strADDTLINFO = "";
   } else {
      strADDTLINFO = thisForm.ADDITIONALINFO[thisForm.ADDITIONALINFO.selectedIndex].value;
   }
   if ( thisForm.ADDITIONALINFO2 != null ) {
      strADDTLINFO += "; " + thisForm.ADDITIONALINFO2[thisForm.ADDITIONALINFO2.selectedIndex].value;
   }
   if ( thisForm.ADDITIONALINFO3 != null ) {
      strADDTLINFO += "; " + thisForm.ADDITIONALINFO3[thisForm.ADDITIONALINFO3.selectedIndex].value;
   }
   if ( thisForm.ADDITIONALINFO4 != null ) {
      strADDTLINFO += "; " + thisForm.ADDITIONALINFO4[thisForm.ADDITIONALINFO4.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
         ) {
         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 > 20 )
         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:    ChangeQuantity                                         ||
// PARAMETERS:  Order Number to Change Quantity                        ||
// RETURNS:     Null                                                   ||
// PURPOSE:     Changes quantity of an item in the shopping cart       ||
//---------------------------------------------------------------------||
function ChangeQuantity(OrderItem,NewQuantity) {
   if ( isNaN(NewQuantity) ) {
      alert( strErrQty );
   } else {
      NewOrder = "Order." + OrderItem;
      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] + "|" +
                       NewQuantity + "|" +
                       fields[2] + "|" +
                       fields[3] + "|" +
                       fields[4] + "|" +
                       fields[5];
      strNewOrder = "Order." + OrderItem;
      DeleteCookie(strNewOrder, "/");
      SetCookie(strNewOrder, dbUpdatedOrder, null, "/");
      location.href=location.href;  
   }
}


//---------------------------------------------------------------------||
// FUNCTION:    GetFromCart                                            ||
// PARAMETERS:  Null                                                   ||
// RETURNS:     Product Table Written to Document                      ||
// PURPOSE:     Draws current cart product table on HTML page          ||
//              **DEPRECATED FUNCTION, USE ManageCart or Checkout**    ||
//---------------------------------------------------------------------||
function GetFromCart( fShipping ) {
   ManageCart( );
}


//---------------------------------------------------------------------||
// FUNCTION:    RadioChecked                                           ||
// PARAMETERS:  Radio button to check                                  ||
// RETURNS:     True if a radio has been checked                       ||
// PURPOSE:     Form fillin validation                                 ||
//---------------------------------------------------------------------||
function RadioChecked( radiobutton ) {
   var bChecked = false;
   var rlen = radiobutton.length;
   for ( i=0; i < rlen; i++ ) {
      if ( radiobutton[i].checked )
         bChecked = true;
   }    
   return bChecked;
} 


//---------------------------------------------------------------------||
// FUNCTION:    QueryString                                            ||
// PARAMETERS:  Key to read                                            ||
// RETURNS:     value of key                                           ||
// PURPOSE:     Read data passed in via GET mode                       ||
//---------------------------------------------------------------------||
QueryString.keys = new Array();
QueryString.values = new Array();
function QueryString(key) {
   var value = null;
   for (var i=0;i<QueryString.keys.length;i++) {
      if (QueryString.keys[i]==key) {
         value = QueryString.values[i];
         break;
      }
   }
   return value;
} 

//---------------------------------------------------------------------||
// FUNCTION:    QueryString_Parse                                      ||
// PARAMETERS:  (URL string)                                           ||
// RETURNS:     null                                                   ||
// PURPOSE:     Parses query string data, must be called before Q.S.   ||
//---------------------------------------------------------------------||
function QueryString_Parse() {
   var query = window.location.search.substring(1);
   var pairs = query.split("&"); for (var i=0;i<pairs.length;i++) {
      var pos = pairs[i].indexOf('=');
      if (pos >= 0) {
         var argname = pairs[i].substring(0,pos);
         var value = pairs[i].substring(pos+1);
         QueryString.keys[QueryString.keys.length] = argname;
         QueryString.values[QueryString.values.length] = value;
      }
   }
}


//---------------------------------------------------------------------||
// FUNCTION:    ManageCart                                             ||
// PARAMETERS:  Null                                                   ||
// RETURNS:     Product Table Written to Document                      ||
// PURPOSE:     Draws current cart product table on HTML page          ||
//---------------------------------------------------------------------||
function ManageCart( ) {
   var iNumberOrdered = 0;    //Number of products ordered
   var fTotal         = 0;    //Total cost of order
   var fTax           = 0;    //Tax amount
   var fShipping      = 0;    //Shipping amount
   var strTotal       = "";   //Total cost formatted as money
   var strTax         = "";   //Total tax formatted as money
   var strShipping    = "";   //Total shipping formatted as money
   var strOutput      = "";   //String to be written to page
   var bDisplay       = true; //Whether to write string to the page (here for programmers)

   iNumberOrdered = GetCookie("NumberOrdered");
   if ( iNumberOrdered == null )
      iNumberOrdered = 0;

   if ( bDisplay )
      strOutput = "<TABLE CLASS=\"nopcart\"><TR>" +
                  "<TD CLASS=\"nopheader\"><B>"+strILabel+"</B></TD>" +
                  "<TD CLASS=\"nopheader\"><B>"+strDLabel+"</B></TD>" +
                  "<TD CLASS=\"nopheader\"><B>"+strQLabel+"</B></TD>" +
                  "<TD CLASS=\"nopheader\"><B>"+strPLabel+"</B></TD>" +
                  (DisplayShippingColumn?"<TD CLASS=\"nopheader\"><B>"+strSLabel+"</B></TD>":"") +
                  "<TD CLASS=\"nopheader\"><B>"+strRLabel+"</B></TD></TR>";

   if ( iNumberOrdered == 0 ) {
      strOutput += "<TR><TD COLSPAN=6 CLASS=\"nopentry\"><CENTER><BR><B>Your cart is empty</B><BR><BR></CENTER></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 );                 // Product ID
      fields[1] = database.substring( Token0+1, Token1 );          // Quantity
      fields[2] = database.substring( Token1+1, Token2 );          // Price
      fields[3] = database.substring( Token2+1, Token3 );          // Product Name/Description
      fields[4] = database.substring( Token3+1, Token4 );          // Shipping Cost
      fields[5] = database.substring( Token4+1, database.length ); //Additional Information

      fTotal     += (parseInt(fields[1]) * parseFloat(fields[2]) );
      fShipping  += (parseInt(fields[1]) * parseFloat(fields[4]) );
      fTax        = (fTotal * TaxRate);
      strTotal    = moneyFormat(fTotal);
      strTax      = moneyFormat(fTax);
      strShipping = moneyFormat(fShipping);

      if ( bDisplay ) {
         strOutput += "<TR><TD CLASS=\"nopentry\">"  + fields[0] + "</TD>";

         if ( fields[5] == "" )
            strOutput += "<TD CLASS=\"nopentry\">"  + fields[3] + "</TD>";
         else
            strOutput += "<TD CLASS=\"nopentry\">"  + fields[3] + " - <I>"+ fields[5] + "</I></TD>";

         strOutput += "<TD CLASS=\"nopentry\"><INPUT TYPE=TEXT NAME=Q SIZE=2 VALUE=\"" + fields[1] + "\" onChange=\"ChangeQuantity("+i+", this.value);\"></TD>";
         strOutput += "<TD CLASS=\"nopentry\">"+ MonetarySymbol + moneyFormat(fields[2]) + "/each</TD>";

         if ( DisplayShippingColumn ) {
            if ( parseFloat(fields[4]) > 0 )
//               strOutput += "<TD CLASS=\"nopentry\">"+ MonetarySymbol + moneyFormat(fields[4]) + "/each</TD>";
               strOutput += "<TD CLASS=\"nopentry\">"+ moneyFormat(fields[4]) + " lbs/each</TD>";
            else
               strOutput += "<TD CLASS=\"nopentry\">N/A</TD>";
         }

         strOutput += "<TD CLASS=\"nopentry\" ALIGN=CENTER><input type=button value=\" "+strRButton+" \" onClick=\"RemoveFromCart("+i+")\" class=\"nopbutton\"></TD></TR>";
      }

      if ( AppendItemNumToOutput ) {
         strFooter = i;
      } else {
         strFooter = "";
      }
      if ( HiddenFieldsToCheckout ) {
         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 CLASS=\"noptotal\" COLSPAN=3><B>"+strSUB+"</B></TD>";
      strOutput += "<TD CLASS=\"noptotal\" COLSPAN=1><B>" + MonetarySymbol + strTotal + "</B></TD><TD></TD>";
      strOutput += "</TR>";

      if ( DisplayShippingRow ) {
//         strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=4><B>"+strSHIP+"</B></TD>";
         strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=4><B>SHIPPING WEIGHT</B></TD>";
         strOutput += "<TD CLASS=\"noptotal\" COLSPAN=2><B>" + strShipping + " lbs</B></TD>";
         strOutput += "</TR>";
      }

         strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=6 HEIGHT=30></TD></TR>";
         strOutput += "<TR><TD CLASS=\"nopheader\" COLSPAN=6><B>Please provide the following information when you are ready to check out...</B></TD></TR>";

      if ( DisplayTaxRow || TaxByRegion ) {
         if ( TaxByRegion ) {
            strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=4 align=center>" +
                "<SELECT NAME=\""+OutputOrderCountry+"\" onblur=\"setCflag()\">" +
                "<Option Value=\"\" SELECTED>Please Select Country" +
                "<Option Value=\"1\">United States" +
                "<Option Value=\"501\">Afghanistan" +
                "<Option Value=\"401\">Albania" +
                "<Option Value=\"402\">Algeria" +
                "<Option Value=\"701\">American Samoa" +
                "<Option Value=\"201\">Andorra" +
                "<Option Value=\"403\">Angola" +
                "<Option Value=\"101\">Anguilla" +
                "<Option Value=\"102\">Antigua & Barbuda" +
                "<Option Value=\"502\">Argentina" +
                "<Option Value=\"503\">Armenia" +
                "<Option Value=\"202\">Aruba" +
                "<Option Value=\"404\">Australia" +
                "<Option Value=\"405\">Austria" +
                "<Option Value=\"103\">Azerbaijan" +
                "<Option Value=\"406\">Azores" +
                "<Option Value=\"104\">Bahamas" +
                "<Option Value=\"301\">Bahrain" +
                "<Option Value=\"203\">Bangladesh" +
                "<Option Value=\"105\">Barbados" +
                "<Option Value=\"302\">Belarus" +
                "<Option Value=\"407\">Belgium" +
                "<Option Value=\"106\">Belize" +
                "<Option Value=\"107\">Benin" +
                "<Option Value=\"303\">Bermuda" +
                "<Option Value=\"408\">Bhutan" +
                "<Option Value=\"304\">Bolivia" +
                "<Option Value=\"108\">Bosnia & Herzegovina" +
                "<Option Value=\"409\">Botswana" +
                "<Option Value=\"504\">Brazil" +
                "<Option Value=\"109\">British Virgin Islands" +
                "<Option Value=\"110\">Brunei Darussalam" +
                "<Option Value=\"410\">Bulgaria" +
                "<Option Value=\"411\">Burkina Faso" +
                "<Option Value=\"204\">Burma (Myanmar)" +
                "<Option Value=\"205\">Burundi" +
                "<Option Value=\"206\">Cambodia" +
                "<Option Value=\"412\">Cameroon" +
                "<Option Value=\"2\">Canada" +
                "<Option Value=\"413\">Cape Verde" +
                "<Option Value=\"111\">Cayman Islands" +
                "<Option Value=\"505\">Central African Republic" +
                "<Option Value=\"414\">Chad" +
                "<Option Value=\"305\">Chile" +
                "<Option Value=\"469\">China" +
                "<Option Value=\"415\">Christmas Island (Australia)" +
                "<Option Value=\"112\">Christmas Island (Kiribati)" +
                "<Option Value=\"416\">Cocos (Keeling) Islands" +
                "<Option Value=\"207\">Columbia" +
                "<Option Value=\"208\">Comoros" +
                "<Option Value=\"506\">Congo, Republic of the" +
                "<Option Value=\"417\">Cook Islands" +
                "<Option Value=\"418\">Corsica" +
                "<Option Value=\"113\">Costa Rica" +
                "<Option Value=\"306\">Cote D'Ivoire" +
                "<Option Value=\"307\">Croatia (Hrvatska)" +
                "<Option Value=\"308\">Cyprus" +
                "<Option Value=\"309\">Czech Republic" +
                "<Option Value=\"310\">Denmark" +
                "<Option Value=\"419\">Djibouti" +
                "<Option Value=\"114\">Dominica" +
                "<Option Value=\"115\">Dominican Republic" +
                "<Option Value=\"420\">East Timor" +
                "<Option Value=\"209\">Ecuador" +
                "<Option Value=\"421\">Egypt" +
                "<Option Value=\"116\">El Salvador" +
                "<Option Value=\"210\">Equatorial Guinea" +
                "<Option Value=\"422\">Eritrea" +
                "<Option Value=\"423\">Estonia" +
                "<Option Value=\"211\">Ethiopia" +
                "<Option Value=\"601\">Falkland Islands (Malvinas)" +
                "<Option Value=\"311\">Faroe Islands" +
                "<Option Value=\"117\">Fiji" +
                "<Option Value=\"118\">Finland" +
                "<Option Value=\"424\">France" +
                "<Option Value=\"507\">French Guiana" +
                "<Option Value=\"508\">French Polynesia" +
                "<Option Value=\"425\">Gabon" +
                "<Option Value=\"119\">Gambia" +
                "<Option Value=\"509\">Georgia" +
                "<Option Value=\"120\">Germany" +
                "<Option Value=\"426\">Ghana" +
                "<Option Value=\"212\">Gibraltar" +
                "<Option Value=\"427\">Great Britain & Northern Ireland" +
                "<Option Value=\"121\">Greece" +
                "<Option Value=\"312\">Greenland" +
                "<Option Value=\"122\">Grenada" +
                "<Option Value=\"510\">Guadeloupe" +
                "<Option Value=\"702\">Guam" +
                "<Option Value=\"123\">Guatemala" +
                "<Option Value=\"124\">Guinea" +
                "<Option Value=\"125\">Guinea-Bissau" +
                "<Option Value=\"126\">Guyana" +
                "<Option Value=\"127\">Haiti" +
                "<Option Value=\"128\">Honduras" +
                "<Option Value=\"428\">Hong Kong" +
                "<Option Value=\"313\">Hungary" +
                "<Option Value=\"129\">Iceland" +
                "<Option Value=\"429\">India" +
                "<Option Value=\"430\">Indonesia" +
                "<Option Value=\"130\">Ireland" +
                "<Option Value=\"244\">Iraq" +
                "<Option Value=\"431\">Israel" +
                "<Option Value=\"131\">Italy" +
                "<Option Value=\"132\">Jamaica" +
                "<Option Value=\"432\">Japan" +
                "<Option Value=\"213\">Jordan" +
                "<Option Value=\"214\">Kazakhstan" +
                "<Option Value=\"433\">Kenya" +
                "<Option Value=\"133\">Kiribati" +
                "<Option Value=\"215\">Korea, Republic of (South)" +
                "<Option Value=\"434\">Kuwait" +
                "<Option Value=\"314\">Kyrgyzstan" +
                "<Option Value=\"216\">Latvia" +
                "<Option Value=\"134\">Lebanon" +
                "<Option Value=\"435\">Lesotho" +
                "<Option Value=\"315\">Liechtenstein" +
                "<Option Value=\"436\">Lithuania" +
                "<Option Value=\"316\">Luxembourg" +
                "<Option Value=\"317\">Macedonia" +
                "<Option Value=\"511\">Madagascar" +
                "<Option Value=\"437\">Madeira" +
                "<Option Value=\"438\">Malawi" +
                "<Option Value=\"217\">Malaysia" +
                "<Option Value=\"512\">Maldives" +
                "<Option Value=\"439\">Mali" +
                "<Option Value=\"440\">Malta" +
                "<Option Value=\"703\">Marshall Islands" +
                "<Option Value=\"513\">Martinique" +
                "<Option Value=\"135\">Mauritania" +
                "<Option Value=\"218\">Mauritius" +
                "<Option Value=\"441\">Mayotte" +
                "<Option Value=\"3\">Mexico" +
                "<Option Value=\"704\">Micronesia, Federated States of" +
                "<Option Value=\"442\">Moldova" +
                "<Option Value=\"443\">Monaco" +
                "<Option Value=\"444\">Mongolia" +
                "<Option Value=\"136\">Montserrat" +
                "<Option Value=\"318\">Morocco" +
                "<Option Value=\"514\">Mozambique" +
                "<Option Value=\"219\">Myanmar" +
                "<Option Value=\"445\">Namibia" +
                "<Option Value=\"220\">Nauru" +
                "<Option Value=\"446\">Nepal" +
                "<Option Value=\"221\">Netherlands" +
                "<Option Value=\"222\">Netherlands Antilles" +
                "<Option Value=\"515\">New Caledonia" +
                "<Option Value=\"447\">New Zealand" +
                "<Option Value=\"137\">Nicaragua" +
                "<Option Value=\"319\">Niger" +
                "<Option Value=\"448\">Nigeria" +
                "<Option Value=\"449\">Niue" +
                "<Option Value=\"450\">Norfolk Island" +
                "<Option Value=\"705\">Northern Mariana Islands" +
                "<Option Value=\"451\">Norway" +
                "<Option Value=\"223\">Oman" +
                "<Option Value=\"452\">Pakistan" +
                "<Option Value=\"706\">Palau" +
                "<Option Value=\"138\">Panama" +
                "<Option Value=\"516\">Papua New Guinea" +
                "<Option Value=\"320\">Paraguay" +
                "<Option Value=\"321\">Peru" +
                "<Option Value=\"453\">Philippines" +
                "<Option Value=\"454\">Pitcairn Island" +
                "<Option Value=\"322\">Poland" +
                "<Option Value=\"455\">Portugal" +
                "<Option Value=\"707\">Puerto Rico" +
                "<Option Value=\"224\">Qatar" +
                "<Option Value=\"517\">Reunion" +
                "<Option Value=\"456\">Romania" +
                "<Option Value=\"518\">Russia" +
                "<Option Value=\"457\">Rwanda" +
                "<Option Value=\"225\">Saint Kitts & Nevis" +
                "<Option Value=\"139\">Saint Lucia" +
                "<Option Value=\"323\">Saint Vincent & The Grenadines" +
                "<Option Value=\"226\">Samoa, Western" +
                "<Option Value=\"140\">San Marino" +
                "<Option Value=\"227\">Sao Tome and Principe" +
                "<Option Value=\"228\">Saudi Arabia" +
                "<Option Value=\"458\">Senegal" +
                "<Option Value=\"229\">Serbia-Montenegro" +
                "<Option Value=\"324\">Seychelles" +
                "<Option Value=\"459\">Sierra Leone" +
                "<Option Value=\"460\">Singapore" +
                "<Option Value=\"230\">Slovakia (Slovak Republic)" +
                "<Option Value=\"325\">Slovenia" +
                "<Option Value=\"231\">Solomon Islands" +
                "<Option Value=\"461\">South Africa" +
                "<Option Value=\"602\">South Georgia & S. Sandwich I." +
                "<Option Value=\"232\">Spain" +
                "<Option Value=\"233\">Sri Lanka" +
                "<Option Value=\"326\">St. Helena" +
                "<Option Value=\"234\">St. Pierre and Miquelon" +
                "<Option Value=\"235\">Sudan" +
                "<Option Value=\"141\">Suriname" +
                "<Option Value=\"236\">Swaziland" +
                "<Option Value=\"519\">Sweden" +
                "<Option Value=\"327\">Switzerland" +
                "<Option Value=\"462\">Taiwan" +
                "<Option Value=\"328\">Tajikistan" +
                "<Option Value=\"329\">Tanzania" +
                "<Option Value=\"237\">Thailand" +
                "<Option Value=\"463\">Togo" +
                "<Option Value=\"238\">Tokelau" +
                "<Option Value=\"142\">Tonga" +
                "<Option Value=\"143\">Trinidad and Tobago" +
                "<Option Value=\"239\">Tristan da Cunha" +
                "<Option Value=\"240\">Tunisia" +
                "<Option Value=\"241\">Turkey" +
                "<Option Value=\"464\">Turkmenistan" +
                "<Option Value=\"144\">Turks and Caicos Islands" +
                "<Option Value=\"145\">Tuvalu" +
                "<Option Value=\"465\">Uganda" +
                "<Option Value=\"466\">Ukraine" +
                "<Option Value=\"330\">United Arab Emirates" +
                "<Option Value=\"467\">United Kingdom" +
                "<Option Value=\"1\">United States" +
                "<Option Value=\"331\">Uruguay" +
                "<Option Value=\"520\">Uzbekistan" +
                "<Option Value=\"146\">Vanuatu" +
                "<Option Value=\"147\">Vatican City" +
                "<Option Value=\"148\">Venezuela" +
                "<Option Value=\"149\">Virgin Islands (British)" +
                "<Option Value=\"708\">Virgin Islands (U.S.)" +
                "<Option Value=\"521\">Wallis and Futuna Islands" +
                "<Option Value=\"242\">Western Sahara" +
                "<Option Value=\"243\">Western Samoa" +
                "<Option Value=\"332\">Yemen" +
                "<Option Value=\"468\">Zambia" +
                "<Option Value=\"522\">Zimbabwe" +
                "</SELECT>" +
                "</TD>";
            strOutput += "<TD CLASS=\"noptotal\" COLSPAN=2><B>"+strTAX+"";
            strOutput += "<BR><input type=radio name=\""+OutputOrderTax+"\" value=\"" + strTax + "\">";
            strOutput += TaxablePrompt + ": " + MonetarySymbol + strTax;
            strOutput += "<BR><input type=radio name=\""+OutputOrderTax+"\" value=\"0.00\">";
            strOutput += NonTaxablePrompt + ": " + MonetarySymbol + "0.00";
            strOutput += "</B></TD>";
            strOutput += "</TR>";
         } else {
            strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=4><B>"+strTAX+"</B></TD>";
            strOutput += "<TD CLASS=\"noptotal\" COLSPAN=2><B>" + MonetarySymbol + strTax + "</B></TD>";
            strOutput += "</TR>";
         }
      }

      if ( !TaxByRegion ) {
         strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=4><B>"+strTOT+"</B></TD>";
         strOutput += "<TD CLASS=\"noptotal\" COLSPAN=2><B>" + MonetarySymbol + moneyFormat((fTotal + fShipping + fTax)) + "</B></TD>";
         strOutput += "</TR>";
      }
      strOutput += "</TABLE>";

      if ( HiddenFieldsToCheckout ) {
         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)) + "\">";
      }
//   strOutput += "<input type=hidden name=\""+Country+ "\" value=\""+OutputOrderCountry+"\">";
   }
   g_TotalCost = (fTotal + fShipping + fTax);

   document.write(strOutput);
   document.close();
}

//---------------------------------------------------------------------||
// FUNCTION:    setCflag                                               ||
// PARAMETERS:  None                                                   ||
// RETURNS:     Cflag = true                                           ||
// PURPOSE:     Set flag indicating a country has been selected        ||
//---------------------------------------------------------------------||
function setCflag() {
   Cflag = true;
}

//---------------------------------------------------------------------||
// FUNCTION:    ValidateCart                                           ||
// PARAMETERS:  Form to validate                                       ||
// RETURNS:     true/false                                             ||
// PURPOSE:     Validates the managecart form                          ||
//---------------------------------------------------------------------||
var g_TotalCost = 0;
var Cflag       = false;
function ValidateCart( theForm ) {
   if ( TaxByRegion ) {
      if ( !RadioChecked(eval("theForm."+OutputOrderTax)) ) {
         alert( TaxPrompt );
         return false;
      }
   }

   if ( MinimumOrder >= 0.01 ) {
      if ( g_TotalCost < MinimumOrder ) {
         alert( MinimumOrderPrompt );
         return false;
      }
   }

   if ( !Cflag ) {
      alert( CountryPrompt );
      return false;
   }
   return true;
}


//---------------------------------------------------------------------||
// FUNCTION:    stateInput                                             ||
// PARAMETERS:  Null                                                   ||
// RETURNS:     Input State Line Written to Document                   ||
// PURPOSE:     Writes input-state line on HTML page for checkout.     ||
//---------------------------------------------------------------------||
function stateInput() {
   var strOutputState = "";   //String to be written to page
   if( strTax > 0 ) {
      strOutputState += "<TR><TD>State:</TD>";
      strOutputState += "<TD CLASS=\"bigblacktext\"><input type=hidden name=\"b_state\" value=\"CA\"><b>CA</b></TD></TR>";
   }
   else {
      if( CountrySave == "United States" ) {
          strOutputState += "<TR><TD><font color=red><b>State:</b></font></TD>";
          strOutputState += "<TD><SELECT NAME=\"b_state\">";
          strOutputState += "<Option Value=\"\" SELECTED>";
          strOutputState += "<Option Value=\"AL\">Alabama";
          strOutputState += "<Option Value=\"AK\">Alaska";
          strOutputState += "<Option Value=\"AZ\">Arizona";
          strOutputState += "<Option Value=\"AR\">Arkansas";
          strOutputState += "<Option Value=\"CO\">Colorado";
          strOutputState += "<Option Value=\"CT\">Connecticut";
          strOutputState += "<Option Value=\"DE\">Delaware";
          strOutputState += "<Option Value=\"DC\">District of Columbia";
          strOutputState += "<Option Value=\"FL\">Florida";
          strOutputState += "<Option Value=\"GA\">Georgia";
          strOutputState += "<Option Value=\"HI\">Hawaii";
          strOutputState += "<Option Value=\"ID\">Idaho";
          strOutputState += "<Option Value=\"IL\">Illinois";
          strOutputState += "<Option Value=\"IN\">Indiana";
          strOutputState += "<Option Value=\"IA\">Iowa";
          strOutputState += "<Option Value=\"KS\">Kansas";
          strOutputState += "<Option Value=\"KY\">Kentucky";
          strOutputState += "<Option Value=\"LA\">Louisiana";
          strOutputState += "<Option Value=\"ME\">Maine";
          strOutputState += "<Option Value=\"MD\">Maryland";
          strOutputState += "<Option Value=\"MA\">Massachusetts";
          strOutputState += "<Option Value=\"MI\">Michigan";
          strOutputState += "<Option Value=\"MN\">Minnesota";
          strOutputState += "<Option Value=\"MS\">Mississippi";
          strOutputState += "<Option Value=\"MO\">Missouri";
          strOutputState += "<Option Value=\"MT\">Montana";
          strOutputState += "<Option Value=\"NE\">Nebraska";
          strOutputState += "<Option Value=\"NV\">Nevada";
          strOutputState += "<Option Value=\"NH\">New Hampshire";
          strOutputState += "<Option Value=\"NJ\">New Jersey";
          strOutputState += "<Option Value=\"NM\">New Mexico";
          strOutputState += "<Option Value=\"NY\">New York";
          strOutputState += "<Option Value=\"NC\">North Carolina";
          strOutputState += "<Option Value=\"ND\">North Dakota";
          strOutputState += "<Option Value=\"OH\">Ohio";
          strOutputState += "<Option Value=\"OK\">Oklahoma";
          strOutputState += "<Option Value=\"OR\">Oregon";
          strOutputState += "<Option Value=\"PA\">Pennsylvania";
          strOutputState += "<Option Value=\"RI\">Rhode Island";
          strOutputState += "<Option Value=\"SC\">South Carolina";
          strOutputState += "<Option Value=\"SD\">South Dakota";
          strOutputState += "<Option Value=\"TN\">Tennessee";
          strOutputState += "<Option Value=\"TX\">Texas";
          strOutputState += "<Option Value=\"UT\">Utah";
          strOutputState += "<Option Value=\"VT\">Vermont";
          strOutputState += "<Option Value=\"VA\">Virginia";
          strOutputState += "<Option Value=\"WA\">Washington";
          strOutputState += "<Option Value=\"WV\">West Virginia";
          strOutputState += "<Option Value=\"WI\">Wisconsin";
          strOutputState += "<Option Value=\"WY\">Wyoming";
          strOutputState += "</SELECT>";
          strOutputState += "</TD></TR>";

//         strOutputState += "<TD><input type=text size=1 name=\"b_state\"></TD></TR>"; 
      }
      else if( CountrySave == "Canada" ) {
         strOutputState += "<TR><TD><font color=red><b>Province:</b></font></TD>";
          strOutputState += "<TD><SELECT NAME=\"b_state\">";
          strOutputState += "<Option Value=\"\" SELECTED>";
          strOutputState += "<Option Value=\"AB\">Alberta";
          strOutputState += "<Option Value=\"BC\">British Columbia";
          strOutputState += "<Option Value=\"MB\">Manitoba";
          strOutputState += "<Option Value=\"NB\">New Brunswick";
          strOutputState += "<Option Value=\"NL\">Newfoundland and Labrador";
          strOutputState += "<Option Value=\"NT\">Northwest Territories";
          strOutputState += "<Option Value=\"NS\">Nova Scotia";
          strOutputState += "<Option Value=\"NU\">Nunavut";
          strOutputState += "<Option Value=\"ON\">Ontario";
          strOutputState += "<Option Value=\"PE\">Prince Edward Island";
          strOutputState += "<Option Value=\"QC\">Quebec";
          strOutputState += "<Option Value=\"SK\">Saskatchewan";
          strOutputState += "<Option Value=\"YT\">Yukon";
          strOutputState += "</SELECT>";
          strOutputState += "</TD></TR>";
      }
      else {
         strOutputState += "<TR><TD>State/Province:</TD>";
         strOutputState += "<TD><input type=text size=21 name=\"b_state\" value=\" \"></TD></TR>"; 
      }
   }
   document.write(strOutputState);
   document.close();
}



//---------------------------------------------------------------------||
// FUNCTION:    CheckoutCart                                           ||
// PARAMETERS:  Null                                                   ||
// RETURNS:     Product Table Written to Document                      ||
// PURPOSE:     Draws current cart product table on HTML page for      ||
//              checkout.                                              ||
//---------------------------------------------------------------------||
   var Country        = 0;
   var CountrySave    = "";
   var strTax         = "";   //Total tax formatted as money
function CheckoutCart( ) {
   var iNumberOrdered = 0;    //Number of products ordered
   var fTotal         = 0;    //Total cost of order
   var fTax           = 0;    //Tax amount
   var fShipping      = 0;    //Shipping amount
   var strTotal       = "";   //Total cost formatted as money
   var strShipping    = "";   //Total shipping formatted as money
   var strOutput      = "";   //String to be written to page
   var bDisplay       = true; //Whether to write string to the page (here for programmers)
   var strPP          = "";   //Payment Processor Description Field
   var strCountry     = "";

   iNumberOrdered = GetCookie("NumberOrdered");
   if ( iNumberOrdered == null )
      iNumberOrdered = 0;

   if ( TaxByRegion ) {
      QueryString_Parse();
      fTax = parseFloat( QueryString( OutputOrderTax ) );
      strTax = moneyFormat(fTax);
   }

   if ( bDisplay )
      strOutput = "<TABLE CLASS=\"nopcart\"><TR>" +
                  "<TD CLASS=\"nopheader\"><B>"+strILabel+"</B></TD>" +
                  "<TD CLASS=\"nopheader\"><B>"+strDLabel+"</B></TD>" +
                  "<TD CLASS=\"nopheader\"><B>"+strQLabel+"</B></TD>" +
                  "<TD CLASS=\"nopheader\"><B>"+strPLabel+"</B></TD>" +
                  (DisplayShippingColumn?"<TD CLASS=\"nopheader\"><B>"+strSLabel+"</B></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 );                 // Product ID
      fields[1] = database.substring( Token0+1, Token1 );          // Quantity
      fields[2] = database.substring( Token1+1, Token2 );          // Price
      fields[3] = database.substring( Token2+1, Token3 );          // Product Name/Description
      fields[4] = database.substring( Token3+1, Token4 );          // Shipping Cost
      fields[5] = database.substring( Token4+1, database.length ); //Additional Information

      fTotal     += (parseInt(fields[1]) * parseFloat(fields[2]) );
      fShipping  += (parseInt(fields[1]) * parseFloat(fields[4]) );
      if ( !TaxByRegion ) fTax = (fTotal * TaxRate);
      strTotal    = moneyFormat(fTotal);
      if ( !TaxByRegion ) strTax = moneyFormat(fTax);

      strShipping = moneyFormat(fShipping);

      if ( bDisplay ) {
         strOutput += "<TR><TD CLASS=\"nopentry\">"  + fields[0] + "</TD>";

         if ( fields[5] == "" )
            strOutput += "<TD CLASS=\"nopentry\">"  + fields[3] + "</TD>";
         else
            strOutput += "<TD CLASS=\"nopentry\">"  + fields[3] + " - <I>"+ fields[5] + "</I></TD>";

         strOutput += "<TD CLASS=\"nopentry\">" + fields[1] + "</TD>";
         strOutput += "<TD CLASS=\"nopentry\">"+ MonetarySymbol + moneyFormat(fields[2]) + "/each</TD>";

         if ( DisplayShippingColumn ) {
            if ( parseFloat(fields[4]) > 0 )
//               strOutput += "<TD CLASS=\"nopentry\">"+ MonetarySymbol + moneyFormat(fields[4]) + "/each</TD>";
               strOutput += "<TD CLASS=\"nopentry\">"+ moneyFormat(fields[4]) + " lbs/each</TD>";
            else
               strOutput += "<TD CLASS=\"nopentry\">N/A</TD>";
         }

         strOutput += "</TR>";
      }

      if ( AppendItemNumToOutput ) {
         strFooter = i;
      } else {
         strFooter = "";
      }
      if ( PaymentProcessor != '' ) {
         //Process description field for payment processors instead of hidden values.
         //Format Description of product as:
         // ID, Name, Qty X
         strPP += fields[0] + ", " + fields[3];
         if ( fields[5] != "" )
            strPP += " - " + fields[5];
         strPP += ", Qty. " + fields[1] + "\n";
      } else {
         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 CLASS=\"noptotal\" COLSPAN=3><B>"+strSUB+"</B></TD>";
      strOutput += "<TD CLASS=\"noptotal\" COLSPAN=2 ALIGN=RIGHT><B>" + MonetarySymbol + strTotal + "</B></TD>";
      strOutput += "</TR>";

	var cost    = 0;
	QueryString_Parse();
	Country = parseFloat(QueryString( OutputOrderCountry ));
	weight = Math.round(fShipping);
// Calculate the shipping charge for USA ||
      if(Country == 1) {
        if(weight < 5) cost = 8.00+1.00*(weight-1);
        else cost = 11.00+0.50*(weight-4);
	  strCountry = "United States";
      }
// Calculate the shipping charge for Canada ||
      if(Country == 2) {
        if(weight < 5) cost = 17.00+(1.00*(weight-1));
        else cost = 20.00+(1.00*(weight-4));
	  strCountry = "Canada";
      }
// Calculate the shipping charge for Mexico ||
      if(Country == 3) {
        if(weight < 5) cost = 11.00+(4.50*(weight-1));
        else cost = 24.50+(1.65*(weight-4));
	  strCountry = "Mexico";
      }
// Calculate the shipping charge for zone A ||
      if(Country >= 100 && Country <= 200) {
        if(weight < 5) cost = 17.50+(3.50*(weight-1));
        else cost = 28.00+(2.50*(weight-4));
	  if(Country == 101) strCountry = "Anguilla";
	  else if(Country == 102) strCountry = "Antigua & Barbuda";
	  else if(Country == 103) strCountry = "Azerbaijan";
	  else if(Country == 104) strCountry = "Bahamas";
	  else if(Country == 105) strCountry = "Barbados";
	  else if(Country == 106) strCountry = "Belize";
	  else if(Country == 107) strCountry = "Benin";
	  else if(Country == 108) strCountry = "Bosnia & Herzegovina";
	  else if(Country == 109) strCountry = "British Virgin Islands";
	  else if(Country == 110) strCountry = "Brunei Darussalam";
	  else if(Country == 111) strCountry = "Cayman Islands";
	  else if(Country == 112) strCountry = "Christmas Island (Kiribati)";
	  else if(Country == 113) strCountry = "Costa Rica";
	  else if(Country == 114) strCountry = "Dominica";
	  else if(Country == 115) strCountry = "Dominican Republic";
	  else if(Country == 116) strCountry = "El Salvador";
	  else if(Country == 117) strCountry = "Fiji";
	  else if(Country == 118) strCountry = "Finland";
	  else if(Country == 119) strCountry = "Gambia";
	  else if(Country == 120) strCountry = "Germany";
	  else if(Country == 121) strCountry = "Greece";
	  else if(Country == 122) strCountry = "Grenada";
	  else if(Country == 123) strCountry = "Guatemala";
	  else if(Country == 124) strCountry = "Guinea";
	  else if(Country == 125) strCountry = "Guinea-Bissau";
	  else if(Country == 126) strCountry = "Guyana";
	  else if(Country == 127) strCountry = "Haiti";
	  else if(Country == 128) strCountry = "Honduras";
	  else if(Country == 129) strCountry = "Iceland";
	  else if(Country == 130) strCountry = "Ireland";
	  else if(Country == 131) strCountry = "Italy";
	  else if(Country == 132) strCountry = "Jamaica";
	  else if(Country == 133) strCountry = "Kiribati";
	  else if(Country == 134) strCountry = "Lebanon";
	  else if(Country == 135) strCountry = "Mauritania";
	  else if(Country == 136) strCountry = "Montserrat";
	  else if(Country == 137) strCountry = "Nicaragua";
	  else if(Country == 138) strCountry = "Panama";
	  else if(Country == 139) strCountry = "Saint Lucia";
	  else if(Country == 140) strCountry = "San Marino";
	  else if(Country == 141) strCountry = "Suriname";
	  else if(Country == 142) strCountry = "Tonga";
	  else if(Country == 143) strCountry = " Trinidad and Tobago";
	  else if(Country == 144) strCountry = "Turks and Caicos Islands";
	  else if(Country == 145) strCountry = "Tuvalu";
	  else if(Country == 146) strCountry = "Vanuatu";
	  else if(Country == 147) strCountry = "Vatican City";
	  else if(Country == 148) strCountry = "Venezuela";
	  else if(Country == 149) strCountry = "Virgin Islands (British)";
      }
// Calculate the shipping charge for zone B ||
      if(Country >= 200 && Country <= 300) {
        if(weight < 5) cost = 18.50+(4.50*(weight-1));
        else cost = 32.00+(3.50*(weight-4));
	  if(Country == 201) strCountry = "Andorra";
	  else if(Country == 202) strCountry = "Aruba";
	  else if(Country == 203) strCountry = "Bangladesh";
	  else if(Country == 204) strCountry = "Burma (Myanmar)";
	  else if(Country == 205) strCountry = "Burundi";
	  else if(Country == 206) strCountry = "Cambodia";
	  else if(Country == 207) strCountry = "Columbia";
	  else if(Country == 208) strCountry = "Comoros";
	  else if(Country == 209) strCountry = "Ecuador";
	  else if(Country == 210) strCountry = "Equatorial Guinea";
	  else if(Country == 211) strCountry = "Ethiopia";
	  else if(Country == 212) strCountry = "Gibraltar";
	  else if(Country == 213) strCountry = "Jordan";
	  else if(Country == 214) strCountry = "Kazakhstan";
	  else if(Country == 215) strCountry = "Korea, Republic of (South)";
	  else if(Country == 216) strCountry = "Latvia";
	  else if(Country == 217) strCountry = "Malaysia";
	  else if(Country == 218) strCountry = "Mauritius";
	  else if(Country == 219) strCountry = "Myanmar";
	  else if(Country == 220) strCountry = "Nauru";
	  else if(Country == 221) strCountry = "Netherlands";
	  else if(Country == 222) strCountry = "Netherlands Antilles";
	  else if(Country == 223) strCountry = "Oman";
	  else if(Country == 224) strCountry = "Qatar";
	  else if(Country == 225) strCountry = "Saint Kitts & Nevis";
	  else if(Country == 226) strCountry = "Samoa, Western";
	  else if(Country == 227) strCountry = "Sao Tome and Principe";
	  else if(Country == 228) strCountry = "Saudi Arabia";
	  else if(Country == 229) strCountry = "Serbia-Montenegro";
	  else if(Country == 230) strCountry = "Slovakia (Slovak Republic)";
	  else if(Country == 231) strCountry = "Solomon Islands";
	  else if(Country == 232) strCountry = "Spain";
	  else if(Country == 233) strCountry = "Sri Lanka";
	  else if(Country == 234) strCountry = "St. Pierre and Miquelon";
	  else if(Country == 235) strCountry = "Sudan";
	  else if(Country == 236) strCountry = "Swaziland";
	  else if(Country == 237) strCountry = "Thailand";
	  else if(Country == 238) strCountry = "Tokelau";
	  else if(Country == 239) strCountry = "Tristan da Cunha";
	  else if(Country == 240) strCountry = "Tunisia";
	  else if(Country == 241) strCountry = "Turkey";
	  else if(Country == 242) strCountry = "Western Sahara";
	  else if(Country == 243) strCountry = "Western Samoa";
	  else if(Country == 244) strCountry = "Iraq";
      }
// Calculate the shipping charge for zone C ||
      if(Country >= 300 && Country <= 400) {
        if(weight < 5) cost = 20.50+(4.00*(weight-1));
        else cost = 32.50+(3.00*(weight-4));
	  if(Country == 301) strCountry = "Bahrain";
	  else if(Country == 302) strCountry = "Belarus";
	  else if(Country == 303) strCountry = "Bermuda";
	  else if(Country == 304) strCountry = "Bolivia";
	  else if(Country == 305) strCountry = "Chile";
	  else if(Country == 306) strCountry = "Cote D'Ivoire";
	  else if(Country == 307) strCountry = "Croatia (Hrvatska)";
	  else if(Country == 308) strCountry = "Cyprus";
	  else if(Country == 309) strCountry = "Czech Republic";
	  else if(Country == 310) strCountry = "Denmark";
	  else if(Country == 311) strCountry = "Faroe Islands";
	  else if(Country == 312) strCountry = "Greenland";
	  else if(Country == 313) strCountry = "Hungary";
	  else if(Country == 314) strCountry = "Kyrgyzstan";
	  else if(Country == 315) strCountry = "Liechtenstein";
	  else if(Country == 316) strCountry = "Luxembourg";
	  else if(Country == 317) strCountry = "Macedonia";
	  else if(Country == 318) strCountry = "Morocco";
	  else if(Country == 319) strCountry = "Niger";
	  else if(Country == 320) strCountry = "Paraguay";
	  else if(Country == 321) strCountry = "Peru";
	  else if(Country == 322) strCountry = "Poland";
	  else if(Country == 323) strCountry = "Saint Vincent & The Grenadines";
	  else if(Country == 324) strCountry = "Seychelles";
	  else if(Country == 325) strCountry = "Slovenia";
	  else if(Country == 326) strCountry = "St. Helena";
	  else if(Country == 327) strCountry = "Switzerland";
	  else if(Country == 328) strCountry = "Tajikistan";
	  else if(Country == 329) strCountry = "Tanzania";
	  else if(Country == 330) strCountry = "United Arab Emirates";
	  else if(Country == 331) strCountry = "Uruguay";
	  else if(Country == 332) strCountry = "Yemen";
      }
// Calculate the shipping charge for zone D ||
      if(Country >= 400 && Country <= 500) {
        if(weight < 5) cost = 21.50+(5.50*(weight-1));
        else cost = 38.00+(4.50*(weight-4));
	  if(Country == 401) strCountry = "Albania";
	  else if(Country == 402) strCountry = "Algeria";
	  else if(Country == 403) strCountry = "Angola";
	  else if(Country == 404) strCountry = "Australia";
	  else if(Country == 405) strCountry = "Austria";
	  else if(Country == 406) strCountry = "Azores";
	  else if(Country == 407) strCountry = "Belgium";
	  else if(Country == 408) strCountry = "Bhutan";
	  else if(Country == 409) strCountry = "Botswana";
	  else if(Country == 410) strCountry = "Bulgaria";
	  else if(Country == 411) strCountry = "Burkina Faso";
	  else if(Country == 412) strCountry = "Cameroon";
	  else if(Country == 413) strCountry = "Cape Verde";
	  else if(Country == 414) strCountry = "Chad";
	  else if(Country == 415) strCountry = "Christmas Island (Australia)";
	  else if(Country == 416) strCountry = "Cocos (Keeling) Islands";
	  else if(Country == 417) strCountry = "Cook Islands";
	  else if(Country == 418) strCountry = "Corsica";
	  else if(Country == 419) strCountry = "Djibouti";
	  else if(Country == 420) strCountry = "East Timor";
	  else if(Country == 421) strCountry = "Egypt";
	  else if(Country == 422) strCountry = "Eritrea";
	  else if(Country == 423) strCountry = "Estonia";
	  else if(Country == 424) strCountry = "France";
	  else if(Country == 425) strCountry = "Gabon";
	  else if(Country == 426) strCountry = "Ghana";
	  else if(Country == 427) strCountry = "Great Britain & Northern Ireland";
	  else if(Country == 428) strCountry = "Hong Kong";
	  else if(Country == 429) strCountry = "India";
	  else if(Country == 430) strCountry = "Indonesia";
	  else if(Country == 431) strCountry = "Israel";
	  else if(Country == 432) strCountry = "Japan";
	  else if(Country == 433) strCountry = "Kenya";
	  else if(Country == 434) strCountry = "Kuwait";
	  else if(Country == 435) strCountry = "Lesotho";
	  else if(Country == 436) strCountry = "Lithuania";
	  else if(Country == 437) strCountry = "Madeira";
	  else if(Country == 438) strCountry = "Malawi";
	  else if(Country == 439) strCountry = "Mali";
	  else if(Country == 440) strCountry = "Malta";
	  else if(Country == 441) strCountry = "Mayotte";
	  else if(Country == 442) strCountry = "Moldova";
	  else if(Country == 443) strCountry = "Monaco";
	  else if(Country == 444) strCountry = "Mongolia";
	  else if(Country == 445) strCountry = "Namibia";
	  else if(Country == 446) strCountry = "Nepal";
	  else if(Country == 447) strCountry = "New Zealand";
	  else if(Country == 448) strCountry = "Nigeria";
	  else if(Country == 449) strCountry = "Niue";
	  else if(Country == 450) strCountry = "Norfolk Island";
	  else if(Country == 451) strCountry = "Norway";
	  else if(Country == 452) strCountry = "Pakistan";
	  else if(Country == 453) strCountry = "Philippines";
	  else if(Country == 454) strCountry = "Pitcairn Island";
	  else if(Country == 455) strCountry = "Portugal";
	  else if(Country == 456) strCountry = "Romania";
	  else if(Country == 457) strCountry = "Rwanda";
	  else if(Country == 458) strCountry = "Senegal";
	  else if(Country == 459) strCountry = "Sierra Leone";
	  else if(Country == 460) strCountry = "Singapore";
	  else if(Country == 461) strCountry = "South Africa";
	  else if(Country == 462) strCountry = "Taiwan";
	  else if(Country == 463) strCountry = "Togo";
	  else if(Country == 464) strCountry = "Turkmenistan";
	  else if(Country == 465) strCountry = "Uganda";
	  else if(Country == 466) strCountry = "Ukraine";
	  else if(Country == 467) strCountry = "United Kingdom";
	  else if(Country == 468) strCountry = "Zambia";
	  else if(Country == 469) strCountry = "China";
      }
// Calculate the shipping charge for zone E ||
      if(Country >= 500 && Country <= 600) {
        if(weight < 5) cost = 24.00+(4.50*(weight-1));
        else cost = 37.50+(3.50*(weight-4));
	  if(Country == 501) strCountry = "Afghanistan";
	  else if(Country == 502) strCountry = "Argentina";
	  else if(Country == 503) strCountry = "Armenia";
	  else if(Country == 504) strCountry = "Brazil";
	  else if(Country == 505) strCountry = "Central African Republic";
	  else if(Country == 506) strCountry = "Congo, Republic of the";
	  else if(Country == 507) strCountry = "French Guiana";
	  else if(Country == 508) strCountry = "French Polynesia";
	  else if(Country == 509) strCountry = "Georgia";
	  else if(Country == 510) strCountry = "Guadeloupe";
	  else if(Country == 511) strCountry = "Madagascar";
	  else if(Country == 512) strCountry = "Maldives";
	  else if(Country == 513) strCountry = "Martinique";
	  else if(Country == 514) strCountry = "Mozambique";
	  else if(Country == 515) strCountry = "New Caledonia";
	  else if(Country == 516) strCountry = "Papua New Guinea";
	  else if(Country == 517) strCountry = "Reunion";
	  else if(Country == 518) strCountry = "Russia";
	  else if(Country == 519) strCountry = "Sweden";
	  else if(Country == 520) strCountry = "Uzbekistan";
	  else if(Country == 521) strCountry = "Wallis and Futuna Islands";
	  else if(Country == 522) strCountry = "Zimbabwe";
      }
// Calculate the shipping charge for zone F ||
      if(Country >= 600 && Country <= 700) {
        if(weight < 11) cost = 11.50+(2.80*(weight-1));
        else cost = 36.70+(0.80*(weight-10));
	  if(Country == 601) strCountry = "Falkland Islands (Malvinas)";
	  else if(Country == 602) strCountry = "South Georgia & S. Sandwich I.";
      }
// Calculate the shipping charge for zone G ||
      if(Country >= 700 && Country <= 800) {
        if(weight < 11) cost = 8.50+(1.75*(weight-1));
        else cost = 24.25+(0.60*(weight-10));
	  if(Country == 701) strCountry = "American Samoa";
	  else if(Country == 702) strCountry = "Guam";
	  else if(Country == 703) strCountry = "Marshall Islands";
	  else if(Country == 704) strCountry = "Micronesia, Federated States of";
	  else if(Country == 705) strCountry = "Northern Mariana Islands";
	  else if(Country == 706) strCountry = "Palau";
	  else if(Country == 707) strCountry = "Puerto Rico";
	  else if(Country == 708) strCountry = "Virgin Islands (U.S.)";
      }
	CountrySave = strCountry;
      fShipping   = cost;
      strShipping = moneyFormat(fShipping);

      if ( DisplayShippingRow ) {
         strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=3><B>"+strSHIP+"</B></TD>";
         strOutput += "<TD CLASS=\"noptotal\" COLSPAN=2 ALIGN=RIGHT><B>" + MonetarySymbol + strShipping + "</B></TD>";
         strOutput += "</TR>";
      }

      if ( DisplayTaxRow || TaxByRegion ) {
         strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=3><B>"+strTAX+"</B></TD>";
         strOutput += "<TD CLASS=\"noptotal\" COLSPAN=2 ALIGN=RIGHT><B>" + MonetarySymbol + strTax + "</B></TD>";
         strOutput += "</TR>";
      }

      strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=3><B>"+strTOT+"</B></TD>";
      strOutput += "<TD CLASS=\"noptotal\" COLSPAN=2 ALIGN=RIGHT><B>" + MonetarySymbol + moneyFormat((fTotal + fShipping + fTax)) + "</B></TD>";
      strOutput += "</TR>";

      strOutput += "</TABLE>";

      if ( PaymentProcessor == 'an') {
         //Process this for Authorize.net WebConnect
         strOutput += "<input type=hidden name=\"x_Version\" value=\"3.0\">";
         strOutput += "<input type=hidden name=\"x_Show_Form\" value=\"PAYMENT_FORM\">";
         strOutput += "<input type=hidden name=\"x_Description\" value=\""+ strPP + "\">";
         strOutput += "<input type=hidden name=\"x_Amount\" value=\""+ moneyFormat((fTotal + fShipping + fTax)) + "\">";
      } else if ( PaymentProcessor == 'wp') {
         //Process this for WorldPay
         strOutput += "<input type=hidden name=\"desc\" value=\""+ strPP + "\">";
         strOutput += "<input type=hidden name=\"amount\" value=\""+ moneyFormat((fTotal + fShipping + fTax)) + "\">";
      } else if ( PaymentProcessor == 'lp') {
         //Process this for LinkPoint         
         strOutput += "<input type=hidden name=\"mode\" value=\"fullpay\">";
         strOutput += "<input type=hidden name=\"chargetotal\" value=\""+ moneyFormat((fTotal + fShipping + fTax)) + "\">";
         strOutput += "<input type=hidden name=\"tax\" value=\""+ MonetarySymbol + strTax + "\">";
         strOutput += "<input type=hidden name=\"subtotal\" value=\""+ MonetarySymbol + strTotal + "\">";
         strOutput += "<input type=hidden name=\"shipping\" value=\""+ MonetarySymbol + strShipping + "\">";
         strOutput += "<input type=hidden name=\"desc\" value=\""+ strPP + "\">";
      } else {
         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)) + "\">";
	   strOutput += "<input type=hidden NAME=\""+OutputOrderCountry+"\" value=\""+strCountry+"\">";
      }
   }
   document.write(strOutput);
   document.close();
}

//=====================================================================||
//               END NOP Design SmartPost Shopping Cart                ||
//=====================================================================||


