title: Javascript Button SRC
body: <p>i need some help on <strong>JavaScript img src</strong> and <strong>click event.</strong></p>
  
  <p>Lets say i have a 2 images of button, p<strong>ressed and unpressed.</strong></p>
  
  <pre><code>btn1_On = new Image();
  btn1_On.src = "../img/numpad/03_Button_1_Push.jpg";
  
  btn1_Off = new Image();
  btn1_Off.src = "../img/numpad/03_Button_1_No_Push.jpg";
  </code></pre>
  
  <p><strong>and html:</strong></p>
  
  <pre><code>&lt;div class="Numpad_1" onmousedown="btnPress('btn1');return true;"
      onmouseup="btnRelease('btn1');return true;"
      onclick="btnPress('btn1');return true;"&gt;
      &lt;img src="..\img\numpad\03_Button_1_No_Push.jpg" id="btn1" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>i don`t want to multiply function for each button in <strong>html</strong>, so i create function to <strong>press btn</strong> and <strong>release</strong>:</p>
  
  <pre><code>function btnPress(btn) {
      document.getElementById(btn).src = btn+'_On'.src;
  }
  
  function btnRelease(btn) {
      document.getElementById(btn).src = btn + '_Off.src';
  }
  </code></pre>
  
  <p>so, a problem is, btn+'_On'.src - cant init the path of
  image(undefined).</p>
  
  <p>Thnx for any HELP.</p>
  
  <p><strong>P.S: I have some limitation , it must run on IE 6</strong></p>