
w('<div id="loginArea">');

w('<table width="100%" align="center" border="0" cellpadding="2" cellspacing="0" id="tblLogined"style="display:none;">');
w(' <tr>');
w('  <td>');
w('   您好，<a href="/userCenter.asp"><font color="red" id="loginedUserName"></font></a>');
w('   <span><a href="/userCenter.asp" target="_top">会员管理中心</a></span>');
w('   <!-- <span><a href="/charge.asp" target="_top">充值</a></span> -->');
w('   <span><a href="/login.asp?action=logout" target="_self">退出</a></span>');
w('  </td>');
w(' </tr>');
w('</table>');
w('<table width="100%" cellpadding="2" cellspacing="0" border="0" align="left" id="tblLogin">');
w(' <tr>');
w('  <td valign="middle"><span class="title">用户名/邮箱：</span><span><input type="text" name="userName" id="userName" size="14" maxlength="50"/></span></td>');
w('  <td valign="middle"><span class="title">密码：</span><span><input type="password" name="userPass" id="userPass" size="13" maxlength="20"/></span></td>');
w('  <td valign="middle">');
w('   <input type="image" src="/images/login.gif" style="border:none;" id="userLogin" onClick="return chkForm();" />');
w('   <input type="image" src="/images/reg.gif" style="border:none;" onClick="top.location=\'/reg.asp\'" id="userReg" />');
w('  </td>');
w('  <td valign="middle">');
w('   <a href="/forgotPassword.asp" target="_blank">忘记密码?</a>');
w('  </td>');
w(' </tr>');
w('</table>');

function chkForm(){
  var u = $F('userName');
  var p = $F('userPass');
  if(u.length<2){alert('请输入正确的用户名/邮箱!');$c('userName').focus();return false;}
  if(p.length<4){alert('请输入正确的密码!');$c('userPass').focus();return false;}

  var ajax = new Ajax();
  var fnDone = function(xml) {
    if(parseInt(xml.responseText) == 0) {alert('登录失败,请检查您输入的用户名\邮箱\密码等是否正确.');}
    else {$h('tblLogin');$s('tblLogined');$c('loginedUserName').innerHTML=u;}
  }
  ajax.connect("/DealLogin.asp", "GET", "action=login&u="+ escape(u)+"&p="+ p, fnDone);
  ajax=null;
}

$s('tblLogin');$h('tblLogined');
w('</div>');