

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=pxteal.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_pxteal.jpg\" class=\"imgBorder\" alt=\"Tints on Kraft\" />\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"] = 1121;
fldValueStruct["fld1array"][0]["text"] = "3.00 X 3.00 X 2.00";
fldValueStruct["fld1array"][1] = new Object();
fldValueStruct["fld1array"][1]["value"] = 542;
fldValueStruct["fld1array"][1]["text"] = "4.00 X 4.00 X 4.00";
fldValueStruct["fld1array"][2] = new Object();
fldValueStruct["fld1array"][2]["value"] = 925;
fldValueStruct["fld1array"][2]["text"] = "6.00 X 6.00 X 4.00";
fldValueStruct["fld1array"][3] = new Object();
fldValueStruct["fld1array"][3]["value"] = 1287;
fldValueStruct["fld1array"][3]["text"] = "6.00 X 4.50 X 4.50";
fldValueStruct["fld1array"][4] = new Object();
fldValueStruct["fld1array"][4]["value"] = 566;
fldValueStruct["fld1array"][4]["text"] = "7.00 X 7.00 X 7.00";
fldValueStruct["fld1array"][5] = new Object();
fldValueStruct["fld1array"][5]["value"] = 931;
fldValueStruct["fld1array"][5]["text"] = "8.00 X 8.00 X 4.00";
fldValueStruct["fld1array"][6] = new Object();
fldValueStruct["fld1array"][6]["value"] = 1136;
fldValueStruct["fld1array"][6]["text"] = "9.00 X 9.00 X 5.50";
fldValueStruct["fld1array"][7] = new Object();
fldValueStruct["fld1array"][7]["value"] = 1271;
fldValueStruct["fld1array"][7]["text"] = "10.00 X 4.50 X 4.50";
fldValueStruct["fld1array"][8] = new Object();
fldValueStruct["fld1array"][8]["value"] = 922;
fldValueStruct["fld1array"][8]["text"] = "12.00 X 12.00 X 3.00";
fldValueStruct["fld1array"][9] = new Object();
fldValueStruct["fld1array"][9]["value"] = 936;
fldValueStruct["fld1array"][9]["text"] = "12.00 X 12.00 X 5.50";
fldValueStruct["fld1array"][10] = new Object();
fldValueStruct["fld1array"][10]["value"] = 1277;
fldValueStruct["fld1array"][10]["text"] = "12.00 X 5.50 X 6.00";
fldValueStruct["fld1array"][11] = new Object();
fldValueStruct["fld1array"][11]["value"] = 1095;
fldValueStruct["fld1array"][11]["text"] = "14.00 X 6.00 X 6.00";
fldValueStruct["fld2array"] =  new Array();
fldValueStruct["fld2array"][0] = new Object();
fldValueStruct["fld2array"][0]["value"] = 1351;
fldValueStruct["fld2array"][0]["text"] = "MATTE BLACK";
fldValueStruct["fld2array"][1] = new Object();
fldValueStruct["fld2array"][1]["value"] = 1352;
fldValueStruct["fld2array"][1]["text"] = "MATTE BURGUNDY";
fldValueStruct["fld2array"][2] = new Object();
fldValueStruct["fld2array"][2]["value"] = 486;
fldValueStruct["fld2array"][2]["text"] = "MATTE CHOCOLATE";
fldValueStruct["fld2array"][3] = new Object();
fldValueStruct["fld2array"][3]["value"] = 501;
fldValueStruct["fld2array"][3]["text"] = "MATTE GREEN";
fldValueStruct["fld2array"][4] = new Object();
fldValueStruct["fld2array"][4]["value"] = 1582;
fldValueStruct["fld2array"][4]["text"] = "MATTE GREEN";
fldValueStruct["fld2array"][5] = new Object();
fldValueStruct["fld2array"][5]["value"] = 157;
fldValueStruct["fld2array"][5]["text"] = "MATTE NAVY";
fldValueStruct["fld2array"][6] = new Object();
fldValueStruct["fld2array"][6]["value"] = 1451;
fldValueStruct["fld2array"][6]["text"] = "MATTE PURPLE";
fldValueStruct["fld2array"][7] = new Object();
fldValueStruct["fld2array"][7]["value"] = 183;
fldValueStruct["fld2array"][7]["text"] = "MATTE SAND";
fldValueStruct["fld2array"][8] = new Object();
fldValueStruct["fld2array"][8]["value"] = 316;
fldValueStruct["fld2array"][8]["text"] = "MATTE TEAL";


AvailableProducts = new Object();
AvailableProducts["1451_566"] = 35545;
AvailableProducts["157_1277"] = 35095;
AvailableProducts["486_542"] = 35297;
AvailableProducts["501_922"] = 35010;
AvailableProducts["1451_1287"] = 35403;
AvailableProducts["922_1351"] = 35005;
AvailableProducts["501_931"] = 35596;
AvailableProducts["936_501"] = 35043;
AvailableProducts["486_936"] = 35040;
AvailableProducts["566_157"] = 35543;
AvailableProducts["316_542"] = 35307;
AvailableProducts["1277_157"] = 35095;
AvailableProducts["183_1287"] = 35406;
AvailableProducts["542_157"] = 35301;
AvailableProducts["183_936"] = 35049;
AvailableProducts["1352_1271"] = 34957;
AvailableProducts["183_542"] = 35305;
AvailableProducts["316_1136"] = 35678;
AvailableProducts["1352_925"] = 35457;
AvailableProducts["501_1277"] = 35094;
AvailableProducts["542_1351"] = 35295;
AvailableProducts["1136_183"] = 35676;
AvailableProducts["1351_1121"] = 35191;
AvailableProducts["1121_486"] = 35193;
AvailableProducts["501_1136"] = 35670;
AvailableProducts["1136_1352"] = 35666;
AvailableProducts["1121_1451"] = 35198;
AvailableProducts["1121_157"] = 35197;
AvailableProducts["157_936"] = 35044;
AvailableProducts["1121_1351"] = 35191;
AvailableProducts["1121_501"] = 35196;
AvailableProducts["1121_316"] = 35203;
AvailableProducts["1451_922"] = 35013;
AvailableProducts["1352_931"] = 35592;
AvailableProducts["1271_183"] = 34966;
AvailableProducts["1352_1121"] = 35192;
AvailableProducts["1352_566"] = 35538;
AvailableProducts["1451_542"] = 35302;
AvailableProducts["936_316"] = 35051;
AvailableProducts["542_1352"] = 35296;
AvailableProducts["1271_316"] = 34968;
AvailableProducts["501_1287"] = 35401;
AvailableProducts["1271_1451"] = 34963;
AvailableProducts["925_486"] = 35458;
AvailableProducts["1095_1352"] = 35126;
AvailableProducts["1095_501"] = 35130;
AvailableProducts["1095_316"] = 35138;
AvailableProducts["1351_936"] = 35038;
AvailableProducts["1287_1351"] = 35396;
AvailableProducts["1095_1451"] = 35133;
AvailableProducts["1095_157"] = 35131;
AvailableProducts["566_1451"] = 35545;
AvailableProducts["1095_486"] = 35127;
AvailableProducts["1287_183"] = 35406;
AvailableProducts["1095_1351"] = 35125;
AvailableProducts["486_1277"] = 35091;
AvailableProducts["1351_931"] = 35591;
AvailableProducts["922_501"] = 35010;
AvailableProducts["316_925"] = 35469;
AvailableProducts["566_316"] = 35550;
AvailableProducts["501_936"] = 35043;
AvailableProducts["542_183"] = 35305;
AvailableProducts["1287_1352"] = 35397;
AvailableProducts["1277_486"] = 35091;
AvailableProducts["931_486"] = 35593;
AvailableProducts["183_566"] = 35548;
AvailableProducts["566_486"] = 35539;
AvailableProducts["316_936"] = 35051;
AvailableProducts["1351_542"] = 35295;
AvailableProducts["1351_1271"] = 34956;
AvailableProducts["936_486"] = 35040;
AvailableProducts["922_1352"] = 35006;
AvailableProducts["501_1271"] = 34961;
AvailableProducts["1451_1277"] = 35096;
AvailableProducts["486_931"] = 35593;
AvailableProducts["183_925"] = 35467;
AvailableProducts["1451_925"] = 35464;
AvailableProducts["542_316"] = 35307;
AvailableProducts["925_183"] = 35467;
AvailableProducts["1351_1095"] = 35125;
AvailableProducts["1451_936"] = 35046;
AvailableProducts["1351_1287"] = 35396;
AvailableProducts["922_486"] = 35007;
AvailableProducts["316_566"] = 35550;
AvailableProducts["931_1451"] = 35598;
AvailableProducts["1271_501"] = 34961;
AvailableProducts["157_931"] = 35597;
AvailableProducts["542_1451"] = 35302;
AvailableProducts["501_542"] = 35300;
AvailableProducts["316_1271"] = 34968;
AvailableProducts["1451_1121"] = 35198;
AvailableProducts["566_1351"] = 35537;
AvailableProducts["566_501"] = 35542;
AvailableProducts["936_1351"] = 35038;
AvailableProducts["566_183"] = 35548;
AvailableProducts["486_922"] = 35007;
AvailableProducts["1136_486"] = 35667;
AvailableProducts["931_501"] = 35596;
AvailableProducts["157_542"] = 35301;
AvailableProducts["922_157"] = 35011;
AvailableProducts["925_1352"] = 35457;
AvailableProducts["936_1451"] = 35046;
AvailableProducts["542_501"] = 35300;
AvailableProducts["925_1451"] = 35464;
AvailableProducts["1271_486"] = 34958;
AvailableProducts["1351_925"] = 35456;
AvailableProducts["931_1351"] = 35591;
AvailableProducts["925_501"] = 35461;
AvailableProducts["501_1095"] = 35130;
AvailableProducts["183_1277"] = 35099;
AvailableProducts["183_931"] = 35601;
AvailableProducts["1287_486"] = 35398;
AvailableProducts["931_157"] = 35597;
AvailableProducts["1352_1277"] = 35090;
AvailableProducts["922_1451"] = 35013;
AvailableProducts["486_566"] = 35539;
AvailableProducts["1352_922"] = 35006;
AvailableProducts["501_566"] = 35542;
AvailableProducts["157_1271"] = 34962;
AvailableProducts["1277_1352"] = 35090;
AvailableProducts["157_1121"] = 35197;
AvailableProducts["157_1136"] = 35671;
AvailableProducts["931_316"] = 35603;
AvailableProducts["157_1287"] = 35402;
AvailableProducts["157_1095"] = 35131;
AvailableProducts["316_1121"] = 35203;
AvailableProducts["183_1271"] = 34966;
AvailableProducts["183_1121"] = 35201;
AvailableProducts["183_1136"] = 35676;
AvailableProducts["316_1287"] = 35408;
AvailableProducts["316_1095"] = 35138;
AvailableProducts["1271_157"] = 34962;
AvailableProducts["183_1095"] = 35136;
AvailableProducts["1352_1095"] = 35126;
AvailableProducts["486_1287"] = 35398;
AvailableProducts["486_1095"] = 35127;
AvailableProducts["925_157"] = 35462;
AvailableProducts["1287_1451"] = 35403;
AvailableProducts["566_1352"] = 35538;
AvailableProducts["486_1121"] = 35193;
AvailableProducts["486_1136"] = 35667;
AvailableProducts["1287_157"] = 35402;
AvailableProducts["486_1271"] = 34958;
AvailableProducts["1277_1351"] = 35089;
AvailableProducts["1277_183"] = 35099;
AvailableProducts["1351_922"] = 35005;
AvailableProducts["925_316"] = 35469;
AvailableProducts["1287_316"] = 35408;
AvailableProducts["936_183"] = 35049;
AvailableProducts["931_183"] = 35601;
AvailableProducts["922_316"] = 35018;
AvailableProducts["501_1121"] = 35196;
AvailableProducts["1095_183"] = 35136;
AvailableProducts["542_486"] = 35297;
AvailableProducts["316_1277"] = 35101;
AvailableProducts["157_925"] = 35462;
AvailableProducts["1271_1352"] = 34957;
AvailableProducts["936_1352"] = 35039;
AvailableProducts["1451_1136"] = 35673;
AvailableProducts["1121_183"] = 35201;
AvailableProducts["1451_1271"] = 34963;
AvailableProducts["925_1351"] = 35456;
AvailableProducts["936_157"] = 35044;
AvailableProducts["1121_1352"] = 35192;
AvailableProducts["1136_1451"] = 35673;
AvailableProducts["1136_316"] = 35678;
AvailableProducts["1287_501"] = 35401;
AvailableProducts["501_925"] = 35461;
AvailableProducts["316_922"] = 35018;
AvailableProducts["1277_501"] = 35094;
AvailableProducts["931_1352"] = 35592;
AvailableProducts["1136_501"] = 35670;
AvailableProducts["1451_931"] = 35598;
AvailableProducts["1351_1277"] = 35089;
AvailableProducts["1277_1451"] = 35096;
AvailableProducts["1277_316"] = 35101;
AvailableProducts["1271_1351"] = 34956;
AvailableProducts["157_922"] = 35011;
AvailableProducts["1136_157"] = 35671;
AvailableProducts["316_931"] = 35603;
AvailableProducts["157_566"] = 35543;
AvailableProducts["1352_1287"] = 35397;
AvailableProducts["486_925"] = 35458;
AvailableProducts["1352_936"] = 35039;
AvailableProducts["1451_1095"] = 35133;
AvailableProducts["1352_542"] = 35296;
AvailableProducts["1352_1136"] = 35666;
AvailableProducts["1351_566"] = 35537;


AttributeArray = new Object();
AttributeArray["1136"] = new Object();
AttributeArray["1136"]["value"] = 1136;
AttributeArray["1136"]["text"] = "9.00 X 9.00 X 5.50";
AttributeArray["1136"]["prod_id"] = "35671,35676,35678,35667,35670,35666,35673";
AttributeArray["1136"]["allowed"] = "157,183,316,486,501,1352,1451";
AttributeArray["1582"] = new Object();
AttributeArray["1582"]["value"] = 1582;
AttributeArray["1582"]["text"] = "MATTE GREEN";
AttributeArray["1351"] = new Object();
AttributeArray["1351"]["value"] = 1351;
AttributeArray["1351"]["text"] = "MATTE BLACK";
AttributeArray["1351"]["prod_id"] = "35295,35537,35005,35456,35591,35038,35125,35191,34956,35089,35396";
AttributeArray["1351"]["allowed"] = "542,566,922,925,931,936,1095,1121,1271,1277,1287";
AttributeArray["922"] = new Object();
AttributeArray["922"]["value"] = 922;
AttributeArray["922"]["text"] = "12.00 X 12.00 X 3.00";
AttributeArray["922"]["prod_id"] = "35011,35018,35007,35010,35005,35006,35013";
AttributeArray["922"]["allowed"] = "157,316,486,501,1351,1352,1451";
AttributeArray["501"] = new Object();
AttributeArray["501"]["value"] = 501;
AttributeArray["501"]["text"] = "MATTE GREEN";
AttributeArray["501"]["prod_id"] = "35300,35542,35010,35461,35596,35043,35130,35196,35670,34961,35094,35401";
AttributeArray["501"]["allowed"] = "542,566,922,925,931,936,1095,1121,1136,1271,1277,1287";
AttributeArray["925"] = new Object();
AttributeArray["925"]["value"] = 925;
AttributeArray["925"]["text"] = "6.00 X 6.00 X 4.00";
AttributeArray["925"]["prod_id"] = "35462,35467,35469,35458,35461,35456,35457,35464";
AttributeArray["925"]["allowed"] = "157,183,316,486,501,1351,1352,1451";
AttributeArray["486"] = new Object();
AttributeArray["486"]["value"] = 486;
AttributeArray["486"]["text"] = "MATTE CHOCOLATE";
AttributeArray["486"]["prod_id"] = "35297,35539,35007,35458,35593,35040,35127,35193,35667,34958,35091,35398";
AttributeArray["486"]["allowed"] = "542,566,922,925,931,936,1095,1121,1136,1271,1277,1287";
AttributeArray["566"] = new Object();
AttributeArray["566"]["value"] = 566;
AttributeArray["566"]["text"] = "7.00 X 7.00 X 7.00";
AttributeArray["566"]["prod_id"] = "35543,35548,35550,35539,35542,35537,35538,35545";
AttributeArray["566"]["allowed"] = "157,183,316,486,501,1351,1352,1451";
AttributeArray["1451"] = new Object();
AttributeArray["1451"]["value"] = 1451;
AttributeArray["1451"]["text"] = "MATTE PURPLE";
AttributeArray["1451"]["prod_id"] = "35302,35545,35013,35464,35598,35046,35133,35198,35673,34963,35096,35403";
AttributeArray["1451"]["allowed"] = "542,566,922,925,931,936,1095,1121,1136,1271,1277,1287";
AttributeArray["931"] = new Object();
AttributeArray["931"]["value"] = 931;
AttributeArray["931"]["text"] = "8.00 X 8.00 X 4.00";
AttributeArray["931"]["prod_id"] = "35597,35601,35603,35593,35596,35591,35592,35598";
AttributeArray["931"]["allowed"] = "157,183,316,486,501,1351,1352,1451";
AttributeArray["1287"] = new Object();
AttributeArray["1287"]["value"] = 1287;
AttributeArray["1287"]["text"] = "6.00 X 4.50 X 4.50";
AttributeArray["1287"]["prod_id"] = "35402,35406,35408,35398,35401,35396,35397,35403";
AttributeArray["1287"]["allowed"] = "157,183,316,486,501,1351,1352,1451";
AttributeArray["936"] = new Object();
AttributeArray["936"]["value"] = 936;
AttributeArray["936"]["text"] = "12.00 X 12.00 X 5.50";
AttributeArray["936"]["prod_id"] = "35044,35049,35051,35040,35043,35038,35039,35046";
AttributeArray["936"]["allowed"] = "157,183,316,486,501,1351,1352,1451";
AttributeArray["316"] = new Object();
AttributeArray["316"]["value"] = 316;
AttributeArray["316"]["text"] = "MATTE TEAL";
AttributeArray["316"]["prod_id"] = "35307,35550,35018,35469,35603,35051,35138,35203,35678,34968,35101,35408";
AttributeArray["316"]["allowed"] = "542,566,922,925,931,936,1095,1121,1136,1271,1277,1287";
AttributeArray["1095"] = new Object();
AttributeArray["1095"]["value"] = 1095;
AttributeArray["1095"]["text"] = "14.00 X 6.00 X 6.00";
AttributeArray["1095"]["prod_id"] = "35131,35136,35138,35127,35130,35125,35126,35133";
AttributeArray["1095"]["allowed"] = "157,183,316,486,501,1351,1352,1451";
AttributeArray["1277"] = new Object();
AttributeArray["1277"]["value"] = 1277;
AttributeArray["1277"]["text"] = "12.00 X 5.50 X 6.00";
AttributeArray["1277"]["prod_id"] = "35095,35099,35101,35091,35094,35089,35090,35096";
AttributeArray["1277"]["allowed"] = "157,183,316,486,501,1351,1352,1451";
AttributeArray["183"] = new Object();
AttributeArray["183"]["value"] = 183;
AttributeArray["183"]["text"] = "MATTE SAND";
AttributeArray["183"]["prod_id"] = "35305,35548,35467,35601,35049,35136,35201,35676,34966,35099,35406";
AttributeArray["183"]["allowed"] = "542,566,925,931,936,1095,1121,1136,1271,1277,1287";
AttributeArray["157"] = new Object();
AttributeArray["157"]["value"] = 157;
AttributeArray["157"]["text"] = "MATTE NAVY";
AttributeArray["157"]["prod_id"] = "35301,35543,35011,35462,35597,35044,35131,35197,35671,34962,35095,35402";
AttributeArray["157"]["allowed"] = "542,566,922,925,931,936,1095,1121,1136,1271,1277,1287";
AttributeArray["1271"] = new Object();
AttributeArray["1271"]["value"] = 1271;
AttributeArray["1271"]["text"] = "10.00 X 4.50 X 4.50";
AttributeArray["1271"]["prod_id"] = "34962,34966,34968,34958,34961,34956,34957,34963";
AttributeArray["1271"]["allowed"] = "157,183,316,486,501,1351,1352,1451";
AttributeArray["542"] = new Object();
AttributeArray["542"]["value"] = 542;
AttributeArray["542"]["text"] = "4.00 X 4.00 X 4.00";
AttributeArray["542"]["prod_id"] = "35301,35305,35307,35297,35300,35295,35296,35302";
AttributeArray["542"]["allowed"] = "157,183,316,486,501,1351,1352,1451";
AttributeArray["1352"] = new Object();
AttributeArray["1352"]["value"] = 1352;
AttributeArray["1352"]["text"] = "MATTE BURGUNDY";
AttributeArray["1352"]["prod_id"] = "35296,35538,35006,35457,35592,35039,35126,35192,35666,34957,35090,35397";
AttributeArray["1352"]["allowed"] = "542,566,922,925,931,936,1095,1121,1136,1271,1277,1287";
AttributeArray["1121"] = new Object();
AttributeArray["1121"]["value"] = 1121;
AttributeArray["1121"]["text"] = "3.00 X 3.00 X 2.00";
AttributeArray["1121"]["prod_id"] = "35197,35201,35203,35193,35196,35191,35192,35198";
AttributeArray["1121"]["allowed"] = "157,183,316,486,501,1351,1352,1451";


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 {
		
	}
	

