// ************************************* clientSideDescriptor OBJECT *************************************************
// This is an object used to display the texts of descriptors based on their id
// ********************************************************************************************************

//properties

mstrClientSideDescriptorImpl.prototype._Descriptors = new Object();


function mstrClientSideDescriptorImpl() { return this; }

microstrategy.descriptors = new mstrClientSideDescriptorImpl();

mstrClientSideDescriptorImpl.prototype.addDescriptors  = function(idValues){
    //@class=mstrClientSideDescriptorImpl;@method=addDescriptors;
    //Usage: to be called when the page with descriptors just loads.
    try {
		var iv_d = '\x1f';// ascii unit separator
		var group_d = '\x1e';// ascii record separator

		var groups = idValues.split(group_d);
		for(var i=0; i<groups.length-1;i++){
	   		var idV = groups[i].split(iv_d);
			this._Descriptors[idV[0]] = idV[1];
		}
    }
	catch(err){
        microstrategy.errors.log(err);
        return false;
	}
}

mstrClientSideDescriptorImpl.prototype.getDescriptor = function(id){
    //@class=mstrClientSideDescriptorImpl;@method=getDescriptor;
    //Usage: to be called when the text of the descriptor with the id is needed.
    try {
		return (this._Descriptors[id])? this._Descriptors[id] : "Descriptor with id " + id + " not found";
    }
	catch(err){
        microstrategy.errors.log(err);
        return false;
	}
}

