<%option explicit%>
<!--#include file="inc_const.asp"-->
<%dim bg,fg,af,roomid,at
bg=request("bg")
if bg="" then bg="#b0d8ff"
fg=request("fg")
if fg="" then fg="#224466"
af=request("af")
if af="" then af="red"
roomid=request("roomid")
if roomid="" then roomid=1
at="http://"&request.SERVERVARIABLES("SERVER_NAME")&":"&request.SERVERVARIABLES("SERVER_PORT")&request.SERVERVARIABLES("URL")
at=replace(at,"chatdoor.asp","")
%>
function CheckValid() {
if (document.frmLogin.sUserName.value == "") {
alert("请输入名字。");
document.frmLogin.sUserName.focus();
return false;
}
if (document.frmLogin.sPass.value == "") {
alert("请输入密码。");
document.frmLogin.sUserName.focus();
return false;
}
if (document.frmLogin.sPass.value.length < 3 ) {
alert("密码不能少于3个字符,最大15个字符,不能使用汉字。");
document.frmLogin.sUserName.focus();
return false;
}
if (document.frmLogin.sUserName.value == document.frmLogin.sPass.value) {
alert( "姓名与密码相同。");
document.frmLogin.sPass.focus();
return false;
}
return true;
}
function suicide(){var p=false;
if (CheckValid()) p=confirm("你真的决定自杀了吗？");
if (p) window.open("<%=at%>suicide.asp?username="+document.frmLogin.sUserName.value+"&spass="+document.frmLogin.sPass.value,"_self");
}
function findpass(){
if (document.frmLogin.sUserName.value=="") {
alert("请输入用户名。");document.frmLogin.sUserName.focus();}
else window.open("<%=at%>findpass.asp?username="+document.frmLogin.sUserName.value,"_self");
}
function launchchat(){if (CheckValid()) {
document.frmLogin.enter.disabled=1;
setTimeout('document.frmLogin.enter.disabled=0',10000)
var ffcssbchat = window.open("","<%=Application(ConstStr & "_user")%>","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
ffcssbchat.moveTo(0,0);
ffcssbchat.resizeTo(screen.availWidth,screen.availHeight);
ffcssbchat.outerWidth = screen.availWidth;
ffcssbchat.outerHeight = screen.availHeight;
return true;}
return false;
}
var bodystr="<table align='center' border='0' cellpadding='3' cellspacing='0' style='color:<%=fg%>;font-size:10pt;background-color:<%=bg%>;' width=20>" +
"<form name=frmLogin method=POST action='<%=at%>check.asp' onSubmit='return launchchat()' target='<%=Application(ConstStr & "_user")%>'><input type='hidden' value='<%=roomid%>' name=room_id>" +
"<tr><td align='left' nowrap>名字: <td>" +
"<input style=\"color:224466;border:'1px solid navy'\" type='text' name='sUserName' maxlength='10' size='10'></td></tr> "+
"<tr><td align='left' nowrap>密码:<td> " +
"<input style=\"color:224466;border:'1px solid navy'\" type='password' name='sPass' maxlength='20' size='10'></td>"+
"<tr><td align='left' nowrap>性别: <td>"+
"<input type='radio' name='bSex' value='0' checked>男"+
"<input type='radio' name='bSex' value='1'>女"+
"<tr><td colspan=2 align='center' nowrap styl='font-size:9pt;'>"+
"<input style=\"color:<%=fg%>;font-size:9pt;border:'1px solid navy';;background-color:<%=bg%>\"  type='submit' value='进入' name='enter' >&nbsp;"+
" &nbsp;<input style=\"color:<%=fg%>;font-size:9pt;border:'1px solid navy';background-color:<%=bg%>\" type='reset' value='重写' name='B2'></td></tr>"+
"<tr><td colspan=2 align='center' nowrap>|<a style='color:<%=af%>' href='javascript:suicide()'>自杀</a>|<a style='color:<%=af%>' href='javascript:findpass()'>忘记密码</a>|</table>";
document.write(bodystr);