// prelevato e spiegato su http://www.web-link.it
// Begin
function generate(form) {

var selectionarray=new Array(62)
selectionarray[1]="A";
selectionarray[2]="B";
selectionarray[3]="C";
selectionarray[4]="D";
selectionarray[5]="E";
selectionarray[6]="F";
selectionarray[7]="G";
selectionarray[8]="H";
selectionarray[9]="I";
selectionarray[10]="J";
selectionarray[11]="K";
selectionarray[12]="L";
selectionarray[13]="M";
selectionarray[14]="N";
selectionarray[15]="O";
selectionarray[16]="P";
selectionarray[17]="Q";
selectionarray[18]="R";
selectionarray[19]="S";
selectionarray[20]="T";
selectionarray[21]="U";
selectionarray[22]="V";
selectionarray[23]="W";
selectionarray[24]="X";
selectionarray[25]="Y";
selectionarray[26]="Z";
selectionarray[27]="0";
selectionarray[28]="1";
selectionarray[29]="2";
selectionarray[30]="3";
selectionarray[31]="4";
selectionarray[32]="5";
selectionarray[33]="6";
selectionarray[34]="7";
selectionarray[35]="8";
selectionarray[36]="9";
selectionarray[37]="a";
selectionarray[38]="b";
selectionarray[39]="c";
selectionarray[40]="d";
selectionarray[41]="e";
selectionarray[42]="f";
selectionarray[43]="g";
selectionarray[44]="h";
selectionarray[45]="i";
selectionarray[46]="j";
selectionarray[47]="k";
selectionarray[48]="l";
selectionarray[49]="m";
selectionarray[50]="n";
selectionarray[51]="o";
selectionarray[52]="p";
selectionarray[53]="q";
selectionarray[54]="r";
selectionarray[55]="s";
selectionarray[56]="t";
selectionarray[57]="u";
selectionarray[58]="v";
selectionarray[59]="w";
selectionarray[60]="x";
selectionarray[61]="y";
selectionarray[62]="z";

var length=62;

var lngth=form.length.value;
var i,j;
var tmpstr;
tmpstr="";
i=0;
do {
{
var randscript = -1
while (randscript < 1 || randscript > length || isNaN(randscript))
{randscript = parseInt(Math.random()*(length))}
j=randscript}
tmpstr=tmpstr+selectionarray[j]
i=i+1}
while (i<lngth)
form.randomcode.value = tmpstr;
}

