 /////////////////////////////////////////////////
// set up packaging array
function pkgItem(type) {
     this.type = type
}

var packaging = new Array();

packaging[0]  =  new pkgItem("bag");
packaging[1]  =  new pkgItem("crate");
packaging[2]  =  new pkgItem("4 pack");
packaging[3]  =  new pkgItem("6 pack");
packaging[4]  =  new pkgItem("cello pack");
packaging[5]  =  new pkgItem("bulk pack");

/////////////////////////////////////////////////
// set up descr array
function descrItem(descr) {
     this.descr = descr
}

var descriptions = new Array();

descriptions[0]  =  new descrItem("This is one of the most popular, sought after wild mushrooms. Its flavor is unlike any other mushroom, tasting meaty or nut-like. Its aromatic quality lends itself best to light cream or wine sauces, and pastas.");
descriptions[1]  =  new descrItem("This mushroom has an undeniable fragrance, both sweet and spicy. An all purpose mushroom that can be substituted for any kind when the recipe calls. It is excellent with everything.");
descriptions[2]  =  new descrItem("This extremely versatile mushroom can be replaced when a recipe calls for any other mushroom. This is a firm, soft textured mushroom that goes well with baked dishes or sauteed with meat. Enjoy!");
descriptions[3]  =  new descrItem("This extremely popular mushroom has a texture that is both chewy and crunchy and holds up well when cooking. With this mushrooms peppery undertones it goes very well in combination with dried apricots, peaches, or apples.");
descriptions[4]  =  new descrItem("Like the yellow chanterelle, this mushroom has a texture that is both chewy and crunchy. Its beautiful color makes any dish more presentable. This rare mushroom has a bold taste that is undeniable. Enjoy!");
descriptions[5]  =  new descrItem("This bold mushroom is striking with any dish. Most popular with french cuisine, this mushroom does taste best after being re-hydrated from a dried form.");
descriptions[6]  =  new descrItem("This sought after mushroom is popular to both master chefs and the ordinary cook alike. The King Bolete has a flavor that is robust and a texture that is meaty and sturdy. It complements strongly flavored dishes best.");
descriptions[7]  =  new descrItem("This extremely versatile mushroom can be substituted any time a recipe calls for white button mushrooms. Its flavor is sweet and mild, its texture is fragile and soft. Goes very well with stir fry's, sauteing, and braising.");
descriptions[8]  =  new descrItem("This unique mushroom has a distinct flavor and appearance. Very good fried or with many curry dishes, and also popular in soups and stews. Enjoy!");
descriptions[9]  =  new descrItem("This mushroom is a cook\'s delight. It has a slightly different taste than its cousin, the King Bolete, but it\'s still excellent in many dishes and salads. Enjoy!");
descriptions[10]  =  new descrItem("This is a very versatile mushroom, going well with both meat and fish dishes. It has a flavor that is not met by any others, and should be tried as a separate dish on their own.");
descriptions[11]  =  new descrItem("This rare and highly prized mushroom is prized for its strong and distinct mushroom taste. Goes great in sauces and is an excellent addition in soups. Enjoy!");
descriptions[12]  =  new descrItem("A spring delicacy, fiddleheads are the young fronds of certain types of ferns. Although the word \"fiddlehead\" could refer to any fern shoots, only one variety, the ostrich fern, is considered edible. These tightly curled green shoots are picked before their leaves unfurl.");
descriptions[13]  =  new descrItem("Known as \"red mushroom\", \"beefsteak mushroom\", or \"false morel\" it is a poisonous ascomycete fungus somewhat similar in appearance to the \"true\" morel but considered a delicacy if properly preparred.");
descriptions[14]  =  new descrItem("This easily recognized mushroom stands out with its bold color, soft color and absence of gills. Makes a surprisingly good substitute for chicken dishes if prepared right!");
descriptions[15]  =  new descrItem("Fresh black summer truffles (Tuber aestivum) are in season from late-May through September. Not as pungent as the winter truffle (Tuber melanosporum), they still have a lot of flavor with a much smaller price tag. If you have avoided buying truffles because of the expense, you may wish to try the summer truffle.");
//descriptions[16]  =  new descrItem();



/////////////////////////////////////////////////
// set up catalog array
function catItem(idx,code,stock,cat,pkgCode,weight,priceOzUSD,name,fname,descCode) {
     this.idx = idx
     this.code = code
     this.stock = stock //not in stock=0, in stock=1, not in season=0, in season=1
     this.cat = cat
     this.pkgCode = pkgCode
     this.weight = weight
     this.priceOzUSD = priceOzUSD

     this.name = name
     this.fname = fname
     this.descCode = descCode
}
var catalog = new Array();

catalog[0]  =  new catItem(0,"mor",1,"drm",0,1,14,"Dried Morel Mushroom","morel",0);
catalog[1]  =  new catItem(1,"mor",1,"drm",0,4,10.0,"Dried Morel Mushroom","morel",0);
catalog[2]  =  new catItem(2,"mor",1,"drm",0,8,10.0,"Dried Morel Mushroom","morel",0);
catalog[3]  =  new catItem(3,"mor",1,"drm",0,16,10.0,"Dried Morel Mushroom","morel",0);

catalog[4]  =  new catItem(4,"mat",1,"drm",0,1,9,"Dried Matsutake (Pine) Mushroom","pine",1);
catalog[5]  =  new catItem(5,"mat",1,"drm",0,4,5,"Dried Matsutake (Pine) Mushroom","pine",1);
catalog[6]  =  new catItem(6,"mat",1,"drm",0,8,3.625,"Dried Matsutake (Pine) Mushroom","pine",1);
catalog[7]  =  new catItem(7,"mat",1,"drm",0,16,3.0625,"Dried Matsutake (Pine) Mushroom","pine",1);

catalog[8]  =  new catItem(8,"lob",1,"drm",0,1,9,"Dried Lobster Mushroom","lobster",2);
catalog[9]  =  new catItem(9,"lob",1,"drm",0,4,4.5,"Dried Lobster Mushroom","lobster",2);
catalog[10]  =  new catItem(10,"lob",1,"drm",0,8,3.5,"Dried Lobster Mushroom","lobster",2);
catalog[11]  =  new catItem(11,"lob",1,"drm",0,16,3.125,"Dried Lobster Mushroom","lobster",2);

catalog[12]  =  new catItem(12,"ych",1,"drm",0,1,9,"Dried Yellow Chanterelle Mushroom","yellowchant",3);
catalog[13]  =  new catItem(13,"ych",1,"drm",0,4,5,"Dried Yellow Chanterelle Mushroom","yellowchant",3);
catalog[14]  =  new catItem(14,"ych",1,"drm",0,8,3.625,"Dried Yellow Chanterelle Mushroom","yellowchant",3);
catalog[15]  =  new catItem(15,"ych",1,"drm",0,16,3.0625,"Dried Yellow Chanterelle Mushroom","yellowchant",3);

catalog[16]  =  new catItem(16,"bch",0,"drm",0,1,9,"Dried Blue Chanterelle Mushroom","bluechant",4);
catalog[17]  =  new catItem(17,"bch",0,"drm",0,4,5.25,"Dried Blue Chanterelle Mushroom","bluechant",4);
catalog[18]  =  new catItem(18,"bch",0,"drm",0,8,3.75,"Dried Blue Chanterelle Mushroom","bluechant",4);
catalog[19]  =  new catItem(19,"bch",0,"drm",0,16,3.3125,"Dried Blue Chanterelle Mushroom","bluechant",4);

catalog[20]  =  new catItem(20,"tru",0,"drm",0,1,9,"Dried Black Trumpet Mushroom","trumpet",5);
catalog[21]  =  new catItem(21,"tru",0,"drm",0,4,5,"Dried Black Trumpet Mushroom","trumpet",5);
catalog[22]  =  new catItem(22,"tru",0,"drm",0,8,3.625,"Dried Black Trumpet Mushroom","trumpet",5);
catalog[23]  =  new catItem(23,"tru",0,"drm",0,16,3.0625,"Dried Black Trumpet Mushroom","trumpet",5);

catalog[24]  =  new catItem(24,"por",1,"drm",0,1,9,"Dried Porcini Bolete Mushroom","porcini",6);
catalog[25]  =  new catItem(25,"por",1,"drm",0,4,5,"Dried Porcini Bolete Mushroom","porcini",6);
catalog[26]  =  new catItem(26,"por",1,"drm",0,8,3.625,"Dried Porcini Bolete Mushroom","porcini",6);
catalog[27]  =  new catItem(27,"por",1,"drm",0,16,3.0625,"Dried Porcini Bolete Mushroom","porcini",6);

catalog[28]  =  new catItem(28,"oys",1,"drm",0,1,9,"Dried Oyster Mushroom","oyster",7);
catalog[29]  =  new catItem(29,"oys",1,"drm",0,4,5,"Dried Oyster Mushroom","oyster",7);
catalog[30]  =  new catItem(30,"oys",1,"drm",0,8,3.625,"Dried Oyster Mushroom","oyster",7);
catalog[31]  =  new catItem(31,"oys",1,"drm",0,16,3.0625,"Dried Oyster Mushroom","oyster",7);

catalog[32]  =  new catItem(32,"cau",0,"drm",0,1,9,"Dried Cauliflower Mushroom","cauliflower",8);
catalog[33]  =  new catItem(33,"cau",0,"drm",0,4,5,"Dried Cauliflower Mushroom","cauliflower",8);
catalog[34]  =  new catItem(34,"cau",0,"drm",0,8,3.625,"Dried Cauliflower Mushroom","cauliflower",8);
catalog[35]  =  new catItem(35,"cau",0,"drm",0,16,3.0625,"Dried Cauliflower Mushroom","cauliflower",8);

catalog[36]  =  new catItem(36,"adm",1,"drm",0,1,9,"Dried Admiral Bolete Mushroom","admiral",9);
catalog[37]  =  new catItem(37,"adm",1,"drm",0,4,5,"Dried Admiral Bolete Mushroom","admiral",9);
catalog[38]  =  new catItem(38,"adm",1,"drm",0,8,3.625,"Dried Admiral Bolete Mushroom","admiral",9);
catalog[39]  =  new catItem(39,"adm",1,"drm",0,16,3.0625,"Dried Admiral Bolete Mushroom","admiral",9);

catalog[40]  =  new catItem(40,"hed",1,"drm",0,1,9,"Dried Hedgehog Mushroom","hedgehog",10);
catalog[41]  =  new catItem(41,"hed",1,"drm",0,4,4,"Dried Hedgehog Mushroom","hedgehog",10);
catalog[42]  =  new catItem(42,"hed",1,"drm",0,8,3.25,"Dried Hedgehog Mushroom","hedgehog",10);
catalog[43]  =  new catItem(43,"hed",1,"drm",0,16,2.75,"Dried Hedgehog Mushroom","hedgehog",10);

catalog[44]  =  new catItem(44,"bea",1,"drm",0,1,9,"Dried Bear's Tooth Mushroom","bearstooth",11);
catalog[45]  =  new catItem(45,"bea",1,"drm",0,4,5,"Dried Bear's Tooth Mushroom","bearstooth",11);
catalog[46]  =  new catItem(46,"bea",1,"drm",0,8,3.625,"Dried Bear's Tooth Mushroom","bearstooth",11);
catalog[47]  =  new catItem(47,"bea",1,"drm",0,16,3.0625,"Dried Bear's Tooth Mushroom","bearstooth",11);

catalog[301]  =  new catItem(301,"bea",1,"drm",0,1,9,"Dried Red Cap Bolete Mushroom","red-cap-bolete-mushroom",301);
catalog[302]  =  new catItem(302,"bea",1,"drm",0,4,5,"Dried Red Cap Bolete Mushroom","red-cap-bolete-mushroom",301);
catalog[303]  =  new catItem(303,"bea",1,"drm",0,8,3.625,"Dried Red Cap Bolete Mushroom","red-cap-bolete-mushroom",301);
catalog[304]  =  new catItem(304,"bea",1,"drm",0,16,3.0625,"Dried Red Cap Bolete Mushroom","red-cap-bolete-mushroom",301);

catalog[305]  =  new catItem(305,"bea",1,"drm",0,1,9,"Dried Yellow Foot Chanterelle Mushroom","yellow-foot-chanterelle-mushroom",305);
catalog[306]  =  new catItem(306,"bea",1,"drm",0,4,5,"Dried Yellow Foot Chanterelle Mushroom","yellow-foot-chanterelle-mushroom",305);
catalog[307]  =  new catItem(307,"bea",1,"drm",0,8,3.625,"Dried Yellow Foot Chanterelle Mushroom","yellow-foot-chanterelle-mushroom",305);
catalog[308]  =  new catItem(308,"bea",1,"drm",0,16,3.0625,"Dried Yellow Foot Chanterelle Mushroom","yellow-foot-chanterelle-mushroom",305);

catalog[48]  =  new catItem(48,"mor",1,"frm",1,16,2.0,"Fresh Morel Mushroom","morel",0);
catalog[49]  =  new catItem(49,"mor",1,"frm",1,80,2.0,"Fresh Morel Mushroom","morel",0);
catalog[50]  =  new catItem(50,"mor",1,"frm",1,160,2.0,"Fresh Morel Mushroom","morel",0);

catalog[51]  =  new catItem(51,"fid",0,"frg",1,16,0.84375,"Fresh Fiddlehead","fiddlehead",12);
catalog[52]  =  new catItem(52,"fid",0,"frg",1,80,0.84375,"Fresh Fiddlehead","fiddlehead",12);
catalog[53]  =  new catItem(53,"fid",0,"frg",1,160,0.84375,"Fresh Fiddlehead","fiddlehead",12);

catalog[54]  =  new catItem(54,"mat",0,"frm",1,16,2.1875,"Fresh Matsutake (Pine) Mushroom","pine",1);
catalog[55]  =  new catItem(55,"mat",0,"frm",1,80,2.1875,"Fresh Matsutake (Pine) Mushroom","pine",1);
catalog[56]  =  new catItem(56,"mat",0,"frm",1,160,2.1875,"Fresh Matsutake (Pine) Mushroom","pine",1);

catalog[57]  =  new catItem(57,"ver",0,"frm",1,16,1.75,"Fresh Verpa Mushroom","verpa",13);
catalog[58]  =  new catItem(58,"ver",0,"frm",1,80,1.6625,"Fresh Verpa Mushroom","verpa",13);
catalog[59]  =  new catItem(59,"ver",0,"frm",1,160,1.625,"Fresh Verpa Mushroom","verpa",13);

catalog[60]  =  new catItem(60,"lob",0,"frm",1,16,.875,"Fresh Lobster Mushroom","lobster",2);
catalog[61]  =  new catItem(61,"lob",0,"frm",1,80,.875,"Fresh Lobster Mushroom","lobster",2);
catalog[62]  =  new catItem(62,"lob",0,"frm",1,160,.875,"Fresh Lobster Mushroom","lobster",2);

catalog[63]  =  new catItem(63,"ych",1,"frm",1,16,1.375,"Fresh Yellow Chanterelle Mushroom","yellowchant",3);
catalog[64]  =  new catItem(64,"ych",1,"frm",1,80,1.375,"Fresh Yellow Chanterelle Mushroom","yellowchant",3);
catalog[65]  =  new catItem(65,"ych",1,"frm",1,160,1.375,"Fresh Yellow Chanterelle Mushroom","yellowchant",3);

catalog[66]  =  new catItem(66,"bch",0,"frm",1,16,1.75,"Fresh Blue Chanterelle Mushroom","bluechant",4);
catalog[67]  =  new catItem(67,"bch",0,"frm",1,80,1.6625,"Fresh Blue Chanterelle Mushroom","bluechant",4);
catalog[68]  =  new catItem(68,"bch",0,"frm",1,160,1.625,"Fresh Blue Chanterelle Mushroom","bluechant",4);

catalog[69]  =  new catItem(69,"tru",1,"frm",1,16,1.625,"Fresh Black Trumpet Mushroom","trumpet",5);
catalog[70]  =  new catItem(70,"tru",1,"frm",1,80,1.625,"Fresh Black Trumpet Mushroom","trumpet",5);
catalog[71]  =  new catItem(71,"tru",1,"frm",1,160,1.625,"Fresh Black Trumpet Mushroom","trumpet",5);

catalog[72]  =  new catItem(72,"por",0,"frm",1,16,1.5625,"Fresh Porcini Mushroom","porcini",6);
catalog[73]  =  new catItem(73,"por",0,"frm",1,80,1.5625,"Fresh Porcini Mushroom","porcini",6);
catalog[74]  =  new catItem(74,"por",0,"frm",1,160,1.5625,"Fresh Porcini Mushroom","porcini",6);

catalog[75]  =  new catItem(75,"oys",1,"frm",1,16,.75,"Fresh Oyster Mushroom","oyster",7);
catalog[76]  =  new catItem(76,"oys",1,"frm",1,80,.75,"Fresh Oyster Mushroom","oyster",7);
catalog[77]  =  new catItem(77,"oys",1,"frm",1,160,.75,"Fresh Oyster Mushroom","oyster",7);

catalog[78]  =  new catItem(78,"cau",0,"frm",1,16,1.125,"Fresh Cauliflower Mushroom","cauliflower",8);
catalog[79]  =  new catItem(79,"cau",0,"frm",1,80,1.125,"Fresh Cauliflower Mushroom","cauliflower",8);
catalog[80]  =  new catItem(80,"cau",0,"frm",1,160,1.125,"Fresh Cauliflower Mushroom","cauliflower",8);

catalog[81]  =  new catItem(81,"chk",0,"frm",1,16,1.125,"Fresh Chicken of the Woods Mushroom","chicken",14);
catalog[82]  =  new catItem(82,"chk",0,"frm",1,80,1.125,"Fresh Chicken of the Woods Mushroom","chicken",14);
catalog[83]  =  new catItem(83,"chk",0,"frm",1,160,1.125,"Fresh Chicken of the Woods Mushroom","chicken",14);

catalog[84]  =  new catItem(84,"hed",1,"frm",1,16,1.25,"Fresh Hedgehog Mushroom","hedgehog",10);
catalog[85]  =  new catItem(85,"hed",1,"frm",1,80,1.25,"Fresh Hedgehog Mushroom","hedgehog",10);
catalog[86]  =  new catItem(86,"hed",1,"frm",1,160,1.25,"Fresh Hedgehog Mushroom","hedgehog",10);

catalog[87]  =  new catItem(87,"bea",0,"frm",1,16,1.50,"Fresh Bear's Tooth Mushroom","bearstooth",11);
catalog[88]  =  new catItem(88,"bea",0,"frm",1,80,1.50,"Fresh Bear's Tooth Mushroom","bearstooth",11);
catalog[89]  =  new catItem(89,"bea",0,"frm",1,160,1.50,"Fresh Bear's Tooth Mushroom","bearstooth",11);

catalog[90]  =  new catItem(90,"adm",0,"frm",1,16,1.75,"Fresh Admiral Bolete Mushroom","admiral",9);
catalog[91]  =  new catItem(91,"adm",0,"frm",1,80,1.6625,"Fresh Admiral Bolete Mushroom","admiral",9);
catalog[92]  =  new catItem(92,"adm",0,"frm",1,160,1.625,"Fresh Admiral Bolete Mushroom","admiral",9);

catalog[200]  =  new catItem(200,"yfc",1,"frm",1,16,1.0,"Fresh Yellow Foot Chanterelle Mushroom","yellow-foot-chanterelle-mushroom",305);
catalog[201]  =  new catItem(201,"yfc",1,"frm",1,80,1.0,"Fresh Yellow Foot Chanterelle Mushroom","yellow-foot-chanterelle-mushroom",305);
catalog[202]  =  new catItem(202,"yfc",1,"frm",1,160,1.0,"Fresh Yellow Foot Chanterelle Mushroom","yellow-foot-chanterelle-mushroom",305);


catalog[93]  =  new catItem(93,"bst",0,"drm",0,4,28.0,"Black Summer Truffles","black-summer-truffle",15);
catalog[94]  =  new catItem(94,"bst",0,"drm",0,8,28.0,"Black Summer Truffles","black-summer-truffle",15);
catalog[95]  =  new catItem(95,"bst",0,"drm",0,16,28.0,"Black Summer Truffles","black-summer-truffle",15);

catalog[96]  =  new catItem(96,"bst",1,"frm",1,16,12.8125,"Black Oregon Truffles","bstruffle",16);
catalog[97]  =  new catItem(97,"bst",1,"frm",1,80,12.8125,"Black Oregon Truffles","bstruffle",16);
catalog[98]  =  new catItem(98,"bst",1,"frm",1,160,12.8125,"Black Oregon Truffles","bstruffle",16);

catalog[192]  =  new catItem(192,"bst",1,"drm",0,4,28.0,"Fresh Black Oregon Truffles - 3 oz","Black-Oregon-Truffles",48);
catalog[193]  =  new catItem(193,"bst",1,"drm",0,8,28.0,"Fresh Black Oregon Truffles - 3 oz","Black-Oregon-Truffles",48);
catalog[194]  =  new catItem(194,"bst",1,"drm",0,16,28.0,"Fresh Black Oregon Truffles - 3 oz","Black-Oregon-Truffles",48);

catalog[99]  =  new catItem(99,"bst",1,"frm",1,16,12.8125,"Black Summer Truffles","bstruffle",17);
catalog[100]  =  new catItem(100,"bst",1,"frm",1,80,12.8125,"Black Summer Truffles","bstruffle",17);
catalog[101]  =  new catItem(101,"bst",1,"frm",1,160,12.8125,"Black Summer Truffles","bstruffle",17);

catalog[102]  =  new catItem(102,"bst",1,"frm",1,16,12.8125,"Black Summer Truffles","bstruffle",18);
catalog[103]  =  new catItem(103,"bst",1,"frm",1,80,12.8125,"Black Summer Truffles","bstruffle",18);
catalog[104]  =  new catItem(104,"bst",1,"frm",1,160,12.8125,"Black Summer Truffles","bstruffle",18);

catalog[105]  =  new catItem(105,"bst",1,"frm",1,16,12.8125,"Black Summer Truffles","bstruffle",19);
catalog[106]  =  new catItem(106,"bst",1,"frm",1,80,12.8125,"Black Summer Truffles","bstruffle",19);
catalog[107]  =  new catItem(107,"bst",1,"frm",1,160,12.8125,"Black Summer Truffles","bstruffle",19);

catalog[108]  =  new catItem(108,"bst",1,"frm",1,16,12.8125,"Black Summer Truffles","bstruffle",20);
catalog[109]  =  new catItem(109,"bst",1,"frm",1,80,12.8125,"Black Summer Truffles","bstruffle",20);
catalog[110]  =  new catItem(110,"bst",1,"frm",1,160,12.8125,"Black Summer Truffles","bstruffle",20);

catalog[111]  =  new catItem(111,"bst",1,"frm",1,16,12.8125,"Black Summer Truffles","bstruffle",21);
catalog[112]  =  new catItem(112,"bst",1,"frm",1,80,12.8125,"Black Summer Truffles","bstruffle",21);
catalog[113]  =  new catItem(113,"bst",1,"frm",1,160,12.8125,"Black Summer Truffles","bstruffle",21);

catalog[114]  =  new catItem(114,"bst",1,"frm",1,16,12.8125,"Black Summer Truffles","bstruffle",22);
catalog[115]  =  new catItem(115,"bst",1,"frm",1,80,12.8125,"Black Summer Truffles","bstruffle",22);
catalog[116]  =  new catItem(116,"bst",1,"frm",1,160,12.8125,"Black Summer Truffles","bstruffle",22);

catalog[117]  =  new catItem(117,"bst",1,"frm",1,16,1.125,"Maitake Mushroom","maitake-mushroom",23);
catalog[118]  =  new catItem(118,"bst",1,"frm",1,80,1.125,"Maitake Mushroom","maitake-mushroom",23);
catalog[119]  =  new catItem(119,"bst",1,"frm",1,160,1.125,"Maitake Mushroom","maitake-mushroom",23);

catalog[120]  =  new catItem(120,"bst",1,"frm",1,16,1.625,"Blue foot Mushroom","Blue-foot-Mushroom",24);
catalog[121]  =  new catItem(121,"bst",1,"frm",1,80,1.625,"Blue foot Mushroom","Blue-foot-Mushroom",24);
catalog[122]  =  new catItem(122,"bst",1,"frm",1,160,1.625,"Blue foot Mushroom","Blue-foot-Mushroom",24);

catalog[123]  =  new catItem(123,"bst",1,"frm",1,16,0.75,"Baby Shiitake Mushroom","Baby-Shiitake-Mushroom",25);
catalog[124]  =  new catItem(124,"bst",1,"frm",1,80,0.75,"Baby Shiitake Mushroom","Baby-Shiitake-Mushroom",25);
catalog[125]  =  new catItem(125,"bst",1,"frm",1,160,0.75,"Baby Shiitake Mushroom","Baby-Shiitake-Mushroom",25);

catalog[126]  =  new catItem(126,"bst",1,"frm",1,16,1.0,"Trumpet Royale Mushroom","Trumpet-Royale-Mushroom",26);
catalog[127]  =  new catItem(127,"bst",1,"frm",1,80,1.0,"Trumpet Royale Mushroom","Trumpet-Royale-Mushroom",26);
catalog[128]  =  new catItem(128,"bst",1,"frm",1,160,1.0,"Trumpet Royale Mushroom","Trumpet-Royale-Mushroom",26);

catalog[129]  =  new catItem(129,"bst",1,"frm",1,16,1.0,"Alba Clamshell Mushroom","Alba-Clamshell-Mushroom",27);
catalog[130]  =  new catItem(130,"bst",1,"frm",1,80,1.0,"Alba Clamshell Mushroom","Alba-Clamshell-Mushroom",27);
catalog[131]  =  new catItem(131,"bst",1,"frm",1,160,1.0,"Alba Clamshell Mushroom","Alba-Clamshell-Mushroom",27);

catalog[132]  =  new catItem(132,"bst",1,"frm",1,16,1.0,"Brown Clamshell Mushroom","Brown-Clamshell-Mushroom",28);
catalog[133]  =  new catItem(133,"bst",1,"frm",1,80,1.0,"Brown Clamshell Mushroom","Brown-Clamshell-Mushroom",28);
catalog[134]  =  new catItem(134,"bst",1,"frm",1,160,1.0,"Brown Clamshell Mushroom","Brown-Clamshell-Mushroom",28);

catalog[135]  =  new catItem(135,"bst",1,"frm",1,16,1.0,"Forest Nameko Mushroom","Forest-Nameko-Mushroom",29);
catalog[136]  =  new catItem(136,"bst",1,"frm",1,80,1.0,"Forest Nameko Mushroom","Forest-Nameko-Mushroom",29);
catalog[137]  =  new catItem(137,"bst",1,"frm",1,160,1.0,"Forest Nameko Mushroom","Forest-Nameko-Mushroom",29);

catalog[138]  =  new catItem(138,"bst",1,"frm",1,16,.875,"Hon Shimeji Mushroom","Hon-Shimeji-Mushroom",30);
catalog[139]  =  new catItem(139,"bst",1,"frm",1,80,.875,"Hon Shimeji Mushroom","Hon-Shimeji-Mushroom",30);
catalog[140]  =  new catItem(140,"bst",1,"frm",1,160,.875,"Hon Shimeji Mushroom","Hon-Shimeji-Mushroom",30);

catalog[141]  =  new catItem(141,"bst",1,"frm",1,16,.875,"White Hon Shimeji Mushroom","White-Hon-Shimeji-Mushroom",31);
catalog[142]  =  new catItem(142,"bst",1,"frm",1,80,.875,"White Hon Shimeji Mushroom","White-Hon-Shimeji-Mushroom",31);
catalog[143]  =  new catItem(143,"bst",1,"frm",1,160,.875,"White Hon Shimeji Mushroom","White-Hon-Shimeji-Mushroom",31);

catalog[144]  =  new catItem(144,"bst",1,"frm",1,16,0.75,"French Horns (King Eryngii) Mushroom","French-Horns-Mushroom",32);
catalog[145]  =  new catItem(145,"bst",1,"frm",1,80,0.75,"French Horns (King Eryngii) Mushroom","French-Horns-Mushroom",32);
catalog[146]  =  new catItem(146,"bst",1,"frm",1,160,0.75,"French Horns (King Eryngii) Mushroom","French-Horns-Mushroom",32);

catalog[147]  =  new catItem(147,"bst",1,"frm",1,16,0.9375,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",33);
catalog[148]  =  new catItem(148,"bst",1,"frm",1,80,0.9375,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",33);
catalog[149]  =  new catItem(149,"bst",1,"frm",1,160,0.9375,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",33);

catalog[150]  =  new catItem(150,"bst",1,"frm",1,16,0.9375,"Abalone (White Elf) Mushroom","Abalone-Mushroom",34);
catalog[151]  =  new catItem(151,"bst",1,"frm",1,80,0.9375,"Abalone (White Elf) Mushroom","Abalone-Mushroom",34);
catalog[152]  =  new catItem(152,"bst",1,"frm",1,160,0.9375,"Abalone (White Elf) Mushroom","Abalone-Mushroom",34);

catalog[153]  =  new catItem(153,"bst",1,"frm",1,16,0.5,"Enoki Bouquet Mushroom","Enoki-Bouquet-Mushroom",35);
catalog[154]  =  new catItem(154,"bst",1,"frm",1,80,0.5,"Enoki Bouquet Mushroom","Enoki-Bouquet-Mushroom",35);
catalog[155]  =  new catItem(155,"bst",1,"frm",1,160,0.5,"Enoki Bouquet Mushroom","Enoki-Bouquet-Mushroom",35);

catalog[156]  =  new catItem(156,"bst",1,"frm",1,16,1.125,"Velvet Pioppini Mushroom","Velvet-Pioppini-Mushroom",36);
catalog[157]  =  new catItem(157,"bst",1,"frm",1,80,1.125,"Velvet Pioppini Mushroom","Velvet-Pioppini-Mushroom",36);
catalog[158]  =  new catItem(158,"bst",1,"frm",1,160,1.125,"Velvet Pioppini Mushroom","Velvet-Pioppini-Mushroom",36);

catalog[159]  =  new catItem(159,"bst",1,"frm",1,16,1.125,"Petit Jaune Mushroom","Petit-Jaune-Mushroom",37);
catalog[160]  =  new catItem(160,"bst",1,"frm",1,80,1.125,"Petit Jaune Mushroom","Petit-Jaune-Mushroom",37);
catalog[161]  =  new catItem(161,"bst",1,"frm",1,160,1.125,"Petit Jaune Mushroom","Petit-Jaune-Mushroom",37);

catalog[162]  =  new catItem(162,"bst",1,"frm",1,16,1.125,"Lion's Mane (Pom Pom's) Mushroom","Lions-Mane-Mushroom",38);
catalog[163]  =  new catItem(163,"bst",1,"frm",1,80,1.125,"Lion's Mane (Pom Pom's) Mushroom","Lions-Mane-Mushroom",38);
catalog[164]  =  new catItem(164,"bst",1,"frm",1,160,1.125,"Lion's Mane (Pom Pom's) Mushroom","Lions-Mane-Mushroom",38);

catalog[165]  =  new catItem(165,"bst",1,"frm",1,16,6.1875,"King Oyster Mushroom (11 lb Case)","King-Oyster-Mushroom",39);
catalog[166]  =  new catItem(166,"bst",1,"frm",1,80,6.1875,"King Oyster Mushroom (11 lb Case)","King-Oyster-Mushroom",39);
catalog[167]  =  new catItem(167,"bst",1,"frm",1,160,6.1875,"King Oyster Mushroom (11 lb Case)","King-Oyster-Mushroom",39);

catalog[168]  =  new catItem(168,"bst",1,"frm",1,16,12.8125,"Organic oyster Mushroom (6 lb Case)","Organic-oyster-Mushroom",40);
catalog[169]  =  new catItem(169,"bst",1,"frm",1,80,12.8125,"Organic oyster Mushroom (6 lb Case)","Organic-oyster-Mushroom",40);
catalog[170]  =  new catItem(170,"bst",1,"frm",1,160,12.8125,"Organic oyster Mushroom (6 lb Case)","Organic-oyster-Mushroom",40);
/*

catalog[171]  =  new catItem(171,"bst",1,"frm",1,16,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",41);
catalog[172]  =  new catItem(172,"bst",1,"frm",1,80,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",41);
catalog[173]  =  new catItem(173,"bst",1,"frm",1,160,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",41);

catalog[174]  =  new catItem(174,"bst",1,"frm",1,16,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",42);
catalog[175]  =  new catItem(175,"bst",1,"frm",1,80,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",42);
catalog[176]  =  new catItem(176,"bst",1,"frm",1,160,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",42);

catalog[177]  =  new catItem(177,"bst",1,"frm",1,16,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",43);
catalog[178]  =  new catItem(178,"bst",1,"frm",1,80,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",43);
catalog[179]  =  new catItem(179,"bst",1,"frm",1,160,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",43);

catalog[162]  =  new catItem(147,"bst",1,"frm",1,16,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",44);
catalog[163]  =  new catItem(148,"bst",1,"frm",1,80,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",44);
catalog[164]  =  new catItem(149,"bst",1,"frm",1,160,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",44);

catalog[162]  =  new catItem(147,"bst",1,"frm",1,16,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",45);
catalog[163]  =  new catItem(148,"bst",1,"frm",1,80,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",45);
catalog[164]  =  new catItem(149,"bst",1,"frm",1,160,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",45);

catalog[162]  =  new catItem(147,"bst",1,"frm",1,16,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",46);
catalog[163]  =  new catItem(148,"bst",1,"frm",1,80,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",46);
catalog[164]  =  new catItem(149,"bst",1,"frm",1,160,12.8125,"Baby French Horn Mushroom","Baby-French-Horn-Mushroom",46);
*/

/*
fresh shipping rates:
1-5  lb               :  $8 per pound
6-15 lb              :  $5 per pound
15-25 lb            :  $4 per pound
+25 lb              :  $3.5 per pound
 
 
fresh mushrooms prices:

morel
1 lb   $28
5 lb   $133
10lb  $260
 
fiddleheads
1 lb   $10
5 lb   $47
10lb  $93
*/

///////////////////////////////////////////////////////////////////////////////         
function opTest(form,count) {
// option=""
 for (var i = 0; i < count; i++) {
  if (form.opt[i].checked) option = form.opt[i].value
  }
//alert(options[option].desc);
//alert('option='+option);
return option;
}

///////////////////////////////////////////////////////////////////////////////
function catOption(idx,size,desc) {
     this.idx = idx
     this.size = size
     this.desc = desc
     
}
var options = new Array()
options[0] = new catOption (0,16,"16 oz / 454 gr bag");
options[1] = new catOption (1,8,"8 oz / 227 gr bag");
options[2] = new catOption (2,4,"4 oz / 114 gr bag");
options[3] = new catOption (3,1,"1 oz / 28 gr bag");

/*

*/

function shipOption(area,code,rateCode,rateUSD,name) {
     this.area = area
     this.code = code
     this.rateCode = rateCode
     this.rateUSD = rateUSD
     this.name = name
}

var shipping = new Array()
shipping[0]   = new shipOption ("USA","USA1","A",24.1,"CanPost USA Small Packet (Air)");
shipping[1]   = new shipOption ("USA","USA1","B",28.9,"CanPost USA Small Packet (Air)");
shipping[2]   = new shipOption ("USA","USA1","C",33.4,"CanPost USA Small Packet (Air)");
shipping[3]   = new shipOption ("USA","USA1","D",36,"CanPost USA Small Packet (Air)");
shipping[4]   = new shipOption ("USA","USA1","E",38.2,"CanPost USA Small Packet (Air)");
shipping[5]   = new shipOption ("USA","USA1","F",41,"CanPost USA Small Packet (Air)");
shipping[6]   = new shipOption ("USA","USA1","G",48,"CanPost USA Small Packet (Air)");
shipping[7]   = new shipOption ("USA","USA2","A",12.9,"CanPost USA Small Packet (Surface)");
shipping[8]   = new shipOption ("USA","USA2","B",14.85,"CanPost USA Small Packet (Surface)");
shipping[9]   = new shipOption ("USA","USA2","C",15.2,"CanPost USA Small Packet (Surface)");
shipping[10]  = new shipOption ("USA","USA2","D",21.5,"CanPost USA Small Packet (Surface)");
shipping[11]  = new shipOption ("USA","USA2","E",26,"CanPost USA Small Packet (Surface)");
shipping[12]  = new shipOption ("USA","USA2","F",28.2,"CanPost USA Small Packet (Surface)");
shipping[13]  = new shipOption ("USA","USA2","G",32.1,"CanPost USA Small Packet (Surface)");
shipping[14]  = new shipOption ("INT","INT1","A",28.3,"CanPost International Small Packet (Air)");
shipping[15]  = new shipOption ("INT","INT1","B",32.4,"CanPost International Small Packet (Air)");
shipping[16]  = new shipOption ("INT","INT1","C",44.2,"CanPost International Small Packet (Air)");
shipping[17]  = new shipOption ("INT","INT1","D",54.3,"CanPost International Small Packet (Air)");
shipping[18]  = new shipOption ("INT","INT1","E",82.2,"CanPost International Small Packet (Air)");
shipping[19]  = new shipOption ("INT","INT1","F",120.1,"CanPost International Small Packet (Air)");
shipping[20]  = new shipOption ("INT","INT1","G",130.5,"CanPost International Small Packet (Air)");
shipping[21]  = new shipOption ("INT","INT2","A",18.2,"CanPost International Small Packet (Surface)");
shipping[22]  = new shipOption ("INT","INT2","B",22.3,"CanPost International Small Packet (Surface)");
shipping[23]  = new shipOption ("INT","INT2","C",28.3,"CanPost International Small Packet (Surface)");
shipping[24]  = new shipOption ("INT","INT2","D",33.2,"CanPost International Small Packet (Surface)");
shipping[25]  = new shipOption ("INT","INT2","E",38.5,"CanPost International Small Packet (Surface)");
shipping[26]  = new shipOption ("INT","INT2","F",49.5,"CanPost International Small Packet (Surface)");
shipping[27]  = new shipOption ("INT","INT2","G",89,"CanPost International Small Packet (Surface)");
shipping[28]  = new shipOption ("CAN","CAN1","A",11.4,"CanPost Regular Parcel");
shipping[29]  = new shipOption ("CAN","CAN1","B",13.2,"CanPost Regular Parcel");
shipping[30]  = new shipOption ("CAN","CAN1","C",14.1,"CanPost Regular Parcel");
shipping[31]  = new shipOption ("CAN","CAN1","D",17.2,"CanPost Regular Parcel");
shipping[32]  = new shipOption ("CAN","CAN1","E",18.4,"CanPost Regular Parcel");
shipping[33]  = new shipOption ("CAN","CAN1","F",19.5,"CanPost Regular Parcel");
shipping[34]  = new shipOption ("CAN","CAN1","G",24.9,"CanPost Regular Parcel");
shipping[35]  = new shipOption ("CAN","CAN2","A",18.2,"CanPost Xpresspost");
shipping[36]  = new shipOption ("CAN","CAN2","B",21.4,"CanPost Xpresspost");
shipping[37]  = new shipOption ("CAN","CAN2","C",28.2,"CanPost Xpresspost");
shipping[38]  = new shipOption ("CAN","CAN2","D",34.2,"CanPost Xpresspost");
shipping[39]  = new shipOption ("CAN","CAN2","E",37.8,"CanPost Xpresspost");
shipping[40]  = new shipOption ("CAN","CAN2","F",39.5,"CanPost Xpresspost");
shipping[41]  = new shipOption ("CAN","CAN2","G",39.5,"CanPost Xpresspost");
shipping[42]  = new shipOption ("USA","USA3","A",8,"FedEx Priority Courier Only");
shipping[43]  = new shipOption ("USA","USA3","B",5,"FedEx Priority Courier Only");
shipping[44]  = new shipOption ("USA","USA3","C",4,"FedEx Priority Courier Only");
shipping[45]  = new shipOption ("USA","USA3","D",3.5,"FedEx Priority Courier Only");


///////////////////////////////////////////////////////
function buyItem(newIdx,newQuantity)
   {  if (newQuantity <= 0) {
          rc=alert('The quantity entered is incorrect');
     } else {
//          if (confirm('Add ('+newQuantity+') '+packaging[catalog[newIdx].pkgCode].type+'(s) of "'+catalog[newIdx].name+'" to basket ?')) {
               index=document.cookie.indexOf("theBasket");
               countbegin=(document.cookie.indexOf("=", index) + 1);
               countend=document.cookie.indexOf(";", index);
               if (countend == -1) {
                    countend=document.cookie.length;
               }
			document.cookie="theBasket="+document.cookie.substring(countbegin, countend)+"["+newIdx+"|"+newQuantity+"]";
			history.go(0);
//          }
     }
}


///////////////////////////////////////////////////////////////////////////////         
function updateQty(strPlusMinus,strForm){
	 var qtyValue;
	 var txtObj;
	 txtObj = eval('document.'+strForm+'.quant');
	 qtyValue = eval('document.'+strForm+'.quant.value');
/*
alert ('strForm='+strForm);
alert ('txtObj='+txtObj);
alert ('qtyValue='+qtyValue);
alert ('txtObj.value='+txtObj.value);
*/
	 if(strPlusMinus == "+") {
		if (isANumber(qtyValue)) {
			if(parseInt(qtyValue) < 100) {
				txtObj.value = parseInt(qtyValue) + 1;
				}
			} else {
			txtObj.value = "0";
			}
	 }

	 if(strPlusMinus == "-") {
	 	if(isANumber(qtyValue))	{
			if(parseInt(qtyValue) > 0) {
				txtObj.value = parseInt(qtyValue) - 1 ;
			}
		} else {
			txtObj.value = "0";
		}
	 }

}

function isANumber(strCheck) {
	var iChars = "0123456789";
 	for (var i = 0; i < strCheck.length; i++) {
      	if (iChars.indexOf(strCheck.charAt(i)) == -1)
        	 return false;
   	}
	return true;
}

/////////////////////////////////////////////////////
// totalItems() - total shopping basket contents for display
     function totalItems(disp) {
          index=parent.document.cookie.indexOf("theBasket");
          countbegin=(parent.document.cookie.indexOf("=", index) + 1);
          countend=parent.document.cookie.indexOf(";", index);
          if (countend == -1) {
                    countend=parent.document.cookie.length;
			}
          fulllist=parent.document.cookie.substring(countbegin, countend);

          var subtotalUSD=0;
          var itemlist=0;
          var totalBags=0;
//alert ('fulllist='+fulllist);
          for (var i=0; i <= fulllist.length; i++) {
               if (fulllist.substring(i,i+1) == '[') {
                    itemstart=i+1;
                    thisitem=1;
               } else if (fulllist.substring(i,i+1) == ']') {
                    itemend=i;
                    thequantity=fulllist.substring(itemstart, itemend);

                    thepriceUSD=catalog[theindex].priceOzUSD*catalog[theindex].weight;
                    totalBags=totalBags+parseInt(thequantity);

                    itemtotalUSD=0;
                    itemtotalUSD=convDec(thepriceUSD*thequantity);
                    subtotalUSD=subtotalUSD + parseFloat(convDec(itemtotalUSD));
                    itemlist=itemlist+1;

					} else if (fulllist.substring(i,i+1) == '|') {
						if (thisitem==1) theindex=fulllist.substring(itemstart, i);
						thisitem++;
						itemstart=i+1;
               }
          }

		subtotal=subtotalUSD;
//alert ('subtotal='+subtotal);
//alert ('totalBags='+totalBags);

	if (disp==1){
		document.writeln('<TABLE border=0 cellSpacing=0 cellPadding=0 width=242><TR vAlign=top align=left><TD width=154><IMG height=1 src="images/blank.gif" width=154></TD><TD width=23><IMG height=5 src="images/blank.gif" width=1></TD><TD width=65><IMG height=1 src="images/blank.gif" width=65></TD></TR><TR vAlign=top align=left>');
		document.writeln('<TD class=topright vAlign=top align=right><IMG height=15 alt="My Basket" src="images/basket_icon.gif" width=21 border=0> <STRONG><A class=toprightlink href="cart.php">My Basket</A></STRONG>');
		document.writeln('<BR><IMG height=14 src="images/blank.gif" width=1>Your basket has '+itemlist+' items<BR>USD &#36;'+convDec(subtotal)+'</TD>');
		document.writeln('<TD><IMG height=56 src="images/header-rt_v-dotted.gif" width=23></TD><TD class=topright vAlign=top><A class=toprightlink href="checkout.php"><IMG height=15 src="images/blank.gif" width=1 border=0>Checkout</A><BR><BR>');
		document.writeln('</TD>');
		document.writeln('</TR></TABLE>');
	}

	if (disp==2){
		document.writeln('<TABLE border=0 cellSpacing=0 cellPadding=0 width=242><TR vAlign=top align=left><TD width=154><IMG height=1 src="images/blank.gif" width=154></TD><TD width=23><IMG height=5 src="images/blank.gif" width=1></TD><TD width=65><IMG height=1 src="images/blank.gif" width=65></TD></TR><TR vAlign=top align=left>');
		document.writeln('<TD class=topright vAlign=top align=right><IMG height=15 alt="My Basket" src="images/basket_icon.gif" width=21 border=0> <STRONG><A class=toprightlink href="cart.php">My Basket</A></STRONG>');
		document.writeln('<BR><IMG height=14 src="images/blank.gif" width=1>Your basket has '+itemlist+' items<BR>USD &#36;'+convDec(subtotal)+'</TD>');
		document.writeln('<TD><IMG height=56 src="images/header-rt_v-dotted.gif" width=23></TD><TD class=topright vAlign=top><BR>');
		document.writeln('</TD>');
		document.writeln('</TR></TABLE>');
	}

return totalBags;

}

/////////////////////////////////////////////////////
function totalWeight() {

	var totalBags=0;
	var totWeight=0;
    var itemlist=0;
//alert ('fulllist='+fulllist);

    for (var i=0; i <= fulllist.length; i++) {
         if (fulllist.substring(i,i+1) == '[') {
              itemstart=i+1;
              thisitem=1;
         } else if (fulllist.substring(i,i+1) == ']') {
              itemend=i;
              theWquantity=fulllist.substring(itemstart, itemend);
//alert ('theWindex='+theWindex);
//alert ('theWquantity='+theWquantity);

              totalBags=totalBags+parseInt(theWquantity);
			  totWeight=totWeight+parseInt(theWquantity)*catalog[theWindex].weight;
              itemlist=itemlist+1;

				} else if (fulllist.substring(i,i+1) == '|') {
					if (thisitem==1) theWindex=fulllist.substring(itemstart, i);
					thisitem++;
					itemstart=i+1;
           }
      }

//alert ('totWeight='+totWeight);
//alert ('totalBags='+totalBags);
return totWeight;
}




/////////////////////////////////////////////////////
function checkSierra() {

	var sierraChk=0;
    var itemlist=0;

    for (var i=0; i <= fulllist.length; i++) {
         if (fulllist.substring(i,i+1) == '[') {
              itemstart=i+1;
              thisitem=1;
         } else if (fulllist.substring(i,i+1) == ']') {
              itemend=i;
              theSquantity=fulllist.substring(itemstart, itemend);

              if (catalog[theSindex].cat != "drm") {sierraChk=1;}

              itemlist=itemlist+1;

				} else if (fulllist.substring(i,i+1) == '|') {
					if (thisitem==1) theSindex=fulllist.substring(itemstart, i);
					thisitem++;
					itemstart=i+1;
           }
      }

//alert ('sierraChk='+sierraChk);

return sierraChk;
}






// extract front part of string prior to searchString
function getFront(mainStr,searchStr){
	foundOffset = mainStr.indexOf(searchStr);
	if (foundOffset == -1) {
		return null;
		}
	return mainStr.substring(0,foundOffset);
}

// extract back end of string after searchString
function getEnd(mainStr,searchStr) {
     foundOffset = mainStr.indexOf(searchStr)
     if (foundOffset == -1) {
          return null
     }
     return mainStr.substring(foundOffset+searchStr.length,mainStr.length)
}


///////////////////////////////////////////////////////
function convDec(strng) {
        if (strng == 0) {
                return "0.00";
        } else {
        var str = "" + Math.round(strng * 100);
        return (str.substring(0, str.length-2) + "." + str.substring(str.length-2, str.length));
        }
}

