/*!
 * Ext JS Library 3.0.0
 * Copyright(c) 2006-2009 Ext JS, LLC
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
var MX_IMAGE_PROMO = Ext.extend(Ext.util.Observable, {
    constructor: function(config){
        this.addEvents('finished'); // specify the events we're going to fire
        MX_IMAGE_PROMO.constructor.call(this, config);
    },
    
    create: function(pid, uid, i, value){
		// var v = value.split('|||',3);
		var jsonData = Ext.util.JSON.decode(value.substring(3,value.length-3));

		this.panel = new Ext.Panel({ 
			id: 'mt_promo_block_mx_image-'+uid+'-'+i,
			cls: 'mt_promo_block_mx_image',
			html: '<a href="http://'+window.location.hostname+'/index.php?id='+jsonData.spid+'&idObject='+jsonData.oid+'">'+
					'<img src="http://'+window.location.hostname+'/'+jsonData.url+'" title="'+jsonData.title+'">'+
					'</a>'
		});
		
		this.fireEvent('finished', this.panel);
    }
});
