﻿function Authority() {
    this.ID = 0;
    this.Account = "";
    this.Name = "";
    this.AccountCategory = 1;
    this.AccountCategoryName = "";
    this.Title = 1;
    this.TitleCode = 1;
    this.StoreCode = "";
    this.StroeName = "";
    this.AdminCity = "";

    this.Init = function() {
        var myolay = new CyberSysCookie();
        var myolayValue = unescape(myolay.GetCookie("myolaym"));
        if (myolayValue != "null") {
            var myolayArgs = myolayValue.split("|");
            this.ID = myolayArgs[0];
            this.Account = myolayArgs[1];
            this.Name = myolayArgs[2];
            this.AccountCategory = myolayArgs[3];
            this.TitleCode = myolayArgs[4];
            this.StoreCode = myolayArgs[5];
            this.StroeName = myolayArgs[6];
            this.AdminCity = myolayArgs[7];
            this.AccountCategoryName = this.AccountCategoryName(this.AccountCategory);
            this.Title = this.SetTitle(this.TitleCode);
            return true;
        }
        else {
            return false;
        }
    }

    this.SetTitle = function(flag) {
        var str = "女士";
        if (flag == "1") {
            str = "先生";
        }
        return str;
    }

    this.AccountCategoryName = function(flag) {
        var str = "个人会员";
        if (flag == "2") {
            str = "大客户会员";
        }
        return str;
    }
}