What's wrong with this js function?
<p>i am rather new to Javascript and i am having trouble making a function to generate a random password. The function gets called when i click a button. The empty and MD5 functions are included in a differant file.</p>

<pre><code>function genPass(id) {
        if(!empty(id)) {
            var n = Math.ceil(Math.random()*(5*Math.random()));
            n = n.substring(0,7);
            //document.getElementById(id).value = n;
            document.write(n);
        }
    }
</code></pre>
