﻿kiln.client.mediastory = function() {
    kiln.client.mediastory.initializeBase(this);

    this._ContentList = null;
    this._CurrentID = null;

};

kiln.client.mediastory.prototype = {

    initialize: function() {
    kiln.client.mediastory.callBaseMethod(this, 'initialize');

        this.WriteContentByte();
    },

    dispose: function() {
        kiln.client.mediastory.callBaseMethod(this, 'dispose');


    },

    WriteContentByte: function() {

        var self = this, convertStr = '',i;

        if (this._ContentList !== null) {
            for (i = 0; i < this._ContentList.length; i++) {
                convertStr = self.bin2String(this._ContentList[i].Code);
                jQuery('#' + this._ContentList[i].ClientID).text(convertStr)
                                                           .attr('href', 'mailto:' + convertStr);
            }
        }
    },

    bin2String: function(array) {
        var result = '',i;
        for (i = 0; i < array.length; i++) {
            result += String.fromCharCode(array[i]);
        }
        return result;
    },

    get_ContentList: function() {
        return this._ContentList;
    },

    set_ContentList: function(value) {
        this._ContentList = value;
    },
    
    get_CurrentID: function() {
        return this._CurrentID;
    },

    set_CurrentID: function(value) {
        this._CurrentID = value;
    }
    
};

kiln.client.mediastory.inheritsFrom(Sys.Component);
kiln.client.mediastory.registerClass('kiln.client.mediastory', Sys.Component);
