﻿Type.registerNamespace("Res.Commerce.Web.Composants.FicheProduit.V01");
Res.Commerce.Web.Composants.FicheProduit.V01.Finaref = function (element) {
    Res.Commerce.Web.Composants.FicheProduit.V01.Finaref.initializeBase(this, [element]);
};
Res.Commerce.Web.Composants.FicheProduit.V01.Finaref.prototype = {
    initialize: function () {
        Res.Commerce.Web.Composants.FicheProduit.V01.Finaref.callBaseMethod(this, "initialize");
    },
    dispose: function () {
        Res.Commerce.Web.Composants.FicheProduit.V01.Finaref.callBaseMethod(this, "dispose");
    },
    saveClientState: function () {
        return null;
    },
    dataBind: function () {
        Res.Commerce.Web.Composants.FicheProduit.V01.Finaref.callBaseMethod(this, "dataBind");
    },
    FormatId: function (selector) {
        return '#' + this._element.id + ' ' + selector;
    },
    SetInfoFinaref: function (finaref) {
        if (finaref == null) {
            $('#' + this._element.id).css('display', 'none');
            return;
        }
        if (finaref.Libelle == null)
            return;
        $('#' + this._element.id).css('display', 'inline');

        var pmens = $(this.FormatId('p.memo_fp_mensualite'));
        var ptaeg = $(this.FormatId('p.memo_fp_taeg'));

        if (pmens != null && ptaeg != null) {
            pmens.html(finaref.Libelle.LibelleFractionnementDuree);
            ptaeg.html(finaref.Libelle.LibelleTaeg)
        }
    }
};
Res.Commerce.Web.Composants.FicheProduit.V01.Finaref.registerClass("Res.Commerce.Web.Composants.FicheProduit.V01.Finaref", Res.Commerce.Web.Composants.ScriptControlBase);
if (typeof (Sys) !== "undefined") Sys.Application.notifyScriptLoaded(); 

