ip2.declare("IP2.widgets.UrlPreview", {
	xtype: "container",
	closable: false,
	layout: "fit",
	onInitialize: function(i_owner, o_config) {

		var i_self = this;
		var i_record = o_config.record;
		var n_id = i_record.get(i_record.idProperty);
		var s_language = ip2.session.getLanguage();
		var s_url = o_config.embeded || o_config.url;
		var b_override = o_config.override || false;

		if (o_config.key) {
			n_id = i_record.get(o_config.key);
		}

		if (!b_override) {

			if (o_config.multilanguage) {
				s_url = s_url.replace("{1}", s_language);
			}
			else {
				s_url = s_url.replace("{1}/", "");
			}

			s_url = s_url.replace("{0}", o_config.http_host);
		}

		s_url = s_url.replace("{2}", n_id);

		var i_container;

		if (s_url) {
			i_container = Ext.widget("webcontainer", {
				src: s_url,
				layout: "fit"
			});
		}

		else {
			i_container = Ext.widget("container", {
				html: "No data",
				layout: "fit"
			});
		}

		i_owner.add(i_container);
	}
});
