﻿$IG.BehaviorCollectionBase=function(control){this._grid=control;this._behaviors=[];};$IG.BehaviorCollectionBase.prototype={get_grid:function(){return this._grid;},add:function(behavior){this._behaviors.push(behavior);},_initializeBehaviors:function(){if(!this._behaviors)return;for(var i=0;i<this._behaviors.length;i++){var behavior=this._behaviors[i];if(behavior){behavior._parentCollection=this;if($IG.IGridBehaviorContainer.isInstanceOfType(behavior)){var subBehCollection=behavior.get_behaviors();if(subBehCollection)subBehCollection._initializeBehaviors();}}}},getBehaviorByName:function(behaviorName){if(!behaviorName)return null;var behavior=null;for(var i=0;i<this._behaviors.length;i++){if(this._behaviors[i].get_name()==behaviorName){behavior=this._behaviors[i];break;}if($IG.IGridBehaviorContainer.isInstanceOfType(this._behaviors[i])){behavior=this._behaviors[i].get_behaviors().getBehaviorByName(behaviorName);if(behavior!=null)break;}}return behavior;},getBehaviorFromInterface:function(behaviorInterface){if(!behaviorInterface)return null;var behavior=null;for(var i=0;i<this._behaviors.length;i++){if(behaviorInterface.isInstanceOfType(this._behaviors[i])){behavior=this._behaviors[i];break;}if($IG.IGridBehaviorContainer.isInstanceOfType(this._behaviors[i])){behavior=this._behaviors[i].get_behaviors().getBehaviorFromInterface(behaviorInterface);if(behavior!=null)break;}}return behavior;},dispose:function(){this._grid=null;$IG.BehaviorCollectionBase.callBaseMethod(this,"dispose");}};$IG.BehaviorCollectionBase.registerClass('Infragistics.Web.UI.BehaviorCollectionBase',$IG.ObjectBase);$IG.GridBehavior=function(obj,objProps,control,parentCollection){var props=objProps[0];var clientEvents=objProps[3];var csm=obj?new $IG.ObjectClientStateManager(props):null;$IG.GridBehavior.initializeBase(this,[obj,control._element,props,control,csm]);this._grid=this._owner;this._parentCollection=parentCollection;this._owner._initClientEventsForObject(this,clientEvents);this.__raiseClientEvent('Initialize');};$IG.GridBehavior.prototype={_initializeComplete:function(){},get_name:function(){return this._get_value($IG.GridBehaviorProps.Name);},dispose:function(){this._grid=null;this._parentCollection=null;$IG.GridBehavior.callBaseMethod(this,"dispose");},__raiseClientEvent:function(clientEventName,evntArgs,eventArgsParams){var args=null;var grid=this._owner;var clientEvent=this._clientEvents[clientEventName];if(clientEvent!=null){if(evntArgs==null)args=new $IG.EventArgs();else args=new evntArgs(eventArgsParams);args=grid._raiseSenderClientEvent(this,clientEvent,args);}return args;},_responseComplete:function(callbackObject,responseOptions){}};$IG.GridBehavior.registerClass('Infragistics.Web.UI.GridBehavior',$IG.ObjectBase);$IG.GridBehaviorProps=new function(){var count=$IG.ObjectBaseProps.Count;this.Name=[count++,''];this.Count=count;};$IG.IGridBehaviorContainer=function(){};$IG.IGridBehaviorContainer.prototype={_initializeBehaviors:function(behaviorProps,control,parentCollection){if(!behaviorProps)return;for(var i=0;i<behaviorProps.length;i++){var objProps=behaviorProps[i];if(!objProps[0]||!objProps[0][0])continue;var objName=objProps[0][0][0];var propName=objName;if(propName==null||!propName.indexOf)continue;propName="_"+propName.substr(0,1).toLowerCase()+propName.substr(1,propName.length-1);var behaviorCollection=this.get_behaviors();var behavior=behaviorCollection[propName]=new $IG[objName]((objName+i),objProps,control,parentCollection);behaviorCollection.add(behavior);this._objectsManager.register_object(i,behavior);}},get_behaviors:function(){throw "Not implemented: get_behaviors()!"}};$IG.IGridBehaviorContainer.registerInterface("Infragistics.Web.UI.IGridBehaviorContainer");$IG.GridBehaviorContainer=function(obj,objProps,control,parentCollection){this._initializeBehaviors=$IG.IGridBehaviorContainer.prototype._initializeBehaviors;$IG.GridBehaviorContainer.initializeBase(this,[obj,objProps,control,parentCollection]);};$IG.GridBehaviorContainer.prototype={_createObjects:function(objectsManager){this._objectsManager=objectsManager;this._initializeBehaviors(objectsManager._objects,this._owner,this._owner.get_behaviors());},_behaviors:null,get_behaviors:function(){if(this._behaviors==null)this._behaviors=this._createBehaviorCollection();return this._behaviors;},dispose:function(){if(this._behaviors&&this._behaviors._behaviors){var behaviors=this._behaviors._behaviors;for(var i=0;i<behaviors.length;i++){behaviors[i].dispose();}this._behaviors.dispose();}this._objectsManager=null;$IG.GridBehaviorContainer.callBaseMethod(this,"dispose");},_createBehaviorCollection:function(){return null;}};$IG.GridBehaviorContainer.registerClass('Infragistics.Web.UI.GridBehaviorContainer',$IG.GridBehavior,$IG.IGridBehaviorContainer);$IG.GridAction=function(type,ownerName,object,value,tag){this.type=type;this.ownerName=ownerName;this._object=object;if(value)this._value=value;if(tag)this._tag=tag;};$IG.GridAction.prototype={type:"",ownerName:"",_object:null,_value:null,_tag:null,_transactionList:null,_index:-1,get_action:function(){return{ownerName:this.ownerName,type:this.type,id:(this._object.get_idPair?this._object.get_idPair():null),value:this.get_value(),tag:this.get_tag()};},get_value:function(){return this._value;},get_tag:function(){return this._tag;},dispose:function(){this._object=null;this._value=null;this._tag=null;}};$IG.GridAction.registerClass('Infragistics.Web.UI.GridAction');$IG.GridActionTransactionList=function(){$IG.GridActionTransactionList.initializeBase(this);};$IG.GridActionTransactionList.prototype={add_transaction:function(action,keepPrevious){if(typeof(keepPrevious)=="undefined")keepPrevious=false;if(!keepPrevious){var prevAction=action._object["_action"+action.type];if(prevAction&&prevAction._transactionList==this)this.remove_transaction(prevAction);}action._transactionList=this;action._object["_action"+action.type]=action;action._index=this._count;this._orderedList[this._count]=action;this._count++;},remove_transaction:function(action){if(action){delete action._object["_action"+action.type];delete this._orderedList[action._index];}},clear:function(){for(var i=this._count-1;i>=0;i--)this.remove_transaction(this._orderedList[i]);},get_value:function(action){return action.get_action();},get_list:function(){var list=[];var i=0;for(var action in this._orderedList){if(!isNaN(parseInt(action)))list[i++]=this._orderedList[action].get_action();}return list;},get_actionListForType:function(type){var list=[];var i=0;for(var action in this._orderedList){if(!isNaN(parseInt(action))){if(this._orderedList[action].type==type)list[i++]=this._orderedList[action];}}return list;},dispose:function(){for(var i in this._orderedList){if(!isNaN(parseInt(i))){var action=this._orderedList[i];action._transactionList=null;action._object["_action"+action.type]=null;action.dispose();}}}};$IG.GridActionTransactionList.registerClass('Infragistics.Web.UI.GridActionTransactionList',$IG.TransactionListBase);$IG.CancelBehaviorEventArgs=function(behavior){$IG.CancelBehaviorEventArgs.initializeBase(this);this._context["behavior"]=behavior.get_name();};$IG.CancelBehaviorEventArgs.prototype={_context:{}};$IG.CancelBehaviorEventArgs.registerClass('Infragistics.Web.UI.CancelBehaviorEventArgs',$IG.CancelEventArgs);$IG.IActivationBehavior=function(){};$IG.IActivationBehavior.prototype={get_activeCell:function(){},set_activeCell:function(cell,fireEvent){},_addActiveCellChangedEventHandler:function(handler){},_addActiveCellChangingEventHandler:function(handler){}};$IG.IActivationBehavior.registerInterface("Infragistics.Web.UI.IActivationBehavior");$IG.IColumnMovingBehavior=function(){};$IG.IColumnMovingBehavior.prototype={};$IG.IColumnMovingBehavior.registerInterface("Infragistics.Web.UI.IColumnMovingBehavior");$IG.IColumnResizingBehavior=function(){};$IG.IColumnResizingBehavior.prototype={};$IG.IColumnResizingBehavior.registerInterface("Infragistics.Web.UI.IColumnResizingBehavior");$IG.IEditingBehavior=function(){};$IG.IEditingBehavior.prototype={commit:function(){}};$IG.IEditingBehavior.registerInterface("Infragistics.Web.UI.IEditingBehavior");$IG.IUpdatingBehavior=function(){};$IG.IUpdatingBehavior.prototype={enterEditMode:function(cell){},exitEditMode:function(){},get_isInEditMode:function(cell){},_addExitKeyHandledEventListener:function(handler){},_registerEditableRow:function(rowElement){},_addEnteringEditEventListener:function(handler){},_addExitedEditEventListener:function(handler){}};$IG.IUpdatingBehavior.registerInterface("Infragistics.Web.UI.IUpdatingBehavior");$IG.IRowAddingBehavior=function(){};$IG.IRowAddingBehavior.prototype={get_row:function(){}};$IG.IRowAddingBehavior.registerInterface("Infragistics.Web.UI.IRowAddingBehavior");$IG.IRowDeletingBehavior=function(){};$IG.IRowDeletingBehavior.prototype={deleteRows:function(rows){}};$IG.IRowDeletingBehavior.registerInterface("Infragistics.Web.UI.IRowDeletingBehavior");$IG.ISelectionBehavior=function(){};$IG.ISelectionBehavior.prototype={get_selectedCells:function(){},get_selectedRows:function(){},get_selectedColumns:function(){},addInternalColumnSelectionChangingHandler:function(handler){}};$IG.ISelectionBehavior.registerInterface("Infragistics.Web.UI.ISelectionBehavior");$IG.IRowSelectorsBehavior=function(){};$IG.IRowSelectorsBehavior.prototype={addRowSelectorClickedEventHandler:function(handler){},addSelectorImage:function(row,cssClass){},removeSelectorImage:function(row,cssClass){},addSelectorClass:function(row,cssClass){},removeSelectorClass:function(row,cssClass){}};$IG.IRowSelectorsBehavior.registerInterface("Infragistics.Web.UI.IRowSelectorsBehavior");$IG.IColumnSettings=function(){};$IG.IColumnSettings.prototype={get_columnSettings:function(){}};$IG.IColumnSettings.registerInterface("Infragistics.Web.UI.IColumnSettings");$IG.ColumnSetting=function(adr,element,props,owner,csm){$IG.ColumnSetting.initializeBase(this,[adr,element,props,owner,csm]);};$IG.ColumnSetting.prototype={get_columnKey:function(){return this._get_clientOnlyValue('ck');}};$IG.ColumnSetting.registerClass('Infragistics.Web.UI.ColumnSetting',$IG.ObjectBase);$IG.ColumnSettingProps=new function(){this.Count=$IG.ObjectBaseProps.Count;};$IG.IDPair=function(index,key){if(typeof(index)!="undefined")this.index=index;if(typeof(key)!="undefined"&&key!==null){if(typeof(key)=="string")this.key=key.split(",");else if(key.length)this.key=key;else this.key=[key];}};$IG.IDPair.prototype={index:-1,key:[]};$IG.GridUtility=function(gridObj){this._grid=gridObj;};$IG.GridUtility.prototype={scrollCellIntoViewIE:function(cell){var elem=cell.get_element();var row=cell.get_row();var scrollContainer=this._grid._elements["container"];var scrollLeft=scrollContainer.scrollLeft;var bounds=Sys.UI.DomElement.getBounds(elem);var scrollBounds=(scrollLeft+scrollContainer.offsetWidth);var elemBounds=elem.offsetLeft+bounds.width;if(elem.offsetLeft>scrollBounds||elemBounds<scrollLeft||elem.offsetLeft<=scrollBounds&&elemBounds>scrollBounds||elem.offsetLeft<=scrollLeft&&elemBounds>=scrollLeft){scrollLeft=elemBounds-(scrollContainer.offsetWidth);}var delegate=Function.createDelegate(this,this._onContainerScroll);this._newScrollLeft=scrollLeft;$addHandler(scrollContainer,"scroll",delegate);if(row._container!=null&&row._container!=scrollContainer){$addHandler(row._container,"scroll",delegate);}elem.focus();$removeHandler(scrollContainer,"scroll",delegate);scrollContainer.scrollLeft=this._newScrollLeft;if(row._container!=null&&row._container!=scrollContainer){$removeHandler(row._container,"scroll",delegate);row._container.scrollLeft=scrollLeft;}},_onContainerScroll:function(evnt){evnt.target.scrollLeft=this._newScrollLeft;$util.cancelEvent(evnt);},findRowIndexByCellElem:function(elem){var obj=$util.resolveMarkedElement(elem.parentNode);if(obj){var type=obj[0].getAttribute("type");if(type=="row")return obj[1];}return null;},getRowFromCellElem:function(elem){var parentRow=elem.parentNode;while(parentRow&&(parentRow.tagName!="TR"||!parentRow.id))parentRow=parentRow.parentNode;var obj=null;if(parentRow)obj=$util.resolveMarkedElement(parentRow);if(obj){var elem=obj[0];var type=elem.tagName;if(type=="TR"){var index=parseInt(obj[1]);if(!isNaN(index)){var auxRow=elem.getAttribute("auxRow");if(auxRow!==null)return this._grid._get_auxRows(auxRow)[index];else return this._grid.get_rows().get_row(index);}else{if(elem._object!=null){return elem._object;}}}}return null;},getCellFromElem:function(elem){var obj=$util.resolveMarkedElement(elem);if(obj!=null){elem=obj[0];var type=elem.getAttribute("type");if(type=="cell"){var row=this.getRowFromCellElem(elem);if(row)return row.get_cell(obj[1]);}}return null;},getCellIndexFromElem:function(elem){return elem.cellIndex-this._grid._get_cellIndexOffset();},getCellElemFromIndex:function(row,index){return row._get_cellElementByIndex(row.get_element(),index+this._grid._get_cellIndexOffset());},getNextCell:function(cell){var cellIndex=cell.get_index();var visibleIndex=this._grid.get_columns().get_column(cellIndex).get_visibleIndex();var row=cell.get_row();if(visibleIndex==row.get_cellCount()-1){var rows=this._grid.get_rows();if(this._grid._isAuxRow(row)){var auxAlign=(this._grid._isAuxRow(row,$IG.GridAuxRows.Top)?$IG.GridAuxRows.Top:$IG.GridAuxRows.Bottom);var auxRows=this._grid._get_auxRows(auxAlign);var index=this._grid._get_auxRowIndex(row,auxAlign);if(index<auxRows.length-1)return auxRows[index+1].get_cell(0);else if(auxAlign==$IG.GridAuxRows.Top&&rows.get_length()>0)return rows.get_row(0).get_cell(this._findFirstVisibleColumn().get_index());}else{var rowIndex=row.get_index();if(rowIndex!=rows.get_length()-1){var nextRow=rows.get_row(rowIndex+1);if(nextRow!=null)return nextRow.get_cell(this._findFirstVisibleColumn().get_index());}else{var auxRows=this._grid._get_auxRows($IG.GridAuxRows.Bottom);if(auxRows&&auxRows.length)return auxRows[0].get_cell(this._findFirstVisibleColumn().get_index());}}}else return row.get_cell(this._getColumnAdrFromVisibleIndex(visibleIndex+1));},getNextCellVert:function(cell){var row=cell.get_row();var rowIndex=row.get_index();var rows=this._grid.get_rows();if(this._grid._isAuxRow(row)){var auxAlign=(this._grid._isAuxRow(row,$IG.GridAuxRows.Top)?$IG.GridAuxRows.Top:$IG.GridAuxRows.Bottom);var auxRows=this._grid._get_auxRows(auxAlign);var index=this._grid._get_auxRowIndex(row,auxAlign);if(index<auxRows.length-1)return auxRows[index+1].get_cell(cell.get_index());else if(auxAlign==$IG.GridAuxRows.Top&&rows.get_length()>0)return rows.get_row(0).get_cell(cell.get_index());}else{if(rowIndex<rows.get_length()-1){var nextRow=rows.get_row(rowIndex+1);if(nextRow!=null)return nextRow.get_cell(cell.get_index());}else{var auxRows=this._grid._get_auxRows($IG.GridAuxRows.Bottom);if(auxRows&&auxRows.length)return auxRows[0].get_cell(cell.get_index());}}},getPrevCell:function(cell){var cellIndex=cell.get_index();var visibleIndex=this._grid.get_columns().get_column(cellIndex).get_visibleIndex();var row=cell.get_row();if(visibleIndex==0){var rows=this._grid.get_rows();var nextRow=null;if(this._grid._isAuxRow(row)){var auxAlign=(this._grid._isAuxRow(row,$IG.GridAuxRows.Top)?$IG.GridAuxRows.Top:$IG.GridAuxRows.Bottom);var auxRows=this._grid._get_auxRows(auxAlign);var index=this._grid._get_auxRowIndex(row,auxAlign);if(index>0)nextRow=auxRows[index-1];else if(auxAlign==$IG.GridAuxRows.Bottom&&rows.get_length()>0)nextRow=rows.get_row(rows.get_length()-1);}else{var rowIndex=row.get_index();if(rowIndex!=0)nextRow=rows.get_row(rowIndex-1);else{var auxRows=this._grid._get_auxRows($IG.GridAuxRows.Top);if(auxRows&&auxRows.length)nextRow=auxRows[auxRows.length-1];}}if(nextRow!=null)return nextRow.get_cell(this._findLastVisibleColumn().get_index());}else return row.get_cell(this._getColumnAdrFromVisibleIndex(visibleIndex-1));},getPrevCellVert:function(cell){var row=cell.get_row();var rowIndex=row.get_index();var rows=this._grid.get_rows();if(this._grid._isAuxRow(row)){var auxAlign=(this._grid._isAuxRow(row,$IG.GridAuxRows.Top)?$IG.GridAuxRows.Top:$IG.GridAuxRows.Bottom);var auxRows=this._grid._get_auxRows(auxAlign);var index=this._grid._get_auxRowIndex(row,auxAlign);if(index>0)return auxRows[index-1].get_cell(cell.get_index());else if(auxAlign==$IG.GridAuxRows.Bottom&&rows.get_length()>0)return rows.get_row(rows.get_length()-1).get_cell(cell.get_index());}else{if(rowIndex!=0){var nextRow=this._grid.get_rows().get_row(rowIndex-1);if(nextRow!=null)return nextRow.get_cell(cell.get_index());}else{var auxRows=this._grid._get_auxRows($IG.GridAuxRows.Top);if(auxRows&&auxRows.length)return auxRows[auxRows.length-1].get_cell(cell.get_index());}}},getCellIDPairFromElem:function(element){var row=this.getRowFromCellElem(element);if(row){var column=this._grid.get_columns().get_column(this.getCellIndexFromElem(element));if(column)return new $IG.CellIDPair(row.get_idPair(),column.get_idPair());}return null;},getNextRow:function(element){var rows=this._grid._elements.dataTbl.rows;if(!element)return rows[0];if(element.rowIndex==rows.length-1)return null;return rows[element.rowIndex+1];},getPrevRow:function(element){var rows=this._grid._elements.dataTbl.rows;if(!element)return rows[rows.length-1];if(element.rowIndex==0)return null;return rows[element.rowIndex-1];},_registerEventListener:function(obj,evntName,listener){if(obj._internalEventListeners==null)obj._internalEventListeners={};if(obj._internalEventListeners[evntName]==null)obj._internalEventListeners[evntName]=[];obj._internalEventListeners[evntName].push(listener);},_fireEvent:function(obj,evntName,args){if(obj._internalEventListeners==null)return;var listeners=obj._internalEventListeners[evntName];if(listeners!=null&&listeners.length>0){for(var i=0;i<listeners.length;i++)if(listeners[i](args))return true;}return false;},_unregisterEventListener:function(obj,evntName,listener){if(obj._internalEventListeners==null)return;var listeners=obj._internalEventListeners[evntName];if(listeners!=null&&listeners.length>0){for(var i=0;i<listeners.length;i++){if(listeners[i]==listener){Array.removeAt(obj._internalEventListeners[evntName],i);return;}}}},areIdPairsEqual:function(idPair1,idPair2){if(!idPair1||!idPair2)return false;if(!(idPair1.key==null&&idPair2.key==null)){if(idPair1.key.length!=idPair2.key.length)return false;for(var i=0;i<idPair1.key.length;i++)if(idPair1.key[i]!=idPair2.key[i])return false;}if(idPair1.index!=idPair2.index)return false;return true;},_get_gridWidth:function(){return $util.getRuntimeStyle(this._grid._element).width;},_get_containerTableWidth:function(){return $util.getRuntimeStyle(this._grid._elements.dataTbl).width;},_get_containerTableWidthResolved:function(){return this._grid._elements.dataTbl.offsetWidth;},_set_containerTableWidth:function(value){this._grid._elements.dataTbl.style.width=value;},_getColumnFromHeader:function(headerElem){if(!headerElem)return null;var adr=headerElem.getAttribute("adr");if(adr<0||adr>=this._grid.get_columns().get_length())return null;return this._grid.get_columns().get_column(adr);},_getColumnAdrFromVisibleIndex:function(index){var column=null;var columns=this._grid.get_columns();for(var i=0;i<columns.get_length()&&!column;i++){if(columns._items[i]._visibleIndex==index)column=columns.get_column(i);}if(column)return column.get_index();return null;},_findLastVisibleColumn:function(){var column=null;var index=null;var columns=this._grid.get_columns();for(var i=0;i<columns.get_length();i++){if(index==null||columns._items[i]._visibleIndex>index){column=columns.get_column(i);index=column._visibleIndex;}}return column;},_findFirstVisibleColumn:function(){var column=null;var index=null;var columns=this._grid.get_columns();for(var i=0;i<columns.get_length();i++){if(index==null||columns._items[i]._visibleIndex<index){column=columns.get_column(i);index=column._visibleIndex;}}return column;},_getPreviousRenderedColumn:function(column){var index=column.get_visibleIndex()-1;if(index<0)return null;var columns=this._grid.get_columns();for(var i=0;i<columns.get_length();i++){var column=columns.get_column(i);if(column.get_visibleIndex()==index)return column;}},_getGridCellFromElement:function(element){while(element&&(element.tagName!="TD"&&element.tagName!="TH"||element.parentNode.id.indexOf("adr")==-1&&element.parentNode.getAttribute("adr")===null))element=element.parentNode;return element;},dispose:function(){this._grid=null;}};$IG.GridUtility.registerClass("Infragistics.Web.UI.GridUtility");$IG.EditorProvider=function(adr,elem,props,owner,csm){var input=elem;var grid=owner;if(!elem){if(grid._editorProvidersPool){var id=grid._element.id+"_"+adr;elem=document.getElementById(id);if(!elem){elem=document.createElement('DIV');grid._editorProvidersPool.appendChild(elem);elem.id=id;if($util.IsSafari)elem.style.position="absolute";$util.display(elem,true);input=document.createElement('INPUT');elem.appendChild(input);}else input=elem.firstChild;}}else{if($util.IsSafari&&elem.nodeName=='DIV')elem.style.position="absolute";var nodes=elem.childNodes;var i=-1,len=nodes?nodes.length:0;if(len>5)len=5;while(++i<len)if(nodes[i].nodeName=='INPUT'&&nodes[i].type=='text')input=nodes[i];}$IG.EditorProvider.initializeBase(this,[adr,elem,props,owner,csm]);if(elem){elem.control=this;this._input=input;}};$IG.EditorProvider.prototype={get_inputElement:function(){return this._input;},get_value:function(){var elem=this.get_inputElement();return elem?elem.value:null;},set_value:function(val,text){var elem=this.get_inputElement();if(elem)elem.value=(val==null?text:val);},get_text:function(){},showEditor:function(top,left,width,height,cssClass,parent,cell){var x=parent.scrollLeft,y=parent.scrollTop,cWidth=parent.clientWidth,cHeight=parent.clientHeight;if(!x)x=0;if(!y)y=0;if(!cWidth||cWidth<5)cWidth=parent.offsetWidth;if(!cHeight||cHeight<5)cHeight=parent.offsetHeight;var i=0,tr=parent;while(i++<4&&tr&&tr.nodeName!='TR')tr=tr.parentNode;this._offsetTop=(tr&&i<4)?tr.offsetTop:20;this._x=x;this._y=y;this._cWidth=cWidth;this._cHeight=cHeight;i=this._owner._element.offsetHeight-this._offsetTop-cHeight;if(i>1)this._cHeight+=i;if(x>left){width+=left-x;if(width<5)width=5;left=x;}if(left+width>x+cWidth){width=x+cWidth-left;if(width<5){left+=width-5;width=5;}}if(y>top){height+=top-y;if(height<5)height=5;top=y;}if(top+height>y+cHeight){height=y+cHeight-top;if(height<5){top+=height-5;height=5;}}this._show(top,left,width,height,cssClass,parent,cell);},_show:function(top,left,width,height,cssClass,parent,cell){var input=this.get_inputElement();this._setBounds(top,left,height,this._element.style,parent,cell);this._setCss(input,cssClass);var style=input.style;style.height=height+'px';style.width=width+'px';var diff=input.offsetWidth-width;if(diff!=0)if((width-=diff)>2)style.width=width+'px';diff=input.offsetHeight-height;if(diff!=0)if((height-=diff)>2)style.height=height+'px';try{input.select();input.focus();}catch(diff){}this._addHandlers();},_getWrapper:function(elem,css){if(!this._wrapper){this._wrapper=document.createElement('DIV');var container=elem.parentNode;container.removeChild(elem);container.appendChild(this._wrapper);this._wrapper.setAttribute("_wrapper",1);this._wrapper.appendChild(elem);}this._setCss(this._wrapper,css);return this._wrapper;},_setCss:function(elem,css){var css0=elem.className;if(css&&css0.indexOf(css)<0){if(css0&&css0.length>0)css+=' '+css0;elem.className=css;}},_addHandlers:function(){var input=this.get_inputElement();if(!input||this._hasLsnr)return;if(!this._onBlurFn){this._onBlurFn=Function.createDelegate(this,this._onBlurHandler);this._onKeyFn=Function.createDelegate(this,this._onKeyDownHandler);}this._hasLsnr=true;$addHandler(input,'blur',this._onBlurFn);$addHandler(input,'keydown',this._onKeyFn);},_removeHandlers:function(){if(this._hasLsnr){var input=this.get_inputElement();if(input._events){$removeHandler(input,'blur',this._onBlurFn);$removeHandler(input,'keydown',this._onKeyFn);}}this._hasLsnr=false;},_setBounds:function(top,left,height,style,parent,cell,elem){if(this._owner)this._owner._ensureEditorProvidersPool(parent);style.display='';style.visibility='visible';var tblHeight=0,tblWidth=0,editorHeight=height;if(cell)cell=cell._element;if(cell){tblHeight=this._y+this._cHeight;tblWidth=this._x+this._cWidth;}var aboveBelow=0;if(elem){editorHeight=elem.offsetHeight;if(cell)aboveBelow=cell.parentNode.getAttribute('mkr');if(aboveBelow=='addNewRow')aboveBelow=-1;else if(aboveBelow=='filterRow')aboveBelow=1;else aboveBelow=0;if(aboveBelow<0)top-=editorHeight;else top+=height;if(tblHeight>9){var shiftBot=tblHeight-top-editorHeight;if(aboveBelow==0&&shiftBot<0){var y=this._y-this._offsetTop;var shiftTop=top-y-height-editorHeight;if(shiftTop>shiftBot)top=shiftTop+y;else top+=shiftBot;if(top<y)top=y;}var editorWidth=elem.offsetWidth;if(editorWidth<5)if((editorWidth=elem.firstChild.offsetWidth)<5)editorWidth=5;if(left+editorWidth>tblWidth)left=tblWidth-editorWidth;if(left<this._x)left=this._x;}}this._fixValidator(top,editorHeight,tblHeight);if(Sys.Browser.agent==Sys.Browser.Safari){top-=parent.scrollTop;left-=parent.scrollLeft;}style.marginTop=top+'px';style.marginLeft=left+'px';style.zIndex=1000;style.color='black';},_fixValidator:function(top,height,tblHeight){var validator=this._validator,elem=this._element;var style=validator?validator.style:null;if(!style)return;var nodes=elem.childNodes,i=-1;while(++i<nodes.length)if(nodes[i]==validator)break;if(i==nodes.length){validator.parentNode.removeChild(validator);elem.insertBefore(validator,elem.firstChild);style.position='absolute';style.left=style.top=style.marginTop='';}var mt=validator.offsetHeight;if(tblHeight<10||top+height+mt<tblHeight||top<mt)mt=height+2;else mt=-(mt+2);style.marginTop=mt+'px';},_areEqual:function(val1,val2){if(val1==val2)return true;if(val1&&val2&&val1.getTime&&val2.getTime)return val1.getTime()==val2.getTime();return false;},notifyLostFocus:function(e){},hideEditor:function(){var elem=this._element;if(!elem)return;this._removeHandlers();$util.display(elem,true);},dispose:function(){this.hideEditor();this._input=null;if(typeof(this._editor)!="undefined"&&this._editor&&typeof(this._editor.dispose)=="function"){if(this._element)this._element.control=null;this._editor.dispose();}this._editor=null;$IG.EditorProvider.callBaseMethod(this,'dispose');},_onKeyDownHandler:function(e){var key=e.keyCode;if(key==Sys.UI.Key.tab||key==Sys.UI.Key.esc||key==Sys.UI.Key.enter)this.notifyLostFocus(e);},_onBlurHandler:function(e){this.notifyLostFocus(e);},_get_outOfBouns:function(){return false;}};$IG.EditorProvider.registerClass('Infragistics.Web.UI.EditorProvider',$IG.ObjectBase); 
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();