/**
 *	Default ux functions
 */
 
Ext.ns ("Ext.ux");

/**
 *	This function unites two sets of config options
 *	It only applies the config option from the second parameter
 *	If it doesn't exist in the first parameter
 *	object1 {object} The object with the base values
 *	object2 {object} The object with the values to copy
 *	returns {object} The united object
 */
Ext.ux.uniteIf = function (o, c)
{
	var r = Array();
	if (o)
	{
		for (var p in c)
		{
			if (!Ext.isDefined (o[p]))
			{
				r[p] = c[p];
			}
		}
		for (p in o)
		{
			if (!Ext.isDefined (r[p]))
			{
				r[p] = o[p];
			}
		}
	}
	return r;
}

Ext.ux.getColumnIndices = function (cm) {	
	var columnIndices = Array ();
	for (var i = 0; i < cm.getColumnCount() - 1; i++)
	{
		columnIndices.push (cm.getColumnAt(i).dataIndex);
	}
	return columnIndices;
}

Ext.ux.IFrameComponent = Ext.extend(Ext.BoxComponent, {
     onRender : function(ct, position){
		this.el = ct.createChild({tag: 'iframe', id: 'iframe-'+ this.id, style: 'overflow: auto;', frameBorder: 0, src: this.url, scrolling: 'yes' });
     },
	 setUrl : function (newUrl)
	 {
		document.getElementById ('iframe-' + this.id).src = newUrl;
	 }
});
Ext.reg ('iframe', Ext.ux.IFrameComponent);
