﻿Type.registerNamespace("Infragistics.Web.UI");


/******************************************ObjectBase ENUM************************************/
$IG.ObjectBaseProps = new function()
{
    this.Count = 0;
};
/******************************************END ObjectBase ENUM********************************/

/******************************************OBJECTBASE**********************************************/
$IG.ObjectBase = function(adr, element, props, owner, csm)
{
    this._props = props;
    this._element = element;
    this._owner = owner;
    this._address = adr;
    if(element)
		element._object = this;
    this._csm = csm;
    $IG.ObjectBase.initializeBase(this);
}

$IG.ObjectBase.prototype =
{
    get_element:function()
    {
        /// <summary>
        /// Returns the element assoicated with the item.. 
        /// </summary>
        return this._element;
    },
	set_element:function(val){this._element = val;},

	_get_owner:function(){return this._owner;},
	_set_owner:function(value){this._owner = value;},
	
	_get_address:function(){return this._address;},
	_set_address:function(val){this._address = val;},
	
	_createObjects:function(objectManager)
	{
	}, 
	
	_createCollections:function(collectionsManager)
	{
	},
    
    _set_value:function(index, value)
    {
		if(this._csm)
			this._csm.set_value(index, value, this._address);
    },
    
    _get_value:function(index, isBool)
    {
		return this._csm ? this._csm.get_value(index, isBool, this._address) : null;
    },
    
    _get_clientOnlyValue:function(propName)
    {
		return this._csm ? this._csm.get_clientOnlyValue(propName, this._address) : null;
    },
    
    _get_occasionalProperty:function(propName)
    {
		return this._csm ? this._csm.get_occasionalProperty(propName, this._address) : null;
    },
    
    _set_occasionalProperty:function(propName, val)
    {
		return this._csm ? this._csm.set_occasionalProperty(propName, val, this._address) : null;
    },
       
    
    _saveAdditionalClientState:function()
    {
    
    },
    
    dispose:function()
    {
		if(this._element)
			this._element._object = null;
    }
}
$IG.ObjectBase.registerClass('Infragistics.Web.UI.ObjectBase', Sys.Component);
/******************************************END OBJECTBASE**********************************************/

/******************************************ControlObjectProps ENUM************************************/
$IG.ControlObjectProps = new function()
{
    this.Flags = [$IG.ObjectBaseProps.Count + 0, 0];
    this.Count =  $IG.ObjectBaseProps.Count + 1;
};
/******************************************END ControlObjectProps ENUM********************************/

/******************************************UIObject**********************************************/
$IG.UIObject = function(adr, element, props, owner, csm)
{
    this._flags = null;        
    $IG.UIObject.initializeBase(this, [adr, element, props, owner, csm]);
}

$IG.UIObject.prototype =
{
    _getFlags:function()
    {
        if(this._flags == null)
        {
            this.__flagHelper = new $IG.FlagsHelper();
            var key = [$IG.ObjectBaseProps.Count + 0, this.__getDefaultFlags()]
            this._flags = new $IG.FlagsObject(this._get_value(key), this);
        }
        return this._flags;
    },
    
    __getDefaultFlags:function()
    {
        if(this.__defaultFlags == null)
        {
            this._ensureFlags();
            this.__defaultFlags = this.__flagHelper.calculateFlags();
        }
        return this.__defaultFlags;
    },
    
    _updateFlags:function(flags)
    {
        var key = [$IG.ObjectBaseProps.Count + 0, this.__getDefaultFlags()]
        this._set_value(key, flags)
    },
    
    _ensureFlags:function()
    {
    
    },
    
    _ensureFlag:function(flag, val)
    {
        this.__flagHelper.updateFlag(flag, val);
    }
    
}
$IG.UIObject.registerClass('Infragistics.Web.UI.UIObject', $IG.ObjectBase);
/******************************************END UIObject******************************************/

/******************************************ListItemProps ENUM************************************/
$IG.ListItemProps = new function()
{
    this.KeyTag     =[$IG.ControlObjectProps.Count + 0, ""];
    this.NavigateUrl=[$IG.ControlObjectProps.Count + 1, ""];
    this.Target     =[$IG.ControlObjectProps.Count + 2, ""];
    this.Tooltip    =[$IG.ControlObjectProps.Count + 3, ""];
    this.Count      = $IG.ControlObjectProps.Count + 4;

};
/******************************************END ListItemProps ENUM********************************/

/******************************************List Item**********************************************/
$IG.ListItem = function(adr, element, props, owner,csm, collection, parent)
{
    $IG.ListItem.initializeBase(this, [adr, element, props, owner, csm]);
    this._parent = parent;    
    this._itemCollection = collection
}

$IG.ListItem.prototype =
{
    _ensureFlags:function()
    {
        $IG.ListItem.callBaseMethod(this, "_ensureFlag");
        this._ensureFlag($IG.ClientUIFlags.Hoverable, $IG.DefaultableBoolean.True);
        this._ensureFlag($IG.ClientUIFlags.Selectable, $IG.DefaultableBoolean.True);
        this._ensureFlag($IG.ClientUIFlags.Draggable, $IG.DefaultableBoolean.True);
        this._ensureFlag($IG.ClientUIFlags.Droppable, $IG.DefaultableBoolean.True);
    },
    set_key:function(value){this._set_value($IG.ListItemProps.KeyTag, value);},
    get_key:function()
    {
        /// <summary>
	    /// Returns/sets a string value that can be used to store extra information on the item.
        /// </summary>
        return this._get_value($IG.ListItemProps.KeyTag);
    },
	
	set_navigateUrl:function(value){this._set_value($IG.ListItemProps.NavigateUrl, value);},
    get_navigateUrl:function()
    {
        /// <summary>
	    /// Returns/sets a url that will be navigated to when an item is clicked.
        /// </summary>
        return this._get_value(  $IG.ListItemProps.NavigateUrl);
    },
    
    set_target:function(value){this._set_value($IG.ListItemProps.Target, value);},
    get_target:function()
    {
        /// <summary>
	    /// Returns/sets where the NavigateUrl will be navigated to when an item is clicked.
        /// </summary>         
        return this._get_value($IG.ListItemProps.Target);
    },
    
    set_tooltip:function(value){this._set_value($IG.ListItemProps.Tooltip, value);},
    get_tooltip:function()
    {
        /// <summary>
        /// Returns/sets the text that will be displayed when the mouse is over the item. 
        /// </summary>         
        return this._get_value($IG.ListItemProps.Tooltip);
    }
}
$IG.ListItem.registerClass('Infragistics.Web.UI.ListItem',$IG.UIObject );
/******************************************END List Item******************************************/

/******************************************DataItemProps ENUM************************************/
$IG.DataItemProps = new function()
{
    this.DataPath      =[$IG.ControlObjectProps.Count + 0, null];
    this.Populated     =[$IG.ControlObjectProps.Count + 1, false];
    this.IsEmptyParent = [$IG.ControlObjectProps.Count + 2, false];
    this.Count         = $IG.ControlObjectProps.Count + 3;

};
/******************************************END NavItemProps ENUM********************************/

/******************************************NavItemProps ENUM************************************/
$IG.NavItemProps = new function()
{
    this.Text       =[$IG.DataItemProps.Count + 0, ""];
    this.Value      =[$IG.DataItemProps.Count + 1, ""];
    this.Key        =[$IG.DataItemProps.Count + 2, ""];
    //this.NavigateUrl=[$IG.DataItemProps.Count + 3, ""];
    //this.Target     =[$IG.DataItemProps.Count + 6, ""];
    //this.Tag   =[$IG.DataItemProps.Count + 4, ""];
    //this.CssClass  =[$IG.DataItemProps.Count + 5, ""];
    this.Count      = $IG.DataItemProps.Count + 3;

};
/******************************************END NavItemProps ENUM********************************/

/******************************************Nav Item**********************************************/
$IG.NavItem = function(adr, element, props, owner,csm, collection, parent)
{
    $IG.NavItem.initializeBase(this, [adr, element, props, owner, csm]);
    this._parent = parent;    
    this._itemCollection = collection
}

$IG.NavItem.prototype =
{

    //NavItem Properties
    _ensureFlags:function()
    {
        $IG.NavItem.callBaseMethod(this, "_ensureFlag");
        this._ensureFlag($IG.ClientUIFlags.Hoverable, $IG.DefaultableBoolean.True);
        this._ensureFlag($IG.ClientUIFlags.Selectable, $IG.DefaultableBoolean.True);
        this._ensureFlag($IG.ClientUIFlags.Draggable, $IG.DefaultableBoolean.True);
        this._ensureFlag($IG.ClientUIFlags.Droppable, $IG.DefaultableBoolean.True);
    },
    
    //DataItem properties
    set_dataPath:function(value){this._set_value(       $IG.DataItemProps.DataPath, value);},
    get_dataPath:function(){return this._get_value(     $IG.DataItemProps.DataPath);},
	set_populated:function(value){this._set_value(      $IG.DataItemProps.Populated, value);},
    get_populated:function(){return this._get_value(    $IG.DataItemProps.Populated, true);},
	set_isEmptyParent:function(value){this._set_value(  $IG.DataItemProps.IsEmptyParent, value);},
    get_isEmptyParent:function(){return this._get_value($IG.DataItemProps.IsEmptyParent, true);},

    set_text:function(value){this._set_value(           $IG.NavItemProps.Text, value);},
    get_text:function(){return this._get_value(         $IG.NavItemProps.Text);},
	set_valueString:function(value){this._set_value(    $IG.NavItemProps.Value, value);},
    get_valueString:function(){return this._get_value(  $IG.NavItemProps.Value);},
    set_key:function(value){this._set_value(            $IG.NavItemProps.KeyTag, value);},
    get_key:function(){return this._get_value(          $IG.NavItemProps.KeyTag);},
	//set_navigateUrl:function(value){this._set_value(    $IG.NavItemProps.NavigateUrl, value);},
    //get_navigateUrl:function(){return this._get_value(  $IG.NavItemProps.NavigateUrl);},
    //set_target:function(value){this._set_value(         $IG.NavItemProps.Target, value);},
    //get_target:function(){return this._get_value(       $IG.NavItemProps.Target);},
    
    getItems:function(){return this._itemCollection;}
}
$IG.NavItem.registerClass('Infragistics.Web.UI.NavItem',$IG.UIObject );
/******************************************END Nav Item******************************************/

/******************************************FlagsHelper Object******************************************/
$IG.FlagsHelper = function()
{
    this._flagsHT = [];
};

$IG.FlagsHelper.prototype = 
{
    updateFlag:function(flag, val)
    {
        this._flagsHT[flag] = val;
    },
    getBoolFlag:function(flag)
    {
         var obj = this._flagsHT[flag];
        if (obj == null)
            return false;
        else
            return obj;
    },
    
    getDBFlag:function(flag)
    {
        var obj = this._flagsHT[flag];
        if (obj == null)
            return $IG.DefaultableBoolean.NotSet;
        else
            return obj;
    },
    
    calcBoolFlag:function(flag)
    {
         var val =  this.getBoolFlag(flag);
         return (val) ? flag : 0;
    },
    
    calcDBFlag:function(flag)
    {
         var val =  this.getDBFlag(flag);
         return parseInt(flag * .5 * val);
    },
    
    calculateFlags:function()
    {
        var flags = 0;
        flags += this.calcDBFlag($IG.ClientUIFlags.Visible);
        flags += this.calcDBFlag($IG.ClientUIFlags.Enabled);
        flags += this.calcDBFlag($IG.ClientUIFlags.Selectable);
        flags += this.calcBoolFlag($IG.ClientUIFlags.Selected);
        flags += this.calcDBFlag($IG.ClientUIFlags.Hoverable);
        flags += this.calcBoolFlag($IG.ClientUIFlags.Hovered);
        flags += this.calcDBFlag($IG.ClientUIFlags.Editable);
        flags += this.calcDBFlag($IG.ClientUIFlags.Focusable);
        flags += this.calcBoolFlag($IG.ClientUIFlags.Focused);
        flags += this.calcDBFlag($IG.ClientUIFlags.Draggable);
        flags += this.calcDBFlag($IG.ClientUIFlags.Droppable);
        flags += this.calcDBFlag($IG.ClientUIFlags.KBNavigable);
        return flags;
    }
}

$IG.FlagsHelper.registerClass('Infragistics.Web.UI.FlagsHelper');
/******************************************END Flags Object******************************************/

/******************************************Flags Object******************************************/
$IG.FlagsObject = function(flags,object)
{
    this._flags = flags;
    this._object = object
};

$IG.FlagsObject.prototype = 
{
    getVisible:function(parent){return this._getFlagValue($IG.ClientUIFlags.Visible, parent);},
    setVisible:function(val){this._setFlagValue($IG.ClientUIFlags.Visible, val);},    
    
    getEnabled:function(parent){return this._getFlagValue($IG.ClientUIFlags.Enabled, parent);},
    setEnabled:function(val){this._setFlagValue($IG.ClientUIFlags.Enabled, val);},
    
    getSelectable:function(parent){return this._getFlagValue($IG.ClientUIFlags.Selectable, parent);},
    setSelectable:function(val){this._setFlagValue($IG.ClientUIFlags.Selectable, val);},
    
    getSelected:function(){return this._getFlagValue($IG.ClientUIFlags.Selected, null, true);},
    setSelected:function(val){this._setFlagValue2($IG.ClientUIFlags.Selected, val);},
    
    getHoverable:function(parent){return this._getFlagValue($IG.ClientUIFlags.Hoverable, parent);},
    setHoverable:function(val){this._setFlagValue($IG.ClientUIFlags.Hoverable, val);},
    
    getHovered:function(){return this._getFlagValue($IG.ClientUIFlags.Hovered, null, true);},
    setHovered:function(val){this._setFlagValue2($IG.ClientUIFlags.Hovered, val);},
    
    getEditable:function(parent){return this._getFlagValue($IG.ClientUIFlags.Editable, parent);},
    setEditable:function(val){this._setFlagValue($IG.ClientUIFlags.Editable, val);},
    
    getFocusable:function(parent){return this._getFlagValue($IG.ClientUIFlags.Focusable, parent);},
    setFocusable:function(val){this._setFlagValue($IG.ClientUIFlags.Focusable, val);},
    
    getFocused:function(){return this._getFlagValue($IG.ClientUIFlags.Focused, null, true);},
    setFocused:function(val){this._setFlagValue2($IG.ClientUIFlags.Focused, val);},
    
    getDraggable:function(parent){return this._getFlagValue($IG.ClientUIFlags.Draggable, parent);},
    setDraggable:function(val){this._setFlagValue($IG.ClientUIFlags.Draggable, val);},
    
    getDroppable:function(parent){return this._getFlagValue($IG.ClientUIFlags.Droppable, parent);},
    setDroppable:function(val){this._setFlagValue($IG.ClientUIFlags.Droppable, val);},
    
    getKBNavigable:function(parent){return this._getFlagValue($IG.ClientUIFlags.KBNavigable, parent);},
    setKBNavigable:function(val){this._setFlagValue($IG.ClientUIFlags.KBNavigable, val);},
    
    // Returns a Bool
    _getFlagValue:function(flag, parent, isBoolFlag)
    {
        var returnDb = $IG.DefaultableBoolean.NotSet;
        var trueFlag = this._flags & (flag * .5);
        var falseFlag = this._flags & flag;

        if (trueFlag != 0 && falseFlag == 0)
            returnDb = $IG.DefaultableBoolean.True;
        else if (falseFlag != 0)
            returnDb = $IG.DefaultableBoolean.False;
        
        if(parent != null && returnDb == $IG.DefaultableBoolean.NotSet && parent._getFlags)
            returnDb = parent._getFlags()._getFlagValue(flag);
        
        if(isBoolFlag)
            return (returnDb == 2)
        else if(returnDb == $IG.DefaultableBoolean.True)
            return true;
        else 
            return false; 
    },
    
    
    // Sets a DefaultableBoolean
    _setFlagValue:function(flag, value)
    {
        if(typeof(value) == "boolean")
	        value = (value)?1:2;  
	        
        var trueFlag = this._flags & (flag * .5);
        this._flags -= trueFlag;
        var falseFlag = this._flags & flag;
        this._flags -= falseFlag;
        
        this._flags += flag * (.5) * value;
        
        this._object._updateFlags(this._flags);
    },
    
    // Sets a Bool
    _setFlagValue2:function(flag, value)
    {
        if(typeof(val) == "boolean")
	        val = (val)?1:0;    
	    
        this._flags -= this._flags & flag;
        this._flags += (value)? flag : 0;     
        this._object._updateFlags(this._flags);
    },
    
    _getFlags:function()
    {
        return this._flags;
    }
}

$IG.FlagsObject.registerClass('Infragistics.Web.UI.FlagsObject');
/******************************************END Flags Object******************************************/

/*****************************IMAGEOBJECT**********************************************/

$IG.ImageObject = function(obj, element, props, owner, csm)
{
    if(!csm)
        csm = new $IG.ObjectClientStateManager(props[0]);    
    $IG.ImageObject.initializeBase(this, [obj, element, props, owner, csm]);
    
    this._currentState = this._get_clientOnlyValue("s");
}

$IG.ImageObject.prototype =
{
    setState:function(state)
    {
        if(this._element == null)
            return;
        var url = this._get_clientOnlyValue(state);
        if(url == null || url.length == 0)
            url = this._get_clientOnlyValue($IG.ImageState.Normal);
        
        this._element.src = url;
        this._currentState = state;       
    },
    
    getState:function(){ return this._currentState;}
}
$IG.ImageObject.registerClass('Infragistics.Web.UI.ImageObject', $IG.ObjectBase);

$IG.ImageState = new function()
{
    this.Normal = 'i';
    this.Hover =  'h';
    this.Pressed = 'p';
    this.Disabled = 'd';    
};

/*****************************END IMAGEOBJECT**********************************************/

/******************************************Utility Object******************************************/
Infragistics._Utility = function(){};

Infragistics._Utility.prototype = 
{
      
    addCompoundClass:function(element, className)
    {
       Sys.UI.DomElement.addCssClass(element, className);
    }, 
    
    containsCompoundClass:function (element, className) 
    {
        return (element.className.indexOf(className) >= 0);
    },

    removeCompoundClass:function (element, className) 
    {
        element.className = element.className.replace(className, "");
        element.className = element.className.replace("  ", " ");
    },

    toggleCompoundClass:function (element, className, apply) 
    {
        if(apply)
        {
            if(!this.containsCompoundClass(element, className))
                this.addCompoundClass(element, className);
        }
        else
            this.removeCompoundClass(element, className);  
    },

	/* add ClientEvent handler to a Control or Behavior */
	/* obj - reference to control/behavior, evtName - name of ClientEvent, val - name of function or function */
	addClientEvent:function(obj, evtName, val)
	{
		var fnc = this.toFunction(val);
		if(fnc)
			obj.get_events().addHandler(evtName, fnc);
		else
			throw 'The "' + val + '" for "' + evtName + '" should be a function, function name, or function text';
	},

	/* remove ClientEvent handler from Control or Behavior which was added by addHandler */
	/* obj - reference to control/behavior, evtName - name of ClientEvent, val - name of function or function */
	removeClientEvent:function(obj, evtName, fnc)
	{
		obj.get_events().removeHandler(evtName, fnc);
	},

	/* return object which contains following members: */
	/* x-left position of elem, y-top position, scrollX-horizontal scroll, scrollY-vertical scroll */
	getPosition:function(elem)
	{
		var htm, name, style, elem0 = elem;
		var first = true, noTD = true, ieRect = false, end = false;
		var o = {x:0,y:0,scrollX:0,scrollY:0};
		var ie = document.all && elem.getBoundingClientRect;
		var body2 = !ie;
		while(elem)
		{
			name = elem.nodeName;
			style = this.getRuntimeStyle(elem);
			htm = name == 'HTML';
			if(end)
			{
				if(htm) break;
				elem = elem.parentNode;
				continue;
			}
			var body = name == 'BODY';
			var bdr = false;
			var pos = this.getStyleValue(style, 'position');
			var abs = pos == 'absolute', rel = pos == 'relative';
			if(ie && rel)
				ieRect = abs = true;
			end = body && !ie;
			if((abs && body) || name == 'FORM')
				break;
			var v = elem.offsetTop;
			if(v) o.y += v;
			v = elem.offsetLeft;
			if(v) o.x += v;
			if(!first && !htm)
			{
				var td = name == 'TD', tbl = name == 'TABLE';
				if(ie)				{
					if(!tbl || (noTD && abs))	{
						if(name != 'DIV' || !rel)
							bdr = true;
						if(td)/*disable border for possible coming TABLE*/
							noTD = false;
					}
					if(tbl || (!td && !tbl))/*reset border for next TD/TABLE*/
						noTD = true;
				}
				else if((!tbl && !td) || (td && abs))
					bdr = true;
			}
			if(bdr)
			{
				/*body2: mozilla-fix for BODY-border when no abs pos*/
				v = body2 && body;
				/*mozilla-fix for DIV-border when scrollable with abs/rel pos*/
				if(!ie && !v && (abs || rel))
					v = this._isScroll(style, name);
				this._addBorder(style, o, false, v);
			}
			/*adjust for scroll*/
			this._addScroll(elem, o);
			if(abs)/*do not fix mozilla HTML-border*/
				body2 = false;
			first = false;
			var pe = elem.parentNode;
			elem = elem.offsetParent;
			if(!elem && end)
			{
				elem = pe;
				continue;
			}
			/*mozilla-fix for scroll when no abs pos*/
			if(!ie && !abs && elem) while(pe && pe != elem)
			{
				if(this._isScroll(style = this.getRuntimeStyle(pe), pe.nodeName))
				{
					this._addScroll(pe, o);
					this._addBorder(style, o);
				}
				pe = pe.parentNode;
			}
		}
		if(body2 && htm)/*mozilla-fix for HTML-border when no abs pos*/
			this._addBorder(style, o, true);
		if(ieRect)/*IE fix for rel-position*/
		{
			v = elem0.getBoundingClientRect();
			o.x = v.left + o.scrollX;
			o.y = v.top + o.scrollY;
			if(htm && style)
				this._addBorder(style, o, true);
		}
		return o;
	},
	_addScroll:function(elem, o)/* private used by getPosition */
	{
		var v = elem.scrollLeft;
		if(v) o.scrollX += v;
		v = elem.scrollTop;
		if(v) o.scrollY += v;
	},
	_addBorder:function(style, o, neg, twice)/* private used by getPosition */
	{
		var v = this.toIntPX(style, 'borderLeftWidth', 0);
		if(twice) v += v;
		o.x += neg ? -v : v;
		v = this.toIntPX(style, 'borderTopWidth', 0);
		if(twice) v += v;
		o.y += neg ? -v : v;
	},
	_isScroll:function(style, name)/* private used by getPosition */
	{
		var v = name == 'DIV' ? this.getStyleValue(style, 'overflow') : '';
		return v == 'auto' || v == 'scroll';
	},

	/* cancel browser event e; type: cancel only particular type if multiple events are processed */
	cancelEvent:function(e, type, raw)
	{
		if(!e && !raw)	e = window.event;
		if(!e) return true;
		if(type && type.substring && e.type != type)
			return true;
		if(e.stopPropagation)
			e.stopPropagation();
		if(e.preventDefault)
			e.preventDefault();
		e.cancelBubble = true;
		e.returnValue = false;
		if(raw)
			return false;
		return this.cancelEvent(e.rawEvent, null, true);
	},

	/* return run time style of element */
	getRuntimeStyle:function(elem)
	{
		if(!elem)
			return null;
		var s = elem.currentStyle;
		if(s)
			return s;
		var win = document.defaultView;
		if(!win)
			win = window;
		if(win.getComputedStyle)
			s = win.getComputedStyle(elem, '');
		return s ? s : elem.style;
	},

	/* return property value of style */
	/* style/elem one of those param is optional */
	/* prop - full name of property, like 'borderTopWidth' */
	getStyleValue:function(style, prop, elem)
	{
		if(!style)
			style = this.getRuntimeStyle(elem);
		if(!style)
			return null;
		var val = style[prop];
		if(!this.isEmpty(val) || !style.getPropertyValue)
			return val;
		return style.getPropertyValue(prop);
	},

	/* convert string val to int, def - value returned in case of failure to convert */
	toInt:function(val, def)
	{
		var ok = false;
		var i = -1, len = val ? val.length : 0;
		while(++i < len)
		{
			var ch = val.charCodeAt(i);
			if(ch == 45 && i == 0)
				continue;
			if(ch < 48 || ch > 57)
			{
				val = val.substring(0, i);
				break;
			}
			ok = true;
		}
		return ok ? parseInt(val) : def;
	},

	/* return number of pixels in a property value */
	/* style/elem one of those param is optional */
	/* def - value returned in case of failure to convert */
	/* prop - full name of property, like 'borderTopWidth' */
	toIntPX:function(style, prop, def, elem)
	{
		var px = this.getStyleValue(style, prop, elem);
		return (px && px.indexOf('px') > 0) ? this.toInt(px, 0) : (def ? def : 0);
	},

	/* convert string/function to Function */
	toFunction:function(val)
	{
		if(val instanceof Function)
			return val;
		if(!val || !val.length || !val.charCodeAt)
			return null;
		var fnc = window[val];
		if(fnc instanceof Function)
			return fnc;
		try{fnc = eval(val);}catch(val){}
		return (fnc instanceof Function) ? fnc : null;
	},

	/* check if val (string, array) is not null and has length larger than 0 */
	isEmpty:function(val)
	{
		if(!val)
			return true;
		val = val.length;
		return !val || val.length < 1;
	},
	/* returns value of opacity (supposed to be in range of 0..100) */
	getOpacity:function(elem)
	{
		var op = this.getStyleValue(null, 'opacity', elem);
		if(op)
		{
			op = parseFloat(op);
			if(op)
			{
				op = Math.floor(op * 100);
				return (op < 100 && op >= 0) ? op : 100;
			}
		}
		op = this.getStyleValue(null, 'filter', elem);
		if(!op)
			return 100;
		op = this.replace(op.toLowerCase(), ' ', '');
		var i = op.indexOf('opacity=');
		return (i < 0) ? 100 : this.toInt(op.substring(i + 8), 100);
	},

	/* find reference to IG control by its ID */
	/* id: value of ID or ClientID of control */
	/* prefix: (optional) value of prefix which should contain ClientID */
	findControl:function(id, prefix)
	{
		for(var ig in ig_controls)
		{
			var ctl = ig_controls[ig];
			if(!ctl.get_id || (prefix && ig.indexOf(prefix) != 0))
				continue;
			var i = ig.lastIndexOf(id);
			if(i == 0 || (i > 0 && i + id.length == ig.length && ig.charAt(i - 1) == '_'))
				return ctl;
		}
	},

	/* find child element which id ends-up with id */
	/* elem: parent element */
	/* id: full or partial-suffix id of child element */
	findChild:function(elem, id)
	{
		var id0 = elem.id;
		var i = id0 ? id0.lastIndexOf(id) : -1;
		if(i >= 0 && i + id.length == id0.length && id0.charAt(i - 1) == '_')
			return elem;
		var elems = elem.childNodes;
		i = elems ? elems.length : 0;
		while(i-- > 0)
		{
			elem = this.findChild(elems[i], id);
			if(elem)
				return elem;
		}
	},

	/* find parent LayoutManager (like a splitter pane or WebDialogWindow) and add target which should be notified about resize/layout event happened in LayoutManager */
	addLayoutTarget:function(target)
	{
		/* index of (splitter) pane located within LayoutManager */
		var index = -1, elem = target._element;
		while((elem = elem.parentNode) != null)
		{
			if(!elem.getAttribute)
				continue;
			/* assume that (splitter) pane has mkr="c#" attribute where #-index of pane */
			var ctl = null, id = elem.getAttribute('mkr');
			if(id && id.length > 1 && id.substring(0, 1) == 'c')
				index = this.toInt(id.substring(1), -1);
			id = elem.getAttribute('CtlMain');
			if(!id)
				continue;
			if(id == 'layout')
			{
				id = elem.id;
				if(id)
					ctl = ig_controls[id];
			}
			if(!ctl || !ctl.getLayoutManager)
			{
				index = -1;
				continue;
			}
			/* get reference to LayoutManager (ctl or its LayoutPane at index) */
			ctl = ctl.getLayoutManager(index);
			if(!ctl) continue;
			/* add target as listener for resize events which will be raised by LayoutManager */
			var i = -1, ids = ctl._layoutListeners, id = target._id;
			if(!ids)
				ctl._layoutListeners = ids = new Array();
			/* avoid multiple references to same target */
			while(++i < ids.length)
				if(ids[i] == id)
					break;
			ids[i] = id;
			/* set reference to LayoutManager in target */
			target._layoutManager = ctl;
			return true;
		}
		return false;
	},

	/* notify listeners of LayoutManager about size-change */
	/* This method will call layout(width, height) member function of child controls located in LayoutManager. */
	/* The layout() function should return false/null/nothing in case of success or true in case of failure (if elem.offsetWidth/Height was 0). */
	raiseLayoutEvent:function(man)
	{
		/* check for special condition: if main element has _ctlsForLayout member */
		/* if yes, then use that only once because it is interrupted initialization of child control */
		var ctl, elem = man._element;
		var lsnrs = elem ? elem._ctlsForLayout : null;
		var i = lsnrs ? lsnrs.length : 0;
		while(i-- > 0)
		{
			ctl = lsnrs[i];
			if(ctl && ctl.layout)
				/* if layout at this point fails, then move listener control into normal notification line */
				if(ctl.layout(man.getClientWidth ? man.getClientWidth(ctl) : null, man.getClientHeight ? man.getClientHeight(ctl) : null))
					if(!ctl._layoutManager)
						/* find actual container/manager and assign ctl to it (as containerManager._layoutListeners) */
						this.addLayoutTarget(ctl);
			lsnrs[i] = null;
		}
		if(lsnrs)
		{
			elem._ctlsForLayout = null;
			return;
		}
		lsnrs = man._layoutListeners;
		i = lsnrs ? lsnrs.length : 0;
		while(i-- > 0)
		{
			var ctl = ig_controls[lsnrs[i]];
			if(ctl && ctl.layout)
			{
				var width = man.getClientWidth ? man.getClientWidth(ctl) : null, height = man.getClientHeight ? man.getClientHeight(ctl) : null;
				ctl.layout(width, height);
			}
		}
	},
	/* check all parents of control (ctl) for element which belongs to layout manager */
	/* NOTES: */
	/* That function should be called by a control which size (not set or in %) is controled by LayoutManager. */
	/* The ctl should call that function while first initialization only once. */
	/* If returned value is true, then ctl should skip the rest of logic and wait when layout manager will call ctl.layout(...) */
	/* If returned value is true, then ctl may optionally create a flag for that special wait "layout" condition. */
	/* NOTES for listener: */
	/* Control which expects notification from LayoutManager should implement layout(width,height) function. */
	/* The layout() function should return false/null/nothing in case of success or true in case of failure (if elem.offsetWidth/Height was 0). */
	checkLayoutManager:function(ctl)
	{
		var i = 0, elem = ctl._element;
		/* go through parents to find element of LayoutManager */
		/* at this point the LayoutManager object is not created yet, so, only html element is available */
		while(i++ < 10 && elem && (elem = elem.parentNode) != null)
		{
			/* it uses assumption that main element of layout manager will have className ending with ':=CtlMain:layout' */
			var css = elem.id ? elem.className : null;
			if(css && css.indexOf(':=CtlMain:layout') == css.length - 16)
			{
				/* if element is found, then the element._ctlsForLayout will be created with reference to ctl and returns true */
				if((i = elem._ctlsForLayout) == null)
					i = elem._ctlsForLayout = new Array();
				i[i.length] = ctl;
				return true;
			}
		}
		return false;
	},

	/* style:  reference to run-time style of element */
	/* width:  boolean-true: return horizontal offset of width, false: return vertical offset of height */
	/* noTrail: boolean-true: calculate only left/top gaps (optional) */
	/* noLead: boolean-true: calculate only right/bottom gaps (optional) */
	/* return: gap between bounds of element and its client content */
	getOffset:function(style, width, noTrail, noLead)
	{
		var val = 0;
		if(style) while(!noLead || !noTrail)
		{
			var prop = noLead ? (width ? 'Right' : 'Bottom') : (width ? 'Left' : 'Top');
			if(noLead)
				noTrail = true;
			noLead = true;
			val += this.toIntPX(style, 'border' + prop + 'Width') + this.toIntPX(style, 'padding' + prop);
		}
		return val;
	},

	/* style: reference to run-time style of element */
	/* horiz: boolean-true: return horizontal/vertical margin */
	/* return: marginLeft+marginRight, or marginTop+marginBottom */
	getMargin:function(style, horiz)
	{
		return this.toIntPX(style, 'margin' + (horiz ? 'Left' : 'Top')) + this.toIntPX(style, 'margin' + (horiz ? 'Right' : 'Bottom'));
	},

	/* show/hide element */
	/* elem: element to show/hide */
	/* hide: if it is true, then element is hidden, otherwise it is displayed */
	display:function(elem, hide)
	{
		var style = elem ? elem.style : null;
		if(!style) return;
		style.display = hide ? 'none' : '';
		style.visibility = hide ? 'hidden' : 'visible';
	},

	/* replace all oldVal substrings by newVal */
	/* str: original string */
	/* oldVal: old substring or array of old/new pairs */
	/* newVal: new string or null */
	/* If newVal is missing, then oldVal is assumed to be an array of pairs old and new strings */
	/* Examples: */
	/* val=&util.replace('okxok','ok','?'); will return '?x?' */
	/* val=&util.replace('okxok',['ok','?','x','+']); will return '?+?' */
	replace:function(str, oldVal, newVal)
	{
		if(newVal == null)
			for(var i = 0; i < oldVal.length; i += 2)
				str = this.replace(str, oldVal[i], oldVal[i + 1]);
		else while(str.indexOf(oldVal) >= 0)
			str = str.replace(oldVal, newVal);
		return str;
	},
	
	/* get reference to element which defines size of page */
	getHTML:function(win)
	{
		if(!win)
			win = window;
		var doc = win.document;
		var htm = doc.body;
		while(htm && htm.nodeName != 'HTML')
			htm = htm.parentNode;
		return htm ? htm : doc.body;
	},

	/* get visible left(x), top(y), positions of window and its size (width, height) */
	getWinRect:function(win)
	{
		if(!win)
			win = window;
		var doc = win.document;
		var body = doc.body, htm = this.getHTML(win), de = doc.documentElement;
		if(!de)
			de = htm;
		var x = de.scrollLeft, y = de.scrollTop, wi = win.innerWidth, hi = win.innerHeight, wd = de.clientWidth, hd = de.clientHeight, w = htm.clientWidth, h = htm.clientHeight;
		var maxWidth = w ? w : 0, maxHeight = h ? h : 0, w2 = htm.scrollWidth, h2 = htm.scrollHeight;
		if(wd)
		{
			maxWidth = Math.max(maxWidth, wd);
			maxHeight = Math.max(maxHeight, hd);
		}
		if(wi)
		{
			maxWidth = Math.max(maxWidth, wi);
			maxHeight = Math.max(maxHeight, hi);
		}
		if(w2 && h2)
		{
			maxWidth = Math.max(maxWidth, w2);
			maxHeight = Math.max(maxHeight, h2);
		}
		w2 = body.scrollWidth;
		if(w2)
			maxWidth = Math.max(maxWidth, w2);
		w2 = body.offsetWidth;
		h2 = body.offsetHeight
		maxWidth = Math.max(maxWidth, w2);
		maxHeight = Math.max(maxHeight, h2);
		var noClientSize = false;
		/* find largest left and top scrolls */
		if(!x)
			x = htm.scrollLeft;
		if(!x)
			x = body.scrollLeft;
		if(!y)
			y = htm.scrollTop;
		if(!y)
			y = body.scrollTop;
		/* find smallest valid width */
		if(!wi || wi < 50)
			wi = 99999;
		if(!wd || wd < 50)
			wd = 99999;
		if(!w || w < 50)
			w = 99999;
		if(w > wd)
			w = wd;
		if(w > wi)
			w = wi;
		if(w == 99999)
		{
			w = w2;
			noClientSize = true;
		}
		/* find smallest valid height */
		if(!hi || hi < 50)
			hi = 99999;
		if(!hd || hd < 50)
			hd = 99999;
		if(!h || h < 50)
			h = 99999;
		if(h > hd)
			h = hd;
		if(h > hi)
			h = hi;
		if(h == 99999)
		{
			h = h2;
			noClientSize = true;
		}
		return {x:x, y:y, width:w, height:h, maxWidth:maxWidth, maxHeight:maxHeight, noClientSize:noClientSize};
	},
	
	/* Set the opacity of an element. The opacity should be an integer between 0 and 100 */
	setOpacity:function(element, opacity)
	{
	    element.style.opacity = opacity/100;
	    if(element.filters)
	    {
	        if(!element.filters["alpha"]|| element.style.filter.indexOf("alpha") == -1)
				    element.style.filter += " alpha(opacity=" + opacity + ")";
	        else
	            element.filters["alpha"].opacity=opacity;
	    }
	},
	
	/* try to get markup-attributes from encrypted id and from encrypted className of elem */
	/* returns true if elem has id and its id is not encrypted */
	_initAttr:function(elem)
	{
		var attr = elem.id;
		var j = 99, i = attr ? attr.length : 0;
		if(i < 1)
			/* no id: condition to continue walkThrough */
			return false;
		/* format of encrypted id ":{0}.{1}:{2}:{3}" or ":{0}.{1}:{2}:{3}:{4}:{5}" where */
		/* {0}.{1} - unique value for id which should be ignored */
		/* {2}/{4} - name of attribute, {3}/{5} - value for attribute */
		if(attr.charAt(0) == ':')
		{
			attr = attr.split(':');
			i = attr.length;
			if((i >= 4 || (i % 2 == 0)) && attr[1].indexOf('.') > 0)
				j = 1;
		}
		/* normal id: check className for encryption */
		if(j > 2)
		{
			/* format of encrypted className "{0} :={1}:{2}" or "{0} :={1}:{2}:{3}:{4}" where */
			/* {0} - actual className */
			/* {1}/{3} - name of attribute, {2}/{4} - value for attribute */
			var css = elem.className;
			j = (css && css.length > 5) ? css.indexOf(' :=') : -1;
			if(j < 0)
				/* normal id: condition to end walkThrough */
				return true;
			attr = css.substring(j + 3);
			if(attr.indexOf(' ') >= 0)
				/* normal id: condition to end walkThrough */
				return true;
			attr = attr.split(':');
			i = attr.length;
			if(i < 2 || (i & 1) != 0)
				/* normal id: condition to end walkThrough */
				return true;
			elem.className = css.substring(0, j);
			j = -1;
		}
		while((i -= 2) > j)
			elem.setAttribute(attr[i], attr[i + 1]);
		/* if(j < 0), then it is normal id: condition to end walkThrough */
		return j < 0;
	},

	/* Walks up the parent chain, until an element with an "adr", "mkr", or "obj" is found 
	 * returns an array, where the first object is the element and the second object is the attribute
	 * returns null if no element with a marker is found. */
	resolveMarkedElement:function(elem, checkControl)
	{
	    var adr = null;
	    var control = null;
	    var secondWalkthrough = false;
        while(elem)
        {
            if(elem.getAttribute)
            {
                adr = elem.getAttribute("adr");
                if(adr == null)
                    adr = elem.getAttribute("mkr");
                if(adr == null)
                    adr = elem.getAttribute("obj");
                if(adr == null && !secondWalkthrough)
                {
                    adr = elem.getAttribute("id");
                    if(adr)
                    {
                        secondWalkthrough = true;
						if(!$util._initAttr(elem))
							continue;
						adr = null;
					}
                }
                else
                    secondWalkthrough = false; 
            }
            if(typeof(adr) == "string")
            {
                if(adr.length > 0)
                    break;
            }
            else
            if(typeof(adr) != "undefined" && adr !== null)
                break; 
                
            elem = elem.parentNode;    
        }
        if(elem == null)
            return null;
        else if(checkControl)
        {
            var parent = elem.parentNode;
            while(parent)
            {
                if(parent.control != null)
                {  
                     control = parent.control;
                     break;
                }
                parent = parent.parentNode;
            }
	    }
	    return [elem, adr, control];
	},
	
	compare:function(val1, val2)
	{
	    if(val1 == val2)
	        return true;
	    else if(val1 != null && val2 != null)
	    {
	        var type1 = Object.getType(val1).__typeName;
	        var type2= Object.getType(val2).__typeName;
	        if(type1 != type2 || type1 == "String" || type1 =="Number" || type1 == "Boolean")
	            return false;
	            
	        if(type1 == "Array" )
	        {
	            if(val1.length != val2.length)
	                return false;
	            
	            for(var i in val1)
	            {
	                if(!$util.compare(val1[i], val2[i]))
	                    return false;
	            }
	            return true;
	        }
	        else if(type1 == "Date")
	        {
	            if(val1.getTime() == val2.getTime())
	                return true;
	        }
	        else
	        {
	            for(var i in val1)
	            {
	                if(!$util.compare(val1[i], val2[i]))
	                    return false;
	            }
	            return true;
	        }
	    }
	    return false;
	}, 
	
	ensureBrowserInfo:function()
	{
	    try{this.AgentName=navigator.userAgent.toLowerCase();}catch(e){this.AgentName="";}
	    this.MajorVersionNumber =parseInt(navigator.appVersion);
	    this.IsSafari=this.AgentName.indexOf("safari")>=0;
	    this.IsFireFox=this.AgentName.indexOf("firefox")>=0;
	    this.IsOpera=this.AgentName.indexOf("opera")>=0;
	    this.IsMac=this.AgentName.indexOf("mac")>=0;
	    this.IsIE=document.all!=null&&!this.IsOpera&&!this.IsSafari;
	},
	
	setAbsoluteWidth:function(element, width)
	{
		///<summary>
		///Sets the outer width on an element. The width includes in itself the borders
		///and the paddings.
		///</summary>
		
		var style = this.getRuntimeStyle(element);
		var borderLeftWidth = 0;
		if(style.borderLeftStyle!="none")
		{
			if(style.borderLeftWidth == "thin")
				borderLeftWidth = 1;
			else if(style.borderLeftWidth == "medium")
				borderLeftWidth = 3;
			else if(style.borderLeftWidth == "thick")
				borderLeftWidth = 5;
			else
			{
				var w = parseInt(style.borderLeftWidth, 10);
				if(isNaN(w))
					w = 0;
				borderLeftWidth = w;
			}
		}
		
		var borderRightWidth = 0;
		if(style.borderRightStyle!="none")
		{
			if(style.borderRightWidth == "thin")
				borderRightWidth = 1;
			else if(style.borderRightWidth == "medium")
				borderRightWidth = 3;
			else if(style.borderRightWidth == "thick")
				borderRightWidth = 5;
			else
			{
				var w = parseInt(style.borderRightWidth, 10);
				if(isNaN(w))
					w = 0;
				borderRightWidth = w;
			}
		}
		
		var paddingLeft = parseInt(style.paddingLeft, 10);
		if(isNaN(paddingLeft))
			paddingLeft = 0;
			
		var paddingRight = parseInt(style.paddingRight, 10);
		if(isNaN(paddingRight))
			paddingRight = 0;
		
		width -= borderLeftWidth + borderRightWidth + paddingLeft + paddingRight;

		if(width < 0)
			width = 0;
		
		element.style.width = width + "px";
	}, 
	
	addHandler:function(element, eventName, handler)
    {
        var browserHandler;
        if (element.addEventListener) 
        {
            browserHandler = function(e) 
            {
                return handler.call(element, new Sys.UI.DomEvent(e));
            }
            element.addEventListener(eventName, browserHandler, false);
        }
        else if (element.attachEvent) 
        {
            browserHandler = function(e) 
            {
                return handler.call(element, new Sys.UI.DomEvent(e));
            }
            element.attachEvent('on' + eventName, browserHandler);
        } 
    }
	
};
Infragistics._Utility.registerClass("Infragistics._Utility");

Infragistics.Utility = new Infragistics._Utility();
var $util = Infragistics.Utility;
$util.ensureBrowserInfo();
/******************************************END Utility Object**************************************/

/* Timer to process 1st paint. Most usage: control is invisible on start (inside unselected tab) and offsetWidth/Height of any element is 0 */
var ig_ui_all = null;/* global list of objects which need first painting */
function ig_ui_timer(o, del)/* function which is called by timer in endless loop (until stopped) */
{
	var all = ig_ui_all;
	var i, fn = all ? all._timerFn : null;
	if(o)/* this function is called by object directly (add/remove timer) */
	{
		if(!o._onTimer) return;/* if object does have _onTimer, then nothing to add to global list */
		if(!all) ig_ui_all = all = new Array();
		i = all.length;
		while(i-- > 0) if(all[i] == o) break;/* find object in global list */
		if(del)/* when object is disposed, then its timer should be removed */
		{
			if(i < 0) return;
			delete o._onTimer;
			delete all[i];
			o = null;/* set request to stop timer */
			i = all.length;
			while(i-- > 0) if(all[i]) o = true;/* do not stop timer */
		}
		else/* add object to global list */
		{
			if(i < 0)
			{
				/* find first available index */
				while(all[++i]);
				all[i] = o;
			}
			if(!fn) all._timerFn = fn = window.setInterval(ig_ui_timer, 200);/* start timer */
		}
	}
	if(o) return;
	/* this function is called by timer: notify objects about timer-event */
	if(!del && fn) for(i = 0; i < all.length; i++)
	{
		o = all[i];/* notify all objects in global list about timer event */
		if(o && o._onTimer)
		{
			if(!o._onTimer())
			{
				fn = null;/* paint function failed: global timer should not be stopped */
				continue;
			}
			delete o._onTimer;/* paint function was successful: remove object from list */
			delete all[i];
		}
	}
	if(!fn) return;/* one of the paint function failed: timer should continue */
	window.clearInterval(fn);/* clear all timer related objects */
	delete all._timerFn;
	ig_ui_all = null;
}

/*********************EventArgs (to fire ClientEvents)*******************************/

/* event which contains reference to the event of browser */
$IG.EventArgs = function()
{
	$IG.EventArgs.initializeBase(this);
	this._props = [null,0];
}
$IG.EventArgs.prototype =
{
	get_browserEvent:function(){return this._props[0];},
	dispose:function(){this._props[0]=null;}
}
$IG.EventArgs.registerClass('Infragistics.Web.UI.EventArgs', Sys.EventArgs);

/* event which contains reference to the event of browser and allows to postback */
$IG.PostBackEventArgs = function()
{
	$IG.PostBackEventArgs.initializeBase(this);
}
$IG.PostBackEventArgs.prototype =
{
	/* check if control should not trigger postback (0), trigger full postback (1), or trigger async postback (2) */
	get_postBack:function(){return this._props[1];},
	/* set request for control to do not trigger postback (0), trigger full postback (1), or trigger async postback (2) */
	set_postBack:function(val){this._props[1] = val;}
}
$IG.PostBackEventArgs.registerClass('Infragistics.Web.UI.PostBackEventArgs', $IG.EventArgs);

/* cancelable event which contains reference to the event of browser and allows to postback */
$IG.CancelEventArgs = function()
{
	$IG.CancelEventArgs.initializeBase(this);
	this._cancel = false;
}
$IG.CancelEventArgs.prototype =
{
	/* check if event was canceled */
	get_cancel:function(){return this._cancel;},
	/* cancel event */
	set_cancel:function(val){this._cancel = val;}
}
$IG.CancelEventArgs.registerClass('Infragistics.Web.UI.CancelEventArgs', $IG.EventArgs);

/* event used by MoveBehavior */
$IG.MoveEventArgs = function()
{
	$IG.MoveEventArgs.initializeBase(this);
}
$IG.MoveEventArgs.prototype =
{
	/* this._props: 0-event, 1-postBackAction, 2-new x, 3-new y, 4-old x, 5-old y */
	get_x: function(){return this._props[2];},
	get_y: function(){return this._props[3];},
	get_oldX: function(){return this._props[4];},
	get_oldY: function(){return this._props[5];},
	set_x: function(val){this._props[2] = this._x = val;},
	set_y: function(val){this._props[3] = this._y = val;}
}
$IG.MoveEventArgs.registerClass('Infragistics.Web.UI.MoveEventArgs', $IG.CancelEventArgs);

/* VS: debug output/append of values on screen (let say on mousemove) */
/* Example to show value in top/left corner:  _bug('my val=' + myVal); */
/* Example to append value on new line in top/left corner:  _bug('<br>my val=' + myVal, true); */
/* Example to append value on new line in at x=300, y=50:  _bug('<br>my val=' + myVal, true, '300px', '50px'); */
var _bugE = null;
function _bug3(v){_bug("<br />" + v, true, "400px");}
function _bug2(v){_bug(v, true, "400px");}
function _bug1(v){_bug(v, false, "400px");}
function _bug(v, a, l, t)
{
	if(!_bugE)
	{
		_bugE = document.createElement('DIV');
		document.body.insertBefore(_bugE, document.body.firstChild);
		var s = _bugE.style;
		s.position = 'absolute';
		s.zIndex = 10000;
		s.left = s.top = '0px';
		s.border = '1px dotted red';
		s.fontSize = '12px';
		s.fontFamily = 'courier';
	}
	if(l) _bugE.style.left = l;
	if(t) _bugE.style.top = t;
	_bugE.innerHTML = (a ? _bugE.innerHTML : '') + v;
}
//*/

/******************************************TransparentFrame**********************************************/
$IG.TransparentFrame = function(parent, mouseMoveHandler, mouseUpHandler)
{
    this._parent = parent;
    this._mmh = mouseMoveHandler;
    this._muh = mouseUpHandler;
    
    this.frame = document.createElement("IFRAME");
    this.frame.src = 'javascript:new String("<html></html>")';	  	            	            
    this.frame.style.zIndex = 1000;
    this.frame.style.position = "absolute";
    this.frame.style.top = 0; 
    this.frame.style.left = 0; 	        
    this._originalPos = parent.style.position
    
    parent.appendChild(this.frame);    
    setTimeout(Function.createDelegate(this, this._setupFrame), 0);
}

$IG.TransparentFrame.prototype =
{
    _setupFrame:function()
    {
        var doc = this.frame.contentWindow.document;
        $util.setOpacity(this.frame, 0);	       
        $util.addHandler(doc, 'mousemove', this._mmh);
        $util.addHandler(doc, 'mouseup', this._muh); 	
        
    },
            
    showFrame:function(show, height, width)
    {
        var parent = this._parent;
        if(parent != null && parent.tagName == "DIV")
        {
            if(show)
            {
                if((parent.scrollHeight > 0 ||parent.scrollWidth > 0) && this._originalOverflow == null)
                {
                    this._originalOverflow = parent.style.overflow;          
                    parent.style.overflow = "hidden";	           
		        }
            }
            else if(this._originalOverflow != null)
            {
                parent.style.overflow = this._originalOverflow;
                this._originalOverflow = null;
            }
        }
        parent.style.position = (show)? "relative": this._originalPos;
        this.frame.style.height = height + "px";
        this.frame.style.width = width + "px";
        this.frame.style.display = show? "": "none";
    }
}
$IG.TransparentFrame.registerClass('Infragistics.Web.UI.TransparentFrame');
/******************************************END TransparentFrame**********************************************/
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();