﻿Type.registerNamespace("Res.Commerce.Web.Composants.FicheProduit.V01");
Res.Commerce.Web.Composants.FicheProduit.V01.DescriptifProduit = function (element) {
    Res.Commerce.Web.Composants.FicheProduit.V01.DescriptifProduit.initializeBase(this, [element]);

    this._IdSpanEnSavoirPlus = null;
    this._IdSpanMasquer = null;
    this._IdDivDescription = null;
    this._IsDescriptifDefaultOpenned = null;

};
Res.Commerce.Web.Composants.FicheProduit.V01.DescriptifProduit.prototype = {
    initialize: function () {
        Res.Commerce.Web.Composants.FicheProduit.V01.DescriptifProduit.callBaseMethod(this, "initialize");

        if (!this._IsDescriptifDefaultOpenned) {
            $(this.FormatId('#' + this._IdSpanEnSavoirPlus)).live("click", Function.createDelegate(this, this.clickSpanEnSavoirPlus));
            $(this.FormatId('#' + this._IdSpanMasquer)).live("click", Function.createDelegate(this, this.clickSpanMasquerText));
        }
    },
    dispose: function () {
        if (!this._IsDescriptifDefaultOpenned) {
            $(this.FormatId('#' + this._IdSpanEnSavoirPlus)).die('click');
            $(this.FormatId('#' + this._IdSpanMasquer)).die('click');
        }
        Res.Commerce.Web.Composants.FicheProduit.V01.DescriptifProduit.callBaseMethod(this, "dispose");
    },
    saveClientState: function () {
        return null;
    },
    FormatId: function (selector) {
        return '#' + this._element.id + ' ' + selector;
    },
    clickSpanEnSavoirPlus: function (ev) {
        $(this.FormatId('#' + this._IdDivDescription)).show("slow");
        $(this.FormatId('#' + this._IdDivDescription)).fadeIn("slow");
        $(this.FormatId('#' + this._IdSpanEnSavoirPlus)).css("display", "none");
        return null;
    },

    clickSpanMasquerText: function (ev) {
        $(this.FormatId('#' + this._IdDivDescription)).slideUp();
        $(this.FormatId('#' + this._IdDivDescription)).fadeOut("slow");
        $(this.FormatId('#' + this._IdSpanEnSavoirPlus)).css("display", "inline");
        return null;
    },

    set_IdSpanEnSavoirPlus: function (value) {
        this._IdSpanEnSavoirPlus = value;
    },

    get_IdSpanEnSavoirPlus: function () {
        return this._IdSpanEnSavoirPlus;
    },

    set_IdSpanMasquer: function (value) {
        this._IdSpanMasquer = value;
    },

    get_IdSpanMasquer: function () {
        return this._IdSpanMasquer;
    },

    set_IdDivDescription: function (value) {
        this._IdDivDescription = value;
    },

    get_IdDivDescription: function () {
        return this._IdDivDescription;
    },

    set_IsDescriptifDefaultOpenned: function (value) {
        this._IsDescriptifDefaultOpenned = value;
    },

    get_IsDescriptifDefaultOpenned: function () {
        return this._IsDescriptifDefaultOpenned;
    }

};
Res.Commerce.Web.Composants.FicheProduit.V01.DescriptifProduit.registerClass("Res.Commerce.Web.Composants.FicheProduit.V01.DescriptifProduit", Res.Commerce.Web.Composants.ScriptControlBase);
if (typeof (Sys) !== "undefined") Sys.Application.notifyScriptLoaded(); 
