Multiple rows - same javascript function - how do I update elements within a rows
===

This is script and html I have so far. I am trying to update "Part, SKU and Name from a javascript array based on selected OID from dropdown. I will eventually have multiple html rows - example has two. I am new to javascript and have been working on this for two days. :)

    <script language="javascript"> 
    <!--
    var Component=new Array(3);

    //define objects for the dependent list
    function ListSubItem    (productid,optionvalueid,optionvaluesku,optionvaluenumber,optionvaluename){
    //function for defining the elements of the Components
      this.productid=productid;
      this.optionvalueid=optionvalueid;
      this.optionvaluesku=optionvaluesku;
      this.optionvaluenumber=optionvaluenumber;
      this.optionvaluename=optionvaluename;
    }
 
    function PrepareData(){
    //Fill the values of the option value list
 
    Component[0]=new ListSubItem(9137,45983,"","","No Thanks");
    Component[1]=new ListSubItem(9137,45984,"","509-SINGOG-10-BO","Black Ops Polarized");
    Component[2]=new ListSubItem(9137,45985,"","509-SINGOG-11-WW","White Out Polarized WF");
    Component[3]=new ListSubItem(9137,45986,"","509-SINGOG-11-BW","White Out Polarized BF");
    }
 
    function change_values(OIDarg){
      var OID = "OID" + OIDarg;
      var Part = "Part" + OIDarg;
      var SKU = "SKU" + OIDarg;
      var Name = "Name" + OIDarg;

      var name_element=document.getElementById('OID'); 
      var name_value=name_element.value;

      PrepareData();

      var len=Component.length;
      for (var i=0; i < len;i++){
        if (Component[i].optionvalueid==name_value) {
          selectedid=i;
        }
      } 

      document.LoadImages.Part.value = Component[selectedid].optionvaluenumber;
      document.LoadImages.SKU.value = Component[selectedid].optionvaluesku;
      document.LoadImages.Name.value = Component[selectedid].optionvaluename;
    }
    // -->
    </script>
 
    </head>
    <body >

    <form name="LoadImages" method="post" action="">
    <table>
      <tr>
        <td>Name: <input name="Name" id="Name1" type="text" size="60" maxlength="80"     value="SINISTER Black Ops Polarized (+$75.00)" /></td>
        <td>SKU: <input name="SKU" id="SKU1" type="text" size="20" maxlength="30" value="" /></td>
        <td>Part: <input name="Part" id="Part1" type="text" size="20" maxlength="50" value="509-SINGOG-10-BO" /></td>
        <td>Product ID: <input name="PID" id="PID1" type="text" size="5" maxlength="8" value="9137" /></td>
        <td>Option ID: 
          <select name="OID" id="OID1" size="1" onChange="change_values(1)">
            <option value="45983">No Thanks</option>
            <option value="45984" selected="selected">Black Ops Polarized</option>
            <option value="45985">White Out Polarized WF</option>
            <option value="45986">White Out Polarized BF</option>
          </select>
        </td>
      </tr>
      <tr>
        <td>Name: <input name="Name" id="Name2" type="text" size="60" maxlength="80" value="SINISTER White Out Polarized WF (+$75.00)" /></td>
        <td>SKU: <input name="SKU" id="SKU2" type="text" size="20" maxlength="30" value="" /></td>
        <td>Part: <input name="Part" id="Part2" type="text" size="20" maxlength="50" value="509-SINGOG-11-WW" /></td>
        <td>Product ID: <input name="PID" id="PID2" type="text" size="5" maxlength="8" value="9137" /></td>
        <td>Option ID: 
          <select name="OID" id="OID1" size="1" onChange="change_values(2)">
            <option value="45983">No Thanks</option>
            <option value="45984">Black Ops Polarized</option>
            <option value="45985" selected="selected">White Out Polarized WF</option>
            <option value="45986">White Out Polarized BF</option>
          </select>
        </td>
      </tr>
    </table>
    </body>
    </html>
