/*--------------------------------------------
groupsPage.js - for the groups page dropdown menu list 

Revision History
25Apr08 - sb - removed .propertyIsEnumerable(num) so Safari wouldn't choke
--------------------------------------------*/

// Generate the MM Make Dropdown option list.
function mm_updateMakeSelect(mm_array, makeSel, curMake) {
        with (makeSel) {
                options.length = 0;     // Clear the option list.
 
                // Add a header row.
                options[0] = new Option("Select Make", "");
                if (! curMake) {
                        options[0].selected = true;
                }
 
                // Add options for all makes.
                var make;
                for (make in mm_array) {
                        if (! mm_array.propertyIsEnumerable(make)) { continue; }
                        options[options.length] = new Option(make, make);
                        if (curMake == make) {
                                options[options.length-1].selected = true;
                        }
                }
        }
}
 
// Update the MM Model Dropdown to reflect the selected make.
function mm_updateMakeModelSelect(mm_array, modelSel, curMake, curModel) {
        with (modelSel) {
                options.length = 0;     // Clear the option list.
 
                // Add a header row.
                options[0] = new Option("Select Model", "");
                if (! curModel) {
                        options[0].selected = true;
                }
 
                // No models w/o a make.
                if (!curMake) {
                        return;
                }
 
                // Add options for all this make's models.
                var num;
                for (var num=0; num<mm_array[curMake].length; num++) {
                        if (! mm_array[curMake][num]) { continue; }
                        var model = mm_array[curMake][num];
                        options[options.length] = new Option(model, model);
                        if (curModel == model) {
                                options[options.length-1].selected = true;
                        }
                }
        }
}