home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cricao de Sites - 650 Layouts Prontos
/
WebMasters.iso
/
Servidores
/
JanaSetup.exe
/
admin
/
seiten_js
/
pw_create.js
< prev
next >
Wrap
Text File
|
2006-05-08
|
2KB
|
125 lines
document.title = txt[74][0];
/**/
function selec()
{
var query = self.location.search.substring(1, self.location.search.length);
var optio = query.split('&');
if ((isNaN(optio[1]) == true) || (optio[1] < 4) || (optio[1] > 20))
optio[1] = 4;
for (i = optio[1]; i <= 20; i++)
{
if (i < 10)
document.write('<option value="' + i + '"> ' + i + ' </option>');
else
document.write('<option value="' + i + '"> ' + i + ' </option>');
}
}
/**/
var gopw = 0;
function start()
{
gopw = 1;
go();
}
/**/
function stop()
{
gopw = 0;
setTimeout('uebergabe();', 200);
}
/**/
function go()
{
document.passwd.ausgabe.value = erstellen();
if (gopw == 1)
setTimeout('go();', 50);
}
/**/
function erstellen()
{
var pwaus = '';
var plen = '';
var tmp = '';
var satz = 3;
var anza = document.passwd.anzahl;
var pwcode = new Array('abcdefghijklmnopqrstuvwxyz', '1234567890', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
var parts = Math.round(anza.value / 2) + 1;
for (p = 0; p < parts; p++)
{
if (!p && !plen)
plen++;
plen = rand(anza.value / (parts + 1)) + 1;
if ((p == parts - 1) && (plen < anza.value - pwaus.length) || (plen > anza.value - pwaus.length))
plen = anza.value - pwaus.length;
while (plen)
{
plen--;
pwaus = pwaus + pwcode[p % satz].charAt(rand(pwcode[p % satz].length));
}
}
for (i = 0; i < pwaus.length; i++)
tmp = tmp + pwaus.charAt(i);
pwaus = tmp;
return substring(pwaus, 0, anza.value);
}
/**/
function rand(za)
{
return Math.round(Math.random() * za);
}
/**/
function substring(inp, offs, len)
{
var ausgabe = '';
for (i = offs; i < (offs + len); i++)
ausgabe = ausgabe + inp.charAt(i);
return ausgabe;
}
/**/
function uebergabe()
{
var query = self.location.search.substring(1, self.location.search.length);
var feld = query.split('&');
var passfeld = opener.document.formular.elements[feld[0]];
var pwd = document.passwd.ausgabe.value;
if (document.passwd.ausgabe.value != '')
{
passfeld.value = '';
passfeld.value = pwd;
}
else
{
alert(txt[74][1] + '!');
document.passwd.anzahl.focus();
}
}