// Support Script (747)
function FilterList(theList, SelectedValue, EmptyLabel, EmptyValue)
{

var i

theList.clear()

if (theList.ContentArray[SelectedValue] == null)
{
 theList.addOption(EmptyLabel,0,EmptyValue)
}
else
{
 var a = theList.ContentArray[SelectedValue]
 var len = a.length

 for (i = 0; i < len; i++)
 {
  theList.addOption(a[i].theName,i,a[i].theId)
 }

}

if (theList.MyChildList != null)
{
 theList.setSelectedByPosition(0)
 FilterList(theList.MyChildList, theList.getSelectedValue(), EmptyLabel, EmptyValue)
}

}
// Support Script (667)
function subAwithBinC(a,b,c)
{

	var i = c.indexOf(a);
	var l = b.length;

	while (i != -1)	{
		c = c.substring(0,i) + b + c.substring(i + a.length,c.length);
  i += l
		i = c.indexOf(a,i);
	}
	return c;

}
function document_onLoad() {
DivisionList2.clear()
CategoryList1.MyChildList = DivisionList2
DivisionList2.ContentArray = DynaList1Array
ItemList3.clear()
DivisionList2.MyChildList = ItemList3
ItemList3.ContentArray = DynaList2Array
 }
function CategoryList1__onChange() {
FilterList(DivisionList2,CategoryList1.getSelectedValue(), "None Listed", "0")
 }
function _CategoryList1__onChange() { if (CategoryList1) return CategoryList1.onChange(); }
function DivisionList2__onChange() {
FilterList(ItemList3,DivisionList2.getSelectedValue(), "None Listed", "0")
 }
function _DivisionList2__onChange() { if (DivisionList2) return DivisionList2.onChange(); }
function ItemList3__onChange() {
HiddenItemID.setText(ItemList3.getSelectedValue());
if ("".length > 1)
  Form1.setAction(subAwithBinC(" ", "%20", ""));
    
// execute the onSubmit() event handler and try to 
// determine if it already validated the form
Result = Form1.onSubmit();

//   If there is no onSubmithander the return value is null
//   If there is a validation handler it returns true to submit
//   or false to not submit
if (Result==null || Result==true)
    Form1.submit();
 }
function _ItemList3__onChange() { if (ItemList3) return ItemList3.onChange(); }

