Random Password Function - Javascript

Script generate random passwords.

function randomPassword(length)
{
chars = 01234568789qwertzuiopasdfghjklyxcvbnmQWERTZUIOPASDFGHJKLYXCVBNM;
pass = '';
for(i=0;i<length;i++)
{
j = Math.floor(Math.random()*64);
pass += chars.charAt(j);
}
return pass;
}