<script>
function fLoginFormSubmit()
{
var fm = window.document.login163;
var user = fm.username;
user.value = fTrim( user.value); //Trim the input value. if( user.value =="") {
window.alert("\请输入您的用户名 ?");
user.focus();
event.returnValue = false;
return false;
} if( fm.password.value.length =="") {
window.alert("\请输入您的密码 ?");
fm.password.focus();
event.returnValue = false;
return false;
} var ati = user.value.indexOf( "@"); 
if( ati != -1 ){
user.value = user.value.substring(0, ati);
}
var secure = fm.remUser.checked?true:false;
var url = "http://reg.163.com/in.jsp?url=http://mimg.163.com/oy_vip.htm?"; if( secure){
url += "verifycookie%3D1%26";
user.autocomplete="on";
}else{
user.autocomplete="off";
}
fm.action = url + "language%3D-1%26style%3D" + fm.style.value;
visitordata.setVals( [fm.username.value,fm.style.value,fm.secure.checked?1:0 ], fm.remUser.checked?true:false );
visitordata.store();
return true;
}
function Cookie( document, name, domain )
{
this.$document = document;
this.$name = name;
this.$expiration = new Date(2099,12,31);
this.$domain = domain;
this.data = null;
}
Cookie.prototype.store = function()
{
var cookieval = "";
if( this.data != null)
{
for( var i=0; i<this.data.length;i++)
{
cookieval += this.data[i].join(":") + "&";
}
}
if( cookieval != "" && cookieval.charAt( cookieval.length-1) == "&" )
cookieval = cookieval.substring( 0,cookieval.length-1);
var cookie = this.$name + "=" + cookieval + ";expires=" + this.$expiration.toGMTString() + ";domain=" + this.$domain;
window.document.cookie = cookie;
}
Cookie.prototype.load = function()
{
var allcookies = this.$document.cookie;
if( allcookies == "") return false;
var start = allcookies.indexOf( this.$name + "=" );
if( start == -1) return false;
start += this.$name.length +1;
var end = allcookies.indexOf( ";", start );
if( end == -1) end = allcookies.length;
var cookieval= allcookies.substring( start, end );
var a = cookieval.split("&");
for( var i=0;i<a.length; i++)
a[i] = a[i].split(':');
//用户名:风格:安全
this.data = a;
return true;
}
Cookie.prototype.setVals = function( a, flag )
{
if( this.data == null)
{
if( flag )
{
this.data = [];
this.data[0] = a;
}
}
else
{
this.data[0][0] = a[0];
if( flag)
return;
else
this.data = null;
}
}
function fInitUserName()
{
var fm = window.document.login163;
var name = "";
if( visitordata.data != null)
{
name = visitordata.data[0][0];
fm.remUser.checked = true;
fm.username.autocomplete="on";
//fm.secure.checked = (visitordata.data[0][3]==1);
}else{
fm.username.autocomplete="off";
}
fm.username.focus();
if( name != ""){
fm.username.focus();
fm.username.value = name;
}
}
function fTrim(str)
{
return str.replace(/(^\s*)|(\s*$)/g, ""); 
}
var visitordata = new Cookie( document, "nts_mail_user", document.domain);
visitordata.load();
</script>
<form id="login163" method="post" name="login163" action="" onsubmit="return fLoginFormSubmit();" target="_top">
<input  name="verifycookie" type="hidden" value="1" />
<input  name="style" type="hidden" value="-1" />       
<ul id="it_type">
<li>
用户名:<input id="username" name="username" type="text" class="t_input"  />
</li>
<li>
密 &nbsp;码:<input name="password" type="password" class="t_input" id="password"   />
</li>
<li class="cet"><input type="checkbox" name="remUser" />记住用户名 <input type="checkbox" name="secure" checked="checked" />增强安全性</li>
<li class="cet">
  <input id="log_bnt" name="login" type="submit" value="登&nbsp;录"  alt="登陆" class="input_btn wt" />
</li>
</ul>
</form>