I have this page, but it doesn't function exactly as expected (ignore looks--I am not going to post my css--too much work!).

In the form "editMS", the user first selects a media type, which then displays the appropriate div (and select box) that allows them to select the actual media source (which would be a newspaper or radio station). This much works. The user is then supposed to be able to select the actual source, and have the sources current status show up, which they could then edit. This second part does not work, because in the javascript function "getOptionSelected" there is the code "document.editMS.media" (and its used several times). So I have identified the problem (easy enough). What I don't know how to do is fix it (not a javascript programmer). This could all be done rather easily in PHP and page reloads, but I am trying to cut down on server load by using only one load.

If you can help me fix this, I would deeply appreciate it.

Thanks
Code:
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <!-- compliance patch for microsoft browsers -->
    <!--[if lt IE 7]>
    <script src="/ie7/ie7-standard.js" type="text/javascript">
    </script>
    <![endif]--> 
    <title>AdTrack</title>
    <link rel="stylesheet" type="text/css" href="at.css" />
    <script type="text/javascript">
      <!--
      function selectDiv(option, display){
        var the_div = getOptionSelected(option);
        changeDiv(the_div, display);
        }
        
      function changeDiv(the_div, display){
        var the_style = getStyleObject(the_div);
        if (the_style != false){
          the_style.display = display;
          }
        }
        
      function getOptionSelected(opt_group){
        if(document.editMS.media && document.editMS.media){
          return(document.editMS.media.options[document.editMS.media.selectedIndex].value);
          }
        else if (document.all && document.all(opt_group)){
          return(document.editMS.all(opt_group).value);
          }
        else {
          return false;
          }
        }
        
      function hideAll(){
        changeDiv("rstations","none");
        changeDiv("papers","none");
        changeDiv("tvstations","none");
        changeDiv("sites","none");
        } 
        
      function getStyleObject(objectId){
        if (document.getElementById && document.getElementById(objectId)){
          return document.getElementById(objectId).style;
          }
        else if (document.all && document.all(objectId)){
          return document.all(objectId).style;
          }
        else {
          return false;
          }
        }
      // -->
    </script>  
  </head>
  <body>

    <h1>AdTrack</h1>
    <div id="links">
      <a href="index.php">Home</a>
      <a href="cms.php">CMS</a>
      <a href="reports.php">Reports</a>
    </div>
    <div id="c1">

      <h1>Media Sources</h1>
      <div id="c1">
        <h1>Add</h1>
        <form name="addMS" action="cms2.php" method="post">
          <label for="sourcetype">Media Type</label>
          <select name="sourcetype">
            <option value="papers">papers</option><option value="rstations">rstations</option><option value="sites">sites</option><option value="tvstations">tvstations</option>          </select>

          <label for="sourcename">Name</label>
          <input type="text" name="sourcename" />
          <label for="sourcestatus">Status</label>
          <select name="sourcestatus">
            <option value="1">Current</option>
            <option value="2">Past</option>
          </select>

          <br />
          <input type="submit" value="Submit" />
        </form>
      </div>
      <div id="c1">
        <h1>Edit</h1>
        <form name="editMS" action="cms2.php" method="post">
          <label for="media">Media Type</label>

          <select name="media" onchange="hideAll(); selectDiv('media', 'block');">
            <option value="papers">papers</option><option value="rstations">rstations</option><option value="sites">sites</option><option value="tvstations">tvstations</option>          </select>
          <div id="rstations" style="display: none; position: relative;">
            <label for="rstations">Radio Station</label>
            <select name="rstations" tabindex="14" onchange="hideAll(); selectDiv('rstations', 'block');">
                          </select>

                      </div>
          <div id="papers" style="display: none; position: relative;">
            <label for="papers">Paper</label>
            <select name="papers" tabindex="15" onchange="hideAll(); selectDiv('papers', 'block');">
              <option value="1">Seneca Daily Journal</option><option value="2">Anderson Independent Mail</option>            </select>
            <div id="1" style="display: none; position: relative;"><label for="status">Status</label><input type="text" value="1" name="status" /></div><div id="2" style="display: none; position: relative;"><label for="status">Status</label><input type="text" value="1" name="status" /></div>          </div>

          <div id="tvstations" style="display: none; position: relative;">
            <label for="tvstations">TV Station</label>
            <select name="tvstations" tabindex="16" onchange="hideAll(); selectDiv('tvstations', 'block');">
                          </select>
          </div>
          <div id="sites" style="display: none; position: relative;">
            <label for="sites">Web Site</label>
            <select name="sites" tabindex="17" onchange="hideAll(); selectDiv('sites', 'block');">

                          </select>
          </div>
        </form>
      </div>
      
    </div>
    <div id="c1">
      <h1>Promotions</h1>
      <div id="c1">

        <h1>Add</h1>
        <form name="addPromo" action="cms2.php" method="post">
          <label for="promoname">Name</label>
          <input type="text" name="promoname" />
          <label for="promostatus">Status</label>
          <select name="promostatus">
            <option value="1">Current</option>

            <option value="2">Past</option>
          </select>
          <label for="promodetail">Details</label>
          <textarea name="promodetail">
          </textarea>
          <br />
          <input type="submit" value="Submit" />
        </form>

      </div>
      <div id="c1">
        <h1>Edit</h1>
      </div>
    </div>
    
  </body>
</html>