

ImageStruct = new Object();
ImageStruct["default"] = "\r\n\t\t\t<div id=\"picture\">\r\n\t\t\t\t<div id=\"mainImageOutline\" style=\"width: 250px; height: 0px;\" onclick=\"javascript:window.open(\'/_largeimage.cfm?image=curlingribbon.jpg\',\'popup\',\'width=600,height=600, scrollbars=yes\');\">\r\n\t\t\t\t\t<a href=\"javascript:void(0);\">\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<img id=\"mainImage\" src=\"/images/product//images/large_curlingribbon.jpg\" class=\"imgBorder\" alt=\"Curling Ribbon\" />\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t</a>\r\n\t\t\t\t\t<br />\r\n\t\t\t\t\t<a href=\"javascript:void(0);\"><img id=\"mainImage\" src=\"/images/retail/zoom.gif\" alt=\"Zoom\" /></a>\r\n\t\t\t\t</div>\r\n\t\t\t\t\r\n\t\t\t</div>\t\t\r\n\t\t\t<div id=\"previews\" style=\"padding-top:270px;\">\r\n\t\t\t\r\n\t\t\t</div>\r\n\t\t\t";


fldValueStruct = new Object();
fldValueStruct["fld1array"] =  new Array();
fldValueStruct["fld1array"][0] = new Object();
fldValueStruct["fld1array"][0]["value"] = 987;
fldValueStruct["fld1array"][0]["text"] = "0.25 X 0.00 X 250.00";
fldValueStruct["fld1array"][1] = new Object();
fldValueStruct["fld1array"][1]["value"] = 988;
fldValueStruct["fld1array"][1]["text"] = "1 x 2 x 3";
fldValueStruct["fld1array"][2] = new Object();
fldValueStruct["fld1array"][2]["value"] = 990;
fldValueStruct["fld1array"][2]["text"] = "0.38 X 0.00 X 250.00";
fldValueStruct["fld1array"][3] = new Object();
fldValueStruct["fld1array"][3]["value"] = 1661;
fldValueStruct["fld1array"][3]["text"] = "0.19 X 0.00 X 500.00";
fldValueStruct["fld2array"] =  new Array();
fldValueStruct["fld2array"][0] = new Object();
fldValueStruct["fld2array"][0]["value"] = 346;
fldValueStruct["fld2array"][0]["text"] = "AZALEA";
fldValueStruct["fld2array"][1] = new Object();
fldValueStruct["fld2array"][1]["value"] = 398;
fldValueStruct["fld2array"][1]["text"] = "BABY BLUE";
fldValueStruct["fld2array"][2] = new Object();
fldValueStruct["fld2array"][2]["value"] = 265;
fldValueStruct["fld2array"][2]["text"] = "BEAUTY";
fldValueStruct["fld2array"][3] = new Object();
fldValueStruct["fld2array"][3]["value"] = 1506;
fldValueStruct["fld2array"][3]["text"] = "BLACK";
fldValueStruct["fld2array"][4] = new Object();
fldValueStruct["fld2array"][4]["value"] = 1447;
fldValueStruct["fld2array"][4]["text"] = "BURGUNDY";
fldValueStruct["fld2array"][5] = new Object();
fldValueStruct["fld2array"][5]["value"] = 400;
fldValueStruct["fld2array"][5]["text"] = "CELADON";
fldValueStruct["fld2array"][6] = new Object();
fldValueStruct["fld2array"][6]["value"] = 402;
fldValueStruct["fld2array"][6]["text"] = "CITRUS";
fldValueStruct["fld2array"][7] = new Object();
fldValueStruct["fld2array"][7]["value"] = 403;
fldValueStruct["fld2array"][7]["text"] = "CORAL";
fldValueStruct["fld2array"][8] = new Object();
fldValueStruct["fld2array"][8]["value"] = 313;
fldValueStruct["fld2array"][8]["text"] = "DUSTY ROSE";
fldValueStruct["fld2array"][9] = new Object();
fldValueStruct["fld2array"][9]["value"] = 406;
fldValueStruct["fld2array"][9]["text"] = "HOLIDAY GOLD";
fldValueStruct["fld2array"][10] = new Object();
fldValueStruct["fld2array"][10]["value"] = 235;
fldValueStruct["fld2array"][10]["text"] = "HUNTER GREEN";
fldValueStruct["fld2array"][11] = new Object();
fldValueStruct["fld2array"][11]["value"] = 1442;
fldValueStruct["fld2array"][11]["text"] = "IVORY";
fldValueStruct["fld2array"][12] = new Object();
fldValueStruct["fld2array"][12]["value"] = 1509;
fldValueStruct["fld2array"][12]["text"] = "LAVENDER";
fldValueStruct["fld2array"][13] = new Object();
fldValueStruct["fld2array"][13]["value"] = 256;
fldValueStruct["fld2array"][13]["text"] = "LIGHT BLUE";
fldValueStruct["fld2array"][14] = new Object();
fldValueStruct["fld2array"][14]["value"] = 147;
fldValueStruct["fld2array"][14]["text"] = "MATTE CELERY";
fldValueStruct["fld2array"][15] = new Object();
fldValueStruct["fld2array"][15]["value"] = 306;
fldValueStruct["fld2array"][15]["text"] = "MAUVE";
fldValueStruct["fld2array"][16] = new Object();
fldValueStruct["fld2array"][16]["value"] = 408;
fldValueStruct["fld2array"][16]["text"] = "MELON";
fldValueStruct["fld2array"][17] = new Object();
fldValueStruct["fld2array"][17]["value"] = 409;
fldValueStruct["fld2array"][17]["text"] = "MINT";
fldValueStruct["fld2array"][18] = new Object();
fldValueStruct["fld2array"][18]["value"] = 1430;
fldValueStruct["fld2array"][18]["text"] = "NAVY";
fldValueStruct["fld2array"][19] = new Object();
fldValueStruct["fld2array"][19]["value"] = 215;
fldValueStruct["fld2array"][19]["text"] = "ORANGE";
fldValueStruct["fld2array"][20] = new Object();
fldValueStruct["fld2array"][20]["value"] = 305;
fldValueStruct["fld2array"][20]["text"] = "ORCHID";
fldValueStruct["fld2array"][21] = new Object();
fldValueStruct["fld2array"][21]["value"] = 395;
fldValueStruct["fld2array"][21]["text"] = "PAW DESIGN";
fldValueStruct["fld2array"][22] = new Object();
fldValueStruct["fld2array"][22]["value"] = 410;
fldValueStruct["fld2array"][22]["text"] = "PERIDOT";
fldValueStruct["fld2array"][23] = new Object();
fldValueStruct["fld2array"][23]["value"] = 1511;
fldValueStruct["fld2array"][23]["text"] = "PINK";
fldValueStruct["fld2array"][24] = new Object();
fldValueStruct["fld2array"][24]["value"] = 1421;
fldValueStruct["fld2array"][24]["text"] = "PINK GLOSS";
fldValueStruct["fld2array"][25] = new Object();
fldValueStruct["fld2array"][25]["value"] = 411;
fldValueStruct["fld2array"][25]["text"] = "PRIM ROSE";
fldValueStruct["fld2array"][26] = new Object();
fldValueStruct["fld2array"][26]["value"] = 271;
fldValueStruct["fld2array"][26]["text"] = "PURPLE";
fldValueStruct["fld2array"][27] = new Object();
fldValueStruct["fld2array"][27]["value"] = 1512;
fldValueStruct["fld2array"][27]["text"] = "RED";
fldValueStruct["fld2array"][28] = new Object();
fldValueStruct["fld2array"][28]["value"] = 1651;
fldValueStruct["fld2array"][28]["text"] = "red";
fldValueStruct["fld2array"][29] = new Object();
fldValueStruct["fld2array"][29]["value"] = 307;
fldValueStruct["fld2array"][29]["text"] = "ROYAL BLUE";
fldValueStruct["fld2array"][30] = new Object();
fldValueStruct["fld2array"][30]["value"] = 1423;
fldValueStruct["fld2array"][30]["text"] = "SAGE";
fldValueStruct["fld2array"][31] = new Object();
fldValueStruct["fld2array"][31]["value"] = 238;
fldValueStruct["fld2array"][31]["text"] = "TEAL";
fldValueStruct["fld2array"][32] = new Object();
fldValueStruct["fld2array"][32]["value"] = 1422;
fldValueStruct["fld2array"][32]["text"] = "TURQUOISE";
fldValueStruct["fld2array"][33] = new Object();
fldValueStruct["fld2array"][33]["value"] = 413;
fldValueStruct["fld2array"][33]["text"] = "VANILLA";
fldValueStruct["fld2array"][34] = new Object();
fldValueStruct["fld2array"][34]["value"] = 141;
fldValueStruct["fld2array"][34]["text"] = "WHITE";
fldValueStruct["fld2array"][35] = new Object();
fldValueStruct["fld2array"][35]["value"] = 248;
fldValueStruct["fld2array"][35]["text"] = "YELLOW";


AvailableProducts = new Object();
AvailableProducts["988_1447"] = 1753;
AvailableProducts["346_990"] = 1797;
AvailableProducts["346_988"] = 1748;
AvailableProducts["313_1661"] = 1762;
AvailableProducts["408_1661"] = 1774;
AvailableProducts["411_1661"] = 1780;
AvailableProducts["307_990"] = 1818;
AvailableProducts["988_1422"] = 1793;
AvailableProducts["988_313"] = 1762;
AvailableProducts["1661_1447"] = 1753;
AvailableProducts["1661_1423"] = 1785;
AvailableProducts["398_1661"] = 1749;
AvailableProducts["988_409"] = 1775;
AvailableProducts["235_988"] = 1768;
AvailableProducts["1661_413"] = 1794;
AvailableProducts["988_411"] = 1780;
AvailableProducts["988_1421"] = 1750;
AvailableProducts["409_1661"] = 1775;
AvailableProducts["1512_1661"] = 1782;
AvailableProducts["988_413"] = 1794;
AvailableProducts["313_988"] = 1762;
AvailableProducts["1661_1421"] = 1750;
AvailableProducts["990_141"] = 1824;
AvailableProducts["1447_1661"] = 1753;
AvailableProducts["988_346"] = 1748;
AvailableProducts["990_409"] = 1812;
AvailableProducts["1661_403"] = 1760;
AvailableProducts["235_1661"] = 1768;
AvailableProducts["1661_409"] = 1775;
AvailableProducts["988_398"] = 1749;
AvailableProducts["990_215"] = 1821;
AvailableProducts["990_248"] = 1825;
AvailableProducts["346_1661"] = 1748;
AvailableProducts["147_1661"] = 1756;
AvailableProducts["990_413"] = 1823;
AvailableProducts["1430_988"] = 1776;
AvailableProducts["1430_990"] = 1813;
AvailableProducts["147_988"] = 1756;
AvailableProducts["988_306"] = 1773;
AvailableProducts["1422_990"] = 1822;
AvailableProducts["1421_1661"] = 1750;
AvailableProducts["990_235"] = 1808;
AvailableProducts["1512_988"] = 1782;
AvailableProducts["403_1661"] = 1760;
AvailableProducts["1430_1661"] = 1776;
AvailableProducts["990_271"] = 1816;
AvailableProducts["409_988"] = 1775;
AvailableProducts["1506_990"] = 1799;
AvailableProducts["1422_988"] = 1793;
AvailableProducts["990_410"] = 1814;
AvailableProducts["990_265"] = 1798;
AvailableProducts["306_1661"] = 1773;
AvailableProducts["1661_313"] = 1762;
AvailableProducts["1661_400"] = 1787;
AvailableProducts["305_1661"] = 1777;
AvailableProducts["987_395"] = 1745;
AvailableProducts["1661_147"] = 1756;
AvailableProducts["1447_990"] = 1800;
AvailableProducts["988_305"] = 1777;
AvailableProducts["1661_235"] = 1768;
AvailableProducts["1447_988"] = 1753;
AvailableProducts["1442_990"] = 1809;
AvailableProducts["410_990"] = 1814;
AvailableProducts["1422_1661"] = 1793;
AvailableProducts["1423_988"] = 1785;
AvailableProducts["413_990"] = 1823;
AvailableProducts["1661_1512"] = 1782;
AvailableProducts["411_988"] = 1780;
AvailableProducts["988_408"] = 1774;
AvailableProducts["1661_305"] = 1777;
AvailableProducts["1423_1661"] = 1785;
AvailableProducts["238_1661"] = 1791;
AvailableProducts["990_402"] = 1803;
AvailableProducts["400_1661"] = 1787;
AvailableProducts["988_238"] = 1791;
AvailableProducts["413_1661"] = 1794;
AvailableProducts["988_403"] = 1760;
AvailableProducts["398_988"] = 1749;
AvailableProducts["990_346"] = 1797;
AvailableProducts["988_235"] = 1768;
AvailableProducts["988_147"] = 1756;
AvailableProducts["990_307"] = 1818;
AvailableProducts["395_987"] = 1745;
AvailableProducts["1661_1422"] = 1793;
AvailableProducts["409_990"] = 1812;
AvailableProducts["408_988"] = 1774;
AvailableProducts["406_990"] = 1807;
AvailableProducts["990_406"] = 1807;
AvailableProducts["1421_988"] = 1750;
AvailableProducts["990_1422"] = 1822;
AvailableProducts["403_988"] = 1760;
AvailableProducts["990_1506"] = 1799;
AvailableProducts["402_990"] = 1803;
AvailableProducts["990_256"] = 1811;
AvailableProducts["413_988"] = 1794;
AvailableProducts["990_1442"] = 1809;
AvailableProducts["400_988"] = 1787;
AvailableProducts["990_1447"] = 1800;
AvailableProducts["215_990"] = 1821;
AvailableProducts["1661_238"] = 1791;
AvailableProducts["1661_346"] = 1748;
AvailableProducts["1661_398"] = 1749;
AvailableProducts["141_990"] = 1824;
AvailableProducts["988_400"] = 1787;
AvailableProducts["1661_408"] = 1774;
AvailableProducts["235_990"] = 1808;
AvailableProducts["1661_411"] = 1780;
AvailableProducts["306_988"] = 1773;
AvailableProducts["1509_990"] = 1810;
AvailableProducts["305_988"] = 1777;
AvailableProducts["248_990"] = 1825;
AvailableProducts["271_990"] = 1816;
AvailableProducts["238_988"] = 1791;
AvailableProducts["990_1509"] = 1810;
AvailableProducts["990_1430"] = 1813;
AvailableProducts["1661_306"] = 1773;
AvailableProducts["256_990"] = 1811;
AvailableProducts["988_1423"] = 1785;
AvailableProducts["988_1430"] = 1776;
AvailableProducts["988_1512"] = 1782;
AvailableProducts["1661_1430"] = 1776;
AvailableProducts["265_990"] = 1798;


AttributeArray = new Object();
AttributeArray["408"] = new Object();
AttributeArray["408"]["value"] = 408;
AttributeArray["408"]["text"] = "MELON";
AttributeArray["408"]["prod_id"] = "1774,1774";
AttributeArray["408"]["allowed"] = "988,1661";
AttributeArray["411"] = new Object();
AttributeArray["411"]["value"] = 411;
AttributeArray["411"]["text"] = "PRIM ROSE";
AttributeArray["411"]["prod_id"] = "1780,1780";
AttributeArray["411"]["allowed"] = "988,1661";
AttributeArray["147"] = new Object();
AttributeArray["147"]["value"] = 147;
AttributeArray["147"]["text"] = "MATTE CELERY";
AttributeArray["147"]["prod_id"] = "1756,1756";
AttributeArray["147"]["allowed"] = "988,1661";
AttributeArray["987"] = new Object();
AttributeArray["987"]["value"] = 987;
AttributeArray["987"]["text"] = "0.25 X 0.00 X 250.00";
AttributeArray["987"]["prod_id"] = "1745";
AttributeArray["987"]["allowed"] = "395";
AttributeArray["235"] = new Object();
AttributeArray["235"]["value"] = 235;
AttributeArray["235"]["text"] = "HUNTER GREEN";
AttributeArray["235"]["prod_id"] = "1768,1808,1768";
AttributeArray["235"]["allowed"] = "988,990,1661";
AttributeArray["307"] = new Object();
AttributeArray["307"]["value"] = 307;
AttributeArray["307"]["text"] = "ROYAL BLUE";
AttributeArray["307"]["prod_id"] = "1818";
AttributeArray["307"]["allowed"] = "990";
AttributeArray["256"] = new Object();
AttributeArray["256"]["value"] = 256;
AttributeArray["256"]["text"] = "LIGHT BLUE";
AttributeArray["256"]["prod_id"] = "1811";
AttributeArray["256"]["allowed"] = "990";
AttributeArray["305"] = new Object();
AttributeArray["305"]["value"] = 305;
AttributeArray["305"]["text"] = "ORCHID";
AttributeArray["305"]["prod_id"] = "1777,1777";
AttributeArray["305"]["allowed"] = "988,1661";
AttributeArray["403"] = new Object();
AttributeArray["403"]["value"] = 403;
AttributeArray["403"]["text"] = "CORAL";
AttributeArray["403"]["prod_id"] = "1760,1760";
AttributeArray["403"]["allowed"] = "988,1661";
AttributeArray["346"] = new Object();
AttributeArray["346"]["value"] = 346;
AttributeArray["346"]["text"] = "AZALEA";
AttributeArray["346"]["prod_id"] = "1748,1797,1748";
AttributeArray["346"]["allowed"] = "988,990,1661";
AttributeArray["410"] = new Object();
AttributeArray["410"]["value"] = 410;
AttributeArray["410"]["text"] = "PERIDOT";
AttributeArray["410"]["prod_id"] = "1814";
AttributeArray["410"]["allowed"] = "990";
AttributeArray["988"] = new Object();
AttributeArray["988"]["value"] = 988;
AttributeArray["988"]["text"] = "1 x 2 x 3";
AttributeArray["988"]["prod_id"] = "1756,1768,1791,1777,1773,1762,1748,1749,1755,1787,1760,1774,1775,1780,1794,1750,1793,1785,1776,1753,1782";
AttributeArray["988"]["allowed"] = "147,235,238,305,306,313,346,398,400,400,403,408,409,411,413,1421,1422,1423,1430,1447,1512";
AttributeArray["271"] = new Object();
AttributeArray["271"]["value"] = 271;
AttributeArray["271"]["text"] = "PURPLE";
AttributeArray["271"]["prod_id"] = "1816";
AttributeArray["271"]["allowed"] = "990";
AttributeArray["406"] = new Object();
AttributeArray["406"]["value"] = 406;
AttributeArray["406"]["text"] = "HOLIDAY GOLD";
AttributeArray["406"]["prod_id"] = "1807";
AttributeArray["406"]["allowed"] = "990";
AttributeArray["1422"] = new Object();
AttributeArray["1422"]["value"] = 1422;
AttributeArray["1422"]["text"] = "TURQUOISE";
AttributeArray["1422"]["prod_id"] = "1793,1822,1793";
AttributeArray["1422"]["allowed"] = "988,990,1661";
AttributeArray["413"] = new Object();
AttributeArray["413"]["value"] = 413;
AttributeArray["413"]["text"] = "VANILLA";
AttributeArray["413"]["prod_id"] = "1794,1823,1794";
AttributeArray["413"]["allowed"] = "988,990,1661";
AttributeArray["1421"] = new Object();
AttributeArray["1421"]["value"] = 1421;
AttributeArray["1421"]["text"] = "PINK GLOSS";
AttributeArray["1421"]["prod_id"] = "1750,1750";
AttributeArray["1421"]["allowed"] = "988,1661";
AttributeArray["402"] = new Object();
AttributeArray["402"]["value"] = 402;
AttributeArray["402"]["text"] = "CITRUS";
AttributeArray["402"]["prod_id"] = "1803";
AttributeArray["402"]["allowed"] = "990";
AttributeArray["1423"] = new Object();
AttributeArray["1423"]["value"] = 1423;
AttributeArray["1423"]["text"] = "SAGE";
AttributeArray["1423"]["prod_id"] = "1785,1785";
AttributeArray["1423"]["allowed"] = "988,1661";
AttributeArray["395"] = new Object();
AttributeArray["395"]["value"] = 395;
AttributeArray["395"]["text"] = "PAW DESIGN";
AttributeArray["395"]["prod_id"] = "1745";
AttributeArray["395"]["allowed"] = "987";
AttributeArray["238"] = new Object();
AttributeArray["238"]["value"] = 238;
AttributeArray["238"]["text"] = "TEAL";
AttributeArray["238"]["prod_id"] = "1791,1791";
AttributeArray["238"]["allowed"] = "988,1661";
AttributeArray["1430"] = new Object();
AttributeArray["1430"]["value"] = 1430;
AttributeArray["1430"]["text"] = "NAVY";
AttributeArray["1430"]["prod_id"] = "1776,1813,1776";
AttributeArray["1430"]["allowed"] = "988,990,1661";
AttributeArray["409"] = new Object();
AttributeArray["409"]["value"] = 409;
AttributeArray["409"]["text"] = "MINT";
AttributeArray["409"]["prod_id"] = "1775,1812,1775";
AttributeArray["409"]["allowed"] = "988,990,1661";
AttributeArray["398"] = new Object();
AttributeArray["398"]["value"] = 398;
AttributeArray["398"]["text"] = "BABY BLUE";
AttributeArray["398"]["prod_id"] = "1749,1749";
AttributeArray["398"]["allowed"] = "988,1661";
AttributeArray["1661"] = new Object();
AttributeArray["1661"]["value"] = 1661;
AttributeArray["1661"]["text"] = "0.19 X 0.00 X 500.00";
AttributeArray["1661"]["prod_id"] = "1756,1768,1791,1777,1773,1762,1748,1749,1755,1787,1760,1774,1775,1780,1794,1750,1793,1785,1776,1753,1782";
AttributeArray["1661"]["allowed"] = "147,235,238,305,306,313,346,398,400,400,403,408,409,411,413,1421,1422,1423,1430,1447,1512";
AttributeArray["306"] = new Object();
AttributeArray["306"]["value"] = 306;
AttributeArray["306"]["text"] = "MAUVE";
AttributeArray["306"]["prod_id"] = "1773,1773";
AttributeArray["306"]["allowed"] = "988,1661";
AttributeArray["1442"] = new Object();
AttributeArray["1442"]["value"] = 1442;
AttributeArray["1442"]["text"] = "IVORY";
AttributeArray["1442"]["prod_id"] = "1809";
AttributeArray["1442"]["allowed"] = "990";
AttributeArray["313"] = new Object();
AttributeArray["313"]["value"] = 313;
AttributeArray["313"]["text"] = "DUSTY ROSE";
AttributeArray["313"]["prod_id"] = "1762,1762";
AttributeArray["313"]["allowed"] = "988,1661";
AttributeArray["1509"] = new Object();
AttributeArray["1509"]["value"] = 1509;
AttributeArray["1509"]["text"] = "LAVENDER";
AttributeArray["1509"]["prod_id"] = "1810";
AttributeArray["1509"]["allowed"] = "990";
AttributeArray["1447"] = new Object();
AttributeArray["1447"]["value"] = 1447;
AttributeArray["1447"]["text"] = "BURGUNDY";
AttributeArray["1447"]["prod_id"] = "1753,1800,1753";
AttributeArray["1447"]["allowed"] = "988,990,1661";
AttributeArray["990"] = new Object();
AttributeArray["990"]["value"] = 990;
AttributeArray["990"]["text"] = "0.38 X 0.00 X 250.00";
AttributeArray["990"]["prod_id"] = "1824,1821,1808,1825,1811,1798,1816,1818,1797,1803,1807,1812,1814,1823,1822,1813,1809,1800,1799,1810";
AttributeArray["990"]["allowed"] = "141,215,235,248,256,265,271,307,346,402,406,409,410,413,1422,1430,1442,1447,1506,1509";
AttributeArray["1506"] = new Object();
AttributeArray["1506"]["value"] = 1506;
AttributeArray["1506"]["text"] = "BLACK";
AttributeArray["1506"]["prod_id"] = "1799";
AttributeArray["1506"]["allowed"] = "990";
AttributeArray["1651"] = new Object();
AttributeArray["1651"]["value"] = 1651;
AttributeArray["1651"]["text"] = "red";
AttributeArray["1512"] = new Object();
AttributeArray["1512"]["value"] = 1512;
AttributeArray["1512"]["text"] = "RED";
AttributeArray["1512"]["prod_id"] = "1782,1782";
AttributeArray["1512"]["allowed"] = "988,1661";
AttributeArray["215"] = new Object();
AttributeArray["215"]["value"] = 215;
AttributeArray["215"]["text"] = "ORANGE";
AttributeArray["215"]["prod_id"] = "1821";
AttributeArray["215"]["allowed"] = "990";
AttributeArray["265"] = new Object();
AttributeArray["265"]["value"] = 265;
AttributeArray["265"]["text"] = "BEAUTY";
AttributeArray["265"]["prod_id"] = "1798";
AttributeArray["265"]["allowed"] = "990";
AttributeArray["1511"] = new Object();
AttributeArray["1511"]["value"] = 1511;
AttributeArray["1511"]["text"] = "PINK";
AttributeArray["248"] = new Object();
AttributeArray["248"]["value"] = 248;
AttributeArray["248"]["text"] = "YELLOW";
AttributeArray["248"]["prod_id"] = "1825";
AttributeArray["248"]["allowed"] = "990";
AttributeArray["400"] = new Object();
AttributeArray["400"]["value"] = 400;
AttributeArray["400"]["text"] = "CELADON";
AttributeArray["400"]["prod_id"] = "1755,1787,1755,1787";
AttributeArray["400"]["allowed"] = "988,988,1661,1661";
AttributeArray["141"] = new Object();
AttributeArray["141"]["value"] = 141;
AttributeArray["141"]["text"] = "WHITE";
AttributeArray["141"]["prod_id"] = "1824";
AttributeArray["141"]["allowed"] = "990";


function filterAttribute(attrID,fldID,srcFld){
	var fld = document.getElementById('attributeID_'+fldID);
	attrID = srcFld.options[srcFld.selectedIndex].value;
	var valueCount = 1;
	var noValueCount = 0;
	if (attrID > 0) {
		var allowedValueList = AttributeArray[attrID]['allowed'];
		var prod_id = AttributeArray[attrID]['prod_id'];
		var allowedValueArray = allowedValueList.split(',');
		var notAllowedValueArray = new Array();
		//alert(attrID);
		//alert(allowedValueList);
	
		//alert(fld.selectedIndex)
		
		var selectedValue = '';
		var removed = false;
		if (fld.selectedIndex > 0){
			selectedValue = fld.options[fld.selectedIndex].value;
		}
		if (fld.options.length > 1) {
			removed = true;
			for(var i=fld.options.length-1;i>=1;i--){
				fld.remove(i);
			}
			
			//fldArray = eval('fld'+fldID+'Array');
			fldArray = fldValueStruct['fld'+fldID+'array']
			for(var i=0; i< fldArray.length; i++){
		
				var  currentValue = fldArray[i]['value'];
			
				for (var j = 0; j < allowedValueArray.length; j++){
					var allowedValue = allowedValueArray[j];
					//alert(currentValue+ ' - ' + allowedValue)
					if (currentValue == allowedValue || attrID == 0){
						fld.options[valueCount] = new Option(fldArray[i]['text'], fldArray[i]['value'], false, false);
						if (selectedValue == currentValue)
							fld.options[valueCount].selected = true;
							
						valueCount = valueCount + 1;
					}
					else {
						
						notAllowedValueArray[noValueCount] = currentValue;
						noValueCount = noValueCount + 1;
					}
		
				}
			}
		}
		
		for(var i=0; i< notAllowedValueArray.length; i++){
			var divID = document.getElementById('img'+notAllowedValueArray[i])
			if (divID!= null) { 
				divID.innerHTML = '<img src="/images/retail/inActive.png">';
			}
		}
		
		for(var i=0; i< allowedValueArray.length; i++){
			var divID = document.getElementById('img'+allowedValueArray[i])
			if (divID!= null) { 
				divID.innerHTML = '';
			}
		}
	}
	else {
		var selectedValue = '';
		var removed = false;
		if (fld.selectedIndex > 0){
			selectedValue = fld.options[fld.selectedIndex].value;
		}
		
		if (fld.options.length > 1) {
			removed = true;
			for(var i=fld.options.length-1;i>=1;i--){
				fld.remove(i);
			}
					
			fldArray = fldValueStruct['fld'+fldID+'array']
			//alert(fldArray.length);
			for(var i=0; i< fldArray.length; i++){
				fld.options[i+1] = new Option(fldArray[i]['text'], fldArray[i]['value'], false, false);
				if (selectedValue == currentValue)
					fld.options[i+1].selected = true;
					
				var divID = document.getElementById('img'+fldArray[i]['value']);
				if (divID!= null) { 
					divID.innerHTML = '';
				}
				
			}
		}
	}
	
	if (!removed || (fld.selectedIndex > 0 && srcFld.selectedIndex > 0 )){
		value = fld.options[fld.selectedIndex].value;
		attrID = srcFld.options[srcFld.selectedIndex].value;
		key = value+'_'+attrID;
		//alert(key);
		//alert(AvailableProducts[key]);
		getProductPrice('/index.cfm?event=shop.dspProductPrice&prod_id='+AvailableProducts[key]);
	}
	else {
		if (fld.selectedIndex == 0 && srcFld.selectedIndex == 0 )
			Spry.Utils.setInnerHTML('imageText',ImageStruct['default']);

		Spry.Utils.setInnerHTML('productPrice', '');
	}
	//alert(fldArray)
	//alert('fld'+fldID+'Array');

	//fld.options[boxLength] = new Option(Text, Value, false, false);
	
	/*for (var j = 0; j < fld.length; j++) {
		if (fld.options[j].value == attrID){
			
		}
	}
	alert(AttributeArray[attrID]['allowed']);*/
}
function selectColor(id,imgText,imgBorder){
	//alert(id);
	var imgTagText = document.getElementById(imgText).innerHTML;
	var imgBorderDiv = document.getElementById(imgBorder);
	
	if (imgTagText.indexOf('<img') >=0 )
		alert('Not available');
	else {
		//alert(imgBorderDiv.style.border);
		//imgBorderDiv.style.border = '5px'
		var fld = document.getElementById('attributeID_2');
		for(i=fld.options.length-1;i>=1;i--){
		if (fld.options[i].value == id)
			fld.options[i].selected = true;
		}
	
		filterAttribute(id,1,fld);
	}
}

	function doAdd(){
		Spry.Utils.setInnerHTML('updateResponseDiv', 'Processing.....');
		return Spry.Utils.submitForm(document.forms['frmProductDetail'], updateResponseDiv);
	}

	function doCheckStatus(sc_que_id){
		document.forms['frmCartStatus'].sc_que_id.value = sc_que_id;
		return Spry.Utils.submitForm(document.forms['frmCartStatus'], updateResponseDiv);
	}
	function updateResponseDivTest(req){
		Spry.Utils.setInnerHTML('updateResponseDiv', req.xhRequest.responseText);
	}
	
	function updateResponseDiv(req){

		var responseXML = Spry.XML.documentToObject(req.xhRequest.responseXML);
		if (responseXML.ShopCart) {
			var sc_que_id = responseXML.ShopCart['sc_que_id']._value();
			var sc_que_status_id = responseXML.ShopCart['sc_que_status_id']._value();
			var sc_que_message = responseXML.ShopCart['sc_que_message']._value();
		}
		if (sc_que_status_id == 3) { // Product added to shopping cart
			
			sc_que_message = '<h3>'+sc_que_message + '</h3>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/index.cfm?event=cart.dspView"><img src="/images/retail/cart.gif" />&nbsp;View Cart</a>';
			
			var sc_sub_total = responseXML.ShopCart['sc_sub_total']._value();

			if (document.getElementById('cartTotal') != null)
				Spry.Utils.setInnerHTML('cartTotal', '$'+sc_sub_total);

			Spry.Utils.setInnerHTML('updateResponseDiv', sc_que_message);
		}
		else if (sc_que_status_id == 1) // In Que
			doCheckStatus(sc_que_id);
		else if (sc_que_status_id == 5 ) {// Unable to add to shopping cart
			sc_que_message = '<h3> out of stock </h3>';
			Spry.Utils.setInnerHTML('updateResponseDiv', sc_que_message);
		}
	}
	
	function getProductPrice(url){
		Spry.Utils.setInnerHTML('productPrice', 'Loading...');
		Spry.Utils.setInnerHTML('updateResponseDiv', '');
		var req = Spry.Utils.loadURL("GET", url, true, processDispPriceResult);
	}
	
	function processDispPriceResult(req){
		var responseXML = Spry.XML.documentToObject(req.xhRequest.responseXML);
		
		var priceText = responseXML.product['price']._value();
		var imageText = responseXML.product['image']._value();
		//alert(responseXML);
		Spry.Utils.setInnerHTML('productPrice', priceText);
		Spry.Utils.setInnerHTML('imageText', imageText);
	}

	
	function fadeIt(ele,url){
		Spry.Utils.setInnerHTML(ele, 'Loading...');
		Spry.Utils.setInnerHTML('productPrice', '');
		Spry.Utils.setInnerHTML('updateResponseDiv', '');
		//FilterData();
		Spry.Utils.updateContent(ele,url);
	}
	
	var keyArray = new Array();
	
	
	//var fld1 = document.getElementById('attributeID_1');
	var attrFld1 = eval(document.forms['frmProductDetail'].attributeID_1);
	if (attrFld1.options.length == 2){
		attrFld1.options[0]= null;
		attrFld1.options[0].selected = true;
		
		keyArray[0] = attrFld1.options[attrFld1.selectedIndex].value;
	}
	
	else
		attrFld1.options[0].selected = true;
	
	//var fld2 = document.getElementById('attributeID_2');
	var attrFld2 = eval(document.forms['frmProductDetail'].attributeID_2);
	if (attrFld2.options.length == 2){
		attrFld2.options[0]= null;
		attrFld2.options[0].selected = true;
		
		keyArray[1] = attrFld2.options[attrFld2.selectedIndex].value;
	}
	
	else
		attrFld2.options[0].selected = true;
	
	
	//alert(keyArray.length);
	var key = '';
	for(var i=0; i < keyArray.length;i++){
		if (keyArray[i] != undefined){
			if (key.length ==0)
				key = keyArray[i];
			else
				key = key + '_' + keyArray[i];
		}
	}
	if (keyArray.length > 0 && key.indexOf('_') >0){
		getProductPrice('/index.cfm?event=shop.dspProductPrice&prod_id='+AvailableProducts[key]);
	}
	else {
		
	}
	

