/*!
 * Ext JS Library 3.0.0
 * Copyright(c) 2006-2009 Ext JS, LLC
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
var MX_DESCRIPTION_PROMO = Ext.extend(Ext.util.Observable, {
    constructor: function(config){
        this.addEvents('finished'); // specify the events we're going to fire
        MX_DESCRIPTION_PROMO.constructor.call(this, config);
    },
    
    create: function(pid, uid, i, value){	
		
		var jsonData = Ext.util.JSON.decode(value.substring(3,value.length-3));
		jsonData.desc = jsonData.desc.length > 0 ? jsonData.desc : '&nbsp;';
		
		this.panel = new Ext.Panel({ 
			id: 'mt_promo_block_mx_description-'+uid+'-'+i,
			cls: 'mt_promo_block_mx_description',
			hideLabel: true,
			autoWidth: true,
			layout:'form',
			width:'auto',
			//html: '<div cls="mt_results_mx_description_field">'+Ext.util.Format.htmlDecode(value)+"</div>"
			html: '<div class="mt_promo_block_mx_description_field mt_promo_block_field">'+
						'<a href="http://'+window.location.hostname+'/index.php?id='+jsonData.spid+'&idObject='+jsonData.oid+'">'+
							mobiHtmlDecode(jsonData.desc)+
						'</a>'+
					"</div>"
		});
		
		this.fireEvent('finished', this.panel);
    }
});
