title: Setting mouseover within a script
body: <p>The script I have been working on for a star rating system, saves the filled in stars with an onClick event and changes the onmouseover &amp; onmouseout values to null so moving the mouse off them afterwards won't mess that up, and the form has multiple ratings and a clear button at the bottom, which i need to have reset the onmouseover &amp; onmouseout events, through the function below, but within those, <strong>ratings[y]</strong> and <strong>x</strong> are taken to be literal rather than what they contain, and makes the onmouse events fail because the parameters are incorrect. How do I put in the variables when changing the events this way?</p>
  
  <pre><code>     var ratings = new Array("happy", "clean");
    for(y = 0; y &lt; 2; y++)
    {
     for(x = 0; x &lt; 5; x++)
     {
      fullname =  ratings[y] + '_' + x;
      document.getElementById(fullname).onmouseover = function onmouseover() { star_rate(ratings[y], x, 1); };
      document.getElementById(fullname).onmouseout = function onmouseover() { star_rate(ratings[y], x, 2); };
     }
    }
  </code></pre>