

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=coloredMB.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_coloredMB.jpg\" class=\"imgBorder\" alt=\"Colored Merchandise Bags\" />\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"] = 1197;
fldValueStruct["fld1array"][0]["text"] = "6.25 X 0.00 X 9.25";
fldValueStruct["fld1array"][1] = new Object();
fldValueStruct["fld1array"][1]["value"] = 1175;
fldValueStruct["fld1array"][1]["text"] = "8.50 X 0.00 X 11.00";
fldValueStruct["fld1array"][2] = new Object();
fldValueStruct["fld1array"][2]["value"] = 1006;
fldValueStruct["fld1array"][2]["text"] = "12.00 X 0.00 X 15.00";
fldValueStruct["fld1array"][3] = new Object();
fldValueStruct["fld1array"][3]["value"] = 1158;
fldValueStruct["fld1array"][3]["text"] = "12.00 X 3.00 X 18.00";
fldValueStruct["fld1array"][4] = new Object();
fldValueStruct["fld1array"][4]["value"] = 1162;
fldValueStruct["fld1array"][4]["text"] = "14.00 X 3.00 X 21.00";
fldValueStruct["fld1array"][5] = new Object();
fldValueStruct["fld1array"][5]["value"] = 1194;
fldValueStruct["fld1array"][5]["text"] = "16.00 X 3.75 X 24.00";
fldValueStruct["fld2array"] =  new Array();
fldValueStruct["fld2array"][0] = new Object();
fldValueStruct["fld2array"][0]["value"] = 1361;
fldValueStruct["fld2array"][0]["text"] = "CHOCOLATE";
fldValueStruct["fld2array"][1] = new Object();
fldValueStruct["fld2array"][1]["value"] = 352;
fldValueStruct["fld2array"][1]["text"] = "CREAM";
fldValueStruct["fld2array"][2] = new Object();
fldValueStruct["fld2array"][2]["value"] = 302;
fldValueStruct["fld2array"][2]["text"] = "FOREST GREEN";
fldValueStruct["fld2array"][3] = new Object();
fldValueStruct["fld2array"][3]["value"] = 1351;
fldValueStruct["fld2array"][3]["text"] = "MATTE BLACK";
fldValueStruct["fld2array"][4] = new Object();
fldValueStruct["fld2array"][4]["value"] = 147;
fldValueStruct["fld2array"][4]["text"] = "MATTE CELERY";
fldValueStruct["fld2array"][5] = new Object();
fldValueStruct["fld2array"][5]["value"] = 474;
fldValueStruct["fld2array"][5]["text"] = "MATTE METALLIC BLUE";
fldValueStruct["fld2array"][6] = new Object();
fldValueStruct["fld2array"][6]["value"] = 159;
fldValueStruct["fld2array"][6]["text"] = "MATTE RED";
fldValueStruct["fld2array"][7] = new Object();
fldValueStruct["fld2array"][7]["value"] = 306;
fldValueStruct["fld2array"][7]["text"] = "MAUVE";
fldValueStruct["fld2array"][8] = new Object();
fldValueStruct["fld2array"][8]["value"] = 1370;
fldValueStruct["fld2array"][8]["text"] = "METALLIC BLUE";
fldValueStruct["fld2array"][9] = new Object();
fldValueStruct["fld2array"][9]["value"] = 139;
fldValueStruct["fld2array"][9]["text"] = "METALLIC BLUE GLOSS";
fldValueStruct["fld2array"][10] = new Object();
fldValueStruct["fld2array"][10]["value"] = 1364;
fldValueStruct["fld2array"][10]["text"] = "METALLIC SAGE";
fldValueStruct["fld2array"][11] = new Object();
fldValueStruct["fld2array"][11]["value"] = 1363;
fldValueStruct["fld2array"][11]["text"] = "METALLIC SAGE GLOSS";
fldValueStruct["fld2array"][12] = new Object();
fldValueStruct["fld2array"][12]["value"] = 642;
fldValueStruct["fld2array"][12]["text"] = "MISTY GRAY";
fldValueStruct["fld2array"][13] = new Object();
fldValueStruct["fld2array"][13]["value"] = 359;
fldValueStruct["fld2array"][13]["text"] = "OATMEAL";
fldValueStruct["fld2array"][14] = new Object();
fldValueStruct["fld2array"][14]["value"] = 643;
fldValueStruct["fld2array"][14]["text"] = "PETAL PINK";
fldValueStruct["fld2array"][15] = new Object();
fldValueStruct["fld2array"][15]["value"] = 1373;
fldValueStruct["fld2array"][15]["text"] = "RED GLOSS";
fldValueStruct["fld2array"][16] = new Object();
fldValueStruct["fld2array"][16]["value"] = 1424;
fldValueStruct["fld2array"][16]["text"] = "SOUTHWEST ORANGE";
fldValueStruct["fld2array"][17] = new Object();
fldValueStruct["fld2array"][17]["value"] = 144;
fldValueStruct["fld2array"][17]["text"] = "SUNBRIGHT";
fldValueStruct["fld2array"][18] = new Object();
fldValueStruct["fld2array"][18]["value"] = 246;
fldValueStruct["fld2array"][18]["text"] = "TAN NEWSPRINT";
fldValueStruct["fld2array"][19] = new Object();
fldValueStruct["fld2array"][19]["value"] = 238;
fldValueStruct["fld2array"][19]["text"] = "TEAL";
fldValueStruct["fld2array"][20] = new Object();
fldValueStruct["fld2array"][20]["value"] = 1425;
fldValueStruct["fld2array"][20]["text"] = "TEXTURED NATURAL KRAFT";
fldValueStruct["fld2array"][21] = new Object();
fldValueStruct["fld2array"][21]["value"] = 1426;
fldValueStruct["fld2array"][21]["text"] = "TEXTURED PLUM";
fldValueStruct["fld2array"][22] = new Object();
fldValueStruct["fld2array"][22]["value"] = 275;
fldValueStruct["fld2array"][22]["text"] = "WHITE GLOSS";


AvailableProducts = new Object();
AvailableProducts["144_1197"] = 34196;
AvailableProducts["352_1006"] = 34120;
AvailableProducts["302_1158"] = 34143;
AvailableProducts["1006_144"] = 34140;
AvailableProducts["352_1175"] = 34202;
AvailableProducts["352_1162"] = 34155;
AvailableProducts["1006_246"] = 34136;
AvailableProducts["1197_352"] = 34185;
AvailableProducts["1175_147"] = 34200;
AvailableProducts["302_1194"] = 34171;
AvailableProducts["1175_159"] = 34214;
AvailableProducts["302_1197"] = 34186;
AvailableProducts["1364_1006"] = 34125;
AvailableProducts["246_1175"] = 34219;
AvailableProducts["1175_1425"] = 34220;
AvailableProducts["1197_359"] = 34189;
AvailableProducts["306_1197"] = 34191;
AvailableProducts["1006_1426"] = 34138;
AvailableProducts["246_1197"] = 34194;
AvailableProducts["1197_643"] = 34192;
AvailableProducts["1006_474"] = 34123;
AvailableProducts["1006_147"] = 34118;
AvailableProducts["1006_359"] = 34130;
AvailableProducts["159_1006"] = 34131;
AvailableProducts["1006_1364"] = 34125;
AvailableProducts["1006_306"] = 34132;
AvailableProducts["159_1175"] = 34214;
AvailableProducts["1175_1364"] = 34208;
AvailableProducts["1361_1006"] = 34119;
AvailableProducts["1426_1006"] = 34138;
AvailableProducts["1426_1175"] = 34221;
AvailableProducts["1158_1351"] = 34141;
AvailableProducts["1351_1006"] = 34117;
AvailableProducts["1351_1175"] = 34199;
AvailableProducts["1158_144"] = 34153;
AvailableProducts["1158_359"] = 34146;
AvailableProducts["1175_1361"] = 34201;
AvailableProducts["1175_306"] = 34215;
AvailableProducts["1162_352"] = 34155;
AvailableProducts["1162_1351"] = 34154;
AvailableProducts["1175_642"] = 34212;
AvailableProducts["1363_1175"] = 34211;
AvailableProducts["1006_139"] = 34127;
AvailableProducts["1194_238"] = 34178;
AvailableProducts["1194_306"] = 34176;
AvailableProducts["642_1197"] = 34188;
AvailableProducts["1194_246"] = 34179;
AvailableProducts["1194_359"] = 34174;
AvailableProducts["474_1006"] = 34123;
AvailableProducts["238_1158"] = 34150;
AvailableProducts["352_1197"] = 34185;
AvailableProducts["1162_246"] = 34164;
AvailableProducts["1197_302"] = 34186;
AvailableProducts["238_1175"] = 34218;
AvailableProducts["1175_352"] = 34202;
AvailableProducts["643_1006"] = 34133;
AvailableProducts["1363_1006"] = 34128;
AvailableProducts["359_1175"] = 34213;
AvailableProducts["359_1158"] = 34146;
AvailableProducts["643_1175"] = 34216;
AvailableProducts["643_1158"] = 34149;
AvailableProducts["1197_159"] = 34190;
AvailableProducts["1175_144"] = 34224;
AvailableProducts["1194_643"] = 34177;
AvailableProducts["643_1162"] = 34162;
AvailableProducts["1197_642"] = 34188;
AvailableProducts["1351_1194"] = 34169;
AvailableProducts["1351_1197"] = 34184;
AvailableProducts["238_1197"] = 34193;
AvailableProducts["1158_302"] = 34143;
AvailableProducts["1158_642"] = 34145;
AvailableProducts["1162_302"] = 34156;
AvailableProducts["1162_238"] = 34163;
AvailableProducts["1162_359"] = 34159;
AvailableProducts["1158_352"] = 34142;
AvailableProducts["1197_306"] = 34191;
AvailableProducts["1361_1175"] = 34201;
AvailableProducts["1162_144"] = 34166;
AvailableProducts["1175_238"] = 34218;
AvailableProducts["1194_144"] = 34181;
AvailableProducts["1194_1351"] = 34169;
AvailableProducts["474_1175"] = 34205;
AvailableProducts["359_1194"] = 34174;
AvailableProducts["1006_643"] = 34133;
AvailableProducts["359_1197"] = 34189;
AvailableProducts["1006_1425"] = 34137;
AvailableProducts["1175_139"] = 34210;
AvailableProducts["1006_1363"] = 34128;
AvailableProducts["1006_352"] = 34120;
AvailableProducts["1351_1162"] = 34154;
AvailableProducts["1006_238"] = 34135;
AvailableProducts["643_1197"] = 34192;
AvailableProducts["1162_306"] = 34161;
AvailableProducts["159_1197"] = 34190;
AvailableProducts["1194_352"] = 34170;
AvailableProducts["1424_1006"] = 34134;
AvailableProducts["1197_1351"] = 34184;
AvailableProducts["1197_246"] = 34194;
AvailableProducts["1006_642"] = 34129;
AvailableProducts["147_1175"] = 34200;
AvailableProducts["302_1006"] = 34121;
AvailableProducts["144_1194"] = 34181;
AvailableProducts["302_1162"] = 34156;
AvailableProducts["302_1175"] = 34203;
AvailableProducts["147_1006"] = 34118;
AvailableProducts["352_1158"] = 34142;
AvailableProducts["144_1006"] = 34140;
AvailableProducts["352_1194"] = 34170;
AvailableProducts["144_1162"] = 34166;
AvailableProducts["144_1175"] = 34224;
AvailableProducts["144_1158"] = 34153;
AvailableProducts["275_1175"] = 34222;
AvailableProducts["306_1006"] = 34132;
AvailableProducts["246_1194"] = 34179;
AvailableProducts["306_1162"] = 34161;
AvailableProducts["306_1175"] = 34215;
AvailableProducts["306_1158"] = 34148;
AvailableProducts["1175_302"] = 34203;
AvailableProducts["246_1006"] = 34136;
AvailableProducts["306_1194"] = 34176;
AvailableProducts["246_1162"] = 34164;
AvailableProducts["1158_246"] = 34151;
AvailableProducts["1175_359"] = 34213;
AvailableProducts["246_1158"] = 34151;
AvailableProducts["238_1006"] = 34135;
AvailableProducts["642_1194"] = 34173;
AvailableProducts["238_1162"] = 34163;
AvailableProducts["1194_302"] = 34171;
AvailableProducts["643_1194"] = 34177;
AvailableProducts["359_1162"] = 34159;
AvailableProducts["1194_642"] = 34173;
AvailableProducts["642_1006"] = 34129;
AvailableProducts["238_1194"] = 34178;
AvailableProducts["642_1162"] = 34158;
AvailableProducts["642_1175"] = 34212;
AvailableProducts["359_1006"] = 34130;
AvailableProducts["642_1158"] = 34145;
AvailableProducts["1194_159"] = 34175;
AvailableProducts["159_1194"] = 34175;
AvailableProducts["159_1162"] = 34160;
AvailableProducts["139_1175"] = 34210;
AvailableProducts["159_1158"] = 34147;
AvailableProducts["1175_246"] = 34219;
AvailableProducts["139_1006"] = 34127;
AvailableProducts["1006_1424"] = 34134;
AvailableProducts["1175_1351"] = 34199;
AvailableProducts["1006_1361"] = 34119;
AvailableProducts["1006_302"] = 34121;
AvailableProducts["1006_159"] = 34131;
AvailableProducts["1197_238"] = 34193;
AvailableProducts["1425_1006"] = 34137;
AvailableProducts["1364_1175"] = 34208;
AvailableProducts["1197_144"] = 34196;
AvailableProducts["1162_642"] = 34158;
AvailableProducts["1175_474"] = 34205;
AvailableProducts["1175_643"] = 34216;
AvailableProducts["1162_159"] = 34160;
AvailableProducts["1006_1351"] = 34117;
AvailableProducts["1175_1426"] = 34221;
AvailableProducts["1158_159"] = 34147;
AvailableProducts["1175_275"] = 34222;
AvailableProducts["1175_1363"] = 34211;
AvailableProducts["1162_643"] = 34162;
AvailableProducts["1425_1175"] = 34220;
AvailableProducts["1158_238"] = 34150;
AvailableProducts["1158_306"] = 34148;
AvailableProducts["1158_643"] = 34149;
AvailableProducts["1351_1158"] = 34141;


AttributeArray = new Object();
AttributeArray["1370"] = new Object();
AttributeArray["1370"]["value"] = 1370;
AttributeArray["1370"]["text"] = "METALLIC BLUE";
AttributeArray["1363"] = new Object();
AttributeArray["1363"]["value"] = 1363;
AttributeArray["1363"]["text"] = "METALLIC SAGE GLOSS";
AttributeArray["1363"]["prod_id"] = "34128,34211";
AttributeArray["1363"]["allowed"] = "1006,1175";
AttributeArray["1364"] = new Object();
AttributeArray["1364"]["value"] = 1364;
AttributeArray["1364"]["text"] = "METALLIC SAGE";
AttributeArray["1364"]["prod_id"] = "34125,34208";
AttributeArray["1364"]["allowed"] = "1006,1175";
AttributeArray["359"] = new Object();
AttributeArray["359"]["value"] = 359;
AttributeArray["359"]["text"] = "OATMEAL";
AttributeArray["359"]["prod_id"] = "34130,34146,34159,34213,34174,34189";
AttributeArray["359"]["allowed"] = "1006,1158,1162,1175,1194,1197";
AttributeArray["1006"] = new Object();
AttributeArray["1006"]["value"] = 1006;
AttributeArray["1006"]["text"] = "12.00 X 0.00 X 15.00";
AttributeArray["1006"]["prod_id"] = "34127,34140,34118,34131,34135,34136,34121,34132,34120,34130,34123,34129,34133,34117,34119,34128,34125,34134,34137,34138";
AttributeArray["1006"]["allowed"] = "139,144,147,159,238,246,302,306,352,359,474,642,643,1351,1361,1363,1364,1424,1425,1426";
AttributeArray["139"] = new Object();
AttributeArray["139"]["value"] = 139;
AttributeArray["139"]["text"] = "METALLIC BLUE GLOSS";
AttributeArray["139"]["prod_id"] = "34127,34210";
AttributeArray["139"]["allowed"] = "1006,1175";
AttributeArray["275"] = new Object();
AttributeArray["275"]["value"] = 275;
AttributeArray["275"]["text"] = "WHITE GLOSS";
AttributeArray["275"]["prod_id"] = "34222";
AttributeArray["275"]["allowed"] = "1175";
AttributeArray["1426"] = new Object();
AttributeArray["1426"]["value"] = 1426;
AttributeArray["1426"]["text"] = "TEXTURED PLUM";
AttributeArray["1426"]["prod_id"] = "34138,34221";
AttributeArray["1426"]["allowed"] = "1006,1175";
AttributeArray["238"] = new Object();
AttributeArray["238"]["value"] = 238;
AttributeArray["238"]["text"] = "TEAL";
AttributeArray["238"]["prod_id"] = "34135,34150,34163,34218,34178,34193";
AttributeArray["238"]["allowed"] = "1006,1158,1162,1175,1194,1197";
AttributeArray["474"] = new Object();
AttributeArray["474"]["value"] = 474;
AttributeArray["474"]["text"] = "MATTE METALLIC BLUE";
AttributeArray["474"]["prod_id"] = "34123,34205";
AttributeArray["474"]["allowed"] = "1006,1175";
AttributeArray["1373"] = new Object();
AttributeArray["1373"]["value"] = 1373;
AttributeArray["1373"]["text"] = "RED GLOSS";
AttributeArray["352"] = new Object();
AttributeArray["352"]["value"] = 352;
AttributeArray["352"]["text"] = "CREAM";
AttributeArray["352"]["prod_id"] = "34120,34142,34155,34202,34170,34185";
AttributeArray["352"]["allowed"] = "1006,1158,1162,1175,1194,1197";
AttributeArray["643"] = new Object();
AttributeArray["643"]["value"] = 643;
AttributeArray["643"]["text"] = "PETAL PINK";
AttributeArray["643"]["prod_id"] = "34133,34149,34162,34216,34177,34192";
AttributeArray["643"]["allowed"] = "1006,1158,1162,1175,1194,1197";
AttributeArray["642"] = new Object();
AttributeArray["642"]["value"] = 642;
AttributeArray["642"]["text"] = "MISTY GRAY";
AttributeArray["642"]["prod_id"] = "34129,34145,34158,34212,34173,34188";
AttributeArray["642"]["allowed"] = "1006,1158,1162,1175,1194,1197";
AttributeArray["1424"] = new Object();
AttributeArray["1424"]["value"] = 1424;
AttributeArray["1424"]["text"] = "SOUTHWEST ORANGE";
AttributeArray["1424"]["prod_id"] = "34134";
AttributeArray["1424"]["allowed"] = "1006";
AttributeArray["1425"] = new Object();
AttributeArray["1425"]["value"] = 1425;
AttributeArray["1425"]["text"] = "TEXTURED NATURAL KRAFT";
AttributeArray["1425"]["prod_id"] = "34137,34220";
AttributeArray["1425"]["allowed"] = "1006,1175";
AttributeArray["1194"] = new Object();
AttributeArray["1194"]["value"] = 1194;
AttributeArray["1194"]["text"] = "16.00 X 3.75 X 24.00";
AttributeArray["1194"]["prod_id"] = "34181,34175,34178,34179,34171,34176,34170,34174,34173,34177,34169";
AttributeArray["1194"]["allowed"] = "144,159,238,246,302,306,352,359,642,643,1351";
AttributeArray["302"] = new Object();
AttributeArray["302"]["value"] = 302;
AttributeArray["302"]["text"] = "FOREST GREEN";
AttributeArray["302"]["prod_id"] = "34121,34143,34156,34203,34171,34186";
AttributeArray["302"]["allowed"] = "1006,1158,1162,1175,1194,1197";
AttributeArray["1197"] = new Object();
AttributeArray["1197"]["value"] = 1197;
AttributeArray["1197"]["text"] = "6.25 X 0.00 X 9.25";
AttributeArray["1197"]["prod_id"] = "34196,34190,34193,34194,34186,34191,34185,34189,34188,34192,34184";
AttributeArray["1197"]["allowed"] = "144,159,238,246,302,306,352,359,642,643,1351";
AttributeArray["306"] = new Object();
AttributeArray["306"]["value"] = 306;
AttributeArray["306"]["text"] = "MAUVE";
AttributeArray["306"]["prod_id"] = "34132,34148,34161,34215,34176,34191";
AttributeArray["306"]["allowed"] = "1006,1158,1162,1175,1194,1197";
AttributeArray["246"] = new Object();
AttributeArray["246"]["value"] = 246;
AttributeArray["246"]["text"] = "TAN NEWSPRINT";
AttributeArray["246"]["prod_id"] = "34136,34151,34164,34219,34179,34194";
AttributeArray["246"]["allowed"] = "1006,1158,1162,1175,1194,1197";
AttributeArray["144"] = new Object();
AttributeArray["144"]["value"] = 144;
AttributeArray["144"]["text"] = "SUNBRIGHT";
AttributeArray["144"]["prod_id"] = "34140,34153,34166,34224,34181,34196";
AttributeArray["144"]["allowed"] = "1006,1158,1162,1175,1194,1197";
AttributeArray["1162"] = new Object();
AttributeArray["1162"]["value"] = 1162;
AttributeArray["1162"]["text"] = "14.00 X 3.00 X 21.00";
AttributeArray["1162"]["prod_id"] = "34166,34160,34163,34164,34156,34161,34155,34159,34158,34162,34154";
AttributeArray["1162"]["allowed"] = "144,159,238,246,302,306,352,359,642,643,1351";
AttributeArray["1158"] = new Object();
AttributeArray["1158"]["value"] = 1158;
AttributeArray["1158"]["text"] = "12.00 X 3.00 X 18.00";
AttributeArray["1158"]["prod_id"] = "34153,34147,34150,34151,34143,34148,34142,34146,34145,34149,34141";
AttributeArray["1158"]["allowed"] = "144,159,238,246,302,306,352,359,642,643,1351";
AttributeArray["1351"] = new Object();
AttributeArray["1351"]["value"] = 1351;
AttributeArray["1351"]["text"] = "MATTE BLACK";
AttributeArray["1351"]["prod_id"] = "34117,34141,34154,34199,34169,34184";
AttributeArray["1351"]["allowed"] = "1006,1158,1162,1175,1194,1197";
AttributeArray["159"] = new Object();
AttributeArray["159"]["value"] = 159;
AttributeArray["159"]["text"] = "MATTE RED";
AttributeArray["159"]["prod_id"] = "34131,34147,34160,34214,34175,34190";
AttributeArray["159"]["allowed"] = "1006,1158,1162,1175,1194,1197";
AttributeArray["1175"] = new Object();
AttributeArray["1175"]["value"] = 1175;
AttributeArray["1175"]["text"] = "8.50 X 0.00 X 11.00";
AttributeArray["1175"]["prod_id"] = "34210,34224,34200,34214,34218,34219,34222,34203,34215,34202,34213,34205,34212,34216,34199,34201,34211,34208,34220,34221";
AttributeArray["1175"]["allowed"] = "139,144,147,159,238,246,275,302,306,352,359,474,642,643,1351,1361,1363,1364,1425,1426";
AttributeArray["147"] = new Object();
AttributeArray["147"]["value"] = 147;
AttributeArray["147"]["text"] = "MATTE CELERY";
AttributeArray["147"]["prod_id"] = "34118,34200";
AttributeArray["147"]["allowed"] = "1006,1175";
AttributeArray["1361"] = new Object();
AttributeArray["1361"]["value"] = 1361;
AttributeArray["1361"]["text"] = "CHOCOLATE";
AttributeArray["1361"]["prod_id"] = "34119,34201";
AttributeArray["1361"]["allowed"] = "1006,1175";


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 {
		
	}
	

