quick javascript function help
<p>I have this function, and I want to pass a variable (z) to the OnClick event of an image.</p>

<p>I have this:</p>

<pre><code>for (z=1; z&lt;img_src.length; z++){
    path_th_img= 'ad_images/'+category+'/'+'thumbs/'+img_src[z];
    document.getElementById("thumb_pic_div").innerHTML += "&lt;img src='"+path_th_img+"' class='shadow2' style='margin:7px;' onclick='imageShow(z);'&gt;";
      }
</code></pre>

<p>img_src.lengt is in this case 4... So no matter which of the three images I click, the nr 4 gets passed on... ideas?</p>

<p>Thanks</p>
