

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=psrose blkm.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_psrose blkm.JPG\" class=\"imgBorder\" alt=\"Gloss Tints on White\" />\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"] = 1262;
fldValueStruct["fld1array"][0]["text"] = "5.25 X 3.50 X 8.25";
fldValueStruct["fld1array"][1] = new Object();
fldValueStruct["fld1array"][1]["value"] = 1259;
fldValueStruct["fld1array"][1]["text"] = "8.00 X 4.75 X 10.38";
fldValueStruct["fld1array"][2] = new Object();
fldValueStruct["fld1array"][2]["value"] = 1243;
fldValueStruct["fld1array"][2]["text"] = "16.00 X 6.00 X 19.00";
fldValueStruct["fld1array"][3] = new Object();
fldValueStruct["fld1array"][3]["value"] = 1252;
fldValueStruct["fld1array"][3]["text"] = "16.00 X 6.00 X 12.38";
fldValueStruct["fld1array"][4] = new Object();
fldValueStruct["fld1array"][4]["value"] = 1247;
fldValueStruct["fld1array"][4]["text"] = "18.00 X 7.00 X 18.75";
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"] = 1580;
fldValueStruct["fld2array"][2]["text"] = "CANARY YELLOW";
fldValueStruct["fld2array"][3] = new Object();
fldValueStruct["fld2array"][3]["value"] = 1359;
fldValueStruct["fld2array"][3]["text"] = "CERISE GLOSS";
fldValueStruct["fld2array"][4] = new Object();
fldValueStruct["fld2array"][4]["value"] = 1356;
fldValueStruct["fld2array"][4]["text"] = "DARTMOUTH GREEN";
fldValueStruct["fld2array"][5] = new Object();
fldValueStruct["fld2array"][5]["value"] = 150;
fldValueStruct["fld2array"][5]["text"] = "IVORY GLOSS";
fldValueStruct["fld2array"][6] = new Object();
fldValueStruct["fld2array"][6]["value"] = 1357;
fldValueStruct["fld2array"][6]["text"] = "LAVENDER GLOSS";
fldValueStruct["fld2array"][7] = new Object();
fldValueStruct["fld2array"][7]["value"] = 1370;
fldValueStruct["fld2array"][7]["text"] = "METALLIC BLUE";
fldValueStruct["fld2array"][8] = new Object();
fldValueStruct["fld2array"][8]["value"] = 268;
fldValueStruct["fld2array"][8]["text"] = "METALLIC GOLD";
fldValueStruct["fld2array"][9] = new Object();
fldValueStruct["fld2array"][9]["value"] = 1363;
fldValueStruct["fld2array"][9]["text"] = "METALLIC SAGE GLOSS";
fldValueStruct["fld2array"][10] = new Object();
fldValueStruct["fld2array"][10]["value"] = 184;
fldValueStruct["fld2array"][10]["text"] = "NAVY GLOSS";
fldValueStruct["fld2array"][11] = new Object();
fldValueStruct["fld2array"][11]["value"] = 1421;
fldValueStruct["fld2array"][11]["text"] = "PINK GLOSS";
fldValueStruct["fld2array"][12] = new Object();
fldValueStruct["fld2array"][12]["value"] = 1373;
fldValueStruct["fld2array"][12]["text"] = "RED GLOSS";
fldValueStruct["fld2array"][13] = new Object();
fldValueStruct["fld2array"][13]["value"] = 1360;
fldValueStruct["fld2array"][13]["text"] = "ROYAL BLUE GLOSS";
fldValueStruct["fld2array"][14] = new Object();
fldValueStruct["fld2array"][14]["value"] = 1417;
fldValueStruct["fld2array"][14]["text"] = "SILVER GLOSS";
fldValueStruct["fld2array"][15] = new Object();
fldValueStruct["fld2array"][15]["value"] = 275;
fldValueStruct["fld2array"][15]["text"] = "WHITE GLOSS";
fldValueStruct["fld2array"][16] = new Object();
fldValueStruct["fld2array"][16]["value"] = 1439;
fldValueStruct["fld2array"][16]["text"] = "WINEBERRY GLOSS";


AvailableProducts = new Object();
AvailableProducts["1262_1350"] = 34840;
AvailableProducts["1243_1417"] = 34566;
AvailableProducts["1259_1370"] = 34796;
AvailableProducts["1259_1359"] = 34771;
AvailableProducts["1259_1363"] = 34798;
AvailableProducts["1259_1356"] = 34774;
AvailableProducts["1259_1357"] = 34787;
AvailableProducts["1247_1363"] = 34621;
AvailableProducts["1349_1243"] = 34521;
AvailableProducts["1243_1359"] = 34525;
AvailableProducts["1259_268"] = 34797;
AvailableProducts["1262_1417"] = 34879;
AvailableProducts["1259_275"] = 34836;
AvailableProducts["1262_184"] = 34864;
AvailableProducts["184_1262"] = 34864;
AvailableProducts["1252_1370"] = 34701;
AvailableProducts["1350_1243"] = 34522;
AvailableProducts["1262_1580"] = 34845;
AvailableProducts["1417_1259"] = 34814;
AvailableProducts["1259_1360"] = 34811;
AvailableProducts["1259_1417"] = 34814;
AvailableProducts["1243_1363"] = 34552;
AvailableProducts["1262_1370"] = 34861;
AvailableProducts["1359_1259"] = 34771;
AvailableProducts["1370_1259"] = 34796;
AvailableProducts["1363_1243"] = 34552;
AvailableProducts["1350_1262"] = 34840;
AvailableProducts["1350_1252"] = 34674;
AvailableProducts["1357_1262"] = 34854;
AvailableProducts["1259_150"] = 34785;
AvailableProducts["1252_1350"] = 34674;
AvailableProducts["1359_1252"] = 34677;
AvailableProducts["1373_1262"] = 34874;
AvailableProducts["184_1259"] = 34800;
AvailableProducts["1259_1373"] = 34828;
AvailableProducts["1349_1259"] = 34767;
AvailableProducts["1370_1252"] = 34701;
AvailableProducts["1349_1262"] = 34839;
AvailableProducts["1252_1417"] = 34718;
AvailableProducts["1359_1262"] = 34843;
AvailableProducts["1243_1357"] = 34541;
AvailableProducts["1252_1356"] = 34680;
AvailableProducts["275_1252"] = 34742;
AvailableProducts["1262_1359"] = 34843;
AvailableProducts["1262_1360"] = 34876;
AvailableProducts["1373_1243"] = 34582;
AvailableProducts["1580_1262"] = 34845;
AvailableProducts["1417_1252"] = 34718;
AvailableProducts["1252_1359"] = 34677;
AvailableProducts["1421_1262"] = 34870;
AvailableProducts["268_1259"] = 34797;
AvailableProducts["1360_1262"] = 34876;
AvailableProducts["1243_1373"] = 34582;
AvailableProducts["1259_1350"] = 34768;
AvailableProducts["1439_1252"] = 34740;
AvailableProducts["1357_1243"] = 34541;
AvailableProducts["1363_1247"] = 34621;
AvailableProducts["1421_1243"] = 34559;
AvailableProducts["184_1243"] = 34554;
AvailableProducts["184_1252"] = 34705;
AvailableProducts["275_1262"] = 34898;
AvailableProducts["1356_1252"] = 34680;
AvailableProducts["1252_1349"] = 34673;
AvailableProducts["1243_1439"] = 34589;
AvailableProducts["1243_150"] = 34539;
AvailableProducts["1252_268"] = 34702;
AvailableProducts["1252_275"] = 34742;
AvailableProducts["1252_1421"] = 34710;
AvailableProducts["1252_1580"] = 34679;
AvailableProducts["1370_1247"] = 34620;
AvailableProducts["275_1243"] = 34591;
AvailableProducts["1243_1350"] = 34522;
AvailableProducts["150_1259"] = 34785;
AvailableProducts["1360_1243"] = 34564;
AvailableProducts["150_1243"] = 34539;
AvailableProducts["150_1252"] = 34690;
AvailableProducts["1373_1259"] = 34828;
AvailableProducts["268_1262"] = 34862;
AvailableProducts["1580_1243"] = 34527;
AvailableProducts["268_1243"] = 34551;
AvailableProducts["268_1252"] = 34702;
AvailableProducts["1262_1349"] = 34839;
AvailableProducts["1363_1252"] = 34703;
AvailableProducts["1262_1357"] = 34854;
AvailableProducts["1243_275"] = 34591;
AvailableProducts["1262_268"] = 34862;
AvailableProducts["1243_1370"] = 34550;
AvailableProducts["1439_1262"] = 34896;
AvailableProducts["1259_1439"] = 34834;
AvailableProducts["1356_1259"] = 34774;
AvailableProducts["1252_1373"] = 34734;
AvailableProducts["1359_1243"] = 34525;
AvailableProducts["1243_268"] = 34551;
AvailableProducts["1421_1259"] = 34805;
AvailableProducts["1259_184"] = 34800;
AvailableProducts["150_1262"] = 34852;
AvailableProducts["1262_1373"] = 34874;
AvailableProducts["1243_1360"] = 34564;
AvailableProducts["1370_1262"] = 34861;
AvailableProducts["1259_1349"] = 34767;
AvailableProducts["1363_1259"] = 34798;
AvailableProducts["1580_1252"] = 34679;
AvailableProducts["1580_1259"] = 34773;
AvailableProducts["1370_1243"] = 34550;
AvailableProducts["1417_1243"] = 34566;
AvailableProducts["275_1259"] = 34836;
AvailableProducts["1243_1349"] = 34521;
AvailableProducts["1252_1360"] = 34715;
AvailableProducts["1262_1363"] = 34863;
AvailableProducts["1421_1252"] = 34710;
AvailableProducts["1350_1259"] = 34768;
AvailableProducts["1360_1259"] = 34811;
AvailableProducts["1363_1262"] = 34863;
AvailableProducts["1357_1259"] = 34787;
AvailableProducts["1262_1356"] = 34847;
AvailableProducts["1259_1580"] = 34773;
AvailableProducts["1439_1243"] = 34589;
AvailableProducts["1356_1243"] = 34528;
AvailableProducts["1252_1357"] = 34692;
AvailableProducts["1243_184"] = 34554;
AvailableProducts["1360_1252"] = 34715;
AvailableProducts["1243_1356"] = 34528;
AvailableProducts["1252_184"] = 34705;
AvailableProducts["1252_150"] = 34690;
AvailableProducts["1439_1259"] = 34834;
AvailableProducts["1259_1421"] = 34805;
AvailableProducts["1252_1439"] = 34740;
AvailableProducts["1417_1262"] = 34879;
AvailableProducts["1356_1262"] = 34847;
AvailableProducts["1373_1252"] = 34734;
AvailableProducts["1262_275"] = 34898;
AvailableProducts["1262_1439"] = 34896;
AvailableProducts["1262_150"] = 34852;
AvailableProducts["1357_1252"] = 34692;
AvailableProducts["1252_1363"] = 34703;
AvailableProducts["1243_1580"] = 34527;
AvailableProducts["1349_1252"] = 34673;
AvailableProducts["1247_1370"] = 34620;
AvailableProducts["1243_1421"] = 34559;
AvailableProducts["1262_1421"] = 34870;


AttributeArray = new Object();
AttributeArray["1370"] = new Object();
AttributeArray["1370"]["value"] = 1370;
AttributeArray["1370"]["text"] = "METALLIC BLUE";
AttributeArray["1370"]["prod_id"] = "34550,34620,34701,34796,34861";
AttributeArray["1370"]["allowed"] = "1243,1247,1252,1259,1262";
AttributeArray["1363"] = new Object();
AttributeArray["1363"]["value"] = 1363;
AttributeArray["1363"]["text"] = "METALLIC SAGE GLOSS";
AttributeArray["1363"]["prod_id"] = "34552,34621,34703,34798,34863";
AttributeArray["1363"]["allowed"] = "1243,1247,1252,1259,1262";
AttributeArray["1580"] = new Object();
AttributeArray["1580"]["value"] = 1580;
AttributeArray["1580"]["text"] = "CANARY YELLOW";
AttributeArray["1580"]["prod_id"] = "34527,34679,34773,34845";
AttributeArray["1580"]["allowed"] = "1243,1252,1259,1262";
AttributeArray["150"] = new Object();
AttributeArray["150"]["value"] = 150;
AttributeArray["150"]["text"] = "IVORY GLOSS";
AttributeArray["150"]["prod_id"] = "34539,34690,34785,34852";
AttributeArray["150"]["allowed"] = "1243,1252,1259,1262";
AttributeArray["1262"] = new Object();
AttributeArray["1262"]["value"] = 1262;
AttributeArray["1262"]["text"] = "5.25 X 3.50 X 8.25";
AttributeArray["1262"]["prod_id"] = "34852,34864,34862,34898,34839,34840,34847,34854,34843,34876,34863,34861,34874,34879,34870,34896,34845";
AttributeArray["1262"]["allowed"] = "150,184,268,275,1349,1350,1356,1357,1359,1360,1363,1370,1373,1417,1421,1439,1580";
AttributeArray["1247"] = new Object();
AttributeArray["1247"]["value"] = 1247;
AttributeArray["1247"]["text"] = "18.00 X 7.00 X 18.75";
AttributeArray["1247"]["prod_id"] = "34621,34620";
AttributeArray["1247"]["allowed"] = "1363,1370";
AttributeArray["1439"] = new Object();
AttributeArray["1439"]["value"] = 1439;
AttributeArray["1439"]["text"] = "WINEBERRY GLOSS";
AttributeArray["1439"]["prod_id"] = "34589,34740,34834,34896";
AttributeArray["1439"]["allowed"] = "1243,1252,1259,1262";
AttributeArray["1356"] = new Object();
AttributeArray["1356"]["value"] = 1356;
AttributeArray["1356"]["text"] = "DARTMOUTH GREEN";
AttributeArray["1356"]["prod_id"] = "34528,34680,34774,34847";
AttributeArray["1356"]["allowed"] = "1243,1252,1259,1262";
AttributeArray["275"] = new Object();
AttributeArray["275"]["value"] = 275;
AttributeArray["275"]["text"] = "WHITE GLOSS";
AttributeArray["275"]["prod_id"] = "34591,34742,34836,34898";
AttributeArray["275"]["allowed"] = "1243,1252,1259,1262";
AttributeArray["1360"] = new Object();
AttributeArray["1360"]["value"] = 1360;
AttributeArray["1360"]["text"] = "ROYAL BLUE GLOSS";
AttributeArray["1360"]["prod_id"] = "34564,34715,34811,34876";
AttributeArray["1360"]["allowed"] = "1243,1252,1259,1262";
AttributeArray["1421"] = new Object();
AttributeArray["1421"]["value"] = 1421;
AttributeArray["1421"]["text"] = "PINK GLOSS";
AttributeArray["1421"]["prod_id"] = "34559,34710,34805,34870";
AttributeArray["1421"]["allowed"] = "1243,1252,1259,1262";
AttributeArray["268"] = new Object();
AttributeArray["268"]["value"] = 268;
AttributeArray["268"]["text"] = "METALLIC GOLD";
AttributeArray["268"]["prod_id"] = "34551,34702,34797,34862";
AttributeArray["268"]["allowed"] = "1243,1252,1259,1262";
AttributeArray["1259"] = new Object();
AttributeArray["1259"]["value"] = 1259;
AttributeArray["1259"]["text"] = "8.00 X 4.75 X 10.38";
AttributeArray["1259"]["prod_id"] = "34785,34800,34797,34836,34767,34768,34774,34787,34771,34811,34798,34796,34828,34814,34805,34834,34773";
AttributeArray["1259"]["allowed"] = "150,184,268,275,1349,1350,1356,1357,1359,1360,1363,1370,1373,1417,1421,1439,1580";
AttributeArray["1243"] = new Object();
AttributeArray["1243"]["value"] = 1243;
AttributeArray["1243"]["text"] = "16.00 X 6.00 X 19.00";
AttributeArray["1243"]["prod_id"] = "34539,34554,34551,34591,34521,34522,34528,34541,34525,34564,34552,34550,34582,34566,34559,34589,34527";
AttributeArray["1243"]["allowed"] = "150,184,268,275,1349,1350,1356,1357,1359,1360,1363,1370,1373,1417,1421,1439,1580";
AttributeArray["1373"] = new Object();
AttributeArray["1373"]["value"] = 1373;
AttributeArray["1373"]["text"] = "RED GLOSS";
AttributeArray["1373"]["prod_id"] = "34582,34734,34828,34874";
AttributeArray["1373"]["allowed"] = "1243,1252,1259,1262";
AttributeArray["1350"] = new Object();
AttributeArray["1350"]["value"] = 1350;
AttributeArray["1350"]["text"] = "BRONZE PLATINUM";
AttributeArray["1350"]["prod_id"] = "34522,34674,34768,34840";
AttributeArray["1350"]["allowed"] = "1243,1252,1259,1262";
AttributeArray["184"] = new Object();
AttributeArray["184"]["value"] = 184;
AttributeArray["184"]["text"] = "NAVY GLOSS";
AttributeArray["184"]["prod_id"] = "34554,34705,34800,34864";
AttributeArray["184"]["allowed"] = "1243,1252,1259,1262";
AttributeArray["1349"] = new Object();
AttributeArray["1349"]["value"] = 1349;
AttributeArray["1349"]["text"] = "BLACK GLOSS";
AttributeArray["1349"]["prod_id"] = "34521,34673,34767,34839";
AttributeArray["1349"]["allowed"] = "1243,1252,1259,1262";
AttributeArray["1417"] = new Object();
AttributeArray["1417"]["value"] = 1417;
AttributeArray["1417"]["text"] = "SILVER GLOSS";
AttributeArray["1417"]["prod_id"] = "34566,34718,34814,34879";
AttributeArray["1417"]["allowed"] = "1243,1252,1259,1262";
AttributeArray["1359"] = new Object();
AttributeArray["1359"]["value"] = 1359;
AttributeArray["1359"]["text"] = "CERISE GLOSS";
AttributeArray["1359"]["prod_id"] = "34525,34677,34771,34843";
AttributeArray["1359"]["allowed"] = "1243,1252,1259,1262";
AttributeArray["1252"] = new Object();
AttributeArray["1252"]["value"] = 1252;
AttributeArray["1252"]["text"] = "16.00 X 6.00 X 12.38";
AttributeArray["1252"]["prod_id"] = "34690,34705,34702,34742,34673,34674,34680,34692,34677,34715,34703,34701,34734,34718,34710,34740,34679";
AttributeArray["1252"]["allowed"] = "150,184,268,275,1349,1350,1356,1357,1359,1360,1363,1370,1373,1417,1421,1439,1580";
AttributeArray["1357"] = new Object();
AttributeArray["1357"]["value"] = 1357;
AttributeArray["1357"]["text"] = "LAVENDER GLOSS";
AttributeArray["1357"]["prod_id"] = "34541,34692,34787,34854";
AttributeArray["1357"]["allowed"] = "1243,1252,1259,1262";


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 {
		
	}
	

