// Object constructors 

function CAPRecord(Code, Price) { 

   this.Code = Code

   this.Price = Price 

   this.Quantity = 1 

   this.Description = "CAP"

   this.Flags = "{GST}{PST}{HST}{US}{TEST}{TESTD}|"

} 



var CAPPriceListUS = new Array() 

// Stuff main array entries with objects.

// All Prods on the Wands Page Follow 

CAPPriceListUS[0] = new CAPRecord("BANANA",36.99) 

CAPPriceListUS[1] = new CAPRecord("BLISS", 54.99) 

CAPPriceListUS[2] = new CAPRecord("BOOM7", 24.99) 

CAPPriceListUS[3] = new CAPRecord("CCANE", 29.99) 

CAPPriceListUS[4] = new CAPRecord("DHWAND", 49.99) 

CAPPriceListUS[5] = new CAPRecord("ETERNITY", 69.99) 

CAPPriceListUS[6] = new CAPRecord("JWAND", 36.99) 

CAPPriceListUS[7] = new CAPRecord("KEIGMAST", 48.99) 

CAPPriceListUS[8] = new CAPRecord("ORB", 70.99) 

CAPPriceListUS[9] = new CAPRecord("PROBE7", 24.99) 

CAPPriceListUS[10] = new CAPRecord("RIPPLER", 49.99) 

CAPPriceListUS[11] = new CAPRecord("SCEPTRE", 36.99) 

CAPPriceListUS[12] = new CAPRecord("SMOOTH7", 21.99) 

CAPPriceListUS[13] = new CAPRecord("SWAND-I", 29.99) 

CAPPriceListUS[14] = new CAPRecord("SWAND-II", 69.99) 

CAPPriceListUS[15] = new CAPRecord("THUNDER", 49.99) 

CAPPriceListUS[16] = new CAPRecord("TWAND", 42.99) 

CAPPriceListUS[17] = new CAPRecord("TWISTY", 54.99) 

CAPPriceListUS[18] = new CAPRecord("WAVE", 41.99) 

CAPPriceListUS[19] = new CAPRecord("ZEXPLORE", 26.99)

CAPPriceListUS[20] = new CAPRecord("CBUMP", 59.99)

CAPPriceListUS[21] = new CAPRecord("REACH16", 64.99)

CAPPriceListUS[22] = new CAPRecord("CAN3", 94.99)

CAPPriceListUS[23] = new CAPRecord("CAN2", 59.99)

CAPPriceListUS[24] = new CAPRecord("COCKRING", 19.99)

CAPPriceListUS[25] = new CAPRecord("TWEEZE", 9.99)

CAPPriceListUS[26] = new CAPRecord("CLIPS", 7.99)

CAPPriceListUS[27] = new CAPRecord("XDP", 79.99)

CAPPriceListUS[28] = new CAPRecord("VEGG", 65.99)

CAPPriceListUS[29] = new CAPRecord("ABARB", 33.99)

CAPPriceListUS[30] = new CAPRecord("CLASSICBP", 33.99)

CAPPriceListUS[31] = new CAPRecord("TORP3", 26.99)

CAPPriceListUS[32] = new CAPRecord("KSGVIBE", 12.99)

CAPPriceListUS[33] = new CAPRecord("KSVIBE", 8.99)

CAPPriceListUS[34] = new CAPRecord("CHAMELION", 38.99)

CAPPriceListUS[35] = new CAPRecord("ROCKET6", 46.99)

CAPPriceListUS[36] = new CAPRecord("REACH16", 75.99)

CAPPriceListUS[37] = new CAPRecord("EG_TOUCHME", 49.99)

CAPPriceListUS[38] = new CAPRecord("EG_GSPOT", 55.99)

CAPPriceListUS[39] = new CAPRecord("EG_FANTASY", 49.99)

CAPPriceListUS[40] = new CAPRecord("EG_HELIX", 24.99)

CAPPriceListUS[41] = new CAPRecord("CUSTOM_18", 86.99)

CAPPriceListUS[42] = new CAPRecord("PERFECT-BODY", 44.99)

CAPPriceListUS[43] = new CAPRecord("LoveLace", 44.99)

CAPPriceListUS[44] = new CAPRecord("POSEIDON", 48.99)

CAPPriceListUS[45] = new CAPRecord("OTWIRL", 48.99)

CAPPriceListUS[46] = new CAPRecord("JUICER", 49.99)







function getPrice(prod_code) { 

    var s;

   // Loop through all entries of regionalOffices array. 

   for (var i = 0; i < CAPPriceListUS.length; i++) { 

      // Compare uppercase versions of entered text against one entry 

      // of regionalOffices. 

      if (prod_code.toUpperCase() == CAPPriceListUS[i].Code.toUpperCase()) { 

         // if they're the same, then break out of the for loop 

         break

      } 

   } 

   // Make sure the i counter hasn't exceeded the max index value. 

   if (i < CAPPriceListUS.length) { 

      // Display corresponding entries from parallel arrays. 

      s = CAPPriceListUS[i].Price;

   } else {  // Loop went all the way with no matches. 

      // Empty any previous values. 

      s= 0.0;

      // Advise user. 

      alert("No match found for " + prod_code + ".") 

   } 

  return (s);

} 




