﻿Type.registerNamespace('ActiveBets');
/*******************  ActiveBets.PartnerApp  ***********************/

/*******************  ActiveBets.PartnerApp  ***********************/
ActiveBets.PartnerApp = function() {

    ActiveBets.PartnerApp.initializeBase(this);

    this._user = null;

    this._lockFlag = false;

    ActiveBets.ExtApp = this;
}
ActiveBets.PartnerApp.prototype = {

    _app_onload: function() {
        if (typeof (InitFaq) != "undefined")
            InitFaq();
    },

    get_app: function() {
        return ActiveBets.App;
    },

    // region [ User ]

    get_user: function() {
        if (this._user == null)
            this._user = this.get_app().get_user();
        return this._user;
    },

    update_ui: function() {
        if (this.get_user().is_anonymous())
            return;

        var bal_span = $get("user$balance");
        if (bal_span)
            bal_span.innerHTML = String.localeFormat("{0:C}", this.get_user().get_balance());

        var bets_span = $get("user$bets");
        if (bets_span)
            bets_span.innerHTML = String.localeFormat("{0:C}", this.get_user().get_bets_amount());
    }

    // endregion
}
ActiveBets.PartnerApp.registerClass('ActiveBets.PartnerApp');
