

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=ABPSMETBLUE.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_ABPSMETBLUE.jpg\" class=\"imgBorder\" alt=\"Apparel Boxes\" />\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"] = 865;
fldValueStruct["fld1array"][0]["text"] = "11.50 X 8.50 X 1.63";
fldValueStruct["fld1array"][1] = new Object();
fldValueStruct["fld1array"][1]["value"] = 905;
fldValueStruct["fld1array"][1]["text"] = "11.50 X 8.50 X 1.00";
fldValueStruct["fld1array"][2] = new Object();
fldValueStruct["fld1array"][2]["value"] = 911;
fldValueStruct["fld1array"][2]["text"] = "14.00 X 9.50 X 2.00";
fldValueStruct["fld1array"][3] = new Object();
fldValueStruct["fld1array"][3]["value"] = 910;
fldValueStruct["fld1array"][3]["text"] = "15.00 X 9.50 X 2.00";
fldValueStruct["fld1array"][4] = new Object();
fldValueStruct["fld1array"][4]["value"] = 895;
fldValueStruct["fld1array"][4]["text"] = "17.00 X 11.00 X 2.50";
fldValueStruct["fld1array"][5] = new Object();
fldValueStruct["fld1array"][5]["value"] = 896;
fldValueStruct["fld1array"][5]["text"] = "19.00 X 12.00 X 3.00";
fldValueStruct["fld2array"] =  new Array();
fldValueStruct["fld2array"][0] = new Object();
fldValueStruct["fld2array"][0]["value"] = 1349;
fldValueStruct["fld2array"][0]["text"] = "BLACK GLOSS";
fldValueStruct["fld2array"][1] = new Object();
fldValueStruct["fld2array"][1]["value"] = 1350;
fldValueStruct["fld2array"][1]["text"] = "BRONZE PLATINUM";
fldValueStruct["fld2array"][2] = new Object();
fldValueStruct["fld2array"][2]["value"] = 1355;
fldValueStruct["fld2array"][2]["text"] = "BURGUNDY GLOSS";
fldValueStruct["fld2array"][3] = new Object();
fldValueStruct["fld2array"][3]["value"] = 1356;
fldValueStruct["fld2array"][3]["text"] = "DARTMOUTH GREEN";
fldValueStruct["fld2array"][4] = new Object();
fldValueStruct["fld2array"][4]["value"] = 1442;
fldValueStruct["fld2array"][4]["text"] = "IVORY";
fldValueStruct["fld2array"][5] = new Object();
fldValueStruct["fld2array"][5]["value"] = 1351;
fldValueStruct["fld2array"][5]["text"] = "MATTE BLACK";
fldValueStruct["fld2array"][6] = new Object();
fldValueStruct["fld2array"][6]["value"] = 1352;
fldValueStruct["fld2array"][6]["text"] = "MATTE BURGUNDY";
fldValueStruct["fld2array"][7] = new Object();
fldValueStruct["fld2array"][7]["value"] = 486;
fldValueStruct["fld2array"][7]["text"] = "MATTE CHOCOLATE";
fldValueStruct["fld2array"][8] = new Object();
fldValueStruct["fld2array"][8]["value"] = 501;
fldValueStruct["fld2array"][8]["text"] = "MATTE GREEN";
fldValueStruct["fld2array"][9] = new Object();
fldValueStruct["fld2array"][9]["value"] = 1582;
fldValueStruct["fld2array"][9]["text"] = "MATTE GREEN";
fldValueStruct["fld2array"][10] = new Object();
fldValueStruct["fld2array"][10]["value"] = 157;
fldValueStruct["fld2array"][10]["text"] = "MATTE NAVY";
fldValueStruct["fld2array"][11] = new Object();
fldValueStruct["fld2array"][11]["value"] = 1451;
fldValueStruct["fld2array"][11]["text"] = "MATTE PURPLE";
fldValueStruct["fld2array"][12] = new Object();
fldValueStruct["fld2array"][12]["value"] = 159;
fldValueStruct["fld2array"][12]["text"] = "MATTE RED";
fldValueStruct["fld2array"][13] = new Object();
fldValueStruct["fld2array"][13]["value"] = 183;
fldValueStruct["fld2array"][13]["text"] = "MATTE SAND";
fldValueStruct["fld2array"][14] = new Object();
fldValueStruct["fld2array"][14]["value"] = 316;
fldValueStruct["fld2array"][14]["text"] = "MATTE TEAL";
fldValueStruct["fld2array"][15] = new Object();
fldValueStruct["fld2array"][15]["value"] = 1362;
fldValueStruct["fld2array"][15]["text"] = "METALLIC COPPER";
fldValueStruct["fld2array"][16] = new Object();
fldValueStruct["fld2array"][16]["value"] = 268;
fldValueStruct["fld2array"][16]["text"] = "METALLIC GOLD";
fldValueStruct["fld2array"][17] = new Object();
fldValueStruct["fld2array"][17]["value"] = 1364;
fldValueStruct["fld2array"][17]["text"] = "METALLIC SAGE";
fldValueStruct["fld2array"][18] = new Object();
fldValueStruct["fld2array"][18]["value"] = 270;
fldValueStruct["fld2array"][18]["text"] = "METALLIC SILVER";
fldValueStruct["fld2array"][19] = new Object();
fldValueStruct["fld2array"][19]["value"] = 1373;
fldValueStruct["fld2array"][19]["text"] = "RED GLOSS";
fldValueStruct["fld2array"][20] = new Object();
fldValueStruct["fld2array"][20]["value"] = 318;
fldValueStruct["fld2array"][20]["text"] = "SAGE GLOSS";
fldValueStruct["fld2array"][21] = new Object();
fldValueStruct["fld2array"][21]["value"] = 141;
fldValueStruct["fld2array"][21]["text"] = "WHITE";


AvailableProducts = new Object();
AvailableProducts["896_316"] = 717;
AvailableProducts["1364_896"] = 725;
AvailableProducts["896_1352"] = 710;
AvailableProducts["895_1356"] = 643;
AvailableProducts["865_1350"] = 502;
AvailableProducts["895_1451"] = 663;
AvailableProducts["895_1364"] = 674;
AvailableProducts["896_1355"] = 694;
AvailableProducts["1362_896"] = 697;
AvailableProducts["895_1349"] = 637;
AvailableProducts["1451_865"] = 524;
AvailableProducts["316_865"] = 527;
AvailableProducts["1352_865"] = 520;
AvailableProducts["159_865"] = 525;
AvailableProducts["865_1364"] = 535;
AvailableProducts["896_1356"] = 698;
AvailableProducts["318_895"] = 673;
AvailableProducts["1350_910"] = 582;
AvailableProducts["895_1355"] = 639;
AvailableProducts["1351_896"] = 709;
AvailableProducts["910_270"] = 623;
AvailableProducts["1351_895"] = 658;
AvailableProducts["895_159"] = 664;
AvailableProducts["865_1352"] = 520;
AvailableProducts["157_896"] = 713;
AvailableProducts["865_1451"] = 524;
AvailableProducts["896_486"] = 711;
AvailableProducts["896_157"] = 713;
AvailableProducts["896_183"] = 716;
AvailableProducts["910_141"] = 628;
AvailableProducts["486_895"] = 660;
AvailableProducts["1352_896"] = 710;
AvailableProducts["1349_896"] = 692;
AvailableProducts["157_865"] = 523;
AvailableProducts["910_318"] = 620;
AvailableProducts["1356_865"] = 507;
AvailableProducts["1362_865"] = 506;
AvailableProducts["896_270"] = 727;
AvailableProducts["895_316"] = 666;
AvailableProducts["316_896"] = 717;
AvailableProducts["1362_910"] = 586;
AvailableProducts["1349_910"] = 581;
AvailableProducts["910_1355"] = 583;
AvailableProducts["1451_895"] = 663;
AvailableProducts["865_270"] = 15225;
AvailableProducts["865_486"] = 521;
AvailableProducts["1373_910"] = 619;
AvailableProducts["896_1349"] = 692;
AvailableProducts["159_896"] = 715;
AvailableProducts["865_1362"] = 506;
AvailableProducts["865_1373"] = 533;
AvailableProducts["895_1442"] = 649;
AvailableProducts["865_316"] = 527;
AvailableProducts["1356_896"] = 698;
AvailableProducts["895_1350"] = 638;
AvailableProducts["1442_905"] = 512;
AvailableProducts["895_486"] = 660;
AvailableProducts["910_268"] = 588;
AvailableProducts["1350_896"] = 693;
AvailableProducts["910_1356"] = 587;
AvailableProducts["270_896"] = 727;
AvailableProducts["895_501"] = 661;
AvailableProducts["896_268"] = 699;
AvailableProducts["1355_905"] = 503;
AvailableProducts["1373_895"] = 672;
AvailableProducts["1351_865"] = 519;
AvailableProducts["865_268"] = 508;
AvailableProducts["268_865"] = 508;
AvailableProducts["1364_895"] = 674;
AvailableProducts["1364_865"] = 535;
AvailableProducts["895_318"] = 673;
AvailableProducts["1350_895"] = 638;
AvailableProducts["1373_865"] = 533;
AvailableProducts["910_1373"] = 619;
AvailableProducts["1349_895"] = 637;
AvailableProducts["910_1349"] = 581;
AvailableProducts["1352_895"] = 659;
AvailableProducts["486_896"] = 711;
AvailableProducts["183_896"] = 716;
AvailableProducts["895_270"] = 675;
AvailableProducts["318_896"] = 724;
AvailableProducts["1356_895"] = 643;
AvailableProducts["896_1451"] = 714;
AvailableProducts["1442_895"] = 649;
AvailableProducts["865_157"] = 523;
AvailableProducts["895_1352"] = 659;
AvailableProducts["865_183"] = 526;
AvailableProducts["895_1351"] = 658;
AvailableProducts["895_268"] = 15226;
AvailableProducts["896_159"] = 715;
AvailableProducts["486_865"] = 521;
AvailableProducts["501_865"] = 522;
AvailableProducts["268_910"] = 588;
AvailableProducts["270_910"] = 623;
AvailableProducts["1355_910"] = 583;
AvailableProducts["896_1364"] = 725;
AvailableProducts["895_1362"] = 642;
AvailableProducts["895_1373"] = 672;
AvailableProducts["865_1349"] = 501;
AvailableProducts["865_1356"] = 507;
AvailableProducts["1451_896"] = 714;
AvailableProducts["865_501"] = 522;
AvailableProducts["501_896"] = 712;
AvailableProducts["905_1442"] = 512;
AvailableProducts["905_1355"] = 503;
AvailableProducts["896_1362"] = 697;
AvailableProducts["896_1373"] = 723;
AvailableProducts["865_159"] = 525;
AvailableProducts["896_1350"] = 693;
AvailableProducts["183_895"] = 665;
AvailableProducts["501_895"] = 661;
AvailableProducts["911_1442"] = 594;
AvailableProducts["270_895"] = 675;
AvailableProducts["183_865"] = 526;
AvailableProducts["318_910"] = 620;
AvailableProducts["910_1350"] = 582;
AvailableProducts["1355_895"] = 639;
AvailableProducts["895_183"] = 665;
AvailableProducts["910_1364"] = 621;
AvailableProducts["1362_895"] = 642;
AvailableProducts["141_910"] = 628;
AvailableProducts["896_501"] = 712;
AvailableProducts["268_895"] = 15226;
AvailableProducts["910_1362"] = 586;
AvailableProducts["895_157"] = 662;
AvailableProducts["865_1351"] = 519;
AvailableProducts["157_895"] = 662;
AvailableProducts["1442_911"] = 594;
AvailableProducts["316_895"] = 666;
AvailableProducts["159_895"] = 664;
AvailableProducts["270_865"] = 15225;
AvailableProducts["896_318"] = 724;
AvailableProducts["1349_865"] = 501;
AvailableProducts["268_896"] = 699;
AvailableProducts["1355_896"] = 694;
AvailableProducts["1373_896"] = 723;
AvailableProducts["1350_865"] = 502;
AvailableProducts["1356_910"] = 587;
AvailableProducts["1364_910"] = 621;
AvailableProducts["896_1351"] = 709;


AttributeArray = new Object();
AttributeArray["895"] = new Object();
AttributeArray["895"]["value"] = 895;
AttributeArray["895"]["text"] = "17.00 X 11.00 X 2.50";
AttributeArray["895"]["prod_id"] = "662,664,665,15226,675,666,673,660,661,637,638,658,659,639,643,642,674,672,649,663";
AttributeArray["895"]["allowed"] = "157,159,183,268,270,316,318,486,501,1349,1350,1351,1352,1355,1356,1362,1364,1373,1442,1451";
AttributeArray["1355"] = new Object();
AttributeArray["1355"]["value"] = 1355;
AttributeArray["1355"]["text"] = "BURGUNDY GLOSS";
AttributeArray["1355"]["prod_id"] = "639,694,503,583";
AttributeArray["1355"]["allowed"] = "895,896,905,910";
AttributeArray["1352"] = new Object();
AttributeArray["1352"]["value"] = 1352;
AttributeArray["1352"]["text"] = "MATTE BURGUNDY";
AttributeArray["1352"]["prod_id"] = "520,659,710";
AttributeArray["1352"]["allowed"] = "865,895,896";
AttributeArray["183"] = new Object();
AttributeArray["183"]["value"] = 183;
AttributeArray["183"]["text"] = "MATTE SAND";
AttributeArray["183"]["prod_id"] = "526,665,716";
AttributeArray["183"]["allowed"] = "865,895,896";
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"] = "519,658,709";
AttributeArray["1351"]["allowed"] = "865,895,896";
AttributeArray["910"] = new Object();
AttributeArray["910"]["value"] = 910;
AttributeArray["910"]["text"] = "15.00 X 9.50 X 2.00";
AttributeArray["910"]["prod_id"] = "628,588,623,620,581,582,583,587,586,621,619";
AttributeArray["910"]["allowed"] = "141,268,270,318,1349,1350,1355,1356,1362,1364,1373";
AttributeArray["501"] = new Object();
AttributeArray["501"]["value"] = 501;
AttributeArray["501"]["text"] = "MATTE GREEN";
AttributeArray["501"]["prod_id"] = "522,661,712";
AttributeArray["501"]["allowed"] = "865,895,896";
AttributeArray["865"] = new Object();
AttributeArray["865"]["value"] = 865;
AttributeArray["865"]["text"] = "11.50 X 8.50 X 1.63";
AttributeArray["865"]["prod_id"] = "523,525,526,508,15225,527,521,522,501,502,519,520,507,506,535,533,524";
AttributeArray["865"]["allowed"] = "157,159,183,268,270,316,486,501,1349,1350,1351,1352,1356,1362,1364,1373,1451";
AttributeArray["911"] = new Object();
AttributeArray["911"]["value"] = 911;
AttributeArray["911"]["text"] = "14.00 X 9.50 X 2.00";
AttributeArray["911"]["prod_id"] = "594";
AttributeArray["911"]["allowed"] = "1442";
AttributeArray["486"] = new Object();
AttributeArray["486"]["value"] = 486;
AttributeArray["486"]["text"] = "MATTE CHOCOLATE";
AttributeArray["486"]["prod_id"] = "521,660,711";
AttributeArray["486"]["allowed"] = "865,895,896";
AttributeArray["1373"] = new Object();
AttributeArray["1373"]["value"] = 1373;
AttributeArray["1373"]["text"] = "RED GLOSS";
AttributeArray["1373"]["prod_id"] = "533,672,723,619";
AttributeArray["1373"]["allowed"] = "865,895,896,910";
AttributeArray["316"] = new Object();
AttributeArray["316"]["value"] = 316;
AttributeArray["316"]["text"] = "MATTE TEAL";
AttributeArray["316"]["prod_id"] = "527,666,717";
AttributeArray["316"]["allowed"] = "865,895,896";
AttributeArray["1442"] = new Object();
AttributeArray["1442"]["value"] = 1442;
AttributeArray["1442"]["text"] = "IVORY";
AttributeArray["1442"]["prod_id"] = "649,512,594";
AttributeArray["1442"]["allowed"] = "895,905,911";
AttributeArray["1451"] = new Object();
AttributeArray["1451"]["value"] = 1451;
AttributeArray["1451"]["text"] = "MATTE PURPLE";
AttributeArray["1451"]["prod_id"] = "524,663,714";
AttributeArray["1451"]["allowed"] = "865,895,896";
AttributeArray["318"] = new Object();
AttributeArray["318"]["value"] = 318;
AttributeArray["318"]["text"] = "SAGE GLOSS";
AttributeArray["318"]["prod_id"] = "673,724,620";
AttributeArray["318"]["allowed"] = "895,896,910";
AttributeArray["905"] = new Object();
AttributeArray["905"]["value"] = 905;
AttributeArray["905"]["text"] = "11.50 X 8.50 X 1.00";
AttributeArray["905"]["prod_id"] = "503,512";
AttributeArray["905"]["allowed"] = "1355,1442";
AttributeArray["896"] = new Object();
AttributeArray["896"]["value"] = 896;
AttributeArray["896"]["text"] = "19.00 X 12.00 X 3.00";
AttributeArray["896"]["prod_id"] = "713,715,716,699,727,717,724,711,712,692,693,709,710,694,698,697,725,723,714";
AttributeArray["896"]["allowed"] = "157,159,183,268,270,316,318,486,501,1349,1350,1351,1352,1355,1356,1362,1364,1373,1451";
AttributeArray["268"] = new Object();
AttributeArray["268"]["value"] = 268;
AttributeArray["268"]["text"] = "METALLIC GOLD";
AttributeArray["268"]["prod_id"] = "508,15226,699,588";
AttributeArray["268"]["allowed"] = "865,895,896,910";
AttributeArray["141"] = new Object();
AttributeArray["141"]["value"] = 141;
AttributeArray["141"]["text"] = "WHITE";
AttributeArray["141"]["prod_id"] = "628";
AttributeArray["141"]["allowed"] = "910";
AttributeArray["270"] = new Object();
AttributeArray["270"]["value"] = 270;
AttributeArray["270"]["text"] = "METALLIC SILVER";
AttributeArray["270"]["prod_id"] = "15225,675,727,623";
AttributeArray["270"]["allowed"] = "865,895,896,910";
AttributeArray["159"] = new Object();
AttributeArray["159"]["value"] = 159;
AttributeArray["159"]["text"] = "MATTE RED";
AttributeArray["159"]["prod_id"] = "525,664,715";
AttributeArray["159"]["allowed"] = "865,895,896";
AttributeArray["157"] = new Object();
AttributeArray["157"]["value"] = 157;
AttributeArray["157"]["text"] = "MATTE NAVY";
AttributeArray["157"]["prod_id"] = "523,662,713";
AttributeArray["157"]["allowed"] = "865,895,896";
AttributeArray["1349"] = new Object();
AttributeArray["1349"]["value"] = 1349;
AttributeArray["1349"]["text"] = "BLACK GLOSS";
AttributeArray["1349"]["prod_id"] = "501,637,692,581";
AttributeArray["1349"]["allowed"] = "865,895,896,910";
AttributeArray["1362"] = new Object();
AttributeArray["1362"]["value"] = 1362;
AttributeArray["1362"]["text"] = "METALLIC COPPER";
AttributeArray["1362"]["prod_id"] = "506,642,697,586";
AttributeArray["1362"]["allowed"] = "865,895,896,910";
AttributeArray["1350"] = new Object();
AttributeArray["1350"]["value"] = 1350;
AttributeArray["1350"]["text"] = "BRONZE PLATINUM";
AttributeArray["1350"]["prod_id"] = "502,638,693,582";
AttributeArray["1350"]["allowed"] = "865,895,896,910";
AttributeArray["1356"] = new Object();
AttributeArray["1356"]["value"] = 1356;
AttributeArray["1356"]["text"] = "DARTMOUTH GREEN";
AttributeArray["1356"]["prod_id"] = "507,643,698,587";
AttributeArray["1356"]["allowed"] = "865,895,896,910";
AttributeArray["1364"] = new Object();
AttributeArray["1364"]["value"] = 1364;
AttributeArray["1364"]["text"] = "METALLIC SAGE";
AttributeArray["1364"]["prod_id"] = "535,674,725,621";
AttributeArray["1364"]["allowed"] = "865,895,896,910";


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 {
		
	}
	

