﻿function ToSubmit(){
    var sCode = document.getElementById('TxtCode').value;
    if (sCode == ''){
        alert('验证码不能为空！');
        return;
    }
    var sName = document.getElementById('TxtUid').value;
    if (sName == ''){
        alert('登录用户不能为空');
        return;
    }
    document.forms[0].submit();
}
function getCookie(str){
    var tmp,reg=new RegExp("(^| )"+str+"=([^;]*)(;|$)","gi");
    if(tmp=reg.exec(document.cookie))return(tmp[2]);
    return '';
}
function EnterSubmit(sNextObj){
	if (window.event.keyCode != 13)
	    return;
    if (sNextObj==''){
        ToSubmit();
    }else{
        document.getElementById(sNextObj).focus();
    }
}
function GetLastLoginUser(){
    var sNameVal = document.getElementById('TxtUid').value;
    if (sNameVal==''|| sNameVal == null) {
        sNameVal = getCookie('PMB2B_LASTLOGINUSER');        
	}
	if (sNameVal=='' || sNameVal == null){
	    sNameVal = getCookie('PMB2B_USER');		
	}
	document.getElementById('TxtUid').value = sNameVal;
}
GetLastLoginUser();
