//update the options of a select element (child) from an js array
  // based on the selection of another element (parent)
  //
  //source_object = select name that onchange is called from (ie parent)
  //target_object = select name that will have options updated (ie child)
  //prefix = prefix of javascript array on form (eg job_ or state_)
  function set_select( source_object, target_object, prefix, selected_id) {
    // get the selected "value" => unique_code
    // and store the equivalent array data into the variable secondtype
    secondtype = eval(prefix+source_object.options[source_object.selectedIndex].value);
    // reset the number of options for the target
    target_object.options.length=0;
    selected_index = 0;
    for( i = 0; i < secondtype.length; i++ )
    {
      // check if the sub_type has a valid subscriber stored
      if ( secondtype[i] )
      {
      	// store the label
        target_object.options[i]= new Option(secondtype[i][0]);
        // store the id as the INDEX value
        target_object.options[i].value = secondtype[i][1];
        if (selected_id > 0 && secondtype[i][1] == selected_id) selected_index = i;
      }
    }
    target_object.selectedIndex = selected_index;
  } // end function
