Randomizing output in this javascript
<p>I would like to randomize the output of the numbers at the end of this script. 
Right now it creates a list of random image names sorted by number, I would like to have the image names shuffled. </p>

<p>Any suggestions?</p>

<p>I'm new to JS and pulling my hair out over this. </p>

<p>Thanks!</p>

<pre><code>function check(value)
{
if ( value != Math.round(value) || value &lt;= 0 )
     alert("You must enter a positive integer in each input box.");
}

    function randint( l, u )
// Returns an integer uniformly distributed over l..u.
{
    return l + Math.floor( Math.random() * ( u + 1 - l ));
}


function generate( )
{
var select = parseInt(document.form.num.value);
if ( isNaN(select) || select != parseFloat(select) || select &lt;= 0 )
    {
        alert("The number of random numbers desired must be a positive integer.");
        return;
}
var minval = parseInt(document.form.min.value);
if ( isNaN(minval) || minval != parseFloat(minval) || minval &lt;= 0 )
    {
        alert("The minimum value of the range must be a positive integer.");
        return;
}
var maxval = parseInt(document.form.max.value);
if ( isNaN(maxval) || maxval != parseFloat(maxval) || maxval &lt;= 0 )
    {
        alert("The maximum value of the range must be a positive integer.");
        return;
}


    var index = 0;
    var remaining = maxval - minval + 1;

if ( remaining &lt;= select )
{
    alert("The number of values to select must be less than the size of the range from which to select them.");
    return;
}



function pad(number, length) {

var str = '' + number;
while (str.length &lt; length) {
str = '0' + str;
}

 return str;

}

document.form.out.value = "";
 for ( var i = minval; i &lt;= maxval; i++ )
{
     if (Math.random() &lt; ( select / remaining))
    {
        document.form.out.value = document.form.out.value + '/Users/poe/images/physics304/Principle_' + pad(i, 5) + '.jpg' + '\n';

        index++;
        select--;  
        }
        remaining--;
}

}
</code></pre>
