// JavaScript Document
function sub_frm() {
	document.frm1.acc1.value = ""
	document.frm1.pro_qty.value = ""
	document.frm1.flammable.value = "" 
var sel = "no"

var x;
var msg = "<span class='style21'>** No Locker/Building Selected</span>"
var max = document.frm1.flammable.length;

for (var idx = 0; idx < max; idx++)
{
	item1 = "new" 
	if (document.frm1.flammable[ idx ].checked == true)
	{
		var flamable_idx = document.frm1.flammable[ idx ].value
		flamable_idx_1 = flamable_idx.split("-")
		document.frm1.acc1.value = document.frm1.acc1.value + "^" + flamable_idx_1[ 0 ]
		
			if(isNaN(document.frm1.Flm[ idx ].value) || document.frm1.Flm[ idx ].value == '')
			{
							
				msg= "<span class='style21'>** Please Enter Quantity for " + document.frm1.flammable[ idx ].value + " </span>"
				sel = "no"
				itm.innerHTML = msg
				itm1.innerHTML = msg
				
				return false;
			}
		
			else
			{
			sel = "yes"
			x = idx + 1
			document.frm1.pro_qty.value = document.frm1.pro_qty.value + "," + flamable_idx_1[ 0 ]  + document.frm1.Flm[ idx ].value

			var entry ="first"
				//alert(x)
				
				for (var y = 0; y < 2; y++)
				{
					//alert(y)
					
					if (eval("document.frm1.Accessory"+ x + "[" + y + "].checked") == true)
					{
						//alert(eval("document.frm1.Accessory"+ x + "[" + y + "].value"))
						
							
							if (item1 == "new" &&  entry =="first")
							{
							
								document.frm1.acc1.value = document.frm1.acc1.value  +  eval("document.frm1.Accessory"+ x + "[" + y + "].value")
														
							//alert(document.frm1.acc1.value)
							item1 = "old"
							entry ="second"
														}
							else
							{
								document.frm1.acc1.value = document.frm1.acc1.value + "," + eval("document.frm1.Accessory"+ x + "[" + y + "].value")
								//alert(document.frm1.acc1.value)
							} 
					}
				}
				
				entry =="first"
				
				
				
				
			}
			
	}
}

 
   if(sel == "no")
   {
    itm.innerHTML = msg
	itm1.innerHTML = msg
	}
	else
	{
	//alert(document.frm1.acc1.value + "Final")
if (document.frm1.acc1.value == "blank")
{document.frm1.acc1.value = ""}
	document.frm1.submit();
	}
}