Strange javascript function parameter value
<p>I have the following javascript function:</p>

<pre><code>function changeSelectedCustomerNumber(CustNumber){
    var field = document.getElementById('SelectedNumber');
    field.value = '00'+CustNumber;
}
</code></pre>

<p>Which is called by pressing the following option:</p>

<pre><code>&lt;select style="width:100px;" name="bySubj"&gt;
    &lt;option onclick="changeSelectedCustomerNumber(00510443);"&gt;blatest&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>I have serveral of those checkboxes. what they should do is put the passed number in a seperate input field.</p>

<p>My Problem is, that when debugging the js function, after a click in the option, 
<code>custnumber</code> contains <code>166263</code>.</p>

<p>I assumed that the cast to num would remove the leading zeros, but how could the parameter be converted like this.</p>

<p>Is there any reason why javascript should do something like this?</p>
