Index: branches/LCSv2/views/default/submit.html
===================================================================
--- branches/LCSv2/views/default/submit.html	(revision 623)
+++ branches/LCSv2/views/default/submit.html	(revision 624)
@@ -64,4 +64,47 @@
     startloc.selectedIndex = "0";
     endloc.selectedIndex = "0";
+}
+/* When a supervisor is selected from the combobox, filter the
+   list of fieldrep (crew) for just those of that supervisor. 
+   Note: this function is a near duplicate of routechanged() */
+function supervisorchanged() {
+  var e = document.getElementById("supervisorcombo");
+  var currentSuper = e.options[e.selectedIndex].text;
+  // update the list of crew
+  removeOptions(document.getElementById("fieldrep"));
+  fillCrew(currentSuper);
+}
+/* Fill the FieldRep selectbox with items that match supervisor
+   I.e., have the same radio call number.
+   Note: this function is a near duplicate of fillOptions()  */
+function fillCrew(supervisor)
+{
+    var i;    
+    var tbl = document.getElementById("crewlookup");
+    var dropdown = document.getElementById("fieldrep")
+    var opt1;
+
+    // Examine all items in crew lookup table
+    for(i = tbl.options.length - 1 ; i >= 0 ; i--)
+    {
+        var item = tbl.options[i].text;
+        // Extract the call num from the lookup table item
+        var currentCallnum = item.substring(0,2);
+        // if the supervisor's call num matches crew call num 
+        var superCallnum = supervisor.substring(0,2)
+        if (currentCallnum.startsWith(superCallnum))
+        {
+            // Add an option to the fieldrep combo box
+            opt1 = document.createElement('option');
+            opt1.text = opt1.value = item;
+            dropdown.add(opt1,0);
+        }
+    }
+    // Add an empty option to the select box
+    opt1 = document.createElement('option');
+    opt1.text = opt1.value = '';
+    dropdown.add(opt1,0);
+    // Show the first (empty) option
+    dropdown.selectedIndex = "0";
 }
 </script>
