title: dojo.connect is not working inside a loop. It only keeps the last time I did it
body: <p>Hi here is my function </p>
  
  <pre><code>function connectAccordionTabbing() {
      for(var i = 0; i &lt; coverageStates.length;i=i+3){
          var jsState = coverageStates[i]+coverageStates[i+1];
          var firstNode = dijit.getFirstInTabbingOrder(document.getElementById('liabCovBlock_'+jsState));
          var lastNode  = dijit.getLastInTabbingOrder(document.getElementById('liabCovBlock_'+jsState));
          dojo.connect(firstNode, "onkeypress", function(evt) {
              setTimeout(function() {
                  setAccordionTabOffFields(evt,jsState, true);
              }, 10); 
          });
          dojo.connect(lastNode, "onkeypress", function(evt) {
              setTimeout(function() {
                  setAccordionTabOffFields(evt,jsState, false);
              }, 10); 
          });
      }
  }
  </code></pre>
  
  <p>It loops through and goes through each state and makes the first and last nodes inside a block have connections during the page load.  The problem I am having is that when I am on one of those nodes and press a key it calls <code>setAccordionTabOffFields</code> but it thinks my state is the last state even if I was on the third state.  It does that in Chrome and IE but in firefox it does not even call the setAccordionTabOffFields.</p>
  
  <p>Any ideas what I may be doing wrong?</p>
  
  <p>Thanks</p>