 /* Copyright (c) On Technology Australia Pty Ltd - All Rights Reserved.
 *
 * This source may be used only by registered customers of the "eziMerchant®" range
 * of products. Use of this code by unregistered parties is an offence that will be prosecuted.
 *  Modified heavily by Hendrik Thijssens -CDAS  User 7122 ast updated 12/3/2010
 * * 
 */ 
// cookie cart columns
var colProductID = 0;
var colQuantity = 1;
var colCustomFields = 2;

// product columns
var colProductPrice = 0;
var colFreightLocal = 1;
var colFreightDomestic = 2;
var colFreightInternational = 3;
var colProductWeight = 4;
var colTaxLocal = 5;
var colTaxDomestic = 6;
var colTaxInternational = 7;

// product info columns
var colProductCode = 0;
var colProductDesc = 1; 
var colCustomFieldKeys = 2;

// data structure
var arrCookie = document.cookie.split("; ");
var arrItem;
var arrLine;
var bProcessCart = false;
/*
 * Added by hjt 2/11/2007
 */    
 
 // data structure for ZONE Delivery Costs
//
	 var varOnLine = false;   //<<======================== to identify which of the two Websites is used
	 var varDataInputMode = true;
	 var varCheckOutNow = false;
     var colBasicRate = 0;
     var colVariableRate = 1;
     varPrompt = " ";
//     var varPrice = 0;
     var varWeight = 0;

     var varDiscount = 0;
     var TradeDiscount = 0;
     var TradeDiscountNumber = 0;
     var DeliveryNumber = 0;
	 var varQuantity = 0;

     var varTotalWeight = 0;
     var varTotalLength = 0;
     var varLocalDeliveryCost = 0;
     var varLongHaulCost = 0;
     var varInsurance = 8.00;
     var varAdminFee = 11.00;
     var varAddOn = 1.18;

     var varConfirm = true;

     var cabWidth = 0;
	 var extraShelfCost = parseFloat(0);
	 
	 var varCheckShoppingList = 0;
	 var varSuffix = "";
	 varURL = document.title;

     var varQtyCheck = 0;	 
	 var varFieldValue = " ";	 
     var varCustomFieldValue = 0;
     var  varCustomFieldName = "This is the fieldname "
     var varIndex = 0;
	 
	 var varFieldCheck = 0;
	 var old_iLineIdx = 0;
	 var  iLineIdx = 0;
	 var varPriceFactor = 1;
	 var varStyle = 0;
	 var varProdStyle = " ";
	 var varLaminate = 0;
	 var varProductCode = " ";
	 var newProductCode = " ";
	 var varShortCode = " ";
	 var varLengthShortCode = 2;
	 var varSubFieldIndex = 0;
	 var varErrors = 0;
	 var varBypass = 0;
	 var BypassCheckProductRange = false;
	 var PanelKBQuestion = false;

	 var FinalCheck = false;
	 var varStyleNeeded = 0;      //        checkIfStyleNeeded(iProdID)       
	 var varDeleteLine = false;
	 var varOrderCost = 0;
	 var varLHWidth = 0;
	 var varRHWidth = 0;
	 var varDoorSize = 0;	 
	 var varZone = " ";
	 
	 var ProductDoorStyle1 = "Nil";
	 var ProductDoorStyle2 = "Nil";
	 var ProductDoorStyle3 = "Nil";
	 var ProductOpenStyle1 = "Nil";
	 var ProductOpenStyle2 = "Nil";
	 var ProductOpenStyle3 = "Nil";
	 var ProductPanelStyle1 = "Nil";
	 var ProductPanelStyle2 = "Nil";
	 var ProductPanelStyle3 = "Nil";
	 var ProductKickStyle1 = "Nil";
	 var ProductKickStyle2 = "Nil";
	 var ProductKickStyle3 = "Nil";
	 
	 var varDoorStyle1 = "Nil";
	 var varDoorStyle2 = "Nil";
	 var varDoorStyle3 = "Nil";
	 var varPanelStyle1 = "Nil";
	 var varPanelStyle2 = "Nil";
	 var varPanelStyle3 = "Nil";
	 var varKickStyle1 = "Nil";
	 var varKickStyle2 = "Nil";
	 var varKickStyle3 = "Nil";
	 var varOpenStyle1 = "Nil";
	 var varOpenStyle2 = "Nil";
	 var varOpenStyle3 = "Nil";
	 var varStyleStyle = " ";
	 	 
	 var varCustomFieldNames = "";
	 var varCustomFieldValues = "";
	 var varLHDepth = 0;
	 var varOrderTotals = false;
	 var varProductType = "Unde";
	 var varProductDesc = "Unknown";
	 var varWardRobe1 = "000";
	 var varWardRobe2 = "000";
	 var varWardRobe3 = "000";
	 var varWardRobe4 = "000";
	 var varWardRobe5 = "000";
	 var varWardRobe6 = "000";
 	 var varWardRobe7 = "000";
	 var varWardRobe8 = "000";
	 var varWardRobe9 = "000";
	 var varWardRobe10 = "000";
	 var varWardRobe11 = "000";
	 var varWardRobe12 = "000";
	 var varWardRobe13 = "000";
	 var varWardRobe14 = "000";
	 var varWardRobe15 = "000";
	 var varWardRobe16 = "000";
	 var varWardRobe17 = "000";
	 var varWardRobe18 = "000";
	 var varWardRobe19 = "000";
	 var varWardRobe20 = "000";
	 var varWardRobe21 = "000";
	 var varWardRobe22 = "000";
	 var varWardRobe23 = "000";
	 var varWardRobe24 = "000";
	 
	 var varRoomWall = "00"
	 var RoomWall = "";
	 var Section = "";
	 
	 var varWardRobeHeight1 = 0;
	 var varWardRobeHeight2 = 0;
	 var varWardRobeHeight3 = 0;
	 var varWardRobeHeight4 = 0;
	 var varWardRobeHeight5 = 0;
	 var varWardRobeHeight6 = 0;
 	 var varWardRobeHeight7 = 0;
	 var varWardRobeHeight8 = 0;
	 var varWardRobeHeight9 = 0;
	 var varWardRobeHeight10 = 0;
	 var varWardRobeHeight11 = 0;
	 var varWardRobeHeight12 = 0;
	 var varWardRobeHeight13 = 0;
	 var varWardRobeHeight14 = 0;
	 var varWardRobeHeight15 = 0;
	 var varWardRobeHeight16 = 0;
	 var varWardRobeHeight17 = 0;
	 var varWardRobeHeight18 = 0;
 	 var varWardRobeHeight19 = 0;
	 var varWardRobeHeight20 = 0;
	 var varWardRobeHeight21 = 0;
	 var varWardRobeHeight22 = 0;
	 var varWardRobeHeight23 = 0;
	 var varWardRobeHeight24 = 0;	 
	 
	 var varWardRobeDepth1 = 0;
	 var varWardRobeDepth2 = 0;
	 var varWardRobeDepth3 = 0;
	 var varWardRobeDepth4 = 0;
	 var varWardRobeDepth5 = 0;
	 var varWardRobeDepth6 = 0;
 	 var varWardRobeDepth7 = 0;
	 var varWardRobeDepth8 = 0;
	 var varWardRobeDepth9 = 0;
	 var varWardRobeDepth10 = 0;
	 var varWardRobeDepth11 = 0;
	 var varWardRobeDepth12 = 0;
	 var varWardRobeDepth13 = 0;
	 var varWardRobeDepth14 = 0;
	 var varWardRobeDepth15 = 0;
	 var varWardRobeDepth16 = 0;
	 var varWardRobeDepth17 = 0;
	 var varWardRobeDepth18 = 0;
 	 var varWardRobeDepth19 = 0;
	 var varWardRobeDepth20 = 0;
	 var varWardRobeDepth21 = 0;
	 var varWardRobeDepth22 = 0;
	 var varWardRobeDepth23 = 0;
	 var varWardRobeDepth24 = 0;
	 
  var varWardRobeShape1 = false;
  var varWardRobeShape2 = false;
  var varWardRobeShape3 = false;
  var varWardRobeShape4 = false;
  var varWardRobeShape5 = false;
  var varWardRobeShape6 = false;
  var varWardRobeShape7 = false;
  var varWardRobeShape8 = false;
  var varWardRobeShape9 = false;
  var varWardRobeShape10 = false;
  var varWardRobeShape11 = false;
  var varWardRobeShape12 = false;
  var varWardRobeShape13 = false;
  var varWardRobeShape14 = false;
  var varWardRobeShape15 = false;
  var varWardRobeShape16 = false;
  var varWardRobeShape17 = false;
  var varWardRobeShape17 = false;
  var varWardRobeShape19 = false;
  var varWardRobeShape20 = false;
  var varWardRobeShape21 = false;
  var varWardRobeShape22 = false;
  var varWardRobeShape23 = false;
  var varWardRobeShape24 = false;
  
   wardrobe = new Array("ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ","ZZZ");
   sections = new Array("A","B","C","D","E","F","G","H","I");
  var X = 0;  // used in checking the Wardrobe Sections
  var Y = 0; 
  var WRShelfQuantity = 0;
  var WRShelfCost = 64.50;	
	 	 
	 RoomWallSection = "000";
	 
	 var varRW1 = "NIL";
	 var varRW2 = "NIL";
	 var varRW3 = "NIL";
	 var varRW4 = "NIL";
	 var varRW5 = "NIL";
	 var varRW6 = "NIL";
	 var varRW7 = "NIL";
	 var varRW7 = "NIL";
	 var varRWError = "";
	 var varSection = " ";
	 var varLastWR = " ";
	 var varLastSection = " ";
	 
	 var varNewRoom = " ";
	 var varNewWall = " ";
	 var varNewBench = "";
	 var varNewSection = " ";
	 
 	 var X1 = 0; //used in checking the ABCstring
	 var ABCstring = "ABCDEFGHIJK";
	 var varLastcode = "A";
	 var varNextcode = "A";
	 
	 var varBenchTop1 = "";
     var varBenchTop2 = "";
	 var varBenchTop3 = "";
	 var varBenchTop4 = "";
	 var varBenchTop5 = "";
	 var varBenchTop6 = "";
 	 var varBenchTop7 = "";
	 var varBenchTop8 = "";
	 var varBenchTop9 = "";
	 var varBenchTop10 = "";
	 var varLeftEnd1 = 0;
	 var varLeftEnd2 = 0;
	 var varLeftEnd3 = 0;
	 var varLeftEnd4 = 0;
	 var varLeftEnd5 = 0;
	 var varLeftEnd6 = 0;
	 var varLeftEnd7 = 0;
	 var varLeftEnd8 = 0;
	 var varLeftEnd9 = 0;
	 var varLeftEnd10 = 0;
	 var varRightEnd1 = 0;
	 var varRightEnd2 = 0;
	 var varRightEnd3 = 0;
	 var varRightEnd4 = 0;
	 var varRightEnd5 = 0;
	 var varRightEnd6 = 0;
	 var varRightEnd7 = 0;
	 var varRightEnd8 = 0;
	 var varRightEnd9 = 0;
	 var varRightEnd10 = 0;
	 
	 var varBenchCost = 0;

	 var varBTNumber = 0;
	 var varMaleJoin = 0;
	 var varFemaleJoin = 0;

	 var varButtJoin = 0;
	 var varEndJoin = 0;
	 var varJoinTotal = 0;
	 var varCarcass = false;
	 var varDoor = false;
	 var varCabinet = false;
	 var varBenchtop = false;
	 var varWardrobe = false;
	 var varPanel = false;
	 var varOpenUnit = false;
	 var varStyleSpec= false;
	 var varDelivery = false;
	 var varDiscountRequest = false;
	 var varKickboard = false;
	 var varFiller = false;
	 var varHandles = false;
	 var varHardware = false;
	 var varConfirmDelivery = false;
	 var varOrderStatus = false;
	 var varInvalidProduct = false;
	 var varConfirm = false;
	 var TotalOrderCheck = false;
	 var varFatalError = false;
	 var varErrorType = 0;
	 var varErrorType2 = 0;
	 var iProdIDLast = 0;
	 
	 var varStatistics = false;
	 var FloorUnits = 0;
	 var WallUnits = 0;
	 var OpenUnits = 0;
	 var Panels = 0;
	 var Kickboards = 0;
	 var Benchtops = 0;
	 var Wardrobes = 0;
	 var Bulkheads = 0;
	 var Fillers = 0;
	 var ExtraDoors = 0;
	 var CarcassUnits = 0;
	 var ModularUnits = 0;
	 var Handles = 0;
	 var Hardware = 0;
// for benchtop calculations
     var Ll = 0;  // length of side
	 var Ww = 0;  // Width od side
	 var Ee = 0;  // Single or Double Postform
	 var varBenchWeight = 0 ;  // calculated weight of one Side
	 var BenchWeight = 0 ;  // Total weight of a benchtop product.
	 var CalculatedBenchtopCost = 0;
	 
	 var varBenchtopProcessed = false; 
	 var varLeftSideProcessed = false;
	 var varRightSideProcessed = false;
	 
	 var varL1 = 0;  //Lenth of side 1
	 var varW1 = 0;  // Width of Side 1
	 var varE1 = 0;  //Edging of Side 1
	 var varBenchW1 = 0;  // Weight of Side 1
	 var varL2 = 0;  //Lenth of side 2
	 var varW2 = 0;  // Width of Side 2
	 var varE2 = 0;  //Edging of Side 2
	 var varBenchW2 = 0;  // Weight of Side 2
	 var varL3 = 0;  //Lenth of side 3
	 var varW3 = 0;  // Width of Side 3
	 var varE3 = 0;  //Edging of Side 3
	 var varBenchW3 = 0;  // Weight of Side 3
	 var BenchCost = 0;  //calculated benchCost
	 var BenchCost1 = 0;  // Side 1 cost
	 var BenchCost2= 0;  // Side 2 cost
	 var BenchCost3 = 0;  // Side 3 cost
	 var varBenchtopStyle = false;
	
	 var varEndFinishNumber = 0;
	 var varEndNumber = 0;
	 var BenchLength = 0;  // checking on the maximum length of a benchTop
	 var BenchWeightLshapeA = 0; // weight of Lshape Bench A
	 var BenchWeightLshapeB = 0; // weight of Lshape Bench B
	 var BenchWeightUshapeA = 0; // weight of U-shape Bench A
	 
	 var varKickboardCheck = false;
	 var varPanelCheck = false;
	 var varCarcassProcessed = false;
	 var varPreviousBaseHeight = 0;  //To check that current Base Cabinet Height = Previous one 
	 var varFullProductStyle = "A different Style"; 
	 var varProductChangeFlag = false;
	 var varDescription1 = " but have not chosen a valid Melamine Colour/style for these -click [Yes] to do this now, if not - then click [Cancel]."; 
// for calculation of Proportional Cost (changing curPrice)

	 var varNewPrice = 0;
	 var varMeasurements = " ";
	 arrDimensions = new Array(5);
	 var varHeight = 0;
	 var varWidth = 0;
	 var varDepth = 0;
	 var varLHWidth = 0;
	 var varRHWidth = 0;
	 var varLHDepth = 0;
	 var varRHDepth = 0;
	 var varCurrentOrderPrice = 0;
	 var productCode= " ";
	 var customName = " ";
	 var customValue = " ";
	 var realPID = 0;
	 var varDimension1 = 750;  // default values for Height that is used to build a newProductCode
	 var varDimension2 = 600; // deault Width
	 var varShelfSize = 36; // default shelf size
	 var varfunny = " ";
	 var varFlength = "";
	 var varPart1 = "";
	 var varPart2 = "";
	 var varSpecial = "";
	 var varSpecialRequest = "";
	 var varChar = " ";
	 var DeliveryLocation = " ";

	 var AlbanyColour1 = " ";
	 var AlbanyColour2 = " ";
	 var AlbanyColour3 = " ";
	 var AvocaColour1 = " ";
	 var AvocaColour2 = " ";
	 var AvocaColour3 = " ";
	 
	 var varOutlet = "ACT - Mitchell 2902";
	 var varAdminCost = 0;
	 var Insurance = 0;
	 var DoNotallowEdit = false;
	 var addThirtyPercent = false;
	 var varFirstTime = true;
	 var varOutletSet = false;
	 var varNoPanel = false;
	 var varNoKick = false;
	 var varGLOSS = false;		
     var CookieRetentionDefault = 60;
	 var CookieRetention = 60;  //to set deleted items
	 var OutLet = false;
	 var newwindow1;
	 var prodname = "prodname";
	 var newwindow;
     var newwindow1;
	 var varListAll = false;
   	 var varLimitLines = false; 
	 var currentLine = 0;
	 var CookieID = "lines";
	  // END of Variables put in by HJT
//==================================================================	   
	 var SaveCookie = false;	 
	 if (arrCookie == null || arrCookie == "") SaveCookie = false;
//==================================================================
//start here   <============================	
private_CartLoad(); 
//alert(" 463 arrCookie= " + arrCookie + " varLimitLines = " + varLimitLines );

//=========================================================
// delete current Cookie
function deleteCookie()
{
varLimitLines = false;
 arrLine = new Array();
 CookieRetention = 0;
 private_UpdateLines();
 CookieRetention = CookieRetentionDefault;

}
	
//---------------------------------------------//  this function is to delete the complete order details
function deleteAll()
{
varLimitLines = false;

varConfirm=window.confirm("You have asked to [REMOVE] Projects. Please CONFIRM - to REMOVE all data click [OK] - to KEEP all entries click [CANCEL].");
	if (varConfirm == true)
	{
varConfirm=window.confirm("To DELETE ALL Projects data [for example : to overcome a Systems Problem} - click [OK] - to just REMOVE the current Project details click [Cancel].");
      if (varConfirm == false) 
	  {
	    deleteCookie();
         alert(" Just your current Project data has been Removed - Now (re-)start your new Project specifications");
    	   window.location.replace("category428_1.htm");
      }
	  else
      {
	     for(var ii = 0; ii <arrCookie.length; ii++)
         {
            if (arrCookie[ii] != "undefined" && arrCookie[ii].length > 5)
			{
	            CookieID = arrCookie[ii].substr(0, 5);
		        deleteCookie(); 
		    }
	     }	   
	      window.location.replace("category428_1.htm");
         alert("All Projects stored have been deleted - Now [re-]start your new Project specifications");
      }
    }
		
} 

//==================================================================





//   Checking Input values only ( "?" or Null value, or " "), or exceeding MAX values
//  NOTE: this function is processed for EVERY Field on the Input Record!!	 
function checkInput(strFieldVal, i, iLineIdx, iProdID)
{ 

     if (iLineIdx > 0) iLineIdx = iLineIdx - 1;
	    varCustomFieldCount = getLineSubCount(iLineIdx, colCustomFields);
		customName = getCustomField(getProductInfo(iProdID)[colCustomFieldKeys][i-1]);
  	    varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][i - 1];

		
  // find the 'Special requests' field in the first line item           
	  var firstChar = strFieldVal.substring(0,1);
	  if (varCustomFieldNameCode >  530 && varCustomFieldNameCode < 553) ;
	  else if 
	    (firstChar == "?" || (strFieldVal == " " && varCustomFieldNameCode != 10 && varCustomFieldNameCode != 243 && varCustomFieldNameCode != 617)
		                   || (strFieldVal < " " && varCustomFieldNameCode != 10 && varCustomFieldNameCode != 243 && varCustomFieldNameCode != 617))								  
	  {
			      varFieldCheck = 1;
window.alert("The prompt for: [" + customName + "] in your last Product Specification has an invalid value, shown as: [" + strFieldVal + "]  - or has been changed to [blank cell] . ----- For a VALID Specification or Comment you MUST correctly fill in each cell value. --- To return back to the Prompt to fix the missing value/s click [OK] ");
	  }   			  	          	  

 // Now we check at the end of the normal input if there were any errors
 //Firstly -- check on Outlet change
    if (varProductCode == "Outlet" && OutLet == true && i == 1) {
	  varConfirm=window.confirm("You entered new Project details - there is a CURRENT Project already. If you merely wanted to change some of the Project data details then the Current Project line item will be REPLACED when you click [CANCEL] now -  BUT - If you want to START A NEW RFQ then click [OK] and the current RFQ data will be stored and a new Project will be started." );  
		  
		   if (varConfirm == true) {
		      OutLet = false;
		      storeCurrentCookie();		  
		   }
		   else 
		   {    
		      deleteLine(currentLine);
           }				 
	 }
 
 
// Now --- if STYLE record was entered
   	varProductCode = getProductInfo(iProdID)[colProductCode];	
    if (varProductCode.substring(0,7) == "2 Style" && i == 1) {
		  if (BypassCheckProductRange == false) {
		    checkProductRange();			
               return varFieldCheck;
           }
	}
   	if (varProductCode.substring(0,1) == "3" && varLaminate > 0) {
window.alert("Sorry: You have already specified a Benchtop Laminate earlier - if that selection is not required then please [REMOVE] it from the 'View Cart' first - but if you need an additional Colour then please [EDIT] the Benchtop affected in 'View Cart' by typing the new Colour etc. in the [Special Requests] box of that Benchtop so it is brought to the attention of our Production Manager.");
                  varFieldCheck = 1;
				  location.replace("viewcart.htm");				  
				  return varFieldCheck;			  
    }
 // Firstly when DISCOUNT is entered
    if (varProductCode.substring(0,2) == "zz" && i == 1 ) {
		    if (varDiscountRequest == true) {
			  varFieldCheck = 1;
varConfirm=window.confirm("***You have already specified a Discount - Click [OK] to REMOVE the previous entry from the VIEWCART list, or [CANCEL] your current DISCOUNT choice and pick another Specification.");
                      if (varConfirm == true) location.replace("viewcart.htm");
			}
		    	checkProductRange();			
               return varFieldCheck;
	}     
		
//  Secondly when a DELIVERY is entered.
  // For Customer to arrange Freighting 
    if (varProductCode.substring(0,16) == "zPickUpBoxReqd/1" && i == 1) {
	     varConfirm=window.confirm("***NOTE: For this choice the factory will box the product components, awaiting your Freight Comany - BUT you will not be eligable for the 5% Pickup Discount - please confirm [OK] or change[CANCEL] your Delivery choice.");
                      if (varConfirm == false) {					 
					        varFieldCheck = 1;
					        return varFieldCheck;
					  }
	}			  

        if ((varProductCode.substring(0,2) == "zP" && i == 1) || (varProductCode.substring(0,2) == "zD" && i == 1)) {
		  if (BypassCheckProductRange == false) {
		   checkDiscountandProducts();			
           return varFieldCheck;
           }
		}        

       iProdIDLast = 0;
       varPriceFactor = 1;

	   varProductCode = getProductInfo(iProdID)[colProductCode];
	   varShortCode = varProductCode.substring(0,3);
	   varProdName = getProductInfo(iProdID)[colProductDesc];
	   varStyle = varProdName.indexOf("HMR W");
	   if (varStyle > 0) varProdStyle = "Carca";

       varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][i-1];
// check for Product Style data	   
       if (varCustomFieldNameCode > 594 && varCustomFieldNameCode < 600){
	     varProdStyle = strFieldVal.substring(0,5);	
	     if (varProdStyle == "Lamin" || varProdStyle == "Unfin") varPriceFactor = 1;
	     else if (varProdStyle == "Belmo" || varProdStyle == "Unfin") varPriceFactor = 2;
	     else if (varProdStyle == "Byron" || varProdStyle == "Alban") varPriceFactor = 4;
	     else if (varProdStyle == "Avoca") varPriceFactor = 7;	
//alert("line 517- Fieldnamecode= " + varCustomFieldNameCode + " varProdStyle= " + varProdStyle + " i= " + i + " strFieldVal= " + strFieldVal.substring(0,1));
       }
	   varProductType = checkProductType(iProdID,varStatistics,i);
//  
//  Here we check for MAX Height, Max Width and/or Max Depth (or RH-Width) values for a range of Products
//
  if (varProductType != "Deli" && varProductType != "Disc" && varProductType != "Styl" && varProductType != "Hand" && varProductType != "Hard") 
  {
          varFieldValue = parseInt(strFieldVal);		  
 			  if (i == 1) {			  
			    varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][i - 1];
				varProductCode = getProductInfo(iProdID)[colProductCode];
				varShortCode = varProductCode.substring(0,3);
				varFiveCode = varProductCode.substring(0,5);			  
                varMaxHeight = getMaxHeight(varCustomFieldNameCode);

				  if (varMaxHeight > 0 && varMaxHeight < varFieldValue) {
   window.alert("***Sorry: the MAX HEIGHT (or Length) range for this particular Product is " + varMaxHeight + "mm*** Please either reduce the Height or select a different Product. If it must be this Height, amend the Height to " + varMaxHeight + " and in the [Special Request] box write ‘Height XXXmm’ and we will need to provide a custom quotation in this case.");
                      varFieldCheck = 1;
			          return varFieldCheck;	
				  }
// For Underbench Oven WITH Drawer check if height < 750
                  if (varProductCode.substring(0,4) == "UBOD" && varFieldValue < 750) {
window.alert("*** Sorry, but for an Underbench Oven WITH DRAWER the minimum Height is 750 mm***, please amend the Height or choose a different Underbench Oven product");
                   varFieldCheck = 1;
			          return varFieldCheck;	
				  }				  				  
				  
//Check for Floor Cabinet Height being the same as the previous height, for FIRST Field Value				  
				  if (varProductCode.substring(0,1) == "B" && varProductCode.substring(0,2) != "BT") {
				    if (varPreviousBaseHeight > 0 && varPreviousBaseHeight != varFieldValue) {
varConfirm=window.confirm("This Floor Unit has a different HEIGHT from a previous Floor unit specified - please confirm [OK] or change[CANCEL]");
                      if (varConfirm == false) {					 
					        varFieldCheck = 1;
			                return varFieldCheck;
					  }			  
                    }				  			  					
		         }				  			  					
		      }
			  
              if (i == 2) {			   			  
			    varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][i - 1];			  
                varMaxWidth = getMaxWidth(varCustomFieldNameCode);
				if (varFieldValue > 0) varLHWidth = varFieldValue;
				  if (varMaxWidth > 0 && varMaxWidth < varFieldValue) {
   window.alert("***Sorry: the MAX WIDTH for this particular Product is " + varMaxWidth + "mm*** Please either reduce the Width or select a different Product. If it must be this Width, amend the Width to + varMaxHeight + and in the [Special Request] box write ‘Width XXXmm’ and we will need to provide a custom quotation in this case.");
                      varFieldCheck = 1;
			          return varFieldCheck;
				  }			  					
		      }		  
	  	
		if (i == 3) {
		      if (varProductType != "Ward" && varShortCode != "WOD" ) {			    			  
			    varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][i - 1];			  
                varMaxWidth = getMaxWidth(varCustomFieldNameCode);
                  if (varFieldValue > 0) varRHWidth = varFieldValue;
				  if (varMaxWidth > 0 && varMaxWidth < varFieldValue) {
   window.alert("****You cannot exceed the Depth (or RH-WIDTH range) for this Product***, please amend the field value specified or select a different Product Range - also you could put a REQUEST for Quotation in the [Special Request] box and we will provide a quotation for this special case***");
                      varFieldCheck = 1;
			          return varFieldCheck;
				  }
			   }			  					
		}
			  
		if (i == 4) {			   			  
			    varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][i - 1];
				  if (varProductType != "Ward" && varShortCode != "WOD" && varShortCode != "WOM" ) { 			  
                      varMaxWidth = getMaxWidth(varCustomFieldNameCode);
				      if (varMaxWidth > 0 && varMaxWidth < varFieldValue) {
   window.alert("****You cannot exceed the MAXIMUM DEPTH for this Product***, please amend the field value specified or select a different Product Range - also you could put a REQUEST for Quotation in the [Special Request] box and we will provide a quotation for this special case***");
                      varFieldCheck = 1;
			          return varFieldCheck;
				     }			  
				   if (varFieldValue > 0) varLHDepth = varFieldValue;
				 }
				 else {
			           varMaxHeight = getMaxHeight(varCustomFieldNameCode);
				       if (varMaxHeight > 0 && varMaxHeight < varFieldValue) {
					      if (varProductType == "Ward") {
						     window.alert("****You cannot exceed the HEIGHT range for this Product***, please amend the value specified or select a different Product Range - also you could put a REQUEST for Quotation in the [Special Request] box and we will provide a quotation for this special case***");
                    		  varFieldCheck = 1;
			        		  return varFieldCheck;	
				    	   }
						   else {
						  
   window.alert("****You cannot exceed the maximum DEPTH for this Product***, please amend the value specified or select a different Product Range - also you could put a REQUEST for Quotation in the [Special Request] box and we will provide a quotation for this special case***");
                    		  varFieldCheck = 1;
			        		  return varFieldCheck;	
				      	 }
					   }			  
				 }
	    }
		
		if (i == 5 && varLHDepth > 0 && varProductType != "Ward") {
// window.alert("varProductType= " + varProductType  + " varLHDepth= " + varLHDepth + " i= " + i );			   			  
			    varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][i - 1];			  
              if (varProductType != "Ward" && varProductType != "Benc" && varShortCode != "WOD" && varShortCode != "WOM" && varShortCode != "BOA" && varShortCode != "WDO" && varShortCode != "cWO" && varShortCode != "cPD" && varShortCode != "cBO" && varShortCode != "cWD") {
				varMaxWidth = getMaxWidth(varCustomFieldNameCode);
				if (varFieldValue > 0) {
				      if (varMaxWidth > 0 && varMaxWidth < varFieldValue) {
   window.alert("****You cannot exceed the MAXIMUM DEPTH for this Product***, please amend the field value specified or select a different Product Range - also you could put a REQUEST for Quotation in the [Special Request] box and we will provide a quotation for this special case***");
                      varFieldCheck = 1;
			          return varFieldCheck;
				     }			  				
					varRHDepth = varFieldValue;
//Exclude 'BOOMERANG' cabinet or a Diagonal cabinet and Diagonal Pantries
                  if (varProductType != "Hybr" && varShortCode != "BD-" && varShortCode != "WD-" && varShortCode != "BB4" && varShortCode != "WB4")  {
				  
				   if (varShortCode != "PD-" && varShortCode != "WEC" && varShortCode != "WR" && varShortCode != "cPD" && varShortCode != "cWD" && varShortCode != "cBD" && varShortCode != "BCD") {
				     varBiFoldWidth = varLHWidth - varRHDepth;
					  if (varBiFoldWidth < 220) {
	   window.alert(" From the measurements that you had entered the [LEFT] Bi-fold Door is only [" + varBiFoldWidth + " ]mm Wide. The minimum size is [220]mm. You must increase the [Left] Width or/and decrease the [Right] Depth to achieve a bigger door size. Click the Info button in this product when you return to this product for more information about how to work out door sizes");
                      varFieldCheck = 1;
			          return varFieldCheck;
				      } 
					} 
					
					if (varShortCode != "PD-" && varShortCode != "WEC" && varShortCode != "WR" && varShortCode != "cPD" && varShortCode != "cWD" && varShortCode != "cBD" && varShortCode != "BCD") {
				    	varBiFoldWidth = varRHWidth - varLHDepth;
					  if (varBiFoldWidth < 220) {
	  window.alert(" From the measurements that you had entered the [RIGHT] Bi-fold Door is only [" + varBiFoldWidth + " ]mm Wide. The minimum size is [220]mm. You must increase the [Right] Width or/and decrease the [Left] Depth to achieve a bigger door size. Click the Info button in this product when you return to this product for more information about how to work out door sizes");
                      varFieldCheck = 1;
			          return varFieldCheck;
				      } 
					 }
					 			  
                   if (varShortCode != "PD-" && varShortCode != "WEC" && varShortCode != "WR" && varShortCode != "cPD" && varShortCode != "cWD" && varShortCode != "cBD" && varShortCode != "TBA" && varShortCode != "BCD") {
				    varBiFoldWidth = varLHWidth - varRHDepth + varRHWidth - varLHDepth;					
					  if (varBiFoldWidth > 650) {
varConfirm=window.confirm("From the measurements that you have entered the combined Left and Right Bi-fold door size is [" + varBiFoldWidth + "]mm in combined Width. The hinge supplier will not warrant anything above 650mm because of dropping and sagging due to the excessive weight. To overcome this you will need to reduce the cabinet size to achieve a smaller combined door size. Click the [Info button] when returning to this product for more information about how to work out door sizes.----- Click [OK] to force your current size (thus voiding your warrantee for this cabinet) OR Click [CANCEL] to return to this product to re-adjust sizes or learn more about sizes");  
                        if (varConfirm == false) {					 
					        varFieldCheck = 1;
			                return varFieldCheck;
				        } else {
						   varErrorType2 = 1;
						  }
					  }
					}
					
					if (varShortCode != "PD-" && varShortCode != "WEC" && varShortCode != "WR" && varShortCode != "cPD" && varShortCode != "cWD" && varShortCode != "cBD" && varShortCode != "TBA" && varShortCode != "BCD") {  				  
					    if (varBiFoldWidth < 450){
varConfirm=window.confirm(" The Bi-Fold Door for this cabinet =  " + varBiFoldWidth + "  mm and this is very small , you could reconsider the cabinet dimensions by clicking [CANCEL] or ignore the warning by clicking [O.K.]. "	); 
	                    if (varConfirm == false) {					 
					        varFieldCheck = 1;
			                return varFieldCheck;
						 }			  					  
					  }
					}
					
                   if (varShortCode == "PD-" || varShortCode == "WD-" ) {
                    varBiFoldWidth = Math.ceil(Math.sqrt(Math.pow(varLHWidth - varRHDepth,2)+ Math.pow(varRHWidth - varLHDepth,2)));	
window.alert("Your Door Width has been calculated as about " + varBiFoldWidth + "mm");
					  if (varBiFoldWidth < 400){
varConfirm=window.confirm(" The Diagonal Door for this cabinet =  " + varBiFoldWidth + "  mm and this is very small , you could reconsider the cabinet dimensions by clicking [CANCEL] or ignore the warning by clicking [O.K.]. "	); 
	                    if (varConfirm == false) {					 
					        varFieldCheck = 1;
			                return varFieldCheck;
						 }			  					  
					  }
					}

                if (varFiveCode == "PD-D1") {
				   if (varBiFoldWidth > 650) {
varConfirm=window.confirm("From the measurements that you have entered the Door size is [" + varBiFoldWidth + "]mm in Width The hinge supplier will not warrant anything above 650mm because of dropping and sagging due to the excessive weight. To overcome this you will need to reduce the cabinet size to achieve a smaller combined door size. ----- Click [OK] to force your current size (thus voiding your warrantee for this cabinet) OR Click [CANCEL] to return to this product to re-adjust sizes or learn more about sizes");  
                        if (varConfirm == false) {					 
					        varFieldCheck = 1;
			                return varFieldCheck;
				        } else {
						   varErrorType2 = 1;
						  }
					}
				}
				
                if (varFiveCode == "PD-D2") {
				   if (varBiFoldWidth > 1300) {
varConfirm=window.confirm("From the measurements that you have entered the Door size is [" + varBiFoldWidth + "]mm in width. The hinge supplier will not warrant anything above 650mm because of dropping and sagging due to the excessive weight. To overcome this you will need to reduce the cabinet size to achieve a smaller combined door size. ----- Click [OK] to force your current size (thus voiding your warrantee for this cabinet) OR Click [CANCEL] to return to this product to re-adjust sizes or learn more about sizes");  
                        if (varConfirm == false) {					 
					        varFieldCheck = 1;
			                return varFieldCheck;
				        } else {
						   varErrorType2 = 1;
						  }
					  }				
			    }
//			   }
			   
					}
				  } 					      
			     }                     
		   }
		   
            if (i == 5 && varProductType == "Ward") {			   			  
			    varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][i - 1];			  
//			    window.alert("Field Code name= " + varCustomFieldNameCode + " i= " + i);
                varMaxWidth = getMaxWidth(varCustomFieldNameCode);
				if (varMaxWidth > 0 && varMaxWidth < varFieldValue) {
   window.alert("****You cannot exceed the WIDTH range for this Product***, please amend the width specified or select a different Product Range - also you could put a REQUEST for Quotation in the [Special Request] box and we will provide a quotation for this special case***");
                      varFieldCheck = 1;
			          return varFieldCheck;
				  }
				if (varFieldValue > 0) varLHWidth = varFieldValue;				  			  					
		      }

	         if (i == 6 && varProductType == "Ward") {			    			  
			    varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][i - 1];			  
                varMaxWidth = getMaxWidth(varCustomFieldNameCode);
				    if (varMaxWidth > 0 && varMaxWidth < varFieldValue) {
   window.alert("****You cannot exceed the  maximum DEPTH for this Product***, please amend the field value specified or select a different Product Range - also you could put a REQUEST for Quotation in the [Special Request] box and we will provide a quotation for this special case***");
                      varFieldCheck = 1;
			          return varFieldCheck;
				    }
                  if (varFieldValue > 0) varRHWidth = varFieldValue;								  					
		      }
  }
// Checking on WardRobe to prevent duplicate identifications or Section not starting with A							 
   if (varProductType ==  "Ward")  {						   
	 if (i == 1) varNewRoom = strFieldVal;
	 if (i == 2) varNewWall = strFieldVal;						
	 if (i == 3) {
		varNewSection = strFieldVal;
		varRoomWall = varNewRoom + varNewWall;							
		var varPosition = varNewRoom + varNewWall + varNewSection;
		if (varPosition == varWardRobe1 || varPosition == varWardRobe2 || varPosition == varWardRobe3 || varPosition == varWardRobe4 || varPosition == varWardRobe5 || varPosition == varWardRobe6 || varPosition == varWardRobe7 || varPosition == varWardRobe8 || varPosition == varWardRobe9 || varPosition == varWardRobe10 || varPosition == varWardRobe11 || varPosition == varWardRobe12 || varPosition == varWardRobe13 || varPosition == varWardRobe14 || varPosition == varWardRobe15 || varPosition == varWardRobe16 || varPosition == varWardRobe17 || varPosition == varWardRobe18 || varPosition == varWardRobe19 || varPosition == varWardRobe20 || varPosition == varWardRobe21 || varPosition == varWardRobe22 || varPosition == varWardRobe23 || varPosition == varWardRobe24) {
window.alert("Sorry: You already have a ROOM, ROBE & SECTION combination [" + varPosition + "] in your Quote Request, see [Viewcart]. Please change the combination for this Wardrobe to ensure correct separation of manufactured components");	   
                            varFieldCheck = 1;
			                return varFieldCheck;
	   }
	   
	   if (varRoomWall != varWardRobe1.substring(0,12) && varRoomWall != varWardRobe2.substring(0,12) && varRoomWall != varWardRobe3.substring(0,12) && varRoomWall != varWardRobe4.substring(0,12) && varRoomWall != varWardRobe5.substring(0,12) && varRoomWall != varWardRobe6.substring(0,12) && varRoomWall != varWardRobe7.substring(0,12) && varRoomWall != varWardRobe8.substring(0,12) && varRoomWall != varWardRobe9.substring(0,12) && varRoomWall != varWardRobe10.substring(0,12) && varRoomWall != varWardRobe11.substring(0,12) && varRoomWall != varWardRobe12.substring(0,12) && varRoomWall != varWardRobe13.substring(0,12) && varRoomWall != varWardRobe14.substring(0,12) && varRoomWall != varWardRobe15.substring(0,12) && varRoomWall != varWardRobe16.substring(0,12) && varRoomWall != varWardRobe17.substring(0,12) && varRoomWall != varWardRobe18.substring(0,12) && varRoomWall != varWardRobe19.substring(0,12) && varRoomWall != varWardRobe20.substring(0,12) && varRoomWall != varWardRobe21.substring(0,12) && varRoomWall != varWardRobe22.substring(0,12) && varRoomWall != varWardRobe23.substring(0,12) && strFieldVal != "A") {
window.alert("The first SECTION code for a new ROOM/ROBE specification MUST be [A] -- following Sections must be consequetively coded from the Left to Right, e.g.: [A, B, C...] ----Please amend this specification");	  	   
							varFieldCheck = 1;
			                return varFieldCheck;	   
	   }	   	   
  }
 }   
 // Check that a Wardrobe SECTION has the same Height and Depth and Shape as OTHER SECTIONs with the same ROOM and WALL code
   if (varProductType ==  "Ward" && i == 4)  {
      var varWRH = false;
   if (varRoomWall == varWardRobe1.substring(0,12) && varFieldValue !=  varWardRobeHeight1) varWRH = true;
   if (varRoomWall == varWardRobe2.substring(0,12) && varFieldValue !=  varWardRobeHeight2) varWRH = true;
   if (varRoomWall == varWardRobe3.substring(0,12) && varFieldValue !=  varWardRobeHeight3) varWRH = true;
   if (varRoomWall == varWardRobe4.substring(0,12) && varFieldValue !=  varWardRobeHeight4) varWRH = true;
   if (varRoomWall == varWardRobe5.substring(0,12) && varFieldValue !=  varWardRobeHeight5) varWRH = true;
   if (varRoomWall == varWardRobe6.substring(0,12) && varFieldValue !=  varWardRobeHeight6) varWRH = true;
   if (varRoomWall == varWardRobe7.substring(0,12) && varFieldValue !=  varWardRobeHeight7) varWRH = true;
   if (varRoomWall == varWardRobe8.substring(0,12) && varFieldValue !=  varWardRobeHeight8) varWRH = true;
   if (varRoomWall == varWardRobe9.substring(0,12) && varFieldValue !=  varWardRobeHeight9) varWRH = true;
   if (varRoomWall == varWardRobe10.substring(0,12) && varFieldValue !=  varWardRobeHeight10) varWRH = true;
   if (varRoomWall == varWardRobe11.substring(0,12) && varFieldValue !=  varWardRobeHeight11) varWRH = true;
   if (varRoomWall == varWardRobe12.substring(0,12) && varFieldValue !=  varWardRobeHeight12) varWRH = true;
   if (varRoomWall == varWardRobe13.substring(0,12) && varFieldValue !=  varWardRobeHeight13) varWRH = true;
   if (varRoomWall == varWardRobe14.substring(0,12) && varFieldValue !=  varWardRobeHeight14) varWRH = true;
   if (varRoomWall == varWardRobe15.substring(0,12) && varFieldValue !=  varWardRobeHeight15) varWRH = true;
   if (varRoomWall == varWardRobe16.substring(0,12) && varFieldValue !=  varWardRobeHeight16) varWRH = true;
   if (varRoomWall == varWardRobe17.substring(0,12) && varFieldValue !=  varWardRobeHeight17) varWRH = true;
   if (varRoomWall == varWardRobe18.substring(0,12) && varFieldValue !=  varWardRobeHeight18) varWRH = true; 	 
   if (varRoomWall == varWardRobe19.substring(0,12) && varFieldValue !=  varWardRobeHeight19) varWRH = true;
   if (varRoomWall == varWardRobe20.substring(0,12) && varFieldValue !=  varWardRobeHeight20) varWRH = true;
   if (varRoomWall == varWardRobe21.substring(0,12) && varFieldValue !=  varWardRobeHeight21) varWRH = true;
   if (varRoomWall == varWardRobe22.substring(0,12) && varFieldValue !=  varWardRobeHeight22) varWRH = true;
   if (varRoomWall == varWardRobe23.substring(0,12) && varFieldValue !=  varWardRobeHeight23) varWRH = true;
   if (varRoomWall == varWardRobe24.substring(0,12) && varFieldValue !=  varWardRobeHeight24) varWRH = true;

	 if (varWRH == true) {
window.alert("Error: You have tried to ADD another section to an existing BANK of robes - but you have entered a different HEIGHT value? Please correct either Height value OR change the Wall Number");
 							varFieldCheck = 1;
			                return varFieldCheck;	 
     }
  }

   if (varProductType ==  "Ward" && i == 6) {
      varWRD = false;
    if (varRoomWall == varWardRobe1.substring(0,12) && varFieldValue !=  varWardRobeDepth1) varWRD = true;
	if (varRoomWall == varWardRobe2.substring(0,12) && varFieldValue !=  varWardRobeDepth2) varWRD = true;
	if (varRoomWall == varWardRobe3.substring(0,12) && varFieldValue !=  varWardRobeDepth3) varWRD = true;
	if (varRoomWall == varWardRobe4.substring(0,12) && varFieldValue !=  varWardRobeDepth4) varWRD = true;
	if (varRoomWall == varWardRobe5.substring(0,12) && varFieldValue !=  varWardRobeDepth5) varWRD = true;
	if (varRoomWall == varWardRobe6.substring(0,12) && varFieldValue !=  varWardRobeDepth6) varWRD = true;
	if (varRoomWall == varWardRobe7.substring(0,12) && varFieldValue !=  varWardRobeDepth7) varWRD = true;
	if (varRoomWall == varWardRobe8.substring(0,12) && varFieldValue !=  varWardRobeDepth8) varWRD = true;
	if (varRoomWall == varWardRobe9.substring(0,12) && varFieldValue !=  varWardRobeDepth9) varWRD = true;
	if (varRoomWall == varWardRobe10.substring(0,12) && varFieldValue !=  varWardRobeDepth10) varWRD = true;
	if (varRoomWall == varWardRobe11.substring(0,12) && varFieldValue !=  varWardRobeDepth11) varWRD = true;
    if (varRoomWall == varWardRobe12.substring(0,12) && varFieldValue !=  varWardRobeDepth12) varWRD = true;
	if (varRoomWall == varWardRobe13.substring(0,12) && varFieldValue !=  varWardRobeDepth13) varWRD = true;
	if (varRoomWall == varWardRobe14.substring(0,12) && varFieldValue !=  varWardRobeDepth14) varWRD = true;
	if (varRoomWall == varWardRobe15.substring(0,12) && varFieldValue !=  varWardRobeDepth15) varWRD = true;
	if (varRoomWall == varWardRobe16.substring(0,12) && varFieldValue !=  varWardRobeDepth16) varWRD = true;
	if (varRoomWall == varWardRobe17.substring(0,12) && varFieldValue !=  varWardRobeDepth17) varWRD = true;
	if (varRoomWall == varWardRobe18.substring(0,12) && varFieldValue !=  varWardRobeDepth18) varWRD = true;
	if (varRoomWall == varWardRobe19.substring(0,12) && varFieldValue !=  varWardRobeDepth19) varWRD = true;
	if (varRoomWall == varWardRobe20.substring(0,12) && varFieldValue !=  varWardRobeDepth20) varWRD = true;
	if (varRoomWall == varWardRobe21.substring(0,12) && varFieldValue !=  varWardRobeDepth21) varWRD = true;
	if (varRoomWall == varWardRobe22.substring(0,12) && varFieldValue !=  varWardRobeDepth22) varWRD = true;	 
	if (varRoomWall == varWardRobe23.substring(0,12) && varFieldValue !=  varWardRobeDepth23) varWRD = true;
	if (varRoomWall == varWardRobe24.substring(0,12) && varFieldValue !=  varWardRobeDepth24) varWRD = true;

	 if (varWRD == true) {
window.alert("Error: You have tried to ADD another section to an existing BANK of robes - but you have entered a different DEPTH value? Please correct either Depth value OR change the Wall Number");
 							varFieldCheck = 1;
			                return varFieldCheck;	 
     }
   }   
   if (varProductType ==  "Ward" && i == 7) {
      var varWRS = false;
    if (varRoomWall == varWardRobe1.substring(0,12) && strFieldVal !=  varWardRobeShape1) varWRS = true;
	if (varRoomWall == varWardRobe2.substring(0,12) && strFieldVal !=  varWardRobeShape2) varWRS = true;
	if (varRoomWall == varWardRobe3.substring(0,12) && strFieldVal !=  varWardRobeShape3) varWRS = true;
	if (varRoomWall == varWardRobe4.substring(0,12) && strFieldVal !=  varWardRobeShape4) varWRS = true;
	if (varRoomWall == varWardRobe5.substring(0,12) && strFieldVal !=  varWardRobeShape5) varWRS = true;
	if (varRoomWall == varWardRobe6.substring(0,12) && strFieldVal !=  varWardRobeShape6) varWRS = true;
	if (varRoomWall == varWardRobe7.substring(0,12) && strFieldVal !=  varWardRobeShape7) varWRS = true;
	if (varRoomWall == varWardRobe8.substring(0,12) && strFieldVal !=  varWardRobeShape8) varWRS = true;
	if (varRoomWall == varWardRobe9.substring(0,12) && strFieldVal !=  varWardRobeShape9) varWRS = true;
	if (varRoomWall == varWardRobe10.substring(0,12) && strFieldVal !=  varWardRobeShape10) varWRS = true;
	if (varRoomWall == varWardRobe11.substring(0,12) && strFieldVal !=  varWardRobeShape11) varWRS = true;
    if (varRoomWall == varWardRobe12.substring(0,12) && strFieldVal !=  varWardRobeShape12) varWRS = true;
	if (varRoomWall == varWardRobe13.substring(0,12) && strFieldVal !=  varWardRobeShape13) varWRS = true;
	if (varRoomWall == varWardRobe14.substring(0,12) && strFieldVal !=  varWardRobeShape14) varWRS = true;
	if (varRoomWall == varWardRobe15.substring(0,12) && strFieldVal !=  varWardRobeShape15) varWRS = true;
	if (varRoomWall == varWardRobe16.substring(0,12) && strFieldVal !=  varWardRobeShape16) varWRS = true;
	if (varRoomWall == varWardRobe17.substring(0,12) && strFieldVal !=  varWardRobeShape17) varWRS = true;
	if (varRoomWall == varWardRobe18.substring(0,12) && strFieldVal !=  varWardRobeShape18) varWRS = true;
	if (varRoomWall == varWardRobe19.substring(0,12) && strFieldVal !=  varWardRobeShape19) varWRS = true;
	if (varRoomWall == varWardRobe20.substring(0,12) && strFieldVal !=  varWardRobeShape20) varWRS = true;
	if (varRoomWall == varWardRobe21.substring(0,12) && strFieldVal !=  varWardRobeShape21) varWRS = true;
	if (varRoomWall == varWardRobe22.substring(0,12) && strFieldVal !=  varWardRobeShape22) varWRS = true;	 
	if (varRoomWall == varWardRobe23.substring(0,12) && strFieldVal !=  varWardRobeShape23) varWRS = true;
	if (varRoomWall == varWardRobe24.substring(0,12) && strFieldVal !=  varWardRobeShape24) varWRS = true;

	 if (varWRS == true) {
window.alert("Error: You have tried to ADD another section to an existing BANK of robes - but you have entered a different Angle of Top Shelf? Please correct the Angle setting");
//alert("line 849- strFieldVal= "  + strFieldVal + " varWardRobeShape1= " + varWardRobeShape1 + " varWardRobeShape2= " + varWardRobeShape2);
 							varFieldCheck = 1;
			                return varFieldCheck;	
     }
   }   
//  Set flag to show LEFT END finishing has been recorded
 if (varProductType == "Benc" ) {
      varProductCode = getProductInfo(iProdID)[colProductCode];
      var varLongCode = varProductCode.substring(0,4);
	  varShortCode = varProductCode.substring(0,3);
	
  if (varLongCode == "BTEL" || varLongCode == "BTLM" || varLongCode == "BTLF" || varLongCode == "BTLT")
 	       varLeftSideProcessed = true ;
  else     varLeftSideProcessed = false;
 }


// Check on Unique Numbers for Benchtops
  if (varProductType == "Benc" ) {
               if ((varShortCode == "BTS" || varShortCode == "BTD") && i == 3) {
			       varBenchtopProcessed = true;
				   varNewBench = strFieldVal;
			   }
   }
   		
  if (varProductType == "Benc" ) {
		      if (iProdID > 215 && iProdID < 220 && i == 7) {
			       varBenchtopProcessed = true;
				   varNewBench = strFieldVal;
			   }			   
			   else if ((iProdID > 220 && iProdID < 224) && i == 9) {
			       varBenchtopProcessed = true;
				   varNewBench = strFieldVal;
			   }			   
			   else if (iProdID == 220 && i == 10) {
			       varBenchtopProcessed = true;
				   varNewBench = strFieldVal;
			   }			   
	}

 if (varProductType == "Disc" && i==1) { 
 window.alert("The Discount has been calculated and is added at the bottom of your Shopping List");
 }
 
 	varProductCode = getProductInfo(iProdID)[colProductCode];
	if (varProductCode.substring(0,18) == "2 Style Laminate/Y" && i ==2) {
window.alert("You will be given a QUOTE for the extra cost for this YOUR CHOICE Brand/Material selection, this will be at least $385 for the Order");
    }
				
   if (varProductType == "Carc" && i == 1)  {
    if (varCarcassProcessed == false) {
varConfirm=window.confirm("This selection is for a CARCASS-ONLY product, that means Doors, Drawer-Fronts, Drawer Slides, Hinges and Adjustable Feet are NOT INCLUDED - please confirm [OK] or change[CANCEL]");
                      if (varConfirm == false) {					 
					        varFieldCheck = 1;
			                return varFieldCheck;
					  }
	 }
   }		  
 return varFieldCheck;
 }
 //
 //  Find the maximum Height for a Custom Field Height specification, using SubfieldCode value
 //
 function getMaxHeight(varHeightCode)
  {
  switch(varHeightCode)
  {
case 1: return 500;
case 110: return 600;
case 111: return 1000;
case 112: return 1000;
case 113: return 1050;
case 114: return 1200;
case 115: return 1350;
case 166: return 600;
case 219: return 2150;
case 220: return 2350;
case 334: return 750;
case 343: return 1200;
case 344: return 1200;
case 352: return 500;
case 373: return 2350;
case 379: return 2100;
case 386: return 200;
case 388: return 400;
case 390: return 600;
case 392: return 1450;
case 393: return 1800;
case 396: return 750;
case 397: return 900;
case 398: return 1200;
case 399: return 1500;
case 400: return 1800;
case 401: return 2100;
case 402: return 2350;
case 405: return 1200;
case 434: return 2350;
case 435: return 2150;
case 446: return 1050;
case 466: return 600;
case 493: return 2100;
case 505: return 1000;
case 507: return 1500;
case 508: return 2100;
case 509: return 2500;
case 510: return 3000;
case 511: return 3550;
case 567: return 1200;
case 573: return 1200;
case 580: return 850;
case 583: return 900;
case 585: return 1800;
case 601: return 1000;
case 611: return 1000;
case 630: return 1150;
}
return 0;
} 
//  End of Maximum Height Custom Field Code Table 
//
// Find the Maximum Width ( or LH Width or RH Width, or Depth) for a Custom Field width specification
//

 function getMaxWidth(varWidthCode)
  {
  switch(varWidthCode)
  {
case 150:  return 300;
case 151:  return 400;
case 152:  return 500;
case 153:  return 620;
case 154:  return 800;
case 155:  return 800;
case 156:  return 900;
case 157:  return 1200;
case 164:  return 400;
case 167:  return 700;
case 168:  return 700;
case 171:  return 1000;
case 172:  return 1000;
case 202:  return 300;
case 229:  return 600;
case 233:  return 900;
case 234:  return 900;
case 292:  return 600;
case 307:  return 800;
case 311:  return 400;
case 318:  return 600;
case 339:  return 700;
case 350:  return 900;
case 351:  return 900;
case 382:  return 750;
case 383:  return 900;
case 384:  return 1050;
case 385:  return 1200;
case 403:  return 1000;
case 404:  return 1100;
case 405:  return 1200;
case 427:  return 500;
case 440:  return 1150;
case 441:  return 1150;
case 442:  return 1150;
case 498:  return 400;
case 499:  return 600;
case 506:  return 900;
case 513:  return 500;
case 520:  return 595;
case 521:  return 150;
case 540:  return 750;
case 568:  return 600;
case 570:  return 1200;
case 571:  return 900;
case 572:  return 1200;
case 574:  return 900;
case 575:  return 1200;
case 576:  return 900;
case 577:  return 1200;
case 584:  return 600;
case 586:  return 850;
case 587:  return 850;
case 588:  return 445;
case 589:  return 445;
case 590:  return 595;
case 591:  return 595;
case 602:  return 700;
case 603:  return 700;
case 613:  return 1000;
case 616: return 2350;
case 629: return 1150;
}
return 0;
}  
//  End of Maximum Width Custom Field Code Table
//	 


// to calculate extra charges for extra Shelf - depending on Width X Depth  and for Softclose Drawers
function extraShelfCalc(i, iProdID)
{	   
// get the posted custom fields
     var varQty = 1;
	 var varSoftClose = false;
	    shelfCost = 0
		extraShelfCost = 0;
		varPriceFactor = 1;
	    varCustomFieldCount = getLineSubCount(i, colCustomFields);
	    varProductCode = getProductInfo(iProdID)[colProductCode];
	    varShortCode = varProductCode.substring(0,3);
	    varProdName = getProductInfo(iProdID)[colProductDesc];
	    varStyle = varProdName.indexOf("HMR W");
	    if (varStyle > 0) varProdStyle = "Carca";

		if (varCustomFieldCount > 0)
		{		      			  				 		
		      for (var varIndex = 0; varIndex < varCustomFieldCount; varIndex++)
              {        
				   varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][varIndex];
				   varCustomFieldValue = getLineSubItem(i, colCustomFields, varIndex);
// check for Product Style data	   
                   if ((varCustomFieldNameCode > 594 && varCustomFieldNameCode < 600) || varCustomFieldNameCode == 605){
	                 varProdStyle = varCustomFieldValue.substring(0,5);	
	                 if (varProdStyle == "Belmo" || varProdStyle == "Unfin") varPriceFactor = 2;
	                 else if (varProdStyle == "Byron" || varProdStyle == "Alban") varPriceFactor = 4;
	                 else if (varProdStyle == "Avoca") varPriceFactor = 7;	
                   }
				   	   		
			       if (varCustomFieldNameCode == 333) {
				        if (varShortCode == "P-D" || varShortCode == "PD-" || varShortCode == "PC-") 
						     varQty = varCustomFieldValue - 5;   // original Cabinet cost included five shelves
						else varQty = varCustomFieldValue - 1;  // original Cabinet cost included one shelf
						shelfCost = Math.floor(2.75 + (varShelfSize / 10000) * .18 + .50) ;					
				   }
				   if (varCustomFieldNameCode == 634 && varCustomFieldValue == "Yes" ) varSoftClose = true; 
              }
	   
// If the cabinet is an Open Unit AND NOT just made of melamine then we charge more for extra Shelves
// the the normal Qty * Price REMEMBER that the original Cabinets price was based on 1Shelf included (5) for Pantries
//	  
			  if (varShortCode == "BO-" || varShortCode == "BOA" || varShortCode == "WO-" || varShortCode == "WDO")
					   		 shelfCost = shelfCost * varPriceFactor;

			  if (varProductCode.substring(0,8) == "BDrw-MT2" && varSoftClose == true) shelfCost = 132.74;
			  if (varProductCode.substring(0,8) == "BDrw-MT3" && varSoftClose == true) shelfCost = 199.11;
			  if (varProductCode.substring(0,8) == "BDrw-MT4" && varSoftClose == true) shelfCost = 265.40;
			  if (varProductCode.substring(0,8) == "BDrw-MT5" && varSoftClose == true) shelfCost = 331.85;			 
			  extraShelfCost = Math.round((varQty  * shelfCost * 100) /100);
//alert(" line 1114  varCustomFieldNameCode= " + varCustomFieldNameCode + " varSoftClose= " + varSoftClose + " extraShelfCost= " + extraShelfCost + " varShelfSize= "  + varShelfSize);
		                 	           	  
       }	 
   return extraShelfCost;
 }
// end of hjt function 4/11/2007
/*
 *	Creates a new array with X elements, with the supplied argument value or default
 *
 */
function nA()
{
	var myProductArray = new Array(0,0,0,0,0,0,0,0);
	for (var x = 0; x < arguments.length; x++) 
	{
		myProductArray[x] = arguments[x];
	}
	return myProductArray;
}
/* getProductPrice
 *
 */
function getProductPrice(curSymbol, thousandsSeparator, decPlaces, decSeparator, truncateDec, blnSymbolAtFront, pid, local, domestic, international, defaultRegion, blnIncludeTax)
{
	var curPrice;

 	var region = defaultRegion.toString();	
 	if (getItem("region") != "") region = getItem("region");
 	if (region != "0" && region != "1" && region != "2") region = "1";	

	if (!blnIncludeTax) region = "99";
    region = "1";   //  forece to Domestic Pricing hjt 19/01/2010
	switch(region)
	{
	case "0":
		curPrice = getProduct(pid)[colProductPrice] * (1 + getProduct(pid)[colTaxLocal]);		
		break;
	case "1":
		curPrice = getProduct(pid)[colProductPrice] * (1 + getProduct(pid)[colTaxDomestic]);		
		break;
	case "2": 
		curPrice = getProduct(pid)[colProductPrice] * (1 + getProduct(pid)[colTaxInternational]);		
		break;
	case "99":
		curPrice = getProduct(pid)[colProductPrice];
		break;
	}

	return formatCurrency(curSymbol, thousandsSeparator, decPlaces, decSeparator, truncateDec, blnSymbolAtFront, curPrice);
}

function getPriceInfo(pid,local, domestic, international, defaultRegion, blnIncludeTax)
{
	var strTaxString;
	var curPrice;
	
	var region = defaultRegion.toString();	
	if (getItem("region") != "") region = getItem("region");
	if (region != "0" && region != "1" && region != "2") region = "1";	

	if (!blnIncludeTax) region = "99";
    region = "1";   //  forece to Domestic Pricing hjt 19/01/2010
	switch(region)
	{
	case "0":
		curPrice = getProduct(pid)[colProductPrice] * (1 + getProduct(pid)[colTaxLocal]);		
		if (curPrice != getProduct(pid)[colProductPrice])
			strTaxString = local;
		else
			strTaxString = "";
		break;
	case "1":
		curPrice = getProduct(pid)[colProductPrice] * (1 + getProduct(pid)[colTaxDomestic]);		
		if (curPrice != getProduct(pid)[colProductPrice])
			strTaxString = domestic;
		else
			strTaxString = "";
		break;
	case "2": 
		curPrice = getProduct(pid)[colProductPrice] * (1 + getProduct(pid)[colTaxInternational]);		
		if (curPrice != getProduct(pid)[colProductPrice])
			strTaxString = international;
		else
			strTaxString = "";
		break;
	case "99":
		curPrice = getProduct(pid)[colProductPrice];
		strTaxString = "";
		break;
	}
	return strTaxString;
}
 
/* addProductToCart(frm)
 * adds the product represented by the HTML form - frm. This includes custom fields.
 * If the product being added is identical (including custom fields) the quantity of
 * the item in the cart is added to the amount being added through the form.
 *
 * input - 
 * frm: a HTML form object that contains a qty and pid element along with any
 *		custom fields that are required.
 */

function addProductToCart(frm, strAddMessage, strErrMsg, strFileName)
{
//   add  by hjt 4/11/2007
//
      varDataInputMode = true;
	  if (varFieldCheck == 0)
	     {
		    iLineIdx = getLineCount();
		    old_iLineIdx = iLineIdx;
	     }
	  else
	    {
	      iLineIdx = old_iLineIdx;
		  varFieldCheck = 0;
	    } 
		
//  end of substitution hjt 4/11/2007			
//  var iLineIdx = getLineCount();  // this line was substituted with the above code

	var iProdID = parseInt(frm.elements["pid"].value);
	var fltQty = parseInt(frm.elements["qty"].value);
    varQtyCheck = fltQty;
	// check the quantity

	if ((fltQty.toString() == "NaN") ||
			(fltQty - frm.elements["qty"].value != 0) || (fltQty <= 0))
	{

		if (typeof(document.all) != "undefined")
		{ 
  		  if (strFileName != ""){
		    showModalDialog(strFileName, "", "dialogHeight: 145px; dialogWidth: 256px; dialogTop: px; dialogLeft: px; center: Yes; help: No; resizable: No; status: No; scroll: No;edge: raised");
 		  }
		}
		else
		{
  		  if (strErrMsg != ""){
			alert(strErrMsg);
		  } 
		}
		frm.elements["qty"].focus();
		frm.elements["qty"].select();
		return false;
	}
// =========================================================================================
//  add (insert) by hjt in December 2007   Get Global values from preceding Input Lines
       if (CalculateOrderTotals() == true) varOrderTotals = true;   
	   varProductType = checkProductType(iProdID,varStatistics,i);	   	      
	   if (varDelivery == true) {
	    if (varProductType != "Disc" && varProductType != "Hand" && varProductType != "Hard" && varProductType != "Styl"
		 && varProductType != "Outl") {
window.alert(" Sorry - This Product can not be added UNTIL the Delivery product that you have in your Shopping Cart is Removed. The Delivery product has to be the very last Product Ordered as it works out the Total Weight. Please [REMOVE] the Delivery Item.");
				   window.location = "viewcart.htm";
				   varFieldCheck = 1;
				   return false;
	     }
		} 			  	   	   
	   
// end of add by hjt
// =======================================================================================	
	// get the posted custom fields
	var arrCustomField = new Array(0);
	for (var i = 0; i <frm.elements.length; i++)
	{
		if (frm.elements[i].name == "cf")
		{
			var strFieldVal = "";
			if (frm.elements[i].type.substr(0, 6) == "select")
			{
				strFieldVal = frm.elements[i].options[frm.elements[i].selectedIndex].value;
			}
			else if (frm.elements[i].type.substr(0, 6) == "checkb")
			{
				if (frm.elements[i].checked == false)
				{
					strFieldVal = "No"
				} else {
					strFieldVal = "Yes"			
				}

			}
			else
			{
				strFieldVal = frm.elements[i].value;
			}
//===================================================			
//  add by hjt 9/11/2007   to check simple input fields. 
varProductCode = getProductInfo(iProdID)[colProductCode];
varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][i - 1];

if (varCustomFieldNameCode == 364) {
	 if  (varProductCode.substring(0,3) == "BTS" || varProductCode.substring(0,3) == "BTD" 
	   || varProductCode.substring(0,3) == "BTL" || varProductCode.substring(0,3) == "BTU") {
      if (varLastcode == "") strFieldVal = "A";
	  else strFieldVal = varNextcode; 
	 } 
	if  (varProductCode.substring(0,3) == "BTE" ) strFieldVal  = varLastcode;


 
 }				
    	varFieldCheck = checkInput(strFieldVal, i, iLineIdx, iProdID); 				
		if (varFieldCheck == 1) {
		    return false;
		}		
		
		if (varErrorType2 == 1 && frm.elements.length - 2 == i) {
				    strFieldVal = "**Cabinet Warranty revoked due to exessive door width**" + strFieldVal;
					varErrorType2 = 0;
		}
		
// Process Colour/Profile record(s) 
//
		varProductCode = getProductInfo(iProdID)[colProductCode];
		 if (varProductCode.substring(0,1) == "1" || varProductCode.substring(0,1) == "2") {
		  if (BypassCheckProductRange == false) {
		   if (frm.elements.length - 2 == i) {
		       strFieldVal = "*C* " + strFieldVal;
		   }
		  }
		   varStyleStyle = varProductCode.substring(8,13);
		   if (frm.elements.length - 4 == i) {
		       if (strFieldVal.substring(0,12) == "All Cabinets") {
			      if (varStyleStyle == varDoorStyle1 || varStyleStyle == varDoorStyle2 || varStyleStyle == varDoorStyle3) {
window.alert("You have already recorded a STYLE for Doors & Drawer fronts - please choose another Style or omit this input");
						varFieldCheck = 1;
	                    return false;
				  }
			      if (varStyleStyle == varPanelStyle1 || varStyleStyle == varPanelStyle2 || varStyleStyle == varPanelStyle3) {
window.alert("You have already recorded a STYLE for Panels - please choose another Style or omit this input");
						varFieldCheck = 1;
	                    return false;										  
				  }
			      if (varStyleStyle == varKickStyle1 || varStyleStyle == varKickStyle2 || varStyleStyle == varKickStyle3) {
window.alert("You have already recorded a STYLE for KICKBOARDS - please choose another Style or omit this input");
						varFieldCheck = 1;
	                    return false;										  
				  }
			      if (varStyleStyle == varOpenStyle1 || varStyleStyle == varOpenStyle2 || varStyleStyle == varOpenStyle3) {
window.alert("You have already recorded a STYLE for OPEN UNITS - please choose another Style or omit this input");
						varFieldCheck = 1;
	                    return false;										  
				  }				 				  
			   }
		       if (strFieldVal.substring(0,5) == "Doors") {			   
			      if (varStyleStyle == varDoorStyle1 || varStyleStyle == varDoorStyle2 || varStyleStyle == varDoorStyle3) {
window.alert("You have already recorded a STYLE for DOORS and DRAWER fronts - please choose another Style or omit this input");
						varFieldCheck = 1;
	                    return false;										  
				  }			 				  
			   }
			   			   
		       if (strFieldVal.substring(0,11) == "Panels only") {
			      if (varStyleStyle == varPanelStyle1 || varStyleStyle == varPanelStyle2 || varStyleStyle == varPanelStyle3) {
window.alert("You have already recorded this STYLE for PANELS - please choose another Style or omit this input");
						varFieldCheck = 1;
	                    return false;										  
				  }			 				  
			   }
		       if (strFieldVal.substring(0,15) == "Kickboards only") {
			      if (varStyleStyle == varKickStyle1 || varStyleStyle == varKickStyle2 || varStyleStyle == varKickStyle3) {
window.alert("You have already recorded this STYLE for KICKBOARDS - please choose another Style or omit this input");
						varFieldCheck = 1;
	                    return false;										  
				  }			 				  
			   }			   			   		   
		       if (strFieldVal.substring(0,15) == "Open Units only") {
			      if (varStyleStyle == varOpenStyle1 || varStyleStyle == varOpenStyle2 || varStyleStyle == varOpenStyle3) {
window.alert("You have already recorded this STYLE for OPEN UNITS - please choose another Style or omit this input");
						varFieldCheck = 1;
	                    return false;										  
				  }			 				  
			   }			   			   			   		   
		   }	
		}
// remove the possible funny char ~ from any text field		
	  varfunny = strFieldVal.indexOf("~");
	  if (varfunny > 0) {
	    varFlength = strFieldVal.length;
		varPart1 = strFieldVal.substring(0,varfunny);
		varPart2 = strFieldVal.substring(varfunny + 1, varFlength);
		strFieldVal = varPart1 + "-" + varPart2
       }
	   		
// Process Discount 'Product' 
//
        if (iProdID == 26043 || iProdID == 26045) {
		   if (frm.elements.length - 2 == i) {
		       strFieldVal = "*D* Discount processed " + strFieldVal;
		    }	
		}
// Process 'Project" record
 
        if (iProdID == 287 && frm.elements.length - 3 == i){	
			strFieldVal = DateModified;
	     }		
 
//   Also Validate fields (except "Special Requests") and remove any extraneous characters
       if (frm.elements.length - 2 != i)  {      				
		 varStrFieldVal = parseInt(strFieldVal);
		if (varStrFieldVal > 0 &&  varProductType != "Styl") strFieldVal = varStrFieldVal;
	   }
									
// calculate and add the weight. length and other statistics into the Delivery Option 'product'	
			    if (iProdID < 5) {
				
				   if (i == 1) {
					             varStatistics = true;
					             CalculateOrderWeight();
// Here we estimate the Weight of the packing case
					 if (iProdID == 1 || iProdID == 4 ) varTotalWeight = Math.round(varTotalWeight * 1.28);                          
 	                                             arrCustomField[arrCustomField.length] = varTotalWeight;
                 }
 			         if (i == 2)                 arrCustomField[arrCustomField.length] = varTotalLength;
					 
					 if (i == 3 && iProdID != 4) arrCustomField[arrCustomField.length] = FloorUnits;
					 if (i == 4 && iProdID != 4) arrCustomField[arrCustomField.length] = WallUnits;
					 if (i == 5 && iProdID != 4) arrCustomField[arrCustomField.length] = OpenUnits;
					 if (i == 6 && iProdID != 4) arrCustomField[arrCustomField.length] = Benchtops;
					 if (i == 7 && iProdID != 4) arrCustomField[arrCustomField.length] = Wardrobes;
					 if (i == 8 && iProdID != 4) arrCustomField[arrCustomField.length] = Panels;
					 if (i == 9 && iProdID != 4) arrCustomField[arrCustomField.length] = Kickboards;
					 if (i == 10 && iProdID != 4) arrCustomField[arrCustomField.length] = Fillers;
					 if (i == 11 && iProdID != 4) arrCustomField[arrCustomField.length] = ExtraDoors;
					 if (i == 12 && iProdID != 4) arrCustomField[arrCustomField.length] = CarcassUnits;
					 if (i == 13 && iProdID != 4) arrCustomField[arrCustomField.length] = Handles;
					 if (i == 14 && iProdID != 4) arrCustomField[arrCustomField.length] = Hardware;
					 if (i == 15 && iProdID != 4) arrCustomField[arrCustomField.length] = varSpecial;
					 if (i == 16 && iProdID != 4) arrCustomField[arrCustomField.length] = strFieldVal;

					 if (i == 3 && iProdID == 4) arrCustomField[arrCustomField.length] = strFieldVal;			 					 					 
					 if (i == 4 && iProdID == 4) arrCustomField[arrCustomField.length] = strFieldVal;  
					 if (i == 4 && iProdID == 4) arrCustomField[arrCustomField.length] = FloorUnits;
					 if (i == 6 && iProdID == 4) arrCustomField[arrCustomField.length] = WallUnits;
					 if (i == 7 && iProdID == 4) arrCustomField[arrCustomField.length] = OpenUnits;
					 if (i == 8 && iProdID == 4) arrCustomField[arrCustomField.length] = Benchtops;					 
					 if (i == 9 && iProdID == 4) arrCustomField[arrCustomField.length] = Wardrobes;
					 if (i == 10 && iProdID == 4) arrCustomField[arrCustomField.length] = Panels;
					 if (i == 11 && iProdID == 4) arrCustomField[arrCustomField.length] = Kickboards;
					 if (i == 12 && iProdID == 4) arrCustomField[arrCustomField.length] = Fillers;
					 if (i == 13 && iProdID == 4) arrCustomField[arrCustomField.length] = ExtraDoors;
					 if (i == 14 && iProdID == 4) arrCustomField[arrCustomField.length] = CarcassUnits;
					 if (i == 15 && iProdID == 4) arrCustomField[arrCustomField.length] = Handles;
					 if (i == 16 && iProdID == 4) arrCustomField[arrCustomField.length] = Hardware;
					 if (i == 17 && iProdID == 4) arrCustomField[arrCustomField.length] = varSpecial;
	 				 if (i == 18 && iProdID == 4) arrCustomField[arrCustomField.length] = strFieldVal;

//alert("line 1484 i= " + i + " strFieldVal= " + strFieldVal);					
					 
			    }
				else arrCustomField[arrCustomField.length] = strFieldVal; 
// end of current 'Modification' by hjt
//=======================================================================================================						
		}
	}
	
// add by hjt 6/12/2009
// ==============================================\
// check and delete Repricing 'product" if a new one is submitted - to get rid of the old one	
	for(var i = 0; i <iLineIdx; i++)
	{
		if (getLineItem(i, colProductID) == iProdID && iProdID == 6)
		{
				   deleteLine(i);
				   iLineIdx = iLineIdx - 1;
				   break;  
		} 
	}	
// c=================================================================	
	for(var i = 0; i <iLineIdx; i++)
	{
		if (getLineItem(i, colProductID) == iProdID)
		{	
			if (arrCustomField.length != getLineSubCount(i, colCustomFields)) continue;		

			for(var iCustomField = 0; iCustomField <arrCustomField.length; iCustomField++)
			{
				if (getLineSubItem(i, colCustomFields, iCustomField) != arrCustomField[iCustomField]) break;
								
			}
		
			if (iCustomField == arrCustomField.length)
			{	
				setLineItem(i, colQuantity, fltQty + parseFloat(getLineItem(i, colQuantity)));

				break;
			}
		}
	}

	if (i == iLineIdx)
	{
		// process line
		setLineItem(iLineIdx, colProductID, iProdID);
		setLineItem(iLineIdx, colQuantity, fltQty);
	
		// process custom fields
		for(var iCustomField = 0; iCustomField <arrCustomField.length; iCustomField++)
		{
			setLineSubItem(iLineIdx, colCustomFields, iCustomField, arrCustomField[iCustomField]);
		}
	}

// Add by HJT 22/10/2008 =======================================================

  if (varBenchtopProcessed == true) {
     if (varShortCode == "BTS" || varShortCode =="BTD") 
    window.alert("The Benchtop details have been recorded - Note that for 'L' and 'U' Shapes this does include the cost of the JOINS - now please specify the LEFT END finish requirements - even if this is UNFINISHED - as we like to have positive confirmation.");
	 else
   window.alert("The Benchtop details have been processed and a Cost Price has been calculated, for 'L' and 'U' Shapes this does include the cost of the JOINS  -- now please specify the LEFT END and RIGHT END finish requirements - even if this is UNFINISHED, then all three items will be shown on the Shoppimg List (see View Cart).");

	return true;
   }
   
  if (varLeftSideProcessed == true) {
    window.alert("LEFT END finish details have been recorded - now please specify the RIGHT END finish requirements - even if this is UNFINISHED - as we like to have positive confirmation.");

	varLeftSideProcessed == false;
	return true;
   }
//  end add ================================================================

	if (typeof(strAddMessage) == "undefined" && varBenchtopProcessed == false)
	{
		window.location = "viewcart.htm";
		return true;
	}
	else if (strAddMessage != "")
	{
		alert(strAddMessage);
		return false;
	}
	
  
	
//  add (Insert) by hjt 4/11/2007  ===========================================================
//  checkFieldValue(iLineIdx, iProdID);    
   if (varDeleteLine) deleteLine(0);
 	   if (varFieldCheck == 1) {
       return false;
	   } 
// =================================================================================
 }
// end of addProductToCart(frm, strAddMessage, strErrMsg, strFileName) function

// recalcCart

function recalcCart(line, item, strErrMsg, strFileName)
{
var iProdID = parseInt(getLineItem(line, colProductID));
var	currentProductCode = getProductInfo(iProdID)[colProductCode]
 if (currentProductCode.substring(0,1) == "z" || currentProductCode.substring(0,2) == "BT" || currentProductCode.substring(0,2) == "WR") {
	alert("Sorry: - the Quantity for this 'product selection' can only be [1]. The Edit has not been allowed");
 }
 else {
	if (item.value != item.defaultValue)
	{
		var fltQty = parseInt(item.value);

		if ((fltQty.toString() != "NaN") &&
			(fltQty - item.value == 0))
		{
			if (fltQty <= 0)
				deleteLine(line);
			else
				setLineItem(line, colQuantity, fltQty);
	
			window.location.href = 'viewcart.htm';
		}
		else
		{			
			if (typeof(document.all) != "undefined") 
			{
			  if (strFileName != ""){
				showModalDialog(strFileName, "", "dialogHeight: 145px; dialogWidth: 256px; dialogTop: px; dialogLeft: px; center: Yes; help: No; resizable: No; status: No; scroll: No;edge: raised");

				item.focus();
				item.select();			
			  }
			}
			else
			{
			  if (strErrMsg != ""){
				alert(strErrMsg);
				item.focus();
				item.select();			
			   }
			}
		}
	}
  }	
}

/* getCart(curSymbol, thousandsSeparator, decPlaces, decSeparator, blnSymbolAtFront, showExTax, showIncTax, showTaxPercent, showTaxAmount, defaultRegion)
 *
 * gets an HTML table that represents the reflects the current state of a shopping cart
 * 
 * input -
 * curSymbol:	the symbol used to represent currency
 * decPlaces:	the number of decimal places to display when writing currency
 * blnSymbolAtFront: whether to put the currency symbol at the front or at the back of the currency
 * showExTax:	show the ex tax column in the cart
 * showIncTax:	show the inc tax column in the cart
 * showTaxPercent: show the tax percent column in the cart
 * showTaxAmount: show the tax amount in the cart
 * defaultRegion: the default merchant to customer relationship in which to show prices (0 - local, 1 - domestic, 2 - international)
 */

function getCart(curSymbol, thousandsSeparator, decPlaces, decSeparator,  truncateDec, blnSymbolAtFront, 

showExTax, showIncTax, showTaxPercent, showTaxAmount, defaultRegion, headerFont, headerSize, 

headerBackgnd, headerForegnd, headerText, cartFontOdd, cartFontSizeOdd, cartBackgndOdd,cartForegndOdd, 

cartFontEven, cartFontSizeEven, cartBackgndEven, cartForegndEven, totTaxLabel, totLabel, removeText, emptyCart, 

verStr, imagepath, strErrMsg, strFileName,NotRegMsg)

{
 document.cookie = 'deleteme' + escape('nothing')
  if (document.cookie == "") 
  {
	strCart="<table border=\"1\" cellspacing=\"0\" width=\"80%\" bgcolor=\"#FFFFFF\" bordercolor=\"#808080\" cellpadding=\"6\"><tr><td width=\"100%\">";
	strCart +="<p align=\"center\"><font face=\"Tahoma\"><b>We're Sorry</b></font></td>";
	strCart +="</tr><tr><td width=\"100%\"><font face=\"Tahoma\" size=\"2\"><br>";
	strCart +="It appears your browser is set to refuse cookies. Our online purchasing ";
	strCart +="system requires that you have cookies enabled on your browser. </font>";
	strCart +="<p><font face=\"Tahoma\" size=\"2\">If you don't know how to enable this ";
	strCart +="feature we have provided instructions on enabling cookies for various ";
	strCart +="browsers at <a href=\"http://www.ezimerchant.com/linkin/shopping_cart.asp?link=CookiesNotEnabled\">www.ezimerchant.com</a>";
	strCart +="</font></p><p>&nbsp;</td></tr></table>";
	return strCart;

  }
	var strCart = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">";

	var iColSpan = 4 + 
		(showExTax ? 1 : 0) + 
		(showTaxPercent ? 1 : 0) + 
		(showTaxAmount ? 1 : 0) + 
		(showIncTax ? 1 : 0);

	var curTaxTotal = 0;
	var curSubTotal = 0;

 	var region = defaultRegion.toString();	
 	if (getItem("region") != "") region = getItem("region");
 	if (region != "0" && region != "1" && region != "2") region = "1";
    region = "1";   //  forece to Domestic Pricing hjt 19/01/2010	
	var lineCount = getLineCount();

	if (lineCount == 0)
	{	
		strCart += "<tr bgcolor=\"" + cartBackgndEven + "\"><td colspan=" + (iColSpan + 1) + " align=center valign=center nowrap><font face=\"" + cartFontOdd + "\" color=\"" + cartForegndEven + "\" size=\"" + cartFontSizeOdd + "\">" + emptyCart + "</font></td></tr>";
	}
	else
	{	
		strCart += "<tr id=\"heading\" bgcolor=" + headerBackgnd + ">";
		strCart += "<th nowrap valign=\"bottom\"><font face=\""+ headerFont + "\" color=\"" + headerForegnd + "\" size=" + headerSize +"><b>" + headerText[0] + "</b></font></th>";
		strCart += "<th valign=\"bottom\"><font face=\"" + headerFont +"\" color=\"" + headerForegnd + "\" size=" + headerSize + "><b>" + headerText[1] + "</b></font></th>";
		strCart += "<th valign=\"bottom\"><font face=\""+ headerFont +"\" color=\"" + headerForegnd + "\" size=" + headerSize + "><b>" + headerText[2] + "</b></font></th>";
		strCart += showExTax ? "<th valign=\"bottom\"><font face=\""+ headerFont +"\" color=\"" + headerForegnd + "\" size=" + headerSize + "><b>" + headerText[3] + "</b></font></th>" : "";
		strCart += showTaxPercent ? "<th valign=\"bottom\"><font face=\""+ headerFont +"\" color=\"" + headerForegnd + "\" size=" + headerSize + "><b>" + headerText[4] + "</b></font></th>" : "";
		strCart += showTaxAmount ? "<th valign=\"bottom\"><font face=\""+ headerFont +"\" color=\"" + headerForegnd +"\" size=" + headerSize + "><b>" + headerText[5] + "</b></font></th>" : "";
		strCart += showIncTax ? "<th valign=\"bottom\"><font face=\""+ headerFont +"\" color=\"" + headerForegnd + "\" size=" + headerSize + "><b>" + headerText[6] + "</b></font></th>" : "";
		strCart += "<th valign=\"bottom\"><font face=\""+ headerFont +"\" color=\"" + headerForegnd + "\" size=" + headerSize + "><b>" + headerText[7] + "</b></font></th>";
		strCart += "<th>&nbsp;</th></tr>";
//==============================================================
// insert by hjt 2/12/2009
// Check if there is a ProductCode = '8 Style'  record and get its Style Description; also checj various other records on all current input
 var lineCount = getLineCount();
 varSuffix = "";
 if (lineCount != 0)
 { 		
	for(var i = 0; i <lineCount; i++)
	{						
		var iProdID = parseInt(getLineItem(i, colProductID));
		varProductCode = getProductInfo(iProdID)[colProductCode]
		varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][0];
	   
		if (varProductCode.substring(0,1) == "2" || varProductCode.substring(0,1) == "z") varStyleSpec = true;
		if (varProductCode.substring(0,3) == "zP-") varNoPanel = true;
		if (varProductCode.substring(0,3) == "zK-") varNoKick = true;
                      // this is to prevent multiple prompts for missing Panel or Kickboard
		if (varProductCode.substring(0,6) == "Outlet") {
		    varOutlet = getLineSubItem(i, colCustomFields, 1);
			varOutletSet = true;
			OutLet = true;
		}			  
					  					  
		if (varProductCode.substring(0,7) == "8 Style") {
			varCustomFieldValues = getLineSubItem(i, colCustomFields, 1);           	
		    varDataInputMode = false;
     	     if (varCustomFieldValues.substring(0,5) == "BELMO" ) varSuffix = "a"; 
	 		 if (varCustomFieldValues.substring(0,5) == "BYRON" ) varSuffix = "b";  
	 		 if (varCustomFieldValues.substring(0,5) == "ALBAN" ) varSuffix = "c";  
	 		 if (varCustomFieldValues.substring(0,5) == "AVOCA" ) varSuffix = "d";
			 if (varCustomFieldValues.substring(0,5) == "UNFIN" ) varSuffix = "e";
			 if (varCustomFieldValues.substring(0,5) == "LAMIN" ) varSuffix = "z";
			 if (varCustomFieldValues.substring(0,5) == "GLOSS" ) varSuffix = "y";    
	 		 if (varCustomFieldValues.substring(0,5) == "RESET" ) varSuffix = "x";  
	    }
		if (addThirtyPercent == true && varFirstTime == true) varFirstTime = false;   
		if (varProductCode.substring(0,18) == "2 Style Laminate/X" || 
		      varProductCode.substring(0,18) == "2 Style Laminate/Z") addThirtyPercent = true;
	}
 }
// alert("1793 outlet= " + OutLet + " varURL.substring(0,5)= " + varURL.substring(0,5));
	if (OutLet == false && varURL.substring(0,5) != "START") {
		 alert("Your Current PRODUCT selection has been stored, but you have not yet supplied your choosen Manufacturing Outlet - please do that now before continuing - see [START - Select Outlet] page.");
		 OutLet = true;
		 window.location.replace("category428_1.htm");
	}
//=======================end inser by jjt 2/12/2009==========================
			   
		for(var i = 0; i <lineCount; i++)
		{
			var iProdID = parseInt(getLineItem(i, colProductID));
			var fltQty = parseFloat(getLineItem(i, colQuantity));
//=========================Adition by hjt  Feb 2012 ================================== 
	        if (varLimitLines == true && iProdID == 287) currentLine = i;  // currentLine   is used in 'START-...' in case we want to REMOVE the Project line 		
            if (varLimitLines == true && iProdID != 287) continue;    // hjt  29/01/2012

//  swap PID for a different Style-Price calculation using a new Product Code that is assembled from parts of the Old Product code
           varProductType = checkProductType(iProdID,varStatistics,i);
  		   varNewPID=changeStyle(iProdID,i);
// alert(" 1700 varProductType = " + varProductType + " varNewPID= " + varNewPID + " iProdID= " + iProdID);
// ========================================================				
			if (getProduct(iProdID) == null) continue;
			if (getProductInfo(iProdID) == null) continue;
			switch(region)
			{
			case "0":
				l_taxRate = parseFloat(getProduct(iProdID)[colTaxLocal]);
				break;			
			case "1":
				l_taxRate = parseFloat(getProduct(iProdID)[colTaxDomestic]);
				break;
			case "2":
				l_taxRate = parseFloat(getProduct(iProdID)[colTaxInternational]);
				break;
			}
//================================================
//add by HJT
          if (varNewPID != iProdID)	
			var curPrice = parseFloat(getProduct(varNewPID)[colProductPrice]); 			
		  else curPrice = parseFloat(getProduct(iProdID)[colProductPrice]);

//----------------------------------------------------------------------------------
// add (insert) by hjt on 30/11/2007
//
// calculate Price for Variable Size products 

	varProductCode = getProductInfo(iProdID)[colProductCode];
//alert("line 1756 i= " + i + " curPrice= " + curPrice + " iProdID=  " +  iProdID + "varNewPID= " + varNewPID + " " + varProductCode + " " + varProductType );	
	
    if (varProductType != "Disc" && varProductType != "Hand" && varProductType != "Hard" && varProductType != "Styl" && varProductType != "Carc" 
	  && varProductType != "Outl" && varProductType != "Deli") {
	  if (curPrice > 0) curPrice = CalculateProportionalDiscount(curPrice,iProdID,i,lineCount,varNewPID);
	  
// add 25% to cost for GLOSS Laminate or 50% for Panels/Kickboards/Open-cabinets 
       if (varGLOSS == true) {
	    if (varProductType == "Pane" || varProductType == "Door" || varProductType == "Kick" || varProductType == "Open") curPrice = curPrice * 150/100;
		else if (varProductType == "Kit-") curPrice = curPrice * 125/100;	  
       }
            extraShelfCalc(i, iProdID); 
//alert("1745 curPrice = " + curPrice + " extraShelfCost= " + extraShelfCost);       
			curPrice = curPrice + extraShelfCost;			
			extraShelfCost = 0;
			
// add 30% to cost of Kickboards in Aluminium or Black
     if (varProductCode.substring(0,4) == "Kick" && addThirtyPercent == true && varFirstTime == true) {
	   window.alert("The Kickboard(s) cost has been recalculated based on your choice of Aluminium or Black colour");
	   varFirstTime = false;
	 } 
	 if (varProductCode.substring(0,4) == "Kick" && addThirtyPercent == true)  curPrice = Math.round(curPrice * 130 /100); 
    }			
// check on Poly paint specified
  if (varProductCode.substring(0,14) == "2 Style Albany" ) {  
   if (AlbanyColour1 == " ") AlbanyColour1 = varProductCode.substring(15,16)
   else if (AlbanyColour2 == " " && varProductCode.substring(15,16) != AlbanyColour1) AlbanyColour2 = varProductCode.substring(15,16);
   else if (AlbanyColour3 == " " && varProductCode.substring(15,16) != AlbanyColour1 && varProductCode.substring(15,16) != AlbanyColour2)
	           AlbanyColour3 = varProductCode.substring(15,16);    
   else curPrice = 0;
   }
 if (varProductCode.substring(0,13) == "2 Style Avoca" ){  
  if (AvocaColour1 == " ") AvocaColour1 = varProductCode.substring(14,15)
  else if (AvocaColour2 == " " && varProductCode.substring(14,15) != AvocaColour1) AvocaColour2 = varProductCode.substring(14,15);
  else if (AvocaColour3 == " " && varProductCode.substring(14,15) != AvocaColour1 && varProductCode.substring(14,15) != AvocaColour2)
	           AvocaColour3 = varProductCode.substring(14,15);    
  else curPrice = 0;	 
 }
			  	 
// Calculate U-Shape  or L-Shape bench
     if (iProdID < 224 && iProdID > 215 )  curPrice = BenchtopParameters(i, iProdID)
	 CalculateOrderWeight()
    varProductCode = getProductInfo(iProdID)[colProductCode]; // reset Product Code	 
	 varCurrentOrderPrice = varCurrentOrderPrice + parseFloat(curPrice * fltQty);
     varWeight = parseFloat(getProduct(iProdID)[colProductWeight]);   			
	 varTotalWeight = Math.round(varTotalWeight + (varWeight * fltQty));		 	 

//calculate Freight cost and add in Admin charge proportionally for order cost < $800 (incl GST) unless Hardware only
             var varAdminCost = Math.round(54.545 - varCurrentOrderPrice / 727.20 * 54.545);
			 if (varAdminCost < 2 ) varAdminCost = 0;

			 if (varAdminCost > 0 && varTotalLength > 0 && iProdID < 5) 
			 	alert("$" + varAdminCost + " (excl. GST) has been added to the Delivery Cost (or deducted from your Discount) for Orders <$800 in value, to cover a proportion of the $60 Setup/Admin costs incurred.");
				
			  if (iProdID == 1) {
   			     curPrice = 0;
				 if (varCurrentOrderPrice < 727.21) curPrice = curPrice + varAdminCost;  
			  }		  		
			  if (iProdID == 2) {
				  curPrice = Math.round(curPrice - (varCurrentOrderPrice * 5 ) / 100);
				  if (varCurrentOrderPrice <  727.21) curPrice = curPrice + varAdminCost;					 
			  }		  			       	   
              else if (iProdID == 3) {
				    if (CalculateOrderWeight() == true) {				  	 				 
			            varLocalDeliveryCost = Math.round(varTotalWeight * 3.5) / 10;
						if (varTotalLength > 2350) {
						    varLocalDeliveryCost = varLocalDeliveryCost + 50.00;
	alert("An extra charge of $50 has been added to the estimated cost of delivery as one of the components exceeds 2350mm in length and this may result in extra charges by the Carrier");
	
	                    }						
						 if (varLocalDeliveryCost < 70.00) {
							  varLocalDeliveryCost = 70.00;
window.alert("A MINIMUM freight cost of $70.00 (excl. GST) has been applied for this Order");
                          }									 								   
				     curPrice = varLocalDeliveryCost;
					 if (varCurrentOrderPrice <  727.21) curPrice = curPrice + varAdminCost;							 
				    }
			 }	  	   		  				  	
             else if (iProdID == 4) {
				   if (CalculateOrderWeight() == true) {
					varTotalWeight = Math.round(varTotalWeight * 1.28);
					varZone = getLineSubItem(i, colCustomFields, 2);
					if (getLineSubItem(i, colCustomFields, 3) == "Yes") varInsured = "Yes";   				
					else varInsured = "No";					   		
     			    varLongHaulCost = Math.round(CalculateLongHaul(varZone) * 100) / 100;
                    if (varTotalLength > 2350) {
						    varLocalDeliveryCost = varLocalDeliveryCost + 50.00;
	alert("An extra charge of $50 has been added to the estimated cost of delivery as one of the components exceeds 2350mm in length and this may result in extra charges by the Carrier");
	                 }
					if (varLongHaulCost < 85.00) {
						varLongHaulCost = 85.00;
					    alert("A MINIMUM freight cost of $85.00 (excl GST) has been applied for this Order");
					}
					if (varInsured == "Yes") {
					  Insurance = Math.ceil(varCurrentOrderPrice * .105) ; 
					  varLongHaulCost = varLongHaulCost + Insurance;
	alert(" Insurance cost of " + Insurance + " (excl. GST) has been added to the ESTIMATED cost of Delivery");
	                }
									  										
					if (varTotalLength > 2350) {
						varLongHaulCost = varLongHaulCost + 50.00;
	alert("An extra charge of $50 (excl. GST) has been added to the estimated cost of delivery as one of the components exceeds 2350mm in length and this may result in extra charges by the Carrier");
	                }
					
					curPrice = varLongHaulCost;
					if (varCurrentOrderPrice < 727.21) curPrice = curPrice + varAdminCost;  
	             }
    	     } 
 			 
// Calculate Discounts    
     if (varProductCode.substring(0,3) == "zzD") {
// window.alert(" 1863 varProductCode= " + varProductCode + " varCurrentOrderPrice= " + varCurrentOrderPrice + " " + varLocalDeliveryCost + " " + varLongHaulCost + " TradeDiscount= " + TradeDiscount);

			  TradeDiscount = 0;			  					 
//  calculate the Order Cost up to this point excluding any Delivery COSTS	     
//			 if (CalculateOrderWeight() == true) {

	    if ((varCurrentOrderPrice - varLocalDeliveryCost - varLongHaulCost) * 1.1 > 1199) {
		  if (iProdID == 26043)  TradeDiscount = ((varCurrentOrderPrice - varLocalDeliveryCost - varLongHaulCost) * 5 ) / 100;
		  else if (iProdID == 26045) TradeDiscount = ((varCurrentOrderPrice - varLocalDeliveryCost - varLongHaulCost) * 10 ) / 100;
		  }
				TradeDiscountNumber = TradeDiscountNumber + 1;
			 	curPrice = curPrice - TradeDiscount;		
    }
     
//
//* end modification by hjt on 30/o1/2008
//											
			var curTaxAmount = curPrice * l_taxRate;
			var curPriceIncTax = curPrice + curTaxAmount;
			var curPriceSubTotal;
			if (truncateDec) {
 			  curPriceSubTotal = Math.floor(fltQty * curPriceIncTax * Math.pow(10, decPlaces)) / Math.pow(10, decPlaces);
			}else {
 			  curPriceSubTotal = Math.round(fltQty * curPriceIncTax * Math.pow(10, decPlaces)) / Math.pow(10, decPlaces);
			}
//=================================================================			
			strCart += "<tr bgcolor=\"" + ((i % 2) == 0 ? cartBackgndEven : cartBackgndOdd) + "\">" +
						"<td><input type=text size=4 name=\"quantity\" value=\"" + fltQty + "\" onblur=\"recalcCart(" + i + ", this, '" + strErrMsg + "', '" + strFileName + "');\" onkeypress=\"if (event.which == 0 || event.keyCode == 13) recalcCart(" + i + ", this);\"></td>" +
						"<td><font face=\"" + ((i % 2) == 0 ? cartFontEven : cartFontOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd)  + "\" size=\"" + ((i % 2) == 0 ? cartFontSizeEven : cartFontSizeOdd) + "\">" + getProductInfo(iProdID)[colProductDesc] + "</font></td>" +
//=========================================================================						
//						"<td><font face=\"" + ((i % 2) == 0 ? cartFontEven : cartFontOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd)  + "\" size=\"" + ((i % 2) == 0 ? cartFontSizeEven : cartFontSizeOdd) + "\">" + getProductInfo(iProdID)[colProductCode] + "</font></td>";
						"<td><font face=\"" + ((i % 2) == 0 ? cartFontEven : cartFontOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd)  + "\" size=\"" + ((i % 2) == 0 ? cartFontSizeEven : cartFontSizeOdd) + "\">" + newProductCode + "</font></td>";
//==========================================================================						
						
					
			strCart += showExTax ? "<td align=\"right\"><font face=\"" + ((i % 2) == 0 ? cartFontEven : cartFontOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd)  + "\" size=\"" + ((i % 2) == 0 ? cartFontSizeEven : cartFontSizeOdd) + "\">" + formatCurrency(curSymbol, thousandsSeparator, decPlaces, decSeparator, truncateDec, blnSymbolAtFront, curPrice) + "</font></td>" : "";
			strCart += showTaxPercent ? "<td><font face=\"" + ((i % 2) == 0 ? cartFontEven : cartFontOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd)  + "\" size=\"" + ((i % 2) == 0 ? cartFontSizeEven : cartFontSizeOdd) + "\">" + l_taxRate * 100 + "%</td>" : "";
			strCart += showTaxAmount ? "<td align=\"right\"><font face=\"" + ((i % 2) == 0 ? cartFontEven : cartFontOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd) + "\"  color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd)  + "\" size=\"" + ((i % 2) == 0 ? cartFontSizeEven : cartFontSizeOdd) + "\">" + formatCurrency(curSymbol, thousandsSeparator,decPlaces, decSeparator, truncateDec, blnSymbolAtFront, curTaxAmount) + "</td>" : "";
			strCart += showIncTax ? "<td align=\"right\"><font face=\"" + ((i % 2) == 0 ? cartFontEven : cartFontOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd)  + "\" size=\"" + ((i % 2) == 0 ? cartFontSizeEven : cartFontSizeOdd) + "\">" + formatCurrency(curSymbol, thousandsSeparator,decPlaces, decSeparator, truncateDec, blnSymbolAtFront, curPriceIncTax) + "</td>" : "";
			strCart += "<td align=\"right\"><font face=\"" + ((i % 2) == 0 ? cartFontEven : cartFontOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd)  + "\" size=\"" + ((i % 2) == 0 ? cartFontSizeEven : cartFontSizeOdd) + "\">" + formatCurrency(curSymbol, thousandsSeparator,decPlaces, decSeparator, truncateDec, blnSymbolAtFront, curPriceSubTotal) + "</td>";
			strCart += "<td><a href=\"javascript: deleteLine(" + i + "); window.location = 'viewcart.htm';\"><img src=\"" + imagepath + "/cartremove.gif\" border=0 title=\"" + removeText + "\"></a>";
	
			// hidden fields sent to server per orderline					
			strCart += "<input type=hidden name=\"prodweight\" value=\"" + FormatSeparator(getProduct(iProdID)[colProductWeight],decSeparator) + "\">";
			strCart += "<input type=hidden name=\"localtax\" value=\"" + getProduct(iProdID)[colTaxLocal] + "\">";
			strCart += "<input type=hidden name=\"domestictax\" value=\"" + getProduct(iProdID)[colTaxDomestic] + "\">";
			strCart += "<input type=hidden name=\"internationaltax\" value=\"" + getProduct(iProdID)[colTaxInternational] + "\">";
			strCart += "<input type=hidden name=\"localdelivery\" value=\"" + getProduct(iProdID)[colFreightLocal] + "\">";
			strCart += "<input type=hidden name=\"interstatedelivery\" value=\"" + getProduct(iProdID)[colFreightDomestic] + "\">";
			strCart += "<input type=hidden name=\"internationaldelivery\" value=\"" + getProduct(iProdID)[colFreightInternational] + "\">";
			strCart += "<input type=hidden name=\"unitprice\" value=\"" +  FormatSeparator(curPrice,decSeparator) + "\">";
// change to ---curPrice--- here  hjt 2008
			strCart += "<input type=hidden name=\"prodname\" value=\"" + safeString(getProductInfo(iProdID)[colProductDesc]) + "\">";
//			strCart += "<input type=hidden name=\"prodcode\" value=\"" + safeString(getProductInfo(iProdID)[colProductCode]) + "\">";
            strCart += "<input type=hidden name=\"prodcode\" value=\"" + newProductCode + "\">";
			// process custom fields into hidden fields to be sent to server
			var strCustomFieldNames = "";
			var strCustomFieldValues = "";
			var iCustomFieldCount = getLineSubCount(i, colCustomFields);

			if (iCustomFieldCount > 0)
			{
				for(var iCustomField = 0; iCustomField <iCustomFieldCount; iCustomField++)
				{
					if (iCustomField > 0)
					{
						strCustomFieldNames += "|";
						strCustomFieldValues += "|";
					}		

					strCustomFieldNames += escape(getCustomField(getProductInfo(iProdID)[colCustomFieldKeys][iCustomField]));
					varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][iCustomField];
									
					if ((varCustomFieldNameCode > 594 && varCustomFieldNameCode < 600) || varCustomFieldNameCode == 605) {
					   if      (varSuffix == "a") strCustomFieldValues += "Belmont - Vinyl Texture";
					   else if (varSuffix == "b") strCustomFieldValues += "Byron Bay - Vinyl GLOSS wrap";
					   else if (varSuffix == "c") strCustomFieldValues += "Albany - Polyurethane Texture";
					   else if (varSuffix == "d") strCustomFieldValues += "Avoca - Polyurethane Gloss";
					   else if (varSuffix == "e") strCustomFieldValues += "Unfinished - 18mm MDF";
					   else if (varSuffix == "y") strCustomFieldValues += "GLOSS Laminate (Formica)";
					   else if (varSuffix == "z") { strCustomFieldValues += "Laminate (Melamine) - Coloured";					   
					                  if (newProductCode.substring(0,9) == "DoorGlass") strCustomFieldValues += "Unfinished - 18mm MDF";
									  }
					   else strCustomFieldValues += escape(getLineSubItem(i, colCustomFields, iCustomField));				  							  
					}
	
 				  // and just in case a 'last Minute Edit has removed one or more products we reclculate the totals					              
					if (varCustomFieldNameCode == 514 || varCustomFieldNameCode == 519) {
					    varStatistics = true;
					    CalculateOrderWeight();
						varStatistics = false;
					     if (varCustomFieldNameCode == 514 ) strCustomFieldValues += varTotalWeight;
					     if (varCustomFieldNameCode == 519 ) strCustomFieldValues += Math.round(varTotalWeight * 1.28);
					}
					else if (varCustomFieldNameCode == 517 ) strCustomFieldValues += varTotalLength;
					else if (varCustomFieldNameCode == 531 ) strCustomFieldValues += FloorUnits;
					else if (varCustomFieldNameCode == 532 ) strCustomFieldValues += WallUnits;
					else if (varCustomFieldNameCode == 533 ) strCustomFieldValues + OpenUnits;
					else if (varCustomFieldNameCode == 534 ) strCustomFieldValues += Wardrobes;
					else if (varCustomFieldNameCode == 535 ) strCustomFieldValues += Panels;
					else if (varCustomFieldNameCode == 536 ) strCustomFieldValues += Kickboards;
					else if (varCustomFieldNameCode == 537 ) strCustomFieldValues += ExtraDoors;
					else if (varCustomFieldNameCode == 538 ) strCustomFieldValues += Benchtops;
					else if (varCustomFieldNameCode == 539 ) strCustomFieldValues += CarcassUnits;
					else if (varCustomFieldNameCode == 552 ) strCustomFieldValues += Handles;
					else if (varCustomFieldNameCode == 553 ) strCustomFieldValues += Hardware;
 //check "Special Requests" for ;, -= characters					
			        else if (varCustomFieldNameCode == 10 || varCustomFieldNameCode == 617) { 
					            varSpecialRequest = escape(getLineSubItem(i, colCustomFields, iCustomField));
					            if (varSpecialRequest != "" ) varSpecialRequest = checkSpecialCharacters(varSpecialRequest);
					            strCustomFieldValues += varSpecialRequest;
					            }
					else if ((varCustomFieldNameCode < 594 || varCustomFieldNameCode > 599) && varCustomFieldNameCode != 605)		
					          strCustomFieldValues += escape(getLineSubItem(i, colCustomFields, iCustomField));							 														  									
				 }
  			}					  									

			strCart += "<input type=hidden name=\"customfieldname\" value=\"" + strCustomFieldNames + "\">";
			strCart += "<input type=hidden name=\"customfieldvalue\" value=\"" + strCustomFieldValues + "\">";
			strCart += "</td></tr>";
						
			if (iCustomFieldCount > 0)
			{
				strCart += "<tr bgcolor=\"" + ((i % 2) == 0 ? cartBackgndEven : cartBackgndOdd) + "\"><td>&nbsp;</td><td colspan=\"" + iColSpan + "\"><table>";
				for(var iCustomField = 0; iCustomField <getLineSubCount(i, colCustomFields); iCustomField++)
				{
					strCart += "<tr><td width=\"45%\" align=\"left\"><font face=\"" + ((i % 2) == 0 ? cartFontEven : cartFontOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd)  + "\" size=\"" + ((i % 2) == 0 ? cartFontSizeEven : cartFontSizeOdd) + "\"><b><i>" + getCustomField(getProductInfo(iProdID)[colCustomFieldKeys][iCustomField]) + ":</i></b></font></td>"
					
//  added code hjt====================================================================					
					 customName = getCustomField(getProductInfo(iProdID)[colCustomFieldKeys][iCustomField]);
					 customValue = getLineSubItem(i, colCustomFields, iCustomField);
                     productCode = newProductCode;
					 varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][iCustomField];					 
					 if ((varCustomFieldNameCode > 594 && varCustomFieldNameCode < 600) || varCustomFieldNameCode == 605) {
					   if      (varSuffix == "a") customValue = "Belmont Style - Vinyl Texture";
					   else if (varSuffix == "b") customValue = "Byron Bay Style - Vinyl Gloss";
					   else if (varSuffix == "c") customValue = "Albany Style - Polyurethane Texture";
					   else if (varSuffix == "d") customValue = "Avoca Style - Polyurethane Gloss";
					   else if (varSuffix == "e") customValue = "Unfinished Style - 18mm MDF";
					   else if (varSuffix == "y") customValue = "GLOSS Laminate (Formica)";
					   else if (varSuffix == "z") { customValue = "Laminate (Melamine Coloured";					   
					                    if (newProductCode.substring(0,9) == "DoorGlass") customValue = "Unfinished - 18mm MDF";
					  }
					}
// and just in cse a 'last Minute Edit has removed one or more products we reclculate the totals					              
					
					if (varCustomFieldNameCode == 514 )      customValue = varTotalWeight;
					else if (varCustomFieldNameCode == 519 ) customValue = Math.round(varTotalWeight * 1.28);
					else if (varCustomFieldNameCode == 517 ) customValue = varTotalLength;
					else if (varCustomFieldNameCode == 531 ) customValue = FloorUnits;
					else if (varCustomFieldNameCode == 532 ) customValue = WallUnits;
					else if (varCustomFieldNameCode == 533 ) customValue = OpenUnits;
					else if (varCustomFieldNameCode == 534 ) customValue = Wardrobes;
					else if (varCustomFieldNameCode == 535 ) customValue = Panels;
					else if (varCustomFieldNameCode == 536 ) customValue = Kickboards;
					else if (varCustomFieldNameCode == 537 ) customValue = ExtraDoors;
					else if (varCustomFieldNameCode == 538 ) customValue = Benchtops;
					else if (varCustomFieldNameCode == 539 ) customValue = CarcassUnits;
					else if (varCustomFieldNameCode == 552 ) customValue = Handles;
					else if (varCustomFieldNameCode == 553 ) customValue = Hardware;
					else if (varCustomFieldNameCode == 10 ) customValue = getLineSubItem(i, colCustomFields, iCustomField);
					
					else if (varCustomFieldNameCode == 637 && iProdID == 2 && varAdminCost > 0) customValue = "*D* Pickup Discount is offset by Setup/Admin cost $" + varAdminCost + " (excl. GST)";
					else if (varCustomFieldNameCode == 637 && iProdID == 2 && varAdminCost == 0)  customValue = "*D* Pickup Discount calculated";
					else if (varCustomFieldNameCode == 637 && iProdID == 1 && varAdminCost > 0)  customValue = "*F* Self Shipping cost is free but a proportional Setup/Admin cost is included of $" + varAdminCost + " (excl. GST)" ;
					else if (varCustomFieldNameCode == 637 && iProdID == 1 && varAdminCost == 0)  customValue = "*F* Self Shipping cost." ;
					else if (varCustomFieldNameCode == 637 && iProdID == 3 && varAdminCost == 0 && Insurance == 0) customValue = "*F* Freight Calculated." ;
					else if (varCustomFieldNameCode == 637 && iProdID == 3 && varAdminCost != 0) customValue = "*F* Freight Calculated includes a proportion of Setup cost of $" + varAdminCost + " (excl. GST)";
					else if (varCustomFieldNameCode == 637 && iProdID == 4  && varAdminCost == 0 && Insurance == 0)  customValue = "*F* Freight Calculated";
					else if (varCustomFieldNameCode == 637 && iProdID == 4 && varAdminCost == 0 && Insurance != 0) customValue = "*F* Freight Calculated includes insurance cost of $" + Insurance + " (excl. GST)"; 
					else if (varCustomFieldNameCode == 637 && iProdID == 4 && varAdminCost != 0 && Insurance == 0) customValue = "*F* Freight Calculated includes a proportion of Setup cost of $" + varAdminCost + " (excl. GST)";   
					else if (varCustomFieldNameCode == 637 && iProdID == 4 && varAdminCost != 0 && Insurance != 0) customValue = "*F* Freight Calculated includes a proportion of Setup cost of $" + varAdminCost + " (excl. GST)" + " Insurance of $" + Insurance + " (excl. GST)";
					else if (varCustomFieldNameCode == 636 && iProdID == 4) {
					 var tempvar= customValue;
					 if (tempvar.substring(0,3) == "Yes")  varPrompt="Alternative= [No]"; 
					 if (tempvar.substring(0,3) == "No")  varPrompt="Alternative= [Yes]"; 
					}							
					if (iProdID > 4){
					 var tempvar= customValue;
					 varPrompt=" ";
					      if (tempvar.substring(0,3) == "Yes")  varPrompt="Alternative= [No]";
					 else if (tempvar.substring(0,2) == "No")  varPrompt="Alternative= [Yes]";					 
					 else if (tempvar.substring(0,4) == "Left")  varPrompt="Alternative= [Right], or [None]";
					 else if (tempvar.substring(0,4) == "None")  varPrompt="Alternative= [Right], or [Left]";
					 else if (tempvar.substring(0,5) == "Right")  varPrompt="Alternative= [Left], or [None]";
					 else if (tempvar.substring(0,5) == "Fixed")  varPrompt="Alternative= [Adjustable]";
					 else if (tempvar.substring(0,10) == "Adjustable")  varPrompt="Alternative= [Fixed]";
					 else if (tempvar.substring(0,5) == "Right")  varPrompt="Alternative= [Left], or [None}";
					 else if (customName.substring(0,5) =="Front") varPrompt="Alternatives: [Bullnose Edge], [D-round Edge] or [Square]";
					 else if (customName.substring(0,10) =="Hinge Hole") varPrompt="Alternatives: [Cup + Outriggers], [Cup only] or [Not Applicable]";
					 else if (customName.substring(0,4) == "Rear") varPrompt="Alternatives: [Unfinished], or [As for Front edge]";
					 else if (customName.substring(0,4) == "SECT")  varPrompt="Alternatives [A] - [G]";
					 else if (tempvar.substring(0,5) == 0 && iProdID > 5)  varPrompt="Amend: [Number]";
					 
					 else if ((varCustomFieldNameCode > 594 && varCustomFieldNameCode < 600) || varCustomFieldNameCode == 605) 
					 			varPrompt="Alternatives: [Belmont},[Byron Bay],[Albany], [Avoca],[Unfinished],[Laminate],[GLOSS]";
					 
				   }

			       if (varURL.substring(0,9) != "View Cart" || productCode.substring(0,1) == "2" || productCode.substring(0,1) == "8" || productCode.substring(0,2) == "zz" || customName.substring(0,6) == "Unique" || customName.substring(0,4) == "Room" || customName.substring(0,4) == "Wall" ||  customName.substring(0,4) == "Ward"  || iProdID < 5 || iProdID == 287)
				     DoNotallowEdit = true;
				   else DoNotallowEdit = false;
				   
				   if (varCustomFieldNameCode == 636 || varCustomFieldNameCode == 10) DoNotallowEdit = false; 
				   
				   if (DoNotallowEdit == true) {
			   
					strCart += "<td align=\"left\"><font face=\"" + ((i % 2) == 0 ? cartFontEven : cartFontOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd) + "\"  color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd)  + "\" size=\"" + ((i % 2) == 0 ? cartFontSizeEven : cartFontSizeOdd) + "\">" + customValue + "</font></td>";
   			      } else {
						

						if (customName.substring(0,16) == "Special requests") 
 						  strCart += "<td align=\"left\"><input type=text size=50 name=\"newInput\" value=\"" + getLineSubItem(i, colCustomFields, iCustomField) +  "\" onblur=\"editCart(" + i + ", this, '" + colCustomFields + "', '" + iCustomField + "' ,'" + productCode + "', '" + customName + "','" + customValue + "','" + varCustomFieldNameCode + "');\" onkeypress=\"if (event.which == 0 || event.keyCode == 13) editCart(" + i + ", this);\"></td>" ;
                         else {						  				   		
  	                     strCart += "<td width=\"5%\" align=\"left\"><input type=text size=20 name=\"newInput\" value=\"" + tempvar + "\" onblur=\"editCart(" + i + ", this, '" + colCustomFields + "', '" + iCustomField + "' ,'" + productCode + "', '" + customName + "','" + customValue + "','" + varCustomFieldNameCode + "');\" onkeypress=\"if (event.which == 0 || event.keyCode == 13) editCart(" + i + ", this) ;\"> " ;
                          strCart += "</td>";
						  strCart += "<td width=\"70%\" align=\"right\">";
						  strCart += varPrompt;		 
						 
						 strCart += "</td>";
//						 	alert(item.value + " " + productCode + " " + customName + " " + customValue);
						}		
 				  }				      
			    }
//alert("1872 - prodname= " + safeString(getProductInfo(iProdID)[colProductDesc])  + " prodcode= " + newProductCode + " strCustomFieldNames= "  + strCustomFieldNames + " strCustomFieldValues= " + strCustomFieldValues);	
															
//======================================================================================= hjt end changes				
//"\" onblur=\"recalcCart(" + i + ", this, '" + strErrMsg + "', '" + strFileName + "');\"				
							
				strCart += "</table></td></tr>";
			}
	
			if (truncateDec) {
  			  curTaxTotal += Math.floor(fltQty * curTaxAmount * Math.pow(10, decPlaces)) / Math.pow(10, decPlaces); 	
			}else {
  			  curTaxTotal += Math.round(fltQty * curTaxAmount * Math.pow(10, decPlaces)) / Math.pow(10, decPlaces);
			}
	
			curSubTotal += curPriceSubTotal;
		}
		
		iUseBackgnd = lineCount + 1;
		if (curTaxTotal > 0)
		{
			strCart += "<tr><td colspan=\"" + (iColSpan - 1) + "\" align=right>" +
					"<font face=\"" + ((i % 2) == 0 ? cartFontEven : cartFontOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd) + "\"  color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd)  + "\" size=\"" + ((i % 2) == 0 ? cartFontSizeEven : cartFontSizeOdd) + "\">" +
					"<b>" + totLabel + " (" +  totTaxLabel + " " + formatCurrency(curSymbol, thousandsSeparator,decPlaces, decSeparator, truncateDec, blnSymbolAtFront, curTaxTotal) + "):</b>" + 
					"</font>" +
					"</td>" +
					"<td align=\"right\" bgcolor=\"" + ((iUseBackgnd % 2) ? cartBackgndEven : cartBackgndOdd) + "\">" +
					"<font face=\"" + ((i % 2) == 0 ? cartFontEven : cartFontOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd)  + "\" size=\"" + ((i % 2) == 0 ? cartFontSizeEven : cartFontSizeOdd) + "\">" +
					"<b>" + formatCurrency(curSymbol, thousandsSeparator,decPlaces, decSeparator, truncateDec, blnSymbolAtFront, curSubTotal) + "</b>" +
					"</font>" +
					"</td>" +
				"</tr>";
//------------------------------------------------------------------------------------
// add (insert)  by hjt 29/11/2007
 varOrderCost = curSubTotal;

 
// end of add-in   --------------------------------------------------------------------				
						
		}
		else
		{
			strCart += "<tr><td colspan=\"" + (iColSpan - 1) + "\" align=right><font face=\"" + ((i % 2) == 0 ? cartFontEven : cartFontOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd) + "\"  color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd)  + "\" size=\"" + ((i % 2) == 0 ? cartFontSizeEven : cartFontSizeOdd) + "\"><b><i>" + totLabel + ":</i></b></font></td><td align=\"right\" bgcolor=\"" + ((iUseBackgnd % 2) ? cartBackgndEven : cartBackgndOdd) + "\"><font face=\"" + ((i % 2) == 0 ? cartFontEven : cartFontOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd) + "\" color=\"" + ((i % 2) == 0 ? cartForegndEven : cartForegndOdd)  + "\" size=\"" + ((i % 2) == 0 ? cartFontSizeEven : cartFontSizeOdd) + "\"><b>" + formatCurrency(curSymbol, thousandsSeparator,decPlaces, decSeparator, truncateDec, blnSymbolAtFront, curSubTotal) + "</b></font></td></tr>";		
		}

		strCart += "<tr><td colspan=\"" + (iColSpan + 1) + "\" align=right>";
		strCart += "<input type=hidden name=\"productcount\" value=\"" + getLineCount() + "\">";
		strCart += "<input type=hidden name=\"version\" value=\"" + verStr + "\">";
		strCart += "</td></tr>";

		strCart += "<tr><td colspan=\"9\" align=left>";
// add by HJT 01282008   -----------------------------------------------------------------------
// to allow validation of total Order details before submitting the Order to the Server
// the CheckShoppingList() function will change the window.location to viewcart-2.htm if the Order checks out.
   
   varNewPID = iProdID
		
  if (varURL.substring(0,9) == "View Cart") {
  
        strCart += "<font color='green' size=2>When finished (or at any time) validate your Request for Quotation by clicking: </font> <a href=\"#\" onclick=\"CheckShoppingList()\"><img src=\"" + imagepath + "/CheckShoppingList_on.gif\"  border=\"2\" name=\"recalcBtn\"></a>";
		
//		strCart += "<br><font color='blue' size='2'>After Advice that your Shopping List has been correctly validated - </font> <a href=\"#\" // onclick=\"CheckoutMessage()\"><img src=\"" + imagepath + "/cartcheckout.gif\" border=\"0\"></a>";

  }
  if (varURL.substring(0,10) == "viewcart-2") { 
    if (NotRegMsg !="") {
		strCart += "<br> <a href=\"javascript: bProcessCart = false;alert('" + NotRegMsg+ "');\"><img src=\"" + imagepath + "/cartcheckout.gif\" border=\"0\"></a>";
    } else
    {
		strCart += "<br><font color='green' size='5'>Your Shopping List has been validated - please continue:<a href=\"javascript: bProcessCart = true; document.forms['ordercart'].submit();\"><img src=\"" + imagepath + "/cartcheckout.gif\" border=\"0\"></a>";
    }
 }   
// end of modifications by HJT 30/1/2008 ----------------------------------------------------------
		strCart += "</td></tr>";
	}
	strCart += "</table>";
	strCart += "<input type=hidden name=\"requestedaction\" value=\"CreateNewOrder\">";
// mod hjt 3/10/2011
if (varURL.substring(0,10) == "viewcart-3" && varProductCode.substring(0,6) == "Outlet" ) alert("Now that you have selected a Manufacturing Outlet - please CLICK again on the [Get Price] button to have your first selected product shown on [View Cart] with the  calculated price");
	
return strCart;

}

/* formatCurrency(curSymbol, thousandsSeparator, decPlaces, decSeparator,  truncateDec, blnSymbolAtFront, curValue)
 *
 * takes a currency value and decorates it with currency formatting
 *
 * input -
 * curSymbol:	the actual symbol used to indicate this is currency
 * decPlaces:	the number of decimals to display to the right of the separator
 * decSeparator: the symbol used to separate the whole from the fractional portion of the currency
 * blnSymbolAtFront: whether to put the currency symbol at the front or back
 * curValue:	the actual money value to display
 */

function formatCurrency(curSymbol, thousandsSeparator, decPlaces, decSeparator, truncateDec, blnSymbolAtFront, curValue)
{
	var strCurrency;
	if (truncateDec) {
	  strCurrency = Math.floor(parseFloat(curValue) * Math.pow(10, decPlaces));
	}else {
	  strCurrency = Math.round(parseFloat(curValue) * Math.pow(10, decPlaces));
	}

	strCurrency = strCurrency.toString();

	while (strCurrency.length <= decPlaces) strCurrency = "0" + strCurrency;

	var decValue = 	strCurrency.substr(strCurrency.length - decPlaces, strCurrency.length);			

	strCurrency = strCurrency.substr(0, strCurrency.length - decPlaces);
	var s;

	if (strCurrency.length > 3) {
	        s = strCurrency.substr(strCurrency.length-3, 3);

		for (var i = 4; i <= strCurrency.length; i++){
        	   if (((i - 4) % 3) == 0){
	              s = strCurrency.substr(strCurrency.length - i,1) + thousandsSeparator + s;
		    } 
		    else{
		      s = strCurrency.substr(strCurrency.length - i,1) + s;
		    }
	
		}
	} else {
	  s = strCurrency;
	}

	if (decPlaces != 0) {
   	  strCurrency =  s + decSeparator + decValue;
	}else{
   	  strCurrency =  s;
	}

	return blnSymbolAtFront ? curSymbol + strCurrency : strCurrency + curSymbol;	

}

/* safeString(str)
 *
 * takes a str and returns another safe to put into a value attribute on an input tag
 *
 * input -
 * str:		the string that is dirty
 */

function safeString(str)
{
	if (str.constructor != String) 
		str = new String(str);
	return str.replace(/\"/g, "&quot;");
}

/* setRegion(region)
 *
 * takes the region specified and persists it for the current user
 * this allows prices to shown in the region relative to the merchant appropriately
 *
 * input -
 * region:	0 for a local (interstate) sale
 *			1 for a domestic (national) sale
 *			2 for an international sale
 */

function setRegion(region)
{
	setItem("region", region);
	
	// File condition to cater for problem with IE7
	if (window.location.protocol == "file:")
	{
		window.location = "file://" + window.location.pathname;
	}
	else
	{
		window.location = window.location.pathname;
	}
	return false;
}

function getRegion(defaultregion)
{
   var region = defaultregion.toString();	
   if (getItem("region") != "") region = getItem("region");
   if (region != "0" && region != "1" && region != "2") region = "1";	
    region = "1";   //  forece to Domestic Pricing hjt 19/01/2010
  return region;
}

function getLocalButton(defaultregion, OnlyInCart)
{

  if (OnlyInCart) {
    var lineCount = getLineCount();
    if (lineCount == 0){
      return  "";
    }
  }
     
  var strBtn = "<a href=\"javascript:setRegion(0);\">";
  strBtn += getRegion(defaultregion) == 0 ? "<img border=\"0\" src=\"images/cartlocal_on.gif\"></a>" : "<img border=\"0\" src=\"images/cartlocal_off.gif\"></a>";
  return strBtn;

}

function getDomesticButton(defaultregion, OnlyInCart)
{
  if (OnlyInCart) {
    var lineCount = getLineCount();
    if (lineCount == 0){
      return  "";
    }
  }
  var strBtn = "<a href=\"javascript:setRegion(1);\">";
  strBtn += getRegion(defaultregion) == 1 ? "<img border=\"0\" src=\"images/cartdomestic_on.gif\"></a>" : "<img border=\"0\" src=\"images/cartdomestic_off.gif\"></a>";
  return strBtn;

}

function getInternationalButton(defaultregion, OnlyInCart)
{
  if (OnlyInCart) {
    var lineCount = getLineCount();
    if (lineCount == 0){
      return  "";
    }
  }
  var strBtn = "<a href=\"javascript:setRegion(2);\">";
  strBtn += getRegion(defaultregion) == 2 ? "<img border=\"0\" src=\"images/cartinternational_on.gif\"></a>" : "<img border=\"0\" src=\"images/cartinternational_off.gif\"></a>";
  return strBtn;

}

function getItem(key)
{
	var idx = private_getItemIndex(key);

	if (idx == -1)
	{
		return "";
	}
	
	return unescape(arrItem[idx][1]);
}

function setItem(key, value)
{	
	var idx = private_getItemIndex(key);

	if (idx == -1) idx = arrItem.length;

	arrItem[idx] = new Array(key, escape(value));

	return private_UpdateItems();
}

function getLineItem(line, key)
{
	var idx = private_getLineItemIndex(line, key);

	if (idx == -1)
	{
		return "";
	}

	return unescape(arrLine[line][idx]);
}

function setLineItem(line, key, value)
{
	var idx = private_getLineItemIndex(line, key);
	if (idx == -1)
	{
		if (typeof(arrLine) == "undefined")
		{
			arrLine = new Array();
		}
		if (typeof(arrLine[line]) == "undefined")
		{		     
			arrLine[line] = new Array(0);
		}
		idx = key;
	}

	if (typeof(value) == "string")
	{
		arrLine[line][idx] = escape(value);
	   if (typeof(arrLine[line][idx]) == "undefined") arrLine = escape(value);  // hjt26/12/2010
	}
	else
	{
	   if (typeof(arrLine) == "undefined") arrLine = escape(value);   // hjt 26/12/2010
	   else arrLine[line][idx] = value;
	}

	return private_UpdateLines();
}


function deleteLine(line)
{
	var arrLineTmp = new Array(0);

	if (arrLine.length > line)
	{
		for(var i = 0; i <line; i++)
		{
			arrLineTmp[i] = arrLine[i];
		}
		for(var i = line + 1; i <arrLine.length; i++)
		{
			arrLineTmp[i - 1] = arrLine[i];
		}
	}
	
	arrLine = arrLineTmp;
	
	private_UpdateLines();
}

function getLineSubItem(line, key1, key2)
{
	var idx = private_getLineItemIndex(line, key1);

	if (idx == -1)
	{
		return "";
	}
	if (typeof(arrLine[line][idx]) == "string")
	{
		return unescape(arrLine[line][idx]);
	}

	arrSubLine = arrLine[line][idx];

	if (typeof(arrSubLine) == "undefined" || arrSubLine == null)
	{
		return "";
	}
	
	return unescape(arrSubLine[key2]);
}

function setLineSubItem(line, key1, key2, value)
{

	var idx = private_getLineItemIndex(line, key1);

	var arrSubLine = null;

	if (idx == -1)
	{
		arrSubLine = new Array(0);
		arrSubLine[key2] = escape(value);
	}
	else
	{
		arrSubLine = arrLine[line][idx];
		if (typeof(arrSubLine) == "undefined")
		{
			arrSubLine = new Array(0);			
		}
		
		arrSubLine[key2] = escape(value);
		if (typeof(value) == "string" && typeof(arrSubLine[key2]) == "undefined") arrSubLine = value;       //hjt 26/12/2010
	}

	setLineItem(line, key1, arrSubLine);
}

function getLineCount()
{
	if (typeof(arrLine) == "undefined")
		return 0;
	else
		return arrLine.length;
}

function getLineSubCount(line, key)
{
	if (typeof(arrLine[line]) == "undefined")
	{
		return 0;
	}

	if (typeof(arrLine[line][key]) == "string")
	{
		return 1;
	}

	if (typeof(arrLine[line][key]) == "undefined" ||
		typeof(arrLine[line][key]) != "object")
	{
		return 0;
	}
	
	return arrLine[line][key].length;
}

function private_UpdateItems()
{
	var arrItemTmp = new Array(arrItem.length);
	
// change Cookie storage to 14 days
// hjt 10/4/2008
	  	 var dtExpiry = new Date();
		 dtExpiry.setDate(dtExpiry.getDate() + 14);	

// end replace the once line "document.cookie = strLines

	var strItems;
	for(var i = 0; i <arrItem.length; i++)
	{
		arrItemTmp[i] = arrItem[i].join("=");
	}
	strItems = "items=" + arrItemTmp.join("&");

	document.cookie = strItems + "; expires=" + dtExpiry.toGMTString() + ";";

	return true;
}

function private_UpdateLines()
{
	var strLines;
	var arrLineTmp = new Array(0);
	var yy = 0;
	
	for(var i = 0; i <arrLine.length; i++)
	{
//alert("2619 arrLine=  " + arrLine[i] + " arrLine.length= " + arrLine.length + " i= " + i);		
		if (typeof(arrLine[i]) == "undefined")    continue;
		 arrLineTmp[yy] = arrLine[i].join("&"); //change 12/01/22
		 yy = yy + 1;
	}
 //alert("2625 what is arrLineTemp now= " + arrLineTmp + " i= " + i + " yy= " + yy);
 
	    strLines = CookieID + "=" + arrLineTmp.join("#");

	  if (strLines.length > 4096) return false;
	  var dtExpiry = new Date();
	  dtExpiry.setDate(dtExpiry.getDate() + CookieRetention); // added as a variable	
	document.cookie = strLines + "; expires=" + dtExpiry.toGMTString() + ";";
//alert("2636 at end - strLines= " + strLines + " i= " + i);

    if (strLines.length > 3900) { window.alert("Your  Current Project's [Cookie] storage is getting close to the maximum of 4096 characters - there is space left for a few more Specifications but then you must enter your Colour options and Delivery details and submit the data. If more products are needed then please enter these in a separate Request for Quotation but let us know that this has been done, so we can combine and Deliver them all together. - NOTE You will have to click [OK] 3-4 times to proceed.");
    }
	return true;
}

function private_getItemIndex(key)
{
	if (typeof(arrItem) == "undefined") return -1;

	for(var i = 0; i <arrItem.length; i++)
	{
		if (arrItem[i][0] == key) return i;
	}

	return -1;
}

function private_getLineItemIndex(line, key)
{
	if (typeof(arrLine) == "undefined") return -1;
	if (typeof(arrLine[line]) == "undefined") return -1;
	if (typeof(arrLine[line][key]) == "undefined") return -1;

	return key;
}

function private_CartLoad()
{

//alert(" CookieID= " + CookieID + " arrrCookie= " + arrCookie + " varLimitLines = " + varLimitLines);
	if (arrCookie == null || arrCookie == "" || arrCookie == "delet")
	{
		arrCookie = new Array(0);
	}
  if (varListAll == false ) {
	for(var i = 0; i <arrCookie.length; i++)
	{
		if (arrCookie[i].substr(0, 5) == CookieID )
		{
			arrLine = arrCookie[i].substr(6, arrCookie[i].length - 6).split("#");
//alert("2663 collected new arrLine data= " + arrLine);
		}
	}
  }

//	if (arrItem == null || arrItem == "")
//	{
//		arrItem = new Array(0);
//	}
//	for(var i = 0; i <arrItem.length; i++)
//	{
//		arrItem[i] = arrItem[i].split("=");
//	}
	if (arrLine == null || arrLine == "" )
	{
		arrLine = new Array(0);
	} 
	
	for(var i = 0; i <arrLine.length; i++)
	{
     if (arrLine[i] == "" || arrLine[i] == null) continue; 		
	 else {
// alert(" 2589 - i= " + i + " varListAll= " + varListAll + " arrLine[i] = " + arrLine[i]);
	 	arrLine[i] = arrLine[i].split("&");
         }	
		for (var iField = 0; iField <arrLine[i].length; iField++)
		{
			var arrSubItems = arrLine[i][iField].split(",");
			
			if (arrSubItems != null && arrSubItems != "")
			{
				if (arrSubItems.length == 1) continue;

				arrLine[i][iField] = arrSubItems;
			}
		}				
	}
	
}

function FormatSeparator(strValue,decSeparator)
{
	var re = /\./;
	var newValue = strValue.toString();
	newValue = newValue.replace(re, decSeparator);
	return newValue;
}

function CalculateOrderTotals()
{
    TotalOrderCheck = true;
    varOrderCost = 0;
	extraShelfCost = 0;
	varPrice = 0;
	varWeight = 0;
	varTotalWeight = 0;
	varQuantity = 0;
	CalculatedBenchtopCost = 0;
    PanelStyle = "Nil";

	varWardRobe1 = "000";
	varWardRobe2 = "000";
	varWardRobe3 = "000";
	varWardRobe4 = "000";
	varWardRobe5 = "000";
	varWardRobe6 = "000";
	varWardRobe7 = "000";
	varWardRobe8 = "000";
	varWardRobe9 = "000";
	varWardRobe10 = "000";
	varWardRobe11 = "000";
	varWardRobe12 = "000";
	varWardRobe13 = "000";
	varWardRobe14 = "000";
	varWardRobe15 = "000";
	varWardRobe16 = "000";
	varWardRobe17 = "000";
	varWardRobe18 = "000";
	varWardRobe19 = "000";
	varWardRobe20 = "000";
	varWardRobe21 = "000";
	varWardRobe22 = "000";
	varWardRobe23 = "000";
	varWardRobe24 = "000";
	
	varWardRobeHeight1 = 0;
	varWardRobeHeight2 = 0;
	varWardRobeHeight3 = 0;
	varWardRobeHeight4 = 0;
	varWardRobeHeight5 = 0;
	varWardRobeHeight6 = 0;
    varWardRobeHeight7 = 0;
    varWardRobeHeight8 = 0;
	varWardRobeHeight9 = 0;
	varWardRobeHeight10 = 0;
	varWardRobeHeight11 = 0;
	varWardRobeHeight12 = 0;
	varWardRobeHeight13 = 0;
	varWardRobeHeight14 = 0;
	varWardRobeHeight15 = 0;
	varWardRobeHeight16 = 0;
	varWardRobeHeight17 = 0;
	varWardRobeHeight18 = 0;
    varWardRobeHeight19 = 0;
    varWardRobeHeight20 = 0;
	varWardRobeHeight21 = 0;
	varWardRobeHeight22 = 0;
	varWardRobeHeight23 = 0;
	varWardRobeHeight24 = 0;	 
	 
 varWardRobeDepth1 = 0;
 varWardRobeDepth2 = 0;
 varWardRobeDepth3 = 0;
 varWardRobeDepth4 = 0;
 varWardRobeDepth5 = 0;
 varWardRobeDepth6 = 0;
 varWardRobeDepth7 = 0;
 varWardRobeDepth8 = 0;
 varWardRobeDepth9 = 0;
 varWardRobeDepth10 = 0;
 varWardRobeDepth11 = 0;
 varWardRobeDepth12 = 0;
 varWardRobeDepth13 = 0;
 varWardRobeDepth14 = 0;
 varWardRobeDepth15 = 0;
 varWardRobeDepth16 = 0;
 varWardRobeDepth17 = 0;
 varWardRobeDepth17 = 0;
 varWardRobeDepth19 = 0;
 varWardRobeDepth20 = 0;
 varWardRobeDepth21 = 0;
 varWardRobeDepth22 = 0;
 varWardRobeDepth23 = 0;
 varWardRobeDepth24 = 0;
 
 varWardRobeShape1 = false;
 varWardRobeShape2 = false;
 varWardRobeShape3 = false;
 varWardRobeShape4 = false;
 varWardRobeShape5 = false;
 varWardRobeShape6 = false;
 varWardRobeShape7 = false;
 varWardRobeShape8 = false;
 varWardRobeShape9 = false;
 varWardRobeShape10 = false;
 varWardRobeShape11 = false;
 varWardRobeShape12 = false;
 varWardRobeShape13 = false;
 varWardRobeShape14 = false;
 varWardRobeShape15 = false;
 varWardRobeShape16 = false;
 varWardRobeShape17 = false;
 varWardRobeShape17 = false;
 varWardRobeShape19 = false;
 varWardRobeShape20 = false;
 varWardRobeShape21 = false;
 varWardRobeShape22 = false;
 varWardRobeShape23 = false;
 varWardRobeShape24 = false;	 
 varRW1 = "NIL";
 varRW2 = "NIL";
 varRW3 = "NIL";
 varRW4 = "NIL";
 varRW5 = "NIL";
 varRW6 = "NIL";
 varRWError = "";
 varRWError = "";
 varSection = " ";
 varLastWR = " ";
 varLastSection = " ";
 for (var ii = 0; ii<24; ii++)
   {wardrobe[ii] = "ZZZ";
   }
	  
	varBenchTop1 = "";
	varBenchTop2 = "";
	varBenchTop3 = "";
    varBenchTop4 = "";
	varBenchTop5 = "";
	varBenchTop6 = "";
	varBenchTop7 = "";
	varBenchTop8 = "";
	varBenchTop9 = "";
	varBenchTop10 = "";
	varBTNumber = 0;
	varMaleJoin = 0;
	varFemaleJoin = 0;	
	varButtJoin = 0;
	varEndJoin = 0;  
	varTotalJoin = 0;
	varInvalidProduct = false;
	varProductType = "Unde";
	
	FloorUnits = 0;
	WallUnits = 0;
	OpenUnits = 0;
	Panels = 0;
	Kickboards = 0;
	Benchtops = 0;
	Wardrobes = 0;
	Bulkheads = 0;
	Filler = 0;
	ExtraDoors = 0;
	CarcassUnits = 0;
	ModularUnits = 0;
	Handles = 0;
	Hardware = 0;
	varLaminate = 0;

	varStatistics = false;
// for benchtop calculations
    Ll = 0;  // length of side
	Ww = 0;  // Width od side
	Ee = 0;  // Single or Double Postform
	varBenchWeight = 0 ;  // calculated weight of one Side
    BenchWeight = 0 ;  // Total weight of a benchtop product.	 	 
    varL1 = 0;  //Lenth of side 1
	varW1 = 0;  // Width of Side 1
	varE1 = 0;  //Edging of Side 1
	varBenchW1 = 0;  // Weight of Side 1
	varL2 = 0;  //Lenth of side 2
	varW2 = 0;  // Width of Side 2
	varE2 = 0;  //Edging of Side 2
	varBenchW2 = 0;  // Weight of Side 2
	varL3 = 0;  //Lenth of side 3
	varW3 = 0;  // Width of Side 3
	varE3 = 0;  //Edging of Side 3
	varBenchW3 = 0;  // Weight of Side 3
	BenchCost = 0;  //calculated benchCost
	BenchCost1 = 0;  // Side 1 cost
	BenchCost2= 0;  // Side 2 cost
	BenchCost3 = 0;  // Side 3 cost
	BenchLength = 0;
	varBenchtopStyle = false;
	varEndFinishNumber = 0;
	varEndNumber = 0;
	varFatalError = false;
	varPreviousBaseHeight = 0;  //To check that current Base Cabinet Height = Previous one 
	
	varDoorStyle1 = "Nil";
    varDoorStyle2 = "Nil";
	varDoorStyle3 = "Nil";
	varPanelStyle1 = "Nil";
	varPanelStyle2 = "Nil";
	varPanelStyle3 = "Nil";
	varKickStyle1 = "Nil";
	varKickStyle2 = "Nil";
	varKickStyle3 = "Nil";
	varOpenStyle1 = "Nil";
	varOpenStyle2 = "Nil";
	varOpenStyle3 = "Nil";
	
	varFullProductStyle = "A different Style"; 
	varCarcassProcessed = false;		
			
    var lineCount = getLineCount();
// firstly we check on the Style records that were recorded and build up an array of recorded Styles:

 if (lineCount != 0)
 {	
	for(var i = 0; i <lineCount; i++)
	{
		var iProdID = parseInt(getLineItem(i, colProductID));
//=========================Adition by hjt  November 2009 ================================== 
//  swap PID for a different Style-Price calculation BUT DO NOT CHANGE DATA INPUT!!!!
		varNewPID=changeStyle(iProdID,i);
// ========================================================		

 			checkStyleInput(i, iProdID);
								
            var iCustomFieldCount = getLineSubCount(i, colCustomFields); 	        
			if (iCustomFieldCount > 0)  {						
	          for(var iCustomField = 0; iCustomField <iCustomFieldCount; iCustomField++)
	          {
			      var varCustomFieldValue = getLineSubItem(i, colCustomFields, iCustomField);					
			      varThree = varCustomFieldValue.substring(0,3);
				  if (varThree == "*D*" || varThree == "*F*" || varThree == "*C*") {   
// this means that  Product Range checking was done when either Delivery or Style records were processed
				       BypassCheckProductRange = true;
				  }
// hjt 11/9/22 get the last Unique bench identifyer used and set the next one
                  var varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][iCustomField];
                  if (varCustomFieldNameCode == 364) {
				     if  (varProductCode.substring(0,3) == "BTS"  || varProductCode.substring(0,3) == "BTD"
					  || varProductCode.substring(0,3) == "BTL" || varProductCode.substring(0,3) == "BTU") {
				      X1 = ABCstring.indexOf(varCustomFieldValue);
					  varLastcode = varCustomFieldValue;
					  varNextcode = ABCstring.substring(X1 + 1,X1 + 2);				   
				  } }
//				  				  	  	  	  
			  }
			}
	if (varProductCode.substring(0,3) == "zP-") varNoPanel = true;
	if (varProductCode.substring(0,3) == "zK-") varNoKick = true;
    }
 }

// now we collect data on actual Product items
 if (lineCount != 0)
 {	
	for(var i = 0; i <lineCount; i++)
	{
		var iProdID = parseInt(getLineItem(i, colProductID));		
		iQty = parseFloat(getLineItem(i, colQuantity));
		varWeight = parseFloat(getProduct(iProdID)[colProductWeight]);
			
// check that any previous Product ordered still conforms to the Style specifications
       varProdStyle = getProductStyle(iProdID,i);
//alert("line 2614 - varProdStyle= " + varProdStyle + " i= " + i);
   
	   varProductType = checkProductType(iProdID,varStatistics,i);	   
	   if (varProductType == "Deli") varDelivery = true;  
	   
//	   set Base Cabinet Height
	 			varProductCode = getProductInfo(iProdID)[colProductCode];
				if (varProductCode.substring(0,1) == "B") {
				  var iCustomFieldCnt = getLineSubCount(i, colCustomFields); 
                  if (iCustomFieldCnt > 0)  {			
	                  varPreviousBaseHeight = getLineSubItem(i, colCustomFields, 0);			   			   
			      } 				
				}

// get details on WardRobe identifications:
           var iCustomFieldCount = getLineSubCount(i, colCustomFields); 
           if (iCustomFieldCount > 0 && varProductType ==  "Ward")  {			
	          for (var iCustomField = 0; iCustomField <iCustomFieldCount; iCustomField++)
	          {
			   varCustomFieldValues = getLineSubItem(i, colCustomFields, iCustomField);
			   			   
			      if (iCustomField == 0) var varRoom = varCustomFieldValues;
				  else {
					   if (iCustomField == 1) var varWall = varCustomFieldValues;
				       else {
						    if (iCustomField == 2) {
							    var varSection = varCustomFieldValues;							
							    var varPosition = varRoom + varWall + varSection;
 								var varWRHeight = getLineSubItem(i, colCustomFields,3);
 								var varWRDepth = getLineSubItem(i, colCustomFields, 5);
								var varWRShape = getLineSubItem(i, colCustomFields, 6);								 
							    if (varWardRobe1 == "000") 	{ 
								    wardrobe[0] = varPosition;
								    varWardRobe1 = varPosition;
									varWardRobeHeight1 = varWRHeight;
									varWardRobeDepth1 = varWRDepth;
									varWardRobeShape1 = varWRShape;																		
								}							
								else if (varWardRobe2 == "000") {
								    wardrobe[1] = varPosition;
									varWardRobe2 = varPosition;
									varWardRobeHeight2 = varWRHeight;
									varWardRobeDepth2 = varWRDepth;
									varWardRobeShape2 = varWRShape;
								}
							  	else if (varWardRobe3 == "000") {
									wardrobe[2] = varPosition;
									varWardRobe3 = varPosition;
									varWardRobeHeight3 = varWRHeight;
									varWardRobeDepth3 = varWRDepth;
									varWardRobeShape3 = varWRShape;
								}
							    else if (varWardRobe4 == "000") {
									wardrobe[3] = varPosition;
									varWardRobe4 = varPosition;
									varWardRobeHeight4 = varWRHeight;
									varWardRobeDepth4 = varWRDepth;
									varWardRobeShape4 = varWRShape;
								}
							    else if (varWardRobe5 == "000") {
									wardrobe[4] = varPosition;
									varWardRobe5 = varPosition;
									varWardRobeHeight5 = varWRHeight;
									varWardRobeDepth5 = varWRDepth;
									varWardRobeShape5 = varWRShape;
								}
								else if (varWardRobe6 == "000") {
									wardrobe[5] = varPosition;
									varWardRobe6 = varPosition;
									varWardRobeHeight6 = varWRHeight;
									varWardRobeDepth6 = varWRDepth;
									varWardRobeShape6 = varWRShape;
								}
								else if (varWardRobe7 == "000") {
									wardrobe[6] = varPosition;
									varWardRobe7 = varPosition;
									varWardRobeHeight7 = varWRHeight;
									varWardRobeDepth7 = varWRDepth;
									varWardRobeShape7 = varWRShape;
								}
								else if (varWardRobe8 == "000") {
									wardrobe[7] = varPosition;
									varWardRobe8 = varPosition;
									varWardRobeHeight8 = varWRHeight;
									varWardRobeDepth8 = varWRDepth;
									varWardRobeShape8 = varWRShape;
								}
								else if (varWardRobe9 == "000") {
									wardrobe[8] = varPosition;
									varWardRobe9 = varPosition;
									varWardRobeHeight9 = varWRHeight;
									varWardRobeDepth9 = varWRDepth;
									varWardRobeShape9 = varWRShape;
								}
								else if (varWardRobe10 == "000") {
									wardrobe[9] = varPosition;
									varWardRobe10 = varPosition;
									varWardRobeHeight10 = varWRHeight;
									varWardRobeDepth10 = varWRDepth;
									varWardRobeShape10 = varWRShape;
								}
								else if (varWardRobe11 == "000") {
									wardrobe[10] = varPosition;
									varWardRobe11 = varPosition;
									varWardRobeHeight11 = varWRHeight;
									varWardRobeDepth11 = varWRDepth;
									varWardRobeShape11 = varWRShape;
								}
								else if (varWardRobe12 == "000") {
									wardrobe[11] = varPosition;
									varWardRobe12 = varPosition;
									varWardRobeHeight12 = varWRHeight;
									varWardRobeDepth12 = varWRDepth;
									varWardRobeShape12 = varWRShape;
								}
								else if (varWardRobe13 == "000") {
									wardrobe[12] = varPosition;
									varWardRobe13 = varPosition;
									varWardRobeHeight13 = varWRHeight;
									varWardRobeDepth13 = varWRDepth;
									varWardRobeShape13 = varWRShape;
								}
								else if (varWardRobe14 == "000") {
									wardrobe[13] = varPosition;
									varWardRobe14 = varPosition;
									varWardRobeHeight14 = varWRHeight;
									varWardRobeDepth14 = varWRDepth;
									varWardRobeShape14 = varWRShape;
								}
							  	else if (varWardRobe15 == "000") {
									wardrobe[14] = varPosition;
									varWardRobe15 = varPosition;
									varWardRobeHeight15 = varWRHeight;
									varWardRobeDepth15 = varWRDepth;
									varWardRobeShape15 = varWRShape;
								}
							    else if (varWardRobe16 == "000") {
									wardrobe[15] = varPosition;
									varWardRobe16 = varPosition;
									varWardRobeHeight16 = varWRHeight;
									varWardRobeDepth16 = varWRDepth;
									varWardRobeShape16 = varWRShape;
								}
							    else if (varWardRobe17 == "000") {
									wardrobe[16] = varPosition;
									varWardRobe17 = varPosition;
									varWardRobeHeight17 = varWRHeight;
									varWardRobeDepth17 = varWRDepth;
									varWardRobeShape17 = varWRShape;
								}
								else if (varWardRobe18 == "000") {
									wardrobe[17] = varPosition;
									varWardRobe18 = varPosition;
									varWardRobeHeight18 = varWRHeight;
									varWardRobeDepth18 = varWRDepth;
									varWardRobeShape18 = varWRShape;
								}
								else if (varWardRobe19 == "000") {
									wardrobe[18] = varPosition;
									varWardRobe19 = varPosition;
									varWardRobeHeight19 = varWRHeight;
									varWardRobeDepth19 = varWRDepth;
									varWardRobeShape19 = varWRShape;
								}
								else if (varWardRobe20 == "000") {
									wardrobe[19] = varPosition;
									varWardRobe20 = varPosition;
									varWardRobeHeight20 = varWRHeight;
									varWardRobeDepth20 = varWRDepth;
									varWardRobeShape20 = varWRShape;
								}
								else if (varWardRobe21 == "000") {
									wardrobe[20] = varPosition;
									varWardRobe21 = varPosition;
									varWardRobeHeight21 = varWRHeight;
									varWardRobeDepth21 = varWRDepth;
									varWardRobeShape21 = varWRShape;
								}
								else if (varWardRobe22 == "000") {
									wardrobe[21] = varPosition;
									varWardRobe22 = varPosition;
									varWardRobeHeight22 = varWRHeight;
									varWardRobeDepth22 = varWRDepth;
									varWardRobeShape22 = varWRShape;
								}
								else if (varWardRobe23 == "000") {
									wardrobe[22] = varPosition;
									varWardRobe23 = varPosition;
									varWardRobeHeight23 = varWRHeight;
									varWardRobeDepth23 = varWRDepth;
									varWardRobeShape23 = varWRShape;
								}
								else if (varWardRobe24 == "000") {
									wardrobe[23] = varPosition;
									varWardRobe24 = varPosition;
									varWardRobeHeight24 = varWRHeight;
									varWardRobeDepth24 = varWRDepth;
									varWardRobeShape24 = varWRShape;
								}	
// window.alert("Height= " + varWRHeight + " Depth= " + varWRDepth + " varWRShape=) " + varWRShape) ;																			            
							}							
					 }					 
				   }	 
					 
			    }
			  }																
								
				if ( varProductType ==  "Ward")  {
					if (iQty > 1) {
window.alert("The WARDROBE Quantity in the View-Cart Shopping List is greater than '1' -- it must Only be '1'. Our Production System can not deal with duplicate Room/Wall and Sections. Please change the Qty to '1' and then Enter another Unique Wardrobe specification if you require multiple wardrobe inserts.");
                  varErrorType = varErrorType + 1;
				  location.replace("viewcart.htm");
                    }
			}
			if (varProductType ==  "Disc") {
			varDiscountRequest = true;
			 PanelKBQuestion = true;
			 if (iQty > 1) {
window.alert("The Discount Quantity in the View-Cart Shopping List is greater than '1' -- it must Only be '1'. Only ONE Discount is allowed at the time. Please change the Qty to '1' or REMOVE the Discount entry completely and resubmit a new one." );
                  varErrorType = varErrorType + 1;
				  location.replace("viewcart.htm");
                    }
			}			  			 
			 
			if ( varProductType ==  "Styl" && varProductCode.substring(0,7) != "8 Style")  {
			  PanelKBQuestion = true;
				if (iQty > 1) {
window.alert("One of your STYLE specifications has been duplicated as it has a QUANTITY > '1' - each STYLE product must be for a UNIQUE set of components - please [CHANGE] the Quantity to '1' and make another Style specification if needed");
                  varErrorType = varErrorType + 1;
				   location.replace("viewcart.htm");
                }
			}
														 
            if (varProductType ==  "Benc")  {
			    
				if (iQty > 1) {
window.alert("Ooooppps - There is a QUANTITY greater than [1] for one of your Benchtop products in your VIEW CART - The QUANTITY can only ever be [1] here. - Click [OK] to go to the View Cart so you can correct this to [1]");
                  varErrorType = varErrorType + 1;
				   location.replace("viewcart.htm");
                }
				varProductCode = getProductInfo(iProdID)[colProductCode];
				varShortCode = varProductCode.substring(0,3);
				varLongCode = varProductCode.substring(0,4);
				if (varShortCode == "BTS" || varShortCode == "BTD" || varShortCode == "BTU") 
											varBTNumber = varBTNumber + 1;
				if (varLongCode == "BTLA" || varLongCode == "BTLB" || varLongCode == "BTLC" || varLongCode == "BTLD") varBTNumber = varBTNumber + 1;
				if (varLongCode == "BTEL" || varLongCode == "BTER") varEndNumber = varEndNumber + 1;
				if (varLongCode == "BTLM" || varLongCode == "BTLF" || varLongCode == "BTBL" || varLongCode == "BTRM" || varLongCode == "BTRF" || varLongCode == "BTBR") {
				     varJoinTotal = varJoinTotal + 1;					 
				     varProdName = getProductInfo(iProdID)[colProductDesc];
					   if (varProdName.indexOf("Male") > 0) varMaleJoin = varMaleJoin + 1;
					   else if (varProdName.indexOf("Female") > 0) varFemaleJoin = varFemaleJoin + 1;
					   else if (varProdName.indexOf("Butt") > 0) varButtJoin = varButtJoin + 1;
					   else varEndJoin = varEndJoin + 1;
                }
								
              var iCustomFieldCount = getLineSubCount(i, colCustomFields); 			
       }
	   }    
  TotalOrderCheck = false; 
  
  
// to prevent additional Carcass Selected Messages  
    if (varProductType ==  "Carc")  varCarcassProcessed = true; 
    return true;	   	       													
   }
  else {
    TotalOrderCheck = false;
    return false;
  }			    			
}

// fundtion to calculate Total Weight, Total Order Cost and checkout WardRobe details
function CalculateOrderWeight()
{
    varOrderCost = 0;
	extraShelfCost = 0;
//	varPrice = 0;
	varWeight = 0;
	varTotalWeight = 0;
	BenchWeightLshapeA = 0; // weight of Lshape Bench A
	BenchWeightLshapeB = 0; // weight of Lshape Bench B
	BenchWeightUshapeA = 0; // weight of U-shape Bench A
	CalculatedBenchtopCost = 0;
			
    var lineCount = getLineCount();

 if (lineCount != 0)
 { 		
	for(var ii = 0; ii <lineCount; ii++)
	{						
			var iProdID = parseInt(getLineItem(ii, colProductID));			
							
			iQty = parseFloat(getLineItem(ii, colQuantity));
			varWeight = parseFloat(getProduct(iProdID)[colProductWeight]);
			varQuantity = iQty			
			varProductType = checkProductType(iProdID,varStatistics,ii);
//			varProductCode = getProductInfo(iProdID)[colProductCode];      			
			varTotalWeight = Math.round(varTotalWeight + (varWeight * iQty));

//  ascertain longest size (either Height or Width) from Order details
             var iCustomFieldCount = getLineSubCount(ii, colCustomFields); 
			 
             if (iCustomFieldCount > 0) {			
	          for(var iCustomField = 0; iCustomField <iCustomFieldCount; iCustomField++)
	          {
			   varCustomFieldValues = parseInt(getLineSubItem(ii, colCustomFields, iCustomField));
               if (varProductType == "Kit-" || varProductType == "Door" || varProductType == "Pane" || varProductType == "Open" 
			    || varProductType == "Kick" || varProductType == "Hybr") {
			    if (iCustomField <= 2) {				  
				     if (varCustomFieldValues > varTotalLength) varTotalLength = varCustomFieldValues;
				}
			   }
			   	
	           if (varProductType ==  "Ward") {
					   if (iCustomField <= 5) {
					       if (varCustomFieldValues > varTotalLength) varTotalLength = varCustomFieldValues;
					   }
			   } 
			   
	           if (varProductType ==  "Benc") {
					   
					   if (iCustomField == 0 && iProdID > 215 && iProdID < 224) {
					      BenchtopParameters(ii, iProdID);
					      varTotalWeight = Math.round(varTotalWeight + BenchWeightUshapeA + BenchWeightLshapeA + BenchWeightLshapeB);
						  if (BenchLength > varTotalLength) varTotalLength = BenchLength;				  
                       }
					   else if (iCustomField <= 2 && (iProdID < 216 || iProdID > 223)) {
					     if (varCustomFieldValues > varTotalLength) varTotalLength = varCustomFieldValues;
					   }
			   } 			   			   			   
//
			  }
			 }
			 							       													
          }
// add in the Benchtop weight
   
	  return true;   			
   }
   else return false;

}

// Calculation of Long Haul Costs via TOLL with extra Discount for Queensland
//
function   CalculateLongHaul(varZone)
{

 arrayZoneCosts = getZoneCost(varZone);
 varBasicRate = arrayZoneCosts[colBasicRate];
 varVariableRate = arrayZoneCosts[colVariableRate];
 
  varLongHaulCost = Math.round(varInsurance + varAdminFee + (varVariableRate * varTotalWeight + varBasicRate) * varAddOn);
  
 //if(varZone.substring(0,3) == "QLD") {
//    if (varCurrentOrderPrice < 1500) varSubsidyRate = 0.05 * varCurrentOrderPrice;
//	else varSubsidyRate = 0.10 * varCurrentOrderPrice; 
//window.alert("varZone= " + varZone.substring(0,3) + " varVariableRate= " + varVariableRate + 

//   varLongHaulCost = Math.round(varLongHaulCost - varSubsidyRate);
//  }
  
return varLongHaulCost;
}

function getZoneCost(zoneName)
{

switch(zoneName)
	{

case  "NSW Central NSW": return nD(16.34,1.01);
case  "NSW Hunter Region NSW": return nD(16.34,0.9);
case  "NSW Newcastle": return nD(16.34,0.79);
case  "NSW North Coast NSW": return nD(16.34,1.13);
case  "NSW Riverina NSW": return nD(16.34,0.52);
case  "NSW South Coast NSW": return nD(16.34,0.87);
case  "NSW Sydney": return nD(16.34,0.41);
case  "NSW Western NSW": return nD(16.34,1.22);
case  "NSW Wollongong": return nD(16.34,0.75);
case  "NSW Albury/Wodonga": return nD(16.34,0.28);
case  "NT Alice Springs": return nD(19.71,1.18);
case  "NT Darwin": return nD(19.71,1.7);
case  "NT Northern Territory": return nD(34.81,3.15);
case  "QLD Brisbane": return nD(16.34,0.41);
case  "QLD Brisbane Outside CBD": return nD(16.34,0.42);
case  "QLD Cairns": return nD(16.34,1.50);
case  "QLD Cape York": return nD(31.01,5.09);
case  "QLD Central Coast QLD": return nD(16.34,1.50);
case  "QLD Mackay": return nD(16.34,1.00);
case  "QLD Northern Coast QLD": return nD(16.34,1.63);
case  "QLD Rockhampton": return nD(16.34,0.90);
case  "QLD South East QLD": return nD(16.34,0.42);
case  "QLD South East QLD (Outer)": return nD(19.71,1.40);
case  "QLD Townsville": return nD(16.34,1.14);
case  "QLD Western QLD": return nD(25.84,2.09);
case  "SA Adelaide": return nD(16.34,0.57);
case  "SA Mt. Gambier": return nD(16.34,0.99);
case  "SA North West SA": return nD(16.34,1.57);
case  "SA South East SA": return nD(16.34,0.31);
case  "TAS Hobart": return nD(16.34,2.22);
case  "TAS Launceston": return nD(16.34,1.82);
case  "TAS Tasmania (Rest)": return nD(23.63,2.81);
case  "VIC Inner VIC Country": return nD(19.71,0.94);
case  "VIC Melbourne": return nD(16.34,0.5);
case  "VIC Outer VIC Country": return nD(16.34,0.75);
case  "WA Broome": return nD(26.87,4.02);
case  "WA Central WA": return nD(20.49,2.16);
case  "WA Northern WA": return nD(26.87,6.07);
case  "WA Perth": return nD(16.34,0.6);
case  "WA Southern WA": return nD(16.34,0.69);
}

return nD(0.0,0.00);
}

/*
 *	Creates a new array with X elements, with the supplied argument value or default
 *
 */
function nD()
{
	var arrayZoneCosts = new Array(0,0);
	for (var x = 0; x < arguments.length; x++) 
	{
		arrayZoneCosts[x] = arguments[x];
	}
	return arrayZoneCosts;
}

// determine the Style Name of a Product

 function getProductStyle(iProdID,i)
 {
//    varProdStyle = "Lamin";   // default value
	varProductCode = getProductInfo(iProdID)[colProductCode];
	varProdName = getProductInfo(iProdID)[colProductDesc];	
	var iCustomFieldCount = getLineSubCount(i, colCustomFields); 	        
			if (iCustomFieldCount > 0)  {						
	          for (var iCustomField = 0; iCustomField <iCustomFieldCount; iCustomField++)
	          {	
			    var varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][iCustomField];
				var varCustomFieldValue = getLineSubItem(i, colCustomFields, iCustomField);								   
                if ((varCustomFieldNameCode > 594 && varCustomFieldNameCode < 600) || varCustomFieldNameCode == 605)
	               varProdStyle = varCustomFieldValue.substring(0,5);
	            var varStyle = varProdName.indexOf("HMR W");
			    if (varStyle > 0) varProdStyle = "Carca";
				if (varProductCode.substring(0,2) == "WR") varProdStyle = "Carca";
				if (varProductCode.substring(0,9) == "Panel-HMR") varProdStyle = "Carca";				
			  }
			}
			if (varDataInputMode == false) {
			  if (varSuffix == "a") varProdStyle = "Belmo";
			  else if (varSuffix == "b") varProdStyle = "Byron";
			  else if (varSuffix == "c") varProdStyle = "Alban";
			  else if (varSuffix == "d") varProdStyle = "Avoca";
			  else if (varSuffix == "e") varProdStyle = "Unfin";
			  else if (varSuffix == "z")  varProdStyle = "Lamin";
			  else if (varProductCode.substring(0,9) == "Panel-HMR") varProdStyle = "Carca";			  
			  else if (varSuffix != "x") varProdStyle = "Lamin";
			  
			  
			}
//alert("line 3293 -varProdStyle= " + varProdStyle + " i= " + i + " varSuffix= " + varSuffix + " varProductCode= " + varProductCode);						  						  					                			
	return varProdStyle;
}

//  Here we accumulate the various STYLE inputs when ever they have been made. ????

function checkStyleInput(i,iProdID)
{
     var varProdCode  = "Nil";		
	varProductCode = getProductInfo(iProdID)[colProductCode];
	varProdCode = varProductCode.substring(8,13);
	var iCustomFieldCount = getLineSubCount(i, colCustomFields);
	        
	  if (iCustomFieldCount > 0)  {
	    if (varProductCode.substring(0,1) == "3") varLaminate = varLaminate + 1;		
        if (varProductCode.substring(0,1) == "2" || varProductCode.substring(0,1) == "1") {			
 	          for(var iCustomField = 0; iCustomField <iCustomFieldCount; iCustomField++)
 	          {
 			   varCustomFieldValues = getLineSubItem(i, colCustomFields, iCustomField);
 			   if (varCustomFieldValues.substring(0,12) == "All Cabinets") {
    		     if (varDoorStyle1 == "Nil") varDoorStyle1 = varProdCode; 
			     else if (varDoorStyle2 == "Nil" && varProdCode != varDoorStyle1) varDoorStyle2 = varProdCode;
			     else if (varDoorStyle3 == "Nil" && varProdCode != varDoorStyle1 && varProdCode != varDoorStyle2) varDoorStyle3 = varProdCode;
				 				 				
				 if (varPanelStyle1 == "Nil") varPanelStyle1 = varProdCode;
    		     else if (varPanelStyle2 == "Nil" && varProdCode != varPanelStyle1) varPanelStyle2 = varProdCode;
				 else if (varPanelStyle3 == "Nil" && varProdCode != varPanelStyle1 && varProdCode!= varPanelStyle2) varPanelStyle3 = varProdCode;
				 				  
				 if (varOpenStyle1 == "Nil") varOpenStyle1 = varProdCode;
				 else if (varOpenStyle2 == "Nil" && varProdCode != varOpenStyle1) varOpenStyle2 = varProdCode;
				 else if (varOpenStyle3 == "Nil" && varProdCode != varOpenStyle1 && varProdCode != varOpenStyle2) varOpenStyle3 = varProdCode;
						 
				 if (varKickStyle1 == "Nil") varKickStyle1 = varProdCode;
				 else if (varKickStyle2 == "Nil" && varProdCode != varKickStyle1) varKickStyle2 = varProdCode;
				 else if (varKickStyle3 == "Nil" && varProdCode != varKickStyle1 && varProdCode != varKickStyle2) varKickStyle3 = varProdCode;				 				 						
               }
			 
 			   if (varCustomFieldValues.substring(0,5) == "Doors") {
    		     if (varDoorStyle1 == "Nil") varDoorStyle1 = varProdCode; 
			     else if (varDoorStyle2 == "Nil" && varProdCode != varDoorStyle1) varDoorStyle2 = varProdCode;
			     else if (varDoorStyle3 == "Nil" && varProdCode != varDoorStyle1 && varProdCode != varDoorStyle2) varDoorStyle3 = varProdCode;
				 
				 if (varOpenStyle1 == "Nil") varOpenStyle1 = varProdCode;
				 else if (varOpenStyle2 == "Nil" && varProdCode != varOpenStyle1) varOpenStyle2 = varProdCode;
				 else if (varOpenStyle3 == "Nil" && varProdCode != varOpenStyle1 && varProdCode != varOpenStyle2) varOpenStyle3 = varProdCode;				 				 								
               }			 

			  if (varCustomFieldValues.substring(0,11) == "Panels only") {
    		     if (varPanelStyle1 == "Nil") varPanelStyle1 = varProdCode;
    		     else if (varPanelStyle2 == "Nil" && varProdCode != varPanelStyle1) varPanelStyle2 = varProdCode;
				 else if (varPanelStyle3 == "Nil" && varProdCode != varPanelStyle1 && varProdCode != varPanelStyle2) varPanelStyle3 = varProdCode;				 								
              }			 			 
			 
			  if (varCustomFieldValues.substring(0,15) == "Kickboards only") {			 
				 if (varKickStyle1 == "Nil") varKickStyle1 = varProdCode;
				 else if (varKickStyle2 == "Nil" && varProdCode != varKickStyle1) varKickStyle2 = varProdCode;
				 else if (varKickStyle3 == "Nil" && varProdCode != varKickStyle1 && varProdCode != varKickStyle2) varKickStyle3 = varProdCode;				 						
              }
			  
			  if (varCustomFieldValues.substring(0,15) == "Open Units only") {
				 if (varOpenStyle1 == "Nil") varOpenStyle1 = varProdCode;
				 else if (varOpenStyle2 == "Nil" && varProdCode != varOpenStyle1) varOpenStyle2 = varProdCode;
				 else if (varOpenStyle3 == "Nil" && varProdCode != varOpenStyle1 && varProdCode != varOpenStyle2) varOpenStyle3 = varProdCode;			  }			  			 
 		} 
	   }   
	 } 		 			   						   			   								  					
}


//  this function determines Product Type (Cabinet, Doors, Panels, Wardrobe insert, Benchtop etc.)
// also it (again) determines Product Style and creates a Product Style matrix
//   and also accumulates Product-type totals for display in the DELIVERY product

function checkProductType(iProdID,varStatistics,i)
{
var varHeight = 750;  //default values
var varWidth = 600;
var varRange = "base";
// window.alert("iProdIDLast= " + iProdIDLast + " " + iProdID);
//if (varStatistics == true) {
  varProductCode = getProductInfo(iProdID)[colProductCode];
  varProductDesc = getProductInfo(iProdID)[colProductDesc];
     
  if (varProductCode.substring(0,1) == "c"){
      varProductType = "Carc";
      varCarcass = true;
	  if(varStatistics == true) CarcassUnits = CarcassUnits + varQuantity;
   }
  else {
     if (varProductCode.substring(0,2) == "BT") {
	   varProductType = "Benc";
	   varBenchtop = true;
	   if(varStatistics == true && (varProductCode.substring(0,3) == "BTS" || varProductCode.substring(0,3) == "BTD" || varProductCode.substring(0,3) == "BTU" || varProductCode.substring(0,4) == "BTLA" || varProductCode.substring(0,4) == "BTLB" || varProductCode.substring(0,4) == "BTLC" || varProductCode.substring(0,4) == "BTLD")) Benchtops = Benchtops + varQuantity;
	 }  
	else {
	  if (varProductCode.substring(0,2) == "WR" || varProductCode.substring(0,2) == "RV" ) {
	     varProductType = "Ward";
	     varWardrobe = true;
		 if(varStatistics == true) Wardrobes = Wardrobes + varQuantity;
		 if (varProductCode.substring(0,4) == "WRCS" || varProductCode.substring(0,2) == "RV") varProductType = "Hybr";
		 if (varProductCode.substring(0,4) != "WRCS") {
		 	varHeight = parseInt(getLineSubItem(i, colCustomFields, 3));
			varWidth = parseInt(getLineSubItem(i, colCustomFields, 4));
			varDimension1 = 2000;
		    if (varWidth < 301) varDimension2 = 300;
			else if (varWidth < 601) varDimension2 = 600;
			else varDimension2 = 1000;
			
			if (varProductCode.substring(0,4) == "WRD2" || varProductCode.substring(0,4) == "WRD3" || varProductCode.substring(0,4) == "WRD4" || varProductCode.substring(0,4) == "WRD5") {
				if (varWidth < 401) varDimension2 = 400;
				else if (varWidth < 601) varDimension2 = 600;
				else varDimension2 = 900;
		    }
         }
		 if (varProductCode.substring(0,4) == "WRCS") {
		   	varHeight = parseInt(getLineSubItem(i, colCustomFields, 0));
			varWidth  = parseInt(getLineSubItem(i, colCustomFields, 1));
				if (varHeight < 1801) varDimension1 = 1800;
				else if (varHeight < 2001) varDimension1 = 2000;
				else  varDimension1 = 2350;
            varDimension2 = 1000;
		 }
	  }
	  else {
	     if (varProductCode.substring(0,4) == "Kick") {
		    varProductType = "Kick";
		    varKickboard = true;
			if(varStatistics == true) Kickboards = Kickboards + varQuantity;
			varHeight = parseInt(getLineSubItem(i, colCustomFields, 0));
			varWidth = parseInt(getLineSubItem(i, colCustomFields, 1));

		    varDimension1 = 200;	
			if (varWidth < 301) varDimension2 = 300;
			else if (varWidth < 501) varDimension2 = 500;
			else if (varWidth < 751) varDimension2 = 750;
			else if (varWidth < 901) varDimension2 = 900;
			else if (varWidth < 1051) varDimension2 = 1050;
			else if (varWidth < 1201) varDimension2 = 1200;
			else if (varWidth < 1501) varDimension2 = 1500;
			else if (varWidth < 1801) varDimension2 = 1800;
			else if (varWidth < 2101) varDimension2 = 2100;
			else  varDimension2 = 2350;
					
			getProductStyle(iProdID,i);
			if (varProdStyle != "Nil") {

			   varHeight = parseInt(getLineSubItem(i, colCustomFields, 0));
			   varWidth = parseInt(getLineSubItem(i, colCustomFields, 1)); 
	
			   if (ProductKickStyle1 == "Nil") ProductKickStyle1 = varProdStyle;
			   else if(ProductKickStyle2 == "Nil" && varProdStyle != ProductKickStyle1) ProductKickStyle2 = varProdStyle;
			   else if(ProductKickStyle3 == "Nil" && varProdStyle != ProductKickStyle1 && varProdStyle != ProductKickStyle2) ProductKickStyle3 = varProdStyle;
			} 
		  }
		 else { 
		   if (varProductCode.substring(0,4) == "Door") {
		       varProductType = "Door";
		       varDoor = true;
			   if (varHeight < 401) varDimension1 = 400;
			   else if (varHeight < 601)  varDimension1 = 600;
			   else if (varHeight < 751)  varDimension1 = 750;
			   else if (varHeight < 901)  varDimension1 = 900;
			   else if (varHeight < 1201) varDimension1 = 1200;
			   else if (varHeight < 1451) varDimension1 = 1450;
			   else if (varHeight < 1801) varDimension1 = 1800;
	           else if (varHeight < 2101) varDimension1 = 2100;
			   else  varDimension1 = 2350;
	
			   if (varWidth < 301) varDimension2 = 300;
	           else if (varWidth < 401) varDimension2 = 400;
	           else if (varWidth < 501) varDimension2 = 500;
	           else  varDimension2 = 600;
			   
			   getProductStyle(iProdID,i);
			   if (varProdStyle != "Nil") {
			     if(varStatistics == true) ExtraDoors = ExtraDoors + varQuantity;
				 if (ProductDoorStyle1 == "Nil") ProductDoorStyle1 = varProdStyle;
				 else if(ProductDoorStyle2 == "Nil" && varProdStyle != ProductDoorStyle1) {
				       ProductDoorStyle2 = varProdStyle;
//					   alert("3469 varProdStyle= " + varProdStyle + "  varProductType= " +  varProductType);
					   }
				 else if(ProductDoorStyle3 == "Nil" && varProdStyle != ProductDoorStyle1 && varProdStyle != ProductDoorStyle2) ProductDoorStyle3 = varProdStyle;
				} 
		   }
		   else {
		     if (varProductCode.substring(0,4) == "Pane") {
			    varProductType = "Pane";
			    varPanel = true;
				getProductStyle(iProdID,i);
				varHeight = parseInt(getLineSubItem(i, colCustomFields, 0));
				varWidth = parseInt(getLineSubItem(i, colCustomFields, 1));

				if (varHeight < 201) varDimension1 = 200;
				else if (varHeight < 401)  varDimension1 = 400;
				else if (varHeight < 601)  varDimension1 = 600;
				else if (varHeight < 751)  varDimension1 = 750;
				else if (varHeight < 901) varDimension1 = 900;
				else if (varHeight < 1201) varDimension1 = 1200;
				else if (varHeight < 1451) varDimension1 = 1450;
				else if (varHeight < 1801) varDimension1 = 1800;
				else if (varHeight < 2101) varDimension1 = 2100;
				else if (varHeight < 2351) varDimension1 = 2350;
				else  varDimension1 = 2350;
	
				if (varWidth < 301) varDimension2 = 300;
				else if (varWidth < 401) varDimension2 = 400;
				else if (varWidth < 501) varDimension2 = 500;
				else if (varWidth < 601) varDimension2 = 600;
				else if (varWidth < 751) varDimension2 = 750;
				else if (varWidth < 901) varDimension2 = 900;
				else if (varWidth < 1051) varDimension2 = 1050; 
				else  varDimension2 = 1200;
				if (varProdStyle != "Nil" && varProdStyle != "Carc") {
					if (ProductPanelStyle1 == "Nil") ProductPanelStyle1 = varProdStyle;
				    else if(ProductPanelStyle2 == "Nil" && varProdStyle != ProductPanelStyle1) ProductPanelStyle2 = varProdStyle;
				  	else if(ProductPanelStyle3 == "Nil" && varProdStyle != ProductPanelStyle1 && varProdStyle != ProductPanelStyle2) ProductPanelStyle3 = varProdStyle;
				}
				if(varStatistics == true) Panels = Panels + varQuantity;
			  }
			 else {
			   if (varProductCode.substring(0,4) == "Hand") {
			       varProductType = "Hand";
			       varHandles = true;
				   if(varStatistics == true) Handles = Handles + varQuantity;
			    }
				
				else {
			       if (varProductCode.substring(0,4) == "Hard") {
			          varProductType = "Hard";
			          varHardware = true;
				      if(varStatistics == true) Hardware = Hardware + varQuantity;
			       }
				
			      else  {
			        if (varProductDesc.indexOf("Open") > 0) {
					    varProductType = "Open";
					    varOpenUnit = true;
						getProductStyle(iProdID,i);
									 varHeight = parseInt(getLineSubItem(i, colCustomFields, 0));
									 varWidth = parseInt(getLineSubItem(i, colCustomFields, 1)); 
	
								    if (varProductCode.substring(0,3) == "MW/" )  varDimension1 = 500;
									else if (varProductCode.substring(0,3) == "BO-" && varHeight < 751) varDimension1 = 750;
									else if (varProductCode.substring(0,3) == "BO-" && varHeight < 1001) varDimension1 = 900;
									else if ((varProductCode.substring(0,3) == "BOA" || varProductCode.substring(0,3) == "WO-" ||
									 varProductCode.substring(0,3) == "WDO") && varHeight < 901) varDimension1 = 900;										 
									else if ((varProductCode.substring(0,3) == "BOA" || varProductCode.substring(0,3) == "WO-" || 
												varProductCode.substring(0,3) == "WDO") && varHeight < 1201) varDimension1 = 1200;
									else if (varHeight < 751)  varDimension1 = 500;													 
									else  varDimension1 = 900;
	
									if (varWidth < 401) varDimension2 = 400;
									else if (varWidth < 501) varDimension2 = 500;
									else if (varWidth < 601) varDimension2 = 600;
									else if (varWidth < 701) varDimension2 = 700;
									else if (varWidth < 801) varDimension2 = 800;
									else if (varWidth < 901) varDimension2 = 900;
									else if (varWidth < 1001) varDimension2 = 1000;
									else if (varWidth < 1101) varDimension2 = 1100;
									else  varDimension2 = 1200;
									 if (varProdStyle != "Nil") {
				   						if (ProductOpenStyle1 == "Nil") ProductOpenStyle1 = varProdStyle;
				  					    else if(ProductOpenStyle2 == "Nil" && varProdStyle != ProductOpenStyle1) ProductOpenStyle2 = varProdStyle;
				  						else if(ProductOpenStyle3 == "Nil" && varProdStyle != ProductOpenStyle1 && varProdStyle != ProductOpenStyle2) ProductOpenStyle3 = varProdStyle;
									 }						
						if(varStatistics == true) OpenUnits = OpenUnits + varQuantity;
					}
					else {
					   if (varProductCode.substring(0,1) >= "0" && varProductCode.substring(0,1) <= "9" )
					   {
					       varProductType = "Styl";
                           varStyle = true;

						   if (varProductCode.substring(0,1) == "3") varBenchtopStyle = true;
					   }
					   else {
					    if (varProductCode.substring(0,2) == "zz") {
						    varProductType = "Disc";
//						    varDiscountRequest = true;
						}
						else {
						  if (varProductCode.substring(0,2) == "zP" || varProductCode.substring(0,2) == "zD" || varProductCode.substring(0,2) == "zK" 
						   || varProductCode.substring(0,6) == "Outlet") {
						      varProductType = "Deli";
							  if (varProductCode.substring(0,6) == "Outlet") varProductType = "Outl";
							  if (varProductCode.substring(0,3) == "zP-") varProductType = "Outl";
							  if (varProductCode.substring(0,3) == "zK-") varProductType = "Outl";
						  }
						  
						  else {
	     						if (varProductCode.substring(0,4) == "Fill") {
		                          varProductType = "Pane";
		                          varPanel = true;
								  getProductStyle(iProdID,i);
								  varHeight = parseInt(getLineSubItem(i, colCustomFields, 0));
								  varWidth = parseInt(getLineSubItem(i, colCustomFields, 1)); 
	
								if (varHeight < 751) varDimension1 = 750;
								else if (varHeight < 1201) varDimension1 = 1200;
								else if (varHeight < 1801) varDimension1 = 1800;
								else  varDimension1 = 2350;
	
 								varDimension2 = 100;
								 getProductStyle(iProdID);
									 if (varProdStyle != "Nil") {
				   						if (ProductPanelStyle1 == "Nil") ProductPanelStyle1 = varProdStyle;
				  					    else if(ProductPanelStyle2 == "Nil" && varProdStyle != ProductPanelStyle1) ProductPanelStyle2 = varProdStyle;
				  						else if(ProductPanelStyle3 == "Nil" && varProdStyle != ProductPanelStyle1 && varProdStyle != ProductPanelStyle2) ProductPanelStyle3 = varProdStyle;
									 }
			                      if (varStatistics == true) Fillers = Fillers + varQuantity;
		                        }
						  
				                else { 								
						             varProductType = "Kit-";									 
								     varCabinet = true;        // check for WallUnits  now but excluding OpenUnits
									 getProductStyle(iProdID,i);
									 varHeight = parseInt(getLineSubItem(i, colCustomFields, 0));
									 varWidth = parseInt(getLineSubItem(i, colCustomFields, 1));
									 var varWidthRH = varWidth;
									 if (varProductCode.substring(0,3) == "BC-" || varProductCode.substring(0,3) == "WC-"|| varProductCode.substring(0,3) == "BB4" || varProductCode.substring(0,3) == "WB4") 
										varWidthRH = parseInt(getLineSubItem(i, colCustomFields, 2));
	            					 if (varWidthRH > varWidth) varWidth = varWidthRH;
													 								 
	                                 if (varProductCode.substring(0,3) == "B-D" || varProductCode.substring(0,3) == "BDr" || varProductCode.substring(0,3) == "BD-" || varProductCode.substring(0,3) == "BC-" || varProductCode.substring(0,3) == "BCA" || varProductCode.substring(0,3) == "BB4" || varProductCode.substring(0,3) == "BCD" || varProductCode.substring(0,3) == "UBO"  ) varRange = "base";
									 else if (varProductCode.substring(0,3) == "W-D" || varProductCode.substring(0,3) == "BOA" || varProductCode.substring(0,3) == "BDr" || varProductCode.substring(0,3) == "WC-" ||  varProductCode.substring(0,3) == "WO-" || varProductCode.substring(0,3) == "WD-" || varProductCode.substring(0,3) == "WDO" || varProductCode.substring(0,3) == "WB4" || varProductCode.substring(0,3) == "BDr" || varProductCode.substring(0,3) == "cWC" || varProductCode.substring(0,3) == "RH-") 
									    varRange = "wall";
									 
									 else if (varProductCode.substring(0,3) == "WOM" || varProductCode.substring(0,3) == "WOD") 
									 		varRange = "oven";
									 else if (varProductCode.substring(0,3) == "P-D" || varProductCode.substring(0,3) == "PC-" || varProductCode.substring(0,3) == "PD-" || varProductCode.substring(0,1) == "L") varRange = "pant";
									 else varRange = "unkn";
									 
									 if(varProductCode.substring(0,3) == "UBO") varDimension1 = 800;
									 else if ((varRange == "base" || varRange == "wall") && varHeight < 751) varDimension1 = 750;
									 else if(varRange == "base" && varHeight < 1001) varDimension1 = 900;
									 else if(varRange == "wall" && varHeight < 901 && varProductCode.substring(0,3) != "WD-")
									     varDimension1 = 900;
									 else if(varRange == "wall" && varHeight < 1201 && varProductCode.substring(0,3) == "RH-") 
									      varDimension1 = 900;												 
									 else if(varRange == "wall" && varHeight < 1201 && varProductCode.substring(0,3) != "RH-") 
									      varDimension1 = 1200;
									 else if((varRange == "pant" || varRange == "oven") && varHeight < 2151) varDimension1 = 2150;
									 else if((varRange == "pant" || varRange == "oven") && varHeight < 2400) varDimension1 = 2350;
									 else varDimension1 = 750;
	
									 if ((varProductCode.substring(0,3) == "BC-" || varProductCode.substring(0,3) == "BCA" 
									      || varProductCode.substring(0,3) == "WC-" || varProductCode.substring(0,3) == "WD-" 
										  || varProductCode.substring(0,3) == "BB4" || varProductCode.substring(0,3) == "WB4" 
										  || varProductCode.substring(0,3) == "RH-" || varRange == "oven") && varWidth < 601)
										            varDimension2 = 600;					 						 
 									 else if ((varProductCode.substring(0,3) == "BC-" || varProductCode.substring(0,3) == "BCA" 
									 	|| varProductCode.substring(0,3) == "WC-" || varProductCode.substring(0,3) == "RH-") 
										&& varWidth < 701)  varDimension2 = 700;
									 else if(varRange == "oven" && varWidth < 1001)  varDimension2 = 700; 										 						 
 									 else if ((varProductCode.substring(0,3) == "BC-" || varProductCode.substring(0,3) == "WCA" 
									 || varProductCode.substring(0,3) == "WC-" || varProductCode.substring(0,3) == "RH-" 
									 || varProductCode.substring(0,1) == "L")  && varWidth < 1001)              varDimension2 = 900;
									 else if (varProductCode.substring(0,4) == "BCD1"  && varWidth < 401)       varDimension2 = 400;
									 else if (varProductCode.substring(0,8) == "BCD2Drw1" && varWidth > 801) varDimension2 = 900;									 						 
									 else if (varProductCode.substring(0,3) == "WD-" && varWidth <1200) varDimension2 = 1200;
									 else if (varProductCode.substring(0,3) == "PD-") varDimension2 = 1000;
									 else if (varProductCode.substring(0,3) == "UBO" && varWidth > 801) varDimension2 = 900;
									 else if (varWidth > 600 && varRange == "oven") varDimension2 = 700;						 															 
															 															 
									 else if (varWidth < 301 && varRange != "pant" && varRange != "micr") varDimension2 = 300;
									 else if (varWidth < 401 && varRange != "pant" && varRange != "micr") varDimension2 = 400;
									 else if (varWidth < 501 && varRange != "micr") varDimension2 = 500;
									 else if (varWidth < 601) varDimension2 = 600;
									 else if (varWidth < 701) varDimension2 = 700;
									 else if (varWidth < 801) varDimension2 = 800;
									 else if (varWidth < 901) varDimension2 = 900;
									 else if (varWidth > 900 && varProductCode.substring(0,3) == "P-D") varDimension2 = 900;
									 else if (varWidth < 1001) varDimension2 = 1000;
									 else if (varWidth < 1101) varDimension2 = 1100;									 	 								 
									 else if (varWidth < 1201) varDimension2 = 1200;
									 else  varDimension2 = 900;									 									 
									 if (varProdStyle != "Nil") {
				   						if (ProductDoorStyle1 == "Nil") ProductDoorStyle1 = varProdStyle;
				  					    else if(ProductDoorStyle2 == "Nil" && varProdStyle != ProductDoorStyle1) ProductDoorStyle2 = varProdStyle;
				  						else if(ProductDoorStyle3 == "Nil" && varProdStyle != ProductDoorStyle1 && varProdStyle != ProductDoorStyle2)
										                    ProductDoorStyle3 = varProdStyle;
										
//window.alert("line 3581 - ProductDoorStyle1= " + ProductDoorStyle1 + " ProductDoorStyle2= " + ProductDoorStyle2 + " ProductDoorStyle3= " + ProductDoorStyle3 + " ProductKickStyle1= " + ProductKickStyle1);
										
										
									 }
						             if(varProductCode.substring(0,1) == "W" || varProductCode.substring(0,1) == "R" || varProductCode.substring(0,1) == "M") {
									     if(varStatistics == true) WallUnits = WallUnits + varQuantity;
									 } 
									   else  if(varStatistics == true) FloorUnits = FloorUnits + varQuantity;
									 					
						     	}	
						      }
                           }						 
					    }
					  }
			        }    
				 }				 			   
			   }
		   }
		 }
	  }
	}
  } 
 //}
					 
 iProdIDLast =iProdID
//alert("line 3596 varDimension1 = " + varDimension1 + " varDimension2 = " + varDimension2 + " varHeight= " + varHeight + " varWidth= " + varWidth + "varProductCode= " + varProductCode + " varRange=  " + varRange);
  return varProductType;
}



// Checking of Total Order after pressing "t" button in "ViewCart"

function CheckShoppingList()
{ 
  varCheckShoppingList = 1;
  CalculateOrderTotals()  
  CalculateOrderWeight()
  
  if(varInvalidProduct == true || varErrorType > 0) {
     window.alert(" You still have an invalid Product specification in your Shopping Cart and you CAN NOT proceed past [Checkout] to SUBMIT this Order. Please [REMOVE] it and then RE-ENTER its details");
	 return;
  }
//Check WardRobes that each unique ROOM/WALL  has one Section [A] and [A] is followed by [B], [C] etc
  sortedwardrobe = wardrobe.sort();
  
//  alert("line 3615 sorted wardrobe data= " + sortedwardrobe[0] + "," + sortedwardrobe[1] + "," + sortedwardrobe[2] + "," + sortedwardrobe[3] + "," + sortedwardrobe[4] + "," + sortedwardrobe[5] + "," + sortedwardrobe[6] + "," + sortedwardrobe[7] + "," + sortedwardrobe[8] + sortedwardrobe[9] + sortedwardrobe[10]  + sortedwardrobe[11]  + sortedwardrobe[12]  + sortedwardrobe[13] + sortedwardrobe[14]);
 if (sortedwardrobe[0].substring(0,3) != "ZZZ" ) {
  X = 0;
  Y = 0;
// check that the first Sorted Wardrobe entry has a Section = "A"
 if (sortedwardrobe[0].substring(12,13) != sections[0]) {
    wardrobeError(sortedwardrobe[X].substring(12,13),sections[Y]);
		location.replace("viewcart.htm");
		             return;
 }  

  for ( X = 1; X< 24; X++) {
	if (sortedwardrobe[X].substring(0,3) == "ZZZ") break; 
      if (sortedwardrobe[X].substring(0,12) == sortedwardrobe[X-1].substring(0,12)) {
          if (Y != "H") Y = Y + 1;
          if (sortedwardrobe[X].substring(12,13) != sections[Y]) {
			wardrobeError(sortedwardrobe[X].substring(0,12),sections[Y]);
				location.replace("viewcart.htm");
		             return;
          } 
      }
      else {
          Y = 0;
	      if (sortedwardrobe[X].substring(12,13) != sections[Y]) {
			wardrobeError(sortedwardrobe[X].substring(0,12),sections[Y]);
				location.replace("viewcart.htm");
		             return;
	      } 
    }
   
    }
 }
        if (varButtJoin != 0 && varButtJoin != 2 && varButtJoin != 4) {
window.alert(" There are normally two sides to a BUTT join but you specified only an uneven number, Each actual Benchtop MUST have BOTH of these products with the SAME [Unique Bench Identifyer] - i.e [A] or [B] etc. as that Benchtop. Click [OK] to go back to the View Cart to find which Benchtop is missing one or both of the END Finish products and then ADD in the correct END Finish from the Benchtop section")
				     varFieldCheck = 1;
	                 location.replace("viewcart.htm");
		             return;	
             } 
	 	 	 
	          if (varMaleJoin != varFemaleJoin) {
window.alert(" You specified " + varMaleJoin + " MALE joins and " + varFemaleJoin + " FEMALE joins - we need one of each for a proper join - Each actual Benchtop MUST have BOTH of these products with the SAME [Unique Bench Identifyer] - i.e [A] or [B] etc. as that Benchtop. Click [OK] to go back to the View Cart to find which Benchtop is missing one of the END Finish products and then ADD in the correct END Finish from the Benchtop section");	 
	                 location.replace("viewcart.htm");
		             return;	
	          }
			  
			  if (varBTNumber > 0) {
			   varEndFinishNumber = varBTNumber * 2 - varMaleJoin - varFemaleJoin - varButtJoin - varEndNumber;
//window.alert("varBTNumber= " + varBTNumber + " varMaleJoin= " + varMaleJoin + " varFemaleJoin= " + varFemaleJoin + " varButtJoin= " + varButtJoin + " varEndNumber= " + varEndNumber);	
			   if (varEndFinishNumber > 0) {
	window.alert(" You missed specifying the finishing for " + varEndFinishNumber + " of the short END side(s)for the Bench Top(s) shown on the Shopping List (see Viewcart) - Each actual Benchtop MUST have BOTH of these products with the SAME [Unique Bench Identifyer] - i.e [A] or [B] etc. as that Benchtop. Click [OK] to go back to the View Cart to find which Benchtop is missing one of the END Finish products and then ADD in the correct END Finish from the Benchtop section");
	                 location.replace("viewcart.htm");
					varFieldCheck = 1;
		             return;
			   }	
              }
			  
              if (varBTNumber > 0 && varEndFinishNumber < 0) {
 window.alert(" Somehow you specified " + varEndFinishNumber * -1 + " too many End Machining operations ---- Please review your Shopping List (in Viewcart) and remove the duplicates"); 
 					varFieldCheck = 1;
		             return;               	
              }			  			  			  			  			  	
  			  

     if (varBenchtop == true && varBenchtopStyle == false ) {
      varConfirm=window.confirm(" You now need to add a Colour for your Bench top Laminate - If you don't know as yet then just select 'TBA' when in the selection area.---Click [OK] to now go to the 'Benchtop LAMINATE' page to do this or [CANCEL] to add more products first");
	    if (varConfirm == true) {
	      varFieldCheck = 1;
         location.replace("category406_1.htm");
		  return;
	    }
		varFatalError = true;  
	}	
 
     if (varNoPanel == false && varCabinet == true ) {
	    if (varPanel == false) {
window.alert("You did not specify any Coloured 'seen' End or SIDE PANELS  - this may be an oversight or intentional. At this stage of processing we like to be certain so you will be transferred to the Panels page to add Specifications or [No Panel Requird]");
	      varFieldCheck = 1;
	     location.replace("category1000011_1.htm");
		 return;
	    }	
	}
	  
    if (varNoKick == false && varCabinet == true ) {
		  if (varKickboard == false) {
window.alert("You did not specify any Kickboards - this may be an oversight or intentional. At this stage of processing we like to be certain so you will be transferred to the Kickboards page to add Specifications or [No Kickboard Required]");
	      varFieldCheck = 1;
	     location.replace("category1002111_1.htm");
		 return;
	    }	
	}


			if (varDoorStyle1 == "Nil" && varPanelStyle1 == "Nil" && varOpenStyle1 == "Nil" && varKickStyle1 == "Nil" && (varCabinet == true || varPanel == true)) {
varConfirm=window.confirm("A COLOUR/PROFILE scheme MUST be supplied to cover your Cabinets and Panels --- Click [OK] to go to COLOUR & Profiles ----- otherwise Click [CANCEL] to add additional products");

                 if (varConfirm == true) { 
	                 varFieldCheck = 1;
	                 location.replace("category259_1.htm");
		             return;
	             }
				 varFatalError = true;
           }
  		   
		   			
//window.alert("3716 Check on Product Styles - ProductDoorStyle1= " + ProductDoorStyle1 + " ProductDoorStyle2= " + ProductDoorStyle2 + " ProductDoorStyle3= " + ProductDoorStyle3 + " ProductKickStyle1= " + ProductKickStyle1 + " ProductKickStyle2= " + ProductKickStyle2 + " ProductPanelStyle1= " + ProductPanelStyle1 + " ProductPanelStyle2= " + ProductPanelStyle2 + " varDoorStyle1+2= " + varDoorStyle1 + " " + varDoorStyle2 + " varKickStyle1= " + varKickStyle1 + " varKickStyle2= " + varKickStyle2 + " varPanelStyle1= " + varPanelStyle1 +  " varPanelStyle2= " + varPanelStyle2);

// Check on Match of ProductStyles to Style Records
      if (ProductDoorStyle1 != "Nil" && (ProductDoorStyle1 != varDoorStyle1 && ProductDoorStyle1 != varDoorStyle2 && ProductDoorStyle1 != varDoorStyle3)) {

	 varFullProductStyle = transformProductStyle(ProductDoorStyle1);
varConfirm=window.confirm("You have one or more products with DOORS or DRAWER FRONTS in the material " + varFullProductStyle + varDescription1);
				 if (varConfirm == true) { 
	                 varFieldCheck = 1;
	                 returnaddress(varFullProductStyle);
		             return;
	             }
				 varFatalError = true;
     }
	
     if (ProductDoorStyle2 != "Nil" && (ProductDoorStyle2 != varDoorStyle1 && ProductDoorStyle2 != varDoorStyle2 && ProductDoorStyle2 != varDoorStyle3)) {
	  varFullProductStyle = transformProductStyle(ProductDoorStyle2);
varConfirm=window.confirm("You have listed another product with DOORS or DRAWER FRONTS in the " + varFullProductStyle + varDescription1);
				 if (varConfirm == true) { 
	                 varFieldCheck = 1;
	                 returnaddress(varFullProductStyle);
		             return;
	             }
				 varFatalError = true;
    }  
     
	 if (ProductDoorStyle3 != "Nil" && (ProductDoorStyle3 != varDoorStyle1 && ProductDoorStyle3 != varDoorStyle2 && ProductDoorStyle3 != varDoorStyle3)) {
	 	  varFullProductStyle = transformProductStyle(ProductDoorStyle3);
varConfirm=window.confirm("You have listed one or more products with DOORS or DRAWER FRONTS in the " + varFullProductStyle + varDescription1);
 				 if (varConfirm == true) { 
	                 varFieldCheck = 1;
	                  returnaddress(varFullProductStyle);
		             return;
	             }
				 varFatalError = true;
     }                 	  		   		                  	  

      if (ProductPanelStyle1 != "Nil" && ProductPanelStyle1 != "Carca" && (ProductPanelStyle1 != varPanelStyle1 && ProductPanelStyle1 != varPanelStyle2 && ProductPanelStyle1 != varPanelStyle3)) {
	 varFullProductStyle = transformProductStyle(ProductPanelStyle1);
     varConfirm=window.confirm("You have listed one or more PANELS in the " + varFullProductStyle + varDescription1);
				 if (varConfirm == true) { 
	                 varFieldCheck = 1;
	                  returnaddress(varFullProductStyle);
		             return;
	             }
				 varFatalError = true;
     }
	
     if (ProductPanelStyle2 != "Nil" && ProductPanelStyle2 != "Carca" && (ProductPanelStyle2 != varPanelStyle1 && ProductPanelStyle2 != varPanelStyle2 && ProductPanelStyle2 != varPanelStyle3)) {
	  varFullProductStyle = transformProductStyle(ProductPanelStyle2);
      varConfirm=window.confirm("You have listed one or more PANELS in the " + varFullProductStyle + varDescription1);
				 if (varConfirm == true) { 
	                 varFieldCheck = 1;
	                  returnaddress(varFullProductStyle);
		             return;
	             }
				 varFatalError = true;
    }  
     
	 if (ProductPanelStyle3 != "Nil" && ProductPanelStyle3 != "Carca" && (ProductPanelStyle3 != varPanelStyle1 && ProductPanelStyle3 != varPanelStyle2 && ProductPanelStyle3 != varPanelStyle3)) {
	 	  varFullProductStyle = transformProductStyle(ProductPanelStyle3);
varConfirm=window.confirm("You have listed one or more PANELS in the " + varFullProductStyle + varDescription1);
 				 if (varConfirm == true) { 
	                 varFieldCheck = 1;
	                  returnaddress(varFullProductStyle);
		             return;
	             }
				 varFatalError = true;
     }                 	 
	
     if (ProductKickStyle1 != "Nil" && (ProductKickStyle1 != varKickStyle1 && ProductKickStyle1 != varKickStyle2 && ProductKickStyle1 != varKickStyle3)) {
	 varFullProductStyle = transformProductStyle(ProductKickStyle1);
varConfirm=window.confirm("You have listed one or more KICKBOARDS in the " + varFullProductStyle + varDescription1);
				 if (varConfirm == true) { 
	                 varFieldCheck = 1;
	                  returnaddress(varFullProductStyle);
		             return;
	             }
				 varFatalError = true;
     }
	
     if (ProductKickStyle2 != "Nil" && (ProductKickStyle2 != varKickStyle1 && ProductKickStyle2 != varKickStyle2 && ProductKickStyle2 != varKickStyle3)) {
	  varFullProductStyle = transformProductStyle(ProductKickStyle2);
varConfirm=window.confirm("You have listed one or more KICKBOARDS in the " + varFullProductStyle + varDescription1);
				 if (varConfirm == true) { 
	                 varFieldCheck = 1;
	                  returnaddress(varFullProductStyle);
		             return;
	             }
				 varFatalError = true;
    }  
     
	 if (ProductKickStyle3 != "Nil" && (ProductKickStyle3 != varKickStyle1 && ProductKickStyle3 != varKickStyle2 && ProductKickStyle3 != varKickStyle3)) {
	 	  varFullProductStyle = transformProductStyle(ProductKickStyle3);
varConfirm=window.confirm("You have listed one or more KICKBOARDS in the " + varFullProductStyle + varDescription1);
 				 if (varConfirm == true) { 
	                 varFieldCheck = 1;
	                  returnaddress(varFullProductStyle);
		             return;
	             }
				 varFatalError = true;
     }                 	 
				
		
     if (ProductOpenStyle1 != "Nil" && (ProductOpenStyle1 != varOpenStyle1 && ProductOpenStyle1 != varOpenStyle2 && ProductOpenStyle1 != varOpenStyle3)) {
	 varFullProductStyle = transformProductStyle(ProductOpenStyle1);
varConfirm=window.confirm("You have listed one or more OPEN UNITS in the " + varFullProductStyle + varDescription1);
				 if (varConfirm == true) { 
	                 varFieldCheck = 1;
	                 returnaddress(varFullProductStyle);
		             return;
	             }
				 varFatalError = true;
     }
	
     if (ProductOpenStyle2 != "Nil" && (ProductOpenStyle2 != varOpenStyle1 && ProductOpenStyle2 != varOpenStyle2 && ProductOpenStyle2 != varOpenStyle3)) {
	  varFullProductStyle = transformProductStyle(ProductOpenStyle2);
varConfirm=window.confirm("You have listed one or more OPEN UNITS in the " + varFullProductStyle + varDescription1);
				 if (varConfirm == true) { 
	                 varFieldCheck = 1;
	                  returnaddress(varFullProductStyle);
		             return;
	             }
				 varFatalError = true;
    }  
     
	 if (ProductOpenStyle3 != "Nil" && (ProductOpenStyle3 != varOpenStyle1 && ProductOpenStyle3 != varOpenStyle2 && ProductOpenStyle3 != varOpenStyle3)) {
	 	  varFullProductStyle = transformProductStyle(ProductOpenStyle3);
varConfirm=window.confirm("You have listed one or more OPEN UNITS in the " + varFullProductStyle + varDescription1);
 				 if (varConfirm == true) { 
	                 varFieldCheck = 1;
	                  returnaddress(varFullProductStyle);
		             return;
	             }
				 varFatalError = true;
     }                 	 
								
					  
	 if (varDiscountRequest == false && ((varCurrentOrderPrice - varLocalDeliveryCost - varLongHaulCost) * 1.1  > 1080) && varOnLine == false) {
varConfirm=window.confirm("You have not applied for any discount. --- Click [OK] to go to the Discount page, (see Discounts ) -----Click [CANCEL] to continue");
       if (varConfirm == true) { 
	      varFieldCheck = 1;
	     location.replace("category1005632_1.htm");
		 return;
	   }
	 } 			  
 
  
// redo the validation process before deciding the Delivery process
     if (varStyleSpec == false && varCabinet == true ) {
window.alert("Please redo the Validation process when additional entries have been made, for example:  Colour/Profiles");
        return;
     }
 
 if (varDelivery == false) {
 varConfirm=window.confirm("You have not yet entered a Delivery Option, this MUST be supplied - as the last Order Line. --- Click [O.K] to go to 'DELIVERY' ---Click [CANCEL] to add additional products first.");
   if (varConfirm ==true) {
      FinalCheck = true;
	   varFieldCheck = 1;
     location.replace("category9001_1.htm");
	 return;
   }
 }
 
 if (varDelivery == true && varFatalError == false) varOrderStatus = true;
 else varOrderStatus = false;
 
  if (varOrderStatus == true) {
  window.alert("Your Request for final Quotation (or Shopping List) has been validated and you can now proceed to the CHECKOUT ");
         location.replace("viewcart-2.htm"); 
  }
  else {
 window.alert("Your Request for Quotation (or Shopping List) IS NOT COMPLETE YET - Please Validate once more and follow the suggestions to add additional specifications"); 
	            return;
  }
}
// =================================== 
function BypassChecking()
{
  location.replace("\category80_1.htm"); 
}
//=====================================

// change the five-character Style code to a full description
function transformProductStyle(varFullProductStyle)
{

  if (varFullProductStyle == "Lamin")      varFullProductStyle = "MELAMINE (LAMINATE) style";
  else if (varFullProductStyle == "GLOSS") varFullProductStyle = "GLOSS Laminate (Formica) style";
  else if (varFullProductStyle == "Belmo") varFullProductStyle = "Vinyl - BELMONT style";
  else if (varFullProductStyle == "Byron") varFullProductStyle = "Vinyl - BYRON BAY style";
  else if (varFullProductStyle == "Alban") varFullProductStyle = "Polyurethane - ALBANY style";
  else if (varFullProductStyle == "Avoca") varFullProductStyle = "Polyurethane - AVOCA style";
  else if (varFullProductStyle == "Unfin") varFullProductStyle = "Unfinished 18mm MR-MDF";

 return varFullProductStyle;
}


function CheckoutMessage()
{
window.alert("Proceeding to Checkout can only be done after [Check Shopping List] has advised that you can proceed ---- Please click on 'Check Shopping List] now");
}

function checkProductRange()
{
  if(varInvalidProduct == true || varErrorType > 0) {
     window.alert(" You still have an invalid Product specification in your Shopping Cart and you CAN NOT proceed past [Checkout] to SUBMIT this Order. Please [REMOVE] it and then RE-ENTER its details");
	 return;
  }

 if (BypassCheckProductRange == false) {
  
  if (varBTNumber > 1 & varJoinTotal == 0) {
varConfirm=window.confirm("You have ordered " + varBTNumber + " benchtops but you did not specify any MACHINING for possible JOINs - if this is an oversight then Click [OK} to add the required Machining details as well for that Benchtop Unique Identifier Code - [A], [B] etc.; ---Click [CANCEL] if there is no requirement for to JOIN any of the Benchtops - or if you want to Review your Viewcart entries first");
          if (varConfirm == true) {
	         location.replace("category1002104_1.htm");
			 varFieldCheck = 1;
        	             return;
	      }	
   }
	 	 	 
	          if (varButtJoin != 0 && varButtJoin != 2 && varButtJoin != 4) {
varConfirm=window.confirm(" There are normally two sides to a BUTT join but you specified only an uneven number - please review your specification and Click [OK} to ADD new Order lines if required; otherwise Click [Cancel].")
                  if (varConfirm == true) {
	                 location.replace("category1002104_1.htm");
					 varFieldCheck = 1;
		             return;
	              }	
              } 
	          if (varMaleJoin != varFemaleJoin) {
varConfirm=window.confirm(" You specified " + varMaleJoin + " MALE joins and " + varFemaleJoin + " FEMALE joins - Each actual Benchtop MUST have TWO of these products with the SAME [Unique Bench Identifyer] - i.e [A] or [B] etc. as that Benchtop. Click [OK] to go back to the View Cart to find which Benchtop is missing one or both of the END Finish products and then ADD in the correct END Finish from the Benchtop section");	 
                 if (varConfirm == true) {
	                 location.replace("category1002104_1.htm");
		             return;
	              }	
	          }
  if (varCabinet == true && varNoPanel == false) {
    if (varPanel != true) {
window.alert("You did not specify any Coloured 'seen' End or SIDE PANELS  - this may be an oversight or intentional. At this stage of processing we like to be certain so you will be transferred to the Panels page to add Specifications or [No Panel Requird]");
	      varFieldCheck = 1;
	     location.replace("category1000011_1.htm");
		 return;
	    }	
	}

  if ((varCabinet == true || varCarcass == true) && varNoKick == false) {
    if (varKickboard != true ) {
window.alert("You did not specify any Kickboards - this may be an oversight or intentional. At this stage of processing we like to be certain so you will be transferred to the Kickboard page to add Specifications or [No Kickboard Required]");
	      varFieldCheck = 1;
	     location.replace("category1002111_1.htm");
		 return;
	    }	
	}
  
 } 

}

function checkDiscountandProducts()
{
 CalculateOrderTotals()
  CalculateOrderWeight()

  if (varDiscountRequest == false && ((varCurrentOrderPrice - varLocalDeliveryCost - varLongHaulCost) * 1.1  > 1080) && varOnLine == false) {   
varConfirm=window.confirm("You have not yet applied for any discount. ---Click [OK] to go to the Discount page, see DISCOUNTS -----Click [CANCEL] to continue");
       if (varConfirm == true) { 
	      varFieldCheck = 1;
	     location.replace("category1005632_1.htm");
		 return;
	   }
  } 
  			  
  checkProductRange();

}
//  collect the benchtop parameters
function BenchtopParameters(i, iProdID) {

     if (iProdID > 219 && iProdID < 224) {
         varL1 = parseInt(getLineSubItem(i, colCustomFields, 0));
		 varL2 = parseInt(getLineSubItem(i, colCustomFields, 1));
		 varL3 = parseInt(getLineSubItem(i, colCustomFields, 2));
		 varW1 = parseInt(getLineSubItem(i, colCustomFields, 3));
		 varW2 = parseInt(getLineSubItem(i, colCustomFields, 4));
		 varW3 = parseInt(getLineSubItem(i, colCustomFields, 5));
		 
		 if(iProdID == 220) {
		 	varE1 = getLineSubItem(i, colCustomFields, 7);
			varE3 = getLineSubItem(i, colCustomFields, 8);
		 
		 	varE1 = varE1.substring(0,1);
		 	varE2 = "U";
		 	varE3 = varE3.substring(0,1);
		 	varLx = varL2 - varW1 ;
		 	varL2 = varLx - varW3 ;
		}
		if(iProdID == 221) {
		 	varE1 = getLineSubItem(i, colCustomFields, 7);		 
		 	varE1 = varE1.substring(0,1);
		 	varE2 = "U";
		 	varE3 = "U";
		 	varL2 = varL2 - varW1 ;
			varL3 = varL3 - varW2 ;
		}
		if(iProdID == 222) {
			varE3 = getLineSubItem(i, colCustomFields, 7);		 
		 	varE1 = "U";
		 	varE2 = "U";
		 	varE3 = varE3.substring(0,1);
		 	varL1 = varL1 - varW2 ;
		 	varL2 = varL2 - varW3 ;
		}
		if(iProdID == 223) {	 
		 	varE1 = "U";
		 	varE2 = getLineSubItem(i, colCustomFields, 7);
			varE2= varE2.substring(0,1);
		 	varE3 = "U";
		 	varL1 = varL1 - varW2 ;
		 	varL3 = varL3 - varW2 ;
		}
				 		 
		 BenchCost1 = calculateBenchCost(varL1, varW1, varE1) ;
		 BenchCost2 = calculateBenchCost(varL2, varW2, varE2) ;
		 BenchCost3 = calculateBenchCost(varL3, varW3, varE3) ;
		 
		 curPrice = BenchCost1 + BenchCost2 + BenchCost3 + 231.00;
		 if (varL1 > 2350) curPrice = curPrice + 80.00;
		 if (varL2 > 2350) curPrice = curPrice + 80.00;
		 if (varL3 > 2350) curPrice = curPrice + 80.00;
		 
		 CalculatedBenchtopCost = CalculatedBenchtopCost + curPrice;
//window.alert("line 3043 - CalculatedBenchtopCost= " + CalculatedBenchtopCost + " curPrice= " + curPrice);
		 
		 if (varL1 > varL2) BenchLength = varL1 ;
		 else BenchLength = varL2;		 
		 if (BenchLength < varL3) BenchLength = varL3 ;
		 
		 	varBench1Weight = calculateBenchWeight(varL1, varW1, varE1);
			varBench2Weight = calculateBenchWeight(varL2, varW2, varE2);
			varBench3Weight = calculateBenchWeight(varL3, varW3, varE3);
			
			BenchWeightUshapeA = varBench1Weight + varBench2Weight + varBench3Weight;		
// window.alert(" 2988 bench1W= " + varBench1Weight + "bench2W= " + varBench2Weight + "bench3W= " + varBench3Weight);			
		 		 
		 return curPrice;		
     }
	 
//  calculate for L-Shape benchtops	 
	 if (iProdID > 215 && iProdID < 220) {
         varL1 = parseInt(getLineSubItem(i, colCustomFields, 0));
		 varL2 = parseInt(getLineSubItem(i, colCustomFields, 1));
		 varW1 = parseInt(getLineSubItem(i, colCustomFields, 2));
		 varW2 = parseInt(getLineSubItem(i, colCustomFields, 3));
		 varIdentifyer = parseInt(getLineSubItem(i, colCustomFields, 6));
		 
		 if(iProdID == 216) {
		  	varE1 = getLineSubItem(i, colCustomFields, 5);		 
		 	varE1 = varE1.substring(0,1);
		 	varE2 = "U";
		 	varL2 = varL2 - varW1 ;		 
		}
		if(iProdID == 217) {
			varE1 = "U";
		   	varE2 = getLineSubItem(i, colCustomFields, 5)
		 	varE2 = varE2.substring(0,1);
		 	varL1 = varL1 - varW2 ;
		}
		if(iProdID == 218) {
			varE2 = getLineSubItem(i, colCustomFields, 5);		 
		 	varE1 = "U";
		 	varE2 = varE2.substring(0,1);
		 	varL1 = varL1 - varW2 ;
		}
		if(iProdID == 219) {	 
		 	varE1 = getLineSubItem(i, colCustomFields, 5);
			varE1 = varE1.substring(0,1);
		 	varE2 = "U";
		 	varL2 = varL2 - varW1 ;
		}
				 		 
		 BenchCost1 = calculateBenchCost(varL1, varW1, varE1) ;	 
		 BenchCost2 = calculateBenchCost(varL2, varW2, varE2) ;
		 
		 curPrice = BenchCost1 + BenchCost2 + 116.00;
		 if (varL1 > 2350) curPrice = curPrice + 80.00;
		 if (varL2 > 2350) curPrice = curPrice + 80.00;
		 
		 if (varL1 > varL2) BenchLength = varL1 ;
		 else BenchLength = varL2;
// window.alert(" 3093 BenchCost1= " + BenchCost1 + " BenchCost2 = " + BenchCost2 + " BenchCost3= " + BenchCost3 + " varL1= " + varL1 + " varL2 = " + varL2 + " varL3 =  " + varL3);

		 CalculatedBenchtopCost = CalculatedBenchtopCost + curPrice;
//window.alert("line 3102 - CalculatedBenchtopCost= " + CalculatedBenchtopCost + " curPrice= " + curPrice);		 
		 
		 	varBench1Weight = calculateBenchWeight(varL1, varW1, varE1);
			varBench2Weight = calculateBenchWeight(varL2, varW2, varE2);			
			if (varIdentifyer == "A") BenchWeightLshapeA = varBench1Weight + varBench2Weight;
			else BenchWeightLshapeB = varBench1Weight + varBench2Weight; 					
//  window.alert(" 2988 benchWeight - " + BenchWeightLshapeA + " bench1W= " + varBench1Weight + " bench2W= " + varBench2Weight );
		 return curPrice;		
     }
}

function calculateBenchCost(Ll, Ww, Ee)
{
if      (Ee == "U" && Ww < 601)  BenchCost = Math.ceil(Ll  / 100) * 10.00;
else if (Ee == "U" && Ww < 901)  BenchCost = Math.ceil(Ll  / 100) * 14.50;
else if (Ee == "U" && Ww < 1201) BenchCost = Math.ceil(Ll  / 100) * 21.75;
else if (Ee == "A" && Ww < 601)  BenchCost = Math.ceil(Ll  / 100) * 11.75;
else if (Ee == "A" && Ww < 901)  BenchCost = Math.ceil(Ll  / 100) * 15.45;
else if (Ee == "A" && Ww < 1201) BenchCost = Math.ceil(Ll  / 100) * 22.70;
// changed 11/9/2011 add 30% to cost
BenchCost = Math.ceil(BenchCost * 1.30);
//alert("line 4264 cost = " + BenchCost + " length=  " + Math.ceil(Ll  / 100) + " Width= " + Ww + " Ee= " + Ee); 
	  
return BenchCost;
}

function calculateBenchWeight(Ll, Ww, Ee){
			if (Ww  < 601 && varE1 == "U") varBenchWeight = (Ll * 13.8) / 1000 ;
			else if (Ww  < 601 && Ee == "A") varBenchWeight = (Ll * 14.0) / 1000 ;
			else if (Ww  < 901 && Ee == "U") varBenchWeight = (Ll * 20.6) / 1000 ;
			else if (Ww  < 901 && Ee == "A") varBenchWeight = (Ll * 21.0) / 1000;
			else if (Ee == "U") varBenchWeight = (Ll * 27.6) / 1000 ;
			else if (Ee == "A") varBenchWeight = (Ll * 28.0) / 1000 ;
					
			return varBenchWeight ;
}


function PriceandWeightCalc(i)
{
        curPrice = 0.0;
		getInputDimensions(i);
	
// Base Cabinets Your Dimension	
   if (varProductCode.substring(0,12) == "B-D1-S1/Y241"){
      curPrice = Math.round(0.17687 * varHeight * varWidth * varDepth / 1000000 + 75.55);
	  varWeight = 0.59 * varHeight * varWidth * varDepth / 10000000 + 10.00;
   }
   if (varProductCode.substring(0,12) == "B-D2-S1/Y242")  {
      curPrice = Math.round(0.13605 * varHeight * varWidth * varDepth / 1000000 + 116.55);
	    varWeight = 0.5935 * varHeight * varWidth * varDepth / 10000000 + 10.1;
   }
// Floor Open Uniys BO-S1/Y1	
   if (varProductCode.substring(0,8) == "BO-S1/Y1"){
      curPrice = Math.round(0.229 * varHeight * varWidth * varDepth / 1000000 + 80.55);
	  varWeight = 0.4853 * varHeight * varWidth * varDepth / 10000000 + 12.55;
   }   
   
// Drawers Your Dimension    
    if (varProductCode.substring(0,10) == "BDrw-MT2/Y") {
    curPrice = Math.round(0.104 * varWidth + (varHeight - 750) * 0.04 + 156.55);
      varWeight = 0.039 * varWidth + (varHeight - 750) * 0.04 + 14.00;
	}
   if (varProductCode.substring(0,10) == "BDrw-MT3/Y") {
     curPrice = Math.round(0.124 * varWidth + (varHeight - 750) * 0.06 + 203.55);
 	   varWeight = 0.05 * varWidth + (varHeight - 750) * 0.06 + 12.00;
   }
   if (varProductCode.substring(0,10) == "BDrw-MT4/Y") {
     curPrice = Math.round(0.142 * varWidth + (varHeight - 750) * 0.12 + 238.55);
	  varWeight = 0.06 * varWidth + (varHeight - 750) * 0.06 + 13.00;
   }
   if (varProductCode.substring(0,10) == "BDrw-MT5/Y") {
     curPrice = Math.round(0.160 * varWidth + (varHeight - 750) * 0.14 + 250.55);
	 varWeight = 0.06 * varWidth + (varHeight - 750) * 0.06 + 14.00;
   }
 // Corner Cabinets Your Dimesion BC-D1-S1/Y  
   if (varProductCode.substring(0,10) == "BC-D1-S1/Y" || varProductCode.substring(0,11) == "BCA-D1-S1/Y") {     
	 curPrice = Math.round(1.073 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 10000000 + 206.55);
	   varWeight = Math.round(0.425 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 10000000) + 18.5;
   }  
	 if (varProductCode.substring(0,11) == "BCA-D1-S1/Y") {
	 curPrice = Math.round(1.073 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 10000000 + 218.55);
	  varWeight = Math.round(0.425 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 10000000) + 18.5;
   }   
// Diagonals BD-D1-S1/Y
  if (varProductCode.substring(0,10) == "BD-D1-S1/Y") {
	 curPrice = Math.round(1.13 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 10000000 + 134.55);
	 varWeight = Math.round(0.292 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 10000000 + 16.5);
  }
// Combo units BCD1Drw1/Y  
     if (varProductCode.substring(0,10) == "BCD1Drw1/Y") {
     curPrice = Math.round(0.2889 * varHeight * varWidth * varDepth / 1000000 + 118.55);
	 varWeight = Math.round(0.0843 * varHeight * varWidth * varDepth / 1000000 + 11.5);
     }
    if (varProductCode.substring(0,10) == "BCD2Drw1/Y") {
     curPrice = Math.round(0.245 * varHeight * varWidth * varDepth / 1000000 + 141.55);
	 varWeight = Math.round(0.0829 * varHeight * varWidth * varDepth / 1000000 + 12.7);
    }
    if (varProductCode.substring(0,10) == "BCD2Drw2/Y") {
     curPrice = Math.round(0.3033 * varHeight * varWidth * varDepth / 1000000 + 153.55);
	  varWeight = Math.round(0.0799 * varHeight * varWidth * varDepth / 1000000 + 13.9);
    }
// Wall Units W-D1-S1/Y 
  if (varProductCode.substring(0,9) == "W-D1-S1/Y" && varHeight > 900) {
     curPrice = Math.round(0.218 * varHeight * varWidth * varDepth / 1000000 + 76.55);
	 varWeight = Math.round(0.076 * varHeight * varWidth * varDepth / 1000000 + 8.4);
   }
   if (varProductCode.substring(0,9) == "W-D2-S1/Y" && varHeight > 900) {
     curPrice = Math.round(0.2089 * varHeight * varWidth * varDepth / 1000000 + 94.55);
	   varWeight = Math.round(0.07 * varHeight * varWidth * varDepth / 1000000 + 10.0);
   }
   if (varProductCode.substring(0,9) == "W-D1-S1/Y" && varHeight < 901) {
     curPrice = Math.round(0.235 * varHeight * varWidth * varDepth / 1000000 + 71.55);
	 varWeight = Math.round(0.0806 * varHeight * varWidth * varDepth / 1000000 + 7.00);
   }
   if (varProductCode.substring(0,9) == "W-D2-S1/Y" && varHeight < 901) {
     curPrice = Math.round(0.21905 * varHeight * varWidth * varDepth / 1000000 + 92.55);
	  varWeight = Math.round(0.0762 * varHeight * varWidth * varDepth / 1000000 + 8.45);
   }   
 // Wall Units Frame Doors W-F1-S1/Y 
   if (varProductCode.substring(0,9) == "W-F1-S1/Y" && varHeight > 900) {
     curPrice = Math.round(0.218 * varHeight * varWidth * varDepth / 1000000 + 86.55);
	varWeight = Math.round(0.076 * varHeight * varWidth * varDepth / 1000000 + 2.4);
   }
   if (varProductCode.substring(0,9) == "W-F2-S1/Y" && varHeight > 900) {
     curPrice = Math.round(0.2089 * varHeight * varWidth * varDepth / 1000000 + 114.55);
	varWeight = Math.round(0.07 * varHeight * varWidth * varDepth / 1000000 + 40.0);
   }
   if (varProductCode.substring(0,9) == "W-F1-S1/Y" && varHeight < 901) {
     curPrice = Math.round(0.235 * varHeight * varWidth * varDepth / 1000000 + 81.55);
	varWeight = Math.round(0.0806 * varHeight * varWidth * varDepth / 1000000 + 1.00);
   }
  if (varProductCode.substring(0,9) == "W-F2-S1/Y" && varHeight < 901) {
     curPrice = Math.round(0.21905 * varHeight * varWidth * varDepth / 1000000 + 112.55);
	varWeight = Math.round(0.0762 * varHeight * varWidth * varDepth / 1000000 + 2.45);
   }
   
 // Corner Wall Cabinets Your Dimesion WC-D1-S1/Y  
   if (varProductCode.substring(0,10) == "WC-D1-S1/Y") {
	 curPrice = Math.round(0.16667 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 1000000 + 204.00);
	 varWeight = Math.round(0.054127 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 1000000 + 5.55);
   }
// Wall Diagonals WD-D1-S1/Y
   if (varProductCode.substring(0,10) == "WD-D1-S1/Y") {
	 curPrice = Math.round(0.1353 * (varHeight * varLHWidth * varRHWidth)/ 1000000 + 120.55);
		 varWeight = Math.round(0.0546 * (varHeight * varLHWidth * varRHWidth)/ 1000000 + 12.5);
   }
 // Wall Units Open WO-S1/Y 
   if (varProductCode.substring(0,7) == "WO-S1/Y") {
     curPrice = Math.round(0.2617 * varHeight * varWidth * varDepth / 1000000 + 89.55);
	varWeight = Math.round(0.0576 * varHeight * varWidth * varDepth / 1000000 + 9.75);
   }
  
 // Wall Diagonals Open WDO-S1/Y
   if (varProductCode.substring(0,8) == "WDO-S1/Y") {
	 curPrice = Math.round(0.309677 * (varHeight * varLHWidth * varRHWidth)/ 1000000 + 61.55);
		 varWeight = Math.round(0.0615 * (varHeight * varLHWidth * varRHWidth)/ 1000000 + 9.5);
   }  
// Wall 135 degree Booma unit WB45-D1-S1/Y  
    if (varProductCode.substring(0,12) == "WB45-D1-S1/Y" ) {
	 curPrice = Math.round(2.519 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 10000000 + 150.55);
	 varWeight = Math.round(0.56 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 10000000) + 26.5;
	 } 
	   
 // Floor 135 degree Booma unit BB45-D1-S1/Y  
    if (varProductCode.substring(0,12) == "BB45-D1-S1/Y" ) {
	 curPrice = Math.round(1.073 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 10000000 + 250.55);
	 varWeight = Math.round(0.425 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 10000000) + 18.5;
	 }
// Pantry or general storage One Door P-D1-S5/Y
	if (varProductCode.substring(0,9) == "P-D1-S5/Y") {
     curPrice = Math.round(0.06818 * varHeight * varWidth * varDepth / 1000000 + 197.55);
     varWeight = Math.round(0.06818 * varHeight * varWidth * varDepth / 1000000 + 20.75);
    }
// Pantry or general storage Two Door P-D1-S5/Y
	if (varProductCode.substring(0,9) == "P-D2-S5/Y") {
     curPrice = Math.round(0.154 * varHeight * varWidth * varDepth / 1000000 + 192.55);
	   varWeight = Math.round(0.06347 * varHeight * varWidth * varDepth / 1000000 + 26.25);  
	}
// Corner Pantry One Door PC-D1-S5/Y
	if (varProductCode.substring(0,10) == "PC-D1-S5/Y") {
	 curPrice = Math.round(0.148148148 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 1000000 + 325.55);
	  varWeight = Math.round(0.0342592593 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 1000000 + 57.35);	 
	 }	 
// Corner Walkin Diagonal Pantry One Door PD-D1-S5/Y
	if (varProductCode.substring(0,10) == "PD-D1-S5/Y") {
	 curPrice = Math.round(0.10416667 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 1000000 + 177.55);
		 varWeight  = Math.round(0.0375 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 1000000 + 40);
	 }	 	 
// Corner Walkin Pantry Two Door PD-D2-S5/Y
	if (varProductCode.substring(0,10) == "PD-D2-S5/Y") {
	   if (varHeight < 2151) curPrice = Math.round(0.03083333 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 1000000 + 386);
       if (varHeight > 2150) curPrice = Math.round(0.03083333 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 1000000 + 452); 
		 varWeight  = Math.round(0.029167 * (varHeight * varLHWidth * varLHDepth + varHeight * varRHWidth * varRHDepth)/ 1000000 + 64); 
	 }
	 
// Panels  "Panel/Y"
	if (varProductCode.substring(0,7) == "Panel/Y") {
	   curPrice = Math.round(0.05654 * (varHeight * varWidth) / 1000 + 10.50);
		 varWeight  = Math.round(0.01116 * (varHeight * varWidth)/ 1000 + 1); 
	 }
// Kickboards  "Kick/Y"
	if (varProductCode.substring(0,6) == "Kick/Y") {
	   curPrice = Math.round(0.05 * (varHeight * varWidth) / 1000 + 5.50);
		 varWeight  = Math.round(0.01116 * (varHeight * varWidth)/ 1000 + 1 ); 
	 }	 
// Filler  "Filler/Y"
	if (varProductCode.substring(0,8) == "Filler/Y") {
	   curPrice = Math.round(0.075 * (varHeight * varWidth) / 1000 + 7.4);
		 varWeight  = Math.round(0.01116 * (varHeight * varWidth)/ 1000 + 1 ); 
	 }	 	 
// just Doors  "Door/Y"
	if (varProductCode.substring(0,6) == "Door/Y") {
	   curPrice = Math.round(0.0538129 * (varHeight * varWidth) / 1000 + 18);
		 varWeight  = Math.round(0.01116 * (varHeight * varWidth)/ 1000 + 1 ); 
	 }	
		  	 	 
	 return curPrice;
}


//function to determine PID to be used depending on Style required and specified Height and Width
// Recalculate Costs after a GLOBAL change in Style Finish
// && varDataInputMode == false && varSuffix != "x"
// 	varProductChangeFlag = true;
function changeStyle(iProdID,i)
{
//alert("line 4515 iProdID= " +iProdID);
 realPID = iProdID;
 varNewPID = iProdID;
 varProductCode = getProductInfo(iProdID)[colProductCode];
 newProductCode = varProductCode;
 if ((varProductCode.substring(0,1) != "2" && varProductCode.substring(0,1) != "3"  && varProductCode.substring(0,1) != "8" & varProductCode.substring(0,1) != "0" && varProductCode.substring(0,1) != "z" && varProductCode.substring(0,2) != "Ha" && varProductCode.substring(0,2) != "BT"  && varProductCode.substring(0,3) != "TBA" && varProductCode.substring(0,1) != "c")|| varProductCode.indexOf("/Q") == 0) { 
	var varLength = varProductCode.length;
	var varSlash = varProductCode.indexOf("/");
	var varRoot = varProductCode.substring(0,varSlash + 1);
	var iCustomFieldCount = getLineSubCount(i, colCustomFields); 
	var varLastChar = ""	        
			if (iCustomFieldCount > 0)  {						
	          for(var iCustomField = 0; iCustomField <iCustomFieldCount; iCustomField++)
	          {	
			    var varCustomFieldNameCode = getProductInfo(iProdID)[colCustomFieldKeys][iCustomField];
				var varCustomFieldValue = getLineSubItem(i, colCustomFields, iCustomField );
    					   
                if ((varCustomFieldNameCode > 594 && varCustomFieldNameCode < 600) || varCustomFieldNameCode == 605) {
				  if      (varCustomFieldValue.substring(0,5) == "Belmo") varLastChar = "a";
				  else if (varCustomFieldValue.substring(0,5) == "Byron") varLastChar = "b";
				  else if (varCustomFieldValue.substring(0,5) == "Alban") varLastChar = "c";
				  else if (varCustomFieldValue.substring(0,5) == "Avoca") varLastChar = "d";
				  else if (varCustomFieldValue.substring(0,5) == "Unfin") varLastChar = "e";				  
				  else if (varCustomFieldValue.substring(0,5) == "Lamin") varLastChar = "";
				  else varLastChar = "";
//alert("line 4533 - varCustomFieldNameCode= " + varCustomFieldNameCode + " varCustomFieldValue= " + varCustomFieldValue + " varLastChar= " + varLastChar);
               }
			   if (varCustomFieldValue.substring(0,5) == "GLOSS") varGLOSS = true;			   
			  }
			}
	   
						 	
	if (varProductCode.substring(0,11) != "DoorGlass/Y") {	
	    newProductCode = varRoot + varDimension1 + "-" + varDimension2 + varLastChar;
		 	
//In case of a GLOBAL STYLE Change.  For GLOSS we treat as Laminate Plus 25%	
	    if (varSuffix == "a" || varSuffix == "b" || varSuffix == "c" || varSuffix == "d" || varSuffix == "e")
	      {
		  newProductCode = varRoot + varDimension1 + "-" + varDimension2 + varSuffix;
		  varGLOSS = false;
		}
	    else if (varSuffix == "z" || varSuffix == "y") newProductCode = varRoot + varDimension1 + "-" + varDimension2 ;
		
	    if (varSuffix == "y") varGLOSS = true;
		if (varSuffix == "z") varGLOSS = false;
		
 	    varNewPID=changePID(newProductCode);   // find the new PID based on the newProductCode 

         if(varNewPID == 0)  varNewPID = realPID;
	}
	
    if (varProductCode.substring(0,11) == "DoorGlass/Y") {
	   if (varLastChar != "a" && varLastChar != "b" && varLastChar != "c" && varLastChar != "d") varLastChar = "e"; 
				varProductCode = varProductCode.substring(0,12) + varLastChar;
	   if (varSuffix == "a" || varSuffix == "b" || varSuffix == "c" || varSuffix == "d" || varSuffix == "e")
	         varProductCode = varProductCode.substring(0,12) + varSuffix;
	   else if (varSuffix == "z" ) varProductCode = varProductCode.substring(0,12) + "e";
	   varNewPid = realPID;
	   newProductCode = varProductCode;		
    }
 } 
//alert("line 4423 varRoot= " + varRoot + " varLastChar= " + varLastChar + " newProductCode= " + newProductCode +  " varNewPID= " + varNewPID);
return varNewPID;
}
// ----------------------------------------------------------------------------------------	 
function changePID(varNewPID)
{
// varNewPID initially contains the ProductCode.
//window.alert("4430-varNewPID=  " + varNewPID);

  switch(varNewPID)
  {
case 'BB45-D1-S1/750-700' : return  17785;
case 'BB45-D1-S1/750-700a' : return  17786;
case 'BB45-D1-S1/750-700b' : return  17789;
case 'BB45-D1-S1/750-700c' : return  17791;
case 'BB45-D1-S1/750-700d' : return  17796;
case 'BB45-D1-S1/750-700e' : return  267;
case 'BB45-D1-S1/900-700' : return  17841;
case 'BB45-D1-S1/900-700a' : return  17842;
case 'BB45-D1-S1/900-700b' : return  17845;
case 'BB45-D1-S1/900-700c' : return  17847;
case 'BB45-D1-S1/900-700d' : return  17852;
case 'BB45-D1-S1/900-700e' : return  268;
case 'BCA-D1-S1/750-1000' : return  15192;
case 'BCA-D1-S1/750-1000a' : return  15193;
case 'BCA-D1-S1/750-1000b' : return  15196;
case 'BCA-D1-S1/750-1000c' : return  15198;
case 'BCA-D1-S1/750-1000d' : return  15203;
case 'BCA-D1-S1/750-1000e' : return  30307;
case 'BCA-D1-S1/750-600' : return  15150;
case 'BCA-D1-S1/750-600a' : return  15151;
case 'BCA-D1-S1/750-600b' : return  15154;
case 'BCA-D1-S1/750-600c' : return  15156;
case 'BCA-D1-S1/750-600d' : return  15161;
case 'BCA-D1-S1/750-600e' : return  30301;
case 'BCA-D1-S1/750-700' : return  15164;
case 'BCA-D1-S1/750-700a' : return  15165;
case 'BCA-D1-S1/750-700b' : return  15168;
case 'BCA-D1-S1/750-700c' : return  15170;
case 'BCA-D1-S1/750-700d' : return  15175;
case 'BCA-D1-S1/750-700e' : return  30303;
case 'BCA-D1-S1/750-900' : return  15178;
case 'BCA-D1-S1/750-900a' : return  15179;
case 'BCA-D1-S1/750-900b' : return  15182;
case 'BCA-D1-S1/750-900c' : return  15184;
case 'BCA-D1-S1/750-900d' : return  15189;
case 'BCA-D1-S1/750-900e' : return  30305;
case 'BCA-D1-S1/900-1000' : return  15136;
case 'BCA-D1-S1/900-1000a' : return  20669;
case 'BCA-D1-S1/900-1000b' : return  15137;
case 'BCA-D1-S1/900-1000c' : return  15140;
case 'BCA-D1-S1/900-1000d' : return  15142;
case 'BCA-D1-S1/900-1000e' : return  30315;
case 'BCA-D1-S1/900-600' : return  15094;
case 'BCA-D1-S1/900-600a' : return  15095;
case 'BCA-D1-S1/900-600b' : return  15098;
case 'BCA-D1-S1/900-600c' : return  15100;
case 'BCA-D1-S1/900-600d' : return  15105;
case 'BCA-D1-S1/900-600e' : return  30309;
case 'BCA-D1-S1/900-700' : return  15108;
case 'BCA-D1-S1/900-700a' : return  15109;
case 'BCA-D1-S1/900-700b' : return  15112;
case 'BCA-D1-S1/900-700c' : return  15114;
case 'BCA-D1-S1/900-700d' : return  15119;
case 'BCA-D1-S1/900-700e' : return  30311;
case 'BCA-D1-S1/900-900' : return  15122;
case 'BCA-D1-S1/900-900a' : return  15123;
case 'BCA-D1-S1/900-900b' : return  15126;
case 'BCA-D1-S1/900-900c' : return  15128;
case 'BCA-D1-S1/900-900d' : return  15133;
case 'BCA-D1-S1/900-900e' : return  30313;
case 'BCD1Drw1/750-400' : return  18673;
case 'BCD1Drw1/750-400a' : return  18679;
case 'BCD1Drw1/750-400b' : return  18697;
case 'BCD1Drw1/750-400c' : return  18709;
case 'BCD1Drw1/750-400d' : return  18739;
case 'BCD1Drw1/750-400e' : return  31011;
case 'BCD1Drw1/750-500' : return  18674;
case 'BCD1Drw1/750-500a' : return  18680;
case 'BCD1Drw1/750-500b' : return  18698;
case 'BCD1Drw1/750-500c' : return  18710;
case 'BCD1Drw1/750-500d' : return  18740;
case 'BCD1Drw1/750-500e' : return  31012;
case 'BCD1Drw1/900-400' : return  18841;
case 'BCD1Drw1/900-400a' : return  18847;
case 'BCD1Drw1/900-400b' : return  18865;
case 'BCD1Drw1/900-400c' : return  18877;
case 'BCD1Drw1/900-400d' : return  18907;
case 'BCD1Drw1/900-400e' : return  31023;
case 'BCD1Drw1/900-500' : return  18842;
case 'BCD1Drw1/900-500a' : return  18848;
case 'BCD1Drw1/900-500b' : return  18866;
case 'BCD1Drw1/900-500c' : return  18878;
case 'BCD1Drw1/900-500d' : return  18908;
case 'BCD1Drw1/900-500e' : return  31024;
case 'BC-D1-S1/750-1000' : return  15024;
case 'BC-D1-S1/750-1000a' : return  15025;
case 'BC-D1-S1/750-1000b' : return  15028;
case 'BC-D1-S1/750-1000c' : return  15030;
case 'BC-D1-S1/750-1000d' : return  15035;
case 'BC-D1-S1/750-1000e' : return  30306;
case 'BC-D1-S1/750-600' : return  14982;
case 'BC-D1-S1/750-600a' : return  14983;
case 'BC-D1-S1/750-600b' : return  14986;
case 'BC-D1-S1/750-600c' : return  14988;
case 'BC-D1-S1/750-600d' : return  14993;
case 'BC-D1-S1/750-600e' : return  30300;
case 'BC-D1-S1/750-700' : return  14996;
case 'BC-D1-S1/750-700a' : return  14997;
case 'BC-D1-S1/750-700b' : return  15000;
case 'BC-D1-S1/750-700c' : return  15002;
case 'BC-D1-S1/750-700d' : return  15007;
case 'BC-D1-S1/750-700e' : return  30302;
case 'BC-D1-S1/750-900' : return  15010;
case 'BC-D1-S1/750-900a' : return  15011;
case 'BC-D1-S1/750-900b' : return  15014;
case 'BC-D1-S1/750-900c' : return  15016;
case 'BC-D1-S1/750-900d' : return  15021;
case 'BC-D1-S1/750-900e' : return  30304;
case 'BC-D1-S1/900-1000' : return  15080;
case 'BC-D1-S1/900-1000a' : return  15081;
case 'BC-D1-S1/900-1000b' : return  15084;
case 'BC-D1-S1/900-1000c' : return  15086;
case 'BC-D1-S1/900-1000d' : return  20668;
case 'BC-D1-S1/900-1000e' : return  30314;
case 'BC-D1-S1/900-600' : return  15038;
case 'BC-D1-S1/900-600a' : return  15039;
case 'BC-D1-S1/900-600b' : return  15042;
case 'BC-D1-S1/900-600c' : return  15044;
case 'BC-D1-S1/900-600d' : return  15049;
case 'BC-D1-S1/900-600e' : return  30308;
case 'BC-D1-S1/900-700' : return  15052;
case 'BC-D1-S1/900-700a' : return  15053;
case 'BC-D1-S1/900-700b' : return  15056;
case 'BC-D1-S1/900-700c' : return  15058;
case 'BC-D1-S1/900-700d' : return  15063;
case 'BC-D1-S1/900-700e' : return  30310;
case 'BC-D1-S1/900-900' : return  15066;
case 'BC-D1-S1/900-900a' : return  15067;
case 'BC-D1-S1/900-900b' : return  15070;
case 'BC-D1-S1/900-900c' : return  15072;
case 'BC-D1-S1/900-900d' : return  15077;
case 'BC-D1-S1/900-900e' : return  30312;
case 'BCD2Drw1/750-600' : return  18675;
case 'BCD2Drw1/750-600a' : return  18681;
case 'BCD2Drw1/750-600b' : return  18699;
case 'BCD2Drw1/750-600c' : return  18711;
case 'BCD2Drw1/750-600d' : return  18741;
case 'BCD2Drw1/750-600e' : return  31013;
case 'BCD2Drw1/750-700' : return  18676;
case 'BCD2Drw1/750-700a' : return  18682;
case 'BCD2Drw1/750-700b' : return  18700;
case 'BCD2Drw1/750-700c' : return  18712;
case 'BCD2Drw1/750-700d' : return  18742;
case 'BCD2Drw1/750-700e' : return  31014;
case 'BCD2Drw1/750-800' : return  18677;
case 'BCD2Drw1/750-800a' : return  18683;
case 'BCD2Drw1/750-800b' : return  18701;
case 'BCD2Drw1/750-800c' : return  18713;
case 'BCD2Drw1/750-800d' : return  18743;
case 'BCD2Drw1/750-800e' : return  31015;
case 'BCD2Drw1/750-900' : return  18678;
case 'BCD2Drw1/750-900a' : return  18684;
case 'BCD2Drw1/750-900b' : return  18702;
case 'BCD2Drw1/750-900c' : return  18714;
case 'BCD2Drw1/750-900d' : return  18744;
case 'BCD2Drw1/750-900e' : return  31016;
case 'BCD2Drw1/900-600' : return  18843;
case 'BCD2Drw1/900-600a' : return  18849;
case 'BCD2Drw1/900-600b' : return  18867;
case 'BCD2Drw1/900-600c' : return  18879;
case 'BCD2Drw1/900-600d' : return  18909;
case 'BCD2Drw1/900-600e' : return  31025;
case 'BCD2Drw1/900-700' : return  18844;
case 'BCD2Drw1/900-700a' : return  18850;
case 'BCD2Drw1/900-700b' : return  18868;
case 'BCD2Drw1/900-700c' : return  18880;
case 'BCD2Drw1/900-700d' : return  18910;
case 'BCD2Drw1/900-700e' : return  31026;
case 'BCD2Drw1/900-800' : return  18845;
case 'BCD2Drw1/900-800a' : return  18851;
case 'BCD2Drw1/900-800b' : return  18869;
case 'BCD2Drw1/900-800c' : return  18881;
case 'BCD2Drw1/900-800d' : return  18911;
case 'BCD2Drw1/900-800e' : return  31027;
case 'BCD2Drw1/900-900' : return  18846;
case 'BCD2Drw1/900-900a' : return  18852;
case 'BCD2Drw1/900-900b' : return  18870;
case 'BCD2Drw1/900-900c' : return  18882;
case 'BCD2Drw1/900-900d' : return  18912;
case 'BCD2Drw1/900-900e' : return  31028;
case 'BCD2Drw2/750-1000' : return  18760;
case 'BCD2Drw2/750-1000a' : return  18766;
case 'BCD2Drw2/750-1000b' : return  18784;
case 'BCD2Drw2/750-1000c' : return  18796;
case 'BCD2Drw2/750-1000d' : return  18826;
case 'BCD2Drw2/750-1000e' : return  31020;
case 'BCD2Drw2/750-1100' : return  18761;
case 'BCD2Drw2/750-1100a' : return  18767;
case 'BCD2Drw2/750-1100b' : return  18785;
case 'BCD2Drw2/750-1100c' : return  18797;
case 'BCD2Drw2/750-1100d' : return  18827;
case 'BCD2Drw2/750-1100e' : return  31021;
case 'BCD2Drw2/750-1200' : return  18762;
case 'BCD2Drw2/750-1200a' : return  18768;
case 'BCD2Drw2/750-1200b' : return  18786;
case 'BCD2Drw2/750-1200c' : return  18798;
case 'BCD2Drw2/750-1200d' : return  18828;
case 'BCD2Drw2/750-1200e' : return  31022;
case 'BCD2Drw2/750-700' : return  18757;
case 'BCD2Drw2/750-700a' : return  18763;
case 'BCD2Drw2/750-700b' : return  18781;
case 'BCD2Drw2/750-700c' : return  18793;
case 'BCD2Drw2/750-700d' : return  18823;
case 'BCD2Drw2/750-700e' : return  31017;
case 'BCD2Drw2/750-800' : return  18758;
case 'BCD2Drw2/750-800a' : return  18764;
case 'BCD2Drw2/750-800b' : return  18782;
case 'BCD2Drw2/750-800c' : return  18794;
case 'BCD2Drw2/750-800d' : return  18824;
case 'BCD2Drw2/750-800e' : return  31018;
case 'BCD2Drw2/750-900' : return  18759;
case 'BCD2Drw2/750-900a' : return  18765;
case 'BCD2Drw2/750-900b' : return  18783;
case 'BCD2Drw2/750-900c' : return  18795;
case 'BCD2Drw2/750-900d' : return  18825;
case 'BCD2Drw2/750-900e' : return  31019;
case 'BCD2Drw2/900-1000' : return  18928;
case 'BCD2Drw2/900-1000a' : return  18934;
case 'BCD2Drw2/900-1000b' : return  18952;
case 'BCD2Drw2/900-1000c' : return  18964;
case 'BCD2Drw2/900-1000d' : return  18994;
case 'BCD2Drw2/900-1000e' : return  31032;
case 'BCD2Drw2/900-1100' : return  18929;
case 'BCD2Drw2/900-1100a' : return  18935;
case 'BCD2Drw2/900-1100b' : return  18953;
case 'BCD2Drw2/900-1100c' : return  18965;
case 'BCD2Drw2/900-1100d' : return  18995;
case 'BCD2Drw2/900-1100e' : return  31033;
case 'BCD2Drw2/900-1200' : return  18930;
case 'BCD2Drw2/900-1200a' : return  18936;
case 'BCD2Drw2/900-1200b' : return  18954;
case 'BCD2Drw2/900-1200c' : return  18966;
case 'BCD2Drw2/900-1200d' : return  18996;
case 'BCD2Drw2/900-1200e' : return  31034;
case 'BCD2Drw2/900-700' : return  18925;
case 'BCD2Drw2/900-700a' : return  18931;
case 'BCD2Drw2/900-700b' : return  18949;
case 'BCD2Drw2/900-700c' : return  18961;
case 'BCD2Drw2/900-700d' : return  18991;
case 'BCD2Drw2/900-700e' : return  31029;
case 'BCD2Drw2/900-800' : return  18926;
case 'BCD2Drw2/900-800a' : return  18932;
case 'BCD2Drw2/900-800b' : return  18950;
case 'BCD2Drw2/900-800c' : return  18962;
case 'BCD2Drw2/900-800d' : return  18992;
case 'BCD2Drw2/900-800e' : return  31030;
case 'BCD2Drw2/900-900' : return  18927;
case 'BCD2Drw2/900-900a' : return  18933;
case 'BCD2Drw2/900-900b' : return  18951;
case 'BCD2Drw2/900-900c' : return  18963;
case 'BCD2Drw2/900-900d' : return  18993;
case 'BCD2Drw2/900-900e' : return  31031;
case 'B-D1-S1/750-300' : return  10668;
case 'B-D1-S1/750-300a' : return  10670;
case 'B-D1-S1/750-300b' : return  10673;
case 'B-D1-S1/750-300c' : return  10675;
case 'B-D1-S1/750-300d' : return  10680;
case 'B-D1-S1/750-300e' : return  30201;
case 'B-D1-S1/750-400' : return  13372;
case 'B-D1-S1/750-400a' : return  13375;
case 'B-D1-S1/750-400b' : return  13378;
case 'B-D1-S1/750-400c' : return  13381;
case 'B-D1-S1/750-400d' : return  13385;
case 'B-D1-S1/750-400e' : return  30202;
case 'B-D1-S1/750-500' : return  13389;
case 'B-D1-S1/750-500a' : return  13392;
case 'B-D1-S1/750-500b' : return  13395;
case 'B-D1-S1/750-500c' : return  13398;
case 'B-D1-S1/750-500d' : return  13402;
case 'B-D1-S1/750-500e' : return  30203;
case 'B-D1-S1/750-600' : return  13406;
case 'B-D1-S1/750-600a' : return  13409;
case 'B-D1-S1/750-600b' : return  13412;
case 'B-D1-S1/750-600c' : return  13415;
case 'B-D1-S1/750-600d' : return  13419;
case 'B-D1-S1/750-600e' : return  30204;
case 'B-D1-S1/900-300' : return  13542;
case 'B-D1-S1/900-300a' : return  13545;
case 'B-D1-S1/900-300b' : return  13548;
case 'B-D1-S1/900-300c' : return  13551;
case 'B-D1-S1/900-300d' : return  13555;
case 'B-D1-S1/900-300e' : return  30212;
case 'B-D1-S1/900-400' : return  13559;
case 'B-D1-S1/900-400a' : return  13562;
case 'B-D1-S1/900-400b' : return  13565;
case 'B-D1-S1/900-400c' : return  13568;
case 'B-D1-S1/900-400d' : return  13572;
case 'B-D1-S1/900-400e' : return  30213;
case 'B-D1-S1/900-500' : return  13576;
case 'B-D1-S1/900-500a' : return  13579;
case 'B-D1-S1/900-500b' : return  13582;
case 'B-D1-S1/900-500c' : return  13585;
case 'B-D1-S1/900-500d' : return  13589;
case 'B-D1-S1/900-500e' : return  30214;
case 'B-D1-S1/900-600a' : return  13596;
case 'B-D1-S1/900-600b' : return  13599;
case 'B-D1-S1/900-600c' : return  13602;
case 'B-D1-S1/900-600d' : return  13606;
case 'B-D1-S1/900-600e' : return  30215;
case 'B-D2-S1/750-1000' : return  13474;
case 'B-D2-S1/750-1000a' : return  13477;
case 'B-D2-S1/750-1000b' : return  13480;
case 'B-D2-S1/750-1000c' : return  13483;
case 'B-D2-S1/750-1000d' : return  13487;
case 'B-D2-S1/750-1000e' : return  30209;
case 'B-D2-S1/750-1100' : return  13491;
case 'B-D2-S1/750-1100a' : return  13494;
case 'B-D2-S1/750-1100b' : return  13497;
case 'B-D2-S1/750-1100c' : return  13500;
case 'B-D2-S1/750-1100d' : return  13504;
case 'B-D2-S1/750-1100e' : return  30210;
case 'B-D2-S1/750-1200' : return  13508;
case 'B-D2-S1/750-1200a' : return  13511;
case 'B-D2-S1/750-1200b' : return  13514;
case 'B-D2-S1/750-1200c' : return  13517;
case 'B-D2-S1/750-1200d' : return  13521;
case 'B-D2-S1/750-1200e' : return  30211;
case 'B-D2-S1/750-600' : return  13525;
case 'B-D2-S1/750-600a' : return  13528;
case 'B-D2-S1/750-600b' : return  13531;
case 'B-D2-S1/750-600c' : return  13534;
case 'B-D2-S1/750-600d' : return  13538;
case 'B-D2-S1/750-600e' : return  30205;
case 'B-D2-S1/750-700' : return  13423;
case 'B-D2-S1/750-700a' : return  13426;
case 'B-D2-S1/750-700b' : return  13429;
case 'B-D2-S1/750-700c' : return  13432;
case 'B-D2-S1/750-700d' : return  13436;
case 'B-D2-S1/750-700e' : return  30206;
case 'B-D2-S1/750-800' : return  13440;
case 'B-D2-S1/750-800a' : return  13443;
case 'B-D2-S1/750-800b' : return  13446;
case 'B-D2-S1/750-800c' : return  13449;
case 'B-D2-S1/750-800d' : return  13453;
case 'B-D2-S1/750-800e' : return  30207;
case 'B-D2-S1/750-900' : return  13457;
case 'B-D2-S1/750-900a' : return  13460;
case 'B-D2-S1/750-900b' : return  13463;
case 'B-D2-S1/750-900c' : return  13466;
case 'B-D2-S1/750-900d' : return  13470;
case 'B-D2-S1/750-900e' : return  30208;
case 'B-D2-S1/900-1000' : return  13661;
case 'B-D2-S1/900-1000a' : return  13664;
case 'B-D2-S1/900-1000b' : return  13667;
case 'B-D2-S1/900-1000c' : return  13670;
case 'B-D2-S1/900-1000d' : return  13674;
case 'B-D2-S1/900-1000e' : return  30220;
case 'B-D2-S1/900-1100' : return  13678;
case 'B-D2-S1/900-1100a' : return  13681;
case 'B-D2-S1/900-1100b' : return  13684;
case 'B-D2-S1/900-1100c' : return  13687;
case 'B-D2-S1/900-1100d' : return  13691;
case 'B-D2-S1/900-1100e' : return  30221;
case 'B-D2-S1/900-1200' : return  13695;
case 'B-D2-S1/900-1200a' : return  13698;
case 'B-D2-S1/900-1200b' : return  13701;
case 'B-D2-S1/900-1200c' : return  13704;
case 'B-D2-S1/900-1200d' : return  13708;
case 'B-D2-S1/900-1200e' : return  30222;
case 'B-D2-S1/900-600' : return  13712;
case 'B-D2-S1/900-600a' : return  13715;
case 'B-D2-S1/900-600b' : return  13718;
case 'B-D2-S1/900-600c' : return  13721;
case 'B-D2-S1/900-600d' : return  13725;
case 'B-D2-S1/900-600e' : return  30216;
case 'B-D2-S1/900-700' : return  13610;
case 'B-D2-S1/900-700a' : return  13613;
case 'B-D2-S1/900-700b' : return  13616;
case 'B-D2-S1/900-700c' : return  13619;
case 'B-D2-S1/900-700d' : return  13623;
case 'B-D2-S1/900-700e' : return  30217;
case 'B-D2-S1/900-800' : return  13627;
case 'B-D2-S1/900-800a' : return  13630;
case 'B-D2-S1/900-800b' : return  13633;
case 'B-D2-S1/900-800c' : return  13636;
case 'B-D2-S1/900-800d' : return  13640;
case 'B-D2-S1/900-800e' : return  30218;
case 'B-D2-S1/900-900' : return  13593;
case 'B-D2-S1/900-900a' : return  13647;
case 'B-D2-S1/900-900b' : return  13650;
case 'B-D2-S1/900-900c' : return  13653;
case 'B-D2-S1/900-900d' : return  13657;
case 'B-D2-S1/900-900e' : return  30219;
case 'BD-D1-S1/750-600' : return  17902;
case 'BD-D1-S1/750-600a' : return  24833;
case 'BD-D1-S1/750-600b' : return  17910;
case 'BD-D1-S1/750-600c' : return  17914;
case 'BD-D1-S1/750-600d' : return  17924;
case 'BD-D1-S1/750-600e' : return  31005;
case 'BD-D1-S1/750-900' : return  17928;
case 'BD-D1-S1/750-900a' : return  17930;
case 'BD-D1-S1/750-900b' : return  17936;
case 'BD-D1-S1/750-900c' : return  17940;
case 'BD-D1-S1/750-900d' : return  17950;
case 'BD-D1-S1/750-900e' : return  31006;
case 'BD-D1-S1/900-600' : return  17954;
case 'BD-D1-S1/900-600a' : return  17956;
case 'BD-D1-S1/900-600b' : return  17962;
case 'BD-D1-S1/900-600c' : return  17966;
case 'BD-D1-S1/900-600d' : return  17976;
case 'BD-D1-S1/900-600e' : return  31007;
case 'BD-D1-S1/900-900' : return  17980;
case 'BD-D1-S1/900-900a' : return  17982;
case 'BD-D1-S1/900-900b' : return  17988;
case 'BD-D1-S1/900-900c' : return  17992;
case 'BD-D1-S1/900-900d' : return  18002;
case 'BD-D1-S1/900-900e' : return  31008;
case 'BDrw-MT2/750-400' : return  15220;
case 'BDrw-MT2/750-400a' : return  15221;
case 'BDrw-MT2/750-400b' : return  15224;
case 'BDrw-MT2/750-400c' : return  15226;
case 'BDrw-MT2/750-400d' : return  15231;
case 'BDrw-MT2/750-400e' : return  30250;
case 'BDrw-MT2/750-500' : return  15234;
case 'BDrw-MT2/750-500a' : return  15235;
case 'BDrw-MT2/750-500b' : return  15238;
case 'BDrw-MT2/750-500c' : return  15240;
case 'BDrw-MT2/750-500d' : return  15245;
case 'BDrw-MT2/750-500e' : return  30254;
case 'BDrw-MT2/750-600' : return  15248;
case 'BDrw-MT2/750-600a' : return  15249;
case 'BDrw-MT2/750-600b' : return  15252;
case 'BDrw-MT2/750-600c' : return  15254;
case 'BDrw-MT2/750-600d' : return  15259;
case 'BDrw-MT2/750-600e' : return  30258;
case 'BDrw-MT2/750-700' : return  15262;
case 'BDrw-MT2/750-700a' : return  15263;
case 'BDrw-MT2/750-700b' : return  15266;
case 'BDrw-MT2/750-700c' : return  15268;
case 'BDrw-MT2/750-700d' : return  15273;
case 'BDrw-MT2/750-700e' : return  30262;
case 'BDrw-MT2/750-800' : return  15276;
case 'BDrw-MT2/750-800a' : return  15277;
case 'BDrw-MT2/750-800b' : return  15280;
case 'BDrw-MT2/750-800c' : return  15282;
case 'BDrw-MT2/750-800d' : return  15287;
case 'BDrw-MT2/750-800e' : return  30266;
case 'BDrw-MT2/750-900' : return  15290;
case 'BDrw-MT2/750-900a' : return  15291;
case 'BDrw-MT2/750-900b' : return  15303;
case 'BDrw-MT2/750-900c' : return  15305;
case 'BDrw-MT2/750-900d' : return  15310;
case 'BDrw-MT2/750-900e' : return  30270;
case 'BDrw-MT2/900-400' : return  15313;
case 'BDrw-MT2/900-400a' : return  15314;
case 'BDrw-MT2/900-400b' : return  15317;
case 'BDrw-MT2/900-400c' : return  15319;
case 'BDrw-MT2/900-400d' : return  15324;
case 'BDrw-MT2/900-400e' : return  30274;
case 'BDrw-MT2/900-500' : return  15327;
case 'BDrw-MT2/900-500a' : return  15328;
case 'BDrw-MT2/900-500b' : return  15331;
case 'BDrw-MT2/900-500c' : return  15333;
case 'BDrw-MT2/900-500d' : return  15338;
case 'BDrw-MT2/900-500e' : return  30278;
case 'BDrw-MT2/900-600' : return  15341;
case 'BDrw-MT2/900-600a' : return  15342;
case 'BDrw-MT2/900-600b' : return  15345;
case 'BDrw-MT2/900-600c' : return  15347;
case 'BDrw-MT2/900-600d' : return  15352;
case 'BDrw-MT2/900-600e' : return  30282;
case 'BDrw-MT2/900-700' : return  15355;
case 'BDrw-MT2/900-700a' : return  15356;
case 'BDrw-MT2/900-700b' : return  15359;
case 'BDrw-MT2/900-700c' : return  15361;
case 'BDrw-MT2/900-700d' : return  15366;
case 'BDrw-MT2/900-700e' : return  30286;
case 'BDrw-MT2/900-800' : return  15369;
case 'BDrw-MT2/900-800a' : return  15370;
case 'BDrw-MT2/900-800b' : return  15373;
case 'BDrw-MT2/900-800c' : return  15375;
case 'BDrw-MT2/900-800d' : return  15380;
case 'BDrw-MT2/900-800e' : return  30290;
case 'BDrw-MT2/900-900' : return  15383;
case 'BDrw-MT2/900-900a' : return  15384;
case 'BDrw-MT2/900-900b' : return  15387;
case 'BDrw-MT2/900-900c' : return  15389;
case 'BDrw-MT2/900-900d' : return  15394;
case 'BDrw-MT2/900-900e' : return  30294;
case 'BDrw-MT3/750-400' : return  15398;
case 'BDrw-MT3/750-400a' : return  15399;
case 'BDrw-MT3/750-400b' : return  15402;
case 'BDrw-MT3/750-400c' : return  15404;
case 'BDrw-MT3/750-400d' : return  15409;
case 'BDrw-MT3/750-400e' : return  30251;
case 'BDrw-MT3/750-500' : return  15412;
case 'BDrw-MT3/750-500a' : return  15413;
case 'BDrw-MT3/750-500b' : return  15416;
case 'BDrw-MT3/750-500c' : return  15418;
case 'BDrw-MT3/750-500d' : return  15423;
case 'BDrw-MT3/750-500e' : return  30255;
case 'BDrw-MT3/750-600' : return  15426;
case 'BDrw-MT3/750-600a' : return  15427;
case 'BDrw-MT3/750-600b' : return  15430;
case 'BDrw-MT3/750-600c' : return  15432;
case 'BDrw-MT3/750-600d' : return  15437;
case 'BDrw-MT3/750-600e' : return  30259;
case 'BDrw-MT3/750-700' : return  15440;
case 'BDrw-MT3/750-700a' : return  15441;
case 'BDrw-MT3/750-700b' : return  15444;
case 'BDrw-MT3/750-700c' : return  15446;
case 'BDrw-MT3/750-700d' : return  15451;
case 'BDrw-MT3/750-700e' : return  30263;
case 'BDrw-MT3/750-800' : return  15454;
case 'BDrw-MT3/750-800a' : return  15455;
case 'BDrw-MT3/750-800b' : return  15458;
case 'BDrw-MT3/750-800c' : return  15460;
case 'BDrw-MT3/750-800d' : return  15465;
case 'BDrw-MT3/750-800e' : return  30267;
case 'BDrw-MT3/750-900' : return  15468;
case 'BDrw-MT3/750-900a' : return  15469;
case 'BDrw-MT3/750-900b' : return  15472;
case 'BDrw-MT3/750-900c' : return  15474;
case 'BDrw-MT3/750-900d' : return  15479;
case 'BDrw-MT3/750-900e' : return  30271;
case 'BDrw-MT3/900-400' : return  15482;
case 'BDrw-MT3/900-400a' : return  15483;
case 'BDrw-MT3/900-400b' : return  15486;
case 'BDrw-MT3/900-400c' : return  15488;
case 'BDrw-MT3/900-400d' : return  15493;
case 'BDrw-MT3/900-400e' : return  30275;
case 'BDrw-MT3/900-500' : return  15496;
case 'BDrw-MT3/900-500a' : return  15497;
case 'BDrw-MT3/900-500b' : return  15500;
case 'BDrw-MT3/900-500c' : return  15502;
case 'BDrw-MT3/900-500d' : return  15507;
case 'BDrw-MT3/900-500e' : return  30279;
case 'BDrw-MT3/900-600' : return  15510;
case 'BDrw-MT3/900-600a' : return  15511;
case 'BDrw-MT3/900-600b' : return  15514;
case 'BDrw-MT3/900-600c' : return  15516;
case 'BDrw-MT3/900-600d' : return  15521;
case 'BDrw-MT3/900-600e' : return  30283;
case 'BDrw-MT3/900-700' : return  15524;
case 'BDrw-MT3/900-700a' : return  15525;
case 'BDrw-MT3/900-700b' : return  15528;
case 'BDrw-MT3/900-700c' : return  15530;
case 'BDrw-MT3/900-700d' : return  15535;
case 'BDrw-MT3/900-700e' : return  30287;
case 'BDrw-MT3/900-800' : return  15538;
case 'BDrw-MT3/900-800a' : return  15539;
case 'BDrw-MT3/900-800b' : return  15542;
case 'BDrw-MT3/900-800c' : return  15544;
case 'BDrw-MT3/900-800d' : return  15549;
case 'BDrw-MT3/900-800e' : return  30291;
case 'BDrw-MT3/900-900' : return  15552;
case 'BDrw-MT3/900-900a' : return  15553;
case 'BDrw-MT3/900-900b' : return  15556;
case 'BDrw-MT3/900-900c' : return  15558;
case 'BDrw-MT3/900-900d' : return  15563;
case 'BDrw-MT3/900-900e' : return  30295;
case 'BDrw-MT4/750-400' : return  15566;
case 'BDrw-MT4/750-400a' : return  15567;
case 'BDrw-MT4/750-400b' : return  15570;
case 'BDrw-MT4/750-400c' : return  15572;
case 'BDrw-MT4/750-400d' : return  15577;
case 'BDrw-MT4/750-400e' : return  30252;
case 'BDrw-MT4/750-500' : return  15580;
case 'BDrw-MT4/750-500a' : return  15581;
case 'BDrw-MT4/750-500b' : return  15584;
case 'BDrw-MT4/750-500c' : return  15586;
case 'BDrw-MT4/750-500d' : return  15591;
case 'BDrw-MT4/750-500e' : return  30256;
case 'BDrw-MT4/750-600' : return  15594;
case 'BDrw-MT4/750-600a' : return  15595;
case 'BDrw-MT4/750-600b' : return  15598;
case 'BDrw-MT4/750-600c' : return  15600;
case 'BDrw-MT4/750-600d' : return  15605;
case 'BDrw-MT4/750-600e' : return  30260;
case 'BDrw-MT4/750-700' : return  15608;
case 'BDrw-MT4/750-700a' : return  15609;
case 'BDrw-MT4/750-700b' : return  15612;
case 'BDrw-MT4/750-700c' : return  15614;
case 'BDrw-MT4/750-700d' : return  15619;
case 'BDrw-MT4/750-700e' : return  30264;
case 'BDrw-MT4/750-800' : return  15622;
case 'BDrw-MT4/750-800a' : return  15623;
case 'BDrw-MT4/750-800b' : return  15626;
case 'BDrw-MT4/750-800c' : return  15628;
case 'BDrw-MT4/750-800d' : return  15633;
case 'BDrw-MT4/750-800e' : return  30268;
case 'BDrw-MT4/750-900' : return  15636;
case 'BDrw-MT4/750-900a' : return  15637;
case 'BDrw-MT4/750-900b' : return  15640;
case 'BDrw-MT4/750-900c' : return  15642;
case 'BDrw-MT4/750-900d' : return  15647;
case 'BDrw-MT4/750-900e' : return  30272;
case 'BDrw-MT4/900-400' : return  15650;
case 'BDrw-MT4/900-400a' : return  15651;
case 'BDrw-MT4/900-400b' : return  15654;
case 'BDrw-MT4/900-400c' : return  15656;
case 'BDrw-MT4/900-400d' : return  15661;
case 'BDrw-MT4/900-400e' : return  30276;
case 'BDrw-MT4/900-500' : return  15664;
case 'BDrw-MT4/900-500a' : return  15665;
case 'BDrw-MT4/900-500b' : return  15668;
case 'BDrw-MT4/900-500c' : return  15670;
case 'BDrw-MT4/900-500d' : return  15675;
case 'BDrw-MT4/900-500e' : return  30280;
case 'BDrw-MT4/900-600' : return  15678;
case 'BDrw-MT4/900-600a' : return  15679;
case 'BDrw-MT4/900-600b' : return  15682;
case 'BDrw-MT4/900-600c' : return  15684;
case 'BDrw-MT4/900-600d' : return  15689;
case 'BDrw-MT4/900-600e' : return  30284;
case 'BDrw-MT4/900-700' : return  15692;
case 'BDrw-MT4/900-700a' : return  15693;
case 'BDrw-MT4/900-700b' : return  15696;
case 'BDrw-MT4/900-700c' : return  15698;
case 'BDrw-MT4/900-700d' : return  15703;
case 'BDrw-MT4/900-700e' : return  30288;
case 'BDrw-MT4/900-800' : return  15706;
case 'BDrw-MT4/900-800a' : return  15707;
case 'BDrw-MT4/900-800b' : return  15710;
case 'BDrw-MT4/900-800c' : return  15712;
case 'BDrw-MT4/900-800d' : return  15717;
case 'BDrw-MT4/900-800e' : return  30292;
case 'BDrw-MT4/900-900' : return  15720;
case 'BDrw-MT4/900-900a' : return  15721;
case 'BDrw-MT4/900-900b' : return  15724;
case 'BDrw-MT4/900-900c' : return  15726;
case 'BDrw-MT4/900-900d' : return  15731;
case 'BDrw-MT4/900-900e' : return  30296;
case 'BDrw-MT5/750-400' : return  15734;
case 'BDrw-MT5/750-400a' : return  15735;
case 'BDrw-MT5/750-400b' : return  15738;
case 'BDrw-MT5/750-400c' : return  15740;
case 'BDrw-MT5/750-400d' : return  15745;
case 'BDrw-MT5/750-400e' : return  30253;
case 'BDrw-MT5/750-500' : return  15748;
case 'BDrw-MT5/750-500a' : return  15749;
case 'BDrw-MT5/750-500b' : return  15752;
case 'BDrw-MT5/750-500c' : return  15754;
case 'BDrw-MT5/750-500d' : return  15759;
case 'BDrw-MT5/750-500e' : return  30257;
case 'BDrw-MT5/750-600' : return  15762;
case 'BDrw-MT5/750-600a' : return  15763;
case 'BDrw-MT5/750-600b' : return  15766;
case 'BDrw-MT5/750-600c' : return  15768;
case 'BDrw-MT5/750-600d' : return  15773;
case 'BDrw-MT5/750-600e' : return  30261;
case 'BDrw-MT5/750-700' : return  15776;
case 'BDrw-MT5/750-700a' : return  15777;
case 'BDrw-MT5/750-700b' : return  15780;
case 'BDrw-MT5/750-700c' : return  15782;
case 'BDrw-MT5/750-700d' : return  15787;
case 'BDrw-MT5/750-700e' : return  30265;
case 'BDrw-MT5/750-800' : return  15790;
case 'BDrw-MT5/750-800a' : return  15791;
case 'BDrw-MT5/750-800b' : return  15794;
case 'BDrw-MT5/750-800c' : return  15796;
case 'BDrw-MT5/750-800d' : return  15801;
case 'BDrw-MT5/750-800e' : return  30269;
case 'BDrw-MT5/750-900' : return  15804;
case 'BDrw-MT5/750-900a' : return  15805;
case 'BDrw-MT5/750-900b' : return  15808;
case 'BDrw-MT5/750-900c' : return  15810;
case 'BDrw-MT5/750-900d' : return  15815;
case 'BDrw-MT5/750-900e' : return  30273;
case 'BDrw-MT5/900-400' : return  15818;
case 'BDrw-MT5/900-400a' : return  15819;
case 'BDrw-MT5/900-400b' : return  15822;
case 'BDrw-MT5/900-400c' : return  15824;
case 'BDrw-MT5/900-400d' : return  15829;
case 'BDrw-MT5/900-400e' : return  30277;
case 'BDrw-MT5/900-500' : return  15832;
case 'BDrw-MT5/900-500a' : return  15833;
case 'BDrw-MT5/900-500b' : return  15836;
case 'BDrw-MT5/900-500c' : return  15838;
case 'BDrw-MT5/900-500d' : return  15843;
case 'BDrw-MT5/900-500e' : return  30281;
case 'BDrw-MT5/900-600' : return  15846;
case 'BDrw-MT5/900-600a' : return  15847;
case 'BDrw-MT5/900-600b' : return  15850;
case 'BDrw-MT5/900-600c' : return  15852;
case 'BDrw-MT5/900-600d' : return  15857;
case 'BDrw-MT5/900-600e' : return  30285;
case 'BDrw-MT5/900-700' : return  15860;
case 'BDrw-MT5/900-700a' : return  15861;
case 'BDrw-MT5/900-700b' : return  15864;
case 'BDrw-MT5/900-700c' : return  15866;
case 'BDrw-MT5/900-700d' : return  15871;
case 'BDrw-MT5/900-700e' : return  30289;
case 'BDrw-MT5/900-800' : return  15874;
case 'BDrw-MT5/900-800a' : return  15875;
case 'BDrw-MT5/900-800b' : return  15878;
case 'BDrw-MT5/900-800c' : return  15880;
case 'BDrw-MT5/900-800d' : return  15885;
case 'BDrw-MT5/900-800e' : return  30293;
case 'BDrw-MT5/900-900' : return  15888;
case 'BDrw-MT5/900-900a' : return  15889;
case 'BDrw-MT5/900-900b' : return  15892;
case 'BDrw-MT5/900-900c' : return  15894;
case 'BDrw-MT5/900-900d' : return  15899;
case 'BDrw-MT5/900-900e' : return  30297;
case 'BOA-S1/1200-500' : return  20972;
case 'BOA-S1/1200-500a' : return  24915;
case 'BOA-S1/1200-500b' : return  25015;
case 'BOA-S1/1200-500c' : return  25115;
case 'BOA-S1/1200-500d' : return  25315;
case 'BOA-S1/1200-500e' : return  31085;
case 'BOA-S1/1200-600' : return  20973;
case 'BOA-S1/1200-600a' : return  24916;
case 'BOA-S1/1200-600b' : return  25016;
case 'BOA-S1/1200-600c' : return  25116;
case 'BOA-S1/1200-600d' : return  25316;
case 'BOA-S1/1200-600e' : return  31086;
case 'BOA-S1/1200-700c' : return  25117;
case 'BOA-S1/1200-700d' : return  25317;
case 'BOA-S1/750-500' : return  20966;
case 'BOA-S1/750-500a' : return  24909;
case 'BOA-S1/750-500b' : return  25009;
case 'BOA-S1/750-500c' : return  25109;
case 'BOA-S1/750-500d' : return  25309;
case 'BOA-S1/750-500e' : return  31081;
case 'BOA-S1/750-600' : return  20967;
case 'BOA-S1/750-600a' : return  24910;
case 'BOA-S1/750-600b' : return  25010;
case 'BOA-S1/750-600c' : return  25110;
case 'BOA-S1/750-600d' : return  25310;
case 'BOA-S1/750-600e' : return  31082;
case 'BOA-S1/750-700c' : return  25111;
case 'BOA-S1/750-700d' : return  25311;
case 'BOA-S1/900-500' : return  20969;
case 'BOA-S1/900-500a' : return  24912;
case 'BOA-S1/900-500b' : return  25012;
case 'BOA-S1/900-500c' : return  25112;
case 'BOA-S1/900-500d' : return  25312;
case 'BOA-S1/900-500e' : return  31083;
case 'BOA-S1/900-600' : return  20970;
case 'BOA-S1/900-600a' : return  24913;
case 'BOA-S1/900-600b' : return  25013;
case 'BOA-S1/900-600c' : return  25113;
case 'BOA-S1/900-600d' : return  25313;
case 'BOA-S1/900-600e' : return  31084;
case 'BOA-S1/900-700c' : return  25114;
case 'BOA-S1/900-700d' : return  25314;
case 'BO-S1/750-1000' : return  20874;
case 'BO-S1/750-1000a' : return  24842;
case 'BO-S1/750-1000b' : return  24942;
case 'BO-S1/750-1000c' : return  25042;
case 'BO-S1/750-1000d' : return  25242;
case 'BO-S1/750-1000e' : return  31058;
case 'BO-S1/750-1100' : return  20875;
case 'BO-S1/750-1100a' : return  24843;
case 'BO-S1/750-1100b' : return  24943;
case 'BO-S1/750-1100c' : return  25043;
case 'BO-S1/750-1100d' : return  25243;
case 'BO-S1/750-1100e' : return  31059;
case 'BO-S1/750-1200' : return  20876;
case 'BO-S1/750-1200a' : return  24844;
case 'BO-S1/750-1200b' : return  24944;
case 'BO-S1/750-1200c' : return  25044;
case 'BO-S1/750-1200d' : return  25244;
case 'BO-S1/750-1200e' : return  31060;
case 'BO-S1/750-300' : return  20867;
case 'BO-S1/750-300a' : return  24835;
case 'BO-S1/750-300b' : return  24935;
case 'BO-S1/750-300c' : return  25035;
case 'BO-S1/750-300d' : return  25235;
case 'BO-S1/750-300e' : return  31051;
case 'BO-S1/750-400' : return  20868;
case 'BO-S1/750-400a' : return  24836;
case 'BO-S1/750-400b' : return  24936;
case 'BO-S1/750-400c' : return  25036;
case 'BO-S1/750-400d' : return  25236;
case 'BO-S1/750-400e' : return  31052;
case 'BO-S1/750-500' : return  20869;
case 'BO-S1/750-500a' : return  24837;
case 'BO-S1/750-500b' : return  24937;
case 'BO-S1/750-500c' : return  25037;
case 'BO-S1/750-500d' : return  25237;
case 'BO-S1/750-500e' : return  31053;
case 'BO-S1/750-600' : return  20870;
case 'BO-S1/750-600a' : return  24838;
case 'BO-S1/750-600b' : return  24938;
case 'BO-S1/750-600c' : return  25038;
case 'BO-S1/750-600d' : return  25238;
case 'BO-S1/750-600e' : return  31054;
case 'BO-S1/750-700' : return  20871;
case 'BO-S1/750-700a' : return  24839;
case 'BO-S1/750-700b' : return  24939;
case 'BO-S1/750-700c' : return  25039;
case 'BO-S1/750-700d' : return  25239;
case 'BO-S1/750-700e' : return  31055;
case 'BO-S1/750-800' : return  20872;
case 'BO-S1/750-800a' : return  24840;
case 'BO-S1/750-800b' : return  24940;
case 'BO-S1/750-800c' : return  25040;
case 'BO-S1/750-800d' : return  25240;
case 'BO-S1/750-800e' : return  31056;
case 'BO-S1/750-900' : return  20873;
case 'BO-S1/750-900a' : return  24841;
case 'BO-S1/750-900b' : return  24941;
case 'BO-S1/750-900c' : return  25041;
case 'BO-S1/750-900d' : return  25241;
case 'BO-S1/750-900e' : return  31057;
case 'BO-S1/900-1000' : return  20885;
case 'BO-S1/900-1000a' : return  24852;
case 'BO-S1/900-1000b' : return  24952;
case 'BO-S1/900-1000d' : return  25252;
case 'BO-S1/900-1000e' : return  31068;
case 'BO-S1/900-100c' : return  25052;
case 'BO-S1/900-1100' : return  20886;
case 'BO-S1/900-1100a' : return  24853;
case 'BO-S1/900-1100b' : return  24953;
case 'BO-S1/900-1100c' : return  25053;
case 'BO-S1/900-1100d' : return  25253;
case 'BO-S1/900-1100e' : return  31069;
case 'BO-S1/900-1200' : return  20887;
case 'BO-S1/900-1200a' : return  24854;
case 'BO-S1/900-1200b' : return  24954;
case 'BO-S1/900-1200c' : return  25054;
case 'BO-S1/900-1200d' : return  25254;
case 'BO-S1/900-1200e' : return  31070;
case 'BO-S1/900-300' : return  20878;
case 'BO-S1/900-300a' : return  24845;
case 'BO-S1/900-300b' : return  24945;
case 'BO-S1/900-300c' : return  25045;
case 'BO-S1/900-300d' : return  25245;
case 'BO-S1/900-300e' : return  31061;
case 'BO-S1/900-400' : return  20879;
case 'BO-S1/900-400a' : return  24846;
case 'BO-S1/900-400b' : return  24946;
case 'BO-S1/900-400c' : return  25046;
case 'BO-S1/900-400d' : return  25246;
case 'BO-S1/900-400e' : return  31062;
case 'BO-S1/900-500' : return  20880;
case 'BO-S1/900-500a' : return  24847;
case 'BO-S1/900-500b' : return  24947;
case 'BO-S1/900-500c' : return  25047;
case 'BO-S1/900-500d' : return  25247;
case 'BO-S1/900-500e' : return  31063;
case 'BO-S1/900-600' : return  20881;
case 'BO-S1/900-600a' : return  24848;
case 'BO-S1/900-600b' : return  24948;
case 'BO-S1/900-600c' : return  25048;
case 'BO-S1/900-600d' : return  25248;
case 'BO-S1/900-600e' : return  31064;
case 'BO-S1/900-700' : return  20882;
case 'BO-S1/900-700a' : return  24849;
case 'BO-S1/900-700b' : return  24949;
case 'BO-S1/900-700c' : return  25049;
case 'BO-S1/900-700d' : return  25249;
case 'BO-S1/900-700e' : return  31065;
case 'BO-S1/900-800' : return  20883;
case 'BO-S1/900-800a' : return  24850;
case 'BO-S1/900-800b' : return  24950;
case 'BO-S1/900-800c' : return  25050;
case 'BO-S1/900-800d' : return  25250;
case 'BO-S1/900-800e' : return  31066;
case 'BO-S1/900-900' : return  20884;
case 'BO-S1/900-900a' : return  24851;
case 'BO-S1/900-900b' : return  24951;
case 'BO-S1/900-900c' : return  25051;
case 'BO-S1/900-900d' : return  25251;
case 'BO-S1/900900e' : return  31067;
case 'BTBL/25558' : return  25558;
case 'BTBR/25559' : return  25559;
case 'BTC/1' : return  215;
case 'BTD/19213' : return  19213;
case 'BTD/19227' : return  19227;
case 'BTD/19241' : return  19241;
case 'BTEL/19259' : return  19259;
case 'BTEL/19260' : return  19260;
case 'BTEL/19261' : return  19261;
case 'BTEL/224' : return  224;
case 'BTEL/3' : return  226;
case 'BTER/19266' : return  19266;
case 'BTER/19267' : return  19267;
case 'BTER/19268' : return  19268;
case 'BTER/2' : return  225;
case 'BTER/4' : return  227;
case 'BTLA/1' : return  216;
case 'BTLB/2' : return  217;
case 'BTLC/3' : return  218;
case 'BTLD/4' : return  219;
case 'BTLF/2' : return  229;
case 'BTLM/1' : return  228;
case 'BTRF/4' : return  231;
case 'BTRM/3' : return  230;
case 'BTS/19212' : return  19212;
case 'BTS/19226' : return  19226;
case 'BTS/19240' : return  19240;
case 'BTUA/1' : return  220;
case 'BTUB/2' : return  221;
case 'BTUC/3' : return  222;
case 'BTUD/4' : return  223;
case 'Door/1200-300' : return  9284;
case 'Door/1200-300a' : return  10823;
case 'Door/1200-300b' : return  11351;
case 'Door/1200-300c' : return  13276;
case 'Door/1200-300d' : return  14692;
case 'Door/1200-300e' : return  30717;
case 'Door/1200-400' : return  9286;
case 'Door/1200-400a' : return  10824;
case 'Door/1200-400b' : return  11352;
case 'Door/1200-400c' : return  13279;
case 'Door/1200-400d' : return  14695;
case 'Door/1200-400e' : return  30718;
case 'Door/1200-500' : return  9289;
case 'Door/1200-500a' : return  10825;
case 'Door/1200-500b' : return  11353;
case 'Door/1200-500c' : return  13283;
case 'Door/1200-500d' : return  14699;
case 'Door/1200-500e' : return  30719;
case 'Door/1200-600' : return  9292;
case 'Door/1200-600a' : return  10826;
case 'Door/1200-600b' : return  11354;
case 'Door/1200-600c' : return  13287;
case 'Door/1200-600d' : return  14703;
case 'Door/1200-600e' : return  30720;
case 'Door/1450-300' : return  9302;
case 'Door/1450-300a' : return  10827;
case 'Door/1450-300b' : return  11355;
case 'Door/1450-300c' : return  13298;
case 'Door/1450-300d' : return  14714;
case 'Door/1450-300e' : return  30721;
case 'Door/1450-400' : return  9304;
case 'Door/1450-400a' : return  10828;
case 'Door/1450-400b' : return  11356;
case 'Door/1450-400c' : return  13301;
case 'Door/1450-400d' : return  14717;
case 'Door/1450-400e' : return  30722;
case 'Door/1450-500' : return  9307;
case 'Door/1450-500a' : return  10829;
case 'Door/1450-500b' : return  11357;
case 'Door/1450-500c' : return  13305;
case 'Door/1450-500d' : return  14721;
case 'Door/1450-500e' : return  30723;
case 'Door/1450-600' : return  9310;
case 'Door/1450-600a' : return  10830;
case 'Door/1450-600b' : return  11358;
case 'Door/1450-600c' : return  13309;
case 'Door/1450-600d' : return  14725;
case 'Door/1450-600e' : return  30724;
case 'Door/1800-300' : return  9320;
case 'Door/1800-300a' : return  10831;
case 'Door/1800-300b' : return  11359;
case 'Door/1800-300c' : return  13320;
case 'Door/1800-300d' : return  14736;
case 'Door/1800-300e' : return  30725;
case 'Door/1800-400' : return  9322;
case 'Door/1800-400a' : return  10832;
case 'Door/1800-400b' : return  11360;
case 'Door/1800-400c' : return  13323;
case 'Door/1800-400d' : return  14739;
case 'Door/1800-400e' : return  30726;
case 'Door/1800-500' : return  9324;
case 'Door/1800-500a' : return  10833;
case 'Door/1800-500b' : return  11361;
case 'Door/1800-500c' : return  13326;
case 'Door/1800-500d' : return  14742;
case 'Door/1800-500e' : return  30727;
case 'Door/1800-600' : return  9326;
case 'Door/1800-600a' : return  10834;
case 'Door/1800-600b' : return  11362;
case 'Door/1800-600c' : return  13329;
case 'Door/1800-600d' : return  14745;
case 'Door/1800-600e' : return  30728;
case 'Door/2100-300' : return  9332;
case 'Door/2100-300a' : return  10835;
case 'Door/2100-300b' : return  11363;
case 'Door/2100-300c' : return  13336;
case 'Door/2100-300d' : return  14752;
case 'Door/2100-300e' : return  30729;
case 'Door/2100-400' : return  9334;
case 'Door/2100-400a' : return  10836;
case 'Door/2100-400b' : return  11364;
case 'Door/2100-400c' : return  13339;
case 'Door/2100-400d' : return  14755;
case 'Door/2100-400e' : return  30730;
case 'Door/2100-500' : return  9336;
case 'Door/2100-500a' : return  10837;
case 'Door/2100-500b' : return  11365;
case 'Door/2100-500c' : return  13342;
case 'Door/2100-500d' : return  14758;
case 'Door/2100-500e' : return  30731;
case 'Door/2100-600' : return  9338;
case 'Door/2100-600a' : return  10838;
case 'Door/2100-600b' : return  11366;
case 'Door/2100-600c' : return  13345;
case 'Door/2100-600d' : return  14761;
case 'Door/2100-600e' : return  30732;
case 'Door/2350-300' : return  9344;
case 'Door/2350-300a' : return  10839;
case 'Door/2350-300b' : return  11367;
case 'Door/2350-300c' : return  13352;
case 'Door/2350-300d' : return  14768;
case 'Door/2350-300e' : return  30733;
case 'Door/2350-400' : return  9346;
case 'Door/2350-400a' : return  10840;
case 'Door/2350-400b' : return  11368;
case 'Door/2350-400c' : return  13355;
case 'Door/2350-400d' : return  14771;
case 'Door/2350-400e' : return  30734;
case 'Door/2350-500' : return  9348;
case 'Door/2350-500a' : return  10841;
case 'Door/2350-500b' : return  11369;
case 'Door/2350-500c' : return  13358;
case 'Door/2350-500d' : return  14774;
case 'Door/2350-600' : return  9350;
case 'Door/2350-600a' : return  10842;
case 'Door/2350-600b' : return  11370;
case 'Door/2350-600c' : return  13361;
case 'Door/2350-600d' : return  14777;
case 'Door/2350-600e' : return  30736;
case 'Door/400-300' : return  9224;
case 'Door/400-300a' : return  10807;
case 'Door/400-300b' : return  11335;
case 'Door/400-300c' : return  13200;
case 'Door/400-300d' : return  14616;
case 'Door/400-300e' : return  30701;
case 'Door/400-400' : return  9226;
case 'Door/400-400a' : return  10808;
case 'Door/400-400b' : return  11336;
case 'Door/400-400c' : return  13203;
case 'Door/400-400d' : return  14619;
case 'Door/400-400e' : return  30702;
case 'Door/400-500' : return  9228;
case 'Door/400-500a' : return  10809;
case 'Door/400-500b' : return  11337;
case 'Door/400-500c' : return  13206;
case 'Door/400-500d' : return  14622;
case 'Door/400-500e' : return  30703;
case 'Door/400-600' : return  9230;
case 'Door/400-600a' : return  10810;
case 'Door/400-600b' : return  11338;
case 'Door/400-600c' : return  13209;
case 'Door/400-600d' : return  14625;
case 'Door/400-600e' : return  30704;
case 'Door/600-300' : return  9236;
case 'Door/600-300a' : return  10811;
case 'Door/600-300b' : return  11339;
case 'Door/600-300c' : return  13216;
case 'Door/600-300d' : return  14632;
case 'Door/600-300e' : return  30705;
case 'Door/600-400' : return  9238;
case 'Door/600-400a' : return  10812;
case 'Door/600-400b' : return  11340;
case 'Door/600-400c' : return  13219;
case 'Door/600-400d' : return  14635;
case 'Door/600-400e' : return  30706;
case 'Door/600-500' : return  9240;
case 'Door/600-500a' : return  10813;
case 'Door/600-500b' : return  11341;
case 'Door/600-500c' : return  13222;
case 'Door/600-500d' : return  14638;
case 'Door/600-500e' : return  30707;
case 'Door/600-600' : return  9242;
case 'Door/600-600a' : return  10814;
case 'Door/600-600b' : return  11342;
case 'Door/600-600c' : return  13225;
case 'Door/600-600d' : return  14641;
case 'Door/600-600e' : return  30708;
case 'Door/750-300' : return  9248;
case 'Door/750-300a' : return  10815;
case 'Door/750-300b' : return  11343;
case 'Door/750-300c' : return  13232;
case 'Door/750-300d' : return  14648;
case 'Door/750-300e' : return  30709;
case 'Door/750-400' : return  9250;
case 'Door/750-400a' : return  10816;
case 'Door/750-400b' : return  11344;
case 'Door/750-400c' : return  13235;
case 'Door/750-400d' : return  14651;
case 'Door/750-400e' : return  30710;
case 'Door/750-500' : return  9253;
case 'Door/750-500a' : return  10817;
case 'Door/750-500b' : return  11345;
case 'Door/750-500c' : return  13239;
case 'Door/750-500d' : return  14655;
case 'Door/750-500e' : return  30711;
case 'Door/750-600' : return  9256;
case 'Door/750-600a' : return  5;
case 'Door/750-600b' : return  11346;
case 'Door/750-600c' : return  13243;
case 'Door/750-600d' : return  14659;
case 'Door/750-600e' : return  30712;
case 'Door/900-300' : return  9266;
case 'Door/900-300a' : return  10819;
case 'Door/900-300b' : return  11347;
case 'Door/900-300c' : return  13254;
case 'Door/900-300d' : return  14670;
case 'Door/900-300e' : return  30713;
case 'Door/900-400' : return  9268;
case 'Door/900-400a' : return  10820;
case 'Door/900-400b' : return  11348;
case 'Door/900-400c' : return  13257;
case 'Door/900-400d' : return  14673;
case 'Door/900-400e' : return  30714;
case 'Door/900-500' : return  9271;
case 'Door/900-500a' : return  10821;
case 'Door/900-500b' : return  11349;
case 'Door/900-500c' : return  13261;
case 'Door/900-500d' : return  14677;
case 'Door/900-500e' : return  30715;
case 'Door/900-600' : return  9274;
case 'Door/900-600a' : return  10822;
case 'Door/900-600b' : return  11350;
case 'Door/900-600c' : return  13265;
case 'Door/900-600d' : return  14681;
case 'Door/900-600e' : return  30716;
case 'Door/9348e' : return  30735;
case 'Filler/1200-100' : return  25566;
case 'Filler/1200-100a' : return  25570;
case 'Filler/1200-100b' : return  25574;
case 'Filler/1200-100c' : return  25578;
case 'Filler/1200-100e' : return  30692;
case 'Filler/1800-100' : return  25567;
case 'Filler/1800-100a' : return  25571;
case 'Filler/1800-100b' : return  25575;
case 'Filler/1800-100c' : return  25579;
case 'Filler/1800-100d' : return  25583;
case 'Filler/1800-100e' : return  30693;
case 'Filler/2350-100' : return  25568;
case 'Filler/2350-100a' : return  25572;
case 'Filler/2350-100b' : return  25576;
case 'Filler/2350-100c' : return  25580;
case 'Filler/2350-100d' : return  25584;
case 'Filler/2350-100e' : return  30694;
case 'Filler/750-100' : return  25565;
case 'Filler/750-100a' : return  25569;
case 'Filler/750-100b' : return  25573;
case 'Filler/750-100c' : return  25577;
case 'Filler/750-100d' : return  25581;
case 'Filler/750-100e' : return  30691;
case 'Handle/26059' : return  26059;
case 'Handle/26060' : return  26060;
case 'Handle/26061' : return  26061;
case 'Handle/26062' : return  26062;
case 'Handle/26064' : return  26064;
case 'Handle/26065' : return  26065;
case 'Handle/26066' : return  26066;
case 'Handle/26069' : return  26069;
case 'Handle/26070' : return  26070;
case 'Handle/272' : return  272;
case 'Handle/273' : return  273;
case 'Hardware/24753' : return  24753;
case 'Hardware/24754' : return  24754;
case 'Hardware/24755' : return  24755;
case 'Hardware/24756' : return  24756;
case 'Hardware/24757' : return  24757;
case 'Hardware/24758' : return  24758;
case 'Hardware/24759' : return  24759;
case 'Hardware/24760' : return  24760;
case 'Hardware/24761' : return  24761;
case 'Hardware/24762' : return  24762;
case 'Hardware/24763' : return  24763;
case 'Hardware/24764' : return  24764;
case 'Hardware/24765' : return  24765;
case 'Hardware/24766' : return  24766;
case 'Hardware/24767' : return  24767;
case 'Hardware/24768' : return  24768;
case 'Hardware/24769' : return  24769;
case 'Hardware/25587' : return  25587;
case 'Hardware/25588' : return  25588;
case 'Hardware/25592' : return  25592;
case 'Hardware/25594' : return  25594;
case 'Hardware/25595' : return  25595;
case 'Hardware/25596' : return  25596;
case 'Hardware/25597' : return  25597;
case 'Hardware/25598' : return  25598;
case 'Hardware/25599' : return  25599;
case 'Hardware/25600' : return  25600;
case 'Hardware/25601' : return  25601;
case 'Kick/200-1050' : return  20621;
case 'Kick/200-1050a' : return  20629;
case 'Kick/200-1050b' : return  24798;
case 'Kick/200-1050c' : return  20645;
case 'Kick/200-1050d' : return  24806;
case 'Kick/200-1050e' : return  30683;
case 'Kick/200-1200' : return  20622;
case 'Kick/200-1200a' : return  20630;
case 'Kick/200-1200b' : return  24799;
case 'Kick/200-1200c' : return  20646;
case 'Kick/200-1200d' : return  24807;
case 'Kick/200-1200e' : return  30684;
case 'Kick/200-1500' : return  20623;
case 'Kick/200-1500a' : return  20631;
case 'Kick/200-1500b' : return  24800;
case 'Kick/200-1500c' : return  20647;
case 'Kick/200-1500d' : return  24808;
case 'Kick/200-1500e' : return  30685;
case 'Kick/200-1800' : return  20624;
case 'Kick/200-1800a' : return  20632;
case 'Kick/200-1800b' : return  24801;
case 'Kick/200-1800c' : return  20648;
case 'Kick/200-1800d' : return  24809;
case 'Kick/200-1800e' : return  30686;
case 'Kick/200-2100' : return  20625;
case 'Kick/200-2100a' : return  20649;
case 'Kick/200-2100b' : return  20633;
case 'Kick/200-2100c' : return  24810;
case 'Kick/200-2100d' : return  24802;
case 'Kick/200-2100e' : return  30687;
case 'Kick/200-2350' : return  20626;
case 'Kick/200-2350a' : return  20634;
case 'Kick/200-2350b' : return  24803;
case 'Kick/200-2350c' : return  20650;
case 'Kick/200-2350d' : return  24811;
case 'Kick/200-2350e' : return  30688;
case 'Kick/200-750' : return  20619;
case 'Kick/200-750a' : return  20627;
case 'Kick/200-750b' : return  24796;
case 'Kick/200-750c' : return  20643;
case 'Kick/200-750d' : return  24804;
case 'Kick/200-750e' : return  30681;
case 'Kick/200-900' : return  20620;
case 'Kick/200-900a' : return  20628;
case 'Kick/200-900b' : return  24797;
case 'Kick/200-900c' : return  20644;
case 'Kick/200-900d' : return  24805;
case 'Kick/200-900e' : return  30682;
case 'Kick/200-300' : return  303;
case 'Kick/200-300a' : return  301;
case 'Kick/200-300b' : return  307;
case 'Kick/200-300c' : return  309;
case 'Kick/200-300d' : return  311;
case 'Kick/200-300e' : return  305;
case 'Kick/200-500' : return  302;
case 'Kick/200-500a' : return  300;
case 'Kick/200-500b' : return  306;
case 'Kick/200-500c' : return  308;
case 'Kick/200-500d' : return  310;
case 'Kick/200-500e' : return  304;
case 'LY-BM/24752' : return  24752;
case 'MW/500-600' : return  14970;
case 'MW/500-600a' : return  14972;
case 'MW/500-600b' : return  25825;
case 'MW/500-600c' : return  14974;
case 'MW/500-600d' : return  25827;
case 'MW/500-600e' : return  31191;
case 'MW/500-700' : return  14971;
case 'MW/500-700a' : return  14973;
case 'MW/500-700b' : return  25826;
case 'MW/500-700c' : return  14975;
case 'MW/500-700d' : return  25828;
case 'MW/500-700e' : return  31192;
case 'Panel/1200-1050' : return  9300;
case 'Panel/1200-1050a' : return  10773;
case 'Panel/1200-1050b' : return  11301;
case 'Panel/1200-1050c' : return  13296;
case 'Panel/1200-1050d' : return  14712;
case 'Panel/1200-1050e' : return  30646;
case 'Panel/1200-1200' : return  9301;
case 'Panel/1200-1200a' : return  10774;
case 'Panel/1200-1200b' : return  11302;
case 'Panel/1200-1200c' : return  13297;
case 'Panel/1200-1200d' : return  14713;
case 'Panel/1200-1200e' : return  30647;
case 'Panel/1200-300' : return  9285;
case 'Panel/1200-300a' : return  10767;
case 'Panel/1200-300b' : return  11295;
case 'Panel/1200-300c' : return  13278;
case 'Panel/1200-300d' : return  14694;
case 'Panel/1200-300e' : return  30640;
case 'Panel/1200-400' : return  9288;
case 'Panel/1200-400a' : return  10768;
case 'Panel/1200-400b' : return  11296;
case 'Panel/1200-400c' : return  13282;
case 'Panel/1200-400d' : return  14698;
case 'Panel/1200-400e' : return  30641;
case 'Panel/1200-500' : return  9291;
case 'Panel/1200-500a' : return  10769;
case 'Panel/1200-500b' : return  11297;
case 'Panel/1200-500c' : return  13286;
case 'Panel/1200-500d' : return  14702;
case 'Panel/1200-500e' : return  30642;
case 'Panel/1200-600' : return  9294;
case 'Panel/1200-600a' : return  10770;
case 'Panel/1200-600b' : return  11298;
case 'Panel/1200-600c' : return  13290;
case 'Panel/1200-600d' : return  14706;
case 'Panel/1200-600e' : return  30643;
case 'Panel/1200-750' : return  9296;
case 'Panel/1200-750a' : return  10771;
case 'Panel/1200-750b' : return  11299;
case 'Panel/1200-750c' : return  13292;
case 'Panel/1200-750d' : return  14708;
case 'Panel/1200-750e' : return  30644;
case 'Panel/1200-900' : return  9298;
case 'Panel/1200-900a' : return  10772;
case 'Panel/1200-900b' : return  11300;
case 'Panel/1200-900c' : return  13294;
case 'Panel/1200-900d' : return  14710;
case 'Panel/1200-900e' : return  30645;
case 'Panel/1450-1050' : return  9318;
case 'Panel/1450-1050a' : return  10781;
case 'Panel/1450-1050b' : return  11309;
case 'Panel/1450-1050c' : return  13318;
case 'Panel/1450-1050d' : return  14734;
case 'Panel/1450-1050e' : return  30654;
case 'Panel/1450-1200' : return  9319;
case 'Panel/1450-1200a' : return  10782;
case 'Panel/1450-1200b' : return  11310;
case 'Panel/1450-1200c' : return  13319;
case 'Panel/1450-1200d' : return  14735;
case 'Panel/1450-1200e' : return  30655;
case 'Panel/1450-300' : return  9303;
case 'Panel/1450-300a' : return  10775;
case 'Panel/1450-300b' : return  11303;
case 'Panel/1450-300c' : return  13300;
case 'Panel/1450-300d' : return  14716;
case 'Panel/1450-300e' : return  30648;
case 'Panel/1450-400' : return  9306;
case 'Panel/1450-400a' : return  10776;
case 'Panel/1450-400b' : return  11304;
case 'Panel/1450-400c' : return  13304;
case 'Panel/1450-400d' : return  14720;
case 'Panel/1450-400e' : return  30649;
case 'Panel/1450-5009' : return  9309;
case 'Panel/1450-500a' : return  10777;
case 'Panel/1450-500b' : return  11305;
case 'Panel/1450-500c' : return  13308;
case 'Panel/1450-500d' : return  14724;
case 'Panel/1450-500e' : return  30650;
case 'Panel/1450-600' : return  9312;
case 'Panel/1450-600a' : return  10778;
case 'Panel/1450-600b' : return  11306;
case 'Panel/1450-600c' : return  13312;
case 'Panel/1450-600d' : return  14728;
case 'Panel/1450-600e' : return  30651;
case 'Panel/1450-750' : return  9314;
case 'Panel/1450-750a' : return  10779;
case 'Panel/1450-750b' : return  11307;
case 'Panel/1450-750c' : return  13314;
case 'Panel/1450-750d' : return  14730;
case 'Panel/1450-750e' : return  30652;
case 'Panel/1450-900' : return  9316;
case 'Panel/1450-900a' : return  10780;
case 'Panel/1450-900b' : return  11308;
case 'Panel/1450-900c' : return  13316;
case 'Panel/1450-900d' : return  14732;
case 'Panel/1450-900e' : return  30653;
case 'Panel/1800-1050' : return  9330;
case 'Panel/1800-1050a' : return  10789;
case 'Panel/1800-1050b' : return  11317;
case 'Panel/1800-1050c' : return  13334;
case 'Panel/1800-1050d' : return  14750;
case 'Panel/1800-1050e' : return  30662;
case 'Panel/1800-1200' : return  9331;
case 'Panel/1800-1200a' : return  10790;
case 'Panel/1800-1200b' : return  11318;
case 'Panel/1800-1200c' : return  13335;
case 'Panel/1800-1200d' : return  14751;
case 'Panel/1800-1200e' : return  30663;
case 'Panel/1800-300' : return  9321;
case 'Panel/1800-300a' : return  10783;
case 'Panel/1800-300b' : return  11311;
case 'Panel/1800-300c' : return  13322;
case 'Panel/1800-300d' : return  14738;
case 'Panel/1800-300e' : return  30656;
case 'Panel/1800-400' : return  9323;
case 'Panel/1800-400a' : return  10784;
case 'Panel/1800-400b' : return  11312;
case 'Panel/1800-400c' : return  13325;
case 'Panel/1800-400d' : return  14741;
case 'Panel/1800-400e' : return  30657;
case 'Panel/1800-500' : return  9325;
case 'Panel/1800-500a' : return  10785;
case 'Panel/1800-500b' : return  11313;
case 'Panel/1800-500c' : return  13328;
case 'Panel/1800-500d' : return  14744;
case 'Panel/1800-500e' : return  30658;
case 'Panel/1800-600' : return  9327;
case 'Panel/1800-600a' : return  10786;
case 'Panel/1800-600b' : return  11314;
case 'Panel/1800-600c' : return  13331;
case 'Panel/1800-600d' : return  14747;
case 'Panel/1800-600e' : return  30659;
case 'Panel/1800-750' : return  9328;
case 'Panel/1800-750a' : return  10787;
case 'Panel/1800-750b' : return  11315;
case 'Panel/1800-750c' : return  13332;
case 'Panel/1800-750d' : return  14748;
case 'Panel/1800-750e' : return  30660;
case 'Panel/1800-900' : return  9329;
case 'Panel/1800-900a' : return  10788;
case 'Panel/1800-900b' : return  11316;
case 'Panel/1800-900c' : return  13333;
case 'Panel/1800-900d' : return  14749;
case 'Panel/1800-900e' : return  30661;
case 'Panel/200-1050' : return  9222;
case 'Panel/200-1050a' : return  10733;
case 'Panel/200-1050b' : return  11261;
case 'Panel/200-1050c' : return  13198;
case 'Panel/200-1050d' : return  14614;
case 'Panel/200-1050e' : return  30607;
case 'Panel/200-1200' : return  9223;
case 'Panel/200-1200a' : return  10734;
case 'Panel/200-1200b' : return  11262;
case 'Panel/200-1200c' : return  13199;
case 'Panel/200-1200d' : return  14615;
case 'Panel/200-1200e' : return  30608;
case 'Panel/200-300' : return  9216;
case 'Panel/200-300a' : return  10727;
case 'Panel/200-300b' : return  11255;
case 'Panel/200-300c' : return  13192;
case 'Panel/200-300d' : return  14608;
case 'Panel/200-300e' : return  30601;
case 'Panel/200-400' : return  9217;
case 'Panel/200-400a' : return  10728;
case 'Panel/200-400b' : return  11256;
case 'Panel/200-400c' : return  13193;
case 'Panel/200-400d' : return  14609;
case 'Panel/200-400e' : return  30602;
case 'Panel/200-500' : return  9218;
case 'Panel/200-500a' : return  10729;
case 'Panel/200-500b' : return  11257;
case 'Panel/200-500c' : return  13194;
case 'Panel/200-500d' : return  14610;
case 'Panel/200-500e' : return  30603;
case 'Panel/200-600' : return  9219;
case 'Panel/200-600a' : return  10730;
case 'Panel/200-600b' : return  11258;
case 'Panel/200-600c' : return  13195;
case 'Panel/200-600d' : return  14611;
case 'Panel/200-600e' : return  30604;
case 'Panel/200-750' : return  9220;
case 'Panel/200-750a' : return  10731;
case 'Panel/200-750b' : return  11259;
case 'Panel/200-750c' : return  13196;
case 'Panel/200-750d' : return  14612;
case 'Panel/200-750e' : return  30605;
case 'Panel/200-900' : return  9221;
case 'Panel/200-900a' : return  10732;
case 'Panel/200-900b' : return  11260;
case 'Panel/200-900c' : return  13197;
case 'Panel/200-900d' : return  14613;
case 'Panel/200-900e' : return  30606;
case 'Panel/20804' : return  20804;
case 'Panel/2100-1050' : return  9342;
case 'Panel/2100-1050a' : return  10797;
case 'Panel/2100-1050b' : return  11325;
case 'Panel/2100-1050c' : return  13350;
case 'Panel/2100-1050d' : return  14766;
case 'Panel/2100-1050e' : return  30670;
case 'Panel/2100-1200' : return  9343;
case 'Panel/2100-1200a' : return  10798;
case 'Panel/2100-1200b' : return  11326;
case 'Panel/2100-1200c' : return  13351;
case 'Panel/2100-1200d' : return  14767;
case 'Panel/2100-1200e' : return  30671;
case 'Panel/2100-300' : return  9333;
case 'Panel/2100-300a' : return  10791;
case 'Panel/2100-300b' : return  11319;
case 'Panel/2100-300c' : return  13338;
case 'Panel/2100-300d' : return  14754;
case 'Panel/2100-300e' : return  30664;
case 'Panel/2100-400' : return  9335;
case 'Panel/2100-400a' : return  10792;
case 'Panel/2100-400b' : return  11320;
case 'Panel/2100-400c' : return  13341;
case 'Panel/2100-400d' : return  14757;
case 'Panel/2100-400e' : return  30665;
case 'Panel/2100-500' : return  9337;
case 'Panel/2100-500a' : return  10793;
case 'Panel/2100-500b' : return  11321;
case 'Panel/2100-500c' : return  13344;
case 'Panel/2100-500d' : return  14760;
case 'Panel/2100-500e' : return  30666;
case 'Panel/2100-600' : return  9339;
case 'Panel/2100-600a' : return  10794;
case 'Panel/2100-600b' : return  11322;
case 'Panel/2100-600c' : return  13347;
case 'Panel/2100-600d' : return  14763;
case 'Panel/2100-600e' : return  30667;
case 'Panel/2100-750' : return  9340;
case 'Panel/2100-750a' : return  10795;
case 'Panel/2100-750b' : return  11323;
case 'Panel/2100-750c' : return  13348;
case 'Panel/2100-750d' : return  14764;
case 'Panel/2100-750e' : return  30668;
case 'Panel/2100-900' : return  9341;
case 'Panel/2100-900a' : return  10796;
case 'Panel/2100-900b' : return  11324;
case 'Panel/2100-900c' : return  13349;
case 'Panel/2100-900d' : return  14765;
case 'Panel/2100-900e' : return  30669;
case 'Panel/2350-1050' : return  9354;
case 'Panel/2350-1050b' : return  11333;
case 'Panel/2350-1050c' : return  13366;
case 'Panel/2350-1050d' : return  14782;
case 'Panel/2350-1050e' : return  30678;
case 'Panel/2350-105a' : return  10805;
case 'Panel/2350-1200' : return  9355;
case 'Panel/2350-1200a' : return  10806;
case 'Panel/2350-1200b' : return  11334;
case 'Panel/2350-1200c' : return  13367;
case 'Panel/2350-1200d' : return  14783;
case 'Panel/2350-1200e' : return  30679;
case 'Panel/2350-300' : return  9345;
case 'Panel/2350-300a' : return  10799;
case 'Panel/2350-300b' : return  11327;
case 'Panel/2350-300c' : return  13354;
case 'Panel/2350-300d' : return  14770;
case 'Panel/2350-300e' : return  30672;
case 'Panel/2350-400' : return  9347;
case 'Panel/2350-400a' : return  10800;
case 'Panel/2350-400b' : return  11328;
case 'Panel/2350-400c' : return  13357;
case 'Panel/2350-400d' : return  14773;
case 'Panel/2350-400e' : return  30673;
case 'Panel/2350-500' : return  9349;
case 'Panel/2350-500a' : return  10801;
case 'Panel/2350-500b' : return  11329;
case 'Panel/2350-500c' : return  13360;
case 'Panel/2350-500d' : return  14776;
case 'Panel/2350-500e' : return  30674;
case 'Panel/2350-600' : return  9351;
case 'Panel/2350-600a' : return  10802;
case 'Panel/2350-600b' : return  11330;
case 'Panel/2350-600c' : return  13363;
case 'Panel/2350-600d' : return  14779;
case 'Panel/2350-600e' : return  30675;
case 'Panel/2350-750' : return  9352;
case 'Panel/2350-750a' : return  10803;
case 'Panel/2350-750b' : return  11331;
case 'Panel/2350-750c' : return  13364;
case 'Panel/2350-750d' : return  14780;
case 'Panel/2350-750e' : return  30676;
case 'Panel/2350-900' : return  9353;
case 'Panel/2350-900a' : return  10804;
case 'Panel/2350-900b' : return  11332;
case 'Panel/2350-900c' : return  13365;
case 'Panel/2350-900d' : return  14781;
case 'Panel/2350-900e' : return  30677;
case 'Panel/400-1050' : return  9234;
case 'Panel/400-1050a' : return  10741;
case 'Panel/400-1050b' : return  11269;
case 'Panel/400-1050d' : return  14630;
case 'Panel/400-1050e' : return  30615;
case 'Panel/400-105c' : return  13214;
case 'Panel/400-1200' : return  9235;
case 'Panel/400-1200a' : return  10742;
case 'Panel/400-1200b' : return  11270;
case 'Panel/400-1200c' : return  13215;
case 'Panel/400-1200d' : return  14631;
case 'Panel/400-1200e' : return  30616;
case 'Panel/400-300' : return  9225;
case 'Panel/400-300a' : return  10735;
case 'Panel/400-300b' : return  11263;
case 'Panel/400-300c' : return  13202;
case 'Panel/400-300d' : return  14618;
case 'Panel/400-300e' : return  30609;
case 'Panel/400-400' : return  9227;
case 'Panel/400-400a' : return  10736;
case 'Panel/400-400b' : return  11264;
case 'Panel/400-400c' : return  13205;
case 'Panel/400-400d' : return  14621;
case 'Panel/400-400e' : return  30610;
case 'Panel/400-500' : return  9229;
case 'Panel/400-500a' : return  10737;
case 'Panel/400-500b' : return  11265;
case 'Panel/400-500c' : return  13208;
case 'Panel/400-500d' : return  14624;
case 'Panel/400-500e' : return  30611;
case 'Panel/400-600' : return  9231;
case 'Panel/400-600a' : return  10738;
case 'Panel/400-600b' : return  11266;
case 'Panel/400-600c' : return  13211;
case 'Panel/400-600d' : return  14627;
case 'Panel/400-600e' : return  30612;
case 'Panel/400-750' : return  9232;
case 'Panel/400-750a' : return  10739;
case 'Panel/400-750b' : return  11267;
case 'Panel/400-750c' : return  13212;
case 'Panel/400-750d' : return  14628;
case 'Panel/400-750e' : return  30613;
case 'Panel/400-900' : return  9233;
case 'Panel/400-900a' : return  10740;
case 'Panel/400-900b' : return  11268;
case 'Panel/400-900c' : return  13213;
case 'Panel/400-900d' : return  14629;
case 'Panel/400-900e' : return  30614;
case 'Panel/600-1050' : return  9246;
case 'Panel/600-1050a' : return  10749;
case 'Panel/600-1050b' : return  11277;
case 'Panel/600-1050c' : return  13230;
case 'Panel/600-1050d' : return  14646;
case 'Panel/600-1050e' : return  30623;
case 'Panel/600-1200' : return  25345;
case 'Panel/600-1200a' : return  10750;
case 'Panel/600-1200b' : return  11278;
case 'Panel/600-1200c' : return  13231;
case 'Panel/600-1200d' : return  14647;
case 'Panel/600-1200e' : return  266;
case 'Panel/600-300' : return  9237;
case 'Panel/600-300a' : return  10743;
case 'Panel/600-300b' : return  11271;
case 'Panel/600-300c' : return  13218;
case 'Panel/600-300e' : return  30618;
case 'Panel/600-300d' : return  279;
case 'Panel/600-400' : return  9239;
case 'Panel/600-400a' : return  10744;
case 'Panel/600-400b' : return  11272;
case 'Panel/600-400c' : return  13221;
case 'Panel/600-400d' : return  14637;
case 'Panel/600-400e' : return  30619;
case 'Panel/600-500' : return  9241;
case 'Panel/600-500a' : return  10745;
case 'Panel/600-500b' : return  11273;
case 'Panel/600-500c' : return  13224;
case 'Panel/600-500d' : return  14640;
case 'Panel/600-500e' : return  30620;
case 'Panel/600-600' : return  9243;
case 'Panel/600-600a' : return  10746;
case 'Panel/600-600b' : return  11274;
case 'Panel/600-600c' : return  13227;
case 'Panel/600-600d' : return  14643;
case 'Panel/600-600e' : return  30621;
case 'Panel/600-750' : return  9244;
case 'Panel/600-750a' : return  10747;
case 'Panel/600-750b' : return  11275;
case 'Panel/600-750c' : return  13228;
case 'Panel/600-750d' : return  14644;
case 'Panel/600-750e' : return  30622;
case 'Panel/600-900' : return  9245;
case 'Panel/600-900a' : return  10748;
case 'Panel/600-900b' : return  11276;
case 'Panel/600-900c' : return  13229;
case 'Panel/600-900d' : return  7;
case 'Panel/600-900e' : return  30617;
case 'Panel/750-1050' : return  9264;
case 'Panel/750-1050a' : return  10757;
case 'Panel/750-1050b' : return  11285;
case 'Panel/750-1050c' : return  13252;
case 'Panel/750-1050d' : return  14668;
case 'Panel/750-1050e' : return  30630;
case 'Panel/750-1200' : return  9265;
case 'Panel/750-1200a' : return  10758;
case 'Panel/750-1200b' : return  11286;
case 'Panel/750-1200c' : return  13253;
case 'Panel/750-1200d' : return  14669;
case 'Panel/750-1200e' : return  30631;
case 'Panel/750-300' : return  9249;
case 'Panel/750-300a' : return  10751;
case 'Panel/750-300b' : return  11279;
case 'Panel/750-300c' : return  13234;
case 'Panel/750-300d' : return  14650;
case 'Panel/750-300e' : return  30624;
case 'Panel/750-400' : return  9252;
case 'Panel/750-400a' : return  10752;
case 'Panel/750-400b' : return  11280;
case 'Panel/750-400c' : return  13238;
case 'Panel/750-400d' : return  14654;
case 'Panel/750-400e' : return  30625;
case 'Panel/750-500' : return  9255;
case 'Panel/750-500a' : return  10753;
case 'Panel/750-500b' : return  11281;
case 'Panel/750-500c' : return  13242;
case 'Panel/750-500d' : return  14658;
case 'Panel/750-500e' : return  30626;
case 'Panel/750-600' : return  9258;
case 'Panel/750-600a' : return  10754;
case 'Panel/750-600b' : return  11282;
case 'Panel/750-600c' : return  13246;
case 'Panel/750-600d' : return  14662;
case 'Panel/750-600e' : return  30627;
case 'Panel/750-750' : return  9259;
case 'Panel/750-750a' : return  10755;
case 'Panel/750-750b' : return  11283;
case 'Panel/750-750c' : return  13248;
case 'Panel/750-750d' : return  14664;
case 'Panel/750-750e' : return  30628;
case 'Panel/750-900' : return  9262;
case 'Panel/750-900a' : return  10756;
case 'Panel/750-900b' : return  11284;
case 'Panel/750-900c' : return  13250;
case 'Panel/750-900d' : return  14666;
case 'Panel/750-900e' : return  30629;
case 'Panel/900-1050' : return  9282;
case 'Panel/900-1050a' : return  10765;
case 'Panel/900-1050b' : return  11293;
case 'Panel/900-1050c' : return  13274;
case 'Panel/900-1050d' : return  14690;
case 'Panel/900-1050e' : return  30638;
case 'Panel/900-1200' : return  9283;
case 'Panel/900-1200a' : return  10766;
case 'Panel/900-1200b' : return  11294;
case 'Panel/900-1200c' : return  13275;
case 'Panel/900-1200d' : return  14691;
case 'Panel/900-1200e' : return  30639;
case 'Panel/900-300' : return  9267;
case 'Panel/900-300a' : return  10759;
case 'Panel/900-300b' : return  11287;
case 'Panel/900-300c' : return  13256;
case 'Panel/900-300d' : return  14672;
case 'Panel/900-300e' : return  30632;
case 'Panel/900-400' : return  9270;
case 'Panel/900-400a' : return  10760;
case 'Panel/900-400b' : return  11288;
case 'Panel/900-400c' : return  13260;
case 'Panel/900-400d' : return  14676;
case 'Panel/900-400e' : return  30633;
case 'Panel/900-500' : return  9273;
case 'Panel/900-500a' : return  10761;
case 'Panel/900-500b' : return  11289;
case 'Panel/900-500c' : return  13264;
case 'Panel/900-500d' : return  14680;
case 'Panel/900-500e' : return  30634;
case 'Panel/900-600' : return  9276;
case 'Panel/900-600a' : return  10762;
case 'Panel/900-600b' : return  11290;
case 'Panel/900-600c' : return  13268;
case 'Panel/900-600d' : return  14684;
case 'Panel/900-600e' : return  30635;
case 'Panel/900-750' : return  9278;
case 'Panel/900-750a' : return  10763;
case 'Panel/900-750b' : return  11291;
case 'Panel/900-750c' : return  13270;
case 'Panel/900-750d' : return  14686;
case 'Panel/900-750e' : return  30636;
case 'Panel/900-900' : return  9280;
case 'Panel/900-900a' : return  10764;
case 'Panel/900-900b' : return  11292;
case 'Panel/900-900c' : return  13272;
case 'Panel/900-900d' : return  14688;
case 'Panel/900-900e' : return  30637;
case 'Panel-HMR/1200-1050' : return  6534;
case 'Panel-HMR/1200-1200' : return  6535;
case 'Panel-HMR/1200-300' : return  6519;
case 'Panel-HMR/1200-400' : return  6522;
case 'Panel-HMR/1200-500' : return  6525;
case 'Panel-HMR/1200-600' : return  6528;
case 'Panel-HMR/1200-750' : return  6530;
case 'Panel-HMR/1200-900' : return  6532;
case 'Panel-HMR/1450-1050' : return  6552;
case 'Panel-HMR/1450-1200' : return  6553;
case 'Panel-HMR/1450-300' : return  6537;
case 'Panel-HMR/1450-400' : return  6540;
case 'Panel-HMR/1450-5003' : return  6543;
case 'Panel-HMR/1450-600' : return  6546;
case 'Panel-HMR/1450-750' : return  6548;
case 'Panel-HMR/1450-900' : return  6550;
case 'Panel-HMR/1800-1050' : return  6564;
case 'Panel-HMR/1800-1200' : return  6565;
case 'Panel-HMR/1800-300' : return  6555;
case 'Panel-HMR/1800-400' : return  6557;
case 'Panel-HMR/1800-500' : return  6559;
case 'Panel-HMR/1800-600' : return  6561;
case 'Panel-HMR/1800-750' : return  6562;
case 'Panel-HMR/1800-900' : return  6563;
case 'Panel-HMR/200-1050' : return  6456;
case 'Panel-HMR/200-1200' : return  6457;
case 'Panel-HMR/200-300' : return  20607;
case 'Panel-HMR/200-400' : return  6449;
case 'Panel-HMR/200-500' : return  6451;
case 'Panel-HMR/200-600' : return  6453;
case 'Panel-HMR/200-750' : return  6454;
case 'Panel-HMR/200-900' : return  6455;
case 'Panel-HMR/2100-1050' : return  6576;
case 'Panel-HMR/2100-1200' : return  6577;
case 'Panel-HMR/2100-300' : return  6567;
case 'Panel-HMR/2100-400' : return  6569;
case 'Panel-HMR/2100-500' : return  6571;
case 'Panel-HMR/2100-600' : return  6573;
case 'Panel-HMR/2100-750' : return  6574;
case 'Panel-HMR/2100-900' : return  6575;
case 'Panel-HMR/2350-1050' : return  6588;
case 'Panel-HMR/2350-1200' : return  6589;
case 'Panel-HMR/2350-300' : return  6579;
case 'Panel-HMR/2350-400' : return  6581;
case 'Panel-HMR/2350-500' : return  6583;
case 'Panel-HMR/2350-600' : return  6585;
case 'Panel-HMR/2350-750' : return  6586;
case 'Panel-HMR/2350-900' : return  6587;
case 'Panel-HMR/241' : return  241;
case 'Panel-HMR/400-1050' : return  6468;
case 'Panel-HMR/400-1200' : return  6469;
case 'Panel-HMR/400-300' : return  6459;
case 'Panel-HMR/400-400' : return  6461;
case 'Panel-HMR/400-500' : return  6463;
case 'Panel-HMR/400-600' : return  6465;
case 'Panel-HMR/400-750' : return  6466;
case 'Panel-HMR/400-900' : return  6467;
case 'Panel-HMR/600-1050' : return  6480;
case 'Panel-HMR/600-1200' : return  6481;
case 'Panel-HMR/600-300' : return  6471;
case 'Panel-HMR/600-400' : return  6473;
case 'Panel-HMR/600-500' : return  6475;
case 'Panel-HMR/600-600' : return  6477;
case 'Panel-HMR/600-750' : return  6478;
case 'Panel-HMR/600-900' : return  6479;
case 'Panel-HMR/750-1050' : return  6498;
case 'Panel-HMR/750-1200' : return  6499;
case 'Panel-HMR/750-300' : return  282;
case 'Panel-HMR/750-400' : return  6486;
case 'Panel-HMR/750-500' : return  6489;
case 'Panel-HMR/750-600' : return  6492;
case 'Panel-HMR/750-750' : return  6493;
case 'Panel-HMR/750-900' : return  6496;
case 'Panel-HMR/900-1050' : return  6516;
case 'Panel-HMR/900-1200' : return  6517;
case 'Panel-HMR/900-300' : return  6501;
case 'Panel-HMR/900-400' : return  6504;
case 'Panel-HMR/900-500' : return  6507;
case 'Panel-HMR/900-600' : return  6510;
case 'Panel-HMR/900-750' : return  6512;
case 'Panel-HMR/900-900' : return  6514;
case 'PC-D1-S5/2150-1000' : return  20780;
case 'PC-D1-S5/2150-1000a' : return  25996;
case 'PC-D1-S5/2150-1000b' : return  25998;
case 'PC-D1-S5/2150-1000c' : return  26000;
case 'PC-D1-S5/2150-1000d' : return  26002;
case 'PC-D1-S5/2150-1000e' : return  30552;
case 'PC-D1-S5/2150-700' : return  18024;
case 'PC-D1-S5/2150-700a' : return  18030;
case 'PC-D1-S5/2150-700b' : return  18048;
case 'PC-D1-S5/2150-700c' : return  18060;
case 'PC-D1-S5/2150-700d' : return  18091;
case 'PC-D1-S5/2150-700e' : return  30550;
case 'PC-D1-S5/2150-900' : return  18028;
case 'PC-D1-S5/2150-900a' : return  18034;
case 'PC-D1-S5/2150-900b' : return  18052;
case 'PC-D1-S5/2150-900c' : return  18064;
case 'PC-D1-S5/2150-900d' : return  18095;
case 'PC-D1-S5/2150-900e' : return  30551;
case 'PC-D1-S5/2350-1000' : return  20781;
case 'PC-D1-S5/2350-1000a' : return  25997;
case 'PC-D1-S5/2350-1000b' : return  25999;
case 'PC-D1-S5/2350-1000c' : return  26001;
case 'PC-D1-S5/2350-1000d' : return  26004;
case 'PC-D1-S5/2350-1000e' : return  30555;
case 'PC-D1-S5/2350-700' : return  18108;
case 'PC-D1-S5/2350-700a' : return  18114;
case 'PC-D1-S5/2350-700b' : return  18132;
case 'PC-D1-S5/2350-700c' : return  18144;
case 'PC-D1-S5/2350-700d' : return  18174;
case 'PC-D1-S5/2350-700e' : return  30553;
case 'PC-D1-S5/2350-900' : return  18112;
case 'PC-D1-S5/2350-900a' : return  18118;
case 'PC-D1-S5/2350-900b' : return  18136;
case 'PC-D1-S5/2350-900c' : return  18148;
case 'PC-D1-S5/2350-900d' : return  18178;
case 'PC-D1-S5/2350-900e' : return  30554;
case 'P-D1-S5/2150-500' : return  25831;
case 'P-D1-S5/2150-500a' : return  25841;
case 'P-D1-S5/2150-500b' : return  25847;
case 'P-D1-S5/2150-500c' : return  25853;
case 'P-D1-S5/2150-500d' : return  25866;
case 'P-D1-S5/2150-500e' : return  30501;
case 'P-D1-S5/2150-600' : return  25834;
case 'P-D1-S5/2150-600a' : return  25843;
case 'P-D1-S5/2150-600b' : return  25849;
case 'P-D1-S5/2150-600c' : return  25855;
case 'P-D1-S5/2150-600d' : return  25868;
case 'P-D1-S5/2150-600e' : return  30503;
case 'P-D1-S5/2350-500' : return  25896;
case 'P-D1-S5/2350-500a' : return  25872;
case 'P-D1-S5/2350-500d' : return  25890;
case 'P-D1-S5/2350-500e' : return  30513;
case 'P-D1-S5/2350-600' : return  25898;
case 'P-D1-S5/2350-600a' : return  25874;
case 'P-D1-S5/2350-600b' : return  25880;
case 'P-D1-S5/2350-600c' : return  25886;
case 'P-D1-S5/2350-600d' : return  25892;
case 'P-D1-S5/2350-600e' : return  30515;
case 'P-D1-S5/25896b' : return  25878;
case 'P-D1-S5/25896c' : return  25884;
case 'P-D2-S5/2150-600' : return  25832;
case 'P-D2-S5/2150-600a' : return  25845;
case 'P-D2-S5/2150-600b' : return  25851;
case 'P-D2-S5/2150-600c' : return  25857;
case 'P-D2-S5/2150-600d' : return  25870;
case 'P-D2-S5/2150-600e' : return  30511;
case 'P-D2-S5/2150-700' : return  18025;
case 'P-D2-S5/2150-700a' : return  18031;
case 'P-D2-S5/2150-700b' : return  18049;
case 'P-D2-S5/2150-700c' : return  18061;
case 'P-D2-S5/2150-700d' : return  18092;
case 'P-D2-S5/2150-700e' : return  30505;
case 'P-D2-S5/2150-800' : return  25526;
case 'P-D2-S5/2150-800a' : return  25528;
case 'P-D2-S5/2150-800b' : return  25530;
case 'P-D2-S5/2150-800c' : return  25532;
case 'P-D2-S5/2150-800d' : return  25534;
case 'P-D2-S5/2150-800e' : return  30509;
case 'P-D2-S5/2150-900' : return  18027;
case 'P-D2-S5/2150-900a' : return  18033;
case 'P-D2-S5/2150-900b' : return  18051;
case 'P-D2-S5/2150-900c' : return  18063;
case 'P-D2-S5/2150-900d' : return  18094;
case 'P-D2-S5/2150-900e' : return  30507;
case 'P-D2-S5/2350-600' : return  25900;
case 'P-D2-S5/2350-600a' : return  25876;
case 'P-D2-S5/2350-600b' : return  25882;
case 'P-D2-S5/2350-600c' : return  25888;
case 'P-D2-S5/2350-600d' : return  25894;
case 'P-D2-S5/2350-600e' : return  30521;
case 'P-D2-S5/2350-700' : return  18109;
case 'P-D2-S5/2350-700a' : return  18115;
case 'P-D2-S5/2350-700b' : return  18133;
case 'P-D2-S5/2350-700c' : return  18145;
case 'P-D2-S5/2350-700d' : return  18175;
case 'P-D2-S5/2350-700e' : return  30517;
case 'P-D2-S5/2350-800' : return  25904;
case 'P-D2-S5/2350-800a' : return  25906;
case 'P-D2-S5/2350-800b' : return  25908;
case 'P-D2-S5/2350-800c' : return  25910;
case 'P-D2-S5/2350-800d' : return  25912;
case 'P-D2-S5/2350-800e' : return  30523;
case 'P-D2-S5/2350-900' : return  18111;
case 'P-D2-S5/2350-900a' : return  18117;
case 'P-D2-S5/2350-900b' : return  18135;
case 'P-D2-S5/2350-900c' : return  18147;
case 'P-D2-S5/2350-900d' : return  18177;
case 'P-D2-S5/2350-900e' : return  30519;
case 'PD-D1-S5/2150-1000' : return  25537;
case 'PD-D1-S5/2150-1000a' : return  25542;
case 'PD-D1-S5/2150-1000b' : return  25544;
case 'PD-D1-S5/2150-1000c' : return  25546;
case 'PD-D1-S5/2150-1000d' : return  25548;
case 'PD-D1-S5/2150-1000e' : return  30556;
case 'PD-D1-S5/2350-1000' : return  25539;
case 'PD-D1-S5/2350-1000a' : return  25543;
case 'PD-D1-S5/2350-1000b' : return  25545;
case 'PD-D1-S5/2350-1000c' : return  25547;
case 'PD-D1-S5/2350-1000d' : return  25549;
case 'PD-D1-S5/2350-1000e' : return  30558;
case 'PD-D2-S5/2150-1000' : return  26047;
case 'PD-D2-S5/2150-1000a' : return  26049;
case 'PD-D2-S5/2150-1000b' : return  26051;
case 'PD-D2-S5/2150-1000c' : return  26053;
case 'PD-D2-S5/2150-1000d' : return  26055;
case 'PD-D2-S5/2150-1000e' : return  30557;
case 'PD-D2-S5/2350-1000' : return  26048;
case 'PD-D2-S5/2350-1000a' : return  26050;
case 'PD-D2-S5/2350-1000b' : return  26052;
case 'PD-D2-S5/2350-1000c' : return  26054;
case 'PD-D2-S5/2350-1000d' : return  26056;
case 'PD-D2-S5/2350-1000e' : return  30559;
case 'RH-D2-S1/750-600' : return  19071;
case 'RH-D2-S1/750-600a' : return  19074;
case 'RH-D2-S1/750-600b' : return  19083;
case 'RH-D2-S1/750-600c' : return  19089;
case 'RH-D2-S1/750-600d' : return  19104;
case 'RH-D2-S1/750-600e' : return  31141;
case 'RH-D2-S1/750-700' : return  19072;
case 'RH-D2-S1/750-700a' : return  19075;
case 'RH-D2-S1/750-700b' : return  19084;
case 'RH-D2-S1/750-700c' : return  19090;
case 'RH-D2-S1/750-700d' : return  19105;
case 'RH-D2-S1/750-700e' : return  31142;
case 'RH-D2-S1/750-900' : return  19158;
case 'RH-D2-S1/750-900a' : return  19159;
case 'RH-D2-S1/750-900b' : return  19162;
case 'RH-D2-S1/750-900c' : return  19164;
case 'RH-D2-S1/750-900d' : return  19169;
case 'RH-D2-S1/750-900e' : return  31143;
case 'RH-D2-S1/900-600' : return  19113;
case 'RH-D2-S1/900-600a' : return  19116;
case 'RH-D2-S1/900-600b' : return  19125;
case 'RH-D2-S1/900-600c' : return  19131;
case 'RH-D2-S1/900-600d' : return  19146;
case 'RH-D2-S1/900-600e' : return  31144;
case 'RH-D2-S1/900-700' : return  19114;
case 'RH-D2-S1/900-700a' : return  19117;
case 'RH-D2-S1/900-700b' : return  19126;
case 'RH-D2-S1/900-700c' : return  19132;
case 'RH-D2-S1/900-700d' : return  19147;
case 'RH-D2-S1/900-700e' : return  31145;
case 'RH-D2-S1/900-900' : return  19172;
case 'RH-D2-S1/900-900a' : return  19173;
case 'RH-D2-S1/900-900b' : return  19176;
case 'RH-D2-S1/900-900c' : return  19178;
case 'RH-D2-S1/900-900d' : return  19183;
case 'RH-D2-S1/900-900e' : return  31146;
case 'RVBD/25761' : return  25761;
case 'RVBS/25760' : return  25760;
case 'TBA Cabinet/1' : return  20672;
case 'UBO/800-600a' : return  18317;
case 'UBO/800-700' : return  18257;
case 'UBO/800-600' : return  18201;
case 'UBO/800-600a' : return  18205;
case 'UBO/800-600b' : return  18217;
case 'UBO/800-600c' : return  18225;
case 'UBO/800-600d' : return  18245;
case 'UBO/800-600e' : return  31151;
case 'UBO/800-700a' : return  18261;
case 'UBO/800-700b' : return  18273;
case 'UBO/800-700c' : return  18281;
case 'UBO/800-700d' : return  18301;
case 'UBO/800-700e' : return  31155;
case 'UBO/800-800' : return  18313;
case 'UBO/800-800b' : return  18329;
case 'UBO/800-800c' : return  18337;
case 'UBO/800-800d' : return  18357;
case 'UBO/800-800e' : return  31159;
case 'UBO/800-900' : return  18369;
case 'UBO/800-900a' : return  18373;
case 'UBO/800-900b' : return  18385;
case 'UBO/800-900c' : return  18393;
case 'UBO/800-900d' : return  18413;
case 'UBO/800-900e' : return  31163;
case 'UBOD/800-700' : return  18259;
case 'UBOD/800-600' : return  18203;
case 'UBOD/800-600a' : return  18207;
case 'UBOD/800-600b' : return  18219;
case 'UBOD/800-600c' : return  18227;
case 'UBOD/800-600d' : return  18247;
case 'UBOD/800-600e' : return  31153;
case 'UBOD/800-700a' : return  18263;
case 'UBOD/800-700b' : return  18275;
case 'UBOD/800-700c' : return  18283;
case 'UBOD/800-700d' : return  18303;
case 'UBOD/800-700e' : return  31157;
case 'UBOD/800-800' : return  18331;
case 'UBOD/800-800a' : return  18359;
case 'UBOD/800-800b' : return  18319;
case 'UBOD/800-800c' : return  18315;
case 'UBOD/800-800d' : return  18339;
case 'UBOD/800-800e' : return  31161;
case 'UBOD/800-900' : return  18371;
case 'UBOD/800-900a' : return  18375;
case 'UBOD/800-900b' : return  18387;
case 'UBOD/800-900c' : return  18395;
case 'UBOD/800-900d' : return  18415;
case 'UBOD/800-900e' : return  31165;
case 'UBODV/800-700' : return  18260;
case 'UBODV/800-600' : return  18204;
case 'UBODV/800-600a' : return  18208;
case 'UBODV/800-600b' : return  18220;
case 'UBODV/800-600c' : return  18228;
case 'UBODV/800-600d' : return  18248;
case 'UBODV/800-600e' : return  31154;
case 'UBODV/800-700a' : return  18264;
case 'UBODV/800-700b' : return  18276;
case 'UBODV/800-700c' : return  18284;
case 'UBODV/800-700d' : return  18304;
case 'UBODV/800-700e' : return  31158;
case 'UBODV/800-800' : return  18316;
case 'UBODV/800-800a' : return  18320;
case 'UBODV/800-800b' : return  18332;
case 'UBODV/800-800c' : return  18340;
case 'UBODV/800-800d' : return  18360;
case 'UBODV/800-800e' : return  31162;
case 'UBODV/800-900' : return  18372;
case 'UBODV/800-900a' : return  18376;
case 'UBODV/800-900b' : return  18388;
case 'UBODV/800-900c' : return  18396;
case 'UBODV/800-900d' : return  18416;
case 'UBODV/800-900e' : return  31166;
case 'UBOV/800-700' : return  18258;
case 'UBOV/800-600' : return  18202;
case 'UBOV/800-600a' : return  18206;
case 'UBOV/800-600b' : return  18218;
case 'UBOV/800-600c' : return  18226;
case 'UBOV/800-600d' : return  18246;
case 'UBOV/800-600e' : return  31152;
case 'UBOV/800-700a' : return  18262;
case 'UBOV/800-700b' : return  18274;
case 'UBOV/800-700c' : return  18282;
case 'UBOV/800-700d' : return  18302;
case 'UBOV/800-700e' : return  31156;
case 'UBOV/800-800' : return  18314;
case 'UBOV/800-800a' : return  18318;
case 'UBOV/800-800b' : return  18330;
case 'UBOV/800-800c' : return  18338;
case 'UBOV/800-800d' : return  18358;
case 'UBOV/800-800e' : return  31160;
case 'UBOV/800-900' : return  18370;
case 'UBOV/800-900a' : return  18374;
case 'UBOV/800-900b' : return  18386;
case 'UBOV/800-900c' : return  18394;
case 'UBOV/800-900d' : return  18414;
case 'UBOV/800-900e' : return  31164;
case 'WB45-D1-S1/1200-600' : return  17690;
case 'WB45-D1-S1/1200-600a' : return  17696;
case 'WB45-D1-S1/1200-600b' : return  17714;
case 'WB45-D1-S1/1200-600c' : return  17726;
case 'WB45-D1-S1/1200-600d' : return  17756;
case 'WB45-D1-S1/1200-600e' : return  271;
case 'WB45-D1-S1/750-600' : return  17522;
case 'WB45-D1-S1/750-600a' : return  17528;
case 'WB45-D1-S1/750-600b' : return  17546;
case 'WB45-D1-S1/750-600c' : return  17558;
case 'WB45-D1-S1/750-600d' : return  17588;
case 'WB45-D1-S1/750-600e' : return  269;
case 'WB45-D1-S1/900-600' : return  17606;
case 'WB45-D1-S1/900-600a' : return  17612;
case 'WB45-D1-S1/900-600b' : return  17630;
case 'WB45-D1-S1/900-600c' : return  17642;
case 'WB45-D1-S1/900-600d' : return  17672;
case 'WB45-D1-S1/900-600e' : return  270;
case 'WC-D1-S1/1200-600' : return  17689;
case 'WC-D1-S1/1200-600a' : return  17695;
case 'WC-D1-S1/1200-600b' : return  17713;
case 'WC-D1-S1/1200-600c' : return  17725;
case 'WC-D1-S1/1200-600d' : return  17755;
case 'WC-D1-S1/1200-600e' : return  30456;
case 'WC-D1-S1/1200-700' : return  17691;
case 'WC-D1-S1/1200-700a' : return  17697;
case 'WC-D1-S1/1200-700b' : return  17715;
case 'WC-D1-S1/1200-700c' : return  17727;
case 'WC-D1-S1/1200-700d' : return  17757;
case 'WC-D1-S1/1200-700e' : return  30457;
case 'WC-D1-S1/1200-900' : return  17693;
case 'WC-D1-S1/1200-900a' : return  17699;
case 'WC-D1-S1/1200-900b' : return  17717;
case 'WC-D1-S1/1200-900c' : return  17729;
case 'WC-D1-S1/1200-900d' : return  17759;
case 'WC-D1-S1/1200-900e' : return  30458;
case 'WC-D1-S1/750-600' : return  17521;
case 'WC-D1-S1/750-600a' : return  17527;
case 'WC-D1-S1/750-600b' : return  17545;
case 'WC-D1-S1/750-600c' : return  17557;
case 'WC-D1-S1/750-600d' : return  17587;
case 'WC-D1-S1/750-600e' : return  30450;
case 'WC-D1-S1/750-700' : return  17523;
case 'WC-D1-S1/750-700a' : return  17529;
case 'WC-D1-S1/750-700b' : return  17547;
case 'WC-D1-S1/750-700c' : return  17559;
case 'WC-D1-S1/750-700d' : return  17589;
case 'WC-D1-S1/750-700e' : return  30451;
case 'WC-D1-S1/750-900' : return  17525;
case 'WC-D1-S1/750-900a' : return  17531;
case 'WC-D1-S1/750-900b' : return  17549;
case 'WC-D1-S1/750-900c' : return  17561;
case 'WC-D1-S1/750-900d' : return  17591;
case 'WC-D1-S1/750-900e' : return  30452;
case 'WC-D1-S1/900-600' : return  17605;
case 'WC-D1-S1/900-600a' : return  17611;
case 'WC-D1-S1/900-600b' : return  17629;
case 'WC-D1-S1/900-600c' : return  17641;
case 'WC-D1-S1/900-600d' : return  17671;
case 'WC-D1-S1/900-600e' : return  30453;
case 'WC-D1-S1/900-700' : return  17607;
case 'WC-D1-S1/900-700a' : return  17613;
case 'WC-D1-S1/900-700b' : return  17631;
case 'WC-D1-S1/900-700c' : return  17643;
case 'WC-D1-S1/900-700d' : return  17673;
case 'WC-D1-S1/900-700e' : return  30454;
case 'WC-D1-S1/900-900' : return  17609;
case 'WC-D1-S1/900-900a' : return  17615;
case 'WC-D1-S1/900-900b' : return  17633;
case 'WC-D1-S1/900-900c' : return  17645;
case 'WC-D1-S1/900-900d' : return  17675;
case 'WC-D1-S1/900-900e' : return  30455;
case 'W-D1-S1/1200-300' : return  17329;
case 'W-D1-S1/1200-300a' : return  17340;
case 'W-D1-S1/1200-300b' : return  17373;
case 'W-D1-S1/1200-300c' : return  17395;
case 'W-D1-S1/1200-300d' : return  17450;
case 'W-D1-S1/1200-300e' : return  30422;
case 'W-D1-S1/1200-400' : return  17330;
case 'W-D1-S1/1200-400a' : return  17341;
case 'W-D1-S1/1200-400b' : return  17374;
case 'W-D1-S1/1200-400c' : return  17396;
case 'W-D1-S1/1200-400d' : return  17451;
case 'W-D1-S1/1200-400e' : return  30423;
case 'W-D1-S1/1200-500' : return  17331;
case 'W-D1-S1/1200-500a' : return  17342;
case 'W-D1-S1/1200-500b' : return  17375;
case 'W-D1-S1/1200-500c' : return  17397;
case 'W-D1-S1/1200-500d' : return  17452;
case 'W-D1-S1/1200-500e' : return  30424;
case 'W-D1-S1/1200-600' : return  17332;
case 'W-D1-S1/1200-600a' : return  17343;
case 'W-D1-S1/1200-600b' : return  17376;
case 'W-D1-S1/1200-600c' : return  17398;
case 'W-D1-S1/1200-600d' : return  17453;
case 'W-D1-S1/1200-600e' : return  30425;
case 'W-D1-S1/750-300' : return  15925;
case 'W-D1-S1/750-300a' : return  15936;
case 'W-D1-S1/750-300b' : return  15969;
case 'W-D1-S1/750-300c' : return  15991;
case 'W-D1-S1/750-300d' : return  16046;
case 'W-D1-S1/750-300e' : return  30400;
case 'W-D1-S1/750-400' : return  15926;
case 'W-D1-S1/750-400a' : return  15937;
case 'W-D1-S1/750-400b' : return  15970;
case 'W-D1-S1/750-400c' : return  15992;
case 'W-D1-S1/750-400d' : return  16047;
case 'W-D1-S1/750-400e' : return  30401;
case 'W-D1-S1/750-500' : return  15927;
case 'W-D1-S1/750-500a' : return  15938;
case 'W-D1-S1/750-500b' : return  15971;
case 'W-D1-S1/750-500c' : return  15993;
case 'W-D1-S1/750-500d' : return  16048;
case 'W-D1-S1/750-500e' : return  30402;
case 'W-D1-S1/750-600' : return  15928;
case 'W-D1-S1/750-600a' : return  15939;
case 'W-D1-S1/750-600b' : return  15972;
case 'W-D1-S1/750-600c' : return  15994;
case 'W-D1-S1/750-600d' : return  16049;
case 'W-D1-S1/750-600e' : return  30403;
case 'W-D1-S1/900-300' : return  16079;
case 'W-D1-S1/900-300a' : return  16090;
case 'W-D1-S1/900-300b' : return  16123;
case 'W-D1-S1/900-300c' : return  16145;
case 'W-D1-S1/900-300d' : return  16200;
case 'W-D1-S1/900-300e' : return  30411;
case 'W-D1-S1/900-400' : return  16080;
case 'W-D1-S1/900-400a' : return  16091;
case 'W-D1-S1/900-400b' : return  16124;
case 'W-D1-S1/900-400c' : return  16146;
case 'W-D1-S1/900-400d' : return  16201;
case 'W-D1-S1/900-400e' : return  30412;
case 'W-D1-S1/900-500' : return  16081;
case 'W-D1-S1/900-500a' : return  16092;
case 'W-D1-S1/900-500b' : return  16125;
case 'W-D1-S1/900-500c' : return  16147;
case 'W-D1-S1/900-500d' : return  16202;
case 'W-D1-S1/900-500e' : return  30413;
case 'W-D1-S1/900-600' : return  16082;
case 'W-D1-S1/900-600a' : return  16093;
case 'W-D1-S1/900-600b' : return  16126;
case 'W-D1-S1/900-600c' : return  16148;
case 'W-D1-S1/900-600d' : return  16203;
case 'W-D1-S1/900-600e' : return  30414;
case 'W-D2-S1/1200-1000' : return  17337;
case 'W-D2-S1/1200-1000a' : return  17348;
case 'W-D2-S1/1200-1000b' : return  17381;
case 'W-D2-S1/1200-1000c' : return  17403;
case 'W-D2-S1/1200-1000d' : return  17458;
case 'W-D2-S1/1200-1000e' : return  30430;
case 'W-D2-S1/1200-1100' : return  17338;
case 'W-D2-S1/1200-1100a' : return  17349;
case 'W-D2-S1/1200-1100b' : return  17382;
case 'W-D2-S1/1200-1100c' : return  17404;
case 'W-D2-S1/1200-1100d' : return  17459;
case 'W-D2-S1/1200-1100e' : return  30431;
case 'W-D2-S1/1200-1200' : return  17339;
case 'W-D2-S1/1200-1200a' : return  17350;
case 'W-D2-S1/1200-1200b' : return  17383;
case 'W-D2-S1/1200-1200c' : return  17405;
case 'W-D2-S1/1200-1200d' : return  17460;
case 'W-D2-S1/1200-1200e' : return  30432;
case 'W-D2-S1/1200-600' : return  17333;
case 'W-D2-S1/1200-600a' : return  17344;
case 'W-D2-S1/1200-600b' : return  17377;
case 'W-D2-S1/1200-600c' : return  17399;
case 'W-D2-S1/1200-600d' : return  17454;
case 'W-D2-S1/1200-600e' : return  30426;
case 'W-D2-S1/1200-700' : return  17334;
case 'W-D2-S1/1200-700a' : return  17345;
case 'W-D2-S1/1200-700b' : return  17378;
case 'W-D2-S1/1200-700c' : return  17400;
case 'W-D2-S1/1200-700d' : return  17455;
case 'W-D2-S1/1200-700e' : return  30427;
case 'W-D2-S1/1200-800' : return  17335;
case 'W-D2-S1/1200-800a' : return  17346;
case 'W-D2-S1/1200-800b' : return  17379;
case 'W-D2-S1/1200-800c' : return  17401;
case 'W-D2-S1/1200-800d' : return  17456;
case 'W-D2-S1/1200-800e' : return  30428;
case 'W-D2-S1/1200-900' : return  17336;
case 'W-D2-S1/1200-900a' : return  17347;
case 'W-D2-S1/1200-900b' : return  17380;
case 'W-D2-S1/1200-900c' : return  17402;
case 'W-D2-S1/1200-900d' : return  17457;
case 'W-D2-S1/1200-900e' : return  30429;
case 'W-D2-S1/750-1000' : return  15933;
case 'W-D2-S1/750-1000a' : return  15944;
case 'W-D2-S1/750-1000b' : return  15977;
case 'W-D2-S1/750-1000c' : return  15999;
case 'W-D2-S1/750-1000d' : return  16054;
case 'W-D2-S1/750-1000e' : return  30408;
case 'W-D2-S1/750-1100' : return  15934;
case 'W-D2-S1/750-1100a' : return  15945;
case 'W-D2-S1/750-1100b' : return  15978;
case 'W-D2-S1/750-1100c' : return  16000;
case 'W-D2-S1/750-1100d' : return  16055;
case 'W-D2-S1/750-1100e' : return  30409;
case 'W-D2-S1/750-1200' : return  15935;
case 'W-D2-S1/750-1200a' : return  15946;
case 'W-D2-S1/750-1200b' : return  15979;
case 'W-D2-S1/750-1200c' : return  16001;
case 'W-D2-S1/750-1200d' : return  16056;
case 'W-D2-S1/750-1200e' : return  30410;
case 'W-D2-S1/750-600' : return  15929;
case 'W-D2-S1/750-600a' : return  15940;
case 'W-D2-S1/750-600b' : return  15973;
case 'W-D2-S1/750-600c' : return  15995;
case 'W-D2-S1/750-600d' : return  16050;
case 'W-D2-S1/750-600e' : return  30404;
case 'W-D2-S1/750-700' : return  15930;
case 'W-D2-S1/750-700a' : return  15941;
case 'W-D2-S1/750-700b' : return  15974;
case 'W-D2-S1/750-700c' : return  15996;
case 'W-D2-S1/750-700d' : return  16051;
case 'W-D2-S1/750-700e' : return  30405;
case 'W-D2-S1/750-800' : return  15931;
case 'W-D2-S1/750-800a' : return  15942;
case 'W-D2-S1/750-800b' : return  15975;
case 'W-D2-S1/750-800c' : return  15997;
case 'W-D2-S1/750-800d' : return  16052;
case 'W-D2-S1/750-800e' : return  30406;
case 'W-D2-S1/750-900' : return  15932;
case 'W-D2-S1/750-900a' : return  15943;
case 'W-D2-S1/750-900b' : return  15976;
case 'W-D2-S1/750-900c' : return  15998;
case 'W-D2-S1/750-900d' : return  16053;
case 'W-D2-S1/750-900e' : return  30407;
case 'W-D2-S1/900-1000' : return  16087;
case 'W-D2-S1/900-1000a' : return  16098;
case 'W-D2-S1/900-1000b' : return  16131;
case 'W-D2-S1/900-1000c' : return  16153;
case 'W-D2-S1/900-1000d' : return  16208;
case 'W-D2-S1/900-1000e' : return  30419;
case 'W-D2-S1/900-1100' : return  16088;
case 'W-D2-S1/900-1100a' : return  16099;
case 'W-D2-S1/900-1100b' : return  16132;
case 'W-D2-S1/900-1100c' : return  16154;
case 'W-D2-S1/900-1100d' : return  16209;
case 'W-D2-S1/900-1100e' : return  30420;
case 'W-D2-S1/900-1200' : return  16089;
case 'W-D2-S1/900-1200a' : return  16100;
case 'W-D2-S1/900-1200b' : return  16133;
case 'W-D2-S1/900-1200c' : return  16155;
case 'W-D2-S1/900-1200d' : return  16210;
case 'W-D2-S1/900-1200e' : return  30421;
case 'W-D2-S1/900-600' : return  16083;
case 'W-D2-S1/900-600a' : return  16094;
case 'W-D2-S1/900-600b' : return  16127;
case 'W-D2-S1/900-600c' : return  16149;
case 'W-D2-S1/900-600d' : return  16204;
case 'W-D2-S1/900-600e' : return  30415;
case 'W-D2-S1/900-700' : return  16084;
case 'W-D2-S1/900-700a' : return  16095;
case 'W-D2-S1/900-700b' : return  16128;
case 'W-D2-S1/900-700c' : return  16150;
case 'W-D2-S1/900-700d' : return  16205;
case 'W-D2-S1/900-700e' : return  30416;
case 'W-D2-S1/900-800' : return  16085;
case 'W-D2-S1/900-800a' : return  16096;
case 'W-D2-S1/900-800b' : return  16129;
case 'W-D2-S1/900-800c' : return  16151;
case 'W-D2-S1/900-800d' : return  16206;
case 'W-D2-S1/900-800e' : return  30417;
case 'W-D2-S1/900-900' : return  16086;
case 'W-D2-S1/900-900a' : return  16097;
case 'W-D2-S1/900-900b' : return  16130;
case 'W-D2-S1/900-900c' : return  16152;
case 'W-D2-S1/900-900d' : return  16207;
case 'W-D2-S1/900-900e' : return  30418;
case 'WD-D1-S1/1200-600' : return  17955;
case 'WD-D1-S1/1200-600a' : return  17957;
case 'WD-D1-S1/1200-600b' : return  17963;
case 'WD-D1-S1/1200-600c' : return  17967;
case 'WD-D1-S1/1200-600d' : return  17977;
case 'WD-D1-S1/1200-600e' : return  31003;
case 'WD-D1-S1/1200-900a' : return  17983;
case 'WD-D1-S1/1200-900b' : return  17989;
case 'WD-D1-S1/1200-900c' : return  17993;
case 'WD-D1-S1/1200-900e' : return  31004;
case 'WD-D1-S1/1200-90d' : return  18003;
case 'WD-D1-S1/750-600' : return  17903;
case 'WD-D1-S1/750-600a' : return  24834;
case 'WD-D1-S1/750-600b' : return  17911;
case 'WD-D1-S1/750-600c' : return  17915;
case 'WD-D1-S1/750-600d' : return  17925;
case 'WD-D1-S1/750-60e' : return  31001;
case 'WD-D1-S1/750-900' : return  17929;
case 'WD-D1-S1/750-900a' : return  17931;
case 'WD-D1-S1/750-900b' : return  17937;
case 'WD-D1-S1/750-900c' : return  17941;
case 'WD-D1-S1/750-900d' : return  17951;
case 'WD-D1-S1/750-900e' : return  31002;
case 'WDO-S1/1200-300' : return  20986;
case 'WDO-S1/1200-300a' : return  24928;
case 'WDO-S1/1200-300b' : return  25028;
case 'WDO-S1/1200-300c' : return  25128;
case 'WDO-S1/1200-300d' : return  25328;
case 'WDO-S1/1200-300e' : return  31137;
case 'WDO-S1/1200-400' : return  20987;
case 'WDO-S1/1200-400a' : return  24929;
case 'WDO-S1/1200-400b' : return  25029;
case 'WDO-S1/1200-400c' : return  25129;
case 'WDO-S1/1200-400d' : return  25329;
case 'WDO-S1/1200-400e' : return  31138;
case 'WDO-S1/1200-500' : return  20988;
case 'WDO-S1/1200-500a' : return  24930;
case 'WDO-S1/1200-500b' : return  25030;
case 'WDO-S1/1200-500c' : return  25130;
case 'WDO-S1/1200-500d' : return  25330;
case 'WDO-S1/1200-500e' : return  31139;
case 'WDO-S1/750-300' : return  20979;
case 'WDO-S1/750-300a' : return  24922;
case 'WDO-S1/750-300b' : return  25022;
case 'WDO-S1/750-300c' : return  25122;
case 'WDO-S1/750-300e' : return  31131;
case 'WDO-S1/750-30d' : return  25322;
case 'WDO-S1/750-400' : return  20980;
case 'WDO-S1/750-400a' : return  24923;
case 'WDO-S1/750-400b' : return  25023;
case 'WDO-S1/750-400c' : return  25123;
case 'WDO-S1/750-400e' : return  31132;
case 'WDO-S1/750-40d' : return  25323;
case 'WDO-S1/750-500' : return  20982;
case 'WDO-S1/750-500a' : return  24924;
case 'WDO-S1/750-500b' : return  25024;
case 'WDO-S1/750-500c' : return  25124;
case 'WDO-S1/750-500d' : return  25324;
case 'WDO-S1/750-500e' : return  31133;
case 'WDO-S1/900-300' : return  20983;
case 'WDO-S1/900-300a' : return  24925;
case 'WDO-S1/900-300b' : return  25025;
case 'WDO-S1/900-300c' : return  25125;
case 'WDO-S1/900-300e' : return  31134;
case 'WDO-S1/900-30d' : return  25325;
case 'WDO-S1/900-400' : return  20984;
case 'WDO-S1/900-400a' : return  24926;
case 'WDO-S1/900-400b' : return  25026;
case 'WDO-S1/900-400c' : return  25126;
case 'WDO-S1/900-400d' : return  25326;
case 'WDO-S1/900-400e' : return  31135;
case 'WDO-S1/900-500' : return  20985;
case 'WDO-S1/900-500a' : return  24927;
case 'WDO-S1/900-500b' : return  25027;
case 'WDO-S1/900-500c' : return  25127;
case 'WDO-S1/900-500d' : return  25327;
case 'WDO-S1/900-500e' : return  31136;
case 'WOD2/2150-600' : return  18443;
case 'WOD2/2150-600a' : return  18459;
case 'WOD2/2150-600b' : return  18483;
case 'WOD2/2150-600c' : return  18499;
case 'WOD2/2150-600d' : return  18539;
case 'WOD2/2150-600e' : return  31171;
case 'WOD2/2150-700' : return  18447;
case 'WOD2/2150-700a' : return  18463;
case 'WOD2/2150-700b' : return  18487;
case 'WOD2/2150-700c' : return  18503;
case 'WOD2/2150-700d' : return  18543;
case 'WOD2/2150-700e' : return  31173;
case 'WOD2/2350-600' : return  18563;
case 'WOD2/2350-600a' : return  18571;
case 'WOD2/2350-600b' : return  18595;
case 'WOD2/2350-600c' : return  18611;
case 'WOD2/2350-600d' : return  18651;
case 'WOD2/2350-600e' : return  31175;
case 'WOD2/2350-700' : return  18567;
case 'WOD2/2350-700a' : return  18575;
case 'WOD2/2350-700b' : return  18599;
case 'WOD2/2350-700c' : return  18615;
case 'WOD2/2350-700d' : return  18655;
case 'WOD2/2350-700e' : return  31177;
case 'WOD4/2150-600' : return  18444;
case 'WOD4/2150-600a' : return  18460;
case 'WOD4/2150-600b' : return  18484;
case 'WOD4/2150-600c' : return  18500;
case 'WOD4/2150-600d' : return  18540;
case 'WOD4/2150-600e' : return  31172;
case 'WOD4/2150-700' : return  18448;
case 'WOD4/2150-700a' : return  18464;
case 'WOD4/2150-700b' : return  18488;
case 'WOD4/2150-700c' : return  18504;
case 'WOD4/2150-700d' : return  18544;
case 'WOD4/2150-700e' : return  31174;
case 'WOD4/2350-600' : return  18564;
case 'WOD4/2350-600a' : return  18572;
case 'WOD4/2350-600b' : return  18596;
case 'WOD4/2350-600c' : return  18612;
case 'WOD4/2350-600d' : return  18652;
case 'WOD4/2350-600e' : return  31176;
case 'WOD4/2350-700' : return  18568;
case 'WOD4/2350-700a' : return  18576;
case 'WOD4/2350-700b' : return  18600;
case 'WOD4/2350-700c' : return  18616;
case 'WOD4/2350-700d' : return  18656;
case 'WOD4/2350-700e' : return  31178;
case 'WOMD2/2150-600' : return  18441;
case 'WOMD2/2150-600a' : return  18457;
case 'WOMD2/2150-600b' : return  18481;
case 'WOMD2/2150-600c' : return  18497;
case 'WOMD2/2150-600d' : return  18537;
case 'WOMD2/2150-600e' : return  31179;
case 'WOMD2/2150-700' : return  18445;
case 'WOMD2/2150-700a' : return  18461;
case 'WOMD2/2150-700b' : return  18485;
case 'WOMD2/2150-700c' : return  18501;
case 'WOMD2/2150-700d' : return  18541;
case 'WOMD2/2150-700e' : return  31180;
case 'WOMD2/2350-600' : return  18561;
case 'WOMD2/2350-600a' : return  18569;
case 'WOMD2/2350-600b' : return  18593;
case 'WOMD2/2350-600c' : return  18609;
case 'WOMD2/2350-600d' : return  18649;
case 'WOMD2/2350-600e' : return  31183;
case 'WOMD2/2350-700' : return  18565;
case 'WOMD2/2350-700a' : return  18573;
case 'WOMD2/2350-700b' : return  18597;
case 'WOMD2/2350-700c' : return  18613;
case 'WOMD2/2350-700d' : return  18653;
case 'WOMD2/2350-700e' : return  31184;
case 'WOMD4/2150-600' : return  18442;
case 'WOMD4/2150-600a' : return  18458;
case 'WOMD4/2150-600b' : return  18482;
case 'WOMD4/2150-600c' : return  18498;
case 'WOMD4/2150-600d' : return  18538;
case 'WOMD4/2150-600e' : return  31181;
case 'WOMD4/2150-700' : return  18446;
case 'WOMD4/2150-700a' : return  18462;
case 'WOMD4/2150-700b' : return  18486;
case 'WOMD4/2150-700c' : return  18502;
case 'WOMD4/2150-700d' : return  18542;
case 'WOMD4/2150-700e' : return  31182;
case 'WOMD4/2350-600' : return  18562;
case 'WOMD4/2350-600a' : return  18570;
case 'WOMD4/2350-600b' : return  18594;
case 'WOMD4/2350-600c' : return  18610;
case 'WOMD4/2350-600d' : return  18650;
case 'WOMD4/2350-600e' : return  31185;
case 'WOMD4/2350-700' : return  18566;
case 'WOMD4/2350-700a' : return  18574;
case 'WOMD4/2350-700b' : return  18598;
case 'WOMD4/2350-700c' : return  18614;
case 'WOMD4/2350-700d' : return  18654;
case 'WOMD4/2350-700e' : return  31186;
case 'WO-S1/1200-1000' : return  20927;
case 'WO-S1/1200-1000a' : return  24883;
case 'WO-S1/1200-1000b' : return  24983;
case 'WO-S1/1200-1000c' : return  25774;
case 'WO-S1/1200-1000d' : return  25283;
case 'WO-S1/1200-1000e' : return  31128;
case 'WO-S1/1200-1100' : return  20928;
case 'WO-S1/1200-1100a' : return  24884;
case 'WO-S1/1200-1100b' : return  24984;
case 'WO-S1/1200-1100c' : return  25775;
case 'WO-S1/1200-1100d' : return  25284;
case 'WO-S1/1200-1100e' : return  31129;
case 'WO-S1/1200-1200' : return  20929;
case 'WO-S1/1200-1200a' : return  24885;
case 'WO-S1/1200-1200b' : return  24985;
case 'WO-S1/1200-1200c' : return  25776;
case 'WO-S1/1200-1200d' : return  25285;
case 'WO-S1/1200-1200e' : return  31130;
case 'WO-S1/1200-3000' : return  20920;
case 'WO-S1/1200-300a' : return  24876;
case 'WO-S1/1200-300b' : return  24976;
case 'WO-S1/1200-300c' : return  25767;
case 'WO-S1/1200-300d' : return  25276;
case 'WO-S1/1200-300e' : return  31121;
case 'WO-S1/1200-400' : return  20921;
case 'WO-S1/1200-400a' : return  24877;
case 'WO-S1/1200-400b' : return  24977;
case 'WO-S1/1200-400c' : return  25768;
case 'WO-S1/1200-400d' : return  25277;
case 'WO-S1/1200-400e' : return  31122;
case 'WO-S1/1200-500' : return  20922;
case 'WO-S1/1200-500a' : return  24878;
case 'WO-S1/1200-500b' : return  24978;
case 'WO-S1/1200-500c' : return  25769;
case 'WO-S1/1200-500d' : return  25278;
case 'WO-S1/1200-500e' : return  31123;
case 'WO-S1/1200-600' : return  20923;
case 'WO-S1/1200-600a' : return  24879;
case 'WO-S1/1200-600b' : return  24979;
case 'WO-S1/1200-600c' : return  25770;
case 'WO-S1/1200-600d' : return  25279;
case 'WO-S1/1200-600e' : return  31124;
case 'WO-S1/1200-700' : return  20924;
case 'WO-S1/1200-700a' : return  24880;
case 'WO-S1/1200-700b' : return  24980;
case 'WO-S1/1200-700c' : return  25771;
case 'WO-S1/1200-700d' : return  25280;
case 'WO-S1/1200-700e' : return  31125;
case 'WO-S1/1200-800' : return  20925;
case 'WO-S1/1200-800a' : return  24881;
case 'WO-S1/1200-800b' : return  24981;
case 'WO-S1/1200-800c' : return  25772;
case 'WO-S1/1200-800d' : return  25281;
case 'WO-S1/1200-800e' : return  31126;
case 'WO-S1/1200-900' : return  20926;
case 'WO-S1/1200-900a' : return  24882;
case 'WO-S1/1200-900b' : return  24982;
case 'WO-S1/1200-900c' : return  25773;
case 'WO-S1/1200-900d' : return  25282;
case 'WO-S1/1200-900e' : return  31127;
case 'WO-S1/750-1000' : return  20896;
case 'WO-S1/750-1000a' : return  24863;
case 'WO-S1/750-1000b' : return  24963;
case 'WO-S1/750-1000c' : return  25063;
case 'WO-S1/750-1000d' : return  25263;
case 'WO-S1/750-1000e' : return  31108;
case 'WO-S1/750-1100' : return  20897;
case 'WO-S1/750-1100a' : return  24864;
case 'WO-S1/750-1100b' : return  24964;
case 'WO-S1/750-1100c' : return  25064;
case 'WO-S1/750-1100d' : return  25264;
case 'WO-S1/750-1100e' : return  31109;
case 'WO-S1/750-1200' : return  20898;
case 'WO-S1/750-1200a' : return  24865;
case 'WO-S1/750-1200b' : return  24965;
case 'WO-S1/750-1200c' : return  25065;
case 'WO-S1/750-1200d' : return  25265;
case 'WO-S1/750-1200e' : return  31110;
case 'WO-S1/750-300' : return  20889;
case 'WO-S1/750-300a' : return  24856;
case 'WO-S1/750-300b' : return  24956;
case 'WO-S1/750-300c' : return  25056;
case 'WO-S1/750-300d' : return  25256;
case 'WO-S1/750-300e' : return  31101;
case 'WO-S1/750-400' : return  20890;
case 'WO-S1/750-400a' : return  24857;
case 'WO-S1/750-400b' : return  24957;
case 'WO-S1/750-400c' : return  25057;
case 'WO-S1/750-400d' : return  25257;
case 'WO-S1/750-400e' : return  31102;
case 'WO-S1/750-500' : return  20891;
case 'WO-S1/750-500a' : return  24858;
case 'WO-S1/750-500b' : return  24958;
case 'WO-S1/750-500c' : return  25058;
case 'WO-S1/750-500d' : return  25258;
case 'WO-S1/750-500e' : return  31103;
case 'WO-S1/750-600' : return  20892;
case 'WO-S1/750-600a' : return  24859;
case 'WO-S1/750-600b' : return  24959;
case 'WO-S1/750-600c' : return  25059;
case 'WO-S1/750-600d' : return  25259;
case 'WO-S1/750-600e' : return  31104;
case 'WO-S1/750-700' : return  20893;
case 'WO-S1/750-700a' : return  24860;
case 'WO-S1/750-700b' : return  24960;
case 'WO-S1/750-700c' : return  25060;
case 'WO-S1/750-700d' : return  25260;
case 'WO-S1/750-700e' : return  31105;
case 'WO-S1/750-800' : return  20894;
case 'WO-S1/750-800a' : return  24861;
case 'WO-S1/750-800b' : return  24961;
case 'WO-S1/750-800c' : return  25061;
case 'WO-S1/750-800d' : return  25261;
case 'WO-S1/750-800e' : return  31106;
case 'WO-S1/750-900' : return  20895;
case 'WO-S1/750-900a' : return  24862;
case 'WO-S1/750-900b' : return  24962;
case 'WO-S1/750-900c' : return  25062;
case 'WO-S1/750-900d' : return  25262;
case 'WO-S1/750-900e' : return  31107;
case 'WO-S1/900-1000' : return  20906;
case 'WO-S1/900-1000a' : return  24873;
case 'WO-S1/900-1000b' : return  24973;
case 'WO-S1/900-1000c' : return  25073;
case 'WO-S1/900-1000d' : return  25273;
case 'WO-S1/900-1000e' : return  31118;
case 'WO-S1/900-1100' : return  20907;
case 'WO-S1/900-1100a' : return  24874;
case 'WO-S1/900-1100b' : return  24974;
case 'WO-S1/900-1100c' : return  25074;
case 'WO-S1/900-1100d' : return  25274;
case 'WO-S1/900-1100e' : return  31119;
case 'WO-S1/900-1200' : return  20908;
case 'WO-S1/900-1200a' : return  24875;
case 'WO-S1/900-1200b' : return  24975;
case 'WO-S1/900-1200c' : return  25075;
case 'WO-S1/900-1200d' : return  25275;
case 'WO-S1/900-1200e' : return  31120;
case 'WO-S1/900-300' : return  20899;
case 'WO-S1/900-300a' : return  24866;
case 'WO-S1/900-300b' : return  24966;
case 'WO-S1/900-300c' : return  25066;
case 'WO-S1/900-300d' : return  25266;
case 'WO-S1/900-300e' : return  31111;
case 'WO-S1/900-400' : return  20900;
case 'WO-S1/900-400a' : return  24867;
case 'WO-S1/900-400b' : return  24967;
case 'WO-S1/900-400c' : return  25067;
case 'WO-S1/900-400d' : return  25267;
case 'WO-S1/900-400e' : return  31112;
case 'WO-S1/900-500' : return  20901;
case 'WO-S1/900-500a' : return  24868;
case 'WO-S1/900-500b' : return  24968;
case 'WO-S1/900-500c' : return  25068;
case 'WO-S1/900-500d' : return  25268;
case 'WO-S1/900-500e' : return  31113;
case 'WO-S1/900-600' : return  20902;
case 'WO-S1/900-600a' : return  24869;
case 'WO-S1/900-600b' : return  24969;
case 'WO-S1/900-600c' : return  25069;
case 'WO-S1/900-600d' : return  25269;
case 'WO-S1/900-600e' : return  31114;
case 'WO-S1/900-700' : return  20903;
case 'WO-S1/900-700a' : return  24870;
case 'WO-S1/900-700b' : return  24970;
case 'WO-S1/900-700c' : return  25070;
case 'WO-S1/900-700d' : return  25270;
case 'WO-S1/900-700e' : return  31115;
case 'WO-S1/900-800' : return  20904;
case 'WO-S1/900-800a' : return  24871;
case 'WO-S1/900-800b' : return  24971;
case 'WO-S1/900-800c' : return  25071;
case 'WO-S1/900-800d' : return  25271;
case 'WO-S1/900-800e' : return  31116;
case 'WO-S1/900-900' : return  20905;
case 'WO-S1/900-900a' : return  24872;
case 'WO-S1/900-900b' : return  24972;
case 'WO-S1/900-900c' : return  25072;
case 'WO-S1/900-900d' : return  25272;
case 'WO-S1/900-900e' : return  31117;
case 'WRCS/1800-900' : return	8;
case 'WRCS/2000-1000' : return	9;
case 'WRCS/2350-1000' : return  274;
case 'WRD2/2000-400' : return  25733;
case 'WRD2/2000-600' : return  25734;
case 'WRD2/2000-900' : return  25735;
case 'WRD3/2000-400' : return  25739;
case 'WRD3/2000-600' : return  25740;
case 'WRD3/2000-900' : return  25741;
case 'WRD4/2000-400' : return  25745;
case 'WRD4/2000-600' : return  25746;
case 'WRD4/2000-900' : return  25747;
case 'WRD5/2000-400' : return  25751;
case 'WRD5/2000-600' : return  25752;
case 'WRD5/2000-900' : return  25753;
case 'WRDH/2000-1000' : return  25717;
case 'WRDH/2000-300' : return  25715;
case 'WRDH/2000-600' : return  25716;
case 'WRFH/2000-1000' : return  25723;
case 'WRFH/2000-300' : return  25721;
case 'WRFH/2000-600' : return  25722;
case 'WRFHS/2000-1000' : return  25729;
case 'WRFHS/2000-300' : return  25727;
case 'WRFHS/2000-600' : return  25728;
case 'WRS/2000-1000' : return  25759;
case 'WRS/2000-300' : return  25757;
case 'WRS/2000-600' : return  25758;
  }
   return 0; 
}     

function CalculateProportionalDiscount(curPrice,iProdID,i,lineCount,varNewPID)
// We assume that: for Base and Wall Cabinets - based on Carcass-only pricing
//					Depth variation save $5.00 per 100mm in Carcass costs;
//                  Width variations save $4.00 per 100mm in Carcass cost 
//                  Height variations save $9.00 per 100mm  
//  Drawers:     Height or Width $12 per 100mm, Depth at $5.00
//   Doors etc.  Vinyl - no saving as prices set in ranges by the Supplier
//                Laminate Doors etc. %5.00 per 100mm Height and $4.00 per 100mm Width
//				  Vinyl - Belmont    $20 per 1000mm squared
//						- Byron Bay  $24 per 1000mm squared
//                Albany Style       $23.00 per 1000mm squared
//                Avoca Style        $30.00 per 1000mm squared 
// With iProdID we find Product Code for the standard item. We then Modify the Product code for the nearest HeightxWidth dimension and the appropriate
//  Suffix (Style finish code) 
// We use the new ProductCode to find the appropriate PID code, and use that to find the Stored Price. This Price is then modified in the ratio 
//   HxW/eightxwidth 
//                   But not for Benchtops, Hardware etc    
{ 
  var varOldPrice = curPrice;
  var varStart = 0;
  var varCarcassSaving = 0;
  var varDoorSaving = 0;
  var varBenchSaving = 0;
  varNewPrice = varOldPrice;

//if (varProductCode.indexOf("/Y") == 0 && varProductCode.substring(0,1) != "2") { // exception for "DoorGlass" products (Framed Doors)
   
  getProductStyle(iProdID,i);

//  When processing BenchTop STYLE record
 if (newProductCode.substring(0,1) == "3") {
      if (varBenchCost < 181.82 && varBenchCost > 0) varNewPrice = 72.73;
      else if (varBenchCost > 454.55) varNewPrice = 0;
      else varNewPrice = Math.round(72.73 - ((varBenchCost - 181.82) * 0.267));
      if (i == lineCount - 1)
alert("To cover Overheads for small Benchtop operations - this Benchtop Value being $" + varBenchCost + " (excl. GST) we have charged $" + varNewPrice  + " excl. GST extra.") ;
  }
  else if(newProductCode.substring(0,1) == "2")  varStart = 0; 
  else varStart = newProductCode.indexOf("/");
  var varLength = newProductCode.length;
//------------------------------------------------------  
  if  (varStart > 0) varMeasurements = newProductCode.substring(varStart + 1, varLength);
  
  arrDimensions = varMeasurements.split("-");
//window.alert("line 7313 " + arrDimensions[0] + "," + arrDimensions[1] + " varProdStyle= " + varProdStyle + " newProductCode= " + newProductCode);
  var varH = parseInt(arrDimensions[0]);
  var varW = parseInt(arrDimensions[1]);
  if (newProductCode.substring(0,3) == "B-D") varD = 700;
  else if (newProductCode.substring(0,3) == "W-D" || newProductCode.substring(0,4) == "WB45" || newProductCode.substring(0,2) == "WC" || 
      newProductCode.substring(0,3) == "WO-" || newProductCode.substring(0,2) == "WB" || newProductCode.substring(0,3) == "WDO" 
	  || newProductCode.substring(0,3) == "RH-" || newProductCode.substring(0,3) == "MW/") varD =500;
  else if (newProductCode.substring(0,2) == "WR") varD = 595;
  else if (newProductCode.substring(0,4) == "BD-D") varD = 350;
  else varD = 600;
  
  if (newProductCode.substring(0,4) == "BB45" || newProductCode.substring(0,4) == "WB45"|| newProductCode.substring(0,4) == "BD-D" || newProductCode.substring(0,4) == "BC-D") var varDoorWidth = 600;
  else if (newProductCode.substring(0,3) == "PD-") varDoorWidth = 566
  else if (newProductCode.substring(0,4) == "PC-D") varDoorWidth = 600;  // Assumed Door size on which PRICE was based 
  else varDoorWidth = varW;
   
  getInputDimensions(i);
  
 if (newProductCode.substring(0,4) == "BDrw" || newProductCode.substring(0,4) == "cBDr" || newProductCode.substring(0,3) == "BCD")   
   varCarcassSaving = (varH - varHeight) / 100 * 6.00 + (varW - varWidth) / 100 * 11.00 + (varD - varDepth) / 100 * 11.00;

 else if (newProductCode.substring(0,4) == "BC-D" || newProductCode.substring(0,4) == "BCA-" || newProductCode.substring(0,4) == "cBC-" || newProductCode.substring(0,4) == "cBCA") {
     varCarcassSaving = (varH - varHeight) / 100 * 9.00 + (varW - varLHWidth) / 100 * 6.00 + (varW - varRHWidth) / 100 * 6.00 + (varD - (varLHDepth + varRHDepth)/2) / 100 * 6.00 ;
		varDoorWidth = 600;  // Assumed Standard Door size 
      }
else if (newProductCode.substring(0,4) == "PC-D" || newProductCode.substring(0,4) == "PD-D") 
	varCarcassSaving = (varH - varHeight) / 100 * 10.00 + (varW - varLHWidth) / 100 * 11.00 + (varW - varRHWidth) / 100 * 11.00 + 
	(varD - varLHDepth) / 100 * 10.00 + (varD - varRHDepth) / 100 * 10.00;
		
else if (newProductCode.substring(0,4) == "cPC-" || newProductCode.substring(0,4) == "cPD-") 
	varCarcassSaving = (varH - varHeight) / 100 * 10.00 + (varW - varLHWidth) / 100 * 11.00 + (varW - varRHWidth) / 100 * 11.00 + 
	(varD - varLHDepth) / 100 * 10.00 + (varD - varRHDepth) / 100 * 10.00;
	  
else if (newProductCode.substring(0,4) == "WC-D") {
      if (varH < 901) varCarcassSaving = (varH - varHeight) / 100 * 10.00 + (varW - varLHWidth) / 100 * 10.00 + (varW - varRHWidth) / 100 * 10.00 + (varD - varLHDepth) / 100 * 2.00 + (varD - varRHDepth) / 100 * 2.00;
	  else  varCarcassSaving = (varH - varHeight) / 100 * 10.00 + (varW - varLHWidth) / 100 * 11.00 + (varW - varRHWidth) / 100 * 11.00 + (varD - varLHDepth) / 100 * 2.00 + (varD - varRHDepth) / 100 * 2.00;
	  varDoorWidth = 600;  // Assumed Door size 	  
      }
else if (newProductCode.substring(0,3) == "cWC") {
      if (varH < 901) varCarcassSaving = (varH - varHeight) / 100 * 10.00 + (varW - varLHWidth) / 100 * 10.00 + (varW - varRHWidth) / 100 * 10.00 + (varD - varLHDepth) / 100 * 2.00 + (varD - varRHDepth) / 100 * 2.00;
	  else  varCarcassSaving = (varH - varHeight) / 100 * 10.00 + (varW - varLHWidth) / 100 * 11.00 + (varW - varRHWidth) / 100 * 11.00 + (varD - varLHDepth) / 100 * 2.00 + (varD - varRHDepth) / 100 * 2.00;
	  varDoorWidth = 600;  // Assumed Door size   
      }
 else if (newProductCode.substring(0,4) == "BB45" ) {
        varCarcassSaving = (varH - varHeight) / 100 * 10.00 + (varW - varLHWidth) / 100 * 4.00 + (varW - varRHWidth) / 100 * 4.00 + (varD - varLHDepth) / 100 * 2.00 + (varD - varRHDepth) / 100 * 2.00;
		varDoorWidth = 600;  // Assumed Door size  
      }
 else if (newProductCode.substring(0,4) == "WB45") {
        varCarcassSaving = (varH - varHeight) / 100 * 10.00 + (varW - varLHWidth) / 100 * 4.00 + (varW - varRHWidth) / 100 * 4.00 + (varD - varLHDepth) / 100 * 2.00 + (varD - varRHDepth) / 100 * 2.00;
		varDoorWidth = 600;  // Assumed Door size  
      }
      
 else if (newProductCode.substring(0,4) == "BD-D" || newProductCode.substring(0,4) == "WD-D" || newProductCode.substring(0,4) == "BOA-")  {
		varDoorWidth = 600;  // Assumed Door size 
       if (newProductCode.substring(0,4) == "BD-D" || newProductCode.substring(0,4) == "WD-D")
	   		varCarcassSaving = (varH - varHeight) / 100 * 4.00 + (varW - varLHWidth) / 100 * 7.00 + (varW - varRHWidth) / 100 * 7.00;
	   else if (newProductCode.substring(0,4) == "BOA-")	{
	     if (varProdStyle == "Lamin") {
		   if (varH < 751) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 8.00 + (varW - varWidth) / 100 * 6.50 + (varD - varDepth) / 100 * 6.50;
		   else if (varH < 901) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 8.00 + (varW - varWidth) / 100 * 14.00 + (varD - varDepth) / 100 * 14.00;
		   else if (varH < 1201) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 7.00 + (varW - varWidth) / 100 * 15.00 + (varD - varDepth) / 100 * 15.00;
		 }
		 else if (varProdStyle == "Unfin") {
		   if (varH < 751) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 25.00 + (varW - varWidth) / 100 * 25.00 + (varD - varDepth) / 100 * 25.00;
		   else if (varH < 901) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 20.00 + (varW - varWidth) / 100 * 30.00 + (varD - varDepth) / 100 * 30.00;
		   else if (varH < 1201) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 15.00 + (varW - varWidth) / 100 * 35.00 + (varD - varDepth) / 100 * 35.00;
		 }
		 else if (varProdStyle == "Belmo") {
		   if (varH < 751) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 52.00 + (varW - varWidth) / 100 * 50.00 + (varD - varDepth) / 100 * 50.00;
		   else if (varH < 901) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 39.00 + (varW - varWidth) / 100 * 59.00 + (varD - varDepth) / 100 * 59.00;
		   else if (varH < 1201) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 30.00 + (varW - varWidth) / 100 * 72.00 + (varD - varDepth) / 100 * 72.00;
		 }
		 else if (varProdStyle == "Byron") {
		   if (varH < 751) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 50.00 + (varW - varWidth) / 100 * 58.00 + (varD - varDepth) / 100 * 58.00;
		   else if (varH < 901) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 43.00 + (varW - varWidth) / 100 * 69.00 + (varD - varDepth) / 100 * 69.00;
		   else if (varH < 1201) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 33.00 + (varW - varWidth) / 100 * 84.00 + (varD - varDepth) / 100 * 84.00;
		 }
		 else if (varProdStyle == "Alban") {
		   if (varH < 751) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 35.00 + (varW - varWidth) / 100 * 112.00 + (varD - varDepth) / 100 * 112.00;
		   else if (varH < 901) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 33.00 + (varW - varWidth) / 100 * 80.00 + (varD - varDepth) / 100 * 80.00;
		   else if (varH < 1201) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 31.00 + (varW - varWidth) / 100 * 133.00 + (varD - varDepth) / 100 * 133.00;
		 }
		 else if (varProdStyle == "Avoca") {
		   if (varH < 751) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 35.00 + (varW - varWidth) / 100 * 96.00 + (varD - varDepth) / 100 * 96.00;
		   else if (varH < 901) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 35.00 + (varW - varWidth) / 100 * 147.00 + (varD - varDepth) / 100 * 147.00;
		   else if (varH < 1201) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 35.00 + (varW - varWidth) / 100 * 147.00 + (varD - varDepth) / 100 * 147.00;
		   }
	     }
	   }
//  Wall Diagonal Open
 else if (newProductCode.substring(0,4) == "WDO-" || newProductCode.substring(0,3) == "WM/")  {
		varDoorWidth = 600;  // Assumed Door size NOTE varDepth is actually RHWidth in this case
		
	     if (varProdStyle == "Lamin") {
		   if (varH < 751) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 8.00 + (varW - varWidth) / 100 * 12.00 + (varD - varDepth) / 100 * 12.000;
		   else if (varH < 901) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 8.00 + (varW - varWidth) / 100 * 13.00 + (varD - varDepth) / 100 * 13.00;
		  else varCarcassSaving = (varH - varHeight) / 100 * 8.00 + (varW - varWidth) / 100 * 14.00 + (varD - varDepth) / 100 * 13.00;
		 }
		 else if (varProdStyle == "Unfin") {
		   if (varH < 751) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 7.00 + (varW - varWidth) / 100 * 20.00 + (varD - varDepth) / 100 * 24.00;
		   else if (varH < 901) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 7.00 + (varW - varWidth) / 100 * 23.00 + (varD - varDepth) / 100 * 23.00;
		  else varCarcassSaving = (varH - varHeight) / 100 * 5.00 + (varW - varWidth) / 100 * 28.00 + (varD - varDepth) / 100 * 28.00;
		 }
		 else if (varProdStyle == "Belmo") {
		   if (varH < 751) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 13.00 + (varW - varWidth) / 100 * 48.00 + (varD - varDepth) / 100 * 48.00;
		   else if (varH < 901) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 13.00 + (varW - varWidth) / 100 * 46.00 + (varD - varDepth) / 100 * 46.00;
		 else varCarcassSaving = (varH - varHeight) / 100 * 11.00 + (varW - varWidth) / 100 * 56.00 + (varD - varDepth) / 100 * 56.00;
		 }
		 else if (varProdStyle == "Byron") {
		   if (varH < 751) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 20.00 + (varW - varWidth) / 100 * 55.00 + (varD - varDepth) / 100 * 55.00;
		   else if (varH < 901) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 35.00 + (varW - varWidth) / 100 * 54.00 + (varD - varDepth) / 100 * 54.00;
		  else varCarcassSaving = (varH - varHeight) / 100 * 13.00 + (varW - varWidth) / 100 * 65.00 + (varD - varDepth) / 100 * 65.00;
		 }
		 else if (varProdStyle == "Alban") {
		   if (varH < 751) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 18.00 + (varW - varWidth) / 100 * 56.00 + (varD - varDepth) / 100 * 56.00;
		   else if (varH < 901) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 20.00 + (varW - varWidth) / 100 * 39.00 + (varD - varDepth) / 100 * 39.00;
		  else varCarcassSaving = (varH - varHeight) / 100 * 22.00 + (varW - varWidth) / 100 * 40.00 + (varD - varDepth) / 100 * 40.00;
		 }
		 else if (varProdStyle == "Avoca") {
		   if (varH < 751) 
		    varCarcassSaving = (varH - varHeight) / 100 * 12.00 + (varW - varWidth) / 100 * 29.00 + (varD - varDepth) / 100 * 29.00;
		   else if (varH < 901) 
		   	varCarcassSaving = (varH - varHeight) / 100 * 15.00 + (varW - varWidth) / 100 * 21.00 + (varD - varDepth) / 100 * 21.00;
		  else varCarcassSaving = (varH - varHeight) / 100 * 24.00 + (varW - varWidth) / 100 * 85.00 + (varD - varDepth) / 100 * 85.00;
		  }
  }	  	   
   	   
  else if ((newProductCode.substring(0,4) == "BO-S" || newProductCode.substring(0,4) == "WO-S" || newProductCode.substring(0,3) =="MW/") && varProdStyle == "Lamin") 
 	 varCarcassSaving = (varH - varHeight) / 100 * 10.00 + (varW - varWidth) / 100 * 8.00 + (varD - varDepth) / 100 * 5.00;
  else if ((newProductCode.substring(0,4) == "BO-S" || newProductCode.substring(0,4) == "WO-S"|| newProductCode.substring(0,3) == "MW/") && varProdStyle == "Unfin")
  	varCarcassSaving = (varH - varHeight) / 100 * 32.00 + (varW - varWidth) / 100 * 18.00 + (varD - varDepth) / 100 * 19.00;
  else if ((newProductCode.substring(0,4) == "BO-S" || newProductCode.substring(0,4) == "WO-S"|| newProductCode.substring(0,3) == "MW/") && varProdStyle == "Belmo") 
  	varCarcassSaving = (varH - varHeight) / 100 * 64.00 + (varW - varWidth) / 100 * 37.00 + (varD - varDepth) / 100 * 38.00; 
  else if ((newProductCode.substring(0,4) == "BO-S" || newProductCode.substring(0,4) == "WO-S"|| newProductCode.substring(0,3) == "MW/") && varProdStyle == "Byron") 
  	varCarcassSaving = (varH - varHeight) / 100 * 75.00 + (varW - varWidth) / 100 * 37.00 + (varD - varDepth) / 100 * 38.00;
  else if ((newProductCode.substring(0,4) == "BO-S" || newProductCode.substring(0,4) == "WO-S"|| newProductCode.substring(0,3) == "MW/") && varProdStyle == "Alban") 
  	varCarcassSaving = (varH - varHeight) / 100 * 50.00 + (varW - varWidth) / 100 * 124.00 + (varD - varDepth) / 100 * 30.00;
  else if ((newProductCode.substring(0,4) == "BO-S" || newProductCode.substring(0,4) == "WO-S"|| newProductCode.substring(0,3) == "MW/") && varProdStyle == "Avoca") 
  	varCarcassSaving = (varH - varHeight) / 100 * 56.00 + (varW - varWidth) / 100 * 138.00 + (varD - varDepth) / 100 * 50.00;
	
	
 else if (newProductCode.substring(0,3) == "P-D" || newProductCode.substring(0,3) == "cP-") varCarcassSaving = (varH - varHeight) / 100 * 11.00 + (varW - varWidth) / 100 * 12.00 + (varD - varDepth) / 100 * 13.00; 
 
 else if (newProductCode.substring(0,4) == "WRFH") varCarcassSaving = (varH - varHeight) / 100 * 1.00 + (varW - varWidth) / 100 * 2.00 + (varD - varDepth) / 100 * 5.00; 
 else if (newProductCode.substring(0,4) == "WRDH") varCarcassSaving = (varH - varHeight) / 100 * 1.00 + (varW - varWidth) / 100 * 3.00 + (varD - varDepth) / 100 * 8.00; 
 else if (newProductCode.substring(0,3) == "WRS") varCarcassSaving = (varH - varHeight) / 100 * 4.00 + (varW - varWidth) / 100 * 7.00 + (varD - varDepth) / 100 * 18.00; 
 else if (newProductCode.substring(0,5) == "WRFHS") varCarcassSaving = (varH - varHeight) / 100 * 2.00 + (varW - varWidth) / 100 * 3.00 + (varD - varDepth) / 100 * 12.00;
 else if (newProductCode.substring(0,4) == "WRD2") varCarcassSaving = (varH - varHeight) / 100 * 4.00 + (varW - varWidth) / 100 * 12.00 + (varD - varDepth) / 100 * 28.00;
 else if (newProductCode.substring(0,4) == "WRD3") varCarcassSaving = (varH - varHeight) / 100 * 4.00 + (varW - varWidth) / 100 * 14.00 + (varD - varDepth) / 100 * 32.00;
 else if (newProductCode.substring(0,4) == "WRD4") varCarcassSaving = (varH - varHeight) / 100 * 4.00 + (varW - varWidth) / 100 * 15.00 + (varD - varDepth) / 100 * 35.00;
 else if (newProductCode.substring(0,4) == "WRD5") varCarcassSaving = (varH - varHeight) / 100 * 4.00 + (varW - varWidth) / 100 * 16.00 + (varD - varDepth) / 100 * 40.00;
 else if (newProductCode.substring(0,4) == "WECS") varCarcassSaving = (varH - varHeight) / 100 * 9.00 + (varW - varLHWidth) / 100 * 6.00 + (varW - varRHWidth) / 100 * 6.00 + (varD - varLHDepth) / 100 * 7.00 + (varD - varRHDepth) / 100 * 7.00 ;
 else if (newProductCode.substring(0,4) == "WRCS") varCarcassSaving = (varH - varHeight) / 100 * 3.00 + (varW - varLHWidth) / 100 * 3.00 + (varW - varRHWidth) / 100 * 3.00 + (varD - varLHDepth) / 100 * 8.00 + (varD - varRHDepth) / 100 * 8.00 + (4 - WRShelfQuantity) * WRShelfCost ; 
 
 else if (newProductCode.substring(0,2) == "RV") varCarcassSaving = (2000 - varHeight) / 100 * 1.00 + (595 - varWidth) / 100 * 2.00;
 
 else if (newProductCode.substring(0,4) == "Pane" || newProductCode.substring(0,4) == "Door" || newProductCode.substring(0,4) == "Kick" || newProductCode.substring(0,4) == "Fill" || newProductCode.substring(0,2) == "BT" || newProductCode.substring(0,1) == "2" || newProductCode.substring(0,1) == "L") { 
 		varCarcassSaving = 0;
	    varDoorSize =  varWidth;
		if (varWidth < 100) varDoorSize = 100;
   }     	    
 else varCarcassSaving = (varH - varHeight) / 100 * 5.00 + (varW - varWidth) / 100 * 4.00 + (varD - varDepth) / 100 * 4.00;

varDoorSaving = 0;  // no Doorsaving on Belmont and Byron Bay

 if      (varProdStyle == "Lamin") varDoorSaving = Math.round(((varH * varDoorWidth) - (varHeight * varDoorSize)) / 1000 * 0.055);
 else if (varProdStyle == "Unfin") varDoorSaving = Math.round(((varH * varDoorWidth) - (varHeight * varDoorSize)) / 1000 * .11);
 else if (varProdStyle == "Alban") varDoorSaving = Math.round(((varH * varDoorWidth) - (varHeight * varDoorSize)) / 1000 * .09);
 else if (varProdStyle == "Avoca") varDoorSaving = Math.round(((varH * varDoorWidth) - (varHeight * varDoorSize)) / 1000 * .10);
 else if (varProdStyle = "Carca" && newProductCode.substring(0,4) == "Kick")  varDoorSaving = ((varH * varDoorWidth) - (varHeight * varDoorSize)) / 1000 * 0.03;


//alert(" line 7598 - varDoorSaving= " + varDoorSaving + " varProdStyle= " + varProdStyle + " varH= " + varH + "  varDoorWidth= " + varDoorWidth + " varHeight= " + varHeight + " varDoorSize= " + varDoorSize );

 if (newProductCode.substring(0,4) == "BO-S" || newProductCode.substring(0,4) == "WO-S" || newProductCode.substring(0,4) == "BOA-" || 		newProductCode.substring(0,4) == "WDO-" || newProductCode.substring(0,4) == "BB45" || newProductCode.substring(0,4) == "BB45" ||    newProductCode.substring(0,3) == "MW/" || newProductCode.substring(0,2) == "WR" || newProductCode.substring(0,2) == "WE"  || newProductCode.substring(0,2) == "BT" || newProductCode.substring(0,1) == "c" || newProductCode.substring(0,2) == "RV" || newProductCode.substring(0,1) == "L")  varDoorSaving = 0; 
	
 if (newProductCode.substring(0,3) == "WOD" || newProductCode.substring(0,3) == "WOM") varDoorSaving = varDoorSaving / 2;  
 if (newProductCode.substring(0,3) == "MW/") varCarcassSaving = varCarcassSaving / 2; 
 
 if (newProductCode.substring(0,3) == "BTS" || newProductCode.substring(0,3) == "BTD") {	
 	if (varWidth < 601 && newProductCode.substring(0,3) == "BTS")  varBenchSaving = Math.round((varHeight / 100) * 13);
	else if (varWidth < 901 && newProductCode.substring(0,3) == "BTS")  varBenchSaving = Math.round((varHeight / 100) * 18.8);
	else if (varWidth < 1201 && newProductCode.substring(0,3) == "BTS") varBenchSaving = Math.round((varHeight / 100) * 28.25);
	else if (varWidth < 601 && newProductCode.substring(0,3) == "BTD")  varBenchSaving = Math.round((varHeight / 100) * 15.35);
	else if (varWidth < 901  && newProductCode.substring(0,3) == "BTD") varBenchSaving = Math.round((varHeight / 100) * 20.10);
	else if (varWidth < 1201  && newProductCode.substring(0,3) == "BTD") varBenchSaving = Math.round((varHeight / 100) * 29.50);
	varNewPrice = varBenchSaving;
	varBenchCost = varBenchCost + varBenchSaving; 	
 }
 
 if (newProductCode.substring(0,2) != "BT" && newProductCode.substring(0,1) != "3" && newProductCode.substring(0,1) != "2" && newProductCode.substring(0,11) != "DoorGlass/Y3")  {
 	  varNewPrice = Math.round(varOldPrice - varCarcassSaving - varDoorSaving);
	  
// Frame Doors  "DoorGlass/Y*"
	if (newProductCode.substring(0,11) == "DoorGlass/Y") {
	   var varNumber = varProductCode.substring(11,12)	   

	  if (newProductCode.substring(12,13) == "a") {
	     if (varNumber == 1) varNewPrice = Math.round(0.21574 * (varHeight * varWidth) / 1000 + 75.0);
		 else if (varNumber == 2) varNewPrice = Math.round(0.21574 * (varHeight * varWidth) / 1000 + 127.5);
		 else if (varNumber == 3) varNewPrice = Math.round(0.21574 * (varHeight * varWidth) / 1000 + 169.6);
	  }
      else if (newProductCode.substring(12,13) == "b") {
				 if (varNumber == 1 ) varNewPrice = Math.round(0.272 * (varHeight * varWidth) / 1000 + 83.80);
				 else if (varNumber == 2 ) varNewPrice = Math.round(0.272 * (varHeight * varWidth) / 1000 + 136.5);
				 else if (varNumber == 3) varNewPrice = Math.round(0.272 * (varHeight * varWidth) / 1000 + 178.5);
	  }
 	  else if (newProductCode.substring(12,13) == "c") {
				 if (varNumber == 1 )      varNewPrice = Math.round(0.3636 * (varHeight * varWidth) / 1000 + 52.0);
				 else if (varNumber == 2)  varNewPrice = Math.round(0.3854 * (varHeight * varWidth) / 1000 + 109.5);
				 else if (varNumber == 3 ) varNewPrice = Math.round(0.3883 * (varHeight * varWidth) / 1000 + 155);
	  }
	  else if (newProductCode.substring(12,13) == "d") {
				 if (varNumber == 1)      varNewPrice = Math.round(0.404 * (varHeight * varWidth) / 1000 + 83.8);				
				 else if (varNumber == 2) varNewPrice = Math.round(0.449 * (varHeight * varWidth) / 1000 + 108.3);
				 else if (varNumber == 3) varNewPrice = Math.round(0.4521 * (varHeight * varWidth) / 1000 + 153.7);
	  }
	  else   {            //   assume it is "e"  ----            if (varProductCode.substring(12,13) == "e") {			 
		 varNewPrice = Math.round(0.15 * (varHeight * varWidth) / 1000);
	     if (varNumber == 1) varNewPrice = Math.round(0.15 * (varHeight * varWidth) / 1000 + 75.0);
		 if (varNumber == 2) varNewPrice = Math.round(0.15 * (varHeight * varWidth) / 1000 + 127.5);
		 if (varNumber == 3) varNewPrice = Math.round(0.15 * (varHeight * varWidth) / 1000+ 169.6);				 
	  } 
		varWeight  = Math.round(0.02 * (varHeight * varWidth)/ 1000 + 0.2 ); 
	}

//alert("7643 line- " + varH + " " + varHeight + " " + varW + " " + varWidth + " " + varD + " " + varDepth + " " + curPrice + " ProductChangeFlag= " + varProductChangeFlag +  " varCarcassSaving= " + varCarcassSaving + " varDoorSaving= " + varDoorSaving + " varProdStyle= " + varProdStyle); 

}
 varProductChangeFlag == false;
  return varNewPrice;
}
//----------------------------------------------------------------------
function getInputDimensions(i)
{
	var iCustomFieldCount = getLineSubCount(i, colCustomFields);
    if (newProductCode.substring(0,1) != "2" && newProductCode.substring(0,1) != "3" && newProductCode.substring(0,1) != "z" && newProductCode.substring(0,1) != "H" && newProductCode.substring(0,2) != "WR" && newProductCode.substring(0,6) != "Outlet") { 
        varHeight = getLineSubItem(i, colCustomFields, 0);
	    varWidth = getLineSubItem(i, colCustomFields, 1);
	    varDepth = getLineSubItem(i, colCustomFields, 2); 
		varDoorSize = varWidth;	
		varShelfSize = varWidth * varDepth;
		if (newProductCode.substring(0,4) == "Fill" || newProductCode.substring(0,4) == "Door" ||newProductCode.substring(0,4) == "Kick") 
		   varDepth = 0;		
    } 
	if (newProductCode.substring(0,3) == "WC-" || newProductCode.substring(0,3) == "WD-" || newProductCode.substring(0,3) == "WDO" || newProductCode.substring(0,3) == "WB4-" || newProductCode.substring(0,3) == "PD-" || newProductCode.substring(0,3) == "PC-" || newProductCode.substring(0,3) == "BC-" || newProductCode.substring(0,3) == "BD-" || newProductCode.substring(0,3) == "BB4" || newProductCode.substring(0,3) == "BCA") {
	 varHeight = getLineSubItem(i, colCustomFields, 0);
	 varLHWidth = parseInt(getLineSubItem(i, colCustomFields, 1));
	 varRHWidth = parseInt(getLineSubItem(i, colCustomFields, 2));
	 varLHDepth = parseInt(getLineSubItem(i, colCustomFields, 3));
	 varRHDepth = parseInt(getLineSubItem(i, colCustomFields, 4));
	 varDoorSize = (varLHWidth + varRHWidth)- (varLHDepth + varRHDepth);
	 varShelfSize = varLHWidth * varRHDepth + varRHWidth * varLHDepth;
	}
 	if (newProductCode.substring(0,4) == "cBC-" || newProductCode.substring(0,4) == "cBCA" || newProductCode.substring(0,4) == "cWC-" || newProductCode.substring(0,4) == "cBD-" || newProductCode.substring(0,4) == "cWD-" || newProductCode.substring(0,3) == "cPC" || newProductCode.substring(0,3) == "cPD" || newProductCode.substring(0,3) == "cWC" ) {
	 varHeight = getLineSubItem(i, colCustomFields, 0);
	 varLHWidth = parseInt(getLineSubItem(i, colCustomFields, 1));
	 varRHWidth = parseInt(getLineSubItem(i, colCustomFields, 2));
	 varLHDepth = parseInt(getLineSubItem(i, colCustomFields, 3));
	 varRHDepth = parseInt(getLineSubItem(i, colCustomFields, 4));
	 varDoorSize = (varLHWidth + varRHWidth)- (varLHDepth + varRHDepth)
	 varShelfSize = varLHWidth * varRHDepth + varRHWidth * varLHDepth;
	}
	if (newProductCode.substring(0,2) == "WR" && newProductCode.substring(0,4) != "WRCS") {
		varHeight = getLineSubItem(i, colCustomFields, 3);
	    varWidth  = getLineSubItem(i, colCustomFields, 4);
	    varDepth  = getLineSubItem(i, colCustomFields, 5); 
		varShelfSize = varWidth * varDepth;
		varDoorSize = 0;
	}
	if (newProductCode.substring(0,4) == "WRCS") {
	 varHeight = getLineSubItem(i, colCustomFields, 0);
	 varLHWidth = parseInt(getLineSubItem(i, colCustomFields, 1));
	 varRHWidth = parseInt(getLineSubItem(i, colCustomFields, 2));
	 varLHDepth = parseInt(getLineSubItem(i, colCustomFields, 3));
	 varRHDepth = parseInt(getLineSubItem(i, colCustomFields, 4));
	 WRShelfQuantity = parseInt(getLineSubItem(i, colCustomFields, 5));
	 if (varLHWidth < 901 && varRHWidth < 901) WRShelfCost = 57.20;
	 else WRShelfCost = 64.50;
		varDoorSize = 0;
	}
	if (newProductCode.substring(0,4) == "BD-D" || newProductCode.substring(0,4) == "WD-D" || newProductCode.substring(0,4) == "BB45" || newProductCode.substring(0,4) == "WB45" || newProductCode.substring(0,4) == "cBD-" || newProductCode.substring(0,4) == "cWD-") varDoorSize = 600;
	if (newProductCode.substring(0,3) == "PD-" ) varDoorSize = Math.ceil(Math.sqrt(Math.pow(varLHWidth - varRHDepth,2)+ Math.pow(varRHWidth - varLHDepth,2)));
//alert("line 7625 varHeight= " + varHeight + "varWidth= " + varWidth + "varDepth= " + varDepth + " varDoorSize =" + varDoorSize);
}
//============================================
// Procedure to Acccept changes from the View Cart screen when the User OVERWRITE the listed Custom fields
function editCart(line, item, colCustomFields, iCustomField, productCode, customName, customValue, varCustomFieldNameCode)
{
		if (item.value != "NaN") {	
	        var varFieldCode = parseInt(varCustomFieldNameCode);
			
			if ((item.value.substring(0,1) == "n" || item.value.substring(0,1) == "y" || item.value.substring(0,1) == "a" || item.value.substring(0,1) == "b" || item.value.substring(0,1) == "l" || item.value.substring(0,1) == "f" || item.value.substring(0,1) == "r" || item.value.substring(0,1) == "l" || item.value.substring(0,1) == "b" || item.value.substring(0,1) == "c" || item.value.substring(0,1) == "d" || item.value.substring(0,1) == "s") && productCode.substring(0,1) != "3")
				{	 
					 var varFirstChar = item.value.substring(0,1);
					 var varFirstChar2 = varFirstChar.toUpperCase();
					 var newitemValue = varFirstChar2 + item.value.substring(1,item.value.length);
					 setLineSubItem(line, colCustomFields, iCustomField, newitemValue);
					 item.value = newitemValue;		
				}
			else if (customName.substring(0,6) == "Height") {
			         varMaxHeight = getMaxHeight(varFieldCode);
//alert(" 4597 customname= " + customName + " customValue= " + customValue + " item.value= " + item.value + " varCustomFieldNameCode= " + varCustomFieldNameCode + " varMaxHeight= " + varMaxHeight);
				      if (varMaxHeight > 0 && varMaxHeight < item.value) 
   window.alert("****You cannot exceed the HEIGHT (or Length) range for this Product***, please amend the height specified or select a different Product Range - also you could put a REQUEST for Quotation in the [Special Request] box and we will provide a quotation for this special case***");
                     else { setLineSubItem(line, colCustomFields, iCustomField, item.value);
					      window.location.href = 'viewcart.htm';
					  }
					  
            }
			else if (customName.substring(0,5) == "Width") {
			        varMaxWidth = getMaxWidth(varFieldCode);				 
                    if (varMaxWidth > 0 && varMaxWidth < item.value)
   window.alert("****You cannot exceed the MAXIMUM WIDTH for this Product***, please amend the field value specified or select a different Product Range - also you could put a REQUEST for Quotation in the [Special Request] box and we will provide a quotation for this special case***");								        	
			        else { setLineSubItem(line, colCustomFields, iCustomField, item.value);
			               window.location.href = 'viewcart.htm';
				    }
			}
			else if (customName.substring(0,4) == "LH W") {
			        varMaxWidth = getMaxWidth(varFieldCode);				 
                    if (varMaxWidth > 0 && varMaxWidth < item.value)
   window.alert("****You cannot exceed the MAXIMUM LH WIDTH for this Product***, please amend the field value specified or select a different Product Range - also you could put a REQUEST for Quotation in the [Special Request] box and we will provide a quotation for this special case***");								        	
			        else { setLineSubItem(line, colCustomFields, iCustomField, item.value);
			               window.location.href = 'viewcart.htm';
				    }
			}
			else if (customName.substring(0,4) == "RH W") {
			        varMaxWidth = getMaxWidth(varFieldCode);				 
                    if (varMaxWidth > 0 && varMaxWidth < item.value)
   window.alert("****You cannot exceed the MAXIMUM RH WIDTH for this Product***, please amend the field value specified or select a different Product Range - also you could put a REQUEST for Quotation in the [Special Request] box and we will provide a quotation for this special case***");								        	
			        else { setLineSubItem(line, colCustomFields, iCustomField, item.value);
			               window.location.href = 'viewcart.htm';
				    }
			}
			
			else {  setLineSubItem(line, colCustomFields, iCustomField, item.value);
			              window.location.href = 'viewcart.htm';
			}		
		
	if (customName.substring(0,4) == "SECT") {
	         if (item.value != "A" && item.value != "B" && item.value != "C" && item.value != "D" && item.value != "E" && item.value != "F" && item.value != "G")  alert("The only values allowed here are [A] - [G] ..... please correct");  }
	
	if (customName.substring(0,10) == "Door Style" || customName.substring(0,11) == "Panel Style" || customName.substring(0,12) == "Drawer Front" || customName.substring(0,12) == "Filler Style"  || customName.substring(0,10) == "Kickboards") {
  		if (item.value != "NaN" && item.value.substring(0,5) != "Lamin" && item.value.substring(0,5) != "GLOSS" && item.value.substring(0,5) != "Belmo"  && item.value.substring(0,5) !=  "Byron" && item.value.substring(0,5) != "Alban" && item.value.substring(0,5) != "Avoca" && item.value.substring(0,5) != "Unfin")
 		{
		alert("You changed to an invalid Style - only [Belmont},[Byron Bay],[Albany], [Avoca],[Unfinished],[Laminate], [GLOSS] is valid here.  You can specify a particular Colour, Profile or Material in STEP 7: Colour & Profiles.  ---- The Style has been set to [Laminate] in the mean time");
  			 newitemValue = "Laminate"; 
   			 setLineSubItem(line, colCustomFields, iCustomField, newitemValue);
  		}
	}
  }
}
//==============================
function wardrobeError(varRWError,varSection)
{
window,alert("The Wardrobe Insert specifications for [" + varRWError + " ] is missing a SECTION code [" + varSection + "]. Please Insert a Section [" + varSection + "] or recode the other SECTIONS for that Wardrobe to make a complete sequence like: [A],[B]....[G].");
varFatalError = true;
varFieldCheck = 1;
X = 0;
Y = 0;	                
}
//============================
var newwindow;
var newwindow1;
var newwindow2;
var newwindow3;
function poptastic(url)
{
  if (newwindow) newwindow.close();
  if (newwindow1) newwindow1.close();
  if (newwindow2) newwindow2.close();
  if (newwindow3) newwindow3.close();
  newwindow = window.open(url,"pop1","height=300,width=600,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=no,status=no");
  if (window.focus){newwindow.focus()}
}
function poptastic1(url)
{
  if (newwindow) newwindow.close();
  if (newwindow1) newwindow1.close();
  if (newwindow2) newwindow2.close();
  if (newwindow3) newwindow3.close();
  newwindow1 = window.open(url,"pop2","height=250,width=1100,left=10,top=1000,resizable=yes,scrollbars=yes,toolbar=no,status=no");
  if (window.focus){newwindow1.focus()}
}

function poptastic2(url)
{
  if (newwindow) newwindow.close();
  if (newwindow1) newwindow1.close();
   if (newwindow2) newwindow2.close();
   if (newwindow3) newwindow3.close();
   newwindow2 = window.open(url,"pop3","height=350,width=780,left=400,top=010,resizable=yes,scrollbars=yes,toolbar=no,status=no");
  if (window.focus){newwindow2.focus()}
// location.href=url;
 
}

function poptastic3(url)
{
  if (newwindow) newwindow.close();
  if (newwindow2) newwindow2.close();
  if (newwindow3) newwindow3.close();
  newwindow3 = window.open(url,"pop4","height=200,width=950,left=20,top=1050,resizable=yes,scrollbars=yes,toolbar=no,status=no");
  if (window.focus){newwindow3.focus()}
}

//===========================================
function checkSpecialCharacters(varSpecialRequest)
{
var varX = 0;
var varY = 1;
var varSRL = varSpecialRequest.length;
 for(varX = 0; varX <varSRL; varX++)
 {					
    if (varSpecialRequest.substring(varX,varY + 2) == "%3B") varSpecialRequest = replaceChar(varSpecialRequest,".",varX);
	if (varSpecialRequest.substring(varX,varY + 2) == "%2C") varSpecialRequest = replaceChar(varSpecialRequest,".",varX);
	if (varSpecialRequest.substring(varX,varY) == "-") varSpecialRequest = replaceChar(varSpecialRequest,"_",varX);
	if (varSpecialRequest.substring(varX,varY + 2) == "%3D") varSpecialRequest = replaceChar(varSpecialRequest,"EQUALS",varX);
	varY = varY + 1

  }
  return varSpecialRequest;
}

function replaceChar(varSpecialRequest,varChar,varX)
{ 
 var varSRL = varSpecialRequest.length;
 var varNew = "";
  if (varChar == "_" ) varNew = varSpecialRequest.substring(0,varX) + varChar + varSpecialRequest.substring(varX + 1,varSRL);
  else    varNew = varSpecialRequest.substring(0,varX) + varChar + varSpecialRequest.substring(varX + 3,varSRL);
// alert("4695 varX= " + varX + " varChar= " + varChar + " " + varNew); 
  varSpecialRequest = varNew;
  return varSpecialRequest;
}
function returnaddress(varFullProductStyle)
{
  if (varFullProductStyle == "MELAMINE (LAMINATE) style") location.replace("category258_1.htm");
  else if (varFullProductStyle == "GLOSS Laminate (Formica) style") location.replace("category307_1.htm");
  else if (varFullProductStyle == "BELMONT style") location.replace("category270_1.htm");
  else if (varFullProductStyle == "Vinyl - BYRON BAY style") location.replace("category311_1.htm");
  else if (varFullProductStyle == "Polyurethane - ALBANY style")  location.replace("category312_1.htm");
  else if (varFullProductStyle == "Polyurethane - AVOCA style") location.replace("category313_1.htm");
  else if (varFullProductStyle == "Unfinished 18mm MR-MDF") location.replace("category484_1.htm");
}
//==================end
