
function FillSubIndustry(SubIndustries, f, s, IndustryID) {
  var first_option=(arguments.length >=5) ? arguments[4] : "-- Please Select --";
  
  f = document.forms[f];
  s = f.elements[s];
  // Clear SubIndustry:
  for (i=0; i<s.length; i++) {
    s.options[i].value = "";
    s.length = 0;
  }
  // Fill SubIndustry:
  s.options[0] = new Option(first_option,"");
  if (IndustryID) {   // Don't fill if no Industry selected
    for (i=0; i<SubIndustries[IndustryID]['ID'].length; i++) {
      s.options[i+1] = new Option(SubIndustries[IndustryID]['Name'][i], SubIndustries[IndustryID]['ID'][i]);
    }
  }
};
