var rType = '';
var nmobile ='';
        var Cash=0;
        var paymodel = '';
        var issend = 0;

        $(document).ready(function() {
            GetLoginInfor();
        });
        this.check = function(type,payload)
        {
            rType = type;
            paymodel= payload;
            switch(rType)
            {
                case "AliPay":
                    $("#umpay").hide();
                    $("#19pay").hide();
                    $("#alipy").show();
                    break;
                case "19pay":
                    $("#alipy").hide();
                    $("#umpay").hide();
                    $("#19pay").show();
                    break;
                case "umpay":
                    $("#alipy").hide();
                    $("#19pay").hide();
                    $("#umpay").show();
                    break;
            }
            $("input[name='amount']:checked").removeAttr("checked");
            
        }
        this.Send = function()
        {
            if(rType == '')
            {
                alert('请选择支付方式');
                return;
            }
            if(rType == 'umpay')
            {
                nmobile = $("#usermobile").val();
                if(nmobile == '')
                {
                    alert('请填写手机号');
                    return;
                }
            }
            if($("input[name='amount']:checked").size() > 0)
            {
                Cash = $("input[name='amount']:checked").val();
            }
            if(Cash > 0)
            {
                if(paymodel=='BC')
                {
                    rType='19pay';
                }
                location.href = "../"+rType+"/send.aspx?cash="+Cash+"&type="+paymodel+"&m="+nmobile;
            } 
            else
            {
                alert('请选择支付金额');
            }
        }
        this.GetLoginInfor = function()
        {
            Request.sendPOST("../AjaxLogin.aspx", "d="+new Date+"&n=4",
            this.bind(this, this.ReturnInfor), null, null); 
        }
        this.ReturnInfor = function(req)//载入页面输出登录信息
        {
            if(req.responseText == "")
            {
                $("#loginin").show();
                return;
            }
            $("#LoginArea").show();
            $("#LoginArea").html(req.responseText);
        }
        //解决回调函数中，this引用无效的问题
        this.bind = function(instance, method)
        {
            return function()
            {
	            method.apply(instance, arguments);
            }
        }
        this.UserLogin = function()
        {
            
            if($("#txbUserName").val() == "")
            {
                $("#mes").html('请填写用户名');
                return;
            }
            if($("#txbPwd").val() == "")
            {
                $("#mes").html('请填写密码');
                return;
            }
            if(issend == 1)
            {
                $("#mes").html('登录中…请稍候…');
                return;
            }
            issend=1;
            Request.sendPOST("../AjaxLogin.aspx", "d="+new Date+"&n=3&un="+escape($("#txbUserName").val())+"&pw="+escape($("#txbPwd").val()),
            this.bind(this, this.ReturnSend), null, null); 
        }
        this.ReturnSend = function(req)//回调函数
        {
            issend = 0;
            if(req.responseText == "")
            {
                $("#mes").html('用户名密码有误');
                return;
            }
            $("#loginin").hide();
            $("#LoginArea").show();
            $("#LoginArea").html(req.responseText);
        }