
 //去掉空字符串
    String.prototype.Trim = function() 
    { 
        return this.replace(/(^\s*)|(\s*$)/g, ""); 
    }  
    //end 去空字符串
    //验证非空
    function checkEmpty(inputValue)
    {
        if(inputValue.Trim()=="")
        {
            return false;
        }
        else
        {
            return true;
        }
    }
    //提交按钮验证非空
    function but_checkEmpty(controlID,alertWord)
    {
        control=document.getElementById(controlID);
        if(!checkEmpty(control.value))
        {
            alert(alertWord);
            control.focus();
            return false;
        }
        else
        {
            return true;
        }
    }
     function validateTop()
     {
        try
        {
            //用户名
            if(!but_checkEmpty("Top1_tb_Username","请填写用户名!"))
            {
                return false;
            }
            //密码
            if(!but_checkEmpty("Top1_tb_Password","请填写登录密码!"))
            {
                return false;
            }
            return true;   
        }
        catch(ex)
        {alert(ex);
            return false;
        }
    }