|
放到</head>前部份:
<SCRIPT LANGUAGE=javascript>
<!--
if (top.location !== self.location) {
top.location=self.location;
}
function window_onload() {
var S = document.getElementById("usernameshow");
S.focus();
}
function gook() {
var S;
S = document.getElementById("usernameshow");
if (S.value == "")
{
alert("用户名不可为空");
S.focus();
return ;
}
S = document.getElementById("pwshow");
if (S.value == "")
{
alert("密码不可为空");
S.focus();
return ;
}
S = document.getElementById("usernameshow");
document.f1.username.value = S.value;
S = document.getElementById("pwshow");
document.f1.pwhidden.value = encode(S.value, parseInt(document.f1.picnum.value));
document.f1.submit();
}
function encode(datastr, bassnum) {
var tempstr;
var tchar;
var newdata = "";
for (var i = 0; i < datastr.length; i++)
{
tchar = 65535 + bassnum - datastr.charCodeAt(i);
tchar = tchar.toString();
while(tchar.length < 5)
{
tchar = "0" + tchar;
}
newdata = newdata + tchar;
}
return newdata;
}
//-->
</SCRIPT>
[ 本帖最后由 ycwmw 于 2007-3-18 08:46 编辑 ] |
|