Making a table consisting of multiple drop down menus
===

 I am currently making a web page in *html* with a series of drop down menus.  The web site is here: http://tc.met.psu.edu/tcgengifs/index2.html

I am using the following code to make the drop-down menus

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript">
           function getUrl() {
                  var part12 = document.getElementById("firstChoice2").value;
                  var part22 = document.getElementById("secondChoice2").value;
                  var part32 = document.getElementById("thirdChoice2").value;
                   return "http://tc.met.psu.edu/tcgengifs/CMC/"+part12+"/"+part22+part32;
    }
          function gotoSelection() {
             var urlToGoTo = getUrl();
             alert(urlToGoTo);
            //location.href=urlToGoTo;
               
          function setupLink() {
          var urlToGoTo = getUrl();
          document.getElementById("gotoLink").href=UrlToGoTo;
              }
     </script>
    </head>
     <body onload="setupLink();">
    <div id=leftcol>
    <select id =firstChoice2 onchange="setupLink();">
        <option value=2012072600>2012072600</option>
        <option value=2012072512>2012072512</option>
    </select>
    </div>
    <body>
    <div id=leftcencol>
    <select id =secondChoice2 onchange="setupLink();">
    <option value=rain>Rainfall</option>
    <option value=slp>Sea Level Pressure</option>
    <option value=850virt>850mb Virtual Temperature</option>
    </select>
    </div>
    <div id=rightcencol>
     <select id =thirdChoice2 onchange="setupLink();">
         <option value=.anim.html>Animation</option>
         <option value=0.png>000hr</option>
         <option value=1.png>006hr</option>
         <option value=2.png>012hr</option>
    </select>
    </div>
    <div id=rightcol>
    <a id="gotoLink" href="">Submit</a>


My problem is that I need to use this code (with modifications) multiple times, but when I do that, the submit button for each series of 3 dropdown menus takes me to the site that the last piece of code is designed to take me to.  How do I separate the code so that the first series of three dropdowns is not influenced by any other series?