function InitializeParentChild(afForm, asParentSelText, asChildSelText, asDefaultParentText, asDefaultChildText) {
    var rgParent;
    
    // clear the makes select box, and add a default record to tell the user to select something
    clearList(afForm.lstParent);
    addElement(afForm.lstParent, asDefaultParentText, 0);
    
    // Populate the Makes Select box from the array
    for (var i = 0; i < gary_Parent.length; i++){
        if (gary_Parent[i]){
            rgParent = gary_Parent[i].split('#');
            addElement(afForm.lstParent, rgParent[0], rgParent[1]);
            }
        }
    // If there is a selected value in the Parent list box, then rebuild the Child list
    if (asParentSelText){
        setDefaultByText(afForm.lstParent, asParentSelText);
        ReBuildChild(afForm, asDefaultChildText);
        if (asChildSelText)
            setDefaultByText(afForm.lstChild, asChildSelText);
        }
    else{
		// If there isnt a selected value, default it to be index of 0
        afForm.lstParent.selectedIndex = 0;
        ReBuildChild(afForm, asDefaultChildText);
        }
    }// InitializeParentChild



// When the Makes list has changed, adjust the Models accordingly
function ReBuildChild(afForm, asDefaultChildText){
    // Point to the appropriate Child array.  In cases of initialization, there will be no array
    var lary_Child = gary_Child[afForm.lstParent.options[afForm.lstParent.selectedIndex].value];

    clearList(afForm.lstChild);
    addElement(afForm.lstChild, asDefaultChildText, 0);
    // If there is a valid Child List
    if(lary_Child){
        var rgChild = lary_Child.split(',');
        for (var i = 0; i < rgChild.length; i++){
            if (rgChild[i]){
                var rgModel = rgChild[i].split('#');
                addElement(afForm.lstChild, rgModel[0], rgModel[1]);
                }
            }
        afForm.lstChild.disabled = false;
        }
    else{
        afForm.lstChild.disabled = true;
        }

    afForm.lstChild.selectedIndex = 0;
    } 

// Clears out a list box
function clearList(list) {
    var i = 0;
    var o = list.options;

    for (i = o.length; i >= 0; --i)
		o[i] = null;
    list.disabled = true;
    }


// Adds a record to the given list box.  Required are both a value and text
function addElement(list, text_in, value_in){
    var o = list.options;
    var nIdx;
	if (o.length < 0) //IE for Mac 4.5 sets length to -1 if list is empty
		nIdx = 0;
	else
		nIdx = o.length;
		
	o[nIdx] = new Option(text_in, value_in);
	list.disabled = false;
    }

// Selects the record in the given list box by matching on the text 
function setDefaultByText(list, text_in){
    with (list){
        for (var i = 0; i < (options.length); i++){
             if (options[i].text == text_in){
                 selectedIndex = i;
                 return;
                 }
             }
        }
    }

// Selects the record in the given list box by matching on the Value
function setDefaultByValue(list, value_in){
    with (list){
        for (var i = 0; i < (options.length); i++){
             if (options[i].value == value_in){
                 selectedIndex = i;
                 return;
                 }
             }
        }
    }

