

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=LB845RED.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_LB845RED.jpg\" class=\"imgBorder\" alt=\"Gable Boxes/Lunch 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"] = 1517;
fldValueStruct["fld1array"][0]["text"] = "4.00 X 2.50 X 2.50";
fldValueStruct["fld1array"][1] = new Object();
fldValueStruct["fld1array"][1]["value"] = 1517;
fldValueStruct["fld1array"][1]["text"] = "4.00 X 2.50 X 2.50";
fldValueStruct["fld1array"][2] = new Object();
fldValueStruct["fld1array"][2]["value"] = 926;
fldValueStruct["fld1array"][2]["text"] = "8.00 X 4.00 X 3.00";
fldValueStruct["fld1array"][3] = new Object();
fldValueStruct["fld1array"][3]["value"] = 1519;
fldValueStruct["fld1array"][3]["text"] = "8.00 X 4.88 X 5.25";
fldValueStruct["fld1array"][4] = new Object();
fldValueStruct["fld1array"][4]["value"] = 1520;
fldValueStruct["fld1array"][4]["text"] = "8.00 X 8.75 X 5.25";
fldValueStruct["fld1array"][5] = new Object();
fldValueStruct["fld1array"][5]["value"] = 1521;
fldValueStruct["fld1array"][5]["text"] = "9.50 X 5.00 X 3.00";
fldValueStruct["fld1array"][6] = new Object();
fldValueStruct["fld1array"][6]["value"] = 1522;
fldValueStruct["fld1array"][6]["text"] = "9.00 X 6.00 X 6.00";
fldValueStruct["fld1array"][7] = new Object();
fldValueStruct["fld1array"][7]["value"] = 1523;
fldValueStruct["fld1array"][7]["text"] = "9.00 X 7.50 X 9.00";
fldValueStruct["fld1array"][8] = new Object();
fldValueStruct["fld1array"][8]["value"] = 1514;
fldValueStruct["fld1array"][8]["text"] = "10.25 X 10.25 X 3.00";
fldValueStruct["fld1array"][9] = new Object();
fldValueStruct["fld1array"][9]["value"] = 1515;
fldValueStruct["fld1array"][9]["text"] = "10.50 X 3.50 X 3.50";
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"] = 186;
fldValueStruct["fld2array"][1]["text"] = "BLUE GINGHAM";
fldValueStruct["fld2array"][2] = new Object();
fldValueStruct["fld2array"][2]["value"] = 181;
fldValueStruct["fld2array"][2]["text"] = "BURGUNDY GINGHAM";
fldValueStruct["fld2array"][3] = new Object();
fldValueStruct["fld2array"][3]["value"] = 1527;
fldValueStruct["fld2array"][3]["text"] = "GREEN GINGHAM";
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"] = 501;
fldValueStruct["fld2array"][7]["text"] = "MATTE GREEN";
fldValueStruct["fld2array"][8] = new Object();
fldValueStruct["fld2array"][8]["value"] = 1582;
fldValueStruct["fld2array"][8]["text"] = "MATTE GREEN";
fldValueStruct["fld2array"][9] = new Object();
fldValueStruct["fld2array"][9]["value"] = 157;
fldValueStruct["fld2array"][9]["text"] = "MATTE NAVY";
fldValueStruct["fld2array"][10] = new Object();
fldValueStruct["fld2array"][10]["value"] = 1451;
fldValueStruct["fld2array"][10]["text"] = "MATTE PURPLE";
fldValueStruct["fld2array"][11] = new Object();
fldValueStruct["fld2array"][11]["value"] = 140;
fldValueStruct["fld2array"][11]["text"] = "NATURAL KRAFT";
fldValueStruct["fld2array"][12] = new Object();
fldValueStruct["fld2array"][12]["value"] = 1528;
fldValueStruct["fld2array"][12]["text"] = "RED GINGHAM";
fldValueStruct["fld2array"][13] = new Object();
fldValueStruct["fld2array"][13]["value"] = 1373;
fldValueStruct["fld2array"][13]["text"] = "RED GLOSS";
fldValueStruct["fld2array"][14] = new Object();
fldValueStruct["fld2array"][14]["value"] = 141;
fldValueStruct["fld2array"][14]["text"] = "WHITE";


AvailableProducts = new Object();
AvailableProducts["1523_140"] = 15206;
AvailableProducts["1528_1522"] = 15198;
AvailableProducts["1522_1451"] = 15192;
AvailableProducts["1522_1442"] = 15184;
AvailableProducts["1349_1519"] = 15138;
AvailableProducts["1522_501"] = 15190;
AvailableProducts["141_1523"] = 15209;
AvailableProducts["1517_157"] = 15109;
AvailableProducts["157_1522"] = 15191;
AvailableProducts["157_1517"] = 15109;
AvailableProducts["1523_141"] = 15209;
AvailableProducts["1442_1517"] = 15100;
AvailableProducts["1517_1351"] = 15106;
AvailableProducts["140_1519"] = 15141;
AvailableProducts["1519_1373"] = 15159;
AvailableProducts["141_1514"] = 15082;
AvailableProducts["141_1521"] = 15170;
AvailableProducts["1351_1517"] = 15106;
AvailableProducts["140_1521"] = 15169;
AvailableProducts["1522_1352"] = 15189;
AvailableProducts["1517_141"] = 15098;
AvailableProducts["1517_1442"] = 15100;
AvailableProducts["1515_140"] = 15083;
AvailableProducts["1522_186"] = 15355;
AvailableProducts["140_1514"] = 15080;
AvailableProducts["186_1522"] = 15355;
AvailableProducts["1519_1349"] = 15138;
AvailableProducts["186_1517"] = 15095;
AvailableProducts["157_1520"] = 15152;
AvailableProducts["181_1522"] = 15177;
AvailableProducts["1517_140"] = 15097;
AvailableProducts["1519_1527"] = 15143;
AvailableProducts["1517_1349"] = 15094;
AvailableProducts["141_1515"] = 15084;
AvailableProducts["1520_1451"] = 15153;
AvailableProducts["1527_1519"] = 15143;
AvailableProducts["1520_1352"] = 15149;
AvailableProducts["1520_501"] = 15151;
AvailableProducts["1451_1522"] = 15192;
AvailableProducts["1519_141"] = 15142;
AvailableProducts["1527_1517"] = 15099;
AvailableProducts["1349_1517"] = 15094;
AvailableProducts["1517_1451"] = 15110;
AvailableProducts["1522_141"] = 15181;
AvailableProducts["1451_1517"] = 15110;
AvailableProducts["140_1523"] = 15206;
AvailableProducts["140_1517"] = 15097;
AvailableProducts["141_1522"] = 15181;
AvailableProducts["1517_1373"] = 15115;
AvailableProducts["1514_140"] = 15080;
AvailableProducts["141_1517"] = 15098;
AvailableProducts["1373_1517"] = 15115;
AvailableProducts["501_1522"] = 15190;
AvailableProducts["1519_1442"] = 15144;
AvailableProducts["140_1515"] = 15083;
AvailableProducts["1373_1519"] = 15159;
AvailableProducts["1351_1522"] = 15188;
AvailableProducts["1517_186"] = 15095;
AvailableProducts["1520_157"] = 15152;
AvailableProducts["141_1519"] = 15142;
AvailableProducts["1519_140"] = 15141;
AvailableProducts["926_141"] = 15134;
AvailableProducts["140_1522"] = 15180;
AvailableProducts["1522_1349"] = 15175;
AvailableProducts["1352_1517"] = 15107;
AvailableProducts["1352_1522"] = 15189;
AvailableProducts["1517_181"] = 15096;
AvailableProducts["1517_1527"] = 15099;
AvailableProducts["501_1520"] = 15151;
AvailableProducts["1349_1522"] = 15175;
AvailableProducts["181_1517"] = 15096;
AvailableProducts["501_1517"] = 15108;
AvailableProducts["1442_1522"] = 15184;
AvailableProducts["1517_1352"] = 15107;
AvailableProducts["1521_140"] = 15169;
AvailableProducts["1517_501"] = 15108;
AvailableProducts["1522_157"] = 15191;
AvailableProducts["1528_1517"] = 15116;
AvailableProducts["1522_140"] = 15180;
AvailableProducts["1517_1528"] = 15116;
AvailableProducts["1522_181"] = 15177;
AvailableProducts["1522_1351"] = 15188;
AvailableProducts["1352_1520"] = 15149;
AvailableProducts["926_140"] = 15133;
AvailableProducts["1451_1520"] = 15153;
AvailableProducts["141_926"] = 15134;
AvailableProducts["140_926"] = 15133;
AvailableProducts["1514_141"] = 15082;
AvailableProducts["1515_141"] = 15084;
AvailableProducts["1521_141"] = 15170;
AvailableProducts["1442_1519"] = 15144;
AvailableProducts["1522_1528"] = 15198;


AttributeArray = new Object();
AttributeArray["1523"] = new Object();
AttributeArray["1523"]["value"] = 1523;
AttributeArray["1523"]["text"] = "9.00 X 7.50 X 9.00";
AttributeArray["1523"]["prod_id"] = "15206,15209";
AttributeArray["1523"]["allowed"] = "140,141";
AttributeArray["1352"] = new Object();
AttributeArray["1352"]["value"] = 1352;
AttributeArray["1352"]["text"] = "MATTE BURGUNDY";
AttributeArray["1352"]["prod_id"] = "15107,15149,15189";
AttributeArray["1352"]["allowed"] = "1517,1520,1522";
AttributeArray["141"] = new Object();
AttributeArray["141"]["value"] = 141;
AttributeArray["141"]["text"] = "WHITE";
AttributeArray["141"]["prod_id"] = "15134,15082,15084,15098,15142,15170,15181,15209";
AttributeArray["141"]["allowed"] = "926,1514,1515,1517,1519,1521,1522,1523";
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"] = "15106,15188";
AttributeArray["1351"]["allowed"] = "1517,1522";
AttributeArray["501"] = new Object();
AttributeArray["501"]["value"] = 501;
AttributeArray["501"]["text"] = "MATTE GREEN";
AttributeArray["501"]["prod_id"] = "15108,15151,15190";
AttributeArray["501"]["allowed"] = "1517,1520,1522";
AttributeArray["1528"] = new Object();
AttributeArray["1528"]["value"] = 1528;
AttributeArray["1528"]["text"] = "RED GINGHAM";
AttributeArray["1528"]["prod_id"] = "15116,15198";
AttributeArray["1528"]["allowed"] = "1517,1522";
AttributeArray["1521"] = new Object();
AttributeArray["1521"]["value"] = 1521;
AttributeArray["1521"]["text"] = "9.50 X 5.00 X 3.00";
AttributeArray["1521"]["prod_id"] = "15169,15170";
AttributeArray["1521"]["allowed"] = "140,141";
AttributeArray["1442"] = new Object();
AttributeArray["1442"]["value"] = 1442;
AttributeArray["1442"]["text"] = "IVORY";
AttributeArray["1442"]["prod_id"] = "15100,15144,15184";
AttributeArray["1442"]["allowed"] = "1517,1519,1522";
AttributeArray["1451"] = new Object();
AttributeArray["1451"]["value"] = 1451;
AttributeArray["1451"]["text"] = "MATTE PURPLE";
AttributeArray["1451"]["prod_id"] = "15110,15153,15192";
AttributeArray["1451"]["allowed"] = "1517,1520,1522";
AttributeArray["1517"] = new Object();
AttributeArray["1517"]["value"] = 1517;
AttributeArray["1517"]["text"] = "4.00 X 2.50 X 2.50";
AttributeArray["1517"]["prod_id"] = "15097,15098,15109,15096,15095,15108,15094,15106,15107,15115,15100,15110,15099,15116";
AttributeArray["1517"]["allowed"] = "140,141,157,181,186,501,1349,1351,1352,1373,1442,1451,1527,1528";
AttributeArray["1522"] = new Object();
AttributeArray["1522"]["value"] = 1522;
AttributeArray["1522"]["text"] = "9.00 X 6.00 X 6.00";
AttributeArray["1522"]["prod_id"] = "15180,15181,15191,15177,15355,15190,15175,15188,15189,15184,15192,15198";
AttributeArray["1522"]["allowed"] = "140,141,157,181,186,501,1349,1351,1352,1442,1451,1528";
AttributeArray["1519"] = new Object();
AttributeArray["1519"]["value"] = 1519;
AttributeArray["1519"]["text"] = "8.00 X 4.88 X 5.25";
AttributeArray["1519"]["prod_id"] = "15141,15142,15138,15159,15144,15143";
AttributeArray["1519"]["allowed"] = "140,141,1349,1373,1442,1527";
AttributeArray["1520"] = new Object();
AttributeArray["1520"]["value"] = 1520;
AttributeArray["1520"]["text"] = "8.00 X 8.75 X 5.25";
AttributeArray["1520"]["prod_id"] = "15152,15151,15149,15153";
AttributeArray["1520"]["allowed"] = "157,501,1352,1451";
AttributeArray["926"] = new Object();
AttributeArray["926"]["value"] = 926;
AttributeArray["926"]["text"] = "8.00 X 4.00 X 3.00";
AttributeArray["926"]["prod_id"] = "15133,15134";
AttributeArray["926"]["allowed"] = "140,141";
AttributeArray["1514"] = new Object();
AttributeArray["1514"]["value"] = 1514;
AttributeArray["1514"]["text"] = "10.25 X 10.25 X 3.00";
AttributeArray["1514"]["prod_id"] = "15080,15082";
AttributeArray["1514"]["allowed"] = "140,141";
AttributeArray["1515"] = new Object();
AttributeArray["1515"]["value"] = 1515;
AttributeArray["1515"]["text"] = "10.50 X 3.50 X 3.50";
AttributeArray["1515"]["prod_id"] = "15083,15084";
AttributeArray["1515"]["allowed"] = "140,141";
AttributeArray["1527"] = new Object();
AttributeArray["1527"]["value"] = 1527;
AttributeArray["1527"]["text"] = "GREEN GINGHAM";
AttributeArray["1527"]["prod_id"] = "15099,15143";
AttributeArray["1527"]["allowed"] = "1517,1519";
AttributeArray["181"] = new Object();
AttributeArray["181"]["value"] = 181;
AttributeArray["181"]["text"] = "BURGUNDY GINGHAM";
AttributeArray["181"]["prod_id"] = "15096,15177";
AttributeArray["181"]["allowed"] = "1517,1522";
AttributeArray["186"] = new Object();
AttributeArray["186"]["value"] = 186;
AttributeArray["186"]["text"] = "BLUE GINGHAM";
AttributeArray["186"]["prod_id"] = "15095,15355";
AttributeArray["186"]["allowed"] = "1517,1522";
AttributeArray["1349"] = new Object();
AttributeArray["1349"]["value"] = 1349;
AttributeArray["1349"]["text"] = "BLACK GLOSS";
AttributeArray["1349"]["prod_id"] = "15094,15138,15175";
AttributeArray["1349"]["allowed"] = "1517,1519,1522";
AttributeArray["140"] = new Object();
AttributeArray["140"]["value"] = 140;
AttributeArray["140"]["text"] = "NATURAL KRAFT";
AttributeArray["140"]["prod_id"] = "15133,15080,15083,15097,15141,15169,15180,15206";
AttributeArray["140"]["allowed"] = "926,1514,1515,1517,1519,1521,1522,1523";
AttributeArray["157"] = new Object();
AttributeArray["157"]["value"] = 157;
AttributeArray["157"]["text"] = "MATTE NAVY";
AttributeArray["157"]["prod_id"] = "15109,15152,15191";
AttributeArray["157"]["allowed"] = "1517,1520,1522";
AttributeArray["1373"] = new Object();
AttributeArray["1373"]["value"] = 1373;
AttributeArray["1373"]["text"] = "RED GLOSS";
AttributeArray["1373"]["prod_id"] = "15115,15159";
AttributeArray["1373"]["allowed"] = "1517,1519";


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 {
		
	}
	

