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

//=====================================================================||
//                                                                     ||
//      Advanved UPS Shiping Modifications by KFLTECHNOLOGIES.COM      ||
//                                                                     ||
//=====================================================================|| 

//---------------------------------------------------------------------|| 
// FUNCTION:    AddOneOfManyToCart                                     || 
// PARAMETERS:  Form Object PRODUCTSELECTOR                            || 
// RETURNS:     Product parameters to order form                       || 
// PURPOSE:     selects one of many products with different size,      || 
//              cost, shipping and/or tax to add to shopping cart      || 
//---------------------------------------------------------------------|| 

function AddOneOfManyToCart(formToUpdate) {

   selectedObj = formToUpdate.PRODUCTSELECTOR[formToUpdate.PRODUCTSELECTOR.selectedIndex]; 

   nameVal = selectedObj.getAttribute("name"); 
   if (nameVal == "select") { 
      alert('Please select an option'); 
      return false;
   } 

   formToUpdate.NAME.value = nameVal; 

   costVal = selectedObj.getAttribute("cost"); 
   formToUpdate.PRICE.value = costVal; 

   id_numVal = selectedObj.getAttribute("id_num"); 
   formToUpdate.ID_NUM.value = id_numVal; 
   
   weightVal = selectedObj.getAttribute("weight"); 
   formToUpdate.WEIGHT.value = weightVal; 

   shippingVal = selectedObj.getAttribute("shipping"); 
   formToUpdate.SHIPPING.value = shippingVal; 

   switch( formToUpdate.PRODUCTSELECTOR[formToUpdate.PRODUCTSELECTOR.selectedIndex].value ) { 
   } 
   AddToCart(formToUpdate); 
} 

//---------------------------------------------------------------------|| 

//Options for Everyone: 
MonetarySymbol = '$'; 
DisplayNotice = true; 
DisplayChangeQty = false; 
DisplayShippingColumn = true; 
DisplayShippingRow = true; 
var RateAdjust = 1.59; //shipping adjustment
TaxRate = 0.06; //set taxable region rate ||
DisplayTaxRow = false; 
TaxByRegion = false; //leave this at false, UPS Shipping Mod will activate taxable Zone ||
TaxPrompt = 'For tax purposes, please select if you are a Florida resident'; //Deactivated ||
TaxablePrompt = 'Florida Resident?'; //Deactivated ||
NonTaxablePrompt = 'Other States'; //Deactivated ||
MinimumOrder = 25.00; 
MinimumOrderPrompt = 'Oops!\n\nWe can not proceed to check out since\nyour order is below our minimum order of $25.'; 
//original syntax - MinimumOrderPrompt = 'Your order is below our minimum order of $25.'; 

NoQtyPrompt = 'Please select SHIPPING LOCATION'; //If attempted to go to checkout before selecting shipping zone ||

//Payment Processor Options: 
PaymentProcessor = ''; 

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

//Options for Shipping by Weight: 
LocationLabel = 'ZONE'; 
LocationPrompt = 'Please select SHIPPING LOCATION'; 
MaxWeightPrompt = 'Sorry, maximum weight allowable is 500lbs.'; 

//=====================================================================|| 
//---------------------------------------------------------------------|| 
//     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 is full, please proceed to checkout."; 
strAdded =  "Added To Cart"; 
strRemove = "Click 'Ok' to remove this product from your shopping cart."; 
strILabel = "Product Id"; 
strDLabel = "Product Name/Description"; 
strQLabel = "Qty"; 
strPLabel = "Price"; 
strSLabel = "Weight"; //Added for UPS mod ||
strRLabel = "Remove From Cart"; 
strRButton= "Remove"; 
strSUB = "SUBTOTAL"; 
strWTOT = "TOTAL WEIGHT"; //Added for UPS mod ||
strSHIP = "SHIPPING"; 
strTAX = "TAX"; 
strTOT = "TOTAL"; 
strErrQty = "Invalid Quantity."; 
strNewQty = 'Please enter new quantity:'; 
bLanguageDefined = true; 
} 

//---------------------------------------------------------------------|| 
// 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                 || 
// EXTRAS ADDED IN: USERENTRY for customer text input                  ||
//---------------------------------------------------------------------|| 
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^0^0^0^0^0^0^0"; 
else 
strSHIPPING = thisForm.SHIPPING.value; 

if ( thisForm.SHIPPING2 == null ) 
strSHIPPING2 = "0"; 
else 
strSHIPPING2 = thisForm.SHIPPING2.value; 

if ( thisForm.WEIGHT == null )
strWEIGHT = "0"; 
else 
strWEIGHT = thisForm.WEIGHT.value; 

if ( thisForm.WEIGHT2 == null )
strWEIGHT2 = "0"; 
else 
strWEIGHT2 = thisForm.WEIGHT2.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; 
} 
if ( thisForm.USERENTRY != null ) { 
strADDTLINFO += "; " + thisForm.USERENTRY.value; 
} 
if ( thisForm.USERENTRY2 != null ) { 
strADDTLINFO += "; " + thisForm.USERENTRY2.value; 
} 
if ( thisForm.USERENTRY3 != null ) { 
strADDTLINFO += "; " + thisForm.USERENTRY3.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); 
Token5 = database.indexOf("|", Token4+1); 
Token6 = database.indexOf("|", Token5+1); 
Token7 = database.indexOf("|", Token6+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, Token5 ); 
fields[6] = database.substring( Token5+1, Token6 ); 
fields[7] = database.substring( Token6+1, Token7 ); 
fields[8] = database.substring( Token7+1, database.length ); 

if ( fields[0] == strID_NUM && 
fields[2] == strPRICE && 
fields[3] == strNAME && 
fields[8] == strADDTLINFO 
) { 
bAlreadyInCart = true; 
dbUpdatedOrder = strID_NUM + "|" + 
(parseInt(strQUANTITY)+parseInt(fields[1])) + "|" + 
strPRICE + "|" + 
strNAME + "|" + 
strSHIPPING + "|" + 
strSHIPPING2 + "|" + 
strWEIGHT + "|" +
strWEIGHT2 + "|" +
strADDTLINFO; 
strNewOrder = "Order." + i; 
DeleteCookie(strNewOrder, "/"); 
SetCookie(strNewOrder, dbUpdatedOrder, null, "/"); 
notice = strAdded + "\n-------------------------------------\n" + "Quantity : " + strQUANTITY + "\nProduct  : " + strNAME;
break; 
} 
} 

if ( !bAlreadyInCart ) { 
iNumberOrdered++; 

if ( iNumberOrdered > 12 ) 
alert( strSorry ); 
else { 
dbUpdatedOrder = strID_NUM + "|" + 
strQUANTITY + "|" + 
strPRICE + "|" + 
strNAME + "|" + 
strSHIPPING + "|" + 
strSHIPPING2 + "|" + 
strWEIGHT + "|" + 
strWEIGHT2 + "|" + 
strADDTLINFO; 

strNewOrder = "Order." + iNumberOrdered; 
SetCookie(strNewOrder, dbUpdatedOrder, null, "/"); 
SetCookie("NumberOrdered", iNumberOrdered, null, "/"); 
notice = strAdded + "\n-------------------------------------\n" + "Quantity : " + strQUANTITY + "\nProduct  : " + strNAME;
} 
} 

if ( DisplayNotice && notice!=''){ 
alert(notice); 
}else{ 
} 
} 

//---------------------------------------------------------------------|| 
// 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); 
Token5 = database.indexOf("|", Token4+1); 
Token6 = database.indexOf("|", Token5+1); 
Token7 = database.indexOf("|", Token6+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, Token5 ); 
fields[6] = database.substring( Token5+1, Token6 ); 
fields[7] = database.substring( Token6+1, Token7 ); 
fields[8] = database.substring( Token7+1, database.length ); 

dbUpdatedOrder = fields[0] + "|" + 
NewQuantity + "|" + 
fields[2] + "|" + 
fields[3] + "|" + 
fields[4] + "|" + 
fields[5] + "|" + 
fields[6] + "|" + 
fields[7] + "|" + 
fields[8]; 
strNewOrder = "Order." + OrderItem; 
DeleteCookie(strNewOrder, "/"); 
SetCookie(strNewOrder, dbUpdatedOrder, null, "/"); 
location.href=location.href; 
} 
} 

//---------------------------------------------------------------------||
// 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              || 
// EXTRAS ADDED IN: Code to enable UPS mod.                            ||
//---------------------------------------------------------------------|| 
function ManageCart( ) { 
var fItems = 0;
var iNumberOrdered = 0; //Number of products ordered 
var fTotal = 0; //Total cost of order 
var fTax = 0; //Tax amount 
var fWeight = 0; //Weight 
var fWeight2 = 0; //Weight2
var fWeightTOT = 0; //Total Weight
var fShipping = 0; //Advanced Shipping amount 
var fShipping2 = 0; //Standard Shipping amount 
var strTotal = ""; //Total cost formatted as money 
var strTax = ""; //Total tax formatted as money 
var strShipping = ""; //Total shipping formatted as money 
var strWeight = ""; //Total weight formatted -Advanced
var strWeight2 = ""; //Total weight formatted - Standard
var strOutput = ""; //String to be written to page 
var bDisplay = true; //Whether to write string to the page (here for programmers) 
var shipValue1=0; //Zone1 amount
var shipValue2=0; //Zone2 amount
var shipValue3=0; //Zone3 amount
var shipValue4=0; //Zone4 amount
var shipValue5=0; //Zone5 amount
var shipValue6=0; //Zone6 amount
var shipValue7=0; //Zone7 amount
var shipValue8=0; //Zone8 amount

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

LocationSelected = GetCookie("ZoneSelected"); 
if (LocationSelected == null) LocationSelected = 0; // Code to use Wichita as default checked if customer goes to Checkout with an empty Cart ||

if ( bDisplay ) 
strOutput = "<TABLE WIDTH=630 CELLSPACING=0 CELLPADDING=3 BORDER=0 CLASS=\"nopcart\"><TR>" + 
"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strILabel+"</B></TD>" + 
"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strDLabel+"</B></TD>" + 
"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strQLabel+"</B></TD>" + 
"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strPLabel+"</B></TD>" + 
(DisplayShippingColumn?"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strSLabel+"</B></TD>":"") + 
"<TD CLASS=\"nopheader\" ALIGN=CENTER><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++ ) {
			even = Math.round(i/2);
      NewOrder = "Order." + i;
      database = "";
      dbShip ="";
      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); 
Token5 = database.indexOf("|", Token4+1); 
Token6 = database.indexOf("|", Token5+1); 
Token7 = database.indexOf("|", Token6+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, Token5 ); 
fields[6] = database.substring( Token5+1, Token6 ); 
fields[7] = database.substring( Token6+1, Token7 ); 
fields[8] = database.substring( Token7+1, database.length ); 

dbShip = fields[4];
Coin0 = dbShip.indexOf("^", 0); 
Coin1 = dbShip.indexOf("^", Coin0+1); 
Coin2 = dbShip.indexOf("^", Coin1+1); 
Coin3 = dbShip.indexOf("^", Coin2+1); 
Coin4 = dbShip.indexOf("^", Coin3+1); 
Coin5 = dbShip.indexOf("^", Coin4+1);
Coin6 = dbShip.indexOf("^", Coin5+1);
Coin7 = dbShip.indexOf("^", Coin6+1);

shipfields = new Array;
shipfields[0] = dbShip.substring( 0, Coin0 ); 
shipfields[1] = dbShip.substring( Coin0+1, Coin1 );
shipfields[2] = dbShip.substring( Coin1+1, Coin2 );
shipfields[3] = dbShip.substring( Coin2+1, Coin3 );
shipfields[4] = dbShip.substring( Coin3+1, Coin4 );
shipfields[5] = dbShip.substring( Coin4+1, Coin5 );
shipfields[6] = dbShip.substring( Coin5+1, Coin6 );
shipfields[7] = dbShip.substring( Coin6+1, dbShip.length );

shipValue1 += (parseFloat(fields[1]) * parseFloat(shipfields[0]) ); 
shipValue2 += (parseFloat(fields[1]) * parseFloat(shipfields[1]) ); 
shipValue3 += (parseFloat(fields[1]) * parseFloat(shipfields[2]) ); 
shipValue4 += (parseFloat(fields[1]) * parseFloat(shipfields[3]) ); 
shipValue5 += (parseFloat(fields[1]) * parseFloat(shipfields[4]) ); 
shipValue6 += (parseFloat(fields[1]) * parseFloat(shipfields[5]) ); 
shipValue7 += (parseFloat(fields[1]) * parseFloat(shipfields[6]) ); 
shipValue8 += (parseFloat(fields[1]) * parseFloat(shipfields[7]) ); 

fItems += (parseInt(fields[1]));
fTotal += (parseInt(fields[1]) * parseFloat(fields[2]) ); 
fWeight += (parseInt(fields[1]) * parseFloat(fields[6]) ); 
fWeight2 += (parseInt(fields[1]) * parseFloat(fields[7]) );
fWeight = Math.round(fWeight * 100)/100;
fWeight2 = Math.round(fWeight2 * 100)/100;
fWeightTOT = fWeight + fWeight2;


var strProductId = fields[0];
strProductId=strProductId.charAt(0);
if( strProductId!= 'n' ) {
fTax += (parseInt(fields[1]) * parseFloat(fields[2]) ) * TaxRate;
}

strTotal = moneyFormat(fTotal); 
strTax = moneyFormat(fTax); 

if ( bDisplay ){
      if ((even) ==(i/2) ) {
strOutput += "<TR><TD CLASS=\"nopeven\" ALIGN=CENTER>" + fields[0] + "</TD>"; 

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

if ( DisplayChangeQty ) {
strOutput += "<TD CLASS=\"nopeven\" ALIGN=CENTER><INPUT TYPE=TEXT NAME=Q SIZE=2 VALUE=\"" + fields[1] + "\" onChange=\"ChangeQuantity("+i+", this.value);\"></TD>"; 
} else {
strOutput += "<TD CLASS=\"nopeven\" ALIGN=CENTER>" + fields[1] + "</TD>"; 
}
strOutput += "<TD CLASS=\"nopeven\" ALIGN=RIGHT>"+ MonetarySymbol + moneyFormat(fields[2]) + "/ea</TD>"; 

if ( DisplayShippingColumn ) { 

strOutput += "<TD CLASS=\"nopeven\" ALIGN=RIGHT>"+ MonetarySymbol + moneyFormat(parseInt(fields[1]) * parseFloat(fields[2]) ) + "</TD>"; 
}else {
strOutput += "<TD CLASS=\"nopeven\" ALIGN=RIGHT>N/A</TD>"; 
} 

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

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

if ( DisplayChangeQty ) {
strOutput += "<TD CLASS=\"nopentry\" ALIGN=CENTER><INPUT TYPE=TEXT NAME=Q SIZE=2 VALUE=\"" + fields[1] + "\" onChange=\"ChangeQuantity("+i+", this.value);\"></TD>"; 
} else {
strOutput += "<TD CLASS=\"nopentry\" ALIGN=CENTER>" + fields[1] + "</TD>"; 
}
strOutput += "<TD CLASS=\"nopentry\" ALIGN=RIGHT>"+ MonetarySymbol + moneyFormat(fields[2]) + "/ea</TD>"; 

if ( DisplayShippingColumn ) { 

strOutput += "<TD CLASS=\"nopentry\" ALIGN=RIGHT>"+ MonetarySymbol + moneyFormat(parseInt(fields[1]) * parseFloat(fields[2]) ) + "</TD>"; 
}else {
strOutput += "<TD CLASS=\"nopentry\" ALIGN=RIGHT>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=\"" + OutputItemShipping2 + strFooter + "\" value=\"" + fields[5] + "\">";
strOutput += "<input type=hidden name=\"" + OutputItemWeight + strFooter + "\" value=\"" + fields[6] + "\">"; 
strOutput += "<input type=hidden name=\"" + OutputItemWeight2 + strFooter + "\" value=\"" + fields[7] + "\">"; 
strOutput += "<input type=hidden name=\"" + OutputItemAddtlInfo + strFooter + "\" value=\"" + fields[8] + "\">"; 
} 
} 

if ( bDisplay ) { 
strOutput += "</TR>"; 
//this displays the shipping matrix and sets the value for each zone ||

if (( DisplayShippingRow ) && ( iNumberOrdered != 0)) { 
strOutput += "<TR bgcolor=#FFFFFF>"; 
strOutput += "<TD CLASS=\"nopship\" COLSPAN=6 valign=top align=middle>"; 
strOutput += "<font color=red size=1 face=verdana><b>Choose Shipping Location</b></font>&nbsp;<img src=\"rightarrowlh.gif\" width=28 height=20 align=center>&nbsp;&nbsp;"; 
strOutput += "<select name=\"ZONE\" onChange=\"ComputeShipping(this.value, "+shipValue1+", "+shipValue2+", "+shipValue3+", "+shipValue4+", "+shipValue5+", "+shipValue6+", "+shipValue7+", "+shipValue8+", "+fWeight2+")\">";

if (LocationSelected == 0){//NO ZONE
strOutput += "<option value=\"0\">Please select</option>"; 
}else{
strOutput += "<option value=\"0\">Please select</option>"; 
}
if (LocationSelected == 1){//ZONE 5
strOutput += "<option value=\"1\" selected>Alabama</option>"; 
}else{
strOutput += "<option value=\"1\">Alabama</option>"; 
}
if (LocationSelected == 2){//ZONE 8
strOutput += "<option value=\"2\" selected>Arizona</option>"; 
}else{
strOutput += "<option value=\"2\">Arizona</option>"; 
}
if (LocationSelected == 3){//ZONE 6
strOutput += "<option value=\"3\" selected>Arkansas</option>"; 
}else{
strOutput += "<option value=\"3\">Arkansas</option>"; 
}
if (LocationSelected == 4){//ZONE 8
strOutput += "<option value=\"4\" selected>California</option>"; 
}else{
strOutput += "<option value=\"4\">California</option>"; 
}
if (LocationSelected == 5){//ZONE 7
strOutput += "<option value=\"5\" selected>Colorado</option>"; 
}else{
strOutput += "<option value=\"5\">Colorado</option>"; 
}
if (LocationSelected == 6){// ZONE 3
strOutput += "<option value=\"6\" selected>Connecticut</option>"; 
}else{
strOutput += "<option value=\"6\">Connecticut</option>"; 
}
if (LocationSelected == 7){//ZONE 3 
strOutput += "<option value=\"7\" selected>Delaware</option>"; 
}else{
strOutput += "<option value=\"7\">Delaware</option>"; 
}
if (LocationSelected == 8){//ZONE 6
strOutput += "<option value=\"8\" selected>Florida</option>"; 
}else{
strOutput += "<option value=\"8\">Florida</option>"; 
}
if (LocationSelected == 9){// ZONE 5
strOutput += "<option value=\"9\" selected>Georgia</option>"; 
}else{
strOutput += "<option value=\"9\">Georgia</option>"; 
}
if (LocationSelected == 10){//ZONE 8
strOutput += "<option value=\"10\" selected>Idaho</option>"; 
}else{
strOutput += "<option value=\"10\">Idaho</option>"; 
}
if (LocationSelected == 11){//ZONE 5
strOutput += "<option value=\"11\" selected>Illinois</option>"; 
}else{
strOutput += "<option value=\"11\">Illinois</option>"; 
}
if (LocationSelected == 12){//ZONE 5
strOutput += "<option value=\"12\" selected>Indiana</option>"; 
}else{
strOutput += "<option value=\"12\">Indiana</option>"; 
}
if (LocationSelected == 13){//ZONE 6
strOutput += "<option value=\"13\" selected>Iowa</option>"; 
}else{
strOutput += "<option value=\"13\">Iowa</option>"; 
}
if (LocationSelected == 14){//ZONE 6
strOutput += "<option value=\"14\" selected>Kansas</option>"; 
}else{
strOutput += "<option value=\"14\">Kansas</option>"; 
}
if (LocationSelected == 15){//ZONE 5
strOutput += "<option value=\"15\" selected>Kentucky</option>"; 
}else{
strOutput += "<option value=\"15\">Kentucky</option>"; 
}
if (LocationSelected == 16){//ZONE 6
strOutput += "<option value=\"16\" selected>Louisiana</option>"; 
}else{
strOutput += "<option value=\"16\">Louisiana</option>"; 
}
if (LocationSelected == 17){//ZONE 4
strOutput += "<option value=\"17\" selected>Maine</option>"; 
}else{
strOutput += "<option value=\"17\">Maine</option>"; 
}
if (LocationSelected == 18){//ZONE 3
strOutput += "<option value=\"18\" selected>Maryland</option>"; 
}else{
strOutput += "<option value=\"18\">Maryland</option>"; 
}
if (LocationSelected == 19){//ZONE 4
strOutput += "<option value=\"19\" selected>Massachusetts</option>"; 
}else{
strOutput += "<option value=\"19\">Massachusetts</option>"; 
}
if (LocationSelected == 20){//ZONE 5
strOutput += "<option value=\"20\" selected>Michigan</option>"; 
}else{
strOutput += "<option value=\"20\">Michigan</option>"; 
}
if (LocationSelected == 21){//ZONE 6
strOutput += "<option value=\"21\" selected>Minnesota</option>"; 
}else{
strOutput += "<option value=\"21\">Minnesota</option>"; 
}
if (LocationSelected == 22){//ZONE 5
strOutput += "<option value=\"22\" selected>Mississippi</option>"; 
}else{
strOutput += "<option value=\"22\">Mississippi</option>"; 
}
if (LocationSelected == 23){//ZONE 5
strOutput += "<option value=\"23\" selected>Missouri</option>"; 
}else{
strOutput += "<option value=\"23\">Missouri</option>"; 
}
if (LocationSelected == 24){//ZONE 8
strOutput += "<option value=\"24\" selected>Montana</option>"; 
}else{
strOutput += "<option value=\"24\">Montana</option>"; 
}
if (LocationSelected == 25){//ZONE 6
strOutput += "<option value=\"25\" selected>Nebraska</option>"; 
}else{
strOutput += "<option value=\"25\">Nebraska</option>"; 
}
if (LocationSelected == 26){//ZONE 8
strOutput += "<option value=\"26\" selected>Nevada</option>"; 
}else{
strOutput += "<option value=\"26\">Nevada</option>"; 
}
if (LocationSelected == 27){//ZONE 4
strOutput += "<option value=\"27\" selected>New Hampshire</option>"; 
}else{
strOutput += "<option value=\"27\">New Hampshire</option>"; 
}
if (LocationSelected == 28){//ZONE 3
strOutput += "<option value=\"28\" selected>New Jersey</option>"; 
}else{
strOutput += "<option value=\"28\">New Jersey</option>"; 
}
if (LocationSelected == 29){//ZONE 7
strOutput += "<option value=\"29\" selected>New Mexico</option>"; 
}else{
strOutput += "<option value=\"29\">New Mexico</option>"; 
}
if (LocationSelected == 30){//ZONE 3
strOutput += "<option value=\"30\" selected>New York</option>"; 
}else{
strOutput += "<option value=\"30\">New York</option>"; 
}
if (LocationSelected == 31){//ZONE 4
strOutput += "<option value=\"31\" selected>North Carolina</option>"; 
}else{
strOutput += "<option value=\"31\">North Carolina</option>"; 
}
if (LocationSelected == 32){//ZONE 7
strOutput += "<option value=\"32\" selected>North Dakota</option>"; 
}else{
strOutput += "<option value=\"32\">North Dakota</option>"; 
}
if (LocationSelected == 33){//ZONE 4
strOutput += "<option value=\"33\" selected>Ohio</option>"; 
}else{
strOutput += "<option value=\"33\">Ohio</option>"; 
}
if (LocationSelected == 34){//ZONE 6
strOutput += "<option value=\"34\" selected>Oklahoma</option>"; 
}else{
strOutput += "<option value=\"34\">Oklahoma</option>"; 
}
if (LocationSelected == 35){//ZONE 8
strOutput += "<option value=\"35\" selected>Oregon</option>"; 
}else{
strOutput += "<option value=\"35\">Oregon</option>"; 
}
if (LocationSelected == 36){//ZONE 3 TAX ZONE
strOutput += "<option value=\"36\" selected>Pennsylvania</option>"; 
}else{
strOutput += "<option value=\"36\">Pennsylvania</option>"; 
}
if (LocationSelected == 37){//ZONE 3
strOutput += "<option value=\"37\" selected>Rhode Island</option>"; 
}else{
strOutput += "<option value=\"37\">Rhode Island</option>"; 
}
if (LocationSelected == 38){//ZONE 4
strOutput += "<option value=\"38\" selected>South Carolina</option>"; 
}else{
strOutput += "<option value=\"38\">South Carolina</option>"; 
}
if (LocationSelected == 39){//ZONE 6
strOutput += "<option value=\"39\" selected>South Dakota</option>"; 
}else{
strOutput += "<option value=\"39\">South Dakota</option>"; 
}
if (LocationSelected == 40){//ZONE 5
strOutput += "<option value=\"40\" selected>Tennessee</option>"; 
}else{
strOutput += "<option value=\"40\">Tennessee</option>"; 
}
if (LocationSelected == 41){//ZONE 7
strOutput += "<option value=\"41\" selected>Texas</option>"; 
}else{
strOutput += "<option value=\"41\">Texas</option>"; 
}
if (LocationSelected == 42){//ZONE 8
strOutput += "<option value=\"42\" selected>Utah</option>"; 
}else{
strOutput += "<option value=\"42\">Utah</option>"; 
}
if (LocationSelected == 43){//ZONE 4
strOutput += "<option value=\"43\" selected>Vermont</option>"; 
}else{
strOutput += "<option value=\"43\">Vermont</option>"; 
}
if (LocationSelected == 44){//ZONE 4
strOutput += "<option value=\"44\" selected>Virginia</option>"; 
}else{
strOutput += "<option value=\"44\">Virginia</option>"; 
}
if (LocationSelected == 45){//ZONE 8
strOutput += "<option value=\"45\" selected>Washington</option>"; 
}else{
strOutput += "<option value=\"45\">Washington</option>"; 
}
if (LocationSelected == 46){//ZONE 4
strOutput += "<option value=\"46\" selected>West Virginia</option>"; 
}else{
strOutput += "<option value=\"46\">West Virginia</option>"; 
}
if (LocationSelected == 47){//ZONE 5
strOutput += "<option value=\"47\" selected>Wisconsin</option>"; 
}else{
strOutput += "<option value=\"47\">Wisconsin</option>"; 
}
if (LocationSelected == 48){//ZONE 7
strOutput += "<option value=\"48\" selected>Wyoming</option>"; 
}else{
strOutput += "<option value=\"48\">Wyoming</option>"; 
}
strOutput += "</select>"; 
strOutput += "</TD>"; 
strOutput += "<TD  CLASS=\"nopship\" COLSPAN=4>"; 
strOutput += "</TD>";
strOutput += "</TR>"; 

document.write(strOutput); 
strOutput = ""; 

LocationSelected = GetCookie("ZoneSelected"); 
if (LocationSelected == null) LocationSelected = 0; // Code to use Local Area as default checked, but not needed because want null selected at this time ||
//if (LocationSelected != null) document.all.ZONE[LocationSelected].checked = true; 

if (LocationSelected != null) {
    var cLocations = document.getElementsByName('ZONE');
    for (var iCtr = 0; iCtr < cLocations.length; iCtr++) {
         if (cLocations[iCtr].value == LocationSelected) cLocations[iCtr].checked = true;
    }
}

if (LocationSelected == 0) LocationLabel = '<font color="#FF0000">Select Shipping Location</font>';
if (LocationSelected == 1) LocationLabel = "Zone 5"; 
if (LocationSelected == 2) LocationLabel = "Zone 8"; 
if (LocationSelected == 3) LocationLabel = "Zone 6"; 
if (LocationSelected == 4) LocationLabel = "Zone 8"; 
if (LocationSelected == 5) LocationLabel = "Zone 7"; 
if (LocationSelected == 6) LocationLabel = "Zone 3"; 
if (LocationSelected == 7) LocationLabel = "Zone 3"; 
if (LocationSelected == 8) LocationLabel = "Zone 6";
if (LocationSelected == 9) LocationLabel = "Zone 5";
if (LocationSelected == 10) LocationLabel = "Zone 8"; 
if (LocationSelected == 11) LocationLabel = "Zone 5"; 
if (LocationSelected == 12) LocationLabel = "Zone 5"; 
if (LocationSelected == 13) LocationLabel = "Zone 6"; 
if (LocationSelected == 14) LocationLabel = "Zone 6";
if (LocationSelected == 15) LocationLabel = "Zone 5"; 
if (LocationSelected == 16) LocationLabel = "Zone 6"; 
if (LocationSelected == 17) LocationLabel = "Zone 4";
if (LocationSelected == 18) LocationLabel = "Zone 3";
if (LocationSelected == 19) LocationLabel = "Zone 4"; 
if (LocationSelected == 20) LocationLabel = "Zone 5"; 
if (LocationSelected == 21) LocationLabel = "Zone 6";
if (LocationSelected == 22) LocationLabel = "Zone 5";
if (LocationSelected == 23) LocationLabel = "Zone 5";
if (LocationSelected == 24) LocationLabel = "Zone 8";
if (LocationSelected == 25) LocationLabel = "Zone 6"; 
if (LocationSelected == 26) LocationLabel = "Zone 8";
if (LocationSelected == 27) LocationLabel = "Zone 4";
if (LocationSelected == 28) LocationLabel = "Zone 3";
if (LocationSelected == 29) LocationLabel = "Zone 7";
if (LocationSelected == 30) LocationLabel = "Zone 3";
if (LocationSelected == 31) LocationLabel = "Zone 4";
if (LocationSelected == 32) LocationLabel = "Zone 7";
if (LocationSelected == 33) LocationLabel = "Zone 4";
if (LocationSelected == 34) LocationLabel = "Zone 6";
if (LocationSelected == 35) LocationLabel = "Zone 8";
if (LocationSelected == 36) LocationLabel = "Zone 3";
if (LocationSelected == 37) LocationLabel = "Zone 3";
if (LocationSelected == 38) LocationLabel = "Zone 4";
if (LocationSelected == 39) LocationLabel = "Zone 6"; 
if (LocationSelected == 40) LocationLabel = "Zone 5";
if (LocationSelected == 41) LocationLabel = "Zone 7";
if (LocationSelected == 42) LocationLabel = "Zone 8";
if (LocationSelected == 43) LocationLabel = "Zone 4";
if (LocationSelected == 44) LocationLabel = "Zone 4";
if (LocationSelected == 45) LocationLabel = "Zone 8";
if (LocationSelected == 46) LocationLabel = "Zone 4";
if (LocationSelected == 47) LocationLabel = "Zone 5";
if (LocationSelected == 48) LocationLabel = "Zone 7";

if ((fWeight == 0) && (fWeight2 == 0)) fShipping = 0; 
else fShipping = ComputeShipping(LocationSelected, shipValue1, shipValue2, shipValue3, shipValue4, shipValue5, shipValue6, shipValue7, shipValue8, fWeight2); 

strShipping = moneyFormat(fShipping);
strOutput += "<TR bgcolor=#FFFFFF><TD CLASS=\"nopship\" COLSPAN=1 ALIGN=CENTER><font color=\"black\"><B>"+strWTOT+"</B></font></TD>"; 
strOutput += "<TD CLASS=\"nopship\" COLSPAN=5 ALIGN=LEFT><font color=\"black\"><B>" + fWeightTOT + "lbs" + "</B></font></TD>"; 
strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=5 ALIGN=RIGHT><B>"+strSUB+"</B></TD>"; 
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=1 ALIGN=RIGHT><B>" + MonetarySymbol + strTotal + strSpace +"</B></TD>";  
strOutput += "<TD CLASS=\"nopship\" COLSPAN=1 ALIGN=RIGHT></TD>"; 
strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=5 ALIGN=RIGHT><B>" + strSHIP +"&nbsp;&nbsp;" + LocationLabel + "</B></TD>"; 
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=1 ALIGN=RIGHT><B>" + MonetarySymbol + strShipping + strSpace +"</B></TD>"; 
strOutput += "</TR>"; 
} 

if ( DisplayTaxRow || TaxByRegion ) { 
if ( TaxByRegion ) { 
strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=5><B>"+strTAX+"</B></TD>"; 
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=1><B>"; 
strOutput += "<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=5><B>"+strTAX+"</B></TD>"; 
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=1 ALIGN=RIGHT><B>" + MonetarySymbol + strTax + strSpace +"</B></TD>"; 
strOutput += "</TR>"; 
} 
} 

if (LocationSelected != 36 ) fTax = 0.00; 
//sets tax to 0.00 for all areas except 36   

// show the tax row for area 36 
if (LocationSelected == 36 ) { 
strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=5 ALIGN=RIGHT><B>"+strTAX+"</B></TD>"; 
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=1 ALIGN=RIGHT><B>" + MonetarySymbol + strTax + strSpace +"</B></TD>"; 
strOutput += "</TR>"; 
} 

if ( !TaxByRegion ) { 
strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=5 ALIGN=RIGHT><B>"+strTOT+"</B></TD>"; 
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=1 ALIGN=RIGHT><B>" + MonetarySymbol + moneyFormat((fTotal*1)
 + (fShipping*1) + (fTax*1)) + strSpace +"</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)) + "\">"; 
} 
} 
g_TotalCost = (fTotal + fShipping + fTax); 

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

//---------------------------------------------------------------------|| 
// FUNCTION: ComputeShipping                                           || 
// PARAMETERS:                                                         || 
// RETURNS:                                                            || 
// PURPOSE: Compute shipping cost due to total weight                  || 
//---------------------------------------------------------------------|| 
function ComputeShipping(Zone, Ship1, Ship2, Ship3, Ship4, Ship5, Ship6, Ship7, Ship8, fWeight2, fItems) { 
LocationValue = GetCookie("ZoneSelected"); 
if (LocationValue != Zone) { 
SetCookie("ZoneSelected", Zone, null, "/"); 
//location.href=location.href; 
location.reload();
} 
Xship = 0;	
//ZONE 0
if(LocationValue == 0){
return 0;
}
//ZONE 2
if(LocationValue== 51){
return Ship2;
}

//ZONE 3
if ((LocationValue == 6)||(LocationValue== 7)||(LocationValue== 18)||(LocationValue== 28)||(LocationValue== 30)||(LocationValue== 36)||(LocationValue== 37)){
if ( fWeight2 == 1 ) { Xship = ( 3.57 * RateAdjust ); }
if ( fWeight2 == 2 ) { Xship = ( 3.74 * RateAdjust ); }
if ( fWeight2 == 3 ) { Xship = ( 3.91 * RateAdjust ); }
if ( fWeight2 == 4 ) { Xship = ( 4.09 * RateAdjust ); }
if ( fWeight2 == 5 ) { Xship = ( 4.24 * RateAdjust ); }
if ( fWeight2 == 6 ) { Xship = ( 4.35 * RateAdjust ); }
if ( fWeight2 == 7 ) { Xship = ( 4.47 * RateAdjust ); }
if ( fWeight2 == 8 ) { Xship = ( 4.62 * RateAdjust ); }
if ( fWeight2 == 9 ) { Xship = ( 4.76 * RateAdjust ); }
if ( fWeight2 == 10 ) { Xship = ( 5.88 * RateAdjust ); }
if ( fWeight2 == 11 ) { Xship = ( 5.01 * RateAdjust ); }
if ( fWeight2 == 12 ) { Xship = ( 5.18 * RateAdjust ); }
if ( fWeight2 == 13 ) { Xship = ( 5.34 * RateAdjust ); }
if ( fWeight2 == 14 ) { Xship = ( 5.51 * RateAdjust ); }
if ( fWeight2 == 15 ) { Xship = ( 5.69 * RateAdjust ); }
if ( fWeight2 == 16 ) { Xship = ( 5.84 * RateAdjust ); }
if ( fWeight2 == 17 ) { Xship = ( 6.03 * RateAdjust ); }
if ( fWeight2 == 18 ) { Xship = ( 6.23 * RateAdjust ); }
if ( fWeight2 == 19 ) { Xship = ( 6.44 * RateAdjust ); }
if ( fWeight2 == 20 ) { Xship = ( 6.65 * RateAdjust ); }
if ( fWeight2 == 21 ) { Xship = ( 6.86 * RateAdjust ); }
if ( fWeight2 == 22 ) { Xship = ( 7.06 * RateAdjust ); }
if ( fWeight2 == 23 ) { Xship = ( 7.27 * RateAdjust ); }
if ( fWeight2 == 24 ) { Xship = ( 7.46 * RateAdjust ); }
if ( fWeight2 == 25 ) { Xship = ( 7.65 * RateAdjust ); }
if ( fWeight2 == 26 ) { Xship = ( 7.84 * RateAdjust ); }
if ( fWeight2 == 27 ) { Xship = ( 8.01 * RateAdjust ); }
if ( fWeight2 == 28 ) { Xship = ( 8.19 * RateAdjust ); }
if ( fWeight2 == 29 ) { Xship = ( 8.38 * RateAdjust ); }
if ( fWeight2 == 30 ) { Xship = ( 8.57 * RateAdjust ); }
if ( fWeight2 == 31 ) { Xship = ( 8.75 * RateAdjust ); }
if ( fWeight2 == 32 ) { Xship = ( 8.95 * RateAdjust ); }
if ( fWeight2 == 33 ) { Xship = ( 9.14 * RateAdjust ); }
if ( fWeight2 == 34 ) { Xship = ( 9.34 * RateAdjust ); }
if ( fWeight2 == 35 ) { Xship = ( 9.55 * RateAdjust ); }
if ( fWeight2 == 36 ) { Xship = ( 9.74 * RateAdjust ); }
if ( fWeight2 == 37 ) { Xship = ( 9.94 * RateAdjust ); }
if ( fWeight2 == 38 ) { Xship = ( 10.13 * RateAdjust ); }
if ( fWeight2 == 39 ) { Xship = ( 10.33 * RateAdjust ); }
if ( fWeight2 == 40 ) { Xship = ( 10.54 * RateAdjust ); }
if ( fWeight2 == 41 ) { Xship = ( 10.74 * RateAdjust ); }
if ( fWeight2 == 42 ) { Xship = ( 10.93 * RateAdjust ); }
if ( fWeight2 == 43 ) { Xship = ( 11.13 * RateAdjust ); }
if ( fWeight2 == 44 ) { Xship = ( 11.32 * RateAdjust ); }
if ( fWeight2 == 45 ) { Xship = ( 11.51 * RateAdjust ); }
if ( fWeight2 == 46 ) { Xship = ( 11.7 * RateAdjust ); }
if ( fWeight2 == 47 ) { Xship = ( 11.87 * RateAdjust ); }
if ( fWeight2 == 48 ) { Xship = ( 12.03 * RateAdjust ); }
if ( fWeight2 == 49 ) { Xship = ( 12.19 * RateAdjust ); }
if ( fWeight2 == 50 ) { Xship = ( 12.32 * RateAdjust ); }
if ( fWeight2 == 51 ) { Xship = ( 12.44 * RateAdjust ); }
if ( fWeight2 == 52 ) { Xship = ( 12.56 * RateAdjust ); }
if ( fWeight2 == 53 ) { Xship = ( 12.68 * RateAdjust ); }
if ( fWeight2 == 54 ) { Xship = ( 12.79 * RateAdjust ); }
if ( fWeight2 == 55 ) { Xship = ( 12.9 * RateAdjust ); }
if ( fWeight2 == 56 ) { Xship = ( 13.02 * RateAdjust ); }
if ( fWeight2 == 57 ) { Xship = ( 13.15 * RateAdjust ); }
if ( fWeight2 == 58 ) { Xship = ( 13.26 * RateAdjust ); }
if ( fWeight2 == 59 ) { Xship = ( 13.37 * RateAdjust ); }
if ( fWeight2 == 60 ) { Xship = ( 13.48 * RateAdjust ); }
if ( fWeight2 == 61 ) { Xship = ( 13.58 * RateAdjust ); }
if ( fWeight2 == 62 ) { Xship = ( 13.69 * RateAdjust ); }
if ( fWeight2 == 63 ) { Xship = ( 13.79 * RateAdjust ); }
if ( fWeight2 == 64 ) { Xship = ( 13.89 * RateAdjust ); }
if ( fWeight2 == 65 ) { Xship = ( 13.99 * RateAdjust ); }
if ( fWeight2 == 66 ) { Xship = ( 14.09 * RateAdjust ); }
if ( fWeight2 == 67 ) { Xship = ( 14.19 * RateAdjust ); }
if ( fWeight2 == 68 ) { Xship = ( 14.3 * RateAdjust ); }
if ( fWeight2 == 69 ) { Xship = ( 14.4 * RateAdjust ); }
if ( fWeight2 == 70 ) { Xship = ( 14.5 * RateAdjust ); }
if ( fWeight2 == 71 ) { Xship = ( 18.91 * RateAdjust ); }
if ( fWeight2 == 72 ) { Xship = ( 23.23 * RateAdjust ); }
if ( fWeight2 == 73 ) { Xship = ( 26.85 * RateAdjust ); }
if ( fWeight2 == 74 ) { Xship = ( 29.53 * RateAdjust ); }
if ( fWeight2 == 75 ) { Xship = ( 30.93 * RateAdjust ); }
if ( fWeight2 == 76 ) { Xship = ( 32.08 * RateAdjust ); }
if ( fWeight2 == 77 ) { Xship = ( 33.14 * RateAdjust ); }
if ( fWeight2 == 78 ) { Xship = ( 34.13 * RateAdjust ); }
if ( fWeight2 == 79 ) { Xship = ( 35.11 * RateAdjust ); }
if ( fWeight2 == 80 ) { Xship = ( 36.1 * RateAdjust ); }
if ( fWeight2 == 81 ) { Xship = ( 36.62 * RateAdjust ); }
if ( fWeight2 == 82 ) { Xship = ( 37.14 * RateAdjust ); }
if ( fWeight2 == 83 ) { Xship = ( 37.64 * RateAdjust ); }
if ( fWeight2 == 84 ) { Xship = ( 38.14 * RateAdjust ); }
if ( fWeight2 == 85 ) { Xship = ( 38.62 * RateAdjust ); }
if ( fWeight2 == 86 ) { Xship = ( 39.09 * RateAdjust ); }
if ( fWeight2 == 87 ) { Xship = ( 39.56 * RateAdjust ); }
if ( fWeight2 == 88 ) { Xship = ( 40.03 * RateAdjust ); }
if ( fWeight2 == 89 ) { Xship = ( 40.5 * RateAdjust ); }
if ( fWeight2 == 90 ) { Xship = ( 40.96 * RateAdjust ); }
if ( fWeight2 == 91 ) { Xship = ( 41.43 * RateAdjust ); }
if ( fWeight2 == 92 ) { Xship = ( 41.9 * RateAdjust ); }
if ( fWeight2 == 93 ) { Xship = ( 42.37 * RateAdjust ); }
if ( fWeight2 == 94 ) { Xship = ( 42.84 * RateAdjust ); }
if ( fWeight2 == 95 ) { Xship = ( 43.29 * RateAdjust ); }
if ( fWeight2 == 96 ) { Xship = ( 43.7 * RateAdjust ); }
if ( fWeight2 == 97 ) { Xship = ( 44.11 * RateAdjust ); }
if ( fWeight2 == 98 ) { Xship = ( 44.52 * RateAdjust ); }
if ( fWeight2 == 99 ) { Xship = ( 44.93 * RateAdjust ); }
if ( fWeight2 == 100 ) { Xship = ( 45.34 * RateAdjust ); }
if ( fWeight2 == 101 ) { Xship = ( 45.74 * RateAdjust ); }
if ( fWeight2 == 102 ) { Xship = ( 46.15 * RateAdjust ); }
if ( fWeight2 == 103 ) { Xship = ( 46.56 * RateAdjust ); }
if ( fWeight2 == 104 ) { Xship = ( 46.97 * RateAdjust ); }
if ( fWeight2 == 105 ) { Xship = ( 47.37 * RateAdjust ); }
if ( fWeight2 == 106 ) { Xship = ( 47.78 * RateAdjust ); }
if ( fWeight2 == 107 ) { Xship = ( 48.19 * RateAdjust ); }
if ( fWeight2 == 108 ) { Xship = ( 48.6 * RateAdjust ); }
if ( fWeight2 == 109 ) { Xship = ( 49 * RateAdjust ); }
if ( fWeight2 == 110 ) { Xship = ( 49.41 * RateAdjust ); }
if ( fWeight2 == 111 ) { Xship = ( 49.82 * RateAdjust ); }
if ( fWeight2 == 112 ) { Xship = ( 50.23 * RateAdjust ); }
if ( fWeight2 == 113 ) { Xship = ( 50.63 * RateAdjust ); }
if ( fWeight2 == 114 ) { Xship = ( 51.04 * RateAdjust ); }
if ( fWeight2 == 115 ) { Xship = ( 51.45 * RateAdjust ); }
if ( fWeight2 == 116 ) { Xship = ( 51.86 * RateAdjust ); }
if ( fWeight2 == 117 ) { Xship = ( 52.26 * RateAdjust ); }
if ( fWeight2 == 118 ) { Xship = ( 52.67 * RateAdjust ); }
if ( fWeight2 == 119 ) { Xship = ( 53.08 * RateAdjust ); }
if ( fWeight2 == 120 ) { Xship = ( 53.49 * RateAdjust ); }
if ( fWeight2 == 121 ) { Xship = ( 53.89 * RateAdjust ); }
if ( fWeight2 == 122 ) { Xship = ( 54.3 * RateAdjust ); }
if ( fWeight2 == 123 ) { Xship = ( 54.71 * RateAdjust ); }
if ( fWeight2 == 124 ) { Xship = ( 55.12 * RateAdjust ); }
if ( fWeight2 == 125 ) { Xship = ( 55.53 * RateAdjust ); }
if ( fWeight2 == 126 ) { Xship = ( 55.93 * RateAdjust ); }
if ( fWeight2 == 127 ) { Xship = ( 56.34 * RateAdjust ); }
if ( fWeight2 == 128 ) { Xship = ( 56.75 * RateAdjust ); }
if ( fWeight2 == 129 ) { Xship = ( 57.16 * RateAdjust ); }
if ( fWeight2 == 130 ) { Xship = ( 57.56 * RateAdjust ); }
if ( fWeight2 == 131 ) { Xship = ( 57.97 * RateAdjust ); }
if ( fWeight2 == 132 ) { Xship = ( 58.38 * RateAdjust ); }
if ( fWeight2 == 133 ) { Xship = ( 58.79 * RateAdjust ); }
if ( fWeight2 == 134 ) { Xship = ( 59.19 * RateAdjust ); }
if ( fWeight2 == 135 ) { Xship = ( 59.6 * RateAdjust ); }
if ( fWeight2 == 136 ) { Xship = ( 60.01 * RateAdjust ); }
if ( fWeight2 == 137 ) { Xship = ( 60.42 * RateAdjust ); }
if ( fWeight2 == 138 ) { Xship = ( 60.82 * RateAdjust ); }
if ( fWeight2 == 139 ) { Xship = ( 61.23 * RateAdjust ); }
if ( fWeight2 == 140 ) { Xship = ( 61.64 * RateAdjust ); }
if ( fWeight2 == 141 ) { Xship = ( 62.05 * RateAdjust ); }
if ( fWeight2 == 142 ) { Xship = ( 62.45 * RateAdjust ); }
if ( fWeight2 == 143 ) { Xship = ( 62.86 * RateAdjust ); }
if ( fWeight2 == 144 ) { Xship = ( 63.27 * RateAdjust ); }
if ( fWeight2 == 145 ) { Xship = ( 63.68 * RateAdjust ); }
if ( fWeight2 == 146 ) { Xship = ( 64.08 * RateAdjust ); }
if ( fWeight2 == 147 ) { Xship = ( 64.49 * RateAdjust ); }
if ( fWeight2 == 148 ) { Xship = ( 64.9 * RateAdjust ); }
if ( fWeight2 == 149 ) { Xship = ( 65.31 * RateAdjust ); }
if ( fWeight2 == 150 ) { Xship = ( 65.72 * RateAdjust ); }
Ship3 += Xship;
if(Ship3 == 0){
return Ship1;
}
return Ship3;
}

//ZONE 4
if((LocationValue == 17)||(LocationValue== 19)||(LocationValue==27)||(LocationValue== 31)||(LocationValue==33)||(LocationValue==38)||(LocationValue==43)||(LocationValue==44)||(LocationValue==46)){
if ( fWeight2 == 1 ) { Xship = ( 3.81 * RateAdjust ); }
if ( fWeight2 == 2 ) { Xship = ( 4.13 * RateAdjust ); }
if ( fWeight2 == 3 ) { Xship = ( 4.36 * RateAdjust ); }
if ( fWeight2 == 4 ) { Xship = ( 4.59 * RateAdjust ); }
if ( fWeight2 == 5 ) { Xship = ( 4.80 * RateAdjust ); }
if ( fWeight2 == 6 ) { Xship = ( 4.91 * RateAdjust ); }
if ( fWeight2 == 7 ) { Xship = ( 5.03 * RateAdjust ); }
if ( fWeight2 == 8 ) { Xship = ( 5.16 * RateAdjust ); }
if ( fWeight2 == 9 ) { Xship = ( 5.28 * RateAdjust ); }
if ( fWeight2 == 10 ) { Xship = ( 5.39 * RateAdjust ); }
if ( fWeight2 == 11 ) { Xship = ( 5.50 * RateAdjust ); }
if ( fWeight2 == 12 ) { Xship = ( 5.61 * RateAdjust ); }
if ( fWeight2 == 13 ) { Xship = ( 5.73 * RateAdjust ); }
if ( fWeight2 == 14 ) { Xship = ( 5.83 * RateAdjust ); }
if ( fWeight2 == 15 ) { Xship = ( 5.93 * RateAdjust ); }
if ( fWeight2 == 16 ) { Xship = ( 6.07 * RateAdjust ); }
if ( fWeight2 == 17 ) { Xship = ( 6.26 * RateAdjust ); }
if ( fWeight2 == 18 ) { Xship = ( 6.47 * RateAdjust ); }
if ( fWeight2 == 19 ) { Xship = ( 6.71 * RateAdjust ); }
if ( fWeight2 == 20 ) { Xship = ( 6.94 * RateAdjust ); }
if ( fWeight2 == 21 ) { Xship = ( 7.17 * RateAdjust ); }
if ( fWeight2 == 22 ) { Xship = ( 7.42 * RateAdjust ); }
if ( fWeight2 == 23 ) { Xship = ( 7.66 * RateAdjust ); }
if ( fWeight2 == 24 ) { Xship = ( 7.91 * RateAdjust ); }
if ( fWeight2 == 25 ) { Xship = ( 8.15 * RateAdjust ); }
if ( fWeight2 == 26 ) { Xship = ( 8.4 * RateAdjust ); }
if ( fWeight2 == 27 ) { Xship = ( 8.64 * RateAdjust ); }
if ( fWeight2 == 28 ) { Xship = ( 8.9 * RateAdjust ); }
if ( fWeight2 == 29 ) { Xship = ( 9.15 * RateAdjust ); }
if ( fWeight2 == 30 ) { Xship = ( 9.41 * RateAdjust ); }
if ( fWeight2 == 31 ) { Xship = ( 9.66 * RateAdjust ); }
if ( fWeight2 == 32 ) { Xship = ( 9.91 * RateAdjust ); }
if ( fWeight2 == 33 ) { Xship = ( 10.17 * RateAdjust ); }
if ( fWeight2 == 34 ) { Xship = ( 10.42 * RateAdjust ); }
if ( fWeight2 == 35 ) { Xship = ( 10.67 * RateAdjust ); }
if ( fWeight2 == 36 ) { Xship = ( 10.91 * RateAdjust ); }
if ( fWeight2 == 37 ) { Xship = ( 11.16 * RateAdjust ); }
if ( fWeight2 == 38 ) { Xship = ( 11.4 * RateAdjust ); }
if ( fWeight2 == 39 ) { Xship = ( 11.65 * RateAdjust ); }
if ( fWeight2 == 40 ) { Xship = ( 11.89 * RateAdjust ); }
if ( fWeight2 == 41 ) { Xship = ( 12.14 * RateAdjust ); }
if ( fWeight2 == 42 ) { Xship = ( 12.38 * RateAdjust ); }
if ( fWeight2 == 43 ) { Xship = ( 12.62 * RateAdjust ); }
if ( fWeight2 == 44 ) { Xship = ( 12.84 * RateAdjust ); }
if ( fWeight2 == 45 ) { Xship = ( 13.06 * RateAdjust ); }
if ( fWeight2 == 46 ) { Xship = ( 13.28 * RateAdjust ); }
if ( fWeight2 == 47 ) { Xship = ( 13.49 * RateAdjust ); }
if ( fWeight2 == 48 ) { Xship = ( 13.7 * RateAdjust ); }
if ( fWeight2 == 49 ) { Xship = ( 13.9 * RateAdjust ); }
if ( fWeight2 == 50 ) { Xship = ( 14.09 * RateAdjust ); }
if ( fWeight2 == 51 ) { Xship = ( 14.28 * RateAdjust ); }
if ( fWeight2 == 52 ) { Xship = ( 14.46 * RateAdjust ); }
if ( fWeight2 == 53 ) { Xship = ( 14.63 * RateAdjust ); }
if ( fWeight2 == 54 ) { Xship = ( 14.81 * RateAdjust ); }
if ( fWeight2 == 55 ) { Xship = ( 14.97 * RateAdjust ); }
if ( fWeight2 == 56 ) { Xship = ( 15.13 * RateAdjust ); }
if ( fWeight2 == 57 ) { Xship = ( 15.29 * RateAdjust ); }
if ( fWeight2 == 58 ) { Xship = ( 15.43 * RateAdjust ); }
if ( fWeight2 == 59 ) { Xship = ( 15.57 * RateAdjust ); }
if ( fWeight2 == 60 ) { Xship = ( 15.71 * RateAdjust ); }
if ( fWeight2 == 61 ) { Xship = ( 15.85 * RateAdjust ); }
if ( fWeight2 == 62 ) { Xship = ( 15.97 * RateAdjust ); }
if ( fWeight2 == 63 ) { Xship = ( 16.09 * RateAdjust ); }
if ( fWeight2 == 64 ) { Xship = ( 16.2 * RateAdjust ); }
if ( fWeight2 == 65 ) { Xship = ( 16.31 * RateAdjust ); }
if ( fWeight2 == 66 ) { Xship = ( 16.43 * RateAdjust ); }
if ( fWeight2 == 67 ) { Xship = ( 16.54 * RateAdjust ); }
if ( fWeight2 == 68 ) { Xship = ( 16.65 * RateAdjust ); }
if ( fWeight2 == 69 ) { Xship = ( 16.76 * RateAdjust ); }
if ( fWeight2 == 70 ) { Xship = ( 16.87 * RateAdjust ); }
if ( fWeight2 == 71 ) { Xship = ( 21.06 * RateAdjust ); }
if ( fWeight2 == 72 ) { Xship = ( 25.14 * RateAdjust ); }
if ( fWeight2 == 73 ) { Xship = ( 28.63 * RateAdjust ); }
if ( fWeight2 == 74 ) { Xship = ( 31.26 * RateAdjust ); }
if ( fWeight2 == 75 ) { Xship = ( 33.12 * RateAdjust ); }
if ( fWeight2 == 76 ) { Xship = ( 33.86 * RateAdjust ); }
if ( fWeight2 == 77 ) { Xship = ( 34.63 * RateAdjust ); }
if ( fWeight2 == 78 ) { Xship = ( 35.33 * RateAdjust ); }
if ( fWeight2 == 79 ) { Xship = ( 35.98 * RateAdjust ); }
if ( fWeight2 == 80 ) { Xship = ( 36.55 * RateAdjust ); }
if ( fWeight2 == 81 ) { Xship = ( 37.08 * RateAdjust ); }
if ( fWeight2 == 82 ) { Xship = ( 37.59 * RateAdjust ); }
if ( fWeight2 == 83 ) { Xship = ( 38.09 * RateAdjust ); }
if ( fWeight2 == 84 ) { Xship = ( 38.59 * RateAdjust ); }
if ( fWeight2 == 85 ) { Xship = ( 39.07 * RateAdjust ); }
if ( fWeight2 == 86 ) { Xship = ( 39.55 * RateAdjust ); }
if ( fWeight2 == 87 ) { Xship = ( 40.03 * RateAdjust ); }
if ( fWeight2 == 88 ) { Xship = ( 40.5 * RateAdjust ); }
if ( fWeight2 == 89 ) { Xship = ( 40.96 * RateAdjust ); }
if ( fWeight2 == 90 ) { Xship = ( 41.43 * RateAdjust ); }
if ( fWeight2 == 91 ) { Xship = ( 41.89 * RateAdjust ); }
if ( fWeight2 == 92 ) { Xship = ( 42.34 * RateAdjust ); }
if ( fWeight2 == 93 ) { Xship = ( 42.79 * RateAdjust ); }
if ( fWeight2 == 94 ) { Xship = ( 43.23 * RateAdjust ); }
if ( fWeight2 == 95 ) { Xship = ( 43.65 * RateAdjust ); }
if ( fWeight2 == 96 ) { Xship = ( 44.08 * RateAdjust ); }
if ( fWeight2 == 97 ) { Xship = ( 44.51 * RateAdjust ); }
if ( fWeight2 == 98 ) { Xship = ( 44.94 * RateAdjust ); }
if ( fWeight2 == 99 ) { Xship = ( 45.37 * RateAdjust ); }
if ( fWeight2 == 100 ) { Xship = ( 45.79 * RateAdjust ); }
if ( fWeight2 == 101 ) { Xship = ( 46.21 * RateAdjust ); }
if ( fWeight2 == 102 ) { Xship = ( 46.63 * RateAdjust ); }
if ( fWeight2 == 103 ) { Xship = ( 47.05 * RateAdjust ); }
if ( fWeight2 == 104 ) { Xship = ( 47.47 * RateAdjust ); }
if ( fWeight2 == 105 ) { Xship = ( 47.88 * RateAdjust ); }
if ( fWeight2 == 106 ) { Xship = ( 48.3 * RateAdjust ); }
if ( fWeight2 == 107 ) { Xship = ( 48.72 * RateAdjust ); }
if ( fWeight2 == 108 ) { Xship = ( 49.14 * RateAdjust ); }
if ( fWeight2 == 109 ) { Xship = ( 49.55 * RateAdjust ); }
if ( fWeight2 == 110 ) { Xship = ( 49.97 * RateAdjust ); }
if ( fWeight2 == 111 ) { Xship = ( 50.39 * RateAdjust ); }
if ( fWeight2 == 112 ) { Xship = ( 50.81 * RateAdjust ); }
if ( fWeight2 == 113 ) { Xship = ( 51.23 * RateAdjust ); }
if ( fWeight2 == 114 ) { Xship = ( 51.64 * RateAdjust ); }
if ( fWeight2 == 115 ) { Xship = ( 52.06 * RateAdjust ); }
if ( fWeight2 == 116 ) { Xship = ( 52.48 * RateAdjust ); }
if ( fWeight2 == 117 ) { Xship = ( 52.9 * RateAdjust ); }
if ( fWeight2 == 118 ) { Xship = ( 53.31 * RateAdjust ); }
if ( fWeight2 == 119 ) { Xship = ( 53.73 * RateAdjust ); }
if ( fWeight2 == 120 ) { Xship = ( 54.15 * RateAdjust ); }
if ( fWeight2 == 121 ) { Xship = ( 54.57 * RateAdjust ); }
if ( fWeight2 == 122 ) { Xship = ( 54.99 * RateAdjust ); }
if ( fWeight2 == 123 ) { Xship = ( 55.4 * RateAdjust ); }
if ( fWeight2 == 124 ) { Xship = ( 55.82 * RateAdjust ); }
if ( fWeight2 == 125 ) { Xship = ( 56.24 * RateAdjust ); }
if ( fWeight2 == 126 ) { Xship = ( 56.66 * RateAdjust ); }
if ( fWeight2 == 127 ) { Xship = ( 57.07 * RateAdjust ); }
if ( fWeight2 == 128 ) { Xship = ( 57.49 * RateAdjust ); }
if ( fWeight2 == 129 ) { Xship = ( 57.91 * RateAdjust ); }
if ( fWeight2 == 130 ) { Xship = ( 58.33 * RateAdjust ); }
if ( fWeight2 == 131 ) { Xship = ( 58.75 * RateAdjust ); }
if ( fWeight2 == 132 ) { Xship = ( 59.16 * RateAdjust ); }
if ( fWeight2 == 133 ) { Xship = ( 59.58 * RateAdjust ); }
if ( fWeight2 == 134 ) { Xship = ( 60 * RateAdjust ); }
if ( fWeight2 == 135 ) { Xship = ( 60.42 * RateAdjust ); }
if ( fWeight2 == 136 ) { Xship = ( 60.83 * RateAdjust ); }
if ( fWeight2 == 137 ) { Xship = ( 61.25 * RateAdjust ); }
if ( fWeight2 == 138 ) { Xship = ( 61.67 * RateAdjust ); }
if ( fWeight2 == 139 ) { Xship = ( 62.09 * RateAdjust ); }
if ( fWeight2 == 140 ) { Xship = ( 62.51 * RateAdjust ); }
if ( fWeight2 == 141 ) { Xship = ( 62.92 * RateAdjust ); }
if ( fWeight2 == 142 ) { Xship = ( 63.34 * RateAdjust ); }
if ( fWeight2 == 143 ) { Xship = ( 63.76 * RateAdjust ); }
if ( fWeight2 == 144 ) { Xship = ( 64.18 * RateAdjust ); }
if ( fWeight2 == 145 ) { Xship = ( 64.59 * RateAdjust ); }
if ( fWeight2 == 146 ) { Xship = ( 65.01 * RateAdjust ); }
if ( fWeight2 == 147 ) { Xship = ( 65.43 * RateAdjust ); }
if ( fWeight2 == 148 ) { Xship = ( 65.85 * RateAdjust ); }
if ( fWeight2 == 149 ) { Xship = ( 66.27 * RateAdjust ); }
if ( fWeight2 == 150 ) { Xship = ( 66.68 * RateAdjust ); }
Ship4 += Xship;
if(Ship4 == 0){
return Ship1;
}
return Ship4;
}

//ZONE 5
if((LocationValue == 1)||(LocationValue==9)||(LocationValue==11)||(LocationValue==12)||(LocationValue==15)||(LocationValue==20)||(LocationValue==22)||(LocationValue==23)||(LocationValue==40)||(LocationValue==47)){
if ( fWeight2 == 1 ) { Xship = ( 3.89 * RateAdjust ); }
if ( fWeight2 == 2 ) { Xship = ( 4.24 * RateAdjust ); }
if ( fWeight2 == 3 ) { Xship = ( 4.54 * RateAdjust ); }
if ( fWeight2 == 4 ) { Xship = ( 4.82 * RateAdjust ); }
if ( fWeight2 == 5 ) { Xship = ( 5.05 * RateAdjust ); }
if ( fWeight2 == 6 ) { Xship = ( 5.23 * RateAdjust ); }
if ( fWeight2 == 7 ) { Xship = ( 5.41 * RateAdjust ); }
if ( fWeight2 == 8 ) { Xship = ( 5.54 * RateAdjust ); }
if ( fWeight2 == 9 ) { Xship = ( 5.68 * RateAdjust ); }
if ( fWeight2 == 10 ) { Xship = ( 5.84 * RateAdjust ); }
if ( fWeight2 == 11 ) { Xship = ( 6.00 * RateAdjust ); }
if ( fWeight2 == 12 ) { Xship = ( 6.16 * RateAdjust ); }
if ( fWeight2 == 13 ) { Xship = ( 6.3 * RateAdjust ); }
if ( fWeight2 == 14 ) { Xship = ( 6.44 * RateAdjust ); }
if ( fWeight2 == 15 ) { Xship = ( 6.59 * RateAdjust ); }	
if ( fWeight2 == 16 ) { Xship = ( 6.78 * RateAdjust ); }
if ( fWeight2 == 17 ) { Xship = ( 7.06 * RateAdjust ); }	
if ( fWeight2 == 18 ) { Xship = ( 7.41 * RateAdjust ); }
if ( fWeight2 == 19 ) { Xship = ( 7.75 * RateAdjust ); }
if ( fWeight2 == 20 ) { Xship = ( 8.11 * RateAdjust ); }
if ( fWeight2 == 21 ) { Xship = ( 8.46 * RateAdjust ); }
if ( fWeight2 == 22 ) { Xship = ( 8.78 * RateAdjust ); }
if ( fWeight2 == 23 ) { Xship = ( 9.09 * RateAdjust ); }
if ( fWeight2 == 24 ) { Xship = ( 9.38 * RateAdjust ); }
if ( fWeight2 == 25 ) { Xship = ( 9.67 * RateAdjust ); }
if ( fWeight2 == 26 ) { Xship = ( 9.97 * RateAdjust ); }
if ( fWeight2 == 27 ) { Xship = ( 10.26 * RateAdjust ); }
if ( fWeight2 == 28 ) { Xship = ( 10.57 * RateAdjust ); }
if ( fWeight2 == 29 ) { Xship = ( 10.88 * RateAdjust ); }
if ( fWeight2 == 30 ) { Xship = ( 11.2 * RateAdjust ); }
if ( fWeight2 == 31 ) { Xship = ( 11.51 * RateAdjust ); }
if ( fWeight2 == 32 ) { Xship = ( 11.83 * RateAdjust ); }
if ( fWeight2 == 33 ) { Xship = ( 12.15 * RateAdjust ); }
if ( fWeight2 == 34 ) { Xship = ( 12.46 * RateAdjust ); }
if ( fWeight2 == 35 ) { Xship = ( 12.78 * RateAdjust ); }
if ( fWeight2 == 36 ) { Xship = ( 13.09 * RateAdjust ); }
if ( fWeight2 == 37 ) { Xship = ( 13.41 * RateAdjust ); }
if ( fWeight2 == 38 ) { Xship = ( 13.73 * RateAdjust ); }
if ( fWeight2 == 39 ) { Xship = ( 14.04 * RateAdjust ); }
if ( fWeight2 == 40 ) { Xship = ( 14.36 * RateAdjust ); }
if ( fWeight2 == 41 ) { Xship = ( 14.67 * RateAdjust ); }
if ( fWeight2 == 42 ) { Xship = ( 14.99 * RateAdjust ); }
if ( fWeight2 == 43 ) { Xship = ( 15.31 * RateAdjust ); }
if ( fWeight2 == 44 ) { Xship = ( 15.62 * RateAdjust ); }
if ( fWeight2 == 45 ) { Xship = ( 15.94 * RateAdjust ); }
if ( fWeight2 == 46 ) { Xship = ( 16.24 * RateAdjust ); }
if ( fWeight2 == 47 ) { Xship = ( 16.53 * RateAdjust ); }
if ( fWeight2 == 48 ) { Xship = ( 16.81 * RateAdjust ); }
if ( fWeight2 == 49 ) { Xship = ( 17.1 * RateAdjust ); }
if ( fWeight2 == 50 ) { Xship = ( 17.36 * RateAdjust ); }
if ( fWeight2 == 51 ) { Xship = ( 17.61 * RateAdjust ); }
if ( fWeight2 == 52 ) { Xship = ( 17.85 * RateAdjust ); }
if ( fWeight2 == 53 ) { Xship = ( 18.09 * RateAdjust ); }
if ( fWeight2 == 54 ) { Xship = ( 18.31 * RateAdjust ); }
if ( fWeight2 == 55 ) { Xship = ( 18.54 * RateAdjust ); }
if ( fWeight2 == 56 ) { Xship = ( 18.76 * RateAdjust ); }
if ( fWeight2 == 57 ) { Xship = ( 18.97 * RateAdjust ); }
if ( fWeight2 == 58 ) { Xship = ( 19.18 * RateAdjust ); }
if ( fWeight2 == 59 ) { Xship = ( 19.36 * RateAdjust ); }
if ( fWeight2 == 60 ) { Xship = ( 19.5 * RateAdjust ); }
if ( fWeight2 == 61 ) { Xship = ( 19.64 * RateAdjust ); }
if ( fWeight2 == 62 ) { Xship = ( 19.77 * RateAdjust ); }
if ( fWeight2 == 63 ) { Xship = ( 19.9 * RateAdjust ); }
if ( fWeight2 == 64 ) { Xship = ( 20.03 * RateAdjust ); }
if ( fWeight2 == 65 ) { Xship = ( 20.17 * RateAdjust ); }
if ( fWeight2 == 66 ) { Xship = ( 20.3 * RateAdjust ); }
if ( fWeight2 == 67 ) { Xship = ( 20.43 * RateAdjust ); }
if ( fWeight2 == 68 ) { Xship = ( 20.56 * RateAdjust ); }
if ( fWeight2 == 69 ) { Xship = ( 20.7 * RateAdjust ); }
if ( fWeight2 == 70 ) { Xship = ( 20.83 * RateAdjust ); }
if ( fWeight2 == 71 ) { Xship = ( 23.32 * RateAdjust ); }
if ( fWeight2 == 72 ) { Xship = ( 26.25 * RateAdjust ); }
if ( fWeight2 == 73 ) { Xship = ( 29.16 * RateAdjust ); }
if ( fWeight2 == 74 ) { Xship = ( 32.07 * RateAdjust ); }
if ( fWeight2 == 75 ) { Xship = ( 33.82 * RateAdjust ); }
if ( fWeight2 == 76 ) { Xship = ( 34.93 * RateAdjust ); }
if ( fWeight2 == 77 ) { Xship = ( 35.86 * RateAdjust ); }
if ( fWeight2 == 78 ) { Xship = ( 36.64 * RateAdjust ); }
if ( fWeight2 == 79 ) { Xship = ( 37.28 * RateAdjust ); }
if ( fWeight2 == 80 ) { Xship = ( 37.78 * RateAdjust ); }
if ( fWeight2 == 81 ) { Xship = ( 38.25 * RateAdjust ); }
if ( fWeight2 == 82 ) { Xship = ( 38.72 * RateAdjust ); }
if ( fWeight2 == 83 ) { Xship = ( 39.19 * RateAdjust ); }
if ( fWeight2 == 84 ) { Xship = ( 39.66 * RateAdjust ); }
if ( fWeight2 == 85 ) { Xship = ( 40.13 * RateAdjust ); }
if ( fWeight2 == 86 ) { Xship = ( 40.59 * RateAdjust ); }
if ( fWeight2 == 87 ) { Xship = ( 41.05 * RateAdjust ); }
if ( fWeight2 == 88 ) { Xship = ( 41.5 * RateAdjust ); }
if ( fWeight2 == 89 ) { Xship = ( 41.96 * RateAdjust ); }
if ( fWeight2 == 90 ) { Xship = ( 42.42 * RateAdjust ); }
if ( fWeight2 == 91 ) { Xship = ( 42.89 * RateAdjust ); }
if ( fWeight2 == 92 ) { Xship = ( 43.36 * RateAdjust ); }
if ( fWeight2 == 93 ) { Xship = ( 43.83 * RateAdjust ); }
if ( fWeight2 == 94 ) { Xship = ( 44.3 * RateAdjust ); }
if ( fWeight2 == 95 ) { Xship = ( 44.76 * RateAdjust ); }
if ( fWeight2 == 96 ) { Xship = ( 45.23 * RateAdjust ); }
if ( fWeight2 == 97 ) { Xship = ( 45.7 * RateAdjust ); }
if ( fWeight2 == 98 ) { Xship = ( 46.16 * RateAdjust ); }
if ( fWeight2 == 99 ) { Xship = ( 46.62 * RateAdjust ); }
if ( fWeight2 == 100 ) { Xship = ( 47.07 * RateAdjust ); }
if ( fWeight2 == 101 ) { Xship = ( 47.48 * RateAdjust ); }
if ( fWeight2 == 102 ) { Xship = ( 47.88 * RateAdjust ); }
if ( fWeight2 == 103 ) { Xship = ( 48.29 * RateAdjust ); }
if ( fWeight2 == 104 ) { Xship = ( 48.7 * RateAdjust ); }
if ( fWeight2 == 105 ) { Xship = ( 49.11 * RateAdjust ); }
if ( fWeight2 == 106 ) { Xship = ( 49.5 * RateAdjust ); }
if ( fWeight2 == 107 ) { Xship = ( 49.9 * RateAdjust ); }
if ( fWeight2 == 108 ) { Xship = ( 50.3 * RateAdjust ); }
if ( fWeight2 == 109 ) { Xship = ( 50.7 * RateAdjust ); }
if ( fWeight2 == 110 ) { Xship = ( 51.09 * RateAdjust ); }
if ( fWeight2 == 111 ) { Xship = ( 51.49 * RateAdjust ); }
if ( fWeight2 == 112 ) { Xship = ( 51.89 * RateAdjust ); }
if ( fWeight2 == 113 ) { Xship = ( 52.28 * RateAdjust ); }
if ( fWeight2 == 114 ) { Xship = ( 52.68 * RateAdjust ); }
if ( fWeight2 == 115 ) { Xship = ( 53.08 * RateAdjust ); }
if ( fWeight2 == 116 ) { Xship = ( 53.48 * RateAdjust ); }
if ( fWeight2 == 117 ) { Xship = ( 53.87 * RateAdjust ); }
if ( fWeight2 == 118 ) { Xship = ( 54.27 * RateAdjust ); }
if ( fWeight2 == 119 ) { Xship = ( 54.67 * RateAdjust ); }
if ( fWeight2 == 120 ) { Xship = ( 55.07 * RateAdjust ); }
if ( fWeight2 == 121 ) { Xship = ( 55.46 * RateAdjust ); }
if ( fWeight2 == 122 ) { Xship = ( 55.86 * RateAdjust ); }
if ( fWeight2 == 123 ) { Xship = ( 56.26 * RateAdjust ); }
if ( fWeight2 == 124 ) { Xship = ( 56.66 * RateAdjust ); }
if ( fWeight2 == 125 ) { Xship = ( 57.05 * RateAdjust ); }
if ( fWeight2 == 126 ) { Xship = ( 57.45 * RateAdjust ); }
if ( fWeight2 == 127 ) { Xship = ( 57.85 * RateAdjust ); }
if ( fWeight2 == 128 ) { Xship = ( 58.25 * RateAdjust ); }
if ( fWeight2 == 129 ) { Xship = ( 58.64 * RateAdjust ); }
if ( fWeight2 == 130 ) { Xship = ( 59.04 * RateAdjust ); }
if ( fWeight2 == 131 ) { Xship = ( 59.44 * RateAdjust ); }
if ( fWeight2 == 132 ) { Xship = ( 59.84 * RateAdjust ); }
if ( fWeight2 == 133 ) { Xship = ( 60.23 * RateAdjust ); }
if ( fWeight2 == 134 ) { Xship = ( 60.63 * RateAdjust ); }
if ( fWeight2 == 135 ) { Xship = ( 61.03 * RateAdjust ); }
if ( fWeight2 == 136 ) { Xship = ( 61.43 * RateAdjust ); }
if ( fWeight2 == 137 ) { Xship = ( 61.82 * RateAdjust ); }
if ( fWeight2 == 138 ) { Xship = ( 62.22 * RateAdjust ); }
if ( fWeight2 == 139 ) { Xship = ( 62.62 * RateAdjust ); }
if ( fWeight2 == 140 ) { Xship = ( 63.01 * RateAdjust ); }
if ( fWeight2 == 141 ) { Xship = ( 63.41 * RateAdjust ); }
if ( fWeight2 == 142 ) { Xship = ( 63.81 * RateAdjust ); }
if ( fWeight2 == 143 ) { Xship = ( 64.21 * RateAdjust ); }
if ( fWeight2 == 144 ) { Xship = ( 64.6 * RateAdjust ); }
if ( fWeight2 == 145 ) { Xship = ( 65 * RateAdjust ); }
if ( fWeight2 == 146 ) { Xship = ( 65.4 * RateAdjust ); }
if ( fWeight2 == 147 ) { Xship = ( 65.8 * RateAdjust ); }
if ( fWeight2 == 148 ) { Xship = ( 66.19 * RateAdjust ); }
if ( fWeight2 == 149 ) { Xship = ( 66.59 * RateAdjust ); }
if ( fWeight2 == 150 ) { Xship = ( 66.99 * RateAdjust ); }
Ship5 += Xship;	
if(Ship5 == 0){
return Ship1;
}
return Ship5;
}

//ZONE 6
if ((LocationValue == 3)||(LocationValue == 8)||(LocationValue == 13)||(LocationValue == 14)||(LocationValue == 16)||(LocationValue == 21)||(LocationValue == 25)||(LocationValue == 34)||(LocationValue == 39)){
if ( fWeight2 == 1 ) { Xship = ( 4.10 * RateAdjust ); }
if ( fWeight2 == 2 ) { Xship = ( 4.57 * RateAdjust ); }
if ( fWeight2 == 3 ) { Xship = ( 4.87 * RateAdjust ); }
if ( fWeight2 == 4 ) { Xship = ( 5.16 * RateAdjust ); }
if ( fWeight2 == 5 ) { Xship = ( 5.40 * RateAdjust ); }
if ( fWeight2 == 6 ) { Xship = ( 5.58 * RateAdjust ); }
if ( fWeight2 == 7 ) { Xship = ( 5.80 * RateAdjust ); }
if ( fWeight2 == 8 ) { Xship = ( 5.99 * RateAdjust ); }
if ( fWeight2 == 9 ) { Xship = ( 6.15 * RateAdjust ); }
if ( fWeight2 == 10 ) { Xship = ( 6.40 * RateAdjust ); }
if ( fWeight2 == 11 ) { Xship = ( 6.68 * RateAdjust ); }
if ( fWeight2 == 12 ) { Xship = ( 6.98 * RateAdjust ); }
if ( fWeight2 == 13 ) { Xship = ( 7.32 * RateAdjust ); }
if ( fWeight2 == 14 ) { Xship = ( 7.72 * RateAdjust ); }
if ( fWeight2 == 15 ) { Xship = ( 8.13 * RateAdjust ); }
if ( fWeight2 == 16 ) { Xship = ( 8.51 * RateAdjust ); }
if ( fWeight2 == 17 ) { Xship = ( 8.94 * RateAdjust ); }
if ( fWeight2 == 18 ) { Xship = ( 9.36 * RateAdjust ); }
if ( fWeight2 == 19 ) { Xship = ( 9.79 * RateAdjust ); }
if ( fWeight2 == 20 ) { Xship = ( 10.22 * RateAdjust ); }
if ( fWeight2 == 21 ) { Xship = ( 10.65 * RateAdjust ); }
if ( fWeight2 == 22 ) { Xship = ( 11.08 * RateAdjust ); }
if ( fWeight2 == 23 ) { Xship = ( 11.50 * RateAdjust ); }
if ( fWeight2 == 24 ) { Xship = ( 11.93 * RateAdjust ); }
if ( fWeight2 == 25 ) { Xship = ( 12.36 * RateAdjust ); }
if ( fWeight2 == 26 ) { Xship = ( 12.79 * RateAdjust ); }
if ( fWeight2 == 27 ) { Xship = ( 13.22 * RateAdjust ); }
if ( fWeight2 == 28 ) { Xship = ( 13.64 * RateAdjust ); }
if ( fWeight2 == 29 ) { Xship = ( 14.07 * RateAdjust ); }
if ( fWeight2 == 30 ) { Xship = ( 14.50 * RateAdjust ); }
if ( fWeight2 == 31 ) { Xship = ( 14.92 * RateAdjust ); }
if ( fWeight2 == 32 ) { Xship = ( 15.34 * RateAdjust ); }
if ( fWeight2 == 33 ) { Xship = ( 15.75 * RateAdjust ); }
if ( fWeight2 == 34 ) { Xship = ( 16.17 * RateAdjust ); }
if ( fWeight2 == 35 ) { Xship = ( 16.59 * RateAdjust ); }
if ( fWeight2 == 36 ) { Xship = ( 17.00 * RateAdjust ); }
if ( fWeight2 == 37 ) { Xship = ( 17.38 * RateAdjust ); }
if ( fWeight2 == 38 ) { Xship = ( 17.77 * RateAdjust ); }
if ( fWeight2 == 39 ) { Xship = ( 18.16 * RateAdjust ); }
if ( fWeight2 == 40 ) { Xship = ( 18.55 * RateAdjust ); }
if ( fWeight2 == 41 ) { Xship = ( 18.93 * RateAdjust ); }
if ( fWeight2 == 42 ) { Xship = ( 19.3 * RateAdjust ); }
if ( fWeight2 == 43 ) { Xship = ( 19.67 * RateAdjust ); }
if ( fWeight2 == 44 ) { Xship = ( 20.01 * RateAdjust ); }
if ( fWeight2 == 45 ) { Xship = ( 20.36 * RateAdjust ); }
if ( fWeight2 == 46 ) { Xship = ( 20.67 * RateAdjust ); }
if ( fWeight2 == 47 ) { Xship = ( 20.97 * RateAdjust ); }
if ( fWeight2 == 48 ) { Xship = ( 21.27 * RateAdjust ); }
if ( fWeight2 == 49 ) { Xship = ( 21.55 * RateAdjust ); }
if ( fWeight2 == 50 ) { Xship = ( 21.84 * RateAdjust ); }
if ( fWeight2 == 51 ) { Xship = ( 22.1 * RateAdjust ); }
if ( fWeight2 == 52 ) { Xship = ( 22.37 * RateAdjust ); }
if ( fWeight2 == 53 ) { Xship = ( 22.63 * RateAdjust ); }
if ( fWeight2 == 54 ) { Xship = ( 22.9 * RateAdjust ); }
if ( fWeight2 == 55 ) { Xship = ( 23.16 * RateAdjust ); }
if ( fWeight2 == 56 ) { Xship = ( 23.43 * RateAdjust ); }
if ( fWeight2 == 57 ) { Xship = ( 23.69 * RateAdjust ); }
if ( fWeight2 == 58 ) { Xship = ( 23.94 * RateAdjust ); }
if ( fWeight2 == 59 ) { Xship = ( 24.16 * RateAdjust ); }
if ( fWeight2 == 60 ) { Xship = ( 24.38 * RateAdjust ); }
if ( fWeight2 == 61 ) { Xship = ( 24.59 * RateAdjust ); }
if ( fWeight2 == 62 ) { Xship = ( 24.77 * RateAdjust ); }
if ( fWeight2 == 63 ) { Xship = ( 24.93 * RateAdjust ); }
if ( fWeight2 == 64 ) { Xship = ( 25.1 * RateAdjust ); }
if ( fWeight2 == 65 ) { Xship = ( 25.26 * RateAdjust ); }
if ( fWeight2 == 66 ) { Xship = ( 25.42 * RateAdjust ); }
if ( fWeight2 == 67 ) { Xship = ( 25.59 * RateAdjust ); }
if ( fWeight2 == 68 ) { Xship = ( 25.74 * RateAdjust ); }
if ( fWeight2 == 69 ) { Xship = ( 25.89 * RateAdjust ); }
if ( fWeight2 == 70 ) { Xship = ( 26.05 * RateAdjust ); }
if ( fWeight2 == 71 ) { Xship = ( 28.19 * RateAdjust ); }
if ( fWeight2 == 72 ) { Xship = ( 30.23 * RateAdjust ); }
if ( fWeight2 == 73 ) { Xship = ( 32.24 * RateAdjust ); }
if ( fWeight2 == 74 ) { Xship = ( 34.17 * RateAdjust ); }
if ( fWeight2 == 75 ) { Xship = ( 35.98 * RateAdjust ); }
if ( fWeight2 == 76 ) { Xship = ( 37.49 * RateAdjust ); }
if ( fWeight2 == 77 ) { Xship = ( 38.68 * RateAdjust ); }
if ( fWeight2 == 78 ) { Xship = ( 39.55 * RateAdjust ); }
if ( fWeight2 == 79 ) { Xship = ( 40.15 * RateAdjust ); }
if ( fWeight2 == 80 ) { Xship = ( 40.62 * RateAdjust ); }
if ( fWeight2 == 81 ) { Xship = ( 41.09 * RateAdjust ); }
if ( fWeight2 == 82 ) { Xship = ( 41.55 * RateAdjust ); }
if ( fWeight2 == 83 ) { Xship = ( 42.02 * RateAdjust ); }
if ( fWeight2 == 84 ) { Xship = ( 42.49 * RateAdjust ); }
if ( fWeight2 == 85 ) { Xship = ( 42.96 * RateAdjust ); }
if ( fWeight2 == 86 ) { Xship = ( 43.43 * RateAdjust ); }
if ( fWeight2 == 87 ) { Xship = ( 43.9 * RateAdjust ); }
if ( fWeight2 == 88 ) { Xship = ( 44.37 * RateAdjust ); }
if ( fWeight2 == 89 ) { Xship = ( 44.84 * RateAdjust ); }
if ( fWeight2 == 90 ) { Xship = ( 45.3 * RateAdjust ); }
if ( fWeight2 == 91 ) { Xship = ( 45.76 * RateAdjust ); }
if ( fWeight2 == 92 ) { Xship = ( 46.22 * RateAdjust ); }
if ( fWeight2 == 93 ) { Xship = ( 46.68 * RateAdjust ); }
if ( fWeight2 == 94 ) { Xship = ( 47.14 * RateAdjust ); }
if ( fWeight2 == 95 ) { Xship = ( 47.6 * RateAdjust ); }
if ( fWeight2 == 96 ) { Xship = ( 48.06 * RateAdjust ); }
if ( fWeight2 == 97 ) { Xship = ( 48.51 * RateAdjust ); }
if ( fWeight2 == 98 ) { Xship = ( 48.97 * RateAdjust ); }
if ( fWeight2 == 99 ) { Xship = ( 49.43 * RateAdjust ); }
if ( fWeight2 == 100 ) { Xship = ( 49.89 * RateAdjust ); }
if ( fWeight2 == 101 ) { Xship = ( 50.35 * RateAdjust ); }
if ( fWeight2 == 102 ) { Xship = ( 50.81 * RateAdjust ); }
if ( fWeight2 == 103 ) { Xship = ( 51.26 * RateAdjust ); }
if ( fWeight2 == 104 ) { Xship = ( 51.69 * RateAdjust ); }
if ( fWeight2 == 105 ) { Xship = ( 52.12 * RateAdjust ); }
if ( fWeight2 == 106 ) { Xship = ( 52.55 * RateAdjust ); }
if ( fWeight2 == 107 ) { Xship = ( 52.98 * RateAdjust ); }
if ( fWeight2 == 108 ) { Xship = ( 53.41 * RateAdjust ); }
if ( fWeight2 == 109 ) { Xship = ( 53.83 * RateAdjust ); }
if ( fWeight2 == 110 ) { Xship = ( 54.26 * RateAdjust ); }
if ( fWeight2 == 111 ) { Xship = ( 54.69 * RateAdjust ); }
if ( fWeight2 == 112 ) { Xship = ( 55.12 * RateAdjust ); }
if ( fWeight2 == 113 ) { Xship = ( 55.55 * RateAdjust ); }
if ( fWeight2 == 114 ) { Xship = ( 55.97 * RateAdjust ); }
if ( fWeight2 == 115 ) { Xship = ( 56.4 * RateAdjust ); }
if ( fWeight2 == 116 ) { Xship = ( 56.83 * RateAdjust ); }
if ( fWeight2 == 117 ) { Xship = ( 57.26 * RateAdjust ); }
if ( fWeight2 == 118 ) { Xship = ( 57.69 * RateAdjust ); }
if ( fWeight2 == 119 ) { Xship = ( 58.11 * RateAdjust ); }
if ( fWeight2 == 120 ) { Xship = ( 58.54 * RateAdjust ); }
if ( fWeight2 == 121 ) { Xship = ( 58.97 * RateAdjust ); }
if ( fWeight2 == 122 ) { Xship = ( 59.4 * RateAdjust ); }
if ( fWeight2 == 123 ) { Xship = ( 59.83 * RateAdjust ); }
if ( fWeight2 == 124 ) { Xship = ( 60.25 * RateAdjust ); }
if ( fWeight2 == 125 ) { Xship = ( 60.68 * RateAdjust ); }
if ( fWeight2 == 126 ) { Xship = ( 61.12 * RateAdjust ); }
if ( fWeight2 == 127 ) { Xship = ( 61.56 * RateAdjust ); }
if ( fWeight2 == 128 ) { Xship = ( 62 * RateAdjust ); }
if ( fWeight2 == 129 ) { Xship = ( 62.43 * RateAdjust ); }
if ( fWeight2 == 130 ) { Xship = ( 62.87 * RateAdjust ); }
if ( fWeight2 == 131 ) { Xship = ( 63.31 * RateAdjust ); }
if ( fWeight2 == 132 ) { Xship = ( 63.75 * RateAdjust ); }
if ( fWeight2 == 133 ) { Xship = ( 64.19 * RateAdjust ); }
if ( fWeight2 == 134 ) { Xship = ( 64.62 * RateAdjust ); }
if ( fWeight2 == 135 ) { Xship = ( 65.06 * RateAdjust ); }
if ( fWeight2 == 136 ) { Xship = ( 65.5 * RateAdjust ); }
if ( fWeight2 == 137 ) { Xship = ( 65.94 * RateAdjust ); }
if ( fWeight2 == 138 ) { Xship = ( 66.38 * RateAdjust ); }
if ( fWeight2 == 139 ) { Xship = ( 66.82 * RateAdjust ); }
if ( fWeight2 == 140 ) { Xship = ( 67.25 * RateAdjust ); }
if ( fWeight2 == 141 ) { Xship = ( 67.69 * RateAdjust ); }
if ( fWeight2 == 142 ) { Xship = ( 68.13 * RateAdjust ); }
if ( fWeight2 == 143 ) { Xship = ( 68.57 * RateAdjust ); }
if ( fWeight2 == 144 ) { Xship = ( 69.01 * RateAdjust ); }
if ( fWeight2 == 145 ) { Xship = ( 69.44 * RateAdjust ); }
if ( fWeight2 == 146 ) { Xship = ( 69.88 * RateAdjust ); }
if ( fWeight2 == 147 ) { Xship = ( 70.32 * RateAdjust ); }
if ( fWeight2 == 148 ) { Xship = ( 70.76 * RateAdjust ); }
if ( fWeight2 == 149 ) { Xship = ( 71.2 * RateAdjust ); }
if ( fWeight2 == 150 ) { Xship = ( 71.64 * RateAdjust ); }
Ship6 += Xship;	
if(Ship6 == 0){
return Ship1;
}
return Ship6;
}

//ZONE 7
if((LocationValue == 5)||(LocationValue== 29)||(LocationValue== 32)||(LocationValue== 41)||(LocationValue==48)){
if ( fWeight2 == 1 ) { Xship = ( 4.15 * RateAdjust ); }
if ( fWeight2 == 2 ) { Xship = ( 4.67 * RateAdjust ); }
if ( fWeight2 == 3 ) { Xship = ( 5.03 * RateAdjust ); }
if ( fWeight2 == 4 ) { Xship = ( 5.33 * RateAdjust ); }
if ( fWeight2 == 5 ) { Xship = ( 5.62 * RateAdjust ); }
if ( fWeight2 == 6 ) { Xship = ( 5.86 * RateAdjust ); }
if ( fWeight2 == 7 ) { Xship = ( 6.09 * RateAdjust ); }
if ( fWeight2 == 8 ) { Xship = ( 6.38 * RateAdjust ); }
if ( fWeight2 == 9 ) { Xship = ( 6.73 * RateAdjust ); }
if ( fWeight2 == 10 ) { Xship = ( 7.20 * RateAdjust ); }
if ( fWeight2 == 11 ) { Xship = ( 7.72 * RateAdjust ); }
if ( fWeight2 == 12 ) { Xship = ( 8.24 * RateAdjust ); }
if ( fWeight2 == 13 ) { Xship = ( 8.76 * RateAdjust ); }
if ( fWeight2 == 14 ) { Xship = ( 9.28 * RateAdjust ); }
if ( fWeight2 == 15 ) { Xship = ( 9.8 * RateAdjust ); }
if ( fWeight2 == 16 ) { Xship = ( 10.29 * RateAdjust ); }
if ( fWeight2 == 17 ) { Xship = ( 10.79 * RateAdjust ); }
if ( fWeight2 == 18 ) { Xship = ( 11.29 * RateAdjust ); }
if ( fWeight2 == 19 ) { Xship = ( 11.79 * RateAdjust ); }
if ( fWeight2 == 20 ) { Xship = ( 12.29 * RateAdjust ); }
if ( fWeight2 == 21 ) { Xship = ( 12.78 * RateAdjust ); }
if ( fWeight2 == 22 ) { Xship = ( 13.27 * RateAdjust ); }
if ( fWeight2 == 23 ) { Xship = ( 13.76 * RateAdjust ); }
if ( fWeight2 == 24 ) { Xship = ( 14.27 * RateAdjust ); }
if ( fWeight2 == 25 ) { Xship = ( 14.78 * RateAdjust ); }
if ( fWeight2 == 26 ) { Xship = ( 15.24 * RateAdjust ); }
if ( fWeight2 == 27 ) { Xship = ( 15.71 * RateAdjust ); }
if ( fWeight2 == 28 ) { Xship = ( 16.18 * RateAdjust ); }
if ( fWeight2 == 29 ) { Xship = ( 16.7 * RateAdjust ); }
if ( fWeight2 == 30 ) { Xship = ( 17.22 * RateAdjust ); }
if ( fWeight2 == 31 ) { Xship = ( 17.74 * RateAdjust ); }
if ( fWeight2 == 32 ) { Xship = ( 18.26 * RateAdjust ); }
if ( fWeight2 == 33 ) { Xship = ( 18.79 * RateAdjust ); }
if ( fWeight2 == 34 ) { Xship = ( 19.31 * RateAdjust ); }
if ( fWeight2 == 35 ) { Xship = ( 19.83 * RateAdjust ); }
if ( fWeight2 == 36 ) { Xship = ( 20.35 * RateAdjust ); }
if ( fWeight2 == 37 ) { Xship = ( 20.87 * RateAdjust ); }
if ( fWeight2 == 38 ) { Xship = ( 21.39 * RateAdjust ); }
if ( fWeight2 == 39 ) { Xship = ( 21.91 * RateAdjust ); }
if ( fWeight2 == 40 ) { Xship = ( 22.43 * RateAdjust ); }
if ( fWeight2 == 41 ) { Xship = ( 22.95 * RateAdjust ); }
if ( fWeight2 == 42 ) { Xship = ( 23.47 * RateAdjust ); }
if ( fWeight2 == 43 ) { Xship = ( 23.98 * RateAdjust ); }
if ( fWeight2 == 44 ) { Xship = ( 24.49 * RateAdjust ); }
if ( fWeight2 == 45 ) { Xship = ( 25 * RateAdjust ); }
if ( fWeight2 == 46 ) { Xship = ( 25.45 * RateAdjust ); }
if ( fWeight2 == 47 ) { Xship = ( 25.91 * RateAdjust ); }
if ( fWeight2 == 48 ) { Xship = ( 26.37 * RateAdjust ); }
if ( fWeight2 == 49 ) { Xship = ( 26.8 * RateAdjust ); }
if ( fWeight2 == 50 ) { Xship = ( 27.23 * RateAdjust ); }
if ( fWeight2 == 51 ) { Xship = ( 27.64 * RateAdjust ); }
if ( fWeight2 == 52 ) { Xship = ( 27.98 * RateAdjust ); }
if ( fWeight2 == 53 ) { Xship = ( 28.29 * RateAdjust ); }
if ( fWeight2 == 54 ) { Xship = ( 28.53 * RateAdjust ); }
if ( fWeight2 == 55 ) { Xship = ( 28.74 * RateAdjust ); }
if ( fWeight2 == 56 ) { Xship = ( 28.9 * RateAdjust ); }
if ( fWeight2 == 57 ) { Xship = ( 29.06 * RateAdjust ); }
if ( fWeight2 == 58 ) { Xship = ( 29.22 * RateAdjust ); }
if ( fWeight2 == 59 ) { Xship = ( 29.39 * RateAdjust ); }
if ( fWeight2 == 60 ) { Xship = ( 29.55 * RateAdjust ); }
if ( fWeight2 == 61 ) { Xship = ( 29.72 * RateAdjust ); }
if ( fWeight2 == 62 ) { Xship = ( 29.9 * RateAdjust ); }
if ( fWeight2 == 63 ) { Xship = ( 30.07 * RateAdjust ); }
if ( fWeight2 == 64 ) { Xship = ( 30.24 * RateAdjust ); }
if ( fWeight2 == 65 ) { Xship = ( 30.42 * RateAdjust ); }
if ( fWeight2 == 66 ) { Xship = ( 30.59 * RateAdjust ); }
if ( fWeight2 == 67 ) { Xship = ( 30.76 * RateAdjust ); }
if ( fWeight2 == 68 ) { Xship = ( 30.94 * RateAdjust ); }
if ( fWeight2 == 69 ) { Xship = ( 31.11 * RateAdjust ); }
if ( fWeight2 == 70 ) { Xship = ( 31.28 * RateAdjust ); }
if ( fWeight2 == 71 ) { Xship = ( 32.95 * RateAdjust ); }
if ( fWeight2 == 72 ) { Xship = ( 34.7 * RateAdjust ); }
if ( fWeight2 == 73 ) { Xship = ( 36.46 * RateAdjust ); }
if ( fWeight2 == 74 ) { Xship = ( 37.92 * RateAdjust ); }
if ( fWeight2 == 75 ) { Xship = ( 39.08 * RateAdjust ); }
if ( fWeight2 == 76 ) { Xship = ( 39.95 * RateAdjust ); }
if ( fWeight2 == 77 ) { Xship = ( 40.54 * RateAdjust ); }
if ( fWeight2 == 78 ) { Xship = ( 41.07 * RateAdjust ); }
if ( fWeight2 == 79 ) { Xship = ( 41.6 * RateAdjust ); }
if ( fWeight2 == 80 ) { Xship = ( 42.06 * RateAdjust ); }
if ( fWeight2 == 81 ) { Xship = ( 42.53 * RateAdjust ); }
if ( fWeight2 == 82 ) { Xship = ( 43 * RateAdjust ); }
if ( fWeight2 == 83 ) { Xship = ( 43.47 * RateAdjust ); }
if ( fWeight2 == 84 ) { Xship = ( 43.94 * RateAdjust ); }
if ( fWeight2 == 85 ) { Xship = ( 44.41 * RateAdjust ); }
if ( fWeight2 == 86 ) { Xship = ( 44.88 * RateAdjust ); }
if ( fWeight2 == 87 ) { Xship = ( 45.35 * RateAdjust ); }
if ( fWeight2 == 88 ) { Xship = ( 45.81 * RateAdjust ); }
if ( fWeight2 == 89 ) { Xship = ( 46.28 * RateAdjust ); }
if ( fWeight2 == 90 ) { Xship = ( 46.75 * RateAdjust ); }
if ( fWeight2 == 91 ) { Xship = ( 47.22 * RateAdjust ); }
if ( fWeight2 == 92 ) { Xship = ( 47.69 * RateAdjust ); }
if ( fWeight2 == 93 ) { Xship = ( 48.16 * RateAdjust ); }
if ( fWeight2 == 94 ) { Xship = ( 48.62 * RateAdjust ); }
if ( fWeight2 == 95 ) { Xship = ( 49.08 * RateAdjust ); }
if ( fWeight2 == 96 ) { Xship = ( 49.53 * RateAdjust ); }
if ( fWeight2 == 97 ) { Xship = ( 49.99 * RateAdjust ); }
if ( fWeight2 == 98 ) { Xship = ( 50.45 * RateAdjust ); }
if ( fWeight2 == 99 ) { Xship = ( 50.91 * RateAdjust ); }
if ( fWeight2 == 100 ) { Xship = ( 51.37 * RateAdjust ); }
if ( fWeight2 == 101 ) { Xship = ( 51.83 * RateAdjust ); }
if ( fWeight2 == 102 ) { Xship = ( 52.28 * RateAdjust ); }
if ( fWeight2 == 103 ) { Xship = ( 52.74 * RateAdjust ); }
if ( fWeight2 == 104 ) { Xship = ( 53.2 * RateAdjust ); }
if ( fWeight2 == 105 ) { Xship = ( 53.66 * RateAdjust ); }
if ( fWeight2 == 106 ) { Xship = ( 54.12 * RateAdjust ); }
if ( fWeight2 == 107 ) { Xship = ( 54.58 * RateAdjust ); }
if ( fWeight2 == 108 ) { Xship = ( 55.04 * RateAdjust ); }
if ( fWeight2 == 109 ) { Xship = ( 55.49 * RateAdjust ); }
if ( fWeight2 == 110 ) { Xship = ( 55.95 * RateAdjust ); }
if ( fWeight2 == 111 ) { Xship = ( 56.4 * RateAdjust ); }
if ( fWeight2 == 112 ) { Xship = ( 56.85 * RateAdjust ); }
if ( fWeight2 == 113 ) { Xship = ( 57.3 * RateAdjust ); }
if ( fWeight2 == 114 ) { Xship = ( 57.75 * RateAdjust ); }
if ( fWeight2 == 115 ) { Xship = ( 58.2 * RateAdjust ); }
if ( fWeight2 == 116 ) { Xship = ( 58.64 * RateAdjust ); }
if ( fWeight2 == 117 ) { Xship = ( 59.09 * RateAdjust ); }
if ( fWeight2 == 118 ) { Xship = ( 59.54 * RateAdjust ); }
if ( fWeight2 == 119 ) { Xship = ( 60 * RateAdjust ); }
if ( fWeight2 == 120 ) { Xship = ( 60.46 * RateAdjust ); }
if ( fWeight2 == 121 ) { Xship = ( 60.92 * RateAdjust ); }
if ( fWeight2 == 122 ) { Xship = ( 61.37 * RateAdjust ); }
if ( fWeight2 == 123 ) { Xship = ( 61.83 * RateAdjust ); }
if ( fWeight2 == 124 ) { Xship = ( 62.29 * RateAdjust ); }
if ( fWeight2 == 125 ) { Xship = ( 62.75 * RateAdjust ); }
if ( fWeight2 == 126 ) { Xship = ( 63.21 * RateAdjust ); }
if ( fWeight2 == 127 ) { Xship = ( 63.67 * RateAdjust ); }
if ( fWeight2 == 128 ) { Xship = ( 64.13 * RateAdjust ); }
if ( fWeight2 == 129 ) { Xship = ( 64.58 * RateAdjust ); }
if ( fWeight2 == 130 ) { Xship = ( 65.04 * RateAdjust ); }
if ( fWeight2 == 131 ) { Xship = ( 65.5 * RateAdjust ); }
if ( fWeight2 == 132 ) { Xship = ( 65.96 * RateAdjust ); }
if ( fWeight2 == 133 ) { Xship = ( 66.42 * RateAdjust ); }
if ( fWeight2 == 134 ) { Xship = ( 66.88 * RateAdjust ); }
if ( fWeight2 == 135 ) { Xship = ( 67.34 * RateAdjust ); }
if ( fWeight2 == 136 ) { Xship = ( 67.79 * RateAdjust ); }
if ( fWeight2 == 137 ) { Xship = ( 68.25 * RateAdjust ); }
if ( fWeight2 == 138 ) { Xship = ( 68.71 * RateAdjust ); }
if ( fWeight2 == 139 ) { Xship = ( 69.17 * RateAdjust ); }
if ( fWeight2 == 140 ) { Xship = ( 69.63 * RateAdjust ); }
if ( fWeight2 == 141 ) { Xship = ( 70.09 * RateAdjust ); }
if ( fWeight2 == 142 ) { Xship = ( 70.55 * RateAdjust ); }
if ( fWeight2 == 143 ) { Xship = ( 71 * RateAdjust ); }
if ( fWeight2 == 144 ) { Xship = ( 71.46 * RateAdjust ); }
if ( fWeight2 == 145 ) { Xship = ( 71.92 * RateAdjust ); }
if ( fWeight2 == 146 ) { Xship = ( 72.38 * RateAdjust ); }
if ( fWeight2 == 147 ) { Xship = ( 72.84 * RateAdjust ); }
if ( fWeight2 == 148 ) { Xship = ( 73.3 * RateAdjust ); }
if ( fWeight2 == 149 ) { Xship = ( 73.76 * RateAdjust ); }
if ( fWeight2 == 150 ) { Xship = ( 74.21 * RateAdjust ); }
Ship7 += Xship;
if(Ship7 == 0){
return Ship1;
}		
return Ship7;
}

//ZONE 8
if((LocationValue == 2)||(LocationValue==4)||(LocationValue==10)||(LocationValue==24)||(LocationValue==26)||(LocationValue==35)||(LocationValue==42)||(LocationValue==45)){
if ( fWeight2 == 1 ) { Xship = ( 4.26 * RateAdjust ); }
if ( fWeight2 == 2 ) { Xship = ( 4.96 * RateAdjust ); }
if ( fWeight2 == 3 ) { Xship = ( 5.49 * RateAdjust ); }
if ( fWeight2 == 4 ) { Xship = ( 5.85 * RateAdjust ); }
if ( fWeight2 == 5 ) { Xship = ( 6.20 * RateAdjust ); }
if ( fWeight2 == 6 ) { Xship = ( 6.44 * RateAdjust ); }
if ( fWeight2 == 7 ) { Xship = ( 6.73 * RateAdjust ); }
if ( fWeight2 == 8 ) { Xship = ( 7.29 * RateAdjust ); }
if ( fWeight2 == 9 ) { Xship = ( 7.66 * RateAdjust ); }
if ( fWeight2 == 10 ) { Xship = ( 8.38 * RateAdjust ); }
if ( fWeight2 == 11 ) { Xship = ( 8.77 * RateAdjust ); }
if ( fWeight2 == 12 ) { Xship = ( 9.42 * RateAdjust ); }
if ( fWeight2 == 13 ) { Xship = ( 10.05 * RateAdjust ); }
if ( fWeight2 == 14 ) { Xship = ( 10.68 * RateAdjust ); }
if ( fWeight2 == 15 ) { Xship = ( 11.31 * RateAdjust ); }
if ( fWeight2 == 16 ) { Xship = ( 11.91 * RateAdjust ); }
if ( fWeight2 == 17 ) { Xship = ( 12.53 * RateAdjust ); }
if ( fWeight2 == 18 ) { Xship = ( 13.35 * RateAdjust ); }
if ( fWeight2 == 19 ) { Xship = ( 13.81 * RateAdjust ); }
if ( fWeight2 == 20 ) { Xship = ( 14.45 * RateAdjust ); }
if ( fWeight2 == 21 ) { Xship = ( 15.08 * RateAdjust ); }
if ( fWeight2 == 22 ) { Xship = ( 15.71 * RateAdjust ); }
if ( fWeight2 == 23 ) { Xship = ( 16.34 * RateAdjust ); }
if ( fWeight2 == 24 ) { Xship = ( 16.98 * RateAdjust ); }
if ( fWeight2 == 25 ) { Xship = ( 17.61 * RateAdjust ); }
if ( fWeight2 == 26 ) { Xship = ( 18.22 * RateAdjust ); }
if ( fWeight2 == 27 ) { Xship = ( 18.83 * RateAdjust ); }
if ( fWeight2 == 28 ) { Xship = ( 19.45 * RateAdjust ); }
if ( fWeight2 == 29 ) { Xship = ( 20.07 * RateAdjust ); }
if ( fWeight2 == 30 ) { Xship = ( 20.70 * RateAdjust ); }
if ( fWeight2 == 31 ) { Xship = ( 21.33 * RateAdjust ); }
if ( fWeight2 == 32 ) { Xship = ( 21.96 * RateAdjust ); }
if ( fWeight2 == 33 ) { Xship = ( 22.59 * RateAdjust ); }
if ( fWeight2 == 34 ) { Xship = ( 23.22 * RateAdjust ); }
if ( fWeight2 == 35 ) { Xship = ( 23.85 * RateAdjust ); }
if ( fWeight2 == 36 ) { Xship = ( 24.47 * RateAdjust ); }
if ( fWeight2 == 37 ) { Xship = ( 25.08 * RateAdjust ); }
if ( fWeight2 == 38 ) { Xship = ( 25.69 * RateAdjust ); }
if ( fWeight2 == 39 ) { Xship = ( 26.28 * RateAdjust ); }
if ( fWeight2 == 40 ) { Xship = ( 26.87 * RateAdjust ); }
if ( fWeight2 == 41 ) { Xship = ( 27.46 * RateAdjust ); }
if ( fWeight2 == 42 ) { Xship = ( 28.05 * RateAdjust ); }
if ( fWeight2 == 43 ) { Xship = ( 28.64 * RateAdjust ); }
if ( fWeight2 == 44 ) { Xship = ( 29.24 * RateAdjust ); }
if ( fWeight2 == 45 ) { Xship = ( 29.83 * RateAdjust ); }
if ( fWeight2 == 46 ) { Xship = ( 30.38 * RateAdjust ); }
if ( fWeight2 == 47 ) { Xship = ( 30.93 * RateAdjust ); }
if ( fWeight2 == 48 ) { Xship = ( 31.44 * RateAdjust ); }
if ( fWeight2 == 49 ) { Xship = ( 31.9 * RateAdjust ); }
if ( fWeight2 == 50 ) { Xship = ( 32.33 * RateAdjust ); }
if ( fWeight2 == 51 ) { Xship = ( 32.74 * RateAdjust ); }
if ( fWeight2 == 52 ) { Xship = ( 33.15 * RateAdjust ); }
if ( fWeight2 == 53 ) { Xship = ( 33.49 * RateAdjust ); }
if ( fWeight2 == 54 ) { Xship = ( 33.80 * RateAdjust ); }
if ( fWeight2 == 55 ) { Xship = ( 34.07 * RateAdjust ); }
if ( fWeight2 == 56 ) { Xship = ( 34.30 * RateAdjust ); }
if ( fWeight2 == 57 ) { Xship = ( 34.53 * RateAdjust ); }
if ( fWeight2 == 58 ) { Xship = ( 34.77 * RateAdjust ); }
if ( fWeight2 == 59 ) { Xship = ( 35.00 * RateAdjust ); }
if ( fWeight2 == 60 ) { Xship = ( 35.24 * RateAdjust ); }
if ( fWeight2 == 61 ) { Xship = ( 35.47 * RateAdjust ); }
if ( fWeight2 == 62 ) { Xship = ( 35.71 * RateAdjust ); }
if ( fWeight2 == 63 ) { Xship = ( 35.94 * RateAdjust ); }
if ( fWeight2 == 64 ) { Xship = ( 36.17 * RateAdjust ); }
if ( fWeight2 == 65 ) { Xship = ( 36.41 * RateAdjust ); }
if ( fWeight2 == 66 ) { Xship = ( 36.64 * RateAdjust ); }
if ( fWeight2 == 67 ) { Xship = ( 36.88 * RateAdjust ); }
if ( fWeight2 == 68 ) { Xship = ( 37.11 * RateAdjust ); }
if ( fWeight2 == 69 ) { Xship = ( 37.35 * RateAdjust ); }
if ( fWeight2 == 70 ) { Xship = ( 37.58 * RateAdjust ); }
if ( fWeight2 == 71 ) { Xship = ( 38.99 * RateAdjust ); }
if ( fWeight2 == 72 ) { Xship = ( 40.15 * RateAdjust ); }
if ( fWeight2 == 73 ) { Xship = ( 41.02 * RateAdjust ); }
if ( fWeight2 == 74 ) { Xship = ( 41.8 * RateAdjust ); }
if ( fWeight2 == 75 ) { Xship = ( 42.47 * RateAdjust ); }
if ( fWeight2 == 76 ) { Xship = ( 43.05 * RateAdjust ); }
if ( fWeight2 == 77 ) { Xship = ( 43.53 * RateAdjust ); }
if ( fWeight2 == 78 ) { Xship = ( 44.00 * RateAdjust ); }
if ( fWeight2 == 79 ) { Xship = ( 44.47 * RateAdjust ); }
if ( fWeight2 == 80 ) { Xship = ( 44.94 * RateAdjust ); }
if ( fWeight2 == 81 ) { Xship = ( 45.40 * RateAdjust ); }
if ( fWeight2 == 82 ) { Xship = ( 45.86 * RateAdjust ); }
if ( fWeight2 == 83 ) { Xship = ( 46.31 * RateAdjust ); }
if ( fWeight2 == 84 ) { Xship = ( 46.77 * RateAdjust ); }
if ( fWeight2 == 85 ) { Xship = ( 47.23 * RateAdjust ); }
if ( fWeight2 == 86 ) { Xship = ( 47.69 * RateAdjust ); }
if ( fWeight2 == 87 ) { Xship = ( 48.15 * RateAdjust ); }
if ( fWeight2 == 88 ) { Xship = ( 48.62 * RateAdjust ); }
if ( fWeight2 == 89 ) { Xship = ( 49.09 * RateAdjust ); }
if ( fWeight2 == 90 ) { Xship = ( 49.55 * RateAdjust ); }
if ( fWeight2 == 91 ) { Xship = ( 50.02 * RateAdjust ); }
if ( fWeight2 == 92 ) { Xship = ( 50.49 * RateAdjust ); }
if ( fWeight2 == 93 ) { Xship = ( 50.96 * RateAdjust ); }
if ( fWeight2 == 94 ) { Xship = ( 51.43 * RateAdjust ); }
if ( fWeight2 == 95 ) { Xship = ( 51.90 * RateAdjust ); }
if ( fWeight2 == 96 ) { Xship = ( 52.37 * RateAdjust ); }
if ( fWeight2 == 97 ) { Xship = ( 52.84 * RateAdjust ); }
if ( fWeight2 == 98 ) { Xship = ( 53.30 * RateAdjust ); }
if ( fWeight2 == 99 ) { Xship = ( 53.77 * RateAdjust ); }
if ( fWeight2 == 100 ) { Xship = ( 54.24 * RateAdjust ); }
if ( fWeight2 == 101 ) { Xship = ( 54.70 * RateAdjust ); }
if ( fWeight2 == 102 ) { Xship = ( 55.16 * RateAdjust ); }
if ( fWeight2 == 103 ) { Xship = ( 55.62 * RateAdjust ); }
if ( fWeight2 == 104 ) { Xship = ( 56.08 * RateAdjust ); }
if ( fWeight2 == 105 ) { Xship = ( 56.53 * RateAdjust ); }
if ( fWeight2 == 106 ) { Xship = ( 56.99 * RateAdjust ); }
if ( fWeight2 == 107 ) { Xship = ( 57.45 * RateAdjust ); }
if ( fWeight2 == 108 ) { Xship = ( 57.91 * RateAdjust ); }
if ( fWeight2 == 109 ) { Xship = ( 58.37 * RateAdjust ); }
if ( fWeight2 == 110 ) { Xship = ( 58.83 * RateAdjust ); }
if ( fWeight2 == 111 ) { Xship = ( 59.28 * RateAdjust ); }
if ( fWeight2 == 112 ) { Xship = ( 59.72 * RateAdjust ); }
if ( fWeight2 == 113 ) { Xship = ( 60.17 * RateAdjust ); }
if ( fWeight2 == 114 ) { Xship = ( 60.62 * RateAdjust ); }
if ( fWeight2 == 115 ) { Xship = ( 61.07 * RateAdjust ); }
if ( fWeight2 == 116 ) { Xship = ( 61.52 * RateAdjust ); }
if ( fWeight2 == 117 ) { Xship = ( 61.97 * RateAdjust ); }
if ( fWeight2 == 118 ) { Xship = ( 62.41 * RateAdjust ); }
if ( fWeight2 == 119 ) { Xship = ( 62.86 * RateAdjust ); }
if ( fWeight2 == 120 ) { Xship = ( 63.31 * RateAdjust ); }
if ( fWeight2 == 121 ) { Xship = ( 63.77 * RateAdjust ); }
if ( fWeight2 == 122 ) { Xship = ( 64.23 * RateAdjust ); }
if ( fWeight2 == 123 ) { Xship = ( 64.69 * RateAdjust ); }
if ( fWeight2 == 124 ) { Xship = ( 65.14 * RateAdjust ); }
if ( fWeight2 == 125 ) { Xship = ( 65.60 * RateAdjust ); }
if ( fWeight2 == 126 ) { Xship = ( 66.06 * RateAdjust ); }
if ( fWeight2 == 127 ) { Xship = ( 66.52 * RateAdjust ); }
if ( fWeight2 == 128 ) { Xship = ( 66.98 * RateAdjust ); }
if ( fWeight2 == 129 ) { Xship = ( 67.44 * RateAdjust ); }
if ( fWeight2 == 130 ) { Xship = ( 67.90 * RateAdjust ); }
if ( fWeight2 == 131 ) { Xship = ( 68.35 * RateAdjust ); }
if ( fWeight2 == 132 ) { Xship = ( 68.81 * RateAdjust ); }
if ( fWeight2 == 133 ) { Xship = ( 69.27 * RateAdjust ); }
if ( fWeight2 == 134 ) { Xship = ( 69.73 * RateAdjust ); }
if ( fWeight2 == 135 ) { Xship = ( 70.19 * RateAdjust ); }
if ( fWeight2 == 136 ) { Xship = ( 70.65 * RateAdjust ); }
if ( fWeight2 == 137 ) { Xship = ( 71.11 * RateAdjust ); }
if ( fWeight2 == 138 ) { Xship = ( 71.56 * RateAdjust ); }
if ( fWeight2 == 139 ) { Xship = ( 72.02 * RateAdjust ); }
if ( fWeight2 == 140 ) { Xship = ( 72.48 * RateAdjust ); }
if ( fWeight2 == 141 ) { Xship = ( 72.94 * RateAdjust ); }
if ( fWeight2 == 142 ) { Xship = ( 73.40 * RateAdjust ); }
if ( fWeight2 == 143 ) { Xship = ( 73.86 * RateAdjust ); }
if ( fWeight2 == 144 ) { Xship = ( 74.32 * RateAdjust ); }
if ( fWeight2 == 145 ) { Xship = ( 74.77 * RateAdjust ); }
if ( fWeight2 == 146 ) { Xship = ( 75.23 * RateAdjust ); }
if ( fWeight2 == 147 ) { Xship = ( 75.69 * RateAdjust ); }
if ( fWeight2 == 148 ) { Xship = ( 76.15 * RateAdjust ); }
if ( fWeight2 == 149 ) { Xship = ( 76.61 * RateAdjust ); }
if ( fWeight2 == 150 ) { Xship = ( 77.07 * RateAdjust ); }
Ship8 += Xship;
if(Ship8 == 0){
return Ship1;
}
return Ship8;
}
}

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

   if ( isNaN (g_TotalCost) ) {
      alert( NoQtyPrompt );
      return false;
   }

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

if (theForm.ZONE.selectedIndex == 0) {
		alert("Please Select Shipping Location!");
         return false;
	}
   return true;
}

//---------------------------------------------------------------------|| 
// FUNCTION: CheckoutCart                                              || 
// PARAMETERS: Null                                                    || 
// RETURNS: Product Table Written to Document                          || 
// PURPOSE: Draws current cart product table on HTML page for          || 
// checkout.                                                           || 
//---------------------------------------------------------------------|| 
function CheckoutCart( ) { 
var fItems = 0;
var iNumberOrdered = 0; //Number of products ordered 
var fTotal = 0; //Total cost of order 
var fTax = 0; //Tax amount 
var fWeight = 0; //Weight 
var fWeight2 = 0; //Weight 
var fShipping = 0; //Shipping amount 
var fShipping2 = 0; //Shipping amount 
var strWeight = ""; //Total weight formatted -Advanced
var strWeight2 = ""; //Total weight formatted - Standard
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) 
var strPP = ""; //Payment Processor Description Field 
var shipValue1=0;
var shipValue2=0;
var shipValue3=0;
var shipValue4=0;
var shipValue5=0;
var shipValue6=0;
var shipValue7=0;
var shipValue8=0;

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

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

if ( bDisplay ) 
strOutput = "<TABLE CELLSPACING=0 CELLPADDING=3 BORDER=0 CLASS=\"nopcart\"><TR>" + 
"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strILabel+"</B></TD>" + 
"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strDLabel+"</B></TD>" + 
"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strQLabel+"</B></TD>" + 
"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strPLabel+"</B></TD>" + 
(DisplayShippingColumn?"<TD CLASS=\"nopheader\" ALIGN=CENTER><B>"+strSLabel+"</B></TD>":"") + 
"</TR>"; 

for ( i = 1; i <= iNumberOrdered; i++ ) {
			even = Math.round(i/2);
      NewOrder = "Order." + i;
      database = "";
      dbShip ="";
      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); 
Token5 = database.indexOf("|", Token4+1); 
Token6 = database.indexOf("|", Token5+1); 
Token7 = database.indexOf("|", Token6+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, Token5 ); 
fields[6] = database.substring( Token5+1, Token6 ); 
fields[7] = database.substring( Token6+1, Token7 ); 
fields[8] = database.substring( Token7+1, database.length ); 

dbShip = fields[4];
Coin0 = dbShip.indexOf("^", 0); 
Coin1 = dbShip.indexOf("^", Coin0+1); 
Coin2 = dbShip.indexOf("^", Coin1+1); 
Coin3 = dbShip.indexOf("^", Coin2+1); 
Coin4 = dbShip.indexOf("^", Coin3+1); 
Coin5 = dbShip.indexOf("^", Coin4+1);
Coin6 = dbShip.indexOf("^", Coin5+1);
Coin7 = dbShip.indexOf("^", Coin6+1);

shipfields = new Array;
shipfields[0] = dbShip.substring( 0, Coin0 ); 
shipfields[1] = dbShip.substring( Coin0+1, Coin1 );
shipfields[2] = dbShip.substring( Coin1+1, Coin2 );
shipfields[3] = dbShip.substring( Coin2+1, Coin3 );
shipfields[4] = dbShip.substring( Coin3+1, Coin4 );
shipfields[5] = dbShip.substring( Coin4+1, Coin5 );
shipfields[6] = dbShip.substring( Coin5+1, Coin6 );
shipfields[7] = dbShip.substring( Coin6+1, dbShip.length );

shipValue1 += (parseFloat(fields[1]) * parseFloat(shipfields[0]) ); 
shipValue2 += (parseFloat(fields[1]) * parseFloat(shipfields[1]) ); 
shipValue3 += (parseFloat(fields[1]) * parseFloat(shipfields[2]) ); 
shipValue4 += (parseFloat(fields[1]) * parseFloat(shipfields[3]) ); 
shipValue5 += (parseFloat(fields[1]) * parseFloat(shipfields[4]) ); 
shipValue6 += (parseFloat(fields[1]) * parseFloat(shipfields[5]) ); 
shipValue7 += (parseFloat(fields[1]) * parseFloat(shipfields[6]) ); 
shipValue8 += (parseFloat(fields[1]) * parseFloat(shipfields[7]) ); 

fItems += (parseInt(fields[1]));
fTotal += (parseInt(fields[1]) * parseFloat(fields[2]) ); 
fWeight += (parseInt(fields[1]) * parseFloat(fields[6]) ); 
fWeight2 += (parseInt(fields[1]) * parseFloat(fields[7]) );
fWeight = Math.round(fWeight * 100)/100;
fWeight2 = Math.round(fWeight2 * 100)/100;
fWeightTOT = fWeight + fWeight2;
if ( !TaxByRegion ) var strProductId = fields[0];
strProductId=strProductId.charAt(0);
if( strProductId!= 'n' ) {
fTax += (parseInt(fields[1]) * parseFloat(fields[2]) ) * TaxRate;
}
strTotal = moneyFormat(fTotal); 
if ( !TaxByRegion ) strTax = moneyFormat(fTax); 

if ( bDisplay ){
      if ((even) ==(i/2) ) {
strOutput += "<TR><TD CLASS=\"nopeven\" ALIGN=CENTER>" + fields[0] + "</TD>"; 

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

strOutput += "<TD CLASS=\"nopeven\" ALIGN=CENTER>" + fields[1] + "</TD>"; 
strOutput += "<TD CLASS=\"nopeven\" ALIGN=RIGHT>"+ MonetarySymbol + moneyFormat(fields[2]) + "/ea</TD>"; 

if ( DisplayShippingColumn ) { 

strOutput += "<TD CLASS=\"nopeven\" ALIGN=RIGHT>"+ MonetarySymbol + moneyFormat(parseInt(fields[1]) * parseFloat(fields[2]) ) + "</TD>"; 
}else {
strOutput += "<TD CLASS=\"nopeven\" ALIGN=RIGHT>N/A</TD>"; 
} 

strOutput += "</TR>"; 
} 
else {
strOutput += "<TR><TD CLASS=\"nopentry\" ALIGN=CENTER>" + fields[0] + "</TD>"; 

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

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

if ( DisplayShippingColumn ) { 

strOutput += "<TD CLASS=\"nopentry\" ALIGN=RIGHT>"+ MonetarySymbol + moneyFormat(parseInt(fields[1]) * parseFloat(fields[2]) ) + "</TD>"; 
}else {
strOutput += "<TD CLASS=\"nopentry\" ALIGN=RIGHT>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[8] != "" ) 
strPP += " - " + fields[8]; 
strPP += ", Qty. " + fields[1] + "\n"; 
} else { 
LocationSelected = GetCookie("ZoneSelected"); 
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] + fields[5] +  "\">"; 
strOutput += "<input type=hidden name=\"" + OutputItemWeight + strFooter + "\" value=\"" + fields[6] + fields[7] + "\">"; 
strOutput += "<input type=hidden name=\"" + OutputItemAddtlInfo + strFooter + "\" value=\"" + fields[8] + "\">"; 
strOutput += "<input type=hidden name=\"" + OutputItemXtend + strFooter + "\" value=\"" + moneyFormat(fields[1] * fields[2]) + "\">";
strOutput += "<input type=hidden name=\"" + OutputOrderZone + strFooter + "\" value=\"" + LocationSelected + "\">"; 
} 
} 

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

if ( DisplayShippingRow ) { 
LocationSelected = GetCookie("ZoneSelected"); 
if (LocationSelected == null) LocationSelected = 0; //Needed if checkout cart is empty

if (LocationSelected == 0) LocationLabel = '<font color="#FF0000">Select Shipping Location</font>';
if (LocationSelected == 1) LocationLabel = "Zone 5"; 
if (LocationSelected == 2) LocationLabel = "Zone 8"; 
if (LocationSelected == 3) LocationLabel = "Zone 6"; 
if (LocationSelected == 4) LocationLabel = "Zone 8"; 
if (LocationSelected == 5) LocationLabel = "Zone 7"; 
if (LocationSelected == 6) LocationLabel = "Zone 3"; 
if (LocationSelected == 7) LocationLabel = "Zone 3"; 
if (LocationSelected == 8) LocationLabel = "Zone 6";
if (LocationSelected == 9) LocationLabel = "Zone 5";
if (LocationSelected == 10) LocationLabel = "Zone 8"; 
if (LocationSelected == 11) LocationLabel = "Zone 5";
if (LocationSelected == 12) LocationLabel = "Zone 5";  
if (LocationSelected == 13) LocationLabel = "Zone 6";
if (LocationSelected == 14) LocationLabel = "Zone 6"; 
if (LocationSelected == 15) LocationLabel = "Zone 5"; 
if (LocationSelected == 16) LocationLabel = "Zone 6";
if (LocationSelected == 17) LocationLabel = "Zone 4";
if (LocationSelected == 18) LocationLabel = "Zone 3";
if (LocationSelected == 19) LocationLabel = "Zone 4"; 
if (LocationSelected == 20) LocationLabel = "Zone 5";  
if (LocationSelected == 21) LocationLabel = "Zone 6";
if (LocationSelected == 22) LocationLabel = "Zone 5";
if (LocationSelected == 23) LocationLabel = "Zone 5";
if (LocationSelected == 24) LocationLabel = "Zone 8";
if (LocationSelected == 25) LocationLabel = "Zone 6"; 
if (LocationSelected == 26) LocationLabel = "Zone 8";
if (LocationSelected == 27) LocationLabel = "Zone 4";
if (LocationSelected == 28) LocationLabel = "Zone 3";
if (LocationSelected == 29) LocationLabel = "Zone 7";
if (LocationSelected == 30) LocationLabel = "Zone 3";
if (LocationSelected == 31) LocationLabel = "Zone 4";
if (LocationSelected == 32) LocationLabel = "Zone 8";
if (LocationSelected == 33) LocationLabel = "Zone 4";
if (LocationSelected == 34) LocationLabel = "Zone 6";
if (LocationSelected == 35) LocationLabel = "Zone 8";
if (LocationSelected == 36) LocationLabel = "Zone 3";
if (LocationSelected == 37) LocationLabel = "Zone 3";
if (LocationSelected == 38) LocationLabel = "Zone 4";
if (LocationSelected == 39) LocationLabel = "Zone 6"; 
if (LocationSelected == 40) LocationLabel = "Zone 5";
if (LocationSelected == 41) LocationLabel = "Zone 7";
if (LocationSelected == 42) LocationLabel = "Zone 8";
if (LocationSelected == 43) LocationLabel = "Zone 4";
if (LocationSelected == 44) LocationLabel = "Zone 4";
if (LocationSelected == 45) LocationLabel = "Zone 8";
if (LocationSelected == 46) LocationLabel = "Zone 4";
if (LocationSelected == 47) LocationLabel = "Zone 5";
if (LocationSelected == 48) LocationLabel = "Zone 7";

fShipping = ComputeShipping(LocationSelected, shipValue1, shipValue2, shipValue3, shipValue4, shipValue5, shipValue6, shipValue7, shipValue8, fWeight2); 

strShipping = moneyFormat(fShipping); 
//strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=3><B>"+strWTOT+"</B></TD>"; 
//strOutput += "<TD CLASS=\"noptotal\" COLSPAN=2 ALIGN=RIGHT><B>" + fWeight + " lbs" + "</B></TD>"; 
strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=3><B>" + strSHIP + " for " + LocationLabel + "</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=1><B>"+strTAX+"</B></TD>"; 
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=4 ALIGN=RIGHT><B>" + MonetarySymbol + strTax + "</B></TD>"; 
strOutput += "</TR>"; 
} 

if (LocationSelected != 36 ) fTax = 0.00; 
//sets tax to 0.00 for all areas except 36   

// show the tax row for pa 
if (LocationSelected == 36 ) { 
strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=1 ALIGN=RIGHT><B>"+strTAX+"</B></TD>"; 
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=4 ALIGN=RIGHT><B>" + MonetarySymbol + strTax +"</B></TD>"; 
strOutput += "</TR>"; 
} 

strOutput += "<TR><TD CLASS=\"noptotal\" COLSPAN=1><B>"+strTOT+"</B></TD>"; 
strOutput += "<TD CLASS=\"noptotal\" COLSPAN=4 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 if (LocationSelected != 36 ){
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 + "0.00" + "\">"; 
strOutput += "<input type=hidden name=\""+OutputOrderTotal+"\" value=\""+ MonetarySymbol + moneyFormat(fTotal + fShipping + fTax) + "\">"; 
strOutput += "<input type=hidden name=\""+OutputOrderZone+"\" value=\""+ LocationLabel + "\">"; 
} 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=\""+OutputOrderZone+"\" value=\""+ LocationLabel + "\">"; 
} 
} 
document.write(strOutput); 
document.close(); 
} 

//---------------------------------------------------------------------|| 
// FUNCTION: Print_total                                               || 
// PARAMETERS: none                                                    || 
// RETURNS: Total cost currently racked up by shopper                  || 
// PURPOSE: Aesthetics                                                 || 
//---------------------------------------------------------------------|| 
function Print_total( ) { 
var strOutput = ""; //String to be written to page 
var strTotal = ""; //Total cost formatted as money 
var fTotal = 0; 
var iNumberOrdered = 0; //Number of products ordered 

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

for ( i = 1; i <= iNumberOrdered; i++ ) {
			even = Math.round(i/2);
      NewOrder = "Order." + i;
      database = "";
      dbShip ="";
      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); 
Token5 = database.indexOf("|", Token4+1); 
Token6 = database.indexOf("|", Token5+1); 
Token7 = database.indexOf("|", Token6+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, Token5 ); 
fields[6] = database.substring( Token5+1, Token6 ); 
fields[7] = database.substring( Token6+1, Token7 ); 
fields[8] = database.substring( Token7+1, database.length ); 

fTotal += (parseInt(fields[1]) * parseFloat(fields[2]) ); 
} 

strTotal = moneyFormat(fTotal); 
strOutput+=strTotal; 
document.write(strOutput); 
} 

//---------------------------------------------------------------------|| 
// FUNCTION: Print_total                                               || 
// PARAMETERS: true/false if you want MonetarySymbol added to string   || 
// RETURNS: Total cost currently racked up by shopper                  || 
// PURPOSE: Aesthetics                                                 || 
//---------------------------------------------------------------------|| 
function Print_total(bSymbol) { 
var strOutput = ""; //String to be written to page 
var strTotal = ""; //Total cost formatted as money 
var fTotal = 0; 
var iNumberOrdered = 0; //Number of products ordered 

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

for ( i = 1; i <= iNumberOrdered; i++ ) {
			even = Math.round(i/2);
      NewOrder = "Order." + i;
      database = "";
      dbShip ="";
      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); 
Token5 = database.indexOf("|", Token4+1); 
Token6 = database.indexOf("|", Token5+1); 
Token7 = database.indexOf("|", Token6+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, Token5 ); 
fields[6] = database.substring( Token5+1, Token6 ); 
fields[7] = database.substring( Token6+1, Token7 ); 
fields[8] = database.substring( Token7+1, database.length ); 

fTotal += (parseInt(fields[1]) * parseFloat(fields[2]) ); 
} 

strTotal = moneyFormat(fTotal); 
strOutput+=strTotal; 
if ( bSymbol ) 
   strOutput = MonetarySymbol + strOutput 
document.write(strOutput); 
} 

//---------------------------------------------------------------------|| 
// FUNCTION: Print_total_products                                      || 
// PARAMETERS: true/false if you want "item(s)" added to string        || 
// RETURNS: Total cost currently racked up by shopper                  || 
// PURPOSE: Aesthetics                                                 || 
//---------------------------------------------------------------------|| 
function Print_total_products(bVerbose) { 
var strOutput = ""; //String to be written to page 
var fTotal = 0; 
var iNumberOrdered = 0; //Number of products ordered 

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

for ( i = 1; i <= iNumberOrdered; i++ ) {
			even = Math.round(i/2);
      NewOrder = "Order." + i;
      database = "";
      dbShip ="";
      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); 
Token5 = database.indexOf("|", Token4+1); 
Token6 = database.indexOf("|", Token5+1); 
Token7 = database.indexOf("|", Token6+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, Token5 ); 
fields[6] = database.substring( Token5+1, Token6 ); 
fields[7] = database.substring( Token6+1, Token7 ); 
fields[8] = database.substring( Token7+1, database.length ); 

fTotal += (parseInt(fields[1])); 
} 

strOutput+=fTotal; 
if ( bVerbose ) { 
   if (fTotal == 1) { 
      strOutput+=" item" 
   } 
   else { 
      strOutput+=" items" 
   } 
} 
document.write(strOutput); 
} 

//---------------------------------------------------------------------|| 
// FUNCTION: Cart_is_empty                                             || 
// PARAMETERS: none                                                    || 
// RETURNS: Total true if cart is empty, false otherwise               || 
// PURPOSE: Aesthetics                                                 || 
//---------------------------------------------------------------------|| 
function Cart_is_empty( ) { 
   iNumInCart = GetCookie("NumberOrdered");          
   if ( iNumInCart == null ) iNumInCart = 0; 
   if ( iNumInCart == 0 ) return true;   
   return false; 
}

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