/*!@license
* Infragistics.Web.ClientUI Combo 13.1.20131.2523
*
* Copyright (c) 2011-2014 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery-1.4.4.js
* jquery.ui.core.js
* jquery.ui.widget.js
* infragistics.util.js
* infragistics.dataSource.js
*
* Example to use:
*	<script type="text/javascript">
*	$(function () {
*		$('#combo1').igCombo();
*	});
*	</script>
*	<input id="combo1" />
*/
(function($){var _aNull=function(v,nan){return v===null||v===undefined||nan&&typeof v==="number"&&isNaN(v)},_toPx=function(val){if(!val){return 0}if(typeof val==="number"){return val}val=val.toString();val=val.match(/[e%mitc]/i)?0:parseFloat(val);return isNaN(val)?0:Math.floor(val+.5)},_px=function(elem,css){return _toPx(elem.css(css))},_notab=function(elem){return elem.attr("tabIndex",-1).css("outline",0).attr("unselectable","on")},_stop=function(e){try{e.preventDefault();e.stopPropagation()}catch(ex){}},_equals=function(o1,o2){return o1===o2||o1&&o2&&o1.getTime&&o2.getTime&&o1.getTime()===o2.getTime()},_now=function(){return(new Date).getTime()},_offset=function(e,xy){return $.ig.util?$.ig.util.offset(e,xy):xy||(e?e.offset():null)},_listIDShift=100,_cascWait;$.widget("ui.igCombo",{options:{height:null,width:null,tabIndex:null,animationShowDuration:100,animationHideDuration:50,enableDisplayBlock:false,mode:"editable",dropDownOnFocus:false,renderMatchItems:"multi",caseSensitive:false,filteringCondition:"contains",filteringType:null,filterExprUrlKey:null,autoComplete:false,format:true,selectedItems:[{index:-1,value:null,text:null}],multiSelection:"off",enableActiveItem:true,allowCustomValue:false,clearSelectionOnBlur:false,selectItemBySpaceKey:false,itemSeparator:", ",dropDownWidth:0,dropDownMaxHeight:300,dropDownMinHeight:0,dropDownAsChild:false,virtualization:false,showDropDownButton:true,enableClearButton:true,noMatchFoundText:null,dropDownButtonTitle:null,clearButtonTitle:null,text:null,itemTemplate:null,headerTemplate:null,footerTemplate:null,nullText:null,dataSource:null,dataSourceType:null,dataSourceUrl:null,responseTotalRecCountKey:null,responseDataKey:null,responseContentType:null,requestType:"GET",validatorOptions:null,inputName:null,loadOnDemandSettings:{enabled:false,pageSize:null},dataBindOnOpen:false,closeDropDownOnSelect:true,closeDropDownOnBlur:true,valueKeyType:null,textKeyType:null,valueKey:null,textKey:null,parentCombo:null,cascadingDataSources:null,parentComboKey:null},events:{dropDownOpening:null,dropDownOpened:null,dropDownClosing:null,dropDownClosed:null,dataBinding:null,dataBound:null,textChanged:null,selectionChanging:null,selectionChanged:null,activeItemChanging:null,activeItemChanged:null,noMatchFound:null,filtering:null,filtered:null},css:{combo:"ui-igcombo ui-state-default ui-widget ui-corner-all",field:"ui-igcombo-field ui-corner-all",fieldHolder:"ui-igcombo-fieldholder",fieldHolderRTL:"ui-igcombo-fieldholder-rtl ui-corner-right",fieldHolderLTR:"ui-igcombo-fieldholder-ltr ui-corner-left",hover:"ui-igcombo-hover ui-state-hover",focus:"ui-igcombo-focus ui-state-focus",fieldHover:"ui-igcombo-field-hover",fieldFocus:"ui-igcombo-field-focus",disabled:"ui-igcombo-disabled ui-state-disabled",waitFiltering:"ui-igcombo-waitfiltering",nullText:"ui-igcombo-nulltext",button:"ui-igcombo-button ui-state-default",buttonRTL:"ui-igcombo-button-rtl ui-corner-left",buttonLTR:"ui-igcombo-button-ltr ui-corner-right",buttonFocus:"ui-igcombo-button-focus",buttonHover:"ui-igcombo-button-hover ui-state-hover",buttonPressed:"ui-igcombo-button-pressed ui-state-highlight",buttonIcon:"ui-igcombo-buttonicon ui-icon-triangle-1-s ui-icon",clear:"ui-igcombo-clear",clearHover:"ui-igcombo-clear-hover ui-state-hover",clearPressed:"ui-igcombo-clear-pressed ui-state-highlight",clearFocus:"ui-igcombo-clear-focus",clearIcon:"ui-igcombo-clearicon ui-icon-circle-close ui-icon",checkbox:"ui-state-default ui-corner-all ui-igcombo-checkbox ui-igcheckbox-small",checkboxHover:"ui-state-hover ui-igcombo-checkbox-hover",checkboxIconHover:"ui-state-hover ui-igcombo-checkboxicon-hover",checkboxOff:"ui-icon ui-igcombo-checkbox-off ui-igcheckbox-small-off",checkboxOn:"ui-icon ui-icon-check ui-igcombo-checkbox-on ui-igcheckbox-small-on",list:"ui-igcombo-list ui-widget ui-widget-content ui-corner-all",listItemHolder:"ui-igcombo-listitemholder",listItem:"ui-igcombo-listitem ui-state-default",listItemHover:"ui-igcombo-listitem-hover ui-state-hover",listItemActive:"ui-igcombo-listitem-active ui-state-active",listItemSelected:"ui-igcombo-listitem-selected ui-state-highlight",listItemMatch:"ui-igcombo-listitem-match",listItemTextWithCheckbox:"ui-igcombo-listitemtextwithcheckbox",noTopCorners:"ui-igcombo-no-top-corners",noBottomCorners:"ui-igcombo-no-bottom-corners"},RECORDS_VIEW:"{0}",RECORDS_DATA:"{1}",RECORDS_SERVER:"{2}",RECORDS_SERVER_TOTAL:"{3}",_create:function(){var name,evts,inp,i,len,clear,but,sel,txt,fieldHolder,touch,me=this,o=me.options,css=me.css,elem=me.element,selItems=o.selectedItems,fl="float",field=elem,rtl=elem.css("direction")==="rtl",oldC={display:0,visibility:0,position:0},oldA={title:0};me._data=[];me._rtl=rtl;me._lastScroll=me._virtualTop=me._topID=0;me._changeID=me._activeID=me._scrollTo=-1;i=me._noMouse()?null:o.renderMatchItems;me._matchFlag=i&&i!=="none"?i:null;if(o.id!==undefined&&o.id!==null&&o.id!==""&&(elem.attr("id")===undefined||elem.attr("id").toString()==="")){elem.attr("id",o.id)}if(selItems&&selItems.length===1&&selItems[0].index===-1&&selItems[0].value===null){o.selectedItems=selItems=null}name=elem[0].nodeName;if(name){name=name.toUpperCase()}inp=name==="INPUT";me._SELECT=sel=name==="SELECT";if(!o.inputName){me._oldCss=oldC;me._oldAttr=oldA}if(inp){oldA.value=oldA.disabled=oldA.readOnly=oldA.alt=oldA.tabIndex=oldC.textAlign=oldC.position=oldC.overflow=oldC[fl]=0}else if(sel){if(!o.dataSource){sel=elem[0].options;len=sel.length;if(!selItems||selItems.length===0){clear=selItems=o.selectedItems=[]}o.dataSource=[];o.valueKey="value";o.textKey="text";for(i=0;i<len;i+=1){txt=sel[i].text||sel[i].innerHTML;o.dataSource[i]={value:sel[i].value||txt,text:txt};if(clear&&(i===elem[0].selectedIndex||sel[i].selected)){selItems.push({index:i})}}}}else{if(name!=="DIV"&&name!=="SPAN"){throw new Error(name+" is not supported as base element")}oldA.innerHTML=0}for(i in oldC){if(oldC.hasOwnProperty(i)){oldC[i]=elem.css(i)}}for(i in oldA){if(oldA.hasOwnProperty(i)){oldA[i]=elem[0][i]}}oldC.width=elem[0].style.width;o.width=o.width||oldC.width;oldC.height=elem[0].style.height;o.height=o.height||oldC.height;if(selItems&&selItems.length>0){txt=""}else if(_aNull(txt=o.text)){if(!elem[0].multiple){txt=o.inputName?"":inp?oldA.value:sel?elem.val():oldA.innerHTML}txt=txt?txt.replace(/[\x09\x0a]/g,""):"";i=txt.length;while((i-=1)>=0){if(txt.charCodeAt(i)===32){txt=txt.substring(0,i)}else{break}}}if(inp||sel){me._swap=true;elem=$("<span />").css({position:field.css("position"),left:field.css("left"),top:field.css("top")}).insertBefore(field);if(rtl){elem.css("direction","rtl")}if(sel){field.css("display","none");field=$("<input />")}}else{field=$("<input />");if(!o.inputName){elem.html("")}}me._oldTxt="";me.mainElem=elem;i=elem.css("position");me._static=!i||i==="static";elem.css("overflow","hidden");me._fieldHolder=fieldHolder=$("<span />").addClass(css.fieldHolder).addClass(rtl?css.fieldHolderRTL:css.fieldHolderLTR).css("float",rtl?"right":"left").appendTo(elem);me.fieldElem=field.appendTo(fieldHolder).addClass(css.field).css("float",rtl?"right":"left").bind(me._evts={keydown:function(e){me._onKey(e,0)},keypress:function(e){me._onKey(e,1)},keyup:function(e){me._onKey(e,2)},focus:function(e){me._onEvt(this,8,e)},blur:function(e){me._onEvt(this,9,e)},paste:function(e){me._onChange(e)},beforecut:function(e){me._onChange(e)},cut:function(e){me._onChange(e)},drop:function(e){me._onChange(e)}});if(!_aNull(i=o.tabIndex)){field.attr("tabIndex",i)}field[0].disabled=o.disabled;field[0].readOnly=this._mode(o)>0?"readonly":"";elem.addClass(css.combo).css("display","inline-block").bind(me._elemEvts={MSPointerOver:function(e){me._onEvt(this,26,e)},pointerover:function(e){me._onEvt(this,26,e)},mouseover:function(e){me._onEvt(null,6,e)},mouseleave:function(e){me._onEvt(null,7,e)}});me._mEvts=evts={mousedown:function(e){me._onEvt(this,3,e)},mouseup:function(e){me._onEvt(this,4,e)},MSPointerOver:function(e){me._onEvt(this,26,e)},pointerover:function(e){me._onEvt(this,26,e)},mouseover:function(e){me._onEvt(this,6,e)},mouseleave:function(e){me._onEvt(this,7,e)}};me._tEvts=touch={touchstart:function(e){_stop(e)},touchmove:function(e){_stop(e)},touchend:function(e){_stop(e);var el=$(this);setTimeout(function(){el.trigger("mousedown").trigger("mouseup")},350)}};me.buttonElem=but=_notab($("<span />").addClass(css.button).addClass(rtl?css.buttonRTL:css.buttonLTR).css("float",rtl?"left":"right").attr("data-id",1).appendTo(elem).bind(evts).bind(touch));_notab($("<span />").addClass(css.buttonIcon).appendTo(but).bind(touch));me.clearElem=clear=_notab($("<span />").addClass(css.clear).css("float",rtl?"left":"right").attr("data-id",2).appendTo(fieldHolder).bind(evts).bind(touch));_notab($("<span />").addClass(css.clearIcon).appendTo(clear).bind(touch));me._titles();me.validator();me._clearOn=false;me._doSize();i=me._cascade();if(i){if(i!==true){if(typeof i==="string"){i=i.replace("#","")}_cascWait=_cascWait||{};if(_cascWait[i]){_cascWait[i].push(me)}else{_cascWait[i]=[me]}}}else if(!o.dataBindOnOpen){me.dataBind()}if(txt){me.text(txt)}me._canFire=true},dropDownVisible:function(showHide,fire){if(!arguments.length){return!!this._ddOn}this._canFire=fire;this._doDrop(showHide?2:0);this._canFire=true;return this},remove:function(){var p,v=this._validator,e=this.mainElem;if(!e||!e[0]){return}if(v){v.hide()}if(this._fcs){this._onEvt(null,9)}this.fieldElem.removeClass(this.css.fieldHover);e.removeClass(this.css.hover);p=e[0].parentNode;if(p&&p.tagName){this._doDrop(0);this._fcs=0;p.removeChild(e[0])}return this},validator:function(destroy){var o=this.options.validatorOptions,field=this.fieldElem,v=this._validator;if(v&&(destroy||!o)){v.destroy();delete this._validator}else if(!v&&!destroy&&o&&field.igValidator){o.combo=o.element=this.mainElem;this._validator=field.igValidator(o).data("igValidator")}return this._validator},validate:function(){return this._validator?this._validator.validate():null},setFocus:function(delay){var me=this;if(me.fieldElem&&!me._fcs){if(delay===-1){try{me.fieldElem[0].focus()}catch(ex){}}else{setTimeout(function(){me.setFocus(-1)},delay||0)}}return this},hasFocus:function(){return this._fcs===1},isSelected:function(index){var selItems=this.options.selectedItems,len=selItems?selItems.length:0;while((len-=1)>=0){if(selItems[len].index===index){return true}}return false},selectedIndex:function(index,fire){if(index===undefined){var i,selItems=this.options.selectedItems,len=selItems?selItems.length:0;index=-1;while((len-=1)>=0){i=selItems[len].index;index=index<0?i:Math.min(i,index)}return index}this._canFire=fire!==false&&(fire||this._cascFire);this._select(index);this._updateFromList(null,1);this._fixNull();this._canFire=true;return this},activeIndex:function(index,fire){if(index===undefined){return this._activeID}this._canFire=fire;this._activate(index);this._canFire=true;return this},value:function(val,fire){if(this._noMouse()){return this.text(val,fire)}if(val===undefined){val=this.options.selectedItems;return val&&val[0]?val[0].value:null}this._canFire=fire!==false&&(fire||this._cascFire);this._valTime=_now();this._valLast=val;this._select(null,val);this._updateFromList(null,1);this._canFire=true;return this},text:function(text,fire){if(text===undefined){text=this.fieldElem.val();return this._nullT&&(!text||text===this.options.nullText)?"":text}this._canFire=fire!==false&&(fire||this._cascFire);this._select(null,text,2);this._updateFromList(null,1);if(this._custom()){this._onChange(null,null,text)}this._canFire=true;return this},values:function(vals){var o=this.options,selItems=o.selectedItems,i=selItems?selItems.length:0;if(vals===undefined){vals=[];while((i-=1)>=0){vals[i]=selItems[i].value}return vals}i=vals?vals.length:0;selItems=[];while((i-=1)>=0){selItems[i]={value:vals[i]}}o.selectedItems=selItems;this._initSel(o);return this},itemByIndex:function(id){return id<0?null:{element:this._findItem(id),index:id,value:this._item(id),text:this._item(id,2)}},itemByValue:function(val){var id=-1;while(++id<this._count){if(_equals(val,this._item(id))){return this.itemByIndex(id)}}},getFooter:function(){return this.listElem?this.listElem.find("[data-footer]"):null},getDataSource:function(){return this._dataSource},getData:function(){return this._data},getRecordsCount:function(flag){var count=this._count,ds=this._dataSource;if(flag===this.RECORDS_VIEW||flag===0){return count}if(ds){count=ds._data.length;if(flag===this.RECORDS_DATA||flag===1){return count}count=Math.max(ds.totalRecordsCount(),count);if(flag===this.RECORDS_SERVER||flag===2){return count}if(flag===this.RECORDS_SERVER_TOTAL||flag===3){count=Math.max(Math.max(count,this._totalAll||0),parseInt(this.options._totalAll||0,10))}}return count},listScrollTop:function(val){if(val!==undefined&&!this._ddOn){this.dropDownVisible(true)}var dd=this._ddScroll||this._ddCont;if(val===undefined){return dd?dd[0].scrollTop:0}if(dd){dd[0].scrollTop=val||0}return this},_cascade:function(evt,destroy,combo){var key,i,url,me=this,val=me._parentCombo,o=me.options,ds=o.cascadingDataSources,old=me._cascOpt,parent=combo||o.parentCombo;combo=evt?val:parent;if(val&&!evt){key=val._cascFire;i=key?key.length:0;while(i-->0){if(key[i]===me){key.splice(i,1);if(key.length===0){delete val._cascFire}break}}delete me._parentCombo;delete me._cascFilter;if(destroy){return}if(old){o.valueKey=old.value;o.textKey=old.text;o.dataSource=old.ds;o.dataSourceUrl=old.url;if(!combo){me.dataBind()}}}if(!combo||destroy){return}if(evt){delete me._cascSel;me.selectedIndex(-1);me.activeIndex(-1)}else{if(!ds){key=o.parentComboKey;if(!key){return}if(o.filteringType==="remote"){me._cascFilter=-1}else{o.filteringType="local";me._cascFilter=1}me._cascKey=key;url=o.dataSource?null:o.dataSourceUrl}if(typeof combo==="string"||combo.nodeName){combo=$(parent);if(combo.length!==1){combo=$("#"+parent);if(combo.length!==1){return parent}}}if(combo&&combo[0]&&typeof combo.data==="function"){parent=combo[0];combo=combo.data("igCombo")}if(!combo||combo.widgetName!=="igCombo"||combo===me){return parent}key=combo._cascFire;i=key?key.length:0;while(i-->0){if(key[i]===me){break}}if(i<0){combo._cascFire=key=key||[];key.push(me)}me._parentCombo=combo;if(!old&&ds){old=me._cascOpt={value:o.valueKey,text:o.textKey,ds:o.dataSource,url:o.dataSourceUrl}}if(!combo._hasData){return parent}}val=combo.options.selectedItems;val=val&&val.length>0?val[0].value:null;if(me._valTime&&_now()-me._valTime<200){me._valTime=1}if(ds){ds=val===null?null:ds[val];val=ds?ds.valueKey:null;o.valueKey=val||old.value;val=ds?ds.textKey:null;o.textKey=val||old.text;o.dataSourceUrl=url=ds?ds.dataSourceUrl:null;o.dataSource=ds?ds.dataSource||(ds.length&&!url?ds:null):null;me._hasData=false;me._urlBind=me._lod=me._totalAll=o._totalAll=me._count=0;me._cascUrl=url;if(url){val=o.selectedItems;me._cascSel=val?val[0]?val[0].value:null:null}me.dataBind();delete me._cascUrl}else{me._cascVal=val;if(me._hasData){if(_aNull(val,true)||val===""){me._dataChange()}else{me.filter()}}else{me._cascUrl=url;me.dataBind();delete me._cascUrl}}return true},_noMouse:function(){var o=this.options,ds=o.dataSource;o=o.itemTemplate;return o&&ds&&ds.length===1&&o.indexOf("{")<0&&o.indexOf("}")<0},_custom:function(){return this.options.allowCustomValue||this._noMouse()},_multi:function(o){o=o.multiSelection;return o&&o!=="off"},_checkBox:function(o){o=o.multiSelection;return o===2||o&&o.toLowerCase&&o.toLowerCase()==="onwithcheckboxes"},_mode:function(o){o=o.mode;return o===1||o==="dropdown"?1:o===2||o==="readonlylist"?2:o===3||o==="readonly"?3:0},_fixSelElem:function(elem,sel){var css=this.css,icon=css.listItemSelected,iconOut=css.checkboxOff;if(sel){elem.addClass(icon)}else{elem.removeClass(icon)}if(elem.attr("data-check")){elem[0]._check=sel;icon=css.checkboxOn;elem.find("[data-icon]").removeClass(sel?iconOut:icon).addClass(sel?icon:iconOut)}},_copyA:function(a){var len=a?a.length:0,a1=len?[]:null;while((len-=1)>=0){a1[len]=a[len]}return a1},_clearSel:function(){var elems=this._selElems,i=elems?elems.length:0;while((i-=1)>=0){this._fixSelElem(elems[i])}this._selElems=null},_selChanged:function(e){if(this._selArg){var elem,o,selItems,key=this._cascFire,i=key?key.length:0;while(i-->0){key[i]._cascade(true)}this._fire("selectionChanged",e,this._selArg);if(this._SELECT){elem=this.element[0];o=elem.options;selItems=this.options.selectedItems;i=selItems?selItems[0]:null;i=i?i.index:-1;elem.selectedIndex=i;if(o&&i>=0&&i<o.length){o[i].selected=true}if(elem.onchange){elem.onchange()}}delete this._selArg}},_selChange:function(selItems,e,clear,noReturn){var i,old=this.options.selectedItems,i0=old?old.length:0,i1=selItems?selItems.length:0;if(!i1){selItems=null}if(i0===i1){while(i0-->0){for(i=0;i<i1;i+=1){if(noReturn){if(old[i0].value===selItems[i].value&&old[i0].text===selItems[i].text){break}}else if(old[i0].index===selItems[i].index){break}}if(i===i1){break}}}old=i0>=0&&this._hasData&&!this._waitFilter?{owner:this,oldItems:old,items:selItems}:null;delete this._selArg;if(old&&!this._fire("selectionChanging",e,old)&&!noReturn){return}this._selTime=e&&this.options.focusOnSelect===false?_now():0;this._selArg=old;if(clear||!i1){this._clearSel()}this.options.selectedItems=selItems;this._noFilter=selItems&&selItems.length;return 1},_addSel:function(id,e){if(id>=0&&!this.isSelected(id)){var selItems=this._copyA(this.options.selectedItems);id=this._createSelItem(id);if(!selItems){selItems=[id]}else{selItems.push(id)}if(this._selChange(selItems,e)){this._selChanged(e)}}return this.options.selectedItems},_sepEnd:function(txt){var sep=this._sep(),len=txt.length;return len>1&&txt.lastIndexOf(sep)===len-sep.length},_select:function(id,val,flag,part,e){var vals,lenVals,txt,j,cond,ds,selItems=null,scrollID=-1,actID=-1,i=-1,o=this.options,more=1,count=this._count,act=part?o.allowCustomValue?2:1:null,sep=false,lower=!o.caseSensitive&&typeof val==="string";if(e&&part&&!this._ddOn&&e.type!=="mouseup"){this._doDrop(1,e)}if(this._noMouse()){return}if(act){this._changeID=-1}if(!_aNull(val)&&val!==""){if(flag===2){val=val.toString()}vals=typeof val==="string"?this._texts(val):val.length?val:[val];if((lenVals=vals.length)>0){j=vals[lenVals-1];if(!j&&(flag===2||_aNull(j))){if(act===1){sep=this._sepEnd(val)}vals.splice(lenVals-=1,1)}}if(lenVals===0){this._selChange(selItems,e,1,1);this._selChanged(e);return}while((i+=1)<lenVals){vals[i]={val:vals[i],id:-1,done:null}}if(!this._isStrCond(cond=this._cond(o))){cond="startsWith"}ds=this._dataSource;id=-1;while((id+=1)<count&&more){if(_aNull(txt=this._item(id,flag))){continue}if(lower){txt=txt.toString().toLowerCase()}more=null;for(i=0;i<lenVals;i+=1){if(!vals[i].done){more=1;val=vals[i].val;if(val===txt||part&&ds._findMatch(txt,val,"string",false,cond)){j=i;while((j-=1)>=0){if(vals[j].id===id){break}}if(act&&j>=0){continue}if(act&&i+1===lenVals&&!sep){if(actID<0){this._changeID=scrollID=actID=id;if(act===1&&!o.enableActiveItem){vals[i].id=id}}}else if(vals[i].id<0){vals[i].id=id}if(act!==1&&(val===txt||!part)){vals[i].id=id;vals[i].done=1}}}}}selItems=[];for(i=0;i<lenVals;i+=1){if((id=vals[i].id)>=0&&act!==2){if(scrollID<0){scrollID=id}j=selItems.length;while((j-=1)>=0){if(selItems[j].index===id){break}}if(j<0&&(this._multi(o)||selItems.length===0)){selItems.push(this._createSelItem(id))}}}}else if(typeof id==="number"&&id>=0&&id<count){selItems=[this._createSelItem(scrollID=id)]}if(this._selChange(selItems,e,1)){if(scrollID>=0){this._fixSelScroll(this._scrollTo=scrollID);if(sep){this._updateFromList(e,1,1)}}this._selChanged(e)}if(act){this._activate(actID,e)}},_createSelItem:function(id,txt,val){return{index:id,value:val||this._item(id),text:txt||this._item(id,2)}},_item:function(id,valHtmlText){var val,textValue,i,txtVal,format,tags,j,o=this.options,key=this._keyVal,row=this._data[id],mf=this._matchFlag;if(valHtmlText){key=this._key}if(!row){return valHtmlText?"":null}val=row[key];if(!valHtmlText){return val}format=format||o.format;if(format){if(_aNull(txtVal=row[i=key+"_"])){if(_aNull(val)){val=""}else if($.ig&&$.ig.formatter&&(typeof val==="number"||val&&val.getMonth)){val=$.ig.formatter(val,null,format==="auto"||format===true?null:format)}else{val=val.toString()}row[i]=val}else{val=txtVal}}else{val=_aNull(val)?"":val.toString()}if(valHtmlText!==1){return val}textValue=val;i=o.itemTemplate;if(i&&$.ig.tmpl){if(!this._it){if($.ig.util.isIE&&i.indexOf("unselectable")<0){tags=["<div","<span","<img","<a","<td","<li"];j=tags.length;while(j-->0){i=i.replace(new RegExp(tags[j],"gi"),tags[j]+' unselectable="on"')}}this._it=i}val=$.ig.tmpl(this._it,row);if(mf){val=this._replaceTextInTemplate(val,textValue,this._renderMatches(textValue,o,mf))}return val}if(val===""){return"&nbsp;"}return mf?this._renderMatches(val,o,mf):val},_replaceTextInTemplate:function(template,text,highlightedText){var parsedNode,resultNode,parsedTemplate,parent,children,i;if(text!==highlightedText){parsedTemplate="";parsedNode=$(template);for(i=0;i<parsedNode.length;i++){resultNode=this._replaceTextInNode($(parsedNode[i]),text,highlightedText);resultNode=$("<div>").append(resultNode);parsedTemplate+=resultNode.html()}return parsedTemplate}return template},_replaceTextInNode:function(node,text,highlightedText){var children=node.children(),parent=node.clone().children().remove().end(),i;parent.html(parent.text().replace(text,highlightedText));for(i=0;i<children.length;i++){parent=parent.append(this._replaceTextInNode($(children[i]),text,highlightedText))}return parent},_renderMatches:function(html,o,match){var index,i,lenMatch,len,lenIndex,val=o.caseSensitive?html:html.toLowerCase(),minIndex=0,shift=0,matches=[],txts=this._textsTemp||this._texts(1),lenTxt=txts.length;while(minIndex<99999){i=-1;minIndex=99999;len=val.length;while((i+=1)<lenTxt){index=val.indexOf(txts[i]);lenMatch=txts[i].length;if(index>=0&&index<minIndex&&(index===0||match!=="startsWith")&&!(match==="full"&&len!==lenMatch)&&lenMatch){minIndex=index;lenIndex=lenMatch}}if(minIndex<99999){matches.push({index:shift+=minIndex,len:lenIndex});val=val.substring(minIndex+lenIndex);shift+=lenIndex}if(match!=="multi"||shift>=len){break}}for(i=matches.length-1;i>=0;i-=1){index=matches[i].index;len=matches[i].len;html=html.substring(0,index)+'<span unselectable="on" class="'+this.css.listItemMatch+'">'+html.substring(index,index+len)+"</span>"+html.substring(index+len)}return html},_renderRow:function(id,repaint){var txt,elem,box,i,top,cell,me=this,itemWidth=me._itemWidth,o=me.options,checkBoxes=me._checkBox(o),cbWidth=me._cbWidth||0,html=me._html,lod=me._lodWait&&!html;if(lod){if(me._findItem(id+me._virtualTop)){return}repaint=false}if(html){repaint=false;if(!me._data[id]){return}html+='<li tabIndex="-1" class="'+me.css.listItem+'" style="width:';html+=itemWidth+"px;height:"+me._itemHeight+'px" unselectable="on" data-id="'+(id+_listIDShift)+'"'}else if(!repaint){elem=$("<li />").addClass(me.css.listItem).css({width:itemWidth,height:me._itemHeight}).attr("data-id",id+_listIDShift).attr("tabIndex",-1).attr("unselectable","on").appendTo(me._itemsHolder);if(checkBoxes){box=$("<span />").attr("data-box","x").attr("unselectable","on").css("top",(me._cbTop||0)+"px").addClass(me.css.checkbox).appendTo(elem.attr("data-check","x"));$("<span />").attr("data-icon","x").attr("unselectable","on").addClass(me.css.checkboxOff).appendTo(box);if(!cbWidth){me._cbWidth=cbWidth=box[0].offsetWidth}cell=$("<span />").attr("data-txt","x").attr("unselectable","on").addClass(me.css.listItemTextWithCheckbox).css(me._rtl?"marginRight":"marginLeft",Math.max(cbWidth,14)+3+"px").prependTo(elem)}else{elem.attr("data-txt","x")}}id+=me._virtualTop;if(repaint){elem=this._findItem(id);if(!elem){return}if(!o.virtualization&&!me._matchFlag){return elem}}txt=me._item(id,1);if(html){if(checkBoxes){html+=' data-check="x"><span unselectable="on" data-txt="x" style="'+(me._rtl?"margin-right:":"margin-left:")+(Math.max(cbWidth,14)+3)+'px;" class="'+me.css.listItemTextWithCheckbox+'">'+txt+"</span>";html+='<span unselectable="on" data-box="x" style="top:'+(me._cbTop||0)+'px" class="'+me.css.checkbox;html+='"><span unselectable="on" data-icon="x" class="'+me.css.checkboxOff+'"></span></span>'}else{html+=' data-txt="x">'+txt}me._html=html+"</li>"}else if(!me._data[id]){elem.hide();cell=me._findItem(id+1);if(cell){cell.hide()}}else if(elem[0]._old!==txt){elem[0]._old=txt;cell=elem.find("[data-txt]");if(cell.length===0){cell=elem}if(txt!==cell[0].innerHTML){cell.html(txt)}if(checkBoxes&&_aNull(me._cbTop)){box=elem.find("[data-box]");if(box[0]&&(top=elem[0].clientHeight)>0&&(i=box[0].offsetHeight)>0){if(i>=top){elem.css("height",top=i+1)}me._cbTop=Math.max((top-i-1)/2,0)}}elem.show()}if(lod){me._bindLIs(o,elem)}return elem},_isCheckBox:function(elem){return elem&&(elem.getAttribute("data-box")||elem.parentNode.getAttribute("data-box"))},_fixNull:function(clear){var txt,nullTxt=this.options.nullText;if(!nullTxt&&!this._nullT){return}txt=this.text();if(!clear&&txt===""&&nullTxt&&!this._fcs){this._nullT=true;this.fieldElem.addClass(this.css.nullText).val(nullTxt)}else if(this._nullT){this._nullT=null;this.fieldElem.removeClass(this.css.nullText).val(txt||"")}},_onScroll:function(e){var elem,selItems,selID,selLen,id,top,ds,me=this,count=me._count,itemHeight=me._itemHeightOuter,dd=me._ddScroll||me._ddCont;if(!dd||!me._ddOn||count<2||me._lodWait){return}id=Math.floor((top=dd[0].scrollTop)/itemHeight);if(e){me._lastScroll=top}top=Math.floor(me._lastScroll/itemHeight+.4);if(me._lod&&top>count-me._page*1.5){ds=me._dataSource;top=ds.pageIndex();if(top+1<ds.pageCount()){me._wait(me._lodWait=true);ds.pageIndex(top+1);return}else{top=id}}me._topID=top=Math.max(0,Math.min(top,count-Math.floor(dd[0].offsetHeight/itemHeight)));if(me._ddScroll){me._fixActive(me._activeID);count=me._page+1;me._virtualTop=top;selItems=me.options.selectedItems;selLen=selItems?selItems.length:0;me._selElems=[];while((count-=1)>=0){elem=me._renderRow(count,1);if(elem){for(selID=0;selID<selLen;selID+=1){if(selItems[selID].index===count+top){me._selElems.push(elem);me._fixSelElem(elem,1);break}}if(selID>=selLen){me._fixSelElem(elem)}}}me._fixActive(me._activeID,1)}},_lodLbl:function(){var i=-1,dd=this.listElem;while(i++<3&&this._lodFoot&&dd){dd.find("[data-lod"+i+"]").html(this.getRecordsCount(i))}},_touch:function(act){var scroll,dd=this._ddCont;if(dd&&dd.igScroll){scroll=dd.data("igScroll");if(!act){return scroll?scroll.barY:dd.igScroll({direction:"y",yThumb:"draggable",yScroller:this._ddScroll,cancelStart:"ms"}).attr("data-scroll","y")}if(scroll){scroll[act](true)}}},_xyCheck:function(stop){var xy=this._xy,xyE=this.mainElem;if(!xy){return}if(xyE){xyE=_offset(xyE);if(Math.abs(xyE.left-xy.x)>2||Math.abs(xyE.top-xy.y)>2){stop=true}}if(stop||!xyE){delete this._xy;clearInterval(xy.i);this._doDrop()}},_vAct:function(act){return $.ui.igValidator&&$.ui.igValidator._act(this,act)},_doDrop:function(show,e,repaint){var height,needScroll,winHeight,y,bodyElem,row1st,rowLast,max,end,step,docElem,xy,effect,width,body,i,duration,arg,listWidth,footer,callback,me=this,lod=me._lod,lodWait=me._lodWait,up=me._listUp,extraHeight=me._extraHeight||0,ddCont=me._ddCont,o=me.options,rtl=me._rtl,virtual=o.virtualization,dd=me.listElem,itemsHolder=me._itemsHolder,ddScroll=me._ddScroll,elem=me.mainElem,dif=me._ddItemBorderFix,on=me._ddOn,count=me._count,itemHeightOuter=me._itemHeightOuter;repaint=repaint||me._listChanged;if(me._mode(o)>2){show=0}if(!elem||!show&&!on||show===2&&on){return}if(!repaint&&on&&show&&_now()-on<100){return}show=show?repaint||!on:false;if(me._vAct(show?"drop":"hide")){return}if(!itemHeightOuter&&count&&show){repaint=true}if(!me._hasData){if(show&&o.dataBindOnOpen&&!me._dataSource){me._wait(true);callback=function(){this._dataChange();this._doDrop(2);this._wait(false)};me.dataBind(callback)}return}if(count<1&&me._filtering){row1st=me._noResults;if(!row1st){me._noResults=row1st=_notab($("<li />").css({width:"100%",textAlign:"center"}).addClass(me.css.listItem).html(me._locale("noMatchFoundText")||"&nbsp;"))}}if((!show||show&&!on)&&!me._fire(show?"dropDownOpening":"dropDownClosing",e,arg={owner:me,element:dd||$("<div/>")})){return}if(!lodWait&&show&&me._activeID>=0&&!me.isSelected(me._activeID)&&(i=me.selectedIndex())>=0){me._activate(me._scrollTo=i,e,1)}body=!o.dropDownAsChild;if(!dd){repaint=false}if(!dd||repaint){delete me._listChanged;if((width=parseInt(o.dropDownWidth,10))<5||isNaN(width)){if((width=elem[0].offsetWidth)<5){width=100}}if(!dd){dd=me.listElem=ddScroll=ddCont=_notab(arg.element.attr("data-id",_listIDShift-1).css("position","absolute").addClass(me.css.list).bind(me._mEvts).bind({DOMMouseScroll:function(e){me._onEvt(this,10,e)},mousewheel:function(e){me._onEvt(this,10,e)}}));footer=o.footerTemplate;if(o.headerTemplate||footer){dd.css("overflow","hidden");if(o.headerTemplate){_notab($("<div/>").attr("data-id",_listIDShift-1).css({overflow:"hidden",position:"relative"}).html(o.headerTemplate).appendTo(dd))}ddScroll=ddCont=_notab($("<div/>").attr("data-id",_listIDShift-1).css("position","relative").appendTo(dd));if(footer){i=footer;footer=footer.replace(this.RECORDS_VIEW,'<span data-lod0="x"></span>').replace(this.RECORDS_DATA,'<span data-lod1="x"></span>').replace(this.RECORDS_SERVER,'<span data-lod2="x"></span>').replace(this.RECORDS_SERVER_TOTAL,'<span data-lod3="x"></span>');me._lodFoot=i!==footer;_notab($("<div/>").attr("data-footer","x").attr("data-id",_listIDShift-1).css({overflow:"hidden",position:"relative"}).html(footer).appendTo(dd))}extraHeight=1}me._ddCont=ddCont;me._itemsHolder=itemsHolder=_notab($("<ul/>").attr("data-id",_listIDShift-1).addClass(me.css.listItemHolder).appendTo(ddCont));if(virtual){ddCont.css({overflow:"hidden"});me._ddScroll=ddScroll=_notab($("<div/>").attr("data-id",_listIDShift-1).css({width:"30px",height:"100%",overflowY:"scroll",overflowX:"hidden","float":rtl?"left":"right"}).appendTo(ddCont));me._ddScrollChild=_notab($("<div/>").attr("data-id",_listIDShift-1).css({width:"1px",height:"1px"}).appendTo(ddScroll))}ddScroll.scroll(function(e){me._onScroll(e)});if(me._rtl){dd.css("direction","rtl")}if(body){dd.css({left:"0px",top:"0px"}).appendTo($("body"))}else{dd.prependTo(elem)}me._ddBorderFix=dd.outerWidth()-dd.width();if(extraHeight){ddCont.hide();dd.css("width",width-me._ddBorderFix);me._extraHeight=extraHeight=dd[0].clientHeight;dd.css("width","auto");ddCont.show()}}dd.css({display:"block"});listWidth=width-=me._ddBorderFix;if(row1st){if(itemsHolder.has(row1st).length===0){row1st.appendTo(itemsHolder)}itemHeightOuter=Math.max(10,row1st.outerHeight());dif=0}else if(!lodWait){if(virtual){ddScroll.hide();itemsHolder.css({width:"auto",height:"auto",overflow:"visible","float":"left"})}else{me._keyFixed=1}}if(!itemHeightOuter&&count>0){me._itemWidth=width=Math.ceil(width-1);me._itemHeight="auto";row1st=me._renderRow(0);if((height=row1st.height())<5){height=16}row1st.css({height:me._itemHeight=height});me._ddItemBorderFix=dif=Math.max(0,Math.floor(row1st.outerWidth()-row1st.width()+.4));if(dif>0){me._itemWidth=width-=dif}me._itemHeightOuter=itemHeightOuter=row1st.outerHeight()+Math.max(0,itemsHolder[0].offsetHeight-row1st[0].offsetHeight);me._sameBC(row1st,dd)}itemHeightOuter=itemHeightOuter||0;me._listHeight=Math.max(10,Math.max((max=o.dropDownMinHeight)-extraHeight,itemHeightOuter*(count||1)));max=Math.min(Math.max(0,Math.max(max,o.dropDownMaxHeight)-extraHeight),me._listHeight);if(lod){max=Math.min((lod-1)*itemHeightOuter,max)}height=ddCont.css("height");height=repaint&&height&&height.indexOf("px")>0?parseFloat(height):max;dd.css("width",listWidth);needScroll=me._listHeight>max;if(virtual){me._ddScrollChild.css("height",me._listHeight+itemHeightOuter);ddCont.css("height",me._listHeight=max);dd.css("height",max+extraHeight);if(needScroll){ddScroll.show();ddScroll.css("width",width=ddScroll[0].offsetWidth-ddScroll[0].clientWidth+1);width=listWidth-width;itemsHolder.css({width:width,height:"100%",overflow:"hidden","float":rtl?"right":"left"});width-=dif;count=Math.ceil(max/itemHeightOuter+1)}else{ddScroll.hide();itemsHolder.css("width","100%")
}}else{ddCont.css({overflow:needScroll?"auto":"hidden",width:listWidth,height:me._listHeight=max}).css("overflowX","hidden");dd.css("height",max+extraHeight);if(needScroll){rowLast=$("<div/>").css({position:"absolute",top:max+100+"px",width:9,height:9}).appendTo(ddCont);width=ddCont[0].clientWidth;width=ddCont[0].clientWidth-dif;rowLast.remove()}}if(!needScroll){width=listWidth-dif}me._itemWidth=width;this._repaintList(0,count);me._page=itemHeightOuter?Math.max(2,Math.floor(max/itemHeightOuter)):1;if(repaint&&on){if(me._needsSel){me._fixSelScroll(-1);delete me._needsSel}i=me._listHeightLast;height=me._listHeight+extraHeight;dif=i-height;if(up){end=me._listTop;me._listTop+=dif}me._listHeightLast=height;if(dif){if((duration=dif<0?o.animationShowDuration:o.animationHideDuration)>5){dd.css("height",i).animate({height:height},{duration:duration,step:function(now){if(up){dd.css(body?"top":"marginTop",end+dif*(i-now)/(i-height))}}})}else if(up){dd.css(body?"top":"marginTop",end+dif)}}return}}height=me._listHeightLast=me._listHeight+extraHeight;me._ddOn=show?_now():null;duration=show?o.animationShowDuration:o.animationHideDuration;if(!duration||typeof duration==="number"&&duration<5){duration=null}else{effect=show?o.animationShowEffect:o.animationHideEffect;if(!$.effects||!$.effects[effect]){if(!show&&typeof duration!=="number"){duration=450}effect=null}}me._listHeightEnd=duration&&!effect?0:height;end=function(){if(show){dd.css("filter","");me._fixSelScroll(me._scrollTo);me._touch()}else{dd.css({display:"none"});me._touch("_hide")}me._fire(show?"dropDownOpened":"dropDownClosed",e,arg)};step=function(now,fx){if(me._listUp&&fx&&fx.prop==="height"){dd.css(body?"top":"marginTop",me._listTop+height-now)}};if(show){me._lodLbl();me.setFocus();if(me._needsPaint){me._repaintList()}if(!body&&(!me._static||me._relative)){elem.css("overflow","visible")}if(me._needsSel){me._fixSelScroll(-1);delete me._needsSel}winHeight=999;bodyElem=document.body;docElem=document.documentElement;if((i=window.innerHeight)>50&&i){winHeight=i}else if((i=docElem.clientHeight)>50&&i){winHeight=i}else if((i=bodyElem.clientHeight)>50&&i){winHeight=i}y=Math.max(window.pageYOffset||0,Math.max(bodyElem.scrollTop,docElem.scrollTop));xy=_offset(elem);me._xy=body?{x:xy.left,y:xy.top}:null;xy.height=elem[0].offsetHeight;me._listUp=null;if((up=xy.top+xy.height+height-y-winHeight)>0&&y-xy.top+height<up){me._listUp=up;if(xy.top-(up=height+2)<y&&!me._filtering){up=Math.max(xy.top-y,2)}xy.top+=(xy.height=-up)+_px(elem,"borderTopWidth");elem.addClass(me.css.noTopCorners);dd.addClass(me.css.noBottomCorners)}else{xy.top+=xy.height-_px(elem,"borderBottomWidth");elem.addClass(me.css.noBottomCorners);dd.addClass(me.css.noTopCorners)}dd.css({opacity:duration&&!effect?0:1,height:me._listHeightEnd,display:""});if(body){dd.css({left:xy.left,top:me._listTop=xy.top});me._xy.i=setInterval(function(){me._xyCheck()},300)}else{i=me._rtl?"Right":"Left";dd.css("margin"+i,-_px(elem,"border"+i+"Width")+"px");up=me._listUp?0:_px(elem,"borderTopWidth")+_px(elem,"borderBottomWidth");dd.css("marginTop",me._listTop=xy.height-up);up=_offset(dd);if((up=up.left-xy.left)>30&&up<elem[0].offsetWidth+10){dd.css("marginLeft",-up+"px")}}if(!duration){end()}else if(effect){dd.show(effect,{},duration,end)}else{dd.animate({opacity:1,height:height},{duration:duration,complete:function(){end()},step:function(now,fx){step(now,fx)}})}}else{if(!body&&(!me._static||me._relative)){elem.css("overflow","hidden")}me._xyCheck(true);elem.removeClass(me.css.noTopCorners).removeClass(me.css.noBottomCorners);dd.removeClass(me.css.noBottomCorners).removeClass(me.css.noTopCorners);if(!duration){end()}else if(effect){dd.hide(effect,{},duration,end)}else{dd.animate({opacity:0,height:me._listHeightEnd},{duration:duration,complete:function(){end()},step:function(now,fx){step(now,fx)}})}}return true},_repaintList:function(id,count){if(this._noMouse()){return}var me=this,repaint=!count;if(repaint){id=Math.max(0,this._topID-1);count=id+(this._page&&(this._ddScroll||this._matchFlag)?this._page+3:-1)}count=Math.min(count,this._count);delete this._needsPaint;this._textsTemp=this._texts(1);if(!repaint&&(!this._lodWait||this._lod&&this._filtering===-1)){this._html=" "}while(id<count){this._renderRow(id,repaint);id+=1}if(this._html){this._itemsHolder.html(this._html.substring(this._bindLI=1));delete this._html;setTimeout(function(){me._bindLIs()},600)}if(this._paintAct){this._fixActive(this._activeID,1)}delete this._textsTemp},_startOfSelTrail:function(field,txt,len){var range,sep,end=0,start=0,tr=this._tr();if(tr===1){start=field.selectionStart;end=field.selectionEnd}else if(tr){try{range=document.selection.createRange();tr=range.duplicate();tr.move("textedit",-1);try{while(tr.compareEndPoints("StartToStart",range)<0){tr.moveStart("character",1);if((start+=1)>len){break}}}catch(ex){}end=start+range.text.length}catch(e2){}}if(start===len&&len>2){sep=this._sep();if(sep.length>1&&txt.charAt(len-1)===sep.charAt(1)&&txt.charAt(len-2)===sep.charAt(0)){return start-1}}return start<end&&end===len?start:0},_tr:function(){var field=this.fieldElem[0],tr=this._trVar;if(!tr){try{if((!$.ig.util.isIE||$.ig.util.isIE11)&&!_aNull(field.selectionStart)){tr=1}}catch(ex){}if(tr!==1){try{tr=field.createTextRange?field.createTextRange():null}catch(e2){}}this._trVar=tr}return tr},_setCaret:function(start,end){var tr=this._tr();end=end||start;if(tr){try{if(tr===1){tr=this.fieldElem[0];tr.selectionStart=start;tr.selectionEnd=end;return}if(this._selTime&&_now()-this._selTime<50){return}end-=start;tr.move("textedit",-1);tr.move("character",start);if(end>0){tr.moveEnd("character",end)}tr.select()}catch(ex){}}},_autoComplete:function(filter){var len,txt,selStart,e,backKey,item,tr,txts,ii,last,i=-1,id=this._filtering?this._activeID:this._changeID,field=this.fieldElem,args=this._acArgs,sel="",selEnd=0,o=this.options,selItems=o.selectedItems,itemsLen=selItems?selItems.length:0,sep=this._sep();if(!args||this._noMouse()){return}delete this._acArgs;txt=args.txt;selStart=args.len;e=args.e;if(e&&e.keyCode===$.ui.keyCode.DELETE&&this._custom()){return}backKey=args.backKey;len=txt.length;if(itemsLen>0){if(filter){id=-1}txts=txt.split(sep);tr=selItems;selItems=[];filter=field.val();while((i+=1)<itemsLen){item=tr[i].text;for(ii=0;ii<txts.length;ii+=1){if(txts[ii]===(o.caseSensitive?item:item.toLowerCase())){selItems[ii]=item;if(filter===txts[ii]&&filter!==item){field.val(item)}break}}if(ii===txts.length&&!last){last=item}}while(i>=0){item=i<itemsLen?selItems[i]:last;if(item){if(sel.length>0){sel=sep+sel}sel=item+sel}i-=1}}filter=null;item=id>=0?this._item(id,2):null;if(item&&(!sel||sel!==item)){if(sel){sel+=sep}sel+=item}if(sel&&len>1&&selStart===len&&this._multi(o)&&!backKey&&txt.charAt(len-1)===sep.charAt(0)){if(id>=0){this._addSel(id,e);this._fixSelScroll(-1)}txt=sel+=sep;filter=selStart=i=sel.length}this._userTxt=txt;if(!sel){if(len>0&&!this._filtering){this._fire("noMatchFound",e,{owner:this,text:txt})}if(!backKey){return}}else if(selStart<(selEnd=sel.length)||i>0){field.val(this._oldTxt=sel)}else if(backKey){selEnd=selStart=len}else{return}this._setCaret(selStart,selEnd);this._userTxt=txt.substring(0,selStart);this._selLen=selEnd-selStart;if(filter&&this._multi(o)&&this._filtering){this.filter(e,null,this._noFilter)}},_onChange:function(e,flag,text,backKey){var selStart,len,txt,autoComplete,me=this,field=me.fieldElem,old=me._oldTxt,o=me.options;if(!field||!field[0]){return}txt=e?e.type:null;if(txt&&e.keyCode!==13&&txt.indexOf("blur")<0&&txt.indexOf("mouse")<0&&me._userTxt!==text){delete me._noFilter}if(me._hasData&&me._nullT&&flag===undefined&&!me._fcs){me._fixNull(1)}if(!_aNull(text)){field.val(me._userTxt=text);text=1}txt=me.text();len=txt.length;if(e&&e.type!=="blur"&&(text||flag===2)){me._setCaret(len)}if(!me._expr&&backKey===true&&o.autoComplete&&len>0&&(selStart=me._startOfSelTrail(field[0],txt,len))>0){_stop(e);return me._onChange(e,1,txt.substring(0,selStart-1),2)}if(txt!==old||me._selLen===1&&!flag&&me._userTxt&&old.length-me._userTxt.length===1){if(txt===old){me._userTxt=old}delete me._filterTxt;me._oldTxt=txt;me._fixClear();me._needsPaint=1;if(e){me._fire("textChanged",e,{owner:me,oldText:old,text:txt});if(me._validator){me._validator._evt(e)}}autoComplete=o.autoComplete&&(len>0||backKey);if(me._filtering){if(flag===2&&me._multi(o)){me._repaintList();return}me._userTxt=txt;me.filter(e,null,me._noFilter)}else{if(flag!==2){me._select(null,txt,2,1,e)}if(!autoComplete){me._userTxt=txt;me._repaintList()}}if(autoComplete){me._acArgs={txt:txt,len:len,e:e,backKey:backKey};if(me._filtering>=0){setTimeout(function(){if(!me._jpn){me._autoComplete()}me._repaintList()},0)}}}if(!flag){setTimeout(function(){me._onChange(e,1)},10)}else{me._save(o);if(e&&!me._ddOn&&me._fcs){me._doDrop(1,e)}}},_save:function(o){var item,input,select,sel,i=-1,str="",name=o.inputName;if(!name||!this._hasData||this._waitFilter){return}input=$('input[name="'+name+'"]');if(input[0]===this.element[0]){return}if(input.length===0){input=$('select[name="'+name+'"]');select=input.length;if(select){input.empty()}else{input=$('<input type="hidden" name="'+name+'" />').appendTo(this.element.parent())}}sel=o.selectedItems;while(sel&&(i+=1)<sel.length){item=this._item(sel[i].index);if(item&&item.getTime){item=item.getFullYear()+"-"+(item.getMonth()+1)+"-"+item.getDate()+" "+item.getHours()+":"+item.getMinutes()+":"+item.getSeconds()+"."+item.getMilliseconds()}if(select){$('<option value="'+item+'" selected="selected" >').appendTo(input)}else{if(i>0){str+=","}str+=item}}if(i<1&&this._custom()){str=this.text();if(select){$('<option value="'+str+'" selected="selected" >').appendTo(input)}}if(!select){input.val(str)}},_onKey:function(e,type){var k=e?e.keyCode||e.which:null,me=this,on=me._ddOn,id=me._activeID,o=me.options,kc=$.ui.keyCode,selItems=o.selectedItems,back=k===kc.BACKSPACE,count=me._count-1,mode=me._mode(o);if(type<2&&!me._fire(type===0?"keydown":"keypress",e,{owner:me,keyCode:k})){return _stop(e)}if(type<2&&k===kc.SPACE&&(mode>0||o.selectItemBySpaceKey&&id>=0&&o.enableActiveItem&&on)){_stop(e);if(mode<2&&id>=0&&type===0){me._fixSelScroll(id,e,null,null,1)}return}if(k===46){e.stopPropagation()}if(type<2&&(back||k>40||k===kc.SPACE)&&mode===0){me._jpn=k===229;me._onChange(e,null,null,back)}if(type===0){if(e.shiftKey){return}if(k===kc.ESCAPE){if(!on){setTimeout(function(){me._onChange(e,null,me._focTxt)},0)}else{_stop(e);me._doDrop(0,e)}}if((on||id>=0)&&(k===kc.ENTER||k===kc.NUMPAD_ENTER)){_stop(e);if(mode<2){if(id>=0&&o.enableActiveItem&&!me.isSelected(id)){me._fixSelScroll(id,e,null,null,1)}me._updateFromList(e)}me._doDrop(0,e)}if(k<33||k>40){return}if(e.ctrlKey){return}if(!e.altKey&&!e.metaKey){if(me._count<1){return}if(id<0){if(!on&&k!==kc.DOWN&&k!==kc.UP){return}id=count+1;back=selItems?selItems.length:0;while((back-=1)>=0){id=Math.min(selItems[back].index,id)}if(id>count){id=0}}else if(k===kc.DOWN){id+=1}else if(k===kc.UP){id-=1}else if(k===kc.HOME&&on){id=0}else if(k===kc.END&&on){id=count}else if(k===kc.PAGE_DOWN&&on){id+=me._page}else if(k===kc.PAGE_UP&&on){id-=me._page}else{return}_stop(e);if((id=Math.max(Math.min(id,count),0))!==me._activeID){if(me._activate(id,e)){if(on){me._fixSelScroll(id,e,null,1)}else{me.selectedIndex(id,true)}}}}else if(k===kc.DOWN&&!on||k===kc.UP&&on){return me._doDrop(on?0:1,e)}}},_sep:function(){var sep=this.options.itemSeparator||",";return sep.length>2?sep.substring(0,2):sep},_updateFromList:function(e,zero,addSep){var id=this._changeID,txt="",o=this.options,i=-1,sep=this._sep(),selItems=this._addSel(id===this._activeID?id:-1,e),len=selItems?selItems.length:0;delete this._jpn;if(this._noMouse()){return}this._changeID=-1;if(!this._multi(o)&&len>1){len=1}while((i+=1)<len){txt+=this._item(selItems[i].index,2);if(i+1<len||addSep){txt+=sep}}if(txt.length>0||zero){this._onChange(e,2,txt)}},_findItem:function(id){var dd=this._itemsHolder;if(dd){id-=this._virtualTop;dd=dd.find('[data-id="'+(id+_listIDShift)+'"]');if(dd.length===1){return dd}}},_fixSelScroll:function(id,e,elem,key,ctrl){if(this._fixSel(id,e,elem,key,ctrl)){return}if(e){this._updateFromList(e,ctrl);if(!ctrl&&!key&&this.options.closeDropDownOnSelect){this._doDrop(0,e)}}if(key||!e){this._fixScroll(id)}},_fixActive:function(id,on){var css=this.css.listItemActive,elem=id>=0&&this.options.enableActiveItem?this._findItem(id):null;if(elem){if(on){elem.addClass(css)}else{elem.removeClass(css)}delete this._paintAct}else if(on){this._paintAct=1}},_activate:function(id,e,noScroll){if(!this.options.enableActiveItem||this._noMouse()){this._activeID=id;return 1}var arg,old=this._activeID;if(old!==id&&this._fire("activeItemChanging",e,arg={owner:this,oldIndex:old,index:id})){this._fixActive(old);this._fixActive(this._activeID=id=arg.index,1);if(id>=0&&!noScroll&&(!e||e.type!=="mousedown")){this._fixScroll(id)}this._fire("activeItemChanged",e,arg)}},_fixSel:function(id,e,elem,key,ctrl){var item,next=0,i=id,o=this.options,selItems=this._copyA(o.selectedItems),len=selItems?selItems.length:0,oldSelElems=this._selElems,virtual=this._ddScroll,old=virtual&&id<0?null:this._selElems;if(!this._ddOn||this._noMouse()){return 1}if(id>=0&&!elem){elem=this._findItem(id);if(!elem){old=null;while(virtual&&!elem&&i>=0&&i<=this._count&&(next+=1)<4){this._fixScroll(i);this._onScroll(e);elem=this._findItem(id);i-=1}}if(!elem){return 1}}for(i=0;i<len;i+=1){item=old?old[i]:null;if(!item){item=this._findItem(selItems[i].index);if(item){if(!old){this._selElems=old=[]}this._fixSelElem(old[i]=item,1)}}if(id<0||!item||!e){continue}if(item[0]===elem[0]){if(!ctrl){if(len===1){return}}else{selItems.splice(i,1);if(this._selChange(selItems,e)){this._fixSelElem(elem);old.splice(i,1);this._selChanged(e)}else{this._selElems=oldSelElems}return}}else if(!ctrl){this._fixSelElem(item)}}if(!elem||!e){return}i=null;if(!ctrl||!selItems||!this._multi(o)){i=selItems=[];old=[]}selItems.push(this._createSelItem(id));if(this._selChange(selItems,e,i)){this._activate(id,e);old=old||[];old.push(elem);this._selElems=old;this._fixSelElem(elem,1);this._selChanged(e)}else{this._selElems=oldSelElems;for(i=0;i<this._selElems.length;i++){this._fixSelElem(this._selElems[i],true)}return 1}},_fixScroll:function(id){var scroll,top,last=this._lastScroll,dd=this._ddScroll||this._ddCont,height=this._itemHeightOuter;if(!dd||this._lodWait){return}top=scroll=dd[0].scrollTop;this._scrollTo=-1;if(id<0){if(last&&last!==top){dd[0].scrollTop=last;top=dd[0].scrollTop}if($.ig.util.isSafari&&top>20){dd[0].scrollTop=top-1}}else if((top=id*height)>scroll){if((top+=height-this._listHeight)<scroll){return}}if(top!==last){if(this._ddScroll&&top>last){top+=height-1}dd[0].scrollTop=top}},_bindLIs:function(o,li){var me=this,holder=me._itemsHolder,elem=li;if(!me.mainElem){return}if(!li){if(!this._bindLI||!holder){return}delete this._bindLI;elem=holder.find("li[data-id]")}elem.bind(me._mEvts);if(me._checkBox(o||this.options)){if(!me._evtHov){me._evtHov={MSPointerOver:function(e){me._onEvt(this,26,e)},pointerover:function(e){me._onEvt(this,26,e)},mouseover:function(e){me._onEvt(this,16,e)},mouseleave:function(e){me._onEvt(this,17,e)}}}elem=li||holder;elem.find("span[data-box]").bind(me._evtHov).bind(me._tEvts).find("span[data-icon]").bind(me._tEvts)}},_onEvt:function(el,type,e){var i,hovCss,pressCss,me=this,msOver=me._msOver,o=me.options,css=me.css,field=me.fieldElem,el$=!el||el===field[0]||e&&e.target===field[0]?field:$(el),id=el$.attr("data-id"),elem=me.mainElem,mode=me._mode(o);if(o.disabled){return}if(type===8){me._focTxt=me.text();me._fcs=1;elem.addClass(css.focus);field.addClass(css.fieldFocus);me._fixNull();if(mode<3){me.buttonElem.addClass(css.buttonFocus);me.clearElem.addClass(css.clearFocus)}if(!me._ddOn&&o.dropDownOnFocus){setTimeout(function(){if(me._fcs){me._doDrop(1,e)}},50)}return}if(type===9){i=me.text();if(e&&me._jpn&&$.ig.util.isFF&&me._userTxt!==i){me._onChange(e,null,i)}me._jpn=me._fcs=0;elem.removeClass(css.focus);field.removeClass(css.fieldFocus);me.buttonElem.removeClass(css.buttonFocus);me.clearElem.removeClass(css.clearFocus);if(!e){return}if(o.closeDropDownOnBlur){me._doDrop(0,e)}if(!me._custom()){me._updateFromList(e,1)}if(o.clearSelectionOnBlur||!o.allowCustomValue){me._changeID=-1;me._onChange(e,null)}me._fixNull();if(me._validator){me._validator._evt(e,null,1)}return}if(type===10){elem=me._ddScroll||me._ddCont;o=e.originalEvent||e;i=e.wheelDelta||o.wheelDelta||-(e.detail||o.detail);if(!_aNull(i,true)&&elem){_stop(e);elem[0].scrollTop+=i>0?-me._itemHeightOuter:me._itemHeightOuter}return}if($.ig.util&&$.ig.util.evtButton(e)){return}if(type===26){me._msOver=e.originalEvent.pointerType;return}if(msOver===2&&(type===6||type===16)){delete me._msOver;return}if(!id&&type>15){id=el$.parent().attr("data-id")}id=el$===field?0:isNaN(id=id?parseInt(id,10):-1)?-1:id;if(id>90){me._bindLIs(o)}if(id<0||id>98&&me._noMouse()){return}if(type===3){_stop(e)}if(mode>1&&(type>7||id>3)){return}if(type===16){return el$.addClass(css.checkboxHover)}if(type===17){return el$.removeClass(css.checkboxHover)}hovCss=id>=_listIDShift?me._touch()&&!(msOver&&msOver!==2)?"":css.listItemHover:id===1?css.buttonHover:css.clearHover;pressCss=id>=_listIDShift?"":id===1?css.buttonPressed:css.clearPressed;if(type===3){if(id<3){el$.addClass(pressCss)}return}if(id===_listIDShift-1){return}if(type===4){if(id>=_listIDShift){delete me._jpn;me._fixSelScroll(id-_listIDShift+me._virtualTop,e,el$,null,e.ctrlKey||e.metaKey||me._isCheckBox(e.target))}else if(el$.hasClass(pressCss)){if(id===1){if(me._vAct("drop")){return}me.setFocus();me._doDrop(1,e)}if(id===2){if(me._filtering){me._select(-1)}me._onChange(e,null,"")}el$.removeClass(pressCss)}return}if(type===6){if(id===0){field.addClass(css.fieldHover);elem.addClass(css.hover)}else{el$.addClass(hovCss)}}if(type===7){if(id===0){elem.removeClass(css.hover);field.removeClass(css.fieldHover);if(me._fcs===1){elem.addClass(css.focus)}}else{el$.removeClass(hovCss).removeClass(pressCss)}}},_fixClear:function(size){var o=this.options,show=o.enableClearButton&&this._oldTxt.length>0&&this._mode(o)<2&&!o.disabled;if(this._jpn&&$.ig.util.isFF){return}if(this._clearOn!==show){this._clearOn=show;size=1}if(size){this._doSize()}},_doTimer:function(flag){var me=this,timer=me._timer;if(flag===2){if(timer){clearInterval(timer);delete me._timer}return}if(!timer){me._timer=setInterval(function(){me._doTimer()},200)}if(flag===1){return}if(me._doSize(1)&&!me._percWidth&&!me._percHeight){me._doTimer(2)}},_doButHeight:function(height,perc){var img,imgHeight,min=this._butMinHeight,offsetHeight=height,minHolder=this._minHolderHeight;this.clearElem.css("height",perc?"100%":height-minHolder);height=Math.max(height-min,0);this.buttonElem.css("height",perc?height/offsetHeight*100+"%":height);img=this.buttonElem.children(0);imgHeight=img[0].offsetHeight||16;img.css("marginTop",Math.floor((offsetHeight-(min||0)-imgHeight)/2+.5)+"px");img=this.clearElem.children(0);img.css("marginTop",Math.floor((offsetHeight-minHolder-(img[0].offsetHeight||imgHeight))/2+.5)+"px")},_outerWidth:function(elem){return elem[0].offsetWidth+_px(elem,"marginLeft")+_px(elem,"marginRight")},_outerHeight:function(elem){return elem[0].offsetHeight+_px(elem,"marginTop")+_px(elem,"marginBottom")},_sameBC:function(src,targ){var clr=src.css("backgroundColor");targ.css("background",!clr||clr==="transparent"||clr.replace(/ /g,"").indexOf("(0,0,0,0")>0?"white":clr)},_doSize:function(timer){if(!this.mainElem){return}var fieldWidth,fix,percWidth,percHeight,butHeight,holderHeight,holderWidth,me=this,o=me.options,width=o.width,height=o.height,relative=me._relative,but=me.buttonElem,css=me.css,elem=me.mainElem,elem0=elem[0],field=me.fieldElem,fieldHolder=me._fieldHolder,clearOn=me._clearOn,minFieldHeight=me._minFieldHeight,minFieldWidth=me._minFieldWidth,minHolderWidth=me._minHolderWidth,minHolderHeight=me._minHolderHeight,butWidth=me._butWidth,clearWidth=me._clearWidth,lastHeight=me._lastHeight,clear=me.clearElem,offsetWidth=elem0.offsetWidth,offsetHeight=elem0.offsetHeight;if(offsetWidth&&!me._offsetWidth&&(!width||!height)){fix=$("<span />").css({display:"inline-block",position:"absolute"}).addClass("ui-igcombo").appendTo(me.element.parent());if(!width){width=fix[0].offsetWidth;if(width>10){o.width=width}else{width=0}}if(!height){height=fix[0].offsetHeight;if(height>10&&height!==fix.removeClass("ui-igcombo")[0].offsetHeight){o.height=height}else{height=0}}fix.remove()}width=width||150;height=height||"auto";fix=me._offsetWidth!==offsetWidth||width!==me._lastWidth||me._offsetHeight!==offsetHeight||height!==lastHeight;if(!offsetWidth||timer&&!fix){if(!offsetWidth){me._doTimer(1)}return}if(fix){me._listRemove()}me._lastWidth=width;me._lastHeight=height;me._percWidth=percWidth=typeof width==="string"&&width.indexOf("%")>0;me._percHeight=percHeight=typeof height==="string"&&height.indexOf("%")>0;if(percWidth||percHeight){me._doTimer(1)}if(!lastHeight){me._sameBC(field,fieldHolder);relative=elem.css("position")!=="static";if(!relative&&(percWidth||percHeight)){elem.css("position","relative");relative=true}me._relative=relative;field.css("position",relative?"absolute":"static")}fieldHolder.css({position:"absolute",width:"auto",height:"auto"});clear.hide();field.css({width:0,height:0});if(!lastHeight){fix=me._rtl?css.fieldHolderRTL:css.fieldHolderLTR;if(o.showDropDownButton){fieldHolder.addClass(fix)}else{fieldHolder.removeClass(fix)}fix=me._rtl?css.buttonRTL:css.buttonLTR;if(o.showDropDownButton){but.addClass(fix)}else{but.removeClass(fix)}butWidth=0;if(o.showDropDownButton){but.show();butWidth=me._outerWidth(but);fix=but.css("height");but.css("height",0);me._butMinHeight=me._outerHeight(but);but.css("height",fix)}else{but.hide()}me._butWidth=butWidth;me._minFieldWidth=minFieldWidth=me._outerWidth(field);me._minFieldHeight=minFieldHeight=me._outerHeight(field);me._minWidth=butWidth+me._outerWidth(field);if(o.enableClearButton){clear.show();me._clearWidth=clearWidth=me._outerWidth(clear);clear.hide()}field.hide();me._minHolderHeight=minHolderHeight=fieldHolder[0].offsetHeight;me._minHolderWidth=minHolderWidth=fieldHolder[0].offsetWidth;field.show()}fix=_toPx(width);if(fix){width=fix-_px(elem,"borderLeftWidth")-_px(elem,"borderRightWidth");if(width<1){width=1}}fix=_toPx(height);if(fix){height=fix-_px(elem,"borderTopWidth")-_px(elem,"borderBottomWidth");if(height<1){height=1}}elem.css({width:width,height:height,display:"inline-block",minWidth:0,minHeight:0});offsetWidth=elem0.clientWidth;offsetHeight=elem0.clientHeight;fieldHolder.css("height","auto");butHeight=o.showDropDownButton?me._outerHeight(but):0;if(!relative){fieldHolder.css("position","static")}field.css({height:"auto",position:"static"});holderHeight=me._outerHeight(fieldHolder);if(relative){field.css("position","absolute")}if(clearOn){clear.show()}if(o.height){holderHeight=Math.max(offsetHeight-minHolderHeight,0);fieldHolder.css("height",percHeight?holderHeight/offsetHeight*100+"%":holderHeight);field.css("height",percHeight?(holderHeight-minFieldHeight)/holderHeight*100+"%":holderHeight-minHolderHeight-minFieldHeight);me._doButHeight(offsetHeight,percHeight)}else if(holderHeight<butHeight){fieldHolder.css("height",butHeight-minHolderHeight);field.css("height",butHeight-minHolderHeight-minFieldHeight)}else{me._doButHeight(holderHeight,percHeight);field.css("height",holderHeight-minHolderHeight-minFieldHeight);if(relative){fieldHolder.css("height",holderHeight-minHolderHeight)}elem.css("height",height=holderHeight)}elem.css({display:o.enableDisplayBlock?"block":"inline-block",minWidth:me._minWidth+clearWidth+2});width=Math.max(offsetWidth-butWidth-minHolderWidth,0);fieldHolder.css("width",percWidth?width/offsetWidth*100+"%":width);offsetWidth=elem0.clientWidth;holderWidth=fieldHolder[0].offsetWidth;if((fix=offsetWidth-holderWidth-butWidth)!==0){width+=fix;fieldHolder.css("width",percWidth?width/offsetWidth*100+"%":width)}fieldWidth=width-minFieldWidth-1;if(clearOn){fieldWidth-=clearWidth}field.css("width",percWidth?fieldWidth/width*100+"%":fieldWidth);if((fix=fieldHolder[0].clientWidth-me._outerWidth(field)-(clearOn?clearWidth:0)-1)!==0){fieldWidth+=fix;field.css("width",percWidth?fieldWidth/width*100+"%":fieldWidth)}if(!relative){holderHeight=fieldHolder[0].offsetHeight+5;elem.css("height","auto");for(fix=0;fix<4&&width>0;fix+=1){if(elem0.offsetHeight<holderHeight){break}width-=.5;fieldHolder.css("width",percWidth?width/offsetWidth*100+"%":width)}fieldHolder.css("width",percWidth?--width/offsetWidth*100+"%":--width);elem.css("height",height)}me._offsetWidth=elem0.offsetWidth;me._offsetHeight=elem0.offsetHeight;return 1},_listRemove:function(){var me=this;if(!me.listElem){return}me._touch("destroy");me.mainElem.removeClass(me.css.noTopCorners).removeClass(me.css.noBottomCorners);me.listElem.remove();me._selElems=me.listElem=me._itemsHolder=me._ddCont=me._ddScroll=me._noResults=me._q=me._ddOn=me._extraHeight=me._listChanged=me._ddItemBorderFix=me._itemHeightOuter=me._bindLI=null;me._lastScroll=me._virtualTop=me._topID=0;me._activeID=me._scrollTo=-1},destroy:function(){var i,e,elem=this.mainElem,css=this.css,old=this._oldCss,field=this.fieldElem,elem0=this.element;e=elem?elem[0]:null;if(!e){return this}if(this._loadInd){this._loadInd.destroy()}this._doTimer(2);this._listRemove();this.validator(1);if(this._SELECT){elem.remove();elem0.css("display",old.display)}else{field.removeClass(css.nullText).removeClass(css.fieldFocus).removeClass(css.fieldHolder).unbind(this._evts);if(this._swap){field.removeClass(css.field);field.insertBefore(elem);elem.remove()}else{this.buttonElem.remove();this.clearElem.remove();elem.unbind(this._elemEvts).removeClass(css.combo).removeClass(css.hover).removeClass(css.focus).removeClass(css.disabled);field.remove()}for(i in old){if(old.hasOwnProperty(i)){elem0.css(i,old[i])}}old=this._oldAttr;for(i in old){if(old.hasOwnProperty(i)){elem0[0][i]=old[i]}}}this._cascade(false,true);delete this.mainElem;$.Widget.prototype.destroy.apply(this,arguments);return this},_getType:function(v){return v===true||v===false?"bool":v&&v.getTime?"date":typeof v==="number"?"number":"string"},dataBind:function(callback){var field,ds0,dataOptions,setting,binded,o=this.options,url=o.dataSourceUrl,lod=o.parentComboKey&&o.parentCombo?null:o.loadOnDemandSettings,key=o.responseDataKey,txtKey=o.textKey||o.valueKey,type=o.dataSourceType,vt=o.valueKeyType,tt=o.textKeyType,verb=o.requestType,contentType=o.responseContentType,schema={fields:[]},ds=o.dataSource,dsStr=typeof ds==="string",keys=key?key.split("."):null,len=keys?keys.length-1:-1,i=-1;vt=vt==="auto"?null:vt;if(dsStr&&!type){if($.ig.util.isJsonpUrl(ds)){ds=new $.ig.JSONPDataSource({dataSource:ds})}else{ds=new $.ig.DataSource({dataSource:ds})}}ds0=ds;while(ds0&&i++<len){ds0=ds0[keys[i]]}if(!ds0){ds0=ds;keys=null}else if(keys){schema.searchField=key}field=ds0?ds0[0]:null;if(typeof field==="string"||typeof field==="number"||field&&field.getTime){i=ds0.length;field=ds0;ds0=[];txtKey=txtKey||"x";while(i-->0){ds0[i]={};ds0[i][txtKey]=field[i]}if(keys){field=ds;i=-1;while(++i<len){field=field[keys[i]]}field[keys[len]]=ds0}else{ds=ds0}}dataOptions={callback:callback?callback:this._dataChange,dataSource:ds,requestType:verb,responseContentType:contentType,type:type||undefined,responseDataKey:key,responseTotalRecCountKey:o.responseTotalRecCountKey};field=this._noMouse()||this._cascFilter?null:o.filteringType;this._filtering=field==="local"?1:field==="remote"?-1:0;if(ds0){ds0=ds0[0];for(field in ds0){if(ds0.hasOwnProperty(field)){if(!txtKey){txtKey=o.valueKey=o.textKey=field}i=this._getType(ds0[field]);if(!vt&&field===o.valueKey){o.valueKeyType=vt=i}schema.fields.push({name:field,type:i});if(txtKey!==field&&o.valueKey!==field){o._all=1}}}}if(ds instanceof $.ig.DataSource&&!ds.settings.schema||!(ds instanceof $.ig.DataSource)){dataOptions=$.extend(dataOptions,{schema:schema})}if(ds instanceof $.ig.DataSource){binded=ds._data&&ds._data.length;dataOptions.dataSource=ds.settings.dataSource;ds.settings=$.extend(true,{},ds.settings,dataOptions);ds.settings.callee=this;if(dataOptions.schema){ds._initSchema()}}else{ds=new $.ig.DataSource(dataOptions);ds.settings.callee=this}tt=tt==="auto"?null:tt;schema=vt||tt?ds.schema():null;schema=schema?schema.fields():null;i=schema?schema.length:0;while((i-=1)>=0){field=schema[i];if(vt&&field.name===o.valueKey){field.type=vt}if(tt&&field.name===o.textKey){field.type=tt}}ds._response_data=function(data){var len=data?data.length:0,count=len>0?data[len-1][":totals:"]:null;if(count){data.pop();count=count.split(":");ds.totalRecordsCount(_aNull(len=parseInt(count[0],10),true)?0:len);len=_aNull(len=parseInt(count[1],10),true)?0:len;if(len){o._totalAll=len}}};delete this._lod;if(lod&&lod.enabled&&(url||dsStr)){setting=ds.settings.paging;setting.type="remote";setting.appendPage=setting.enabled=true;setting.pageSizeUrlKey=lod.pageSizeUrlKey||null;setting.pageIndexUrlKey=lod.pageIndexUrlKey||null;if(!_aNull(i=parseInt(o._total,10),true)){ds.totalRecordsCount(i)}lod=parseInt(lod.pageSize||30,10);setting.pageSize=this._lod=_aNull(lod,true)?30:Math.max(lod,5);setting.pageIndex=0}if(this._fire("dataBinding",null,{owner:this,dataSource:ds},1)){this._dataSource=ds;this._keyVal=this._hasData=this._key_=null;this._listRemove();if(binded){this._dataChange()}else{ds.dataBind()}}if(url&&!this._urlBind){setting=ds.settings;setting.dataSource=url;setting.type="remoteUrl";ds._runtimeType=ds.analyzeDataSource();setting.urlParamsEncoded=$.proxy(function(data,params){params=params?params.filteringParams:null;if(params){params.textKey=o.textKey||o.valueKey;params.valueKey=o.valueKey;if(!o.caseSensitive){params.toLower="1"}if(o.compactData){params.compact="1"}if(o.parentComboKey){params.cascade=o.parentComboKey}}},this);this._urlBind=1;if(!o.dataSource){ds.dataBind()}}},_cond:function(o,paint){return o.autoComplete?"startsWith":paint||!this._filtering?o.renderMatchItems:o.filteringCondition},_isStrCond:function(cond){return cond==="startsWith"||cond==="endsWith"||cond==="contains"||cond==="doesNotContain"||cond==="empty"||cond==="notEmpty"},_texts:function(txt){var i,len,sepLen,render=txt===1,o=this.options,sep=this._multi(o)?this._sep():null;if(render||_aNull(txt)){txt=this._userTxt||this._oldTxt}else if(typeof txt!=="string"){return[txt]}if(!o.caseSensitive){txt=txt.toLowerCase()}if(!sep){return txt?[txt]:[]}while(txt.indexOf(sep+sep)>0){txt=txt.replace(sep+sep,sep)}sepLen=sep.length;len=txt.length;if(render){if((i=txt.lastIndexOf(sep.charAt(0)))>0&&i===len-1){txt=txt.substring(0,len-=1)}if((i=txt.lastIndexOf(sep))>0&&i===(len-=sepLen)){txt=txt.substring(0,len)}}else if((i=txt.lastIndexOf(sep.charAt(0)))>0&&i===len-1&&sepLen>1){txt+=sep.charAt(1)}if(txt.indexOf(sep)===0){txt=txt.substring(sepLen)}return txt?txt.split(sep):[]},_fillKeys:function(fix){if((fix||!this._keyFixed)&&this._key!==this._key_){var count=this._count;while((count-=1)>=0){this._item(count,2)}}this._keyFixed=1},_wait:function(on){var css=this.css.waitFiltering,load=this._loadInd,elem=this.mainElem,holder=this._itemsHolder;if(on){elem.addClass(css);if(holder){holder.addClass(css)}if(!load&&elem.igLoading){load=elem.igLoading().data("igLoading");if(load){this._loadInd=load=load.indicator()}}if(load){load.show()}}else if(elem){elem.removeClass(css);if(holder){holder.removeClass(css)}if(load){load.hide()}}},filter:function(e,txtNew,noFilter){var filter,key,i=-1,casc=this._cascFilter,txt=casc?this._cascVal:typeof txtNew==="string"?[txtNew]:txtNew instanceof Array?txtNew:this._texts(),len=casc?0:txt.length,cond=len?txt.toString():null,ds=this._dataSource,o=this.options,expr=[],remote=casc===-1||this._filtering<0;if(noFilter||this._hasData&&cond&&this._filterTxt===cond){return}if(this._expr){this._filterNew={txt:txt,e:e};return}this._filterTxt=cond;delete this._filterNew;if(remote&&len>1&&!txt[len-1]){len=0}if(casc){cond="equals";key=this._cascKey;expr.push({fieldName:key,cond:cond,expr:txt})}else{cond=this._cond(o);key=remote||!this._isStrCond(cond)?this._key:this._key_;
while((i+=1)<len){expr.push({fieldName:key,cond:cond,expr:txt[i]})}}if(expr.length===0&&!e){return}if(!this._fire("filtering",e,this._expr={owner:this,expression:expr},1)){delete this._expr;return}if(remote&&this._hasData&&!this._fire("dataBinding",null,{owner:this,dataSource:ds},1)){delete this._expr;return}if(!casc){this._needsSel=txt;this._needsSelEnd=this._multi(o)&&this._sepEnd(this.text())}filter=ds.settings.filtering;filter.caseSensitive=o.caseSensitive;filter.type=o.filteringType;if(remote){this._wait(true);key=o.filterExprUrlKey;if(key){filter.filterExprUrlKey=key}filter.expressions=expr;this._waitFilter=!this._hasData;if(this._lod){txt=txtNew!==null&&txtNew!==undefined?txtNew:this.text();if(this._lodTxt!==txt){this._lodTxt=txt}ds._data=[];ds._dataView=[];ds._filteredDataView=[];ds._cachedDataView=null;ds.settings.paging.pageIndex=0;ds.pageSizeDirty(true)}ds.dataBind();return}if(expr.length===0||!this._hasData&&!casc){ds.clearLocalFilter()}else{this._fillKeys();ds.filter(expr,"OR",this._noFilter)}this._dataChange(e,true)},_checkExpr:function(){var change,filterNew=this._filterNew,expr=this._expr,len=filterNew&&filterNew.txt?filterNew.txt.length||0:0;if(!filterNew){return}if(expr){expr=expr.expression}if(len!==(expr?expr.length:0)){change=1}while(!change&&(len-=1)>=0){change=filterNew.txt[len]!==expr[len].expr}if(change){delete this._expr;this.filter(filterNew.e,filterNew.txt,this._noFilter);return 1}delete this._filterNew},_fixType:function(val){var fields,type=this.options.valueKeyType;if(!_aNull(val)){if(type==="number"){return typeof val==="number"?val:parseFloat(val)}if(type==="bool"){return val==="true"||val===true}if(type==="date"&&!val.getTime){val=val.toString();fields=val.replace(/[\. :]/g,"-").split("-");return fields.length===7?new Date(parseInt(fields[0],10),parseInt(fields[1],10)-1,parseInt(fields[2],10),parseInt(fields[3],10),parseInt(fields[4],10),parseInt(fields[5],10),parseInt(fields[6],10)):Date.parse(val)}}return val},_initSel:function(o){var item,val,id,ii,custom,more=1,selItems=o.selectedItems,len=selItems?selItems.length:0,i=-1;while(!this._multi(o)&&len>1){selItems.splice(len-=1,1)}id=len;while(id-->0){item=selItems[id];item.value=this._fixType(val=item.value)}custom=o.text||(len===1&&this._custom(o)?val:null);o.text=null;while((i+=1)<this._count&&more){val=this._item(i);more=null;id=len;while((id-=1)>=0){item=selItems[id];if(_aNull(ii=item.index)||ii<0){if(_equals(item.value,val)){if(this.isSelected(i)){selItems.splice(id,1);len-=1}else{item.index=i;item.text=this._item(i,2)}}else{more=1;if(i===this._count-1){selItems.splice(id,1)}}}else{item.value=item.value||this._item(ii);item.text=item.text||this._item(ii,2)}}}if(custom&&(!selItems||!selItems.length)){this.text(custom)}else if(!this.text()||!this._custom(o)){this._updateFromList(null,1)}},_dataChange:function(e,local){var count,txt,selLen,selItems,data,top,firstMatch,fullMatch,firstFullMatch,item,cond,lod=this._lodWait,casc=this._cascFilter,more=!casc,i=-1,actID=-1,sel=this._needsSel,id=-1,keyVal=this._keyVal,key=this._key,dd=this._itemsHolder,ds=this._dataSource,filter=casc||this._filtering,o=this.options,trimmedSep,txtTmp;if(!o||!this._multi||this._cascUrl){return}selItems=o.selectedItems;if(casc&&(_aNull(this._cascVal,true)||this._cascVal==="")){filter=false}else{data=ds.dataView()}this._data=data=data||[];this._count=count=top=data.length;if(!this._hasData&&!count&&o.dataSourceUrl&&o.selectedItems){this._urlSel=1}if(!keyVal){keyVal=o.valueKey;if(!keyVal&&data[0]){for(keyVal in data[0]){if(data[0].hasOwnProperty(keyVal)){break}}}this._keyVal=keyVal;key=o.textKey||keyVal;this._key_=this._key=key;this._keyFixed=!o.format;if(!this._keyFixed){this._key_+="_"}}if(count&&!o.valueKeyType){while(++i<count){if(!_aNull(item=this._item(i))){o.valueKeyType=item===true||item===false?"bool":typeof item==="number"?"number":item.getTime?"date":"string";break}}i=selItems?selItems.length:0;while(i-->0){selItems[i].value=this._fixType(selItems[i].value)}this._cascSel=this._fixType(this._cascSel)}if(this._hasData){if(this._checkExpr()){return}if(this._urlSel===1){this._initSel(o);this._urlSel=2}else{txtTmp=this.text();trimmedSep=$.trim(o.itemSeparator);if(this._urlSel||lod&&this.selectedIndex()<0&&!o.autoComplete||e&&e.type==="keydown"&&this._multi(o)&&o.itemSeparator.lastIndexOf(" ")>-1&&txtTmp.lastIndexOf(trimmedSep)===txtTmp.length-trimmedSep.length){txt=txtTmp}if(!lod){this._activate(-1,e);this._clearSel();this._lastScroll=this._virtualTop=this._topID=0;this._scrollTo=-1}if(dd){if(!lod){dd.empty()}this._listChanged=1}if(txt){this._select(null,txt,2)}}}if(this._expr){if(filter<0){this._fire("dataBound",null,{owner:this,dataSource:ds},1)}if(!this._isStrCond(cond=this._cond(o))){cond="startsWith"}if(!this._multi(o)){cond="equals"}if(this._ddOn||e&&e.type==="keydown"){this._doDrop(1,e)}this._fillKeys(1);selLen=sel&&!casc?sel.length:0;if(casc){this._initSel(o);item=selItems?selItems[0]:null;if(item){while(++id<count){if(item.value===this._item(id)){item.index=id;break}}if(id===count){o.selectedItems=null;this.fieldElem.val("")}}}selItems=[];while((id+=1)<count&&more){txt=this._item(id,2);i=-1;more=null;while((i+=1)<selLen){if(sel[i]){more=1;if(txt&&ds._findMatch(txt,sel[i],"string",!o.caseSensitive,cond)){item=null;if(!selItems[i]){selItems[i]=item=this._createSelItem(id,txt)}fullMatch=txt.length===sel[i].length;if(!firstMatch||fullMatch){firstMatch=1;top=Math.min(top,id);if(fullMatch){if(!firstFullMatch){top=id}firstFullMatch=1;selItems[i]=item||this._createSelItem(id,txt);sel[i]=null;if(!this._multi(o)){id=count+1}break}}}}}}if(selItems[0]){txt=selItems[0].text}while((selLen-=1)>=0){item=selItems[selLen];if(!item||actID<0&&!this._needsSelEnd){if(item){actID=item.index}if(!item||item.text!==txt){selItems.splice(selLen,1)}}}if(!casc){if(this._selChange(selItems,e)){this._selChanged(e);if(this._needsSelEnd){this._updateFromList(e,1,1)}}}if(actID<0&&count){item=this._item(0,2);txt=this.text();if(item&&txt){if(!o.caseSensitive){item=item.toLowerCase();txt=txt.toLowerCase()}if(item.indexOf(txt)===0){actID=0}}}if(actID>=0){this._activate(top=actID,e,1)}this._fixSelScroll(this._scrollTo=top===count?0:top);this._fire("filtered",e,this._expr,1);this._autoComplete(1);this._wait();delete this._waitFilter;delete this._expr}else{if(this._urlSel!==2){txt=this.text();sel=this.selectedIndex();if(txt&&!this._custom(o)&&sel<0){if(!this._hasData||!o.autoComplete){this._select(null,txt,2)}}else{if(e===true&&!_aNull(sel=sel<0?this._cascSel:null)){selItems=null;while(!selItems&&++id<count){if(this._item(id)===sel){selItems=[this._createSelItem(id,null,sel)]}}o.selectedItems=selItems;if(!selItems){this.fieldElem.val("")}delete this._cascSel}if(!casc){this._initSel(o)}}}this._fire("dataBound",null,{owner:this,dataSource:ds},1);if(this._urlSel===2&&!casc){this._noFilter=1;this._updateFromList(null,1);delete this._noFilter;delete this._urlSel}else if(filter){this.filter(null,null,this._noFilter)}if(this._ddOn){this._doDrop(1,e,1)}}if(this._mode(o)>1&&this.selectedIndex()<0&&this.value()===null){this.selectedIndex(0)}if(data.length<1){this._fire("noMatchFound",e,{owner:this,text:this.text()})}this._hasData=1;this._fixClear();this._fixNull();this._save(o);if(this._lodWait&&!local){this._wait();this._fixSel();delete this._lodWait}this._lodLbl();if(_cascWait){more=_cascWait[id=e=this.element[0]];if(!more){more=_cascWait[id=e.id]}count=more?more.length:0;while(count-->0){item=more[count];i=casc=item.options.parentCombo;if(i===id||i==="#"+id){casc=e}else{if(casc&&typeof casc==="string"){casc=$(casc);if(casc.length!==1){casc=$("#"+i)}}if(casc&&casc.element){casc=casc.element[0]}else if(casc&&casc.length===1){casc=casc[0]}}if(casc===e){if(_cascWait){delete _cascWait[id];for(key in _cascWait){if(_cascWait.hasOwnProperty(key)){casc=null;break}}if(casc){_cascWait=undefined}}item._cascade(false,false,this)}}}if(this._valTime===1){delete this._valTime;this.value(this._valLast,true)}},_locale:function(key){var val=this.options[key];if(_aNull(val)){val=$.ig.Combo&&$.ig.Combo.locale?$.ig.Combo.locale[key]:null}return val||""},_titles:function(){var val=this._locale("clearButtonTitle");this.clearElem.attr("title",val).attr("longdesc",val);val=this._locale("dropDownButtonTitle");this.buttonElem.attr("title",val).attr("longdesc",val)},_fire:function(t,e,a,fire){return this._canFire||fire?this._trigger(t,e,a):true},_same:function(old,val){if(old===val){return true}if(!old||!val||typeof val==="string"){return}var p1,p2,item,key,i=val.length;if(i!==old.length||_aNull(i)){return}while(i-->0){item=val[i];if(item&&!old[i]||!item&&old[i]){return}for(key in item){if(item.hasOwnProperty(key)){p1=item[key];p2=old[i][key];if(p1!==p2&&(p1&&!p2||!p1&&p2||!p1.getTime||!p2.getTime||p1.getTime()!==p2.getTime())){return}}}}return true},_setOption:function(key,val){var o=this.options,field=this.fieldElem,elem=this.mainElem;if(this._same(o[key],val)){return this}if(key==="selectedItems"){this._clearSel()}if(key.indexOf("virt")===0||key.indexOf("Match")>0||key.indexOf("empl")>0||key.indexOf("drop")===0||key==="caseSensitive"||key==="format"||key==="enableActiveItem"){o=null;delete this._it}if(key==="multiSelection"||!o){this._listRemove()}$.Widget.prototype._setOption.apply(this,arguments);if(key.indexOf("par")===0||key.indexOf("casc")===0||key.indexOf("useT")===0){this._cascade();return this}if(typeof val==="function"||!o){return this}if(key==="width"||key==="height"||key==="showDropDownButton"){this._lastHeight=null;this._doSize()}else if(key==="selectedItems"||key==="multiSelection"){this._initSel(o);this._updateFromList(null,1);this._fixNull()}else if(key.indexOf("Title")>0){this._titles()}else if(key.indexOf("dataS")===0||key.indexOf("fil")===0||key.indexOf("Key")>0||key.indexOf("OnDem")>0){this._hasData=false;this._lod=this._totalAll=o._totalAll=this._count=0;this.selectedIndex(-1);this.activeIndex(-1);this.dataBind()}else if(key==="enableClearButton"){this._fixClear(1)}else if(key==="tabIndex"||key==="disabled"){field.attr(key,val);this._fixClear()}else if(key==="mode"){field.attr("readOnly",this._mode(o)>0);this._fixClear()}else if(key==="enableDisplayBlock"){elem.css("display",val?"block":"inline-block")}else if(key==="itemSeparator"){this._updateFromList()}else if(key==="text"){this.text(val)}else if(key==="nullText"){this._fixNull()}else if(key==="validatorOptions"){this.validator()}return this}});$.extend($.ui.igCombo,{version:"13.1.20131.2523"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Dialog 13.1.20131.2523
*
* Copyright (c) 2011-2014 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery-1.6.1.js
* jqueryui/1.8.11/jquery-ui.js
* Example to use:
*	<script type="text/javascript">
*	$(function () {
*		$("#dialog1").igDialog();
*	});
*	</script>
*	<div id="dialog1"></div>
*/
(function($){var _lastTop,_iframe,_visCount=0,_modals=[],_lastZ=0,_maxZ=0,CLOSE=0,OPEN=1,MIN=2,MAX=3,PIN=4,UNPIN=5,RESTORE=6,_pos={my:"center",at:"center",collision:"fit",of:window,using:function(pos){if(pos.top<0){pos.top=0}if(pos.left<0){pos.left=0}var p=$(this).css(pos).offset();if(p.top<0){$(this).css("top",pos.top-p.top)}if(p.left<0){$(this).css("left",pos.left-p.left)}}},_isSrc=function(elem,src){return elem&&src&&(elem.has(src).length>0||elem[0]===src)},_notab=function(elem){return elem.attr("zIndex",-1).css("outline",0).attr("unselectable","on")},_toPx=function(elem,css){var val=elem.css(css);if(!val){return 0}css=parseFloat(val);if(val.indexOf("px")>0){css+=.7}else if(val.indexOf("em")>0){css*=12}else{return 0}return Math.floor(css)},_getPadding=function(elem,vert,margin){return _toPx(elem,(margin||"padding")+(vert?"Top":"Left"))+_toPx(elem,(margin||"padding")+(vert?"Bottom":"Right"))+_toPx(elem,"border"+(vert?"Top":"Left")+"Width")+_toPx(elem,"border"+(vert?"Bottom":"Right")+"Width")},_stopEvt=function(e){try{e.preventDefault();e.stopPropagation()}catch(ex){}};$.widget("ui.igDialog",{options:{mainElement:null,state:"opened",pinned:false,closeOnEscape:true,showCloseButton:true,showMaximizeButton:false,showMinimizeButton:false,showPinButton:false,pinOnMinimized:false,imageClass:null,headerText:null,showHeader:true,showFooter:false,footerText:null,dialogClass:null,container:null,height:null,width:300,minHeight:100,minWidth:150,maxHeight:null,maxWidth:null,draggable:true,position:null,resizable:true,tabIndex:0,openAnimation:null,closeAnimation:null,zIndex:null,modal:false,trackFocus:true,closeButtonTitle:null,minimizeButtonTitle:null,maximizeButtonTitle:null,pinButtonTitle:null,unpinButtonTitle:null,restoreButtonTitle:null,temporaryUrl:null,enableHeaderFocus:true,enableDblclick:"auto"},events:{stateChanging:null,stateChanged:null,animationEnded:null,focus:null,blur:null},css:{dialog:"ui-igdialog ui-dialog ui-widget ui-widget-content ui-corner-all",header:"ui-igdialog-header ui-dialog-titlebar ui-widget-header ui-corner-top ui-helper-clearfix",headerFocus:"ui-igdialog-header-focus ui-state-focus",headerMinimized:"ui-corner-bottom",headerText:"ui-igdialog-headertext ui-dialog-title",headerImage:"ui-igdialog-headerimage",headerTextMinimized:"ui-igdialog-headertext-minimized",headerButton:"ui-igdialog-headerbutton ui-corner-all ui-state-default",headerButtonHover:"ui-igdialog-headerbutton-hover ui-state-hover",close:"ui-igdialog-buttonclose",minimize:"ui-igdialog-buttonminimize",maximize:"ui-igdialog-buttonmaximize",pin:"ui-igdialog-buttonpin",closeIcon:"ui-igdialog-close-icon ui-icon ui-icon-close",minimizeIcon:"ui-igdialog-minimize-icon ui-icon ui-icon-minus",maximizeIcon:"ui-igdialog-maximize-icon ui-icon ui-icon-extlink",restoreIcon:"ui-igdialog-restore-icon ui-icon ui-icon-copy",pinIcon:"ui-igdialog-pin-icon ui-icon ui-icon-pin-s",unpinIcon:"ui-igdialog-unpin-icon ui-icon ui-icon-pin-w",footer:"ui-igdialog-footer ui-widget-header ui-corner-bottom ui-helper-clearfix",resizing:"ui-igdialog-resizing",dragging:"ui-igdialog-dragging",unmovable:"ui-igdialog-unmovable",overlay:"ui-igdialog-overlay ui-widget-overlay",contentIframe:"ui-igdialog-content-iframe",content:"ui-igdialog-content ui-widget-content ui-dialog-content"},_create:function(){var elem,self=this,elem0=self.element,el=elem0[0],url=el&&el.nodeName==="IFRAME"?el.src:null,o=self.options,state=o.state,parent,css=self.css;o.container=o.container||this.element.parent();parent=o.container;self._fixIE(elem0);self._old={position:elem0.css("position"),left:elem0.css("left"),top:elem0.css("top"),display:elem0.css("display"),visibility:elem0.css("visibility"),width:el.style.width,height:el.style.height};if(url){el.src=o.temporaryUrl||""}self._min=state==="minimized"||state===MIN;self._max=state==="maximized"||state===MAX;self._opened=state&&state!=="closed";self._oldDad=el.parentNode;self._next=self._oldDad?el.nextSibling:null;self._dad=parent;elem0=$("<div />");this.element.contents().appendTo(elem0);el=elem=this.element;elem.css({zIndex:o.zIndex||1e3,outline:0}).attr("tabIndex",o.tabIndex).keydown(function(e){if(o.closeOnEscape&&e.keyCode===$.ui.keyCode.ESCAPE){self.close(e);e.preventDefault()}if(e.keyCode!==$.ui.keyCode.TAB){return}self._tabTime=(new Date).getTime();if(!self._modal&&!self._max){return}var min,max,ti,next,iNext=-1,big=999999,iMin=big,iMax=-1,targ=e.target,ti0=self._getTabIndex(targ),shift=e.shiftKey,tabs=$(":tabbable",elem[0]),len=tabs.length,i=len;while(i-->0){ti=self._getTabIndex(el=tabs[i]);if(ti>iMax){iMax=ti;max=el}if(ti<=iMin){iMin=ti;min=el}if(ti===ti0){if(!next){next=el===targ;if(!next){iNext=i}}else if(iNext<0){iNext=i}}}if(iNext<0){i=len}iMin=shift?-1:big;while(i-->0){ti=self._getTabIndex(tabs[i]);if(ti>ti0&&ti<iMin&&!shift||ti<ti0&&ti>iMin&&shift){iMin=ti;iNext=i}}max=max||elem[0];min=min||max;self._nextTabElem=iNext>=0?tabs[iNext]:shift?max:min;if(targ===elem[0]||targ===min&&shift||targ===max&&!shift){_stopEvt(e);el=shift?max:min;try{el.focus()}catch(ex){}}}).mousedown(function(e){self.moveToTop(e)});el.addClass(css.dialog);if(o.dialogClass){el.addClass(o.dialogClass)}elem0.show().addClass(css.content).appendTo(el);if(url!==null){elem0[0].src=url;elem0.addClass(css.contentIframe)}self._modal=self._hasFocus=false;self._lastFoc="blur";self._doHeader();self._doFooter();self._doDraggable();self._doResizable();if(self._min){self._onMin(true,true,true)}if(self._max){o.pinned=false;self._onMax(true,true,true)}if(o.pinned){self._onPin(true,true,true)}if(self._opened){self._open()}else{elem.hide()}self._created=true;self._save()},_fixIE:function(elem){elem=elem.find("*");var n,e,i=elem.length;while(i-->0){e=elem[i];n=e.nodeName;if(n==="/INPUT"||n==="/IMG"){e.parentNode.removeChild(e)}}},destroy:function(){var self=this,elem0=this.element.children(".ui-igdialog-content");this._doClose(null,true);if(self._winResize){$(window).unbind("resize",self._winResize)}this.element.children(".ui-igdialog-header").remove();this.element.children(".ui-igdialog-footer").remove();elem0.contents().unwrap();this.element.removeClass(self.css.dialog).css(self._old);if(this.options.draggable){this.element.draggable("destroy")}if(this.options.resizable){this.element.resizable("destroy")}this.element.unbind();$.Widget.prototype.destroy.apply(this,arguments);return this},state:function(state){if(!arguments.length){return this.options.state}if((state==="minimized"||state===MIN)&&(!this._min||!this._opened)){if(!this._min){this._minimize()}else{this._open(null,1)}}if((state==="maximized"||state===MAX)&&(!this._max||!this._opened)){if(!this._max){this._maximize()}else{this._open(null,1)}}if((state==="opened"||state===OPEN)&&(this._min||this._max||!this._opened)){this._onMin();this._onMax();this._open();this.options.state=state}if((state==="closed"||!state)&&(this._min||this._max||this._opened)){this._onMin();this._onMax();this.close()}return this},mainElement:function(){return this.element},close:function(e){if(this._opened){this._doClose(e)}return this},open:function(){return this._open(null,1)},minimize:function(){if(!this._min){this._minimize()}return this},maximize:function(){if(!this._max){this._maximize()}return this},restore:function(){if(this._max){this._onMax()}if(this._min){this._onMin()}return this},pin:function(){if(!this.options.pinned){this._pin()}return this},unpin:function(){if(this.options.pinned){this._pin()}return this},getTopModal:function(){return _modals[_modals.length-1]},isTopModal:function(){return this.getTopModal()===this},moveToTop:function(e){var src,name,self=this,o=self.options,zi=o.zIndex,elem=self.element,zi0=self._created?null:zi,modal=o.modal,elem0=this.element[0],scrollTop=elem0.scrollTop,scrollLeft=elem0.scrollLeft;if($.ig&&$.ig.util&&$.ig.util.evtButton(e)){return}zi=zi||1e3;src=e?e.target:null;if(_isSrc(self._header,src)||_isSrc(self._footer,src)){name=src.nodeName;if(name!=="INPUT"&&name!=="BUTTON"){_stopEvt(e);self._setFocus()}}else if(e&&!this._hasFocus){self._setFocus()}_maxZ=Math.max(zi0||zi,_maxZ);if(o.pinned){return self}if(modal&&self._lastZ){elem=self._modalDiv;if(elem&&elem[0].offsetWidth<10){self._onResize()}return self}if(_lastTop===self&&(zi0||zi)>=_maxZ){return self}if(_lastTop&&!zi0){_lastTop.element.css("zIndex",_lastTop._lastZ||-1);_lastTop._save()}if(_lastZ>=_maxZ){_maxZ++}if(modal&&!zi0){_maxZ++;_maxZ++}_lastTop=self;self._lastZ=_lastZ=zi0||(modal||_modals.length>0?_maxZ:zi);if(!zi0){elem.css("zIndex",zi0||_maxZ);self._save()}elem0.scrollTop=scrollTop;elem0.scrollLeft=scrollLeft;if(modal){self._doModal(_maxZ)}return self},content:function(newContent){if(arguments.length===0){return this.element.children(".ui-igdialog-content")}this.element.children(".ui-igdialog-content").html(newContent)},_save:function(){var str,input,pos,o=this.options,name=o.inputName;if(!name){return}input=$('input[name="'+name+'"]');if(input.length===0){input=input.parents("form")[0]||document.forms[0];if(!input){return}input=$('<input type="hidden" name="'+name+'" />').appendTo(input)}str="s"+(o.pinned?"1":"")+(this._opened?this._min?2:this._max?3:1:0)+(o.width?":w"+o.width:"")+(o.height?":h"+o.height:"")+(":z"+this.element.css("zIndex")||o.zIndex);pos=o.position;if(pos&&pos.length===2){str+=":p"+pos[0]+","+pos[1]}input.val(str)},_open:function(e,raiseEvt){var self=this,o=self.options,elem=self.element,anim=self._min?null:o.openAnimation,arg={action:"open",owner:this};if(self._opened&&self._vis||raiseEvt&&!self._fireState(e,true,arg)){return self}if(!o.pinned){elem.css("position","absolute")}if(o.width!==null){elem.show()}self._opened=true;self._doSize(1);if(anim){elem.hide().show(anim,function(){self._trigger("animationEnded",e,arg)})}self._vis=true;_visCount++;self._trackFocus(elem);self.moveToTop(true);self._fixState();if(raiseEvt){self._fireState(e,false,arg)}self._save();return self},_initContainer:function(container,change){if(container){if(typeof container==="string"){container=$(container)}if(container&&container[0]){container=container[0]}}if(!container||!container.parentNode){container=this.element.parents("form")[0]||document.body}else if(container.nodeName!=="BODY"){var style=container.style,pos=style?style.position:null;if(style&&(!pos||pos==="static")){style.position="relative"}}if(change){this.element.appendTo(container)}return container},_fixState:function(){this.options.state=this._opened?this._min?"minimized":this._max?"maximized":"opened":"closed"},_minimize:function(e){return this._doState(e,{action:this._min?"restore":"minimize"},e?"minimize":null,"_onMin",true)},_maximize:function(e){return this._doState(e,{action:this._max?"restore":"maximize"},e?"maximize":null,"_onMax",true)},_pin:function(e){return this._doState(e,{action:this.options.pinned?"unpin":"pin"},e?"pin":null,"_onPin")},_close:function(e){return this._opened?this.close(e):this._open(e)},_getTabIndex:function(e){return isNaN(e=parseInt(e.tabIndex,10))||e<1?0:e},_doHeader:function(){var button,id,evts,i=4,self=this,header=self._header,o=self.options,txt=o.headerText,css=self.css;if(header){header.remove()}delete self._minHW;header=self._header=_notab($("<div />").addClass(css.header).css("display","block").prependTo(self.element)).dblclick(function(e){var dbl=o.enableDblclick;if(!dbl){return}if(self._min){self._doState(e,{action:"restore"},null,"_onMin",true)}else if(dbl===true||dbl==="auto"&&o.showMaximizeButton){self._doState(e,{action:self._max?"restore":"maximize"},null,"_onMax",true)}});if(o.imageClass){self._img=$("<span />").addClass(css.headerImage).addClass(o.imageClass).html("&nbsp;").appendTo(header)}self._headerText=$("<span />").addClass(css.headerText).html(txt||"&nbsp;").appendTo(header);evts={mouseover:function(){$(this).addClass(css.headerButtonHover)},mouseleave:function(){$(this).removeClass(css.headerButtonHover)},mousedown:function(e){this._mdb=$.ig&&$.ig.util&&$.ig.util.evtButton(e)},click:function(e){if(!e||this._mdb){return}try{self["_"+$(this).attr("data-id")](e)}catch(ex){}_stopEvt(e)},touchstart:function(e){this._drag=null;_stopEvt(e)},touchmove:function(e){this._drag=1;_stopEvt(e)},touchend:function(e){if(!this._drag){$(this).trigger("click")}}};while(i-->=0){if(i===3&&o.showCloseButton){id="close"}else if(i===2&&o.showMaximizeButton){id="maximize"}else if(i===1&&o.showMinimizeButton){id="minimize"}else{id=i===0&&o.showPinButton?"pin":null}if(id){button=$("<a />").addClass(css.headerButton+" "+css[id]).attr("data-id",id).attr("href","#").attr("role","button").bind(evts).appendTo(header);$("<span />").addClass(css[id+"Icon"]).appendTo(button);self._loc(button,i===3?CLOSE:i===2?MAX:i===1?MIN:PIN)}}if(!o.showHeader){header.hide()}},_doFooter:function(){var self=this,o=self.options,txt=o.footerText,css=self.css;if(self._footer){self._footer.remove();delete self._footer}if(o.showFooter){self._footer=_notab($("<div />").addClass(css.footer).css("display","block").html(txt||"&nbsp").appendTo(self.element))}},_onMin:function(e,noSize,noFocus){var but,o=this.options,bar=this._footer,css=this.css,header=this._header,min=e&&e.type?!this._min:!!e;if(min===this._min&&this._created){return}this._min=min;if(min&&o.pinOnMinimized){this._onPin(min,true,true)}but=header.find("."+css.minimize);but.find("*").removeClass(min?css.minimizeIcon:css.restoreIcon).addClass(min?css.restoreIcon:css.minimizeIcon);if(e&&e.type&&min&&this._max){this._onMax(false,true,true)}this._loc(but,min?RESTORE:MIN);if(min){header.addClass(css.headerMinimized);if(bar){bar.hide()}}else{header.removeClass(css.headerMinimized);if(bar){bar.show()}}if(!noSize&&this._vis){this._doSize()}if(!noFocus&&this._vis){this._setFocus()}this._save()},_onMax:function(e,noSize,noFocus){var but,o=this.options,header=this._header,css=this.css,max=e&&e.type?!this._max:!!e;if(max===this._max&&this._created){return}this._max=max;if(!max){this._restoreHtml()}else{this._originalParent=this.element.parent();this.element.appendTo(document.body)}but=header.find("."+css.maximize);but.find("*").removeClass(max?css.maximizeIcon:css.restoreIcon).addClass(max?css.restoreIcon:css.maximizeIcon);this._loc(but,max?RESTORE:MAX);if(max){if(this._min){this._onMin(false,true,true)}if(o.pinned){this._onPin(false,true,true)}}if(max){header.addClass(css.unmovable)}else{header.removeClass(css.unmovable)}if(!noSize&&this._vis){this._doSize()}if(!noFocus&&this._vis){this._setFocus()}this._save()},_onPin:function(e,noSize,noFocus){var but,elem,parent,dad,pos,old=this._old,next=this._next,css=this.css,header=this._header,o=this.options,pin=e&&e.type?!o.pinned:!!e;if(pin===o.pinned&&this._created){return}o.pinned=pin;but=header.find("."+css.pin);but.find("*").removeClass(pin?css.pinIcon:css.unpinIcon).addClass(pin?css.unpinIcon:css.pinIcon);if(this._max&&pin){this._onMax(false,false,true)}this._loc(but,pin?UNPIN:PIN);if(pin){header.addClass(css.unmovable)}else{header.removeClass(css.unmovable)}elem=this.element;if(pin){pos=old.position;if(this._resize&&(pos==="static"||!pos)){pos="relative"}this._pinPos=pos={position:pos,left:old.left,top:old.top}}else{pos={position:"absolute"}}elem.css(pos);parent=elem.parent()[0];dad=pin?this._oldDad:this._dad;if(dad&&dad!==parent){if(pin&&next&&next.parentNode===dad){elem.insertBefore(next)}else{elem.appendTo(dad)}}if(!noFocus&&this._vis){this._setFocus()}if(!noSize&&this._vis){if(!pin){this._doSize(1)}else{this._doModal()}}this._save()},_doClose:function(e,destroy){var i,self=this,elem=self.element,arg={action:"close"},o=self.options,anim=self._min||destroy?null:o.closeAnimation;if(!self._opened||!destroy&&!self._fireState(e,true,arg,e?"close":null)){return}self._trackFocus(elem,1);self._restoreHtml();if(_lastTop===self){_lastTop=null}self._fireFoc(false);self._hasFocus=false;delete self._lastZ;self._vis=self._opened=false;if(destroy){o.modal=false}self._doModal();if(anim){elem.hide(anim,function(){self._trigger("animationEnded",e,arg)})}else if(!destroy){elem.hide()}if(!destroy){self._fixState();self._fireState(e,false,arg)}if(--_visCount<1){_visCount=_lastZ=_maxZ=0}else if(_visCount===(i=_modals.length)){_modals[i-1]._setFocus()}self._save()},_fireState:function(e,before,arg,but){if(before){var o=this.options;arg.oldState=o.state;arg.oldPinned=o.pinned;arg.owner=this;if(but){arg.button=but}}return this._created?this._trigger("stateChang"+(before?"ing":"ed"),e,arg):true},_doState:function(e,arg,but,fnName,show){if(this._fireState(e,true,arg,but)){this[fnName](e||{type:1});if(show&&!this._opened){this._open(null,true)}this._fixState();if(this._created){this._trigger("stateChanged",e,arg)}}return this},_fireFoc:function(foc,e){var name=foc?"focus":"blur";if(name!==this._lastFoc){this._trigger(this._lastFoc=name,e,{owner:this});if(this.options.enableHeaderFocus){name=this.css.headerFocus;if(foc){this._header.addClass(name)}else{this._header.removeClass(name)}}}},_trackFocus:function(elem,remove){var self=this,focusEvt=self._focusEvt,track=self.options.trackFocus;if(!focusEvt&&!track){return}if(remove){if(self._focBind){self._focBind.unbind(focusEvt);delete self._focBind}return}if(!focusEvt){focusEvt=function(e){var elems,old=self._focBind,foc=e.type==="focus";if(!foc&&old&&elem){elems=elem.find("*").not(old);if(elems.length){self._focBind=old.add(elems);elems.bind(focusEvt)}}self._hasFocus=foc;setTimeout(function(){var focusTo=self.getTopModal(),elem=self.element;if(elem&&focusTo&&!self._hasFocus&&!foc&&_lastTop===self){if(self._max||focusTo===self){focusTo=self._nextTabElem||elem[0]}else{focusTo=self._tabTime&&(new Date).getTime()-self._tabTime<200?elem[0]:null}if(focusTo){self._setFocus(focusTo)}}self._fireFoc(self._hasFocus,e)},50)};focusEvt=self._focusEvt={focus:focusEvt,blur:focusEvt}}if(track&&elem){self._focBind=elem.find("*").add(elem).bind(focusEvt)}},_setFocus:function(elem){var self=this;setTimeout(function(){try{if(!self._hasFocus){if(!self.options.trackFocus){self._hasFocus=true}elem=elem||self.element[0];elem.focus()}}catch(ex){}},100)},_restoreHtml:function(){var html,old=this._oldHtml,parent=this._originalParent;if(parent){this.element.appendTo(parent);this._originalParent=null}if(old){html=old.html;if(html.style){html.style.overflow=old.overflow}html.scrollLeft=old.scrollLeft;html.scrollTop=old.scrollTop;delete this._oldHtml}},_touch:function(elem,name){var start,self=this,evt=function(evt,type){var act,e=evt.originalEvent,touches=e?e.touches:null,one=touches&&touches.length===1;if(one&&type){_stopEvt(evt)}one=one&&type==="move";if(start){start=one?start:null;act=one?"Drag":"Stop"}else if(one){start=true;elem.trigger("mouseover");act="Start"}if(act){e=self.element.data(name);act="_mouse"+act;if(e&&e[act]){evt.pageX=one?touches[0].pageX:0;evt.pageY=one?touches[0].pageY:0;e[act](evt)}}};elem.bind({touchstart:function(e){evt(e,"start")},touchmove:function(e){evt(e,"move")},touchend:function(e){evt(e)}})},_doDraggable:function(){var self=this,o=self.options,elem=self.element;if(elem.draggable&&o.draggable){self._touch(self._header,"draggable");elem.draggable({cancel:".ui-igdialog-content, .ui-igdialog-headerbutton",handle:".ui-igdialog-header",containment:"document",start:function(){if(o.pinned||self._max){return false}$(this).addClass(self.css.dragging)},stop:function(e,ui){var doc=$(document);o.position=[ui.position.left-doc.scrollLeft(),ui.position.top-doc.scrollTop()];$(this).removeClass(self.css.dragging);self._save()}})}},_doResizable:function(){var elems,r,i=0,self=this,o=self.options,elem=self.element,pos;if(!elem.resizable){return}self._resize=o.resizable;if(!self._resize){return}elem.css("position",elem.css("position")).resizable({cancel:"."+self.css.content,containment:"document",alsoResize:self.element.children(".ui-igdialog-content"),maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:self._minWidth(),minHeight:o.minHeight,handles:typeof o.resizable==="string"?o.resizable:"n,e,s,w,se,sw,ne,nw",start:function(event,ui){$(this).addClass(self.css.resizing);pos=ui.originalPosition;if(o.pinned&&self._pinPos){elem.css(self._pinPos)}},resize:function(){self._fixCaption();elem.css(pos);if(o.pinned&&self._pinPos){elem.css(self._pinPos)}},stop:function(){$(this).removeClass(self.css.resizing);o.height=$(this).height();o.width=$(this).width();self._save()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se");r=elem.data("resizable")||elem.data("ui-resizable");if(r){if(!r._dragFix){r._dragFix=r._mouseDrag;r._mouseDrag=function(e){var x,y,d=r.parentData;if(d&&e){x=e.pageX;y=e.pageY;if(x<=d.left||y<=d.top||x>=d.left+d.width||y>=d.top+d.height){return false}}return r._dragFix(e)}}elems=r._handles;i=elems.length}while(i-->0){self._touch($(elems[i]),"resizable")}},_toPx:function(val,height){if(typeof val==="number"){return val}if(!val){return height?val:0}val=val.toString();var elem,num=parseInt(val,10);if(isNaN(num)){return 0}if(val.indexOf("m")>0||val.indexOf("e")>0||val.indexOf("i")>0||val.indexOf("t")>0){elem=$("<div />").css({visibility:"hidden",width:val}).appendTo(this._dad);num=elem.width();elem.remove()}else if(val.indexOf("%")>0){val=this._winRect(1);val=height?val.height:val.width;return Math.floor(num*val/100)}return num},_doSize:function(fixPos){var self=this,o=self.options,max=self._max,pos=max?[0,0]:o.position,resize=self._resize?".ui-resizable-handle":null,elem0=self.element.children(".ui-igdialog-content"),elem=self.element;if(resize){if(self._min||max){$(resize,elem).hide()}else{$(resize,elem).show()}}self._headerText.css("width",0);if(self._min){elem0.hide();self._fixCaption(elem)}else if(max){elem0.show().css({width:"auto",height:"auto"});elem.css({width:100,height:50})}else if(o.width!==null){this._doSizePX(elem0,elem,Math.max(self._minWidth(),self._toPx(o.width)),self._toPx(o.height,true),o.minHeight);if(resize){elem.resizable("option","minHeight",o.minHeight)}}if(o.width===null){this._fixCaption(elem);elem.show()}if(!o.pinned&&(fixPos||max||self._oldMax)){self._oldMax=max;if(max){self._onResize()}if(elem.position){if(pos){if(pos.length===2&&typeof pos[0]==="number"){if($.ig.util.jQueryUIMainVersion<=1&&$.ig.util.jQueryUISubVersion<9){pos={my:"left top",at:"left top",offset:pos[0]+" "+pos[1]}}else{pos={my:"left+"+pos[0]+" top+"+pos[1],at:"left top"}}}pos=$.extend({},_pos,pos)}elem.css({top:0,left:0}).position(pos||_pos)}}self._doModal();self._save()},_doSizePX:function(elem0,elem,width,height,minHeight){elem0.show().css({width:"auto",height:0,minHeight:0});var zeroHeight=elem.css({width:width,height:"auto",display:"block"}).height();this._fixCaption(elem);if(typeof height==="string"){if(height.indexOf("px")>0){height=parseInt(height,10)}}if(typeof height!=="number"){height=elem0.css("height","auto").height()+zeroHeight}height=Math.max(minHeight,height);elem0.height(Math.max(height-zeroHeight,0));minHeight=height-elem[0].offsetHeight;if(minHeight>0){elem0.height(Math.max(height-zeroHeight+minHeight,0))}},_onResize:function(){var rect,self=this,div=self.isTopModal()?self._modalDiv:null;if(!self._winResize){$(window).bind("resize",self._winResize=function(){setTimeout(function(){self._onResize()},50)})}if(!self._opened||self.options.pinned){return}if(div){div.hide();self._doIframe(div,1)}if(self._max){self._doMaxSize(self.element)}if(div){rect=self._winRect();div.css({width:rect.maxWidth-1,height:rect.maxHeight-1}).show();self._doIframe(div)}},_minHeaderWidth:function(){var outerWidth,elem,width=this._minHW,elems=this._header.children().not(this._headerText),i=elems.length;if(!width){width=3+_getPadding(this._header);while(--i>=0){elem=elems[i];try{outerWidth=$(elem).outerWidth(true)}catch(ex){}width+=1+(outerWidth&&outerWidth>2&&outerWidth<100?outerWidth:elem.offsetWidth)}this._minHW=width}return width},_minWidth:function(){if(!this._minW){this._minW=this._minHeaderWidth()}return Math.max(this.options.minWidth,this._minW)},_fixCaption:function(elem){var width,widths,top,len,topi,j=0,i=-1,header=this._header,cap=this._headerText,minCss=this.css.headerTextMinimized;if(this._min){cap.css("width","").addClass(minCss);if(!elem){return}elem.css({height:"auto",width:"auto",display:"inline-block"});widths=_getPadding(header)+3;cap=header.children();len=cap.length;while(++i<len){widths+=cap[i].offsetWidth+_toPx($(cap[i]),"marginLeft")+_toPx($(cap[i]),"marginRight")}while(j++<2){elem.css("width",widths);widths+=2;i=len;while(i-->0){topi=cap[i].offsetTop;if(i>0&&i<len-1&&Math.abs(top-topi)>4){break}top=topi}if(i<0){j=4}}return}cap.removeClass(minCss);try{width=header.innerWidth()-3}catch(ex){}if(!width||width>1e3){width=header[0].clientWidth-4}width=Math.max(1,width-this._minHeaderWidth());cap.css("width","auto");if(cap[0].offsetWidth*1.3>width){cap.css("width",width)}},_doMaxSize:function(elem){var html,old=this._oldHtml,elem0=this.element.children(".ui-igdialog-content"),rect=this._winRect(),paddingX=_getPadding(elem),paddingY=_getPadding(elem,1);html=rect.html;if(!old){this._oldHtml=old={html:html,scrollLeft:html.scrollLeft,scrollTop:html.scrollTop};html.scrollLeft=html.scrollTop=0;if(html.style){old.overflow=html.style.overflow;html.style.overflow="hidden";if(rect.maxWidth>rect.width||rect.maxHeight>rect.height){rect=this._winRect(1)}}}this._doSizePX(elem0,elem,rect.width-paddingX-1,rect.height-paddingY-1,0)},_winRect:function(sizeOnly){var size,docElem,width,height,widthOk,heightOk,container=this.options.container,maxWidth=0,maxHeight=0,big=999999,win=window,doc=win.document,body=doc.body,html=body;while(html&&html.nodeName!=="HTML"){html=html.parentNode}if(!html){html=body}docElem=doc.documentElement||html;size=doc.compatMode!=="CSS1Compat"&&$.ig.util.isIE?body:html;width=size.clientWidth;height=size.clientHeight;if(sizeOnly){return{width:width,height:height}}if(width&&width>50){maxWidth=width;maxHeight=height}else{width=height=big}widthOk=html.scrollWidth;heightOk=html.scrollHeight;if(widthOk&&heightOk){maxWidth=Math.max(maxWidth,widthOk);maxHeight=Math.max(maxHeight,heightOk)}maxWidth=Math.max(maxWidth,body.scrollWidth);maxHeight=Math.max(maxHeight,body.scrollHeight);widthOk=body.offsetWidth;heightOk=body.offsetHeight;maxWidth=Math.max(maxWidth,widthOk);maxHeight=Math.max(maxHeight,heightOk);return{width:width===big?widthOk:width,height:height===big?heightOk:height,maxWidth:maxWidth,maxHeight:maxHeight,html:html}},_doIframe:function(div,hide){var src="javascript";if(!_iframe){_iframe=_notab($("<iframe />").attr("frameBorder",0).attr("scrolling","no").attr("src",src+":''").css({position:"absolute",filter:"alpha(opacity=50)",opacity:0}))}if(_iframe.parent()[0]!==div.parent()[0]){_iframe.css({width:"1px",height:"1px",marginLeft:div.css("marginLeft"),marginTop:div.css("marginTop"),left:div.css("left"),top:div.css("top"),zIndex:div.attr("zIndex")-1}).insertBefore(div)}_iframe.css({width:hide?"1px":div.css("width"),height:hide?"1px":div.css("height")})},_doModal:function(zi){var i,pos,on,obj,len=_modals.length,self=this,o=self.options,elem=self.element,div=self._modalDiv;on=o.modal&&!o.pinned&&!self._min&&self._opened;i=$.inArray(self,_modals);if(self._modal===on){if(zi&&div){div.css("zIndex",zi-1);self._onResize()}if(!on&&!_lastTop&&len>0){_modals[len-1].moveToTop()}return}if(i<0&&on){if(len>0){_modals[len-1]._modalDiv.hide()}_modals.push(self)}if(i>=0&&!on){if(i>0&&i+1===len){obj=_modals[i-1]}_modals.splice(i,1)}self._modal=on;if(on){self._modalDiv=div=_notab($("<div />").css({position:"absolute",left:0,top:0,zIndex:_maxZ-1}).addClass(self.css.overlay).mousedown(function(e){self._setFocus();_stopEvt(e)}).insertBefore(elem));pos=div.offset();div.css({marginLeft:-pos.left+"px",marginTop:-pos.top+"px"});self._onResize()}else{div.remove();_iframe.remove();delete self._modalDiv;if(obj){obj.moveToTop()}}},_loc:function(but,state){state=(state===MIN?"minimize":state===MAX?"maximize":state===RESTORE?"restore":state===CLOSE?"close":state===PIN?"pin":state===UNPIN?"unpin":"open")+"ButtonTitle";var val=this.options[state]||($.ig&&$.ig.Dialog&&$.ig.Dialog.locale?$.ig.Dialog.locale[state]:null)||"";but.attr("title",val).attr("longdesc",val)},_setOption:function(key,val){var pos,size,drag,resize,elem=this.element,o=this.options,container=key==="container";if(!elem||!key||o[key]===val||key==="mainElement"){return this}if(key==="state"){return this.state(val)}if(key==="pinned"){return this._pin()}if(container){if(o.draggable&&elem.draggable){elem.draggable("destroy");drag=true}if(o.resizable&&elem.resizable){elem.resizable("destroy");resize=true}}$.Widget.prototype._setOption.apply(this,arguments);if(typeof val==="function"){return this}if(container){this._initContainer(val,1);if(drag){this._doDraggable()}if(resize){this._doResizable()}}if(key==="draggable"){if(val){this._doDraggable()}else if(elem.draggable){elem.draggable("destroy")}}if(key==="resizable"){if(val){this._doResizable()}else if(this._resize){this._resize=val;elem.resizable("destroy")}}if(key==="modal"){this._doModal()}if(key.indexOf("Button")>0||key==="image"||key==="headerText"||key==="showHeader"){this._doHeader();size=true}if(key.indexOf("ooter")>0){this._doFooter();size=true}if(key==="tabIndex"){elem.attr("tabIndex",val)}if(key==="zIndex"){elem.css("zIndex",val);this._save()}if(this._vis){pos=key==="position";if(container||size||pos||key.indexOf("idth")>0||key.indexOf("eight")>0){this._doSize(pos||container)}}if(key.indexOf("Foc")>0){this._header.removeClass(this.css.headerFocus);if(key==="trackFocus"&&val!==!!this._focBind){if(this._opened){this._doClose();this._open()}else{this._open();this._doClose()}}}return this}});$.extend($.ui.igDialog,{version:"13.1.20131.2523"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Editors 13.1.20131.2523
*
* Copyright (c) 2011-2014 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery-1.4.4.js
* jquery.ui.core.js
* jquery.ui.widget.js
* jquery.ui.datepicker.js
* infragistics.util.js
*
* Example to use:
*	<script type="text/javascript">
*	$(function () {
*		$('#editor1').igEditor();
*	});
*	</script>
*	<input id="editor1" type="text" />
*/
(function($){var _aNull=function(v,nan){return v===null||v===undefined||nan&&typeof v==="number"&&isNaN(v)},_int=function(val,nan){val=parseInt(val,10);if(isNaN(val)){val=nan||0}return val},_pad_bdr=function(elem,horiz){var v1=horiz?"Left":"Top",v2=horiz?"Right":"Bottom";return _int(elem.css("padding"+v1))+_int(elem.css("padding"+v2))+_int(elem.css("border"+v1+"Width"))+_int(elem.css("border"+v2+"Width"))},_str=function(v){return _aNull(v)?"":v.toString()},_now=function(){return(new Date).getTime()},_offset=function(e,xy){return $.ig.util?$.ig.util.offset(e,xy):xy||(e?e.offset():null)},_stop=function(e){try{e.preventDefault();e.stopPropagation()}catch(ignore){}};$.ig=$.ig||{};$.widget("ui.igEditor",{options:{value:null,tabIndex:null,nullText:null,button:"none",textAlign:null,listItems:null,theme:null,type:null,locale:null,width:null,height:null,validatorOptions:null,required:false,display:"inline-block",renderInContainer:false,selectionOnFocus:-1,readOnly:false,spinOnReadOnly:false,focusOnSpin:false,spinWrapAround:false,hideEnterKey:true,dropDownOnReadOnly:false,dropDownTriggers:"button,ctrl+arrow,alt+arrow",listDropDownAsChild:false,listWidth:0,listMaxHeight:300,listColumns:1,animationShowDuration:200,animationHideDuration:200,inputName:null},events:{keydown:0,keypress:1,keyup:2,mousedown:3,mouseup:4,mousemove:5,mouseover:6,mouseleave:7,focus:8,blur:9,valueChanging:10,valueChanged:11,textChanged:12,invalidValue:13,spin:14,buttonClick:15,showDropDown:16,hideDropDown:17,listSelecting:18,listSelected:19},css:{editor:"ui-igedit ui-state-default ui-widget ui-corner-all",container:"ui-igedit-container",field:"ui-igedit-field",fieldRtl:"ui-igedit-rtl",textArea:"ui-igedit-textarea",hover:"ui-igedit-hover ui-state-hover",focus:"ui-igedit-focus ui-state-focus",buttonsImageStateOverride:"ui-igedit-buttonsimagestateoverride",disabled:"ui-igedit-disabled ui-state-disabled",negative:"ui-igedit-negative",nullValue:"ui-igedit-nullvalue",button:"ui-igedit-button",buttonRtl:"ui-igedit-button-rtl",buttonFocus:"ui-igedit-buttonfocus",buttonDefault:"ui-igedit-buttondefault ui-state-default",buttonHover:"ui-igedit-buttonhover ui-state-hover",buttonPressed:"ui-igedit-buttonpressed ui-state-highlight",buttonDisabled:"ui-igedit-buttondisabled ui-state-disabled",buttonImage:"ui-igedit-buttonimage ui-icon-triangle-1-s ui-icon",buttonClear:"ui-igedit-buttonclear",buttonClearImage:"ui-igedit-buttonimage ui-icon-circle-close ui-icon",buttonImageHover:"ui-igedit-buttonimagehover",buttonImagePressed:"ui-igedit-buttonimagepressed",buttonImageDisabled:"ui-igedit-buttonimagedisabled",spinButton:"ui-igedit-spinbutton",spinButtonImage:"ui-igedit-buttonimage ui-igedit-spinbuttonimage",spinLowerImage:"ui-igedit-spinlowerimage ui-icon-carat-1-s ui-icon",spinLowerImageHover:"ui-igedit-spinlowerimagehover",spinLowerImagePressed:"ui-igedit-spinlowerimagepressed",spinLowerImageDisabled:"ui-igedit-spinlowerimagedisabled",spinUpperImage:"ui-igedit-spinupperimage ui-icon-carat-1-n ui-icon",spinUpperImageHover:"ui-igedit-spinupperimagehover",spinUpperImagePressed:"ui-igedit-spinupperimagepressed",spinUpperImageDisabled:"ui-igedit-spinupperimagedisabled",dropDown:"ui-igedit-dropdown",list:"ui-igedit-list ui-widget ui-widget-content ui-corner-all",listItem:"ui-igedit-listitem ui-state-default",listItemHover:"ui-igedit-listitemhover ui-state-hover",listItemSelected:"ui-igedit-listitemselected ui-state-highlight",listItemColumnBorder:"ui-igedit-listitemcolumnborder",noTopCorners:"ui-igedit-no-top-corners",noBottomCorners:"ui-igedit-no-bottom-corners"},regional:$.ig._regional||{},_create:function(type){var v,css=this.css,elem,field,align,oldCss,o=this.options,me=this,val=o.value;type=this._doType(_aNull(type)?o.type:type,val);if(typeof o.maxLength!=="number"){o.maxLength=0}if(typeof o.spinDelta!=="number"){o.spinDelta=1}o.nullable=o.nullable!==false;this._listID=-1;this._css=css.field;elem=this._element=this._render(this.element,o,css);if(o.display){elem.css("display",o.display)}if(type===3&&(!$.datepicker||this._ta)){throw new Error("The ui.igDatePicker depends on jquery.ui.datepicker and TEXTAREA/multiline is not supported")}if(this._ta){this._css+=" "+css.textArea}field=this._field;this._box=field[0].type==="checkbox";this._1e=field===elem;if(o.readOnly){field[0].readOnly="readonly"}align=o.textAlign;if(!align&&type>3){align="right"}if(align){field.css("textAlign",align)}field[0]._id=-1;field[0].disabled=o.disabled;this._hover=this._mouseDown=0;this._fix=1;this._fcs=-1;this._bad=0;this._k0=this._sel0=0;this._noPaste=0;this._fixMode(1);this._clearHide=false;me._evts=v={keydown:function(e){me._onEvt(e,0)},keypress:function(e){me._onEvt(e,1)},keyup:function(e){me._onEvt(e,2)},paste:function(e){me._onEvt(e,11)},beforecut:function(e){me._onEvt(e,11)},cut:function(e){me._onEvt(e,11)},drop:function(e){me._onEvt(e,11)},focus:function(e){me._onEvt(e,8)},blur:function(e){me._onEvt(e,9)}};field.bind(v);me._mEvts=v={mousedown:function(e){me._onEvt(e,3)},mouseup:function(e){me._onEvt(e,4)},mousemove:function(e){me._onEvt(e,5)},MSPointerOver:function(e){me._onEvt(e,26)},pointerover:function(e){me._onEvt(e,26)},mouseover:function(e){me._onEvt(e,6)},mouseleave:function(e){me._onEvt(e,7)}};if(this._buttons&&this._buttons[1]){v.DOMMouseScroll=function(e){me._onEvt(e,10)};v.mousewheel=function(e){me._onEvt(e,10)}}elem.bind(v);this._fcs=0;v=o.maxLength;if(v&&v>0){field[0].maxLength=v}v=o.tabIndex;if(!_aNull(v)){field[0].tabIndex=v}v=o._vsFormat;if(v&&val&&type>3&&typeof val!=="number"){val=parseFloat(this._txtAsNum(val.toString(),v,"-"))}this._setVal(_aNull(val)?this._value:val);if(this._val()===""){this._text=this._field[0].value=this._focTxt("",false,"")}this._fixCss();oldCss=this._oldCss;val=o.height;if(!val&&!this._1e){val=oldCss.height;if(val){val=val.indexOf("px")>0?_int(val):this.element.height()}}this._height(val);if(this._box){this._fixBC(field,field)}val=o.width;if(!val&&!this._1e){val=oldCss.width;if(val){val=val.indexOf("px")>0?_int(val):this.element.width()}}if(this._selElem){delete oldCss.width;delete oldCss.height}this._width(val);this._lastText=this._val();this._initValidator();this._doClear(o.value)},_doType:function(type,val){if(type==="text"){type=0}if(type==="mask"){type=1}if(type==="date"){type=2}if(type==="datepicker"){type=3}if(type==="numeric"){type=4}if(type==="currency"){type=5}if(type==="percent"){type=6}if(typeof type!=="number"||type<0||type>6){if(typeof val==="number"){type=4}else if(val&&val.getMonth){type=2}else{type=0}}this._type=type;return type},_render:function(elem,o,css){var spin,name,par,csso,inp,cont,oldC,oldA,i,obj,img,clear,buts,butCss,left=elem.css("direction")==="rtl",but=o.button,field=elem,sel=null;name=elem[0].nodeName;par=elem[0].parentNode;if(name){name=name.toUpperCase()}this._ta=name==="TEXTAREA";this._td=name==="TD";this._left=left;inp=name==="INPUT";sel=this._selElem=name==="SELECT";spin=but&&but.indexOf("spin")>=0;clear=but&&but.indexOf("clear")>=0;but=but&&but.indexOf("dropdown")>=0||sel&&!spin;if(clear||but||spin){buts=this._buttons=[]}cont=buts||o.renderInContainer||o.theme;oldC=this._oldCss={display:0};oldA=this._oldAttr={className:0,title:0};if(inp){oldA.value=0;inp=elem[0].type||"text";if(inp==="date"||inp==="number"){elem[0].type="text";oldA.type=inp}}else if(sel){sel=o.listItems;if(!sel){o.listItems=[];sel=elem[0].options;i=sel?sel.length:0;if(i>0){while(i-->0){obj=sel[i].value;img=sel[i].text;o.listItems[i]={value:obj,text:_aNull(img)?obj:img}}this._listID=elem[0].selectedIndex}sel=1}}else{oldA.innerHTML=0}if(inp||this._ta){oldA.disabled=oldA.readOnly=oldA.alt=oldC.textAlign=0}for(i in oldC){if(oldC.hasOwnProperty(i)){oldC[i]=elem.css(i)}}for(i in oldA){if(oldA.hasOwnProperty(i)){oldA[i]=elem[0][i]}}oldC.width=elem[0].style.width;oldC.height=elem[0].style.height;i=inp?oldA.value:sel?elem.val():oldA.innerHTML;if(i===o.nullText){i=""}if(!this._ta&&i){i=i.replace(/[\x09\x0a]/g,"")}this._value=i;if(inp||this._ta||sel){if(oldA.className){this._css+=" "+oldA.className}if(cont){this._swap=true;elem.css("display",sel?"none":"");elem=$("<span />");par.insertBefore(elem[0],field[0]);if(sel){field=$("<input />")}else{par.removeChild(field[0])}elem.css("display",oldC.display)}else{this._css+=" "+css.editor;this._field=elem;return this._field}}else{if(o.textMode==="textarea"||o.textMode==="multiline"){field=$("<textarea />");this._ta=1}else{field=$(o.textMode?'<input type="'+o.textMode+'"/>':"<input />")}elem[0].innerHTML=""}elem.addClass(css.editor+" "+css.container);if(o.theme){elem.addClass(o.theme)}this._field=field;butCss=css.button+" "+css.buttonDefault;if(left){butCss+=" "+css.buttonRtl;this._css+=" "+css.fieldRtl}i=buts?-1:6;inp=this;this._touchEvts={touchstart:function(e){inp.__touch=1;this._drag=null;_stop(e)},touchmove:function(e){this._drag=1;_stop(e)},touchend:function(){if(!this._drag){$(this).trigger("mousedown").trigger("mouseup")}}};while(i++<4){if(but&&i===0||clear&&i===3||spin&&(i===1||i===2)){if(i===0){csso=[butCss,css.buttonHover,css.buttonPressed,css.buttonDisabled,css.buttonImage,css.buttonImageHover,css.buttonImagePressed,css.buttonImageDisabled];sel="button"}else if(i===1){csso=[butCss+" "+css.spinButton,css.buttonHover,css.buttonPressed,css.buttonDisabled,css.spinButtonImage+" "+css.spinUpperImage,css.spinUpperImageHover,css.spinUpperImagePressed,css.spinUpperImageDisabled];sel="spinUpper"}else if(i===2){csso=[butCss+" "+css.spinButton,css.buttonHover,css.buttonPressed,css.buttonDisabled,css.spinButtonImage+" "+css.spinLowerImage,css.spinLowerImageHover,css.spinLowerImagePressed,css.spinLowerImageDisabled];sel="spinLower"}else{csso=[butCss+" "+this.css.buttonClear,css.buttonHover,css.buttonPressed,css.buttonDisabled,css.buttonClearImage,css.buttonImageHover,css.buttonImagePressed,css.buttonImageDisabled];sel="clear"}obj=buts[i]=$("<span />").addClass(csso[0]).appendTo(elem).bind(this._touchEvts);obj[0]._css=csso;obj[0].longdesc=obj[0].title=this._optVal(sel+"Title",1);img=$("<span />").addClass(csso[4]).appendTo(obj);img[0]._id=i+5;obj[0]._id=i+1}}field.appendTo(elem);return elem},_leftShift:function(){var left=0,buts=this._buttons,i=this._left&&buts?4:0;while(i-->0){if(buts[i]){left+=buts[i][0].offsetWidth}}return left},_val:function(){var field=this._field;return field?this._box?field[0].checked:this._nullT?"":field[0].value:""},_fixNull:function(){var txt,nullTxt=this.options.nullText;if(!this._field||!nullTxt&&!this._nullT){return}txt=this._val();this._nullT=null;if(txt===""&&typeof nullTxt==="string"&&this._fcs<2){this._nullT=true;this._field[0].value=nullTxt}this._fixCss()},_focTxt:function(txt,foc,e){var nt=this.options.nullText;this._nullT=null;if(!foc&&txt===""&&nt&&(!_aNull(e)||this.options.readOnly)){txt=nt;this._nullT=true}return txt},validate:function(noLabel){return!this.options.validatorOptions||!this._doInvalid(null,noLabel?2:1)},isValid:function(){return!this._doInvalid(null,9)},_doInvalid:function(e,flag){if(!this._field){return}var ch,i,old,fixVal,val=this._val(),cancel=false,fac=1,inv=this._invPlus,o=this.options,type=this._type;this._inv=null;if(inv){i=0;fixVal=type}else if(o.required&&(!val||type===1&&!this.getValueByMode(0,"",1))){inv=1;fixVal=type}else if(type===0){if(!o.nullable&&!val){inv=1}}else if(type===1){val=this._txt;i=val.length;while(i-->0&&!inv){ch=val.charCodeAt(i);if(ch<21&&ch%2===1){val=this._getVal();inv={value:val,message:this._optVal("mask",2)}}}}else if(type<4){val=this._toDate(val,e==="",true,true);inv=this._inv}else{val=this._toNum(val,true,true);inv=this._inv;fac=this._prop(7);if(inv&&val&&fac>1){old=val;val/=fac;inv.value=val}}if(fixVal===1){val=this._txt}else if(fixVal){val=fixVal<4?this._toDate(val,e==="",true,true):this._toNum(val,true,true)}if(inv===1){val=null;inv={value:val,message:this._optVal("required",2)}}if(typeof inv==="string"){inv={value:val,message:inv}}if(flag===9){return inv}if(inv){cancel=this._fire(13,null,inv);if(val!==inv.value){val=inv.value;inv=null}if(old){if(inv){val=old}else{if(_aNull(val,1)){val=null}else if(val){val*=fac}}}if(type<=1&&!inv){this._setVal(val);return}}if(type>1&&type<4){this._isNull=_aNull(val);if(!this._isNull){this._date=val}if(val&&o.useLastGoodDate){this._goodD=val}}this._value=val;if(flag&&!cancel&&!this._setOpt){return this._doError(flag,null,inv?inv.message:null)}},_focusTxt:function(foc,e,txt0){var e0=e,txt="",o=this.options,type=this._type,d=null,prompt="";if(type===1){txt0=null;if(!_aNull(e)&&!foc){e=e!=="";if(e&&this._bad!==0){this._txt=this._setTxt(this._val(),5,true)}txt0=this._txt;if(!e){this._doInvalid(e0)}}txt=this._getTxt(foc?5:4,foc?o.promptChar:o.padChar,txt0)}else if(type===2||type===3){if(_aNull(txt0)){prompt=o.promptChar;if(_aNull(e)&&foc){return this._getTxt(5,prompt)}if(!_aNull(e)&&!foc){this._doInvalid(e);d=this._value}else if(!this._isNull){d=this._date}}else{d=this._toDate(txt0,foc,true)}txt=this._toTxt(d,foc,prompt,!_aNull(e))}else if(type>3){if(!_aNull(e)&&!foc){this._doInvalid()}txt=this._toTxtNum(this._value,foc)}else{txt=this._val();if(!_aNull(e)&&!foc){this._doInvalid(e)}}return this._focTxt(txt,foc,e)},_repaint:function(){if(this._field&&this._val()!==this._text){this._field[0].value=this._text}},_instant:function(p1,limit,f){var val,type=this._type,mode=this._dataMode;if(this._box){return this._val()}if(type===1){return this.getValueByMode(mode,p1,limit)}if(type===2||type===3){return this.getValueByMode(p1?0:mode,limit)}if(type>3){val=this._toNum(this._val(),limit);if(val&&(limit||f)&&!isNaN(val)&&mode>0){val/=this._prop(7)}return p1||mode>0?val:this._toTxtNum(val,mode===0)}return this._val()},_optVal:function(key,flag){var val=this._validator,o=this.options;if(flag===2){return val?val._loc(key):""}val=o[key];if(!_aNull(val)){return val}if(flag===3||flag===1){if(flag===1&&this._type===3){key="datePickerButtonTitle"}val=o.locale?o.locale[key]:null;return val||($.ig&&$.ig.Editor&&$.ig.Editor.locale?$.ig.Editor.locale[key]:null)||""}o=o.regional;if(typeof o==="string"){o=$.ig.regional[o]}if(o){val=o[key]}if(!o||_aNull(val)){val=$.ig.regional.defaults[key]}return _aNull(val)?this.regional[key]:val},_setOption:function(key,val){var v,old=val,dp=null,o=this.options,loc=key==="locale",reg=key==="regional",buts=this._buttons,field=this._field;if(o[key]===val||key==="textMode"||!field){return this}if(key==="buttonHidden"){this._butVis(null,val);return this}if(key==="theme"){if(this._1e){return this}for(v=0;v<3;v++){if(buts&&buts[v]){buts[v].css("height","")}}if(o.theme){this._element.removeClass(o.theme)}if(val){this._element.addClass(val)}this._listRemove();this._height(o.height);this._width(o.width)}if(key==="inputMask"&&this._type===1){old=this.getValueByMode(0," ",1);this._setMask(val);this._setTxt(old,0)}o[key]=val;if(typeof val==="function"){return this}if(reg&&this._dp){dp=this._dpRegion();if(dp){v=o.datepickerOptions=$.extend(o.datepickerOptions,dp);this._dpOption(v)}}v="buttonTitle";if((loc||key===v)&&buts&&buts[0]){buts[0][0].title=this._optVal(v,1)}v="spinUpperTitle";if((loc||key===v)&&buts&&buts[1]){buts[1][0].title=this._optVal(v,3)}v="spinLowerTitle";if((loc||key===v)&&buts&&buts[2]){buts[2][0].title=this._optVal(v,3)}v="clearTitle";if((loc||key===v)&&buts&&buts[3]){buts[3][0].title=this._optVal(v,3)}if(key==="disabled"){field[0].disabled=val;this._fixCss()}if(key==="display"){this._element.css(key,val)}if(key==="textAlign"){field.css(key,val)}if(key==="readOnly"){field[0].readOnly=val?"readonly":""}if(key==="maxLength"||key==="tabIndex"){field[0][key]=val}if(key==="value"){this.value(val)}if(key==="width"){this._width(val)}if(key==="height"){this._height(val)}v=key==="required";if(key==="validatorOptions"||v){this._initValidator(false,v)}if(key==="nullText"){this._fixNull()}if(key==="type"){this._doType(val);reg=3}key=key.toLowerCase();v=key.indexOf("minv")===0?1:key.indexOf("maxv")===0?2:key.indexOf("maxd")>=0||key.indexOf("mind")>=0?-1:0;if(key.indexOf("list")===0){this._listRemove()}else if(key.indexOf("an")===0){if(this._dp&&key.indexOf("show")>7){this._dpOption(key.indexOf("eff")>7?"showAnim":"duration",val)}}else if(key.indexOf("kero")>0){if(this._dp){this._dpOption(val)}}else if(key.indexOf("data")>=0||v||reg||!_aNull(this.regional[key])||key.indexOf("date")===0||key.indexOf("pat")>=0||key.indexOf("roup")>0||key.indexOf("sep")>=0||key.indexOf("ymb")>0){if(v>0&&this._dp){dp=$.data(field[0],"datepicker");if(dp){dp.settings[v===1?"minDate":"maxDate"]=null}}this._setOpt=true;this._listRemove();this._fixMode(reg===3?3:0);this._repaint();this._lastText=this._val();this._setOpt=null}return this},_dpRegion:function(){var reg=this.options.regional;return $.datepicker&&typeof reg==="string"?$.datepicker.regional[reg==="defaults"||reg==="en-US"?"":reg]:null},_dpOption:function(val,p){var old=this._getVal(1);if(val&&val.changeYear&&$.ig.util.isOpera){val.changeYear=false}this._field.datepicker("option",val,p);this._setVal(old)},getRegionalOption:function(name){return this._optVal(name)},field:function(){return this._field},mainElement:function(){return this._element},dropDownElement:function(){var el=this._ddList;if(this._type===3){el=$.datepicker;if(el){el=el._ig_dp===this?el.dpDiv:null}}return el||null},show:function(){return this._vis(true)},hide:function(){return this._vis()},remove:function(){var p,e=this._element;p=e&&e[0]?e[0].parentNode:null;if(p&&p.tagName){this._doError();this._doDrop();this._stopTimer();this._hadFocus=null;this._vAct();this._noPaste=this._fcs=this._k0=this._hover=this._mouseDown=0;this._fixCss();p.removeChild(e[0])}return this},dropDownVisible:function(showHide){if(!arguments.length){return!!this._ddOn}if(!showHide){this._doDrop()}else if(!this._ddOn){this._doDrop(1)}return this},findListItemIndex:function(text,ignoreCase,partial,contains){var item=this._find(_str(text),0,1,ignoreCase,partial,contains);return item?item.id:-1},addListItems:function(items,index){return this._listChange(items,index,2)},addListItem:function(item,index){return this._listChange([item],index,2)},removeListItem:function(item){return this._listChange(item,-1,1)},removeListItemAt:function(index){return this._listChange(null,index,1)},clearListItems:function(){return this._listChange(null,-1,0)},selectedListIndex:function(index){if(!arguments.length){return this._listID}this._listSelect(index)},getSelectedListItem:function(){var list=this.options.listItems,id=this._listID;return list&&id>=0?list[id]:null},hasInvalidMessage:function(){return this._validator?this._validator.isMessageDisplayed():false},validator:function(){return this._validator||null},text:function(val,flag){if(val===undefined){return this._val()}if(this._type>0){this._sTxt=1;if(this._type===1){this._setTxt(val,_aNull(flag)?5:1e3+flag)}else{this._setVal(val,true)}this._sTxt=0}else{if(val){this._nullT=null}this._text=val;this._repaint()}if(this._fix===1){this._old=this._instant(1,null,1)}return this},_df:function(date,f,val,h,m,s,ms){var utc=this.options.enableUTCDates;if(f===-1){return date&&utc?new Date(date.getTime()+date.getTimezoneOffset()*6e4):date}if(!date){date=new Date;if(utc){date.setUTCMinutes(date.getUTCMinutes()-date.getTimezoneOffset())}return date}if(!_aNull(h)){return utc?new Date(Date.UTC(date,f,val,h,m,s,ms)):new Date(date,f,val,h,m,s,ms)}if(_aNull(val)){if(f===0){return utc?date.getUTCFullYear():date.getFullYear()}if(f===1){return utc?date.getUTCMonth():date.getMonth()}if(f===2){return utc?date.getUTCDate():date.getDate()}if(f===3){return utc?date.getUTCHours():date.getHours()}if(f===4){return utc?date.getUTCMinutes():date.getMinutes()}if(f===5){return utc?date.getUTCSeconds():date.getSeconds()}return utc?date.getUTCMilliseconds():date.getMilliseconds()}if(f===0){if(utc){date.setUTCFullYear(val)}else{date.setFullYear(val)}}if(f===1){if(utc){date.setUTCMonth(val)}else{date.setMonth(val)}}if(f===2){if(utc){date.setUTCDate(val)}else{date.setDate(val)}}if(f===3){if(utc){date.setUTCHours(val)}else{date.setHours(val)}}if(f===4){if(utc){date.setUTCMinutes(val)}else{date.setMinutes(val)}}if(f===5){if(utc){date.setUTCSeconds(val)}else{date.setSeconds(val)}}if(f===6){if(utc){date.setUTCMilliseconds(val)}else{date.setMilliseconds(val)}}},value:function(val){if(val===undefined){val=this._getVal();return val===undefined?null:val}this._setVal(val,true);this._lastText=this._val();return this},_getVal:function(numDate){var o=this.options,val=this._instant(numDate,1);if(this._type>3){if(_aNull(val)){val=o.nullValue;if(this._dataMode<=0){return _str(val)}return o.nullable||!_aNull(val)?val:NaN}}return val},_set_val:function(val,obj){this._fix=0;this._setVal(val,obj);this._fix=1},_setVal:function(val,obj){var txt,max,type=this._type;if(!this._field){return}if(this._box){if(val!==true){val=val==="true"}this._field[0].checked=val}else if(type===1){this._setTxt(_str(val),this._dataMode)}else if(type===2||type===3){if(!_aNull(val)&&!val.getTime){val=val.toString();val=obj=this._toDate(val,this._dataMode<2)||this._toDate(val,true)}obj=val;val=this._limits(val);if(_aNull(val)){val=obj}this._txt=this._mask;this._isNull=_aNull(val);if(!this._isNull){this._toTxt(val,true,"",true)}else{val=this._df()}this._date=val;if(this.options.useLastGoodDate){this._goodD=val}this._text=this._focusTxt(this._fcs>1);this._repaint()}else if(type>3){if(_aNull(val,1)){val=null}if(val&&typeof val==="number"&&this._fix!==0){val*=this._prop(7)}val=this._toNum(val,true);txt=this._toTxtNum(val,this._fcs===2);max=this._prop(12);if(obj===2&&max>0&&txt.length>max){return}this._focTxt(txt);this._text=txt;this._value=val;this._repaint();this._fixCss()}else{this.text(_str(val))}if(this._fix===1&&type>0){this._old=this._instant(1,null,1)}txt=this.options.value=this._getVal();this._doClear(txt);this._fixNull();this._dtt();this._fixList(txt)},_fixList:function(val){var i=-1,list=this.options.listItems,len=list?list.length:0;if(len<1||!this._fix||_aNull(this._lastText)){return}if(!_aNull(val)){while(++i<len){if(list[i]===val){break}}if(i>=len){list=this._findItem(this._val(),-1);i=list?list.id:-1}}this._listSelect(i)},_doClear:function(val){if(this._buttons&&this._buttons[3]){this._butVis(!val||this._type<4&&!this.getValueByMode(0,val))}},_vis:function(show){var e=this._element;e.css("display",show?this.options.display:"none");this._fixHeight();this._doError();return this},_elemWidth:function(elem,val){if(elem&&val>1&&elem[0]._wd!==val){elem[0]._wd=val;val=Math.max(1,val-_pad_bdr(elem,1));elem.css("width",val);return true}},_elemHeight:function(elem,val,but){if(elem&&val>1&&elem[0]._ht!==val){elem[0]._ht=val;val=Math.max(1,val-_pad_bdr(elem));elem.css("height",val);if(but){elem.find("SPAN").css("marginTop",Math.floor((val-16)/2))}}},_fixSize:function(){var o=this.options,elem=this._element,width=elem?elem[0].offsetWidth:0,height=elem?elem[0].offsetHeight:0;if(width||height){if(this._oWidth!==width){this._fixWidth(!this._oWidth&&!o.width)}if(this._oHeight!==height){this._fixHeight(!this._oHeight&&!o.height)}this._oWidth=width;this._oHeight=height}this._doTimer()},_doTimer:function(){var me=this,timer=me._timer1,ok=me._heightOk&&!me._heightPerc&&me._widthOk&&!me._widthPerc;if(ok&&timer){clearInterval(timer);delete me._timer1}else if(!timer){me._timer1=setInterval(function(){me._fixSize()},200)}},_fixHeight:function(zero){if(!this._field||this._1e||this._heightOk&&!this._heightPerc){return 1}var field=this._field,elem=this._element,i=4,height=this._td||zero?0:Math.max(elem[0].offsetHeight-_pad_bdr(elem),0),buts=this._buttons;height=height||field[0].offsetHeight;if(height>1){if(this._heightPerc){height++}this._elemHeight(field,height);if(buts){while(i-->0){this._elemHeight(buts[i],height,1)}}this._heightOk=1}this._doTimer()},_fixWidth:function(zero){if(!this._field||this._1e||this._widthOk&&!this._widthPerc){return 1}var v,left,but,field=this._field,clearHide=this._clearHide,buttonHide=this.options.buttonHidden,elem=this._element,i=4,width=this._td||zero?0:Math.max(elem[0].offsetWidth-_pad_bdr(elem,1),0),minWidth=width,minField=3,buts=this._buttons;width=width||field[0].offsetWidth;if(width>0){if(buts){zero=this._td||zero?Math.max(width,100):0;width=zero||width;if(this._widthPerc||this._td){width--}while(i-->0){but=buts[i];if(but){if(i===0&&buttonHide||i===3&&clearHide){but.show()}but[0]._w=v=but[0].offsetWidth;if(zero&&!left){width-=v;left=zero=zero-v}width-=v;if(width<minField&&!zero){minWidth+=minField-width;left=width=minField}if(i===0&&buttonHide||i===3&&clearHide){but.hide()}}}if(zero||left){elem.css("width",zero||minWidth+minField)}}else if(zero&&elem[0].offsetWidth>width+4){elem.css("width",width)}this._wF=width;if(this._elemWidth(field,width)){this._listRemove()}i=v=buts?Math.min(width,9):0;while(v-->1&&i>3){left=field[0].offsetTop;for(i=0;i<4;i++){if(buts[i]&&Math.abs(buts[i][0].offsetTop-left)>10){this._elemWidth(field,--this._wF);break}}}if(buts){v=$.ig.util.isFF||$.ig.util.isIE?3:1;this._wF-=v;this._elemWidth(field,this._wF)}this._widthOk=1;this._butVis(clearHide,buttonHide)}this._doTimer()},_butVis:function(clear,dropdown){var but,i=-1,o=this.options,width=this._wF,buts=this._buttons,field=this._field;if(_aNull(clear)){but=1;clear=this._clearHide}if(_aNull(dropdown)){but=1;dropdown=o.buttonHidden}if(!buts||but&&clear===this._clearHide&&dropdown===o.buttonHidden){return}o.buttonHidden=dropdown;this._clearHide=clear;while(++i<2){but=buts[i*3];if(but){if(!i&&dropdown||i&&clear){but.hide();width+=but[0]._w}else{but.show();width-=but[0]._w}}}this._elemWidth(field,width)},_width:function(width){var field=this._field,elem=this._1e||this._td?field:this._element,buts=this._buttons,i=buts?4:0,val=_int(width);if(!field){return}if(this._widthOk){delete this._widthOk;delete this._widthPerc;elem[0]._wd=null;field[0]._wd=null;elem.css("width","");field.css("width","");while(i-->0){if(buts[i]){buts[i][0]._wd=null;buts[i].css("width","")}}}if(width){if(width.indexOf&&width.indexOf("px")<0&&width!==val.toString()){elem.css("width",width);this._widthPerc=!this._td&&width.indexOf("%")>0}else{this._elemWidth(elem,val)}}this._fixWidth(!width)},_height:function(height){var field=this._field,elem=this._1e||this._td?field:this._element,buts=this._buttons,i=buts?4:0,val=_int(height);if(!field){return}if(this._heightOk){delete this._heightOk;delete this._heightPerc;elem[0]._ht=null;field[0]._ht=null;elem.css("height","");field.css("height","");while(i-->0){if(buts[i]){buts[i][0]._ht=null;buts[i].css("height","")}}}if(height){if(height.indexOf&&height.indexOf("px")<0&&height!==val.toString()){elem.css("height",height);this._heightPerc=!this._td&&height.indexOf("%")>0}else{this._elemHeight(elem,val)}}this._fixHeight(!height)},_spin:function(delta){var sel,fac,txt,nul=this._nullT,o=this.options;if(this._box||!this._field){return}if(this._fcs<1&&o.focusOnSpin){this.setFocus();if(this._fcs<1){this._focSpin=delta;return}}if(this._fire(14,null,delta)){return}if(nul){this._nullT=null;this._fixCss()}txt=this._val();this.spin(delta);if(this._val()===txt){if(nul){this._nullT=nul;this._fixCss();return}if(this._type>3&&o.spinWrapAround&&!_aNull(this._prop(10))&&!_aNull(this._prop(11))){sel=this._sel0;fac=this._prop(7);if(!fac){fac=1}delta=this._limits(this._getVal(true)*fac,true);this._setVal(delta/fac,this._fcs);this.select(sel)}}if(this._val()!==txt){this._fire(12)}},_item:function(item){if(item&&!_aNull(item.text)){item=item.text}if(typeof item==="function"){item=item()}return _aNull(item)?"":item},_spinList:function(delta){var val,id,roll,len,list,o=this.options;list=o.listItems;len=list?list.length:0;if(len<1){return 1}delta=delta<0?1:-1;id=this._listID+delta;roll=o.spinWrapAround;if(id>=len){if(!roll){return}id=0}if(id<0){if(!roll){return}id=len-1}val=this._instant(1,null,1);if(val===this._item(list[id])){id+=delta;if(id<0){if(!roll){return}id=len-1}if(id>=len){if(!roll){return}id=0}}val=this._item(list[id]);if(!this._listSelect(id)){delete this._lastY;this._set_val(val)}},_doKey:function(k,ch,txt,len,sel0,sel1,bad,e){var maxDec,iDot,d09,ok,dot,min,decSep,minus,mask,ePow,maxLen=this._prop(12),type=this._type;if(type>0&&type<4){mask=this._mask;len=mask?mask.length:0;if(len<1||k<7||k>8&&k<32){k=0}if(bad){if(k===0||!(mask.indexOf(ch)>0||this._optVal("am").indexOf(ch)>=0||this._optVal("pm").indexOf(ch)>=0||k>=48&&k<=57)){_stop(e)}return}if(k===0){return}txt=this._txt;if(sel0!==sel1){while(--sel1>=sel0){txt=txt.substring(0,sel1)+mask.charAt(sel1)+txt.substring(sel1+1)}sel1++}else if(k===7){while(sel1<len&&mask.charCodeAt(sel1)>=22){sel1++}if(sel1>=len){return}txt=txt.substring(0,sel1)+mask.charAt(sel1)+txt.substring(sel1+1);sel1++}else if(k===8){while(sel1>0&&mask.charCodeAt(sel1-1)>=22){sel1--}if(sel1--<1){return}txt=txt.substring(0,sel1)+mask.charAt(sel1)+txt.substring(sel1+1)}if(k>8&&sel1<len){if(sel1>=len){return}sel0=this._maskKey(k,ch,txt,len,sel1,mask);if(sel0>=0){txt=this._txt;sel1=sel0}else{if(sel0===-1){return}while(mask.charCodeAt(sel1)>=22){if(++sel1>=len){return}}ch=this._maskFilter(mask.charCodeAt(sel1),ch,0);if(_aNull(ch)){return}txt=txt.substring(0,sel1)+ch+txt.substring(sel1+1);sel1++}}this._txt=txt;this._selKey=sel1;txt=this._focusTxt(true);this.select(this._selKey,0,txt);this._selKey=99999;this._listSelect(-1);return}if(type>3){decSep=this._prop(4);minus=this._isMinus(k);d09=k>=48&&k<=57;if(minus&&sel0===0){min=this._prop(10);if(!_aNull(min)&&min>=0){return _stop(e)}}if(bad){if(!(k<9||minus||d09||k===decSep.charCodeAt(0))){_stop(e)}return}if(sel0!==sel1){txt=txt.substring(0,sel0)+txt.substring(sel1);sel1=sel0;len=txt.length}else if(k===7){if(sel1++>=len||len<1){return}}else if(k===8){if(sel0--<1){return}}if(k<9||maxLen===0||maxLen>len){dot=k===decSep.charCodeAt(0);iDot=txt.indexOf(decSep);maxDec=this._prop(8);ok=d09||sel0===0&&minus||dot&&maxDec>0;ePow=this._ePow();mask=ePow?txt.indexOf(ePow):-1;if(ePow&&sel0>0){if((k===69||k===101)&&mask<0){ok=ch=ePow}if(dot&&mask>=0&&mask<sel0){ok=false}}if(mask<0&&d09&&iDot>=0&&sel0>iDot&&iDot+maxDec<len){if(sel0===len){ok=false}else{txt=txt.substring(0,--len)}}if(sel0>0&&minus&&txt.charAt(sel0-1).toUpperCase()==="E"&&txt.substring(sel0-1).indexOf("-")<0){ok=true}if(len>0&&sel0===0){if(this._isMinus(txt.charCodeAt(0))){ok=false}}if(k>8&&!ok){return}if(dot){if(iDot>=0){if(iDot===sel0||iDot===sel0-1){return}len--;if(iDot<sel0){sel0=--sel1}txt=txt.substring(0,iDot)+txt.substring(iDot+1)}if(mask<0&&sel0+maxDec<len){len=sel0+maxDec;txt=txt.substring(0,len)}}if(k>8&&sel1>=len){txt+=ch}else{txt=txt.substring(0,sel0)+ch+txt.substring(sel1)}}else{k=0}this.select(k>10?sel1+1:sel0,0,txt);this._listSelect(-1);return}if(sel0!==sel1){txt=txt.substring(0,sel0)+txt.substring(sel1);sel1=sel0;len=txt.length}else if(k===7){if(sel1++>=len||len===0){return}if(this._ta&&txt.charCodeAt(sel1-1)===13&&txt.charCodeAt(sel1)===10){sel1++}}else if(k===8){if(sel0--<1){return}if(this._ta&&txt.charCodeAt(sel0)===10&&txt.charCodeAt(sel0-1)===13){sel0--}}if(k<9||maxLen===0||maxLen>len){if(k>8&&sel1>=len){txt+=ch}else{txt=txt.substring(0,sel0)+ch+txt.substring(sel1)}}else{k=0}this._matchList(txt,k,k>10?sel1+1:sel0)},_matchList:function(txt,key,sel){var item;if(!this._field||this._type>0||key<0&&!this.options.listAutoComplete){return txt}item=this._findItem(txt,key,sel);if(!item){return null}this._listSelect(item.id);txt=item.text;if(key>=0){this.select(item.sel,0,txt)}else{this._field[0].value=txt}return txt},_findItem:function(txt,key,sel){var o=this.options;return this._find(txt,key,o.listMatchOnly,o.listMatchIgnoreCase,true,o.listMatchContains,sel)},_find:function(txt,key,matchOnly,noCase,partial,contains,sel){var item,up,part,inside=null,i=-1,many=0,shift=0,id=-1,str=txt,len=txt.length,items=this.options.listItems,match=key>=0&&matchOnly;if(len>0&&items&&(match||key<0)){part=match=-1;up=noCase;if(up){str=str.toUpperCase()}while(++i<items.length){item=this._item(items[i]);if(_aNull(item)){continue}item=item.toString();if(up){item=item.toUpperCase()}shift=item.indexOf(str);if(shift===0){if(item===str){match=i;break}many++;if(part<0){part=i}}else if(shift>0&&contains){if(!inside){inside={i:i,shift:shift}}many++}}shift=0;if(part<0&&inside){part=inside.i;
shift=inside.shift}if(match<0){if(!partial){return null}if(key<0){match=part}else if(part<0){return key>10&&len===sel?null:this._find(txt.substring(0,--len),key,matchOnly,noCase,contains,sel)}if(key>10&&many===1){match=part}else if(key>=0){txt=this._item(items[part]).toString().substring(0,len+shift)}}if(match>=0){txt=this._item(items[match]).toString();if(match===part){sel=txt.length}}id=match>=0?match:part}return{text:txt,id:id,sel:(_aNull(sel,1)?len:sel)+shift}},_undo:function(redo){var old,val=this._old;if(redo){if(!this._canRedo){return}val=this._redo;this._canRedo=false}else{old=this._instant(1,null,1);if(old===val){return}this._canRedo=true;this._redo=old}this._set_val(val);this._text=this._focusTxt(false);this._doError(1,this._evt)},_doKey0:function(e,a){var ch,up,len,excl,incl,bad=this._validator,me=this,t0=this._text,t1=this._val(),k=this._key,o=this.options;if(o.excelNavigationMode&&a!==1&&(k===38||k===40)){return}if(!this._field){return}if(!e){if(t0!==t1){this.paste(t1)}return}if(a===1&&k===192&&e.altKey&&!e.ctrlKey){return}if(a===1&&this._bad&&this._k0===229){this.getSelectedText();this._bad=0}if(this._type>0&&$.ig.util.isOpera&&k>41&&k<48){if(a===0){this._noKey=k}else if(this._noKey===k){_stop(e)}}if(a!==1){this._noPaste=2-a}else if(this._noPaste!==2){this._noPaste=1}if(k===9){this._k0=a===2?0:9;if(a===0&&bad&&bad._lbl){bad._onTab(e)}}if(k===0||k===114&&a!==1||k===9){return}if(this._bad>2){if(a===0){this._bad=2}if(a===2){this._bad-=3}}if(a===0&&k===229){if(t0!==t1){this._bad=2}else{this._bad+=3}}if(k===13&&this._k0===229&&this._type===1){this._txt=this._setTxt(this._val(),5,true)}if(a===0&&e.ctrlKey&&!e.altKey&&(k===90||k===89)){this._undo(k===89);return}if(this._bad===2||a===1&&e.ctrlKey){return}if(a===0&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){if(this._listKey(e,k)){this._kBad=k;return _stop(e)}}if(this._box){return}if(a===1&&k===this._kBad){return _stop(e)}this._kBad=null;if(a===0&&(e.ctrlKey&&(k===86||k===88)||e.shiftKey&&k===45)){setTimeout(function(){me._doKey0()},1)}if(a!==1&&(e.ctrlKey||e.altKey||k===17)){if(e.altKey){this._k0=-1}else if(t0!==t1&&(k===86||k===17&&a===2)){this.paste(t1);this._noPaste=1}else if(k===17){this.getSelectedText()}return}if(a===0){this._k0=k}if(a===2){if(this._k0>0){this._k0=0}this._spinField=-1}len=t1.length;bad=this._bad!==0;if(k<=46){switch(k){case 8:case 46:if(this._k0===k&&a===1){a=2}if(a===0){a=1;if(k===46){k=7}}break;case 27:_stop(e);if(a===0){this._undo();if(!this._escFix){this._escTxt=this._field[0].value}}else{if(this._escFix&&this._escTxt!==t1&&!_aNull(this._escTxt)){this._field[0].value=this._escTxt;delete this._escTxt}if(a===1){this._escFix=1}else{delete this._escFix}}return;case 13:if(o.hideEnterKey){if(!this._ta||!e.shiftKey||this._type>0&&this._ta&&e.shiftKey){_stop(e)}}else{me._update()}return;case 38:case 40:if(this._ta){break}if(a===0&&!e.shiftKey){this._spin(k===38?o.spinDelta:-o.spinDelta)}if(this._k0===k){a=2}break}}if(a===1&&k===this._k0&&(k<48&&k>9&&k!==32||k>90)){return}if(!bad){if(a!==0&&k!==9){_stop(e)}if(a===1&&this._k0===-1){this._k0=0;this.getSelectedText()}if(a===0||k<9){this.getSelectedText()}}if(a===1&&k>6){if(k>31){if(this._fire(1,e)){if(bad){_stop(e)}return}k=this._key;excl=o.excludeKeys;incl=o.includeKeys;if(o.toUpper||o.toLower||excl||incl){ch=String.fromCharCode(k);up=ch.toUpperCase();if(excl&&excl.toUpperCase().indexOf(up)>=0||incl&&incl.toUpperCase().indexOf(up)<0){return _stop(e)}if(o.toUpper){k=up.charCodeAt(0)}else if(o.toLower){k=ch.toLowerCase().charCodeAt(0)}this._key=k}}this._doKey(k,k<10?"":String.fromCharCode(k),t1,len,this._sel0,this._sel1,bad,e)}},paste:function(txt,flag){var prop,last=this._pasted,o=this.options;if(last&&_now()-last.now<10&&(last.txt===txt||last.val===txt)){return this}this._pasted=last=last||{};last.now=_now();last.txt=txt;if(this._nullT&&!flag||this._noPaste===1){return this}prop=this._prop(12);if(prop>0&&prop<txt.length){txt=txt.substring(0,prop)}prop=o.includeKeys;if(prop){prop=prop.toUpperCase().replace(/\[/gm,"\\[").replace(/\]/gm,"\\]").replace(/\^/gm,"\\^").replace(/\-/gm,"\\-");txt=txt.replace(new RegExp("[^"+prop+"]","igm"),"")}prop=o.excludeKeys;if(prop){prop=prop.toUpperCase().replace(/\[/gm,"\\[").replace(/\]/gm,"\\]").replace(/\^/gm,"\\^").replace(/\-/gm,"\\-");txt=txt.replace(new RegExp("["+prop+"]","igm"),"")}if(o.toUpper){txt=txt.toUpperCase()}else if(o.toLower){txt=txt.toLowerCase()}txt=this._matchList(txt,0);if(_aNull(txt)){txt=this._text}this._text="";this._fix=0;this.text(txt,flag?null:this._sel0);this._fix=1;this._fire(12);last.val=this._field[0].value;return this},_touch:function(act){var scroll,dd=this._ddList;if(dd&&dd.igScroll){scroll=dd.data("igScroll");if(!act){return scroll?scroll.barY:dd.igScroll({direction:"y",yThumb:"draggable",yScroller:this._ddScroll,cancelStart:"ms"}).attr("data-scroll","y")}if(scroll){scroll[act](true)}}},_fixCss:function(){var but,i,dis,csso,elem=this._element,old=this._hoverOld,hov=this._hover,down=this._mouseDown,foc=this._fcs>0,o=this.options,dd=this._ddList,css=this._css,border="";if(!this._field){return}dis=o.disabled;csso=this.css;if(foc){elem.addClass(csso.focus)}else{elem.removeClass(csso.focus)}if(hov){elem.addClass(csso.hover)}else{elem.removeClass(csso.hover)}this._hoverOld=hov;if(!old||old===hov){old=0}if(old>99){if(!dd){return}this._listCss(dd,old,csso.listItemHover)}if(hov>99&&!this._touch()){this._listCss(dd,hov,csso.listItemHover,1)}if(dis){css+=" "+csso.disabled}if(this._nullT){css+=" "+csso.nullValue}if(this._type>3&&csso.negative&&!this._nullT){if(this._instant(1)<0){css+=" "+csso.negative}}this._setCss(this._field,css);i=this._buttons?4:0;while(i-->0){but=this._buttons[i];if(!but){continue}csso=but[0]._css;css=csso[0];if(dis){css+=" "+csso[3]}if(hov===i+1){css+=" "+csso[1]}if(foc){css+=" "+this.css.buttonFocus}if(down===i+1){css+=" "+csso[2]}this._setCss(but,css+border);css=csso[4];if(dis){css+=" "+csso[7]}if(down===i+1){css+=" "+csso[6]}else if(hov===i+1){css+=" "+csso[5]}else if(hov||foc){css+=" "+this.css.buttonsImageStateOverride}this._setCss(but.find("SPAN"),css)}},_setCss:function(obj,css){var cur=obj[0].className,old=obj[0]._ig_oldCss;obj[0]._ig_oldCss=css;if(css===old){return}if(old&&cur&&old!==cur&&cur.indexOf(old)>=0){cur=cur.replace(old,"");css+=(cur.charAt(0)!==" "?" ":"")+cur}obj[0].className=css},_enterTxt:function(){var d,type=this._type;if(type===1){return this._getTxt(this._dataMode,"")}if(type===2||type===3){d=this._toDate(this._val(),true);return _aNull(d)?"":this._toTxt(d,true,"")}if(type>3){return this._toTxtNum(null,true,this._val(),"-",".")}return this._val()},_update:function(){var v,old=this._old;if(this._lock){return}this._lock=true;this._text=this._focusTxt(false,this._fcs===2||this._hadFocus?"":null);v=this._instant(1,null,1);if(!_aNull(v)&&!_aNull(old)){if(v.getTime&&old.getTime&&v.getTime()===old.getTime()){v=old}}if(v!==old||this._bad===2){this._val10=v;if(this._fire(10,null,v,old)){this._set_val(old);this._text=this._focusTxt(false)}else{if(v!==this._val10){this._setVal(this._val10)}this._repaint();this.options.value=v=this._instant(1,null,1);this._fire(11,null,v,old);if(this._k0!==13){this._old=this.options.value}this._dtt()}}this._lock=false},_dropTrigger:function(e,k){var len,ch,acts,o=this.options,on=this._ddOn;acts=o.dropDownTriggers;if(k===0||!acts||o.readOnly&&!o.dropDownOnReadOnly||k===-2&&acts.indexOf("button")<0||k===-1&&acts.indexOf("focus")<0){return}if(k===38&&!on||k===40&&on){return}if(k>0){ch=k===38||k===40?"arrow":String.fromCharCode(k);if(e.ctrlKey){ch="ctrl+"+ch}else if(e.altKey){ch="alt+"+ch}else if(e.shiftKey){ch="shift+"+ch}len=ch.length;ch=acts.indexOf(ch);if(ch<0||ch>0&&acts.charAt(ch-1)!==","||ch+len<acts.length&&acts.charAt(ch+len)!==","){return}}if(!on||k!==-1||_now()-on>900){return this._doDrop(1,e)}},_doDP:function(act,sel){var odp,dp,field,id,o=this.options,v=o.focusOnDropDownOpen;if(!this._field||this._type!==3){return}if(!this._dp&&act!==1){return 1}if(_aNull(this._mobile)){try{this._mobile=this.__touch||window.navigator.userAgent.toLowerCase().indexOf("mobile")>0}catch(ex){}}if(o.dropDownTriggers==="focus"){this._mobile=false}if(_aNull(v)){this._noFocus=this._mobile}else{this._noFocus=!v}if(sel){this._set_val(sel);this._fire(12)}dp=$.datepicker;field=this._field[0];id=field.id;if(!dp._old_selectDay){dp._old_selectDay=dp._selectDay;dp._old_parseDate=dp.parseDate;dp._old_updateDatepicker=dp._updateDatepicker;dp._old_checkOffset=dp._checkOffset;dp.dpDiv.bind("mousedown",function(evt){var dp=$.datepicker._ig_dp;if(dp){if(evt.target&&evt.target.nodeName==="SELECT"){dp._ddmd=_now();dp._ddnf=$.ig.util.isFF||dp.__touch}else{_stop(evt)}}});dp._selectDay=function(id,month,year,td){var me=this._ig_dp;if(!me){return this._old_selectDay(id,month,year,td)}id=$("a",td).html()||td.firstChild.innerHTML;me._doDrop(0,{type:"mousedown"},[year,month,_int(id)],1);me._xyCheck(true)};dp._updateDatepicker=function(inst){var field,me=this._ig_dp;if(me){this._ig_css=me.css.dropDown;this.dpDiv.addClass(this._ig_css);if(me._noFocus){field=me._field[0];if(field.disabled){field=null}}}else if(this._ig_css){this.dpDiv.removeClass(this._ig_css);delete this._ig_css}if(field){field.disabled=true}this._old_updateDatepicker(inst);if(field){field.disabled=false}if(me){this.dpDiv.find("*").attr("unselectable","on")}};dp.parseDate=function(a,b,c){return this._ig_dp?this._ig_dp._df(this._ig_dp._getVal(1),-1):this._old_parseDate(a,b,c)};dp._checkOffset=function(inst,offset,isFixed){var xy,me=this._ig_dp;offset=this._old_checkOffset(inst,offset,isFixed);if(me){offset.left-=me._leftShift();_offset(null,offset);xy=_offset(me._swap?me._field:me._element);me._xy={x:xy.left,y:xy.top,i:setInterval(function(){me._xyCheck()},300)}}return offset}}if(act===1){v=dp._ig_dp;if(v&&v!==this){delete dp._ig_dp;v._doDrop()}if(id.length<1){id=this.element[0].id+"_ig_dp_id";while(document.getElementById(id)){id+=Math.floor(Math.random()*10)}field.id=id}if(!this._dp){odp=$.extend(o.datepickerOptions,this._dpRegion())||{};v=o.animationShowDuration;if(v){odp.duration=v}v=o.animationShowEffect;if(v){odp.showAnim=v}odp.showOn="";odp.onClose=function(){var me=dp._ig_dp;if(me){if(me._fcs&&me._ddnf&&me._ddnf.type){me._onEvt(me._ddnf,9)}me._dpClosed=1;me._doDrop();delete me._dpClosed;delete dp._ig_dp}};this._dp=$(field).datepicker(odp)}odp=$.data(field,"datepicker").settings;odp.minDate=odp.minDate||o.minValue;odp.maxDate=odp.maxDate||o.maxValue;if($.ig.util.isOpera){odp.changeYear=false}dp._ig_dp=this;this._css+=" "+$.datepicker.markerClassName;if(this._noFocus){field.disabled=true}else if(this._fcs<1){this.setFocus(-1)}dp._showDatepicker(field);if(this._noFocus){field.disabled=false;try{dp._dummyFocus=dp._dummyFocus||(this._mobile?$("<button />").css("position","absolute").css("top","-100px").appendTo(document.body)[0]:dp.dpDiv[0]);dp._dummyFocus.focus()}catch(ex){}}}else if(act===2){dp._doKeyUp({target:field})}else{this._xyCheck(true);if(!this._dpClosed){dp._hideDatepicker(field)}if(act===3){dp._destroyDatepicker(field)}}return 1},_fixBC:function(src,e){src=src.css("backgroundColor");e.css("backgroundColor",!src||src==="transparent"||src.replace(/ /g,"").indexOf("(0,0,0,0")>0?"white":src)},_xyCheck:function(stop){var xy=this._xy,xyE=this._swap?this._field:this._element;if(!xy){return}if(xyE){xyE=_offset(xyE);if(Math.abs(xyE.left-xy.x)>2||Math.abs(xyE.top-xy.y)>2){stop=true}}if(stop||!xyE||!this._ddOn){delete this._xy;clearInterval(xy.i);this._doDrop()}},_vAct:function(act){return $.ui.igValidator&&$.ui.igValidator._act(this,act)},_doDrop:function(act,e,sel,dp){var borderClr,widthOuter,heightOuter,height,up,ht,y,b,row,col,cols,rows,dif,cell,max,end,el,xy,effect,width,dd,elem,body,len,items,heightEnd,par=this._ddParent,i=-1,val=sel,me=this,o=this.options;items=o.listItems;act=act===1?!this._ddOn:false;if(!act&&!this._ddOn&&!dp){return}if(!me._field||me._vAct(act?"drop":"hide")){return}len=items?items.length:0;if(this._type===3){if(sel&&!isNaN(sel[2])){val=this._getVal(1);if(!val){val=this._df(sel[0],sel[1],sel[2],0,0,0,0)}else{val=this._df(sel[0],sel[1],sel[2],this._df(val,3),this._df(val,4),this._df(val,5),this._df(val,6))}}}else{if(len<1){return}if(sel){val=this._item(items[sel-100])}}if(this._fire(act?16:17,e,act?null:{value:val})&&e){return}this._ddOn=act?_now():null;if(this._type===3){return this._doDP(act?1:0,val)}dd=me._ddList;elem=me._element;body=!o.listDropDownAsChild||elem===me._field;if(!dd){dd=me._ddList=$("<div/>").addClass(me.css.dropDown+" "+me.css.list).scroll(function(){me._lazy()});dd[0]._id=99;me._ddSel=-1;me._ddLen=len;dd.css({position:"absolute",visibility:"hidden"});width=o.listWidth;if(width<5){width=elem.outerWidth();if(width<5){width=100}}if(body){me._ddParent=par=o.theme?$("<span/>").addClass(o.theme).css("position","absolute").append(dd):dd;MSApp.execUnsafeLocalFunction(function(){par.css({left:"0px",top:"0px"}).appendTo($("body"))});dd.bind(me._mEvts)}else{me._ddParent=par=dd.prependTo(elem)}borderClr=dd.css("borderRightColor");cols=Math.max(1,o.listColumns);rows=me._rows=Math.ceil(len/cols);dif=dd.outerWidth()-dd.width();width=Math.ceil((width-dif)/cols-1);me._listLazy=[];for(col=0;col<cols;col++){for(row=0;row<rows;row++){if(++i>=len){break}cell='<div style="width:'+width+"px;position:absolute;white-space:nowrap;overflow:hidden;";val=me._item(items[i]);if(typeof val!=="string"){if(me._type>=4&&typeof val==="number"){val=me._toTxtNum(val)}else if(val&&me._type===2&&val.getMonth){val=me._toTxt(val)}else{val=_str(val)}}el=items[i];if(el&&typeof el.getHtml==="function"){el=el.getHtml()||val}else{el=val}if(i>0){cell+="height:"+height+"px;left:"+col*widthOuter+"px;top:"+row*heightOuter+"px;"}if(col+1<cols){cell+="border-right-color:"+borderClr}cell+='" title="'+me._item(items[i])+'" _id="'+(i+100)+'" class="'+me.css.listItem;if(col+1<cols){cell+=" "+me.css.listItemColumnBorder}cell+='">'+(el===""?"&nbsp;":el)+"</div>";if(i===0||i+1===len){MSApp.execUnsafeLocalFunction(function(){cell=$(cell).appendTo(dd)});cell[0]._id=i+100}else{me._listLazy[i]=cell}if(i===0){height=cell.height();if(height<5){height=18}dif=cell.outerWidth()-cell.width();if(dif>0){width-=dif;cell.css("width",width)}widthOuter=cell.outerWidth()+1;me._ddWidth=widthOuter*cols;me._ddHeight0=heightOuter=cell.outerHeight();me._ddHeight=me._ddHeight0*rows;me._fixBC(cell,dd);max=Math.max(0,o.listMaxHeight);if(max>0&&me._ddHeight>max){me._ddHeight=max;max=Math.ceil(16/cols);width-=max;cell.css("width",width);widthOuter-=max}else{max=0}dd.css("overflow",max>0?"auto":"hidden");cell.css({height:height,left:col*widthOuter,top:row*heightOuter})}}}me._page=Math.max(2,Math.floor(Math.min(me._ddHeight/height),len/3)-1)}if(sel){if(!me._listSelect(sel-100)){val=this._item(items[sel-100]);me._set_val(val);me._fire(12)}}if(!act){me._lastY=dd[0].scrollTop}else if(me._lastY){dd[0].scrollTop=me._lastY}me._listSelect(null,1);val=act?o.animationShowDuration:o.animationHideDuration;if(!val||typeof val==="number"&&val<5){val=null}else{effect=act?o.animationShowEffect:o.animationHideEffect;if(!$.effects||!$.effects[effect]){if(!act&&typeof val!=="number"){val=450}effect=null}}heightEnd=val&&!effect?0:me._ddHeight;end=function(){if(act){dd.css("filter","");if(!sel&&me._lastY){dd[0].scrollTop=me._lastY}else{me._listSelect()}i=dd[0].scrollWidth-dd[0].clientWidth;if(!me._ddFixW&&i>0&&i&&i<4){me._ddFixW=++i;me._ddWidth+=i;dd.css("width",me._ddWidth)}me._touch()}else{dd.css({display:"none",visibility:"hidden"});me._touch("_hide")}};if(act){this._lazy();if(me._fcs<1){me.setFocus()}ht=999;b=document.body;el=document.documentElement;i=window.innerHeight;if(i>50&&i){ht=i}else if(el.clientHeight>50&&el.clientHeight){ht=el.clientHeight}else if(b.clientHeight>50&&b.clientHeight){ht=b.clientHeight}y=Math.max(window.pageYOffset||0,Math.max(b.scrollTop,el.scrollTop));el=me._swap?me._field:elem;xy=_offset(el);me._xy=body?{x:xy.left,y:xy.top}:null;xy.h=el[0].offsetHeight;up=xy.top+xy.h+me._ddHeight-y-ht;if(up>0&&y-xy.top+me._ddHeight<up){up=me._ddHeight+2;if(xy.top-up<y){up=Math.max(xy.top-y,2)}xy.h=-up;xy.top+=xy.h;heightEnd=me._ddHeight;elem.addClass(me.css.noTopCorners);dd.addClass(me.css.noBottomCorners)}else{xy.top+=xy.h;elem.addClass(me.css.noBottomCorners);dd.addClass(me.css.noTopCorners)}dd.css({opacity:val&&!effect?0:1,height:heightEnd,width:Math.floor(me._ddWidth/(val&&!effect?2:1)),display:"",visibility:"visible"});if(body){if(me._swap){xy.left-=me._leftShift()}xy.left-=_int(elem.css("borderLeftWidth"));par.css({left:xy.left,top:xy.top});me._xy.i=setInterval(function(){me._xyCheck()},300)}else{i=me._left?"Right":"Left";par.css("margin"+i,-_int(elem.css("border"+i+"Width"))+"px");par.css("marginTop",xy.h);up=_offset(par).left-xy.left;if(up>30&&up<elem[0].offsetWidth+10){par.css("marginLeft",-up+"px")}}if(!val){end()}else if(effect){dd.show(effect,{},val,end)}else{dd.animate({opacity:1,height:me._ddHeight,width:me._ddWidth},val,null,end)}}else{me._xyCheck(true);elem.removeClass(me.css.noTopCorners).removeClass(me.css.noBottomCorners);dd.removeClass(me.css.noBottomCorners).removeClass(me.css.noTopCorners);if(!val){end()}else if(effect){dd.hide(effect,{},val,end)}else{dd.animate({opacity:.6},Math.floor(val*.34)).animate({opacity:0,height:heightEnd,width:Math.floor(me._ddWidth/2)},Math.floor(val*.66),null,end)}}return true},_lazy:function(i){var id,j,cols=Math.max(1,this.options.listColumns),items=this._listLazy,dd=this._ddOn?this._ddList:null;if(!dd){return}if(i){if(items[i]){MSApp.execUnsafeLocalFunction(function(){$(items[i]).appendTo(dd)[0]._id=i+100;delete items[i]})}return}id=Math.floor(dd[0].scrollTop/this._ddHeight0);while(cols-->0){for(i=0;i<this._page+8;i++){j=this._rows*cols+id+i;if(items[j]){MSApp.execUnsafeLocalFunction(function(){$(items[j]).appendTo(dd)[0]._id=j+100;delete items[j]})}}}},_listCss:function(dd,id,css,add){dd=$(dd.children("[_id="+id+"]"));if(add){dd.addClass(css)}else{dd.removeClass(css)}},_listSelect:function(id,on){var top,scroll,sel,arg=null,dd=on!==2&&(on||this._ddOn)?this._ddList:null,o=this.options;if(!o.listItems){return}if(!_aNull(id)&&this._listID!==id){arg={index:id,oldIndex:this._listID,item:o.listItems[id]};if(this._fire(18,null,arg)){return 1}this._listID=id}id=this._listID;if(dd){if(on&&id<0){on=this._findItem(this.text(),-1);if(!_aNull(on)&&id!==on.id){arg={index:on.id,oldIndex:id,item:o.listItems[on.id]};if(this._fire(18,null,arg)){return 1}this._listID=id=on.id}}sel=this._ddSel;if(sel!==id){this._lazy(id);this._listCss(dd,sel+100,this.css.listItemSelected);sel=this._ddSel=id;this._listCss(dd,sel+100,this.css.listItemSelected,1)}if(sel>=0){top=sel%this._rows*this._ddHeight0;scroll=dd[0].scrollTop;if(top>scroll){top+=this._ddHeight0-this._ddHeight;if(top<scroll){top=-9}}if(top!==-9){if($.ig.util.isSafari&&top>20&&dd[0].scrollTop===top&&!on){dd[0].scrollTop=top-1}dd[0].scrollTop=top}}}if(arg){this._fire(19,null,arg)}},_listKey:function(e,k){var i,len,dd=this._ddOn?this._ddList:null,id=this._listID,kc=$.ui.keyCode;if(!dd){return}if(k===kc.ENTER||k===kc.SPACE||k===kc.ESCAPE){this._doDrop(0,e,k===kc.ESCAPE?null:id+100);return true}if(k<33||k>40){return}len=this._ddLen-1;i=id;if(i<0){i=-1e3}if(k===kc.DOWN){i++}else if(k===kc.UP){i--}else if(k===kc.PAGE_DOWN){i+=this._page}else if(k===kc.PAGE_UP){i-=this._page}else if(k===kc.HOME){i=0}else if(k===kc.END){i=len}else if(k===kc.RIGHT){i+=this._rows;if(i>len){i=id}}else if(k===kc.LEFT){i-=this._rows;if(i<0){i=id}}else{return}this._listSelect(Math.max(0,Math.min(i,len)));return true},_listChange:function(list,i,act){var len,count,j,items=this.options.listItems;len=items?items.length:0;j=count=list?list.length:0;i=_aNull(i)||i<0?-1:i;if(act<2){if(len<1){return this}if(act>0&&i<0){if(list===null){i=len-1}else{while(++i<len){if(items[i]===list){break}}}}if(i<0){items.length=0}else if(i<len){items.splice(i,1)}}else if(!items){this.options.listItems=list}else{while(j-->0){if(i>=len||i<0){items.push(list[count-j-1])}else if(i===0){items.unshift(list[j])}else{items.splice(i,0,list[j])}}}this._listRemove();return this},_listRemove:function(){if(this._ddList){this._touch("destroy");this._element.removeClass(this.css.noTopCorners).removeClass(this.css.noBottomCorners);this._ddList.unbind();this._ddParent.remove();this._ddOn=this._ddList=this._ddParent=this._listLazy=null;this._listID=-1}},_initValidator:function(end,req){if(!this._field){return}var v=this._validator,o=this.options,vo=o.validatorOptions;if(end||!vo||!this.element.igValidator){if(v){v.destroy();delete this._validator}return}vo.ctl=this;vo.required=o.required=o.required||!req&&vo.required;this._field.igValidator(vo)},_doError:function(flag,e,mes){var val=this._validator;if(val&&this._field){if(!_aNull(mes)){return val._doError(mes,null,flag)!==1}if(flag){val._evt(e,null,flag===2);if(val._lbl){val._lbl._old={t:_now(),val:this._val(),sel0:this._sel0,sel1:this._sel1,lastTxt:this._lastText,last:this._last,txt:this._text}}}else{val.hide(null)}}},_doScrl:function(field,txt){var ch,e,fox=$.ig.util.isFF&&!this._dp,width=field.clientWidth,max=field.scrollWidth,len=txt.length,f=false,sel=this._sel0;if(!this._field||this._tr!==1||len<4){return}ch=max/len*1.1;len-=sel;if(this._ta){max=field.scrollHeight;if(field.clientHeight+2>max){return}txt=txt.split("\n");if(len*15<width&&(fox||txt[txt.length-1].length*15>width)){field.scrollTop=max;return}if(!fox){return}}else if(sel*15<width){return}if(!fox){if(max>width+2){if(len*ch*1.3<width){field.scrollLeft=max}else if(sel*ch>width+field.scrollLeft){field.scrollLeft=Math.floor(sel*ch-width-3)}}return}if(this._bad>2){return}this._scrl=1;try{ch=field.maxLength;e=this._mask;if(ch>0){field.maxLength=Math.max(ch,e?e.length:0)+2}e=document.createEvent("KeyboardEvent");e.initKeyEvent("keypress",!f,!f,null,f,f,f,f,0,32);field.dispatchEvent(e);e=document.createEvent("KeyboardEvent");e.initKeyEvent("keypress",!f,!f,null,f,f,f,f,8,0);field.dispatchEvent(e);if(ch>0){field.maxLength=ch}}catch(ignore){}delete this._scrl},_onEvt:function(e,type){var old,txt,field=this._field,me=this;field=field?field[0]:null;if(!field||me._scrl){return}me._evt=e;if(type!==11){me._doEvt(e,type,field);delete me._evt}else{if(me._pasting&&_now()-me._pasting<2e3){return}old=field.value;try{if(me._nullT&&e&&e.type==="drop"){txt=e.originalEvent.dataTransfer;if(!_aNull(txt)){txt=txt.getData("Text")}}}catch(ex){txt=null}me._pasting=_now();setTimeout(function(){if(!txt){if(!me._field){return}txt=field.value}if(old!==txt){me.paste(txt)}delete me._pasting},0)}},_doEvt:function(e,eType,field){var val,foc,skip,skip0,up,time,src,v=null,k=0,me=this,o=this.options;if(me._noWidth){me._fixWidth()}if(!e||o.disabled){return}if(eType===10){v=e.wheelDelta||e.detail;if(v){_stop(e);me._spin(v>0?o.spinDelta:-o.spinDelta)}return}if($.ig.util&&$.ig.util.evtButton(e)){return}if(eType===26){me._msOver=e.originalEvent.pointerType;return}if(me._msOver===2&&eType===6){delete me._msOver;return}val=src=e.target;v=val._id;while(val&&k++<5&&_aNull(v)){val=val.parentNode;if(val){v=val._id}}if(eType===7){me._hover=me._mouseDown=0;me._fixCss();me._fire(eType,e,v);return}if(!v){return}if(eType===6){if(v>0&&!src.unselectable){src.unselectable="on"}val=field.value;if(val===me._lastText||me._pasting){val=null}if(!me._fcs&&val&&me._nullT){if(val!==o.nullText){me._fixNull()}val=null}if(val){me.paste(val,1)}}if(v>4&&v<9){v-=4}if(eType===0&&me._fcs===0){me._onEvt({target:src,type:"focus"},8)}if(_aNull(me._evt0Spin1)&&!me._box){try{if(!($.ig.util.isIE&&$.ig.util.browserVersion<11&&!me._ta)&&!_aNull(field.selectionStart)){me._tr=1}}catch(ignore){}if(me._tr!==1){me._tr=field.createTextRange?field.createTextRange():null}me._bad=_aNull(me._tr)?1:0}me._evt0Spin1=0;if(eType===5&&me._fcs===2&&e.button===1){me.getSelectedText()}time=_now();if(eType<3){me._key=k=e.keyCode||e.which||0;me._time=time}if(eType!==1&&eType<8){if(me._fire(eType,e,v)){if(eType<4){_stop(e)}return}}if(eType<3){if(eType===0&&(me._fcs===2||o.dropDownOnReadOnly)&&me._dropTrigger(e,k)){return}if(me._fcs===1&&(e.shiftKey||eType===1||!(o.spinOnReadOnly||o.dropDownOnReadOnly&&me._ddOn)||k<9||k>40)){return}if(eType===2&&me._k0===0&&k>0&&k!==13&&k!==86&&me._text!==me._val()&&k!==32){field.value=me._text;return}}if(eType===3&&v>0){if(v===99){me._ddmd=time}_stop(e)}if(eType===3&&me._mouseDown!==v){if(v>1&&v<4){me._stopTimer(1);if(!o.readOnly||o.spinOnReadOnly){up=v===2?o.spinDelta:-o.spinDelta;if(me._fcs<1&&o.focusOnSpin){me._evt0Spin1=1;me.setFocus()}me._spin(up);skip=skip0=5;me._spinField=-1;me._timer=setInterval(function(){if(me._mouseDown<2){return me._stopTimer(1)}if(--skip<1){me._spin(up);skip=--skip0>8?--skip0:skip0}},60)}}me._hover=me._mouseDown=v;me._fixCss()}if((eType===5||eType===6)&&me._hover!==v){me._hover=v;me._fixCss()}if(eType===4&&me._mouseDown){if((v===1||v===4)&&v===me._mouseDown){if(!me._fire(15,e)){if(v===4){me._onEvt(null,11);me._set_val(null);me.select(0)}else{me._dropTrigger(e,-2)}}}if(v>99){me._doDrop(0,e,v)}me._mouseDown=0;me._fixCss()}if(v>0){return}foc=me._focTime;if(eType===4){if(foc&&foc+500>time){me._select()}me._focTime=0}if(eType<3){me._doKey0(e,eType)}if(!me._field){return}val=me._val();if(eType===2){me._last=val;if(me._key===13&&$.ig.util.isFF&&me._text!==val){me._fire(12,e);me._update();me.text(val)}}if(eType===1&&me._keyMod){delete me._keyMod;me._doScrl(field,val)}if(eType>=8){if(me._bad>2){me._bad=2}me._spinField=-1;foc=eType===8;if(foc){delete me._ddnf}v=me._fcs>0;if(foc===v){return}if(!foc&&time-me._ddmd<500){if(me._ddnf){me._ddnf=e}else{me.setFocus(-1)}return}me._noPaste=0;if(!foc&&me._lastText!==val){me.paste(val,1)}if(!foc&&me._type<2&&!val&&!o.nullable){val=me._old||(o.listItems?o.listItems[0]:"");if(val){me._set_val(val);val=me._text=me._focusTxt(false)}else{val=""}}me._fcs=foc?o.readOnly?1:2:0;if(me._vAct(foc)){return}me._hadFocus=!foc;v=me._validator;if(foc){me._k0=0;if(me._bad>1){me._bad=0}if(!o.readOnly){if(me._nullT){val=me._last=me._text=field.value=""}me._nullT=null;v=v&&v._lbl?v._lbl._old:null;if(v&&v.t+200>_now()){field.value=me._text=v.txt;me._lastText=v.lastTxt;me._last=v.last;me.select(v.sel0,v.sel1)}else{if(val!==me._text){me.getSelectedText();me.paste(val)}me._lastText=me._last=me._text=me._focusTxt(foc,e)}}me._focTime=time;me._dropTrigger(e,-1)}else{if(v){me._doError(2,e);setTimeout(function(){if(!me._fcs&&!me._doInvalid(e,9)){me._doError()}},100)}me._doDrop(0,e);val=me._matchList(val,-1);me._canRedo=null;if(!o.readOnly){v=me._ta?o.maxLength||0:0;if(v>0&&val.length>v){val=val.substring(0,v)}if(me._last!==val||me._bad!==0){v=me._fix;me._fix=0;me._fcs=2;me.text(val);me._fcs=0;me._fix=v}me._update()}}me._repaint();me._fixCss();if(foc&&this._prop(13)<2){me.select(this._prop(13)*1e4);me._select()}me._hadFocus=false;if(foc&&me._focSpin){me._spin(me._focSpin)}me._focSpin=null;me._fire(eType,e,-1);me._lastText=me._val();return}if(!(eType>3&&me._k0===0)&&!me._nullT&&val!==me._text){me._text=val;me._fire(12,e)}},_fire:function(id,e,arg,a2){if(!this._field){return}var evt,ee=this.events,args=id===13||id>16?arg:{};for(evt in ee){if(ee.hasOwnProperty(evt)&&ee[evt]===id){break}}if(id===14){args.delta=arg;args.value=this._instant(1,null,1)}if(id===12){args.oldText=this._lastText;arg=this._val();if(args.oldText===arg){return}this._doError(1,e);this._doClear(arg);args.text=this._lastText=this._text=arg;if(this._fcs<2&&this._evt0Spin1!==1){this._update()}this._doDP(2);if(this._type>3){this._fixCss()}}if(id<3){args.key=this._key}else if(id<8){args.elementType=arg===-1?"field":arg===1||arg===5?"button":arg===2||arg===6?"spinUpper":arg===3||arg===7?"spinLower":arg===99?"dropDown":arg>99?"item"+(arg-100):"";args.id=arg}if(id===10||id===11){args.value=arg;args.oldValue=a2}if(id===11&&this._fcs===2){this._update()}args.owner=this;if(!this._trigger(evt,e||this._evt,args)){return true}if(id<3){this._key=args.key}if(id===10){this._val10=args.value}},_select:function(x){var sel1,me=this,field=this._field[0],sel0=this._prop(13);if(this._tr!==1||sel0>1){return}if(!x){setTimeout(function(){try{me._select(1)}catch(ignore){}},0);return}sel1=field.value.length;if(sel0===0){sel1=0}else if(sel0<0){sel0=0}else{sel0=sel1}if(sel0!==field.selectionStart||sel1!==field.selectionEnd){this.select(sel0,sel1)}},select:function(sel0,sel1,val){var j,i,fix0=0,fix1=0,tr=this._tr,field=this._fcs===2?this._field[0]:null;if(!field||field.offsetWidth<2||this._box){return this}if(_aNull(val)){val=field.value}else{sel1=sel0;if(field&&field.value!==val){this._keyMod=field.value=val}}i=val.length;if(_aNull(sel1,1)){sel1=sel0;if(_aNull(sel0,1)||sel0<0){sel0=0;sel1=i}}if(sel1>=i){sel1=i}else if(sel1<sel0){sel1=sel0}if(sel0>sel1){sel0=sel1}this._sel0=sel0;this._sel1=sel1;try{if(tr===1){field.selectionStart=sel0;field.selectionEnd=sel1;return this}if(!tr){if(sel0!==sel1){field.select()}return this}if(this._ta){j=sel1;while(j-->0){if(val.charCodeAt(j)===10){if(j<sel0){fix0++}fix1++}}sel0-=fix0;sel1-=fix1}sel1-=sel0;if(this._ta){tr.moveToElementText(field)}else{tr.move("textedit",-1)}tr.move("character",sel0);if(sel1>0){tr.moveEnd("character",sel1)}tr.select()}catch(ignore){}return this},getSelectedText:function(){var i,range,val,txt="",field=this._field[0],tr=this._tr,sel0=0;this._sel0=this._sel1=0;if(_aNull(tr)){return txt}if(tr===1){this._sel0=field.selectionStart;this._sel1=field.selectionEnd;if(this._sel0<this._sel1){txt=field.value.substring(this._sel0,this._sel1)}return txt}try{range=document.selection.createRange();val=field.value;i=val.length;tr=range.duplicate();if(this._ta){tr.moveToElementText(field)}else{tr.move("textedit",-1)}try{while(tr.compareEndPoints("StartToStart",range)<0){tr.moveStart("character",1);sel0++;if(this._ta&&val.charCodeAt(sel0)===10){sel0++}if(sel0>i){break}}}catch(ignore){}txt=range.text}catch(ignore){}this._sel0=sel0;this._sel1=sel0+txt.length;return txt},getSelection:function(start){this.getSelectedText();return start?this._sel0:this._sel1},setFocus:function(delay){var me=this;if(me._field){if(delay===-1){try{me._field[0].focus()}catch(ignore){}}else{setTimeout(function(){if(me._fcs<1){me.setFocus(-1)}},delay||0)}}return this},hasFocus:function(){return this._fcs>0},_jpn:function(k,str){if(str){if(k===12290||k===65294){return"."}if(k===12289){return","}}else if(!this._sTxt){return k}if(k>65295&&k<65306){k-=65248}else if(k>1631&&k<1642){k-=1584}else if(k>1775&&k<1786){k-=1728}else{return str?null:k}return str?String.fromCharCode(k):k},_dtt:function(){var v,f,input,dt=this._oldAttr.title,o=this.options,name=o.inputName;if(name){f=o._vsFormat;v=this._getVal(1);if(_aNull(v,this._type>3)){v=""}else if(this._date){v=this._df(v,0)+"-"+(this._df(v,1)+1)+"-"+this._df(v,2)+" "+this._df(v,3)+":"+this._df(v,4)+":"+this._df(v,5)+"."+this._df(v,6)}else if(f&&this._type>3){v=v.toString().replace(".",f)}input=$('input[name="'+name+'"]');if(input[0]!==this.element[0]){if(input.length===0){MSApp.execUnsafeLocalFunction(function(){input=$('<input type="hidden" name="'+name+'" />').appendTo(this._element.parent())})}input.val(v)}}if(!dt||dt.indexOf("{0}")<0){return}v=this._val();if(v===""){v=this.options.nullText}this._element[0].title=this._field[0].title=this._field[0].alt=dt.replace("{0}",v)},_stopTimer:function(evt){if(this._timer){clearInterval(this._timer)}delete this._timer;if(!evt&&this._timer1){clearInterval(this._timer1);delete this._timer1}},_maskFlag:function(ch,upLow){switch(ch){case">":return-1;case"<":return-2;case"&":ch=1;break;case"C":ch=2;break;case"A":ch=7;break;case"a":ch=8;break;case"L":ch=13;break;case"?":ch=14;break;case"0":return 19;case"9":return 20;case"#":return 21;default:return 0}return ch+upLow*2},_maskFilter:function(flag,str,i,sf){var ch,f;if(i>=str.length){return sf}ch=str.charCodeAt(i);f=Math.floor((flag-1)/6);str=str.charAt(i);if(ch<22){return sf}if((f===1||f===3)&&ch>100){ch=this._jpn(ch);if(ch<100){str=String.fromCharCode(ch)}}if(f===3){return flag===21&&(str==="-"||str==="+")||ch>47&&ch<58?str:sf}if(f===1||f===2){if(f===1&&ch>47&&ch<58){return str}if(ch<256&&str.toUpperCase()===str.toLowerCase()){return sf}}flag=Math.floor((flag-1)/2)%3;if(flag===0){return str
}return flag===2?str.toLowerCase():str.toUpperCase()},_getTxt:function(vt,prompt,txt0,getVal){var i,len,flag,iLast=this._selKey,mask=this._mask,txt="",non=!_aNull(txt0),o=this.options;if(!non){txt0=this._bad!==0&&this._fcs>1?this._val():this._txt}if(non){non=this._type===1}if(_aNull(txt0)||_aNull(mask)){return txt}len=mask.length;iLast=this._fcs>1&&!getVal&&o.hideMaskOnFocus?iLast&&iLast<len?iLast-1:-1:len;for(i=0;i<len;i++){flag=mask.charCodeAt(i);if(flag<22){if(i<txt0.length&&txt0.charCodeAt(i)>=22){txt+=txt0.charAt(i);if(i>iLast){iLast=i}non=false}else if(vt%3===2||vt%3===1&&flag%2===1){txt+=flag===21&&prompt===""?o.padChar:prompt}}else if(vt>=3){txt+=mask.charAt(i);if(i===iLast+1){if(this._selKey===i){this._selKey++}iLast++}}}if(iLast++<len){txt=txt.substring(0,iLast)}return non?"":txt},_setTxt:function(v,vt,render){var ch,flag,j=0,i=-1,mask=this._mask,txt=this._mask;if(!_aNull(v)){while(++i<mask.length){if(vt===1e3+j){vt=this._dataMode}if(j>=v.length){break}flag=mask.charCodeAt(i);if(flag<22){ch=this._maskFilter(mask.charCodeAt(i),v,j);if(!_aNull(ch)){txt=txt.substring(0,i)+ch+txt.substring(i+1)}j++}else if(vt>=3){j++}}}if(render){return txt}this._txt=txt;this._text=this._focusTxt(this._fcs>1," ");this._repaint()},_setMask:function(str){var x,ch,i,i0=0,upLow=0,mask="",txt="",t0=this._getTxt(0);for(i=0;i<str.length;i++){ch=str.charAt(i);x=this._maskFlag(ch,upLow);if(x!==0){if(x<0){upLow=upLow===-x?0:-x;continue}ch=String.fromCharCode(x);mask+=ch;ch=this._maskFilter(x,t0,i0++,ch)}else if(ch==="\\"&&i+1<str.length&&this._maskFlag(str.charAt(i+1),0)!==0){ch=str.charAt(++i);mask+=ch}else{mask+=ch}txt+=ch}this._txt=txt;this._mask=mask},_getMask:function(fields,v,foc){var x,i,i0=0,flag=-1,txt="";if(!v){v=""}if(foc){v=v.replace("dddd","ddd").replace("ddd,","").replace("ddd ","").replace(" ddd","").replace("ddd","")}v=v.replace(/\x08/g," ").replace(/\x09/g," ");v=v.replace(/\\f/g,"").replace(/\\d/g,"").replace(/\\s/g,"").replace(/\\m/g,"").replace(/\\t/g,"").replace(/\\H/g,"").replace(/\\h/g,"").replace(/\\M/g,"\b").replace(/\\y/g,"	");v=v.replace("fff","24").replace("ff","23").replace("f","22");v=v.replace("dddd",foc?"":"21").replace("ddd",foc?"":"20").replace("dd","09").replace("d","08").replace("ss","19").replace("s","18").replace("mm","17").replace("m","16");v=v.replace("tt","15").replace("t","14").replace("HH","13").replace("H","12").replace("hh","11").replace("h","10");v=v.replace("MMMM",foc?"MM":"07").replace("MMM",foc?"MM":"06").replace("MM","05").replace("M","04").replace("yyyy","03").replace("yy","02").replace("y","01");v=v.replace(/\x01/g,"g").replace(/\x02/g,"d").replace(/\x03/g,"s").replace(/\x04/g,"m").replace(/\x05/g,"t").replace(/\x06/g,"H").replace(/\x07/g,"h").replace(/\x08/g,"M").replace(/\x09/g,"y");for(i=0;i<v.length;i++){x=v.charCodeAt(i);if(x<48||x>57){flag=v.charAt(i);if(!foc&&flag==="\\"&&i+1<v.length){x=v.charAt(++i);if(x==="\\"){continue}if(x==="0"||x==="9"){txt+=flag}txt+=x}else{txt+=v.charAt(i)}continue}flag=(x-48)*10+v.charCodeAt(++i)-48;if(!foc){fields[i0++]=flag;txt+="";continue}fields[i0++]=flag;if(flag===14){txt+="L"}else if(flag===15){txt+="LL"}else if(flag===22){txt+="0"}else{txt+="00";if(flag===3){txt+="00"}while(flag-->23){txt+="0"}}}return txt},getValueByMode:function(mode,v,getVal){var d,type=this._type,empty=this.options.emptyChar;mode=this._mode(mode,type);if(type===0||!this._field){return this._val()}if(type>3){d=this._dataMode;this._dataMode=mode;v=this.value();this._dataMode=d;return v}if(type===1){return this._getTxt(mode,v?"":empty,null,getVal)}d=this._fcs<2?this._isNull?null:this._date:this._toDate(this._val(),true,v);return mode===0?d:d?this._toTxt(d,mode===1,empty):""},_fieldVal:function(f,d,e,ch){var v,j,i=f%2*2,o=this.options;if(f<4){v=this._df(d,0)+o.yearShift;if(f===3){i=4}else{v%=100;i=f===2?2:0}}else if(f<8){this.d_s=2;v=this._df(d,1)+1;if(f>5){f=this._optVal(f===6?"monthNamesShort":"monthNames")[v-1];if(f.length>0){return f}}}else if(f<10){v=this._df(d,2)}else if(f<16){v=this._df(d,3);if(f>13){v=this._optVal(v<12?"am":"pm");f-=13;i=v.length;if(f===i){return v}if(i<f){v+=" "}return v.substring(0,f)}if(f<12){v%=12;if(v===0){v=12}}}else if(f<18){v=this._df(d,4)}else if(f<20){v=this._df(d,5)}else if(f>21){v=this._df(d,6);j=i=f-21;while(j-->3){v*=10}while(j++<2){v=Math.floor(v/10)}}else{return this._optVal(f===20?"dayNamesShort":"dayNames")[d.getDay()]}v=_str(v);if(f<20||f>22){f=v.length;if(e){if(i===0){i=2}else{e=false}}if(i>0){if(i<f){v=v.substring(0,i)}else{while(f++<i){v=(e?ch:"0")+v}}}}return v},_limits:function(val,roll){var time,min=this._prop(10),max=this._prop(11);if(this._type>3){if(_aNull(val,1)&&!this.options.nullable){val=this.options.nullValue;if(!val&&this._dataMode>2){val=0}}if(!_aNull(val,1)){if(!_aNull(min,1)&&val<=min){return roll?max:min}if(!_aNull(max,1)&&val>=max){return roll?min:max}}return val}if(_aNull(val)){return val}time=val.getTime();if(!_aNull(min)){min=min.getTime()}if(!_aNull(max)){max=max.getTime()}if(!_aNull(min)&&(time<min||roll&&time===min)){val.setTime(roll?max:min);return val}if(!_aNull(max)&&(time>max||roll&&time===max)){val.setTime(roll?min:max);return val}return null},_date7:function(val){var i;if(val.length<13){return null}val=val.replace(/[\. :]/g,"-").split("-");i=val.length;if(i!==7){return null}while(i-->0){val[i]=_int(val[i],-1);if(val[i]<0){return null}}return this._df(val[0],val[1]-1,val[2],val[3],val[4],val[5],val[6])},_toDate:function(txt,foc,limit,fire){var v,i0,c,iLen,invMes,mis=0,n=0,i=-1,j=-1,y=-1,mo=-1,day=-1,h=-2,m=-2,s=-2,ms=-2,pm=-1,any=false,inv=null,arg={},o=this.options,d=fire?null:this._date7(txt),fields=foc&&fire?this._fields0(txt):this._fields1(txt,foc);iLen=fields.length;if(!d){while(++i<iLen){j++;v=fields[i];i0=foc?this._field0IDs[i]:this._field1IDs[i];if(i0<4){if(v>100&&v>o.yearShift){v-=o.yearShift}arg.year=y=v;if(y<0){mis++}else{n++;c=o.centuryThreshold;if(v<100){if(i0<3&&c<0){c=29}if(c>=0){y+=v>c?1900:2e3}}}}else if(i0<8){if(v<1||v>12){mis++}else{arg.month=mo=v;n++}}else if(i0<10){arg.day=day=v;if(v<1||v>31){mis++}else{n++}}else if(i0<14){if(v===24){v=0}if(i0>11){pm=-4}else{if(v===12){v=0}if(v>12){mis++}}arg.hours=h=v;if(v>23||v<0){mis++}}else{if(i0<16){j--;if(v>0){pm++}continue}if(i0<18){arg.minutes=m=v;if(v>59||v<0){mis++}}else if(i0<20){arg.seconds=s=v;if(v>59||v<0){mis++}}else{if(i0<22){j--;continue}while(i0++<24){v*=10}while(i0-->25){v=Math.floor(v/10)}arg.milliseconds=ms=v;if(v>999||v<0){mis++}}}if(v>=0){any=true}if(j<o.minNumberOfDateFields&&mis>0){if(fire&&any){invMes=this._optVal("dateFields",2);inv="numberOfFields"}mis+=9}}}if(pm===0&&h>=0&&h<12){h+=12;arg.hours=h}if(!d&&(!o.nullable||mis<9)){if(n===3){d=this._df(y,mo-1,day,0,0,0,0);if(y<100){this._df(d,0,y)}}else{d=this._df();if(this._date){d.setTime(this._date.getTime())}if(day>0){this._df(d,2,10)}if(y>=0){this._df(d,0,y)}if(mo>0){this._df(d,1,mo-1)}if(day>0){this._df(d,2,day)}}}if(fire&&day>0&&d&&day!==this._df(d,2)){invMes=this._optVal("invalidDay",2);inv="dayOfMonth"}day=o.useLastGoodDate?this._goodD:null;if(fire&&!d&&!o.nullable){d=day;if(!d||!d.getTime){d=this._df()}else{invMes=this._optVal("required",2);inv="null"}}if(d){if(h>-2){this._df(d,3,h<0?0:h)}if(m>-2){this._df(d,4,m<0?0:m)}if(s>-2){this._df(d,5,s<0?0:s)}if(ms>-2){this._df(d,6,ms<0?0:ms)}if(limit){i=d;d=this._limits(d);if(_aNull(d)){d=i}else if(fire){if(!o.minValue){invMes=this._optVal("max",2).replace("{0}",this._toTxt(o.maxValue))}else if(!o.maxValue){invMes=this._optVal("min",2).replace("{0}",this._toTxt(o.minValue))}else{invMes=this._optVal("range",2).replace("{0}",this._toTxt(o.minValue)).replace("{1}",this._toTxt(o.maxValue))}inv="limit"}}}if(fire){if(any&&!d&&txt.length>0&&day){if(!inv){invMes=this._optVal("date",2);inv="invalid"}d=day}if(!any&&o.required){invMes=this._optVal("required",2);inv="null"}arg.value=d;if(inv&&(txt||!o.nullable)){if(o.reduceDayOfInvalidDate!==false&&d&&any&&this._df(d,2)<5&&arg.day>27){this._df(d,2,0);arg.value=d}arg.text=txt;arg.reason=inv;arg.message=invMes;this._inv=arg}}return d},_toTxt:function(d,foc,prompt,txt0){var ch,k,i=-1,f0=0,txt="",mask=foc?this._mask:this._mask1,ids=foc?this._field0IDs:this._field1IDs;if(_aNull(d)){if(!foc){return""}if(txt0){this._txt=mask}return this._getTxt(5,prompt,mask)}this.d_s=6;while(++i<mask.length){ch=mask.charAt(i);k=mask.charCodeAt(i);if(k<22){txt+=this._fieldVal(ids[f0++],d,foc,ch);if(foc){while(i+1<mask.length){if(mask.charCodeAt(i+1)===k){i++}else{break}}}}else{txt+=ch}}if(!foc){return txt}if(txt0){this._txt=txt}return this._getTxt(5,prompt,txt)},_isPM:function(t,i){var pm=this._optVal("pm").toUpperCase();return pm.charAt(0)===t.charAt(i)&&(pm.length<2||t.length<=i+1||pm.charAt(1)===t.charAt(i+1))},_fields1:function(txt,foc){var m,k,j,iLen,i=-1,v=-1,field=0,fields=[],ids=foc?this._field0IDs:this._field1IDs;iLen=ids.length;while(++i<iLen){fields[i]=-1}if(_aNull(txt)){return fields}txt=txt.toUpperCase();i=-1;while(++i<txt.length&&field<iLen){k=this._jpn(txt.charCodeAt(i))-48;j=ids[field];if(j===20||j===21){j=ids[++field]}if(j===14||j===15){if(k>=0&&k<=9){v=-1;field++;i--;continue}if(this._isPM(txt,i)){fields[field++]=1;v=-1}}else{if(k>=0&&k<=9){if(v<0){v=k}else{v=v*10+k}}else{if(v>=0){fields[field++]=v;v=-1}else if(j===6||j===7){while(v-->-3){for(k=0;k<12;k++){m=this._optVal(j===6?"monthNamesShort":"monthNames")[k];m=m.toUpperCase();j=m.length;if(j<1){continue}if(v===-3){if(j<4){continue}m=m.substring(0,3)}j=txt.indexOf(m)-1;if(j>-2){if(j<0||txt.charAt(j).toLowerCase()===txt.charAt(j)){break}}}if(k<12){fields[field++]=k+1;break}}}}}}if(field<iLen){fields[field]=v}return fields},_fields0:function(txt){var x,k,j=-1,i=-1,v=-1,field=-1,n=22,mask=this._mask,fields=[];if(!txt){txt=""}while(++i<mask.length){j++;x=mask.charCodeAt(i);if(x>21&&n>21){continue}if(x>21){if(field>=0){fields[field]=v}}else{if(n>21){v=-1;field++}if(j<txt.length){if(x>18){k=this._jpn(txt.charCodeAt(j))-48;if(k>=0&&k<=9){if(v<0){v=k}else{v=v*10+k}}else if(i+1<mask.length&&txt.charAt(j)===mask.charAt(i+1)){j--}}else if(n!==x&&this._isPM(txt.toUpperCase(),j)){v=1}}}n=x}fields[field]=v;return fields},_curField:function(s,mask){var i,x,n=22,field=-1;this._n0=this._n1=-1;for(i=0;i<mask.length;i++){x=mask.charCodeAt(i);if(x>21&&n>21||x<=21&&n<=21){continue}if(x>21){if(i>=s){break}}else{this._n0=i;field++}n=x}if(this._n0>=0){this._n1=i}field=this._field0IDs[field];if(_aNull(field)){return-1}if(field<8){return field<4?0:1}if(field<20){return Math.floor((field-4)/2)}return field>21?8:-1},_maskKey:function(k,ch,txt,i,s,mask){var field,n=0,v=-1;if(this._type<2){return-2}field=this._curField(s,mask);if(s>=this._n1){if(txt.charCodeAt(--s)>21){return this._maskKey(k,ch,txt,i,s+2,mask)}}if(field<0){return-1}if(field===5){if(s<=this._n0){v=this._optVal("am");ch=ch.toUpperCase();if(v.charAt(0).toUpperCase()!==ch){v=this._optVal("pm");if(v.charAt(0).toUpperCase()!==ch){return-1}}i=v.length;if(this._n1===this._n0+1){v=v.charAt(0)}else if(i<2){v+=" "}else if(i>2){v=v.substring(0,2)}this._txt=txt.substring(0,this._n0)+v+txt.substring(this._n1)}return this._n1}if(k<48||k>57){if(s===0||k!==47&&k!==58&&(k<44||k>57)){return-1}if(mask.charCodeAt(s-1)>=22||this._n1===i){return s}while(s<i){if(mask.charCodeAt(s++)>=22){break}txt=txt.substring(0,s-1)+mask.charAt(s-1)+txt.substring(s)}this._txt=txt;return s}k-=48;if(this._n0===s){v=txt.charCodeAt(s+1)-48;if(field===2){if(k>3){n=1}else if(k===3&&v>1){n=2}}else if(field===6||field===7){if(k>5){n=1}}else if(field>0&&field<5){if(field===4){k--;v-=2}if(k>1){n=1}else if(k===1&&v>2){n=2}}}if(this._n0+1===s){v=txt.charCodeAt(s-1)-48;if(field===2){if(v>3||v===3&&k>1){n=3}}else if(field===6||field===7){if(v>6||v===6&&k>0){n=3}}else if(field>0&&field<5){if(field===4){v--;k-=2}if(v>1||v===1&&k>2){n=3}}}if(n===1){txt=txt.substring(0,s)+mask.charAt(s)+txt.substring(s+1);s++}if(n===2){txt=txt.substring(0,s+1)+mask.charAt(s+1)+txt.substring(s+2)}if(n===3){while(++s<i){if(mask.charCodeAt(s)<22){break}}if(s>=i){return-1}return this._maskKey(k+48,ch,txt,i,s,mask)}this._txt=txt.substring(0,s)+ch+txt.substring(s+1);return++s},_add:function(v0,v){var dot0,dot1,dot2,s1,s2=v.toString(),s0=v0.toString(),v1=v0+v;s1=v1.toString();dot0=s0.indexOf(".");dot1=s1.indexOf(".");if(dot0<1||dot1<1){return v1}dot2=s2.indexOf(".");if(dot2>0){dot2=s2.length-dot2}dot0=Math.max(dot2,s0.length-dot0);if(s1.length-dot1<=dot0){return v1}v=10;while(dot0-->2){v*=10}return Math.round(v1*v)/v},spin:function(delta){var val,x,i,d,o=this.options;if(!this._spinList(delta)){return this}if(this._type<2){return this}if(this._type>3){val=this._toNum(this._val())||0;val=this._add(val,delta);delta=o.maxLength;if(!delta||delta<1||val.toString().length<=delta){this._set_val(val,this._fcs)}return this}i=this._spinField;d=this._df();d.setTime(this._date.getTime());if(i<0||i>8){if(this._fcs===2){this.getSelectedText();i=this._curField(this._sel0,this._mask);d=this._toDate(this._val(),true,true);if(_aNull(d)){d=this._df()}this._spinField=i}else{this._spinField=i=this.d_s}}if(i===5){delta=delta>0?12:-12}x=o.spin1Field;switch(i){case 0:delta+=this._df(d,0);this._df(d,0,delta);if(x&&delta!==this._df(d,0)){i=-1}break;case 1:delta+=this._df(d,1);this._df(d,1,delta);if(x&&delta!==this._df(d,1)){i=-1}break;case 2:delta+=this._df(d,2);this._df(d,2,delta);if(x&&delta!==this._df(d,2)){i=-1}break;case 3:case 4:case 5:i=this._df(d,2);delta+=this._df(d,3);this._df(d,3,delta);if(x&&i!==this._df(d,2)){i=-1}break;case 6:delta+=this._df(d,4);this._df(d,4,delta);if(x&&delta!==this._df(d,4)){i=-1}break;case 7:delta+=this._df(d,5);this._df(d,5,delta);if(x&&delta!==this._df(d,5)){i=-1}break;case 8:for(i=this._n1-this._n0;i<3;i++){delta*=10}delta+=this._df(d,6);this._df(d,6,delta);if(x&&delta!==this._df(d,6)){i=-1}break}if(i<0){return this}delta=this._limits(d);if(!_aNull(delta)){d=delta}this._text=this._toTxt(d,this._fcs===2,o.promptChar,true);this._date=d;this._isNull=false;this._repaint();this.select(this._sel0);if(this._fcs===2){this._last=this._val()}return this},_mode:function(mode,t){var mods;if(!mode||t<1){mode=_aNull(mode)?t>3?1:t===1?5:0:0}else if(typeof mode!=="number"){mode=mode.toString().toLowerCase();if(t>3){mods={text:-1,editmodetext:0,"double":1,"float":2,decimal:3,"long":4,ulong:5,"int":6,uint:7,"short":8,ushort:9,sbyte:10,"byte":11}}else if(t>1){mods={date:0,editmodetext:1,text:2}}else if(t>0){mods={rawtext:0,rawtextwithrequiredprompts:1,rawtextwithallprompts:2,rawtextwithliterals:3,rawtextwithrequiredpromptsandliterals:4,alltext:5}}mode=mods[mode];if(_aNull(mode)){mode=-2}}return mode<-1?t>3?1:0:mode},_fixMode:function(init){var len,format,mask,mask1,mode,t=this._type,o=this.options,val=this._value;this._dataMode=mode=this._mode(o.dataMode,t);this._maxLen=o.maxLength;if(t>0&&t<4){if(!o.promptChar){o.promptChar="_"}if(!o.padChar){o.padChar=" "}if(!o.emptyChar){o.emptyChar=" "}if(t===1&&init){t=o.inputMask;this._setMask(t||"CCCCCCCCCC")}}if(t<2){if(init===3){this._setVal(val)}return}if(t<4){format=o.dateInputFormat=o.dateInputFormat||"date";if(!o.yearShift){o.yearShift=0}if(_aNull(o.centuryThreshold)){o.centuryThreshold=29}if(_aNull(o.minNumberOfDateFields)){o.minNumberOfDateFields=3}mask=this._optVal(format+"Pattern")||format;format=o.dateDisplayFormat||format;mask1=this._optVal(format+"Pattern")||format||mask;this._field0IDs=[];mask=this._getMask(this._field0IDs,mask,1);this._field1IDs=[];this._mask1=this._getMask(this._field1IDs,mask1);if(init===1){this._date=this._df();this._isNull=false}this._spinField=-1;this.d_s=10;this._setMask(mask);if(init!==1&&!this._isNull){this._setVal(this._date,1)}return}if(mode>3&&this._maxLen<1){len=3;if(mode<6){len=19}else if(mode<8){len=10}else if(mode<10){len=5}this._field[0].maxLength=this._maxLen=len+(mode+1)%2}if(init===3){this._setVal(val,1)}if(!init&&(val||val===0)){this._setVal(val/this._prop(7))}},_toNum:function(txt,limit,fire){var val,min=null,max=null,invMes,o=this.options,num=txt,len=0;if(typeof txt!=="number"){txt=_str(txt);len=txt.length;num=parseFloat(this._txtAsNum(txt))}if(isNaN(num)){num=null}else if(!isFinite(num)){num=num===Number.NEGATIVE_INFINITY?-Number.MAX_VALUE:Number.MAX_VALUE}val=limit?this._limits(num):num;if(fire&&(val!==num||_aNull(val,1)&&len>0)){fire=_aNull(num,1)?len===0?"null":"format":"limit";if(_aNull(num,1)){if(len===0){fire="null";invMes=this._optVal("required",2)}else{fire="format";invMes=this._optVal("number",2)}}else{fire="limit";limit=null;min=o.minValue;if(_aNull(min,1)){min=this._prop(10);if(!_aNull(min,1)){if(min!==val){min=null}}}max=o.maxValue;if(_aNull(max,1)){max=this._prop(11);if(!_aNull(max,1)){if(max!==val){max=null}}}invMes=_aNull(max,1)?this._optVal("min",2).replace("{0}",min.toString(10)):_aNull(min,1)?this._optVal("max",2).replace("{0}",max.toString(10)):this._optVal("range",2).replace("{0}",min.toString(10)).replace("{1}",max.toString(10))}this._inv={value:val,text:txt,reason:fire,message:invMes}}return val},_txtAsNum:function(txt,dec,min){var ch,len=txt.length;if(!dec){dec=this._prop(4)}if(!min){min=this._prop(3)}while(len-->0){ch=this._jpn(txt.charCodeAt(len),true);if(ch){txt=txt.replace(new RegExp(txt.charAt(len),"g"),ch)}}txt=txt.replace("(",txt.indexOf(min)<0?"-":"").replace(this._prop(2),"").replace(new RegExp(min,"g"),"-");txt=txt.replace(dec,"");ch=txt.indexOf(dec);if(ch>0){txt=txt.substring(0,ch)}txt=txt.replace(/[^0-9\-eE\x01]/gm,"").replace("",".");len=txt.length;ch=txt.indexOf("-");if(ch>=0){ch=txt.indexOf("-",ch+1);if(ch+1<len&&ch>0){if(ch>0&&txt.toUpperCase().charAt(ch-1)!=="E"){txt=txt.substring(0,ch)}}len=txt.length;if(txt.toUpperCase().indexOf("E")<0&&ch+1===len){txt="-"+txt.substring(0,len-1)}}return txt==="-"||txt==="."?"":txt},_ePow:function(plus){var pow=this.options.scientificFormat,len=pow?pow.length:0,ch=len?pow.charAt(0):null;return(ch==="e"||ch==="E")&&(len===1||len===2&&pow.charAt(1)==="+")?plus?pow:ch:null},_toTxtNum:function(val,foc,txt,minus,dec,str){var grps,gr0,gr,ch,iL,ePow=this._ePow(),ig=0,iDec=0,i=-1,neg=val,maxDec=this._prop(8);if(_aNull(txt)){if(_aNull(val,1)){return""}neg=val<0;if(neg){val=-val}try{txt=ePow?val.toString(10):val.toFixed(maxDec)}catch(ex){str=txt=_str(val)}return this._toTxtNum(neg,foc,txt.toUpperCase(),_aNull(minus)?this._prop(3):minus,_aNull(dec)?this._prop(4):dec,str)}if(str){txt=this._txtAsNum(txt,dec)}txt=txt.replace("+","");iL=txt.indexOf("E");if(iL>0){ePow=ePow?this._ePow(!foc&&txt.charAt(iL+1)!=="-")+txt.substring(iL+1):txt.substring(iL);txt=txt.substring(0,iL)}else{ePow=""}iL=txt.length;if(_aNull(neg)){if(iL===0){return foc?txt:""}neg=this._isMinus(txt.charCodeAt(0));if(neg){txt=txt.substring(1);iL--}}while(++i<iL){ch=txt.charCodeAt(i);if(ch<48||ch>57){txt=txt.substring(0,i)+txt.substring(i+1);iL--;break}}while(i<iL){if(txt.charCodeAt(iL-1)!==48){break}txt=txt.substring(0,--iL)}iL=i;if(maxDec>0&&iL<txt.length){iDec=txt.length-iL;txt=txt.substring(0,iL)+dec+txt.substring(iL);iL+=dec.length+maxDec}if(iL<txt.length){txt=txt.substring(0,iL)}gr=txt.replace(/0/g,"");if(neg&&(!gr||gr===dec)){neg=false}iL=this._prop(9);if(iL>0){if(iDec===0){txt+=dec}while(iL-->iDec){txt+="0"}}if(foc){txt+=ePow;return neg?minus+txt:txt}grps=this._prop(6);gr=gr0=grps.length>0?grps[0]:0;while(gr>0&&--i>0){if(--gr===0){txt=txt.substring(0,i)+this._prop(5)+txt.substring(i);gr=grps[++ig];if(_aNull(gr)||gr<1){gr=gr0}else{gr0=gr}}}val=this._prop(neg?1:0).replace("n",txt+ePow);return val.replace("$",this._prop(2))},_prop:function(flag){var min,val,sign,o=this.options,t=this._type,mode=this._dataMode;if(flag===13){o=o.selectionOnFocus;return o===-1||o==="select"?-1:o===0||o==="start"?0:o===1||o==="end"?1:2}if(flag===12){return o.maxLength>0?o.maxLength:this._maxLen}if(flag===0){return o.positivePattern||(t===6?this._optVal("percentPositivePattern"):t===5?this._optVal("currencyPositivePattern"):"n")}if(flag===1){val=o.negativePattern||this._optVal(t===6?"percentNegativePattern":t===5?"currencyNegativePattern":"numericNegativePattern");return val.replace("-",this._prop(3))}if(flag===2){val=o.symbol;if(!_aNull(val)){return val}return t===6?this._optVal("percentSymbol"):t===5?this._optVal("currencySymbol"):""}if(flag===3){return this._optVal("negativeSign")||"-"}if(flag===4){return o.decimalSeparator||this._optVal(t===6?"percentDecimalSeparator":t===5?"currencyDecimalSeparator":"numericDecimalSeparator")}if(flag===5){val=o.groupSeparator;if(!_aNull(val)){return val}return this._optVal(t===6?"percentGroupSeparator":t===5?"currencyGroupSeparator":"numericGroupSeparator")}if(flag===6){return o.groups||this._optVal(t===6?"percentGroups":t===5?"currencyGroups":"numericGroups")}if(flag===7){val=o.displayFactor;if(!_aNull(val)){return val}return t===6?this._optVal("percentDisplayFactor"):1}if(flag===8){if(mode>3){return 0}val=o.maxDecimals;if(!_aNull(val)){return val}return this._optVal(t===6?"percentMaxDecimals":t===5?"currencyMaxDecimals":"numericMaxDecimals")}if(flag===9){if(mode>3){return 0}val=o.minDecimals;if(!_aNull(val)){return val}return this._optVal(t===6?"percentMinDecimals":t===5?"currencyMinDecimals":"numericMinDecimals")}min=flag===10;if(min||flag===11){val=min?o.minValue:o.maxValue;if(t>3&&typeof val==="string"){val=parseFloat(val)}if(!_aNull(val,1)||t<4||mode<2||mode===3||mode>11){return val}if(mode===2){return min?-3.40282347e38:3.40282347e38}val=127;sign=mode%2===0;if(!sign&&min){return 0}if(mode<6){val=0x8000000000000000}else if(mode<8){val=2147483647}else if(mode<10){val=32767}return sign?min?-(val+1):val:val*2+1}},_isMinus:function(k){return k===this._prop(3).charCodeAt(0)||k===45||k===40&&this._prop(1).indexOf("(")>=0||k===12540||k===65293||k===65288},destroy:function(){var par,e,b,elem=this._element,field=this._field,elem0=this.element,buts=this._buttons,i=buts?buts.length:0;e=elem?elem[0]:null;if(!field||!e){return this}this._stopTimer();this._doDP(3);this._initValidator(1);this._listRemove();field.unbind(this._evts);elem.unbind(this._mEvts);while(i-->0){if(buts[i]){buts[i].unbind(this._touchEvts)}}b=buts&&buts[0]?buts[0][0]:null;if(b&&b.parentNode===e){e.removeChild(b)}b=buts&&buts[1]?buts[1][0].parentNode:null;if(b&&b.parentNode===e){e.removeChild(b)}if(field[0].parentNode===e){e.removeChild(field[0])}if(this._selElem){elem.remove()}else if(this._swap){par=e.parentNode;par.insertBefore(elem0[0],e);par.removeChild(e)}par=this._oldCss;for(i in par){if(par.hasOwnProperty(i)){elem0.css(i,par[i])}}par=this._oldAttr;for(i in par){if(par.hasOwnProperty(i)){elem0[0][i]=par[i]}}elem0[0]._ig_oldCss=null;if(e._wd){e._wd=null}if(e._ht){e._ht=null}elem0=elem=field=this._dp=this._buttons=this._field=this._element=null;this._evts=this._mEvts=this._touchEvts=this._oldAttr=this._oldCss=this._validator=null;$.Widget.prototype.destroy.apply(this,arguments);return this}});$.extend($.ui.igEditor,{version:"13.1.20131.2523"});$.ui.igEditor.setDefaultCulture=function(regional){$.ig.regional=$.ig.regional||{};$.ig.regional.defaults=$.extend($.ig._regional,typeof regional==="string"?$.ig.regional[regional]:regional);if(regional==="en"||regional==="en-US"){regional=""}if($.datepicker&&$.datepicker.regional&&$.datepicker.regional[regional]){$.datepicker.setDefaults($.datepicker.regional[regional])}};$.widget("ui.igTextEditor",$.ui.igEditor,{options:{textMode:null,maxLength:0,includeKeys:null,excludeKeys:null,toUpper:false,toLower:false,listMatchIgnoreCase:true,listMatchOnly:false,listMatchContains:false,listAutoComplete:false},_create:function(){$.ui.igEditor.prototype._create.apply(this,[0])}});$.widget("ui.igMaskEditor",$.ui.igEditor,{options:{includeKeys:null,excludeKeys:null,toUpper:false,toLower:false,listMatchIgnoreCase:true,listMatchOnly:false,listMatchContains:false,listAutoComplete:false,inputMask:"CCCCCCCCCC",promptChar:"_",padChar:" ",emptyChar:" ",dataMode:"alltext",hideMaskOnFocus:false},_create:function(){$.ui.igEditor.prototype._create.apply(this,[1])}});$.widget("ui.igDateEditor",$.ui.igEditor,{options:{regional:null,spin1Field:false,minValue:null,maxValue:null,dateDisplayFormat:null,dateInputFormat:null,promptChar:"_",dataMode:"date",minNumberOfDateFields:3,useLastGoodDate:false,reduceDayOfInvalidDate:true,hideMaskOnFocus:false,centuryThreshold:29,enableUTCDates:false,spinDelta:1,nullable:true,yearShift:0},_create:function(){$.ui.igEditor.prototype._create.apply(this,[2])}});$.widget("ui.igDatePicker",$.ui.igDateEditor,{options:{button:"dropdown",focusOnDropDownOpen:null,datepickerOptions:null},_create:function(){$.ui.igEditor.prototype._create.apply(this,[3])}});$.widget("ui.igNumericEditor",$.ui.igEditor,{options:{regional:null,negativePattern:null,negativeSign:null,decimalSeparator:null,groupSeparator:null,groups:null,maxDecimals:null,minDecimals:null,minValue:null,maxValue:null,scientificFormat:null,nullValue:null,spinDelta:1,nullable:true,maxLength:0,dataMode:"double"},_create:function(){$.ui.igEditor.prototype._create.apply(this,[4])}});$.widget("ui.igCurrencyEditor",$.ui.igNumericEditor,{options:{positivePattern:null,negativePattern:null,symbol:null},_create:function(){$.ui.igEditor.prototype._create.apply(this,[5])}});$.widget("ui.igPercentEditor",$.ui.igNumericEditor,{options:{positivePattern:null,negativePattern:null,symbol:null,displayFactor:null},_create:function(){$.ui.igEditor.prototype._create.apply(this,[6])}})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Tree 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.draggable.js
 *	jquery.ui.droppable.js
 *	infragistics.templating.js
 *	infragistics.dataSource.js
 *  infragistics.ui.shared.js
 *	infragistics.util.js
 *	infragistics.ui.tree-en.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igTree",{_const:{dragCursorAt:{top:-10,left:-10}},css:{tree:"ui-widget ui-igtree",treeCollection:"ui-igtree-collection",treeNode:"ui-igtree-node",treeRoot:"ui-igtree-root ui-widget-content",treeRootNode:"ui-igtree-noderoot",nodeNoChildren:"ui-igtree-node-nochildren",parentNode:"ui-igtree-parentnode",collapseIcon:"ui-icon ui-icon-triangle-1-s",expandIcon:"ui-icon ui-icon-triangle-1-e",nodeExpander:"ui-igtree-expander",nodeNormal:"ui-state-default",nodeHightlight:"ui-state-highlight",nodeHovered:"ui-state-hover",nodeSelected:"ui-state-active",nodeActive:"ui-state-focus",checkbox:"ui-state-default ui-corner-all ui-igcheckbox-normal",checkboxOff:"ui-icon ui-icon-check ui-igcheckbox-normal-off",checkboxOn:"ui-icon ui-icon-check ui-igcheckbox-normal-on",checkboxPartial:"ui-icon ui-icon-check ui-state-disabled ui-igcheckbox-normal-on",invalidDropIndicator:"ui-widget ui-igtree-dropindicator ui-state-error ui-corner-all",dropIndicator:"ui-widget ui-igtree-dropindicator ui-state-highlight ui-corner-all",moveMarkupIcon:"ui-icon ui-icon-arrowthick-1-e",invalidMoveMarkupIcon:"ui-icon ui-icon-cancel",copyMarkupIcon:"ui-icon ui-icon-plus",insertLine:"ui-state-default ui-igtree-insertline"},options:{width:null,height:null,checkboxMode:"off",singleBranchExpand:false,hotTracking:true,parentNodeImageUrl:null,parentNodeImageClass:null,parentNodeImageTooltip:null,leafNodeImageUrl:null,leafNodeImageClass:null,leafNodeImageTooltip:null,animationDuration:200,pathSeparator:"_",dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseDataType:null,requestType:"GET",responseContentType:null,initialExpandDepth:-1,loadOnDemand:false,bindings:{textKey:"Text",textXPath:"@Text",valueKey:"Value",valueXPath:"@Value",imageUrlKey:"ImageUrl",imageUrlXPath:"@ImageUrl",navigateUrlKey:"NavigateUrl",navigateUrlXPath:"@NavigateUrl",targetKey:"Target",expandedKey:"Expanded",primaryKey:null,nodeContentTemplate:null,childDataProperty:"Nodes",childDataXPath:"Children",searchFieldXPath:"Nodes",bindings:{}},defaultNodeTarget:"_self",dragAndDrop:false,updateUrl:null,dragAndDropSettings:{allowDrop:false,dragAndDropMode:"default",dragOpacity:.75,revert:true,revertDuration:500,zIndex:10,dragStartDelay:200,expandOnDragOver:true,expandDelay:1e3,helper:"default",customDropValidation:null,containment:false,invalidMoveToMarkup:"<div><p><span></span><strong>{0}</strong></p></div>",moveToMarkup:"<div><p><span></span><strong>Move to</strong> {0}</p></div>",moveBetweenMarkup:"<div><p><span></span><strong>Move between</strong> {0} and {1}</p></div>",moveAfterMarkup:"<div><p><span></span><strong>Move after</strong> {0}</p></div>",moveBeforeMarkup:"<div><p><span></span><strong>Move before</strong> {0}</p></div>",copyToMarkup:"<div><p><span></span><strong>Copy to</strong> {0}</p></div>",copyBetweenMarkup:"<div><p><span></span><strong>Copy between</strong> {0} and {1}</p></div>",copyAfterMarkup:"<div><p><span></span><strong>Copy after</strong> {0}</p></div>",copyBeforeMarkup:"<div><p><span></span><strong>Copy before</strong> {0}</p></div>"}},events:{dataBinding:"dataBinding",dataBound:"dataBound",rendering:"rendering",rendered:"rendered",selectionChanging:"selectionChanging",selectionChanged:"selectionChanged",nodeCheckstateChanging:"nodeCheckstateChanging",nodeCheckstateChanged:"nodeCheckstateChanged",nodePopulating:"nodePopulating",nodePopulated:"nodePopulated",nodeCollapsing:"nodeCollapsing",nodeCollapsed:"nodeCollapsed",nodeExpanding:"nodeExpanding",nodeExpanded:"nodeExpanded",nodeClick:"nodeClick",nodeDoubleClick:"nodeDoubleClick",dragStart:"dragStart",drag:"drag",dragStop:"dragStop",nodeDropping:"nodeDropping",nodeDropped:"nodeDropped"},widget:function(){return this.element},_createWidget:function(options,element){this.options.bindings=null;this.options.dragAndDropSettings.moveToMarkup="<div><p><span></span>"+$.ig.Tree.locale.moveTo+"</p></div>";this.options.dragAndDropSettings.moveBetweenMarkup="<div><p><span></span>"+$.ig.Tree.locale.moveBetween+"</p></div>";this.options.dragAndDropSettings.moveAfterMarkup="<div><p><span></span>"+$.ig.Tree.locale.moveAfter+"</p></div>";this.options.dragAndDropSettings.moveBeforeMarkup="<div><p><span></span>"+$.ig.Tree.locale.moveBefore+"</p></div>";this.options.dragAndDropSettings.copyToMarkup="<div><p><span></span>"+$.ig.Tree.locale.copyTo+"</p></div>";this.options.dragAndDropSettings.copyBetweenMarkup="<div><p><span></span>"+$.ig.Tree.locale.copyBetween+"</p></div>";this.options.dragAndDropSettings.copyAfterMarkup="<div><p><span></span>"+$.ig.Tree.locale.copyAfter+"</p></div>";this.options.dragAndDropSettings.copyBeforeMarkup="<div><p><span></span>"+$.ig.Tree.locale.copyBefore+"</p></div>";$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var opt=this.options;this.dataBind();this.element.addClass(this.css.tree);this._attachEvents();if($.ig.util.isIE&&$.ig.util.browserVersion===7&&this.element.css("position")==="static"){this.element.css("position","relative")}if(opt.width){this.element.css("width",opt.width)}if(opt.height){this.element.css("height",opt.height)}},_setOption:function(option,value){var css=this.css,elements,prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"width":this.element.css("width",value);break;case"height":this.element.css("height",value);break;case"parentNodeImageUrl":elements=this.element.find("img[data-role=parent-node-image]");if(elements.length>0){elements.attr("src",value)}else{throw new Error($.ig.Tree.locale.setOptionError+option)}break;case"parentNodeImageTooltip":elements=this.element.find("img[data-role=parent-node-image]");if(elements.length<=0){elements=this.element.find("span[data-role=parent-node-image]")}if(elements.length>0){elements.attr("title",value)}else{throw new Error($.ig.Tree.locale.setOptionError+option)}break;case"parentNodeImageClass":elements=this.element.find("span[data-role=parent-node-image]");if(elements.length>0){elements.removeClass();elements.addClass(value)}else{throw new Error($.ig.Tree.locale.setOptionError+option)}break;case"leafNodeImageUrl":elements=this.element.find("img[data-role=leaf-node-image]");if(elements.length>0){elements.attr("src",value)}else{throw new Error($.ig.Tree.locale.setOptionError+option)}break;case"leafNodeImageTooltip":elements=this.element.find("img[data-role=leaf-node-image]");if(elements.length<=0){elements=this.element.find("span[data-role=leaf-node-image]")}if(elements.length>0){elements.attr("title",value)}else{throw new Error($.ig.Tree.locale.setOptionError+option)}break;case"leafNodeImageClass":elements=this.element.find("span[data-role=leaf-node-image]");if(elements.length>0){elements.removeClass();elements.addClass(value)}else{throw new Error($.ig.Tree.locale.setOptionError+option)}break;case"hotTracking":if(value){this.element.delegate("a",{mouseover:function(event){$(event.target).addClass(css.nodeHovered)},mouseout:function(event){$(event.target).removeClass(css.nodeHovered)}})}else{this.element.undelegate("a","mouseover");this.element.undelegate("a","mouseout")}break;case"checkboxMode":if(value.toLowerCase()==="off"){this._removeCheckboxes()}else if(prevValue==="off"){this._addCheckboxes()}break;case"dataSource":this.dataBind();break;case"dragAndDrop":if(value){this._initDragAndDrop()}else{this._destroyDragAndDrop()}break;case"updateUrl":this.options.dataSource.root().settings.updateUrl=value;break;case"bindings":case"loadOnDemand":case"pathSeparator":case"initialExpandDepth":case"defaultNodeTarget":throw new Error($.ig.Tree.locale.setOptionError+option);break;default:break}},_removeCheckboxes:function(){this.element.find("span[data-role=checkbox]").remove()},_addCheckboxes:function(){var self=this;this.element.find("li[data-role=node]").each(function(index,element){var $this=$(this);if($this.children("span[data-role=expander]").length>0){$this.children("span[data-role=expander]").after(self._renderCheckbox())}else{$this.prepend(self._renderCheckbox())}})},_initDataOptions:function(){var dataOptions,ul,s;s=this._initDataSourceSchema();if(!this.options.dataSource&&!this.options.dataSourceUrl){if(!this.element.is("ul")){ul=this.element.children("ul");this.options.dataSource=ul[0]}else{this.options.dataSource=this.element[0]}}else if(!this.options.dataSource&&this.options.dataSourceUrl){this.options.dataSource=this.options.dataSourceUrl}else if($.type(this.options.dataSource)==="object"&&typeof this.options.dataSource._encodeHierarchicalUrlParams!=="function"&&typeof this.options.dataSource._xmlToArray!=="function"&&!this.options.dataSourceType){this.options.dataSource=[this.options.dataSource]}dataOptions={callback:this._constructFromData,callee:this,dataSource:this.options.dataSource,requestType:this.options.requestType,responseContentType:this.options.responseContentType,defaultChildrenDataProperty:this.options.bindings.childDataProperty,responseDataType:this.options.responseDataType,primaryKey:this.options.primaryKey,localSchemaTransform:this.options.dataSourceType&&this.options.dataSourceType==="xml"?true:false,schema:s,updateUrl:this.options.updateUrl};if(this.options.dataSourceType){dataOptions.type=this.options.dataSourceType}if(this.options.responseDataKey){dataOptions.responseDataKey=this.options.responseDataKey}return dataOptions},_initDataSourceSchema:function(){var schema={},opt=this.options,bindings=opt.bindings;if(bindings===null){opt.bindings={};schema.text={name:"Text",type:"string"};opt.bindings.textKey="Text";schema.value={name:"Value",type:"string"};opt.bindings.valueKey="Value";schema.imageUrl={name:"ImageUrl",type:"string"};opt.bindings.imageUrlKey="ImageUrl";schema.navigateUrl={name:"NavigateUrl",type:"string"};opt.bindings.navigateUrlKey="NavigateUrl";schema.childData={name:"Nodes",type:"object"};opt.bindings.childDataProperty="Nodes";schema.target={name:"Target",type:"string"};opt.bindings.targetKey="Target";bindings=opt.bindings}else if(opt.dataSourceType==="xml"){if(bindings.searchFieldXPath){schema.searchField=bindings.searchFieldXPath}}schema.fields=[];if(bindings.textKey){schema.fields.push({name:bindings.textKey,type:"string",xpath:bindings.textXPath});schema.textKey=bindings.textKey}if(bindings.valueKey){schema.fields.push({name:bindings.valueKey,type:"string",xpath:bindings.valueXPath});schema.valueKey=bindings.valueKey}if(bindings.navigateUrlKey){schema.fields.push({name:bindings.navigateUrlKey,type:"string",xpath:bindings.navigateUrlXPath});schema.navigateUrlKey=bindings.navigateUrlKey}if(bindings.imageUrlKey){schema.fields.push({name:bindings.imageUrlKey,type:"string",xpath:bindings.imageUrlXPath});schema.imageUrlKey=bindings.imageUrlKey}if(bindings.targetKey){schema.fields.push({name:bindings.targetKey,type:"string"});schema.targetKey=bindings.targetKey}if(bindings.expandedKey){schema.fields.push({name:"Expanded",type:"boolean"});schema.expandedKey=bindings.expandedKey}if(bindings.primaryKey){schema.fields.push({name:bindings.primaryKey,type:"string"});schema.primaryKey=bindings.primaryKey}if(bindings.childDataProperty){schema.fields.push({name:bindings.childDataProperty,type:"object",xpath:bindings.childDataXPath});schema.childDataProperty=bindings.childDataProperty}if(!schema.searchField&&opt.responseDataKey){schema.searchField=opt.responseDataKey}return schema},_initDataSource:function(dataOptions){var opt=this.options;if(!opt.dataSource||typeof opt.dataSource._encodeHierarchicalUrlParams!=="function"){opt.dataSource=new $.ig.HierarchicalDataSource(dataOptions)}},_helper:null,_insertLine:{html:null},_originalHelper:{html:null},_sourceNode:{data:null,element:null,owner:null},_validationObject:{valid:true,dropAfter:true,expandTimeout:null,target:null},_helperDirty:false,_dropAfter:true,_initDragOptions:function(){var self=this,dragAndDropSettings=self.options.dragAndDropSettings,helper=dragAndDropSettings.helper==="default"?function(event){var target=$(event.target).closest("li[data-role=node]"),markup=$(self.options.dragAndDropSettings.invalidMoveToMarkup.replace("{0}",target.children("a").text()));markup.addClass(self.css.invalidDropIndicator).find("span").addClass(self.css.invalidMoveMarkupIcon);return markup}:dragAndDropSettings.helper,opt={revert:dragAndDropSettings.revert?"invalid":false,opacity:dragAndDropSettings.dragOpacity,zIndex:dragAndDropSettings.zIndex,cursorAt:this._const.dragCursorAt,helper:helper,revertDuration:dragAndDropSettings.revertDuration,appendTo:self.element,delay:dragAndDropSettings.dragStartDelay,containment:dragAndDropSettings.containment,start:function(event,ui){var node=self.nodeFromElement($(this)),noCancel;noCancel=self._triggerDragStart(event,ui,node.element);if(noCancel){self._originalHelper.html=ui.helper.html();self._sourceNode.data=$.extend(false,{},node.data);self._sourceNode.owner=self;self._sourceNode.element=$(this)}else{return false}},drag:function(event,ui){var noCancel=self._triggerDrag(event,ui,self._sourceNode.element);if(noCancel){self._performDrag(event,ui)}else{self._resetSourceNode();self._resetValidationObject();return false}},stop:function(event,ui){self._triggerDragStop(event,ui);$(document).find("div[data-role=insert-line]").remove();self._helperDirty=false;self._resetSourceNode();self._resetValidationObject()}};return opt},_performDrag:function(event,ui){var target=$(event.originalEvent.target),markup,copy=event.ctrlKey&&this.options.dragAndDropSettings.dragAndDropMode==="default"||this.options.dragAndDropSettings.dragAndDropMode==="copy",targetTop,dragTop,self=this;if(target.is("div[data-role=insert-line]")){return}this._validationObject.valid=this._accept(this._sourceNode.element,target);$(document).find("div[data-role=insert-line]").remove();if(this.options.dragAndDropSettings.expandOnDragOver){if((target.is("a")||target.closest("a").parent().is("li[data-role=node]"))&&this._validationObject.target!==target.closest("li[data-role=node]")){clearTimeout(this._validationObject.expandTimeout);this._validationObject.target=target.closest("li[data-role=node]");if(this._validationObject.target.hasClass("ui-igtree-parentnode")){this._validationObject.expandTimeout=setTimeout(function(){self.expand(self._validationObject.target)},this.options.dragAndDropSettings.expandDelay)}}else{clearTimeout(this._validationObject.expandTimeout);this._validationObject.expandTimeout=null;this._validationObject.target=null}}if((target.is("a")||target.closest("a").parent().is("li[data-role=node]"))&&this._validationObject.valid){if(copy){markup=$(this.options.dragAndDropSettings.copyToMarkup.replace("{0}",target.text()));markup.find("span").addClass(this.css.copyMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.moveToMarkup.replace("{0}",target.text()));markup.find("span").addClass(this.css.moveMarkupIcon)}this._helper=markup.html();ui.helper.removeClass(this.css.invalidDropIndicator).addClass(this.css.dropIndicator).html(this._helper);this._helperDirty=true}else if(target.is("li[data-role=node]")&&this._validationObject.valid){targetTop=target.offset().top+target.height()/2;dragTop=ui.offset.top+this._const.dragCursorAt.top;if(dragTop>targetTop){this._validationObject.dropAfter=true;if(copy){if(target.next("li[data-role=node]").length>0){markup=$(this.options.dragAndDropSettings.copyBetweenMarkup.replace("{0}",target.children("a").text()).replace("{1}",target.next("li[data-role=node]").children("a").text()));markup.find("span").addClass(this.css.copyMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.copyAfterMarkup.replace("{0}",target.children("a").text()));markup.find("span").addClass(this.css.copyMarkupIcon)}}else{if(target.next("li[data-role=node]").length>0){markup=$(this.options.dragAndDropSettings.moveBetweenMarkup.replace("{0}",target.children("a").text()).replace("{1}",target.next("li[data-role=node]").children("a").text()));markup.find("span").addClass(this.css.moveMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.moveAfterMarkup.replace("{0}",target.children("a").text()));markup.find("span").addClass(this.css.moveMarkupIcon)}}$(this._insertLine.html).appendTo(target);this._helper=markup.html();ui.helper.removeClass(this.css.invalidDropIndicator).addClass(this.css.dropIndicator).html(this._helper)}else{this._validationObject.dropAfter=false;if(copy){if(target.prev("li[data-role=node]").length>0){markup=$(this.options.dragAndDropSettings.copyBetweenMarkup.replace("{0}",target.children("a").text()).replace("{1}",target.prev("li[data-role=node]").children("a").text()));markup.find("span").addClass(this.css.copyMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.copyBeforeMarkup.replace("{0}",target.children("a").text()));markup.find("span").addClass(this.css.copyMarkupIcon)}}else{if(target.prev("li[data-role=node]").length>0){markup=$(this.options.dragAndDropSettings.moveBetweenMarkup.replace("{0}",target.prev("li[data-role=node]").children("a").text()).replace("{1}",target.children("a").text()));markup.find("span").addClass(this.css.moveMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.moveBeforeMarkup.replace("{0}",target.children("a").text()));markup.find("span").addClass(this.css.moveMarkupIcon)}}if(target.index()===0){$(this._insertLine.html).prependTo(target).css("padding-bottom","0.1em")}else{$(this._insertLine.html).appendTo(target.prev())}this._helper=markup.html();ui.helper.removeClass(this.css.invalidDropIndicator).addClass(this.css.dropIndicator).html(this._helper)}this._helperDirty=true}else if(target.is(":ui-igTree")){if(copy){markup=$(this.options.dragAndDropSettings.copyToMarkup.replace("{0}",target.text()));markup.find("span").addClass(this.css.copyMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.moveToMarkup.replace("{0}",target.text()));markup.find("span").addClass(this.css.moveMarkupIcon)}this._helper=markup.html();ui.helper.removeClass(this.css.invalidDropIndicator).addClass(this.css.dropIndicator).html(this._helper);this._helperDirty=true}else{$(document).find("div[data-role=insert-line]").remove();if(this._helperDirty){this._helper=null;ui.helper.removeClass(this.css.dropIndicator).addClass(this.css.invalidDropIndicator).html(this._originalHelper.html);this._helperDirty=false}}},_resetSourceNode:function(){this._originalHelper.html=null;this._sourceNode.data=null;this._sourceNode.owner=null;this._sourceNode.element=null},_resetValidationObject:function(){this._validationObject.valid=true;this._validationObject.dropAfter=true;clearTimeout(this._validationObject.expandTimeout);this._validationObject.expandTimeout=null;this._validationObject.target=null},_initDropOptions:function(){var self=this,opt={tolerance:"pointer",greedy:true,drop:function(event,ui){if(self._sourceNode.element===null&&self._sourceNode.owner===null){return false}return self._performDrop(event,ui)},accept:function(dropElem){return self._validationObject.valid}};return opt},_performDrop:function(event,ui){var self=this,parent,target=$(event.originalEvent.target),noCancel;if(target.is("div[data-role=insert-line]")){target=target.closest("li[data-role=node]")}self.element.find("div[data-role=insert-line]").remove();noCancel=self._triggerNodeDropping(event,ui,target.closest("li[data-role=node]"),target.next("li[data-role=node]").length>0||!self._validationObject.dropAfter?target.index()+(self._validationObject.dropAfter?1:0):target.index());if(noCancel){if(target.is("a")||target.closest("a").parent().is("li[data-role=node]")){target=target.closest("li[data-role=node]");switch(self.options.dragAndDropSettings.dragAndDropMode){case"move":self.addNode(self._sourceNode.data,target);self._sourceNode.owner.removeAt(self._sourceNode.element.attr("data-path"));break;case"copy":self.addNode(self._sourceNode.data,target);break;default:if(!event.ctrlKey){self.addNode(self._sourceNode.data,target);self._sourceNode.owner.removeAt(self._sourceNode.element.attr("data-path"))}else{self.addNode(self._sourceNode.data,target)}break}}else if(target.is("li")){parent=self.parentNode(target);switch(self.options.dragAndDropSettings.dragAndDropMode){case"move":self.addNode(self._sourceNode.data,parent,target.next("li[data-role=node]").length>0||!self._validationObject.dropAfter?target.index()+(self._validationObject.dropAfter?1:0):null);self._sourceNode.element.attr("data-path",self._sourceNode.element.attr("data-path")+"_remove");self._sourceNode.owner.removeAt(self._sourceNode.element.attr("data-path"));break;case"copy":self.addNode(self._sourceNode.data,parent,target.next("li[data-role=node]").length>0||!self._validationObject.dropAfter?target.index()+(self._validationObject.dropAfter?1:0):null);break;default:if(!event.ctrlKey){self.addNode(self._sourceNode.data,parent,target.next("li[data-role=node]").length>0||!self._validationObject.dropAfter?target.index()+(self._validationObject.dropAfter?1:0):null);self._sourceNode.element.attr("data-path",self._sourceNode.element.attr("data-path")+"_remove");self._sourceNode.owner.removeAt(self._sourceNode.element.attr("data-path"))}else{self.addNode(self._sourceNode.data,parent,target.next("li[data-role=node]").length>0||!self._validationObject.dropAfter?target.index()+(self._validationObject.dropAfter?1:0):null)}break}}else if(target.is(":ui-igTree")){switch(self.options.dragAndDropSettings.dragAndDropMode){case"move":self.addNode(self._sourceNode.data);self._sourceNode.owner.removeAt(self._sourceNode.element.attr("data-path"));break;case"copy":self.addNode(self._sourceNode.data);break;default:if(!event.ctrlKey){self.addNode(self._sourceNode.data);self._sourceNode.owner.removeAt(self._sourceNode.element.attr("data-path"))}else{self.addNode(self._sourceNode.data)}break}}self._triggerNodeDropped(event,ui,target)}else{return false}},_accept:function(dropElem,target){var valid=true,node=target.closest("li[data-role=node]"),dropPath=dropElem.attr("data-path"),tree=target.closest(".ui-widget.ui-igtree"),sourceBinding=this._retrieveCurrentDepthBinding(parseInt(this._sourceNode.element.closest("ul").attr("data-depth"),10)),destinationBinding;if(target.is("a")&&target.parent().is("li[data-role=node]")||target.closest("a").parent().is("li[data-role=node]")){destinationBinding=tree.data("igTree")._retrieveCurrentDepthBinding(parseInt(target.closest("ul").attr("data-depth"),10)+1)}else{if(target.is("li[data-role=node]")){destinationBinding=tree.data("igTree")._retrieveCurrentDepthBinding(parseInt(target.closest("ul").attr("data-depth"),10))}else if(target.is(":ui-igTree")){destinationBinding=tree.data("igTree")._retrieveCurrentDepthBinding(0)}else{destinationBinding=false}}if(node.length>0&&(node.attr("data-path")===dropPath||node.attr("data-path").indexOf(dropPath)===0)&&this===tree.data("igTree")){valid=false}else if(this!==tree.data("igTree")&&!tree.igTree("option","dragAndDropSettings").allowDrop){valid=false}else if(typeof tree.igTree("option","dragAndDropSettings").customDropValidation==="function"){valid=tree.igTree("option","dragAndDropSettings").customDropValidation.apply(target,[dropElem])}if(sourceBinding&&destinationBinding&&valid){valid=this._validateBindings(sourceBinding,destinationBinding)}return valid},_validateBindings:function(sourceBinding,destinationBinding){var valid=true;if(destinationBinding.hasOwnProperty("primaryKey")){if(!sourceBinding.hasOwnProperty("primaryKey")||sourceBinding.primaryKey!==destinationBinding.primaryKey){valid=false}}if(destinationBinding.textKey!==sourceBinding.textKey){valid=false}if(destinationBinding.hasOwnProperty("valueKey")&&sourceBinding.hasOwnProperty("valueKey")&&destinationBinding.valueKey!==sourceBinding.valueKey){valid=false}if(destinationBinding.hasOwnProperty("childDataProperty")&&sourceBinding.hasOwnProperty("childDataProperty")&&destinationBinding.childDataProperty!==sourceBinding.childDataProperty){valid=false}return valid},_initDragAndDrop:function(element){var dragOptions=this._initDragOptions(),dropOptions=this._initDropOptions();if(!this._insertLine.html){this._insertLine.html='<div data-role="insert-line" class="'+this.css.insertLine+'"></div>'}if(!element){this.element.find("li[data-role=node]").draggable(dragOptions);this.element.droppable(dropOptions);this.element.delegate("a","mousedown",function(event){$(this).focus()})}else{element.draggable(dragOptions);element.find("li[data-role=node]").draggable(dragOptions)}},_destroyDragAndDrop:function(){this.element.find("li[data-role=node]").draggable("destroy");this.element.droppable("destroy");this.element.undelegate("a","mousedown")},_constructFromData:function(){var ul,data=this.options.dataSource._rootds.data(),self=this;this._triggerDataBound(data);this._triggerRendering(data);this.element.attr("data-scroll",true);if(this.element.is("ul")){this.element.empty();ul=this.element;ul.addClass(this.css.treeCollection).addClass(this.css.treeRoot).attr("data-depth",0);MSApp.execUnsafeLocalFunction(function(){ul.html(self._initChildrenRecursively("",data))});this._triggerRendered()}else{this.element.empty();ul='<ul class="'+this.css.treeCollection+" "+this.css.treeRoot+'" data-depth="0">';ul+=this._initChildrenRecursively("",data);ul+="</ul>";MSApp.execUnsafeLocalFunction(function(){$(ul).appendTo(self.element)});this._triggerRendered()}if(this.options.dragAndDrop){this._initDragAndDrop();if(typeof this.options.dragAndDropSettings.customDropValidation==="string"){if(window[this.options.dragAndDropSettings.customDropValidation]&&typeof window[this.options.dragAndDropSettings.customDropValidation]==="function"){this.options.dragAndDropSettings.customDropValidation=window[this.options.dragAndDropSettings.customDropValidation]}}}},_attachEvents:function(){var self=this,css=this.css,noCancel,target;this.element.delegate("span[data-role=expander]","click",function(event){self.toggle($(event.target).closest("li[data-role=node]"),event)});if(this.options.hotTracking){this.element.delegate("a",{click:function(event){target=$(event.target).closest("a");noCancel=self._triggerNodeClick(event,target.parent());if(noCancel){self.select(target.parent(),event);if($.ig.util.isWebKit){target.focus()}}else{event.preventDefault()}},dblclick:function(event){event.preventDefault();self._triggerNodeDoubleClick(event,$(event.target.parentNode))},keydown:function(event){self._kbNavigation(event)},focus:function(event){self._focusNode(event)},blur:function(event){self._blurNode(event)},mouseover:function(event){target=$(event.target).closest("a");target.addClass(css.nodeHovered)},mouseout:function(event){target=$(event.target).closest("a");target.removeClass(css.nodeHovered)}})}else{this.element.delegate("a",{click:function(event){target=$(event.target).closest("a");noCancel=self._triggerNodeClick(event,target.parent());if(noCancel){self.select(target.parent(),event);if($.ig.util.isWebKit){target.focus()}}else{event.preventDefault()}},dblclick:function(event){event.preventDefault();self._triggerNodeDoubleClick(event,$(event.target.parentNode))},keydown:function(event){self._kbNavigation(event)},focus:function(event){self._focusNode(event)},blur:function(event){self._blurNode(event)}})}this.element.delegate("span[data-role=checkbox] > span",{click:function(event){self.toggleCheckstate($(event.target).closest("li[data-role=node]"),event)},mouseover:function(event){$(event.target).closest("span[data-role=checkbox]").addClass(css.nodeHovered)},mouseout:function(event){$(event.target).closest("span[data-role=checkbox]").removeClass(css.nodeHovered)}})},_initChildrenRecursively:function(path,data,depth,checkFlag,indexFeed){var childUl,opt=this.options,childPath,binding,value,display,liStr=[],i=0,li,children,tempPath;if(!indexFeed){indexFeed=0}if(!depth){depth=0}binding=this._retrieveCurrentDepthBinding(depth);if(!data.hasOwnProperty("length")&&data.hasOwnProperty(binding.textKey)){data=[data]}for(i;i<data.length;i++){childUl="";value="";if(path.length<=0){if(binding.hasOwnProperty("primaryKey")&&data[i].hasOwnProperty(binding.primaryKey)){childPath=typeof data[i][binding.primaryKey]==="function"?data[i][binding.primaryKey]():data[i][binding.primaryKey]}else{childPath=i+indexFeed}}else{if(binding.hasOwnProperty("primaryKey")&&data[i].hasOwnProperty(binding.primaryKey)){childPath=path+opt.pathSeparator+(typeof data[i][binding.primaryKey]==="function"?data[i][binding.primaryKey]():data[i][binding.primaryKey])}else{childPath=path+opt.pathSeparator+(i+indexFeed)}}if(binding.hasOwnProperty("valueKey")&&data[i].hasOwnProperty(binding.valueKey)){if(typeof data[i][binding.valueKey]==="function"){value=data[i][binding.valueKey]()}else{value=data[i][binding.valueKey]}}li='<li class="'+this._buildNodeCssString(data[i],depth,binding)+'" data-path="'+childPath+'" data-value="'+value+'" data-role="node">';children=data[i][binding.childDataProperty];if(typeof children==="function"){children=children()}if(children&&children.length>0||children&&opt.loadOnDemand){if(depth<=opt.initialExpandDepth&&!opt.loadOnDemand||binding.hasOwnProperty("expandedKey")&&data[i].hasOwnProperty(binding.expandedKey)&&data[i][binding.expandedKey]){li+=this._renderExpanderImage(true);display="block"}else{li+=this._renderExpanderImage(false);display="none"}}if(opt.checkboxMode&&opt.checkboxMode.toLowerCase()!=="off"){li+=this._renderCheckbox(checkFlag)}li+=this._renderNodeImage(data[i],binding);if(!binding.nodeContentTemplate){li+=this._renderAnchor(data[i],binding)}else{li+=this._renderNodeTemplate(data[i],binding)}if(children&&children.length>0||children&&opt.loadOnDemand){childUl='<ul style="display: '+display+'" data-depth="'+(depth+1)+'"';if(children.length>0&&!opt.loadOnDemand){childUl+=">"+this._initChildrenRecursively(childPath,children,depth+1,checkFlag)}else{childUl+=' data-populated="false">'}childUl+="</ul>"}li+=childUl;li+="</li>";liStr.push(li)}return liStr.join("")},_buildNodeCssString:function(data,depth,binding){var css=this.css,str=css.treeNode,children;if(depth===0){str+=" "+css.treeRootNode}children=data[binding.childDataProperty];if(typeof children==="function"){children=children()}if(children&&children.length>0||children&&this.options.loadOnDemand){str+=" "+css.parentNode}else{str+=" "+css.nodeNoChildren}return str},_retrieveCurrentDepthBinding:function(depth){var binding=this.options.bindings,i=0;for(i;i<depth;i++){if(binding.hasOwnProperty("bindings")){binding=binding.bindings}else{break}}return binding},_renderExpanderImage:function(expanded){var self=this,css=self.css,expander="";if(expanded){expander='<span data-role="expander" data-exp="true" class="'+css.collapseIcon+" "+css.nodeExpander+'"></span>'}else{expander='<span data-role="expander" data-exp="false" class="'+css.expandIcon+" "+css.nodeExpander+'"></span>'}return expander},_renderAnchor:function(data,binding){var href,target,text;if(binding.hasOwnProperty("navigateUrlKey")&&data[binding.navigateUrlKey]){if(typeof data[binding.navigateUrlKey]==="function"){href=data[binding.navigateUrlKey]()}else if(data[binding.navigateUrlKey].length<=0){href="#"}else{href=data[binding.navigateUrlKey]}}else{href="#"}if(binding.targetKey&&binding.targetKey.length>0&&data.hasOwnProperty(binding.targetKey)){target=data[binding.targetKey]}else{target=this.options.defaultNodeTarget}if(typeof data[binding.textKey]==="function"){text=data[binding.textKey]()}else{text=data[binding.textKey]}return'<a href="'+href+'" target="'+target+'">'+text+"</a>"},_renderNodeTemplate:function(data,binding){var div=$("<div></div>"),html,href,target,template=binding.nodeContentTemplate;if(binding.hasOwnProperty("navigateUrlKey")&&data[binding.navigateUrlKey]){if(typeof data[binding.navigateUrlKey]==="function"){href=data[binding.navigateUrlKey]()}else if(data[binding.navigateUrlKey].length<=0){href="#"}else{href=data[binding.navigateUrlKey]}}else{href="#"}if(binding.targetKey&&binding.targetKey.length>0&&data.hasOwnProperty(binding.targetKey)){target=data[binding.targetKey]}else{target=this.options.defaultNodeTarget}if(typeof $.ig.tmpl==="function"){div.html($.ig.tmpl(template,data));
if(div.children("a").length<=0){html='<a href="'+href+'" target="'+target+'">'+div.html()+"</a>"}else if(!div.children("a").attr("href")){div.children("a").attr({href:href,target:target});html=div.html()}else{html=div.html()}}else{$.tmpl(template,data).appendTo(div);if(div.children("a").length<=0){html='<a href="'+href+'" target="'+target+'">'+div.html()+"</a>"}else if(!div.children("a").attr("href")){div.children("a").attr({href:href,target:target});html=div.html()}else{html=div.html()}}return html},_renderCheckbox:function(checkFlag){var self=this,css=self.css;return'<span data-chk="'+(checkFlag?"on":"off")+'" data-role="checkbox" class="'+css.checkbox+'"><span class="'+(checkFlag?css.checkboxOn:css.checkboxOff)+'"></span></span>'},_renderNodeImage:function(data,binding){var opt=this.options,hasChildren,img="",src;hasChildren=data[binding.childDataProperty]&&data[binding.childDataProperty].length>0||data[binding.childDataProperty]&&opt.loadOnDemand;if(binding.hasOwnProperty("imageUrlKey")&&data.hasOwnProperty(binding.imageUrlKey)){if(typeof data[binding.imageUrlKey]==="function"){src=data[binding.imageUrlKey]();if(src&&src.length>0){img='<img src="'+src+'" alt="error" data-role="node-image" />'}}else if(data[binding.imageUrlKey].length>0){img='<img src="'+data[binding.imageUrlKey]+'" alt="error" data-role="node-image" />'}}if(opt.parentNodeImageUrl&&hasChildren){img+='<img src="'+opt.parentNodeImageUrl+'" alt="error" title="'+(opt.parentNodeImageTooltip!==null?opt.parentNodeImageTooltip:"")+'" data-role="parent-node-image" />'}else if(opt.parentNodeImageClass&&hasChildren){img+='<span title="'+(opt.parentNodeImageTooltip!==null?opt.parentNodeImageTooltip:"")+'" class="'+opt.parentNodeImageClass+'" data-role="parent-node-image"></span>'}else if(!hasChildren&&opt.leafNodeImageUrl){img+='<img src="'+opt.leafNodeImageUrl+'" alt="error" title="'+(opt.leafNodeImageTooltip!==null?opt.leafNodeImageTooltip:"")+'" data-role="leaf-node-image" />'}else if(!hasChildren&&opt.leafNodeImageClass){img+='<span title="'+(opt.leafNodeImageTooltip!==null?opt.leafNodeImageTooltip:"")+'" class="'+opt.leafNodeImageClass+'" data-role="leaf-node-image"></span>'}return img},_focusNode:function(event){$(event.target).addClass(this.css.nodeActive)},_blurNode:function(event){$(event.target).removeClass(this.css.nodeActive)},_kbNavigation:function(event){var opt=this.options,css=this.css,li=$(event.target.parentNode),nextLi,seq=li.index(),expander;if(event.keyCode===$.ui.keyCode.UP){nextLi=this._nextVisibleNodeUp(li);if(!nextLi){return}if(event.ctrlKey){li.children("a").blur();nextLi.children("a").focus()}else if(event.shiftKey&&opt.multipleSelection){opt=this.options}else{li.children("a").blur();nextLi.children("a").focus();this.select(nextLi,null)}event.preventDefault()}else if(event.keyCode===$.ui.keyCode.DOWN){nextLi=this._nextVisibleNodeDown(li,seq);if(!nextLi){return}if(event.ctrlKey){li.children("a").blur();nextLi.children("a").focus()}else if(event.shiftKey&&opt.multipleSelection){opt=this.options}else{li.children("a").blur();nextLi.children("a").focus();this.select(nextLi,null)}event.preventDefault()}else if(event.keyCode===$.ui.keyCode.RIGHT){if(li.children("ul").length>0){expander=li.children("."+css.nodeExpander);if(!expander.attr("data-exp")||expander.attr("data-exp")==="false"){this.toggle(li,null)}else{nextLi=li.find("ul > li:first");if(nextLi.length>0){if(event.ctrlKey){li.children("a").blur();nextLi.children("a").focus()}else if(event.shiftKey&&opt.multipleSelection){opt=this.options}else{li.children("a").blur();nextLi.children("a").focus();this.select(nextLi,null)}}}}}else if(event.keyCode===$.ui.keyCode.LEFT){expander=li.children("."+css.nodeExpander);if(expander.attr("data-exp")&&expander.attr("data-exp")!=="false"){this.toggle(li,null)}else if(li.parent().parent().is("li")){nextLi=li.parent().parent();if(event.ctrlKey){li.children("a").blur();nextLi.children("a").focus()}else if(event.shiftKey&&opt.multipleSelection){opt=this.options}else{li.children("a").blur();nextLi.children("a").focus();this.select(nextLi,null)}}}else if(event.keyCode===$.ui.keyCode.NUMPAD_ADD){if(li.children("ul").length>0){expander=li.children("."+css.nodeExpander);if(!expander.attr("data-exp")||expander.attr("data-exp")==="false"){this.toggle(li,null)}}}else if(event.keyCode===$.ui.keyCode.NUMPAD_SUBTRACT){if(li.children("ul").length>0){expander=li.children("."+css.nodeExpander);if(expander.attr("data-exp")&&expander.attr("data-exp")!=="false"){this.toggle(li,null)}}}else if(event.keyCode===$.ui.keyCode.SPACE){if(opt.checkboxMode&&opt.checkboxMode.toLowerCase()!=="off"){this.toggleCheckstate(li,null);event.preventDefault();event.stopPropagation()}}else if(event.keyCode===$.ui.keyCode.HOME){li.children("a").blur();li=this.element.find("li:first");if(li.length>0){li.children("a").focus();this.select(li)}event.preventDefault()}else if(event.keyCode===$.ui.keyCode.END){li.children("a").blur();li=this._lastVisibleNode();if(li){li.children("a").focus();this.select(li)}event.preventDefault()}},_nextVisibleNodeDown:function(node,nodeSeq){var expander=node.children("."+this.css.nodeExpander),parentLi,seq=nodeSeq,result=null;if(expander.length>0&&expander.attr("data-exp")&&expander.attr("data-exp")!=="false"&&node.children("ul").children("li:first").length>0){return node.children("ul").children("li:first")}if(seq===node.siblings().length){parentLi=node.parent().parent();while(parentLi.is("li")){seq=parentLi.index();if(seq!==parentLi.siblings().length){result=parentLi.next();break}parentLi=parentLi.parent().parent()}}else{result=node.next()}return result},_nextVisibleNodeUp:function(node){var li=node.prev(),expander,result=null;if(li.length<=0){if(node.parent().parent().is("li")){result=node.parent().parent()}}else{while(li.length>0){expander=li.children("."+this.css.nodeExpander);if(li.children("ul").children("li").length<=0||!expander.attr("data-exp")||expander.attr("data-exp")==="false"){result=li;break}li=li.children("ul").children("li:last")}}return result},_lastVisibleNode:function(){var li=this.element.is("ul")?this.element.children("li:last"):this.element.children("ul").children("li:last"),expander,result;if(li.length<=0){result=null}else{while(li.length>0){expander=li.children("."+this.css.nodeExpander);if(li.children("ul").children("li").length<=0||!expander.attr("data-exp")||expander.attr("data-exp")==="false"){result=li;break}li=li.children("ul").children("li:last")}}return result},_populatingNode:null,_populateNodeData:function(success,msg,data){if(!success){throw new Error($.ig.Tree.locale.errorOnRequest+msg)}var ul=this._populatingNode.ul,originalData=this.nodeDataFor(this._populatingNode.node.attr("data-path")),depth=ul.attr("data-depth"),binding=this._retrieveCurrentDepthBinding(depth-1),checked,newData=data.data();if(this.options.checkboxMode.toLowerCase()==="tristate"){checked=this.isChecked(this._populatingNode.node)}ul.children('li[data-role="loading"]').remove();if(!originalData[binding.childDataProperty]||!originalData[binding.childDataProperty].length){originalData[binding.childDataProperty]=newData}else{originalData[binding.childDataProperty]=originalData[binding.childDataProperty].concat(newData)}this._triggerNodePopulated(null,this._populatingNode.node);this._triggerRendering(newData);ul.append(this._initChildrenRecursively(this._populatingNode.node.attr("data-path"),newData,parseInt(ul.attr("data-depth"),10),checked));ul.attr("data-populated",true);if(this.options.dragAndDrop){this._initDragAndDrop(ul)}this._triggerRendered();this.toggle(this._populatingNode.node);this._populatingNode.indicator.hide();this._populatingNode.indicator.destroy();this._populatingNode=null;this._loadRequest()},_prepareRequest:function(node,event){var opt=this.options,pathKeyArr,path,key,data,binding,parentBinding,noCancel;if(this._populatingNode!==null){return}noCancel=this._triggerNodePopulating(event,node);if(noCancel){pathKeyArr=this._buildRequestString(node);binding=this._retrieveCurrentDepthBinding(parseInt(node.children("ul").attr("data-depth"),10));if(!pathKeyArr){return}path=pathKeyArr[0];key=pathKeyArr[1];data=this.nodeDataFor(node.attr("data-path"));parentBinding=this._retrieveCurrentDepthBinding(parseInt(node.children("ul").attr("data-depth"),10)-1);if(data.hasOwnProperty(parentBinding.childDataProperty)){data=data[parentBinding.childDataProperty]}if(data&&data.__deferred&&data.__deferred.uri){this._executeODataRequest(node,data)}else if(data&&data.length>0&&!opt.dataSourceUrl){this._renderOnDemand(node,data)}else{this._executeUrlRequest(node,binding,path,key)}}},_executeODataRequest:function(node,data){var dataSource,ul,indicator,opt=this.options,li;dataSource=new $.ig.JSONPDataSource({dataSource:data.__deferred.uri+"?$format=json&$callback=?",responseDataKey:opt.responseDataKey});ul=node.children("ul");li=$('<li style="width: 20px" data-role="loading">&nbsp;</li>').appendTo(ul);ul.show();indicator=li.igLoading({includeVerticalOffset:false}).data("igLoading").indicator();indicator.show();this._populatingNode={ul:ul,node:node,indicator:indicator};dataSource.dataBind(this._populateNodeData,this)},_renderOnDemand:function(node,data){var ul,checked;ul=node.children("ul");if(this.options.checkboxMode.toLowerCase()==="tristate"){checked=this.isChecked(node)}this._triggerNodePopulated(null,node);this._triggerRendering(data);ul.html(this._initChildrenRecursively(node.attr("data-path"),data,parseInt(ul.attr("data-depth"),10),checked));ul.attr("data-populated",true);if(this.options.dragAndDrop){this._initDragAndDrop(ul)}this._triggerRendered();this.toggle(node);this._loadRequest()},_executeUrlRequest:function(node,binding,path,key){var opt=this.options,ul,indicator,dataSource,li;if(opt.dataSourceUrl&&opt.dataSourceUrl.lastIndexOf("?")===-1){opt.dataSourceUrl+="?"}else if(!opt.dataSourceUrl){throw new Error($.ig.Tree.locale.noDataSourceUrl)}dataSource=new $.ig.DataSource({dataSource:opt.dataSourceUrl+"&"+this._encodeUrlPath(path,key)+"&"+this._encodeBinding(binding)+"&depth="+node.parent().attr("data-depth"),dataSourceType:"remoteUrl"});ul=node.children("ul");li=$('<li style="width: 20px" data-role="loading">&nbsp;</li>').appendTo(ul);ul.show();indicator=li.igLoading({includeVerticalOffset:false}).data("igLoading").indicator();indicator.show();this._populatingNode={ul:ul,node:node,indicator:indicator};dataSource.dataBind(this._populateNodeData,this)},_buildRequestString:function(node){var nodePath,key="",path="",binding=this.options.bindings,i,result;nodePath=node.attr("data-path").split(this.options.pathSeparator);for(i=0;i<nodePath.length;i++){if(key.length>0){key+="/"}key+=binding.childDataProperty;if(path.length>0){path+="/"}path+=(binding.primaryKey?binding.primaryKey+":":"")+nodePath[i];if(binding.bindings){binding=binding.bindings}}if(path.length<=0){result=null}else{result=[path,key]}return result},_encodeBinding:function(binding){var temp="binding=",item;for(item in binding){if(binding.hasOwnProperty(item)&&item!=="bindings"&&item!=="nodeContentTemplate"){temp+=item.toString()+":"+binding[item]+","}}temp=temp.substr(0,temp.length-1);return temp},_encodeUrlPath:function(path,key){var result;if(path.lastIndexOf("/")===-1){path+="/@"+key;result="path="+path}else{result="path="+path.substr(path.lastIndexOf("/")+1,path.length)+"/@"+key.substr(key.lastIndexOf("/")+1,key.length)}return result},_updateParentState:function(parent){var expander=parent.children("span[data-role=expander]"),self=this;if(expander.length<=0){parent.removeClass(this.css.nodeNoChildren).addClass(this.css.parentNode);$(this._renderExpanderImage(false)).prependTo(parent)}else if(parent.children("ul").children("li").length<=0){parent.removeClass(this.css.parentNode).addClass(this.css.nodeNoChildren);parent.children("ul").remove();expander.remove()}this._updateImage(parent)},_updateParentCheckbox:function(parent){var checkbox=parent.children("span[data-role=checkbox]"),checkIcon=checkbox.children("span"),checkState=checkbox.attr("data-chk"),shouldBe,checkCount=0,css=this.css;parent.children("ul").children("li").each(function(index,element){if($(element).children("span[data-role=checkbox]").attr("data-chk")==="on"){checkCount++}});if(checkCount===0){shouldBe="off"}else if(checkCount===parent.children("ul").children("li").length){shouldBe="on"}else{shouldBe="partial"}if(checkState!==shouldBe){checkbox.attr("data-chk",shouldBe);switch(shouldBe){case"off":checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxPartial).addClass(css.checkboxOff);break;case"partial":checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxOff).addClass(css.checkboxPartial);break;case"on":checkIcon.removeClass(css.checkboxPartial).removeClass(css.checkboxOff).addClass(css.checkboxOn);break;default:checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxPartial).addClass(css.checkboxOff)}parent=this.parentNode(parent);if(parent){this._updateParentCheckbox(parent)}}},_updateImage:function(parent){var hasChildren=parent.children("ul").children("li").length>0,opt=this.options,img;if(!hasChildren){if(opt.leafNodeImageUrl){img=parent.children("img[data-role=parent-node-image]");if(img.length>0){img.attr("title",opt.leafNodeImageTooltip!==null?opt.leafNodeImageTooltip:"");img.attr("src",opt.leafNodeImageUrl);img.attr("data-role","leaf-node-image")}}else if(opt.leafNodeImageClass){img=parent.children("span[data-role=parent-node-image]");if(img.length>0){img.attr("title",opt.leafNodeImageTooltip!==null?opt.leafNodeImageTooltip:"");img.removeClass(opt.parentNodeImageClass).addClass(opt.leafNodeImageClass);img.attr("data-role","leaf-node-image")}}}else{if(opt.parentNodeImageUrl){img=parent.children("img[data-role=leaf-node-image]");if(img.length>0){img.attr("title",opt.parentNodeImageTooltip!==null?opt.parentNodeImageTooltip:"");img.attr("src",opt.parentNodeImageUrl);img.attr("data-role","parent-node-image")}}else if(opt.parentNodeImageClass){img=parent.children("span[data-role=leaf-node-image]");if(img.length>0){img.attr("title",opt.parentNodeImageTooltip!==null?opt.parentNodeImageTooltip:"");img.removeClass(opt.leafNodeImageClass).addClass(opt.parentNodeImageClass);img.attr("data-role","parent-node-image")}}}},_addData:function(data,path,depth,dataIndex){var originalData=this.nodeDataFor(path),binding=this._retrieveCurrentDepthBinding(depth),temp,i;if(!binding.hasOwnProperty("primaryKey")){if(!originalData){if(this.options.dataSource._rootds._data.length<=this.element.find(".ui-igtree-noderoot").length||this.element.find(".ui-igtree-noderoot").length<=0){if(dataIndex===0){if($.type(data)==="array"){this.options.dataSource._rootds._data=data.concat(this.options.dataSource._rootds._data)}else{this.options.dataSource._rootds._data=[data].concat(this.options.dataSource._rootds._data)}}else if(!dataIndex){if($.type(data)==="array"){for(i=0;i<data.length;i++){this.options.dataSource._rootds._data.push(data[i])}}else{this.options.dataSource._rootds._data.push(data)}}else{this.options.dataSource._rootds._data.splice(dataIndex,0,data)}}}else{if(typeof originalData[binding.childDataProperty]!=="function"){if(!originalData.hasOwnProperty(binding.childDataProperty)||!originalData[binding.childDataProperty]||originalData[binding.childDataProperty].length===0){originalData[binding.childDataProperty]=[]}if(dataIndex===0){if($.type(data)==="array"){originalData[binding.childDataProperty]=data.concat(originalData[binding.childDataProperty])}else{originalData[binding.childDataProperty]=[data].concat(originalData[binding.childDataProperty])}}else if(!dataIndex){originalData[binding.childDataProperty]=originalData[binding.childDataProperty].concat(data)}else{temp=originalData[binding.childDataProperty].slice(0,dataIndex);temp=temp.concat(data);originalData[binding.childDataProperty]=temp.concat(originalData[binding.childDataProperty].slice(dataIndex))}}else{if(originalData[binding.childDataProperty]().length<=this.nodeByPath(path).children("ul").children("li").length){if(dataIndex===0){temp=$("<li></li>").appendTo(this.nodeByPath(path).children("ul"));originalData[binding.childDataProperty].unshift(data);temp.remove()}else if(!dataIndex){temp=$("<li></li>").appendTo(this.nodeByPath(path).children("ul"));originalData[binding.childDataProperty].push(data);temp.remove()}else{temp=$("<li></li>").appendTo(this.nodeByPath(path).children("ul"));originalData[binding.childDataProperty]().splice(dataIndex,0,data);temp.remove()}}}}}else{if(!originalData){if(this.options.dataSource._rootds._data.length<=this.element.find(".ui-igtree-noderoot").length||this.element.find(".ui-igtree-noderoot").length<=0){if($.type(data)==="array"){for(i=0;i<data.length;i++){this.options.dataSource._rootds._data.push(data[i])}}else{this.options.dataSource._rootds._data.push(data)}}}else{if(typeof originalData[binding.childDataProperty]!=="function"){if(!originalData.hasOwnProperty(binding.childDataProperty)||!originalData[binding.childDataProperty]||originalData[binding.childDataProperty].length===0){originalData[binding.childDataProperty]=[]}originalData[binding.childDataProperty]=originalData[binding.childDataProperty].concat(data)}else{if(originalData[binding.childDataProperty]().length<=this.nodeByPath(path).children("ul").children("li").length){temp=$("<li></li>").appendTo(this.nodeByPath(path).children("ul"));originalData[binding.childDataProperty].push(data);temp.remove()}}}}},_removeData:function(path){var splitPath=path.split(this.options.pathSeparator),data=this.options.dataSource._rootds.data(),i,j,binding=this.options.bindings,key;if(splitPath.length===1){if(!binding.hasOwnProperty("primaryKey")){data.splice(parseInt(splitPath[0],10),1)}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)){key=typeof data[j][binding.primaryKey]==="function"?data[j][binding.primaryKey]():data[j][binding.primaryKey];if(key.toString()===splitPath[0].toString()){data.splice(j,1);break}}}}return}for(i=0;i<splitPath.length-1;i++){if(!binding.hasOwnProperty("primaryKey")){data=data[parseInt(splitPath[i],10)]}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)){key=typeof data[j][binding.primaryKey]==="function"?data[j][binding.primaryKey]():data[j][binding.primaryKey];if(key.toString()===splitPath[i].toString()){data=data[j];break}}}}if(i<splitPath.length-2){if(data[binding.childDataProperty]&&typeof data[binding.childDataProperty]==="function"){data=data[binding.childDataProperty]()}else{data=data[binding.childDataProperty]}}if(binding.hasOwnProperty("bindings")&&i<splitPath.length-2){binding=binding.bindings}}if(data[binding.childDataProperty]&&typeof data[binding.childDataProperty]!=="function"){if(data[binding.childDataProperty]&&data[binding.childDataProperty].length<=1){delete data[binding.childDataProperty]}else{data=data[binding.childDataProperty];if(binding.hasOwnProperty("bindings")){binding=binding.bindings}if(!binding.hasOwnProperty("primaryKey")&&data.length){data.splice(parseInt(splitPath[splitPath.length-1],10),1)}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)&&data[j][binding.primaryKey].toString()===splitPath[i].toString()){data.splice(j,1);break}}}}}else{data=data[binding.childDataProperty]();if(binding.hasOwnProperty("bindings")){binding=binding.bindings}if(!binding.hasOwnProperty("primaryKey")&&data.length){data.splice(parseInt(splitPath[splitPath.length-1],10),1)}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)){key=typeof data[j][binding.primaryKey]==="function"?data[j][binding.primaryKey]():data[j][binding.primaryKey];if(key.toString()===splitPath[splitPath.length-1].toString()){data.splice(j,1);break}}}}}},_recalculatePaths:function(path){var splitPath=path.split(this.options.pathSeparator),index=path.length>0?splitPath[splitPath.length-1]:0,node,parentPath,newPath,ul,child;if(splitPath.length>1){splitPath.splice(splitPath.length-1,1);parentPath=splitPath.join(this.options.pathSeparator);node=this.nodeByPath(parentPath);for(index;index<node.children("ul").children("li").length;index++){newPath=parentPath+this.options.pathSeparator+index;child=$(node.children("ul").children("li")[index]);child.attr("data-path",newPath);if(child.children("ul").length>0&&child.children("ul").children("li").length>0){this._recalculatePaths(newPath+this.options.pathSeparator+"0")}}}else{ul=this.element.is("ul")?this.element:this.element.children("ul");for(index;index<ul.children("li").length;index++){child=$(ul.children("li")[index]);child.attr("data-path",index);if(child.children("ul").length>0&&child.children("ul").children("li").length>0){this._recalculatePaths(index+this.options.pathSeparator+"0")}}}},_loadQueue:null,_toSelect:false,_triggerChainRequest:function(path,toSelect){var list=path.split(this.options.pathSeparator),i,newPath="";if(this._loadQueue===null){this._loadQueue=[]}if(toSelect){this._toSelect=true}for(i=0;i<list.length;i++){newPath+=list[i];this._loadQueue.push(newPath);newPath+=this.options.pathSeparator}this._loadRequest()},_loadRequest:function(){var node;if(this._populatingNode===null){if(this._loadQueue&&this._loadQueue.length>0){node=this.nodeByPath(this._loadQueue.shift());if(this._loadQueue.length>0){this.expand(node)}else if(this._toSelect){this.select(node);this._toSelect=false}}}},_replaceUIValue:function(node,data,item){var element=node.element,binding=this._retrieveCurrentDepthBinding(parseInt(element.parent().attr("data-depth"),10)),value;switch(item){case binding.textKey:if(!binding.nodeContentTemplate){value=typeof data[item]==="function"?data[item]():data[item];element.children("a").text(value)}else{element.children("a").replaceWith(this._renderNodeTemplate(data,binding))}break;case binding.valueKey:value=typeof data[item]==="function"?data[item]():data[item];element.attr("data-value",value);break;case binding.navigateUrlKey:value=typeof data[item]==="function"?data[item]():data[item];element.children("a").attr("href",value);break;case binding.imageUrlKey:value=typeof data[item]==="function"?data[item]():data[item];element.children("img[data-role=node-image]").attr("src",value);break}},dataBind:function(){var dataOpt;dataOpt=this._initDataOptions();this._initDataSource(dataOpt);this._triggerDataBinding();this.options.dataSource.dataBind(this._constructFromData,this)},toggleCheckstate:function(node,event){var self=this,opt=self.options,css=self.css,childCheckboxes,childCheckIcons,checkbox,checkIcon,parentLi,noCancel;if(!node){throw new Error($.ig.Tree.locale.incorrectNodeObject)}if(!opt.checkboxMode||opt.checkboxMode.toLowerCase()==="off"){return}checkbox=node.children("span[data-role=checkbox]");checkIcon=checkbox.children("span");noCancel=self._triggerNodeCheckstateChanging(event,node);if(noCancel){if(opt.checkboxMode.toLowerCase()==="tristate"){if(checkbox.attr("data-chk")==="on"||checkbox.attr("data-chk")==="partial"){childCheckboxes=node.find("span[data-role=checkbox]");childCheckIcons=childCheckboxes.children("span");checkbox.attr("data-chk","off");checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxPartial).addClass(css.checkboxOff);childCheckboxes.attr("data-chk","off");childCheckIcons.removeClass(css.checkboxOn).removeClass(css.checkboxPartial).addClass(css.checkboxOff);parentLi=checkbox.parent().parent().parent();while(parentLi&&parentLi.is("li")){if(parentLi.find("ul > li > span[data-chk=on]").length<=0){checkbox=parentLi.children("span[data-role=checkbox]");checkIcon=checkbox.children("span");checkbox.attr("data-chk","off");checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxPartial).addClass(css.checkboxOff);parentLi=this.parentNode(parentLi)}else{checkbox=parentLi.children("span[data-role=checkbox]");checkIcon=checkbox.children("span");checkbox.attr("data-chk","partial");checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxOff).addClass(css.checkboxPartial);parentLi=this.parentNode(parentLi)}}}else{childCheckboxes=node.find("span[data-role=checkbox]");childCheckIcons=childCheckboxes.children("span");checkbox.attr("data-chk","on");checkIcon.removeClass(css.checkboxOff).removeClass(css.checkboxPartial).addClass(css.checkboxOn);childCheckboxes.attr("data-chk","on");childCheckIcons.removeClass(css.checkboxOff).removeClass(css.checkboxPartial).addClass(css.checkboxOn);parentLi=checkbox.parent().parent().parent();while(parentLi&&parentLi.is("li")){if(parentLi.find("ul > li > span[data-chk=on]").length===parentLi.find("ul > li").length){checkbox=parentLi.children("span[data-role=checkbox]");checkIcon=checkbox.children("span");checkbox.attr("data-chk","on");checkIcon.removeClass(css.checkboxOff).removeClass(css.checkboxPartial).addClass(css.checkboxOn);parentLi=this.parentNode(parentLi)}else{checkbox=parentLi.children("span[data-role=checkbox]");checkIcon=checkbox.children("span");checkbox.attr("data-chk","partial");checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxOff).addClass(css.checkboxPartial);parentLi=this.parentNode(parentLi)}}}}else{if(checkbox.attr("data-chk")==="on"||checkbox.attr("data-chk")==="partial"){checkbox.attr("data-chk","off");checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxPartial).addClass(css.checkboxOff)}else{checkbox.attr("data-chk","on");checkIcon.removeClass(css.checkboxOff).addClass(css.checkboxOn)}}self._triggerNodeCheckstateChanged(event,node)}},toggle:function(node,event){var self=this,opt=self.options,css=self.css,noCancel,sibling,siblingExpander,i=0,expander;if(!node){throw new Error($.ig.Tree.locale.incorrectNodeObject)}if(!event){expander=node.children("."+css.nodeExpander)}else{expander=$(event.target).closest("span[data-role=expander]")}if(node.children("ul").attr("data-populated")&&node.children("ul").attr("data-populated")==="false"){this._prepareRequest(node,event);return}if(expander.attr("data-exp")&&expander.attr("data-exp")!=="false"){noCancel=self._triggerNodeCollapsing(event,node);if(noCancel){$(node).children("ul").hide(opt.animationDuration,function(){self._triggerNodeCollapsed(event,node)});expander.removeClass(css.collapseIcon).addClass(css.expandIcon).attr("data-exp",false)}}else{noCancel=self._triggerNodeExpanding(event,node);if(noCancel){if(opt.singleBranchExpand){sibling=node.siblings();for(i;i<sibling.length;i++){siblingExpander=$(sibling[i]).children("."+css.nodeExpander);if(siblingExpander.length>0&&(siblingExpander.attr("data-exp")==="true"||siblingExpander.attr("data-exp")===true)){noCancel=self._triggerNodeCollapsing(event,$(sibling[i]));if(noCancel){$(sibling[i]).children("ul").hide(opt.animationDuration,$.proxy(this._triggerNodeCollapsed(event,$(sibling[i])),this));siblingExpander.removeClass(css.collapseIcon).addClass(css.expandIcon).attr("data-exp",false)}}}}node.children("ul").show(opt.animationDuration,function(){self._triggerNodeExpanded(event,node)});expander.removeClass(css.expandIcon).addClass(css.collapseIcon).attr("data-exp",true)}}},expandToNode:function(node,toSelect){var parentNode,cachedanimationDuration;if(node&&node.length>0){if(typeof node==="string"&&this.nodeByPath(node).length>0){node=this.nodeByPath(node)}if(typeof node==="string"&&this.options.loadOnDemand){this._triggerChainRequest(node,toSelect);return}if(toSelect){this.select(node)}parentNode=this.parentNode(node);cachedanimationDuration=this.options.animationDuration;this.options.animationDuration=0;while(parentNode){this.expand(parentNode);parentNode=this.parentNode(parentNode)}this.options.animationDuration=cachedanimationDuration}},expand:function(node){var self=this,opt=self.options,css=self.css,sibling,siblingExpander,i=0,expander;if(!node||node.length<=0){throw new Error($.ig.Tree.locale.incorrectNodeObject)}if(node.children("ul").attr("data-populated")&&node.children("ul").attr("data-populated")==="false"){this._prepareRequest(node);return}expander=node.children("."+css.nodeExpander);if(!expander.attr("data-exp")||expander.attr("data-exp")==="false"){if(opt.singleBranchExpand){sibling=node.siblings();for(i;i<sibling.length;i++){siblingExpander=$(sibling[i]).children("."+css.nodeExpander);if(siblingExpander.length>0&&(siblingExpander.attr("data-exp")==="true"||siblingExpander.attr("data-exp")===true)){$(sibling[i]).children("ul").hide(opt.animationDuration);siblingExpander.removeClass(css.collapseIcon).addClass(css.expandIcon).attr("data-exp",false)}}}node.children("ul").show(opt.animationDuration);expander.removeClass(css.expandIcon).addClass(css.collapseIcon).attr("data-exp",true)}},collapse:function(node){var self=this,opt=self.options,css=self.css,expander;if(!node||node.length<=0){throw new Error($.ig.Tree.locale.incorrectNodeObject)}expander=node.children("."+css.nodeExpander);if(expander.attr("data-exp")&&expander.attr("data-exp")!=="false"){$(node).children("ul").hide(opt.animationDuration);expander.removeClass(css.collapseIcon).addClass(css.expandIcon).attr("data-exp",false)}},parentNode:function(node){if(!node){throw new Error($.ig.Tree.locale.incorrectNodeObject)}var parent=node.parent().closest("li[data-role=node]");return parent.length>0?parent:null},nodeByPath:function(nodePath){return this.element.find('li[data-path="'+nodePath+'"]')},nodesByValue:function(value){return this.element.find('li[data-value="'+value+'"]')},checkedNodes:function(){var elements=this.element.find("span[data-chk=on]").parent(),i=0,collection=[];if(elements.length>0){for(i;i<elements.length;i++){collection.push(this.nodeFromElement($(elements[i])))}return collection}},uncheckedNodes:function(){var elements=this.element.find("span[data-chk=off]").parent(),i=0,collection=[];if(elements.length>0){for(i;i<elements.length;i++){collection.push(this.nodeFromElement($(elements[i])))}return collection}},partiallyCheckedNodes:function(){var elements=this.element.find("span[data-chk=partial]").parent(),i=0,collection=[];if(elements.length>0){for(i;i<elements.length;i++){collection.push(this.nodeFromElement($(elements[i])))}return collection}},select:function(node,event){if(!node||node.length<=0){throw new Error($.ig.Tree.locale.incorrectNodeObject)}var css=this.css,nodeId=node.attr("data-path"),noCancel,prevent=false;if(event&&(node.children("a").attr("href")==="#"||node.children("a").attr("href")===document.URLUnencoded+"#")){prevent=true}if(!this._selectedNode){this._selectedNode=[{path:null,element:null,data:null,binding:null}]}if(this._selectedNode[0].path!==null){if(this._selectedNode[0].path!==nodeId){noCancel=this._triggerSelectionChanging(event,node);if(noCancel){this._selectedNode[0].element.children("a").removeClass(css.nodeSelected);node.children("a").addClass(css.nodeSelected);this._selectedNode[0]=this.nodeFromElement(node);this._triggerSelectionChanged(event)}else if(event){prevent=true}}}else{noCancel=this._triggerSelectionChanging(event,node);if(noCancel){node.children("a").addClass(css.nodeSelected);this._selectedNode[0]=this.nodeFromElement(node);this._triggerSelectionChanged(event)}else if(event){prevent=true}}if(prevent){event.preventDefault()}},deselect:function(node){if(!node){throw new Error($.ig.Tree.locale.incorrectNodeObject)}var opt=this.options,css=this.css,nodeId=node.attr("data-path");if(!this._selectedNode){this._selectedNode=[{path:null,element:null,data:null,binding:null}]}if(opt.multipleSelection){opt=this.options}else{if(this._selectedNode[0].path!==null){if(this._selectedNode[0].path===nodeId){node.children("a").removeClass(css.nodeSelected);this._selectedNode[0].path=null;this._selectedNode[0].element=null;this._selectedNode[0].data=null;this._selectedNode[0].binding=null}}}},clearSelection:function(){var css=this.css,i=0;if(this._selectedNode&&this._selectedNode[0].path!==null){for(i;i<this._selectedNode.length;i++){this._selectedNode[i].element.children("a").removeClass(css.nodeSelected)}this._selectedNode=[{path:null,element:null,data:null,binding:null}]}},selectedNode:function(){if(!this._selectedNode){this._selectedNode=[{path:null,element:null,data:null,binding:null}]}return this._selectedNode[0]},findNodesByText:function(text,parent){var collection=[],nodes,self=this;
nodes=parent?parent.find('li > a:contains("'+text+'")'):this.element.find('li > a:contains("'+text+'")');nodes.each(function(index,element){collection.push(self.nodeFromElement($(this).closest("li[data-role=node]")))});return collection},findImmediateNodesByText:function(text,parent){var collection=[],nodes,self=this;nodes=parent?parent.children("ul").children("li").children('a:contains("'+text+'")'):this.element.is("ul")?this.element.children("li").children('a:contains("'+text+'")'):this.element.children("ul").children("li").children('a:contains("'+text+'")');nodes.each(function(index,element){collection.push(self.nodeFromElement($(this).closest("li[data-role=node]")))});return collection},nodeByIndex:function(index,parent){var node;if(!parent){if(this.element.is("ul")){node=this.element.children().eq(index)}else{node=this.element.children("ul").children().eq(index)}}else{node=parent.children("ul").children().eq(index)}return node},nodeFromElement:function(element){if(element.length>0){var nodeElement={path:element.attr("data-path"),element:element,data:this.nodeDataFor(element.attr("data-path")),binding:this._retrieveCurrentDepthBinding(element.parent().attr("data-depth"))};return nodeElement}},children:function(parent){var children=[],self=this,child,ul;if(parent&&parent.length>0){ul=parent.children("ul");if(ul.length>0){ul.children("li").each(function(index){child=$(this);children.push(self.nodeFromElement(child))})}return children}throw new Error($.ig.Tree.locale.incorrectNodeObject)},childrenByPath:function(path){var node=this.nodeByPath(path),children=[],self=this,child,ul;if(node.length>0){ul=node.children("ul");if(ul.length>0){ul.children("li").each(function(index){child=$(this);children.push(self.nodeFromElement(child))})}return children}throw new Error($.ig.Tree.locale.incorrectPath+path)},isSelected:function(node){if(!this._selectedNode){this._selectedNode=[{path:null,element:null,data:null,binding:null}]}if(node&&node.length>0){return this._selectedNode[0].path===node.attr("data-path")}throw new Error($.ig.Tree.locale.incorrectNodeObject)},isExpanded:function(node){if(node&&node.length>0){var expander=node.children("span[data-role=expander]");if(expander.length>0){return expander.attr("data-exp")==="true"}}else{throw new Error($.ig.Tree.locale.incorrectNodeObject)}},isChecked:function(node){if(node&&node.length>0){var checkbox=node.children("span[data-role=checkbox]");if(checkbox.length>0){return checkbox.attr("data-chk")==="on"}}else{throw new Error($.ig.Tree.locale.incorrectNodeObject)}},checkState:function(node){if(node&&node.length>0){var checkbox=node.children("span[data-role=checkbox]");if(checkbox.length>0){return checkbox.attr("data-chk")}}else{throw new Error($.ig.Tree.locale.incorrectNodeObject)}},addNode:function(node,parent,nodeIndex){if(!node||node.length<=0){return}if(!nodeIndex&&typeof parent==="number"){nodeIndex=parent;parent=null}var ul,path,checked,isLi,li,isEmpty,r,binding,self=this;if(!parent){parent=this.element.is("ul")?this.element:this.element.children("ul");if(parent.children().length<=0){this._addData(node,"",0);this._triggerRendering(node);r=$(this._initChildrenRecursively("",node)).appendTo(parent);if(this.options.dragAndDrop){this._initDragAndDrop(r)}this._triggerRendered();this.options.dataSource.root().addNode({data:node,parentPath:"",path:r.attr("data-path")});return}}isLi=parent.is("li");ul=isLi?parent.children("ul"):parent;if(ul.length<=0){ul=$('<ul data-depth="'+(parseInt(parent.parent().attr("data-depth"),10)+1)+'" style="display: none"></ul>').appendTo(parent)}path=isLi?parent.attr("data-path"):"";binding=this._retrieveCurrentDepthBinding(parseInt(ul.attr("data-depth"),10));if(this.options.checkboxMode.toLowerCase()==="tristate"){checked=isLi?this.isChecked(parent):false}this._addData(node,path,parseInt(ul.attr("data-depth"),10)-1,nodeIndex);this._triggerRendering(node);isEmpty=ul.children("li").length<=0;if(nodeIndex===0){MSApp.execUnsafeLocalFunction(function(){li=$(self._initChildrenRecursively(path,node,parseInt(ul.attr("data-depth"),10),checked,ul.children("li").length)).prependTo(ul)});if(!binding.hasOwnProperty("primaryKey")){this._recalculatePaths(path)}}else if(!nodeIndex){MSApp.execUnsafeLocalFunction(function(){li=$(self._initChildrenRecursively(path,node,parseInt(ul.attr("data-depth"),10),checked,ul.children("li").length)).appendTo(ul)})}else{MSApp.execUnsafeLocalFunction(function(){li=$(self._initChildrenRecursively(path,node,parseInt(ul.attr("data-depth"),10),checked,ul.children("li").length)).insertBefore(ul.children("li:eq("+nodeIndex+")"))});if(!binding.hasOwnProperty("primaryKey")){this._recalculatePaths(path)}}if(isLi&&isEmpty){this._updateParentState(parent)}if(this.options.dragAndDrop){this._initDragAndDrop(li)}this._triggerRendered();r=[];li.each(function(index,value){r.push($(value).attr("data-path"))});this.options.dataSource.root().addNode({data:node,parentPath:path,path:r});this._trigger("nodeAdded",null,{owner:this,element:li,data:node,index:nodeIndex,binding:binding})},removeAt:function(path){var node=this.nodeByPath(path),depth=parseInt(node.parent().attr("data-depth"),10),binding,parent=this.parentNode(node),data;if(node.length<=0){return}if(path.indexOf("_remove")!==-1){path=path.replace("_remove","")}binding=this._retrieveCurrentDepthBinding(depth);data={data:$.extend(false,{},this.nodeDataFor(path)),path:path};this._removeData(path,binding);node.remove();if(!binding.hasOwnProperty("primaryKey")){this._recalculatePaths(path)}if(parent&&parent.children("ul").children("li").length<=0){this._updateParentState(parent)}if(this.options.checkboxMode.toLowerCase()==="tristate"&&parent){this._updateParentCheckbox(parent)}this.options.dataSource.root().removeNode(data);this._trigger("nodeDeleted",null,{owner:this,data:data.data,path:path})},removeNodesByValue:function(value){var nodes=this.nodesByValue(value),self=this;nodes.each(function(index,value){self.removeAt($(value).attr("data-path"))})},applyChangesToNode:function(element,data){var node=this.nodeFromElement(element),item;for(item in node.data){if(node.data.hasOwnProperty(item)){this._replaceUIValue(node,data,item)}}},transactionLog:function(){return this.options.dataSource.root()._transactionLog},_triggerSelectionChanging:function(event,node){var args={owner:this,selectedNodes:this._selectedNode,newNodes:[this._constructNodeObject(node)]};return this._trigger(this.events.selectionChanging,event,args)},_triggerSelectionChanged:function(event){var args={owner:this,selectedNodes:this._selectedNode,newNodes:this._selectedNode};this._trigger(this.events.selectionChanged,event,args)},_triggerNodeCollapsing:function(event,node){var args={owner:this,node:this._constructNodeObject(node)};return this._trigger(this.events.nodeCollapsing,event,args)},_triggerNodeCollapsed:function(event,node){var args={owner:this,node:this._constructNodeObject(node)};this._trigger(this.events.nodeCollapsed,event,args)},_triggerNodeExpanding:function(event,node){var args={owner:this,node:this._constructNodeObject(node)};return this._trigger(this.events.nodeExpanding,event,args)},_triggerNodeExpanded:function(event,node){var args={owner:this,node:this._constructNodeObject(node)};this._trigger(this.events.nodeExpanded,event,args)},_triggerNodePopulating:function(event,node){var args=this._constructNodeObject(node);return this._trigger(this.events.nodePopulating,event,args)},_triggerNodePopulated:function(event,node){var args=this._constructNodeObject(node);this._trigger(this.events.nodePopulated,event,args)},_triggerNodeCheckstateChanging:function(event,node){var state=node.children("span[data-role=checkbox]").attr("data-chk"),args={owner:this,node:this._constructNodeObject(node),currentState:state,newState:state==="off"?"on":"off",currentCheckedNodes:this.checkedNodes()};return this._trigger(this.events.nodeCheckstateChanging,event,args)},_triggerNodeCheckstateChanged:function(event,node){var state=node.children("span[data-role=checkbox]").attr("data-chk"),args={owner:this,node:this._constructNodeObject(node),newState:state,newCheckedNodes:this.checkedNodes(),newPartiallyCheckedNodes:this.partiallyCheckedNodes()};return this._trigger(this.events.nodeCheckstateChanged,event,args)},_triggerNodeClick:function(event,node){var args={owner:this,node:this._constructNodeObject(node)};return this._trigger(this.events.nodeClick,event,args)},_triggerNodeDoubleClick:function(event,node){var args=this._constructNodeObject(node);return this._trigger(this.events.nodeDoubleClick,event,args)},_triggerDataBinding:function(){var args={owner:this};this._trigger(this.events.dataBinding,null,args)},_triggerDataBound:function(dataView){var args={owner:this,dataView:dataView};this._trigger(this.events.dataBound,null,args)},_triggerRendering:function(dataView){var args={owner:this,dataView:dataView};this._trigger(this.events.rendering,null,args)},_triggerRendered:function(){var args={owner:this};this._trigger(this.events.rendered,null,args)},_triggerDragStart:function(event,ui,node){var obj=this._constructNodeObject(node),args=$.extend(false,obj,ui);return this._trigger(this.events.dragStart,event,args)},_triggerDrag:function(event,ui,node){var obj=this._constructNodeObject(node),args=$.extend(false,obj,ui);return this._trigger(this.events.drag,event,args)},_triggerDragStop:function(event,ui){this._trigger(this.events.dragStop,event,ui)},_triggerNodeDropping:function(event,ui,node,targetIndex){var obj=this._constructNodeObject(node),args,indexDecrement;obj.targetIndex=targetIndex;obj.originalIndex=ui.draggable.index();indexDecrement=this._sourceNode.element.parent().attr("data-depth")===node.parent().attr("data-depth")&&obj.targetIndex>obj.originalIndex?-1:0;obj.targetIndex+=indexDecrement;args=$.extend(false,obj,ui);return this._trigger(this.events.nodeDropping,event,args)},_triggerNodeDropped:function(event,ui,node){var obj=this._constructNodeObject(node),args=$.extend(false,obj,ui);this._trigger(this.events.nodeDropped,event,args)},_constructNodeObject:function(node){var nodeData=this.nodeDataFor(node!==null?node.attr("data-path"):null),nodeObject={path:node!==null?node.attr("data-path"):null,element:node!==null?node:null,data:nodeData,binding:node!==null?this._retrieveCurrentDepthBinding(parseInt(node.parent().attr("data-depth"),10)):null};return nodeObject},nodeDataFor:function(path){if(!path){return}var splitPath=path.split(this.options.pathSeparator),data=this.options.dataSource._rootds.data(),i,j,binding=this.options.bindings,temp;for(i=0;i<splitPath.length-1;i++){if(!binding.hasOwnProperty("primaryKey")){if(typeof data[parseInt(splitPath[i],10)][binding.childDataProperty]==="function"){data=data[parseInt(splitPath[i],10)][binding.childDataProperty]()}else{data=data[parseInt(splitPath[i],10)][binding.childDataProperty]}}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)){temp=typeof data[j][binding.primaryKey]==="function"?data[j][binding.primaryKey]():data[j][binding.primaryKey];if(temp.toString()===splitPath[i].toString()){data=typeof data[j][binding.childDataProperty]==="function"?data[j][binding.childDataProperty]():data[j][binding.childDataProperty];break}}}}if(binding.hasOwnProperty("bindings")){binding=binding.bindings}}if(!binding.hasOwnProperty("primaryKey")&&data.length){data=data[parseInt(splitPath[splitPath.length-1],10)]}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)){temp=typeof data[j][binding.primaryKey]==="function"?data[j][binding.primaryKey]():data[j][binding.primaryKey];if(temp.toString()===splitPath[i].toString()){data=data[j];break}}}}if(typeof data==="function"){data=data()}return data},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);this.element.undelegate();this.element.removeClass(this.css.tree);this.element.removeClass(this.css.treeCollection);this.element.removeClass(this.css.treeRoot);if(this.options.width){this.element.css("width","")}if(this.options.height){this.element.css("height","")}if(this.options.dragAndDrop){this._destroyDragAndDrop()}this.element.removeAttr("data-depth");this.element.removeAttr("data-scroll");this.element.empty();return this}});$.extend($.ui.igTree,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on: 
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){var _hovTR,_aNull=function(val){return val===null||val===undefined};$.widget("ui.igGrid",{css:{baseClass:"ui-widget ui-helper-clearfix ui-corner-all",baseContentClass:"ui-widget-content",gridClasses:"ui-iggrid",recordClass:"ui-ig-record ui-iggrid-record",recordAltClass:"ui-ig-altrecord ui-iggrid-altrecord",headerClass:"ui-iggrid-header ui-widget-header",headerTextClass:"ui-iggrid-headertext",baseHeaderClass:"ui-widget-header",gridTableClass:"ui-iggrid-table ui-widget-content",gridHeaderTableClass:"ui-iggrid-headertable",gridFooterTableClass:"ui-iggrid-footertable ui-widget-footer",gridFooterClass:"",gridCaptionTableClass:"ui-iggrid-captiontable",gridHeaderCaptionClass:"ui-iggrid-headercaption ui-widget-header ui-corner-top",gridTableBodyClass:"ui-iggrid-tablebody",gridScrollDivClass:"ui-iggrid-scrolldiv ui-widget-content",gridFooterCaptionClass:"ui-iggrid-footercaption",deletedRecord:"ui-iggrid-deletedrecord",modifiedRecord:"ui-iggrid-modifiedrecord",rtl:"ui-iggrid-rtl"},options:{width:null,height:null,autoAdjustHeight:true,avgRowHeight:25,avgColumnWidth:null,defaultColumnWidth:null,autoGenerateColumns:true,virtualization:false,virtualizationMode:"fixed",requiresDataBinding:true,rowVirtualization:false,columnVirtualization:false,virtualizationMouseWheelStep:null,adjustVirtualHeights:false,rowTemplate:null,jQueryTemplating:false,columns:[{headerText:null,key:null,formatter:null,format:null,dataType:"string",width:null,hidden:false,template:null,unbound:false,group:[],rowspan:0,formula:null,unboundValues:null}],dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseTotalRecCountKey:null,requestType:"GET",responseContentType:"application/json; charset=utf-8",showHeader:true,showFooter:true,fixedHeaders:true,fixedFooters:true,caption:null,features:[{}],tabIndex:0,accessibilityRendering:false,localSchemaTransform:true,primaryKey:null,serializeTransactionLog:true,autoCommit:false,aggregateTransactions:false,autoFormat:"date",renderCheckboxes:false,updateUrl:null,restSettings:{create:{url:null,template:null,batch:false},update:{url:null,template:null,batch:false},remove:{url:null,template:null,batch:false},encodeRemoveInRequestUri:true,contentSerializer:null,contentType:"application/json; charset=utf-8"},alternateRowStyles:true,autofitLastColumn:true,enableHoverStyles:true,enableUTCDates:false,mergeUnboundColumns:false,jsonpRequest:false,enableResizeContainerCheck:true},events:{cellClick:"cellClick",dataBinding:"dataBinding",dataBound:"dataBound",rendering:"rendering",rendered:"rendered",dataRendering:"dataRendering",dataRendered:"dataRendered",headerRendering:"headerRendering",headerRendered:"headerRendered",footerRendering:"footerRendering",footerRendered:"footerRendered",headerCellRendered:"headerCellRendered",rowsRendering:"rowsRendering",rowsRendered:"rowsRendered",schemaGenerated:"schemaGenerated",columnsCollectionModified:"columnsCollectionModified",requestError:"requestError",created:"igcontrolcreated",destroyed:"igcontroldestroyed"},resizeTimeout:300,speedupDOMCleanup:false,cloneChildElements:false,widget:function(){return this.element},_createWidget:function(options,element){this.options.columns=null;this.options.features=null;if(options.dataSource&&($.type(options.dataSource)==="array"||$.type(options.dataSource)==="object")){this.tmpDataSource=options.dataSource;options.dataSource=null;this._originalOptions=options}$.Widget.prototype._createWidget.apply(this,arguments)},_setOption:function(key,value){var header,isScrolling,hasWidthInPercent=this._gridHasWidthInPercent(),caption,width,containerWidth,id;if(value===this.options[key]){return}isScrolling=this.options.height!==null||this.options.width!==null;$.Widget.prototype._setOption.apply(this,arguments);if(key==="virtualization"||key==="autoGenerateColumns"||key==="accessibilityRendering"||key==="rowVirtualization"||key==="columnVirtualization"||key==="fixedHeaders"||key==="scrollbars"){throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+key)}if(key==="width"){if(isScrolling===true){this.container().css("width",value);this.element.css("width",value);if(this.options.fixedHeaders){this.headersTable().css("width",value)}if(!this._allColumnWidthsInPercentage||!hasWidthInPercent){if(this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true){containerWidth=this._calculateContainerWidth(false);id=this.id();if(value&&value.indexOf&&value.indexOf("%")!==-1){}else{width=parseInt(value,10)}this.container().find("#"+id+"_headers_v").css("width",width).css("max-width",width);this.element.css("width",width-this._scrollbarWidth());this._vdisplaycontainer().css("width",width-this._scrollbarWidth()).css("max-width",width-this._scrollbarWidth());this._virtualcontainer().css("width",width).css("max-width",width);this._virtualcontainer().find("> colgroup > col").first().attr("width",width-this._scrollbarWidth());this.container().find("#"+id+"_footer_container").css("width",width).css("max-width",width);this.container().find("#"+id+"_footers").css("width",width).css("max-width",width);this._gridInnerWidth=this._vdisplaycontainer().width()+this._scrollbarWidth()}else{this._gridInnerWidth=this.scrollContainer().width()}}if(this.options.width!==null&&this.options.height!==null){this._updateGridContentWidth()}}else{throw new Error($.ig.Grid.locale.optionChangeNotScrollingGrid+" "+key)}}else if(key==="height"){if(isScrolling===true){this.scrollContainer().css("overflow-y","auto");if(this.options.autoAdjustHeight){this.container().css("height",value);this._virtualHeightReset=true;this._initializeHeights()}else{this.scrollContainer().css("height",value)}if(this.options.virtualization||this.options.rowVirtualization||this.options.columnVirtualization){if(this.options.virtualizationMode==="fixed"){this._buildVirtualDom();this.virtualScrollTo(this._startRowIndex)}}}else{throw new Error($.ig.Grid.locale.optionChangeNotScrollingGrid+" "+key)}}else if(key==="dataSource"){this.options.dataSource=value;this.dataBind()}else if(key==="showHeader"){header=this.headersTable();if(header.length>0&&header.is("table")){if(value===true){header.show()}else{header.hide()}}else{header=this.element.find("thead tr");if(value===true){header.show()}else{header.hide()}}}else if(key==="caption"){caption=this._caption();if(caption.length===0){this._renderCaption();if(this.options.autoAdjustHeight){this._initializeHeights()}}else{caption.text(value)}}else if(key==="rowTemplate"){this.setRowTemplate(value,false)}},_initialized:false,_headersInitialized:false,_footerInitialized:false,_create:function(){var grid=this,i,container,attr,isVisible=this.element.is(":visible");this._isHierarchicalGrid=false;this._hasUnboundColumns=false;if(this.options._isHierarchicalGrid===true){this._isHierarchicalGrid=true}if(this.cloneChildElements&&this.element.is("table")&&this.element.children().length>0){this._initialChildren=this.element.children().clone(true)}this._initialAttributes=[];attr=this.element[0].attributes;for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){this._initialAttributes.push({name:attr[i].name,value:attr[i].value})}}this._rtl=this.element.css("direction")==="rtl";this._padding=this._rtl?"padding-left":"padding-right";this._tmap=null;if(this.tmpDataSource!==null&&this.tmpDataSource!==undefined){this.options.dataSource=this.tmpDataSource;this._originalOptions.dataSource=this.tmpDataSource}this._testInnerHtml();this._headerInitCallbacks=[];this._footerInitCallbacks=[];this._firstBind=true;this._hasOptionsRowTemplate=grid.options.rowTemplate!==null&&grid.options.rowTemplate!==undefined;this._isMultiColumnGrid=false;this._unboundValues={};if(!this.options.columns){this.options.columns=[]}if(!this.options.features){this.options.features=[]}if(this._isMultiColumnHeader()===true){this._isMultiColumnGrid=true;this._generateColumnFlatStructure(this.options.columns);this._headerCells=[]}if(this.options.rowVirtualization===true&&this.options.virtualizationMode==="continuous"){this.options.virtualization=true}if(this.options.columnVirtualization===true){this.options.virtualization=true;if(this.options.virtualizationMode==="continuous"){throw new Error($.ig.Grid.locale.colVirtualizationDenied)}this.options.virtualizationMode="fixed"}if(this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true){if(this.options.virtualizationMode===undefined||this.options.virtualizationMode===""){this.options.virtualizationMode="fixed"}if(this.options.virtualizationMode==="fixed"){this.options.fixedHeaders=true;this.options.fixedFooters=true}}if(this.options.virtualization===true&&this.options.virtualizationMode==="continuous"){this.options.fixedHeaders=true}if((this.options.height===null||parseInt(this.options.height,10)<=0)&&this.options.fixedHeaders===true){this.options.fixedHeaders=false}if((this.options.height===null||parseInt(this.options.height,10)<=0)&&this.options.fixedFooters===true){this.options.fixedFooters=false}this.dataBind(true);this._cellClickHandler=function(event){var $et=$(event.target),row=$et.closest("tr"),key=row.attr("data-id"),colKey,currGrid,colIndex=$et.closest("td").index(),dataColIndex=colIndex-row.children("td.ui-iggrid-expandcolumn,th,td[data-skip]").length;if(grid.element.closest(".ui-iggrid-root").data("igGrid")){currGrid=$et.closest(".ui-iggrid-table").data("igGrid");if(currGrid&&grid.id()!==currGrid.id()){return}}if(key===""||key===null||key===undefined){key=row.index()}if(dataColIndex>=0&&dataColIndex<grid._visibleColumns().length){colKey=grid._visibleColumns()[dataColIndex].key}if(!$et.closest("tr").parent().is("thead")&&($et.is("td")||$et.closest("td").length===1&&$et.closest("td").parent().attr("data-container")!=="true")){key=grid._fixPKValue(key);grid._trigger(grid.events.cellClick,event,{rowIndex:row.index(),rowKey:key,colIndex:colIndex,colKey:colKey,cellElement:$et.closest("td")[0],owner:grid})}};this.element.bind({click:this._cellClickHandler});if(this.options.enableResizeContainerCheck&&(this.options.height!==null&&this.options.height.indexOf&&this.options.height.indexOf("%")!==-1||this.options.width!==null&&this.options.width.indexOf&&this.options.width.indexOf("%")!==-1||!isVisible)){if(!isVisible){this._recheckVisibility=true}if($.ig.util.isIE&&$.ig.util.browserVersion<=10){container=this.container();if(container.length>0&&container[0].attachEvent){this._resizeContainerHandler=$.proxy(this.resizeContainer,this);container[0].attachEvent("onresize",this._resizeContainerHandler)}}if(!this._resizeContainerHandler){this._resId=setInterval($.proxy(this.resizeContainer,this),this.resizeTimeout)}}for(i=0;i<this.options.columns.length;i++){if(this.options.columns[i].hidden===undefined){this.options.columns[i].hidden=false}}this._uiSoftDirtyHandler=$.proxy(this._onFeaturesSoftDirty,this);this.element.bind("iggriduisoftdirty",this._uiSoftDirtyHandler);this._oldScrollTop=0;this.element.trigger(this.events.created,{owner:this});if(this._rtl){this.container().addClass(this.css.rtl)}},_fixPKValue:function(val){var col,data,pk=this.options.primaryKey;if(pk){col=this.columnByKey(pk);if(col&&col.dataType){if(col.dataType==="number"||col.dataType==="numeric"){val=parseInt(val,10)}}else{data=this.dataSource._data;if(data&&data.length>0){if(typeof data[0][pk]==="number"){val=parseInt(val,10)}}}}return val},hasFixedColumns:function(){if(this._fixedColumns!==null&&this._fixedColumns!==undefined&&this._fixedColumns.length>0){return true}return false},isFixedColumn:function(colKey){var isFixed=false,typeColKey=$.type(colKey),cols;if(!this.hasFixedColumns()){return false}if(typeColKey==="string"){$.each(this._fixedColumns,function(ind,c){if(c.key===colKey){isFixed=true;return false}})}else if(typeColKey==="number"){cols=this._visibleColumns();if(colKey<0||colKey>=cols.length){return false}isFixed=cols[colKey].fixed===true}return isFixed},_onColumnFixed:function(colInd,isFixed){this._fireInternalEvent("_columnFixed",{colInd:colInd,isFixed:isFixed})},_onGroupedColumnsChanging:function(groupedColumns){this._fireInternalEvent("_groupedColumnsChanging",{groupedColumns:groupedColumns})},_onGroupedColumnsChanged:function(groupedColumns){this._fireInternalEvent("_groupedColumnsChanged",{groupedColumns:groupedColumns})},_testInnerHtml:function(){var t=document.createElement("table");try{t.innerHTML="<tr><td> t </td></tr>";this._canreplaceinner=true}catch(e){this._canreplaceinner=false}},resizeContainer:function(){var scrollContainerWidth,o=this.options,visibilityChanged=false,v=o.virtualization===true||o.rowVirtualization===true||o.columnVirtualization===true;if(this._recheckVisibility&&this.element.is(":visible")){this._prevContainerHeight=0;visibilityChanged=true;this._recheckVisibility=false;if(this._resId&&!(this.options.height!==null&&this.options.height.indexOf&&this.options.height.indexOf("%")!==-1||this.options.width!==null&&this.options.width.indexOf&&this.options.width.indexOf("%")!==-1)){clearInterval(this._resId)}}if(o.autoAdjustHeight&&this.container().height()!==this._prevContainerHeight){this._initializeHeights();if(v&&visibilityChanged){this._avgRowHeight=null;this._updateVirtualScrollContainer();this._onVirtualVerticalScroll()}}if(o.width!==null&&o.height!==null){if(v===false){scrollContainerWidth=this.scrollContainer().width()}else{scrollContainerWidth=this._vdisplaycontainer().width()+this._scrollbarWidth()}if(this._gridInnerWidth!==scrollContainerWidth&&(this._gridInnerWidth>0||scrollContainerWidth>0)){this._gridInnerWidth=scrollContainerWidth;this._updateHScrollbarVisibility()}if(v===false&&this.scrollContainer().get(0).scrollHeight>this.scrollContainer().get(0).clientHeight!==this._hasVerticalScrollbar){this._adjustLastColumnWidth()}}},_isMultiColumnHeader:function(){var cols=this.options.columns,i;for(i=0;i<cols.length;i++){if(cols[i].group!==undefined&&cols[i].group!==null){return true}}return false},_analyzeMultiColumnHeaders:function(cols,newCols,level,oldCols,children,isHidden){var i,j,res,colsLength=cols.length,colspan=0,ind=[],groupChildren=[],identifier,hidden;for(i=0;i<colsLength;i++){if(cols[i].group!==undefined&&cols[i].group!==null){if(cols[i].key!==undefined&&cols[i].key!==null){identifier=cols[i].key.toString()}else{identifier=(this._multiColumnIdentifier++).toString()}if(!cols[i].identifier){cols[i].identifier=identifier}groupChildren=[];hidden=false;if(isHidden===true||cols[i].hidden===true){hidden=true}res=this._analyzeMultiColumnHeaders(cols[i].group,newCols,level+1,oldCols[i].group,groupChildren,hidden);oldCols[i].colspan=res.colspan;oldCols[i].children=groupChildren;for(j=0;j<groupChildren.length;j++){children.push(groupChildren[j])}ind.push(i);colspan+=res.colspan}else{colspan++;oldCols[i].level=0;oldCols[i].level0=true;if(isHidden===true){cols[i].hidden=true}children.push(cols[i]);newCols.push(cols[i])}}for(j=0;j<ind.length;j++){oldCols[ind[j]].level=this._maxLevel-level}return{colspan:colspan}},_getMultiHeaderColumnById:function(id,level,cols){var i,colsLength,res=null;if(cols===null||cols===undefined){if(this._oldCols===null||this._oldCols===undefined){return null}cols=this._oldCols}colsLength=cols.length;for(i=0;i<colsLength;i++){if(cols[i].identifier===id&&(level===undefined||cols[i].level===level)){return cols[i]}if(cols[i].group!==null&&cols[i].group!==undefined){res=this._getMultiHeaderColumnById(id,level,cols[i].group);if(res!==null){return res}}}return null},_getMaxLevelRecursive:function(level,cols){var i,colsLength=cols.length,ml=level,l,rowspan;for(i=0;i<colsLength;i++){rowspan=1;if(cols[i].rowspan!==null&&cols[i].rowspan!==undefined&&cols[i].rowspan>0){rowspan=cols[i].rowspan}if(cols[i].group!==undefined&&cols[i].group!==null){l=this._getMaxLevelRecursive(level+rowspan,cols[i].group);if(l>ml){ml=l}}else if(rowspan>0){l=level+rowspan-1;if(l>ml){ml=l}}}return ml},_headerInit:function(tr,colgroup,prepend){var i;for(i=0;i<this._headerInitCallbacks.length;i++){this._headerInitCallbacks[i].func(tr,colgroup,prepend)}},_footerInit:function(tr,colgroup,prepend,cssClass){var i;for(i=0;i<this._footerInitCallbacks.length;i++){this._footerInitCallbacks[i].func(tr,colgroup,prepend,cssClass)}},id:function(){return this.element[0].id},_caption:function(){return this.container().find("caption")},container:function(){if(!this._container||this._container.length===0){this._container=this.element.closest("div[id="+this.id()+"_container]")}return this._container},headersTable:function(){if(this.options.fixedHeaders===true&&this.options.height!==null){return this.container().find("#"+this.id()+"_headers")}return this.element},footersTable:function(){if(this.options.fixedFooters===true&&this.options.height!==null){return this.container().find("#"+this.id()+"_footers")}return this.element},scrollContainer:function(){return this.container().children("#"+this.id()+"_scroll")},fixedContainer:function(){return $("#"+this.id()+"_fixedBodyContainer")},fixedFooterContainer:function(){return this.container().find("#"+this.id()+"_fixedFooterContainer")},fixedHeaderContainer:function(){return this.container().find("#"+this.id()+"_fixedHeaderContainer")},fixedTable:function(){if(this._fixedTable===undefined){this._fixedTable=this.element[0]}return this._fixedTable},fixedHeadersTable:function(){if(this.options.fixedHeaders===true&&this.options.height!==null){return this.container().find("#"+this.id()+"_headers_fixed")}return this.container().find("#"+this.id()+"_fixed")},fixedFootersTable:function(){if(this.options.fixedFooters===true&&this.options.height!==null){return this.container().find("#"+this.id()+"_footers_fixed")}return this.container().find("#"+this.id()+"_fixed")},_vdisplaycontainer:function(){return this.container().find("#"+this.id()+"_displayContainer")},_virtualcontainer:function(){return this.container().find("#"+this.id()+"_virtualContainer")},_vhorizontalcontainer:function(){return this.container().find("#"+this.id()+"_horizontalScrollContainer")},_fixedfooters:function(){return this.container().find("#"+this.id()+"_footer_container")},cellAt:function(x,y,isFixed){var i;if(x===undefined||y===undefined){return null}if(this.table===undefined){this.table=this.element[0]}i=this._dataRowIndex(y);if(isFixed===true){if(this._fixedTable===undefined){this._fixedTable=this.element}return this._fixedTable[0].rows[i].cells[x]}return this.table.rows[i].cells[x]},cellById:function(rowId,columnKey){var colIndex,i,cols,row,skippedCells,isFixed=this.isFixedColumn(columnKey);if(_aNull(rowId)||_aNull(columnKey)){return null}if(this.table===undefined){this.table=this.element[0]}cols=this._visibleColumns(isFixed);for(i=0;i<cols.length;i++){if(cols[i].key===columnKey){colIndex=i;break}}if(_aNull(colIndex)){return null}if(isFixed){row=this.fixedBodyContainer().find("tbody").first().children("[data-id="+rowId+"]").first()}else{row=this.element.children("tbody").children("[data-id="+rowId+"]").first()}skippedCells=row.children("th,[data-skip=true],[data-parent]").length;return row.children("td:nth-child("+(colIndex+1+skippedCells)+")")},_calculateHeaderFooterRows:function(){var theadCount=0,tfootCount=0;theadCount=this.element.children("thead").children("tr").length;if($.ig.util.isOpera){tfootCount=this.element.children("tfoot").children("tr").length}return theadCount+tfootCount},_dataRowIndex:function(i){var extrahr,j;if(this.table===undefined){this.table=this.element[0]}if(this._additionalTrCount===undefined||this._additionalTrCount===null){this._additionalTrCount=this._calculateHeaderFooterRows()}if(this._hc===true){extrahr=this.element.children("tbody").children("tr[data-container]");for(j=0;j<extrahr.length;j++){if($(extrahr[j]).index()<=i){i+=1}}}i=i+this._additionalTrCount;if(i>=this.table.rows.length){i=this.table.rows.length-1}else if(i<0){i=0}return i},immediateChildrenWidgets:function(){return this.element.children("tbody").children("tr").children(".ui-iggrid-childarea").children("div").children("div").map(function(){if($(this).children(".ui-iggrid-scrolldiv").length>0){return $(this).children(".ui-iggrid-scrolldiv").children(".ui-iggrid-table").data("igGrid")}return $(this).children(".ui-iggrid-table").data("igGrid")})},childrenWidgets:function(){return this.element.find("tbody > tr > .ui-iggrid-childarea").find(".ui-iggrid-table").map(function(){return $(this).data("igGrid")})},children:function(){return this.element.find("tbody > tr > .ui-iggrid-childarea").find(".ui-iggrid-table")},immediateChildren:function(){return this.element.children("tbody").children("tr").children(".ui-iggrid-childarea").children("div").children("div").map(function(){if($(this).children(".ui-iggrid-scrolldiv").length>0){return $(this).children(".ui-iggrid-scrolldiv").children(".ui-iggrid-table")}return $(this).children(".ui-iggrid-table")})},rowAt:function(i){i=this._dataRowIndex(i);return this.table.rows[i]},rows:function(){return this.element.children("tbody").children("tr")},allRows:function(){return this.element.find("tbody tr")},columnByKey:function(key){var cols=this.options.columns,i;for(i=0;i<cols.length;i++){if(String(cols[i].key)===String(key)){return cols[i]}}return null},columnByText:function(text){var cols=this.options.columns,i;for(i=0;i<cols.length;i++){if(cols[i].headerText===text){return cols[i]}}return null},activeCell:function(){return this._activeCell},activeRow:function(){return this._activeRow},selectedCell:function(){return this._selectedCell},selectedRow:function(){return this._selectedRow},selectedCells:function(){return this._selectedCells},selectedRows:function(){return this._selectedRows},getCellValue:function(rowId,colKey){var id=parseInt(rowId,10),i,cols=this.options.columns,colFound=false,rec,primaryKeyCol,tx;tx=this.dataSource.pendingTransactions();if(this.options.autoCommit===false&&tx.length>0){for(i=0;i<tx.length;i++){if(tx[i].rowId===rowId){if(tx[i].type==="cell"&&tx[i].col===colKey){return tx[i].value}if(tx[i].type==="row"||tx[i].type==="newrow"){return tx[i].row[colKey]}}}}if($.type(colKey)==="string"){for(i=0;i<cols.length;i++){if(cols[i].key===colKey){colFound=true;break}}if(colFound===false){throw new Error($.ig.Grid.locale.noSuchColumnDefined)}}if(this.options.primaryKey!==null){primaryKeyCol=this.columnByKey(this.options.primaryKey);if(primaryKeyCol.dataType==="number"||primaryKeyCol.dataType==="numeric"){rec=this.dataSource.findRecordByKey(parseInt(rowId,10))}else{rec=this.dataSource.findRecordByKey(rowId)}if(rec===null||rec===undefined){throw new Error($.ig.Grid.locale.recordNotFound+" "+rowId)}return rec[colKey]}if(id>=this.dataSource.dataView().length){throw new Error($.ig.Grid.locale.indexOutOfRange)}if($.type(colKey)==="string"){return this.dataSource.dataView()[id][colKey]}if(cols.length<=colKey){throw new Error($.ig.Grid.locale.columnIndexOutOfRange)}return this.dataSource.dataView()[id][colKey]},getCellText:function(rowId,colKey){var colIndex;if($.type(colKey)==="string"){colIndex=this._getCellIndexByColumnKey(colKey)}else{colIndex=colKey}if(colIndex===undefined){throw new Error($.ig.Grid.locale.columnNotFound+" "+colKey)}if(this.options.primaryKey!==null){return this.element.find("tr[data-id='"+rowId+"']>td:nth-child("+(colIndex+1)+")").text()}return $(this.cellAt(colIndex,parseInt(rowId,10))).text()},setRowTemplate:function(tmpl,render){this.options.rowTemplate=tmpl;this._tmap=null;render=render===null||render===undefined?true:render;if(render){this._renderData()}},setColumnTemplate:function(col,tmpl,render){var colIdx=this._getColIdxById(this.options.columns,col);if(colIdx===null||colIdx===undefined){return}col=this.options.columns[colIdx];col.template=tmpl;this.options.rowTemplate=this._buildRowTemplateRaw(true);this._tmap=null;render=render===null||render===undefined?true:render;if(render&&!col.hidden){this._renderData()}},commit:function(rowId){var key;key=this._normalizedKey(rowId);this.dataSource.commit(key);if(this._fireInternalEvent("_gridCommit")){return}if(this.options.virtualization||this.options.rowVirtualization||this.options.columnVirtualization){if(this.options.virtualizationMode==="continuous"){this._renderVirtualRecords()}else{this._buildVirtualDom();this.virtualScrollTo(this._startRowIndex)}}else{this._renderData()}},rollback:function(rowId,updateUI){var key=this._normalizedKey(rowId),transactions=this.dataSource.rollback(key),transaction,content,i,skip=false,tridx,rec,tr;if(updateUI===true){if(!_aNull(rowId)){if(transactions.length===0){return}i=transactions.length;while(i-->0){transaction=transactions[i];tr=this.element.find("tr[data-id='"+transaction.rowId+"']");switch(transaction.type){case"newrow":tridx=this.element.children("tbody").children("tr:not([data-container],[data-grouprow])").index(tr);tr.remove();this._reapplyZebraStyle(tridx);break;case"deleterow":tr.removeClass(this.css.deletedRecord);break;case"cell":tr.removeClass(this.css.modifiedRecord);td=this.cellById(transaction.rowId,transaction.col);rec=this.dataSource.findRecordByKey(transaction.rowId);if(this.options.rowTemplate&&this.options.rowTemplate.length>0){content=this._renderTemplatedCell(rec,transaction.col);index=content.indexOf(">");content=content.substring(index+1,content.length);td.html(content)}else{td.html(this._renderCell(rec[transaction.col],transaction.col,rec))}break;case"row":tr.removeClass(this.css.modifiedRecord);rec=this.dataSource.findRecordByKey(transaction.rowId);this._renderRow(rec,tr[0],rec[this.options.primaryKey]);break}}}else{this.dataBind()}}},findRecordByKey:function(key){return this.dataSource.findRecordByKey(key)},getDetachedRecord:function(t){return this.dataSource.getDetachedRecord(t)},pendingTransactions:function(){return this.dataSource.pendingTransactions()},allTransactions:function(){return this.dataSource.allTransactions()},transactionsAsString:function(){return this.dataSource.transactionsAsString()},_normalizedKey:function(id){var key,primaryKeyCol;if(id===undefined||id===null){return null}key=id;if(this.options.primaryKey!==null){primaryKeyCol=this.columnByKey(this.options.primaryKey);if(primaryKeyCol.dataType==="number"||primaryKeyCol.dataType==="numeric"){key=parseInt(id,10)}}else{key=parseInt(id,10)}return key},saveChanges:function(success,error){this.dataSource.saveChanges(success,error)},_renderRow:function(rec,tr,rowId){var i,td,col,id=0,css,cols=this.options.columns,content,index;for(i=0;i<tr.cells.length;i++){td=$(tr.cells[i]);css=td[0].className;if(id>0||!(td.attr("data-skip")||css&&(css.indexOf("-expandcolumn")>0||css.indexOf("-rowselector")>0))){while(true){col=cols[id];if(!col){return tr}if(!col.hidden){break}id++}if(this.options.rowTemplate&&this.options.rowTemplate.length>0){content=this._renderTemplatedCell(rec,col);index=content.indexOf(">");content=content.substring(index+1,content.length);td.html(content)}else{td.html(this._renderCell(rec[col.key],col,rec))}id++}}return tr},renderNewRow:function(rec,key){var tbody=this.element.children("tbody"),index,self=this,virt=this.options.virtualization===true||this.options.rowVirtualization===true,fv=this.options.virtualizationMode==="fixed";if(virt){if(fv){this._buildVirtualDom()}else{this._renderVirtualRecordsContinuous();this._startRowIndex=0}this.virtualScrollTo(this._totalRowCount)}else{index=tbody.children('[data-container!="true"]').length;MSApp.execUnsafeLocalFunction(function(){tbody.append(self._renderRecord(rec,index))})}},_findTableRowByKey:function(key){var primaryKeyIndex,cols=this.options.columns,r,i;if(this.options.primaryKey!==null){for(i=0;i<cols.length;i++){if(cols[i].key===this.options.primaryKey){primaryKeyIndex=i;break}}if(primaryKeyIndex===undefined){throw new Error($.ig.Grid.locale.columnNotFound+" "+this.options.primaryKey)}r=this.element.find("td:nth-child('"+(primaryKeyIndex+1)+"'):contains('"+key+"')").parent();return r.length===0?null:r[0]}return this.rowAt(parseInt(key,10))},dataSourceObject:function(dataSource){if(dataSource!==undefined){this.options.dataSource=dataSource}else{return this.options.dataSource}},totalRecordsCount:function(){return this.dataSource.totalRecordsCount()},dataBind:function(internal){var dataOptions,i,noCancel=true,noCancelRendering=true;if(!this._initialized){noCancelRendering=this._trigger(this.events.rendering,null,{owner:this})}if(noCancelRendering){noCancel=this._trigger(this.events.dataBinding,null,{owner:this});if(internal===undefined){this.options.requiresDataBinding=true}if(noCancel){if(this.options.requiresDataBinding){if(this._hasUnboundColumns){this._rebindUnboundColumns=true}dataOptions=this._generateDataSourceOptions(this.options);this._setupDataSource(dataOptions);this._dataOptions=dataOptions;if(!this._initialized){if(this.element.is("div")){this._isWrapped=true;this.element=$("<table></table>").appendTo(this.element).attr("id",this.id()+"_table");this.element.data("igGrid",this)}for(i=0;i<this.options.features.length;i++){this._initFeature(this.options.features[i],dataOptions)}if(this.options.autoGenerateColumns!==true){this._captureInitiallyHiddenColumns()}this._visibleColumnsArray=undefined}else{this._isDataBoundCalled=true;this.element.trigger("iggriduidirty",{owner:this});for(i=0;i<this.options.features.length;i++){this._initFeatureSettings(this.options.features[i])}}this._renderGrid();if(this._loadingIndicator===undefined){this._initLoadingIndicator()}if(this._loadingIndicator){this._loadingIndicator.show()}this.dataSource.dataBind();this.options.requiresDataBinding=false}else{this._renderGrid()}}}else{this._cancelRendering=true}},_mergeUnboundValues:function(){var i,primaryKeyCol,metadataUC,rec,ucLength,primaryKeyColIsNumber,col,schema,type,dataLength,data,key,val,j,pk=this.options.primaryKey,metadata=this.dataSource.metadata("unboundValues"),self=this,hasPrimaryKey=pk!==null&&pk!==undefined,metaDataMergeFunction;if(metadata===undefined||metadata===null||metadata.length===0||!this._unboundColumns){return}if(hasPrimaryKey){metaDataMergeFunction=function(ind,val){if(primaryKeyColIsNumber){rec=self.dataSource.findRecordByKey(parseInt(ind,10))}else{rec=self.dataSource.findRecordByKey(ind)}if(rec===null||rec===undefined){return true}if(schema!==undefined&&schema!==null){val=schema._convertType(type,val,rec[pk],key)}self._addUnboundColumnValue(key,val);rec[key]=val};primaryKeyCol=this.columnByKey(pk);primaryKeyColIsNumber=primaryKeyCol.dataType==="number"}ucLength=this._unboundColumns.length;schema=this.dataSource.schema();for(i=0;i<ucLength;i++){key=this._unboundColumns[i].key;metadataUC=metadata[key];if(metadataUC===null||metadataUC===undefined){continue}col=this.getUnboundColumnByKey(key);type=null;if(col!==null&&col.dataType){type=col.dataType}if(hasPrimaryKey){$.each(metadataUC,metaDataMergeFunction)}else{self._renderUnboundValues(metadataUC,key)}if(type==="bool"||type==="boolean"){data=this.dataSource.data();val=schema._convertType(type,undefined);dataLength=data.length;if(dataLength<=metadataUC.length){continue}for(j=0;j<dataLength;j++){if(data[j][key]===undefined){data[j][key]=val}}}}},_generateDataSourceOptions:function(options){var schema,dataOptions,t,headers,i;if(!this.options.dataSource&&!this.options.dataSourceUrl&&this.element.is("table")&&this.element.find("tbody").children().length>0){this.options.dataSource=this.element[0]}if(this.options.dataSource&&this.options.dataSource.tagName&&this.options.dataSource.nodeType){t=$(this.options.dataSource);if(t.is("table")&&t.find("thead th").length>0){headers=t.find("thead tr th");this._tb_h=true;this._tb_h_arr=[];for(i=0;i<headers.length;i++){this._tb_h_arr.push($(headers[i]).text())}}}dataOptions={callback:$.proxy(this._renderData,this),callee:this,responseDataKey:this.options.responseDataKey,responseTotalRecCountKey:this.options.responseTotalRecCountKey,dataSource:this.options.dataSource,requestType:this.options.requestType,responseContentType:this.options.responseContentType,primaryKey:this.options.primaryKey,localSchemaTransform:this.options.localSchemaTransform,autoCommit:this.options.autoCommit,aggregateTransactions:this.options.aggregateTransactions,serializeTransactionLog:this.options.serializeTransactionLog,updateUrl:this.options.updateUrl,restSettings:this.options.restSettings};
if(this.options.dataSourceType!==null){dataOptions.type=this.options.dataSourceType}if(!this.options.dataSource||!this.options.dataSource.schema||!this.options.dataSource.schema()||this.options.dataSource.schema()._type!=="xml"){schema=this._generateDataSourceSchema()}if(this.options.dataSource instanceof $.ig.DataSource&&(this.options.dataSource.settings.schema===null||!this.options.dataSource.settings.schema.fields||this.options.dataSource.settings.schema.fields&&this.options.dataSource.settings.schema.fields.length>=0)||!(this.options.dataSource instanceof $.ig.DataSource)){dataOptions=$.extend(dataOptions,{schema:schema})}return dataOptions},_insertUnboundColumn:function(column){if(this._unboundColumns===null||this._unboundColumns===undefined){this._unboundColumns=[]}this._unboundColumns.push(column);if(column.key&&(this._unboundValues[column.key]===null||this._unboundValues[column.key]===undefined)){this._unboundValues[column.key]=[]}if(column.unboundValues&&column.unboundValues.length>0){this._isToSetUnboundColumns=true}this._hasUnboundColumns=true},_addUnboundColumnValue:function(key,value,index){if(this._unboundValues[key]===null||this._unboundValues[key]===undefined){this._unboundValues[key]=[]}if(index!==undefined&&index!==null){this._unboundValues[key][index]=value}else{this._unboundValues[key].push(value)}},_generateDataSourceSchema:function(){var schema,i,rec,prop,count=0,cols=this.options.columns,ds=this.options.dataSource,cl,counter=0;if(ds instanceof $.ig.DataSource){if($.type(ds.settings.dataSource)==="array"||$.type(ds.settings.dataSource)==="object"){ds=ds.settings.dataSource}else if($.type(ds.settings.dataSource)!=="string"){ds=ds.data()}else{ds=[]}}if($.type(ds)==="object"&&this.options.responseDataKey){ds=$.ig.findPath(ds,this.options.responseDataKey)}schema={};schema.fields=[];schema.searchField=this.options.responseDataKey;if(cols.length>0&&!this.options.autoGenerateColumns){for(i=0;i<cols.length;i++){if(cols[i].unbound===true||cols[i].unboundDS===true){this._insertUnboundColumn(cols[i]);if(cols[i].unbound===true){continue}}schema.fields[counter]={};schema.fields[counter].name=cols[i].key;schema.fields[counter].type=cols[i].dataType;counter++}}else if(this.options.autoGenerateColumns){if(ds&&ds.tagName&&$(ds).is("table")&&$(ds).find("tbody tr").length>0){rec=$(ds).find("tbody tr")[0];$(rec).find("td").each(function(){if(cols.length>count){schema.fields.push({name:cols[count].key||count+1,type:cols[count].dataType||"string"})}else{schema.fields.push({name:count+1,type:"string"})}count++})}else if(ds&&ds.length&&ds.length>0&&$.type(ds)==="array"){for(i=0;i<ds.length;i++){rec=ds[i];for(prop in rec){if(rec.hasOwnProperty(prop)){if(this.columnByKey(prop)===null&&!this._fieldExists(prop,schema)&&$.type(rec[prop])!=="object"&&$.type(rec[prop])!=="array"){schema.fields.push({name:prop,type:$.ig.getColType(rec[prop])})}else if(this.columnByKey(prop)!==null){schema.fields.push({name:prop,type:this.columnByKey(prop).dataType})}count++}}if(!this.options._recurseSchema){break}}}for(i=0;i<cols.length;i++){if(cols[i].unbound===true||cols[i].unboundDS===true){this._insertUnboundColumn(cols[i])}}}this._trigger(this.events.schemaGenerated,null,{owner:this,schema:schema,dataSource:ds});cl=this.options.columnLayouts;if(cl&&cl.length&&cl.length>0){for(i=0;i<cl.length;i++){if(cl[i].key===undefined){continue}schema.fields.push({name:cl[i].key})}}return schema},_fieldExists:function(prop,schema){var i;for(i=0;i<schema.fields.length;i++){if(schema.fields[i].name===prop){return true}}return false},_setupDataSource:function(dataOptions){var callee;if(!(this.options.dataSource instanceof $.ig.DataSource)){if($.type(dataOptions.dataSource)==="string"&&(this.options.jsonpRequest||$.ig.util.isJsonpUrl(dataOptions.dataSource))){this.dataSource=new $.ig.JSONPDataSource(dataOptions)}else if(this.options.restSettings.update.url!==null||this.options.restSettings.update.template!==null||this.options.restSettings.create.url!==null||this.options.restSettings.create.template!==null||this.options.restSettings.remove.url!==null||this.options.restSettings.remove.template!==null){this.dataSource=new $.ig.RESTDataSource(dataOptions)}else{this.dataSource=new $.ig.DataSource(dataOptions)}}else{this.dataSource=this.options.dataSource;if(this.dataSource.settings.responseDataKey!==null){delete dataOptions.responseDataKey;if(dataOptions.schema){dataOptions.schema.searchField=this.dataSource.settings.responseDataKey}}if(dataOptions.responseTotalRecCountKey===null&&this.dataSource.settings.responseTotalRecCountKey!==null){delete dataOptions.responseTotalRecCountKey}this._tds=this.dataSource.settings.dataSource;this.dataSource.settings.dataSource=null;if($.ig.util.isIE8&&dataOptions.callee){callee=dataOptions.callee;dataOptions.callee=null}this.dataSource.settings=$.extend(true,{},this.dataSource.settings,dataOptions);if($.ig.util.isIE8&&callee){this.dataSource.settings.callee=callee}this.dataSource.settings.dataSource=this._tds;this._tds=null;if(dataOptions.schema){this.dataSource._initSchema()}}},_generateColumns:function(){var r,key,i,hasExplicitCols=this.options.columns.length>0,hasHeaders=false,len,col,isTable=false,arr=[],ds=this.options.dataSource,cdp=this.options.childrenDataProperty,newDs,colType;if(ds instanceof $.ig.DataSource){ds=ds.data()}else if(typeof ds==="string"){ds=this.dataSource.data()}if($.type(ds)==="object"&&this.options.responseDataKey){newDs=$.ig.findPath(ds,this.options.responseDataKey);if($.type(newDs)==="array"){ds=newDs}}if(ds&&ds.tagName&&$(ds).is("table")){len=$(ds).find("tbody tr").length;isTable=true}else if(ds&&ds.length){len=ds.length}if(ds&&len&&len===0&&this.options.columns.length===0){throw new Error($.ig.Grid.locale.autoGenerateColumnsNoRecords)}if(ds&&len&&len>0){if(isTable){r=$(ds).find("tbody tr")[0]}else{r=ds[0]}if($.type(r)==="array"||isTable){hasHeaders=this._tb_h;if(isTable){$(r).find("td").each(function(){arr.push($(this).text())});r=arr}for(i=0;i<r.length;i++){if(this.columnByKey(i+1)===null&&$.ig.getColType(r[i])!=="object"){col={headerText:hasHeaders?this._tb_h_arr[i]:$.ig.Grid.locale.colPrefix+(i+1),key:String(i+1),dataType:$.ig.getColType(r[i]),hidden:false};col.headerText=(col.headerText||"").toString().trim();if(this._isMultiColumnGrid){col.level0=true;col.level=0;this._oldCols.push(col)}this.options.columns.push(col);this._visibleColumnsArray=undefined}else if(hasHeaders&&!this.columnByKey(i+1).headerText){this.columnByKey(i+1).headerText=this._tb_h_arr[i]}}}else{for(key in r){if(r.hasOwnProperty(key)&&this.columnByKey(key)===null){colType=$.ig.getColType(r[key]);if((cdp&&cdp!==key||!cdp)&&(colType!=="object"||r[key]===null)&&key!=="ig_pk"){col={headerText:key,key:key,dataType:$.ig.getColType(r[key]),hidden:false};this.options.columns.push(col);if(this._isMultiColumnGrid){col.level0=true;col.level=0;this._oldCols.push(col)}this._visibleColumnsArray=undefined}}}}}if((this.dataSource.schema()===null||this.dataSource.schema().fields().length===0)&&!hasExplicitCols){this.dataSource.settings.schema=this._generateDataSourceSchema();this.dataSource._initSchema()}if(this.options.width===null){this._setContainerWidth(this.container())}this._trigger("columnsgenerated",null,{owner:this,key:this.options.key})},_renderGrid:function(){var gridElement=this.element[0],containerId,containerDiv,tbody=this.element.children("tbody"),ar=this.options.accessibilityRendering;this._cancelRendering=false;if(!this._initialized){if(ar){this.element.attr("role","grid")}if(this.options.virtualization===true||this.options.rowVirtualization===true||this.options.columnVirtualization===true){if(this.options.height===undefined||this.options.height===null){throw new Error($.ig.Grid.locale.virtualizationRequiresHeight)}this._createVirtualGrid()}else if(this.options.height!==null||this.options.width!==null){this._createScrollingGrid()}else{containerId=gridElement.id+"_container";containerDiv='<div id="'+containerId+'" class="'+this.css.gridClasses+" "+this.css.baseClass+'" style="position: relative"> </div>';this.element.wrap(containerDiv);this.element.addClass(this.css.gridTableClass);if(ar){this.element.attr("aria-describedby",containerId)}this._setContainerWidth(this.container());this.container().attr("tabIndex",this.options.tabIndex);if(this.options.height!==null){this.container().css("overflow-y","hidden")}}this._touch();if(this.options.columns.length>0&&this.options.virtualization!==true&&this.options.rowVirtualization!==true&&this.options.columnVirtualization!==true&&this.options.autogenerateColumns===false&&this.options.columns.length>0){this._renderColgroup(this.element[0],false,false,this.options.autofitLastColumn)}$(gridElement).attr("cellpadding","0");$(gridElement).attr("cellspacing","0");$(gridElement).attr("border","0");$(gridElement).css("table-layout","fixed");$(gridElement).addClass(this.css.gridTableClass);if(this.options.autoGenerateColumns===false&&this.options.columns.length>0&&this._headerRenderCancel!==true){this._renderHeader()}this._renderCaption();if(this.options.autoAdjustHeight){this._initializeHeights()}}if(tbody.length===0){tbody=$("<tbody></tbody>").appendTo(gridElement).addClass(this.css.baseContentClass).addClass(this.css.gridTableBodyClass).addClass(this.css.recordClass)}if(this.dataSource.type()!=="htmlTableDom"&&this.dataSource.type()!=="htmlTableId"){tbody.empty()}},_setContainerWidth:function(element,rendered){var cols=this._visibleColumns(),width=0;if(cols.length>0){width=this._calculateContainerWidth(true);if(width>0){if(rendered){width=0;this.container().find(".ui-iggrid-header").each(function(){width+=$(this).outerWidth()});element.width(width)}else{width+=this._calculateSpecialColumnsWidth();element.css("width",width)}}}else if(this.options.width!==null){element.css("width",this.options.width)}},_calculateContainerWidth:function(addScrollWidth){var width=0,cols=this.options.columns,i;for(i=0;i<cols.length;i++){if(cols[i].hidden!==true&&(this._initialHiddenColumns===undefined||$.inArray(cols[i],this._initialHiddenColumns)===-1)){width+=cols[i].width?parseInt(cols[i].width,10):this.options.defaultColumnWidth===null?0:parseInt(this.options.defaultColumnWidth,10)}}if(this.options.height!==null&&width>0&&addScrollWidth===true){width+=this._scrollbarWidth()}return width},_createScrollingGrid:function(){var self=this,containerWidth,totalWidth,scrollbarWidth=this._scrollbarWidth(),id=this.id()+"_scroll",dataContainer,scrollDiv='<div id="'+id+'"></div>';this.element.wrap(scrollDiv);dataContainer=this.element.parent();if(this.options.accessibilityRendering){this.element.attr("aria-describedby",id)}dataContainer.addClass(this.css.gridScrollDivClass).wrap("<div id='"+this.id()+"_container'></div>");if($.ig.util.isIE7){dataContainer.css("padding-bottom",this._scrollbarWidth())}this.container().attr("tabIndex",this.options.tabIndex).addClass(this.css.baseClass).addClass(this.css.gridClasses);if(this.options.width!==null){this.container().css("width",this.options.width);if(this.options.width.indexOf&&this.options.width.indexOf("%")!==-1){this.element.css("width","100%")}if(this.options.height!==null){this._addHorizontalScrollBar(dataContainer);this.scrollContainer().css("overflow-x","hidden");containerWidth=dataContainer.width();totalWidth=this._getHScrollContainerInner().width();dataContainer.bind("scroll",function(e){var container=$(this),hScroller=self._hscrollbarcontent(),containerLeft=container.scrollLeft(),hScrollerLeft=hScroller.scrollLeft();if(containerLeft!==hScrollerLeft){if(totalWidth===0){totalWidth=self._getHScrollContainerInner().width()}if(containerLeft===0&&self.element.height()===0){return}if(containerLeft+containerWidth>totalWidth+scrollbarWidth){container.scrollLeft(hScrollerLeft)}else{hScroller.scrollLeft(containerLeft)}}})}}else{this._setContainerWidth(this.container());this.scrollContainer().css("overflow-x","hidden")}this.container().css("position","relative");if(this.options.height!==null){this.scrollContainer().css("overflow-y","auto");if(this.options.autoAdjustHeight){this.container().css("height",this.options.height)}else{this.scrollContainer().css("height",this.options.height)}}},_touch:function(){var id=this.id(),div=this.scrollContainer();if(div.length!==1){div=this._vdisplaycontainer()}if(div.length){div.attr("data-scroll","true").attr("data-oneDirection","true");if(this._hscrollbarcontent()[0]){div.attr("data-xScroller","#"+id+"_hscroller")}else if(this._vhorizontalcontainer()[0]){div.attr("data-xScroller","#"+id+"_horizontalScrollContainer")}if(this._scrollContainer()[0]){div.attr("data-yScroller","#"+id+"_scrollContainer")}if(typeof Modernizr==="object"&&Modernizr.touch===true&&this.element.igScroll!==undefined){div.css("overflow-y","hidden")}}},_createVirtualGrid:function(){var id=this.id(),grid,newW,percWidthStr=$.ig.util.isWebKit?"width=100%":"",totalWidth,scrollContainerInner,scrollbarWidth,w=0,virtualGridMarkup='<div id="'+id+'_container" style="margin:0px; border:0px; padding:0px;"><table border="0" cellspacing="0" cellpadding="0" class="ui-iggrid-layout-helper" style="border-spacing:0px" id="'+id+'_virtualContainer" ><tbody><tr><td colspan="2" style="border-width:0px"><div id="'+id+'_headers_v" style="overflow:hidden;"></div></td></tr><tr><td style="border-width:0px;"><div id="'+id+'_displayContainer"></td>$verticalMarkup$</tr>$horizontalMarkup$</tbody></table></div>',verticalMarkup,horizontalMarkup='<tr><td colspan="2" style="border-width: 0px"><div id="'+id+'_horizontalScrollContainer"></div></td></tr>';scrollbarWidth=this._scrollbarWidth();if($.ig.util.isIE){scrollbarWidth+=1}if(parseInt(this.options.height,10)>0){verticalMarkup='<td style="border-width: 0px;"><div id="'+id+'_scrollContainer" style="overflow:scroll; overflow-x:hidden; width: '+scrollbarWidth+"px; height:"+this.options.height+';"></div></td>'}else{verticalMarkup='<td style="border-width: 0px;"><div id="'+id+'_scrollContainer" style="overflow:scroll; overflow-x:hidden; width: '+scrollbarWidth+'px;"></div></td>'}if(this.options.virtualization===true){virtualGridMarkup=virtualGridMarkup.replace("$verticalMarkup$",verticalMarkup).replace("$horizontalMarkup$",horizontalMarkup)}else if(this.options.rowVirtualization===true){virtualGridMarkup=virtualGridMarkup.replace("$verticalMarkup$",verticalMarkup).replace("$horizontalMarkup$","")}else if(this.options.columnVirtualization===true){virtualGridMarkup=virtualGridMarkup.replace("$horizontalMarkup$",horizontalMarkup).replace("$verticalMarkup$","")}if(this.options.virtualization===true||this.options.columnVirtualization===true){this.element.css("width","100%")}this.element.wrap(virtualGridMarkup);this.container().attr("tabIndex",this.options.tabIndex).addClass(this.css.baseClass).addClass(this.css.gridClasses);if(this.options.width!==null){this.container().width(this.options.width)}else{this._setContainerWidth(this.container())}this._vdisplaycontainer().append(this.element[0]);grid=this;totalWidth=this._calculateContainerWidth(false);if(this.options.width!==null){w=parseInt(this.options.width,10)}else{w=totalWidth}if(this.options.height!==null&&this.options.width!==null){w-=this._scrollbarWidth()}if(w<=0){w=undefined}if(w>0&&this.options.expandColWidth&&!this.options.width){w+=this.options.expandColWidth}$("<colgroup><col "+(w<=0?percWidthStr:'width="'+w+'"')+'></col><col width="'+this._scrollbarWidth()+'"></col></colgroup>').prependTo(this._virtualcontainer());newW=this.options.width;if(newW&&newW.indexOf&&newW.indexOf("%")!==-1){newW="100%"}this._virtualcontainer().css("width",newW).css("max-width",newW);scrollContainerInner='<div style="width:1px; overflow:hidden; height:'+this._totalRowCount*parseInt(this.options.avgRowHeight,10)+'px;"></div>';this._scrollContainer().append(scrollContainerInner);if((this.options.virtualization===true||this.options.rowVirtualization===true)&&this.options.width&&this.options.width.indexOf&&this.options.width.indexOf("%")>0&&totalWidth>$("#"+id+"_container").width()){this._addHorizontalScrollBar(this._virtualcontainer());this._virtualcontainer().css("table-layout","fixed")}else if((this.options.virtualization===true||this.options.columnVirtualization===true)&&this.options.width&&totalWidth>parseInt(this.options.width,10)){this._renderHorizontalScrollContainer(totalWidth)}if(parseInt(this.options.height,10)>0){this._vdisplaycontainer().css("height",this.options.height).css("vertical-align","top")}this._vdisplaycontainer().css("position","relative").css("width",w).css("maxWidth",w);if(this.options.virtualization===true){this.container().find("#"+id+"_headers_v").append("<a href='#' id='"+id+"_displayContainer_a' tabindex='-1' style='position:absolute;top:-100px;left:-100px'>&nbsp;</a>")}if(this.options.width&&this.options.virtualization===false&&this.options.columnVirtualization===false){this._vdisplaycontainer().css({"overflow-y":"hidden","overflow-x":"auto"})}else{this._vdisplaycontainer().css("overflow","hidden")}this._vdisplaycontainer().parent().bind({mouseenter:function(event){grid._isMouseOverVirtualTable=true},mouseleave:function(event){grid._isMouseOverVirtualTable=false}});this._documentEvents={DOMMouseScroll:function(event){var dir="down",delta,step;step=grid.options.virtualizationMouseWheelStep===null?parseInt(grid.options.avgRowHeight,10):grid.options.virtualizationMouseWheelStep;delta=-event.originalEvent.detail/3;if(delta>0){dir="up"}if(grid._isMouseOverVirtualTable){grid._onVirtualVerticalScroll(event,step,dir);event.preventDefault()}},mousewheel:function(event){var dir="down",delta,step;step=grid.options.virtualizationMouseWheelStep===null?parseInt(grid.options.avgRowHeight,10):grid.options.virtualizationMouseWheelStep;delta=event.originalEvent.wheelDelta/120;if(delta>0){dir="up"}if(grid._isMouseOverVirtualTable){grid._onVirtualVerticalScroll(event,step,dir);event.preventDefault()}}};$(document).bind(this._documentEvents);if(this.options.virtualization===true||this.options.rowVirtualization===true){this._scrollContainer().bind({scroll:function(event){grid._onVirtualVerticalScroll(event);grid._virtualScrollMouseDown=false},mousedown:function(event){grid._virtualScrollMouseDown=true}})}if(this.options.virtualization===true||this.options.columnVirtualization===true){this._vhorizontalcontainer().bind({scroll:function(event){grid._onVirtualHorizontalScroll(event)}})}if(this._vhorizontalcontainer().length===0&&this.options.width!==null){if(!this.options.width.indexOf||this.options.width.indexOf("%")===-1){this._addHorizontalScrollBar(this._virtualcontainer())}this._vdisplaycontainer().css("overflow-x","hidden")}this.element.height(this._scrollContainer().height());if(this.options.width&&this.options.width.indexOf&&this.options.width.indexOf("%")!==-1){this.container().find("#"+id+"_virtualContainer > colgroup > col:first").css("width","100%");this._vhorizontalcontainer().css("width","100%");this._vdisplaycontainer().css("width","100%").css("max-width","100%")}},_renderHorizontalScrollContainer:function(totalWidth){var horizontalScrollContainerInner,w=this.options.width;if(w&&w.indexOf&&w.indexOf("%")!==-1&&(this.options.virtualization===true||this.options.rowVirtualization===true)){return}this._vhorizontalcontainer().css("height",this._scrollbarWidth()+"px").css("overflow","scroll");if($.ig.util.isIE){this._vhorizontalcontainer().css("width",parseInt(this.options.width,10)+1).css("height","100%")}else{this._vhorizontalcontainer().css("width",this.options.width)}horizontalScrollContainerInner='<div style="width:'+totalWidth+'px;height:1px;"></div>';this._vhorizontalcontainer().append(horizontalScrollContainerInner)},_onVirtualVerticalScroll:function(event,offset,dir){this._isHorizontal=false;var scrollContainer=this._scrollContainer(),scrollTopDiff,isIE=$.ig.util.isIE,current=scrollContainer.scrollTop(),mode=this.options.virtualizationMode;if(offset!==undefined){if(dir==="down"){scrollContainer.scrollTop(current+offset)}else{scrollContainer.scrollTop(current-offset)}current=scrollContainer.scrollTop()}scrollTopDiff=scrollContainer.scrollTop()-this._oldScrollTop;if(Math.abs(scrollTopDiff)<5&&$.ig.util.isFF&&!isIE){return}if(mode===undefined||mode===""){mode="continuous"}if(mode==="fixed"){this._startRowIndex=Math.ceil(scrollContainer.scrollTop()/parseInt(this.options.avgRowHeight,10));if(!isIE&&this._startRowIndex===this._oldStartRowIndex&&this._virtualScrollMouseDown){if(scrollTopDiff>0&&scrollTopDiff<parseInt(this.options.avgRowHeight,10)){this._startRowIndex++;scrollContainer.scrollTop(scrollContainer.scrollTop()-scrollTopDiff+parseInt(this.options.avgRowHeight,10))}else if(scrollTopDiff<0&&Math.abs(scrollTopDiff)<parseInt(this.options.avgRowHeight,10)){this._startRowIndex--;scrollContainer.scrollTop(scrollContainer.scrollTop()-scrollTopDiff-parseInt(this.options.avgRowHeight,10))}}if(this._startRowIndex>this._totalRowCount-this._virtualRowCount){this._startRowIndex=this._totalRowCount-this._virtualRowCount}if(this._startRowIndex<0){this._startRowIndex=0}this._oldStartRowIndex=this._startRowIndex;this._renderVirtualRecords()}else if(mode==="continuous"){this._virtualScrollToInternal(current)}this._oldScrollTop=scrollContainer.scrollTop()},_scrollContainer:function(){if(!this._scrollContainerObj||this._scrollContainerObj.length===0){this._scrollContainerObj=this.container().find("#"+this.id()+"_scrollContainer")}return this._scrollContainerObj},_onVirtualHorizontalScroll:function(event){var id=this.id(),internallyTriggered=event===undefined,horizontalScrollContainer=this._vhorizontalcontainer(),scrollLeft=horizontalScrollContainer.scrollLeft(),hiddenContentWidth=horizontalScrollContainer[0].scrollWidth-horizontalScrollContainer[0].offsetWidth,deltaScroll=scrollLeft-this._oldScrollLeft;if(!internallyTriggered&&Math.abs(deltaScroll)<5&&$.ig.util.isIE&&!$.ig.util.isIE){return}if(this.options.virtualization===true&&this.options.virtualizationMode==="continuous"){this._setDisplayContainerScrollLeft(this._getDisplayContainerScrollLeft()+deltaScroll);this._oldScrollLeft=horizontalScrollContainer.scrollLeft();this.container().find("#"+id+"_headers_v").scrollLeft(this.container().find("#"+id+"_headers_v").scrollLeft()+deltaScroll);this.container().find("#"+id+"_footer_container").scrollLeft(this.container().find("#"+id+"_footer_container").scrollLeft()+deltaScroll);return}this._isHorizontal=true;if(hiddenContentWidth>0){this._startColIndex=Math.ceil(scrollLeft*this._totalColumnCount/hiddenContentWidth);this._startColIndex=Math.min(this._startColIndex,this._totalColumnCount-this._virtualColumnCount)}else{this._startColIndex=0}if(internallyTriggered||this._oldStartColIndex!==this._startColIndex){this._renderVirtualRecords();this._trigger("virtualhorizontalscroll",null,{startColIndex:this._startColIndex,endColIndex:this._startColIndex+this._virtualColumnCount-1})}this._oldScrollLeft=horizontalScrollContainer.scrollLeft();this._oldStartColIndex=this._startColIndex},_initLoadingIndicator:function(){var widget;if(this.container().data("igLoading")){this._loadingIndicator=this.container().data("igLoading").indicator()}else{widget=this.container().igLoading().data("igLoading");if(widget){this._loadingIndicator=widget.indicator()}}},_addHorizontalScrollBar:function(parent){var sb=$("<div id='"+this.id()+"_hscroller_container' ></div>").css("height",this._scrollbarWidth()+"px").css("position","relative").css("display","none").css("overflow","hidden").append($("<div id='"+this.id()+"_hscroller' ></div>").css("width","100%").css("position","absolute").css("bottom","0px").css("overflow-x","scroll").css("overflow-y","scroll").append($("<div id='"+this.id()+"_hscroller_inner' ></div>").css("height","1px")).bind("scroll",$.proxy(this._scrollData,this)));if(parent){sb.insertAfter(parent)}},_updateVirtualHorizontalScrollbar:function(){var horizontalScrollContainerInner,horizontalScrollContainer;horizontalScrollContainerInner=this.container().find("#"+this.id()+"_horizontalScrollContainer div");horizontalScrollContainerInner.css("width",this._calculateContainerWidth(false));horizontalScrollContainer=this._vhorizontalcontainer();if(horizontalScrollContainer.width()>horizontalScrollContainerInner.width()){horizontalScrollContainer.css("display","none")}else{horizontalScrollContainer.css("display","")}},_generateColumnFlatStructure:function(treeStructure){var cols,oldCols,newCols=[];cols=treeStructure.slice(0);oldCols=treeStructure.slice(0);this._multiColumnIdentifier=0;this._maxLevel=this._getMaxLevelRecursive(0,cols);this._hiddenColumns={};this._analyzeMultiColumnHeaders(cols,newCols,0,oldCols,[]);this._oldCols=oldCols;this.options.columns=newCols},moveColumn:function(column,target,after,inDom){var grid=this,found,nColArray,movingParams,hcPreserve;nColArray=this._buildColumnLayoutArray();after=after===null||after===undefined?true:after;inDom=inDom===null||inDom===undefined?true:inDom;movingParams={column:column,target:target,after:after};if(this._oldCols){found=this._performInternalMove(movingParams,this._oldCols);hcPreserve=jQuery.extend(true,{},this._hiddenColumns);this._generateColumnFlatStructure(this._oldCols);this._hiddenColumns=hcPreserve;this._preserveColspans(this._oldCols)}else{found=this._performInternalMove(movingParams,this.options.columns)}column=movingParams.column;target=movingParams.target;after=movingParams.after;if(found===false){throw new Error($.ig.Grid.locale.movingNotAllowedOrIncompatible)}if(inDom===true){this._loadingIndicator.show();setTimeout(function(){grid._columnMovingResets();grid._performDomColumnMove(column,target,after,nColArray);grid._loadingIndicator.hide()},0)}else{this._columnMovingResets();this._performColumnMove(column,target,after,nColArray)}},_columnMovingResets:function(){var i,$th;this._updateHeaderColumnIndexes();delete this._virtualDom;delete this._visibleColumnsArray;this._headerCells=[];for(i=0;i<this.options.columns.length;i++){$th=this.container().find("#"+this.id()+"_"+this.options.columns[i].key).data("columnIndex",i);$th.data("data-mch-order",i);if($th.is(":visible")){this._headerCells.push($th)}}},_preserveColspans:function(cols){var i,cs=0,col,res;for(i=0;i<cols.length;i++){col=cols[i];if(col.group!==undefined&&col.group!==null){res=this._preserveColspans(col.group);col.colspan=res;cs+=res}else{if(col.hidden!==true){cs++}}}return cs},_columnVisible:function(col){return!col.hidden},_buildColumnLayoutArray:function(){var i=0,j=0,col,id,colrs,l,x=0,cCols=this._oldCols?jQuery.extend(true,[],this._oldCols):jQuery.extend(true,[],this.options.columns),nCols,level=0,width=this.container().find("#"+this.id()+" colgroup:first>col").not("[data-skip=true]").length,height=this.container().find("#"+this.id()+(this.options.fixedHeaders===true?"_headers ":" ")+"thead tr").length,array=[];if(height===0&&this.options.showHeader===false){height=1}for(i=0;i<width;i++){array[i]=[]}i=0;while(level<height){nCols=[];while(i<cCols.length){col=cCols[i];if(col.hidden===true){i++;continue}colrs=col.rowspan||1;id=this._getColMarkForLevel(col);l=col.colspan||1;for(j=0;j<l;j++){array[x+j][level]=id}if(col.crs===colrs&&col.group){nCols.push.apply(nCols,$.grep(col.group,this._columnVisible).slice(0))}else{nCols.push(col)}x+=l;i++}cCols=nCols;level++;x=0;i=0}return array},_getColMarkForLevel:function(col){if(!col.crs){col.crs=0}col.crs++;if(col.crs>1){return-1}return col.key||col.identifier},_performInternalMove:function(movingParams,subset){var i=0,j,success=true;i=this._getColIdxById(subset,movingParams.column);if(typeof movingParams.column==="number"){movingParams.column=subset[i].key||subset[i].identifier}if(i||i===0){j=this._getColIdxById(subset,movingParams.target);if(typeof movingParams.target==="number"){movingParams.target=subset[j].key||subset[j].identifier;if(j<i){movingParams.after=false}else{movingParams.after=true}}if(j||j===0){success=success&&this._rearrangeArray(subset,i,1,movingParams.after===true?j+1:j);return success}return false}for(i=0;i<subset.length;i++){if(subset[i].group){if(this._performInternalMove(movingParams,subset[i].group)===true){return true}}}return false},_getColIdxById:function(array,id){var i,col;if(typeof id==="number"){return id}for(i=0;i<array.length;i++){col=array[i];if(col.key){if(col.key===id){return i}}else if(col.identifier){if(col.identifier===id){return i}}}},_getCellIndexByColumnKey:function(key){var i=this._getVisibleIndexByKey(key);return i===-1?i:i+this.element.find("tbody>tr:not([data-grouprow='true']):first").children("th,td[data-skip='true'],td[data-parent]").length},_findColAreaInLayout:function(col,nColArray,depth){var i,j,res={};for(i=0;i<nColArray.length;i++){if(nColArray[i][depth]===col){res.start=i;for(j=i;j<nColArray.length;j++){if(nColArray[j][depth]!==col){break}}res.length=j-i;return res}}return null},_rearrangeArray:function(array,start,length,at){var col,targetAfter=start<at,n;if(start===at||start<0||at<0||start>=array.length||at>array.length){return false}col=array.splice(start,length);for(n=0;n<col.length;n++){array.splice(targetAfter?at-length+n:at+n,0,col[n])}return true},_moveColumnInHeader:function(column,target,after,nColArray){var rmil,movedColumn,targetColumn,targetIndex,targetObject,spStart,spEnd,i,j,cols,n,header;header=this.container().find("#"+this.id()+(this.options.fixedHeaders===true?"_headers ":" ")+">thead");for(j=0;j<nColArray[0].length;j++){movedColumn=this._findColAreaInLayout(column,nColArray,j);if(movedColumn){targetColumn=this._findColAreaInLayout(target,nColArray,j);if(targetColumn){break}}}rmil=[movedColumn,targetColumn];if(this.options.showHeader===false){return rmil}this._moveThs(header,column,target,after);while(++j<nColArray[0].length){cols=[];n=null;for(i=movedColumn.start;i<movedColumn.start+movedColumn.length;i++){if(nColArray[i][j]===-1){continue}if(nColArray[i][j]!==n){n=nColArray[i][j];cols.push(n)}}targetIndex=after===true?targetColumn.start+targetColumn.length-1:targetColumn.start;if(nColArray[targetIndex][j]!==-1){this._moveThs(header,cols,nColArray[targetIndex][j],after);continue}if(after===true){spStart=targetColumn.start+targetColumn.length;spEnd=movedColumn.start>targetColumn.start+targetColumn.length-1?movedColumn.start:nColArray.length;targetObject=this._findTargetRight(spStart,spEnd,j,nColArray);if(!targetObject){spStart=targetColumn.start+targetColumn.length-2;spEnd=movedColumn.start>targetColumn.start+targetColumn.length-1?-1:movedColumn.start+movedColumn.length;targetObject=this._findTargetLeft(spStart,spEnd,j,nColArray)}}else{spStart=targetColumn.start-1;spEnd=movedColumn.start>targetColumn.start+targetColumn.length-1?-1:movedColumn.start+movedColumn.length;targetObject=this._findTargetLeft(spStart,spEnd,j,nColArray);if(!targetObject){spStart=targetColumn.start+1;spEnd=movedColumn.start>targetColumn.start+targetColumn.length-1?movedColumn.start:nColArray.length;targetObject=this._findTargetRight(spStart,spEnd,j,nColArray)}}if(targetObject&&targetObject.pos&&targetObject.left!==undefined&&targetObject.left!==null){this._moveThs(header,cols,nColArray[targetObject.pos][j],targetObject.left)}}return rmil},_moveColumnInBodyFooter:function(area,movedColumn,targetColumn,after){var i,j,trs,$tr,tds,tar,skip;trs=area.find(">tr:not([data-container='true'],[data-grouprow='true'])");if(trs.length>0){skip=trs.eq(0).find("[data-parent],[data-skip='true'],th").length}for(j=0;j<trs.length;j++){tds=$();$tr=trs.eq(j);for(i=movedColumn.start;i<movedColumn.start+movedColumn.length;i++){tds=tds.add($tr.children().eq(i+skip))}if(after===true){tar=$tr.children().eq(targetColumn.start+targetColumn.length+skip-1);tds.detach().insertAfter(tar)}else{tar=$tr.children().eq(targetColumn.start+skip);tds.detach().insertBefore(tar)}}this._updateVerticalScrollbarCellPadding(true)},_findTargetRight:function(start,end,level,nColArray){var i,colFound={};for(i=start;i>=0&&i<end&&i<nColArray.length;i++){if(nColArray[i][level]!==-1){colFound.pos=i;colFound.left=false;return colFound}}},_findTargetLeft:function(start,end,level,nColArray){var i,colFound={};for(i=start;i>=0&&i>end&&i<nColArray.length;i--){if(nColArray[i][level]!==-1){colFound.pos=i;
colFound.left=true;return colFound}}},_moveCols:function(area,movedColumn,targetColumn,after){var i,cols=$(),tCol,skip=area.children("[data-skip='true']").length;for(i=movedColumn.start;i<movedColumn.start+movedColumn.length;i++){cols=cols.add(area.children().eq(i+skip))}if(after===true){tCol=area.children().eq(targetColumn.start+targetColumn.length+skip-1);cols.detach().insertAfter(tCol)}else{tCol=area.children().eq(targetColumn.start+skip);cols.detach().insertBefore(tCol)}},_moveThs:function(header,ids,tar,after){var $tar,$ids=$(),$id,i,$pid;$tar=header.find("th[data-mch-id='"+tar+"'],th[id='"+this.id()+"_"+tar+"']");if(typeof ids==="object"){for(i=0;i<ids.length;i++){$id=header.find("th[data-mch-id='"+ids[i]+"'],th[id='"+this.id()+"_"+ids[i]+"']");if($id.attr("data-vscr-padding-icrement")){$pid=$id}$ids=$ids.add($id)}}else{$ids=header.find("th[data-mch-id='"+ids+"'],th[id='"+this.id()+"_"+ids+"']");if($ids.attr("data-vscr-padding-icrement")){$pid=$ids}}$ids.detach();if(after){$ids.insertAfter($tar)}else{$ids.insertBefore($tar)}if($tar.attr("data-vscr-padding-icrement")&&after===true){$ids.last().css(this._padding,$tar.css(this._padding)).attr("data-vscr-padding-icrement",$tar.attr("data-vscr-padding-icrement"));$tar.css(this._padding,"");$tar.removeAttr("data-vscr-padding-icrement")}else if($pid){$pid.parent().children(":last").css(this._padding,$pid.css(this._padding)).attr("data-vscr-padding-icrement",$pid.attr("data-vscr-padding-icrement"));$pid.css(this._padding,"");$pid.removeAttr("data-vscr-padding-icrement")}},_moveSpecialThs:function(movedColumn,targetColumn,after){var i,j,spTrs,header,skip,ths,$tr,tar;header=this.container().find("#"+this.id()+(this.options.fixedHeaders===true?"_headers ":" ")+"thead");spTrs=header.find(">tr[data-role]");if(spTrs.length>0){skip=spTrs.eq(0).find("[data-parent],[data-skip='true']").length}for(j=0;j<spTrs.length;j++){ths=$();$tr=$(spTrs[j]);for(i=movedColumn.start;i<movedColumn.start+movedColumn.length;i++){ths=ths.add($tr.children("td,th").eq(i+skip))}if(after===true){tar=$tr.children().eq(targetColumn.start+targetColumn.length+skip-1);ths.detach().insertAfter(tar)}else{tar=$tr.children().eq(targetColumn.start+skip);ths.detach().insertBefore(tar)}}},_performDomColumnMove:function(column,target,after,nColArray){var rmil=this._moveColumnInHeader(column,target,after,nColArray),movedColumn=rmil[0],targetColumn=rmil[1],footer;this._moveSpecialThs(movedColumn,targetColumn,after);if(this.options.fixedHeaders===true){this._moveCols(this.container().find("#"+this.id()+"_headers>colgroup"),movedColumn,targetColumn,after)}this._moveColumnInBodyFooter(this.element.find(">tbody"),movedColumn,targetColumn,after);this._moveCols(this.element.find(">colgroup"),movedColumn,targetColumn,after);if(this.options.fixedFooters===true){footer=this.footersTable();this._moveColumnInBodyFooter(footer.children("tfoot"),movedColumn,targetColumn,after);this._moveCols(footer.children("colgroup"),movedColumn,targetColumn,after)}else{this._moveColumnInBodyFooter(this.element.find("tfoot"),movedColumn,targetColumn,after)}this._trigger("_columnsmoved",null,{owner:this,start:movedColumn.start,len:movedColumn.length,index:after===true?targetColumn.start+targetColumn.length:targetColumn.start})},_performColumnMove:function(column,target,after,nColArray){var rmil=this._moveColumnInHeader(column,target,after,nColArray),movedColumn=rmil[0],targetColumn=rmil[1];if(this.options.fixedHeaders===true){this._moveCols(this.container().find("#"+this.id()+"_headers>colgroup"),movedColumn,targetColumn,after)}this._renderData();this._renderFooter();this._rerenderColgroups()},showColumn:function(column){var grid=this;this._loadingIndicator.show();setTimeout(function(){grid._setHidden(column,false);grid._loadingIndicator.hide()},0)},hideColumn:function(column){var grid=this;this._loadingIndicator.show();setTimeout(function(){grid._setHidden(column,true);grid._loadingIndicator.hide()},0)},_setHidden:function(column,hidden){var col;if(typeof column==="number"){col=this.options.columns[column]}else{col=this.columnByKey(column)}if(col&&col.hidden!==hidden){this._setHiddenColumns([col],hidden,false)}if(this.options.rowTemplate!==null){this.options.rowTemplate=this._buildRowTemplateRaw(true);this._tmpl=null}},_setHiddenColumns:function(columns,hidden,initial){var columnNumberChanged=false,self=this,hasVirtualization=this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true,hasColumnVirtualization=this.options.virtualizationMode!=="continuous"&&(this.options.virtualization===true&&this.options.width||this.options.columnVirtualization===true),isContinuos=false,visibleColumnsLength,visibleColumnsWithWidthLength,gridWidth,hasNoWidthPercentage,overflow,colgroup;if(columns.length===0){return}this._fireInternalEvent("_hidingFinishing");if(hasVirtualization){isContinuos=this.options.virtualizationMode==="continuous";self._updateVirtColCounters();if(!isContinuos){$.each(columns,function(index,col){var oldVirtualColumnCount=self._virtualColumnCount;col.hidden=hidden;self._visibleColumnsArray=undefined;self._updateVirtColCounters();if(self._virtualColumnCount!==oldVirtualColumnCount){if(self._virtualColumnCount<oldVirtualColumnCount){self._detachColumn(col)}else if(self._virtualColumnCount>oldVirtualColumnCount){self._attachColumn(col)}columnNumberChanged=true;self._virtualDom=null}});if(hasColumnVirtualization){this._vheaders=undefined;this._updateVirtualHorizontalScrollbar();this._onVirtualHorizontalScroll();if(!this._initialized){this._adjustLastColumnWidth(true)}}this._renderVirtualRecords()}}if(!hasVirtualization||isContinuos){$.each(columns,function(index,col){col.hidden=hidden;self._visibleColumnsArray=undefined;if(col.hidden){self._detachColumn(col)}else{self._attachColumn(col)}});this._cleanupTBody();columnNumberChanged=true;if(hasVirtualization){this._renderVirtualRecords()}else{this._renderRecords()}}if(columnNumberChanged){if(!this._initialized){this._rerenderColgroups(initial);this._adjustLastColumnWidth(true)}else{if(this._visibleColumns().length>0){this._rerenderColgroups(initial);this._adjustLastColumnWidth(true);visibleColumnsLength=this._visibleColumns().length;visibleColumnsWithWidthLength=$.grep(this._visibleColumns(),function(col){return col.width}).length;if(visibleColumnsWithWidthLength===visibleColumnsLength){if(this.options.width&&parseInt(this.options.width,10)>0){this._updateGridContentWidth()}else{this._setContainerWidth(this.container());if(hasVirtualization){gridWidth=this._calculateContainerWidth(true);if(this.options.height!==null){gridWidth-=this._scrollbarWidth()}this._vdisplaycontainer().css("width",gridWidth).css("max-width",gridWidth)}}}}}}this._fireInternalEvent("_hidingFinished");this.element.trigger("iggriduisoftdirty",{owner:this});this._trigger(this.events.columnsCollectionModified,null,{owner:this});if(columnNumberChanged&&hasVirtualization&&this._visibleColumns().length>0&&visibleColumnsWithWidthLength===visibleColumnsLength){if(this.options.virtualizationMode==="continuous"){gridWidth+=this._calculateSpecialColumnsWidth();this._vdisplaycontainer().css("width",gridWidth).css("max-width",gridWidth)}this.container().find("#"+this.id()+"_virtualContainer>colgroup col").eq(0).attr("width",gridWidth);if(this.options.width===null||this.options.width===undefined){this._setContainerWidth(this.container().find("#"+this.id()+"_headers_v"))}}this._origWidth=parseInt(this.container().css("width"),10);if(columnNumberChanged&&$.ig.util.isSafari&&this.options.showHeader){this._refreshUI()}if(columnNumberChanged&&($.ig.util.isFF||$.ig.util.isIE8)){hasNoWidthPercentage=false;if($.ig.util.isIE8&&typeof this.options.width==="string"&&this.options.width.indexOf("%")!==-1){this._refreshUI()}if(this.options.fixedHeaders===true&&this.options.height!==null||this.options.showHeader===false){colgroup=this.element.children("colgroup").detach();this.element.prepend(colgroup);if(this.options.width||this.options.defaultColumnWidth&&this.options.defaultColumnWidth.indexOf("%")===-1){hasNoWidthPercentage=true}colgroup.find("col").each(function(){var w=this.style.width;if(w&&w.indexOf("%")===-1){hasNoWidthPercentage=false;return false}})}overflow=this.element[0].style.overflow;this.element[0].style.overflow="hidden";setTimeout(function(){self.element[0].style.overflow=overflow},0);if(this.options.showHeader){colgroup=this.headersTable().children("colgroup").detach();this.headersTable().prepend(colgroup);if(hasNoWidthPercentage){overflow=this.headersTable()[0].style.overflow;this.headersTable()[0].style.overflow="hidden";setTimeout(function(){self.headersTable()[0].style.overflow=overflow},0)}}if(this.options.fixedFooters===true&&this.options.height!==null){colgroup=this.footersTable().children("colgroup").detach();this.footersTable().prepend(colgroup);if(hasNoWidthPercentage){overflow=this.footersTable()[0].style.overflow;this.footersTable()[0].style.overflow="hidden";setTimeout(function(){self.footersTable()[0].style.overflow=overflow},0)}}}},_calculateSpecialColumnsWidth:function(){var width=0;this.headersTable().find("> colgroup > col[data-skip=true]").each(function(){var colWidth=this.style.width;if(colWidth){width+=parseInt(colWidth,10)}});if(width>0){this._origSum=width}return width},_allSpecialColumnsInPercentage:function(){var specCols=this.headersTable().find("> colgroup > col[data-skip=true]"),i;for(i=0;i<specCols.length;i++){if(!specCols[i].style.width.endsWith("%")){return false}}return true},_synchronizeHScroll:function(){var hasFixedHeaders=this.options.showHeader&&this.options.fixedHeaders===true&&this.options.height!==null,hasFixedFooters=this.options.showFooter&&this.options.fixedFooters===true&&this.options.height!==null,scroller=this._hscrollbarcontent(),scrollContainer=this.scrollContainer(),horizontalScrollContainer=this._vhorizontalcontainer(),scrLeft=scroller.scrollLeft(),headers,footers;if(scroller.length===0&&horizontalScrollContainer.length===1){scrLeft=horizontalScrollContainer.scrollLeft();this._vdisplaycontainer().scrollLeft(scrLeft)}else{scrollContainer.scrollLeft(scrLeft);if(scrollContainer.scrollLeft()!==0||this.element.height()!==0){scrLeft=scrollContainer.scrollLeft();scroller.scrollLeft(scrLeft)}}if(hasFixedHeaders){headers=this.headersTable().parent();headers.scrollLeft(scrLeft)}if(hasFixedFooters){footers=this._fixedfooters();footers.scrollLeft(scrLeft)}},_updateGridContentWidth:function(){var gridWidth=0,scroller,scrLeft,hasFixedHeader=this.options.height!==null&&this.options.fixedHeaders===true&&this.options.showHeader&&this._headerParent;$.each(this._visibleColumns(),function(index,col){if(gridWidth!==undefined&&col.width&&!(col.width.charAt&&col.width.endsWith("%"))){gridWidth+=parseInt(col.width,10)}else{gridWidth=undefined}});if(gridWidth===undefined){return}gridWidth+=this._calculateSpecialColumnsWidth();if(!hasFixedHeader&&this._hasVerticalScrollbar){gridWidth-=this._scrollbarWidth()}if(this.options.width!==null&&this.options.height!==null){scroller=this._hscrollbarcontent();scrLeft=scroller.scrollLeft()}this._setGridContentWidth(gridWidth);if(this.options.height!==null&&this.options.width!==null){this._updateVerticalScrollbarCellPadding()}if(this.options.width!==null&&this.options.height!==null){scroller.scrollLeft(scrLeft);this._synchronizeHScroll()}},_updateVerticalScrollbarCellPadding:function(skipHeaderFooters){var hasFixedHeaders=this.options.showHeader&&this.options.fixedHeaders===true&&this.options.height!==null,hasFixedFooters=this.options.showFooter&&this.options.fixedFooters===true&&this.options.height!==null,emptySpace,paddingIncrement;if(this.options.height===null){return}if(!hasFixedHeaders&&!hasFixedFooters){return}if(this._gridInnerWidth===undefined||this._gridContentWidth===undefined){emptySpace=0}else{emptySpace=this._gridInnerWidth-this._gridContentWidth}if(this._hasVerticalScrollbar){paddingIncrement=this._scrollbarWidth()}else{paddingIncrement=0}if(emptySpace>=0){paddingIncrement-=emptySpace}if(paddingIncrement<0){paddingIncrement=0}if(hasFixedHeaders&&!skipHeaderFooters){this._increaseLastHeaderCellVScrollbarPadding(this.headersTable(),paddingIncrement)}if(hasFixedFooters&&!skipHeaderFooters){this._increaseLastCellVScrollbarPadding(this.footersTable(),"tfoot","td",paddingIncrement)}this._increaseLastCellVScrollbarPadding(this.element,"tbody","td",paddingIncrement)},_increaseLastHeaderCellVScrollbarPadding:function(table,paddingIncrement){var lastCells=table.children("thead").children("tr").not("[data-skip=true]").children("th:last-child").not("[data-skip=true]"),currIncrement=parseInt(lastCells.first().attr("data-vscr-padding-icrement"),10),paddingValue;paddingValue=parseInt(lastCells.first().css(this._padding),10);if(currIncrement){paddingValue-=currIncrement}lastCells.css(this._padding,paddingValue+paddingIncrement);lastCells.first().attr("data-vscr-padding-icrement",paddingIncrement);lastCells.find("[data-nonpaddedindicator=right]").css(this._rtl?"margin-left":"margin-right",-parseInt(lastCells.css(this._padding),10)+"px")},_increaseLastCellVScrollbarPadding:function(table,tableGroup,rowElement,paddingIncrement){var i,cells,$cell,lastCells=table.find(" > "+tableGroup+" > tr > "+rowElement+":last-child"),currIncrement=parseInt(lastCells.first().attr("data-vscr-padding-icrement"),10),paddingValue;cells=table.find(" > "+tableGroup+" > tr:first > "+rowElement+":not(:last)[data-vscr-padding-icrement]");for(i=0;i<cells.length;i++){$cell=$(cells[i]);$cell.removeAttr("data-vscr-padding-icrement");table.find(" > "+tableGroup+" > tr > "+rowElement+":nth-child("+($cell.index()+1)+")").css(this._padding,"")}paddingValue=parseInt(lastCells.first().css(this._padding),10);if(currIncrement){paddingValue-=currIncrement}lastCells.css(this._padding,paddingValue+paddingIncrement);lastCells.first().attr("data-vscr-padding-icrement",paddingIncrement)},_updateHScrollbarVisibility:function(){var scrollerContainer=this._hscrollbar(),scrollerWasHidden=scrollerContainer.css("display")==="none";scrollerContainer.css("display","");if(this._gridInnerWidth<this._gridContentWidth){if(this.options.virtualizationMode==="continuous"&&scrollerContainer.length===0&&this._getHScrollContainerInner().length===0){this._renderHorizontalScrollContainer(this._calculateContainerWidth(false));scrollerWasHidden=true}if(scrollerWasHidden){if(this.options.autoAdjustHeight){this._initializeHeights()}}}else{if(this.options.virtualizationMode==="continuous"&&scrollerContainer.length===0&&this._getHScrollContainerInner().length===1){this._vhorizontalcontainer().empty().attr("style","");scrollerWasHidden=false}scrollerContainer.css("display","none");if(!scrollerWasHidden){if(this.options.autoAdjustHeight){this._initializeHeights()}}}},_setGridContentWidth:function(gridContentWidth){var o=this.options,v=o.virtualization===true||o.rowVirtualization===true||o.columnVirtualization===true;if(this.options.height!==null){if(gridContentWidth){this._gridContentWidth=gridContentWidth}if(this._gridContentWidth){this._getHScrollContainerInner().css("width",this._hasVerticalScrollbar&&this.options.fixedHeaders?this._gridContentWidth-this._scrollbarWidth():this._gridContentWidth)}this._updateHScrollbarVisibility()}if(v===false){this._setGridTablesWidth(gridContentWidth)}},_setGridTablesWidth:function(width){var hasFixedHeaders=this.options.showHeader&&this.options.fixedHeaders===true&&this.options.height!==null,hasFixedFooters=this.options.showFooter&&this.options.fixedFooters===true&&this.options.height!==null;this.element.width(width);if(hasFixedHeaders){this.headersTable().width(width)}if(hasFixedFooters){this.footersTable().width(width)}},_detachHiddenColumns:function(){var col,i;for(i=0;i<this.options.columns.length;i++){col=this.options.columns[i];if(col.hidden){this._detachColumn(col)}}},_rerenderColgroups:function(){var hasFixedHeader=this.options.height!==null&&this.options.fixedHeaders===true&&this.options.showHeader,hasFixedFooter=this.options.height!==null&&this.options.fixedFooters===true&&this.options.showFooter,initial=this.options.autofitLastColumn;if(hasFixedHeader){this.headersTable().children("colgroup").remove();this._renderColgroup(this.headersTable()[0],true,false,initial)}if(hasFixedFooter){this.footersTable().children("colgroup").remove();this._renderColgroup(this.footersTable()[0],false,true,initial)}this.element.children("colgroup").remove();this._renderColgroup(this.element[0],false,false,initial)},_detachColumn:function(col){var position,cols,headerCells,isMultiColumnGrid=this._isMultiColumnGrid;col.hidden=false;this._visibleColumnsArray=undefined;cols=this._visibleColumns();position=$.inArray(col,cols);col.hidden=true;this._visibleColumnsArray=undefined;this._initializeDetachedContainers();headerCells=this.headersTable().children("thead").children("tr").not("[data-skip=true]");if(isMultiColumnGrid){this._hideMultiHeaderCells(this._headerCells,position,col.key);headerCells=this.headersTable().children("thead").children("tr:not([data-mch-level])").not("[data-skip=true]");this._detachCells(headerCells,function(row){return row.children("th, td").not("[data-skip=true]")},position,this._detachedHeaderCells,col.key)}else{this._detachCells(headerCells,function(row){return row.children("th, td").not("[data-skip=true]")},position,this._detachedHeaderCells,col.key)}this._detachCells(this.footersTable().children("tfoot").children("tr"),function(row){return row.children("td").not("[data-skip=true]")},position,this._detachedFooterCells,col.key)},_attachColumn:function(col){var headerCells,visibleCols=this._visibleColumns(),position=$.inArray(col,visibleCols);this._initializeDetachedContainers();if(this._isMultiColumnGrid){this._showMultiHeaderCells(col.key);headerCells=this.headersTable().children("thead").children("tr:not([data-mch-level])").not("[data-skip=true]");this._attachCells(headerCells,function(row){return row.children("th, td").not("[data-skip=true]")},position,this._detachedHeaderCells,col.key)}else{this._attachCells(this.headersTable().children("thead").children("tr").not("[data-skip=true]"),function(row){return row.children("th, td").not("[data-skip=true]")},position,this._detachedHeaderCells,col.key)}this._attachCells(this.footersTable().children("tfoot").children("tr"),function(row){return row.children("td").not("[data-skip=true]")},position,this._detachedFooterCells,col.key)},_initializeDetachedContainers:function(){if(!this._detachedContainersInitialized){this._detachedHeaderCells={};this._detachedFooterCells={};this._detachedContainersInitialized=true}},_getParentsMultiHeader:function(key){var i,cols=this._oldCols,colsLength=cols.length,arr=[];for(i=0;i<colsLength;i++){if(cols[i].key===key||cols[i].identifier===key){arr.push(cols[i]);break}if(cols[i].group){if(this._getParentsMultiHeaderRecursive(key,cols[i].group,arr)===true){arr.push(cols[i]);break}}}return arr},_getParentsMultiHeaderRecursive:function(key,arr,resArr){var i,cols=arr,colsLength=arr.length,res=false;for(i=0;i<colsLength;i++){if(cols[i].key===key||cols[i].identifier===key){resArr.push(cols[i]);res=true;break}if(cols[i].group&&this._getParentsMultiHeaderRecursive(key,cols[i].group,resArr)===true){resArr.push(cols[i]);res=true;break}}return res},_hideMultiHeaderCells:function(headerCells,position,key){var i,currentCell,parents=this._getParentsMultiHeader(key),parent,colspan,$th,headersTable=this.headersTable().find("thead > tr");currentCell=headerCells[position];this._headerCells.splice(position,1);currentCell.css("display","none");this._hiddenColumns[key]=currentCell;if(parents.length>0){for(i=0;i<parents.length;i++){parent=parents[i];if(parent.level===0){continue}$th=headersTable.find("th[data-mch-id="+parent.identifier+"]");colspan=parseInt($th.attr("colspan"),10);if(colspan>1){$th.attr("colspan",--colspan);parent.colspan=colspan}else{$th.attr("ishidden",1);$th.css("display","none");parent.hidden=true;parent.colspan=0}}}},_detachCells:function(rows,cellSelectorFunction,position,container,key){var detachedCells=[],i,cells,currentCell;if(rows.length>0){for(i=0;i<rows.length;i++){cells=cellSelectorFunction(rows.eq(i));currentCell=cells.eq(position);if(cells.length===1){currentCell.after($("<"+currentCell[0].tagName+"></"+currentCell[0].tagName+">").attr("data-hiddenreplacement","true").css("height",currentCell.height()).attr("class",currentCell.attr("class")))}detachedCells.push(currentCell.detach())}container[key]=detachedCells}},_showMultiHeaderCells:function(key){var i,currentCell=this._hiddenColumns[key],parents=this._getParentsMultiHeader(key),parent,colspan,$th,currentOrder,order,headerCellsLength=this._headerCells.length,headersTable=this.headersTable().find("thead > tr"),isHidden;if(currentCell===null||currentCell===undefined){return}currentOrder=currentCell.data("data-mch-order");for(i=0;i<headerCellsLength;i++){order=this._headerCells[i].data("data-mch-order");if(currentOrder<order){this._headerCells.splice(i,0,currentCell);break}}if(i===headerCellsLength){this._headerCells.push(currentCell)}currentCell.css("display","");currentCell.removeAttr("ishidden");if(parents.length>0){for(i=0;i<parents.length;i++){parent=parents[i];if(parent.level===0){continue}$th=headersTable.find("th[data-mch-id="+parent.identifier+"]");isHidden=$th.attr("ishidden")==="1";colspan=parseInt($th.attr("colspan"),10);if(!isHidden){$th.attr("colspan",++colspan);parent.colspan=colspan}else{$th.removeAttr("ishidden");$th.css("display","");parent.hidden=false;parent.colspan=1}}}},_attachCells:function(rows,cellSelectorFunction,position,container,key){var detachedCells,i,cells,replacementCell,storedKey;if(rows.length>0){if(this.options.virtualization===true||this.options.columnVirtualization===true){detachedCells=container[key];if(detachedCells===null||detachedCells===undefined){for(storedKey in container){if(container.hasOwnProperty(storedKey)){detachedCells=container[storedKey];delete container[storedKey];break}}}else{delete container[key]}}else{detachedCells=container[key];delete container[key]}if(detachedCells===undefined||detachedCells===null){return}for(i=0;i<rows.length;i++){cells=cellSelectorFunction(rows.eq(i)).not("[data-hiddenreplacement=true]");if(position===0){if(cells.length===0){replacementCell=rows.eq(i).find("[data-hiddenreplacement=true]");replacementCell.after(detachedCells[i]);replacementCell.remove()}else{cells.eq(0).before(detachedCells[i])}}else{cells.eq(position-1).after(detachedCells[i])}}}},_cleanupTBody:function(){var tbody=this.element.children("tbody");if($.ui.igGrid.speedupDOMCleanup===false){tbody.empty()}else{if(tbody.children().length>0){this.element[0].removeChild(tbody[0]);tbody=$("<tbody></tbody>").appendTo(this.element).addClass(this.css.baseContentClass).addClass(this.css.gridTableBodyClass).addClass(this.css.recordClass)}}return tbody},_captureInitiallyHiddenColumns:function(){this._initialHiddenColumns=$.grep(this.options.columns,function(column,index){var hidden=column.hidden;column.hidden=false;return hidden})},getUnboundValues:function(key){var res;if(key===undefined||key===null){return this._unboundValues}res=this._unboundValues[key];if(res===undefined||res===null){if(this.getUnboundColumnByKey(key)!==null){res=[]}else{res=null}}return res},setUnboundValues:function(key,values,removeOldValues){var i,column=this.getUnboundColumnByKey(key),uVals,data,len,reRenderData=false;if(column&&!column.formula){uVals=column.unboundValues;if(removeOldValues){column.unboundValues=values;data=this.dataSource.data();len=data.length;for(i=0;i<len;i++){if(data[i][key]!==null&&data[i][key]!==undefined){reRenderData=true;delete data[i][key]}}if(reRenderData){this._renderData()}}else{len=values.length;if(uVals&&uVals.length>len){for(i=0;i<len;i++){column.unboundValues[i]=values[i]}}else{column.unboundValues=values}}}if(!this._hasInitialUnboundValues){this._hasInitialUnboundValues={}}this._hasInitialUnboundValues[key]=true;this._renderUnboundValues(values,key)},_renderUnboundValues:function(values,key,notToRender){var i,data=this.dataSource.data(),dataLength=data.length,valuesLength=values.length,isToConvert=false,type="string",pk=this.options.primaryKey,col,schema,pkVal;if(valuesLength===0){return}col=this.getUnboundColumnByKey(key);if(col===null){return}if(this.dataSource&&this.dataSource.schema){if(col.dataType){type=col.dataType;isToConvert=true;schema=this.dataSource.schema()}}if(pk===undefined){pk=null}for(i=0;i<valuesLength;i++){if(data[i]===undefined||data[i]===null){break}if(isToConvert){if(pk===null){pkVal=i}else{pkVal=data[i][pk]}values[i]=schema._convertType(type,values[i],pkVal,key)}data[i][key]=values[i];this._addUnboundColumnValue(key,values[i],i)}if((type==="bool"||type==="boolean")&&valuesLength<dataLength){for(i=valuesLength;i<dataLength;i++){data[i][key]=schema._convertType(type,null,pkVal,key)}}if(this.options.virtualization===true||this.options.rowVirtualization===true){this._scrollTo(0)}if(notToRender!==true){this._renderColumnData(key,this.dataSource.dataView())}},getUnboundColumnByKey:function(key){if(this._unboundColumns===undefined||this._unboundColumns===null||this._unboundColumns.length===0||key===null||key===undefined){return null}var column=null;$.each(this._unboundColumns,function(ind,col){if(col.key===key){column=col;return false}});return column},_renderColumnData:function(key,values){if(values.length===0){return}var visibleColumns=this._visibleColumns(),grid=this,tdIndex,index,tds,column,ds,isToConvertToString=false,hasTemplate=grid.options.rowTemplate&&grid.options.rowTemplate.length>0;index=this._getVisibleIndexByKey(key);column=visibleColumns[index];if(column===undefined||column===null){return}isToConvertToString=column.dataType==="bool";if(hasTemplate){ds=this.dataSource.dataView()}tdIndex=index+this.headersTable().find(">thead>tr:eq(0)>th[data-skip=true]").length;tds=this.element.find(">tbody> tr > td:not([data-skip]):nth-child("+(tdIndex+1)+")");$.each(values,function(ind,val){var innerHtml;if(val[key]===undefined){return true}if(hasTemplate){innerHtml=grid._renderTemplatedCell(ds[ind],column).substring(1)}else{innerHtml=grid._renderCell(val[key],column,val);if(isToConvertToString===true){innerHtml=innerHtml.toString()}}if(!tds[ind]){return false}$(tds[ind]).html(innerHtml)})},_renderData:function(success,errmsg,response){if(!(this._isDataBoundCalled===true&&success===undefined)||success!==undefined){this._trigger(this.events.dataBound,null,{owner:this});this._isDataBoundCalled=false}var gridElement=this.element,self=this,noCancel=true,sum=0,cols,colsToUnbound,colsLength,data,key,j,i,diff=0,isTable=false,noCancelError=true,isRemoteDS=this._inferOpType()==="remote",ucFormulaFunction,tbody,newW,totalWidth,isToRefreshUI=false,displayCont;if((this.options.requiresDataBinding===true||this._isToSetUnboundColumns===true||isRemoteDS)&&this._hasUnboundColumns){this._isToSetUnboundColumns=false;if(this._hasInitialUnboundValues===null||this._hasInitialUnboundValues===undefined){this._hasInitialUnboundValues={}}cols=this.options.columns;colsLength=cols.length;data=this.dataSource.data();ucFormulaFunction=function(ind,val){if($.type(cols[i].formula)==="function"){val[key]=cols[i].formula(val,gridElement)}else{val[key]=eval(cols[i].formula+"(val, gridElement)")}self._addUnboundColumnValue(key,val[key],ind)};colsToUnbound=[];if(isRemoteDS){this._unboundValues={}}for(i=0;i<colsLength;i++){if(cols[i].unbound===true){key=cols[i].key;if(cols[i].unboundValues!==null&&cols[i].unboundValues!==undefined&&$.type(cols[i].unboundValues)==="array"){if(this._rebindUnboundColumns===true||cols[i].unboundValues.length>0&&this._hasInitialUnboundValues[key]===undefined){this._hasInitialUnboundValues[key]=true;this._renderUnboundValues(cols[i].unboundValues,key,true)}}else if(cols[i].formula!==null&&cols[i].formula!==undefined){$.each(data,ucFormulaFunction)}else if(this._unboundValues[key]&&this._unboundValues[key].length>0){colsToUnbound.push(key)}}}this._rebindUnboundColumns=false;if(this.options.localSchemaTransform===true&&colsToUnbound.length>0&&data.length>0){for(i=0;i<colsToUnbound.length;i++){key=colsToUnbound[i];if(data[0][key]===undefined){this._renderUnboundValues(this._unboundValues[key],key)}}}if(this.options.mergeUnboundColumns===false){this._mergeUnboundValues()}}if(success===false){noCancelError=this._trigger(this.events.requestError,null,{owner:this,message:errmsg,response:response});if(noCancelError){throw new Error(errmsg)}}if(this._cancelRendering===true){this._cancelRendering=false;return}this.element.trigger("iggriduisoftdirty",{owner:this});if(!this._initialized){if(this.options.autoGenerateColumns===true){this._generateColumns();if((this.options.virtualization===true||this.options.columnVirtualization===true)&&this.options.width){totalWidth=this._calculateContainerWidth(false);if(totalWidth>parseInt(this.options.width,10)&&this._vhorizontalcontainer().children().length===0){this._renderHorizontalScrollContainer(totalWidth)}}for(i=0;i<this.options.features.length;i++){this._initFeature(this.options.features[i],this._dataOptions)}}}tbody=gridElement.children("tbody");noCancel=this._trigger(this.events.dataRendering,null,{owner:this,tbody:tbody});if(noCancel){if(!(this.options.dataSource&&this.options.dataSource.tagName&&$(this.options.dataSource).is("table"))){tbody=this._cleanupTBody()}else{isTable=true}this._virtualDom=null;if(!this._initialized){if(this.options.autoGenerateColumns===true){this._captureInitiallyHiddenColumns();this._visibleColumnsArray=undefined;this._updateVirtColCounters()}if(isTable){tbody.empty()}if(this._renderHeaderCalled!==true){this._renderHeader();this._renderCaption()}else{if(this.options.width!==null&&this.options.height===null){this.scrollContainer().css("overflow-y","hidden").css("overflow-x","auto")}}if(this.element.find("colgroup").length===0||this.element.find("colgroup").children().length===0){this._renderColgroup(this.element[0],false,false,this.options.autofitLastColumn)}this._renderFooter()}this._trigger("dataEmpty",null,{owner:this,tbody:tbody});if(this.options.autoGenerateColumns===false&&(this.options.columns&&this.options.columns.length===0||!this.options.columns)){throw new Error($.ig.Grid.locale.noColumnsButAutoGenerateTrue)}if(this._hasColumnTemplates()&&this.options.rowTemplate===null){this.options.rowTemplate=this._buildRowTemplateRaw()}if(this.options.rowTemplate&&!this._tmap){this._initializeTmap()}if(this._initialHiddenColumns===undefined||this._initialHiddenColumns.length===0){if(this.options.columns.length>0){if(this.options.virtualization===true||this.options.rowVirtualization===true||this.options.columnVirtualization===true){this._scrollContainer().scrollTop(0);this._renderVirtualRecords()}else{this._renderRecords()}if(this._initialized){this._adjustLastColumnWidth(false);if(this.options.width!==null&&this.options.height!==null){this._synchronizeHScroll()}}else{if(this.options.height!==null&&this.options.autoAdjustHeight){this._initializeHeights()}this._adjustLastColumnWidth(true)}}}if(!this._initialized){if(this.options.autoAdjustHeight){this._initializeHeights()}}if(this._initialHiddenColumns!==undefined&&this._initialHiddenColumns.length>0){this._setHiddenColumns(this._initialHiddenColumns,true,true);if(this._initialHiddenCells!==undefined&&this._initialHiddenCells.length>0){$.each(this._initialHiddenCells,function(index,cell){cell.css("display","")})}$.each(this._initialHiddenColumns,function(index,column){column._initiallyHidden=true});this._initialHiddenCells=undefined;this._initialHiddenColumns=undefined;if($.ig.util.isFF){isToRefreshUI=true}}if(this.options.rowTemplate!==null&&this._hasOptionsRowTemplate===false){this.options.rowTemplate=this._buildRowTemplateRaw(true);this._tmpl=null}this._registerAdditionalEvents();this._trigger(this.events.dataRendered,null,{owner:this});this._updateVirtualScrollContainer();this._fireInternalEvent("_dataRendered");if(this._loadingIndicator===undefined){this._initLoadingIndicator()}this._loadingIndicator.hide()}if(this._fixScrollY){this.scrollContainer().css("overflow-y",this.rows().length>1?"hidden":"visible")
}if(this.options.width===null&&this.container()[0]&&this.container()[0].style.width){cols=this.element.find("colgroup > col[data-skip]");if(cols.length>0){for(j=0;j<cols.length;j++){sum+=parseInt(cols[j].style.width,10)}}if(!this._origSum){this._origSum=0}diff=sum-this._origSum;if(diff<0){diff=0}newW=parseInt(this.container()[0].style.width,10)+diff;this.container().css("width",newW);displayCont=this._vdisplaycontainer();if(displayCont.length>0){displayCont.css("width",newW-this._scrollbarWidth()).css("max-width",newW-this._scrollbarWidth());this.container().find("#"+this.id()+"_headers_v").css("width",newW);this._fixedfooters().css("width",newW)}this._origSum=sum}if(this.options.dataSourceUrl!==null&&this._firstBind){this.options.dataSource=this.options.dataSourceUrl;this.dataSource.settings.dataSource=this.options.dataSourceUrl;this.dataSource.settings.type="remoteUrl";this.dataSource._runtimeType=this.dataSource.analyzeDataSource();this._firstBind=false}if(!this._initialized){this._trigger(this.events.rendered,null,{owner:this});this._hc=this.container().find(".ui-iggrid-expandheadercell").length>0;this._initialized=true;if(document.documentMode===7||$.ig.util.isIE7){$.each($("#"+this.id()+"_container colgroup col"),function(){var $col=$(this),styleWidth=parseInt(this.style.width,10),width=$col.outerWidth();if(styleWidth&&styleWidth<width){$col.width(2*styleWidth-width)}})}}if(isToRefreshUI){this._refreshUI()}this._fireInternalEvent("_gridRendered",this.container())},_refreshUI:function(){var self=this;self.container().hide();setTimeout(function(){self.container().show()},0)},_updateVirtualScrollContainer:function(){var headersHeight=0;this._totalRowCount=this._getTotalRowCount();if((this.options.virtualization||this.options.rowVirtualization)&&this._totalRowCount){if(this._avgRowHeight===undefined||this._avgRowHeight===null){this._avgRowHeight=this._calculateAvgRowHeight()}if(this.options.showHeader){headersHeight=this.headersTable().height()}if(this._totalRowCount*this._avgRowHeight<=parseInt(this.options.height,10)-headersHeight){this.element.height("");if(this.options.virtualizationMode==="fixed"){this.element.find(".ui-iggrid-virtualrow").height(this._avgRowHeight)}this._setScrollContainerHeight(this._totalRowCount*this._avgRowHeight)}else{this.element.height(this._initialVirtualHeight);if(this.options.virtualizationMode==="continuous"){this._setScrollContainerHeight(this._totalRowCount*this._avgRowHeight)}}}},_hasColumnTemplates:function(){var i,hasTemplates=false,t;for(i=0;i<this.options.columns.length;i++){t=this.options.columns[i].template;if(t!==null&&t!==undefined&&t!==""&&t.length>0){hasTemplates=true;break}}return hasTemplates},_gridHasWidthInPixels:function(){if(typeof this.options.width==="string"&&this.options.width.indexOf("%")!==-1){return false}return parseInt(this.options.width,10)>0},_gridHasWidthInPercent:function(){if(typeof this.options.width==="string"&&this.options.width.indexOf("%")!==-1){return true}return false},_adjustLastColumnWidth:function(colgroupsRerendered){var grid=this,hasFixedHeader=this.options.height!==null&&this.options.fixedHeaders===true&&this.options.showHeader&&this._headerParent,hasFixedFooter=this.options.height!==null&&this.options.fixedFooters===true&&this.options.showFooter&&this._footerParent,hasHeight=this.options.height&&parseInt(this.options.height,10)>0,hasWidthInPixels=this._gridHasWidthInPixels(),hasWidthInPercent=this._gridHasWidthInPercent(),hasVirtualization=this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true,gridWidth,specialColumnsWidth;if(hasHeight&&!hasVirtualization){if(this.options.autoAdjustHeight&&this.element.height()<=this.scrollContainer().height()||!this.options.autoAdjustHeight&&this.options.avgRowHeight*this.element[0].rows.length<parseInt(this.options.height,10)){this._hasVerticalScrollbar=false}else{this._hasVerticalScrollbar=true}}if(colgroupsRerendered){if(hasVirtualization){if(hasFixedHeader){this._headerParent.css(this._padding,this._scrollbarWidth())}if(hasFixedFooter){this._footerParent.css(this._padding,this._scrollbarWidth())}}if(hasWidthInPixels||hasWidthInPercent){if(this._allColumnWidthsInPixels){gridWidth=this._totalColPixelWidth;specialColumnsWidth=this._calculateSpecialColumnsWidth();if(specialColumnsWidth>0){if(this._autoadjustedColumn&&this._lastColPixelWidth){if(this._autoadjustedColumn.difference<specialColumnsWidth){this._lastColPixelWidth-=this._autoadjustedColumn.difference;gridWidth-=this._autoadjustedColumn.difference-specialColumnsWidth}else{this._lastColPixelWidth-=specialColumnsWidth}this._autoadjustedColumn.width=this._lastColPixelWidth;if(hasFixedHeader){this._lastHeaderCol.css("width",this._lastColPixelWidth+"px")}if(hasFixedFooter){this._lastFooterCol.css("width",this._lastColPixelWidth+"px")}this._lastDataCol.css("width",this._lastColPixelWidth+"px")}else{gridWidth+=specialColumnsWidth}}if(!hasFixedHeader&&this._gridWidthGTColWidth&&this._hasVerticalScrollbar){gridWidth-=this._scrollbarWidth();this._lastColPixelWidth-=this._scrollbarWidth();this._lastDataCol.css("width",this._lastColPixelWidth+"px")}}else if(this._allColumnWidthsInPercentage){gridWidth=this.container().width();specialColumnsWidth=this._calculateSpecialColumnsWidth();if(this._allSpecialColumnsInPercentage()===true&&specialColumnsWidth>0){this._lastColPercentWidth=this._lastColPercentWidth-specialColumnsWidth}this._lastDataCol.css("width",this._lastColPercentWidth+"%");if(hasFixedHeader){this._lastHeaderCol.css("width",this._lastColPercentWidth+"%")}if(hasFixedFooter){this._lastFooterCol.css("width",this._lastColPercentWidth+"%")}}else if(hasWidthInPixels){gridWidth=parseInt(grid.options.width,10)}else if(hasWidthInPercent){gridWidth=this.container().width()}if(!this._allColumnWidthsInPercentage||!hasWidthInPercent){if(hasVirtualization===false){this._gridInnerWidth=this.scrollContainer().width()}else{this._gridInnerWidth=this._vdisplaycontainer().width()+this._scrollbarWidth()}if($.ig.util.isWebKit){setTimeout(function(){grid._setGridContentWidth(gridWidth)},0)}else{grid._setGridContentWidth(gridWidth)}}}}else{this._setGridContentWidth()}if(hasHeight&&!hasVirtualization){if(this.options.width!==null&&this.options.height!==null){if(this._hasVerticalScrollbar){this._hscrollbarcontent().css("overflow-y","scroll")}else{this._hscrollbarcontent().css("overflow-y","hidden")}}if(this._allColumnWidthsInPercentage&&hasWidthInPercent||!(hasWidthInPixels||hasWidthInPercent)){if(this._hasVerticalScrollbar){if(hasFixedHeader){this._headerParent.css(this._padding,this._scrollbarWidth())}if(hasFixedFooter){this._footerParent.css(this._padding,this._scrollbarWidth())}}else{if(hasFixedHeader){this._headerParent.css(this._padding,"")}if(hasFixedFooter){this._footerParent.css(this._padding,"")}}}else{this._updateVerticalScrollbarCellPadding()}}},_initializeHeights:function(){var initialHeight,hscrollerContainerHeight;if(this.options.height===null||this.options.height===undefined){return}initialHeight=parseInt(this.options.height,10);if(this.hasFixedColumns()){if(this.options.showHeader&&this.options.fixedHeaders===true&&this.options.height!==null){initialHeight-=this.fixedHeadersTable().height()}hscrollerContainerHeight=this._hscrollbar().height();if(this.fixedBodyContainer().height()<initialHeight+hscrollerContainerHeight){initialHeight-=hscrollerContainerHeight}}if(this.options.height.indexOf&&this.options.height.indexOf("%")!==-1){this.scrollContainer().height("100%")}else{this.scrollContainer().height(initialHeight)}this._initializeHeightsInternal()},_initializeHeightsInternal:function(){var children,height,i,$child,ch,heightChanged=false,dc=this._vdisplaycontainer(),sc=this._scrollContainer();ch=this.container().height();this._prevContainerHeight=ch;if(this.options.height!==null){children=this.container().children();height=0;for(i=0;i<children.length;i++){$child=$(children[i]);if(($child.attr("id")!==undefined&&!$child.attr("id").endsWith("_scroll")&&!$child.attr("data-fixed-container")&&!$child.attr("id").endsWith("_virtualContainer")&&!$child.attr("id").endsWith("_loading")||!$child.attr("id"))&&$child.is(":visible")&&$child.data("efh")!=="1"){if($child.is("table")&&$child.children().first().is("caption")){height+=$child.children().first().outerHeight()}else{height+=$child.outerHeight()}}}if(height>0){this.scrollContainer().height(ch-height);heightChanged=true}if(this.options.virtualization||this.options.rowVirtualization){if($.type(this.options.height)==="string"&&this.options.height.indexOf("%")!==-1||ch!==parseInt(this.options.height,10)){this.container().height(this.options.height);if($.type(this.options.height)==="string"&&this.options.height.indexOf("%")!==-1){ch=parseInt(this.container().height(),10)}}height+=this.container().find("#"+this.id()+"_headers_v").outerHeight();height+=this.container().find("#"+this.id()+"_footers_v").outerHeight();height+=this._fixedfooters().outerHeight();height+=this._vhorizontalcontainer().outerHeight();if(!this._virtualHeightReset){height=height*2;this._virtualHeightReset=true}if(height>0&&dc.height()!==ch-height){dc.height(ch-height);sc.height(ch-height);this.element.height(ch-height);this._initialVirtualHeight=ch-height;heightChanged=true}}if(heightChanged){this._trigger("_heightChanged",null,{})}}},_registerAdditionalEvents:function(){var css="ui-state-hover",topmostGrid=this.element.closest(".ui-iggrid-root").data("igGrid")||this;if(this.options.enableHoverStyles){if(this._hovEvts){this.element.unbind(this._hovEvts)}this._hovEvts={mousemove:function(e){var par,tag,tr=e.target;while(tr){par=tr.parentNode;tag=tr.nodeName;if(tag==="TR"&&par.nodeName==="TBODY"){break}tr=tag==="TABLE"?null:par}if(_hovTR!==tr){if(_hovTR&&$(_hovTR).attr("data-container")!=="true"){$("td",_hovTR).removeClass(css)}if(tr&&$(tr).attr("data-container")!=="true"&&e.target.id.indexOf("_scrollContainer")===-1&&e.target.parentNode.id.indexOf("_scrollContainer")===-1){if(!topmostGrid._cancelHoveringEffects){$("td",tr).addClass(css)}}_hovTR=tr}},mouseleave:function(e){if(_hovTR){$("td",_hovTR).removeClass(css);_hovTR=null}}};this.element.bind(this._hovEvts)}},_renderColgroup:function(table,isHeader,isFooter,autofitLastColumn){var colgroup,i,cols=this._visibleColumns(),defWidth=this.options.defaultColumnWidth,totalColWidth=0,totalGridWidth,hasWidthInPixels=this._gridHasWidthInPixels(),hasWidthInPercent=this._gridHasWidthInPercent(),hasWidth=hasWidthInPixels||hasWidthInPercent,hasVirtualization=this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true,hasColumnVirtualization=this.options.virtualization===true&&this.options.virtualizationMode==="fixed"||this.options.columnVirtualization===true,hasColumnsWithNoWidth=false,isPercentage=true,desiredColWidth,desiredColWidthNumber,lastCol,lastColWidth,difference;colgroup=$(table).find("colgroup");if(colgroup.length===0){colgroup=$("<colgroup></colgroup>").prependTo(table)}if(hasVirtualization&&this.options.virtualizationMode==="fixed"||hasColumnVirtualization){this._updateVirtColCounters();cols=cols.slice(0,this._virtualColumnCount)}for(i=0;i<cols.length;i++){if(cols[i].width){if(cols[i].oWidth){desiredColWidth=cols[i].oWidth}else{desiredColWidth=cols[i].width}}else{desiredColWidth=defWidth;cols[i].width=defWidth}if(desiredColWidth){if(!desiredColWidth.charAt||!desiredColWidth.endsWith("%")){isPercentage=false}desiredColWidthNumber=parseInt(desiredColWidth,10);if(desiredColWidthNumber<=0){desiredColWidthNumber=undefined}}else{desiredColWidthNumber=undefined;isPercentage=false}if(desiredColWidthNumber){lastCol=$("<col></col>").appendTo(colgroup).css("width",desiredColWidth);lastColWidth=desiredColWidthNumber;totalColWidth+=desiredColWidthNumber}else{lastCol=$("<col></col>").appendTo(colgroup);lastColWidth=undefined;hasColumnsWithNoWidth=true}}if(!hasColumnVirtualization&&autofitLastColumn&&hasWidth&&!hasColumnsWithNoWidth&&lastColWidth){if(isPercentage){if(totalColWidth<100){lastColWidth+=100-totalColWidth;lastCol.css("width",lastColWidth+"%");this._autoadjustedColumn=cols.slice(-1)[0];if(!this._autoadjustedColumn.oWidth){this._autoadjustedColumn.oWidth=this._autoadjustedColumn.width}this._autoadjustedColumn.width=lastColWidth+"%"}}else{if(hasWidthInPixels){totalGridWidth=parseInt(this.options.width,10)}else if(hasWidthInPercent){totalGridWidth=this.container().width()}if(totalGridWidth&&totalGridWidth>totalColWidth){difference=totalGridWidth-totalColWidth;lastColWidth+=difference;totalColWidth+=difference;lastCol.css("width",lastColWidth+"px");this._autoadjustedColumn=cols.slice(-1)[0];if(!this._autoadjustedColumn.oWidth){this._autoadjustedColumn.oWidth=this._autoadjustedColumn.width}this._autoadjustedColumn.width=lastColWidth+"px";this._autoadjustedColumn.difference=difference;this._gridWidthGTColWidth=true}}}else{this._autoadjustedColumn=undefined}if(hasWidth&&hasVirtualization&&!hasColumnsWithNoWidth&&lastColWidth){if(!isPercentage){lastColWidth-=this._scrollbarWidth();lastCol.css("width",lastColWidth+"px")}}if(isHeader){this._lastHeaderCol=lastCol}if(isFooter){this._lastFooterCol=lastCol}if(!isHeader&&!isFooter){this._lastDataCol=lastCol}this._allColumnWidthsInPercentage=isPercentage&&!hasColumnsWithNoWidth&&cols.length>0;this._allColumnWidthsInPixels=!isPercentage&&!hasColumnsWithNoWidth&&cols.length>0;if(this._allColumnWidthsInPixels){this._lastColPixelWidth=lastColWidth;this._totalColPixelWidth=totalColWidth}else if(this._allColumnWidthsInPercentage){this._lastColPercentWidth=lastColWidth;this._totalColPixelWidth=undefined}else{this._lastColPixelWidth=undefined;this._totalColPixelWidth=undefined}},_buildRowTemplateRaw:function(removeHiddenColumns){var tmpl="<tr>",i,c=this.options.columns;for(i=0;i<c.length;i++){if(c[i].template){tmpl+="<td>"+c[i].template+"</td>"}else{tmpl+="<td>{{html "+c[i].key+"}}</td>"}}tmpl+="</tr>";return tmpl},_generateRowTemplate:function(){var key,type,format,auto=this.options.autoFormat,ar=this.options.accessibilityRendering,firstRec=null,grid=this,i,prop,tmpl=grid.options.rowTemplate,cols=grid.options.columns,id='data-id="${ig_pk}"';if(this.options.virtualization&&this.options.virtualizationMode==="continuous"){id+=' data-row-idx="${ig_abs_idx}"'}if(this._tmpl){return this._tmpl}if(grid.dataSource.dataView().length>0){firstRec=grid.dataSource.dataView()[0]}if(tmpl){i=tmpl.indexOf("<tr");if(i>=0&&tmpl.indexOf(".ig_pk")<0){tmpl=tmpl.substring(0,i+3)+" "+id+tmpl.substring(i+3)}for(i=0;i<cols.length;i++){key=cols[i].key;if(cols[i].formatter){format="${$item."+key+"Formatter(this.data ? this.data."+key+" : undefined)}"}else{format=cols[i].format;type=cols[i].dataType;type=type==="date"||type==="number"?type:"";if(format||(auto===true||auto==="dateandnumber")&&type||auto&&auto===type){format="${"+key+"}"}}if(format){tmpl=tmpl.replace(new RegExp("\\$ *\\{ *"+key+" *\\}","g"),format)}}}else{if(ar){tmpl='<tr role="row" '}else{tmpl="<tr "}tmpl+=id;if(this.options.alternateRowStyles){tmpl+="class=\"{{if $i % 2 === 0}}''{{else}}"+this.css.recordAltClass+'{{/if}}">'}else{tmpl+=">"}if(cols.length>0){if(firstRec===null||firstRec.hasOwnProperty(cols[0].key)&&$.type(firstRec)!=="array"){for(i=0;i<cols.length;i++){key=cols[i].key;if(ar){tmpl+='<td role=gridcell aria-describedby="'+key+'">'}else{tmpl+="<td>"}if(cols[i].formatter!==undefined){tmpl+="${$item."+key+"Formatter(this.data ? this.data."+key+" : undefined)}</td>"}else{format=cols[i].format;type=cols[i].dataType;type=type==="date"||type==="number"?type:"";if(format||(auto===true||auto==="dateandnumber")&&type||auto&&auto===type){tmpl+="${"+key+"}</td>"}else if(type==="bool"){tmpl+="${"+key+"}</td>"}else{tmpl+="${"+key+"}</td>"}}}}else{tmpl+="{{each $data}}";if(ar){tmpl+='<td role="gridcell">${this}</td>'}else{tmpl+="<td>${this}</td>"}tmpl+="{{/each}}"}}else{if(grid.dataSource.dataView().length>0){for(prop in firstRec){if(firstRec.hasOwnProperty(prop)){if(ar){tmpl+='<td role="gridcell">${'+prop+"}</td>"}else{tmpl+="<td>${"+prop+"}</td>"}}}}else{throw new Error($.ig.DataSourceLocale.locale.cannotBuildTemplate)}}tmpl+="</tr>"}this._tmpl=tmpl;return tmpl},_renderFixedRecords:function($table,start,end,onlyRows){var grid=this,tmpl,rs,ds=this.dataSource.dataView(),i,d="",noCancel=true;if(start===undefined){start=0;end=ds.length-1}if(start!==undefined&&end===undefined){end=start;if(end>ds.length-1){end=ds.length-1}start=0}if(start<0){start=0}if(end>ds.length-1){end=ds.length-1}if(noCancel){if(!grid.options.rowTemplate||grid.options.rowTemplate.length<=0){for(i=start;i<=end;i++){d+=grid._renderFixedRecord(ds[i],i,onlyRows)}}else if(ds.length>0){tmpl=this._generateRowTemplate();if(tmpl.lastIndexOf("ui-iggrid-rowselector-class")>-1){rs=true}for(i=start;i<=end;i++){if(this.options.virtualization&&this.options.virtualizationMode==="continuous"){ds[i].ig_abs_idx=i}d+=grid._renderFixedRecord(ds[i],i,onlyRows)}}$table.find("tbody").html(d)}},_renderFixedRecord:function(data,rowIndex,onlyRows){var i,key=this.options.primaryKey,ar=this.options.accessibilityRendering,grid=this,dstr="",cols=this._fixedColumns,noVisibleColumns;dstr+="<tr";if(rowIndex%2!==0&&this.options.alternateRowStyles){dstr+=' class="'+grid.css.recordAltClass+'"'}if(!_aNull(key)){dstr+=' data-id="'+this._kval_from_key(key,data)+'"'}else if(!_aNull(data.ig_pk)){dstr+=' data-id="'+data.ig_pk+'"'}if(this.options.virtualization&&this.options.virtualizationMode==="continuous"){dstr+=' data-row-idx="'+rowIndex+'"'}if(ar){dstr+=' role="row">'}else{dstr+=">"}if(onlyRows===true){dstr+="</tr>";return dstr}if(cols.length>0){noVisibleColumns=true;$(cols).each(function(colIndex){if(cols[colIndex].hidden||cols[colIndex].fixed!==true){return}var hiddenStr="";noVisibleColumns=false;if(ar){dstr+='<td role="gridcell" aria-describedby="'+this.key+'"'}else{dstr+="<td"}dstr+=hiddenStr;if(data[this.key]===undefined){if(grid.options.rowTemplate&&grid.options.rowTemplate.length>0){dstr+=" ";dstr+=grid._renderTemplatedCell(data,this)}else{dstr+=">";dstr+=grid._renderCell(data[colIndex],this)}dstr+="</td>"}else{if(grid.options.rowTemplate&&grid.options.rowTemplate.length>0){dstr+=" ";dstr+=grid._renderTemplatedCell(data,this)}else{dstr+=">";dstr+=grid._renderCell(data[this.key],this)}dstr+="</td>"}});if(noVisibleColumns){dstr+='<td role="gridcell"></td>'}}else{if($.type(data)==="array"){for(i=0;i<data.length;i++){if(ar){dstr+='<td role="gridcell">'+data[i]+"</td>"}else{dstr+="<td>";dstr+=data[i];dstr+="</td>"}}}else{for(key in data){if(data.hasOwnProperty(key)){if(ar){dstr+='<td role="gridcell" aria-describedby="'+key+'">'+data[key]+"</td>"}else{dstr+="<td>";dstr+=data[key];dstr+="</td>"}}}}}dstr+="</tr>";return dstr},_syncFixedHeights:function($fixedTable,$unfixedTable){var heights=[],$trsFixedTable,$trsUnfixedTable;$trsFixedTable=$fixedTable.find("tr");$trsUnfixedTable=$unfixedTable.find("tr");$trsUnfixedTable.map(function(ind){var unfixedHeight=this.offsetHeight,fixedHeight=$trsFixedTable[ind].offsetHeight;if(unfixedHeight<fixedHeight){unfixedHeight=fixedHeight}heights.push(unfixedHeight)});$.each(heights,function(ci,h){var height=h+"px";$trsFixedTable[ci].style.height=height;$trsUnfixedTable[ci].style.height=height})},_renderRecords:function(start,end){var $fixedTable,hasFixedColumns=this.hasFixedColumns();this._renderUnfixedRecords(start,end);if(hasFixedColumns){$fixedTable=$("#"+this.id()+"_fixed");this._renderFixedRecords($fixedTable,start,end);this._syncFixedHeights($fixedTable,$("#"+this.id()))}},_renderUnfixedRecords:function(start,end){var grid=this,tbody=this.element.children("tbody"),tmpl,ph,rs,ds=this.dataSource.dataView(),i,d="",noCancel=true,tbodytmp;this._trigger("_rowsRendering",null,{owner:this,tbody:tbody,vrtWnd:{start:start,end:end}});noCancel=this._trigger(this.events.rowsRendering,null,{owner:this,tbody:tbody,vrtWnd:{start:start,end:end}});if(start===undefined){start=0;end=ds.length-1}if(start!==undefined&&end===undefined){end=start;if(end>ds.length-1){end=ds.length-1}start=0}if(start<0){start=0}if(end>ds.length-1){end=ds.length-1}if(noCancel){if(!grid.options.rowTemplate||grid.options.rowTemplate.length<=0){for(i=start;i<=end;i++){d+=grid._renderRecord(ds[i],i)}if(!this._canreplaceinner||$.ig.util.isWebKit){ph=document.createElement("div");ph.innerHTML="<table><tbody>"+d+"</tbody></table>";tbodytmp=ph.firstChild.firstChild;this.element[0].replaceChild(tbodytmp,tbody[0])}else if(this._canreplaceinner){MSApp.execUnsafeLocalFunction(function(){tbody[0].innerHTML=d})}d=""}else if(ds.length>0){tmpl=this._generateRowTemplate();if(tmpl.lastIndexOf("ui-iggrid-rowselector-class")>-1){rs=true}for(i=start;i<=end;i++){if(this.options.virtualization&&this.options.virtualizationMode==="continuous"){ds[i].ig_abs_idx=i}d+=grid._renderRecord(ds[i],i)}tbody.html(d);d=""}this._buildVirtualDomForContinuousVirtualization();this._trigger(this.events.rowsRendered,null,{owner:this,tbody:tbody})}},_reapplyZebraStyle:function(from){var dataRows,toChange;if(!this.options.alternateRowStyles){return}dataRows=this.element.children("tbody").children("tr:not([data-container],[data-grouprow])");from=from||0;toChange=dataRows.slice(from);toChange.filter(from%2===0?":odd":":even").addClass(this.css.recordAltClass);toChange.filter(from%2===0?":even":":odd").removeClass(this.css.recordAltClass)},_buildFormatters:function(){var i,cols=this.options.columns,ret={};for(i=0;i<cols.length;i++){if(cols[i].formatter!==undefined){if($.type(cols[i].formatter)==="function"){ret[cols[i].key+"Formatter"]=cols[i].formatter}else{ret[cols[i].key+"Formatter"]=eval(cols[i].formatter)}}}return ret},_getVisibleIndexByKey:function(columnKey){var cols=this._visibleColumns(),index=-1;$.each(cols,function(ind,value){if(value.key===columnKey){index=ind;return false}});return index},_isColumnHidden:function(columnKey){var cols=this.options.columns,i=cols.length;while(i-->=0){if(cols[i].key===columnKey){return cols[i].hidden||false}}return true},_visibleColumns:function(){if(this._visibleColumnsArray===undefined){this._visibleColumnsArray=$.grep(this.options.columns,function(col){return!col.hidden})}return this._visibleColumnsArray},_visibleMchColumns:function(curLvl){var vmch=[],cl=curLvl||this._oldCols,self=this;if(!cl){return null}$.each(cl,function(){if(!this.hidden||this.hidden===false){vmch.push($.extend({},this));if(this.group){vmch[vmch.length-1].group=self._visibleMchColumns(this.group)}}});return vmch},_renderVirtualRecordsFixed:function(){var i,j,row,c,val,headersTexts,headerText,vheaderNode,iRow,tr,ds=this.dataSource,data=ds.dataView(),key=this.options.primaryKey,noVirtualDom=this._virtualDom===null||this._virtualDom===undefined,visibleCols=this._visibleColumns();this._trigger("virtualrendering",null,{isBuiltVirtualDom:!noVirtualDom});if(this._startRowIndex===undefined||this._startRowIndex===null){this._startRowIndex=0}if(this._startColIndex===undefined||this._startColIndex===null){this._startColIndex=0}if(noVirtualDom){this._buildVirtualDom();if(this.options.adjustVirtualHeights===true){this._adjustVirtualHeights()}}else{for(i=0;i<this._virtualRowCount&&i<this._totalRowCount&&this._startRowIndex+i<data.length;i++){if(!this.options.rowTemplate||this.options.rowTemplate.length<=0){for(j=0;j<this._virtualColumnCount;j++){if(this.options.columns.length>0){val=data[this._startRowIndex+i][visibleCols[this._startColIndex+j].key];this._virtualDom[i][j].innerHTML=this._renderCell(val,visibleCols[this._startColIndex+j],data[this._startRowIndex+i])}else{val=data[this._startRowIndex+i][this._startColIndex+j];this._virtualDom[i][j].innerHTML=data[this._startRowIndex+i][this._startColIndex+j]}this._virtualDom[i][j].className=""}}else{if($.type(data[i])==="array"){row=$(this._renderRecord([data[this._startRowIndex+i]],i))}else{row=$(this._renderRecord(data[this._startRowIndex+i],i))}c=row.children();for(j=0;j<this._virtualColumnCount;j++){this._virtualDom[i][j].innerHTML=c[j+this._startColIndex].innerHTML;this._virtualDom[i][j].className=""}}iRow=this._startRowIndex+i;tr=this._virtualDom[i][0].parentNode;tr.className=i%2===0&&this.options.alternateRowStyles?"ui-iggrid-virtualrow ui-ig-altrecord":"ui-iggrid-virtualrow";if(data[iRow]){if(!_aNull(key)){tr.setAttribute("data-id",this._kval_from_key(key,data[iRow]))}else if(!_aNull(data[iRow].ig_pk)){tr.setAttribute("data-id",data[iRow].ig_pk)}}}}if(this._isHorizontal){this._isHorizontal=false;if((this.options.virtualization===true||this.options.columnVirtualization===true)&&parseInt(this.options.width,10)>0){if(!this._vheaders){headersTexts=this.headersTable().find("thead > tr > th > a > span:first-child");if(headersTexts.length>0){this._vheaders=headersTexts}else{this._vheaders=this.headersTable().find("thead > tr > th > span")}}for(j=0;j<this._virtualColumnCount;j++){headerText=visibleCols[j+this._startColIndex].headerText;vheaderNode=$(this._vheaders[j]);vheaderNode.closest("th").attr("id",this.id()+"_"+visibleCols[j+this._startColIndex].key);vheaderNode.html(headerText)}}}this._trigger("virtualrecordsrender",null,{owner:this,tbody:this.element.children("tbody"),dom:this._virtualDom,isBuiltVirtualDom:!noVirtualDom})},_updateVirtColCounters:function(){var visibleColsLength=this._visibleColumns().length;if(this.options.columns){this._totalColumnCount=visibleColsLength;this._maxVirtualColumnCount=this.options.columns.length}else{this._totalColumnCount=this.dataSource.dataView()[0].length;this._maxVirtualColumnCount=this._totalColumnCount}if(this.options.columnVirtualization===false&&this.options.virtualization===false){this._virtualColumnCount=visibleColsLength}else{if(this.options.width===null){this._virtualColumnCount=this._totalColumnCount}else{this._virtualColumnCount=Math.ceil(parseInt(this.options.width,10)/this._avgColumnWidth());this._maxVirtualColumnCount=Math.min(this._maxVirtualColumnCount,this._virtualColumnCount);this._virtualColumnCount=Math.min(this._totalColumnCount,this._virtualColumnCount);this._vhorizontalcontainer().children().first().css("width",this._calculateContainerWidth(false))}}},_buildVirtualDom:function(){var grid=this,markup="",row,i,j,dataLinkFn,ar=this.options.accessibilityRendering,shouldHide=false,visibleCols=this._visibleColumns(),key=this.options.primaryKey,data=this.dataSource.dataView();if(this._startRowIndex===undefined||this._startRowIndex===null){this._startRowIndex=0;this._startColIndex=0;this._oldStartRowIndex=0;this._oldStartColIndex=0}this._virtualDom=[];this._totalRowCount=data.length;if(this.options.height===null){this._virtualRowCount=this._totalRowCount}else{if(this.options.height.indexOf&&this.options.height.indexOf("%")!==-1){this._virtualRowCount=Math.ceil(this._vdisplaycontainer().innerHeight()/parseInt(this.options.avgRowHeight,10),10)}else{this._virtualRowCount=Math.ceil(this._vdisplaycontainer().innerHeight()/parseInt(this.options.avgRowHeight,10),10)}}this._updateVirtColCounters();if(this.options.height!==null){this._setScrollContainerHeight(this._totalRowCount*parseInt(this.options.avgRowHeight,10))}dataLinkFn=function(row,i,vc){for(j=0;j<vc;j++){if(j<grid._totalColumnCount){grid._virtualDom[i][j]=row[0].cells[j]}}};this.element.children("tbody").empty();for(i=0;i<this._virtualRowCount;i++){shouldHide=false;this._virtualDom[i]=[];markup="";for(j=this._startColIndex;j<this._virtualColumnCount+this._startColIndex;j++){if(j>=this._totalColumnCount){break}if(ar){markup+='<td role="gridcell" '}else{markup+="<td "}if(this.options.columns.length>0){if(ar){markup+='aria-describedby="'+visibleCols[j].key+'"'}if(!data[i]){shouldHide=true;markup+="></td>"}else{if(this.options.autoFormat!==false){if(this.options.rowTemplate&&this.options.rowTemplate.length>0){markup+=this._renderTemplatedCell(data[i],visibleCols[j])+"</td>"}else{markup+=">"+this._renderCell(data[i][visibleCols[j].key],visibleCols[j],data[i])+"</td>"}}else{markup+=">"+data[i][visibleCols[j].key]+"</td>"}}}else{if(!data[i]){shouldHide=true;markup+="></td>"}else{markup+=data[i][j]+"</td>"}}}row=$("<tr>"+markup+"</tr>").appendTo(this.element.children("tbody"));if(shouldHide){row.css("visibility","hidden")}if(i%2===0&&this.options.alternateRowStyles){row.addClass("ui-ig-altrecord")}row.addClass("ui-iggrid-virtualrow");if(i%2===0&&this.options.alternateRowStyles){row.addClass("ui-ig-altrecord")}if(ar){row.attr("role","row")}if(data[i]){if(!_aNull(key)){row.attr("data-id",this._kval_from_key(key,data[i]))}else if(!_aNull(data[i].ig_pk)){row.attr("data-id",data[i].ig_pk)}}dataLinkFn(row,i,this._virtualColumnCount);if(i===data.length-1){break}}this._updateVirtualScrollContainer();this._trigger("virtualdombuilt",null,{rows:this.element.children("tbody").children("tr")})},_adjustVirtualHeights:function(){var c=this._vdisplaycontainer(),tbody=c.find("tbody"),h=tbody.children().first().height();if(this.options.height===null){return}if(this.options.avgRowHeight!==h){this.options.avgRowHeight=h;this._buildVirtualDom()}},_verticalScroller:function(){if(!this._verticalScrollerObj||this._verticalScrollerObj.length===0){this._verticalScrollerObj=this._scrollContainer().children().first()}return this._verticalScrollerObj},_hscrollbar:function(){return this.container().find("#"+this.id()+"_hscroller_container")},_hscrollbarcontent:function(){return this.container().find("#"+this.id()+"_hscroller")},_hscrollbarinner:function(){return this.container().find("#"+this.id()+"_hscroller_inner")},_avgColumnWidth:function(){var width=0,cols=this.options.columns,count=cols.length,def=this.options.defaultColumnWidth,i;if(this.options.avgColumnWidth!==null){return parseInt(this.options.avgColumnWidth,10)}for(i=0;i<count;i++){width+=parseInt(cols[i].width,10)}if((count===0||isNaN(width))&&def){return parseInt(def,10)}if(count>0&&this.options.autoGenerateColumns&&isNaN(width)){if(this.options.width===null||this.options.width===undefined){throw new Error($.ig.DataSourceLocale.locale.columnVirtualizationRequiresWidth)}return parseInt(this.options.width,10)/count}if(width===0||width<def){return def}return width/count},_scrollData:function(){var scroller=this._hscrollbarcontent(),scrollContainer;if(this.options.virtualization===true||this.options.rowVirtualization===true){scrollContainer=this._vdisplaycontainer()}else{scrollContainer=this.scrollContainer()}scrollContainer.scrollLeft(scroller.scrollLeft())},_scrollHeader:function(){var scroller=this._hscrollbarcontent(),headers=this.headersTable().parent();headers.scrollLeft(scroller.scrollLeft())},_scrollFooter:function(){var scroller=this._hscrollbarcontent(),footers=this._fixedfooters();footers.scrollLeft(scroller.scrollLeft())},_renderCaption:function(){var colgroup,caption,scrollc,tbl;if(this.options.caption!==null){if(this.container().find(".ui-iggrid-headercaption").length>0){return}if(this.options.fixedHeaders===true&&this.options.showHeader===true){colgroup=this.headersTable().children("colgroup").first();if(colgroup.length===0){caption=$("<caption></caption>").prependTo(this.headersTable())}else{caption=$("<caption></caption>").insertAfter(colgroup)}caption.text(this.options.caption).attr("id",this.id()+"_caption").addClass(this.css.gridHeaderCaptionClass)}else{scrollc=this.scrollContainer();if(scrollc.length===0){tbl=$("<table></table>").prependTo(this.container())}else{tbl=$("<table></table>").insertBefore(scrollc)}caption=$("<caption></caption>").appendTo(tbl.css("width","100%").addClass(this.css.captionTable)).text(this.options.caption).attr("id",this.id()+"_caption").addClass(this.css.gridHeaderCaptionClass)}caption.parent().css("margin",0)}},_renderFixedCaption:function(){var colgroup,caption;if(this.options.caption!==null){if(this.options.fixedHeaders===true&&this.options.showHeader===true){colgroup=this.fixedHeadersTable().children("colgroup").first();if(colgroup.length===0){caption=$("<caption></caption>").prependTo(this.fixedHeadersTable())}else{caption=$("<caption></caption>").insertAfter(colgroup)}caption.text(this.options.caption).attr("id",this.id()+"_caption_fixed").addClass(this.css.gridHeaderCaptionClass)
}caption.parent().css("margin",0)}},_createHeaderColumnMarkup:function(column,index){var headerClass=this.css.headerClass,ar=this.options.accessibilityRendering,headerText=$("<span>"+column.headerText+"</span>").addClass(this.css.headerTextClass),markup="<th></th>",headerCell;if(ar){headerCell=$(markup).append(headerText).attr("id",this.id()+"_"+column.key).attr("role","rowheader").addClass(headerClass).data("columnIndex",index)}else{headerCell=$(markup).append(headerText).attr("id",this.id()+"_"+column.key).addClass(headerClass).data("columnIndex",index)}return headerCell},_updateHeaderColumnIndexes:function(){var grid=this,cols=this.options.columns;if(this.options.virtualization===true&&this.options.virtualizationMode==="fixed"||this.options.columnVirtualization===true){cols=cols.slice(0,this._maxVirtualColumnCount)}grid._initialHiddenCells=[];$(cols).each(function(i){grid.container().find("#"+grid.id()+"_"+this.key).data("columnIndex",i)})},_renderHeaderColumns:function(header){var grid=this,cols=this.options.columns;if(this.options.virtualization===true&&this.options.virtualizationMode==="fixed"||this.options.columnVirtualization===true){cols=cols.slice(0,this._maxVirtualColumnCount)}grid._initialHiddenCells=[];$(cols).each(function(i){var headerCell,key=this.key;if(key){headerCell=grid._createHeaderColumnMarkup(this,i);header.append(headerCell);grid._trigger(grid.events.headerCellRendered,null,{owner:grid,th:headerCell,columnKey:this.key});$.each(grid._initialHiddenColumns,function(){if(this.key===key){grid._initialHiddenCells.push(headerCell);headerCell.css("display","none");return false}})}})},renderMultiColumnHeader:function(cols){var topmostGrid,layout;this._origSum=0;this.options.columns=cols;this.destroy(true);this._initialized=false;this.options.requiresDataBinding=true;this._renderHeaderCalled=false;if(this._isHierarchicalGrid){topmostGrid=this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(topmostGrid){if(topmostGrid.element[0].id!==this.element[0].id&&this.options.key){layout=topmostGrid._findLayout(topmostGrid.options.columnLayouts,this.options.key);layout.columns=cols;topmostGrid._setOption("columnLayouts",topmostGrid.options.columnLayouts);topmostGrid._create();return}topmostGrid._regevents(topmostGrid.element,topmostGrid)}}this._create()},_renderHeader:function(){var w,header,id,headerDom,headerMarkup="",scrollc=this.scrollContainer(),noCancel=true,headerParent=this.element[0],width,headerScrollDiv,existingHeader,o=this.options,v=o.virtualization===true||o.rowVirtualization===true||o.columnVirtualization===true;this._renderHeaderCalled=true;if(this.options.showHeader){noCancel=this._trigger(this.events.headerRendering,null,{owner:this});if(noCancel){id=this.id();headerMarkup="<thead><tr data-header-row></tr></thead>";headerParent=this.container();width=scrollc.css("width");if(this.options.showHeader&&this.options.fixedHeaders&&this.options.height!==null){if(v===false){if(headerParent.length===0){scrollc.removeClass(this.css.gridClasses).removeClass(this.css.baseClasses).css("width","").wrap("<div id='"+id+"_container'></div>");headerParent=this.container().addClass(this.css.baseClasses).addClass(this.css.gridClasses).css("width",width);this._isWrapped=true}}else{width=this.element.parents(".ui-widget").css("width");headerParent=this.container().find("#"+id+"_headers_v").css("width",width);if(this.options.expandColWidth&&!this.options.width){headerParent.css("width",parseInt(width,10)+this.options.expandColWidth+"px")}if(o.width!==null){w=o.width;if(w.indexOf&&w.indexOf("%")!==-1){w="100%"}headerParent.css("width",w).css("max-width",w).css("overflow-x","hidden")}}headerParent=$("<table id='"+id+"_headers'></table>").prependTo(headerParent).addClass(this.css.gridHeaderTableClass).attr("cellpadding",0).attr("cellspacing",0).attr("border","0");if(v===false){headerScrollDiv=$("<div></div>").prependTo(headerParent.parent());headerScrollDiv.css("overflow","hidden").css("position","relative").css("white-space","nowrap");headerScrollDiv.addClass("ui-widget-header ui-helper-reset");headerScrollDiv.append(headerParent)}else if(this.options.rowVirtualization===true){headerParent.addClass("ui-widget-header ui-helper-reset")}this._hscrollbarcontent().bind("scroll",$.proxy(this._scrollHeader,this));this._renderColgroup(headerParent,true,false,this.options.autofitLastColumn)}else if(this.options.fixedHeaders!==true&&this.options.showHeader){headerParent=this.element}if(this.options.width===null&&this.options.height===null){headerParent=this.element}if(this.options.width!==null&&this.options.height===null){this._fixScrollY=1;scrollc.css("overflow-y","hidden").css("overflow-x","auto");headerParent=this.element}if(this._isMultiColumnGrid===true){this._headerParent=headerParent;this._fireInternalEvent("_renderingMultiColumnHeader");if(this.options.virtualization===true||this.options.rowVirtualization===true){this.container().find("#"+id+"_headers_v").css("position","relative").addClass("ui-widget-header ui-helper-reset").addClass(this.css.baseClasses);headerParent.addClass(this.css.gridHeaderTableClass).attr("cellpadding",0).attr("cellspacing",0).attr("border","0")}}else{if(this.options.showHeader){if(this.options.headerTemplate===null||this.options.headerTemplate===undefined){if(this.options.virtualization===true||this.options.rowVirtualization===true){this.container().find("#"+id+"_headers_v").css("position","relative").addClass("ui-widget-header ui-helper-reset").addClass(this.css.baseClasses);headerParent.addClass(this.css.gridHeaderTableClass).attr("cellpadding",0).attr("cellspacing",0).attr("border","0")}this.element.find(">thead").remove();existingHeader=headerParent.find(">thead");if(existingHeader.length===0){header=$(headerMarkup).appendTo(headerParent).children().first()}else{existingHeader.empty();header=$("<tr data-header-row></tr>").appendTo(existingHeader)}this._renderHeaderColumns(header)}else{headerDom=this.options.headerTemplate;if(this.options.virtualization===true||this.options.rowVirtualization===true){$(headerDom).children().each(function(){this.appendTo(this.container().find("#"+id+"_headers"))});header=this.headersTable().addClass(this.css.gridClasses)}else{header=$(headerMarkup).appendTo(headerParent).append(headerDom)}}}this._headerParent=headerParent;this._trigger(this.events.headerRendered,null,{owner:this,table:this.headersTable()});this._headerRenderCancel=false}}else{this._headerRenderCancel=true}}this._trigger("headerRenderedInternal",null,{owner:this,table:this.headersTable()})},_renderFooter:function(){var gridId=this.id(),w,o=this.options,elemParent,footerId=gridId+"_footer_container",footerMarkup='<tfoot class="'+this.css.gridFooterClass+'"></tfoot>',$footer=this.container().find("#"+footerId),$table,width,noCancel,tableGrid=this.element,$tableGridContainer;if(tableGrid.length===0){return}if($footer.length===0&&o.showFooter){noCancel=this._trigger(this.events.footerRendering,null,{owner:this});if(noCancel){if((o.virtualization===true||o.rowVirtualization===true||o.columnVirtualization===true)&&(o.height!==null&&o.height!==undefined||o.width!==null&&o.width!==undefined)){$tableGridContainer=this._vdisplaycontainer();this.options.fixedFooters=true;w=o.width;if(w&&w.indexOf&&w.indexOf("%")!==-1){w="100%"}$tableGridContainer=$('<tr><td colspan="2" style="border-width: 0px;"></td></tr>').insertAfter($tableGridContainer.closest("tr"));$footer=$("<div></div>").attr("id",footerId).css({overflow:"hidden",position:"relative"}).addClass("ui-widget-footer").addClass(this.css.footerContainer).width(w).appendTo($tableGridContainer.find("td"));$table=$("<table></table>").attr("cellpadding",0).attr("cellspacing",0).attr("border",0).width(w).appendTo($footer).addClass(this.css.gridFooterTableClass).attr("id",gridId+"_footers");this._renderColgroup($table,false,true,this.options.autofitLastColumn);$(footerMarkup).appendTo($table);if(this.options.showFooter&&this.options.fixedFooters===true&&this.options.height!==null){elemParent=this.element.parents(".ui-widget:first");if(elemParent.length===1&&elemParent[0].style){width=elemParent[0].style.width;if(width&&(!width.indexOf||width.indexOf("%")===-1)){$footer.css("width",width)}}}if(o.expandColWidth&&!o.width){$footer.css("width",parseInt($footer.width(),10)+o.expandColWidth+"px")}this._hscrollbarcontent().bind("scroll",$.proxy(this._scrollFooter,this))}else if(o.fixedFooters===true&&o.height!==null){if(o.width!==null){$tableGridContainer=this._hscrollbar()}else{$tableGridContainer=this.scrollContainer()}if($tableGridContainer.length===0){$tableGridContainer=tableGrid}$footer=$("<div></div>").attr("id",footerId).css({overflow:"hidden",position:"relative","white-space":"nowrap"}).addClass(this.css.footerContainer).addClass("ui-widget-footer").insertAfter($tableGridContainer);$table=$("<table></table>").attr("cellpadding",0).attr("cellspacing",0).attr("border",0).appendTo($footer).addClass(this.css.gridFooterTableClass).attr("id",gridId+"_footers");this._renderColgroup($table,false,true,this.options.autofitLastColumn);$(footerMarkup).appendTo($table);if(o.virtualization!==true&&o.rowVirtualization!==true&&o.columnVirtualization!==true){this._hscrollbarcontent().bind("scroll",$.proxy(this._scrollFooter,this))}}else{$tableGridContainer=tableGrid;$footer=$(footerMarkup).attr("id",footerId).insertBefore($tableGridContainer.find("tbody:eq(0)"))}$footer.css("display","none");this._footer=$footer;this._footerParent=$table;this._trigger(this.events.footerRendered,null,{owner:this,table:this.footersTable()})}}return $footer},_renderRecord:function(data,rowIndex){var i,key=this.options.primaryKey,ar=this.options.accessibilityRendering,grid=this,dstr="",cols=this.options.columns,noVisibleColumns;dstr+="<tr";if(rowIndex%2!==0&&this.options.alternateRowStyles){dstr+=' class="'+grid.css.recordAltClass+'"'}if(!_aNull(key)){dstr+=' data-id="'+this._kval_from_key(key,data)+'"'}else if(!_aNull(data.ig_pk)){dstr+=' data-id="'+data.ig_pk+'"'}if(this.options.virtualization&&this.options.virtualizationMode==="continuous"){dstr+=' data-row-idx="'+rowIndex+'"'}if(ar){dstr+=' role="row">'}else{dstr+=">"}if(cols.length>0){noVisibleColumns=true;$(cols).each(function(colIndex){if(cols[colIndex].hidden||cols[colIndex].fixed===true){return}noVisibleColumns=false;if(ar){dstr+='<td role="gridcell" aria-describedby="'+this.key+'"'}else{dstr+="<td"}if(data[this.key]===undefined){if(grid.options.rowTemplate&&grid.options.rowTemplate.length>0){dstr+=" ";dstr+=grid._renderTemplatedCell(data,this)}else{dstr+=">";dstr+=grid._renderCell(data[colIndex],this,data)}dstr+="</td>"}else{if(grid.options.rowTemplate&&grid.options.rowTemplate.length>0){dstr+=" ";dstr+=grid._renderTemplatedCell(data,this)}else{dstr+=">";dstr+=grid._renderCell(data[this.key],this,data)}dstr+="</td>"}});if(noVisibleColumns){dstr+='<td role="gridcell"></td>'}}else{if($.type(data)==="array"){for(i=0;i<data.length;i++){if(ar){dstr+='<td role="gridcell">'+data[i]+"</td>"}else{dstr+="<td>";dstr+=data[i];dstr+="</td>"}}}else{for(key in data){if(data.hasOwnProperty(key)){if(ar){dstr+='<td role="gridcell" aria-describedby="'+key+'">'+data[key]+"</td>"}else{dstr+="<td>";dstr+=data[key];dstr+="</td>"}}}}}dstr+="</tr>";return dstr},_renderRecordInArray:function(darr,tbody,data,rowIndex){var i,key=this.options.primaryKey,ar=this.options.accessibilityRendering,grid=this,appendBehavior=false,cols=this.options.columns;if(darr===null){darr=[];appendBehavior=true}darr.push("<tr");if(rowIndex%2!==0&&this.options.alternateRowStyles){darr.push(' class="'+grid.css.recordAltClass+'"')}if(!_aNull(key)){darr.push(' data-id="'+this._kval_from_key(key,data)+'"')}else if(!_aNull(data.ig_pk)){darr.push(' data-id="'+data.ig_pk+'"')}if(ar){darr.push(' role="row">')}else{darr.push(">")}if(cols.length>0){$(cols).each(function(colIndex){if(cols[colIndex].hidden){return}if(ar){darr.push('<td role="gridcell" aria-describedby="'+this.key+'"')}else{darr.push("<td")}if(data[this.key]===undefined){if(grid.options.rowTemplate&&grid.options.rowTemplate.length>0){darr.push(" ");darr.push(grid._renderTemplatedCell(data,this))}else{darr.push(">");darr.push(grid._renderCell(data[colIndex],this,data))}darr.push("</td>")}else{if(grid.options.rowTemplate&&grid.options.rowTemplate.length>0){darr.push(" ");darr.push(grid._renderTemplatedCell(data,this))}else{darr.push(">");darr.push(grid._renderCell(data[this.key],this,data))}darr.push("</td>")}})}else{if($.type(data)==="array"){for(i=0;i<data.length;i++){if(ar){darr.push('<td role="gridcell">'+data[i]+"</td>")}else{darr.push("<td>");darr.push(data[i]);darr.push("</td>")}}}else{for(key in data){if(data.hasOwnProperty(key)){if(ar){darr.push('<td role="gridcell" aria-describedby="'+key+'">'+data[key]+"</td>")}else{darr.push("<td>");darr.push(data[key]);darr.push("</td>")}}}}}darr.push("</tr>");if(appendBehavior){tbody.append(darr.join(""))}},_fixDate:function(val,col){var d,i;if(!col||!val){return val}if(col.dataType==="date"&&!val.getTime){i=val.indexOf?val.indexOf("ate("):-1;if(i>0){d=val.substring(i+4);i=d.indexOf(")");if(i>0){d=parseInt(d.substring(0,i),10);if(!isNaN(d)){val=new Date(d)}}}}return val},_renderCell:function(val,col,record,displayStyle,returnObject){var type=col.dataType,format=col.format,o=this.options,auto=o.autoFormat;val=this._fixDate(val,col);if(col.formatter){return col.formatter(val,record)}if(!format&&type==="bool"&&o.renderCheckboxes){format="checkbox"}if(format==="checkbox"&&type!=="bool"){format=null}type=type==="date"||type==="number"?type:"";if(format||(auto===true||auto==="dateandnumber")&&type||auto&&auto===type){return $.ig.formatter(val,type,format,true,o.enableUTCDates,displayStyle)}if(returnObject){return val}return val||val===0||val===false?val.toString():"&nbsp;"},_renderTemplatedCell:function(val,col){var v,d=$.extend(true,[],val);if(val===undefined||val===null||val[col.key]===undefined){if(col.unbound===true){v="&nbsp;"}else{v=this._renderCell(val,col,val,null,true)}}else{v=this._renderCell(val[col.key],col,val,null,true)}if(this._tmap===null){this._initializeTmap()}d[col.key]=v;return $.ig.tmpl(this._tmap[col.key],d)},_initializeTmap:function(){var tmpl=this.options.rowTemplate,i,cols=this.options.columns,tds,templatePart;this._tmap=[];if(this.options.rowTemplate===null||this.options.rowTemplate===undefined||this.options.rowTemplate===""){throw new Error($.ig.Grid.locale.templatingEnabledButNoTemplate)}tmpl=tmpl.replace("<tr>","").replace("</tr>","");tds=$.trim(tmpl).split("</td>");for(i=0;i<cols.length;i++){templatePart=$.trim(tds[i].replace("<td",""));this._tmap[cols[i].key]=templatePart}},_scrollbarWidth:function(){if(!this._scrollbarWidthResolved){var $parent,$div=$('<div id="'+this.id()+'_tmp"></div>').css({width:"50px",height:"50px",position:"absolute",top:-500,left:-500}).prependTo("body").append("<div></div>").find("div").css({height:"100px"}),w1,w2;if(document.documentMode===7||$.ig.util.isIE7){w1=$div.innerWidth();$div.parent().css("overflow-y","scroll");w2=$div.innerWidth();this._scrollbarWidthResolved=w1-w2}else{$parent=$div.parent();$parent.css({overflow:"auto"});$div.css({width:"100%"});this._scrollbarWidthResolved=$parent.width()-$div.width()}$("#"+this.id()+"_tmp").remove();if(!this._scrollbarWidthResolved){this._scrollbarWidthResolved=17}}return this._scrollbarWidthResolved},_fireInternalEvent:function(name,args){var i,f,featureName,feature;for(i=0;i<this.options.features.length;i++){f=this.options.features[i];if(f!==undefined&&f!==null&&f.name!==undefined){featureName="igGrid"+f.name;feature=this.element.data(featureName);if(feature!==null&&feature!==undefined&&feature[name]){if(args){feature[name](args)}else{feature[name]()}}}}},_initFeature:function(featureObject,dataOptions,destroy){if(!featureObject){return}if(featureObject.name===undefined){return}var widget="igGrid"+featureObject.name;if($.type(this.element[widget])!=="function"){throw new Error($.ig.Grid.locale.noSuchWidget+" "+widget)}if(this.element.data(widget)){this.element[widget]("destroy")}this.element[widget](featureObject);this.element.data(widget)._injectGrid(this)},_initFeatureSettings:function(featureObject){if(!featureObject){return}if(featureObject.name===undefined){return}var widget="igGrid"+featureObject.name;if($.type(this.element[widget])!=="function"){throw new Error($.ig.Grid.locale.noSuchWidget+" "+widget)}if(this.element.data(widget)){this.element.data(widget)._injectGrid(this,true)}},_onFeaturesSoftDirty:function(e,args){var i,feature;if(args.owner.options.type!=="remote"){return}for(i=0;i<this.options.features.length;i++){feature=this.element.data("igGrid"+this.options.features[i].name);if(feature&&feature!==args.owner&&feature.options&&feature.options.type==="local"){if(feature._onUIDirty&&$.type(feature._onUIDirty)==="function"){feature._onUIDirty(e,args)}}}},_kval_from_key:function(key,data){var k,k_val="",i;if(key.indexOf(",")!==-1){k=key.split(",");for(i=0;i<k.length;i++){k_val+=data[k[i]];if(i<k.length-1){k_val+=","}}}else{k_val=data[key]}return k_val},_rowId:function(rec,index){var key=this.options.primaryKey;key=key?this._kval_from_key(key,rec):null;if(!key){key=index;if(key!==0){key=this.rows().length-1}}return key},_inferOpType:function(){if(this.options.dataSourceUrl||this.dataSource.type()==="remoteUrl"){return"remote"}return"local"},_renderVirtualRecords:function(){this._trigger("virtualrendering");var mode=this.options.virtualizationMode;if(mode===undefined||mode===""){mode="continuous"}if(mode==="fixed"||this.options.columnVirtualization===true){this._renderVirtualRecordsFixed()}else if(mode==="continuous"){this._renderVirtualRecordsContinuous();this._trigger("virtualrecordsrender",null,{owner:this,dom:this._virtualDom})}},_getHScrollContainerInner:function(){var ret=this._hscrollbarinner();if(ret.length===0&&this.options.virtualizationMode==="continuous"){ret=this.container().find("#"+this.id()+"_horizontalScrollContainer div")}return ret},_getScrollContainerHeight:function(){return this._scrollContainer().children(":first-child").height()},_getDisplayContainerHeight:function(){return this._vdisplaycontainer().height()},_getDisplayContainerWidth:function(){return this._vdisplaycontainer().width()},_setDisplayContainerWidth:function(width){if(width===undefined){return}this._vdisplaycontainer().css("max-width",width);this._vdisplaycontainer().width(width)},_getVHeadersWidth:function(){return this.container().find("#"+this.id()+"_headers_v").width()},_setVHeadersWidth:function(width){if(width===undefined){return}this.container().find("#"+this.id()+"_headers_v").width(width)},_setScrollContainerHeight:function(height){var sc=this._scrollContainer(),funcIEScroll;if(height===undefined){return}sc.children(":first-child").height(height);if($.ig.util.isIE){funcIEScroll=function(){sc.scrollTop(sc.scrollTop()+2);sc.scrollTop(sc.scrollTop()-2)};if($.ig.util.browserVersion<=8){setTimeout(function(){funcIEScroll()},0)}else{funcIEScroll()}}},_setScrollContainerScrollTop:function(top){if(top===undefined){return}this._scrollContainer().scrollTop(top)},_getScrollContainerScrollTop:function(){return this._scrollContainer().scrollTop()},_setDisplayContainerScrollTop:function(top){if(top===undefined){return}this._vdisplaycontainer().scrollTop(top)},_getDisplayContainerScrollTop:function(){return this._vdisplaycontainer().scrollTop()},_setDisplayContainerScrollLeft:function(left){if(left===undefined){return}this._vdisplaycontainer().scrollLeft(left)},_getDisplayContainerScrollLeft:function(){return this._vdisplaycontainer().scrollLeft()},_calculateAvgRowHeight:function(){var rowHeightSum=this.container().find("#"+this.id()+" > tbody").height();if(rowHeightSum===0){rowHeightSum=parseInt(this.options.height,10)}if(this.options.virtualizationMode==="fixed"){if(this._fixedAvgRowHeight){return this._fixedAvgRowHeight}this._fixedAvgRowHeight=rowHeightSum/this._virtualRowCount}return rowHeightSum/this._virtualRowCount},_getDisplayContainerVisibleArea:function(){var scrollTop=this._getDisplayContainerScrollTop(),height=this._getDisplayContainerHeight();return{top:scrollTop,bottom:scrollTop+height}},virtualScrollTo:function(scrollerPosition){var avgRowHeight,$scrollContainer=this._scrollContainer(),pos=parseInt(scrollerPosition,10);if($.type(scrollerPosition)!=="string"){if(this.options.virtualizationMode==="fixed"){avgRowHeight=parseInt(this.options.avgRowHeight,10)}else{if(this._avgRowHeight){avgRowHeight=this._avgRowHeight}else{avgRowHeight=this._calculateAvgRowHeight()}}scrollerPosition--;pos=avgRowHeight*scrollerPosition;pos=Math.ceil(pos);this._virtualScrollToIndex=scrollerPosition}$scrollContainer.scrollTop(pos)},_virtualScrollToInternal:function(virtualScrollerY){var tableId,firstRow,lastRow,scrollData,scrollResult;if(virtualScrollerY===this._oldScrollTop){return}tableId="#"+this.id();firstRow=this.container().find(tableId+" > tbody > tr:first");lastRow=this.container().find(tableId+" > tbody > tr:last");if(firstRow.length===0||lastRow.length===0){return}scrollData={virtualScrollerY:this._getScrollContainerScrollTop(),deltaScroll:virtualScrollerY-this._oldScrollTop,firstRow:firstRow,lastRow:lastRow,firstRowDataIndex:parseInt(firstRow.attr("data-row-idx"),0),lastRowDataIndex:parseInt(lastRow.attr("data-row-idx"),0),visibleArea:this._getDisplayContainerVisibleArea()};scrollResult={action:"SA_INITIAL"};if(!this._tryScroll(scrollData,scrollResult)){this._rebuildVirtualRows(scrollData,scrollResult)}this._correctScrollPosition(this._getTotalRowsCount())},_getTotalRowsCount:function(){return this.dataSource.dataView().length},_tryScroll:function(scrollData,scrollResult){var deltaScroll,firstRow,lastRow,displayContainerHeight,displayContainerScrollTop;if(scrollResult===undefined){throw new Error("scrollResult parameter should be provided")}deltaScroll=scrollData.deltaScroll;firstRow=scrollData.firstRow;lastRow=scrollData.lastRow;displayContainerHeight=this._getDisplayContainerHeight();displayContainerScrollTop=this._getDisplayContainerScrollTop();if(deltaScroll>0){if(lastRow[0].offsetTop+lastRow.outerHeight()>=displayContainerScrollTop+deltaScroll+displayContainerHeight||isNaN(scrollData.lastRowDataIndex)||scrollData.lastRowDataIndex===this.dataSource.dataView().length-1){this._setDisplayContainerScrollTop(displayContainerScrollTop+deltaScroll);scrollResult.action="SA_SUCCESSFUL";return true}if(deltaScroll<=this._avgRowHeight*this._virtualRowCount){if(deltaScroll+displayContainerHeight>this._avgRowHeight*this._virtualRowCount){scrollResult.action="SA_NEED_SOME_PAGE";return false}scrollResult.action="SA_NEED_NEXT_PAGE";return false}}if(deltaScroll<0){if(firstRow[0].offsetTop<=displayContainerScrollTop+deltaScroll||scrollData.firstRowDataIndex===0){this._setDisplayContainerScrollTop(displayContainerScrollTop+deltaScroll);scrollResult.action="SA_SUCCESSFUL";return true}if(Math.abs(deltaScroll)<=this._avgRowHeight*this._virtualRowCount){scrollResult.action="SA_NEED_PREV_PAGE";return false}}scrollResult.action="SA_NEED_SOME_PAGE";return false},_rebuildVirtualRows:function(scrollData,scrollResult){var noCancel,virtualScrollerY,deltaScroll,tableId,visibleArea,tbody,expandedRowsHeight,trs,i,scrollerHeight,firstVisibleTR,firstVisibleTRRelativeOffset,startIndexToBeLoaded,newFirstVisibleRow,displayContainerScrollTop,maxScrollPos,avgRowHeight,tr,lastVisibleTR,lastVisibleTRIndex,firstVisibleTRIndex,endIndexToBeLoaded,dataRowIndexToBeFirst,hasOverflow;noCancel=this._trigger("rebuildingvirtualrows",null,{owner:this,scrollData:scrollData,scrollResult:scrollResult});if(noCancel===false){return}virtualScrollerY=scrollData.virtualScrollerY;deltaScroll=scrollData.deltaScroll;tableId="#"+this.id();visibleArea=scrollData.visibleArea;tbody=this.container().find(tableId+" > tbody");expandedRowsHeight=0;trs=this.container().find(tableId+" > tbody > tr[data-container='true']");for(i=0;i<trs.length;i++){expandedRowsHeight+=$(trs[i]).outerHeight()}if(expandedRowsHeight>0){scrollerHeight=this._getScrollContainerHeight();this._setScrollContainerHeight(scrollerHeight-expandedRowsHeight)}if(deltaScroll>0&&scrollResult.action==="SA_NEED_NEXT_PAGE"){firstVisibleTR=this._getFirstVisibleTR(visibleArea);firstVisibleTRRelativeOffset=Math.abs(firstVisibleTR[0].offsetTop-visibleArea.top);startIndexToBeLoaded=parseInt(firstVisibleTR.attr("data-row-idx"),0);dataRowIndexToBeFirst=startIndexToBeLoaded;endIndexToBeLoaded=parseInt(this._virtualRowCount,0)+startIndexToBeLoaded-1;hasOverflow=false;if(endIndexToBeLoaded>this.dataSource.dataView().length-1){endIndexToBeLoaded=this.dataSource.dataView().length-1;startIndexToBeLoaded=endIndexToBeLoaded-this._virtualRowCount+1;hasOverflow=true}tbody.empty();this._renderRecords(startIndexToBeLoaded,endIndexToBeLoaded);if(hasOverflow){tr=this.container().find(tableId+" > tbody > tr[data-row-idx='"+dataRowIndexToBeFirst+"']");firstVisibleTRRelativeOffset=tr[0].offsetTop+firstVisibleTRRelativeOffset}this._setDisplayContainerScrollTop(firstVisibleTRRelativeOffset+deltaScroll)}if(deltaScroll<0&&scrollResult.action==="SA_NEED_PREV_PAGE"){lastVisibleTR=this._getLastVisibleTR(visibleArea);lastVisibleTRIndex=parseInt(lastVisibleTR.attr("data-row-idx"),0);firstVisibleTR=this._getFirstVisibleTR(visibleArea);firstVisibleTRIndex=parseInt(firstVisibleTR.attr("data-row-idx"),0);endIndexToBeLoaded=lastVisibleTRIndex;startIndexToBeLoaded=endIndexToBeLoaded-parseInt(this._virtualRowCount,0)+1;if(startIndexToBeLoaded<0){startIndexToBeLoaded=0;endIndexToBeLoaded=startIndexToBeLoaded+this._virtualRowCount-1}tbody.empty();this._renderRecords(startIndexToBeLoaded,endIndexToBeLoaded);tableId="#"+this.id();newFirstVisibleRow=this.container().find(tableId+' > tbody > tr[data-row-idx="'+firstVisibleTRIndex+'"]');this._setDisplayContainerScrollTop(newFirstVisibleRow[0].offsetTop+deltaScroll)}if(scrollResult.action==="SA_NEED_SOME_PAGE"){startIndexToBeLoaded=Math.floor(virtualScrollerY/this._avgRowHeight);endIndexToBeLoaded=startIndexToBeLoaded+this._virtualRowCount-1;if(startIndexToBeLoaded<0){startIndexToBeLoaded=0;endIndexToBeLoaded=startIndexToBeLoaded+this._virtualRowCount-1}if(endIndexToBeLoaded>=this.dataSource.dataView().length-1){endIndexToBeLoaded=this.dataSource.dataView().length-1;startIndexToBeLoaded=endIndexToBeLoaded-this._virtualRowCount+1}tbody.empty();this._renderRecords(startIndexToBeLoaded,endIndexToBeLoaded);displayContainerScrollTop=0;maxScrollPos=this._getScrollContainerHeight()-this._getDisplayContainerHeight();if(maxScrollPos-3<=virtualScrollerY&&virtualScrollerY<=maxScrollPos+3){displayContainerScrollTop=1e4}this._setDisplayContainerScrollTop(displayContainerScrollTop)}avgRowHeight=this._calculateAvgRowHeight();if(avgRowHeight>this._avgRowHeight){this._avgRowHeight=avgRowHeight}this._startRowIndex=startIndexToBeLoaded;this._startColIndex=0;this._trigger("virtualrecordsrender",null,{owner:this,tbody:tbody,dom:this._virtualDom})},_correctScrollPosition:function(totalRowCount){var scrollTop,maxScrollPos,tableId,firstRow,firstRowDataIndex,lastRow,lastRowDataIndex,visibleArea,tbody,rowsLeft,displayContainerScrollTop,targetRow,delta;scrollTop=this._getScrollContainerScrollTop();maxScrollPos=this._getScrollContainerHeight()-this._getDisplayContainerHeight();tableId="#"+this.id();firstRow=this.container().find(tableId+" > tbody > tr:first");firstRowDataIndex=parseInt(firstRow.attr("data-row-idx"),0);lastRow=this.container().find(tableId+" > tbody > tr:last");lastRowDataIndex=parseInt(lastRow.attr("data-row-idx"),0);visibleArea=this._getDisplayContainerVisibleArea();tbody=this.container().find(tableId+" > tbody");if(scrollTop===0){if(visibleArea.top>0){this._scrollTo(visibleArea.top,true)}else if(firstRowDataIndex>0){this._scrollTo(firstRowDataIndex*this._avgRowHeight,true)}}else if(scrollTop>=maxScrollPos-3&&scrollTop<=maxScrollPos+3){if(visibleArea.bottom<tbody.height()&&lastRowDataIndex===totalRowCount-1){this._scrollTo(this._getScrollContainerScrollTop()-(tbody.height()-visibleArea.bottom),true)}else if(lastRowDataIndex<totalRowCount-1){rowsLeft=totalRowCount-lastRowDataIndex;this._setScrollContainerHeight(this._getScrollContainerHeight()+rowsLeft*this._avgRowHeight)}}displayContainerScrollTop=this._getDisplayContainerScrollTop();if(displayContainerScrollTop===0&&firstRowDataIndex===0&&this._getScrollContainerScrollTop()!==0){this._scrollTo(0,true)}if(displayContainerScrollTop===tbody.height()-this._getDisplayContainerHeight()&&lastRowDataIndex===totalRowCount-1){this._scrollTo(this._getScrollContainerHeight(),true)}if(this._virtualScrollToIndex!==undefined&&this._virtualScrollToIndex!==null){targetRow=this.container().find(tableId+" > tbody > tr[data-row-idx="+this._virtualScrollToIndex+"]");delta=0;if(targetRow.length===1&&firstRowDataIndex!==this._virtualScrollToIndex){delta=targetRow.offset().top-firstRow.offset().top}this._virtualScrollToIndex=null;if(delta>0){this._vdisplaycontainer().scrollTop(delta)}}},_scrollTo:function(scrollTop,suppressScrollEvent){if(suppressScrollEvent){this._suppressScroll=true}this._setScrollContainerScrollTop(scrollTop)},_getFirstVisibleTR:function(visibleArea){var tableId="#"+this.element[0].id,firstVisibleTR,visibleAreaTop=visibleArea.top;$(tableId+" > tbody > tr:visible").each(function(index){firstVisibleTR=$(this);if(this.offsetTop+firstVisibleTR.height()>visibleAreaTop){return false}});return firstVisibleTR},_getLastVisibleTR:function(visibleArea){var tableId="#"+this.id(),lastVisibleTR;lastVisibleTR=this.container().find(tableId+" > tbody > tr:visible").filter(function(index){return this.offsetTop<visibleArea.bottom}).last();return lastVisibleTR},_determineVirtualRowCount:function(){var div,rowNumber=10,ds,rows="",i,height,avgRowHeight,displayContainerHeight,rowsPerPage,result;ds=this.dataSource.dataView();if(rowNumber>ds.length){rowNumber=ds.length}div=$("<div></div>)").appendTo("body").css({position:"absolute",top:-1800,left:-1800,visibility:"hidden"});for(i=0;i<rowNumber;i++){rows+=this._renderRecord(ds[i],i)}div.html(rows);height=div.height();avgRowHeight=height/rowNumber;displayContainerHeight=this._getDisplayContainerHeight();rowsPerPage=displayContainerHeight/avgRowHeight;result=Math.ceil(rowsPerPage*3);div.remove();return result},_getTotalRowCount:function(){return this.dataSource.dataView().length},_renderVirtualRecordsContinuous:function(){this._totalRowCount=this._getTotalRowCount();if(this._totalRowCount===0){this._setScrollContainerHeight(0);this._virtualDom=[];return}this._virtualRowCount=this._determineVirtualRowCount();if(this._virtualRowCount>this._totalRowCount){this._virtualRowCount=this._totalRowCount}this._scrollTo(0,true);this._renderRecords(this._virtualRowCount-1);this._avgRowHeight=this._calculateAvgRowHeight();this._setScrollContainerHeight(this._totalRowCount*this._avgRowHeight)},_rerenderVirtualRecordsContinuous:function(){var tableId="#"+this.id(),lastRow,lastRowDataIndex;lastRow=this.container().find(tableId+" > tbody > tr:last");lastRowDataIndex=parseInt(lastRow.attr("data-row-idx"),0);this._renderRecords(this._startRowIndex,lastRowDataIndex);this._trigger("virtualrecordsrender",null,{owner:this,tbody:this.element.children("tbody"),dom:this._virtualDom})},_buildVirtualDomForContinuousVirtualization:function(){var rows,cells,i,j;if(this.options.virtualization===true&&this.options.virtualizationMode==="continuous"){this._virtualDom=[];rows=this.container().find("#"+this.id()+" > tbody > tr");for(i=0;i<rows.length;i++){this._virtualDom[i]=[];cells=rows[i].children;for(j=0;j<cells.length;j++){this._virtualDom[i][j]=cells[j]}}this._updateVirtualScrollContainer()}},destroy:function(notToCallDestroy){var prev=this.container().prev(),i,prepend=false,a,attr;if(this._scrollHeader&&this._hscrollbarcontent().length>0){this._hscrollbarcontent().unbind("scroll",$.proxy(this._scrollHeader,this))}this._headerInitCallbacks=[];this._footerInitCallbacks=[];this.tmpDataSource=null;for(i=0;i<this.options.features.length;i++){if(this.element.data("igGrid"+this.options.features[i].name)){this.element["igGrid"+this.options.features[i].name]("destroy")
}}if(prev.length===0){prev=this.container().parent();prepend=true}if(prepend){prev.prepend(this.element)}else{this.element.insertAfter(prev)}this.element.unbind("click",this._cellClickHandler);delete this._cellClickHandler;this.element.find("thead").empty();this.element.find("colgroup").empty();if(notToCallDestroy!==true){$.Widget.prototype.destroy.call(this)}if(this._isWrapped&&this.container().parent().data("igGrid")){this.container().parent().removeData("igGrid");if($.ui.igGrid.prototype.widgetFullName&&$.ui.igGrid.prototype.widgetFullName!=="igGrid"&&this.container().parent().data($.ui.igGrid.prototype.widgetFullName)){this.container().parent().removeData($.ui.igGrid.prototype.widgetFullName)}}this.container().remove();this._container=null;this.element.find("tbody").empty().removeClass(this.css.gridTableBodyClass).removeClass(this.css.gridRecordClass);this.element.removeClass(this.css.gridTableClass);if(this._resizeContainerHandler&&this.container().length>0){this.container()[0].detachEvent("onresize",this._resizeContainerHandler)}if(this._documentEvents){$(document).unbind(this._documentEvents)}this.element.unbind("iggriduisoftdirty",this._uiSoftDirtyHandler);this.element.trigger(this.events.destroyed,{owner:this});delete this._uiSoftDirtyHandler;if(this._resId){clearInterval(this._resId)}if(this._isWrapped){this.element.remove()}if(this._hovEvts){this.element.unbind(this._hovEvts);this._hovEvts=null}if(notToCallDestroy===true){return}if(this.dataSource){this._dataSource=null;this.dataSource=null}this._dataOptions=null;this._originalOptions=null;this._padding=null;this._originalOptions=null;this._loadingIndicator=null;this._headerParent=null;this._footerParent=null;this._footer=null;this._hovEvts=null;this._lastDataCol=null;this._lastFooterCol=null;this._lastHeaderCol=null;if(this.element.is("table")){this.element.empty();if(this._initialChildren){this._initialChildren.appendTo(this.element)}}attr=this.element[0].attributes;a=[];for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){a.push(attr[i].name)}}for(i=0;i<a.length;i++){this.element.removeAttr(a[i])}for(i=0;i<this._initialAttributes.length;i++){if(this._initialAttributes[i].name!=="id"){this.element.attr(this._initialAttributes[i].name,this._initialAttributes[i].value)}}return this}});$.extend($.ui.igGrid,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Multi Headers 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridColumnFixing",{events:{columnFixing:"columnFixing",columnFixed:"columnFixed",columnUnfixing:"columnUnfixing",columnUnfixed:"columnUnfixed",columnFixingRefused:"columnFixingRefused"},css:{fixedContainer:"ui-iggrid-fixedcontainer",leftFixedContainer:"ui-iggrid-fixedcontainer-left",rightFixedContainer:"ui-iggrid-fixedcontainer-right",headerButtonIcon:"ui-icon ui-corner-all ui-icon-pin-w",headerButtonIconHover:"",headerButtonUnfixIcon:"ui-icon ui-corner-all ui-icon-pin-s"},internalErrors:{NotValidIndex:-1,FixingRefused:-2,AlreadyFixed:-3},options:{headerFixButtonText:$.ig.ColumnFixing.locale.headerFixButtonText,headerUnfixButtonText:$.ig.ColumnFixing.locale.headerUnfixButtonText,showFixButtons:true,syncRowHeights:true,scrollDelta:40,fixingDirection:"left",columnSettings:[{columnKey:null,columnIndex:null,allowFixing:true,isFixed:false}]},scrollContainerCheckValue:2,_createWidget:function(){$.Widget.prototype._createWidget.apply(this,arguments)},_unfixColumnInternal:function(colInd){var noCancel,res,col=this.grid.options.columns[colInd];noCancel=this._trigger(this.events.columnUnfixing,null,{columnIndex:colInd,columnKey:col.key,owner:this.grid});if(noCancel){res=this.unfixColumn(colInd);if(res.error===true){this._trigger(this.events.columnUnfixed,null,{columnIndex:colInd,columnKey:col.key,owner:this.grid})}}},unfixColumn:function(colIdentifier){var col,colInd,res,colWidth,scrollContainer,searchFixedColsIndex,fixedContainer,colIdentifierType=$.type(colIdentifier),i,cols=this.grid.options.columns,colsLength=cols.length,grid=this.grid,gridId=grid.id(),tableIndex,headerContainer,footerContainer,fixedHeaderContainerId=grid.id()+"_fixedHeaderContainer",fixedBodyContainerId=grid.id()+"_fixedBodyContainer",fixedFooterContainerId=grid.id()+"_fixedFooterContainer";res={error:this.internalErrors.None,result:true,col:null,columnIndex:colInd};if(colIdentifierType==="number"){colInd=colIdentifier}else if(colIdentifierType==="string"){for(i=0;i<colsLength;i++){if(cols[i].key===colIdentifier){colInd=i;break}}if(i===colsLength){res.result=false;res.error=this.internalErrors.NotValidIdentifier;return res}}col=this.grid._fixedColumns[colInd];if(col===null||col===undefined){res.result=false;res.error=this.internalErrors.NotValidIdentifier;return res}res.columnIndex=colInd;res.col=col;if(this.grid.container().find("#"+gridId+"_"+col.key).length===0){tableIndex=colInd+1}else{tableIndex=this.grid.container().find("#"+gridId+"_"+col.key).index()+1}if(grid.options.virtualization===true||grid.options.rowVirtualization===true){scrollContainer=this.grid._vdisplaycontainer()}else{scrollContainer=this.grid.scrollContainer()}colWidth=this._unfixColumnByContainer(tableIndex,fixedBodyContainerId,scrollContainer,true);if(grid.options.showHeader&&grid.options.fixedHeaders&&grid.options.height!==null){headerContainer=this.grid.headersTable().parent("div");colWidth=this._unfixColumnByContainer(tableIndex,fixedHeaderContainerId,headerContainer,false,true)}footerContainer=this.grid._fixedfooters();if(grid.options.showFooter&&grid.options.fixedFooters&&grid.options.height!==null&&footerContainer.length>0){this._unfixColumnByContainer(tableIndex,fixedFooterContainerId,footerContainer,false,false,colWidth)}this.grid._hscrollbar().css({width:scrollContainer.width()+"px",left:0});col.fixed=false;$.each(this.grid._fixedColumns,function(ind,c){if(c.key===col.key){searchFixedColsIndex=ind;return false}});if(searchFixedColsIndex>-1){this.grid._visibleColumnsArray=undefined;cols.splice(colInd,1);cols.splice(this.grid._fixedColumns.length-1,0,col);this.grid._onColumnFixed(colInd,false);this.grid._fixedColumns.splice(searchFixedColsIndex,1)}if(this.grid._fixedColumns.length===0){fixedContainer=$("#"+fixedBodyContainerId);if(this._onMouseWheelHandler){scrollContainer.unbind({keydown:this._onKeyDown,mousewheel:this._onMouseWheelHandler});fixedContainer.unbind({mousewheel:this._onMouseWheelHandler});this._onKeyDown=null;this._onMouseWheelHandler=null}if(this._DOMMouseScroll!==null&&this._DOMMouseScroll!==undefined){scrollContainer.unbind({DOMMouseScroll:this._DOMMouseScroll});this._DOMMouseScroll=null}$("#"+this.element[0].id+"_mainFixedContainer").remove();if(this.options.fixingDirection==="right"){scrollContainer.css({"overflow-y":"auto"})}this.grid._hscrollbar().css({width:"100%",left:0});if(this.grid.options.width===null){$("#"+this.grid.id()+"_container").css("width","")}}this.grid._updateHeaderColumnIndexes();this.grid._hscrollbarcontent().scrollLeft(0);this._changeStyleHeaderButton(col.key,false);return res},unfixAllColumns:function(){var i,cols=this.grid._fixedColumns.clone(),colsLength=cols.length;if(colsLength>0){for(i=colsLength-1;i>=0;i--){this.unfixColumn(cols[i].key)}}},_unfixColumnByContainer:function(colInd,fixedContainerId,scrollContainer,isDataContainer,isHeaderContainer,cW){var table,tdsFirst,fixedContainer=$("#"+fixedContainerId),fixedContainerWidth=fixedContainer.width(),trs,oTable,oTableWidth,col,colWidth,width;oTable=scrollContainer.find("table");if(scrollContainer.length===0){scrollContainer=$("#"+this.grid.id());oTable=scrollContainer}oTableWidth=oTable.width();table=fixedContainer.find("table");if(fixedContainer.length===0){return}col=fixedContainer.find("colgroup col:nth-child("+colInd+")").detach();colWidth=col.width();if(colWidth===0){colWidth=$(fixedContainer.find("tr:nth-child(1) td:nth-child("+colInd+"), th:nth-child("+colInd+")")[0]).outerWidth()}if(col.length>0){col.prependTo(oTable.find("colgroup"))}if(colWidth===undefined||colWidth===null||colWidth===0){if(col.length>0){colWidth=col.width()}if((colWidth===0||colWidth===null)&&cW!==undefined){colWidth=cW}}if(oTableWidth>0){oTableWidth+=colWidth;oTable.width(oTableWidth)}if(colWidth!==null){width=fixedContainerWidth-colWidth;table.width(width)}tdsFirst=fixedContainer.find("td:nth-child("+colInd+"), th:nth-child("+colInd+")").detach();trs=oTable.find("tr");trs.each(function(ind,tr){var $td=$(tdsFirst[ind]);$td.prependTo($(tr))});if(isDataContainer){scrollContainer.scrollTop(0);this.grid._hscrollbarinner().css({width:(this.grid._hasVerticalScrollbar&&this.grid.options.fixedHeaders?oTableWidth-this.grid._scrollbarWidth():oTableWidth)+"px",left:0})}if(this.grid._fixedColumns.length===1){trs.height("")}if(this.grid.options.width===null){if(isHeaderContainer&&!$.ig.util.isIE){oTable.width(oTableWidth+this.grid._scrollbarWidth())}if(this.grid._fixedColumns.length===1){oTable[0].style.width=""}}return colWidth},_fixColumnInternal:function(colInd){var noCancel,res,col=this.grid.options.columns[colInd],grid=this.grid;noCancel=this._trigger(this.events.columnFixing,null,{columnIndex:colInd,columnKey:col.key,owner:grid});if(noCancel){res=this.fixColumn(colInd);if(res.error===this.internalErrors.FixingRefused||res.result===false){this._trigger(this.events.columnFixingRefused,null,{columnIndex:colInd,columnKey:col.key,owner:grid})}else{this._trigger(this.events.columnFixed,null,{columnIndex:colInd,columnKey:col.key,owner:grid})}}},fixColumn:function(colIdentifier){var col,colWidth,colInd,res,scrollContainer,colIdentifierType=$.type(colIdentifier),grid=this.grid,gridId=grid.id(),tableIndex,gridWidth=parseInt(grid.options.width,10),isFixedContainer=false,headerContainer,footerContainer,fixedHeaderContainerId=gridId+"_fixedHeaderContainer",fixedBodyContainerId=gridId+"_fixedBodyContainer",fixedFooterContainerId=gridId+"_fixedFooterContainer",i,cols=this.grid.options.columns,colsLength=cols.length;res={error:this.internalErrors.None,result:true,col:null,columnIndex:colInd};if(colIdentifierType==="number"){colInd=colIdentifier}else if(colIdentifierType==="string"){for(i=0;i<colsLength;i++){if(cols[i].key===colIdentifier){colInd=i;break}}if(i===colsLength){res.result=false;res.error=this.internalErrors.NotValidIdentifier;return res}}col=cols[colInd];if(col===null||col===undefined){res.result=false;res.error=this.internalErrors.NotValidIdentifier;return res}if(col.fixed===true){res.result=false;res.error=this.internalErrors.AlreadyFixed;return res}res.columnIndex=colInd;res.col=col;if(isNaN(gridWidth)){gridWidth=this.grid.container().outerWidth()}if($("#"+gridId+"_"+col.key).outerWidth()+$("#"+gridId+"_mainFixedContainer").outerWidth()+this.grid._scrollbarWidth()>=gridWidth){res.result=false;res.error=this.internalErrors.FixingRefused;return res}if(grid._loadingIndicator){grid._loadingIndicator.show()}col.fixed=true;this.grid._fixedColumns.push(col);if($("#"+gridId+"_"+col.key).length===0){tableIndex=colInd+1}else{tableIndex=$("#"+gridId+"_"+col.key).index()+1}if(grid.options.virtualization===true||grid.options.rowVirtualization===true){scrollContainer=this.grid._vdisplaycontainer()}else{scrollContainer=this.grid.scrollContainer()}footerContainer=this.grid._fixedfooters();if(grid.options.showHeader&&grid.options.fixedHeaders&&grid.options.height!==null){headerContainer=this.grid.headersTable().parent("div");isFixedContainer=true;colWidth=this._fixColumnByContainer(tableIndex,fixedHeaderContainerId,headerContainer,false,true,false,isFixedContainer)}colWidth=this._fixColumnByContainer(tableIndex,fixedBodyContainerId,scrollContainer,true,false,false,isFixedContainer,colWidth);if(grid.options.showFooter&&grid.options.fixedFooters&&grid.options.height!==null&&footerContainer.length>0){this._fixColumnByContainer(tableIndex,fixedFooterContainerId,footerContainer,false,false,true,isFixedContainer,colWidth)}this.grid._visibleColumnsArray=undefined;cols.splice(colInd,1);cols.splice(this.grid._fixedColumns.length-1,0,col);this.grid._updateHeaderColumnIndexes();if(this.grid.options.width===null&&this.grid._fixedColumns.length===1){gridWidth=$("#"+gridId+"_mainFixedContainer").outerWidth()+$("#"+gridId).outerWidth();$("#"+this.grid.id()+"_container").css("width",gridWidth)}if(grid._loadingIndicator){grid._loadingIndicator.hide()}this.grid._onColumnFixed(colInd,true);this.grid._hscrollbarcontent().scrollLeft(0);this._changeStyleHeaderButton(col.key,true);return res},_fixColumnByContainer:function(colInd,fixedContainerId,scrollContainer,isDataContainer,isHeaderContainer,isFooterContainer,isFixedHeader,cW){var self=this,grid=this.grid,h,scroller=this.grid._hscrollbarcontent(),fixingDirection,fixedTable,tdsFirst,$thead,$tfoot,tdsLength,j,syncScrollContainers,mainFixedContainerId=grid.id()+"_mainFixedContainer",mainFixedContainer=$("#"+mainFixedContainerId),fixedContainer=$("#"+fixedContainerId),isNewFixedContainer=false,fixedControllerScrollerId=grid.id()+"_fixedContainerScroller",oTable,oTableWidth,scrollContainerHeight,col,heights=[],ind,fixedTDs,colWidth,width=0;oTable=scrollContainer.find("table");if(scrollContainer.length===0){scrollContainer=$("#"+grid.id());oTable=scrollContainer}if(cW!==undefined){colWidth=cW}else{colWidth=oTable.find("tr:nth-child(1)").find("td:nth-child("+colInd+"), th:nth-child("+colInd+")").eq(0).outerWidth()}if(mainFixedContainer.length===0){mainFixedContainer=$('<div id="'+mainFixedContainerId+'" data-fixed-container="true"></div>');mainFixedContainer.css({overflow:"hidden",position:"relative"});mainFixedContainer.addClass(this.css.fixedContainer);fixingDirection="left";if(this.options.fixingDirection==="left"){fixingDirection="left";mainFixedContainer.addClass(this.css.leftFixedContainer);mainFixedContainer.insertBefore(scrollContainer);mainFixedContainer.css({"float":"left",left:0})}else if(this.options.fixingDirection==="right"){fixingDirection="right";mainFixedContainer.addClass(this.css.rightFixedContainer);mainFixedContainer.insertBefore(scrollContainer);mainFixedContainer.css({"float":"right",right:0})}mainFixedContainer.attr("data-fixing-direction",fixingDirection)}if(fixedContainer.length===0){oTable.find("tr").map(function(ind){heights.push({h:this.offsetHeight,r:this})});isNewFixedContainer=true;fixedContainer=$('<div id="'+fixedContainerId+'"></div>');$('<table id="'+oTable.attr("id")+'_fixed" style="table-layout:fixed;" border=0 cellpadding=0 cellspacing=0><colgroup /><tbody /></table>').appendTo(fixedContainer);scrollContainerHeight=scrollContainer.height();if(isDataContainer){if(this.grid._hscrollbar().is(":visible")){scrollContainerHeight+=this.grid._hscrollbar().innerHeight()}fixedContainer.attr("data-fixed-container","true")}if(this.grid.options.height===null){scrollContainerHeight="100%"}fixedContainer.css({overflow:"hidden",position:"relative"});if(!isFooterContainer){fixedContainer.height(scrollContainerHeight)}fixedContainer.attr("data-scroll","true");fixedContainer.appendTo(mainFixedContainer);fixedTable=$("#"+oTable.attr("id")+"_fixed");fixedTable.addClass(oTable.attr("class"));if(isHeaderContainer){scrollContainer.height(scrollContainer.height());this.grid._renderFixedCaption()}if(isDataContainer){this.grid._fixedTable=fixedTable;if(this.options.fixingDirection==="right"){fixedContainer.css({"overflow-y":"auto"});scrollContainer.css({"overflow-y":"hidden"})}grid._renderFixedRecords(fixedTable,undefined,undefined,true);syncScrollContainers=function(direction){var scrollTop=fixedContainer.scrollTop();scrollTop+=-direction*self.options.scrollDelta;if(scrollTop<=0){scrollTop=0}fixedContainer.scrollTop(scrollTop);scrollContainer.scrollTop(scrollTop)};this._onMouseWheelHandler=function(event){var evt,direction,w,d;evt=event.originalEvent;w=evt.wheelDelta;d=evt.detail;if(d){if(w){direction=w/d/40*d>0?1:-1}else{direction=-d/3}}else{direction=w/120}syncScrollContainers(direction);if(grid.options.height===null){return true}return false};this._DOMMouseScroll=function(event){var dir=-1,delta;delta=-event.originalEvent.detail/3;if(delta>0){dir=1}syncScrollContainers(dir);if(grid.options.height===null){return true}event.preventDefault()};this._onKeyDown=function(event){var isUp=event.keyCode===$.ui.keyCode.UP,isDown=event.keyCode===$.ui.keyCode.DOWN;if(isUp){syncScrollContainers(1)}else if(isDown){syncScrollContainers(-1)}};if($.ig.util.isIE||this.options.fixingDirection==="right"){scrollContainer.bind({keydown:this._onKeyDown,mousewheel:this._onMouseWheelHandler,DOMMouseScroll:this._DOMMouseScroll})}scrollContainer.bind({scroll:function(){var top=$(this).scrollTop();fixedContainer.scrollTop(top)}});fixedContainer.bind({mousewheel:this._onMouseWheelHandler,DOMMouseScroll:this._DOMMouseScroll});if(this.options.fixingDirection==="right"){fixedContainer.bind({scroll:function(){var top=$(this).scrollTop();scrollContainer.scrollTop(top)},keydown:this._onMouseWheelHandler})}}}else{fixedTable=$("#"+oTable.attr("id")+"_fixed");width=fixedTable[0].clientWidth}oTableWidth=oTable.outerWidth();if(oTableWidth>0&&!(this.grid.options.width===null&&oTableWidth+this.grid._scrollbarWidth()===scrollContainer.width())){oTableWidth-=colWidth;oTable.width(oTableWidth)}width+=colWidth;fixedTable.width(width);col=scrollContainer.find("colgroup col:nth-child("+colInd+")").detach();if(col.length>0){col.appendTo(fixedTable.find("colgroup"))}ind=grid._fixedColumns.length-1;if(isHeaderContainer||isDataContainer&&!isFixedHeader){tdsFirst=oTable.find("th:nth-child("+colInd+"), td:nth-child("+colInd+")").detach();if(!isNewFixedContainer){fixedTDs=fixedTable.find("thead th:nth-child("+ind+"), td:nth-child("+ind+")")}}else{tdsFirst=oTable.find("td:nth-child("+colInd+")").detach();if(!isNewFixedContainer){fixedTDs=fixedTable.find("td:nth-child("+ind+")")}}if(isNewFixedContainer){if(isHeaderContainer||!isFixedHeader&&isDataContainer){if(oTable.find("tbody").next("thead").length>0){$thead=$("<thead></thead>").insertAfter(fixedTable.find("tbody"))}else{$thead=$("<thead></thead>").insertAfter(fixedTable.find("colgroup").eq(0))}oTable.find("thead tr").each(function(ci,tr){var $td=$(tdsFirst[ci]),css=$(this).attr("class");if(css===undefined||css===null){css=""}else{css=' class="'+css+'"'}$td.appendTo($("<tr"+css+"></tr>").appendTo($thead))})}else if(isFooterContainer){$tfoot=$("<tfoot></tfoot>").appendTo(fixedTable);oTable.find("tr").each(function(ci,tr){var id="",$td=$(tdsFirst[ci]),css=$(this).attr("class"),attr="";if(css===undefined||css===null){css=""}else{css=' class="'+css+'"'}if(tr.id){id=' id="'+tr.id+'_fixed"'}$(tr.attributes).each(function(){attr+=" "+this.nodeName+'="'+this.nodeValue+'" '});$td.appendTo($("<tr"+css+id+attr+"></tr>").appendTo($tfoot))})}fixedTable.find("tr").each(function(ind,$row){$(tdsFirst[ind]).appendTo($row)})}else{tdsLength=tdsFirst.length;if(tdsLength>0){for(j=0;j<tdsLength;j++){$(tdsFirst[j]).insertAfter($(fixedTDs[j]))}}}if(isNewFixedContainer){if(this.options.syncRowHeights){$.each(heights,function(ci,elem){elem.r.style.height=elem.h+"px"});fixedTable.find("tr").map(function(ci){this.style.height=heights[ci].h+"px"})}if(!isHeaderContainer&&scroller.length===1&&$("#"+fixedControllerScrollerId).length===0){$('<div style="height:'+this.grid._hscrollbar().height()+'px" id="'+fixedControllerScrollerId+'"></div>').appendTo(fixedContainer)}}if(isDataContainer&&oTableWidth>0){scrollContainer.scrollTop(0);this.grid._hscrollbar().css({width:scrollContainer.width()+"px",left:0});this.grid._hscrollbarinner().css({width:(this.grid._hasVerticalScrollbar&&this.grid.options.fixedHeaders?oTableWidth-this.grid._scrollbarWidth():oTableWidth)+"px",left:0});if(this.grid.options.height===null){h=scrollContainer.height()-mainFixedContainer.height();if(h>this.scrollContainerCheckValue){$("<div></div>").css("height",h).appendTo(mainFixedContainer)}}}if(this.grid.options.width===null&&oTable[0].style.width===""){oTable[0].style.width=oTable.outerWidth()+"px"}return colWidth},_headerRendered:function(sender,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this.options.showFixButtons===false){return}var i,cs,columnKey,cols=this.grid.options.columns,colsLength=cols.length,isFixed;for(i=0;i<colsLength;i++){columnKey=cols[i].key;cs=this._getColumnSettingByKey(columnKey,i);isFixed=false;if(cs!==null){if(cs.allowFixing===false){continue}if(cs.isFixed===true){isFixed=true}}this._renderHeaderCellButton(columnKey,isFixed)}},_getColumnSettingByKey:function(key,colIndex){var i,cs=this.options.columnSettings,csLength=cs.length,res=null;for(i=0;i<csLength;i++){if(cs[i].columnKey!==null&&cs[i].columnKey!==undefined){if(cs[i].columnKey===key){res=cs[i];break}}else if(cs[i].columnIndex!==null&&cs[i].columnIndex!==undefined){if(cs[i].columnIndex===colIndex){res=cs[i];break}}}return res},_id:function(){var i,res=this.grid.id(),argumentsLength=arguments.length;if(argumentsLength===0){return null}for(i=0;i<argumentsLength;i++){res+="_"+arguments[i]}return res},_renderHeaderCellButton:function(columnKey,isFixed){var self=this,$th=$("#"+this.grid.id()+"_"+columnKey),buttonId=this._id("header_cell","fixing",columnKey),$button,$divHeaderButtonContainer,columnFixingHeaderIconContainer;if($th.length===0){return}columnFixingHeaderIconContainer=$th.find(".ui-iggrid-indicatorcontainer");if(columnFixingHeaderIconContainer.length===0){columnFixingHeaderIconContainer=$("<div></div>").appendTo($th);columnFixingHeaderIconContainer.addClass("ui-iggrid-indicatorcontainer")}$button=$("#"+buttonId);if($button.length===0){$button=$("<a></a>").attr("href","#").attr("data-fixing-indicator","true").attr("id",buttonId);$divHeaderButtonContainer=columnFixingHeaderIconContainer.find(".ui-iggrid-fixcolumn-headerbuttoncontainer");if($divHeaderButtonContainer.length===0){$divHeaderButtonContainer=$("<div></div>").addClass("ui-iggrid-fixcolumn-headerbuttoncontainer").appendTo(columnFixingHeaderIconContainer)}$button.appendTo($divHeaderButtonContainer);$("<span></span>").appendTo($button);$button.bind({mousedown:function(event){self._preventDefaultEvent(event);$(this).trigger("mouseout");return false},click:function(event){var ind=$(this).closest("th").data("columnIndex");self._preventDefaultEvent(event);if($button.attr("data-fixed")==="true"){self._unfixColumnInternal(ind)}else{self._fixColumnInternal(ind)}}})}this._changeStyleHeaderButton(columnKey,isFixed)},_changeStyleHeaderButton:function(columnKey,isFixed){var css=this.css,attrVal="true",title=this.options.headerFixButtonText,$button=$("#"+this._id("header_cell","fixing",columnKey)),$span=$button.find("span");if(isFixed){$span.removeClass(css.headerButtonIcon);$span.addClass(css.headerButtonUnfixIcon);title=this.options.headerUnfixButtonText}else{attrVal="false";$span.removeClass(css.headerButtonUnfixIcon);$span.addClass(css.headerButtonIcon)}$button.attr("data-fixed",attrVal).attr("title",title)},_gridInternalRendered:function(event,ui){var i,j,cs=this.options.columnSettings,csLength=cs.length,columnKeys=[],hasColumnKey,hasColumnIndex,cols=this.grid.options.columns,colsLength=cols.length;for(i=0;i<csLength;i++){if(cs[i].isFixed!==true){continue}hasColumnKey=cs[i].columnKey!==null&&cs[i].columnKey!==undefined;hasColumnIndex=cs[i].columnIndex!==null&&cs[i].columnIndex!==undefined;if(!hasColumnKey){if(!hasColumnIndex){continue}if(cs[i].columnIndex>=0&&cs[i].columnIndex<colsLength){columnKeys.push(cols[cs[i].columnIndex].key)}}else{columnKeys.push(cs[i].columnKey)}}for(j=0;j<columnKeys.length;j++){this.fixColumn(columnKeys[j])}},_preventDefaultEvent:function(event){event.preventDefault();event.stopPropagation()},destroy:function(){if(this.grid._fixedColumns&&this.grid._fixedColumns.length>0){this.unfixAllColumns()}this.grid.headersTable().find("thead > tr > th").not("[data-skip=true]").each(function(){var th=$(this);th.find("a[data-fixing-indicator=true]").parent().remove()});$.Widget.prototype.destroy.call(this);return this},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;if(this._headerRenderedHandler!==null&&this._headerRenderedHandler!==undefined){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}this._headerRenderedHandler=$.proxy(this._headerRendered,this);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);if(this.grid._columns===undefined||this.grid._columns===null){this.grid._columns=this.grid.options.columns.clone()}this._gridRenderedHandler=$.proxy(this._gridInternalRendered,this);this.grid.element.bind("iggridrendered",this._gridRenderedHandler);this.grid._fixedColumns=[]}});$.extend($.ui.igGridColumnFixing,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Column Moving 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.tree.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridColumnMoving",{renderInFeatureChooser:true,options:{columnSettings:[{columnKey:null,columnIndex:null,allowMoving:true}],mode:"immediate",moveType:"dom",addMovingDropdown:true,movingDialogWidth:400,movingDialogHeight:"",movingDialogAnimationDuration:200,movingAcceptanceTolerance:20,movingScrollTolerance:20,scrollSpeedMultiplier:2,scrollDelta:2,hideHeaderContentsDuringDrag:true,dragHelperOpacity:1,movingDialogCaptionButtonDesc:$.ig.ColumnMoving.locale.movingDialogCaptionButtonDesc,movingDialogCaptionButtonAsc:$.ig.ColumnMoving.locale.movingDialogCaptionButtonAsc,movingDialogCaptionText:$.ig.ColumnMoving.locale.movingDialogCaptionText,movingDialogDisplayText:$.ig.ColumnMoving.locale.movingDialogDisplayText,dropDownMoveLeftText:$.ig.ColumnMoving.locale.dropDownMoveLeftText,dropDownMoveRightText:$.ig.ColumnMoving.locale.dropDownMoveRightText,dropDownMoveFirstText:$.ig.ColumnMoving.locale.dropDownMoveFirstText,dropDownMoveLastText:$.ig.ColumnMoving.locale.dropDownMoveLastText,movingToolTipMove:$.ig.ColumnMoving.locale.movingToolTipMove,columnMovingDialogContainment:"owner"},css:{headerCellMouseOver:"ui-state-hover",dropDownButton:"ui-iggrid-moving-indicator",dropDownIndicatorContainer:"ui-iggrid-indicatorcontainer",dragIndicatorTop:"ui-iggrid-columnmoving-dragtop",dragIndicatorBottom:"ui-iggrid-columnmoving-dragbottom",featureChooserIconContainer:"ui-iggrid-featurechoosericoncontainer",featureChooserMovingDialogIcon:"ui-icon ui-icon-newwin",featureChooserLeftIcon:"ui-icon ui-iggrid-icon-left",featureChooserRightIcon:"ui-icon ui-iggrid-icon-right",featureChooserFirstIcon:"ui-icon ui-iggrid-icon-first",featureChooserLastIcon:"ui-icon ui-iggrid-icon-last",columnMovingDropDown:"ui-iggrid-featurechooser-dropdown-dialog ui-widget ui-widget-content ui-corner-all",columnMovingDropDownList:"ui-iggrid-featurechooser-list ui-menu",columnMovingDropDownItem:"ui-iggrid-featurechooserddlistitemicons ui-state-default",columnMovingDropDownItemHover:"ui-iggrid-featurechooser-listitem-hover ui-state-active ui-state-hover",columnMovingDropDownItemText:"ui-iggrid-featurechooserddlistitemtext",columnMovingIndicatorSelected:"ui-iggrid-hiding-indicator-selected",movingDialogItemList:"ui-iggrid-moving-dialog-columns",movingDialogListItem:"ui-widget-content",movingDialogListItemArrowUp:"ui-icon-arrowthick-1-n ui-button-icon-primary ui-icon",movingDialogListItemArrowDown:"ui-icon-arrowthick-1-s ui-button-icon-primary ui-icon",movingDialogListItemArrowButton:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",movingDialogListItemText:"ui-iggrid-dialog-text",movingDialogCloseButton:"ui-icon ui-icon-close"},events:{columnDragStart:"columnDragStart",columnDragEnd:"columnDragEnd",columnDragCanceled:"columnDragCanceled",columnMoving:"columnMoving",columnMoved:"columnMoved",movingDialogOpening:"movingDialogOpening",movingDialogOpened:"movingDialogOpened",movingDialogDragged:"movingDialogDragged",movingDialogClosing:"movingDialogClosing",movingDialogClosed:"movingDialogClosed",movingDialogContentsRendering:"movingDialogContentsRendering",movingDialogContentsRendered:"movingDialogContentsRendered",movingDialogMoveUpButtonPressed:"movingDialogMoveUpButtonPressed",movingDialogMoveDownButtonPressed:"movingDialogMoveDownButtonPressed",movingDialogDragColumnMoving:"movingDialogDragColumnMoving",movingDialogDragColumnMoved:"movingDialogDragColumnMoved"},_createWidget:function(options,element){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._cache={};this._cKey="";this._cIdx=-1;this._tKey="";this._tIdx=-1;this._oTh=null;this._cmib=null;this._cmit=null;this._movingDialog=null;this._groupBy=null;this._ddButtons={first:{text:this.options.dropDownMoveFirstText,func:$.proxy(this._moveFirst,this),icon:this.css.featureChooserFirstIcon},left:{text:this.options.dropDownMoveLeftText,func:$.proxy(this._moveLeft,this),icon:this.css.featureChooserLeftIcon},right:{text:this.options.dropDownMoveRightText,func:$.proxy(this._moveRight,this),icon:this.css.featureChooserRightIcon},last:{text:this.options.dropDownMoveLastText,func:$.proxy(this._moveLast,this),icon:this.css.featureChooserLastIcon}};this._hscroller=null;this._scroller={on:false,delay:-1};if(this.options.mode!=="immediate"&&this.options.mode!=="deferred"){this.options.mode="immediate"}if(this.options.mode==="immediate"&&this.options.moveType==="render"){this.options.moveType="dom"}if(this.options.addMovingDropdown===false){this.renderInFeatureChooser=false}},_setOption:function(key,value){if(key==="mode"||key==="columnSettings"||key==="addMovingDropdown"){throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+key)}$.Widget.prototype._setOption.apply(this,arguments)},destroy:function(){this._unregisterEvents();this._removeMoving();$.Widget.prototype.destroy.call(this);return this},moveColumn:function(column,target,after,inDom){this._moveColumn(column,target,after,inDom,true)},_headerCellRendered:function(event,args){if(this.grid.id()!==args.owner.id()){return}this._thRendered(args.th)},_headerRendering:function(event,args){var i;for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="GroupBy"){this._groupBy=this.grid.element.data("igGridGroupBy");break}}},_headerRendered:function(event,args){if(this.grid.id()!==args.owner.id()){return}this._thsRendered(args.table)},_gridFullyRendered:function(event,args){this._updateLayout()},_headerPicked:function(event,args){var $th=$(event.target).closest("th"),id=this._getIdOfTh($th),noCancel=true;args={columnKey:id,columnIndex:$th.index(),owner:this,header:$th,helper:args.helper};noCancel=this._trigger(this.events.columnDragStart,event,args);if(noCancel){this._thPicked($th,id)}return noCancel},_headerDragged:function(event,args){var left;if(this._oPos){left=this._oPos.left>args.position.left}else{left=args.originalPosition.left>args.position.left}this._oPos={left:args.position.left};if(this._thDragged(args.helper,args.offset,left)){args.originalPosition.left=args.position.left}},_headerDropped:function(event,args){var $th=$(event.target).closest("th"),id=this._getIdOfTh($th),noCancel=true;args={columnKey:id,columnIndex:$th.index(),owner:this,header:$th,helper:args.helper};noCancel=this._trigger(this.events.columnDragEnd,event,args);if(noCancel){this._thDropped()}else{this._trigger(this.events.columnDragCanceled,event,args)}return noCancel},_dialogUpPressed:function(event,args){var tar=$(event.target),item=tar.closest("li"),parent=item.parent(),idx=item.index(),iItem=idx===0?item.parent().children().last().attr("data-value"):item.prev().attr("data-value"),iDir=idx===0?true:false,col=tar.closest("span").attr("datakey"),a;a={owner:this,movingDialog:this._movingdialog,columnKey:col,columnIndex:idx,targetIndex:idx===0?parent.children().length-1:idx-1};if(idx===0){item.detach().insertAfter(parent.children("li:last"))}else{item.detach().insertBefore(parent.children("li:eq("+(idx-1)+")"))}this._cKey=col;this._cIdx=a.columnIndex;this._tIdx=a.targetIndex;this._moveColumn(col,iItem,iDir,this.options.moveType==="dom",false);this._trigger(this.events.movingDialogMoveUpButtonPressed,null,a)},_dialogDownPressed:function(event,args){var tar=$(event.target),item=tar.closest("li"),parent=item.parent(),idx=item.index(),iItem=idx===item.siblings().length?item.parent().children().first().attr("data-value"):item.next().attr("data-value"),iDir=idx===item.siblings().length?false:true,col=tar.closest("span").attr("datakey"),a;a={owner:this,movingDialog:this._movingdialog,columnKey:col,columnIndex:idx,targetIndex:idx===parent.children().length-1?0:idx+1};if(idx===item.parent().children().length-1){item.detach().insertBefore(parent.children("li:first"))}else{item.detach().insertAfter(parent.children("li:eq("+idx+")"))}this._cKey=col;this._cIdx=a.columnIndex;this._tIdx=a.targetIndex;this._moveColumn(col,iItem,iDir,this.options.moveType==="dom",false);this._trigger(this.events.movingDialogMoveDownButtonPressed,null,a)},_dialogRearranging:function(event,args){var noCancel,a,column=$(args.draggable),target=$(args.element),cid=column.attr("data-value"),tid=target.attr("data-value"),aft=$(args.element).closest("ul[data-depth=0]").data("igTree")._validationObject.dropAfter,cix=column.index(),tix=target.index();tix=tix>cix?aft?tix:tix-1:aft?tix+1:tix;a={owner:this,movingDialog:this._movingdialog,columnKey:cid,columnIndex:cix,targetIndex:tix};noCancel=this._trigger(this.events.movingDialogDragColumnMoving,null,a);if(noCancel){this._cKey=cid;this._cIdx=a.columnIndex;this._tIdx=a.targetIndex;this._moveColumn(cid,tid,aft,this.options.moveType==="dom",false);a.movingDialog.find("div.ui-state-highlight").remove();this._trigger(this.events.movingDialogDragColumnMoved,null,a);return true}return false},_dialogRearranged:function(event,args){this._bindUpDownDialogButtons(args.element.parent())},_dialogDragged:function(event,args){this._trigger(this.events.movingDialogDragged,null,{movingDialogElement:event.target,owner:this,originalPosition:args.originalPosition,position:args.position})},_dialogOpening:function(event,args){var noCancel;noCancel=this._trigger(this.events.movingDialogOpening,null,{movingDialogElement:event.target,owner:this});if(noCancel){this._renderMovingDialogContent(event,args);this._trigger(this.events.movingDialogOpened,null,{movingDialogElement:event.target,owner:this})}return noCancel},_dialogClosing:function(event,args){return this._trigger(this.events.movingDialogClosing,null,{movingDialogElement:event.target,owner:this})},_dialogClosed:function(event,args){this._trigger(this.events.movingDialogClosed,null,{movingDialogElement:event.target,owner:this})},_dropDownMouseDown:function(event,args){var ind=$(event.target);this._toggleDropDown(ind,$("div[data-moving-inddropdown='"+this.grid.id()+"']"));this._cancelEvent(event)},_dropDownKeyDown:function(event,args){var sItem,nItem,nItemB,dropdown=$("div[data-moving-inddropdown='"+this.grid.id()+"']");if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){sItem=dropdown.find("ul .ui-state-hover:first");if(dropdown.is(":visible")&&sItem.length>0){sItem.trigger("mousedown")}this._toggleDropDown($(event.target),dropdown,false);this._cancelEvent(event)}else if(event.keyCode===$.ui.keyCode.ESCAPE){this._toggleDropDown($(event.target),dropdown,false);this._cancelEvent(event)}else if(event.keyCode===$.ui.keyCode.DOWN||event.keyCode===$.ui.keyCode.UP){if(dropdown.is(":visible")){sItem=dropdown.find("ul .ui-state-hover:first").closest("li");if(sItem.length===0){nItem=dropdown.find("ul li:eq(0)")}else{if(sItem.index()===0&&event.keyCode===$.ui.keyCode.UP){nItem=sItem.parent().children(":last")}else{nItem=event.keyCode===$.ui.keyCode.DOWN?sItem.next():sItem.prev()}}dropdown.find("ul .ui-state-hover").removeClass(this.css.columnMovingDropDownItemHover);nItemB=nItem.find("[role='button']");if(nItemB.length>0){nItem=nItemB}nItem.addClass(this.css.columnMovingDropDownItemHover)}this._cancelEvent(event)}},_dropDownButtonMouseOver:function(event,args){$(event.currentTarget).addClass(this.css.columnMovingDropDownItemHover)},_dropDownButtonMouseOut:function(event,args){$(event.currentTarget).removeClass(this.css.columnMovingDropDownItemHover)},_moveLeft:function(event,args){var sib=this._cache.siblings[args],cid,tid,i;for(i=0;i<sib.length;i++){cid=sib[i].key||sib[i].identifier;if(cid===args){if(i>0){this._cKey=args;this._cIdx=i;this._tIdx=i-1;tid=sib[i-1].key||sib[i-1].identifier;this._moveColumn(cid,tid,false,this.options.moveType==="dom",false)}break}}},_moveRight:function(event,args){var sib=this._cache.siblings[args],cid,tid,i;for(i=0;i<sib.length;i++){cid=sib[i].key||sib[i].identifier;if(cid===args){if(i<sib.length-1){this._cKey=args;this._cIdx=i;this._tIdx=i+1;tid=sib[i+1].key||sib[i+1].identifier;this._moveColumn(cid,tid,true,this.options.moveType==="dom",false)}break}}},_moveFirst:function(event,args){var sib=this._cache.siblings[args],cid,tid,i;for(i=0;i<sib.length;i++){cid=sib[i].key||sib[i].identifier;if(cid===args){if(i!==0){this._cKey=args;this._cIdx=i;this._tIdx=0;tid=sib[0].key||sib[0].identifier;this._moveColumn(cid,tid,false,this.options.moveType==="dom",false)}break}}},_moveLast:function(event,args){var sib=this._cache.siblings[args],cid,tid,i;for(i=0;i<sib.length;i++){cid=sib[i].key||sib[i].identifier;if(cid===args){if(i!==sib.length-1){this._cKey=args;this._cIdx=i;this._tIdx=sib.length-1;tid=sib[sib.length-1].key||sib[sib.length-1].identifier;this._moveColumn(cid,tid,true,this.options.moveType==="dom",false)}break}}},_headerMouseOver:function(event,args){$(event.target).closest("th").addClass(this.css.headerCellMouseOver)},_headerMouseOut:function(event,args){$(event.target).closest("th").removeClass(this.css.headerCellMouseOver)},_renderHelpers:function(){this._cmib=$("<div>&nbsp;</div>").attr("id",this.grid.id()+"_moving_indicator_bottom").addClass(this.css.dragIndicatorTop).css({position:"absolute","z-index":"1000000",width:"16px",height:"16px",display:"none"}).appendTo(document.body);this._cmit=$("<div>&nbsp;</div>").attr("id",this.grid.id()+"_moving_indicator_top").addClass(this.css.dragIndicatorBottom).css({position:"absolute","z-index":"1000000",width:"16px",height:"16px",display:"none"}).appendTo(document.body)},_renderFeatureChooser:function(col,th){var fc=this.grid.element.data("igGridFeatureChooser");if(fc){if(fc._shouldRenderInFeatureChooser(col)===true){this._addMoveButtonsInFeatureChooser(fc,col);fc._renderInFeatureChooser(col,{name:"ColumnMovingDialog",text:this.options.movingDialogDisplayText,secondaryIconClass:this.css.featureChooserMovingDialogIcon,method:this._openMovingDialogHandler,groupName:"modaldialog",groupOrder:3,order:5})}else{this._renderMovingDropDownIndicator(th,col)}}},_renderMovingDropDownIndicator:function(th,col){var $button,$anchor,$container,self=this;$button=$("<span></span>").addClass(this.css.dropDownButton);$anchor=$("<a></a>").attr("href","#").attr("th-remove-focus","").attr("title",this.options.movingToolTipMove).attr("id",this.grid.id()+"_moving_headerButton_"+col).bind({keydown:this._dropDownKeyHandler,blur:function(e){self._toggleDropDown($(e.target),$("div[data-moving-inddropdown='"+self.grid.id()+"']"),true)},mousedown:this._dropDownButtonHandler,mouseup:this._cancelEventHandler,click:this._cancelEventHandler});$container=$("<div></div>").addClass(this.css.dropDownIndicatorContainer).appendTo(th);$button.appendTo($anchor);$anchor.appendTo($container);this._needToRenderDropDown=true},_renderMovingDialogContent:function(){var $content=this._movingDialog.igGridModalDialog("getContent"),movingDialog=this._movingdialog,$tree=$content.find("#"+this.grid.id()+"_dialog_tree"),noCancel;noCancel=this._trigger(this.events.movingDialogContentsRendering,null,{movingDialogElement:movingDialog,owner:this});if(noCancel){if($tree.length>0){$tree.igTree("option","dataSource",this._getClonedDataSource(this.grid._visibleMchColumns()||this.grid._visibleColumns()))}else{$tree=this._initializeTree($content)}this._bindUpDownDialogButtons($tree);this._trigger(this.events.movingDialogContentsRendered,null,{movingDialogElement:movingDialog,owner:this})}},_initializeTree:function(content){var self=this;return $("<ul id='"+this.grid.id()+"_dialog_tree'></ul>").appendTo(content).igTree({dataSourceType:"json",dataSource:this._getClonedDataSource(this.grid._visibleMchColumns()||this.grid._visibleColumns()),bindings:{primaryKey:"key",textKey:"headerText",valueKey:"key",childDataProperty:"group",nodeContentTemplate:this._getTreeTemplate()},dragAndDrop:true,dragAndDropSettings:{dragAndDropMode:"move",revert:true,zIndex:1000001,customDropValidation:function(col){var context=$(this),$col=$(col);if(self._isColumnMovable($col.attr("data-value"))){if(context.is("li")&&context.parent()[0]===$col.parent()[0]){return true}}return false},containment:false},nodeDropping:this._dialogRearrangingHandler,nodeDropped:this._dialogRearrangedHandler,selectionChanging:function(){return false}})},_getClonedDataSource:function(ds){return jQuery.extend(true,[],ds,this._cloneMovable(ds))},_cloneMovable:function(ds){var self=this,movableClone=[],idx=0;$.each(ds,function(){if(this.group){movableClone.push({movable:self._isColumnMovable(this.key,idx++),group:self._cloneMovable(this.group),key:this.key||this.identifier||idx})}else{movableClone.push({movable:self._isColumnMovable(this.key,idx++),key:this.key||idx})}});return movableClone},_getTreeTemplate:function(){var tmpl="",up,down,wrapper,data;data="<span>${headerText}</span>";wrapper="<span class='"+this.css.movingDialogListItemArrowButton+"'>";up=wrapper+"<span id='"+this.grid.id()+"_moving_dialog_${key}_up' title='"+this.options.movingDialogCaptionButtonAsc+"' role='button' datakey='${key}' class='"+this.css.movingDialogListItemArrowUp+"' style='"+"margin-top:-10px;'></span></span>";down=wrapper+"<span id='"+this.grid.id()+"_moving_dialog_${key}_down' title='"+this.options.movingDialogCaptionButtonDesc+"' role='button' datakey='${key}' class='"+this.css.movingDialogListItemArrowDown+"' style='"+"margin-top:-10px;'></span></span>";wrapper+="</span>";tmpl+="{{if ${movable} }}";tmpl+=up+down+data;tmpl+="{{else}}";tmpl+=wrapper+wrapper+data;tmpl+="{{/if}}";return tmpl},_renderMovingDialog:function(){var o=this.options,containment,$captionButtonContainer,$closeButton,movingDialog=$("<div></div>").appendTo("body").attr("id",this.grid.id()+"_moving_movingDialog");this._movingDialog=movingDialog;if(this.options.columnMovingDialogContainment==="owner"){containment=this.grid.container()}else{containment="window"}movingDialog.igGridModalDialog({containment:containment,renderFooterButtons:false,modalDialogCaptionText:o.movingDialogCaptionText,modalDialogWidth:o.movingDialogWidth,modalDialogHeight:o.movingDialogHeight,animationDuration:o.movingDialogAnimationDuration,gridContainer:this.grid.container(),modalDialogOpening:this._dialogOpeningHandler,modalDialogMoving:this._dialogDraggedHandler,modalDialogClosing:this._dialogClosingHandler,modalDialogClosed:this._dialogClosedHandler});$captionButtonContainer=movingDialog.igGridModalDialog("getCaptionButtonContainer");$closeButton=$("<button></button>").attr("id",this.grid.id()+"_moving_movingDialog_closeButton").appendTo($captionButtonContainer);$closeButton.igButton({onlyIcons:true,icons:{primary:this.css.movingDialogCloseButton},width:"20px",height:"20px",click:this._dialogCloseButtonHandler})},_renderDropDown:function(element){var self=this,dropDown,list;dropDown=$("<div data-moving-inddropdown='"+this.grid.id()+"'></div>").css("position","absolute").css("display","none").addClass(this.css.columnMovingDropDown).appendTo("body");list=$('<ul tabindex="0"></ul>').addClass(this.css.columnMovingDropDownList).appendTo(dropDown);$.each(this._ddButtons,function(key,val){$("<li></li>").addClass(self.css.columnMovingDropDownItem).attr("data-key",key).bind({mouseover:self._dropDownButtonMouseOverHandler,mouseout:self._dropDownButtonMouseOutHandler}).append($("<span></span>").addClass(self.css.featureChooserIconContainer).append($("<span></span>").addClass(val.icon))).append($("<span></span>").addClass(self.css.columnMovingDropDownItemText).text(val.text)).appendTo(list)});$("<a></a>").appendTo($("<li></li>").appendTo(list)).igButton({labelText:this.options.movingDialogCaptionText,mousedown:function(event){if(event.target){setTimeout(function(){$(event.target).removeClass("ui-state-active")},0)}self._toggleDropDown(element,dropDown,true);self._openMovingDialog(element,dropDown,true)}});return dropDown},_toggleDropDown:function(element,dropDown,isCalledFromBlur){var th,id,isLast,offset,left,isVisible=dropDown.is(":visible")===true,nth=element?element.closest("th"):null,nid=nth?nth.attr("id")||nth.attr("data-mch-id"):null,self=this;if(dropDown.data("isAnimating")===true||nid!==null&&this._currentlyToggled!==nid&&isCalledFromBlur===true||isVisible===false&&isCalledFromBlur===true){return}if(!isVisible){th=nth;isLast=th.parent().children().length-th.index()<=2;offset=th.offset();if(isLast){left=offset.left+th.outerWidth()-dropDown.outerWidth();left=Math.max(0,left)}else{left=offset.left}dropDown.css("top",offset.top+th.outerHeight());dropDown.css("left",left);$.each(this._ddButtons,function(key,value){dropDown.find("li[data-key='"+key+"']").bind("mousedown.temp",function(event){self._toggleDropDown(element,dropDown,true);id=th.attr("id");if(id){id=id.replace(self.grid.id()+"_","")}else{id=th.attr("data-mch-id")}value.func(null,id);event.stopPropagation();event.preventDefault()})});this._currentlyToggled=th.attr("id")||th.attr("data-mch-id")}else{$.each(this._ddButtons,function(key,value){dropDown.find("li[data-key='"+key+"']").unbind("mousedown.temp")})}dropDown.data("isAnimating",true);dropDown.toggle(200,function(){if(dropDown.is(":visible")===true){th.find("a").focus();if(element){element.addClass(self.css.columnMovingIndicatorSelected);element.attr("data-indicator-selected","true")}}else{if(element){element.removeClass(self.css.columnMovingIndicatorSelected);element.removeAttr("data-indicator-selected")}}dropDown.data("isAnimating",false)})},_addMoveButtonsInFeatureChooser:function(fc,key){fc._renderInFeatureChooser(key,{name:"First",text:this.options.dropDownMoveFirstText,iconClass:this.css.featureChooserFirstIcon,isSelectable:false,isSelected:false,method:$.proxy(this._moveFirst,this),updateOnClickAll:false,groupName:"click",groupOrder:2,order:2});fc._renderInFeatureChooser(key,{name:"Left",text:this.options.dropDownMoveLeftText,iconClass:this.css.featureChooserLeftIcon,isSelectable:false,isSelected:false,method:$.proxy(this._moveLeft,this),updateOnClickAll:false,groupName:"click",groupOrder:2,order:3});fc._renderInFeatureChooser(key,{name:"Right",text:this.options.dropDownMoveRightText,iconClass:this.css.featureChooserRightIcon,isSelectable:false,isSelected:false,method:$.proxy(this._moveRight,this),updateOnClickAll:false,groupName:"click",groupOrder:2,order:4});fc._renderInFeatureChooser(key,{name:"Last",text:this.options.dropDownMoveLastText,iconClass:this.css.featureChooserLastIcon,isSelectable:false,isSelected:false,method:$.proxy(this._moveLast,this),updateOnClickAll:false,groupName:"click",groupOrder:2,order:6})},_moveColumn:function(column,target,after,inDom,fromApi){var noCancel=true,args;if(fromApi===false){args={columnKey:this._cKey,columnIndex:this._cIdx,targetIndex:this._tIdx,owner:this};noCancel=this._trigger(this.events.columnMoving,null,args)}if(noCancel){this._movingDirty=true;this.grid.moveColumn(column,target,after,inDom);if(fromApi===false){delete args.columnIndex;delete args.targetIndex;args.oldIndex=this._cIdx;args.newIndex=this._tIdx;this._triggerColumnMovedAsync(args)}}},_thRendered:function(th){var cid=this._getIdOfTh(th),cix=th.index("not[data-skip='true']");if(this._isColumnMovable(cid,cix)===true){this._markForMoving(th);if(this.options.addMovingDropdown===true){this._renderFeatureChooser(cid,th)}}},_thsRendered:function(){if(this.options.mode==="deferred"){this._renderHelpers()}if(this.options.addMovingDropdown===true){if(!this._movingDialog||this._movingDialog instanceof jQuery&&this._movingDialog.length===0){this._renderMovingDialog()}if($("div[data-moving-inddropdown='"+this.grid.id()+"']").length===0){this._renderDropDown()}}},_thPicked:function(th,id){this._cKey=id;this._cIdx=th.index();if(this.options.mode==="immediate"){if(this.options.hideHeaderContentsDuringDrag===true){th.children().not("div[data-hiddencolindicator]").hide()}this._oTh=th}},_thDragged:function(helper,pos,left){var siblings,targetKey,targetPosition,targetLeft,scrollLeft=0,dragX,i=0,j=0,updateEvent=false;siblings=this._cache.siblings[this._cKey];if(this._hscroller.length>0){scrollLeft=this._hscroller.scrollLeft()}dragX=left===true?pos.left:pos.left+helper.width();dragX+=scrollLeft;if(!this._gridReady()||this._movingDirty){return}while(i<=siblings.length){j=i===siblings.length?i-1:i;targetKey=siblings[j].key||siblings[j].identifier;if(targetKey===this._cKey&&this.options.mode==="immediate"){i+=2;continue}targetPosition=this._cache.columns[targetKey];targetLeft=j!==i?targetPosition.offset.left+targetPosition.dimensions.width:targetPosition.offset.left;if(dragX>targetLeft-this.options.movingAcceptanceTolerance&&dragX<targetLeft+this.options.movingAcceptanceTolerance){this._tKey=targetKey;this._tIdx=this._cIdx>j||j!==i?j:j-1;if(this.options.mode==="immediate"){this._moveColumn(this._cKey,targetKey,j!==i?true:false,true,false);updateEvent=true}else{this._last=i===siblings.length;this._showIndicators(targetLeft-scrollLeft,targetPosition.offset.top,targetPosition.dimensions)}break}i++}if(this._hscroller.length>0){this._checkScroll(scrollLeft,dragX,left)}return updateEvent},_thDropped:function(){if(this.options.mode==="immediate"){if(this.options.hideHeaderContentsDuringDrag===true){this._oTh.children().show()}return}this._hideIndicators();if(this._tKey&&this._cKey!==this._tKey){this._moveColumn(this._cKey,this._tKey,this._last,this.options.moveType==="dom",false)}delete this._cKey;delete this._tKey;$(".ui-draggable-dragging").hide();this._scroller.on=false},_isColumnMovable:function(col,idx){var i,cs;for(i=0;i<this.options.columnSettings.length;i++){cs=this.options.columnSettings[i];if(cs.columnIndex){if(i===idx){return cs.allowMoving}}if(cs.columnKey){if(col===cs.columnKey){return cs.allowMoving}}}return true},_isColumnGroupable:function(col){var gbColumnSetting=this._groupBy._findColumnSetting(this._getIdOfTh(col));return gbColumnSetting&&gbColumnSetting.allowGrouping},_getIdOfTh:function(th){var mchid=th.attr("data-mch-id");if(mchid){return mchid}return th.attr("id").replace(this.grid.id()+"_","")},_getThById:function(id){return $("th[data-mch-id='"+id+"'],th[id='"+this.grid.id()+"_"+id+"']")},_adjustIndicators:function(delta){var newl=parseInt(this._cmib.css("left"),10)-delta;this._cmib.css("left",newl);this._cmit.css("left",newl)},_showIndicators:function(left,top,dim){this._cmib.css("left",left-8).show();this._cmib.css("top",top-16);this._cmit.css("top",top+dim.height);this._cmit.css("left",left-8).show()},_hideIndicators:function(){this._cmib.hide();this._cmit.hide()},_markForMoving:function(col){if(col.data("draggable")||this._groupBy){if(this._isColumnGroupable(col)){col.bind("drag",this._moveHandler);col.bind("dragstop",this._dropHandler);col.bind("dragstart",this._dragHandler);return}col.attr("groupby-disabled","true")}col.draggable({containment:this.grid.container(),appendTo:this.grid.container(),distance:5,revert:"valid",helper:function(event){var th,clone;th=$(event.target).closest("th");clone=th.clone().css("overflow","hidden").css("z-index",1e4).width(th.width()).height(th.height()).addClass("ui-widget ui-iggrid").wrap($('<div class="ui-iggrid-dragMarkup"></div>').width(th.width()).height(th.height())).parent();clone.find("div[data-hiddencolindicator]").remove();return clone},opacity:this.options.dragHelperOpacity,drag:this._moveHandler,stop:this._dropHandler,start:this._dragHandler});col.unbind("mouseover.moving").bind("mouseover.moving",this._headerMouseOverHandler);col.unbind("mouseout.moving").bind("mouseout.moving",this._headerMouseOutHandler)},_updateLayout:function(){var cols,self=this;if(!this._gridReady()){setTimeout(function(){self._updateLayout()},50);return}if(this.grid._oldCols){cols=$.grep(this.grid._oldCols,this.grid._columnVisible)}else{cols=this.grid._visibleColumns()}this._hscroller=this.grid._hscrollbarcontent();this._hscroller=this._hscroller.length>0?this._hscroller:this.grid.scrollContainer();this._cache.columns={};this._cache.siblings={};this._updateLayoutPerLevel(cols);delete this._movingDirty},_updateLayoutPerLevel:function(cols){var i,id,$th,os,sl=this._hscroller.length>0?this._hscroller.scrollLeft():0;for(i=0;i<cols.length;i++){id=cols[i].key||cols[i].identifier;$th=this._getThById(id);os=$th.offset();os.left=os.left+sl;this._cache.columns[id]={};this._cache.columns[id].offset=os;this._cache.columns[id].dimensions={width:$th.outerWidth(),height:$th.outerHeight()};this._cache.siblings[id]=cols}for(i=0;i<cols.length;i++){if(cols[i].group&&cols[i].hidden!==true){this._updateLayoutPerLevel($.grep(cols[i].group,this.grid._columnVisible))}}},_openMovingDialog:function(){this._movingDialog.igGridModalDialog("openModalDialog")},_closeMovingDialog:function(){this._movingDialog.igGridModalDialog("closeModalDialog")},_triggerColumnMovedAsync:function(args){var self=this;if(!this._gridReady()){setTimeout(function(){self._triggerColumnMovedAsync(args)},50);return}this._trigger(this.events.columnMoved,null,args)},_gridReady:function(){return!(this.grid._loadingIndicator&&this.grid._loadingIndicator._indicator.is(":visible"))},_bindUpDownDialogButtons:function(list){list.find("span[class='"+this.css.movingDialogListItemArrowDown+"']").unbind("mousedown",this._dialogDownHandler).bind("mousedown",this._dialogDownHandler);list.find("span[class='"+this.css.movingDialogListItemArrowUp+"']").unbind("mousedown",this._dialogUpHandler).bind("mousedown",this._dialogUpHandler)},_checkScroll:function(scrollLeft,dragX,left){var sbw=this.grid._hasVerticalScrollbar===true?this.grid._scrollbarWidth():0;if(scrollLeft>0&&left===true&&dragX-scrollLeft<this.options.movingScrollTolerance){this._updateScroller(true,dragX-scrollLeft)}else if(scrollLeft<this._hscroller[0].scrollWidth+sbw-this._hscroller.outerWidth()&&left===false&&dragX-scrollLeft>this._hscroller.outerWidth()-this.options.movingScrollTolerance){this._updateScroller(false,this._hscroller.outerWidth()-dragX+scrollLeft)}else{this._stopScroller()}},_startScroller:function(left,delta){this._scroller.on=true;this._scroller.delay=delta*this.options.scrollSpeedMultiplier;this._scroller.direction=left===true?"left":"right";this._autoScroll()},_updateScroller:function(left,delta){if(this._scroller.on===false){this._startScroller(left,delta);return}this._scroller.delay=delta},_stopScroller:function(){this._scroller.on=false},_scrollGrid:function(){var sl=this._hscroller.scrollLeft(),delta,res,sbw;delta=this._scroller.direction==="left"?this.options.scrollDelta*-1:this.options.scrollDelta;res=sl+delta;sbw=this.grid._hasVerticalScrollbar===true?this.grid._scrollbarWidth():0;this._hscroller.scrollLeft(res);if(res<=0&&delta<0||res>=this._hscroller[0].scrollWidth+sbw-this._hscroller.outerWidth()&&delta>0){this._stopScroller()}if(this._hscroller[0].id.indexOf("_hscroller")>0){this.grid._synchronizeHScroll()}if(this.options.mode==="deferred"){this._adjustIndicators(delta)}if(this._scroller.on===true){setTimeout(this._autoScroll,this._scroller.delay)}},_cancelEvent:function(e){e.stopPropagation();e.preventDefault()},_columnMap:function(){return $.map(this.grid.options.columns,function(col,index){return{columnKey:col.key,enabled:true}})},_removeMoving:function(){var fc,ths=this.grid.headersTable().find(">thead th"),i,th,mdl,removeContainer;this.grid.container().find("[id~='"+this.grid.id()+"'][id~='moving']").remove();if(this.options.addMovingDropdown===true){mdl=this._movingdialog;if(mdl&&mdl instanceof jQuery){mdl.igGridModalDialog("destroy");mdl.remove()}$("div[data-moving-inddropdown='"+this.grid.id()+"']").remove()}fc=this.grid.element.data("igGridFeatureChooser");removeContainer=true;if(this.renderInFeatureChooser&&fc){removeContainer=false;fc._removeFeature("ColumnMovingDialog");fc._removeFeature("First");fc._removeFeature("Left");fc._removeFeature("Right");fc._removeFeature("Last")}for(i=0;i<ths.length;++i){th=$(ths[i]);if(removeContainer){th.find(">div").find("span").unbind("mousedown",this._dropDownButtonHandler);th.find(">div").remove()}th.unbind("mouseover.moving",this._headerMouseOverHandler);th.unbind("mouseout.moving",this._headerMouseOutHandler);if(!this._grpByEnabled){if(th.data&&th.data("draggable")){th.draggable("destroy")}}else{th.unbind("draggabledrag",this._moveHandler);th.unbind("draggablestop",this._dropHandler);th.unbind("draggablestart",this._dragHandler)
}}},_unregisterEvents:function(){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("iggridheaderrendering",this._headerRenderingHandler);this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggridrendered",this._gridFullyRenderedHandler);this.grid.container().find("#"+this.grid.id()+(this.grid.options.fixedHeaders===true?"_headers":"")+" th").unbind("moving");this.grid.element.unbind("iggridresizingcolumnresized",this._columnStateChanged);this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnStateChanged);this.grid.element.unbind("iggridpagingpagingdropdownrendered",this._columnStateChanged);this.grid.element.unbind("iggrid_columnsmoved",this._columnStateChanged)},_registerEvents:function(){this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.bind("iggridheaderrendering",this._headerRenderingHandler);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggridrendered",this._gridFullyRenderedHandler);this.grid.element.bind("iggridresizingcolumnresized",this._columnStateChanged);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnStateChanged);this.grid.element.bind("iggridpagingpagingdropdownrendered",this._columnStateChanged);this.grid.element.bind("iggrid_columnsmoved",this._columnStateChanged)},_createHandlers:function(){this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._headerRenderingHandler=$.proxy(this._headerRendering,this);this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._gridFullyRenderedHandler=$.proxy(this._gridFullyRendered,this);this._dragHandler=$.proxy(this._headerPicked,this);this._moveHandler=$.proxy(this._headerDragged,this);this._dropHandler=$.proxy(this._headerDropped,this);this._headerMouseOverHandler=$.proxy(this._headerMouseOver,this);this._headerMouseOutHandler=$.proxy(this._headerMouseOut,this);this._dropDownButtonHandler=$.proxy(this._dropDownMouseDown,this);this._dropDownKeyHandler=$.proxy(this._dropDownKeyDown,this);this._openMovingDialogHandler=$.proxy(this._openMovingDialog,this);this._dropDownButtonMouseOverHandler=$.proxy(this._dropDownButtonMouseOver,this);this._dropDownButtonMouseOutHandler=$.proxy(this._dropDownButtonMouseOut,this);this._dialogOpeningHandler=$.proxy(this._dialogOpening,this);this._dialogDraggedHandler=$.proxy(this._dialogDragged,this);this._dialogClosingHandler=$.proxy(this._dialogClosing,this);this._dialogClosedHandler=$.proxy(this._dialogClosed,this);this._dialogCloseButtonHandler=$.proxy(this._closeMovingDialog,this);this._dialogUpHandler=$.proxy(this._dialogUpPressed,this);this._dialogDownHandler=$.proxy(this._dialogDownPressed,this);this._dialogRearrangingHandler=$.proxy(this._dialogRearranging,this);this._dialogRearrangedHandler=$.proxy(this._dialogRearranged,this);this._columnStateChanged=$.proxy(this._updateLayout,this);this._cancelEventHandler=$.proxy(this._cancelEvent,this);this._autoScroll=$.proxy(this._scrollGrid,this)},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;if(isRebind===true){return}if(this.grid.element.igGridFeatureChooser!==undefined){this.grid.element.igGridFeatureChooser()}else{throw new Error($.ig.ColumnMoving.locale.featureChooserNotReferenced)}this._createHandlers();this._unregisterEvents();this._registerEvents()}});$.extend($.ui.igGridColumnMoving,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Feature Chooser 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridFeatureChooser",{css:{featureChooserDropDown:"ui-iggrid-featurechooser-dropdown-dialog ui-widget ui-widget-content ui-corner-all",headerButtonIcon:"ui-iggrid-featurechooserbutton ui-icon ui-icon-gear",headerButtonIconMouseOver:"ui-iggrid-header-icon-mouseover",headerButtonIconSelected:"ui-iggrid-header-icon-selected",listClass:"ui-iggrid-featurechooser-list ui-menu ui-widget ui-widget-content ui-corner-all",listItemClass:"ui-iggrid-featurechooserddlistitemicons ui-state-default",itemIconCotainer:"ui-iggrid-featurechoosericoncontainer",itemSecondaryIconContainer:"ui-iggrid-featurechooser-secondaryicon-container",separator:"ui-iggrid-featurechooser-separator",listItemText:"ui-iggrid-featurechooserddlistitemtext",itemSelected:"item-selected",dropDownListItemHover:"ui-iggrid-featurechooser-listitem-hover ui-state-active ui-state-hover",dropDownButtonClasses:"ui-igbutton",dropDownButtonHoverClasses:"",dropDownButtonActiveClasses:"",dropDownButtonFocusClasses:"",dropDownButtonLabelClass:""},options:{dropDownWidth:null,animationDuration:400},events:{featureChooserRendering:"featureChooserRendering",featureChooserRendered:"featureChooserRendered",featureChooserDropDownOpening:"featureChooserDropDownOpening",featureChooserDropDownOpened:"featureChooserDropDownOpened",featureToggling:"featureToggling",featureToggled:"featureToggled"},_createWidget:function(options,element){$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this.analyzedData={};this.data={};this._features=[];this._isFeaturesAnalyzed=false;this.isInitialized=false;this.grid=this.element.data("igGrid");this.gridId=this.element[0].id;this._analyzeGridFeaturesOptions();this._countRenderedFeatures=0;if(this._headerRenderedHandler){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}this._headerRenderedHandler=$.proxy(this._headerRendered,this);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);if(this._gridDestroyedHandler){this.grid.element.unbind("igcontroldestroyed",this._gridDestroyedHandler)}this._gridDestroyedHandler=$.proxy(this.destroy,this);this.grid.element.bind("igcontroldestroyed",this._gridDestroyedHandler)},_analyzeGridFeaturesOptions:function(){var i,features=this.grid.options.features,featuresLength=features.length;for(i=0;i<featuresLength;i++){this._features.push(features[i].name)}},shouldShowFeatureIcon:function(key){if(this.analyzedData[key]!==undefined&&this.analyzedData[key]!==null){return this.analyzedData[key].length<=1}return true},_setOption:function(key,value){$.Widget.prototype._setOption.apply(this,arguments)},_id:function(name,suffix){var res=this.gridId+"_"+name;if(suffix!==undefined&&suffix!==null&&$.type(suffix)==="string"){res+="_"+suffix}return res},_callFeatureMethod:function(feature,isSelected,columnKey,event){var method,methodType=$.type(feature.method),featureData=this.grid.element.data("igGrid"+feature.name);if(methodType==="string"){if(featureData===undefined||featureData===null){return false}method=featureData[feature.method]}else if(methodType==="function"){method=feature.method}if(method===undefined||method===null){return false}if($.type(feature.method)==="string"){featureData[feature.method](event,columnKey,isSelected,feature.methodData)}else{feature.method(event,columnKey,isSelected,feature.methodData)}return true},_getFeatureByKeyName:function(columnKey,featureName){var i,feature=null,columnData=this.data[columnKey],columnDataLength=columnData.length;for(i=0;i<columnDataLength;i++){if(columnData[i].name===featureName){feature=columnData[i];break}}return feature},_clickFeature:function(event){var i,j,$target=$(event.target).data("data")!==undefined?$(event.target):$(event.currentTarget),d=$target.data("data"),self=this,isSelected=null,type=d.type,columnKey=d.columnKey,featureName=d.featureName,columnData=this.data[columnKey],columnDataLength=columnData.length,feature=null;feature=this._getFeatureByKeyName(columnKey,featureName);if(feature===null||feature===undefined){return}if(type==="toggle"){isSelected=!feature.isSelected}if(this._trigger(this.events.featureToggling,null,{target:$target,columnKey:columnKey,isToSelect:isSelected,featureName:"igGrid"+feature.name})===false){return}if(this._callFeatureMethod(feature,isSelected,columnKey,event)===false){return}if(type==="toggle"){feature.isSelected=isSelected;self._setSelectedItem(columnKey,isSelected,$("#"+self._id("featurechooser_dd_li_"+columnKey,featureName)));if(feature.updateOnClickAll===true){$.each(self.data,function(index,value){if(index!==columnKey){for(j=0;j<value.length;j++){if(value[j].name===featureName){break}}if(j===value.length){return true}columnData=self.data[index];if(columnData===null||columnData===undefined){return true}columnDataLength=columnData.length;for(i=0;i<columnDataLength;i++){if(columnData[i].name===featureName){columnData[i].isSelected=isSelected;break}}self._setSelectedItem(index,isSelected,$("#"+self._id("featurechooser_dd_li_"+index,value[j].name)))}})}}},_setListItemText:function(columnKey,featureName,text){$("#"+this._id("featurechooser_dd_li_"+columnKey,featureName)+" span.ui-iggrid-featurechooserddlistitemtext").text(text)},_analyzeFeatures:function(){if(this._isFeaturesAnalyzed===true){return}var i,k,cs=this.grid.options.columns,csLength=cs.length,featureName,featuresLength=this._features.length,features=this._features,newFeatures=[],columnsFeature,columnsFeatureLength,featureInstance,columnKey;for(i=0;i<featuresLength;i++){featureName=features[i];featureInstance=this.grid.element.data("igGrid"+featureName);if(featureInstance===undefined||featureInstance===null){continue}if(featureInstance.renderInFeatureChooser!==true){continue}if(featureInstance._columnMap===undefined||featureInstance._columnMap===null){continue}columnsFeature=featureInstance._columnMap();if(columnsFeature===false||columnsFeature===null||columnsFeature===undefined){continue}columnsFeatureLength=columnsFeature.length;if(columnsFeatureLength===0){for(k=0;k<csLength;k++){columnKey=cs[k].key;if(this.analyzedData[columnKey]===undefined||this.analyzedData[columnKey]===null){this.analyzedData[columnKey]=[]}if(this._isFeatureExistByColumnKey(featureName,columnKey)===true){continue}this.analyzedData[columnKey].push({name:featureName,method:null,text:null,iconClass:null,isSelected:false,columnCell:null,isActive:false})}}else{for(k=0;k<columnsFeatureLength;k++){columnKey=columnsFeature[k].columnKey;if(this.analyzedData[columnKey]===undefined||this.analyzedData[columnKey]===null){this.analyzedData[columnKey]=[]}if(columnsFeature[k].enabled!==true||this._isFeatureExistByColumnKey(featureName,columnKey)===true){continue}this.analyzedData[columnKey].push({name:featureName,method:null,text:null,iconClass:null,isSelected:false,columnCell:null,isActive:false})}}newFeatures.push({name:featureName,instance:featureInstance})}this._features=newFeatures;this._isFeaturesAnalyzed=true},_isFeatureExistByColumnKey:function(featureName,columnKey){var aData=this.analyzedData[columnKey],ret=false;if(aData===null||aData===undefined){return true}$.each(aData,function(index,value){if(value.name===featureName){ret=true;return false}});return ret},_shouldRenderInFeatureChooser:function(columnKey){this._analyzeFeatures();if(this.analyzedData[columnKey]!==undefined&&this.analyzedData[columnKey]!==null){return this.analyzedData[columnKey].length>1}return false},_headerRendered:function(sender,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(sender.target.id!==this.grid.element[0].id){return}var self=this;$.each(this.data,function(columnKey,elem){self._initFC(columnKey,elem)})},_initFC:function(columnKey,elem){var j,self=this,thead=this.grid.container().find("thead"),$columnCell,$theadCell,buttonId,cancelFunc,$button,$headerContainer;$columnCell=$("#"+self.grid.element[0].id+"_"+columnKey);buttonId=self._id("featureChooser_headerButton",columnKey);if(elem.isCancelledRendering!==false&&self._trigger(self.events.featureChooserRendering,null,{owner:self.grid,columnKey:columnKey,columnCell:$columnCell})===false){elem.isCancelledRendering=true;return}elem.isCancelledRendering=false;$theadCell=thead.find("#"+self.grid.element[0].id+"_"+columnKey);$headerContainer=$theadCell.find(".ui-iggrid-indicatorcontainer");if($headerContainer.length===0){$headerContainer=$("<div></div>").appendTo($theadCell).addClass("ui-iggrid-indicatorcontainer")}cancelFunc=function(e){e.preventDefault();e.stopPropagation()};$button=$("<span></span>").prependTo($headerContainer).addClass(self.css.headerButtonIcon);$button.wrap('<a id="'+buttonId+'" href="#" title=""></a>');$button.parent().attr("th-remove-focus","").bind({keydown:function(event){var $item,$nextPrevItem,$dialog=$("#"+self._id("featureChooser_dd",columnKey));if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){$item=$dialog.find("ul li.ui-iggrid-featurechooser-listitem-hover");if($dialog.is(":visible")&&$item.length>0){if($item.find('*[role="button"]').length){event.target=$item.find('*[role="button"]:eq(0)')}else{event.target=$item[0]}self._clickFeature(event)}self._toggleDropDown(event,columnKey,false);cancelFunc(event)}else if(event.keyCode===$.ui.keyCode.DOWN||event.keyCode===$.ui.keyCode.UP){if($dialog.is(":visible")){$item=$dialog.find("ul li.ui-iggrid-featurechooser-listitem-hover");if($item.length>1){$.each($item,function(index,value){self._removeCssSelectionListItem($(value))})}$nextPrevItem=event.keyCode===$.ui.keyCode.DOWN?$item.next():$item.prev();if($nextPrevItem.attr("data-fc-separator")){$nextPrevItem=event.keyCode===$.ui.keyCode.DOWN?$nextPrevItem.next():$nextPrevItem.prev()}if($item.length===0){self._addCssSelectionListItem($dialog.find("ul li:eq(0)"))}else if($nextPrevItem.length>0&&$nextPrevItem.is("li")){self._removeCssSelectionListItem($item);self._addCssSelectionListItem($nextPrevItem)}cancelFunc(event)}}},blur:function(e){self._toggleDropDown(e,columnKey,true)},mousedown:function(event){self._toggleDropDown(event,columnKey,false);cancelFunc(event)},mouseover:function(event){if($button.hasClass(self.css.headerButtonIconSelected)===false){$button.addClass(self.css.headerButtonIconMouseOver)}},mouseout:function(event){$button.removeClass(self.css.headerButtonIconMouseOver)},mouseup:cancelFunc,click:cancelFunc});$("#"+this._id("featureChooser_dd",columnKey)).remove();for(j=0;j<elem.length;j++){self._renderDropDownItem(columnKey,elem[j])}self._trigger(self.events.featureChooserRendered,null,{owner:self.grid,columnKey:columnKey,columnCell:$columnCell})},_renderInFeatureChooser:function(columnKey,data){var i,columnData=this.analyzedData[columnKey],columnDataLength;if(columnData===undefined||columnData===null){return}columnDataLength=columnData.length;if(columnData.isCancelledRendering===true){return}for(i=0;i<columnDataLength;i++){if(columnData[i].name.toLowerCase()===data.name.toLowerCase()){this.analyzedData[columnKey][i]=data;break}}if(i===columnDataLength){this.analyzedData[columnKey].push(data)}if(this.data[columnKey]===null||this.data[columnKey]===undefined){this.data[columnKey]=[]}if($.type(this.data[columnKey].order)!=="number"){this.data[columnKey].order=0}for(i=0;i<this.data[columnKey].length;i++){if(this.data[columnKey][i].name===data.name&&data.name!==undefined){return}}this.data[columnKey].push(data)},_removeFeature:function(featureName){var self=this,cols=this.grid.options.columns;$.each(cols,function(index,col){self._removeDropDownItem(col.key,featureName)})},_removeDropDownItem:function(columnKey,featureName){var $dropDown=$("#"+this._id("featureChooser_dd",columnKey)),$item=$("#"+this._id("featurechooser_dd_li_"+columnKey,featureName));if($item.length>0){$item.remove();if($dropDown.find("li:not([data-fc-separator])").length===0){$dropDown.remove();$("#"+this._id("featureChooser_headerButton",columnKey)).remove()}else{this._removeSeparatorItem(columnKey)}}},_removeSeparatorItem:function(columnKey){var dropDownId=this._id("featureChooser_dd",columnKey),listLiSeparator=$("#"+dropDownId).find("[data-fc-separator]");listLiSeparator.each(function(index){var $li=$(this),$prevLi=$li.prev(),$nextLi=$li.next();if($prevLi.length===0||$prevLi.attr("data-fc-separator")!==undefined||$nextLi.length===0||$nextLi.attr("data-fc-separator")!==undefined){$li.remove();return false}})},_renderDropDownItem:function(columnKey,data){var dropDownId=this._id("featureChooser_dd",columnKey),$dropDown=$("#"+dropDownId),$li,$span,cssClassIcon="",self=this,isSelected=data.isSelected,featureName=data.name,innerData,$button,liId=this._id("featurechooser_dd_li_"+columnKey,featureName),isOnBottom=data.isOnBottom,ddWidth=this.options.dropDownWidth,groupName=data.groupName,groupOrder=data.groupOrder,listId=this._id("featurechooser_dd_list",columnKey),$list=$("#"+listId),listItemsGroup,insertElementObj;if($("#"+liId).length>0){return}if(isSelected===undefined||isSelected===null){isSelected=false}if($dropDown.length===0){$dropDown=$("<div></div>");$dropDown.attr("id",dropDownId).css({position:"absolute",display:"none"}).addClass(this.css.featureChooserDropDown).appendTo("body");$dropDown.width(ddWidth);$list=$("<ul></ul>").attr("id",listId).addClass(this.css.listClass).appendTo($dropDown)}$li=$("<li></li>");$li.addClass(this.css.listItemClass).attr("id",liId).attr("data-fc-order",data.order);if(groupName!==undefined&&groupName!==null){$li.attr("data-fc-groupname",groupName)}if(groupOrder!==undefined&&groupOrder!==null){$li.attr("data-fc-grouporder",groupOrder)}if(isOnBottom===undefined||data.isOnBottom===null){if(data.type==="button"){isOnBottom=true}else{isOnBottom=false}}if(data.type!=="button"){$li.bind({mouseover:$.proxy(this._mouseOverDropDownItem,this),mouseout:$.proxy(this._mouseOutDropDownItem,this)})}innerData={columnKey:columnKey,featureName:featureName,updateOnClickAll:data.updateOnClickAll,isOnBottom:isOnBottom,groupName:groupName,groupOrder:groupOrder,type:data.type,textHide:data.textHide,state:data.state,text:data.text};data.isOnBottom=isOnBottom;$li.data("data",innerData);if(data.type==="button"){$button=$("<a></a>").appendTo($li);$button.igButton({labelText:data.text,mousedown:function(event){self._clickFeature(event);self._toggleDropDown(event,columnKey,true)}});$button.data("data",innerData)}else{$li.bind({mousedown:function(event){self._clickFeature(event);self._toggleDropDown(event,columnKey,true)}});if(data.iconClass!==null&&data.iconClass!==undefined&&data.iconClass!==""){cssClassIcon=data.iconClass}$span=$("<span></span>").addClass(this.css.itemIconCotainer).appendTo($li);$span=$("<span></span>").appendTo($span);if(cssClassIcon!==""){$span.addClass(cssClassIcon)}$("<span></span>").text(data.text).addClass(this.css.listItemText).appendTo($li);if(data.secondaryIconClass!==undefined&&data.secondaryIconClass!==null){$span=$("<span></span>").addClass(this.css.itemSecondaryIconContainer).appendTo($li);$("<span></span>").addClass(data.secondaryIconClass).appendTo($span)}}if(groupName===undefined||groupName===null){listItemsGroup=$("#"+listId+" li:not([data-fc-groupName]):not([data-fc-separator])");insertElementObj=this._getInsertElement(listItemsGroup,data.order,"data-fc-order");this._insertElement(insertElementObj,$list,$li,null)}else{listItemsGroup=$("#"+listId+" li[data-fc-groupName = "+groupName+"]");if(listItemsGroup.length===0){listItemsGroup=$("#"+listId+" li[data-fc-groupName]");insertElementObj=this._getInsertElement(listItemsGroup,groupOrder,"data-fc-grouporder");if(insertElementObj.item!==null){$list=listItemsGroup}this._insertElement(insertElementObj,$list,$li,groupName)}else{insertElementObj=this._getInsertElement(listItemsGroup,data.order,"data-fc-order");this._insertElement(insertElementObj,listItemsGroup,$li,groupName)}}if(data.type==="toggle"){this._setSelectedItem(columnKey,data.isSelected,$li)}},_getSeparatorItem:function(){return $('<li data-fc-separator="1" class="'+this.css.separator+'"></li>')},_insertElement:function(insertElementObj,$list,$li,groupName){var $insertElement=insertElementObj.item,insertElementPosition=insertElementObj.position,$prevElement;if($insertElement===null){$li.appendTo($list);$prevElement=$li.prev();if($prevElement!==undefined&&$prevElement.length>0&&$prevElement.attr("data-fc-separator")!=="1"&&$prevElement.attr("data-fc-groupname")!==undefined&&$prevElement.attr("data-fc-groupname")!==groupName){this._getSeparatorItem().insertBefore($li)}}else{if(insertElementPosition==="after"){$li.insertAfter($insertElement);if($insertElement!==undefined&&$insertElement.length>0&&$insertElement.attr("data-fc-separator")!=="1"&&$insertElement.attr("data-fc-groupname")!==undefined&&$insertElement.attr("data-fc-groupname")!==groupName){this._getSeparatorItem().insertBefore($li)}}else{$li.insertBefore($insertElement);$prevElement=$li.prev();if($prevElement!==undefined&&$prevElement.length>0&&$prevElement.attr("data-fc-separator")!=="1"&&$prevElement.attr("data-fc-groupname")!==undefined&&$prevElement.attr("data-fc-groupname")!==groupName){this._getSeparatorItem().insertBefore($li)}else if($insertElement!==undefined&&$insertElement.length>0&&$insertElement.attr("data-fc-separator")!=="1"&&$insertElement.attr("data-fc-groupname")!==undefined&&$insertElement.attr("data-fc-groupname")!==groupName){this._getSeparatorItem().insertAfter($li)}}}},_getInsertElement:function(listItems,targetOrder,attr){var $item=null,itemOrder,at,i;for(i=0;i<listItems.length;i++){$item=$(listItems[i]);at=$item.attr(attr);if(at===undefined){continue}itemOrder=parseInt(at,10);if(itemOrder>targetOrder){return{item:$item,position:"before"}}}return{item:$item,position:"after"}},_setSelectedState:function(featureName,columnKey,isSelected,executeCallback){var data=this.data[columnKey],$listItem,self=this;if(data===undefined||data===null){return false}$.each(data,function(index,value){if(value.name.toLowerCase()===featureName.toLowerCase()){$listItem=$("#"+self._id("featurechooser_dd_li_"+columnKey,value.name));self._setSelectedItem(columnKey,isSelected,$listItem);self.data[columnKey][index].isSelected=!isSelected;if(executeCallback===true){self._callFeatureMethod(value,isSelected,columnKey,null)}value.isSelected=isSelected;return false}})},_setSelectedItem:function(columnKey,isSelected,$listItem){if($listItem===null||$listItem===undefined||$listItem.length===0){return}var innerData=$listItem.data("data"),textShow,textHide,$label=null;if(innerData!==undefined&&innerData!==null){textShow=innerData.text;textHide=innerData.textHide;$label=$listItem.find("span.ui-iggrid-featurechooserddlistitemtext")}$listItem.attr("data-fc-selected",isSelected);if(isSelected===true){$listItem.addClass(this.css.itemSelected);if($label!==null&&textShow!==null&&textShow!==undefined){$label.text(textShow)}}else{$listItem.removeClass(this.css.itemSelected);if($label!==null&&textHide!==null&&textHide!==undefined){$label.text(textHide)}}},_toggleSelectedItems:function(featureName,selected){var i,$li,columnKey,cols=this.grid.options.columns,colsLength=cols.length,isSelected;if(selected!==undefined){isSelected=selected}for(i=0;i<colsLength;i++){columnKey=cols[i].key;$li=$("#"+this._id("featurechooser_dd_li_"+columnKey,featureName));if($li.data("data")===null||$li.data("data")===undefined){continue}if(selected===undefined){isSelected=$li.attr("data-fc-selected")==="true"}this._setSelectedState(featureName,columnKey,!isSelected)}},_toggleDropDown:function(event,columnKey,isCalledFromBlur){var $button=$("#"+this._id("featureChooser_headerButton",columnKey)),maxZ,left=0,top=0,dropDownId=this._id("featureChooser_dd",columnKey),$headerContainer,$dropDown=$("#"+dropDownId),isVisible=$dropDown.is(":visible")===true,self=this,animationDuration=this.options.animationDuration,$columnCell=null;if($dropDown.data("isAnimating")===true||isVisible===false&&isCalledFromBlur===true){return}$columnCell=$("#"+this.grid.element[0].id+"_"+columnKey);$headerContainer=$("#"+this._id("featureChooser_headerButton",columnKey)).find("span");if(isVisible===false&&this._trigger(this.events.featureChooserDropDownOpening,null,{owner:$dropDown,columnKey:columnKey,columnCell:$columnCell,data:this.data[columnKey]})===false){return}if(!isVisible){maxZ=$.ig.getMaxZIndex(dropDownId);$dropDown.css("zIndex",maxZ);top=$.ig.util.offset($headerContainer).top+$headerContainer.height();left=$.ig.util.offset($headerContainer).left-$dropDown.width()+$headerContainer.width();if(left<0){left=$.ig.util.offset($headerContainer).left}$dropDown.css({top:top,left:left})}$dropDown.data("isAnimating",true);$dropDown.slideToggle(animationDuration,function(){if($dropDown.is(":visible")===true){$button.focus();self._activeDropdown=$dropDown;self._trigger(self.events.featureChooserDropDownOpened,null,{owner:$dropDown,columnKey:columnKey,columnCell:$columnCell,data:self.data[columnKey]});$button.children("span:first").addClass(self.css.headerButtonIconSelected)}else{self._activeDropdown=null;$button.children("span:first").removeClass(self.css.headerButtonIconSelected)}$dropDown.data("isAnimating",false)})},_mouseOverDropDownItem:function(event){this._addCssSelectionListItem($(event.currentTarget))},_mouseOutDropDownItem:function(event){this._removeCssSelectionListItem($(event.currentTarget))},_addCssSelectionListItem:function($listItem){$listItem.addClass(this.css.dropDownListItemHover)},_removeCssSelectionListItem:function($listItem){$listItem.removeClass(this.css.dropDownListItemHover)},destroy:function(){var self=this;this.data=null;$.each(this.grid.options.columns,function(ind,column){$("#"+self._id("featureChooser_dd",column.key)).remove()});this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("igcontroldestroyed",this._gridDestroyedHandler);delete this._headerRenderedHandler;delete this._gridDestroyedHandler;$.Widget.prototype.destroy.apply(this,arguments);return this}});$.extend($.ui.igGridFeatureChooser,{version:"13.1.20131.2523"})})(jQuery);if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridModalDialog",{options:{buttonApplyText:"Apply",buttonCancelText:"Cancel",modalDialogCaptionText:"Header",modalDialogWidth:250,modalDialogHeight:"",renderFooterButtons:true,animationDuration:200},css:{modalDialog:"ui-dialog ui-draggable ui-resizable ui-iggrid-dialog ui-widget ui-widget-content ui-corner-all",modalDialogHeaderCaption:"ui-dialog-titlebar ui-widget-header ui-corner-top ui-helper-reset ui-corner-all ui-helper-clearfix",modalDialogHeaderCaptionTitle:"ui-dialog-title",modalDialogContent:"ui-dialog-content ui-widget-content",modalDialogHandleBar:"",captionButtonContainer:"ui-iggrid-modaldialog-caption-buttoncontainer",modalDialogFooter:"ui-dialog-buttonpane ui-widget-content ui-helper-clearfix",buttonset:"ui-dialog-buttonset",blockArea:"ui-widget-overlay ui-iggrid-blockarea"},events:{modalDialogOpening:"modalDialogOpening",modalDialogOpened:"modalDialogOpened",modalDialogMoving:"modalDialogMoving",modalDialogClosing:"modalDialogClosing",modalDialogClosed:"modalDialogClosed",modalDialogContentsRendering:"modalDialogContentsRendering",modalDialogContentsRendered:"modalDialogContentsRendered",buttonOKClick:"buttonOKClick"},_createWidget:function(options,element){this.gridContainer=options.gridContainer;this.containment=options.containment||options.gridContainer;$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._setGridWidthHeight();this._renderModalDialog()},_setGridWidthHeight:function(){this.element.css("width",this.options.modalDialogWidth).css("height",this.options.modalDialogHeight)},openModalDialog:function(){var maxZ=1e4,scrollLeft,scrollTop,pageLeft,pageTop,pageRight,pageBottom,pos,h,w,bh,bw,mdW,mdH,caption,content,footer,modalDialogTop,modalDialogLeft,noCancel=true,modalDialog=this.element,modalDialogBody,block,animationDuration=this._getAnimationDuration(),blockId=this._id("_modaldialog_block");if(this._modalDialogOpened){return}noCancel=this._trigger(this.events.modalDialogOpening,null,{modalDialog:modalDialog,owner:this});if(noCancel){$("#"+blockId).remove();this._setGridWidthHeight();modalDialogBody=modalDialog.find("table tbody");modalDialogBody.empty();pos=$.ig.util.offset(this.gridContainer);w=this.gridContainer.outerWidth();h=this.gridContainer.outerHeight();scrollLeft=$(window).scrollLeft();scrollTop=$(window).scrollTop();pageLeft=pos.left-scrollLeft;pageTop=pos.top-scrollTop;pageRight=pageLeft+w;pageBottom=pageTop+h;mdW=parseInt(this.options.modalDialogWidth,10);mdH=parseInt(this.options.modalDialogHeight,10);block=$("<div></div>").appendTo("body").attr("id",blockId).css("position","absolute").addClass(this.css.blockArea).hide();if(block.outerWidth()!==this.gridContainer.outerWidth()){block.css("width",this.gridContainer.outerWidth())}if(block.outerHeight()!==this.gridContainer.outerHeight()){block.css("height",this.gridContainer.outerHeight())}block.css({left:pos.left,top:pos.top}).fadeToggle(animationDuration);if(!mdW){mdW=this.element.width()}if(!mdH){mdH=this.element.height()}if(pageLeft<0){pageLeft=0}if(pageTop<0){pageTop=0}bw=$(window).width();bh=$(window).height();if(pageRight>bw){pageRight=bw}if(pageBottom>bh){pageBottom=bh}modalDialogTop=pageTop+scrollTop+(pageBottom-pageTop)/2-mdH/2;modalDialogLeft=pageLeft+scrollLeft+(pageRight-pageLeft)/2-mdW/2;if(modalDialogTop<0){modalDialogTop=pageTop}if(modalDialogLeft<0){modalDialogLeft=pageLeft}maxZ=$.ig.getMaxZIndex(this.element[0].id);modalDialog.css({left:modalDialogLeft,top:modalDialogTop,zIndex:maxZ+2}).fadeToggle(animationDuration);block.css({zIndex:maxZ+1});caption=modalDialog.children("div.ui-dialog-titlebar");content=modalDialog.children("div.ui-dialog-content");footer=modalDialog.children("div.ui-dialog-buttonpane");content.css("height",modalDialog.height()-caption.outerHeight()-(content.outerHeight()-content.height())-footer.outerHeight());$("#"+this._id("content")).css({width:""});this._modalDialogOpened=true;this._trigger(this.events.modalDialogOpened,null,{modalDialogElement:modalDialog,owner:this});modalDialog.focus()}},_getAnimationDuration:function(){var animationDuration=this.options.animationDuration;if(animationDuration===null||animationDuration===undefined){animationDuration=200}return animationDuration},_setOption:function(key,value){$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"buttonApplyText":$("#"+this._id("footer_buttonok")).igButton("option","labelText",value);break;case"buttonCancelText":$("#"+this._id("footer_buttoncancel")).igButton("option","labelText",value);break;case"modalDialogCaptionText":this.element.find("span.ui-dialog-title:eq(0)").html(value);break;case"modalDialogWidth":this.element.css("width",value);break;case"modalDialogHeight":this.element.css("height",value);break;case"renderFooterButtons":if(this.element.is(":visible")){this.closeModalDialog()}this.element.empty();this._renderModalDialog();break;default:break}},closeModalDialog:function(){var noCancel=true,modalDialog=this.element,animationDuration=this._getAnimationDuration();if(!this._modalDialogOpened){return}noCancel=this._trigger(this.events.modalDialogClosing,null,{modalDialog:modalDialog,owner:this});if(noCancel){modalDialog.fadeToggle(animationDuration);$("#"+this._id("_modaldialog_block")).fadeToggle(animationDuration);this._modalDialogOpened=false;this._trigger(this.events.modalDialogClosed,null,{modalDialog:modalDialog,owner:this})}},_modalDialogMove:function(e,ui){var oPos=ui.originalPosition,pos=ui.position;if(pos.top<0&&this.options.containment!=="window"){pos.top=this.gridContainer.position().top}this._trigger(this.events.modalDialogMoving,null,{modalDialog:e.target,owner:this,originalPosition:oPos,position:pos})},getCaptionButtonContainer:function(){return $("#"+this._id("caption_button_container"))},getFooter:function(){return $("#"+this._id("footer"))},getContent:function(){return $("#"+this._id("content"))},_renderModalDialog:function(){var self=this,css=this.css,modalDialog=this.element,caption,modalDialogContent,footer,o=this.options,$buttonSet,$buttonOK,$buttonCancel,noCancel=true;modalDialog.css("position","absolute").addClass(this.css.modalDialog).hide();noCancel=this._trigger(this.events.modalDialogContentsRendering,null,{modalDialog:modalDialog,owner:this});if(noCancel){caption=$("<div></div>").addClass(this.css.modalDialogHeaderCaption).appendTo(modalDialog);$("<span></span>").text(this.options.modalDialogCaptionText).addClass(this.css.modalDialogHeaderCaptionTitle).appendTo(caption);$("<div></div>").attr("id",this._id("caption_button_container")).addClass(css.captionButtonContainer).appendTo(caption);modalDialogContent=$("<div></div>").css("overflow","auto").addClass(this.css.modalDialogContent).attr("id",this._id("content")).appendTo(modalDialog);if(o.renderFooterButtons===true){footer=$("<div></div>").addClass(this.css.modalDialogFooter).attr("id",this._id("footer")).appendTo(modalDialog);$buttonSet=$("<div></div>").addClass(this.css.buttonset).appendTo(footer);$buttonOK=$("<button></button>").attr("id",this._id("footer_buttonok")).appendTo($buttonSet);$buttonOK.igButton({labelText:o.buttonApplyText});$buttonCancel=$("<button></button>").attr("id",this._id("footer_buttoncancel")).appendTo($buttonSet);$buttonCancel.igButton({labelText:o.buttonCancelText});$buttonCancel.bind({click:function(e,args){noCancel=self._trigger(self.events.buttonCancelClick,e,{modalDialog:modalDialog,owner:self});if(noCancel){self.closeModalDialog();e.preventDefault();e.stopPropagation()}}})}modalDialog.bind({keydown:function(e){if(e.keyCode===$.ui.keyCode.ESCAPE){self.closeModalDialog()}}}).draggable({containment:this.containment,handle:caption,drag:$.proxy(this._modalDialogMove,this)}).attr("role","dialog").attr("tabIndex",-1);if(typeof Modernizr!=="object"||Modernizr.touch===false){modalDialog.resizable({containment:"parent",alsoResize:modalDialogContent,minHeight:modalDialog.outerHeight()/4,minWidth:modalDialog.outerWidth()/2})}this._trigger(this.events.modalDialogContentsRendered,null,{modalDialog:modalDialog,owner:this})}},_id:function(){var i,ar=arguments,res=this.element[0].id;for(i=0;i<ar.length;i++){res+="_"+ar[i]}return res},destroy:function(){$("#"+this._id("_modaldialog_block")).remove();$.Widget.prototype.destroy.apply(this,arguments);return this}});$.extend($.ui.igGridModalDialog,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Sorting 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery-tmpl.js (https://github.com/jquery/jquery-tmpl)
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.editors.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridFiltering",{renderInFeatureChooser:true,options:{caseSensitive:false,filterSummaryAlwaysVisible:true,renderFC:true,filterSummaryTemplate:$.ig.GridFiltering.locale.filterSummaryTemplate,filterDropDownAnimations:"linear",filterDropDownAnimationDuration:500,filterDropDownWidth:0,filterDropDownHeight:0,filterExprUrlKey:null,filterDropDownItemIcons:true,columnSettings:[{columnKey:null,columnIndex:null,allowFiltering:true,condition:null,defaultExpressions:[]}],type:null,filterDelay:500,mode:null,advancedModeEditorsVisible:false,advancedModeHeaderButtonLocation:"left",filterDialogWidth:370,filterDialogMaxHeight:350,filterDialogHeight:"",filterDialogFilterDropDownDefaultWidth:80,filterDialogExprInputDefaultWidth:80,filterDialogColumnDropDownDefaultWidth:null,renderFilterButton:true,filterButtonLocation:"left",nullTexts:{startsWith:$.ig.GridFiltering.locale.startsWithNullText,endsWith:$.ig.GridFiltering.locale.endsWithNullText,contains:$.ig.GridFiltering.locale.containsNullText,doesNotContain:$.ig.GridFiltering.locale.doesNotContainNullText,equals:$.ig.GridFiltering.locale.equalsNullText,doesNotEqual:$.ig.GridFiltering.locale.doesNotEqualNullText,greaterThan:$.ig.GridFiltering.locale.greaterThanNullText,lessThan:$.ig.GridFiltering.locale.lessThanNullText,greaterThanOrEqualTo:$.ig.GridFiltering.locale.greaterThanOrEqualToNullText,lessThanOrEqualTo:$.ig.GridFiltering.locale.lessThanOrEqualToNullText,on:$.ig.GridFiltering.locale.onNullText,notOn:$.ig.GridFiltering.locale.notOnNullText,after:$.ig.GridFiltering.locale.afterNullText,before:$.ig.GridFiltering.locale.beforeNullText,thisMonth:$.ig.GridFiltering.locale.thisMonthLabel,lastMonth:$.ig.GridFiltering.locale.lastMonthLabel,nextMonth:$.ig.GridFiltering.locale.nextMonthLabel,thisYear:$.ig.GridFiltering.locale.thisYearLabel,lastYear:$.ig.GridFiltering.locale.lastYearLabel,nextYear:$.ig.GridFiltering.locale.nextYearLabel,empty:$.ig.GridFiltering.locale.emptyNullText,notEmpty:$.ig.GridFiltering.locale.notEmptyNullText,"null":$.ig.GridFiltering.locale.nullNullText,notNull:$.ig.GridFiltering.locale.notNullNullText},labels:{noFilter:$.ig.GridFiltering.locale.noFilterLabel,clear:$.ig.GridFiltering.locale.clearLabel,startsWith:$.ig.GridFiltering.locale.startsWithLabel,endsWith:$.ig.GridFiltering.locale.endsWithLabel,contains:$.ig.GridFiltering.locale.containsLabel,doesNotContain:$.ig.GridFiltering.locale.doesNotContainLabel,equals:$.ig.GridFiltering.locale.equalsLabel,doesNotEqual:$.ig.GridFiltering.locale.doesNotEqualLabel,greaterThan:$.ig.GridFiltering.locale.greaterThanLabel,lessThan:$.ig.GridFiltering.locale.lessThanLabel,greaterThanOrEqualTo:$.ig.GridFiltering.locale.greaterThanOrEqualToLabel,lessThanOrEqualTo:$.ig.GridFiltering.locale.lessThanOrEqualToLabel,trueLabel:$.ig.GridFiltering.locale.trueLabel,falseLabel:$.ig.GridFiltering.locale.falseLabel,after:$.ig.GridFiltering.locale.afterLabel,before:$.ig.GridFiltering.locale.beforeLabel,today:$.ig.GridFiltering.locale.todayLabel,yesterday:$.ig.GridFiltering.locale.yesterdayLabel,thisMonth:$.ig.GridFiltering.locale.thisMonthLabel,lastMonth:$.ig.GridFiltering.locale.lastMonthLabel,nextMonth:$.ig.GridFiltering.locale.nextMonthLabel,thisYear:$.ig.GridFiltering.locale.thisYearLabel,lastYear:$.ig.GridFiltering.locale.lastYearLabel,nextYear:$.ig.GridFiltering.locale.nextYearLabel,on:$.ig.GridFiltering.locale.onLabel,notOn:$.ig.GridFiltering.locale.notOnLabel,advancedButtonLabel:$.ig.GridFiltering.locale.advancedButtonLabel,filterDialogCaptionLabel:$.ig.GridFiltering.locale.filterDialogCaptionLabel,filterDialogConditionLabel1:$.ig.GridFiltering.locale.filterDialogConditionLabel1,filterDialogConditionLabel2:$.ig.GridFiltering.locale.filterDialogConditionLabel2,filterDialogOkLabel:$.ig.GridFiltering.locale.filterDialogOkLabel,filterDialogCancelLabel:$.ig.GridFiltering.locale.filterDialogCancelLabel,filterDialogAnyLabel:$.ig.GridFiltering.locale.filterDialogAnyLabel,filterDialogAllLabel:$.ig.GridFiltering.locale.filterDialogAllLabel,filterDialogAddLabel:$.ig.GridFiltering.locale.filterDialogAddLabel,filterDialogErrorLabel:$.ig.GridFiltering.locale.filterDialogErrorLabel,filterSummaryTitleLabel:$.ig.GridFiltering.locale.filterSummaryTitleLabel,filterDialogClearAllLabel:$.ig.GridFiltering.locale.filterDialogClearAllLabel,empty:$.ig.GridFiltering.locale.emptyNullText,notEmpty:$.ig.GridFiltering.locale.notEmptyNullText,nullLabel:$.ig.GridFiltering.locale.nullNullText,notNull:$.ig.GridFiltering.locale.notNullNullText},tooltipTemplate:$.ig.GridFiltering.locale.tooltipTemplate,filterDialogAddConditionTemplate:"<div><span>${label1}</span><div><select></select></div><span>${label2}</span></div>",filterDialogAddConditionDropDownTemplate:"<option value='${value}'>${text}</option>",filterDialogFilterTemplate:"<tr><td><input/></td><td><select></select></td><td><input /> </td><td><span></span></td></tr>",filterDialogFilterConditionTemplate:"<option value='${conditionName}'>${conditionLabel}</option>",filterDialogAddButtonWidth:100,filterDialogOkCancelButtonWidth:120,filterDialogMaxFilterCount:5,filterDialogContainment:"owner",showEmptyConditions:false,showNullConditions:false,featureChooserText:$.ig.GridFiltering.locale.featureChooserText,featureChooserTextHide:$.ig.GridFiltering.locale.featureChooserTextHide,featureChooserTextAdvancedFilter:$.ig.GridFiltering.locale.featureChooserTextAdvancedFilter},css:{filterRow:"ui-iggrid-filterrow ui-widget",filterCell:"ui-iggrid-filtercell",filterCellEditor:"ui-iggrid-filtereditor",filterDropDownList:"ui-menu ui-widget ui-widget-content ui-iggrid-filterddlist ui-corner-all",filterDropDown:"ui-iggrid-filterdd",filterDropDownListItemTextContainer:"ui-iggrid-filterddlistitemcontainer",filterDropDownListItem:"ui-iggrid-filterddlistitem",filterDropDownListItemAdvanced:"ui-iggrid-filterddlistitemadvanced",filterDropDownListItemWithIcons:"ui-iggrid-filterddlistitemicons ui-state-default",filterDropDownListItemClear:"ui-iggrid-filterddlistitemclear",filterDropDownListItemHover:"ui-iggrid-filterddlistitemhover ui-state-hover",filterDropDownListItemActive:"ui-iggrid-filterddlistitemactive ui-state-active",filterDateCell:"",filterTextCell:"",filterNumberCell:"",filterBoolCell:"",filterButton:"ui-iggrid-filterbutton ui-corner-all ui-icon ui-icon-triangle-1-s",filterButtonAdvanced:"ui-iggrid-filterbutton ui-iggrid-filterbuttonadvanced ui-icon ui-icon-search",filterButtonAdvancedRight:"ui-iggrid-filterbuttonright ui-iggrid-filterbuttonadvanced ui-icon ui-icon-search",filterButtonHover:"ui-iggrid-filterbuttonhover ui-state-hover",filterButtonActive:"ui-iggrid-filterbuttonactive ui-state-active",filterButtonFocus:"ui-iggrid-filterbuttonfocus ui-state-focus",filterButtonDisabled:"ui-iggrid-filterbuttondisabled ui-state-disabled",filterButtonDate:"ui-iggrid-filterbuttondate",filterButtonString:"ui-iggrid-filterbuttonstring",filterButtonNumber:"ui-iggrid-filterbuttonnumber",filterButtonBoolean:"ui-iggrid-filterbuttonbool",filterButtonAdvancedHover:"ui-iggrid-filterbuttonadvancedhover ui-state-hover",filterButtonAdvancedActive:"ui-iggrid-filterbuttonadvancedactive ui-state-active",filterButtonAdvancedFocus:"ui-iggrid-filterbuttonadvancedfocus ui-state-focus",filterButtonAdvancedDisabled:"ui-iggrid-filterbuttonadvanceddisabled ui-state-disabled",filterItemIcon:"ui-iggrid-filtericon",filterItemIconContainer:"ui-iggrid-filtericoncontainer",filterItemIconStartsWith:"ui-iggrid-filtericonstartswith",filterItemIconEndsWith:"ui-iggrid-filtericonendswith",filterItemIconContains:"ui-iggrid-filtericoncontains",filterItemIconEquals:"ui-iggrid-filtericonequals",filterItemIconDoesNotEqual:"ui-iggrid-filtericondoesnotequal",filterItemIconDoesNotContain:"ui-iggrid-filtericondoesnotcontain",filterItemIconGreaterThan:"ui-iggrid-filtericongreaterthan",filterItemIconLessThan:"ui-iggrid-filtericonlessthan",filterItemIconGreaterThanOrEqualTo:"ui-iggrid-filtericongreaterthanorequalto",filterItemIconLessThanOrEqualTo:"ui-iggrid-filtericonlessthanorequalto",filterItemIconTrue:"ui-iggrid-filtericontrue",filterItemIconFalse:"ui-iggrid-filtericonfalse",filterItemIconAfter:"ui-iggrid-filtericonafter",filterItemIconBefore:"ui-iggrid-filtericonbefore",filterItemIconToday:"ui-iggrid-filtericontoday",filterItemIconYesterday:"ui-iggrid-filtericonyesterday",filterItemIconThisMonth:"ui-iggrid-filtericonthismonth",filterItemIconLastMonth:"ui-iggrid-filtericonlastmonth",filterItemIconNextMonth:"ui-iggrid-filtericonnextmonth",filterItemIconThisYear:"ui-iggrid-filtericonthisyear",filterItemIconLastYear:"ui-iggrid-filtericonlastyear",filterItemIconNextYear:"ui-iggrid-filtericonnextyear",filterItemIconOn:"ui-iggrid-filtericonon",filterItemIconNotOn:"ui-iggrid-filtericonnoton",filterItemIconClear:"ui-iggrid-filtericonclear",blockArea:"ui-widget-overlay ui-iggrid-blockarea",filterDialog:"ui-dialog ui-draggable ui-resizable ui-iggrid-dialog ui-widget ui-widget-content ui-corner-all",filterDialogHeaderCaption:"ui-dialog-titlebar ui-iggrid-filterdialogcaption ui-widget-header ui-corner-all ui-helper-reset ui-helper-clearfix",filterDialogHeaderCaptionTitle:"ui-dialog-title",filterDialogAddCondition:"ui-iggrid-filterdialogaddcondition",filterDialogAddConditionDropDown:"ui-iggrid-filterdialogaddconditionlist",filterDialogAddButton:"ui-iggrid-filterdialogaddbuttoncontainer ui-helper-reset",filterDialogOkCancelButton:"ui-dialog-buttonpane ui-widget-content ui-helper-clearfix ui-iggrid-filterdialogokcancelbuttoncontainer",filterDialogFiltersTable:"ui-iggrid-filtertable ui-helper-reset",filterDialogFilterRemoveButton:"ui-icon ui-icon-closethick",filterDialogClearAllButton:"ui-iggrid-filterdialogclearall",featureChooserModalDialogIcon:"ui-icon ui-icon-newwin"},events:{dataFiltering:"dataFiltering",dataFiltered:"dataFiltered",dropDownOpening:"dropDownOpening",dropDownOpened:"dropDownOpened",dropDownClosing:"dropDownClosing",dropDownClosed:"dropDownClosed",filterDialogOpening:"filterDialogOpening",filterDialogOpened:"filterDialogOpened",filterDialogMoving:"filterDialogMoving",filterDialogFilterAdding:"filterDialogFilterAdding",filterDialogFilterAdded:"filterDialogFilterAdded",filterDialogClosing:"filterDialogClosing",filterDialogClosed:"filterDialogClosed",filterDialogContentsRendering:"filterDialogContentsRendering",filterDialogContentsRendered:"filterDialogContentsRendered",filterDialogFiltering:"filterDialogFiltering"},_createWidget:function(options,element){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._editors=[];if(!$.fn.fadeToggle){$.fn.fadeToggle=$.fn.toggle}this._fcData={};this._isInitFC=false;this._ft="<li class='${itemClass}'><span class='${imgContainerClass}'><span class='"+this.css.filterItemIcon+" ${imgClass}'></span></span><span class='${textClass}'> ${text} </span></li>";if(this.options.filterDropDownAnimations==="none"){this.options.filterDropDownAnimationDuration=1;this.options.filterDropDownAnimations="linear"}},_setOption:function(key,value){$.Widget.prototype._setOption.apply(this,arguments);if(key==="mode"||key==="renderFilterButton"||key==="filterButtonLocation"||key==="type"){throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+key)}if(key==="filterDropDownWidth"){this.grid.container().find("div ul").parent().css("width",value)}else if(key==="filterDropDownHeight"){this.grid.container().find("div ul").parent().css("height",value)}else if(key==="filterDialogWidth"){$("#"+this.grid.container().attr("id")+"_dialog").css("width",value)}else if(key==="filterDialogHeight"){$("#"+this.grid.container().attr("id")+"_dialog").css("height",value)}else if(key==="columnSettings"){this._initDefaultSettings()}},destroy:function(){var i,fc,cols=this.grid.options.columns,block=$("#"+this.grid.id()+"_container_block"),dialog=$("#"+this.grid.id()+"_container_dialog");$("#"+this.grid.container()[0].id+" .ui-iggrid-filterrow").remove();$("#"+this.grid.container()[0].id+" .ui-iggrid-filterdd").remove();for(i=0;i<cols.length;i++){$("#"+this.grid.id()+"_dd_"+cols[i].key).remove()}block.remove();dialog.remove();this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this.grid.element.unbind("iggridresizingcolumnresized",this._columnResizedHandler);this.grid.element.unbind("iggridheaderextracellsmodified",this._headerInitHandler);this.grid.element.unbind("iggrid_columnsmoved",this._columnsAlteredHandler);this.grid.element.unbind("iggriduidirty",this._onUIDirtyHandler);delete this._headerCellRenderedHandler;delete this._headerRenderedHandler;delete this._virtualHorizontalScrollHandler;delete this._columnResizedHandler;delete this._headerInitHandler;delete this._onUIDirtyHandler;delete this._columnsAlteredHandler;this._editors=null;this._fcData=null;this._ft=null;this.options.columnSettings=null;this.options=null;if(this._loadingIndicator){delete this._loadingIndicator}if(this._filterInternal){delete this._filterInternal}if(this._toggleFilterRowHandler){delete this._toggleFilterRowHandler}if(this._openFilterDialogFromFCHandler){delete this._openFilterDialogFromFCHandler}if(this._exitEditModeHandler){delete this._exitEditModeHandler}if(this._enterEditModeHandler){delete this._enterEditModeHandler}fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("Filtering");fc._removeFeature("AdvancedFiltering")}$.Widget.prototype.destroy.call(this);return this},_initLoadingIndicator:function(){this._loadingIndicator=this.grid.container().length>0?this.grid.container().igLoading().data("igLoading"):this.grid.element.igLoading().data("igLoading").indicator()},_onUIDirty:function(e,args){var i,cols=this.grid.options.columns,condition;if(args.owner===this||args.owner.element[0].id!==this.element[0].id){return}this._filterDialogClearAll();if(this._editors!==null&&this._editors!==undefined){for(i=0;i<this._editors.length;i++){if(this.options.columnSettings[i].allowFiltering!==false){this._editors[i].value(null);condition=null;if(this.options.columnSettings[i].columnKey){condition=this.options.nullTexts[this._findColumnSetting(this.options.columnSettings[i].columnKey).condition]}if(condition===null||condition===undefined){condition=this.options.nullTexts[this._getDefaultCondition(cols[i].dataType)]}this._editors[i].element.igEditor("option","nullText",condition)}}}for(i=0;i<cols.length;i++){$("#"+this.grid.id()+"_dd_"+cols[i].key).find("li").removeClass("ui-iggrid-filterddlistitemactive ui-state-active")}$(".ui-iggrid-filterbutton",this.grid.container()).parent().attr("title",this.options.tooltipTemplate.replace("${condition}",this.options.labels.noFilter));this.grid.dataSource.settings.filtering.expressions=[]},_dataRendered:function(){var defExpr,expr,matches=0,grid=this.grid,summary=this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").eq(0),footer=summary.parent(),shouldInitHeights=false,isInitiallyFiltered=false;if(!this._loadingIndicator){this._initLoadingIndicator()}if(this._hiddenCells&&this._hiddenCells.length>0){for(i=0;i<this._hiddenCells.length;i++){this._hiddenCells[i].show()}this._hiddenCells=undefined}if(this._defaultExpressions&&this._defaultExpressions.length>0){defExpr=this._defaultExpressions;this._defaultExpressions=[];this._updateFiltersUI(defExpr,false);isInitiallyFiltered=true;this._isFilteringRequest=true}if(this._shouldFireDataFiltered){this._shouldFireDataFiltered=false;this._trigger(this.events.dataFiltered,null,{columnKey:this._curColKey,columnIndex:this._curColIndex,owner:this})}if(!summary.is(":visible")){shouldInitHeights=true}if(this._isFilteringRequest===true){if(this.options.filterSummaryAlwaysVisible===true&&summary.length===0){footer=$("<div></div>").appendTo(this.grid.container()).addClass("ui-widget ui-helper-clearfix ui-corner-bottom ui-widget-header ui-iggrid-footer");summary=$("<span></span>").appendTo(footer).addClass("ui-iggrid-results");if(isInitiallyFiltered&&this.grid.element.data("igGridPaging")){footer.attr("id",this.grid.element[0].id+"_pager");summary.attr("id",this.grid.element[0].id+"_pager_label")}shouldInitHeights=true}if(this.options.type==="local"||this.options.type==="remote"&&this.grid.dataSource.hasTotalRecordsCount()===false){if(this.grid.dataSource._filter){matches=this.grid.dataSource._filteredData.length}else{matches=this.grid.dataSource._data.length}}else{matches=this.grid.dataSource.totalRecordsCount()}if(!summary.parent().is(":visible")){summary.parent().show();shouldInitHeights=true}summary.text(this.options.filterSummaryTemplate.replace("${matches}",matches)).attr("title",this.options.labels.filterSummaryTitleLabel);summary.show();this._isFilteringRequest=false}else if(this._isFilteringRequest===false){expr=this.grid.dataSource.settings.filtering.expressions||[];if(summary.data("hideflag")!==false&&expr.length===0){summary.hide();if(summary.parent().children().length===1){summary.parent().hide()}}else{summary.data("hideflag",true)}shouldInitHeights=true}this._loadingIndicator.hide();if(shouldInitHeights){this.grid._initializeHeights()}if(grid.options.virtualization||grid.options.rowVirtualization){if(!shouldInitHeights){this.grid._initializeHeights()}if(grid._totalRowCount*grid._avgRowHeight<=parseInt(grid.options.height,10)){grid.element.height("");grid._avgRowHeight=grid._calculateAvgRowHeight();grid._setScrollContainerHeight(grid._totalRowCount*grid._avgRowHeight)}}this._setEditorsWidth()},_initFC:function(){var columnKey,i,fc=this.grid.element.data("igGridFeatureChooser"),o=this.options,cs=this.options.columnSettings,showAdvancedButton=o.mode==="advanced"&&o.advancedModeEditorsVisible===true,isAdvanced=o.mode!=="simple"&&o.advancedModeEditorsVisible===false;this._isInitFC=true;if(o.renderFC===false){return}if(fc!==null&&fc!==undefined){if(this._toggleFilterRowHandler===null||this._toggleFilterRowHandler===undefined){this._toggleFilterRowHandler=$.proxy(this.toggleFilterRowByFeatureChooser,this)}if(this._openFilterDialogFromFCHandler===null||this._openFilterDialogFromFCHandler===undefined){this._openFilterDialogFromFCHandler=$.proxy(this._openFilterDialogFromFC,this)}for(i=0;i<cs.length;i++){columnKey=cs[i].columnKey;if(columnKey&&cs[i].allowFiltering===true&&fc._shouldRenderInFeatureChooser(columnKey)===true){this._filterRowShown=true;this._fcData[columnKey]=true;if(isAdvanced||showAdvancedButton){fc._renderInFeatureChooser(columnKey,{name:"AdvancedFiltering",text:o.featureChooserTextAdvancedFilter,secondaryIconClass:this.css.featureChooserModalDialogIcon,isSelected:true,method:this._openFilterDialogFromFCHandler,updateOnClickAll:true,groupName:"modaldialog",groupOrder:3,order:3})}if(!isAdvanced){fc._renderInFeatureChooser(columnKey,{name:"Filtering",text:o.featureChooserText,textHide:o.featureChooserTextHide,iconClass:"ui-iggrid-filterbutton ui-corner-all ui-icon ui-icon-triangle-1-s",isSelected:true,method:this._toggleFilterRowHandler,updateOnClickAll:true,groupName:"toggle",groupOrder:1,order:2,type:"toggle",state:"hide"})}}}}},_columnResized:function(){if(this._filterRowShown!==false){this._setEditorsWidth()}},_setEditorsWidth:function(){if(this.options.mode!=="simple"&&this.options.advancedModeEditorsVisible!==true){return}var cs=this.options.columnSettings,cols=this.grid._visibleColumns(),cells=this.grid.headersTable().find("thead tr[data-role=filterrow]").first().find("td").not("[data-skip=true]"),cellWidth,i,j,skipColumn;for(i=0;i<cols.length;i++){for(j=0;j<cs.length;j++){if(cs[j].columnKey===cols[i].key&&cs[j].allowFiltering===false){skipColumn=true;break}}if(skipColumn){skipColumn=false;continue}if(!$.ig.util.isOpera&&(this.grid.options.height&&this.grid.options.fixedHeaders===true||$.ig.util.isWebKit)){cellWidth=cells.eq(i).innerWidth()}else{cellWidth=cells.eq(i).width()}cellWidth-=cells.eq(i).data("buttonWidth");cells.eq(i).children("span").first().igEditor("option","width",cellWidth)}},_headerRendered:function(sender,args){var thead,filterrow,i=0,cell,w,button,cols=this.grid.options.columns,thCell,id,j,cs=this.options.columnSettings,skipColumn=false,buttonCss,hiddenCells,showAdvancedInHeader=false,indicatorContainer,cancelFunc,ci,buttonWidth,isSimpleMode=this.options.mode==="simple"||this.options.advancedModeEditorsVisible===true,isToCheck=this.grid._initialHiddenColumns&&this.grid._initialHiddenColumns.length>0;if(sender.target.id!==this.grid.element[0].id){return}thead=this.grid.container().find("thead");if(this.options.mode==="simple"||this.options.advancedModeEditorsVisible===true){filterrow=$("<tr></tr>").appendTo(thead).addClass(this.css.filterRow).attr("data-role","filterrow");this.grid._headerInit(filterrow)}else{filterrow=thead.find("tr:first")}cancelFunc=function(e){e.preventDefault();e.stopPropagation()};if(isToCheck){this._hiddenCells=[]}ci=i+filterrow.find("[data-skip=true]").length;for(i=0;i<cols.length;i++,ci++){if(isSimpleMode===true){cell=$("<td></td>").appendTo(filterrow).addClass(this.css.filterCell);if(isToCheck&&this._hiddenCells.length<this.grid._initialHiddenColumns.length){for(j=this.grid._initialHiddenColumns.length-1;j>=0;j--){if(this.grid._initialHiddenColumns[j].key===cols[i].key){cell.hide();this._hiddenCells.push(cell);break}}}}else{if(this.grid._isMultiColumnGrid){cell=$(this.grid._headerCells[ci])}else{cell=$(filterrow[0].cells[ci])}if(cell.children().first().is("a")){cell.children().first().css("display","inline");cell.css("cursor","pointer")}cell.data("colName",cols[i].key)}if(this.grid._isMultiColumnGrid!==true||isSimpleMode===true){if(i===cols.length-1&&this.grid.options.height&&parseInt(this.grid.options.height,10)>0){cell.css("width",parseInt(cols[i].width,10)+this.grid._scrollbarWidth())}else{cell.css("width",cols[i].width)}}for(j=0;j<cs.length;j++){if(cs[j].columnKey===cols[i].key&&cs[j].allowFiltering===false){if(this.options.advancedModeEditorsVisible===true||this.options.mode!=="advanced"){this._editors.push({})}skipColumn=true;break}}if(skipColumn){skipColumn=false;continue}thCell=thead.children().first().find("th:nth-child("+(ci+1)+")");if($.ig.util.isWebKit&&thCell.length>0){w=thCell[0].offsetWidth}else if(this.grid.options.height&&this.grid.options.fixedHeaders===true||$.ig.util.isWebKit){w=thCell.innerWidth()}else{w=thCell.width()}showAdvancedInHeader=this.options.advancedModeEditorsVisible===false&&this.options.mode==="advanced"&&this.options.renderFilterButton===true;if(this.options.renderFilterButton===true&&!showAdvancedInHeader||showAdvancedInHeader&&this._renderFCFor(cols[i].key)===false){id=this.grid.element.attr("id")+"_dd_"+cols[i].key;if(this.options.advancedModeEditorsVisible===true||this.options.mode!=="advanced"){this._renderDropDown(cols[i].dataType,id,cols[i].key)}buttonCss=this.options.mode==="advanced"?this.css.filterButtonAdvanced:this.css.filterButton;if(showAdvancedInHeader&&this.options.advancedModeHeaderButtonLocation==="right"){buttonCss=this.css.filterButtonAdvancedRight;button=$("<span></span>").appendTo(cell).addClass(buttonCss).data("colIndex",i)}else{button=$("<span></span>").prependTo(cell).addClass(buttonCss).data("colIndex",i)}if(this.options.mode==="simple"||this.options.mode==="advanced"&&this.options.advancedModeEditorsVisible===true){button.wrap('<a id="'+id+'_button" href="#" title="'+this.options.tooltipTemplate.replace("${condition}",this.options.labels.noFilter)+'" ></a>')}else{button.wrap('<a id="'+id+'_button" href="#" title="'+this.options.tooltipTemplate.replace("${condition}",this.options.labels.noFilter)+'" style="display:inline;"></a>')}indicatorContainer=cell.find(".ui-iggrid-indicatorcontainer");if(indicatorContainer.length===0){indicatorContainer=$("<div></div>").appendTo(cell).addClass("ui-iggrid-indicatorcontainer")}indicatorContainer.append(button.parent());w=parseInt(w,10);if(this.grid.options.height===null&&$.ig.util.isFF){buttonWidth=button.outerWidth(true)}else{buttonWidth=button.outerWidth(false)}w-=buttonWidth;cell.data("buttonWidth",buttonWidth)}if(this.options.renderFilterButton===true){if(this.options.advancedModeEditorsVisible===true||this.options.mode!=="advanced"){button.parent().bind({mousedown:$.proxy(this._toggleDropDown,this),mouseup:cancelFunc,click:cancelFunc,blur:$.proxy(this._closeDropDown,this),keydown:$.proxy(this._toggleDropDownKeyboard,this),mouseover:$.proxy(this._hoverButton,this),mouseout:$.proxy(this._unhoverButton,this),focus:$.proxy(this._activateButton,this)});if(document.documentMode===5||document.documentMode===7||$.ig.util.isIE7){button.parent().bind({focusout:$.proxy(this._closeDropDown,this)})}}else if(this._renderFCFor(cols[i].key)===false){button.parent().bind({click:$.proxy(this._openFilterDialog,this),keydown:$.proxy(this._openFilterDialogFromKeyboard,this),focus:$.proxy(this._activateButton,this),blur:$.proxy(this._deactivateButton,this)})}}if(this.options.advancedModeEditorsVisible===true||this.options.mode!=="advanced"){this._createEditor(cell,w,i,cols[i].dataType,cols[i].key,cols[i])}}if($("#"+this.grid.container().attr("id")+"_dialog").length>0){$("#"+this.grid.container().attr("id")+"_dialog").remove()}this._renderFilterDialog()},_renderFCFor:function(columnKey){return!(this._fcData===null||this._fcData===undefined||this.options.renderFC===false||this._fcData[columnKey]!==true)},_columnMap:function(){var o=this.options,i,elem,cs=o.columnSettings,csLength=cs.length,result=[];if(o.renderFC===false){return false}for(i=0;i<csLength;i++){elem={columnKey:cs[i].columnKey,enabled:true};if(cs[i].allowFiltering===false){elem.enabled=false}result.push(elem)}return result},_headerCellRendered:function(event,ui){if(this._isInitFC!==true){this._initFC()}},_openFilterDialogFromFC:function(event,columnKey){this._openFilterDialog(event,columnKey)},toggleFilterRowByFeatureChooser:function(event){var fc,o=this.options,isShown=this._filterRowShown,$thead=this.grid.container().find("thead"),$filterRow,isAdvanced=!(o.mode==="simple"||o.advancedModeEditorsVisible===true);if(isShown===null||isShown===undefined){this._filterRowShown=true;isShown=this._filterRowShown}if(isAdvanced===false||isAdvanced&&o.advancedModeEditorsVisible){$filterRow=$thead.find('tr[data-role="filterrow"]');if(isShown===true){$filterRow.hide();if(document.documentMode===7||$.ig.util.isIE7){$filterRow.children().hide()}isShown=false}else{$filterRow.show();if(document.documentMode===7||$.ig.util.isIE7){$filterRow.children().show()}this._setEditorsWidth();isShown=true}if(event===null||event===undefined){fc=this.grid.element.data("igGridFeatureChooser");if(fc){fc._toggleSelectedItems("Filtering")}}this._filterRowShown=isShown;this.grid._initializeHeights();this.grid._adjustLastColumnWidth(true)}},_createEditor:function(parent,w,colIndex,colType,colKey,col){var editor,options,type=this._getEditorType(colType),isDatePicker=type==="datepicker";editor=$("<span />").css("float","left").css("width","5px");if(this.options.filterButtonLocation==="left"){editor.appendTo(parent)}else{editor.prependTo(parent)}if(this._enterEditModeHandler===undefined||this._enterEditModeHandler===null){this._enterEditModeHandler=$.proxy(this._fireEnterEditModeEvents,this)}if(this._exitEditModeHandler===undefined||this._exitEditModeHandler===null){this._exitEditModeHandler=$.proxy(this._fireExitEditModeEvents,this)}options={textChanged:$.proxy(this._filter,this),width:w,disabled:this.grid.options.columns[colIndex].dataType==="bool"||this.grid.options.columns[colIndex].dataType==="boolean",type:type,textAlign:"left",button:isDatePicker?"dropdown":null,maxDecimals:6,nullText:this.options.nullTexts[this._findColumnSetting(colKey).condition],focus:this._enterEditModeHandler,blur:this._exitEditModeHandler,enableUTCDates:this.grid.options.enableUTCDates};if(isDatePicker&&col.format){options.dateInputFormat=col.format}editor.data("colIndex",colIndex).data("colKey",colKey);editor.igEditor(options);this._editors.push(editor.data("igEditor"));editor.find("input").addClass(this.css.filterCellEditor)},_columnsAltered:function(event,args){var i,cs,start=args.start,len=args.len,idx=args.index;for(i=0;i<this.options.columnSettings.length;i++){cs=this.options.columnSettings[i];if(this.grid._isColumnHidden(cs.columnKey)===true){start+=i<=start?1:0;len+=i>=start&&i<start+len?1:0;idx+=i<=idx?1:0}}this.grid._rearrangeArray(this.options.columnSettings,start,len,idx);this.grid._rearrangeArray(this._editors,start,len,idx);for(i=0;i<this._editors.length;i++){$(this._editors[i].element).data("colIndex",i);$(this._editors[i].element).closest("td").find("span.ui-iggrid-filterbutton").data("colIndex",i)}},_getEditorType:function(type){return type==="date"?"datepicker":type==="number"?"numeric":"text"},_findColumnSetting:function(key){var i;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){return this.options.columnSettings[i]}}},filter:function(expressions,updateUI,addedFromAdvanced){this._loadingIndicator.show();if(expressions!==undefined&&expressions.length>0){this._isFilteringRequest=true}if(!addedFromAdvanced){this._filterDataSource(expressions,true);this._updateFiltersUI([],false)}else{this._filterDataSource(expressions)}if(updateUI===undefined||updateUI===true){this._updateFiltersUI(expressions===undefined?this._generateExpressions():expressions,addedFromAdvanced)}},_filter:function(ui,args){clearTimeout(this._timeoutId);this._ui=ui;this._args=args;if(parseInt(this.options.filterDelay,10)===0){this._filterInternal()}else{this._timeoutId=setTimeout($.proxy(this._filterInternal,this),this.options.filterDelay)}},_fireEnterEditModeEvents:function(evt,ui){var sel=ui&&ui.owner?ui.owner._grid_sel:null;if(sel){if(sel.time+1e3>(new Date).getTime()){ui.owner.select(sel.sel)}this.grid._synchronizeHScroll();delete ui.owner._grid_sel}},_filterInternal:function(colIndex,colKey){var args=this._args,_colIndex,_colKey,noCancel,editor,exprs;if(args!==undefined){_colIndex=$(args.owner.element).data("colIndex");_colKey=$(args.owner.element).data("colKey")}else{_colIndex=colIndex;_colKey=colKey}exprs=this._generateExpressions(true);noCancel=this._trigger(this.events.dataFiltering,null,{columnKey:_colKey,columnIndex:_colIndex,owner:this,expressions:exprs});if(noCancel){this.grid._isToSetUnboundColumns=true;this._loadingIndicator.show();editor=this._editors?this._editors[_colIndex]:null;if(editor){editor._addedFromAdvanced=false}this._curColKey=_colKey;this._curColIndex=_colIndex;this._filterDataSource(exprs,false,true);if(editor){editor._grid_sel={time:(new Date).getTime(),sel:editor._sel0};editor.setFocus()}}},_filterDataSource:function(expressions,apiCall,updateUI){var exprs,i,j,button,groupBy,cols=this.grid.options.columns,found=false,defaultTooltip,noCancel;defaultTooltip=this.options.tooltipTemplate.replace("${condition}",this.options.labels.noFilter);if(expressions!==undefined&&!updateUI){if(apiCall===true){this.grid.dataSource.settings.filtering.expressions=expressions;this._filterDialogClearAll();for(i=0;i<expressions.length;i++){this._addFilterFromDialog(null,expressions[i])}}else{this.grid.dataSource.settings.filtering.expressions=expressions}}else{if(expressions!==undefined&&updateUI){exprs=expressions}else{exprs=this._generateExpressions(true)}for(i=0;i<cols.length;i++){found=false;button=$("#"+this.grid.element[0].id+"_dd_"+cols[i].key+"_button");for(j=0;j<exprs.length;j++){if(cols[i].key===exprs[j].fieldName){found=true;if((exprs[j].expr===undefined||exprs[j].expr===null||exprs[j].expr==="")&&this._requiresEntry(exprs[j].cond)){button.attr("title",defaultTooltip)}else{button.attr("title",this.options.tooltipTemplate.replace("${condition}",exprs[j].cond))}break}}if(!found){button.attr("title",defaultTooltip)}}this.grid.dataSource.settings.filtering.expressions=exprs}if(this.grid._hasUnboundColumns){this.grid._rebindUnboundColumns=true}this.grid.element.trigger("iggriduisoftdirty",{owner:this});
noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});if(noCancel){exprs=this.grid.dataSource.settings.filtering.expressions;if(this.options.type==="remote"){this.grid.dataSource.settings.paging.pageIndex=0;this.grid._shouldResetPaging=true}else if(this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").length>0){this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").data("overrideLabel",exprs.length)}this._isFilteringRequest=true;this._preserveSorting();if(exprs.length===0){if(!apiCall){this._shouldFireDataFiltered=true}if(this.options.type==="remote"){this._isFilteringRequest=false;this.grid.dataSource.dataBind()}else{this.grid.dataSource.settings.filtering.type="local";this._isFilteringRequest=false;this.grid.dataSource.clearLocalFilter();groupBy=this.grid.element.data("igGridGroupBy");if(groupBy&&groupBy.options&&groupBy.options.groupedColumns&&groupBy.options.groupedColumns.length>0){if(this.grid.dataSource.settings.sorting.expressions.length>0&&groupBy.options.type==="local"){this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions)}}this.grid._renderData()}}else{if(this.options.type==="remote"){if(!apiCall){this._shouldFireDataFiltered=true}this.grid.dataSource.dataBind()}else{this.grid.dataSource.settings.filtering.type="local";this.grid.dataSource.filter(exprs);groupBy=this.grid.element.data("igGridGroupBy");if(groupBy&&groupBy.options&&groupBy.options.groupedColumns&&groupBy.options.groupedColumns.length>0){if(this.grid.dataSource.settings.sorting.expressions.length>0&&groupBy.options.type==="local"&&this.grid.dataSource._allDataSorted===false){this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions)}}this.grid._renderData();if(!apiCall){this._trigger(this.events.dataFiltered,null,{columnKey:this._curColKey,columnIndex:this._curColIndex,owner:this})}}}}},_filterDataSourceClear:function(colKey,colIndex){var i,exprs=this._generateExpressions(true),noCancel,noCancelFiltering;for(i=0;i<exprs.length;i++){if(exprs[i].fieldName===colKey){$.ig.removeFromArray(exprs,i);break}}this.grid.dataSource.settings.filtering.expressions=exprs;this.grid.element.trigger("iggriduidirty",{owner:this});if(!this._curColKey||colKey){this._curColKey=colKey;this._curColIndex=colIndex}noCancelFiltering=this._trigger(this.events.dataFiltering,null,{columnKey:this._curColKey,columnIndex:this._curColIndex,owner:this,expressions:exprs});if(noCancelFiltering){noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});if(noCancel){this.grid.dataSource.settings.paging.pageIndex=0;this._preserveSorting();this.grid._shouldResetPaging=true;this.grid._isToSetUnboundColumns=true;if(this.options.type==="remote"){if(exprs.length>0){this._shouldFireDataFiltered=true}else{this._isFilteringRequest=false;this._shouldFireDataFiltered=true}this.grid.dataSource.dataBind()}else{this.grid.dataSource.settings.filtering.type="local";if(this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").length>0){this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").data("overrideLabel",exprs.length)}if(exprs.length>0){this.grid.dataSource.filter(exprs)}else{this._isFilteringRequest=false;this.grid.dataSource.clearLocalFilter()}this.grid._renderData();this._trigger(this.events.dataFiltered,null,{columnKey:this._curColKey,columnIndex:this._curColIndex,owner:this})}}}},_preserveSorting:function(){var hasGroupedCols=false,groupBy=this.grid.element.data("igGridGroupBy");if(groupBy&&groupBy.options&&groupBy.options.groupedColumns&&groupBy.options.groupedColumns.length>0){hasGroupedCols=true}if(this.grid.dataSource.settings.sorting.expressions.length>0&&hasGroupedCols){this.grid.dataSource.settings.sorting.defaultFields=this.grid.dataSource.settings.sorting.expressions}},_updateFiltersUI:function(expressions,addedFromAdvanced){var i,j,editor,filterList,items;if(this._editors){for(i=0;i<this._editors.length;i++){if(this.options.columnSettings[i].allowFiltering!==false){this._editors[i].value(null)}}}for(i=0;i<expressions.length;i++){filterList=$("#"+this.grid.element[0].id+"_dd_"+expressions[i].fieldName).find("ul");items=filterList.children();for(j=0;j<items.length;j++){if($(items[j]).data("cond")===expressions[i].cond){this._selectDropDownItem({currentTarget:items[j]},null,expressions[i]);break}}editor=this._editors[this._columnIndexFromKey(expressions[i].fieldName)];if(editor!==undefined&&editor!==null&&editor.value){editor.value(expressions[i].expr);editor._addedFromAdvanced=true}}this._updateTooltips(expressions)},_updateTooltips:function(expressions){var button,title,found,titleText,tempTooltipExpr,cols=this.grid.options.columns,colsLength=cols.length,i,j,expressionFieldName,isSimpleMode=this.options.mode==="simple"||this.options.advancedModeEditorsVisible===true;titleText=this.options.tooltipTemplate.replace("${condition}",this.options.labels.noFilter);title="";for(i=0;i<expressions.length;i++){button=$("#"+this.grid.element[0].id+"_dd_"+expressions[i].fieldName+"_button");if(!this._requiresEntry(expressions[i].cond)||expressions[i].expr===undefined||expressions[i].expr===null){tempTooltipExpr=""}else{tempTooltipExpr=expressions[i].expr;if(expressions[i].type==="date"){if($.type(tempTooltipExpr)==="number"){tempTooltipExpr=new Date(tempTooltipExpr)}if(this.grid.options.enableUTCDates&&$.type(tempTooltipExpr)==="date"&&tempTooltipExpr.toUTCString){tempTooltipExpr=tempTooltipExpr.toUTCString()}}}expressionFieldName=expressions[i].fieldName;for(j=0;j<colsLength;j++){if(cols[j].key===expressionFieldName){expressionFieldName=cols[j].headerText;break}}if(isSimpleMode){button.attr("title",this.options.tooltipTemplate.replace("${condition}",expressions[i].cond));continue}if(i===0){button.attr("title",expressionFieldName+" "+expressions[i].cond+" "+tempTooltipExpr+" ")}else{button.attr("title",title+expressions[i].logic+" "+expressionFieldName+" "+expressions[i].cond+" "+tempTooltipExpr+" ")}title=button.attr("title")}for(i=0;i<colsLength;i++){found=false;for(j=0;j<expressions.length;j++){if(expressions[j].fieldName===cols[i].key){found=true;break}}if(!found){$("#"+this.grid.element[0].id+"_dd_"+cols[i].key+"_button").attr("title",titleText)}}},_columnIndexFromKey:function(key){var i;for(i=0;i<this.grid.options.columns.length;i++){if(this.grid.options.columns[i].key===key){return i}}},_generateExpressions:function(filterRowTrigger){var exprs=[],cols=this.grid.options.columns,expr,i,currentCondition,requiresEntry,isExprAdded,dt,precise,format,preciseInd;for(i=0;i<cols.length;i++){if(this._editors&&this._editors[i]&&this._editors[i]._addedFromAdvanced&&!filterRowTrigger){continue}if(this.options.columnSettings[i].allowFiltering!==true){continue}expr=this._editors[i].value();requiresEntry=this._requiresEntry(this.options.columnSettings[i].condition);if((expr===undefined||expr===null||expr==="")&&requiresEntry){continue}currentCondition=this.options.columnSettings[i].condition;if(currentCondition===undefined||currentCondition===null||currentCondition===""){continue}precise="";dt=cols[i].dataType;if(dt==="date"&&expr){if(this.options.type==="remote"&&this.options.filterExprUrlKey!==null&&this.options.filterExprUrlKey!==undefined){expr=Date.UTC(expr.getUTCFullYear(),expr.getUTCMonth(),expr.getUTCDate(),expr.getUTCHours(),expr.getUTCMinutes())}else{format=cols[i].format;if(format&&format.indexOf){preciseInd=format.indexOf("h");if(preciseInd===-1){preciseInd=format.indexOf("m")}if(preciseInd===-1){preciseInd=format.indexOf("s")}if(preciseInd>-1){precise=format.substr(preciseInd)}}if(precise===""&&currentCondition==="after"&&$.type(expr)==="date"){expr.setHours(23);expr.setMinutes(59);expr.setSeconds(59);expr.setMilliseconds(999)}}}isExprAdded=false;if(dt!=="date"||dt==="date"&&expr!==null&&expr!==undefined&&currentCondition!=="empty"&&currentCondition!=="notEmpty"&&currentCondition!=="null"&&currentCondition!=="notNull"||dt==="date"&&!this._requiresEntry(this.options.columnSettings[i].condition)){if(expr!==""&&!this.options.filterExprUrlKey){isExprAdded=true;exprs.push({fieldName:cols[i].key,cond:currentCondition,expr:expr})}else if(dt==="bool"&&expr!==""||dt!=="bool"&&(this.options.filterExprUrlKey!==undefined&&this.options.filterExprUrlKey!==null||this.options.type==="local")){isExprAdded=true;exprs.push({fieldName:cols[i].key,cond:currentCondition,expr:expr})}else if(dt==="bool"&&expr===""&&(currentCondition==="null"||currentCondition==="notNull"||currentCondition==="empty"||currentCondition==="notEmpty")){isExprAdded=true;exprs.push({fieldName:cols[i].key,cond:currentCondition,expr:expr})}if(isExprAdded){if(dt===undefined&&$.type(expr)==="string"){exprs[exprs.length-1].dataType="string"}if(cols[i].unbound){exprs[exprs.length-1].dataType=dt}if(precise){exprs[exprs.length-1].preciseDateFormat=precise}}}}return exprs},_getDefaultCondition:function(type){var result="equals";if(type===undefined||type===null||type==="string"){result="contains"}else if(type==="number"){result="equals"}else if(type==="date"){result="on"}else if(type==="bool"){result="true"}return result},_initDefaultSettings:function(){var settings=[],key,de,cs=this.options.columnSettings,i,j,k,cols=this.grid.options.columns,allowFiltering,defExpr,isToCheckUnboundColumns=this.grid._hasUnboundColumns===true&&this.options.type==="remote";this._defaultExpressions=this.grid.dataSource.settings.filtering.expressions||[];if(cols&&cols.length>0){for(i=0;i<cols.length;i++){allowFiltering=true;if(isToCheckUnboundColumns&&this.grid.getUnboundColumnByKey(cols[i].key)!==null){allowFiltering=false}settings[i]={columnIndex:i,columnKey:cols[i].key,condition:this._getDefaultCondition(cols[i].dataType),allowFiltering:allowFiltering}}}if(settings.length===0&&this.grid.options.autoGenerateColumns&&cs.length>0){for(i=0;i<cs.length;i++){if(!cs[i].columnKey){continue}defExpr=cs[i].defaultExpressions;if(defExpr&&defExpr.length>0){for(k=0;k<defExpr.length;k++){de={fieldName:cs[i].columnKey,expr:defExpr[k].expr,cond:defExpr[k].cond};if(defExpr[k].logic){de.logic=defExpr[k].logic}this._defaultExpressions.push(de)}}}}else{for(i=0;i<cs.length;i++){for(j=0;j<settings.length;j++){if(settings[j].columnKey===cs[i].columnKey||settings[j].columnIndex===cs[i].columnIndex){break}}if(j===settings.length){continue}for(key in cs[i]){if(cs[i].hasOwnProperty(key)){if(key!=="columnKey"&&key!=="columnIndex"){settings[j][key]=cs[i][key]}if(key==="defaultExpressions"&&cs[i][key]){defExpr=cs[i][key];for(k=0;k<defExpr.length;k++){de={fieldName:cs[i].columnKey,expr:defExpr[k].expr,cond:defExpr[k].cond};if(defExpr[k].logic){de.logic=defExpr[k].logic}this._defaultExpressions.push(de)}}}}}}this.options.columnSettings=settings;this.grid.dataSource.settings.filtering.expressions=this._defaultExpressions;this.grid.dataSource.settings.filtering.defaultFields=this._defaultExpressions},_renderDropDown:function(type,id,colName){var ul,i,cs=this.options.columnSettings,cols=this.grid.options.columns,item,obj;if(type==="number"){ul=this._renderNumericFilterDropDown(id,colName)}else if(type==="date"){ul=this._renderDateFilterDropDown(id,colName)}else if(type==="boolean"||type==="bool"){ul=this._renderBooleanFilterDropDown(id,colName)}else{ul=this._renderStringFilterDropDown(id,colName)}if(this.options.filterDropDownItemIcons!==true){if(this.options.showEmptyConditions){$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","empty")).text(this.options.labels.empty).addClass("ui-corner-all");$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","notEmpty")).text(this.options.labels.notEmpty).addClass("ui-corner-all")}if(this.options.showNullConditions){$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","null")).text(this.options.labels.nullLabel).addClass("ui-corner-all");$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","notNull")).text(this.options.labels.notNull).addClass("ui-corner-all")}}else{obj={itemClass:this.css.filterDropDownListItemWithIcons,imgContainerClass:this.css.filterItemIconContainer,textClass:this.css.filterDropDownListItemTextContainer};if(this.options.showEmptyConditions){obj.text=this.options.labels.empty;obj.imgClass=this.css.filterItemIcon;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","empty");obj.text=this.options.labels.notEmpty;obj.imgClass=this.css.filterItemIcon;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","notEmpty")}if(this.options.showNullConditions){obj.text=this.options.labels.nullLabel;obj.imgClass=this.css.filterItemIcon;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","null");obj.text=this.options.labels.notNull;obj.imgClass=this.css.filterItemIcon;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","notNull")}}if(this.options.mode==="advanced"){this._renderAdvancedButton(ul)}for(i=0;i<cs.length;i++){if(cs[i].columnKey===colName&&cs[i].condition!==this._getDefaultCondition(cols[i].dataType)){if(cs[i].condition==="null"){item=ul.find(':contains("'+this.options.labels.nullLabel+'")')}else{item=ul.find(':contains("'+this.options.labels[cs[i].condition]+'")')}item=item.children().first().closest("li");item.addClass(this.css.filterDropDownListItemActive).parent().data("selectedItem",$("li",item.parent()).index(item))}}},_renderAdvancedButton:function(ul){var li;li=$("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItemAdvanced);this._currentButton=$(toStaticHTML('<input type="button"></input>'));this._currentButton.igButton({labelText:this.options.labels.advancedButtonLabel}).bind({mousedown:$.proxy(this._openFilterDialog,this)});li.append(this._currentButton)},_openFilterDialogFromKeyboard:function(event){if(event.keyCode===$.ui.keyCode.ENTER){this._openFilterDialog(event)}},_openFilterDialog:function(event,columnKey){var maxZ,left,top,pos,h,w,bh,dh,dw,bw,noCancel=true,block=$("#"+this.grid.container().attr("id")+"_block"),dialog=$("#"+this.grid.container().attr("id")+"_dialog"),i,addDefault=true,expressions=this.grid.dataSource.settings.filtering.expressions;maxZ=$.ig.getMaxZIndex(this.grid.container().attr("id")+"_dialog");block.css("zIndex",maxZ+1);dialog.css("zIndex",maxZ+2);if(this.options.filterDialogContainment==="owner"){dialog.draggable("option","containment",this.grid.container())}else{dialog.draggable("option","containment","window")}this._dialogCurrentColumn=$(event.target).closest("ul").data("colName");if(this._dialogCurrentColumn===undefined||this._dialogCurrentColumn===null){if(columnKey!==null&&columnKey!==undefined){this._dialogCurrentColumn=columnKey}else{this._dialogCurrentColumn=$(event.target).closest("th").data("colName")}}if(this._dialogCurrentColumn===undefined||this._dialogCurrentColumn===null){this._dialogCurrentColumn=this.grid.options.columns[0]}dialog.find(".ui-iggrid-filtertable tbody tr").remove();this._dialogCurrentType=this.grid.columnByKey(this._dialogCurrentColumn).dataType;dialog.find(".ui-iggrd-filtertable tbody tr").remove();if(expressions&&expressions.length>0){addDefault=true;for(i=0;i<expressions.length;i++){if(!addDefault||expressions[i].fieldName===this._dialogCurrentColumn){addDefault=false}this._addFilterFromDialog(null,expressions[i])}if(addDefault){this._addFilterFromDialog()}}else{this._addFilterFromDialog()}noCancel=this._trigger(this.events.filterDialogOpening,null,{dialog:dialog,owner:this});if(noCancel){pos=$.ig.util.offset(this.grid.container());left=pos.left;top=pos.top;if(block.outerWidth()!==this.grid.container().outerWidth()){block.css("width",this.grid.container().outerWidth())}if(block.outerHeight()!==this.grid.container().outerHeight()){block.css("height",this.grid.container().outerHeight())}$("#"+this.grid.container().attr("id")+"_dialog_error").hide();block.css({left:left,top:top}).fadeToggle();w=this.grid.container().outerWidth();h=this.grid.container().outerHeight();bw=$(window).width();bh=$(window).height();if(w+left>bw){w=w-(w+left-bw)}if(w<=0){w=this.grid.container().outerWidth()}if(h+top>bh){h=h-(h+top-bh)}if(h<=0){h=this.grid.container().outerHeight()}dh=parseInt(this.options.filterDialogHeight,10);dw=parseInt(this.options.filterDialogWidth,10);if(isNaN(dh)||dh<=0){dh=dialog.outerHeight()}if(isNaN(dw)||dw<=0){dw=dialog.outerWidth()}top=top+parseInt(h/2,10)-dh/2;left=left+parseInt(w/2,10)-dw/2;top=top<0?pos.top:top;left=left<0?pos.left:left;dialog.css({left:left,top:top}).fadeToggle($.proxy(this._setResizableEnv,this));this._trigger(this.events.filterDialogOpened,null,{dialog:dialog,owner:this});dialog.focus();event.preventDefault();event.stopPropagation();if(!(this.options.mode==="advanced"&&this.options.advancedModeEditorsVisible===false)&&this._currentTarget!==null&&this._currentTarget!==undefined){this._toggleDropDown({currentTarget:this._currentTarget},true)}}},_closeFilterDialog:function(e){var noCancel=true;noCancel=this._trigger(this.events.filterDialogClosing,null,{owner:this});if(noCancel){$("#"+this.grid.container().attr("id")+"_block").fadeToggle();$("#"+this.grid.container().attr("id")+"_dialog").fadeToggle();this._trigger(this.events.filterDialogClosed,null,{owner:this});if(e){e.preventDefault();e.stopPropagation()}return false}},_searchFilterDialog:function(e){var expressions=[],rows,boolLogic,selectLogic,noCancel=true,i,type,expr,noCancelFiltering=true,cond;noCancel=this._trigger(this.events.filterDialogFiltering,null,{dialog:$("#"+this.grid.container().attr("id")+"_dialog"),owner:this});if(noCancel){rows=$("#"+this.grid.container().attr("id")+"_dialog table tbody").children();boolLogic="and";selectLogic=$("#"+this.grid.container().attr("id")+"_dialog select:first");if(selectLogic.length>0){boolLogic=$("#"+this.grid.container().attr("id")+"_dialog select:first")[0].value==="all"?"AND":"OR"}for(i=0;i<rows.length;i++){type=this.grid.columnByText($(rows[i].cells[0]).find("input")[0].value).dataType;expr=$(rows[i].cells[2]).find("input").igEditor("value");if(expr&&(expr.nodeName||expr[0]&&expr[0].nodeName)){expr=$(rows[i].cells[2]).find("span").igEditor("value")}cond=$(rows[i].cells[1]).find("select")[0].value;if($.type(expr)==="date"){if(this.grid.options.enableUTCDates){expr=Date.UTC(expr.getUTCFullYear(),expr.getUTCMonth(),expr.getUTCDate(),expr.getUTCHours(),expr.getUTCMinutes())}if(cond==="after"&&this.options.type==="local"){expr.setHours(23);expr.setMinutes(59);expr.setSeconds(59);expr.setMilliseconds(999)}}expressions.push({fieldName:this.grid.columnByText($(rows[i].cells[0]).find("input")[0].value).key,cond:cond,expr:expr,logic:boolLogic,type:type});if(type===undefined&&$.type(expr)==="string"){expressions[expressions.length-1].dataType="string"}}this._closeFilterDialog(e);this._currentAdvancedExpressions=expressions;noCancelFiltering=this._trigger(this.events.dataFiltering,null,{owner:this,expressions:expressions});if(noCancelFiltering){this.filter(expressions,true,true)}}e.preventDefault();e.stopPropagation()},_filterDialogStartMove:function(e){this._isFilterDialogMouseDown=true},_filterDialogStopMove:function(e){this._isFilterDialogMouseDown=false;this._dialogClientX=undefined;this._dialogClientY=undefined},_filterDialogMove:function(e,ui){$(e.target).find(".ui-igedit-fieldincontainer").igEditor("dropDownVisible",false);if(ui.position.top<0&&this.options.filterDialogContainment!=="window"){ui.position.top=this.grid.container().position().top}this._trigger(this.events.filterDialogMoving,null,{dialog:e.target,owner:this,originalPosition:ui.originalPosition,position:ui.position})},_renderFilterDialog:function(){var dialog,condObj,dropDownData,condElement,okCancelContainer,f=this,caption,dialogContent,noCancel=true,addClearButtons,limit;$("<div></div>").appendTo("body").attr("id",this.grid.container().attr("id")+"_block").css("position","absolute").addClass(this.css.blockArea).data("efh","1").hide();dialog=$("<div></div>").appendTo("body").attr("id",this.grid.container().attr("id")+"_dialog").css("position","absolute").css("width",this.options.filterDialogWidth).css("height",this.options.filterDialogHeight).addClass(this.css.filterDialog).data("efh","1").hide();noCancel=this._trigger(this.events.filterDialogContentsRendering,null,{dialogElement:dialog,owner:this});if(noCancel){caption=$("<div></div>").appendTo(dialog).addClass(this.css.filterDialogHeaderCaption);$("<span></span>").appendTo(caption).text(this.options.labels.filterDialogCaptionLabel).addClass(this.css.filterDialogHeaderCaptionTitle);$("<span></span>").appendTo($("<a></a>").appendTo(caption).attr("href","#").attr("role","button").addClass("ui-dialog-titlebar-close ui-corner-all")).bind({click:$.proxy(this._closeFilterDialog,this)}).addClass("ui-icon ui-icon-closethick");dialogContent=$("<div></div>").appendTo(dialog).addClass("ui-dialog-content").css("overflow","auto").css("height",this.options.filterDialogMaxHeight);condObj={label1:this.options.labels.filterDialogConditionLabel1,label2:this.options.labels.filterDialogConditionLabel2};dropDownData=[{text:this.options.labels.filterDialogAllLabel,value:"all"},{text:this.options.labels.filterDialogAnyLabel,value:"any"}];condElement=$($.ig.tmpl(this.options.filterDialogAddConditionTemplate,condObj)).appendTo(dialogContent).addClass(this.css.filterDialogAddCondition);$($.ig.tmpl(this.options.filterDialogAddConditionDropDownTemplate,dropDownData)).appendTo(condElement.find("div").addClass(this.css.filterDialogAddConditionDropDown).find("select"));addClearButtons=$("<div></div>").appendTo(dialogContent);$(toStaticHTML('<input type="button"></input>')).appendTo($("<span></span>").appendTo(addClearButtons).addClass(this.css.filterDialogAddButton)).igButton({labelText:this.options.labels.filterDialogAddLabel,width:this.options.filterDialogAddButtonWidth}).bind({mousedown:$.proxy(this._addFilterFromDialog,this)});$("<button />").appendTo(addClearButtons).css("float","right").igButton({labelText:this.options.labels.filterDialogClearAllLabel,click:$.proxy(this._filterDialogClearAll,this),css:{buttonClasses:this.css.filterDialogClearAllButton,buttonHoverClasses:"",buttonActiveClasses:"",buttonFocusClasses:"",buttonLabelClass:""}});$("<label></label>").appendTo(dialogContent).attr("id",dialog.attr("id")+"_error").hide().text(this.options.labels.filterDialogErrorLabel).addClass("ui-widget ui-state-error ui-igvalidator-label");$("<table><tbody></tbody></table>").appendTo(dialogContent).addClass(this.css.filterDialogFiltersTable);okCancelContainer=$("<div></div>").appendTo($("<div></div>").appendTo(dialog).addClass(this.css.filterDialogOkCancelButton)).addClass("ui-dialog-buttonset");$('<button id="'+this.grid.element[0].id+'_filter_dialog_ok_button"/>').appendTo(okCancelContainer).igButton({labelText:this.options.labels.filterDialogOkLabel,width:this.options.filterDialogOkCancelButtonWidth}).bind({click:$.proxy(this._searchFilterDialog,this)});$('<button id="'+this.grid.element[0].id+'_filter_dialog_cancel_button"/>').appendTo(okCancelContainer).igButton({labelText:this.options.labels.filterDialogCancelLabel,width:this.options.filterDialogOkCancelButtonWidth}).bind({mousedown:$.proxy(this._closeFilterDialog,this)});if(this._hc===true){limit=$("#"+this.grid.element[0].id.split("_")[0]+"_container")}else{limit=this.grid.container()}dialog.bind({keydown:function(e){if(e.keyCode===$.ui.keyCode.ESCAPE){f._closeFilterDialog()}}}).draggable({containment:limit,handle:caption,drag:$.proxy(this._filterDialogMove,this)}).attr("role","dialog").attr("tabIndex",-1);if(typeof Modernizr!=="object"||Modernizr.touch===false){dialog.resizable({minHeight:dialog.outerHeight()/4,minWidth:dialog.outerWidth()/2,containment:"parent",resize:$.proxy(this._resizeHandler,this)})}this._trigger(this.events.filterDialogContentsRendered,null,{dialogElement:dialog,owner:this})}},_setResizableEnv:function(){var e=$("#"+this.grid.container().attr("id")+"_dialog"),rCont=e.find(">.ui-dialog-content"),hCont=e.find(">.ui-dialog-titlebar"),bCont=e.find(">.ui-dialog-buttonpane"),pad=rCont.outerHeight()-rCont.height();this._resizeCont=rCont;this._heightDifference=hCont.outerHeight(true)+bCont.outerHeight(true)+pad},_resizeHandler:function(event,ui){var u=ui.originalElement;this._resizeCont.css({height:u.height()-this._heightDifference+"px"})},_changeFilterCondition:function(e){var requiresEntry,editor,condition,editorObject;condition=e.target.value;editor=$(e.target).closest("td").parent().find("td:nth-child(3)").find("input");requiresEntry=this._requiresEntry(condition);if(!requiresEntry){editor.igEditor("option","disabled",true);editorObject=editor.data("igEditor");this._editorValueForCondition(condition,editorObject)}else{editor.igEditor("option","disabled",false)}},_addFilterFromDialog:function(e,expression){var tableBody=$("#"+this.grid.container().attr("id")+"_dialog table tbody"),j,cs=this.options.columnSettings,filterObj={},filterRow,colKeys,i,o,noCancel=true,field,type,cnd,allowed,defaultValue,condition,col;noCancel=this._trigger(this.events.filterDialogFilterAdding,null,{filtersTableBody:tableBody,owner:this});if(noCancel){if(tableBody.children().length>=this.options.filterDialogMaxFilterCount){$("#"+this.grid.container().attr("id")+"_dialog_error").show();return}filterRow=$($.ig.tmpl(this.options.filterDialogFilterTemplate,filterObj)).appendTo(tableBody).hide();colKeys=[];for(i=0;i<this.grid.options.columns.length;i++){allowed=true;for(j=0;j<cs.length;j++){if((this.grid.options.columns[i].key===cs[j].columnKey||i===cs[j].columnIndex)&&cs[j].allowFiltering===false){allowed=false;break}}if(allowed){colKeys.push(this.grid.options.columns[i].headerText)}}if(expression===undefined){field=this.grid.columnByKey(this._dialogCurrentColumn).headerText;type=this._dialogCurrentType;col=this.grid.columnByKey(field)}else{col=this.grid.columnByKey(expression.fieldName);if(col!==null){field=col.headerText;type=col.dataType}condition=expression.cond;defaultValue=expression.expr;if(type==="date"&&$.type(defaultValue)==="number"&&this.grid.options.enableUTCDates){defaultValue=new Date(defaultValue)}}o={listItems:colKeys,button:"dropdown",listAutoComplete:true,listMatchOnly:true,width:this.options.filterDialogColumnDropDownDefaultWidth||120,textChanged:$.proxy(this._polulateFilterConditionDropDown,this),value:field,enableUTCDates:this.grid.options.enableUTCDates};filterRow.find("td:first").find("input").css("width",80).igEditor(o);cnd=filterRow.find("td:nth-child(2)").children().first();this._populateConditionsList(cnd,field,type);if(condition!==undefined&&cnd.length>0){cnd[0].value=condition}cnd.bind("change",$.proxy(this._changeFilterCondition,this));filterRow.find("td:nth-child(2)").children().first().css("width",this.options.filterDialogFilterDropDownDefaultWidth);filterRow.show();this._populateFilterDialogInput(filterRow.find("td:nth-child(3)").children().first(),type,defaultValue,col);filterRow.find("td:last").children().first().addClass(this.css.filterDialogFilterRemoveButton).bind({mousedown:$.proxy(this._removeFilterFromDialog,this)});this._trigger(this.events.filterDialogFilterAdded,null,{filter:filterRow,owner:this})}},_filterDialogClearAll:function(e){var tableBody=$("#"+this.grid.container().attr("id")+"_dialog table tbody");tableBody.empty();$("#"+this.grid.container().attr("id")+"_dialog_error").hide()},_polulateFilterConditionDropDown:function(e){var selectedColKey=e.target.value,conditionList,cols=this.grid.options.columns,type,expr,i,col;conditionList=$(e.target).closest("tr").find("td:nth-child(2)").children().first();expr=$(e.target).closest("tr").find("td:nth-child(3)").children().first();for(i=0;i<cols.length;i++){if(cols[i].headerText===selectedColKey){type=cols[i].dataType;col=cols[i];break}}if(type===undefined){return}this._populateConditionsList(conditionList,selectedColKey,type);this._populateFilterDialogInput(expr,type,undefined,col)},_populateFilterDialogInput:function(input,type,defaultValue,col){var options={type:this._getEditorType(type),buttonHidden:type!=="date",button:"dropdown",disabled:type==="bool",maxDecimals:12,textAlign:type==="number"?"right":"left",width:this.options.filterDialogExprInputDefaultWidth,value:defaultValue,enableUTCDates:this.grid.options.enableUTCDates};if(type==="date"&&col&&col.format){options.dateInputFormat=col.format}if(!input.is("input")){input=input.find("INPUT")}input.igEditor(options)},_populateConditionsList:function(conditionList,selectedColKey,type){var conditions=[];if(type==="number"){conditions.push({conditionName:"equals",conditionLabel:this.options.labels.equals});conditions.push({conditionName:"doesNotEqual",conditionLabel:this.options.labels.doesNotEqual});conditions.push({conditionName:"greaterThan",conditionLabel:this.options.labels.greaterThan});conditions.push({conditionName:"lessThan",conditionLabel:this.options.labels.lessThan});conditions.push({conditionName:"greaterThanOrEqualTo",conditionLabel:this.options.labels.greaterThanOrEqualTo});conditions.push({conditionName:"lessThanOrEqualTo",conditionLabel:this.options.labels.lessThanOrEqualTo})}else if(type==="bool"||type==="boolean"){conditions.push({conditionName:"true",conditionLabel:this.options.labels.trueLabel});conditions.push({conditionName:"false",conditionLabel:this.options.labels.falseLabel})}else if(type==="date"){conditions.push({conditionName:"on",conditionLabel:this.options.labels.on});conditions.push({conditionName:"notOn",conditionLabel:this.options.labels.notOn});conditions.push({conditionName:"after",conditionLabel:this.options.labels.after});conditions.push({conditionName:"before",conditionLabel:this.options.labels.before});conditions.push({conditionName:"today",conditionLabel:this.options.labels.today});conditions.push({conditionName:"yesterday",conditionLabel:this.options.labels.yesterday});conditions.push({conditionName:"thisMonth",conditionLabel:this.options.labels.thisMonth});conditions.push({conditionName:"lastMonth",conditionLabel:this.options.labels.lastMonth});conditions.push({conditionName:"nextMonth",conditionLabel:this.options.labels.nextMonth});conditions.push({conditionName:"thisYear",conditionLabel:this.options.labels.thisYear});conditions.push({conditionName:"lastYear",conditionLabel:this.options.labels.lastYear});conditions.push({conditionName:"nextYear",conditionLabel:this.options.labels.nextYear})}else{conditions.push({conditionName:"startsWith",conditionLabel:this.options.labels.startsWith});conditions.push({conditionName:"endsWith",conditionLabel:this.options.labels.endsWith});conditions.push({conditionName:"contains",conditionLabel:this.options.labels.contains});conditions.push({conditionName:"doesNotContain",conditionLabel:this.options.labels.doesNotContain});conditions.push({conditionName:"equals",conditionLabel:this.options.labels.equals});conditions.push({conditionName:"doesNotEqual",conditionLabel:this.options.labels.doesNotEqual})}if(this.options.showEmptyConditions){conditions.push({conditionName:"empty",conditionLabel:this.options.labels.empty});conditions.push({conditionName:"notEmpty",conditionLabel:this.options.labels.notEmpty})}if(this.options.showNullConditions){conditions.push({conditionName:"null",conditionLabel:this.options.labels.nullLabel});conditions.push({conditionName:"notNull",conditionLabel:this.options.labels.notNull})}conditionList.empty();$($.ig.tmpl(this.options.filterDialogFilterConditionTemplate,conditions)).appendTo(conditionList);if($.ig.util.isIE){conditionList.parent().append(conditionList);conditionList.width(conditionList.width())}},_removeFilterFromDialog:function(e){var tableBody=$("#"+this.grid.container().attr("id")+"_dialog table tbody");$(e.target).closest("tr").remove();if(tableBody.children().length<this.options.filterDialogMaxFilterCount){$("#"+this.grid.container().attr("id")+"_dialog_error").hide()}},_renderStringFilterDropDown:function(id,colName){var ul=this._renderDropDownElement(id,colName),obj;if(this.options.filterDropDownItemIcons!==true){$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).addClass(this.css.filterDropDownListItemClear)).text(this.options.labels.clear).addClass("ui-corner-all");
$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","startsWith")).text(this.options.labels.startsWith).addClass("ui-corner-all");$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","endsWith")).text(this.options.labels.endsWith).addClass("ui-corner-all");$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","contains")).text(this.options.labels.contains).addClass("ui-corner-all");$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","doesNotContain")).text(this.options.labels.doesNotContain).addClass("ui-corner-all");$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","equals")).text(this.options.labels.equals).addClass("ui-corner-all");$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","doesNotEqual")).text(this.options.labels.doesNotEqual).addClass("ui-corner-all")}else{obj={itemClass:this.css.filterDropDownListItemWithIcons,imgContainerClass:this.css.filterItemIconContainer,imgClass:this.css.filterItemIconClear,textClass:this.css.filterDropDownListItemTextContainer,text:this.options.labels.clear};$($.ig.tmpl(this._ft,obj)).appendTo(ul);obj.text=this.options.labels.startsWith;obj.imgClass=this.css.filterItemIconStartsWith;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","startsWith");obj.text=this.options.labels.endsWith;obj.imgClass=this.css.filterItemIconEndsWith;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","endsWith");obj.text=this.options.labels.contains;obj.imgClass=this.css.filterItemIconContains;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","contains");obj.text=this.options.labels.doesNotContain;obj.imgClass=this.css.filterItemIconDoesNotContain;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","doesNotContain");obj.text=this.options.labels.equals;obj.imgClass=this.css.filterItemIconEquals;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","equals");obj.text=this.options.labels.doesNotEqual;obj.imgClass=this.css.filterItemIconDoesNotEqual;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","doesNotEqual")}return ul},_renderNumericFilterDropDown:function(id,colName){var ul=this._renderDropDownElement(id,colName),obj;if(this.options.filterDropDownItemIcons!==true){$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).addClass(this.css.filterDropDownListItemClear)).text(this.options.labels.clear);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","equals")).text(this.options.labels.equals);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","doesNotEqual")).text(this.options.labels.doesNotEqual);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","greaterThan")).text(this.options.labels.greaterThan);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","lessThan")).text(this.options.labels.lessThan);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","greaterThanOrEqualTo")).text(this.options.labels.greaterThanOrEqualTo);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","lessThanOrEqualTo")).text(this.options.labels.lessThanOrEqualTo)}else{obj={itemClass:this.css.filterDropDownListItemWithIcons,imgContainerClass:this.css.filterItemIconContainer,imgClass:this.css.filterItemIconClear,textClass:this.css.filterDropDownListItemTextContainer,text:this.options.labels.clear};$($.ig.tmpl(this._ft,obj)).appendTo(ul);obj.text=this.options.labels.equals;obj.imgClass=this.css.filterItemIconEquals;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","equals");obj.text=this.options.labels.doesNotEqual;obj.imgClass=this.css.filterItemIconDoesNotEqual;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","doesNotEqual");obj.text=this.options.labels.greaterThan;obj.imgClass=this.css.filterItemIconGreaterThan;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","greaterThan");obj.text=this.options.labels.lessThan;obj.imgClass=this.css.filterItemIconLessThan;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","lessThan");obj.text=this.options.labels.greaterThanOrEqualTo;obj.imgClass=this.css.filterItemIconGreaterThanOrEqualTo;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","greaterThanOrEqualTo");obj.text=this.options.labels.lessThanOrEqualTo;obj.imgClass=this.css.filterItemIconLessThanOrEqualTo;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","lessThanOrEqualTo")}return ul},_renderDateFilterDropDown:function(id,colName){var ul=this._renderDropDownElement(id,colName),obj;if(this.options.filterDropDownItemIcons!==true){$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).addClass(this.css.filterDropDownListItemClear)).text(this.options.labels.clear);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","on")).text(this.options.labels.on);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","notOn")).text(this.options.labels.notOn);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","after")).text(this.options.labels.after);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","before")).text(this.options.labels.before);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","today")).text(this.options.labels.today);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","yesterday")).text(this.options.labels.yesterday);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","thisMonth")).text(this.options.labels.thisMonth);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","lastMonth")).text(this.options.labels.lastMonth);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","nextMonth")).text(this.options.labels.nextMonth);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","thisYear")).text(this.options.labels.thisYear);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","lastYear")).text(this.options.labels.lastYear);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","nextYear")).text(this.options.labels.nextYear)}else{obj={itemClass:this.css.filterDropDownListItemWithIcons,imgContainerClass:this.css.filterItemIconContainer,imgClass:this.css.filterItemIconClear,textClass:this.css.filterDropDownListItemTextContainer,text:this.options.labels.clear};$($.ig.tmpl(this._ft,obj)).appendTo(ul);obj.text=this.options.labels.on;obj.imgClass=this.css.filterItemIconOn;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","on");obj.text=this.options.labels.notOn;obj.imgClass=this.css.filterItemIconNotOn;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","notOn");obj.text=this.options.labels.after;obj.imgClass=this.css.filterItemIconAfter;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","after");obj.text=this.options.labels.before;obj.imgClass=this.css.filterItemIconBefore;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","before");obj.text=this.options.labels.today;obj.imgClass=this.css.filterItemIconToday;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","today");obj.text=this.options.labels.yesterday;obj.imgClass=this.css.filterItemIconYesterday;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","yesterday");obj.text=this.options.labels.thisMonth;obj.imgClass=this.css.filterItemIconThisMonth;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","thisMonth");obj.text=this.options.labels.lastMonth;obj.imgClass=this.css.filterItemIconLastMonth;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","lastMonth");obj.text=this.options.labels.nextMonth;obj.imgClass=this.css.filterItemIconNextMonth;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","nextMonth");obj.text=this.options.labels.thisYear;obj.imgClass=this.css.filterItemIconThisYear;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","thisYear");obj.text=this.options.labels.lastYear;obj.imgClass=this.css.filterItemIconLastYear;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","lastYear");obj.text=this.options.labels.nextYear;obj.imgClass=this.css.filterItemIconNextYear;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","nextYear")}return ul},_renderBooleanFilterDropDown:function(id,colName){var ul=this._renderDropDownElement(id,colName),obj;if(this.options.filterDropDownItemIcons!==true){$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).addClass(this.css.filterDropDownListItemClear)).text(this.options.labels.clear);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","true")).text(this.options.labels.trueLabel);$("<a></a>").appendTo($("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItem).data("cond","false")).text(this.options.labels.falseLabel)}else{obj={itemClass:this.css.filterDropDownListItemWithIcons,imgContainerClass:this.css.filterItemIconContainer,imgClass:this.css.filterItemIconClear,textClass:this.css.filterDropDownListItemTextContainer,text:this.options.labels.clear};$($.ig.tmpl(this._ft,obj)).appendTo(ul);obj.text=this.options.labels.trueLabel;obj.imgClass=this.css.filterItemIconTrue;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","true");obj.text=this.options.labels.falseLabel;obj.imgClass=this.css.filterItemIconFalse;$($.ig.tmpl(this._ft,obj)).appendTo(ul).data("cond","false")}return ul},_renderDropDownElement:function(id,colName){var ul,container;ul=$("<ul></ul>").appendTo("body").addClass(this.css.filterDropDownList);container=$("<div></div>").appendTo("body").attr("id",id).addClass(this.css.filterDropDown).css("overflow","hidden").css("position","absolute").hide();if(!$.ig.util.isIE){container.css("overflow-y","auto")}container.remove();if(this.options.filterDropDownWidth>0){ul.css("width",this.options.filterDropDownWidth)}if(this.options.filterDropDownHeight>0){container.css("height",this.options.filterDropDownHeight)}ul.data("colName",colName);ul.wrap(container);ul.parent().data("efh","1");$("#"+id).delegate("li",{mousedown:$.proxy(this._selectDropDownItem,this),mouseover:$.proxy(this._hoverDropDownItem,this),mouseout:$.proxy(this._unhoverDropDownItem,this)});return ul},_hoverButton:function(event){var $target=$(event.currentTarget).find("span");if(this.options.mode==="advanced"){$target.addClass(this.css.filterButtonAdvancedHover)}else{$target.addClass(this.css.filterButtonHover)}},_unhoverButton:function(event){var $target=$(event.currentTarget).find("span");if(this.options.mode==="advanced"){$target.removeClass(this.css.filterButtonAdvancedHover)}else{$target.removeClass(this.css.filterButtonHover)}},_activateButton:function(event){var $target=$(event.currentTarget).find("span");if(this._dontApplyStyles){this._dontApplyStyles=false;return}if(this.options.mode==="advanced"){$target.addClass(this.css.filterButtonAdvancedActive)}else{$target.addClass(this.css.filterButtonActive)}},_deactivateButton:function(event){var target=$(event.target).find("span");target.removeClass(this.css.filterButtonAdvancedActive);target.removeClass(this.css.filterButtonActive)},_toggleDropDown:function(event,close,dontFocus){var $target=$(event.currentTarget),id=$target.attr("id"),dd,left,top,noCancel=true,button=$target.find("span"),maxZ,block=$("#"+this.grid.container().attr("id")+"_block"),dialog=$("#"+this.grid.container().attr("id")+"_dialog");if(this._animating&&id===this._animatingId){return}maxZ=$.ig.getMaxZIndex(this.grid.container().attr("id")+"_dialog");block.css("zIndex",maxZ+1);dialog.css("zIndex",maxZ+2);dd=$("#"+id.substring(0,id.indexOf("_button")));dd.css("zIndex",maxZ+3);if(!(!dd.is(":visible")&&close===true)){this._animating=true;this._animatingId=id}if(this._openingAnimation!==true){this._dontFocus=dontFocus}else{this._dontFocus=null}this._isClosing=false;if(dd.is(":visible")){noCancel=this._trigger(this.events.dropDownClosing,null,{dropDown:dd,owner:this});this._isClosing=true}else{if(!close){noCancel=this._trigger(this.events.dropDownOpening,null,{dropDown:dd,owner:this})}}if(noCancel){left=$.ig.util.offset(button).left;top=$.ig.util.offset(button).top+button.outerHeight();if(dd.offset().left!==left&&dd.offset().top!==top){dd.css("left",left).css("top",top)}this._currentTarget=$target;this._dd=dd;if(!this._isClosing){this._opendd=dd}if($.ig.util.isIE){dd.css("overflow-x","hidden");dd.css("overflow-y","hidden")}if(close!==undefined&&close===true){if(dd.is(":visible")){if(this.options.filterDropDownAnimations!=="none"){dd.hide(this.options.filterDropDownAnimationDuration,$.proxy(this._animationEnd,this))}else{dd.hide();this._trigger(this.events.dropDownClosed,null,{dropDown:dd,owner:this})}}}else{if(this.options.filterDropDownAnimations!=="none"){if(dd.is(":visible")){this._closingTarget=this._currentTarget}else{this._openingTarget=this._currentTarget;this._openingAnimation=true}dd.toggle(this.options.filterDropDownAnimationDuration,$.proxy(this._animationEnd,this))}else{dd.toggle();if(this._isClosing){this._trigger(this.events.dropDownClosed,null,{dropDown:dd,owner:this})}else{this._trigger(this.events.dropDownOpened,null,{dropDown:dd,owner:this})}if(dontFocus!==true){this._dontApplyStyles=true;$target.focus()}}}}},_animationEnd:function(){if(this._isClosing===true){this._trigger(this.events.dropDownClosed,null,{dropDown:this._dd,owner:this})}else{this._trigger(this.events.dropDownOpened,null,{dropDown:this._opendd,owner:this});this._openingAnimation=false}if(this._dd&&$.ig.util.isIE){this._dd.css("overflow-y","auto")}this._isClosing=null;if(this._dontFocus!==true){this._dontApplyStyles=true;this._openingTarget.focus()}this._animating=false},_toggleDropDownKeyboard:function(event){var parent,selectedItem,$target=$(event.target),ddVisible;if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){event.stopPropagation();event.preventDefault();parent=$("#"+$target.attr("id").substring(0,$target.attr("id").indexOf("_button"))).find("ul");if(parent.data("selectedItem")){selectedItem=parent.find("li:nth-child("+(parent.data("selectedItem")+1)+")");ddVisible=$("#"+$target.attr("id").substring(0,$target.attr("id").indexOf("_button"))).is(":visible");if($(selectedItem).hasClass("ui-iggrid-filterddlistitemadvanced")&&ddVisible){this._openFilterDialog(event)}}this._toggleDropDown(event)}else if(event.keyCode===$.ui.keyCode.DOWN){event.stopPropagation();event.preventDefault();this._selectDropDownItem(event,"next")}else if(event.keyCode===$.ui.keyCode.UP){event.stopPropagation();event.preventDefault();this._selectDropDownItem(event,"prev")}},_closeDropDown:function(event){var $target=$(event.currentTarget).find("span"),$targetButton=$(event.currentTarget),dd;if(this._openingTarget&&event.target.id===this._openingTarget.attr("id")&&this._openingAnimation===true){return}dd=$("#"+$targetButton.attr("id").substring(0,$targetButton.attr("id").indexOf("_button")));if(dd&&!dd.is(":visible")){$target.removeClass(this.css.filterButtonActive);return}this._toggleDropDown(event,true,true);if(this._dontApplyStyles){this._dontApplyStyles=false;return}if(this.options.mode==="advanced"){$target.removeClass(this.css.filterButtonAdvancedActive)}else{$target.removeClass(this.css.filterButtonActive)}},_selectDropDownItem:function(event,nav,expr){var $target=$(event.currentTarget),filterCondition,colIndex,sel,parent,button,requiresEntry,currentCond;if($target.find("input").length>0&&this.options.mode==="advanced"){return}if(nav==="next"||nav==="prev"){parent=$("#"+$target.attr("id").substring(0,$target.attr("id").indexOf("_button"))).find("ul")}if(nav==="next"){if(parent.data("selectedItem")===undefined){$target=parent.find("li:first")}else{$target=parent.find("li:nth-child("+(parent.data("selectedItem")+1)+")");if($target.next().length===0){$target=parent.find("li:first")}else{$target=$target.next()}}}if(nav==="prev"){if(parent.data("selectedItem")===undefined){$target=parent.find("li:last")}else{$target=parent.find("li:nth-child("+(parent.data("selectedItem")+1)+")");if($target.prev().length===0){$target=parent.find("li:last")}else{$target=$target.prev()}}}filterCondition=$target.data("cond");button=$("#"+$target.closest("div").attr("id")+"_button");if($target.data("cond")===undefined){button.attr("title",this.options.tooltipTemplate.replace("${condition}",this.options.labels.noFilter))}else{button.attr("title",this.options.tooltipTemplate.replace("${condition}",$target.text()))}colIndex=$("#"+$target.closest("div").attr("id")+"_button").find("span").data("colIndex");if(!colIndex&&expr){$.each(this.options.columnSettings,function(index,col){if(col.columnKey===expr.fieldName){colIndex=index;return false}})}currentCond=this.options.columnSettings[parseInt(colIndex,10)].condition;if(filterCondition!==undefined){this.options.columnSettings[parseInt(colIndex,10)].condition=filterCondition}else if(currentCond==="empty"||currentCond==="notEmpty"||currentCond==="null"||currentCond==="notNull"||!this._requiresEntry(currentCond)){this.options.columnSettings[parseInt(colIndex,10)].condition=this._getDefaultCondition(this.grid.options.columns[colIndex].dataType);if(currentCond==="null"||this.grid.options.columns[colIndex].dataType==="date"){this._editors[colIndex].element.igEditor("option","nullText",this.options.nullTexts[this._getDefaultCondition(this.grid.options.columns[colIndex].dataType)])}}sel=$target.parent().data("selectedItem");if(sel!==undefined){$target.parent().find("li:nth-child("+(sel+1)+")").removeClass(this.css.filterDropDownListItemActive)}$target.addClass(this.css.filterDropDownListItemActive);$target.parent().data("selectedItem",$("li",$target.parent()).index($target));this._editors[colIndex].element.igEditor("option","nullText",this.options.nullTexts[filterCondition]);requiresEntry=this._requiresEntry(filterCondition);if($target.hasClass("ui-iggrid-filterddlistitemclear")||this.options.filterDropDownItemIcons===true&&$target.find(".ui-iggrid-filtericonclear").length>0){if(!requiresEntry||filterCondition===undefined){this._editors[colIndex].element.igEditor("option","disabled",this.grid.options.columns[colIndex].dataType==="bool")}this._editors[colIndex].value(null);this._filterDataSourceClear(this.grid.options.columns[colIndex].key,colIndex)}else{if(!requiresEntry&&!expr){this._editors[colIndex].element.igEditor("option","disabled",true);this._editorValueForCondition(filterCondition,this._editors[colIndex]);this._args=undefined;this._filterInternal(colIndex,this.grid.options.columns[colIndex].key)}else if(this._editors[colIndex].value()!==""&&this._editors[colIndex].value()!==null){this._editors[colIndex].value(null)}if(requiresEntry){this._editors[colIndex].element.igEditor("option","disabled",false)}if(nav===undefined&&filterCondition!==undefined){this._editors[colIndex].setFocus()}}},_requiresEntry:function(filterCondition){if(filterCondition==="true"||filterCondition==="false"||filterCondition==="today"||filterCondition==="yesterday"||filterCondition==="thisMonth"||filterCondition==="nextMonth"||filterCondition==="lastMonth"||filterCondition==="thisYear"||filterCondition==="lastYear"||filterCondition==="empty"||filterCondition==="notEmpty"||filterCondition==="null"||filterCondition==="notNull"||filterCondition==="nextYear"){return false}if(filterCondition===undefined||filterCondition===null){return false}return true},_editorValueForCondition:function(filterCondition,editor){var date=new Date;if(filterCondition==="true"){editor.value(true)}else if(filterCondition==="false"){editor.value(false)}else if(filterCondition==="today"){editor.value(new Date)}else if(filterCondition==="yesterday"){if(this.grid.options.enableUTCDates){editor.value(new Date(Date.UTC(date.getFullYear(),date.getMonth(),date.getDate()-1,0,0,0,0)))}else{editor.value(new Date(date.getFullYear(),date.getMonth(),date.getDate()-1,0,0,0,0))}}else{editor.value(null)}},_hoverDropDownItem:function(event){if($(event.currentTarget).find("input").length===0){$(event.currentTarget).addClass(this.css.filterDropDownListItemHover)}},_unhoverDropDownItem:function(event){$(event.currentTarget).removeClass(this.css.filterDropDownListItemHover)},_virtualHorizontalScroll:function(event,args){var start=args.startColIndex,i,headers=this.grid.headersTable().find("th"),columnKey;if(this._currentTarget){this._toggleDropDown({currentTarget:this._currentTarget},true)}if(this.options.mode==="advanced"&&this.options.advancedModeEditorsVisible!==true){for(i=0;i<this.grid._virtualColumnCount;i++){columnKey=this.grid.options.columns[i+start].key;$(headers[i]).data("colName",columnKey);if(this._fcData[columnKey]===true){continue}$(headers[i]).find("a").attr("id",this.grid.element[0].id+"_dd_"+columnKey+"_button")}this._updateTooltips(this._currentAdvancedExpressions||[])}else{throw new Error($.ig.GridFiltering.locale.virtualizationSimpleFilteringNotAllowed)}},_columnFixed:function(args){var i,colInd=args.colInd,cs,editor;cs=this.options.columnSettings[colInd];if(cs){this.options.columnSettings.splice(colInd,1);this.options.columnSettings.splice(this.grid._fixedColumns.length-1,0,cs)}editor=this._editors[colInd];if(editor){this._editors.splice(colInd,1);this._editors.splice(this.grid._fixedColumns.length-1,0,editor);for(i=0;i<this._editors.length;i++){$(this._editors[i].element).data("colIndex",i);$(this._editors[i].element).closest("td").find("span.ui-iggrid-filterbutton").data("colIndex",i)}}},_headerInit:function(owner,args){var filterrow;if(this.options.mode!=="simple"&&this.options.advancedModeEditorsVisible!==true||this.grid.element.attr("id")!==args.owner.element.attr("id")){return}filterrow=this.grid.container().find("thead").find("[data-role=filterrow]");filterrow.find("[data-skip=true]").remove();this.grid._headerInit(filterrow,null,true)},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;if(this.options.type===null){this.options.type=this.grid._inferOpType()}if(this.options.type){this.grid.dataSource.settings.filtering.type=this.options.type}else{this.grid.dataSource.settings.filtering.type="remote"}if(this.options.filterExprUrlKey){this.grid.dataSource.settings.filtering.filterExprUrlKey=this.options.filterExprUrlKey}this.grid.dataSource.settings.filtering.caseSensitive=this.options.caseSensitive;if(this._headerCellRenderedHandler!==null&&this._headerCellRenderedHandler!==undefined){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);if(this._headerRenderedHandler!==null&&this._headerRenderedHandler!==undefined){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}this._headerRenderedHandler=$.proxy(this._headerRendered,this);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);if(this._columnResizedHandler!==null&&this._columnResizedHandler!==undefined){this.grid.element.unbind("iggridresizingcolumnresized",this._columnResizedHandler)}this._columnResizedHandler=$.proxy(this._columnResized,this);this.grid.element.bind("iggridresizingcolumnresized",this._columnResizedHandler);if(this._columnsAlteredHandler!==null&&this._columnsAlteredHandler!==undefined){this.grid.element.unbind("iggrid_columnsmoved",this._columnsAlteredHandler)}this._columnsAlteredHandler=$.proxy(this._columnsAltered,this);this.grid.element.bind("iggrid_columnsmoved",this._columnsAlteredHandler);this._initDefaultSettings();if(this._onUIDirtyHandler!==null&&this._onUIDirtyHandler!==undefined){this.grid.element.unbind("iggriduidirty",this._onUIDirtyHandler)}this._onUIDirtyHandler=$.proxy(this._onUIDirty,this);this.grid.element.bind("iggriduidirty",this._onUIDirtyHandler);if(this._virtualHorizontalScrollHandler!==null&&this._virtualHorizontalScrollHandler!==undefined){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}this._virtualHorizontalScrollHandler=$.proxy(this._virtualHorizontalScroll,this);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);if((this.grid.options.virtualization===true&&this.grid.options.width!==null||this.grid.options.columnVirtualization===true)&&this.options.mode===null){this.options.mode="advanced"}else if((this.grid.options.virtualization===false||this.grid.options.virtualization===true&&this.grid.options.width===null)&&this.grid.options.columnVirtualization===false&&this.options.mode===null){this.options.mode="simple"}else if(this.options.mode==="simple"&&(this.grid.options.virtualization===true||this.grid.options.columnVirtualization===true)){throw new Error($.ig.GridFiltering.locale.virtualizationSimpleFilteringNotAllowed)}if(this._headerInitHandler!==null&&this._headerInitHandler!==undefined){this.grid.element.unbind("iggridheaderextracellsmodified",this._headerInitHandler)}this._headerInitHandler=$.proxy(this._headerInit,this);this.grid.element.bind("iggridheaderextracellsmodified",this._headerInitHandler);if(this.grid.element.igGridFeatureChooser!==undefined){this.grid.element.igGridFeatureChooser()}else{throw new Error($.ig.GridFiltering.locale.featureChooserNotReferenced)}}});$.extend($.ui.igGridFiltering,{version:"13.1.20131.2523"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Outlook GroupBy feature 13.1.20131.2523
*
* Copyright (c) 2011-2014 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
*	jquery-1.4.4.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	infragistics.ui.grid.framework.js
*	modernizr.js
*/
(function($){$.widget("ui.igGridGroupBy",{css:{dragMarkup:"ui-iggrid-dragMarkup",groupByArea:"ui-iggrid-groupbyarea",groupByAreaText:"ui-iggrid-groupbyareatext",groupedRow:"ui-iggrid-groupedrow",expandHeaderCellGroupBy:"ui-iggrid-header ui-widget-header",groupByExpandCellExpanded:"ui-icon ui-iggrid-expandbutton ui-iggrid-expandbuttonexpanded ui-icon-minus",groupByExpandCellCollapsed:"ui-icon ui-iggrid-expandbutton ui-icon-plus",groupByAreaDropHover:"ui-iggrid-groupbyareahover",groupByExpandColumn:"ui-iggrid-expandcolumn",nonGroupRowEmptyCell:"ui-iggrid-nongrouprowemptycell",groupedColumnLabel:"ui-iggrid-groupedcolumnlabel ui-state-default",groupedColumnLabelText:"ui-iggrid-groupedcolumnlabeltext",groupByRemoveButton:"ui-icon ui-icon-circle-close ui-iggrid-groupbyremovebutton",groupedColumnLabelRightEdgeEnd:"ui-iggrid-groupbylabelrightedgeend",groupedColumnLabelRightEdge:"ui-iggrid-groupbylabelrightedge",groupedColumnLayoutLabel:"ui-iggrid-groupbylayoutlabel",headerExtraCell:"ui-iggrid-expandheadercellgb",footerExtraCell:"ui-widget-content ui-iggrid-footerextracell",featureChooserIconClass:"ui-icon ui-iggrid-icon-groupby",dialogGroupedColumns:"ui-iggrid-groupby-dialog-groupedcolumns",dialogUnroupedColumns:"ui-iggrid-groupby-dialog-ungroupedcolumns",dialogGroupedItem:"ui-widget-content",dialogUngroupedItem:"ui-widget-content",dialogUngroupedColumnsGroupByButton:"ui-iggrid-dialog-groupby-button",dialogUngroupedColumnsText:"ui-iggrid-dialog-text",dialogButtonAsc:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",dialogButtonAscIcon:"ui-button-icon-primary ui-icon ui-icon-arrowthick-1-n",dialogButtonDesc:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",dialogButtonDescIcon:"ui-button-icon-primary ui-icon ui-icon-arrowthick-1-s",dialogButtonUngroup:"ui-iggrid-dialog-groupedbuttons ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-igbutton ui-widget-content ui-igbutton-remove",dialogButtonUngroupContainer:"ui-button-icon-primary ui-icon ui-icon-circle-close",dialogGroupedColumnTextContainer:"ui-iggrid-dialog-text",dialogListGroupedColumns:"ui-iggrid-dialog-list-groupedcolumns",dialogListUngroupedColumns:"ui-iggrid-dialog-list-ungroupedcolumns",dialogLayoutsDDButton:"ui-icon ui-icon-triangle-1-s ui-iggrid-dialog-layouts-dd-button",dropDownLayoutsContainer:"ui-iggrid-featurechooser-dropdown-dialog ui-widget ui-widget-content ui-corner-all",dialogLayoutsDDField:"ui-iggrid-dialog-layouts-dd-field",dialogLayoutsDD:"ui-iggrid-dialog-layouts-dd ui-widget-content ui-corner-all ig-combo-icon-container",modalDialogTreeContainer:"ui-iggrid-groupby-dialog-tree",modalDialogLayoutsContainer:"ui-iggrid-groupby-dialog-layoutscontainer",dialogButtonsHover:"ui-state-hover",groupByLastEmptyCell:"ui-iggrid-last-emptycell"},renderInFeatureChooser:false,options:{groupByAreaVisibility:"top",initialExpand:true,emptyGroupByAreaContent:$.ig.GridGroupBy.locale.emptyGroupByAreaContent,emptyGroupByAreaContentSelectColumns:$.ig.GridGroupBy.locale.emptyGroupByAreaContentSelectColumns,expansionIndicatorVisibility:true,groupByLabelWidth:null,labelDragHelperOpacity:.5,indentation:30,defaultSortingDirection:"asc",groupedColumns:[{key:null,dir:"asc",layout:null,col:null}],resultResponseKey:null,groupedRowTextTemplate:"${key}: ${val} (${count})",type:null,groupByUrlKey:null,groupByUrlKeyAscValue:null,groupByUrlKeyDescValue:null,summarySettings:{multiSummaryDelimiter:",",summaryFormat:"#.00"},columnSettings:[{allowGrouping:true,isGroupBy:false,groupComparerFunction:null,groupLabelFormatter:null,summaries:[{summaryFunction:"avg",text:null,customSummary:null}]}],expandTooltip:$.ig.GridGroupBy.locale.expandTooltip,collapseTooltip:$.ig.GridGroupBy.locale.collapseTooltip,removeButtonTooltip:$.ig.GridGroupBy.locale.removeButtonTooltip,featureChooserText:$.ig.GridGroupBy.locale.featureChooserText,featureChooserTextHide:$.ig.GridGroupBy.locale.featureChooserTextHide,modalDialogGroupByOnClick:false,modalDialogGroupByButtonText:$.ig.GridGroupBy.locale.modalDialogGroupByButtonText,modalDialogCaptionButtonDesc:$.ig.GridGroupBy.locale.modalDialogCaptionButtonDesc,modalDialogCaptionButtonAsc:$.ig.GridGroupBy.locale.modalDialogCaptionButtonAsc,modalDialogCaptionButtonUngroup:$.ig.GridGroupBy.locale.modalDialogCaptionButtonUngroup,modalDialogCaptionText:$.ig.GridGroupBy.locale.modalDialogCaptionText,modalDialogDropDownLabel:$.ig.GridGroupBy.locale.modalDialogDropDownLabel,modalDialogRootLevelHierarchicalGrid:$.ig.GridGroupBy.locale.modalDialogRootLevelHierarchicalGrid,modalDialogDropDownButtonCaption:$.ig.GridGroupBy.locale.modalDialogDropDownButtonCaption,modalDialogClearAllButtonLabel:$.ig.GridGroupBy.locale.modalDialogClearAllButtonLabel,emptyGroupByAreaContentSelectColumnsCaption:$.ig.GridGroupBy.locale.emptyGroupByAreaContentSelectColumnsCaption,modalDialogDropDownWidth:200,modalDialogDropDownAreaWidth:null,modalDialogAnimationDuration:200,modalDialogWidth:400,modalDialogHeight:"",modalDialogButtonApplyText:$.ig.GridGroupBy.locale.modalDialogButtonApplyText,modalDialogButtonCancelText:$.ig.GridGroupBy.locale.modalDialogButtonCancelText,useGridColumnFormatter:true,groupByDialogContainment:"owner"},events:{groupedColumnsChanging:"groupedColumnsChanging",groupedColumnsChanged:"groupedColumnsChanged",modalDialogMoving:"modalDialogMoving",modalDialogClosing:"modalDialogClosing",modalDialogClosed:"modalDialogClosed",modalDialogOpening:"modalDialogOpening",modalDialogOpened:"modalDialogOpened",modalDialogContentsRendering:"modalDialogContentsRendering",modalDialogContentsRendered:"modalDialogContentsRendered",modalDialogButtonApplyClick:"modalDialogButtonApplyClick",modalDialogButtonResetClick:"modalDialogButtonResetClick",modalDialogGroupingColumn:"modalDialogGroupingColumn",modalDialogGroupColumn:"modalDialogGroupColumn",modalDialogUngroupingColumn:"modalDialogUngroupingColumn",modalDialogUngroupColumn:"modalDialogUngroupColumn",modalDialogSortGroupedColumn:"modalDialogSortGroupedColumn"},_create:function(){this._orderedGroupedCols=[]},_createWidget:function(options,element){this.options.columnSettings=[];this.options.groupedColumns=[];this._tempSortingExpr=[];this._tempGroupedColumns=[];this._tempOrderedGroupedCols=[];this._tempOptions={};this._currentTreeLayer=null;this._isInitFC=false;this._modalSelectedLayout=null;$.Widget.prototype._createWidget.apply(this,arguments)},_setOption:function(key,value){var modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog");$.Widget.prototype._setOption.apply(this,arguments);if(key==="groupByAreaVisibility"||key==="expansionIndicatorVisibility"){throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+key)}switch(key){case"modalDialogGroupByOnClick":$("#"+this.grid.id()+"_groupby_modalDialog").remove();this._renderGroupByDialog();break;case"modalDialogCaptionText":modalDialog.igGridModalDialog("option","modalDialogCaptionText",value);break;case"modalDialogAnimationDuration":modalDialog.igGridModalDialog("option","animationDuration",value);break;case"modalDialogWidth":modalDialog.igGridModalDialog("option","modalDialogWidth",value);break;case"modalDialogHeight":modalDialog.igGridModalDialog("option","modalDialogHeight",value);break;case"modalDialogButtonApplyText":modalDialog.igGridModalDialog("option","buttonApplyText",value);break;case"modalDialogButtonCancelText":modalDialog.igGridModalDialog("option","buttonCancelText",value);break;default:break}},_headerRendered:function(event,args){var groupby=this,groupbyarea;if(args.owner.id()!==this.grid.id()){return}if(args.owner.element.attr("data-childgrid")){return}this._renderGroupByDialog();if(this.options.groupByAreaVisibility==="top"){groupbyarea=$("<div></div>").prependTo(this.grid.container())}else if(this.options.groupByAreaVisibility==="bottom"){groupbyarea=$("<div></div>").appendTo(args.owner.container())}else if(this.options.groupByAreaVisibility==="hidden"){return}groupbyarea.attr("id",this.grid.element.attr("id")+"_groupbyarea").addClass(this.css.groupByArea);this._setGroupAreaTextContent($("<span></span>").appendTo(groupbyarea).addClass(this.css.groupByAreaText));groupbyarea.droppable({accept:"th:not([groupby-disabled])",hoverClass:groupby.css.groupByAreaDropHover,drop:function(event,ui){var accepted,isdescendant;isdescendant=ui.draggable.closest(".ui-iggrid-root").attr("id")===groupby.grid.id()||ui.draggable.closest(".ui-iggrid").find(".ui-iggrid-root").length>0;if(!groupby.grid.element.hasClass("ui-iggrid-root")){isdescendant=true}accepted=ui.draggable.hasClass("ui-iggrid-header")&&isdescendant;if(accepted){groupby._groupBy(event,ui.draggable)}}});if(this.grid._isMultiColumnGrid){groupbyarea.droppable("option","tolerance","touch")}},_renderGroupByDialog:function(){var $buttonOK,containment,self=this,o=this.options,$captionButtonContainer,modalDialog=$("<div></div>").appendTo("body").attr("id",this.grid.id()+"_groupby_modalDialog");if(this.options.groupByDialogContainment==="owner"){containment=this.grid.container()}else{containment="window"}modalDialog.igGridModalDialog({renderFooterButtons:!o.modalDialogGroupByOnClick,modalDialogCaptionText:o.modalDialogCaptionText,modalDialogWidth:o.modalDialogWidth,modalDialogHeight:o.modalDialogHeight,animationDuration:o.modalDialogAnimationDuration,buttonApplyText:o.modalDialogButtonApplyText,buttonCancelText:o.modalDialogButtonCancelText,gridContainer:this.grid.container(),containment:containment,modalDialogOpening:function(event,args){self._groupByDialogOpening(event,args)},modalDialogMoving:function(e,ui){self._trigger(self.events.modalDialogMoving,null,{modalDialogElement:e.target,owner:self,originalPosition:ui.originalPosition,position:ui.position})},modalDialogClosing:function(event,args){return self._trigger(self.events.modalDialogClosing,null,{modalDialogElement:modalDialog,owner:self})},modalDialogClosed:function(event,args){self._trigger(self.events.modalDialogClosed,null,{modalDialogElement:modalDialog,owner:self})}});if(o.modalDialogGroupByOnClick){$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$("<span></span>").bind("click.hiding",function(event){modalDialog.igGridModalDialog("closeModalDialog",true);event.preventDefault();event.stopPropagation();return false}).addClass("ui-icon ui-icon-closethick").appendTo($("<a></a>").appendTo($captionButtonContainer).attr("title",$.ig.GridHiding.locale.columnChooserCloseButtonTooltip).attr("href","#").attr("role","button").addClass("ui-dialog-titlebar-close ui-corner-all"))}else{$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$buttonOK=$("#"+this.grid.id()+"_groupby_modalDialog_footer_buttonok");$buttonOK.bind("igbuttonclick",function(e){self._groupByDialogButtonOKClick(e)})}},openGroupByDialog:function(){var modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog");modalDialog.igGridModalDialog("openModalDialog")},closeGroupByDialog:function(){var modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog");modalDialog.igGridModalDialog("closeModalDialog")},_groupByDialogOpening:function(){var noCancel,modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog");noCancel=this._trigger(this.events.modalDialogOpening,null,{modalDialogElement:modalDialog,owner:this});if(noCancel){this.renderGroupByModalDialog();this._trigger(this.events.modalDialogOpened,null,{modalDialogElement:modalDialog,owner:this})}},renderGroupByModalDialog:function(){var $content,i,self=this,o=this.options,css=this.css,modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog"),noCancel,$groupedColumns,$ungroupedColumns;noCancel=this._trigger(this.events.modalDialogContentsRendering,null,{modalDialogElement:modalDialog,owner:this});if(noCancel){$content=modalDialog.igGridModalDialog("getContent");$content.empty();self._tempGroupedColumns=o.groupedColumns.slice(0);self._tempOrderedGroupedCols=self._orderedGroupedCols.slice(0);self._tempSortingExpr=self.grid.dataSource.settings.sorting.expressions.slice(0);self._tempOptions={columnLayouts:[]};if(this.grid.options.columnLayouts&&this.grid.options.columnLayouts.length>0){for(i=0;i<this.grid.options.columnLayouts.length;i++){self._tempOptions.columnLayouts.push($.extend(true,{},this.grid.options.columnLayouts[i]))}this._renderLayoutsDropDown()}$groupedColumns=$("<div></div>").attr("id",this.grid.id()+"_groupby_modalDialog_groupedcolumns").addClass(css.dialogGroupedColumns).appendTo($content);$ungroupedColumns=$("<div></div>").attr("id",this.grid.id()+"_groupby_modalDialog_ungroupedcolumns").addClass(css.dialogUnroupedColumns).appendTo($content);$("<ul></ul>").addClass(css.dialogListGroupedColumns).appendTo($groupedColumns);$("<ul></ul>").addClass(css.dialogListUngroupedColumns).appendTo($ungroupedColumns);this._renderColumnsDialog(this.grid.options.columns);this._currentTreeLayer=null;if(this._isToRenderClearAllButton()){this._renderDialogButtonClearAll()}else{$("#"+this.grid.id()+"_groupbydialog_reset_button").remove()}this._trigger(this.events.modalDialogContentsRendered,null,{modalDialogElement:modalDialog,owner:this})}},_addSlideButtonGroupedColumns:function(){var css=this.css,o=this.options,$groupedColumns=$("#"+this.grid.id()+"_groupby_modalDialog_groupedcolumns"),buttonId=this.grid.id()+"_groupbymodaldialot_slidebutton",$button,innerHTML;innerHTML='<div class="'+css.dialogSlideArea+'">'+'	<div class="'+css.dialogSlideAreaContainer+'">'+'		<button id="'+buttonId+'" class="'+css.dialogButtonSlide+'" role="button" aria-disabled="false" title="'+o.dialogButtonSlideCaption+'">'+'			<span class="'+css.dialogButtonSlideContainer+'"></span>'+'			<span class="ui-button-text">'+o.dialogButtonSlideCaption+"</span>"+"		</button>"+"	</div>"+"</div>";$(innerHTML).insertAfter($groupedColumns);$button=$("#"+buttonId);$button.bind({click:function(e,args){$groupedColumns.slideToggle("slow");$(this).find("span:eq(0)").toggleClass(css.dialogButtonSlideUp);return false}})},_renderLayoutsDropDown:function(){var o=this.options,fn,w,dW,$ddField,self=this,css=this.css,modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog"),$content=modalDialog.igGridModalDialog("getContent"),cancelFunc,htmlLayouts,$buttonDD,$dropDown,$tree,dropDownId=this.grid.id()+"_groupby_modalDialog_layoutsDD",modalDialogDropDownAreaWidth=o.modalDialogDropDownAreaWidth||o.modalDialogDropDownWidth,columnLayoutsData=this.grid.options.columnLayouts.slice(0),$layoutsContainer;$layoutsContainer=$("<div></div>").attr("id",this.grid.id()+"_groupby_modalDialog_layoutsContainer").addClass(css.modalDialogLayoutsContainer).appendTo($content);htmlLayouts='<div style="float: left;">'+o.modalDialogDropDownLabel+"</div>"+'<div class="'+css.dialogLayoutsDD+'">'+'	<div id="'+this.grid.id()+'_groupby_modalDialog_layoutsDDField" class="'+css.dialogLayoutsDDField+'">'+o.modalDialogRootLevelHierarchicalGrid+"</div>"+'	<span id="'+this.grid.id()+'_groupby_modalDialog_layoutsDDButton" style="float:right;">^</span>'+'	<div style="clear: both;"></div>'+"</div>"+'<div style="clear: both;"></div>';$layoutsContainer.html(htmlLayouts);$buttonDD=$("#"+this.grid.id()+"_groupby_modalDialog_layoutsDDButton");$buttonDD.wrap('<a href="#" title="'+o.modalDialogDropDownButtonCaption+' "></a>');cancelFunc=function(e){e.preventDefault();e.stopPropagation()};$buttonDD.closest("div").bind({mousedown:function(event){self._toggleDropDown(event,false)},mouseup:cancelFunc,click:cancelFunc});$buttonDD.addClass(css.dialogLayoutsDDButton);if(this._checkIsGroupByInherit(this.grid.options)===false){columnLayoutsData=this._getEnabledGroupByLayouts(columnLayoutsData)}if(columnLayoutsData.length>0||this._checkIsGroupByEnabled(this.grid.options)){$dropDown=$("#"+dropDownId);$dropDown.remove();$dropDown=$("<div></div>");$dropDown.attr("id",dropDownId).css({position:"absolute",display:"none","z-index":"1000"}).addClass(this.css.dropDownLayoutsContainer).appendTo($("#"+this.grid.id()+"_groupby_modalDialog_content")).bind({mousedown:function(e,args){clearTimeout(self._dropDownTimeout);setTimeout(function(){$buttonDD.closest("a").focus()},10)}});if(o.modalDialogDropDownWidth){$buttonDD.closest("div").width(o.modalDialogDropDownWidth)}if(o.modalDialogDropDownWidth&&(!o.modalDialogDropDownWidth.indexOf||o.modalDialogDropDownWidth.indexOf("%")===-1)){w=$buttonDD.closest("div").width()-$buttonDD.outerWidth();$ddField=$("#"+this.grid.id()+"_groupby_modalDialog_layoutsDDField");$ddField.width(w);dW=$ddField.outerWidth()-w;if(dW>0){w-=dW;$ddField.width(w-2)}}if(modalDialogDropDownAreaWidth){$dropDown.width(modalDialogDropDownAreaWidth)}$tree=$("<div></div>").attr("id",this.grid.id()+"_groupby_modal_treeLayouts").addClass(css.modalDialogTreeContainer);$tree.appendTo($dropDown);columnLayoutsData=[{key:"root",columnLayouts:columnLayoutsData,isRoot:true}];$tree.igTree({dataSourceType:"json",dataSource:columnLayoutsData,initialExpandDepth:1e6,bindings:{textKey:"key",childDataProperty:"columnLayouts"},nodeClick:function(event,args){var data=args.node.data,keyLayout=data.key,$groupedUL=$("#"+self.grid.id()+"_groupby_modalDialog_groupedcolumns ul"),$ungroupedUL=$("#"+self.grid.id()+"_groupby_modalDialog_ungroupedcolumns ul");if(data.dislabledGroupBy===true){return}$groupedUL.empty();$ungroupedUL.empty();$("#"+self.grid.id()+"_groupby_modalDialog_layoutsDDField").text(keyLayout);if(args.node.path.length===1){self._renderColumnsDialog(self.grid.options.columns);self._currentTreeLayer=null}else{self._currentTreeLayer=keyLayout;self._renderColumnsDialog(data.columns,keyLayout)}self._toggleDropDown()}});fn=function(){self._dropDownTimeout=setTimeout(function(){self.closeDropDown()},200)};$buttonDD.closest("a").bind({focus:function(){self._igTreeHasFocus=true;clearTimeout(self._dropDownTimeout)},blur:function(){self._igTreeHasFocus=false;fn()}});$tree.find("a").bind({focus:function(){clearTimeout(self._dropDownTimeout)},blur:function(){fn()}});$tree.find("span.ui-igtree-expander.ui-icon").bind({click:function(){clearTimeout(self._dropDownTimeout);setTimeout(function(){$buttonDD.closest("a").focus()},10)}})}},openDropDown:function(){var $dropDown=$("#"+this.grid.id()+"_groupby_modalDialog_layoutsDD");if($dropDown.is(":visible")===false){this._toggleDropDown()}},closeDropDown:function(){var $dropDown=$("#"+this.grid.id()+"_groupby_modalDialog_layoutsDD");if($dropDown.is(":visible")===true){this._toggleDropDown()}},_getEnabledGroupByLayouts:function(layouts){var resultLayouts=[],i,tempChildLayouts,layout;if(layouts){for(i=0;i<layouts.length;i++){tempChildLayouts=null;layout=$.extend(true,{},layouts[i]);if(layout.columnLayouts&&this._checkIsGroupByInherit(layout)===false){tempChildLayouts=this._getEnabledGroupByLayouts(layout.columnLayouts);if(tempChildLayouts&&tempChildLayouts.length>0){layout.columnLayouts=tempChildLayouts}else{layout.columnLayouts=null}}if(this._checkIsGroupByEnabled(layout)){resultLayouts.push(layout)}else if(layout.columnLayouts!==null&&layout.columnLayouts!==undefined){layout.dislabledGroupBy=true;resultLayouts.push(layout)}}}return resultLayouts},_checkIsGroupByInherit:function(layout){var i;if(layout&&layout.features){for(i=0;i<layout.features.length;i++){if(layout.features[i].name==="GroupBy"&&layout.features[i].inherit===true){return true}}}return false},_checkIsGroupByEnabled:function(layout){var i;if(layout&&layout.features){for(i=0;i<layout.features.length;i++){if(layout.features[i].name==="GroupBy"){return true}}}return false},_toggleDropDown:function(){var $button=$("#"+this.grid.id()+"_groupby_modalDialog_layoutsDDButton").parent(),$modalDialogContent=$("#"+this.grid.id()+"_groupby_modalDialog_content"),$layoutsDDField=$("#"+this.grid.id()+"_groupby_modalDialog_layoutsDDField").parent(),left=0,top=0,$dropDown=$("#"+this.grid.id()+"_groupby_modalDialog_layoutsDD"),isVisible=$dropDown.is(":visible")===true,self=this;if($dropDown.data("isAnimating")===true){return}if(!isVisible){top=$layoutsDDField.offset().top-$modalDialogContent.offset().top+$layoutsDDField.height()+1;left=$layoutsDDField.offset().left-$modalDialogContent.offset().left;$dropDown.css({top:top,left:left})}$dropDown.data("isAnimating",true);$dropDown.slideToggle(400,function(){var $layoutsDD=$("#"+self.grid.id()+"_groupby_modalDialog_layoutsDD"),$tree=$("#"+self.grid.id()+"_groupby_modal_treeLayouts");if($dropDown.is(":visible")===true){$button.focus();self._activeDropdown=$dropDown;if(!self.options.modalDialogDropDownAreaWidth&&!self.options.modalDialogDropDownWidth){if($layoutsDD.width()!==$tree.width()){$layoutsDD.width($tree.width())}}}else{self._activeDropdown=null}$dropDown.data("isAnimating",false)})},_groupByDialogButtonOKClick:function(e,args){var noCancel,o=this.options,modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog"),i,j,len,tempGroupedCol,isToCallGroupedColumnsChanged=false,copy;noCancel=this._trigger(this.events.modalDialogButtonApplyClick,null,{modalDialogElement:modalDialog,owner:this,groupedColumns:this._tempGroupedColumns,groupedColumnLayouts:this._tempOptions.columnLayouts,sortingExpr:this._tempSortingExpr});if(noCancel){if(this._orderedGroupedCols.length!==this._tempOrderedGroupedCols.length){isToCallGroupedColumnsChanged=true}else{len=this._orderedGroupedCols.length;for(i=0;i<len;i++){tempGroupedCol=this._tempOrderedGroupedCols[i];for(j=0;j<len;j++){if(tempGroupedCol.key===this._orderedGroupedCols[j].key&&tempGroupedCol.layout===this._orderedGroupedCols[j].layout){break}}if(j===len){isToCallGroupedColumnsChanged=true;break}}}if(isToCallGroupedColumnsChanged===true){this.grid._onGroupedColumnsChanged(this._tempGroupedColumns);this._trigger(this.events.groupedColumnsChanged,e,{owner:this,groupedColumns:this._tempGroupedColumns})}this._orderedGroupedCols=this._tempOrderedGroupedCols;if(o.groupedColumns){o.groupedColumns=this._tempGroupedColumns}if(this.grid.options.columnLayouts){this.grid.options.columnLayouts=this._tempOptions.columnLayouts}if(this.grid.dataSource.settings.sorting.expressions){this.grid.dataSource.settings.sorting.expressions=this._tempSortingExpr}if(this._isToRenderClearAllButton()===false){if($(".ui-iggrid-groupbyarea",this.grid.container()).find("ul li").length===0){this._isgroup=null}else{this._isgroup=false}}else{this._isgroup=true}if(o.groupedColumns.length===0&&this.grid.headersTable().find("thead tr").children().first().hasClass("ui-iggrid-expandheadercellgb")){this.grid.element.find("colgroup").children().first().remove();if(this.grid.options.fixedHeaders){this.grid.headersTable().find("colgroup").children().first().remove()}if(this.grid.options.fixedFooters&&this.grid.options.height!==null){this.grid.footersTable().find("colgroup").children().first().remove()}this.grid.headersTable().find("thead tr").children("[data-skip]").first().remove()}copy=this._orderedGroupedCols.slice(0);this._orderedGroupedCols=[];this._ensureLabelsOrder(copy,this._orderedGroupedCols,this.grid.options);this._rebind();if(this.grid.options.width!==null&&this.grid.options.width!==undefined){this.grid._updateGridContentWidth()}this.grid._trigger("headerExtraCellsModified",null,{owner:this});e.preventDefault();e.stopPropagation();modalDialog.igGridModalDialog("closeModalDialog")}},_setSortingTempExpr:function(key,dir,layout){var i,layouts,j,gc=this._tempGroupedColumns,gcTemp,sexpr,s=this._tempSortingExpr,settings,lobj;sexpr={fieldName:key,dir:dir,layout:layout,isGroupBy:true};if(dir===""){for(j=0;j<s.length;j++){if(s[j].fieldName===key&&s[j].layout===layout){s.splice(j,1);break}}return}if(gc.length===0&&!layout){gcTemp=this._tempGroupedColumns.slice(0);this._allGroupedCols(gcTemp);gc=gcTemp.slice(0)}for(i=0;i<gc.length;i++){if(gc[i].key===key){gc[i].dir=dir;for(j=0;j<s.length;j++){if(s[j].fieldName===key){s[j].dir=gc[i].dir;if(gc[i].layout){s[j].layout=gc[i].layout}break}}if(j===s.length){this._addSortingExpressions(s,sexpr)}break}}if(layout){for(i=0;i<this._tempOrderedGroupedCols.length;i++){if(this._tempOrderedGroupedCols[i].key===key&&(this._tempOrderedGroupedCols.layout&&this._tempOrderedGroupedCols.layout===layout||!this._tempOrderedGroupedCols.layout)){this._tempOrderedGroupedCols[i].dir=dir;break}}for(j=0;j<s.length;j++){if(s[j].fieldName===key&&s[j].layout===layout){s[j].dir=dir;break}}if(j===s.length){this._addSortingExpressions(s,sexpr)}layouts=[];this._findLayout(layout,this._tempOptions,layouts);lobj=layouts[0];for(i=0;lobj.features&&i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){settings=lobj.features[i].columnSettings;for(j=0;j<settings.length;j++){if(settings[j].columnKey===key){settings[j].dir=dir;break}}break}}}},_setGroupByTempExpr:function(key,isGroupBy,dir,layout){var i,gexpr,expr,lobj,c,fcs,setting,layouts;if(layout){layouts=[];this._findLayout(layout,this._tempOptions,layouts);lobj=layouts[0];c=this._getColumnByLayoutKey(key,lobj.columns)}else{lobj=this.grid.options;c=this.grid.columnByKey(key)}if(layout){if(!lobj.features){lobj.features=[];lobj.features.push({name:"GroupBy",columnSettings:[]});fcs=lobj.features[0].columnSettings}else{for(i=0;i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){fcs=lobj.features[i].columnSettings;if(!fcs){lobj.features[i].columnSettings=[];fcs=lobj.features[i].columnSettings}break}}}for(i=0;i<fcs.length;i++){if(fcs[i].columnKey===key){if(!isGroupBy){fcs.splice(i,1)}else{setting=fcs[i]}break}}if(isGroupBy){if(!setting){fcs.push({columnKey:key,isGroupBy:isGroupBy,dir:dir})}else{setting.isGroupBy=isGroupBy;setting.dir=dir}}}gexpr={key:key,dir:dir,layout:layout,col:c};if(!layout){expr=this._tempGroupedColumns;for(i=0;i<expr.length;i++){if(expr[i].key===key){expr.splice(i,1);break}}if(isGroupBy){expr=expr.concat(gexpr)}this._tempGroupedColumns=expr}if(isGroupBy){this._tempOrderedGroupedCols.push(gexpr)}else{for(i=0;i<this._tempOrderedGroupedCols.length;i++){if(this._tempOrderedGroupedCols[i].key===key&&(this._tempOrderedGroupedCols.layout&&this._tempOrderedGroupedCols.layout===layout||!this._tempOrderedGroupedCols.layout)){$.ig.removeFromArray(this._tempOrderedGroupedCols,i);break}}}this._setSortingTempExpr(key,dir,layout)},_checkColumnIsGroupedInternal:function(key,layout,groupedColumns,options){var isGrouped=false,i,j,layouts,lobj,fcs;if(!layout){for(i=0;i<groupedColumns.length;i++){if(groupedColumns[i].key===key){isGrouped=true;break}}}else{layouts=[];this._findLayout(layout,options,layouts);lobj=layouts[0];if(lobj&&lobj.features){for(i=0;i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){fcs=lobj.features[i].columnSettings;if(fcs){for(j=0;j<fcs.length;j++){if(fcs[j].columnKey===key){if(fcs[j].isGroupBy){isGrouped=true}break}}}break}}}}return isGrouped},checkColumnIsGrouped:function(key,layout){return this._checkColumnIsGroupedInternal(key,layout,this.options.groupedColumns,this.grid.options)},_getAllColumns:function(columns,columnsRes){var i,columnsLength=columns.length;for(i=0;i<columnsLength;i++){if(columns[i].group){this._getAllColumns(columns[i].group,columnsRes)}else{columnsRes.push(columns[i])}}},_renderColumnsDialog:function(columns,layout){var self=this,columnsRes=[];if(this.grid._isMultiColumnGrid){this._getAllColumns(columns,columnsRes)}else{columnsRes=columns}$.each(columnsRes,function(columnIndex,column){var cs=self._findColumnSetting(column.key);if(self.options.type==="remote"&&(column.unboundDS===true||column.unbound===true)){return true}if(!cs||cs.allowGrouping){if(self._checkColumnIsGroupedInternal(column.key,layout,self._tempGroupedColumns,self._tempOptions)){self._renderDialogGroupedColumn(column,layout)}else{self._renderDialogUngroupedColumn(column,layout)}}})},_clearAllGroupedColumns:function(){this._tempGroupedColumns=[];this._clearAllGroupedColumnsLayout(this._tempOptions)},_clearAllGroupedColumnsLayout:function(layout){var i,fcs;if(layout!==null&&layout.features){for(i=0;i<layout.features.length;i++){if(layout.features[i].name==="GroupBy"){fcs=layout.features[i].columnSettings;if(fcs){layout.features[i].columnSettings=[]}}}}for(i=0;layout.columnLayouts&&i<layout.columnLayouts.length;i++){this._clearAllGroupedColumnsLayout(layout.columnLayouts[i])}},_isToRenderClearAllButton:function(){if(this.options.modalDialogGroupByOnClick===true){return true}if(this._tempGroupedColumns.length>0){return true}if(this._checkRenderLayoutsClearAll(this.grid.options)===true){return true}return false},_checkRenderLayoutsClearAll:function(layout){var i,j,fcs;if(layout!==null&&layout.features){for(i=0;i<layout.features.length;i++){if(layout.features[i].name==="GroupBy"){fcs=layout.features[i].columnSettings;if(fcs){for(j=0;j<fcs.length;j++){if(fcs[j].isGroupBy){return true}}}}}}for(i=0;layout.columnLayouts&&i<layout.columnLayouts.length;i++){if(this._checkRenderLayoutsClearAll(layout.columnLayouts[i])===true){return true}}return false},_renderDialogGroupedColumn:function(column,layout){var i,j,s,$li,liHTML,$buttonUngroup,o=this.options,self=this,css=this.css,key=column.key,$ul=$("#"+this.grid.id()+"_groupby_modalDialog_groupedcolumns ul"),buttonAscDescId=this.grid.id()+"_"+key+"_groupbydialog_groupedcolumns_buttonascdesc",buttonUngroupId=this.grid.id()+"_"+key+"_groupbydialog_groupedcolumns_buttonungroup",dir="asc",gc=null;$("#"+this.grid.id()+"_groupby_modalDialog").css("width");if(!layout){for(i=0;i<self._tempGroupedColumns.length;i++){if(self._tempGroupedColumns[i].key===key){gc=self._tempGroupedColumns[i];dir=gc.dir;break}}}else{s=self._tempSortingExpr;for(j=0;j<s.length;j++){if(s[j].fieldName===key&&s[j].layout===layout){dir=s[j].dir;break}}}$li=$("<li></li>").attr("id",self.grid.id()+"_"+key+"_groupbydialog_grouped_li").addClass(css.dialogGroupedItem);$li.appendTo($ul);liHTML='<span id="'+buttonAscDescId+'" class="'+css.dialogButtonAsc+'" role="button" title="'+o.modalDialogCaptionButtonAsc+'">'+'	<span class="'+css.dialogButtonAscIcon+'"></span>'+"</span>"+'<span class="'+css.dialogGroupedColumnTextContainer+'">'+column.headerText+"</span>"+'<button id="'+buttonUngroupId+'" class="'+css.dialogButtonUngroup+'" role="button" title="'+o.modalDialogCaptionButtonUngroup+'" >'+'	<span class="'+css.dialogButtonUngroupContainer+'"></span>'+'	<span class="ui-button-text">'+o.modalDialogCaptionButtonUngroup+"</span>"+"</button>";$li.html(liHTML);$buttonUngroup=$("#"+buttonUngroupId);self._setDialogButtonAscDesc(dir==="asc",key);$li.bind({click:function(e,args){self._dialogButtonAscDescClick(key,layout)}});$buttonUngroup.bind({click:function(e,args){var noCancel;noCancel=self._trigger(self.events.modalDialogUngroupingColumn,e,{key:key,layout:layout,owner:self});if(noCancel){$li.remove();if(o.modalDialogGroupByOnClick===true){self.ungroupByColumn(key,layout)}else{self._setGroupByTempExpr(key,false,"",layout)}self._renderDialogUngroupedColumn(column,layout);if($("#"+self.grid.id()+"_groupby_modalDialog_groupedcolumns ul li").length===0&&self._isToRenderClearAllButton()===false){$("#"+self.grid.id()+"_groupbydialog_reset_button").remove()}self._trigger(self.events.modalDialogUngroupColumn,e,{key:key,layout:layout,owner:self,groupedColumns:self._tempGroupedColumns})}e.preventDefault();e.stopPropagation()},mouseover:function(e,args){if(!$(this).hasClass(css.dialogButtonsHover)){$(this).addClass(css.dialogButtonsHover)}},mouseout:function(e,args){if($(this).hasClass(css.dialogButtonsHover)){$(this).removeClass(css.dialogButtonsHover)}}})},_dialogButtonAscDescClick:function(key,layout){var o=this.options,$buttonAscDesc=$("#"+this.grid.id()+"_"+key+"_groupbydialog_groupedcolumns_buttonascdesc"),noCancel,modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog"),isAsc=$buttonAscDesc.data("isAsc");noCancel=this._trigger(this.events.modalDialogSortGroupedColumn,null,{modalDialogElement:modalDialog,owner:this,key:key,isAsc:!isAsc,layout:layout});if(noCancel){if(isAsc===true){if(o.modalDialogGroupByOnClick===true){this._setSortingTempExpr(key,"desc",layout);this.grid.dataSource.settings.sorting.expressions=this._tempSortingExpr;this._rebind()}else{this._setSortingTempExpr(key,"desc",layout)}}else{if(o.modalDialogGroupByOnClick===true){this._setSortingTempExpr(key,"asc",layout);this.grid.dataSource.settings.sorting.expressions=this._tempSortingExpr;
this._rebind()}else{this._setSortingTempExpr(key,"asc",layout)}}this._setDialogButtonAscDesc(!isAsc,key)}},_setDialogButtonAscDesc:function(isAsc,key){var css=this.css,$buttonAscDesc=$("#"+this.grid.id()+"_"+key+"_groupbydialog_groupedcolumns_buttonascdesc"),$spanIcon=$buttonAscDesc.find("span:eq(0)"),caption;if(isAsc===true){$buttonAscDesc.removeClass(css.dialogButtonDesc).addClass(css.dialogButtonAsc);$spanIcon.removeClass(css.dialogButtonDescIcon).addClass(css.dialogButtonAscIcon);caption=this.options.modalDialogCaptionButtonAsc}else{$buttonAscDesc.removeClass(css.dialogButtonAsc).addClass(css.dialogButtonDesc);$spanIcon.removeClass(css.dialogButtonAscIcon).addClass(css.dialogButtonDescIcon);caption=this.options.modalDialogCaptionButtonDesc}$buttonAscDesc.data("isAsc",isAsc).attr("title",caption)},_renderDialogButtonClearAll:function(){if(this.options.modalDialogGroupByOnClick===true){return}var self=this,o=this.options,resetButtonId=self.grid.id()+"_groupbydialog_reset_button",modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog"),$captionButtonContainer,$resetButton;if($("#"+resetButtonId).length===0){$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$resetButton=$("<button></button>").attr("id",resetButtonId).appendTo($captionButtonContainer);$resetButton.igButton({labelText:o.modalDialogClearAllButtonLabel,click:function(e){var noCancel,$groupedUL,$ungroupedUL,layouts=[];noCancel=self._trigger(self.events.modalDialogButtonResetClick,e,{modalDialogElement:modalDialog,owner:self});if(noCancel){self._clearAllGroupedColumns();self._tempSortingExpr=self.grid.dataSource.settings.sorting.expressions.slice(0);$groupedUL=$("#"+self.grid.id()+"_groupby_modalDialog_groupedcolumns ul");$ungroupedUL=$("#"+self.grid.id()+"_groupby_modalDialog_ungroupedcolumns ul");$groupedUL.empty();$ungroupedUL.empty();self._tempSortingExpr=[];self._tempOrderedGroupedCols=[];if(!self._currentTreeLayer){self._renderColumnsDialog(self.grid.options.columns)}else{self._findLayout(self._currentTreeLayer,self._tempOptions,layouts);if(layouts.length>0){self._renderColumnsDialog(layouts[0].columns,self._currentTreeLayer)}}$(this).remove()}}})}},_renderDialogUngroupedColumn:function(column,layout){var self=this,$li,$a,key=column.key,o=this.options,css=this.css,$ul=$("#"+this.grid.id()+"_groupby_modalDialog_ungroupedcolumns ul");$li=$("<li></li>").attr("id",self.grid.id()+"_"+key+"_groupbydialog_grouped_li").addClass(css.dialogUngroupedItem).append('<span class="'+css.dialogUngroupedColumnsGroupByButton+'"><a href="#"></a></span> <span class="'+css.dialogUngroupedColumnsText+'">'+column.headerText+"</span>");$li.appendTo($ul);$a=$li.find("a:first");$a.addClass(css.modalDialogSortByColumn);$a.html(o.modalDialogGroupByButtonText);$li.bind({click:function(e,args){var noCancel;noCancel=self._trigger(self.events.modalDialogGroupingColumn,e,{key:key,layout:layout,owner:self});if(noCancel){$li.remove();if(o.modalDialogGroupByOnClick){self.groupByColumn(key,layout)}else{self._setGroupByTempExpr(key,true,o.defaultSortingDirection,layout)}self._renderDialogButtonClearAll();self._renderDialogGroupedColumn(column,layout);self._renderDialogButtonClearAll();self._trigger(self.events.modalDialogGroupColumn,e,{key:key,layout:layout,owner:self,groupedColumns:self._tempGroupedColumns})}e.preventDefault();e.stopPropagation()}})},_setGroupAreaTextContent:function($area){var text=this.options.emptyGroupByAreaContent,linkText=this.options.emptyGroupByAreaContentSelectColumns,linkTextCaption=this.options.emptyGroupByAreaContentSelectColumnsCaption,$a,self=this;text=text.replace("{0}",'<a href="#" id="'+this.grid.id()+'_link_selectcolumns" title="'+linkTextCaption+'">'+linkText+"</a>");$area.html(text);$a=$("#"+this.grid.id()+"_link_selectcolumns");$a.bind({click:function(e,args){self.openGroupByDialog();e.preventDefault();e.stopPropagation()}})},_headerCellDragCancel:function(event,args){return false},_headerCellRendered:function(event,args){var groupby=this,cs,hg,hgTemp,isMultiColumnHeaderGrid=this.grid._isMultiColumnGrid;if(args.owner.id()!==this.grid.id()){return}if(args.isMultiColumnHeader===true){return}hg=groupby.grid.element.hasClass("ui-iggrid-root")?groupby.grid.container():groupby.grid.element.closest(".ui-iggrid-root");if(hg.length===0){hg=groupby.grid.container()}else{hgTemp=hg.closest(".ui-widget");if(hgTemp.length>0){hg=hgTemp}}cs=this._findColumnSetting(args.columnKey);args.th.find(".ui-iggrid-headertext").css("width","100%");if(cs&&cs.allowGrouping||!cs){args.th.draggable({containment:hg,appendTo:hg,distance:5,revert:"invalid",cancel:"div.ui-iggrid-indicatorcontainer",helper:function(event){var th,helperDOM;if($(event.target).is("span")){groupby._spanDragging=true}else{groupby._spanDragging=false}th=$(event.target).closest("th");helperDOM=th.clone().css("overflow","hidden").width(th.width()).addClass("ui-widget ui-iggrid").wrap($('<div class="'+groupby.css.dragMarkup+'"/>').width(th.outerWidth()));if(isMultiColumnHeaderGrid){helperDOM.height(th.height())}return helperDOM.parent()},opacity:groupby.options.labelDragHelperOpacity,drag:function(event,ui){var groupbyarea;groupby._isDragging=true;groupbyarea=$(".ui-iggrid-groupbyarea",hg);if(!groupbyarea.hasClass("ui-iggrid-groupbyareahover")&&!groupby._movingEnabled){if(groupby._spanDragging){ui.helper.find("span").css("cursor","no-drop")}else{ui.helper.css("cursor","no-drop")}}else{if(groupby._spanDragging){ui.helper.find("span").css("cursor","move")}else{ui.helper.css("cursor","move")}}},stop:function(event,ui){groupby._isDragging=false}}).bind({mouseover:groupby._headerMouseOverHandler,mouseout:groupby._headerMouseOutHandler});if(args.owner.element.attr("data-childgrid")){args.th.attr("data-layout",args.owner.options.key).attr("data-grid-id",args.owner.element.attr("id"))}}},_findColumnSetting:function(key){var i;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){return this.options.columnSettings[i]}}},_renderRecords:function(ui,args){if(args.owner.id()!==this.grid.id()){return}if(this._getTotalRowCountHandler){this.grid._getTotalRowCount=this._getTotalRowCountHandler;this._getTotalRowCountHandler=null}if(this.options.groupedColumns.length>0){this._renderRecordsInternal()}else{return true}return false},_recordsRendered:function(ui,args){var currentScrollTop=$(window).scrollTop();if(!args.tbody.is(":visible")){args.tbody.css("display","")}if(this._scrolltop!==0&&currentScrollTop!==0&&this._scrolltop!==currentScrollTop){$(window).scrollTop(this._scrolltop)}},_renderRecordsInternal:function(){var grid=this.grid,idval=null,ds=grid.dataSource.dataView(),firstTime=true,counter,d=[],tbody=grid.element.children("tbody"),fh=false,html,i,tbodyHtml,$thDataSkip,gr,groupedRowsLength,tr,countHiddenRows;this._indent=this.options.indentation;if(this.grid.options.fixedHeaders===true){fh=true}if(this.grid._isMultiColumnGrid){this._colspan=this.grid.container().find("#"+this.grid.id()+" colgroup:first>col").length-1}else{if(this.grid.options.showHeader){this._colspan=this.grid.container().find("#"+this.grid.id()+(fh===true?"_headers":"")+" thead>tr:first").children("th:not(.ui-iggrid-expandheadercellgb)").length}else{this._colspan=this.grid.container().find("#"+this.grid.id()+" colgroup:first>col").length-1}}this._processGroupsRecursive(0,ds,tbody,d,idval,0,ds.length,firstTime);if(!grid.headersTable().find("thead tr th").hasClass("ui-iggrid-expandheadercellgb")){$thDataSkip=$("<th></th>").prependTo(grid.headersTable().find("thead tr:nth-child(1)")).addClass(this.css.expandHeaderCellGroupBy).addClass(this.css.headerExtraCell).attr("data-skip",true);if(grid._isMultiColumnGrid){$thDataSkip.attr("rowspan",grid._maxLevel+1)}if(grid.headersTable().attr("id")!==grid.element.attr("id")){$("<col />").prependTo(grid.headersTable().find("colgroup")).attr("data-skip","true").width(this._indent)}if(grid.footersTable().attr("id")!==grid.element.attr("id")){$("<col />").prependTo(grid.footersTable().find("colgroup")).attr("data-skip","true").width(this._indent)}}else{grid.headersTable().find("colgroup col:nth-child(1)").width(this._indent);grid.footersTable().find("colgroup col:nth-child(1)").width(this._indent)}tbody.show();html=d.join("");if(grid.options.virtualization===true){this.grid._scrollTo(0,true);this._groupedRows=this._tokenizeTBody(html);if(this._groupedRows.length>0){this._groupedRows[0]=this._groupedRows[0].substr(0,3)+' data-firstgrouprow="true" '+this._groupedRows[0].substr(3);this._groupedRows[this._groupedRows.length-1]=this._groupedRows[this._groupedRows.length-1].substr(0,3)+' data-lastrow="true" '+this._groupedRows[this._groupedRows.length-1].substr(3);for(i=this._groupedRows.length-1;i>=0;i--){if(this._groupedRows[i].indexOf('data-grouprow="true"')>=0){this._groupedRows[i]=this._groupedRows[i].substr(0,3)+' data-lastgrouprow="true" '+this._groupedRows[i].substr(3);break}}this._virtualRowCount=this._determineVirtualRowCount(this._groupedRows,grid._getDisplayContainerHeight());if(this._virtualRowCount>this._groupedRows.length){this._virtualRowCount=this._groupedRows.length}tbodyHtml="";if(!this.options.initialExpand){if(!this._getTotalRowCountHandler){this._getTotalRowCountHandler=$.proxy(grid._getTotalRowCount,grid);grid._getTotalRowCount=$.proxy(this._getTotalRowCount,this)}this._countGroupedRows=html.match(/(data-grouprow="true")/gi).length;this._cachedGroupedRows=this._groupedRows;gr=[];this._groups={};counter=0;groupedRowsLength=this._groupedRows.length;countHiddenRows=0;for(i=0;i<groupedRowsLength;i++){tr=this._groupedRows[i];if(tr.indexOf("data-grouprow")>-1){counter++;countHiddenRows=0;tr=tr.replace(/data-row-idx="(\d)+"/i,'data-row-idx="'+(counter-1)+'"');gr.push(tr)}else{if(++countHiddenRows>this._virtualRowCount){continue}if(!this._groups[counter-1]){this._groups[counter-1]=[]}this._groups[counter-1].push(tr)}}this._groupedRows=gr;gr=null;if(this._virtualRowCount>this._groupedRows.length){this._virtualRowCount=this._groupedRows.length}for(i=0;i<this._virtualRowCount;i++){tbodyHtml+=this._groupedRows[i]}}else{for(i=0;i<this._virtualRowCount;i++){tbodyHtml+=this._groupedRows[i]}}if(window.MSApp===undefined){tbody.html(tbodyHtml)}else{MSApp.execUnsafeLocalFunction(function(){tbody.html(tbodyHtml)})}this.grid._buildVirtualDomForContinuousVirtualization()}}else{if(window.MSApp===undefined){tbody.html(html)}else{MSApp.execUnsafeLocalFunction(function(){tbody.html(html)})}if(this.grid.options.width===null){this.grid._setContainerWidth(this.grid.container())}else{this.grid._updateGridContentWidth()}}this._avgRowHeight=this.grid._calculateAvgRowHeight();this.grid._trigger(this.grid.events.rowsRendered,null,{owner:this.grid,tbody:tbody})},_getTotalRowCount:function(){if(this.options.groupedColumns.length>0){return this._countGroupedRows}return this._getTotalRowCountHandler()},_processGroupsRecursive:function(i,ds,tbody,d,idval,start,end,firstTime){var index,tmpSum=0,j,tmpCount=start,tmpStart=start,k,arr,arrLength,cssClass,gcval=this.options.groupedColumns[i].key,cs;if(ds.length===0){return}idval=ds[tmpCount][gcval];cs=this._settingFromKey(gcval);firstTime=true;if(!(this.options.indentation&&this.options.indentation.indexOf&&this.options.indentation.indexOf("%")!==-1)){this._indent=parseInt(this.options.indentation,10)*(i+1)}for(j=start;j<end;j++){if(j<tmpCount||tmpCount>=end){continue}if(!this._cmp(cs,ds[tmpCount][gcval],idval)||firstTime){firstTime=false;idval=ds[tmpCount][gcval];if(cs.customGroupName){index=this._renderGroupRow(d,i,gcval,idval,cs.customGroupName,cs,ds[tmpCount])}else{index=this._renderGroupRow(d,i,gcval,idval,null,cs,ds[tmpCount])}tmpStart=tmpCount;if(this.options.groupedColumns.length-1>i){while(tmpCount<end&&this._cmp(cs,ds[tmpCount][gcval],idval)){tmpCount++;tmpSum++}this._rs(gcval,idval,index,tmpSum,tmpStart,tmpCount,ds,d);tmpSum=0;this._processGroupsRecursive(i+1,ds,tbody,d,idval,j,tmpCount,firstTime)}else{arr=[];while(tmpCount<end&&this._cmp(cs,ds[tmpCount][gcval],idval)){tmpCount++;tmpSum++;this._renderRecord(d,tbody,ds[tmpCount-1],tmpCount-1,this.options.initialExpand,arr)}arrLength=arr.length;for(k=0;k<arrLength;k++){cssClass=this.css.nonGroupRowEmptyCell;if(k===arrLength-1){cssClass+=" "+this.css.groupByLastEmptyCell}d[arr[k]]+='<td class="'+cssClass+'" data-skip="true"></td>'}this._rs(gcval,idval,index,tmpSum,tmpStart,tmpCount,ds,d);tmpSum=0}}}},_rs:function(gcval,idval,index,tmpSum,tmpStart,tmpCount,ds,d){var subdata;tmpSum=this._calcRealSum(gcval,idval,tmpSum,ds);d[index]=d[index].replace("__sum__",tmpSum);if(d[index].indexOf("$$value$$")!==-1){subdata=ds.slice(tmpStart,tmpCount);d[index]=this._calcRealSummary(d[index],gcval,idval,subdata)}},_cmp:function(cs,val1,val2){var res,o=this.grid.options,enableUTCDates=o.enableUTCDates,rowTemplate=!o.rowTemplate||o.rowTemplate.length<=0,format,key,col;if(cs.groupComparerFunction){if(typeof cs.groupComparerFunction==="function"){res=cs.groupComparerFunction(cs,val1,val2)}else{res=window[cs.groupComparerFunction](cs,val1,val2)}return res}if($.type(val1)==="date"&&$.type(val2)==="date"){key=cs.columnKey;if(key!==undefined&&key!==null){col=this.grid.columnByKey(key);if(col!==undefined&&col!==null){format=col.format}}return $.ig.formatter(val1,"date",format,rowTemplate,enableUTCDates)===$.ig.formatter(val2,"date",format,rowTemplate,enableUTCDates)}return val1===val2},_encodeSummaryParams:function(owner,params){var cs=this.options.columnSettings,i,j,key;for(i=0;i<cs.length;i++){if(cs[i].summaries&&cs[i].summaries.length>0){for(j=0;j<cs[i].summaries.length;j++){key="gs("+cs[i].columnKey+")";if(params.extraParams[key]){params.extraParams[key]=params.extraParams[key]+","+cs[i].summaries[j].summaryFunction}else{params.extraParams[key]=cs[i].summaries[j].summaryFunction}}}}},_calcRealSummary:function(contents,gcval,idval,subdata){var n,k,i,cs,j,mdata=this.grid.dataSource.metadata(this.options.resultResponseKey),o,str=contents,val,found=false,mul=1,t,k_val;n=this.grid.dataSource.data();if(mdata&&mdata!==null){cs=this.options.columnSettings;for(i=0;i<cs.length;i++){for(j=0;j<cs[i].summaries.length;j++){o=mdata[cs[i].columnKey+"_"+cs[i].summaries[j].summaryFunction];for(k in o){if(o.hasOwnProperty(k)){t=this.grid.columnByKey(gcval).dataType;if(t==="bool"&&$.type(k)==="string"){k_val=k.toLowerCase()==="true"?true:false}else if(t==="number"&&$.type(k)==="string"){k_val=mul*k}else{k_val=k}if(idval!==null&&!idval.length&&idval===k_val*mul||k_val===idval){val=o[k];val=$.ig.formatter(val,"number",this.options.summarySettings.summaryFormat);if(cs[i].summaries[j].customSummary===undefined||cs[i].summaries[j].customSummary===null){str=str.replace(cs[i].columnKey+cs[i].summaries[j].summaryFunction+"$$value$$",val)}}}}}}}if(!found||this.grid.dataSource.dataView().length<n.length){return this._summaries(str,subdata,gcval)}},_calcRealSum:function(gcval,idval,sum,ds){var tmpSum=0,k,n,nLen,setting,mul=1,idx,metadata,t,n_val;setting=this._settingFromKey(gcval);metadata=this.grid.dataSource.metadata(this.options.resultResponseKey);if(metadata&&metadata[gcval]){k=metadata[gcval];for(n in k){if(k.hasOwnProperty(n)){t=this.grid.columnByKey(gcval).dataType;if(t==="bool"&&$.type(n)==="string"){n_val=n.toLowerCase()==="true"?true:false}else if(t==="number"&&$.type(n)==="string"){n_val=mul*n}else{n_val=n}if(idval!==null&&idval!==undefined&&!idval.length&&idval===n_val*mul){tmpSum=k[n]}else if(n_val===idval){tmpSum=k[n]}}}}else if(ds.length<this.grid.dataSource.data().length){tmpSum=0;if(this.grid.dataSource._filter&&this.grid.dataSource._filteredData&&this.options.type==="local"){n=this.grid.dataSource._filteredData}else{n=this.grid.dataSource.data()}nLen=n.length;for(k=0;k<nLen;k++){if(this._cmp(setting,n[k][gcval],idval)){idx=k;break}}for(k=idx;k<nLen;k++){if(this._cmp(setting,n[k][gcval],idval)){tmpSum++}else{break}}}return tmpSum>0?tmpSum:sum},_settingFromKey:function(key){var cs,j;for(j=0;j<this.options.columnSettings.length;j++){if(this.options.columnSettings[j].columnKey===key){cs=this.options.columnSettings[j]}}return cs},_renderGroupRow:function(arr,indent,field,val,customName,colCustomSetting,record){var expcell,textcell,col,margin=indent>0?parseInt(this.options.indentation,10)*indent:0,text,state,css,i,cs=this.options.columnSettings,shtml="",tmpl,title,j,hide=false;if(this.options.initialExpand){css=this.css.groupByExpandCellExpanded;title=this.options.collapseTooltip}else{css=this.css.groupByExpandCellCollapsed;title=this.options.expandTooltip;if(indent>0){hide=true}}if(this.options.expansionIndicatorVisibility){expcell='<td class="'+this.css.groupByExpandColumn+'" gbexpandcell="1"><span class="ui-iggrid-expandbuttoncontainer-group-by" style="margin-left:'+margin+'px;"><span class="'+css+'" title="'+title+'"></span></span></td>'}else{expcell='<td class="'+this.css.groupByExpandColumn+'" gbexpandcell="1"></td>'}tmpl=this.options.groupedRowTextTemplate;col=this.grid.columnByKey(field);if(colCustomSetting&&colCustomSetting.groupLabelFormatter){if(typeof colCustomSetting.groupLabelFormatter==="function"){val=colCustomSetting.groupLabelFormatter(val)}else{val=window[colCustomSetting.groupLabelFormatter](val)}}else if(this.options.useGridColumnFormatter===true){val=this.grid._renderCell(val,col,record," ")}tmpl=tmpl.replace("${key}",col.headerText);if(customName){text=tmpl.replace("${val}",customName).replace("${count}","__sum__")}else{text=tmpl.replace("${val}",val).replace("${count}","__sum__")}if(this.options.initialExpand){state="expanded"}else{state="collapsed"}for(i=0;i<cs.length;i++){for(j=0;j<cs[i].summaries.length;j++){shtml+=" "+cs[i].columnKey+" "+(cs[i].summaries[j].text||cs[i].summaries[j].summaryFunction)+" "+cs[i].columnKey+cs[i].summaries[j].summaryFunction+"$$value$$";if(j!==cs[i].summaries.length-1){shtml+=this.options.summarySettings.multiSummaryDelimiter}}}text+=shtml;textcell='<td colspan="'+this._colspan+'">'+text+"</td>";arr.push('<tr class="'+this.grid.css.recordClass+" "+this.css.groupedRow+'" data-grouprow="true" data-state="'+state+'" data-glevel="'+indent+'"'+(hide?' style="display:none;"':"")+">"+expcell+textcell+"</tr>");return arr.length-1},_renderRecord:function(d,tbody,data,rowIndex,expand,arr){var i,j,dLen,lastIndex=d.length;this.grid._renderRecordInArray(d,tbody,data,rowIndex);dLen=d.length;for(i=lastIndex;i<dLen;i++){if(d[i].indexOf&&d[i].indexOf("<tr")!==-1){if(!expand){d[i]=d[i]+' style="display: none;"'}for(j=i;j<dLen;j++){if(d[j].indexOf&&d[j].indexOf("data-grouprow")!==-1){break}if(d[j].indexOf&&d[j].indexOf(">")!==-1){arr.push(j);break}}break}}},_renderNewRow:function(rec,key){var tbody=this.grid.element.children("tbody"),dataRows=tbody.children("tr:not([data-container='true'],[data-grouprow='true'])"),index=dataRows.length,row,ind,i;if(this.grid.options.jQueryTemplating===true){row=$.tmpl(this.grid._generateRowTemplate(),[rec],this.grid._buildFormatters()).attr("data-id",key||index)}else{row=this.grid._renderRecord(rec,index)}row=$(row);ind=dataRows.last().find("td."+this.css.nonGroupRowEmptyCell).removeClass(this.css.groupByLastEmptyCell).length;for(i=0;i<ind;i++){$("<td></td>").addClass(this.css.nonGroupRowEmptyCell).addClass(this.css.groupByLastEmptyCell).attr("data-skip",true).prependTo(row)}tbody.append(row)},_summaries:function(contents,data,gcval){var i,j,cs=this.options.columnSettings,s,ret=contents,arr,val;if(contents&&contents.indexOf&&contents.indexOf("$$value$$")===-1){return contents}for(i=0;i<cs.length;i++){s=cs[i].summaries;if(s.length>0){arr=this._arr(cs[i].columnKey,data);for(j=0;j<s.length;j++){val=$.ig.calcSummaries(s[j].summaryFunction,arr,s[j].customSummary);val=$.ig.formatter(val,"number",this.options.summarySettings.summaryFormat);ret=ret.replace(cs[i].columnKey+s[j].summaryFunction+"$$value$$",val)}}}return ret},_arr:function(key,data){var arr=[],i;for(i=0;i<data.length;i++){arr.push(data[i][key])}return arr},_dataEmpty:function(event,args){var indent=0,indentation=parseInt(this.options.indentation,10),colGroup,headersColGroup;if(args.owner.id()!==this.grid.id()){return}if(this.options.groupedColumns.length>0){indent+=indentation*this.options.groupedColumns.length;if(this.options.indentation&&this.options.indentation.indexOf&&this.options.indentation.indexOf("%")>=0){indent=this.options.indentation}colGroup=args.owner.element.children("colgroup");headersColGroup=this.grid.headersTable().children("colgroup");if(colGroup.children("[data-registeredCol=true]").length===0&&headersColGroup.children("[data-registeredCol=true]").length===0){$("<col />").prependTo(colGroup).attr("data-skip","true").attr("data-registeredCol","true").width(indent)}else{colGroup.children("col:nth-child(1)").width(indent)}}if(this._isgroup!==null&&this._isgroup!==undefined&&parseInt(this.grid.container().width(),10)>0&&!this.grid.options.width){if(this._isgroup===true){if(this.grid.options.virtualization!==true){this.grid.container().width(parseInt(this.grid.container().width(),10)+indentation)}}else{this.grid.container().width(parseInt(this.grid.container().width(),10)-indentation);indentation*=-1}if(this.grid.options.virtualization===true&&this.grid.options.virtualizationMode==="continuous"){this.grid._setDisplayContainerWidth(this.grid._getDisplayContainerWidth()+indentation);this.grid._setVHeadersWidth(this.grid._getVHeadersWidth()+indentation)}this._isgroup=null}this._tbody=args.tbody;if(!this._isgroup&&this.groupByColumns().length>0){this._groupAreaList()}event.stopPropagation()},_checkGroupExists:function(key){var exists=false,i;for(i=0;i<this.options.groupedColumns.length;i++){if(this.options.groupedColumns[i].key===key){exists=true;break}}return exists},_groupBy:function(event,th){var noCancel,key,layout,cgrid,fc,exists=false;layout=th.attr("data-layout");if(layout){cgrid=$("#"+th.attr("data-grid-id")).data("igGrid");key=cgrid.options.columns[th.data("columnIndex")].key}else{if(th.data("columnIndex")===null||th.data("columnIndex")===undefined){return}key=this.grid.options.columns[th.data("columnIndex")].key;cgrid=this.grid}fc=this.grid.element.data("igGridFeatureChooser");if(fc!==undefined&&fc!==null){fc._setSelectedState("GroupBy",key,true,false)}if(!layout){exists=this._checkGroupExists(key)}if(exists){return}noCancel=this._trigger(this.events.groupedColumnsChanging,event,{owner:this,groupedColumns:this.options.groupedColumns,key:key,layout:layout,grid:cgrid});if(noCancel){this.groupByColumn(key,layout);this._trigger(this.events.groupedColumnsChanged,event,{owner:this,groupedColumns:this.options.groupedColumns,key:key,layout:layout,grid:cgrid})}},groupByColumns:function(){var gc=[];if(this._hierarchical){gc=this._orderedGroupedCols}else{gc=this.options.groupedColumns}return gc},_ensureLabelsOrder:function(from,to,layout){var i,key=layout?layout.key:null;for(i=0;i<from.length;i++){if((from[i].layout===key||!from[i].layout&&!key)&&!this._exists(to,from[i])){to.push(from[i])}}for(i=0;layout.columnLayouts&&i<layout.columnLayouts.length;i++){this._ensureLabelsOrder(from,to,layout.columnLayouts[i])}},_exists:function(arr,layout){var i;for(i=0;i<arr.length;i++){if((arr[i].layout===layout.layout||!arr[i].layout&&!layout.layout)&&arr[i].key===layout.key){return true}}return false},_findLayout:function(layout,opts,layouts){var i;if(opts.key===layout){layouts.push(opts)}else if(!layout){layouts.push(this.grid.options)}else{for(i=0;opts.columnLayouts&&i<opts.columnLayouts.length;i++){this._findLayout(layout,opts.columnLayouts[i],layouts)}}},_allGroupedCols:function(gc){var i;for(i=0;i<this.options.groupedColumns.length;i++){gc.push(this.options.groupedColumns[i])}this._addGroupsRecursive(gc,this.grid.options.columnLayouts)},_addGroupsRecursive:function(gc,layouts){var i,j,gb,col,k;if(!layouts){return}for(i=0;i<layouts.length;i++){for(j=0;layouts[i].features&&j<layouts[i].features.length;j++){if(layouts[i].features[j].name==="GroupBy"){gb=layouts[i].features[j];break}}if(gb){for(j=0;gb.columnSettings&&gb.columnSettings.length&&j<gb.columnSettings.length;j++){if(gb.columnSettings[j].isGroupBy){for(k=0;k<layouts[i].columns.length;k++){if(layouts[i].columns[k].key===gb.columnSettings[j].columnKey||gb.columnSettings[j].columnIndex===k){col=layouts[i].columns[k];break}}gc.push({key:gb.columnSettings[j].columnKey||col.key,layout:layouts[i].key,dir:gb.columnSettings[j].dir,col:col})}}}gb=null;this._addGroupsRecursive(gc,layouts[i].columnLayouts)}},_getColumnByLayoutKey:function(key,columns){var c,i;if(this.grid._isMultiColumnGrid){for(i=0;i<columns.length;i++){if(columns[i].key===key){c=columns[i];break}if(columns[i].group!==undefined&&columns[i].group!==null){c=this._getColumnByLayoutKey(key,columns[i].group);if(c!==undefined&&c!==null){break}}}}else{for(i=0;i<columns.length;i++){if(columns[i].key===key){c=columns[i];break}}}return c},groupByColumn:function(key,layout,sortingDirection){var i,expr,gexpr,lobj,c,fcs,setting,layouts,exists=this._checkGroupExists(key),copy,dir="asc";this.grid._onGroupedColumnsChanging(this.options.groupedColumns);if(sortingDirection!==undefined&&sortingDirection!==null){dir=sortingDirection}else if(this.options.defaultSortingDirection!==undefined){dir=this.options.defaultSortingDirection}if(!layout&&exists){return}if(layout){layouts=[];this._findLayout(layout,this.grid.options,layouts);lobj=layouts[0];c=this._getColumnByLayoutKey(key,lobj.columns)}else{lobj=this.grid.options;c=this.grid.columnByKey(key)}if(layout){if(!lobj.features){lobj.features=[];lobj.features.push({name:"GroupBy",columnSettings:[]});fcs=lobj.features[0].columnSettings}else{for(i=0;i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){fcs=lobj.features[i].columnSettings;if(!fcs){lobj.features[i].columnSettings=[];fcs=lobj.features[i].columnSettings}break}}}for(i=0;i<fcs.length;i++){if(fcs[i].columnKey===key){if(fcs[i].isGroupBy){return}setting=fcs[i];break}}if(!setting){fcs.push({columnKey:key,isGroupBy:true,dir:dir})}else{setting.isGroupBy=true}}expr={fieldName:key,dir:dir,layout:layout,isGroupBy:true};gexpr={key:key,dir:dir,layout:layout,col:c};if(!layout){this.options.groupedColumns.push(gexpr)}this._orderedGroupedCols.push(gexpr);copy=this._orderedGroupedCols.slice(0);this._orderedGroupedCols=[];this._ensureLabelsOrder(copy,this._orderedGroupedCols,this.grid.options);this.grid._trigger("headerExtraCellsModified",null,{owner:this});this._addSortingExpressions(this.grid.dataSource.settings.sorting.expressions,expr);if(!layout){this._isgroup=true}this._rebind();this.grid._onGroupedColumnsChanged(this.options.groupedColumns)},_addSortingExpressions:function(se,expr){var i,seLength=se.length,found=-1;for(i=0;i<seLength;i++){if(se[i].isGroupBy===true){found=i}}if(found===-1){se.unshift(expr)}else{se.splice(found+1,0,expr)}},ungroupByColumn:function(key,layout){var i,fc,self=this,exprs=this.grid.dataSource.settings.sorting.expressions,lobj,fcs,layouts,exists=this._checkGroupExists(key),copy;this.grid._onGroupedColumnsChanging(this.options.groupedColumns);if(!layout&&!exists){return}if(layout){layouts=[];this._findLayout(layout,this.grid.options,layouts);lobj=layouts[0]}else{lobj=this.grid.options}fc=this.grid.element.data("igGridFeatureChooser");if(fc!==undefined&&fc!==null){fc._setSelectedState("GroupBy",key,false,false)}for(i=0;i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){fcs=lobj.features[i].columnSettings;break}}for(i=0;fcs&&i<fcs.length;i++){if(fcs[i].columnKey===key){fcs[i].isGroupBy=false}}if(!layout){for(i=0;i<this.options.groupedColumns.length;i++){if(this.options.groupedColumns[i].key===key){$.ig.removeFromArray(this.options.groupedColumns,i);break}}}for(i=0;i<this._orderedGroupedCols.length;i++){if(this._orderedGroupedCols[i].key===key&&(this._orderedGroupedCols[i].layout&&this._orderedGroupedCols[i].layout===layout||!this._orderedGroupedCols[i].layout&&(layout===""||layout===undefined))){$.ig.removeFromArray(this._orderedGroupedCols,i);break}}for(i=0;i<exprs.length;i++){if(exprs[i].fieldName===key&&(!layout||layout&&layout===exprs[i].layout)){$.ig.removeFromArray(exprs,i)}}copy=this._orderedGroupedCols.slice(0);this._orderedGroupedCols=[];this._ensureLabelsOrder(copy,this._orderedGroupedCols,this.grid.options);this.grid._trigger("headerExtraCellsModified",null,{owner:this});this.grid.element.children("tbody").hide();if(document.documentMode===8){this.grid.element.hide();this.grid.headersTable().hide()}if(!layout&&this.options.groupedColumns.length===0){this.grid.element.find("colgroup").children().first().remove();if(this.grid.options.fixedHeaders){this.grid.headersTable().find("colgroup").children().first().remove()}if(this.grid.options.fixedFooters&&this.grid.options.height!==null){this.grid.footersTable().find("colgroup").children().first().remove()}this.grid.headersTable().find("thead tr").children("[data-skip]").first().remove()}if(!layout){this._isgroup=false}this._rebind();if(document.documentMode===8){this.grid.headersTable().show();this.grid.element.show()}if(this.options.groupedColumns.length===0){if(window.mozInnerScreenX!==undefined&&self.grid.options.fixedFooters===true){self.grid.footersTable().hide();setTimeout(function(){self.grid.footersTable().show()},0)}this._setGroupAreaTextContent($(".ui-iggrid-groupbyarea .ui-iggrid-groupbyareatext",this.grid.container()));if(this.grid.options.width!==null&&this.grid.options.width!==undefined){this.grid._updateGridContentWidth()}}this.grid._onGroupedColumnsChanged(this.options.groupedColumns)},_clearSettings:function(layouts){var i,j,cs,k;for(i=0;i<layouts.length;i++){if(layouts[i].features&&layouts[i].features.length){for(j=0;j<layouts[i].features.length;j++){if(layouts[i].features[j].name==="GroupBy"){cs=layouts[i].features[j].columnSettings;if(cs){for(k=0;k<cs.length;k++){cs[k].isGroupBy=false}}}}}if(layouts[i].columnLayouts){this._clearSettings(layouts[i].columnLayouts)}}},ungroupAll:function(){var indent=0,i,layouts=this.grid.options.columnLayouts,cols=this.groupByColumns(),hasRoot=false;if(cols.length===0){return}this.grid._onGroupedColumnsChanging(this.options.groupedColumns);for(i=1;i<this.options.groupedColumns.length;i++){indent+=parseInt(this.options.indentation,10)}if(parseInt(this.grid.container().width(),10)>0&&!this.grid.options.width){this.grid.container().width(parseInt(this.grid.container().width(),10)-indent)}this.grid.dataSource.settings.sorting.expressions=[];this.options.groupedColumns=[];this._orderedGroupedCols=[];if(!this._hierarchical){cols=[]}else{for(i=0;i<cols.length;i++){if(!cols[i].layout){hasRoot=true;break}}if(hasRoot){cols=[]}}if(layouts){this._clearSettings(layouts)}if(this.options.groupedColumns.length===0&&cols.length===0){this.grid.element.find("colgroup").children().first().remove();if(this.grid.options.fixedHeaders){this.grid.headersTable().find("colgroup").each(function(){$(this).children("[data-skip]").first().remove()})}if(this.grid.options.fixedFooters){this.grid.footersTable().find("colgroup").each(function(){$(this).children("[data-skip]").first().remove()})}this.grid.headersTable().find("thead tr").each(function(){$(this).children("[data-skip]").first().remove()});this.grid.footersTable().find("tfoot tr").each(function(){$(this).children("[data-skip]").first().remove()})}this._isgroup=false;this._rebind();if(this.options.groupedColumns.length===0){if(this.grid.options.width!==null&&this.grid.options.width!==undefined){this.grid._updateGridContentWidth()}}this.grid._onGroupedColumnsChanged([])},_regroup:function(){var items=$(".ui-iggrid-groupbyarea",this.grid.container()).find("ul li"),groupby=this,copy;this.options.groupedColumns=[];this.grid.dataSource.settings.sorting.expressions=[];copy=this._orderedGroupedCols.slice(0);this._orderedGroupedCols=[];items.each(function(){var direction,k,layout,c,lobj,layouts=[],i;k=$(this).attr("data-key");layout=$(this).attr("data-layout");direction=$(this).find(".ui-iggrid-asc").length>0?"asc":"desc";if(layout){groupby._findLayout(layout,groupby.grid.options,layouts);lobj=layouts[0];for(i=0;lobj&&i<lobj.columns.length;i++){if(lobj.columns[i].key===k){c=lobj.columns[i];
break}}}else{c=groupby.grid.columnByKey(k)}if(layout){groupby._addSortingExpressions(groupby.grid.dataSource.settings.sorting.expressions,{fieldName:k,dir:direction,layout:layout,isGroupBy:true})}else{groupby.options.groupedColumns.push({key:k,dir:direction,col:c});groupby._addSortingExpressions(groupby.grid.dataSource.settings.sorting.expressions,{fieldName:k,dir:direction,isGroupBy:true})}groupby._orderedGroupedCols.push({key:k,dir:direction,col:c,layout:layout})});groupby._ensureLabelsOrder(copy,groupby._orderedGroupedCols,groupby.grid.options);this.grid._loadingIndicator.show();this._rebindDataSource()},_rebind:function(){this._scrolltop=$(window).scrollTop();this.grid._loadingIndicator.show();this._rebindDataSource();this._groupAreaList()},_rebindDataSource:function(){if(this.options.type==="remote"){this.grid.dataSource.dataBind()}else{if(this.grid.dataSource.settings.sorting.expressions.length>0){this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions)}this.grid._renderData()}},_renderPartialRecords:function(parentrow){if(parentrow.attr("data-loaded")){return}var dataRowId,rows,html="",i,rowsLength,scrollerHeight;dataRowId=parseInt(parentrow.attr("data-row-idx"),10);if(dataRowId>=0){rows=this._groups[dataRowId]}if(!rows){return}rowsLength=rows.length;for(i=0;i<rowsLength;i++){html+=rows[i]}$(html).insertAfter(parentrow);scrollerHeight=this.grid._getScrollContainerHeight();this._addScrollHeight=parentrow.outerHeight()*rowsLength;this.grid._setScrollContainerHeight(scrollerHeight+this._addScrollHeight);parentrow.attr("data-loaded",true)},_toggleGroup:function(event,args){var parentrow=$(event.target).closest("tr"),grid,i,el,currentLevel,cindex,glevel=parentrow.attr("data-glevel"),grouprow,rowPath=[],level=glevel,style;cindex=parentrow.index();if(this._hierarchical){grid=parentrow.closest(".ui-iggrid-table").data("igGrid")}else{grid=this.grid}if(parentrow.attr("data-state")==="expanded"){parentrow.attr("data-state","collapsed").find(".ui-iggrid-expandbutton").attr("title",this.options.expandTooltip).removeClass(this.css.groupByExpandCellExpanded).addClass(this.css.groupByExpandCellCollapsed)}else{parentrow.attr("data-state","expanded").find(".ui-iggrid-expandbutton").attr("title",this.options.collapseTooltip).removeClass(this.css.groupByExpandCellCollapsed).addClass(this.css.groupByExpandCellExpanded);if(this._getTotalRowCountHandler){this._renderPartialRecords(parentrow)}}rowPath[glevel]=parentrow;grid.element.children("tbody").children().each(function(index,element){if(index>cindex){var $this=$(this);grouprow=$this.attr("data-grouprow");level=$this.attr("data-glevel");if(grouprow==="true"&&level<=glevel){return false}if(grouprow){currentLevel=level}else{currentLevel=parseInt(rowPath[rowPath.length-1].attr("data-glevel"),10)+1}style="";for(i=0;i<currentLevel;i++){if(rowPath[i]!==undefined&&rowPath[i].attr("data-state")!=="expanded"){style="none";break}}$this.css("display",style);if(grouprow){rowPath[parseInt($this.attr("data-glevel"),10)]=$this}}});for(el in rowPath){if(rowPath.hasOwnProperty(el)){el=null;$.ig.removeFromArray(rowPath,el)}}this.grid._adjustLastColumnWidth(false);event.stopPropagation()},_groupAreaList:function(){var area=$(".ui-iggrid-groupbyarea",this.grid.container()),layout,allgrouped=[],dropFunc,mousedownFunc,list=area.find("ul"),i,groupby=this,css,key,item,itemEdge,helperFunc,overFunc,outFunc,text;allgrouped=this.groupByColumns();if(list.length>0){list.empty()}else{list=$("<ul></ul>").appendTo(area).addClass("ui-iggrid-grouparealist")}helperFunc=function(event){var li=null;if($(event.target).is("li")){li=$(event.target)}else{li=$(event.target).closest("li")}li=li.clone();li.find(".ui-iggrid-groupbylabelrightedgeend").remove();li.find(".ui-iggrid-groupbylabelrightedge").remove();li.find(".ui-iggrid-groupbyremovebutton").remove();li.attr("data-dragging",true);return li};overFunc=function(event,ui){if(!ui.draggable.hasClass("ui-iggrid-groupedcolumnlabel")){return false}if(ui.draggable.attr("data-key")===$(this).attr("data-key")){return false}$(event.target).addClass("ui-iggrid-groupbydroppableedge")};outFunc=function(event,ui){if(!ui.draggable.hasClass("ui-iggrid-groupedcolumnlabel")){return false}if(ui.draggable.attr("data-key")===$(this).attr("data-key")){return false}$(event.target).removeClass("ui-iggrid-groupbydroppableedge")};dropFunc=function(event,ui){var parent,dragged;$(this).removeClass("ui-iggrid-groupbydroppableedge");if(!ui.draggable.hasClass("ui-iggrid-groupedcolumnlabel")){return}if(ui.draggable.attr("data-key")!==$(this).attr("data-key")){parent=$(this).closest("ul");dragged=parent.find("li[data-key="+ui.draggable.attr("data-key")+"]").first();dragged.insertAfter(this);parent.find("li[data-dragging=true]").remove();parent.find("li").removeClass("ui-iggrid-groupbydroppableedge");groupby._regroup();groupby._groupAreaList();event.preventDefault();event.stopPropagation();return false}return};mousedownFunc=function(event){event.preventDefault();event.stopPropagation();return false};for(i=0;i<allgrouped.length;i++){key=allgrouped[i].key;layout=allgrouped[i].layout;text=allgrouped[i].col.headerText;if(allgrouped[i].dir==="asc"){css="ui-iggrid-asc ui-icon ui-icon-arrowthick-1-n"}else{css="ui-iggrid-desc ui-icon ui-icon-arrowthick-1-s"}item=$("<li></li>").appendTo(list).addClass(this.css.groupedColumnLabel).css("float","left").attr("data-key",key).attr("data-layout",layout||"").bind({mouseup:$.proxy(this._changeSortState,this)}).draggable({containment:"body",appendTo:"parent",distance:5,revert:"invalid",helper:helperFunc}).droppable({accept:"li",over:overFunc,out:outFunc,drop:dropFunc});if(this.options.groupByLabelWidth!==null){item.width(this.options.groupByLabelWidth)}itemEdge=$("<span></span>").appendTo(item).css({"float":"right"}).addClass(this.css.groupedColumnLabel).addClass(this.css.groupedColumnLabelRightEdgeEnd);itemEdge.attr("data-marker","edge");item.prev().find("span[data-marker]").removeClass(this.css.groupedColumnLabelRightEdgeEnd).addClass(this.css.groupedColumnLabelRightEdge);if(layout){$("<span></span>").appendTo(item).text(text).addClass(this.css.groupedColumnLabelText);$("<span></span>").prependTo(item).text(layout).addClass(this.css.groupedColumnLayoutLabel)}else{$("<span></span>").appendTo(item).text(text)}$("<span></span>").appendTo(item).addClass(css);if(typeof Modernizr!=="object"||Modernizr.touch===false){$("<span></span>").appendTo(item).addClass("ui-iggrid-groupbyremovebutton").attr("title",groupby.options.removeButtonTooltip).bind({mouseup:$.proxy(groupby._removeButtonClick,groupby),mousedown:mousedownFunc})}if($.ig.util.isIE7&&item.width()>300){item.width(260)}else{item.width(Math.ceil(item.width())+22)}}list.children().bind({mouseover:$.proxy(this._showRemoveButton,this),mouseout:$.proxy(this._hideRemoveButton,this)})},_changeSortState:function(event){var li=$(event.target).closest("li"),key=li.attr("data-key"),i,layout=li.attr("data-layout"),layouts,j,gc=this._orderedGroupedCols,s=this.grid.dataSource.settings.sorting.expressions,settings,lobj;for(i=0;i<gc.length;i++){if(gc[i].key===key&&(layout&&layout===gc[i].layout||!layout)){if(gc[i].dir==="asc"){gc[i].dir="desc"}else{gc[i].dir="asc"}for(j=0;j<s.length;j++){if(s[j].fieldName===key&&(layout&&layout===s[j].layout||!layout)){s[j].dir=gc[i].dir;break}}this._rebind();break}}if(layout){layouts=[];this._findLayout(layout,this.grid.options,layouts);lobj=layouts[0];for(i=0;lobj.features&&i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){settings=lobj.features[i].columnSettings;for(j=0;j<settings.length;j++){if(settings[j].columnKey===key){settings[j].dir=settings[j].dir==="asc"?"desc":"asc";break}}break}}this._rebind()}},_showRemoveButton:function(event){var button=$(event.target).closest("li").find(".ui-iggrid-groupbyremovebutton"),key=$(event.target).closest("li").attr("data-key"),layout=$(event.target).closest("li").attr("data-layout");if(!key){return}button.attr("data-key",key).attr("data-layout",layout).addClass("ui-icon ui-icon-circle-close")},_hideRemoveButton:function(event){var button=$(event.target).closest("li").find(".ui-iggrid-groupbyremovebutton");button.removeClass("ui-icon ui-icon-circle-close");$(event.target).closest("li").removeClass("ui-state-hover")},_removeButtonClick:function(event){var key=$(event.target).attr("data-key"),noCancel,layout;if(this._isDragging){return}noCancel=this._trigger(this.events.groupedColumnsChanging,event,{owner:this,groupedColumns:this.options.groupedColumns,key:key});if(noCancel){layout=$(event.target).attr("data-layout");this.ungroupByColumn(key,layout);this._trigger(this.events.groupedColumnsChanged,event,{owner:this,groupedColumns:this.options.groupedColumns,key:key})}event.preventDefault();event.stopPropagation();return false},destroy:function(){var modalDialog=$("#"+this.grid.id()+"_groupby_modalDialog");this.grid.container().find(".ui-iggrid-groupbyarea").remove();if(this.grid._initialized){this.ungroupAll()}this._detachEvents(true);modalDialog.igGridModalDialog("getCaptionButtonContainer");modalDialog.remove();$.Widget.prototype.destroy.call(this);return this},_detachEvents:function(isDestroyDraggable){var ths=this.grid.headersTable().find("th"),i;if(isDestroyDraggable===true){for(i=0;i<ths.length;++i){if($(ths[i]).data().draggable){$(ths[i]).draggable("destroy")}}}ths.unbind("mouseover",this._headerMouseOverHandler).unbind("mouseout",this._headerMouseOutHandler);$(document).undelegate("#"+this.grid.id()+"_container td[gbexpandcell=1]","mousedown",this._toggleGroupHandler);this.grid.element.unbind("iggridheaderrenderedinternal",this._headerRenderedHandler);this.grid.element.unbind("iggriddataempty",this._dataRenderingHandler);this.grid.element.unbind("iggridrowsrendering",this._rowsRenderingHandler);this.grid.element.unbind("iggridrowsrendered",this._rowsRenderedHandler);this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("iggridheadercelldragcancel",this._headerDragCancelHandler);this.grid.element.unbind("iggriduidirty",this._uiDirtyHandler);this.grid.element.unbind("iggriddatabound",this._dataBoundHandler);if(this._columnsCollectionModifiedHandler){this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)}if(isDestroyDraggable===true){delete this._dataRenderingHandler;delete this._rowsRenderingHandler;delete this._rowsRenderedHandler;delete this._headerCellRenderedHandler;delete this._headerDragCancelHandler;delete this._uiDirtyHandler;delete this._columnsCollectionModifiedHandler}},_initDefaultSettings:function(){var settings=[],key,cs=this.options.columnSettings,i,j,allowGroupBy,isToCheckUnboundColumns=this.grid._hasUnboundColumns===true&&this.options.type==="remote";this._orderedColumnSettings=[];if(this.grid.options.columns&&this.grid.options.columns.length>0){for(i=0;i<this.grid.options.columns.length;i++){allowGroupBy=true;if(isToCheckUnboundColumns&&this.grid.getUnboundColumnByKey(this.grid.options.columns[i].key)!==null){allowGroupBy=false}settings[i]={columnIndex:i,columnKey:this.grid.options.columns[i].key,allowGrouping:allowGroupBy,summaries:[],isGroupBy:false}}}if(settings.length===0&&this.grid.options.autoGenerateColumns&&cs.length>0){for(i=0;i<cs.length;i++){if(!cs[i].columnKey){continue}if(!cs[i].dir){cs[i].dir=this.options.defaultSortingDirection||"asc"}this._orderedColumnSettings.push(cs[i])}}else{for(i=0;i<cs.length;i++){for(j=0;j<settings.length;j++){if(settings[j].columnKey===cs[i].columnKey||settings[j].columnIndex===cs[i].columnIndex){break}}if(j===settings.length){continue}for(key in cs[i]){if(cs[i].hasOwnProperty(key)&&key!=="columnKey"&&key!=="columnIndex"){settings[j][key]=cs[i][key]}}if(settings[j].dir===undefined&&this.options.defaultSortingDirection){settings[j].dir=this.options.defaultSortingDirection}this._orderedColumnSettings.push(settings[j])}}this.options.columnSettings=settings;for(i=0;this.grid._headerInitCallbacks&&i<this.grid._headerInitCallbacks.length;i++){if(this.grid._headerInitCallbacks[i].type==="GroupBy"){$.ig.removeFromArray(this.grid._headerInitCallbacks,i);break}}for(i=0;this.grid._footerInitCallbacks&&i<this.grid._footerInitCallbacks.length;i++){if(this.grid._footerInitCallbacks[i].type==="GroupBy"){$.ig.removeFromArray(this.grid._footerInitCallbacks,i);break}}},_renderExtraFooterCells:function(row,colgroup,prepend){if(this.options.groupedColumns.length>0){if(prepend===true){$("<td></td>").addClass(this.css.footerExtraCell).prependTo(row).attr("data-skip",true)}else{$("<td></td>").addClass(this.css.footerExtraCell).appendTo(row).attr("data-skip",true)}}},_renderExtraHeaderCells:function(row,colgroup,prepend){if(this.options.groupedColumns.length>0){if(prepend===true){$("<td></td>").prependTo(row).addClass(this.css.headerExtraCell).attr("data-skip",true);if(colgroup){$("<col />").prependTo(colgroup).attr("data-skip",true).css("width",this.options.indentation)}}else{$("<td></td>").appendTo(row).addClass(this.css.headerExtraCell).attr("data-skip",true);if(colgroup){$("<col />").appendTo(colgroup).attr("data-skip",true).css("width",this.options.indentation)}}}},_columnsCollectionModified:function(event,args){var colGroup;if(args.owner.id()!==this.grid.id()){return}args.tbody=this.grid.element.children("tbody");if(this.options.groupedColumns.length>0){colGroup=this.grid.headersTable().children("colgroup");if(colGroup.children("[data-registeredCol=true]").length===0){$("<col />").prependTo(colGroup).attr("data-skip","true").attr("data-registeredCol","true").width(this._indent)}else{colGroup.children("col:nth-child(1)").width(this._indent)}if(this.grid.headersTable().attr("id")!==this.grid.element.attr("id")){$("<col />").prependTo(this.grid.element.children("colgroup")).attr("data-skip","true").width(this._indent)}if(this.grid.footersTable().attr("id")!==this.grid.element.attr("id")){$("<col />").prependTo(this.grid.footersTable().children("colgroup")).attr("data-skip","true").width(this._indent)}if(this.grid.options.width===null){this.grid._setContainerWidth(this.grid.container())}else{this.grid._updateGridContentWidth()}}this._dataEmpty(event,args)},_onUIDirty:function(event,args){this.ungroupAll()},_onDataBound:function(event,args){if(this.options.groupedColumns.length>0&&this.grid._isDataBoundCalled){this.grid._trigger("headerExtraCellsModified",null,{owner:this})}},_injectGrid:function(gridInstance){var i,gc,gcsort,s,root=null,orderedGrouped=null,layoutGrouped=null;this.grid=gridInstance;if(this.options.type===null){this.options.type=this.grid._inferOpType()}root=this.element.closest(".ui-iggrid-root");if(root.is("div")){root=root.find("#"+root.attr("id")+"_table")}root=root.data("igGridGroupBy");if(root){orderedGrouped=root._orderedGroupedCols;if(orderedGrouped&&orderedGrouped.length>0&&this.grid.options.key){layoutGrouped=[];for(i=0;i<orderedGrouped.length;i++){if(this.grid.options.key===orderedGrouped[i].layout){layoutGrouped.push(orderedGrouped[i])}}}}for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="ColumnMoving"){this._movingEnabled=true;break}}this._dataBoundHandler=$.proxy(this._onDataBound,this);this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._dataRenderingHandler=$.proxy(this._dataEmpty,this);this._toggleGroupHandler=$.proxy(this._toggleGroup,this);this._rowsRenderingHandler=$.proxy(this._renderRecords,this);this._rowsRenderedHandler=$.proxy(this._recordsRendered,this);this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._headerDragCancelHandler=$.proxy(this._headerCellDragCancel,this);if(this.grid.options.virtualization===true&&this.grid.options.virtualizationMode==="continuous"){this._rebuildVirtualRowsHandler=$.proxy(this._rebuildVirtualRows,this);this.grid.element.bind("iggridrebuildingvirtualrows",this._rebuildVirtualRowsHandler);this.grid._getTotalRowsCount=$.proxy(this._getTotalRowsCount,this)}this._detachEvents();this.grid.element.bind("iggridheaderrenderedinternal",this._headerRenderedHandler);this.grid.element.bind("iggriddatabound",this._dataBoundHandler);this.grid.element.bind("iggriddataempty",this._dataRenderingHandler);this.grid.element.bind("iggridrowsrendering",this._rowsRenderingHandler);this.grid.element.bind("iggridrowsrendered",this._rowsRenderedHandler);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.bind("iggridheadercelldragcancel",this._headerDragCancelHandler);this._headerMouseOverHandler=function(event){$(event.currentTarget).addClass("ui-state-hover")};this._headerMouseOutHandler=function(event){$(event.currentTarget).removeClass("ui-state-hover")};this.grid.dataSource.settings.sorting.sortUrlKey=this.options.groupByUrlKey;this.grid.dataSource.settings.sorting.sortUrlAscValueKey=this.options.groupByUrlKeyAscValue;this.grid.dataSource.settings.sorting.sortUrlDescValueKey=this.options.groupByUrlKeyDescValue;if(this.options.type){this.grid.dataSource.settings.sorting.type=this.options.type}else{this.grid.dataSource.settings.sorting.type="remote"}this.grid.dataSource.settings.encodeExtraParams=$.proxy(this._encodeSummaryParams,this);this._initDefaultSettings();this.options.groupedColumns=[];if(!this.grid.options.key&&(layoutGrouped===null||layoutGrouped.length===0)){for(i=0;i<this._orderedColumnSettings.length;i++){if(this._orderedColumnSettings[i].isGroupBy){s=this._orderedColumnSettings[i];gc={key:s.columnKey,dir:s.dir||"asc",col:this.grid.columnByKey(s.columnKey)};this.options.groupedColumns.push(gc);gcsort={fieldName:s.columnKey,dir:s.dir||"asc",layout:this.grid.options.key,isGroupBy:true};if(this.options.type==="local"){gcsort.layout=null;this.grid.dataSource.settings.sorting.defaultFields.push(gcsort)}this._addSortingExpressions(this.grid.dataSource.settings.sorting.expressions,gcsort)}}}else{for(i=0;layoutGrouped!==null&&i<layoutGrouped.length;i++){this.options.groupedColumns.push(layoutGrouped[i]);gcsort={fieldName:layoutGrouped[i].key,dir:layoutGrouped[i].dir||"asc",layout:this.grid.options.key,isGroupBy:true};if(this.options.type==="local"){gcsort.layout=null;this.grid.dataSource.settings.sorting.defaultFields.push(gcsort)}this._addSortingExpressions(this.grid.dataSource.settings.sorting.expressions,gcsort)}}if(this.grid.element.closest(".ui-iggrid-root").length===0||this.grid.element.hasClass("ui-iggrid-root")||this.grid._isWrapped){$(document).delegate("#"+this.grid.id()+"_container td[gbexpandcell=1]","mousedown",this._toggleGroupHandler)}this._renderExtraHeaderCellHandler=$.proxy(this._renderExtraHeaderCells,this);this._renderExtraFooterCellHandler=$.proxy(this._renderExtraFooterCells,this);this.grid._headerInitCallbacks.push({type:"GroupBy",func:this._renderExtraHeaderCellHandler});this.grid._footerInitCallbacks.push({type:"GroupBy",func:this._renderExtraFooterCellHandler});this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this._uiDirtyHandler=$.proxy(this._onUIDirty,this);this.grid.element.bind("iggriduidirty",this._uiDirtyHandler);if(this.grid.element.igGridFeatureChooser!==undefined){this.grid.element.igGridFeatureChooser()}this._hierarchical=this.grid._isHierarchicalGrid;this._allGroupedCols(this._orderedGroupedCols)},_tokenizeTBody:function(html){var start=0,trTokens=[],index=0,begin,end,tr;while(true){begin=html.indexOf("<tr",start);end=html.indexOf("</tr>",start);if(begin===-1||end===-1){break}tr=html.substr(begin,end+5-begin);tr=tr.substr(0,3)+' data-row-idx="'+index++ +'" '+tr.substr(3);trTokens.push(tr);if(end+5<html.length-1){start=end+5}else{break}}return trTokens},_determineVirtualRowCount:function(allRows,displayContainerHeight){var div,rowNumber,rows,i,height,avgRowHeight,rowsPerPage,result;div=$("<div></div>)").appendTo("body").css({position:"absolute",top:-1800,left:-1800,visibility:"hidden"});rowNumber=allRows.length>10?10:allRows.length;rows="";for(i=0;i<rowNumber;i++){rows+=allRows[i]}div.html(rows);height=div.height();avgRowHeight=height/rowNumber;rowsPerPage=displayContainerHeight/avgRowHeight;result=Math.ceil(rowsPerPage*3);div.remove();return result},_getTotalRowsCount:function(){if(this.options.groupedColumns.length>0){if(this._getTotalRowCountHandler){return this._countGroupedRows}return this._groupedRows.length}return this.grid.dataSource.dataView().length},_rebuildVirtualRows:function(event,args){var scrollData,scrollResult,virtualScrollerY,deltaScroll,tableId,visibleArea,tbody,expandedRowsHeight,trs,i,scrollerHeight,firstVisibleTR,firstVisibleTRRelativeOffset,startIndexToBeLoaded,dataRowIndexToBeFirst,endIndexToBeLoaded,hasOverflow,tr,lastVisibleTR,lastVisibleTRIndex,firstVisibleTRIndex,rowsHtml,newFirstVisibleRow,start,end,displayContainerScrollTop,avgRowHeight,maxScrollPos;if(args.owner.id()!==this.grid.id()){return}if(this.options.groupedColumns.length===0){return true}scrollData=args.scrollData;scrollResult=args.scrollResult;virtualScrollerY=scrollData.virtualScrollerY;deltaScroll=scrollData.deltaScroll;tableId="#"+this.element[0].id;visibleArea=scrollData.visibleArea;tbody=$(tableId+" > tbody");expandedRowsHeight=0;tableId="#"+this.element[0].id;trs=$(tableId+" > tbody > tr[data-container='true']");for(i=0;i<trs.length;i++){expandedRowsHeight+=$(trs[i]).outerHeight()}if(expandedRowsHeight>0){scrollerHeight=this.grid._getScrollContainerHeight();this.grid._setScrollContainerHeight(scrollerHeight-expandedRowsHeight)}if(deltaScroll>0&&scrollResult.action==="SA_NEED_NEXT_PAGE"){firstVisibleTR=this.grid._getFirstVisibleTR(visibleArea);firstVisibleTRRelativeOffset=Math.abs(firstVisibleTR[0].offsetTop-visibleArea.top);startIndexToBeLoaded=parseInt(firstVisibleTR.attr("data-row-idx"),0);dataRowIndexToBeFirst=startIndexToBeLoaded;endIndexToBeLoaded=parseInt(this._virtualRowCount,0)+startIndexToBeLoaded-1;hasOverflow=false;if(endIndexToBeLoaded>this._groupedRows.length-1){endIndexToBeLoaded=this._groupedRows.length-1;startIndexToBeLoaded=endIndexToBeLoaded-this._virtualRowCount+1;hasOverflow=true}tbody.empty();rowsHtml="";for(i=startIndexToBeLoaded;i<=endIndexToBeLoaded;i++){rowsHtml+=this._groupedRows[i]}tbody.html(rowsHtml);if(hasOverflow){tr=$(tableId+" > tbody > tr[data-row-idx='"+dataRowIndexToBeFirst+"']");firstVisibleTRRelativeOffset=tr[0].offsetTop+firstVisibleTRRelativeOffset}this.grid._setDisplayContainerScrollTop(firstVisibleTRRelativeOffset+deltaScroll)}if(deltaScroll<0&&scrollResult.action==="SA_NEED_PREV_PAGE"){lastVisibleTR=this.grid._getLastVisibleTR(visibleArea);lastVisibleTRIndex=parseInt(lastVisibleTR.attr("data-row-idx"),0);firstVisibleTR=this.grid._getFirstVisibleTR(visibleArea);firstVisibleTRIndex=parseInt(firstVisibleTR.attr("data-row-idx"),0);endIndexToBeLoaded=lastVisibleTRIndex;startIndexToBeLoaded=endIndexToBeLoaded-parseInt(this._virtualRowCount,0)+1;if(startIndexToBeLoaded<0){startIndexToBeLoaded=0;endIndexToBeLoaded=startIndexToBeLoaded+this._virtualRowCount-1}tbody.empty();rowsHtml="";for(i=startIndexToBeLoaded;i<=endIndexToBeLoaded;i++){rowsHtml+=this._groupedRows[i]}tbody.html(rowsHtml);tableId="#"+this.element[0].id;newFirstVisibleRow=$(tableId+' > tbody > tr[data-row-idx="'+firstVisibleTRIndex+'"]');this.grid._setDisplayContainerScrollTop(newFirstVisibleRow[0].offsetTop+deltaScroll)}if(scrollResult.action==="SA_NEED_SOME_PAGE"){start=Math.floor(virtualScrollerY/this._avgRowHeight);end=start+this._virtualRowCount-1;if(start<0){start=0;end=start+this._virtualRowCount-1}if(end>=this._groupedRows.length-1){end=this._groupedRows.length-1;start=end-this._virtualRowCount+1}tbody.empty();rowsHtml="";for(i=start;i<=end;i++){rowsHtml+=this._groupedRows[i]}tbody.html(rowsHtml);displayContainerScrollTop=0;maxScrollPos=this.grid._getScrollContainerHeight()-this.grid._getDisplayContainerHeight();if(maxScrollPos-3<=virtualScrollerY&&virtualScrollerY<=maxScrollPos+3){displayContainerScrollTop=1e4}this.grid._setDisplayContainerScrollTop(displayContainerScrollTop)}if(this._addScrollHeight){scrollerHeight=this.grid._getScrollContainerHeight();this.grid._setScrollContainerHeight(scrollerHeight-this._addScrollHeight);this.grid.element.height("")}avgRowHeight=this.grid._calculateAvgRowHeight();if(avgRowHeight>this._avgRowHeight){this._avgRowHeight=avgRowHeight}return false}});$.extend($.ui.igGridGroupBy,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Column Hiding 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridHiding",{options:{columnSettings:[{columnKey:null,columnIndex:null,allowHiding:true,hidden:false}],hiddenColumnIndicatorHeaderWidth:7,columnChooserContainment:"owner",columnChooserWidth:350,columnChooserHeight:"",dropDownAnimationDuration:500,columnChooserCaptionText:$.ig.GridHiding.locale.columnChooserCaptionLabel,columnChooserDisplayText:$.ig.GridHiding.locale.columnChooserDisplayText,hiddenColumnIndicatorTooltipText:$.ig.GridHiding.locale.hiddenColumnIndicatorTooltipText,columnHideText:$.ig.GridHiding.locale.columnHideText,columnChooserShowText:$.ig.GridHiding.locale.columnChooserShowText,columnChooserHideText:$.ig.GridHiding.locale.columnChooserHideText,columnChooserHideOnClick:false,columnChooserResetButtonLabel:$.ig.GridHiding.locale.columnChooserResetButtonLabel,columnChooserAnimationDuration:200,columnChooserButtonApplyText:$.ig.GridHiding.locale.columnChooserButtonApplyText,columnChooserButtonCancelText:$.ig.GridHiding.locale.columnChooserButtonCancelText},css:{columnChooser:"ui-dialog ui-draggable ui-resizable ui-iggrid-dialog ui-widget ui-widget-content ui-corner-all",columnChooserHeaderCaption:"ui-dialog-titlebar ui-iggrid-columnchooser-caption ui-widget-header ui-corner-top ui-helper-reset ui-helper-clearfix",columnChooserHeaderCaptionTitle:"ui-dialog-title ui-iggrid-columnchooser-caption-title",columnChooserContent:"ui-dialog-content ui-iggrid-columnchooser-content",hidingHeaderIndicator:"ui-iggrid-hiding-indicator",columnChooserHandleBar:"ui-iggrid-columnchooser-handlebar",hiddenColumnIndicator:"ui-iggrid-hiding-hiddencolumnindicator",hiddenColumnIndicatorSelected:"ui-iggrid-hiding-indicator-selected",hiddenColumnIndicatorMouseOver:"ui-iggrid-hiding-indicator-mouseover",hiddenColumnsDropDown:"ui-iggrid-featurechooser-dropdown-dialog ui-widget ui-widget-content ui-corner-all",hiddenColumnsDropDownList:"ui-iggrid-featurechooser-list ui-menu",hiddenColumnsDropDownItem:"ui-iggrid-featurechooserddlistitemicons ui-state-default",hiddenColumnsDropDownItemHover:"ui-iggrid-featurechooser-listitem-hover ui-state-active ui-state-hover",hiddenColumnsDropDownItemText:"ui-iggrid-featurechooserddlistitemtext",columnChooserListItems:"ui-iggrid-columnchooser-listitems",columnChooserItem:"ui-iggrid-columnchooser-item ui-widget-content",columnChooserItemHidden:"ui-iggrid-columnchooser-itemhidden",columnChooserHideButton:"ui-iggrid-columnchooser-hidebutton",columnChooserItemText:"ui-iggrid-dialog-text",featureChooserHidingIcon:"ui-icon ui-iggrid-icon-hide",featureChooserModalDialogIcon:"ui-icon ui-icon-newwin"},events:{columnHiding:"columnHiding",multiColumnHiding:"multiColumnHiding",columnHidden:"columnHidden",columnShowing:"columnShowing",columnShown:"columnShown",columnChooserOpening:"columnChooserOpening",columnChooserOpened:"columnChooserOpened",columnChooserMoving:"columnChooserMoving",columnChooserClosing:"columnChooserClosing",columnChooserClosed:"columnChooserClosed",columnChooserContentsRendering:"columnChooserContentsRendering",columnChooserContentsRendered:"columnChooserContentsRendered",columnChooserButtonApplyClick:"columnChooserButtonApplyClick",columnChooserButtonResetClick:"columnChooserButtonResetClick"},renderInFeatureChooser:true,_headerHashDataKey:"igGrid-hiding-hash",_createWidget:function(options,element){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_setOption:function(key,value){throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+key)},destroy:function(){var self=this,fc,modalDialog=$("#"+this.grid.id()+"_hiding_modalDialog");this.grid.element.unbind(".hiding");this.grid.headersTable().find("thead > tr > th").not("[data-skip=true]").each(function(){var th=$(this);th.find("a[data-hiding-indicator=true]").remove();self._clearHiddenColumnIndicator(true,th);self._clearHiddenColumnIndicator(false,th)});$("div[data-hiding-inddropdown='"+this.grid.id()+"']").remove();this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this.grid.element.unbind("iggriduidirty",this._uiDirtyHandler);this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggrid_columnsmoved",this._columnsMovedHandler);modalDialog.igGridModalDialog("getCaptionButtonContainer");modalDialog.remove();fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("Hiding");fc._removeFeature("ColumnChooser")}$.Widget.prototype.destroy.call(this);return this},showColumnChooser:function(){this._openColumnChooser(false)},hideColumnChooser:function(){this._closeColumnChooser(false)},showColumn:function(column,isMultiColumnHeader){var i,colToShow,len,arrIds=[];if(isMultiColumnHeader===true){colToShow=this.grid._getMultiHeaderColumnById(column);if(colToShow===null){return}len=colToShow.children.length;for(i=0;i<len;i++){arrIds.push(colToShow.children[i].key)}this.showMultiColumns(arrIds);colToShow.hidden=false;colToShow.colspan=len}else{this.grid.showColumn(column)}},hideColumn:function(column,isMultiColumnHeader){var i,colToHide,len,arrIds=[];if(isMultiColumnHeader===true){colToHide=this.grid._getMultiHeaderColumnById(column);if(colToHide===null){return}len=colToHide.children.length;for(i=0;i<len;i++){arrIds.push(colToHide.children[i].key)}this.hideMultiColumns(arrIds);colToHide.hidden=true;colToHide.colspan=0}else{this.grid.hideColumn(column)}},hideMultiColumns:function(columns){var i,columnsLength=columns.length;for(i=0;i<columnsLength;i++){this.grid.hideColumn(columns[i])}},showMultiColumns:function(columns){var i,columnsLength=columns.length;for(i=0;i<columnsLength;i++){this.grid.showColumn(columns[i])}},_showColumnFromUI:function(column){var self=this,columnKey,columnIndex,noCancel;if(typeof column==="number"){columnIndex=column}else{columnKey=column}noCancel=this._trigger(this.events.columnShowing,null,{owner:this,columnKey:columnKey,columnIndex:columnIndex});if(noCancel){self.grid._loadingIndicator.show();setTimeout(function(){self.grid._setHidden(column,false);self._trigger(self.events.columnShown,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex});self.grid._loadingIndicator.hide()},0)}return noCancel},_setHiddenMultipleColumns:function(columnsToShow,columnsToHide){var self=this,columnKey,columnIndex;self.grid._loadingIndicator.show();setTimeout(function(){var i,column,noCancel;for(i=0;i<columnsToShow.length;i++){column=columnsToShow[i];if(typeof column==="number"){columnIndex=column}else{columnKey=column}noCancel=self._trigger(self.events.columnShowing,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex});if(noCancel){self.grid._setHidden(column,false);self._trigger(self.events.columnShown,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex})}}for(i=0;i<columnsToHide.length;i++){column=columnsToHide[i];if(self.grid._visibleColumns().length===1){break}if(typeof column==="number"){columnIndex=column}else{columnKey=column}noCancel=self._trigger(self.events.columnHiding,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex});if(noCancel){self.grid._setHidden(column,true);self._trigger(self.events.columnHidden,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex})}}self.grid._loadingIndicator.hide()},0)},_hideMultiColumnFromUI:function(id){var i,self=this,column,children,columnKey,childrenLength,noCancel,visibleChildrenLength=0,columnKeysToHide=[],columnKeysHidden=[];if(self.grid._visibleColumns().length===1){return false}column=this.grid._getMultiHeaderColumnById(id);if(column===null){return}children=column.children;childrenLength=children.length;for(i=0;i<childrenLength;i++){if(!children[i].hidden){visibleChildrenLength++}}if(self.grid._visibleColumns().length-visibleChildrenLength<1){return false}for(i=0;i<childrenLength;i++){columnKeysToHide.push(children[i].key)}noCancel=this._trigger(this.events.multiColumnHiding,null,{owner:this,columnKeys:columnKeysToHide});if(noCancel){self.grid._loadingIndicator.show();setTimeout(function(){for(i=0;i<childrenLength;i++){columnKey=columnKeysToHide[i];noCancel=self._trigger(self.events.columnHiding,null,{owner:self,columnKey:columnKey,columnIndex:undefined});if(noCancel){if(children[i].allowHiding&&!children[i].hidden){self.grid._setHidden(columnKey,true);columnKeysHidden.push(columnKey);self._trigger(self.events.columnHidden,null,{owner:self,columnKey:columnKey,columnIndex:undefined})}}}column.hidden=true;column.colspan=0;self._trigger(self.events.multiColumnHidden,null,{owner:self,columnKeys:columnKeysHidden});self.grid._loadingIndicator.hide()},0)}},_hideColumnFromUI:function(column){var self=this,columnKey,columnIndex,noCancel;if(self.grid._visibleColumns().length===1){return false}if(typeof column==="number"){columnIndex=column}else{columnKey=column}noCancel=this._trigger(this.events.columnHiding,null,{owner:this,columnKey:columnKey,columnIndex:columnIndex});if(noCancel){if(!self.grid._allColumnWidthsInPixels&&$.ig.util.isFF){self.grid._refreshUI()}self.grid._loadingIndicator.show();setTimeout(function(){self.grid._setHidden(column,true);self._trigger(self.events.columnHidden,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex});self.grid._loadingIndicator.hide()},0)}return noCancel},_headerCellRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(ui.isMultiColumnHeader===true){return}var i,col,featureChooserInstance=this.grid.element.data("igGridFeatureChooser");if(!this._featureChooserInitialized){this._featureChooserInitialized=true;this._hidingIconColumnKeys=[];for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i];if(this._getColumnSettingsByIndex(i).allowHiding){if(featureChooserInstance._shouldRenderInFeatureChooser(col.key)===true){featureChooserInstance._renderInFeatureChooser(col.key,{name:"Hiding",text:this.options.columnHideText,iconClass:this.css.featureChooserHidingIcon,isSelectable:false,isSelected:false,method:$.proxy(this._featureChooserHide,this),updateOnClickAll:false,groupName:"click",groupOrder:2,order:2});featureChooserInstance._renderInFeatureChooser(col.key,{name:"ColumnChooser",text:this.options.columnChooserDisplayText,secondaryIconClass:this.css.featureChooserModalDialogIcon,method:$.proxy(this._featureChooserColumnChooser,this),groupName:"modaldialog",groupOrder:3,order:1})}else{this._hidingIconColumnKeys.push(col.key)}}}}},_featureChooserHide:function(event,columnKey,isSelected){this._closeColumnChooser(true);this._hideColumnFromUI(columnKey)},_featureChooserColumnChooser:function(event,columnKey,isSelected){this._openColumnChooser(true)},_columnMap:function(){var self=this;return $.map(this.grid.options.columns,function(col,index){return{columnKey:col.key,enabled:self._getColumnSettingsByIndex(index).allowHiding}})},_renderHidingColumnIcon:function(th,columnKey,isMultiColumnHeader){var self=this,indicatorContainer=th.find(".ui-iggrid-indicatorcontainer");if(indicatorContainer.length===0){indicatorContainer=$("<div></div>").addClass("ui-iggrid-indicatorcontainer").appendTo(th)}$("<span>&laquo;</span>").addClass(this.css.hidingHeaderIndicator).appendTo(indicatorContainer).wrap($("<a></a>").css("display","inline").attr("data-hiding-indicator","true").attr("href","#").attr("title",$.ig.GridHiding.locale.hideColumnIconTooltip)).bind("click.hiding",function(event){$(this).parent().mouseout();self._closeColumnChooser(true);if(isMultiColumnHeader){self._hideMultiColumnFromUI(th.attr("data-mch-id"))}else{self._hideColumnFromUI(columnKey)}event.preventDefault();event.stopPropagation()})},_populateMultiColumnHeadersLevel0:function(){var i,j,self=this,cols=this.grid._oldCols,colsLength=cols.length,ths=$(this.grid._headerCells),level0=[],level0Length,visibleColumns=this.grid._visibleColumns();for(i=0;i<colsLength;i++){if(cols[i].level===0){level0.push(cols[i])}else{for(j=0;j<cols[i].children.length;j++){level0.push(cols[i].children[j])}}}level0Length=level0.length;ths.each(function(index){var th=$(this),col=visibleColumns[index],cs;if(col===null||col===undefined){return true}cs=self._getColumnSettingsByKey(col.key);if(cs.allowHiding){for(i=0;i<level0.length;i++){if(level0[i].key===col.key){break}}if(i<level0Length){level0[i].allowHiding=true;level0[i].visibleIndex=index;level0[i].settings=cs}th.col=level0[i]}})},_renderHidingIcons:function(){var thsMultiHeader,self=this,ths;if(self.grid._isMultiColumnGrid===true){thsMultiHeader=this.grid.headersTable().find("> thead > tr th").not("[data-skip=true]").not("[data-isheadercell=true]");this._populateMultiColumnHeadersLevel0();thsMultiHeader.each(function(index){var th=$(this);self._renderHidingColumnIcon(th,null,true)});ths=$(this.grid._headerCells)}else{ths=this.grid.headersTable().find("thead > tr > th").not("[data-skip=true]")}ths.find("a[data-hiding-indicator=true]").remove();ths.each(function(index){var th=$(this),visibleColumns=self.grid._visibleColumns(),visibleIndex,columnKey;if(self.grid.options.virtualizationMode==="fixed"&&(self.grid.options.virtualization===true||self.grid.options.columnVirtualization===true)){visibleIndex=(self.grid._startColIndex||0)+index}else{visibleIndex=index}columnKey=visibleColumns[visibleIndex].key;if($.inArray(columnKey,self._hidingIconColumnKeys)!==-1){self._renderHidingColumnIcon(th,columnKey)}})},_headerRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}this._renderHidingIcons();this._renderColumnChooser()},_columnChooserButtonOKClick:function(e){var self=this,changedColumns=self._columnsToHide,columnsToHide=[],columnsToShow=[],noCancel,modalDialog=$("#"+this.grid.id()+"_hiding_modalDialog");$.each(this.grid.options.columns,function(columnIndex,column){var cs,columnIdentifier,col;cs=self._getColumnSettingsByIndex(columnIndex);if(!cs.allowHiding){return}columnIdentifier=cs.columnKey||cs.columnIndex||column.key;col=changedColumns[columnIdentifier];if(col!==null&&col!==undefined){if(col){if(column.hidden===false){columnsToHide.push(columnIdentifier)}}else{if(column.hidden===true){columnsToShow.push(columnIdentifier)}}}});noCancel=this._trigger(this.events.columnChooserButtonApplyClick,null,{columnChooserElement:modalDialog,owner:this,columnsToHide:columnsToHide,columnsToShow:columnsToShow});if(noCancel){self._setHiddenMultipleColumns(columnsToShow,columnsToHide);$("#"+this.grid.id()+"_hiding_modalDialog").igGridModalDialog("closeModalDialog",true)}},isToRenderButtonReset:function(){var self=this,columnsToHide=self._columnsToHide,result=false;$.each(this.grid.options.columns,function(columnIndex,column){var cs,columnIdentifier,col,isHidden;cs=self._getColumnSettingsByIndex(columnIndex);if(cs&&!cs.allowHiding){return true}columnIdentifier=cs.columnKey||cs.columnIndex||column.key;col=columnsToHide[columnIdentifier];if(column._initiallyHidden===true){isHidden=true}else{isHidden=cs.hidden}if(col!==null&&col!==undefined){if(col!==isHidden){result=true;return false}}});return result},_isVisibleColumnsNotAllowHiding:function(){var self=this,res=false;$.each(this.grid.options.columns,function(columnIndex,column){var cs;cs=self._getColumnSettingsByIndex(columnIndex);if(cs&&!cs.allowHiding&&!column.hidden){res=true;return false}});return res},_columnChooserOpening:function(e,args){var $ul,noCancel,$content,self=this,o=this.options,css=this.css,countColumnsAllowHiding=0,modalDialog=$("#"+this.grid.id()+"_hiding_modalDialog");noCancel=this._trigger(this.events.columnChooserOpening,null,{columnChooserElement:modalDialog,owner:this});if(noCancel){noCancel=this._trigger(this.events.columnChooserContentsRendering,null,{columnChooserElement:modalDialog,owner:this});if(noCancel){this.removeColumnChooserResetButton();$content=modalDialog.igGridModalDialog("getContent");$content.empty();$ul=$("<ul></ul>").addClass(css.columnChooserListItems).appendTo($content);this._columnsToHide={};$.each(this.grid.options.columns,function(columnIndex,column){var cs,columnIdentifier,$a,$li;cs=self._getColumnSettingsByIndex(columnIndex);if(!cs.allowHiding){return}countColumnsAllowHiding++;columnIdentifier=cs.columnKey||cs.columnIndex||column.key;$li=$("<li></li>").attr("id",self.grid.id()+"_"+columnIdentifier+"_columnchooser_li").addClass(css.columnChooserItem).append('<span class="'+css.columnChooserHideButton+'"><a href="#"></a></span><span class="'+css.columnChooserItemText+'">'+column.headerText+"</span>");$li.appendTo($ul);$a=$li.find("a:first");if(o.columnChooserHideOnClick===true){$li.bind("click.hiding",function(event){var isHidden;if($a.attr("ishidden")==="1"){noCancel=self._showColumnFromUI(columnIdentifier);isHidden=false}else{noCancel=self._hideColumnFromUI(columnIdentifier);isHidden=true}if(noCancel){self._renderColumnChooserHideButton($a,isHidden)}event.preventDefault();event.stopPropagation();return false})}else{$li.bind("click.hiding",function(event){var isHidden;if($a.attr("ishidden")==="1"){isHidden=false}else{isHidden=true}if(isHidden&&!self._isVisibleColumnsNotAllowHiding()&&$ul.find("a[ishidden=1]").length===countColumnsAllowHiding-1){return}self._columnsToHide[columnIdentifier]=isHidden;self._renderColumnChooserHideButton($a,isHidden);if(self.isToRenderButtonReset()){self.renderColumnChooserResetButton()}else{self.removeColumnChooserResetButton()}event.preventDefault();event.stopPropagation();return false})}self._columnsToHide[columnIdentifier]=column.hidden;self._renderColumnChooserHideButton($a,column.hidden)});this._trigger(this.events.columnChooserContentsRendered,null,{columnChooserElement:modalDialog,owner:this});if(o.columnChooserHideOnClick===false&&self.isToRenderButtonReset()){self.renderColumnChooserResetButton()}}this._trigger(this.events.columnChooserOpened,null,{columnChooserElement:modalDialog,owner:this})}return true},resetHidingColumnChooser:function(){var self=this;$.each(this.grid.options.columns,function(columnIndex,column){var cs,columnIdentifier,isToHide;cs=self._getColumnSettingsByIndex(columnIndex);if(!cs){return true}if(!cs.allowHiding){return true}isToHide=cs.hidden;if(column._initiallyHidden===true){isToHide=true}columnIdentifier=cs.columnKey||cs.columnIndex||column.key;self._columnsToHide[columnIdentifier]=isToHide;self._renderColumnChooserHideButton($("#"+self.grid.id()+"_"+columnIdentifier+"_columnchooser_li a:first"),isToHide)});self.removeColumnChooserResetButton()},renderColumnChooserResetButton:function(){var o=this.options,self=this,resetButtonId=this.grid.id()+"_hiding_modalDialog_reset_button",modalDialog=$("#"+this.grid.id()+"_hiding_modalDialog"),$captionButtonContainer,$resetButton;if($("#"+resetButtonId).length===0){$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$resetButton=$("<button></button>").attr("id",resetButtonId).appendTo($captionButtonContainer);$resetButton.igButton({labelText:o.columnChooserResetButtonLabel,click:function(e){self._trigger(self.events.columnChooserButtonResetClick,e,{columnChooserElement:modalDialog,owner:self});self.resetHidingColumnChooser()}})}},removeColumnChooserResetButton:function(){$("#"+this.grid.id()+"_hiding_modalDialog_reset_button").remove()},_renderColumnChooserHideButton:function($a,isHidden){var text,attrIsHidden,css=this.css,$li=$a.closest("li");if(isHidden===false){attrIsHidden="0";text=this.options.columnChooserHideText;$li.removeClass(css.columnChooserItemHidden)}else{attrIsHidden="1";text=this.options.columnChooserShowText;$li.addClass(css.columnChooserItemHidden)}$a.attr("ishidden",attrIsHidden).text(text)},_renderColumnChooser:function(){$("#"+this.grid.id()+"_hiding_modalDialog").remove();var $buttonOK,self=this,o=this.options,$captionButtonContainer,containment=this.grid.container(),modalDialog=$("<div></div>").appendTo("body").attr("id",this.grid.id()+"_hiding_modalDialog");if(this.options.columnChooserContainment!=="owner"){containment="window"}modalDialog.igGridModalDialog({modalDialogWidth:o.columnChooserWidth,modalDialogHeight:o.columnChooserHeight,modalDialogCaptionText:o.columnChooserCaptionText,buttonApplyText:o.columnChooserButtonApplyText,buttonCancelText:o.columnChooserButtonCancelText,containment:containment,gridContainer:this.grid.container(),renderFooterButtons:!o.columnChooserHideOnClick,animationDuration:o.columnChooserAnimationDuration,modalDialogOpening:function(event,args){self._columnChooserOpening(event,args)},modalDialogMoving:function(e,ui){self._trigger(self.events.columnChooserMoving,null,{columnChooserElement:$(e.target),owner:self,originalPosition:ui.originalPosition,position:ui.position})},modalDialogClosing:function(event,args){return self._trigger(self.events.columnChooserClosing,null,{columnChooserElement:modalDialog,owner:self})},modalDialogClosed:function(event,args){self._trigger(self.events.columnChooserClosed,null,{columnChooserElement:modalDialog,owner:self})}});if(!o.columnChooserHideOnClick){$buttonOK=$("#"+this.grid.id()+"_hiding_modalDialog_footer_buttonok");$buttonOK.bind("igbuttonclick",function(e){self._columnChooserButtonOKClick(e)})}else{$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$("<span></span>").bind("click.hiding",function(event){modalDialog.igGridModalDialog("closeModalDialog",true);event.preventDefault();event.stopPropagation();return false}).addClass("ui-icon ui-icon-closethick").appendTo($("<a></a>").appendTo($captionButtonContainer).attr("title",$.ig.GridHiding.locale.columnChooserCloseButtonTooltip).attr("href","#").attr("role","button").addClass("ui-dialog-titlebar-close ui-corner-all"))}},_hidingFinished:function(){if(this.options.virtualization===true&&this.options.virtualizationMode==="fixed"){return}if(this.options.columnVirtualization===true){return}this._renderHiddenColumnIndicators()},_virtualHorizontalScroll:function(){this._renderHiddenColumnIndicators();this._renderHidingIcons()},_renderHiddenColumnIndicators:function(){var self=this,ths,i,col,visibleIndex=0,indicators=[],oldDropDowns,columns=this.grid.options.columns,columnsLength=columns.length;visibleIndex=0;for(i=0;i<columnsLength;i++){col=columns[i];if(col.hidden){if(this._getColumnSettingsByIndex(i).allowHiding){if(indicators[visibleIndex]===undefined){indicators[visibleIndex]=[]}indicators[visibleIndex].push(col.key)}}else{visibleIndex++}}oldDropDowns=$("body").children("div[data-hiding-inddropdown='"+self.grid.id()+"']");setTimeout(function(){oldDropDowns.remove()},this.options.dropDownAnimationDuration*2+1);if(visibleIndex===0){this.grid.headersTable().find("thead > tr > th[data-hiddenreplacement=true]").each(function(){var a=self._renderHiddenColumnIndicator(true,$(this));self._bindDropDownToIndicator(a.find("span"),indicators[0])})}else{if(this.grid._isMultiColumnGrid){ths=$(this.grid._headerCells)}else{ths=this.grid.headersTable().find("thead > tr > th").not("[data-skip=true]")}ths.each(function(index){var th=$(this),a;if(self.grid.options.virtualization===true&&self.grid.options.virtualizationMode==="fixed"||self.grid.options.columnVirtualization===true){visibleIndex=self.grid._startColIndex+index}else{visibleIndex=index}self._clearHiddenColumnIndicator(true,th);self._clearHiddenColumnIndicator(false,th);if(indicators[visibleIndex]!==undefined){a=self._renderHiddenColumnIndicator(true,th);self._bindDropDownToIndicator(a.find("span"),indicators[visibleIndex])}if(visibleIndex===self.grid._visibleColumns().length-1){if(indicators[visibleIndex+1]!==undefined){a=self._renderHiddenColumnIndicator(false,th);self._bindDropDownToIndicator(a.find("span"),indicators[visibleIndex+1])}}})}},_renderHiddenColumnIndicator:function(left,th){var padding,margin,nonPaddedIndicatorsAttr,position,indicatorMarkup,spanMarkup,paddingValue,div,a,span;if(left){padding="padding-left";margin="margin-left";position="left";indicatorMarkup="<div data-hiddencolindicator='left' />";spanMarkup="<span data-nonpaddedindicator='left'></span>";nonPaddedIndicatorsAttr="[data-nonpaddedindicator=left]"}else{padding="padding-right";margin="margin-right";position="right";indicatorMarkup="<div data-hiddencolindicator='right' />";spanMarkup="<span data-nonpaddedindicator='right'></span>";nonPaddedIndicatorsAttr="[data-nonpaddedindicator=right]"}paddingValue=parseInt(th.css(padding),10)+this.options.hiddenColumnIndicatorHeaderWidth;th.css(padding,paddingValue+"px");th.find(nonPaddedIndicatorsAttr).css(margin,-paddingValue+"px");div=$(indicatorMarkup).css("position","relative").css("width","100%").css("height","0px").css("top","0px").css("left","0px").prependTo(th);a=$("<a href='#' />").attr("title",this.options.hiddenColumnIndicatorTooltipText).prependTo(div);span=$(spanMarkup).attr("title",this.options.hiddenColumnIndicatorTooltipText).css("position","absolute").css(margin,-paddingValue+"px").css(position,"0px").css("width",this.options.hiddenColumnIndicatorHeaderWidth+"px").addClass(this.css.hiddenColumnIndicator).appendTo(a);if($.ig.util.isIE7){span.css({top:-parseInt(th.css("padding-top"),10),height:th.innerHeight()})}return a},_clearHiddenColumnIndicator:function(left,th){var padding,paddingValue,indicatorSelector,indicator;if(left){padding="padding-left";indicatorSelector="div[data-hiddencolindicator=left]"}else{padding="padding-right";indicatorSelector="div[data-hiddencolindicator=right]"}indicator=th.find(indicatorSelector);if(indicator.length!==0){indicator.remove();paddingValue=parseInt(th.css(padding),10);th.css(padding,paddingValue-this.options.hiddenColumnIndicatorHeaderWidth+"px")}},_bindDropDownToIndicator:function(button,columnKeys){var self=this,dropDown=this._renderDropDown(button,columnKeys);dropDown.find("ul").bind({blur:function(e){self._toggleDropDown(button,dropDown,true)}});button.parent().bind({mousedown:function(e){self._toggleDropDown(button,dropDown,false);e.preventDefault();e.stopPropagation()},mouseover:function(e){if(button.attr("data-indicator-selected")!=="true"){button.addClass(self.css.hiddenColumnIndicatorMouseOver)}},mouseout:function(e){button.removeClass(self.css.hiddenColumnIndicatorMouseOver)},mouseup:function(e){e.preventDefault();e.stopPropagation()},click:function(e){e.preventDefault();e.stopPropagation()}})},_renderDropDown:function(button,columnKeys){var self=this,dropDown,list;dropDown=$("<div data-hiding-inddropdown='"+this.grid.id()+"'></div>").css("position","absolute").css("display","none").addClass(this.css.hiddenColumnsDropDown).appendTo("body");list=$('<ul tabindex="0"></ul>').addClass(this.css.hiddenColumnsDropDownList).appendTo(dropDown);$.each(columnKeys,function(index,columnKey){$("<li></li>").addClass(self.css.hiddenColumnsDropDownItem).bind({mouseover:function(e){$(e.currentTarget).addClass(self.css.hiddenColumnsDropDownItemHover)},mouseout:function(e){$(e.currentTarget).removeClass(self.css.hiddenColumnsDropDownItemHover)},mousedown:function(e){self._closeColumnChooser(true);self._showColumnFromUI(columnKey);self._toggleDropDown(button,dropDown,true)}}).append($("<span></span>").addClass(self.css.hiddenColumnsDropDownItemText).text(self.grid.columnByKey(columnKey).headerText)).appendTo(list)});$("<a></a>").appendTo($("<li></li>").appendTo(list)).igButton({labelText:this.options.columnChooserDisplayText,mousedown:function(event){if(event.target){setTimeout(function(){$(event.target).removeClass("ui-state-active")},0)}self._openColumnChooser(true);self._toggleDropDown(button,dropDown,true)}});return dropDown},_toggleDropDown:function(button,dropDown,isCalledFromBlur){var th,isLast,offset,left,isVisible=dropDown.is(":visible")===true,self=this;if(dropDown.data("isAnimating")===true||isVisible===false&&isCalledFromBlur===true){return}if(!isVisible){th=button.closest("th");isLast=button.closest("div").attr("data-hiddencolindicator")==="right";offset=$.ig.util.offset(th);if(isLast){left=offset.left+th.outerWidth()-dropDown.outerWidth();left=Math.max(0,left)}else{left=offset.left}dropDown.css("top",offset.top+th.outerHeight());dropDown.css("left",left)}dropDown.data("isAnimating",true);dropDown.toggle(this.options.dropDownAnimationDuration,function(){if(dropDown.is(":visible")===true){dropDown.find("ul").focus();button.addClass(self.css.hiddenColumnIndicatorSelected);button.attr("data-indicator-selected","true")}else{button.removeClass(self.css.hiddenColumnIndicatorSelected);button.removeAttr("data-indicator-selected")}dropDown.data("isAnimating",false)})},_openColumnChooser:function(fireEvents){var modalDialog=$("#"+this.grid.id()+"_hiding_modalDialog");modalDialog.igGridModalDialog("openModalDialog")},_closeColumnChooser:function(fireEvents){var modalDialog=$("#"+this.grid.id()+"_hiding_modalDialog");modalDialog.igGridModalDialog("closeModalDialog")},_columnChooserMove:function(e,ui){this._trigger(this.events.columnChooserMoving,null,{columnChooserElement:e.target,owner:this,originalPosition:ui.originalPosition,position:ui.position})},_getColumnSettings:function(index,key){var i,foundByIndex;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){return this._mergeColumnSettingsDefaults(this.options.columnSettings[i])}if(this.options.columnSettings[i].columnIndex===index){foundByIndex=this.options.columnSettings[i]}}return this._mergeColumnSettingsDefaults(foundByIndex)},_getColumnSettingsByIndex:function(index){var key=this.grid.options.columns[index].key;return this._getColumnSettings(index,key)},_getColumnSettingsByKey:function(key){var i;for(i=0;i<this.grid.options.columns.length;i++){if(this.grid.options.columns[i].key===key){return this._getColumnSettings(i,key)}}},_mergeColumnSettingsDefaults:function(columnSettings){var defaults={allowHiding:true,hidden:false},copy=$.extend({},columnSettings),key;for(key in defaults){if(defaults.hasOwnProperty(key)&&typeof copy[key]!=="boolean"){copy[key]=defaults[key]}}return copy},_columnsMoved:function(){var self=this;this.grid.headersTable().find("thead > tr > th").not("[data-skip=true]").each(function(){var th=$(this);self._clearHiddenColumnIndicator(true,th);self._clearHiddenColumnIndicator(false,th)});this._renderHiddenColumnIndicators()},_injectGrid:function(gridInstance,isRebind){var i,j,cs,col;this.grid=gridInstance;if(this._headerCellRenderedHandler!==null&&this._headerCellRenderedHandler!==undefined){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}if(this._headerRenderedHandler!==null&&this._headerRenderedHandler!==undefined){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}if(this._virtualHorizontalScrollHandler!==null&&this._virtualHorizontalScrollHandler!==undefined){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}if(this._columnsMovedHandler!==null&&this._columnsMovedHandler!==undefined){this.grid.element.unbind("iggrid_columnsmoved",this._columnsMovedHandler)}this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._virtualHorizontalScrollHandler=$.proxy(this._virtualHorizontalScroll,this);this._columnsMovedHandler=$.proxy(this._columnsMoved,this);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this.grid.element.bind("iggrid_columnsmoved",this._columnsMovedHandler);if(this.grid.element.igGridFeatureChooser!==undefined){this.grid.element.igGridFeatureChooser()}else{throw new Error($.ig.GridHiding.locale.featureChooserNotReferenced)}for(i=0;i<this.options.columnSettings.length;i++){cs=this.options.columnSettings[i];if(typeof cs.hidden==="boolean"){if(typeof cs.columnKey==="string"){col=this.grid.columnByKey(cs.columnKey)}else if(typeof cs.columnIndex==="number"){col=this.grid.options.columns[cs.columnIndex]}if(col!==undefined&&col!==null){if(col.hidden===undefined||cs.hidden===true&&col.hidden!==col._initiallyHidden&&col._initiallyHidden!==true){col.hidden=cs.hidden
}}else if(this.grid._isMultiColumnGrid===true&&cs.columnKey!==null&&cs.columnKey!==undefined){col=this.grid._getMultiHeaderColumnById(cs.columnKey);if(col!==undefined&&col!==null&&col.children){for(j=0;j<col.children.length;j++){col.children[j].hidden=cs.hidden}}}}}}});$.extend($.ui.igGridHiding,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Hierarchical Grid 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 */
(function($){$.widget("ui.igHierarchicalGrid",{css:{expandColumn:"ui-iggrid-expandcolumn",expandColumnExpanded:"ui-iggrid-expandcolumn-expanded",expandButton:"ui-iggrid-expandbutton ui-icon-plus",expandButtonHover:"ui-iggrid-expandbuttonhover ui-icon-plus ui-state-hover",expandButtonExpandedHover:"ui-iggrid-expandbuttonexpandedhover ui-icon-plus ui-state-hover",expandButtonExpanded:"ui-iggrid-expandbutton ui-iggrid-expandbuttonexpanded ui-icon-minus",expandButtonClick:"ui-iggrid-expandbuttonclick ui-icon-plus",childGridArea:"ui-iggrid-childarea",childGridAreaCollapsed:"ui-iggrid-childarea-collapsed",expandHeaderCell:"ui-iggrid-expandheadercell ui-iggrid-header ui-widget-header",expandHeaderCellTriangle:"ui-icon ui-icon-triangle-1-se",root:"ui-iggrid-root",childGridSeparator:"ui-iggrid-childgridseparator"},options:{initialDataBindDepth:-1,initialExpandDepth:-1,odata:false,rest:false,maxDataBindDepth:-1,defaultChildrenDataProperty:"children",autoGenerateLayouts:false,expandCollapseAnimations:true,expandColWidth:30,pathSeparator:"/",animationDuration:500,expandTooltip:$.ig.Grid.locale.expandTooltip,collapseTooltip:$.ig.Grid.locale.collapseTooltip,columns:[],columnLayouts:[{key:null,primaryKey:null,foreignKey:null}]},events:{rowExpanding:"rowExpanding",rowExpanded:"rowExpanded",rowCollapsing:"rowCollapsing",rowCollapsed:"rowCollapsed",childrenPopulating:"childrenPopulating",childrenPopulated:"childrenPopulated",childGridCreating:"igchildgridcreating",childGridCreated:"igchildgridcreated"},_setOption:function(key,value){if(key==="dataSource"){this.options.dataSource=value;this.dataBind()}else if(key==="initialDataBindDepth"||key==="initialExpandDepth"||key==="expandColWidth"){throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+key)}if(key==="odata"||key==="defaultChildrenDataProperty"||key==="expandTooltip"||key==="collapseTooltip"||key==="autoGenerateLayouts"||key==="expandCollapseAnimations"||key==="animationDuration"){$.Widget.prototype._setOption.apply(this,arguments)}else if(this.rootWidget()&&key!=="dataSource"){this.rootWidget()._setOption(key,value)}},_create:function(){this._regevents(this.element,this);$.ui.igGrid.prototype.options.columns=[];$.ui.igGrid.prototype.options.features=[];this.options=$.extend(true,{},$.ui.igGrid.prototype.options,this.options);if(this.tmpDataSource!==null&&this.tmpDataSource!==undefined){this.options.dataSource=this.tmpDataSource;this._originalOptions.dataSource=this.tmpDataSource}if(this.options.virtualization===true){this.options.virtualizationMode="continuous"}this._eventQueue=[];this._animationQueue=[];this.dataBind();this.rootWidget()._isMultiColumnGrid=this._checkIsMultiColumnHeader(this.options)},_createWidget:function(options,element){this.options.columns=[];this.options.features=[];this.options.columnLayouts=[];if(options.dataSource&&($.type(options.dataSource)==="array"||$.type(options.dataSource)==="object")){this.tmpDataSource=options.dataSource;options.dataSource=null;this._originalOptions=options}$.Widget.prototype._createWidget.apply(this,arguments)},dataBind:function(){var hds,hdsoptions,rootds,opts;if(this.options.autoGenerateLayouts){this._generateLayouts()}hdsoptions=this._hdsoptions();hds=new $.ig.HierarchicalDataSource(hdsoptions);this._hds=hds;rootds=this._hds.root();this._tmpds=this.options.dataSource;this.options.dataSource=null;opts=$.extend(true,{},this.options);this.options.dataSource=this._tmpds;this._tmpds=null;opts.dataSource=rootds;if($.type(hdsoptions.dataSource)==="string"){opts.dataSourceUrl=hdsoptions.dataSource}if(!this._columnsGeneratedHandler){this._columnsGeneratedHandler=$.proxy(this._columnsGenerated,this)}else{this.element.unbind("iggridcolumnsgenerated",this._columnsGeneratedHandler)}this.element.bind("iggridcolumnsgenerated",this._columnsGeneratedHandler);if(this.options.autoGenerateLayouts===true){if(!this._databoundHandler){this._databoundHandler=$.proxy(this._layouts,this)}else{this.element.unbind("iggridcolumnsgenerated",this._databoundHandler)}this.element.bind("iggriddatarendering",this._databoundHandler)}this.element.addClass(this.css.root);this.element.attr("data-level",0);opts._isHierarchicalGrid=true;if(this._root){this._root.igGrid("option","dataSource",opts.dataSource)}else{if(this.options.autoGenerateLayouts===true){opts._recurseSchema=true}this._root=this.element.igGrid(opts)}if(this.rootWidget().container().data("igLoading")){this.indicator=this.rootWidget().container().data("igLoading").indicator()}else{this.indicator=this.rootWidget().container().igLoading().data("igLoading").indicator()}this._regToggleEvent(this.element,this)},_generateLayouts:function(){var rec,i,ds=this.options.dataSource;if($.type(ds)!=="array"&&$.type(ds)!=="object"||ds.length===0){return}if($.type(ds)==="object"&&this.options.responseDataKey){ds=ds[this.options.responseDataKey]||ds}for(i=0;i<ds.length;i++){rec=ds[i];this._generateLayout(rec,this.options)}},_generateLayout:function(record,options){var name,layout,tmpLayout,i,rec,hasRespKey=false;for(name in record){if(record.hasOwnProperty(name)&&($.type(record[name])==="array"||$.type(record[name])==="object"&&options.responseDataKey&&$.type(record[name][options.responseDataKey])==="array")){rec=record[name];if(options.responseDataKey&&$.type(rec)==="object"){if(rec[options.responseDataKey]&&$.type(rec[options.responseDataKey])==="array"){rec=rec[options.responseDataKey];hasRespKey=true}else{continue}}layout={key:name,childrenDataProperty:name,columnLayouts:[]};if(hasRespKey){layout.responseDataKey=options.responseDataKey}tmpLayout=this._layoutExistsRecursive(this.options,name);if(!tmpLayout){if(options.columnLayouts===undefined||options.columnLayouts===null){options.columnLayouts=[]}options.columnLayouts.push(layout)}else{layout=tmpLayout}if(rec.length>0){for(i=0;i<rec.length;i++){this._generateLayout(rec[i],layout)}}}}},_layoutExistsRecursive:function(options,key){var i,tmpLayout=null;tmpLayout=options.key===key?options:tmpLayout;if(!tmpLayout){for(i=0;options.columnLayouts&&i<options.columnLayouts.length;i++){tmpLayout=this._layoutExistsRecursive(options.columnLayouts[i],key);if(tmpLayout){break}}}return tmpLayout},root:function(){return this._root},rootWidget:function(){return this.root().data("igGrid")},allChildrenWidgets:function(){return this.root().find(".ui-iggrid-table").map(function(){return $(this).data("igGrid")})},allChildren:function(){return this.root().find(".ui-iggrid-table")},toggle:function(element){this._toggleInternal({target:$(element).find(".ui-iggrid-expandcolumn")},true)},expand:function(id){if(!this.populated(id)){this._toggleInternal({target:$(id).find(".ui-iggrid-expandcolumn")},true)}else{this._expand(id,true)}},_expand:function(id,suppressEvents){var tr=$(id),c,noCancel=true,handler,emptystr="",rootgrid;if(!suppressEvents){noCancel=this._trigger(this.events.rowExpanding,null,{owner:this,parentrow:tr})}rootgrid=this._rootgrid||this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(noCancel){if(this.options.expandCollapseAnimations){if(rootgrid._animationQueue[tr.attr("data-id")+emptystr]===true){return}rootgrid._animationQueue[tr.attr("data-id")+emptystr]=true}c=tr.find(".ui-iggrid-expandcolumn");tr.next().css("display","").css("visibility","visible");if(this.options.expandCollapseAnimations){if(!suppressEvents){handler=this._expandend}else{handler=this._expandendnoevents}tr.next().find("> td > div").slideDown(this.options.animationDuration,handler)}else{tr.next().find("> td > div").show();c.addClass(this.css.expandColumnExpanded).find(".ui-iggrid-expandbutton").removeClass(this.css.expandButton).addClass(this.css.expandButtonExpanded).attr("title",this.options.collapseTooltip);if(!suppressEvents){this._rowExpanded({owner:this,parentrow:tr});this._trigger(this.events.rowExpanded,null,{owner:this,parentrow:tr})}}tr.attr("state","e");tr.next().children().first().removeClass(this.css.childGridAreaCollapsed).addClass(this.css.childGridArea)}},expanded:function(element){var $e=element.length!==undefined?element:$(element);if($e===null||$e===undefined){return false}if($e.attr("state")!=="e"||$e.attr("state")===undefined){return false}return true},_expandendnoevents:function(ctx){var expcell,expcellspan,rootgrid,$this=ctx?$(ctx):$(this),prow=$this.closest("tr[data-container]").prev(),emptystr="";rootgrid=this._rootgrid||$this.closest(".ui-iggrid-root").data("igHierarchicalGrid");expcell=$this.closest("[data-container=true]").prev().find(".ui-iggrid-expandcolumn");expcellspan=expcell.find(".ui-iggrid-expandbutton");expcell.addClass(rootgrid.css.expandColumnExpanded);expcellspan.removeClass(rootgrid.css.expandButton).addClass(rootgrid.css.expandButtonExpanded).attr("title",rootgrid.options.collapseTooltip);if(rootgrid._animationQueue[prow.attr("data-id")+emptystr]===true){delete rootgrid._animationQueue[prow.attr("data-id")+emptystr]}},_expandend:function(){var $this=$(this),rootgrid,prow=$this.closest("tr[data-container]").prev(),parentGrid=prow.closest(".ui-iggrid-table").data("igGrid");rootgrid=this._rootgrid||$this.closest(".ui-iggrid-root").data("igHierarchicalGrid");rootgrid._expandendnoevents(this);parentGrid._adjustLastColumnWidth(false);rootgrid._rowExpanded({owner:rootgrid,parentrow:prow});rootgrid._trigger(rootgrid.events.rowExpanded,null,{owner:rootgrid,parentrow:prow})},_collapseendnoevents:function(ctx){var expcell,expcellspan,rootgrid,$this=ctx?$(ctx):$(this),ctd=$this.closest(".ui-iggrid-childarea"),prow=$this.closest("tr[data-container]").prev(),emptystr="";rootgrid=this._rootgrid||$this.closest(".ui-iggrid-root").data("igHierarchicalGrid");ctd.removeClass(rootgrid.css.childGridArea).addClass(rootgrid.css.childGridAreaCollapsed);ctd.closest("tr").css("display","none").css("visibility","hidden");expcell=$this.closest("[data-container=true]").prev().find(".ui-iggrid-expandcolumn");expcellspan=expcell.find(".ui-iggrid-expandbutton");expcell.removeClass(rootgrid.css.expandColumnExpanded);expcellspan.removeClass(rootgrid.css.expandButtonExpanded).addClass(rootgrid.css.expandButton).attr("title",rootgrid.options.expandTooltip);if(rootgrid._animationQueue[prow.attr("data-id")+emptystr]===true){delete rootgrid._animationQueue[prow.attr("data-id")+emptystr]}},_collapseend:function(){var $this=$(this),rootgrid,prow=$this.closest("tr[data-container]").prev(),parentGrid=prow.closest(".ui-iggrid-table").data("igGrid");rootgrid=this._rootgrid||$this.closest(".ui-iggrid-root").data("igHierarchicalGrid");rootgrid._collapseendnoevents(this);parentGrid._adjustLastColumnWidth(false);rootgrid._trigger(rootgrid.events.rowCollapsed,null,{owner:rootgrid,parentrow:prow})},collapse:function(id){this._collapse(id,true)},_collapse:function(id,suppressEvents){var tr=$(id),c,noCancel=true,handler,emptystr="",rootgrid;if(!suppressEvents){noCancel=this._trigger(this.events.rowCollapsing,null,{owner:this,parentrow:tr})}rootgrid=this._rootgrid||this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(noCancel){if(this.options.expandCollapseAnimations){if(rootgrid._animationQueue[tr.attr("data-id")+emptystr]===true){return}rootgrid._animationQueue[tr.attr("data-id")+emptystr]=true}c=tr.find(".ui-iggrid-expandcolumn");if(this.options.expandCollapseAnimations){if(!suppressEvents){handler=this._collapseend}else{handler=this._collapseendnoevents}this._rowCollapsed({owner:this,parentrow:tr});tr.next().find("> td > div").slideUp(this.options.animationDuration,handler)}else{tr.next().find("> td > div").hide();tr.next().children().first().removeClass(this.css.childGridArea).addClass(this.css.childGridAreaCollapsed);tr.next().css("display","none").css("visibility","hidden");c.find(".ui-iggrid-expandbutton").removeClass(this.css.expandButtonExpanded).addClass(this.css.expandButton).attr("title",this.options.expandTooltip);if(!suppressEvents){this._rowCollapsed({owner:this,parentrow:tr});this._trigger(this.events.rowCollapsed,null,{owner:this,parentrow:tr})}}tr.attr("state","c")}},collapsed:function(element){var $e=element.length!==undefined?element:$(element);if($e===null||$e===undefined){return true}if($e.attr("state")==="c"||$e.attr("state")===undefined){return true}return false},populated:function(element){var $e=element.length!==undefined?element:$(element);if($e===null||$e===undefined){return false}if($e.attr("c")==="true"){return true}return false},_mouseOver:function(event){$(event.target).addClass(this.css.expandButtonHover)},_mouseOut:function(event){$(event.target).removeClass(this.css.expandButtonHover).addClass(this.css.expandButton)},_toggleInternalWithDelay:function(event){var self=this;setTimeout(function(){self._toggleInternal(event)},0);event.stopImmediatePropagation()},_toggleInternal:function(event,suppressEvents){var created=$(event.target).closest("tr").attr("c"),p=$(event.target).closest("tr").find(".ui-iggrid-expandcolumn"),hgrid=this,x,y,isExpand,expandTout=this.options.virtualization===true?50:0;isExpand=$(event.target).hasClass("ui-iggrid-expandbutton")||$(event.target).children(".ui-iggrid-expandbutton").length>0;if(!created&&this.options.initialDataBindDepth===-1&&isExpand){x=p.offset().left;y=p.offset().top;this.indicator._indicator.css("left",x+p.width()/4).css("top",y+p.height()/3-4);if(!$.ig.util.isWebKit){p.find(".ui-iggrid-expandbutton").css("visibility","hidden");this.indicator.show(false)}setTimeout(function(){hgrid._toggleInternalAsync(event,suppressEvents)},expandTout)}else{hgrid._toggleInternalAsync(event,suppressEvents)}if(!suppressEvents){event.stopImmediatePropagation()}},_toggleInternalAsync:function(event,suppressEvents){var $td=$(event.target),parentrow=$td.closest("tr"),rowid="",keyspath="",keyspathvar="",pgridp,o,level=-1,sp=false,curpath=0,restSettingsSet,childds,created=parentrow.attr("c"),childrow,childgrids=[],ds,opts=[],id,k,isHierarchical,tmpkey,pki,dsobj,dsString,key,cs,popts,i,h,parentLevel=0,tmpgrid,state=parentrow.attr("state"),animatec,noCancel=true,noCancelChild=true,pid;if($td.is("td")&&$td.attr("data-parent")!=="true"||$td.closest("td").attr("data-parent")!=="true"){return}if(state===undefined){state="c"}restSettingsSet=this.options.restSettings.update.url!==null||this.options.restSettings.update.template!==null||this.options.restSettings.create.url!==null||this.options.restSettings.create.template!==null||this.options.restSettings.remove.url!==null||this.options.restSettings.remove.template!==null;if(!created&&state==="c"){parentrow.after("<tr></tr>");childrow=parentrow.next();childrow.attr("data-container",true);popts=parentrow.closest("table").data("igGrid").options;opts=this._optsFor(popts);if(popts.childrenDataProperty===undefined){if(popts.key){keyspath=popts.key}}else{keyspath+=popts.childrenDataProperty}pgridp=parentrow.closest(".ui-iggrid-childarea").parent().prev();while(pgridp.length>0){if(curpath!==0){rowid+=this.options.pathSeparator}o=pgridp.closest(".ui-iggrid-table").data("igGrid").options;k=o.primaryKey;rowid+=k+":"+pgridp.attr("data-id");if(o.childrenDataProperty===undefined){if(o.key){keyspath+=this.options.pathSeparator+o.key}}else{keyspath+=this.options.pathSeparator+o.childrenDataProperty}pgridp=pgridp.closest(".ui-iggrid-childarea").parent().prev();curpath++}keyspath=keyspath.split(this.options.pathSeparator).reverse().join(this.options.pathSeparator);rowid=rowid.split(this.options.pathSeparator).reverse().join(this.options.pathSeparator);k=parentrow.closest("table").data("igGrid").options.primaryKey;if(rowid===""){rowid=k+":"+parentrow.attr("data-id")}else{rowid+=this.options.pathSeparator+k+":"+parentrow.attr("data-id")}cs=parentrow.find("td,th").length;animatec=$("<div></div>").appendTo($("<td></td>").appendTo(childrow).addClass(this.css.childGridArea).attr("colspan",cs));for(i=0;i<opts.length;i++){keyspathvar="";childgrids.push($("<table></table>").appendTo(animatec).attr("data-childgrid",true));if(i<opts.length-1){$("<div></div>").appendTo(animatec).addClass(this.css.childGridSeparator)}key=opts[i].key!==undefined?opts[i].key:opts[i].childrenDataProperty;childgrids[i].attr("id",this.root()[0].id+"_"+parentrow.attr("data-id")+"_"+key+"_child");parentLevel=parseInt(parentrow.closest("table").attr("data-level"),10);childgrids[i].attr("id",childgrids[i].attr("id").replace(",","-")).attr("data-level",parentLevel+1);if(keyspath===""){keyspathvar=opts[i].childrenDataProperty===undefined?opts[i].key:opts[i].childrenDataProperty}else{keyspathvar=this.options.pathSeparator+(opts[i].childrenDataProperty===undefined?opts[i].key:opts[i].childrenDataProperty)}childds=this._hds.dataAt(rowid,keyspath+keyspathvar);if($.type(childds)!=="array"&&!opts[i].responseDataKey&&childds!==undefined){childds=[childds]}else if(childds===null||childds===undefined){childds=[]}isHierarchical=false;if(opts[i].columnLayouts&&opts[i].columnLayouts.length>0){isHierarchical=true}if(isHierarchical){this._regevents(childgrids[i],this)}level=rowid.split(this.options.pathSeparator).length;if(level>this.options.initialDataBindDepth&&this.options.initialDataBindDepth!==-1){sp=true}ds=this._hdsoptions().dataSource;if(!sp){opts[i].dataSource=childds;if($.type(ds)==="string"&&this.options.rest!==true&&!opts[i].dataSourceUrl){opts[i].dataSourceUrl=ds}if(opts[i].dataSourceUrl&&$.type(opts[i].dataSourceUrl)==="string"){if(opts[i].dataSourceUrl.indexOf("?")!==-1){opts[i].dataSourceUrl+="&"+this._hds._encodeUrlPath(rowid,opts[i].key)}else{opts[i].dataSourceUrl+="?"+this._hds._encodeUrlPath(rowid,opts[i].key)}}if(this.options.autoGenerateLayouts===true){opts[i]._recurseSchema=true}childgrids[i].trigger(this.events.childGridCreating,{owner:this,options:opts[i],element:childgrids[i],id:rowid,path:keyspath+keyspathvar});noCancelChild=childgrids[i].attr("data-create");if(noCancelChild!=="false"){if((this.options.rest||this.options.odata)&&restSettingsSet===true){this._inheritRestSettings(null,parentrow.attr("data-id"),keyspathvar.toLowerCase(),popts,opts[i])}if(isHierarchical){opts[i]._isHierarchicalGrid=true}childgrids[i].igGrid(opts[i]);if(isHierarchical){this._regToggleEvent(childgrids[i],this)}childgrids[i].trigger(this.events.childGridCreated,{owner:this,element:childgrids[i]})}if(opts[i].primaryKey===null||opts[i].primaryKey===undefined){if(opts[i].dataSource instanceof $.ig.DataSource){throw new Error($.ig.Grid.locale.noPrimaryKey)}tmpgrid=childgrids[i].data("igGrid");tmpkey=tmpgrid.dataSource.schema().schema.searchField;if(tmpkey!==null){for(pki=0;pki<opts[i].dataSource[tmpkey].length;pki++){opts[i].dataSource[tmpkey][pki].ig_pk=tmpgrid.dataSource.data()[pki].ig_pk}}else{for(pki=0;pki<opts[i].dataSource.length;pki++){if(opts[i].dataSource[pki]){opts[i].dataSource[pki].ig_pk=tmpgrid.dataSource.data()[pki].ig_pk}}}}}else{if(this.options.odata){dsobj=ds instanceof $.ig.DataSource?ds.settings.dataSource:ds;dsString=popts.dataSource instanceof $.ig.DataSource?popts.dataSource.settings.dataSource:popts.dataSource;childds=parentrow.closest("table").data("igGrid").dataSource.data();tmpkey=parentrow.attr("data-id");k=parentrow.closest("table").data("igGrid").options.primaryKey;if(parentrow.closest("table").data("igGrid").columnByKey(k).dataType==="number"){tmpkey=parseInt(tmpkey,10)}for(pki=0;pki<childds.length;pki++){if(childds[pki][parentrow.closest("table").data("igGrid").options.primaryKey]===tmpkey){childds=childds[pki][opts[i].key];break}}if(!childds){if(dsString.substr(dsString.length-1)==="/"){dsString=dsString.substring(0,dsString.length-1)}pid=typeof tmpkey==="string"?"'"+tmpkey+"'":tmpkey;if(keyspathvar.charAt(0)!=="/"){keyspathvar="/"+keyspathvar}if($.type(dsobj)==="string"&&dsobj!==dsString){dsString=dsobj.substring(0,dsobj.lastIndexOf("/"))+dsString.substring(dsString.lastIndexOf("/"))}opts[i].dataSource=dsString+"("+pid+")"+keyspathvar}else{if(childds.__deferred&&childds.__deferred.uri){opts[i].dataSource=childds.__deferred.uri;if(dsobj.indexOf("$callback=?")!==-1){opts[i].dataSource+="?$callback=?"}if(dsobj.indexOf("$format=")!==-1){if(dsobj.indexOf("$format=json")!==-1){opts[i].dataSource+="&$format=json"}else{opts[i].dataSource+="&$format=atom"}}}}if(restSettingsSet===true){this._inheritRestSettings(null,parentrow.attr("data-id"),keyspathvar.toLowerCase(),popts,opts[i])}}else if(this.options.rest===true){if(ds.substr(ds.length-1)!=="/"){ds+="/"}pid=parentrow.attr("data-id");opts[i].dataSource=ds+pid+"/"+keyspathvar.toLowerCase();if(restSettingsSet===true){this._inheritRestSettings(opts[i].dataSource,pid,keyspathvar.toLowerCase(),popts,opts[i])}}else if(ds instanceof $.ig.DataSource){opts[i].dataSource=ds.settings.dataSource+this._hds._encodeUrlPath(rowid,opts[i].key)}else{if(opts[i].dataSource){if(opts[i].dataSource.indexOf("?")!==-1){opts[i].dataSource+="&"+this._hds._encodeUrlPath(rowid,opts[i].key)}else{opts[i].dataSource+="?"+this._hds._encodeUrlPath(rowid,opts[i].key)}opts[i].dataSourceType="remoteUrl"}else{if($.type(opts[i].dataSource)==="string"&&$.type(ds)!=="string"){opts[i].dataSource+="?"+this._hds._encodeUrlPath(rowid,opts[i].key);opts[i].dataSourceType="remoteUrl"}else{opts[i].dataSource=ds+"?"+this._hds._encodeUrlPath(rowid,opts[i].key)}}if(opts[i].dataSource!==opts[i].dataSourceUrl){opts[i].dataSourceUrl=opts[i].dataSource}}}}if(sp){noCancel=this._trigger(this.events.childrenPopulating,null,{owner:this,parentrow:parentrow,id:rowid});if(noCancel){for(i=0;i<opts.length;i++){id=parentrow.attr("data-id");if(!this._eventQueue["id"+id]||!this._eventQueue["id"+id].length){this._eventQueue["id"+id]=[]}h=$.proxy(this._childRendered,this);this._eventQueue["id"+id].push({grid:childgrids[i],handler:h,parentrow:parentrow,id:rowid});childgrids[i].bind("iggridrendered",h);if(this.options.autoGenerateLayouts===true){opts[i]._recurseSchema=true}if(isHierarchical){opts[i]._isHierarchicalGrid=true}childgrids[i].igGrid(opts[i]);if(isHierarchical){this._regToggleEvent(childgrids[i],this)}}}}animatec.attr("id","ac");parentrow.attr("c",true);parentrow.next().hide();animatec.hide();this._expand(parentrow,suppressEvents)}else{if(state==="e"){this._collapse(parentrow,suppressEvents)}else if(state==="c"){this._expand(parentrow,suppressEvents)}}this.indicator.hide();parentrow.find(".ui-iggrid-expandbutton").css("visibility","visible")},_layouts:function(){this.element.unbind("iggriddatarendering",this._databoundHandler)},_columnsGenerated:function(event,args){var layoutKey=args.key,layout;if(!layoutKey){return}layout=this._findLayout(this.rootWidget().options.columnLayouts,layoutKey);if(layout.columns&&layout.columns.length&&layout.columns.length>0){return}layout.columns=args.owner.options.columns},_findLayout:function(layouts,key){var i,layout;for(i=0;layouts&&i<layouts.length;i++){if(layouts[i].key===key){layout=layouts[i];break}if(!layout&&layouts[i].columnLayouts){layout=this._findLayout(layouts[i].columnLayouts,key)}}return layout},_hdsoptions:function(){var opts,schema;opts={responseDataKey:this.options.responseDataKey,responseTotalRecCountKey:this.options.responseTotalRecCountKey,dataSource:this.options.dataSource,primaryKey:this.options.primaryKey,localSchemaTransform:this.options.localSchemaTransform,autoCommit:this.options.autoCommit,odata:this.options.odata,serializeTransactionLog:this.options.serializeTransactionLog,updateUrl:this.options.updateUrl,restSettings:this.options.restSettings,initialDataBindDepth:this.options.initialDataBindDepth};if(this.options.dataSourceType!==null){opts.type=this.options.dataSourceType}schema=this._hschema();if(this.options.dataSource instanceof $.ig.HierarchicalDataSource&&this.options.dataSource.settings.schema===null||!(this.options.dataSource instanceof $.ig.HierarchicalDataSource)){opts=$.extend(opts,{schema:schema})}return opts},_getDataColumns:function(cols){var i,j,res=[],colsLength=cols.length,dCols;for(i=0;i<colsLength;i++){if(cols[i].group!==undefined&&cols[i].group!==null){dCols=this._getDataColumns(this._getDataColumns(cols[i].group));for(j=0;j<dCols.length;j++){res.push(dCols[j])}}else{res.push(cols[i])}}return res},_hschema:function(){var schema,i,j,rec,prop,cols=this._getDataColumns(this.options.columns),encodedLayouts=[],k,c;if(cols.length>0&&!this.options.autoGenerateColumns){schema={};schema.fields=[];j=0;for(i=0;i<cols.length;i++){if(cols[i].unbound===true){continue}schema.fields[j]={};schema.fields[j].name=cols[i].key;schema.fields[j].type=cols[i].dataType;j++}schema.searchField=this.options.responseDataKey}else if(this.options.autoGenerateColumns){schema={};schema.fields=[];if(this.options.dataSource&&this.options.dataSource.length&&this.options.dataSource.length>0&&$.type(this.options.dataSource)==="array"){rec=this.options.dataSource[0];for(prop in rec){if(rec.hasOwnProperty(prop)){for(k=0;k<cols;k++){if(cols[k].key===prop){c=cols[k];break}}if(c===null||c===undefined){schema.fields.push({name:prop,type:$.ig.getColType(rec[prop])})}else{if(c.unbound===true){continue}schema.fields.push({name:prop,type:c.dataType})}}}}}if(this.options.columnLayouts&&this.options.columnLayouts.length>0){for(j=0;j<this.options.columnLayouts.length;j++){schema.fields.push({name:this.options.columnLayouts[j].childrenDataProperty===undefined?this.options.columnLayouts[j].key:this.options.columnLayouts[j].childrenDataProperty})}}this._parseLayouts(encodedLayouts,"",this.options);schema.layouts=encodedLayouts;return schema},_parseLayouts:function(layouts,cpath,options){var j,layout,p,cdp=null;if(options.columnLayouts&&options.columnLayouts.length!==undefined&&options.columnLayouts.length>0){for(j=0;j<options.columnLayouts.length;j++){layout=options.columnLayouts[j];cdp=layout.childrenDataProperty===undefined?layout.key:layout.childrenDataProperty;if(!cdp){cdp=this.options.defaultChildrenDataProperty}p=cpath+this.options.pathSeparator+cdp+":"+layout.primaryKey;layouts[p]=layout;this._parseLayouts(layouts,p,layout)}}},_batchExpand:function(){var crows=[],tmpanim,hgrid;hgrid=this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(!hgrid){hgrid=this.element.data("igHierarchicalGrid")}tmpanim=hgrid.options.expandCollapseAnimations;hgrid.options.expandCollapseAnimations=false;crows=this.element.find("tr[data-id]");hgrid._batchExpandLevel(crows);hgrid.options.expandCollapseAnimations=tmpanim},_batchExpandLevel:function(rows){var i;for(i=0;i<rows.length;i++){this.toggle(rows[i])}},_renderExtraHeaderCell:function(row,colgroup,prepend){if(prepend===true){$("<td></td>").prependTo(row).css("border-width",0).attr("data-skip",true)}else{$("<td></td>").appendTo(row).css("border-width",0).attr("data-skip",true)}},_renderExtraFooterCell:function(row,colgroup,prepend,cssClass){if(prepend===true){$("<td></td>").addClass(cssClass).prependTo(row).attr("data-skip",true)}else{$("<td></td>").addClass(cssClass).appendTo(row).attr("data-skip",true)}},_headerrenderedinternal:function(sender,args){if(args.owner.element[0].id!==sender.currentTarget.id&&args.owner.element[0].id!==sender.currentTarget.id+"_table"){return}var self=this,flatRenderColgroup=args.owner._renderColgroup,tmpid,$thDataSkip;args.owner._renderRecord=$.proxy(this._hierarchicalRenderRecord,args.owner);args.owner._getFirstVisibleTR=$.proxy(this._hierarchicalGetFirstVisibleTR,args.owner);args.owner._getLastVisibleTR=$.proxy(this._hierarchicalGetLastVisibleTR,args.owner);args.owner._renderRecordInArray=$.proxy(this._hierarchicalRenderRecordInArray,args.owner);args.owner._renderColgroup=function(){self._hierarchicalRenderColgroup.apply(args.owner,$.merge([flatRenderColgroup,self],arguments))};args.owner._headerInitCallbacks.push({type:"HierarchicalGrid",func:$.proxy(this._renderExtraHeaderCell,this)});args.owner._footerInitCallbacks.push({type:"HierarchicalGrid",func:$.proxy(this._renderExtraFooterCell,this)});args.owner._trigger("headerextracellsmodified",null,{owner:args.owner});if(args.owner._hasColumnTemplates()&&args.owner.options.rowTemplate===null){args.owner.options.rowTemplate=args.owner._buildRowTemplateRaw()}if(args.owner.options.rowTemplate!==null&&args.owner.options.rowTemplate!==undefined&&args.owner.options.rowTemplate!==""){args.owner.useCustomTemplates=true}if(args.table.attr("id")!==args.owner.element.attr("id")&&$(args.table).find("colgroup col[data-expander]").length===0){$("<col></col>").attr("data-skip","true").attr("data-expander",true).prependTo(args.table.find("colgroup")).width(this.options.expandColWidth)}$thDataSkip=$("<th></th>");$("<span></span>").appendTo($thDataSkip.prependTo(args.table.find("thead tr:first")).addClass(this.css.expandHeaderCell).attr("data-skip",true)).addClass(this.css.expandHeaderCellTriangle);if(args.owner._isMultiColumnGrid){$thDataSkip.attr("rowspan",args.owner._maxLevel+1)}if(args.owner._isWrapped){tmpid=args.owner.element.attr("id").substring(0,args.owner.element.attr("id").indexOf("_table"));args.owner.container().find("#"+tmpid).unbind("iggridheaderrenderedinternal",args.owner.element.data("hr"));args.owner.container().find("#"+tmpid).removeData("hr")}else{args.owner.element.unbind("iggridheaderrenderedinternal",args.owner.element.data("hr"));args.owner.element.removeData("hr")}},_checkIsMultiColumnHeader:function(lobj){var i,columnLayouts=lobj.columnLayouts,cols=lobj.columns,columnLayoutsLength,colsLength;if(cols){colsLength=cols.length;for(i=0;i<colsLength;i++){if(cols[i].group!==undefined&&cols[i].group!==null){return true}}}return false},_hierarchicalRenderRecord:function(data,rowIndex){var i,key,ar=this.options.accessibilityRendering,grid=this,lod,hg,childprop,dstr="",val,markup="",layouts,hasChildren,noVisibleColumns,layout;if(rowIndex%2!==0&&this.options.alternateRowStyles){dstr+='<tr class="'+grid.css.recordAltClass+'"'}else{dstr+="<tr"}dstr+=' data-row-idx="'+rowIndex+'"';if(!this._hg){hg=this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(!hg){hg=this.element.hasClass(".ui-iggrid-root")?this.element:undefined}this._hg=hg}else{hg=this._hg}if(this.options.foreignKey){dstr+=" data-id-fk='"+this._kval_from_key(this.options.foreignKey,data)+"'"}else{if(this.options.primaryKey===null||this.options.primaryKey===undefined){this.options.primaryKey="ig_pk";val=hg._getVal(data);dstr+=" data-id-fk='"+val+"'"}else if(this.options.primaryKey==="ig_pk"){val=hg._getVal(data);dstr+=" data-id-fk='"+val+"'"}else{dstr+=" data-id-fk='"+this._kval_from_key(this.options.primaryKey,data)+"'"}}if(this.options.primaryKey===null||this.options.primaryKey===undefined){this.options.primaryKey="ig_pk";val=hg._getVal(data);dstr+=" data-id='"+val+"'"}else if(this.options.primaryKey==="ig_pk"){val=hg._getVal(data);dstr+=" data-id='"+val+"'"}else{dstr+=" data-id='"+this._kval_from_key(this.options.primaryKey,data)+"'"}if(ar){dstr+=' role="row">'}else{dstr+=">"}layouts=this.options.columnLayouts;hasChildren=false;lod=hg?hg.options.initialDataBindDepth>-1:false;if(!lod){for(i=0;layouts&&i<layouts.length;i++){if(data[layouts[i].key]){childprop=layouts[i].key;layout=layouts[i]}else{childprop=layouts[i].childrenDataProperty}childprop=childprop||this.options.defaultChildrenDataProperty;if(childprop){if(layout&&layout.responseDataKey){if(data[childprop]&&data[childprop][layout.responseDataKey]&&data[childprop][layout.responseDataKey].length!==undefined&&(data[childprop][layout.responseDataKey].length>0||this._shouldAlwaysRenderChildIndicator)){hasChildren=true;break}}else{if(data[childprop]){if(data[childprop].length!==undefined&&(data[childprop].length>0||this._shouldAlwaysRenderChildIndicator)){hasChildren=true;break}else{if(this.options.responseDataKey&&data[childprop][this.options.responseDataKey]&&data[childprop][this.options.responseDataKey].length!==undefined&&(data[childprop][this.options.responseDataKey].length>0||this._shouldAlwaysRenderChildIndicator)){hasChildren=true;break}}}}}}}else{hasChildren=true}if(hasChildren){markup='<span class="ui-iggrid-expandbuttoncontainer"><span class="ui-iggrid-expandbutton ui-icon ui-icon-plus" title="'+hg.options.expandTooltip+'"></span></span>'}dstr+='<td class="ui-iggrid-expandcolumn" data-parent="'+hasChildren+'">'+markup+"</td>";if(this.options.columns.length>0){noVisibleColumns=true;$(this.options.columns).each(function(colIndex){var col=grid.options.columns[colIndex];
if(col.hidden){return}noVisibleColumns=false;if(ar){dstr+='<td role="gridcell" aria-describedby="'+this.key+'"'}else{dstr+="<td"}if(data[this.key]===undefined){if(grid.useCustomTemplates===true){dstr+=" ";if(col.unbound){dstr+=grid._renderTemplatedCell(data,this)}else{dstr+=grid._renderTemplatedCell(data[colIndex],this)}}else{dstr+=">";dstr+=grid._renderCell(data[colIndex],this,data)}dstr+="</td>"}else{if(grid.useCustomTemplates===true){dstr+=" ";dstr+=grid._renderTemplatedCell(data,this)}else{dstr+=">";dstr+=grid._renderCell(data[this.key],this,data)}dstr+="</td>"}});if(noVisibleColumns){dstr+='<td role="gridcell"></td>'}}else{if($.type(data)==="array"){for(i=0;i<data.length;i++){if(ar){dstr+='<td role="gridcell">'+data[i]+"</td>"}else{dstr+="<td>";dstr+=data[i];dstr+="</td>"}}}else{for(key in data){if(data.hasOwnProperty(key)){if(ar){dstr+='<td role="gridcell" aria-describedby="'+key+'">'+data[key]+"</td>"}else{dstr+="<td>";dstr+=data[key];dstr+="</td>"}}}}}dstr+="</tr>";return dstr},_getVal:function(data){var val;if(data.ig_pk){val=data.ig_pk}else{val=$.ig.util.getCheckSumForObject(data);data.ig_pk=val}return val},_hierarchicalRenderRecordInArray:function(darr,tbody,data,rowIndex){var i,key,ar=this.options.accessibilityRendering,grid=this,lod,hg,childprop,val,markup="",layouts,hasChildren,noVisibleColumns,appendBehavior=false;if(darr===null){darr=[];appendBehavior=true}if(rowIndex%2!==0&&this.options.alternateRowStyles){darr.push('<tr class="'+grid.css.recordAltClass+'"')}else{darr.push("<tr")}if(this.options.foreignKey){darr.push(" data-id-fk='"+this._kval_from_key(this.options.foreignKey,data)+"'")}else{if(this.options.primaryKey===null||this.options.primaryKey===undefined){this.options.primaryKey="ig_pk";val=$.ig.uid();darr.push(" data-id-fk='"+val+"'");data.ig_pk=val}else if(this.options.primaryKey==="ig_pk"){val=$.ig.uid();darr.push(" data-id-fk='"+val+"'");data.ig_pk=val}else{darr.push(" data-id-fk='"+this._kval_from_key(this.options.primaryKey,data)+"'")}}if(this.options.primaryKey===null||this.options.primaryKey===undefined){this.options.primaryKey="ig_pk";val=$.ig.uid();darr.push(" data-id='"+val+"'");data.ig_pk=val}else if(this.options.primaryKey==="ig_pk"){val=$.ig.uid();darr.push(" data-id='"+val+"'");data.ig_pk=val}else{darr.push(" data-id='"+this._kval_from_key(this.options.primaryKey,data)+"'")}if(ar){darr.push(' role="row">')}else{darr.push(">")}layouts=this.options.columnLayouts;hasChildren=false;hg=this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(!hg){hg=this.element.hasClass(".ui-iggrid-root")?this.element:undefined}lod=hg?hg.options.initialDataBindDepth>-1:false;if(!lod){for(i=0;layouts&&i<layouts.length;i++){if(data[layouts[i].key]){childprop=layouts[i].key}else{childprop=layouts[i].childrenDataProperty}childprop=childprop||this.options.defaultChildrenDataProperty;if(childprop){if(this.options.responseDataKey){if(data[childprop]&&data[childprop][this.options.responseDataKey]&&data[childprop][this.options.responseDataKey].length!==undefined&&data[childprop][this.options.responseDataKey].length>0){hasChildren=true;break}}else{if(data[childprop]&&data[childprop].length!==undefined&&data[childprop].length>0){hasChildren=true;break}}}}}else{hasChildren=true}if(hasChildren){markup='<span class="ui-iggrid-expandbuttoncontainer"><span class="ui-iggrid-expandbutton ui-icon ui-icon-plus" title="'+hg.options.expandTooltip+'"></span></span>'}darr.push('<td class="ui-iggrid-expandcolumn" data-parent="'+hasChildren+'">'+markup+"</td>");if(this.options.columns.length>0){noVisibleColumns=true;$(this.options.columns).each(function(colIndex){if(grid.options.columns[colIndex].hidden){return}noVisibleColumns=false;if(ar){darr.push('<td role="gridcell" aria-describedby="'+this.key+'"')}else{darr.push("<td")}if(data[this.key]===undefined){if(grid.useCustomTemplates===true){darr.push(" ");darr.push(grid._renderTemplatedCell(data,this))}else{darr.push(">");darr.push(grid._renderCell(data[colIndex],this,data))}darr.push("</td>")}else{if(grid.useCustomTemplates===true){darr.push(" ");darr.push(grid._renderTemplatedCell(data,this))}else{darr.push(">");darr.push(grid._renderCell(data[this.key],this,data))}darr.push("</td>")}});if(noVisibleColumns){darr.push('<td role="gridcell"></td>')}}else{if($.type(data)==="array"){for(i=0;i<data.length;i++){if(ar){darr.push('<td role="gridcell">'+data[i]+"</td>")}else{darr.push("<td>");darr.push(data[i]);darr.push("</td>")}}}else{for(key in data){if(data.hasOwnProperty(key)){if(ar){darr.push('<td role="gridcell" aria-describedby="'+key+'">'+data[key]+"</td>")}else{darr.push("<td>");darr.push(data[key]);darr.push("</td>")}}}}}darr.push("</tr>");if(appendBehavior){tbody.append(darr.join(""))}},_hierarchicalRenderColgroup:function(flatRenderColgroup,hierarchicalGrid,table,isHeader,isFooter,autofitLastColumn){flatRenderColgroup.apply(this,[table,isHeader,isFooter,autofitLastColumn]);if($(table).find("colgroup col[data-expander]").length>0){return}$("<col></col>").prependTo($(table).find("colgroup")).css("width",hierarchicalGrid.options.expandColWidth).attr("data-skip","true").attr("data-expander",true)},_schemaGenerated:function(event,args){var hg,i,rec,schema=args.schema,ds=args.dataSource,$this=args.owner,prop;hg=$this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(!hg){hg=$this.element.hasClass(".ui-iggrid-root")?$this.element:undefined}if(!hg||hg.options.initialDataBindDepth>-1){return}for(i=0;ds&&ds.length&&$.type(ds)==="array"&&i<ds.length;i++){rec=ds[i];for(prop in rec){if(rec.hasOwnProperty(prop)){if(!$this._fieldExists(prop,schema)&&($.type(rec[prop])==="array"||$.type(rec[prop])==="object")){schema.fields.push({name:prop,type:$.ig.getColType(rec[prop])})}}}}},_childRendered:function(sender,args){var ptr=args.owner.element.closest("tr").prev(),pid="id"+ptr.attr("data-id"),e=this._eventQueue[pid],i,fire=true;for(i=0;e.length!==undefined&&i<e.length;i++){if(e[i].grid.attr("id")===args.owner.element.attr("id")){e[i].done=true;e[i].grid.unbind("iggridrendered",e[i].handler);break}}for(i=0;e.length!==undefined&&i<e.length;i++){if(!e[i].done){fire=false;break}}if(fire){this._trigger(this.events.childrenPopulated,null,{owner:this,parentrow:ptr,id:e[0].id});delete this._eventQueue[pid]}},_optsFor:function(popts){var i,j,o=[],layouts;if(popts.columnLayouts&&popts.columnLayouts.length>0&&$.type(popts.columnLayouts)==="array"){layouts=popts.columnLayouts;for(j=0;j<layouts.length;j++){this._inherit(popts,layouts[j]);o.push($.extend(true,{},$.ui.igGrid.prototype.options,layouts[j]))}}for(i=0;i<o.length;i++){if(!o[i].dataSource){o[i].dataSourceUrl=popts.dataSourceUrl}else{if(String(popts.initialDataBindDepth)==="-1"||popts.initialDataBindDepth===undefined){o[i].dataSourceUrl=o[i].dataSource}}}return o},_inherit:function(parent,child){var i,f,j,nowrite;if(parent.dataSourceType){child.dataSourceType=parent.dataSourceType}if(!parent.features||parent.features.length===undefined||parent.features.length===0){return}if(!child.features||child.features.length===undefined){child.features=[]}for(i=0;i<parent.features.length;i++){if(parent.features[i].inherit===true){f=null;for(j=0;j<child.features.length;j++){if(child.features[j].name===parent.features[i].name){f=child.features[j];break}}if(f===null||f===undefined){child.features.push($.extend(true,{},parent.features[i]));child.features[child.features.length-1].columnSettings=[]}else{nowrite=false;if(child.features[j].columnSettings&&child.features[j].columnSettings.length>0){nowrite=true}child.features[j]=$.extend(true,{},parent.features[i],f);if(!nowrite){child.features[j].columnSettings=[]}}}}},_regevents:function(e,context){var headerRenderedInternal,datarendered,schemaGenerated;headerRenderedInternal=$.proxy(context._headerrenderedinternal,context);datarendered=$.proxy(this._handleBatchExpandRender,context);schemaGenerated=$.proxy(this._schemaGenerated,context);e.bind("iggridheaderrenderedinternal",headerRenderedInternal);e.bind("iggriddatarendered",datarendered);e.bind("iggridschemagenerated",schemaGenerated);e.data("hr",headerRenderedInternal)},_regToggleEvent:function(e,context){var toggle;toggle=$.proxy(context._toggleInternalWithDelay,context);e.undelegate(".ui-iggrid-expandcolumn > .ui-iggrid-expandbuttoncontainer","mousedown");e.delegate(".ui-iggrid-expandcolumn > .ui-iggrid-expandbuttoncontainer","mousedown",toggle)},commit:function(){var elem=this.element;elem.find(".ui-iggrid-table").each(function(){$(this).igGrid("commit")});elem.igGrid("commit")},rollback:function(rebind){var elem=this.element;elem.find(".ui-iggrid-table").each(function(){$(this).igGrid("rollback",null,rebind)});elem.igGrid("rollback",null,rebind)},_addToLog:function(elem,taLog,child){var grid=elem.data("igGrid"),ds=grid?grid.dataSource:null,gridLog=ds?ds._accumulatedTransactionLog:null,i=gridLog?gridLog.length:0;if(!i){return}this._dsLog=this._dsLog||[];this._dsLog.push(ds);while(i-->0){taLog.push($.extend(true,child?{layoutKey:grid.options.key}:{},gridLog[i]))}},saveChanges:function(success,error){var self=this,opts,elem=self.element,url=self.options.updateUrl,taLog=[];if((this.options.rest||this.options.odata)&&this.options.restSettings){this._saveChangesForEachGrid();return}if(!url||!elem){return}delete self._dsLog;self._addToLog(elem,taLog);elem.find(".ui-iggrid-table").each(function(){self._addToLog($(this),taLog,true)});opts={type:"POST",url:url,data:{ig_transactions:JSON.stringify(taLog)},success:function(data,textStatus,jqXHR){var logs=self._dsLog,i=logs?logs.length:0;while(i-->0){logs[i]._saveChangesSuccess(data,textStatus,jqXHR)}if(success){success(data,textStatus,jqXHR)}},error:function(jqXHR,textStatus,errorThrown){var logs=self._dsLog,i=logs?logs.length:0;while(i-->0){logs[i]._saveChangesError(jqXHR,textStatus,errorThrown)}if(error){error(jqXHR,textStatus,errorThrown)}}};$.ajax(opts)},_saveChangesForEachGrid:function(success,error){this.rootWidget().saveChanges(success,error);$.each(this.allChildrenWidgets(),function(){this.saveChanges(success,error)})},_handleBatchExpandRender:function(sender,args){var level=0,grid=args.owner,keyspath,ds,hdsData,o,k,curpath,rowid,popts,pgridp,gridId=grid.element[0].id,tId=sender.currentTarget.id;if(gridId!==tId&&gridId!==tId+"_table"){return}level=parseInt(grid.element.attr("data-level"),10);if(isNaN(level)){level=0;grid.element.attr("data-level",level)}if(level>0&&this.options.initialDataBindDepth===-1&&this._hds.settings.type==="json"&&$.type(grid.options.dataSource)==="string"){keyspath="";curpath=0;rowid="";popts=grid.options;if(popts.childrenDataProperty===undefined){if(popts.key){keyspath=popts.key}}else{keyspath+=popts.childrenDataProperty}pgridp=grid.element;pgridp=pgridp.closest(".ui-iggrid-childarea").parent().prev();while(pgridp.length>0){if(curpath!==0){rowid+=this.options.pathSeparator}o=pgridp.closest(".ui-iggrid-table").data("igGrid").options;k=o.primaryKey;rowid+=k+":"+pgridp.attr("data-id");if(o.childrenDataProperty===undefined){if(o.key){keyspath+=this.options.pathSeparator+o.key}}else{keyspath+=this.options.pathSeparator+o.childrenDataProperty}pgridp=pgridp.closest(".ui-iggrid-childarea").parent().prev();curpath++}keyspath=keyspath.split(this.options.pathSeparator).reverse().join(this.options.pathSeparator);rowid=rowid.split(this.options.pathSeparator).reverse().join(this.options.pathSeparator);hdsData=this._hds.dataAt(rowid,keyspath);ds=grid.dataSource;if(hdsData[popts.responseDataKey]){hdsData[popts.responseDataKey]=ds._dataView;hdsData.Metadata=ds.metadata()}}if(level>this.options.initialExpandDepth){return}if((this.options.initialDataBindDepth===-1||this.options.initialDataBindDepth>=this.options.initialExpandDepth)&&this.options.initialExpandDepth!==-1){setTimeout($.proxy(this._batchExpand,args.owner),1)}},_inheritRestSettings:function(path,pid,layout,popts,copts){var crest=copts.restSettings,prest=popts.restSettings,rs,ptmpl,fullpath;if(!path){if(prest.update.template||prest.remove.template){path=prest.update.template||prest.remove.template;path=path.replace("${id}",pid)}else{path=prest.create.url||prest.update.url||prest.remove.url;if(path.substr(path.length-1)!=="/"){path+="/"}path+=pid}if(layout.substr(0,1)==="/"){layout=layout.substr(1)}if(path.substr(path.length-1)!=="/"){path+="/"}fullpath=path+layout}else{fullpath=path}rs={update:{url:fullpath},create:{url:fullpath},remove:{url:fullpath}};if(crest.create.template&&prest.create.template){ptmpl=prest.create.template.replace("${id}",pid);crest.create.template=ptmpl+"/"+crest.create.template}if(crest.remove.template&&prest.remove.template){ptmpl=prest.remove.template.replace("${id}",pid);crest.remove.template=ptmpl+"/"+crest.remove.template}if(crest.update.template&&prest.update.template){ptmpl=prest.update.template.replace("${id}",pid);crest.update.template=ptmpl+"/"+crest.update.template}crest=$.extend(true,crest,rs)},_rowExpanded:function(args){var rowExpansion,rowHeight,parentGrid,currentHeight;rowExpansion=args.parentrow.next();if(rowExpansion.length===0||!rowExpansion.is('tr[data-container="true"]')){return}rowHeight=rowExpansion.outerHeight();parentGrid=args.parentrow.closest(".ui-iggrid-table").data("igGrid");currentHeight=parentGrid._getScrollContainerHeight();parentGrid._setScrollContainerHeight(currentHeight+rowHeight)},_rowCollapsed:function(args){var rowExpansion=args.parentrow.next(),rowHeight,parentGrid,currentHeight;if(rowExpansion.length===0||!rowExpansion.is('tr[data-container="true"]')){return}rowHeight=rowExpansion.outerHeight();parentGrid=args.parentrow.closest(".ui-iggrid-table").data("igGrid");currentHeight=parentGrid._getScrollContainerHeight();parentGrid._setScrollContainerHeight(currentHeight-rowHeight)},_hierarchicalGetFirstVisibleTR:function(visibleArea){var tableId="#"+this.element[0].id,firstVisibleTR;firstVisibleTR=$(tableId+' > tbody > tr:not([data-container="true"])').filter(function(index){return this.offsetTop+$(this).height()>visibleArea.top}).first();return firstVisibleTR},_hierarchicalGetLastVisibleTR:function(visibleArea){var tableId="#"+this.element[0].id,lastVisibleTR;lastVisibleTR=$(tableId+' > tbody > tr:not([data-container="true"])').filter(function(index){return this.offsetTop<visibleArea.bottom}).last();return lastVisibleTR},destroy:function(){this.tmpDataSource=null;this._rootgrid=null;this.rootWidget().destroy();$.Widget.prototype.destroy.call(this)}});$.extend($.ui.igHierarchicalGrid,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Merged Cells 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){"use strict";$.widget("ui.igGridCellMerging",{css:{mergedCellsTop:"ui-iggrid-mergedcellstop",mergedCellsBottom:"ui-iggrid-mergedcellsbottom",mergedCell:"ui-iggrid-mergedcell"},options:{initialState:"regular"},events:{cellsMerging:"cellsMerging",cellsMerged:"cellsMerged"},_create:function(){this._db=0;this._sortingRequested=false;this._v=false},destroy:function(){this._removePaint();this._unregisterEvents();$.Widget.prototype.destroy.call(this);return this},_gridPaging:function(){this._db--},_gridSorting:function(){this._sortingRequested=true},_gridSorted:function(){this._sortingRequested=false},_gridRendered:function(event,ui){var key,index,sExp=this.grid.dataSource.settings.sorting.expressions,i,j;if(this.options.initialState==="merged"&&this._db===0&&this._sortingRequested===false){for(j=0;j<this.grid._visibleColumns().length;j++){this._paintMergedCells(j,this.grid._visibleColumns()[j].key)}}else{for(i=0;i<sExp.length;i++){key=sExp[i].fieldName;for(j=0;j<this.grid._visibleColumns().length;j++){if(this.grid._visibleColumns()[j].key===key){index=j;break}}if(typeof this.grid._startColIndex==="number"){index-=this.grid._startColIndex}if(index&&key){this._paintMergedCells(index,key)}}}this._db++},_rrn:function(event,args){this._db--;this._gridRendered()},_rcn:function(event,args){this._db--;this._gridRendered()},_columnsCollectionModified:function(){this._gridRendered()},_paintMergedCells:function(index,key){var cells,prvCell,curCell,prvCellTxt,curCellTxt,first=true,str=false,count=0,i,args,cval,noCancel;cells=$("#"+this.grid.id()+" tbody tr>td:nth-child("+(index+1+this._getSystemColumnsCount())+")");this._addVirtualBorderCells(cells,key);prvCell=cells.eq(0);for(i=1;i<cells.length;i++){curCell=cells.eq(i);prvCellTxt=this._getComparableCellText(prvCell);curCellTxt=this._getComparableCellText(curCell);if(prvCellTxt===curCellTxt&&prvCellTxt!==cval){if(str===false){args=this._getEventArgsForCell(prvCell);noCancel=this._trigger(this.events.cellsMerging,this,args);if(noCancel!==true){cval=prvCellTxt;prvCell=curCell;continue}}cval=null;str=true;if(first===true){if(!cells.eq(i-1)[0].fictive){cells.eq(i-1).addClass(this.css.mergedCellsTop)}first=false;count++}if(!curCell[0].fictive){curCell.addClass(this.css.mergedCell)}count++}else{if(str===true){args.count=count;count=0;this._trigger(this.events.cellsMerged,this,args);cells.eq(i-1).addClass(this.css.mergedCellsBottom);str=false}first=true}prvCell=curCell}if(str===true){args.count=count;this._trigger(this.events.cellsMerged,this,args);if(!cells.eq(cells.length-1)[0].fictive){cells.eq(cells.length-1).addClass(this.css.mergedCellsBottom)}}},_addVirtualBorderCells:function(list,key){var ds=this.grid.dataSource.dataView();if(this._v===true){if(this.grid._startRowIndex>0){list.splice(0,0,{txt:String(ds[this.grid._startRowIndex-1][key]),fictive:true})}if(this.grid._startRowIndex+this.grid._virtualRowCount<this.grid.dataSource.dataView().length){list.splice(list.length,0,{txt:String(ds[this.grid._startRowIndex+this.grid._virtualRowCount][key]),fictive:true})}}},_getSystemColumnsCount:function(){var firstRow=this.grid.container().find("#"+this.grid.id()+" tbody>tr:not([data-container='true'],[data-grouprow='true']):first");return firstRow.children("[data-parent='true'],[data-skip='true'],th").length},_getEventArgsForCell:function(cell){var args,row,rKey,rIdx,val;if(cell[0].fictive){row=null;rKey=null;rIdx=this.grid._startRowIndex?this.grid._startRowIndex-1:-1;val=cell[0].txt}else{row=cell.closest("tr");rKey=row.attr("data-id");rIdx=this._getVisibleRowIndex(row);if(rKey===""||rKey===null||rKey===undefined){rKey=rIdx}val=cell.html()}args={owner:this,row:row,rowIndex:rIdx,rowKey:rKey,grid:this.grid,value:val};return args},_getComparableCellText:function(cell){var text=cell[0].fictive?cell[0].txt:cell.html().replace(/^&nbsp;$/,"");if(this.grid.dataSource.settings.sorting.caseSensitive===false){text=text.toLowerCase()}return text},_getVisibleRowIndex:function(row){return row.closest("tbody").children("tr:not([data-container='true'],[data-grouprow='true'])").index(row)+(this.grid._startRowIndex||0)},_removePaint:function(){var dataRows=this.grid.container().find("#"+this.grid.id()+"> tbody > tr:not([data-container='true'],[data-grouprow='true'])"),cells,i;cells=dataRows.children("td."+this.css.mergedCellsTop+",td."+this.css.mergedCell);for(i=0;i<cells.length;i++){$(cells[i]).removeClass(this.css.mergedCellsTop).removeClass(this.css.mergedCell).removeClass(this.css.mergedCellsBottom)}},_createHandlers:function(){this._gridRenderedHandler=$.proxy(this._gridRendered,this);this._sortingInitiatedHandler=$.proxy(this._gridSorting,this);this._sortingHandler=$.proxy(this._gridSorted,this);this._pagingHandler=$.proxy(this._gridPaging,this);this._virtualRowsHandler=$.proxy(this._rrn,this);this._virtualColumnsHandler=$.proxy(this._rcn,this);this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this)},_registerEvents:function(){this.grid.element.bind("ig_gridrendered",this._gridRenderedHandler);this.grid.element.bind("iggridsortingcolumnsorting",this._sortingInitiatedHandler);this.grid.element.bind("iggridsortingcolumnsorted",this._sortingHandler);this.grid.element.bind("iggridpagingpageindexchanging",this._pagingHandler);this.grid.element.bind("iggridvirtualrecordsrender",this._virtualRowsHandler);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualColumnsHandler);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)},_unregisterEvents:function(){this.grid.element.unbind("ig_gridrendered",this._gridRenderedHandler);this.grid.element.unbind("iggridsortingcolumnsorting",this._sortingInitiatedHandler);this.grid.element.unbind("iggridsortingcolumnsorted",this._sortingHandler);this.grid.element.unbind("iggridpagingpageindexchanging",this._pagingHandler);this.grid.element.unbind("iggridvirtualrecordsrender",this._virtualRowsHandler);this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualColumnsHandler);this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)},_injectGrid:function(gridInstance){this.grid=gridInstance;this._v=this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true;this._createHandlers();this._unregisterEvents();this._registerEvents()}});$.extend($.ui.igGridCellMerging,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Multi Headers 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridMultiColumnHeaders",{css:{multiHeaderCell:"ui-iggrid-multiheader-cell"},options:{},_createWidget:function(){$.Widget.prototype._createWidget.apply(this,arguments)},_renderingMultiColumnHeader:function(){this._renderHeaderColumns(this.grid._headerParent);this.grid._trigger(this.grid.events.headerRendered,null,{owner:this.grid,table:this.grid.headersTable()});this.grid._headerRenderCancel=false},_analyzeRowspanRows:function(oldCols,level){var i,col,groups=[],ml=this.grid._maxLevel-level,rowspan;for(i=0;i<oldCols.length;i++){rowspan=1;col=oldCols[i];if($.type(col.rowspan)==="string"){col.rowspan=parseInt(col.rowspan,10)}if(col.rowspan>0){rowspan=col.rowspan}if(col.group!==undefined&&col.group!==null){groups.push({group:col.group,level:level+rowspan})}else{if(col.level===0){if(col.rowspan===null||col.rowspan===undefined||isNaN(col.rowspan)){if(ml+1-col.level>0){col.rowspan=ml+1-col.level}}}}if(this._rows[ml]===undefined||this._rows[ml]===null){this._rows[ml]=[]}this._rows[ml].push(col)}for(i=0;i<groups.length;i++){this._analyzeRowspanRows(groups[i].group,groups[i].level)}},_renderRow:function(headerContainer,row,level){var col,i,$headerCell,$tr=$('<tr data-mch-level="'+level+'"></tr>').appendTo(headerContainer);for(i=0;i<row.length;i++){col=row[i];$headerCell=this._createHeaderColumnMarkup(col.headerText,col.colspan,col.key,col.level,col.identifier,col.rowspan);$headerCell.appendTo($tr)}},_renderHeaderColumns:function($container){var $th,i,j,k,oldCols,parents,key,headersTable,parentCol,mchElement,cols=this.grid.options.columns,mchChildren,isToHide,colsLength=cols.length,initHiddenCols=this.grid._initialHiddenColumns,gridId=this.grid.id(),$thead;this._arrayTargetRowspan=[];this._totalColumnsLength=$container.find("colgroup col").length;$thead=$container.find("thead");if($thead.length>0){$container=$thead.empty()}else{$container=$("<thead></thead>").appendTo($container)}this._tr={};oldCols=this.grid._oldCols;this._rows={};this._analyzeRowspanRows(oldCols,0);for(i=this.grid._maxLevel;i>=0;i--){if(this._rows[i]!==null&&this._rows[i]!==undefined){this._renderRow($container,this._rows[i],i)}}for(i=0;i<colsLength;i++){$th=this.grid.container().find("#"+gridId+"_"+cols[i].key).data("columnIndex",i);$th.data("data-mch-order",i);this.grid._headerCells.push($th)}if(initHiddenCols){headersTable=this.grid.headersTable().find("thead");for(i=0;i<initHiddenCols.length;i++){key=initHiddenCols[i].key;this.grid.container().find("#"+gridId+"_"+key).css("display","none");parents=this.grid._getParentsMultiHeader(key);for(j=0;j<parents.length;j++){parentCol=parents[j];if(parentCol.level>0){mchElement=this.grid._getMultiHeaderColumnById(parentCol.identifier);if(mchElement&&mchElement.children){mchChildren=mchElement.children;isToHide=true;if(mchElement.hidden!==true){for(k=0;k<mchChildren.length;k++){if(mchChildren[k].level===0){$th=this.grid.container().find("#"+gridId+"_"+mchChildren[k].key)}else{$th=headersTable.find("th[data-mch-id="+mchChildren[k].identifier+"]")}if(!$th.is(":visible")){isToHide=false;break}}}if(isToHide){headersTable.find("th[data-mch-id="+parentCol.identifier+"]").css("display","none")}}}}}}},_createHeaderColumnMarkup:function(headerText,colSpan,columnKey,level,identifier,rowspan){var grid=this.grid,id,isMultiColumnHeader=true,headerClass=grid.css.headerClass,$th=$("<th></th>"),$headerCell;$headerCell=$th.append('<span class="'+grid.css.headerTextClass+'">'+headerText+"</span>").attr("role","rowheader").addClass(headerClass);if(colSpan>1){$th.attr("colspan",colSpan)}if(rowspan>1){$headerCell.attr("rowspan",rowspan)}if(columnKey){$headerCell.attr("id",this.grid.id()+"_"+columnKey)}if(level===0){id=columnKey;isMultiColumnHeader=false;$headerCell.attr("data-isheadercell",true)}else{id=identifier;$headerCell.addClass(this.css.multiHeaderCell);$headerCell.attr("data-mch-id",identifier)}grid._trigger(grid.events.headerCellRendered,null,{owner:grid,th:$headerCell,columnKey:id,isMultiColumnHeader:isMultiColumnHeader});return $headerCell},getMultiColumnHeaders:function(){return this.grid._oldCols},destroy:function(){$.Widget.prototype.destroy.call(this);return this},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance}});$.extend($.ui.igGridMultiHeaders,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Paging 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.editors.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridPaging",{css:{pagerClass:"ui-widget ui-iggrid-pager ui-helper-clearfix ui-corner-bottom ui-widget-header ui-iggrid-footer",pageLink:"ui-iggrid-pagelink ui-helper-reset",page:"ui-iggrid-page ui-state-default ui-corner-all",pageHover:"ui-iggrid-page-hover ui-state-hover",pageList:"ui-helper-reset ui-iggrid-pagelist ui-iggrid-paging-item",pageLinkCurrent:"ui-iggrid-pagelinkcurrent",pageCurrent:"ui-iggrid-pagecurrent ui-state-active ui-corner-all",pageFocused:"ui-iggrid-pagefocused ui-state-focus",nextPage:"ui-iggrid-nextpage ui-iggrid-paging-item ui-state-default",prevPage:"ui-iggrid-prevpage ui-iggrid-paging-item ui-state-default",firstPage:"ui-iggrid-firstpage ui-iggrid-paging-item ui-state-default ui-corner-left",lastPage:"ui-iggrid-lastpage ui-iggrid-paging-item ui-state-default ui-corner-right",nextPageLabel:"ui-iggrid-nextpagelabel",prevPageLabel:"ui-iggrid-prevpagelabel",firstPageLabel:"ui-iggrid-firstpagelabel",lastPageLabel:"ui-iggrid-lastpagelabel",nextPageLabelDisabled:"ui-iggrid-nextpagelabeldisabled ui-state-disabled",prevPageLabelDisabled:"ui-iggrid-prevpagelabeldisabled ui-state-disabled",firstPageLabelDisabled:"ui-iggrid-firstpagelabeldisabled ui-state-disabled",lastPageLabelDisabled:"ui-iggrid-lastpagelabeldisabled ui-state-disabled",nextPageImage:"ui-iggrid-pageimg ui-iggrid-nextpageimg ui-icon ui-icon-triangle-1-e",prevPageImage:"ui-iggrid-pageimg ui-iggrid-prevpageimg ui-icon ui-icon-triangle-1-w",firstPageImage:"ui-iggrid-pageimg ui-iggrid-firstpageimg ui-icon ui-icon-arrowstop-1-w",lastPageImage:"ui-iggrid-pageimg ui-iggrid-lastpageimg ui-icon ui-icon-arrowstop-1-e",nextPageImageDisabled:"ui-iggrid-pageimg ui-iggrid-nextpageimgdisabled ui-icon ui-state-disabled ui-icon-triangle-1-e",prevPageImageDisabled:"ui-iggrid-pageimg ui-iggrid-prevpageimgdisabled ui-icon ui-state-disabled ui-icon-triangle-1-w",firstPageImageDisabled:"ui-iggrid-pageimg ui-iggrid-firstpageimgdisabled ui-icon ui-state-disabled ui-icon-arrowstop-1-w",lastPageImageDisabled:"ui-iggrid-pageimg ui-iggrid-lastpageimgdisabled ui-icon ui-state-disabled ui-icon-arrowstop-1-e",pagerRecordsLabel:"ui-iggrid-pagerrecordslabel ui-iggrid-results",pageSizeLabel:"ui-iggrid-pagesizelabel",pageSizeDropDown:"ui-iggrid-pagesizedropdown",pageSizeDropDownContainer:"ui-helper-clearfix ui-iggrid-pagesizedropdowncontainer",pageSizeDropDownContainerAbove:"ui-widget ui-helper-clearfix ui-iggrid-pagesizedropdowncontainerabove ui-iggrid-toolbar ui-widget-header and ui-corner-top",pageDropDownContainer:"ui-iggrid-pagedropdowncontainer",pageDropDownLabels:"ui-iggrid-pagedropdownlabels",pageDropDown:"ui-iggrid-pagedropdown",pagerRightAreaContainer:"ui-iggrid-paging",pagingResults:"ui-iggrid-results"},options:{pageSize:25,recordCountKey:null,pageSizeUrlKey:null,pageIndexUrlKey:null,currentPageIndex:0,type:null,showPageSizeDropDown:true,pageSizeDropDownLabel:$.ig.GridPaging.locale.pageSizeDropDownLabel,pageSizeDropDownTrailingLabel:$.ig.GridPaging.locale.pageSizeDropDownTrailingLabel,pageSizeDropDownLocation:"above",showPagerRecordsLabel:true,pagerRecordsLabelTemplate:$.ig.GridPaging.locale.pagerRecordsLabelTemplate,nextPageLabelText:$.ig.GridPaging.locale.nextPageLabelText,prevPageLabelText:$.ig.GridPaging.locale.prevPageLabelText,firstPageLabelText:$.ig.GridPaging.locale.firstPageLabelText,lastPageLabelText:$.ig.GridPaging.locale.lastPageLabelText,showFirstLastPages:true,showPrevNextPages:true,currentPageDropDownLeadingLabel:$.ig.GridPaging.locale.currentPageDropDownLeadingLabel,currentPageDropDownTrailingLabel:$.ig.GridPaging.locale.currentPageDropDownTrailingLabel,currentPageDropDownTooltip:$.ig.GridPaging.locale.currentPageDropDownTooltip,pageSizeDropDownTooltip:$.ig.GridPaging.locale.pageSizeDropDownTooltip,pagerRecordsLabelTooltip:$.ig.GridPaging.locale.pagerRecordsLabelTooltip,prevPageTooltip:$.ig.GridPaging.locale.prevPageTooltip,nextPageTooltip:$.ig.GridPaging.locale.nextPageTooltip,firstPageTooltip:$.ig.GridPaging.locale.firstPageTooltip,lastPageTooltip:$.ig.GridPaging.locale.lastPageTooltip,pageTooltipFormat:$.ig.GridPaging.locale.pageTooltipFormat,pageSizeList:[],pageCountLimit:10,visiblePageCount:5,defaultDropDownWidth:70,delayOnPageChanged:350},events:{pageIndexChanging:"pageIndexChanging",pageIndexChanged:"pageIndexChanged",pageSizeChanging:"pageSizeChanging",pageSizeChanged:"pageSizeChanged",pagerRendering:"pagerRendering",pagerRendered:"pagerRendered"},_loadingIndicator:null,_isPaging:false,_setOption:function(key,value){var items,label,id,pager;pager=this._pager();$.Widget.prototype._setOption.apply(this,arguments);if(key==="type"||key==="showPageSizeDropDown"||key==="pageSizeDropDownLocation"||key==="showPagerRecordsLabel"||key==="visiblePageCount"){throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+key)}if(key==="pageSize"){this.pageSize(value)}else if(key==="currentPageIndex"){this.pageIndex(value)}else if(key==="showFirstLastPages"){if(value===true){pager.find(".ui-iggrid-firstpage").show();pager.find(".ui-iggrid-lastpage").show()}else{pager.find(".ui-iggrid-firstpage").hide();pager.find(".ui-iggrid-lastpage").hide()}}else if(key==="showPrevNextPages"){if(value===true){pager.find(".ui-iggrid-prevpage").show();pager.find(".ui-iggrid-nextpage").show()}else{pager.find(".ui-iggrid-prevpage").hide();pager.find(".ui-iggrid-nextpage").hide()}}else if(key==="pageSizeList"){if($.type(value)==="string"){items=value.split(",")}else{items=value}if(this._pageSizeDD){this._pageSizeDD.igEditor("option","listItems",items)}}else if(key==="nextPageLabelText"){label=pager.find(".ui-iggrid-nextpagelabel");label=label.length===0?pager.find(".ui-iggrid-nextpagelabeldisabled"):label;label.text(value)}else if(key==="prevPageLabelText"){label=pager.find(".ui-iggrid-prevpagelabel");label=label.length===0?pager.find(".ui-iggrid-prevpagelabeldisabled"):label;label.text(value)}else if(key==="firstPageLabelText"){label=pager.find(".ui-iggrid-firstpagelabel");label=label.length===0?pager.find(".ui-iggrid-firstpagelabeldisabled"):label;label.text(value)}else if(key==="lastPageLabelText"){label=pager.find(".ui-iggrid-lastpagelabel");label=label.length===0?pager.find(".ui-iggrid-nextpagelabeldisabled"):label;label.text(value)}},pageIndex:function(index){if(index!==null&&index!==undefined){this._overrideLabel=true;this.options.currentPageIndex=index}if(index!==undefined&&index!==null){this.grid.element.trigger("iggriduisoftdirty",{owner:this})}if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}return this.grid.dataSource.pageIndex(index)},pageSize:function(size){var noCancel=true;if(size){this.grid.dataSource.settings.paging.pageIndex=0;this.options.currentPageIndex=0;noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});if(noCancel){this._showLoading();if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}this.options.pageSize=size;this.grid.dataSource.pageSize(size)}if(this._pageSizeDD){this._pageSizeDD.igEditor("value",size)}}else{return this.grid.dataSource.pageSize()}},_initLoadingIndicator:function(){this._loadingIndicator=this.grid.container().igLoading().data("igLoading").indicator()},_nextPage:function(event){var noCancel=true,noCancelBinding=true;noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:this.options.currentPageIndex+1,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){if(this.options.currentPageIndex>=this.grid.dataSource.pageCount()-1){return}this.options.currentPageIndex=this.options.currentPageIndex+1;noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});this._shouldFirePageIndexChanged=true;if(noCancelBinding){this._showLoading();this._overrideLabel=true;this.grid.element.trigger("iggriduisoftdirty",{owner:this});if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}this.grid.dataSource.nextPage()}}if(event){event.stopPropagation();event.preventDefault()}},_prevPage:function(event){var noCancel=true,noCancelBinding=true;noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:this.options.currentPageIndex-1,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){if(this.options.currentPageIndex===0){return}this.options.currentPageIndex=this.options.currentPageIndex-1;noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});this._shouldFirePageIndexChanged=true;if(noCancelBinding){this._showLoading();this._overrideLabel=true;this.grid.element.trigger("iggriduisoftdirty",{owner:this});if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}this.grid.dataSource.prevPage()}}if(event){event.stopPropagation();event.preventDefault()}},_firstPage:function(event){var noCancel=true,noCancelBinding=true;noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:0,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});this._shouldFirePageIndexChanged=true;if(noCancelBinding){this._showLoading();this.pageIndex(0)}}if(event){event.stopPropagation();event.preventDefault()}},_lastPage:function(event){var noCancel=true,noCancelBinding=true;noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:this.grid.dataSource.pageCount()-1,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});this._shouldFirePageIndexChanged=true;if(noCancelBinding){this._showLoading();this.pageIndex(this.grid.dataSource.pageCount()-1)}}if(event){event.stopPropagation();event.preventDefault()}},_showLoading:function(){this._loadingIndicator.show()},_hideLoading:function(){this._loadingIndicator.hide()},_bindEvents:function(pagerElement){var paging=this,grid=this.grid,noCancel=true,id,noCancelBinding=true;id="#"+grid.element[0].id+"_pager";$(id+" li").bind({mousedown:function(event){var $eventTarget=$(event.target),newIndex=$eventTarget.data("pageIndex");if(newIndex===undefined){newIndex=$eventTarget.parent().data("pageIndex")}if($.type(newIndex)==="number"&&newIndex!==paging.options.currentPageIndex){noCancel=paging._trigger(paging.events.pageIndexChanging,event,{newPageIndex:newIndex,currentPageIndex:paging.options.currentPageIndex,owner:paging});paging._shouldFirePageIndexChanged=true;if(noCancel){noCancelBinding=paging.grid._trigger(paging.grid.events.dataBinding,null,{owner:paging.grid});if(noCancelBinding){paging._showLoading(grid.element.children("tbody"));paging.pageIndex(newIndex)}}}}});$(id+" li").bind({mouseover:function(event){$(event.currentTarget).addClass(paging.css.pageHover)},mouseout:function(event){$(event.currentTarget).removeClass(paging.css.pageHover)}});this.grid.element.bind("iggridupdatinginternalrowdeleted",this._rowDeletedHandler);this.grid.element.bind("iggridupdatinginternalrowadded",this._rowAddedHandler)},_gridRendered:function(gridContainer){var self=this;if(this.options.showPageSizeDropDown===true&&this.options.pageSizeDropDownLocation==="above"&&!this._pageSizeDropDownRendered){self._renderPageSizeDropDown(gridContainer,true)}if(this.grid.options.autoAdjustHeight){this.grid._initializeHeights();this.grid._adjustLastColumnWidth()}if(this.grid.options.caption!==null&&!($.ig.util.isIE&&$.ig.util.browserVersion>=8)){this.grid._caption().removeClass("ui-corner-top")}},_rowDeleted:function(evt,ui){if(this.options.type==="remote"||ui.owner.grid.id()!==this.grid.id()){return}var currentPageIndex=this.options.currentPageIndex,pageCount=this.grid.dataSource.pageCount();if(currentPageIndex>0&&currentPageIndex+1>pageCount){currentPageIndex--}this.pageIndex(currentPageIndex)},_rowAdded:function(evt,ui){if(this.options.type==="remote"||ui.owner.grid.id()!==this.grid.id()){return}var currentPageIndex=this.options.currentPageIndex,pageCount=this.grid.dataSource.pageCount();if(currentPageIndex<pageCount&&this.grid.options.autoCommit){this.pageIndex(pageCount-1)}else{this._dataRendered()}},_gridCommit:function(){if(this.options.type==="remote"){return}this.pageIndex(this.options.currentPageIndex);return true},_plabel:function(){return this._pager().find(".ui-iggrid-pagerrecordslabel")},_pager:function(){return this.grid.container().find(".ui-iggrid-pager")},_dataRendered:function(){var id=this.grid.element[0].id,pageCount,i,html,pagerHtml=toStaticHTML('<div id="'+id+'_pager"></div>'),pageLinkHtml=toStaticHTML('<li class="${pageClass}"><a class="${pageLinkClass}" href="javascript:void(0);">${page}</a></li>'),pager=null,startRecord=0,endRecord=0,recordsCount=0,localRecordsCount=0,noCancel=true,pageList,pagesArray,dropDownContainer,startPageIndex=0,endPageIndex=0,template=this.options.pagerRecordsLabelTemplate,self=this,pagerRight=null,vpc=this.options.visiblePageCount,val=0,recordsLabel=null;this._deleteOld();noCancel=this._trigger(this.events.pagerRendering,null,{dataSource:this.grid.dataSource,owner:this});if(noCancel){if(this.grid._shouldResetPaging){this.options.currentPageIndex=0;this.grid._shouldResetPaging=false}if(this._plabel().length>0){this._pager().find(".ui-iggrid-paging").remove()}else{this._pager().empty()}this._initLoadingIndicator();if(this.grid.dataSource.pageSizeDirty()){this.options.currentPageIndex=this.grid.dataSource.pageIndex();this.grid.dataSource.pageSizeDirty(false)}if(this._pager().length===0){id=this.grid.element[0].id;pager=$(pagerHtml).appendTo(this.grid.container())}else{pager=this._pager()}pager.addClass(this.css.pagerClass);if(this.options.showPagerRecordsLabel){recordsCount=this.grid.dataSource.totalRecordsCount()>0?this.grid.dataSource.totalRecordsCount():this.grid.dataSource.totalLocalRecordsCount();startRecord=this.options.currentPageIndex===0?1:this.options.currentPageIndex*this.pageSize()+1;if(this.grid.dataSource._filter){recordsCount=this.grid.dataSource._filteredData.length;localRecordsCount=this.grid.dataSource._filteredData.length}else{localRecordsCount=this.grid.dataSource.totalLocalRecordsCount()}endRecord=this.options.currentPageIndex===0&&this.pageSize()<=recordsCount?this.pageSize():startRecord+this.pageSize()>recordsCount?recordsCount:startRecord-1+this.pageSize();if(this.grid.dataSource.totalLocalRecordsCount()===0){startRecord=0;endRecord=0}if(endRecord>localRecordsCount&&this.options.type==="local"){endRecord=localRecordsCount}if(this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").data("overrideLabel")===0||this._overrideLabel||!this.grid.dataSource._filter){this._plabel().remove();template=template.replace("${startRecord}",startRecord).replace("${endRecord}",endRecord).replace("${recordCount}",recordsCount);recordsLabel=$("<span>"+template+"</span>").appendTo(pager).attr("id",pager[0].id+"_label").addClass(this.css.pagerRecordsLabel).attr("title",this.options.pagerRecordsLabelTooltip).show()}else if(this._plabel().length===0){recordsLabel=$("<span></span>").appendTo(pager).attr("id",pager[0].id+"_label").addClass(this.css.pagerRecordsLabel).attr("title",this.options.pagerRecordsLabelTooltip).show()}if(recordsLabel){recordsLabel.data("hideflag",false)}this._plabel().show();this._overrideLabel=false}pageCount=this.grid.dataSource.pageCount();pagerRight=$("<div></div>").appendTo(pager).addClass(this.css.pagerRightAreaContainer);if(this.options.showFirstLastPages===true){this._renderFirstPage(pagerRight)}if(this.options.showPrevNextPages===true){this._renderPrevPage(pagerRight)}if(this.grid.dataSource.pageCount()<=this.options.pageCountLimit){pageList=$("<ul></ul>").appendTo(pagerRight).addClass(this.css.pageList);if(!this._pagerEvents){this._pagerEvents={keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._showLoading();self.pageIndex($(event.currentTarget).closest("li").data("pageIndex"));event.stopPropagation();event.preventDefault()}},focus:function(event){$(event.currentTarget).closest("li").addClass(self.css.pageFocused)},blur:function(event){$(event.currentTarget).closest("li").removeClass(self.css.pageFocused)}}}else{this._pager().undelegate("li a",this._pagerEvents)}this._pager().delegate("li a",this._pagerEvents);val=Math.floor(parseInt(vpc,10)/2);startPageIndex=this.options.currentPageIndex-val;if(startPageIndex<0){startPageIndex=0}endPageIndex=this.options.currentPageIndex+val;if(this.options.currentPageIndex-startPageIndex<val){endPageIndex+=val-(this.options.currentPageIndex-startPageIndex)}if(this.grid.dataSource.pageCount()-(this.options.currentPageIndex+1)<val&&vpc%2!==0){startPageIndex=startPageIndex-(val-(this.grid.dataSource.pageCount()-(this.options.currentPageIndex+1)))}if(endPageIndex>=this.grid.dataSource.pageCount()){endPageIndex=this.grid.dataSource.pageCount()-1}if(startPageIndex<0){startPageIndex=0}if(vpc%2===0&&endPageIndex-startPageIndex<vpc-1){startPageIndex-=vpc-1-(endPageIndex-startPageIndex)}if(startPageIndex<0){startPageIndex=0}for(i=startPageIndex;i<=endPageIndex&&i-startPageIndex<vpc;i++){html=pageLinkHtml.replace("${page}",i+1).replace("${pageLinkClass}",i===this.options.currentPageIndex?this.css.pageLinkCurrent:this.css.pageLink);html=html.replace("${pageClass}",i===this.options.currentPageIndex?this.css.pageCurrent:this.css.page);$(html).appendTo(pageList).attr("title",this.options.pageTooltipFormat.replace("${index}",i+1)).data("pageIndex",i)}}else{pagesArray=[];for(i=1;i<=pageCount;i++){pagesArray.push(i+this._empty())}dropDownContainer=$("<div></div>").appendTo(pagerRight).addClass(this.css.pageDropDownContainer).attr("title",this.options.currentPageDropDownTooltip);$("<span></span>").appendTo(dropDownContainer).text(this.options.currentPageDropDownLeadingLabel).addClass(this.css.pageDropDownLabels);this._curPageDD=$("<span />").css("display","none").appendTo(dropDownContainer).addClass(this.css.pageDropDownContainer).igEditor({listItems:pagesArray,readOnly:false,listMatchOnly:true,width:this.options.defaultDropDownWidth,nullable:false,listAutoComplete:true,button:"dropdown",type:"text",value:this.options.currentPageIndex+1,dropDownTriggers:"button,focus",textChanged:$.proxy(this._onSelectDropDownPageIndex,this)}).css("display","");$("<span></span>").appendTo(dropDownContainer).text(this.options.currentPageDropDownTrailingLabel.replace("${count}",this.grid.dataSource.pageCount())).addClass(this.css.pageDropDownLabels)}if(this.options.showPrevNextPages===true){this._renderNextPage(pagerRight)}if(this.options.showFirstLastPages===true){this._renderLastPage(pagerRight)}if(this.options.showPageSizeDropDown&&this.options.pageSizeDropDownLocation==="inpager"){this._renderPageSizeDropDown(pagerRight)}this._bindEvents(pager);this._hideLoading(this.grid.element.children("tbody"));pager.show();if(this._shouldFirePageSizeChanged){this._shouldFirePageSizeChanged=false;this._trigger(this.events.pageSizeChanged,null,{pageSize:this.pageSize(),owner:this})}this._trigger(this.events.pagerRendered,null,{dataSource:this.grid.dataSource,owner:this});if(this._shouldFirePageIndexChanged){this._shouldFirePageIndexChanged=false;this._trigger(this.events.pageIndexChanged,null,{pageIndex:this.options.currentPageIndex,owner:this})}}},_onSelectDropDownPageIndex:function(event,args){var self=this;if(this._timeoutId!==undefined){clearTimeout(this._timeoutId)}if(parseInt(this.options.delayOnPageChanged,10)===0){this._dropDownPageIndex(event,args)}else{this._timeoutId=setTimeout(function(){self._dropDownPageIndex(event,args)},this.options.delayOnPageChanged)}},_dropDownPageIndex:function(event,args){var noCancel=true,noCancelBinding=true;noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:parseInt(args.text,10)-1,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});if(noCancelBinding){this._shouldFirePageIndexChanged=true;if(args.text){this._showLoading();this.pageIndex(parseInt(args.text,10)-1)}}this.grid.element.trigger("iggriduisoftdirty",{owner:this})}else{args.owner.value(this.options.currentPageIndex+1)}},_renderPrevPage:function(pager){var prev,self=this,imgspan;prev=$("<div></div>").appendTo(pager).addClass(this.css.prevPage).attr("title",this.options.prevPageTooltip);if(this.options.currentPageIndex===0){$("<span></span>").appendTo(prev).addClass(this.css.prevPageImageDisabled);$("<span></span>").appendTo(prev).addClass(this.css.prevPageLabelDisabled).append(this.options.prevPageLabelText)}else{prev.bind("mousedown",$.proxy(this._prevPage,this));imgspan=$("<span></span>").appendTo(prev).addClass(this.css.prevPageImage);$("<span></span>").appendTo(prev).addClass(this.css.prevPageLabel).append(this.options.prevPageLabelText);imgspan.wrap(toStaticHTML('<a href="javascript:void(0);"></a>'));imgspan.parent().bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._prevPage();event.stopPropagation();event.preventDefault()}},focus:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-default").addClass("ui-state-focus")},blur:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-focus").addClass("ui-state-default")}})}},_renderNextPage:function(pager){var next,self=this,imgspan;next=$("<div></div>").appendTo(pager).addClass(this.css.nextPage).attr("title",this.options.nextPageTooltip);if(this.options.currentPageIndex===this.grid.dataSource.pageCount()-1){$("<span></span>").appendTo(next).addClass(this.css.nextPageLabelDisabled).append(this.options.nextPageLabelText);$("<span></span>").appendTo(next).addClass(this.css.nextPageImageDisabled)}else{next.bind("mousedown",$.proxy(this._nextPage,this));$("<span></span>").appendTo(next).addClass(this.css.nextPageLabel).append(this.options.nextPageLabelText);imgspan=$("<span></span>").appendTo(next).addClass(this.css.nextPageImage);imgspan.wrap(toStaticHTML('<a href="javascript:void(0);"></a>'));imgspan.parent().bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._nextPage();event.stopPropagation();event.preventDefault()}},focus:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-default").addClass("ui-state-focus")},blur:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-focus").addClass("ui-state-default")}})}},_renderFirstPage:function(pager){var first,self=this,imgspan;first=$("<div></div>").appendTo(pager).addClass(this.css.firstPage).attr("title",this.options.firstPageTooltip);if(this.options.currentPageIndex===0){$("<span></span>").appendTo(first).addClass(this.css.firstPageImageDisabled);$("<span></span>").appendTo(first).addClass(this.css.firstPageLabelDisabled).append(this.options.firstPageLabelText)}else{first.bind("mousedown",$.proxy(this._firstPage,this));imgspan=$("<span></span>").appendTo(first).addClass(this.css.firstPageImage);$("<span></span>").appendTo(first).addClass(this.css.firstPageLabel).append(this.options.firstPageLabelText);imgspan.wrap(toStaticHTML('<a href="javascript:void(0);"></a>'));imgspan.parent().bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._firstPage();event.stopPropagation();event.preventDefault()}},focus:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-default").addClass("ui-state-focus")},blur:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-focus").addClass("ui-state-default")}})}},_renderLastPage:function(pager){var last,self=this,imgspan;last=$("<div></div>").appendTo(pager).addClass(this.css.lastPage).attr("title",this.options.lastPageTooltip);if(this.options.currentPageIndex===this.grid.dataSource.pageCount()-1){$("<span></span>").appendTo(last).addClass(this.css.lastPageLabelDisabled).append(this.options.lastPageLabelText);$("<span></span>").appendTo(last).addClass(this.css.lastPageImageDisabled)}else{last.bind("mousedown",$.proxy(this._lastPage,this));$("<span></span>").appendTo(last).addClass(this.css.lastPageLabel).append(this.options.lastPageLabelText);imgspan=$("<span></span>").appendTo(last).addClass(this.css.lastPageImage);imgspan.wrap(toStaticHTML('<a href="javascript:void(0);"></a>'));imgspan.parent().bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._lastPage();event.stopPropagation();event.preventDefault()}},focus:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-default").addClass("ui-state-focus")},blur:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-focus").addClass("ui-state-default")}})}},_renderPageSizeDropDown:function(parent,prepend){var editorId=this.grid.id()+"_editor",cClass,items;cClass=this.options.pageSizeDropDownLocation==="above"?this.css.pageSizeDropDownContainerAbove:this.css.pageSizeDropDownContainer;if(prepend){parent=$("<div></div>").prependTo(parent).addClass(cClass)}else{parent=$("<div></div>").appendTo(parent).addClass(cClass)}parent.attr("title",this.options.pageSizeDropDownTooltip);parent=$("<div></div>").appendTo(parent).addClass(this.css.pagingResults);if(prepend){$("<span>"+this.options.pageSizeDropDownTrailingLabel+"</span>").prependTo(parent).addClass(this.css.pageSizeLabel);$("<span></span>").prependTo(parent).attr("id",editorId).addClass(this.css.pageSizeDropDown);$("<span>"+this.options.pageSizeDropDownLabel+"</span>").prependTo(parent).addClass(this.css.pageSizeLabel)}else{$("<span>"+this.options.pageSizeDropDownLabel+"</span>").appendTo(parent).addClass(this.css.pageSizeLabel);$("<span></span>").appendTo(parent).attr("id",editorId).addClass(this.css.pageSizeDropDown);$("<span>"+this.options.pageSizeDropDownTrailingLabel+"</span>").appendTo(parent).addClass(this.css.pageSizeLabel)}items=this.options.pageSizeList===null||this.options.pageSizeList.length===0?[5,10,20,25,50,75,100]:this.options.pageSizeList;if($.type(items)==="string"){items=items.split(",")}this._pageSizeDD=this.grid.container().find("#"+editorId).css("display","none").igEditor({width:this.options.defaultDropDownWidth,button:"dropdown",dropDownOnReadOnly:true,dropDownTriggers:"button,focus",listItems:items,listMatchOnly:true,readOnly:true,textAlign:"left",type:"numeric",value:this.pageSize(),textChanged:$.proxy(this._changePageSize,this)}).css("display","");if($.ig.util.isIE8===true&&this.grid.options._isHierarchicalGrid&&this.grid.options.fixedHeaders){$("<col></col>").appendTo(this.grid.headersTable().find("colgroup")).remove()}this._pageSizeDropDownRendered=true;this._trigger("pagingdropdownrendered")},_changePageSize:function(event,args){var noCancel=true,size=args.owner.value();noCancel=this._trigger(this.events.pageSizeChanging,null,{currentPageSize:this.pageSize(),newPageSize:size,owner:this});if(noCancel){if(this.options.type==="remote"){this.grid.element.trigger("iggriduidirty",{owner:this})}else{this.grid.element.trigger("iggriduisoftdirty",{owner:this})}this.pageSize(size);if(this.options.type==="remote"){this._shouldFirePageSizeChanged=true}else{this._trigger(this.events.pageSizeChanged,null,{pageSize:size,owner:this})}}else{args.owner.value(this.pageSize())}},_deleteOld:function(destroy){if(this._curPageDD){this._curPageDD.igEditor("destroy");delete this._curPageDD}if(this._pageSizeDD&&this._pageSizeDD.closest("body").length>0&&(destroy||this.options.pageSizeDropDownLocation==="inpager")){this._pageSizeDD.igEditor("destroy");delete this._pageSizeDD}this.grid.element.unbind("iggridupdatinginternalrowdeleted",this._rowDeletedHandler);this.grid.element.unbind("iggridupdatinginternalrowadded",this._rowAddedHandler)},destroy:function(){var pager=this._pager();this.pageSize(0);this._deleteOld(true);if(this.options.showPageSizeDropDown===true&&this.options.pageSizeDropDownLocation==="above"){$("#"+this.grid.container()[0].id+" .ui-iggrid-pagesizedropdowncontainerabove").remove()}pager.remove();if(this._loadingIndicator){delete this._loadingIndicator}$.Widget.prototype.destroy.call(this);return this},_createHandlers:function(){this._rowDeletedHandler=$.proxy(this._rowDeleted,this);this._rowAddedHandler=$.proxy(this._rowAdded,this)},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;this._createHandlers();if(this.options.type===null){this.options.type=this.grid._inferOpType()}this.grid.dataSource.settings.paging.type=this.options.type||"remote";this.grid.dataSource.settings.paging.pageIndex=this.options.currentPageIndex;this.grid.dataSource.settings.paging.pageSize=parseInt(this.options.pageSize,10);if(this.options.pageSizeUrlKey!==null&&this.options.pageIndexUrlKey){this.grid.dataSource.settings.paging.pageSizeUrlKey=this.options.pageSizeUrlKey;this.grid.dataSource.settings.paging.pageIndexUrlKey=this.options.pageIndexUrlKey}if(this.options.recordCountKey!==null){this.grid.dataSource.settings.responseTotalRecCountKey=this.options.recordCountKey}this.grid.dataSource.settings.paging.enabled=true;if(this._pageSizeDD){this._pageSizeDD.igEditor("option","value",this.options.pageSize)}},_empty:function(){return""}});$.extend($.ui.igGridPaging,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Column Resizing 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridResizing",{options:{allowDoubleClickToResize:true,deferredResizing:false,columnSettings:[{columnKey:null,columnIndex:null,allowResizing:true,minimumWidth:20,maximumWidth:null}],handleTreshold:5},css:{columnResizeLine:"ui-iggrid-resize-line",resizingHandleCursor:"ui-iggrid-resizing-handle-cursor",resizingHandle:"ui-iggrid-resizing-handle"},events:{columnResizing:"columnResizing",columnResized:"columnResized"},_createWidget:function(options,element){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_setOption:function(key,value){throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+key)},destroy:function(){this._clearResizingHandles();this.grid.element.unbind(".resizing");$.Widget.prototype.destroy.call(this);return this},resize:function(column,width){var columnIndex;if(typeof column==="number"){columnIndex=column}else{$.each(this.grid._visibleColumns(),function(index,col){if(col.key===column){columnIndex=index}})}if(width===undefined||width===null){this._autoResize(columnIndex,false,null)}else{this._resizeColumn(columnIndex,width,false,null)}},_headerRendered:function(event,ui){this._renderResizingHandles()},_columnsCollectionModified:function(){this._renderResizingHandles()},_columnsMoved:function(){this._populateMultiColumnHeadersLevel0()},_renderResizingHandles:function(){var self=this,ths,visibleColumns=this.grid._visibleColumns(),thsMultiHeader;this._clearResizingHandles();if(visibleColumns.length===0){return}if(this.grid._isMultiColumnGrid){thsMultiHeader=this.grid.headersTable().find("> thead > tr th").not("[data-skip=true]").not("[data-isheadercell=true]");this._populateMultiColumnHeadersLevel0();thsMultiHeader.each(function(index){var a,th=$(this);a=self._renderResizingHandle(th);self._bindMultipleResizingHandle(th,a.find("span"))});ths=$(this.grid._headerCells)}else{if(this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true){ths=this.grid.headersTable().find("> thead > tr").eq(0).children("th").not("[data-skip=true]")}else{ths=this.grid.headersTable().find("> thead > tr[data-header-row]").eq(0).children("th").not("[data-skip=true]")}}ths.each(function(index){var a,cs,th=$(this),col=visibleColumns[index];if(col===null||col===undefined){return true}cs=self._findColumnSettingsByKey(col.key);if(cs.allowResizing){a=self._renderResizingHandle(th);self._bindResizingHandle(th,a.find("span"),col)}})},_renderResizingHandle:function(th){var div,a;if(!this._resizingHandles){this._resizingHandles=[]}div=$("<div data-resizinghandle='true' />").css("position","relative").css("width","100%").css("height","0px").css("top","0px").css("left","0px").prependTo(th);a=$("<a href='#' />").attr("title","").prependTo(div);if($.ig.util.isIE9){a.addClass(this.css.resizingHandleCursor)}$("<span data-nonpaddedindicator='right'></span>").attr("title","").css("position","absolute").css("margin-right",-parseInt(th.css("padding-right"),10)+"px").css("right","0px").css("width",this.options.handleTreshold+"px").addClass(this.css.resizingHandleCursor).addClass(this.css.resizingHandle).appendTo(a);this._resizingHandles.push(div);return a},_populateMultiColumnHeadersLevel0:function(){var i,j,self=this,cols=this.grid._oldCols||[],colsLength=cols.length,ths=$(this.grid._headerCells),level0=[],level0Length,visibleColumns=this.grid._visibleColumns();for(i=0;i<colsLength;i++){if(cols[i].level===0){level0.push(cols[i])}else{for(j=0;j<cols[i].children.length;j++){level0.push(cols[i].children[j])}}}level0Length=level0.length;ths.each(function(index){var th=$(this),col=visibleColumns[index],cs;if(col===null||col===undefined){return true}cs=self._findColumnSettingsByKey(col.key);if(cs.allowResizing){for(i=0;i<level0.length;i++){if(level0[i].key===col.key){break}}if(i<level0Length){level0[i].allowResizing=true;level0[i].visibleIndex=index;level0[i].settings=cs}th.col=level0[i]}})},_bindMultipleResizingHandle:function($th,button){var self=this,id=$th.attr("data-mch-id"),column;column=this.grid._getMultiHeaderColumnById(id);button.mouseWrapper({distance:5,start:function(event){return self._startResizing($th)},drag:function(event){return self._doResizingMultiColumnHeader(event.originalEvent,$th,column)},stop:function(event){return self._stopResizingMiltiColumnHeader(event.originalEvent,$th,column)}}).bind("dblclick.resizing",function(event){self._handleMouseMultiColumnHeaderDbClick(event,$th,column)}).bind("click.resizing",function(event){event.preventDefault();event.stopPropagation()})},_bindResizingHandle:function(th,button,column){var self=this;button.mouseWrapper({distance:5,start:function(event){return self._startResizing(th)},drag:function(event){return self._doResizing(event.originalEvent,th,column)},stop:function(event){return self._stopResizing(event.originalEvent,th,column)}}).bind("dblclick.resizing",function(event){self._handleMouseDbClick(event,th,column)}).bind("click.resizing",function(event){event.preventDefault();event.stopPropagation()})},_clearResizingHandles:function(){var i;if(this._resizingHandles){for(i=0;i<this._resizingHandles.length;i++){this._resizingHandles[i].remove()}this._resizingHandles=[]}},_handleMouseDbClick:function(event,th,column){if(!this.options.allowDoubleClickToResize){return}this._autoResize($.inArray(column,this.grid._visibleColumns()),true,event)},_handleMouseMultiColumnHeaderDbClick:function(event,$th,column){var i,children=column.children,childrenLength=children.length;if(!this.options.allowDoubleClickToResize){return}for(i=0;i<childrenLength;i++){if(children[i].allowResizing===true){this._autoResize(children[i].visibleIndex,true,event)}}},_autoResize:function(columnIndex,fireEvents,event){var rows,cells=[],maxWidth=0,measureDiv,i;rows=this.grid.element.find("> tbody > tr").not("[data-container=true]").not("[data-grouprow=true]");for(i=0;i<rows.length;i++){cells.push(rows.eq(i).children("td").not("[data-skip=true]").not(".ui-iggrid-rowselector-class").not(".ui-iggrid-expandcolumn").eq(columnIndex))}if(cells.length>0){measureDiv=$("<div></div>").css({position:"absolute",visibility:"hidden",height:"auto",width:"auto",left:-1e3,top:-1e3,"font-family":cells[0].css("fontFamily"),"font-size":cells[0].css("fontSize"),"font-size-adjust":cells[0].css("fontSizeAdjust"),"font-stretch":cells[0].css("fontStretch"),"font-style":cells[0].css("fontStyle"),"font-variant":cells[0].css("fontVariant"),"font-weight":cells[0].css("fontWeight")}).appendTo($(document.body));for(i=0;i<cells.length;i++){measureDiv.html(cells[i][0].innerHTML);maxWidth=Math.max(maxWidth,measureDiv[0].offsetWidth)}maxWidth=maxWidth+cells[0].outerWidth()-cells[0].width();if($.ig.util.isIE){maxWidth+=1}measureDiv.remove();return this._resizeColumn(columnIndex,maxWidth,fireEvents,event)}},_cancelHoveringEffects:function(cancel){var topmostGrid=this.grid.element.closest(".ui-iggrid-root").data("igGrid");if(topmostGrid===undefined||topmostGrid===null){topmostGrid=this.grid}topmostGrid._cancelHoveringEffects=cancel},_startResizing:function(th){var body=$(document.body),resizeLineTop,heightOffset;this._resizing=true;this._cancelHoveringEffects(true);if(!$.ig.util.isIE10){$(document.activeElement).blur()}else{body.focus()}body.addClass(this.css.resizingHandleCursor);if(this.grid._isMultiColumnGrid){heightOffset=th.offset().top-this._gridContainerPositioningOffset().top}resizeLineTop=th.offset().top+this._gridContainerPositioningOffset().top;if(this.grid.options.height!==null&&this.grid.options.showHeader===true){if(this.grid.options.fixedHeaders===false){resizeLineTop+=this.grid.scrollContainer().scrollTop()}else{this._headersHeight=this.grid.headersTable().outerHeight()}}this._resizeLine=$("<div></div>").addClass(this.css.columnResizeLine).data("efh","1").css({height:this._calculateGridResizableHeight(heightOffset),top:resizeLineTop,visibility:"hidden"}).appendTo(this.grid.container());return true},_doResizingMultiColumnHeader:function(event,$th,column){var i,width,resizeCellRange,resizeResult,range,offsetLeft,offsetHeight,children=column.children,childrenLength=children.length,child=null,cellToResize;width=event.pageX-$th.offset().left;if(width<0){width=0}offsetHeight=$th.offset().top-this.grid.headersTable().offset().top;if(!this.options.deferredResizing){for(i=childrenLength-1;i>=0;i--){if(children[i].allowResizing&&!children[i].hidden){child=children[i];child.resized=!child.resized;if(child.resized){break}}}if(child!==null&&!child.hidden){cellToResize=$("#"+this.grid.element[0].id+"_"+child.key);width=cellToResize[0].offsetWidth-$th[0].offsetWidth+width;resizeResult=this._resizeColumn(child.visibleIndex,width,true,event,child.visibleIndex)}if(!resizeResult){return true}if(!resizeResult.canceled){this._resizeLine.css("height",this._calculateGridResizableHeight(offsetHeight));this._resizeLine.css({left:$th.offset().left+$th.outerWidth()+this._gridContainerPositioningOffset().left,visibility:"visible"})}}else{offsetLeft=$th.offset().left;range={min:offsetLeft,max:offsetLeft};for(i=0;i<childrenLength;i++){child=children[i];if(child.hidden){continue}if(child.allowResizing){resizeCellRange=this._getRange(this.options.columnSettings[child.visibleIndex]);range.min+=resizeCellRange.min;if(resizeCellRange.max===Infinity){range.max=Infinity}else if(range.max!==Infinity){range.max+=resizeCellRange.max}}else{range.min+=$("#"+this.grid.element[0].id+"_"+child.key)[0].offsetWidth}}this._resizeLine.css("height",this._calculateGridResizableHeight(offsetHeight));this._resizeLine.css({left:this._coerceRange(range,event.pageX)+this._gridContainerPositioningOffset().left,visibility:"visible"})}return true},_doResizing:function(event,th,column){var width,resizeResult,columnIndex=$.inArray(column,this.grid._visibleColumns()),range,offsetLeft,offsetHeight;if(!this.options.deferredResizing){width=event.pageX-th.offset().left;if(width<0){width=0}if(this.grid._isMultiColumnGrid){offsetHeight=th.offset().top-this.grid.headersTable().offset().top}resizeResult=this._resizeColumn(columnIndex,width,true,event);if(!resizeResult.canceled){this._resizeLine.css("height",this._calculateGridResizableHeight(offsetHeight));this._resizeLine.css({left:th.offset().left+th.outerWidth()+this._gridContainerPositioningOffset().left,visibility:"visible"})}}else{range=this._getRange(this.options.columnSettings[columnIndex]);offsetLeft=th.offset().left;range.min+=offsetLeft;range.max+=offsetLeft;this._resizeLine.css({left:this._coerceRange(range,event.pageX)+this._gridContainerPositioningOffset().left,visibility:"visible"})}return true},_stopResizingMiltiColumnHeader:function(event,th,column){var i,width,cs,columnKey,self=this,children,childrenLength,childrenLengthAllowResizing=0,childrenToResize;if(this.options.deferredResizing){width=event.pageX-th.offset().left;children=column.children;childrenLength=children.length;childrenToResize=[];for(i=0;i<childrenLength;i++){columnKey=children[i].key;cs=this._findColumnSettingsByKey(columnKey);if(children[i].allowResizing===false||cs&&cs.allowResizing===false){width-=$("#"+this.grid.element[0].id+"_"+columnKey)[0].offsetWidth;continue}childrenToResize.push(children[i]);childrenLengthAllowResizing++}if(childrenLengthAllowResizing>0){this._resizeMCHDeffered(width,childrenToResize)}}$("body").removeClass(this.css.resizingHandleCursor);setTimeout(function(){self._resizing=false},0);this._cancelHoveringEffects(false);this._resizeLine.remove();this._resizeLine=undefined;return true},_resizeMCHDeffered:function(width,columns){var i,column,columnIndex,columnsLength=columns.length,visibleColumns=[],gridVC=this.grid._visibleColumns(),resizeInfo,newWidth=width,newColumnsToResize=[],avgWidth;if(columnsLength===0){return}for(i=0;i<columnsLength;i++){columnIndex=$.inArray(columns[i],gridVC);if(columnIndex===-1||this.options.columnSettings[columnIndex].allowResizing===false){continue}visibleColumns.push({column:column,columnIndex:columnIndex})}columnsLength=visibleColumns.length;if(columnsLength>0){avgWidth=parseInt(width/columnsLength,10);for(i=0;i<columnsLength;i++){column=visibleColumns[i].column;columnIndex=visibleColumns[i].columnIndex;resizeInfo=this._resizeColumn(columnIndex,avgWidth,true);if(resizeInfo.newWidth!==avgWidth){newWidth-=resizeInfo.newWidth}else{newColumnsToResize.push(column)}}}if(newWidth>5&&newWidth!==width&&newColumnsToResize.length>0){this._resizeMCHDeffered(newWidth,newColumnsToResize)}},_stopResizing:function(event,th,column){var width,self=this,columnIndex=$.inArray(column,this.grid._visibleColumns());if(this.options.deferredResizing){width=event.pageX-th.offset().left;width=this._coerceRange(this._getRange(this.options.columnSettings[columnIndex]),width);this._resizeColumn(columnIndex,width,true,event)}$("body").removeClass(this.css.resizingHandleCursor);setTimeout(function(){self._resizing=false;if(self._headersHeight&&self._headersHeight!==self.grid.headersTable().outerHeight()){self.grid._initializeHeights()}},0);this._cancelHoveringEffects(false);this._resizeLine.remove();this._resizeLine=undefined;return true},_resizeColumn:function(columnIndex,width,fireEvents,originalEvent,startIndex){var columnKey=this.grid._visibleColumns()[columnIndex].key,headersTable=this.grid.headersTable(),headers,cs,headerWidth,headerColumns,columnSettings=this.options.columnSettings,columnsLength,headerColStyleWidth,hasPercentageWidth,actualColumnStyleWidths=[],actualColumnWidths=[],requiredColumnPercentageWidths=[],newColumnStyleWidths=[],i,widthToDistribute,shrinkColumns,widthDistributed,widthUsed,coercedWidth,widthPerColumn,range,totalWidth,readyColumns,readyColumnsCount,finalPixelWidth,allColumnsHaveWidth,noCancel,containerWidth,isResized=true;if(this.grid._isMultiColumnGrid){headers=$(this.grid._headerCells);if(headers.length>0){headerWidth=$(headers[columnIndex])[0].offsetWidth}}else{if(this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true){headers=headersTable.find("> thead > tr").first().children("th").not("[data-skip=true]")}else{headers=headersTable.find("> thead > tr[data-header-row]").first().children("th").not("[data-skip=true]")}if(headers.length>0){headerWidth=headers.get(columnIndex).offsetWidth}}headerColumns=headersTable.find("> colgroup > col").not("[data-skip=true]");columnSettings=this.options.columnSettings;columnsLength=headerColumns.length;headerColStyleWidth=headerColumns[columnIndex].style.width;hasPercentageWidth=/%$/.test(headerColStyleWidth);if(fireEvents){noCancel=this._trigger(this.events.columnResizing,originalEvent,{owner:this,columnIndex:columnIndex,columnKey:columnKey,desiredWidth:width});if(!noCancel){return{canceled:true,originalWidth:width,newWidth:width}}}if(columnKey!==undefined){cs=this._findColumnSettingsByKey(columnKey)}else{cs=columnSettings[columnIndex]}range=this._getRange(cs);width=this._coerceRange(range,width);width=Math.floor(width);if(width===range.min||width===range.max){isResized=false}if(this.grid._isMultiColumnGrid){if($.ig.util.isWebKit&&hasPercentageWidth){totalWidth=headersTable[0].offsetWidth;for(i=0;i<columnsLength;i++){actualColumnWidths[i]=parseFloat(headerColumns[i].style.width)/100*totalWidth}}else if(headers.length>0){for(i=0;i<columnsLength;i++){actualColumnStyleWidths[i]=headerColumns[i].style.width;actualColumnWidths[i]=headers[i][0].offsetWidth}}}else{if($.ig.util.isWebKit&&hasPercentageWidth){totalWidth=headersTable[0].offsetWidth;for(i=0;i<columnsLength;i++){actualColumnWidths[i]=parseFloat(headerColumns[i].style.width)/100*totalWidth}}else if(headers.length>0){for(i=0;i<columnsLength;i++){actualColumnStyleWidths[i]=headerColumns[i].style.width;actualColumnWidths[i]=headers[i].offsetWidth}}}if(hasPercentageWidth){widthToDistribute=headerWidth-width;shrinkColumns=widthToDistribute<0;readyColumns=[];readyColumnsCount=0;widthDistributed=0;if(startIndex===undefined||startIndex===null){startIndex=0}while(readyColumnsCount<columnsLength-1-startIndex&&(shrinkColumns&&widthToDistribute<-.05||!shrinkColumns&&widthToDistribute>.05)){widthPerColumn=widthToDistribute/(columnsLength-1);for(i=startIndex;i<columnsLength;i++){if(i!==columnIndex&&!readyColumns[i]){if(shrinkColumns){widthUsed=Math.max(widthPerColumn,widthToDistribute)}else{widthUsed=Math.min(widthPerColumn,widthToDistribute)}actualColumnWidths[i]+=widthUsed;range=this._getRange(columnSettings[i]);coercedWidth=this._coerceRange(range,actualColumnWidths[i]);if(Math.abs(actualColumnWidths[i]-coercedWidth)>5e-6){widthUsed-=actualColumnWidths[i]-coercedWidth;actualColumnWidths[i]=coercedWidth;readyColumns[i]=true;readyColumnsCount++}widthDistributed+=widthUsed;widthToDistribute-=widthUsed}}}actualColumnWidths[columnIndex]-=widthDistributed;totalWidth=0;for(i=0;i<columnsLength;i++){totalWidth+=actualColumnWidths[i]}for(i=0;i<columnsLength;i++){requiredColumnPercentageWidths[i]=100*actualColumnWidths[i]/totalWidth}for(i=0;i<columnsLength;i++){newColumnStyleWidths[i]=requiredColumnPercentageWidths[i]+"%";this.grid._visibleColumns()[i].width=newColumnStyleWidths[i]}finalPixelWidth=actualColumnWidths[columnIndex];this._applyToEachGridCOL(function(index,col){col.css("width",newColumnStyleWidths[index])})}else{allColumnsHaveWidth=true;for(i=0;i<columnsLength;i++){if(i===columnIndex){newColumnStyleWidths[i]=width+"px";finalPixelWidth=width;this.grid._visibleColumns()[i].width=newColumnStyleWidths[i]}else{newColumnStyleWidths[i]=actualColumnStyleWidths[i];allColumnsHaveWidth=allColumnsHaveWidth&&parseInt(actualColumnStyleWidths[i],10)>0}}this._applyToEachGridCOL(function(index,col){col.css("width",newColumnStyleWidths[index])});containerWidth=this.grid._calculateContainerWidth(false);if(allColumnsHaveWidth){if(this.grid.options.width&&parseInt(this.grid.options.width,10)>0){this.grid._updateGridContentWidth();$("#"+this.grid.element[0].id+"_horizontalScrollContainer").children("div").css("width",containerWidth);if(this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true){this.grid._oldScrollLeft=$("#"+this.grid.id()+"_horizontalScrollContainer").scrollLeft()}}else{this.grid._setContainerWidth($("#"+this.grid.id()+"_container"));if(this.grid.options.rowVirtualization||this.grid.options.virtualization===true){$("#"+this.grid.element[0].id+"_headers_v").css("width",containerWidth+this.grid._scrollbarWidth()).css("max-width",containerWidth+this.grid._scrollbarWidth());$("#"+this.grid.element[0].id+"_displayContainer").css("width",containerWidth).css("max-width",containerWidth);$("#"+this.grid.element[0].id+"_virtualContainer > colgroup > col").first().attr("width",containerWidth);$("#"+this.grid.id()+"_footer_container").css("width",containerWidth+this.grid._scrollbarWidth()).css("max-width",containerWidth+this.grid._scrollbarWidth())}}}}if(fireEvents){this._trigger(this.events.columnResized,originalEvent,{owner:this,columnIndex:columnIndex,columnKey:columnKey,originalWidth:headerWidth,newWidth:finalPixelWidth})}return{canceled:false,originalWidth:headerWidth,newWidth:finalPixelWidth,isResized:isResized}},_applyToEachGridCOL:function(appliedFunction){if(this.grid.options.showHeader){this.grid.headersTable().find("> colgroup > col").not("[data-skip=true]").each(function(i){appliedFunction(i,$(this))})}if(this.grid.options.fixedHeaders===true&&this.grid.options.height!==null||this.grid.options.showHeader===false){this.grid.element.find("> colgroup > col").not("[data-skip=true]").each(function(i){appliedFunction(i,$(this))})}if(this.grid.options.fixedFooters===true&&this.grid.options.height!==null){this.grid.footersTable().find("> colgroup > col").not("[data-skip=true]").each(function(i){appliedFunction(i,$(this))})}},_getRange:function(column){var min=column.minimumWidth,max=column.maximumWidth;min=isNaN(min)?0:min;min=Math.max(0,min);max=isNaN(max)?Infinity:max;return{min:min,max:max}},_coerceRange:function(range,value){value=Math.max(range.min,value);value=Math.min(range.max,value);return value},_gridContainerPositioningOffset:function(){var offset=this.grid.container().offset();return{top:-offset.top,left:-offset.left}},_calculateGridResizableHeight:function(heightOffset){var height,caption,headersTable,footersTable,scrollerContainer,hasVirtualization=this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true||this.grid.options.columnVirtualization===true,hasWidthOrHeight=this.grid.options.height!==null||this.grid.options.width!==null;if(hasVirtualization){height=$("#"+this.grid.element[0].id+"_displayContainer").height()}else if(hasWidthOrHeight){height=this.grid.scrollContainer().height()}else{height=this.grid.element.height()}if(hasVirtualization||hasWidthOrHeight){headersTable=this.grid.headersTable();footersTable=this.grid.footersTable();if(this.grid.options.fixedHeaders===true&&this.grid.options.showHeader===true){if(headersTable.length!==0&&this.grid.element[0].id!==headersTable[0].id){height+=headersTable.height()}caption=headersTable.children("#"+this.grid.element[0].id+"_caption");if(caption.length!==0){if(!$.ig.util.isFF){height-=caption.outerHeight(true)}}}scrollerContainer=$("#"+this.element[0].id+"_hscroller_container");if(scrollerContainer.is(":visible")){height+=scrollerContainer.height()}if(this.grid.options.fixedFooters===true&&this.grid.options.showFooter===true&&footersTable.length!==0&&this.grid.element[0].id!==footersTable[0].id){height+=footersTable.height()}}if(heightOffset){height-=heightOffset}return height},_findColumnSettingsByKey:function(key){var i;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){return this.options.columnSettings[i]}}},_initDefaultSettings:function(){var settings=[],key,cs=this.options.columnSettings,i,j;if(this.grid.options.columns&&this.grid.options.columns.length>0){for(i=0;i<this.grid.options.columns.length;i++){settings[i]={columnIndex:i,columnKey:this.grid.options.columns[i].key,allowResizing:true,minimumWidth:20}}}for(i=0;i<cs.length;i++){for(j=0;j<settings.length;j++){if(settings[j].columnKey===cs[i].columnKey||settings[j].columnIndex===cs[i].columnIndex){break}}if(j===settings.length){continue}for(key in cs[i]){if(cs[i].hasOwnProperty(key)&&key!=="columnIndex"&&key!=="columnKey"){settings[j][key]=cs[i][key]}}}this.options.columnSettings=settings},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;this.grid.element.unbind(".resizing");this._initDefaultSettings();this.grid.element.bind("iggridheaderrendered.resizing",$.proxy(this._headerRendered,this));this.grid.element.bind("iggridcolumnscollectionmodified.resizing",$.proxy(this._columnsCollectionModified,this));this.grid.element.bind("iggrid_columnsmoved.resizing",$.proxy(this._columnsMoved,this))}});$.extend($.ui.igGridResizing,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Responsive 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.tree.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){"use strict";$.widget("ui.igGridResponsive",{options:{columnSettings:[{columnKey:null,columnIndex:null,classes:"",configuration:null}],reactOnContainerWidthChanges:true,forceResponsiveGridWidth:true,responsiveSensitivity:20,rowTemplate:null,responsiveModes:null},events:{responsiveColumnHiding:"responsiveColumnHiding",responsiveColumnHidden:"responsiveColumnHidden",responsiveColumnShowing:"responsiveColumnShowing",responsiveColumnShown:"responsiveColumnShown",responsiveModeChanged:"responsiveModeChanged"},_createWidget:function(options,element){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._callBackId=null;this._responsive=null;this._exclusiveContainer=false;this._mode="";this._modes=this.options.responsiveModes||{desktop:"infragistics",tablet:"infragistics",phone:"infragistics"};this._modes=this._initializeModeRecognizers(this._modes);this._hiddenByClass=this._flagClassConfiguration();this._defaultColumnTemplates=null;this._defaultRowTemplate=null;this._footersDisplacement=.1},_setOption:function(key,value){switch(key){case"rowTemplate":throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+key);case"responsiveModes":this._modes=value;this._modes=this._initializeModeRecognizers(this._modes);break;case"reactOnContainerWidthChanges":if(value===true){this._activateContainer()}else{this._deactivateContainer()}break}$.Widget.prototype._setOption.apply(this,arguments);this._hiddenByClass=this._flagClassConfiguration()},destroy:function(){this._deactivateContainer();if(this._initialGridRenderedHandler){this.grid.element.unbind("iggridrendered",this._initialGridRenderedHandler)}this.grid.element.unbind("iggrid_heightchanged",this._gridContainerHeightHandler);$("#"+this.grid.element[0].id+"_responsive_test_container").remove();$.Widget.prototype.destroy.call(this);return this},getCurrentResponsiveMode:function(){return this._mode},_activateContainer:function(){if(!this._responsive||typeof this._responsive.addCallback!=="function"){this._responsive=this.grid.element.closest(".ui-widget").igResponsiveContainer().data("igResponsiveContainer");this._exclusiveContainer=true}this._callBackId=this._responsive.addCallback(this._containerResized,this,this.options.responsiveSensitivity,"x")},_deactivateContainer:function(removeContainer){if(typeof this._callBackId==="number"){this._responsive.removeCallback(this._callBackId);this._callBackId=null}if(this._exclusiveContainer===true){this._responsive.destroy();delete this._responsive;this._exclusiveContainer=false}},_renderTestElement:function(){$("<div></div>").attr("id",this.grid.element[0].id+"_responsive_test_container").css("position","absolute").css("top","-100px").text("&nbsp;").appendTo(document.body)},_initializeModeRecognizers:function(definedModes){var self=this,transformed={},nval;$.each(this._modes,function(key,value){if(typeof value==="string"){nval=value.substring(0,1).toUpperCase()+value.substring(1);nval=new $.ig[nval+"Mode"]({key:key,visibilityTester:$.proxy(self._checkVisibilityByClass,self)})}else if(typeof value==="object"&&!value.isActive){nval=new $.ig.ResponsiveMode({minWidth:value.minWidth||-1,maxWidth:value.maxWidth||Number.MAX_VALUE,minHeight:value.minHeight||-1,maxHeight:value.maxHeight||Number.MAX_VALUE})}else{nval=value}transformed[key]=nval});return transformed},_flagClassConfiguration:function(){var byClass=false;$.each(this.options.columnSettings,function(){if(this.classes){byClass=true;return false}});return byClass},_getDefaultColumnTemplates:function(){var cache={},col,i;for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i];if(col.template){if(col.key){cache[col.key]=col.template}else{cache[i]=col.template}}}return cache},_checkVisibilityByClass:function(classes){var testContainer=$("#"+this.grid.element[0].id+"_responsive_test_container");testContainer.removeClass();testContainer.addClass(classes);return testContainer.is(":visible")},_gridReady:function(){return!(this.grid._loadingIndicator&&this.grid._loadingIndicator._indicator.is(":visible"))},_updateGridSync:function(initial,full){var self=this;if(!this._gridReady()){setTimeout(function(){self._updateGridSync(initial,full)},50);return}self._updateGrid(initial,full)},_updateGrid:function(initial,full){var result=[],applyTemplates=false,colsToShow,colsToHide,self=this,i;if(this._hiddenByClass===true){result=this._updateColumnsByClass()}if(full===true){if(this._hiddenByClass===false){result=this._updateColumns()}applyTemplates=this._updateTemplates()}colsToShow=result[0]||[];colsToHide=result[1]||[];if(colsToShow.length===0&&colsToHide.length===0){if(applyTemplates===true&&initial===false){this.grid._renderData()}return}if(initial===false){this.grid._loadingIndicator.show();setTimeout(function(){self.grid._setHiddenColumns(colsToShow,false,initial);for(i=0;i<colsToShow.length;i++){self._trigger(self.events.responsiveColumnShown,null,self._getArgsByColumn(colsToShow[i]))}self.grid._setHiddenColumns(colsToHide,true,initial);for(i=0;i<colsToHide.length;i++){self._trigger(self.events.responsiveColumnHidden,null,self._getArgsByColumn(colsToHide[i]))}if(initial===false){self.grid._loadingIndicator.hide()}self._setMaxWidthOnGrid()},0)}else{$.each(colsToShow,function(){this.hidden=false});$.each(colsToHide,function(){this.hidden=true})}},_updateColumnsByClass:function(){var i,cs=this.options.columnSettings,col,colsToHide=[],colsToShow=[],noCancel,hidden,visible;for(i=0;i<cs.length;i++){if(cs[i].classes){col=this._getGridColumnBySetting(cs[i]);if(!col){continue}hidden=col.hidden||false;visible=this._checkVisibilityByClass(cs[i].classes);if(hidden===true&&visible===true){noCancel=this._trigger(this.events.responsiveColumnShowing,null,this._getArgsByColumnSetting(cs[i]));if(noCancel){colsToShow.push(col)}}if(hidden===false&&visible===false){noCancel=this._trigger(this.events.responsiveColumnHiding,null,this._getArgsByColumnSetting(cs[i]));if(noCancel){colsToHide.push(col)}}}}return[colsToShow,colsToHide]},_updateColumns:function(){var i,cs=this.options.columnSettings,col,colsToHide=[],colsToShow=[],noCancel,m=this._mode,hidden,visible;for(i=0;i<cs.length;i++){if(cs[i].configuration){col=this._getGridColumnBySetting(cs[i]);if(!col){continue}hidden=col.hidden||false;visible=!(cs[i].configuration[m]&&cs[i].configuration[m].hidden);if(hidden===true&&visible===true){noCancel=this._trigger(this.events.responsiveColumnShowing,null,this._getArgsByColumnSetting(cs[i]));if(noCancel){colsToShow.push(col)}}if(hidden===false&&visible===false){noCancel=this._trigger(this.events.responsiveColumnHiding,null,this._getArgsByColumnSetting(cs[i]));if(noCancel){colsToHide.push(col)}}}}return[colsToShow,colsToHide]},_updateTemplates:function(){var i,cs=this.options.columnSettings,rt=this.options.rowTemplate,nt,updated=false,col,m=this._mode;if(rt){nt=rt[m]||this._defaultRowTemplate;if(nt!==this.grid.options.rowTemplate){this.grid._hasOptionsRowTemplate=true;this.grid.options.rowTemplate=nt;updated=true}}if(updated===true){this.grid._tmpl=null;this.grid._tmap=this._allTmaps[m]||null;return updated}for(i=0;i<cs.length;i++){col=this._getGridColumnBySetting(cs[i]);if(!col){continue}if(cs[i].configuration&&cs[i].configuration[m]&&cs[i].configuration[m].template){nt=cs[i].configuration[m].template}else{nt=col.key?this._defaultColumnTemplates[col.key]:this._defaultColumnTemplates[$.inArray(col,this.grid.options.columns)]}if(col.template!==nt){col.template=nt;updated=true}}if(updated===true){this.grid._tmpl=null;this.grid._tmap=this._allTmaps[m]||null;this.grid.options.rowTemplate=this.grid._buildRowTemplateRaw(true)}return updated},_generateTmapStorage:function(){var a=this._allTmaps={},cols=this.grid.options.columns,m=this._mode,self=this;this.grid.options.columns=$.extend(true,[],this.grid.options.columns);$.each(this._modes,function(key,value){self._mode=key;self._updateTemplates();if(self.grid.options.rowTemplate){self.grid._initializeTmap();a[key]=$.extend(true,[],self.grid._tmap)}});this._mode=m;this.grid.options.columns=cols;this.grid._tmap=null},_getGridColumnBySetting:function(cs){var col;if(cs.columnKey&&typeof cs.columnKey==="string"){col=this.grid.columnByKey(cs.columnKey)}else if(cs.columnIndex!==null&&cs.columnIndex!==undefined&&typeof cs.columnIndex==="number"&&cs.columnIndex>=0&&cs.columnIndex<this.grid.options.columns.length){col=this.grid.options.columns[cs.columnIndex]}return col},_getArgsByColumnSetting:function(cs){return{owner:this,columnIndex:cs.columnIndex||null,columnKey:cs.columnKey||null}},_getArgsByColumn:function(col){return{owner:this,columnIndex:$.inArray(col,this.grid.options.columns),columnKey:col.key||null}},_getCurrentMode:function(){var env;$.each(this._modes,function(key,value){if(this.isActive()===true){env=key;return false}});return env},_containerResized:function(nw,nh){var mode=this._getCurrentMode(),shouldUpdate=false;if(nw<=0&&nh<=0){return}this._setMaxWidthOnGrid();if(mode&&mode!==this._mode){this._trigger(this.events.responsiveModeChanged,null,{owner:this,previousMode:this._mode,mode:mode});this._mode=mode;shouldUpdate=true}if(shouldUpdate||this._hiddenByClass){this._updateGridSync(false,shouldUpdate)}},_initialGridRendered:function(evt,ui){this._activateContainer();this._setMaxWidthOnGrid()},_dataRendered:function(){this._setMaxWidthOnGrid()},_heightChanged:function(evt,ui){var newHeight=$("#"+this.grid.element[0].id+"_scroll").height();if(this._height!==newHeight){this._height=newHeight;this.grid._adjustLastColumnWidth(false);this._setMaxWidthOnGrid()}},_setMaxWidthOnGrid:function(){var sbw=this.grid._hasVerticalScrollbar===true?this.grid._scrollbarWidth():0,npw;this.grid._gridContentWidth=0;this.grid.element.css("width","100%");if(!this.grid._allColumnWidthsInPercentage){npw=100-sbw/this.grid.container().width()*100;if(this.grid.options.fixedHeaders===true){this.grid.headersTable().css("width",npw+"%")}if(this.grid.options.fixedFooters===true){this.grid.footersTable().css("width",npw+this._footersDisplacement+"%")}}},_createHandlers:function(){this._initialGridRenderedHandler=$.proxy(this._initialGridRendered,this);this._gridContainerHeightHandler=$.proxy(this._heightChanged,this)},_injectGrid:function(gridInstance,isRebind){if(isRebind===true){return}this.grid=gridInstance;this._createHandlers();this._renderTestElement();this._mode=this._getCurrentMode();this._defaultColumnTemplates=this._getDefaultColumnTemplates();this._defaultRowTemplate=this.grid.options.rowTemplate;this._generateTmapStorage();this._updateGridSync(true,true);if(this.options.forceResponsiveGridWidth===true){this.grid.options.width=typeof this.grid.options.width==="string"&&this.grid.options.width.endsWith("%")?this.grid.options.width:"100%";this.grid.options.autoFitLastColumn=false}if(this.options.reactOnContainerWidthChanges===true){this.grid.element.bind("iggridrendered",this._initialGridRenderedHandler)}if(this.grid.options.height!==null&&this.grid.options.height.indexOf&&this.grid.options.height.indexOf("%")!==-1){this.grid.element.bind("iggrid_heightchanged",this._gridContainerHeightHandler)}}});$.extend($.ui.igGridResponsive,{version:"13.1.20131.2523"});$.ig=$.ig||{};$.ig.ResponsiveMode=$.ig.ResponsiveMode||Class.extend({settings:{minWidth:-1,maxWidth:Number.MAX_VALUE,minHeight:-1,maxHeight:Number.MAX_VALUE},init:function(options){if(options){this.settings=$.extend(true,{},$.ig.ResponsiveMode.prototype.settings,options)}return this},isActive:function(){return window.innerWidth>=this.settings.minWidth&&window.innerWidth<=this.settings.maxWidth&&window.innerHeight>=this.settings.minHeight&&window.innerHeight<=this.settings.maxHeight}});$.ig.InfragisticsMode=$.ig.InfragisticsMode||$.ig.ResponsiveMode.extend({settings:{key:"",visibilityTester:null},init:function(options){this._hc="ui-hidden-"+options.key;this._vc="ui-visible-"+options.key;this._super(options);return this},isActive:function(){if(typeof this.settings.visibilityTester==="function"){return this.settings.visibilityTester(this._hc)===false&&this.settings.visibilityTester(this._vc)===true}return this._super()}});$.ig.BootstrapMode=$.ig.BootstrapMode||$.ig.ResponsiveMode.extend({settings:{key:"",visibilityTester:null},init:function(options){this._hc="hidden-"+options.key;this._vc="visible-"+options.key;this._super(options);return this},isActive:function(){if(typeof this.settings.visibilityTester==="function"){return this.settings.visibilityTester(this._hc)===false&&this.settings.visibilityTester(this._vc)===true}return this._super()}})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Tooltips 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.editors.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridRowSelectors",{options:{enableRowNumbering:true,enableCheckBoxes:false,rowNumberingSeed:0,rowSelectorColumnWidth:null,requireSelection:true,showCheckBoxesOnFocus:false},css:{rowSelectorCssClass:"ui-iggrid-rowselector-class",headerRowSelectorCssClass:"ui-iggrid-rowselector-header",footerRowSelectorCssClass:"ui-iggrid-rowselector-footer",checkbox:"ui-state-default ui-corner-all ui-igcheckbox-normal",checkboxOff:"ui-icon ui-icon-check ui-igcheckbox-normal-off",checkboxOn:"ui-icon ui-icon-check ui-igcheckbox-normal-on",nodeHovered:"ui-state-hover"},events:{rowSelectorClicked:"rowSelectorClicked",checkBoxStateChanging:"checkBoxStateChanging",checkBoxStateChanged:"checkBoxStateChanged"},_createWidget:function(options,element){$.Widget.prototype._createWidget.apply(this,arguments);if(this.options.rowSelectorColumnWidth===null){this.options.rowSelectorColumnWidth=45;if(this.options.enableCheckBoxes===true&&this.options.enableRowNumbering===true){this.options.rowSelectorColumnWidth+=15}}},_create:function(){this._cpIdx=0;this._pSelection={};this._vRsDom=[];this._cIdx=0;this._functionsRedirected=false;this._isPaging=false;this._hovTR=null;this._gridRenderRecord=null;this._gridRenderRecordInArray=null;this._checkBoxesShown=false;this._nTmpl="{{html ig_rs_idx}}";this._v=false;this._ms=false},destroy:function(){this._unregisterEvents();this._unregisterCellEvents();if(this._gridRenderRecordHandler!==undefined){this.grid._renderColgroup=this._flatRenderColgroup;this.grid._renderRecord=this._gridRenderRecordHandler;this.grid._renderRecordInArray=this._gridRenderRecordInArrayHandler;this.grid._generateRowTemplate=this._gridRenderTemplateHandler}if(this.options.enableCheckBoxes===true){this._unregisterCheckBoxEvents()}this._cleanInterface(false);$.Widget.prototype.destroy.call(this);return this},_renderHeaderRowSelectors:function(owner){var rows,i,cell,header,$thDataSkip;if(owner.id()!==this.grid.id()){return}if(this.grid.options.fixedHeaders===true){rows=$("#"+this.grid.id()+"_headers thead").children()}else{rows=$("#"+this.grid.id()+" thead").children()}if(rows.length>0){cell=$(rows[0]).find("th.ui-iggrid-expandheadercell")[0];if(cell===undefined){cell=$(rows[i]).children()[0];this._index=0}else{this._index=$(cell).index()+1}if(this.grid._isMultiColumnGrid){$thDataSkip=$("<th></th>").prependTo(this.grid.headersTable().find("thead tr:nth-child(1)")).addClass(this.css.headerRowSelectorCssClass).addClass(this.grid.css.headerClass).attr("data-role","rs").attr("data-skip","true");$thDataSkip.attr("rowspan",this.grid._maxLevel+1);if(this.options.enableCheckBoxes===true&&this._ms){$(this._getCheckBox(true)).appendTo($thDataSkip)}}else{for(i=0;i<rows.length;i++){if($(rows[i]).find("th[data-role='rs']").length>0){continue}header=$("<th>"+($.ig.util.isIE7?"&nbsp;":"")+"</th>").addClass(this.css.headerRowSelectorCssClass).addClass(i===0?this.grid.css.headerClass:"").attr("data-role","rs").attr("data-skip","true").insertBefore($($(rows[i]).children()[this._index]));if(this.options.enableCheckBoxes===true&&i===0&&this._ms){$(this._getCheckBox(true)).appendTo(header)}}}}},_renderFooterRowSelectors:function(owner){var rows,i;if(owner.id()!==this.grid.id()){return}if(this.grid.options.fixedFooters===true){rows=$("#"+this.grid.id()+"_footers tfoot").children()}else{rows=$("#"+this.grid.id()+" tfoot").children()}if(rows.length>0){for(i=0;i<rows.length;i++){if($(rows[i]).find("td[data-role='rs']").length>0){continue}$("<td>"+($.ig.util.isIE7?"&nbsp;":"")+"</td>").addClass(this.css.footerRowSelectorCssClass).attr("data-role","rs").attr("data-skip","true").insertBefore($($(rows[i]).children()[this._index]))}}},_headerRendered:function(event,ui){if(!this._skipRefresh){this._ms=$("#"+this.grid.id()).igGridSelection("option","multipleSelection")===true}this._renderHeaderRowSelectors(ui.owner)},_footerRendered:function(event,ui){this._renderFooterRowSelectors(ui.owner)},_recordsRendering:function(event,ui){if(this.grid.id()!==ui.owner.id()){return}this._cIdx=ui.vrtWnd.start&&ui.vrtWnd.end?ui.vrtWnd.start:0;if(this._functionsRedirected===false){this._renderRecordHandler=$.proxy(this._rsRenderRecord,this);this._renderRecordInArrayHandler=$.proxy(this._rsRenderRecordInArray,this);this._gridRenderRecordHandler=$.proxy(this.grid._renderRecord,this.grid);this._gridRenderRecordInArrayHandler=$.proxy(this.grid._renderRecordInArray,this.grid);this._renderTemplateHandler=$.proxy(this._rsRenderTemplate,this);this._gridRenderTemplateHandler=$.proxy(this.grid._generateRowTemplate,this.grid);this._gridRenderRecord=this._gridRenderRecordHandler;this._gridRenderRecordInArray=this._gridRenderRecordInArrayHandler;this.grid._renderRecord=this._renderRecordHandler;this.grid._renderRecordInArray=this._renderRecordInArrayHandler;this._gridGenerateRowTemplate=this._gridRenderTemplateHandler;this.grid._generateRowTemplate=this._renderTemplateHandler}this._functionsRedirected=true},_recordsRendered:function(event,ui){if(this.grid.id()!==ui.owner.id()){return}if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents()}},_gridRendered:function(event,ui){if(ui===undefined){return}if(this.grid.id()!==ui.owner.id()){return}if(!this._skipRefresh){this._ms=$("#"+this.grid.id()).igGridSelection("option","multipleSelection")===true}this._unregisterCellEvents();this._registerCellEvents();if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents()}},_hidingFinished:function(){this._unregisterCellEvents();this._registerCellEvents()},_rsRenderColgroup:function(flatRenderColgroup,rs,table,isHeader,isFooter,autofitLastColumn){var cgrp;flatRenderColgroup.apply(this,[table,isHeader,isFooter,autofitLastColumn]);cgrp=$(table).find("colgroup");if(cgrp.find("col[data-role='rs']").length===0){$("<col></col>").prependTo(cgrp).css("width",rs.options.rowSelectorColumnWidth).attr("data-skip","true").attr("data-role","rs")}},_rsRenderRecord:function(data,rowIndex){var markup=this._gridRenderRecord(data,rowIndex),pre,app,idx,rs=this._getRowSelectorCellMarkup();idx=markup.indexOf("ui-iggrid-expandcolumn");if(idx>=0){app=markup.substr(idx);idx=idx+app.indexOf("</td>")+4;pre=markup.substring(0,idx+1);app=markup.substring(idx+1)}else{idx=markup.indexOf(">")+1;pre=markup.substring(0,idx);app=markup.substring(idx)}markup=pre+rs+app;return markup},_rsRenderRecordInArray:function(darr,tbody,data,rowIndex){var i,j;this._gridRenderRecordInArray(darr,tbody,data,rowIndex);for(i=darr.length-1;i>=0;i--){if(darr[i].indexOf&&darr[i].indexOf("<tr")!==-1){for(j=i;j<darr.length;j++){if(darr[j].indexOf&&darr[j].indexOf("<td")!==-1){if(darr[j].indexOf("ui-iggrid-expandcolumn")!==-1){darr[j]+=this._getRowSelectorCellMarkup();break}darr[j]=this._getRowSelectorCellMarkup()+darr[j];break}}break}}},_rsRenderTemplate:function(){var markup=this._gridGenerateRowTemplate(),pre,app,idx,self=this,rs=this._getRowSelectorCellMarkup(true);$.ig.rowNumberingFunctionDelegate=function(id){return $("#"+self.grid.id()).data("igGridRowSelectors")._getCurrentNumber(id)};idx=markup.indexOf("ui-iggrid-expandcolumn");if(idx>=0){app=markup.substr(idx);idx=idx+app.indexOf("</td>")+4;pre=markup.substring(0,idx+1);app=markup.substring(idx+1)}else{idx=markup.indexOf(">")+1;pre=markup.substring(0,idx);app=markup.substring(idx)}markup=pre+rs+app;return markup},_renderExtraHeaderCells:function(row,colgroup,prepend){this._renderExtraCells(row,colgroup,prepend,true)},_renderExtraFooterCells:function(row,colgroup,prepend,cssClass){this._renderExtraCells(row,colgroup,prepend,false,cssClass)},_renderExtraCells:function(row,colgroup,prepend,header,cssClass){var rHeader,rCol,index,cell;if(row.find("[data-role='rs']").length>0){return}if(header===true){rHeader=$("<th>"+($.ig.util.isIE7?"&nbsp;":"")+"</th>").addClass(this.css.headerRowSelectorCssClass).attr("data-role","rs").attr("data-skip","true")}else{rHeader=$("<td>"+($.ig.util.isIE7?"&nbsp;":"")+"</td>").addClass(this.css.footerRowSelectorCssClass).addClass(cssClass).attr("data-role","rs").attr("data-skip","true")}cell=row.find("th.ui-iggrid-expandheadercell,td.ui-iggrid-expandheadercellgb");if(cell.length===0){cell=row.children().eq(0);index=0}else{index=cell.last().index()+1}if(index===0){rHeader.prependTo(row)}else{rHeader.insertBefore(row.children().eq(index))}if(colgroup){rCol=$("<col></col>").attr("data-skip","true").attr("data-role","rs").css("width",this.options.rowSelectorColumnWidth);rCol.insertBefore(colgroup.children().eq(index))}},_registerCellEvents:function(){$("#"+this.grid.id()+">tbody>tr>th."+this.css.rowSelectorCssClass).bind({click:this._rsClickHandler});$("#"+this.grid.id()+" tbody").bind({mousemove:this._rrHoverHandler,mouseleave:this._rrLeaveHandler})},_unregisterCellEvents:function(){$("#"+this.grid.id()+">tbody>tr>th."+this.css.rowSelectorCssClass).unbind({click:this._rsClickHandler});$("#"+this.grid.id()+" tbody").unbind({mousemove:this._rrHoverHandler,mouseleave:this._rrLeaveHandler})},_registerCheckBoxEvents:function(){var cbx=$("#"+this.grid.id()+'>tbody>tr>th span[name="chk"]');if(cbx.length<=0){return}cbx.unbind({click:this._checkboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler}).bind({click:this._checkboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler});$("#"+this.grid.id()+(this.grid.options.fixedHeaders===true?"_headers":"")+'>thead>tr>th span[name="hchk"] > span').unbind({click:this._hCheckboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler}).bind({click:this._hCheckboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler})},_unregisterCheckBoxEvents:function(){$("#"+this.grid.id()+'>tbody>tr>th span[name="chk"]').unbind({click:this._checkboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler});$("#"+this.grid.id()+(this.grid.options.fixedHeaders===true?"_headers":"")+'>thead>tr>th span[name="hchk"] > span').unbind({click:this._hCheckboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler})},_checkboxMouseOver:function(event){$(event.target).closest('span[data-role="checkbox"]').addClass(this.css.nodeHovered)},_checkboxMouseOut:function(event){$(event.target).closest('span[data-role="checkbox"]').removeClass(this.css.nodeHovered)},_checkBoxClicked:function(event){var trg=$(event.target).closest("span[name='chk']"),rCell=trg.parent(),rRow=rCell.parent(),args,rIdx=this._getVisibleRowIndex(rRow),rKey=rRow.attr("data-id"),noCancel,state=trg.attr("data-chk");if(rKey===""||rKey===null||rKey===undefined){rKey=rIdx}args={row:rRow,rowIndex:rIdx,rowKey:rKey,rowSelector:rCell,owner:this,grid:this.grid,currentState:state,newState:state==="off"?"on":"off",isHeader:false};noCancel=this._triggerCheckingEvent(event,args);if(noCancel===true){this._handleCheck(trg);this._updateHeader();delete args.currentState;args.state=args.newState;delete args.newState;this._triggerCheckedEvent(event,args)}event.stopPropagation()},_headerCheckBoxClicked:function(event){var trg=$(event.target).closest("span[name='hchk']"),args,noCancel,state=trg.attr("data-chk");args={owner:this,grid:this.grid,currentState:state,newState:state==="off"?"on":"off",isHeader:true};noCancel=this._triggerCheckingEvent(event,args);if(noCancel===true){this._handleHcheck(trg);delete args.currentState;args.state=args.newState;delete args.newState;this._triggerCheckedEvent(event,args)}event.stopPropagation();event.preventDefault()},_handleCheck:function(checkbox){var row=checkbox.parent().parent(),idx=this._getVisibleRowIndex(row),rIdx=this._getVisibleHRowIndex(row),offset=0,upd,sel;if(checkbox===undefined||checkbox===null){return}upd=this.grid.element.data("igGridUpdating");sel=this.grid.element.data("igGridSelection");if(sel&&sel._suspend){if(upd){if(upd.findInvalid()){return}else{upd._endEdit(null,true)}}else{return}}if(this._v===true){offset=this.grid._startRowIndex}if(checkbox.attr("data-chk")==="off"){this._alterCheckbox(checkbox,true);if(this.grid.element.igGridSelection("option","multipleSelection")!==true){this._clearRowSelectorsSelection()}this.grid.element.igGridSelection("selectRow",rIdx+offset);if(this._pSelection[this._cpIdx]===undefined){this._pSelection[this._cpIdx]={}}this._pSelection[this._cpIdx][idx+offset]=true;this._updateCheckBoxes(idx)}else{this._alterCheckbox(checkbox,false);this.grid.element.igGridSelection("deselectRow",rIdx+offset);this._pSelection[this._cpIdx][idx+offset]=false}},_handleHcheck:function(checkbox){var checkBoxes=$("#"+this.grid.id()+'>tbody>tr>th span[name="chk"]'),i,vfs,sm;this.grid.element.unbind("iggridselectioninternalrowselectionchanged",this._rowSelectionChangedHandler);if(checkbox.attr("data-chk")==="off"){this._alterCheckbox(checkbox,true);for(i=0;i<checkBoxes.length;i++){if($(checkBoxes[i]).attr("data-chk")==="off"){this._handleCheck($(checkBoxes[i]))}}}else{this._alterCheckbox(checkbox,false);for(i=0;i<checkBoxes.length;i++){if($(checkBoxes[i]).attr("data-chk")==="on"){this._handleCheck($(checkBoxes[i]))}}}if(this._v===true){vfs=checkbox.attr("data-chk")==="on"?true:false;sm=vfs?"selectRow":"deselectRow";for(i=0;i<this.grid._startRowIndex;i++){if(this._pSelection[this._cpIdx][i]!==vfs){this.grid.element.igGridSelection(sm,i);this._pSelection[this._cpIdx][i]=vfs}}for(i=this.grid._startRowIndex+this.grid._virtualRowCount;i<this.grid._totalRowCount;i++){if(this._pSelection[this._cpIdx][i]!==vfs){this.grid.element.igGridSelection(sm,i);this._pSelection[this._cpIdx][i]=vfs}}}this.grid.element.bind("iggridselectioninternalrowselectionchanged",this._rowSelectionChangedHandler)},_updateHeader:function(){var checkboxes=$("#"+this.grid.id()+'>tbody>tr>th span[name="chk"]'),i,check=true,header=$("#"+this.grid.id()+(this.grid.options.fixedHeaders===true?"_headers":"")+'>thead>tr>th span[name="hchk"]');for(i=0;i<checkboxes.length;i++){if($(checkboxes[i]).attr("data-chk")==="off"){check=false;break}}this._alterCheckbox(header,check)},_updateCheckBoxes:function(idx){var cb,self=this;if(this.grid.element.igGridSelection("option","multipleSelection")===true){return}cb=$("#"+this.grid.id()+'>tbody>tr>th span[name="chk"]');if(this._pSelection[this._cpIdx]!==undefined){$.each(this._pSelection[this._cpIdx],function(key,value){if(value===true&&parseInt(key,10)!==idx){self._alterCheckbox($(cb[key]),false);self._pSelection[self._cpIdx][key]=false}})}},_alterCheckbox:function(checkbox,check){var $inner=$(checkbox.children()[0]);if(checkbox!==undefined&&$inner!==undefined){if(check===true){checkbox.attr("data-chk","on");$inner.removeClass(this.css.checkboxOff).addClass(this.css.checkboxOn)}else{checkbox.attr("data-chk","off");$inner.removeClass(this.css.checkboxOn).addClass(this.css.checkboxOff)}}},_getRowSelectorCellMarkup:function(template){return'<th class="'+this.css.rowSelectorCssClass+'">'+'<span class="ui-icon ui-icon-triangle-1-e" style="margin-left: -5px"> </span>'+(this.options.enableRowNumbering===true?template===true?this._nTmpl:this._getCurrentNumber():"")+(this.options.enableCheckBoxes===true?this._getCheckBox():"")+"</th>"},_getCheckBox:function(header){return'<span name="'+(header===true?"hchk":"chk")+'" data-chk="off" data-role="checkbox" class="'+this.css.checkbox+'"'+(this.options.showCheckBoxesOnFocus===true&&this._checkBoxesShown===false?' style="visibility: hidden;"':"")+'><span class="'+this.css.checkboxOff+'"></span></span>'},_getCurrentNumber:function(id){var seed;if(id!==undefined&&id!==null){seed=id}else{seed=++this._cIdx}return'<span class="ui-iggrid-rowselector-row-number">'+(seed+this.options.rowNumberingSeed+this._getStartingIndexForPage())+"</span>"},_getStartingIndexForPage:function(){if(this._isPaging===false){return 0}return this.grid.element.igGridPaging("pageIndex")*this.grid.element.igGridPaging("pageSize")},_rsRenderVirtualRecords:function(event,ui){var i=0,rs;this._cIdx=0;this._vRsDom=[];for(i;i<ui.rows.length;i++){rs=$(this._getRowSelectorCellMarkup());this._vRsDom.push(rs);rs.prependTo($(ui.rows[i]))}this._unregisterCellEvents();this._registerCellEvents();if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents()}},_rrn:function(event,args){var rsDom=this._vRsDom,i=0,sri=this.grid._startRowIndex||0;if(this.options.enableRowNumbering===true){for(i=0;i<rsDom.length;i++){$(rsDom[i]).children("span.ui-iggrid-rowselector-row-number").text(sri+i+this.options.rowNumberingSeed+1)}}if(!this._skipRefresh){this._refreshSelection(sri)}},_rcn:function(event,args){var i=0,st=this._index+1;if(args.startColIndex!==0){if(this.grid.options.fixedHeaders===true){$("#"+this.grid.id()+"_headers colgroup:nth-child("+st+")").hide()}$("#"+this.grid.id()+" colgroup:nth-child("+st+")").hide();$("#"+this.grid.id()+" thead th[data-role='rs']").hide();$("#"+this.grid.id()+" tfoot th[data-role='rs']").hide();for(i;i<this._vRsDom.length;i++){this._vRsDom[i].hide()}}else{if(this.grid.options.fixedHeaders===true){$("#"+this.grid.id()+"_headers colgroup:nth-child("+st+")").css("display","")}$("#"+this.grid.id()+" colgroup:nth-child("+st+")").css("display","");$("#"+this.grid.id()+" thead th[data-role='rs']").css("display","");$("#"+this.grid.id()+" tfoot th[data-role='rs']").css("display","");for(i;i<this._vRsDom.length;i++){this._vRsDom[i].css("display","")}}},_cSelectionChanged:function(event,ui){var cells,cog=false;if(ui.owner.grid.id()!==this.grid.id()){cog=true}if(!this._ms){cells=[this.grid._selectedCell]}else{cells=ui.selectedCells}this._selectionChanged(this.grid._selectedRows,cells,cog)},_rSelectionChanged:function(event,ui){var rows,cog=false;if(ui.owner.grid.id()!==this.grid.id()){cog=true}if(!this._ms){rows=[this.grid._selectedRow]}else{rows=ui.selectedRows}this._selectionChanged(rows,this.grid._selectedCells,cog)},_selectionChanged:function(selRows,selCells,selectedOtherGrid){var i,row,rowInRange,rowSelector,checkbox,offset=this._v===true?this.grid._startRowIndex||0:0;this._clearRowSelectorsSelection();if(this.options.enableCheckBoxes===true){this._clearRowSelectorsCheckboxes();this._pSelection[this._cpIdx]={}}if(selectedOtherGrid===true){return}if(this._checkBoxesShown===false&&this.options.showCheckBoxesOnFocus===true){this._animateCheckboxes(true)}for(i=0;i<selRows.length;i++){if(this._v===true){rowInRange=offset<=selRows[i].index&&selRows[i].index<offset+this.grid._virtualRowCount;row=rowInRange===true?$(selRows[i].element).parent().children().eq(selRows[i].index-offset):null}else{row=$(selRows[i].element)}if(row){rowSelector=row.children().eq(this._index);if(rowSelector.hasClass("ui-iggrid-selectedcell ui-state-active")===false){rowSelector.addClass("ui-iggrid-selectedcell ui-state-active")}if(this.options.enableCheckBoxes===true){checkbox=rowSelector.find("span[name='chk']");this._alterCheckbox(checkbox,true)}}if(this.options.enableCheckBoxes===true){this._pSelection[this._cpIdx][selRows[i].index]=true}}for(i=0;i<selCells.length;i++){rowSelector=$($(selCells[i].element).parent().children()[this._index]);if(rowSelector.hasClass("ui-iggrid-selectedcell ui-state-active")===false){rowSelector.addClass("ui-iggrid-selectedcell ui-state-active")}}this._updateHeader()},_refreshSelection:function(sri){var i,checkboxes,cb,sc,sr;this._clearRowSelectorsSelection(false);if(this.options.enableCheckBoxes===true){checkboxes=$("#"+this.grid.id()+'>tbody>tr>th span[name="chk"]').attr("data-chk","off");checkboxes.children("span").removeClass(this.css.checkboxOn).addClass(this.css.checkboxOff)}if(!this._skipRefresh){if(!this._ms){sc=this.grid._selectedCell?[this.grid._selectedCell]:[];sr=this.grid._selectedRow?[this.grid._selectedRow]:[]}else{sc=this.grid._selectedCells;sr=this.grid._selectedRows}for(i=0;i<sc.length;i++){if(sc[i].rowIndex>=sri&&sc[i].rowIndex<sri+this._vRsDom.length){$(this._vRsDom[sc[i].rowIndex-sri]).addClass("ui-iggrid-selectedcell ui-state-active")}}for(i=0;i<sr.length;i++){if(sr[i].index>=sri&&sr[i].index<sri+this._vRsDom.length){$(this._vRsDom[sr[i].index-sri]).addClass("ui-iggrid-selectedcell ui-state-active")}}}if(this.options.enableCheckBoxes===true&&this._pSelection[this._cpIdx]){checkboxes=$("#"+this.grid.id()+'>tbody>tr>th span[name="chk"]').attr("data-chk","off");checkboxes.children("span").removeClass(this.css.checkboxOn).addClass(this.css.checkboxOff);for(i=sri;i<sri+checkboxes.length;i++){if(this._pSelection[this._cpIdx][i]){cb=$(checkboxes[i-sri]);if(this._pSelection[this._cpIdx][i]===true){this._alterCheckbox(cb,true)}}}}},_clearSelection:function(evt,ui){if(ui.owner.id()===this.grid.id()){this._clearRowSelectorsSelection();this._clearRowSelectorsCheckboxes()}if(!ui.uiDirty||ui.uiDirty===false){this._pSelection[this._cpIdx]={}}},_clearRowSelectorsSelection:function(){var selectors,i;selectors=$("#"+this.grid.id()+">tbody>tr>th."+this.css.rowSelectorCssClass);for(i=0;i<selectors.length;i++){$(selectors[i]).removeClass("ui-iggrid-selectedcell ui-state-active")}this._index=$(selectors[0]).index()},_clearRowSelectorsCheckboxes:function(){var cbs,$cbs,i;cbs=$("#"+this.grid.id()+'>tbody>tr>th span[name="chk"]');for(i=0;i<cbs.length;i++){$cbs=$(cbs[i]);if($cbs.attr("data-chk")==="on"){this._alterCheckbox($cbs,false)}}if(cbs.length>0){this._updateHeader()}},_cellClick:function(event,ui){var args,rCell=$(event.target).closest("th"),rRow=rCell.parent(),rIdx=this._getVisibleRowIndex(rRow),rKey=rRow.attr("data-id");if(this.options.showCheckBoxesOnFocus===true&&this._checkBoxesShown===false){this._animateCheckboxes(true)}if($(event.target).is("span")&&$(event.target).attr("unselectable")){return}if(rKey===""||rKey===null||rKey===undefined){rKey=rIdx}args={row:rRow,rowIndex:rIdx,rowKey:rKey,rowSelector:rCell,owner:this,grid:this.grid};this._triggerClickEvent(event,args)},_mouseHoverRow:function(event,ui){var par,tag,tr=event.target;while(tr){par=tr.parentNode;tag=tr.nodeName;if(tag==="TR"&&par.nodeName==="TBODY"){break}tr=tag==="TABLE"?null:par}if(this._hovTR!==tr){if(this._hovTR&&$(this._hovTR).attr("data-container")!=="true"){$("th."+this.css.rowSelectorCssClass,this._hovTR).removeClass(this.css.nodeHovered)}if(tr&&$(tr).attr("data-container")!=="true"){$("th."+this.css.rowSelectorCssClass,tr).addClass(this.css.nodeHovered)}this._hovTR=tr}},_mouseLeaveRow:function(event,ui){if(this._hovTR){$("th",this._hovTR).removeClass(this.css.nodeHovered);this._hovTR=null}},_triggerClickEvent:function(event,args){this._trigger(this.events.rowSelectorClicked,event,args)},_triggerCheckingEvent:function(event,args){return this._trigger(this.events.checkBoxStateChanging,event,args)},_triggerCheckedEvent:function(event,args){this._trigger(this.events.checkBoxStateChanged,event,args)},_pageIndexChanging:function(event,ui){if(ui.owner.grid.id()!==this.grid.id()){return}if(this._v){this._skipRefresh=true}this._isPaging=true;this._cIdx=0},_pageIndexChanged:function(event,ui){var self=this,idx=ui.pageIndex,checkboxes,iKey,cb,sl=jQuery.extend(true,{},this._pSelection[idx]);if(ui.owner.grid.id()!==this.grid.id()){return}this._cpIdx=idx;if(sl){checkboxes=$("#"+this.grid.id()+'>tbody>tr>th span[name="chk"]');$.each(sl,function(key,value){if(sl[key]===true){iKey=parseInt(key,10);cb=$(checkboxes[iKey]);self._alterCheckbox(cb,true);self.grid.element.igGridSelection("selectRow",cb.closest("tr").index())}})}if(this.options.enableCheckBoxes===true){this._updateHeader()}if(this._v){delete this._skipRefresh}},_getVisibleRowIndex:function(row){return row.closest("tbody").children("tr:not([data-container='true'],[data-grouprow='true'])").index(row)},_getVisibleHRowIndex:function(row){return row.closest("tbody").children("tr:not([data-container='true'])").index(row)},_animateCheckboxes:function(trans){var h=$("#"+this.grid.id()+(this.grid.options.fixedHeaders===true?"_headers":"")+'>thead>tr>th span[name="hchk"]'),c=$("#"+this.grid.id()+'>tbody>tr>th span[name="chk"]'),all=h.add(c);if(trans===true){all.css("visibility","visible").css("opacity",0).animate({opacity:1},1e3)}else{all.css("opacity",1e3).animate({opacity:0},1e3,function(){$(this).css("visibility","hidden")})}this._checkBoxesShown=trans},_newRowAdded:function(event,ui){this._unregisterCellEvents();this._registerCellEvents();if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents()}},_cleanSelection:function(event,ui){var header;header=$("#"+this.grid.id()+(this.grid.options.fixedHeaders===true?"_headers":"")+'>thead>tr>th span[name="hchk"]');this._alterCheckbox(header,false);this._pSelection={};this._cpIdx=this.grid.dataSource.pageIndex()},_resetIndexing:function(){this._cIdx=0},_cleanInterface:function(isRebind){var header,footer,cols,rsCells,w;if(isRebind===true){header=$("#"+this.grid.id()+(this.grid.options.fixedHeaders===true?"_headers":"")+'>thead>tr>th span[name="hchk"]');this._alterCheckbox(header,false);return}cols=$("#"+this.grid.id()+" col[data-role='rs']");if(this.grid.options.fixedHeaders===true){cols=cols.add("#"+this.grid.id()+"_headers col[data-role='rs']")}if(this.grid.options.fixedFooters===true){cols=cols.add("#"+this.grid.id()+"_footers col[data-role='rs']")}footer=$("#"+this.grid.id()+(this.grid.options.fixedFooters===true?"_footers":"")+" td[data-role='rs']");header=$("#"+this.grid.id()+(this.grid.options.fixedHeaders===true?"_headers":"")+" th[data-role='rs']");rsCells=$("#"+this.grid.id()+" th.ui-iggrid-rowselector-class");if(!this.grid.options.width&&this._functionsRedirected){w=this.grid.container().css("width");if(w&&!w.endsWith("%")){this.grid.container().css("width",parseInt(w,10)-this.options.rowSelectorColumnWidth)}}cols.remove();footer.remove();header.remove();rsCells.remove()},_checkForSelection:function(){var i,isSelection=false;for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="Selection"){isSelection=true;break}}if(isSelection===false){if(this.options.requireSelection===true){throw new Error($.ig.GridRowSelectors.locale.selectionNotLoaded)}this._skipRefresh=true}},_groupedColumnsChanging:function(args){this._resetIndexing()},_createHandlers:function(){this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._footerRenderedHandler=$.proxy(this._footerRendered,this);this._recordsRenderingHandler=$.proxy(this._recordsRendering,this);this._recordsRenderedHandler=$.proxy(this._recordsRendered,this);this._gridRenderedHandler=$.proxy(this._gridRendered,this);this._cellSelectionChangedHandler=$.proxy(this._cSelectionChanged,this);this._rowSelectionChangedHandler=$.proxy(this._rSelectionChanged,this);this._clearSelectionHandler=$.proxy(this._clearSelection,this);this._virtualDomBuiltHandler=$.proxy(this._rsRenderVirtualRecords,this);this._virtualRowsHandler=$.proxy(this._rrn,this);this._virtualColumnsHandler=$.proxy(this._rcn,this);this._pageIndexChangingHandler=$.proxy(this._pageIndexChanging,this);this._pageIndexChangedHandler=$.proxy(this._pageIndexChanged,this);this._renderExtraHeaderCellHandler=$.proxy(this._renderExtraHeaderCells,this);this._renderExtraFooterCellHandler=$.proxy(this._renderExtraFooterCells,this);this._rsClickHandler=$.proxy(this._cellClick,this);this._rrHoverHandler=$.proxy(this._mouseHoverRow,this);this._rrLeaveHandler=$.proxy(this._mouseLeaveRow,this);this._newRowAddedHandler=$.proxy(this._newRowAdded,this);this._cleanHandler=$.proxy(this._cleanSelection,this);if(this.options.enableCheckBoxes===true){this._checkboxMouseOverHandler=$.proxy(this._checkboxMouseOver,this);this._checkboxMouseOutHandler=$.proxy(this._checkboxMouseOut,this);this._checkboxClickHandler=$.proxy(this._checkBoxClicked,this);this._hCheckboxClickHandler=$.proxy(this._headerCheckBoxClicked,this)}},_registerEvents:function(){this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggridfooterrendered",this._footerRenderedHandler);this.grid.element.bind("iggrid_rowsrendering",this._recordsRenderingHandler);this.grid.element.bind("iggridrowsrendered",this._recordsRenderedHandler);this.grid.element.bind("iggriddatarendered",this._gridRenderedHandler);this.grid.element.bind("iggridvirtualdombuilt",this._virtualDomBuiltHandler);this.grid.element.bind("iggridvirtualrecordsrender",this._virtualRowsHandler);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualColumnsHandler);this.grid.element.bind("iggridselectioncellselectionchanged",this._cellSelectionChangedHandler);this.grid.element.bind("iggridselectionrowselectionchanged",this._rowSelectionChangedHandler);this.grid.element.bind("iggridselectioninternalrowselectionchanged",this._rowSelectionChangedHandler);this.grid.element.bind("iggridselectioninternalcellselectionchanged",this._cellSelectionChangedHandler);this.grid.element.bind("iggridselectionselectioncleared",this._clearSelectionHandler);this.grid.element.bind("iggridpagingpageindexchanging",this._pageIndexChangingHandler);this.grid.element.bind("iggridpagingpageindexchanged",this._pageIndexChangedHandler);this.grid.element.bind("iggridpagingpagesizechanged",this._cleanHandler);this.grid.element.bind("iggridfilteringdatafiltered",this._cleanHandler);this.grid.element.bind("iggridgroupbygroupedcolumnschanged",this._cleanHandler);this.grid.element.bind("iggriduidirty",this._cleanHandler);this.grid.element.bind("iggridupdatingrowadded",this._newRowAddedHandler);this.grid.element.bind("iggridupdatinginternalrowadded",this._newRowAddedHandler)},_unregisterEvents:function(){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggridfooterrendered",this._footerRenderedHandler);this.grid.element.unbind("iggrid_rowsrendering",this._recordsRenderingHandler);this.grid.element.unbind("iggridrowsrendered",this._recordsRenderedHandler);this.grid.element.unbind("iggriddatarendered",this._gridRenderedHandler);this.grid.element.unbind("iggridvirtualdombuilt",this._virtualDomBuiltHandler);this.grid.element.unbind("iggridvirtualrecordsrender",this._virtualRowsHandler);this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualColumnsHandler);this.grid.element.unbind("iggridselectioncellselectionchanged",this._cellSelectionChangedHandler);this.grid.element.unbind("iggridselectionrowselectionchanged",this._rowSelectionChangedHandler);this.grid.element.unbind("iggridselectioninternalrowselectionchanged",this._rowSelectionChangedHandler);this.grid.element.unbind("iggridselectioninternalcellselectionchanged",this._cellSelectionChangedHandler);this.grid.element.unbind("iggridselectioncleared",this._clearSelectionHandler);this.grid.element.unbind("iggridpagingpageindexchanging",this._pageIndexChangingHandler);this.grid.element.unbind("iggridpagingpageindexchanged",this._pageIndexChangedHandler);this.grid.element.unbind("iggridpagingpagesizechanged",this._cleanHandler);this.grid.element.unbind("iggridfilteringdatafiltered",this._cleanHandler);this.grid.element.unbind("iggridgroupbygroupedcolumnschanged",this._cleanHandler);this.grid.element.unbind("iggriduidirty",this._cleanHandler);this.grid.element.unbind("iggridupdatingrowadded",this._newRowAddedHandler);this.grid.element.unbind("iggridupdatinginternalrowadded",this._newRowAddedHandler)},_injectGrid:function(gridInstance,isRebind){if(isRebind===true){this._cleanInterface(true);return}var self=this;this.grid=gridInstance;this._v=this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true;this._flatRenderColgroup=this.grid._renderColgroup;this._createHandlers();this.grid._headerInitCallbacks.push({type:"RowSelectors",func:this._renderExtraHeaderCellHandler});this.grid._footerInitCallbacks.push({type:"RowSelectors",func:this._renderExtraFooterCellHandler});this._registerEvents();this.grid._renderColgroup=function(){if(self._flatRenderColgroup!==undefined){self._rsRenderColgroup.apply(self.grid,$.merge([self._flatRenderColgroup,self],arguments))}};this._checkForSelection()}});$.extend($.ui.igGridRowSelectors,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Selection (and Keyboard navigation) 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *	modernizr.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridSelection",{css:{selectedCell:"ui-iggrid-selectedcell ui-state-active",selectedRow:"ui-iggrid-selectedrow ui-state-active",activeCell:"ui-iggrid-activecell ui-state-focus",activeRow:"ui-iggrid-activerow ui-state-focus"},options:{multipleSelection:false,mouseDragSelect:true,mode:"row",activation:true,wrapAround:true,skipChildren:true,multipleCellSelectOnClick:false,touchDragSelect:true},events:{rowSelectionChanging:"rowSelectionChanging",rowSelectionChanged:"rowSelectionChanged",cellSelectionChanging:"cellSelectionChanging",cellSelectionChanged:"cellSelectionChanged",activeCellChanging:"activeCellChanging",activeCellChanged:"activeCellChanged",activeRowChanging:"activeRowChanging",activeRowChanged:"activeRowChanged"},_create:function(){this._isMouseDown=false;this._isDrag=false;this._registeredEvents=false;this.y_exclude_current=0;this.x_exclude_current=0},_setOption:function(key,value){$.Widget.prototype._setOption.apply(this,arguments);if(key==="mode"){throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+key)}},_dataRendering:function(e,args){var tbody;if(args.owner.id()!==this.grid.id()){return}tbody=this.grid.element.find("tbody");if(this._mouseDownHandler){tbody.unbind({mousedown:this._mouseDownHandler,mousemove:this._mouseMoveHandler,mouseup:this._mouseUpHandler,selectstart:this._selectStartHandler});if(this._touchEvents){tbody.unbind({touchstart:this._touchStartHandler,touchend:this._touchEndHandler,MSPointerDown:this._touchStartHandler,MSPointerMove:this._touchMoveHandler,MSPointerUp:this._touchEndHandler,pointerdown:this._touchStartHandler,pointermove:this._touchMoveHandler,pointerup:this._touchEndHandler});tbody[0].removeEventListener("touchmove",this._touchMoveHandler)}}},_dataRendered:function(){if(!this._registeredEvents){this._registerEvents();this._registeredEvents=true}else{this._registerTbodyEvents()}if(this._hc===undefined){this._hc=this.grid.container().closest(".ui-iggrid-root").length>0;if(this._hc===false){this._hc=this.grid.element.hasClass("ui-iggrid-root")}}if(this._hc){this._hgrid=this.grid.element.closest(".ui-iggrid-root")}if(this._groupBy===undefined){this._groupBy=this.grid.container().find(".ui-iggrid-groupbyarea").length>0}this._refresh(true);if(!this._initialSelectionInitialized){if(this.options.selectedRowIndex!==undefined&&this.options.selectedRowIndex!==null&&this.options.selectedRowIndex>=0){if(this.options.selectedCellIndex===undefined){this.selectRow(this.options.selectedRowIndex)}else if(this.options.selectedCellIndex!==undefined&&this.options.selectedRowIndex!==null&&this.options.selectedCellIndex>=0){this.selectCell(this.options.selectedRowIndex,this.options.selectedCellIndex)}}this._initialSelectionInitialized=true}this.grid._startRowIndex=this.grid._startRowIndex||0},_refresh:function(init){if(!init||!(this._firstCell&&this._firstCell.length!==0)){this._firstCell=this.grid.element.children("tbody").children("tr:visible:nth-child(1) td:nth-child(1)");if(!this._firstCell){this._firstRow=this.grid.element.children("tbody").children("tr:visible:nth-child(1)")}}if(!init||!(this._firstRow&&this._firstRow.length!==0)||!this._rowCount){this._firstRow=this.grid.element.children("tbody").children("tr:visible:nth-child(1)");if(this.grid.options.virtualization||this.grid.options.rowVirtualization){this._rowCount=this.grid.dataSource.dataView().length}else{this._rowCount=this.grid.element.find("tbody tr").length}this._length=this._firstRow?this._firstRow.children().length:0}this.x_exclude_current=this._calcExtraCells()},_registerTbodyEvents:function(){var tbody=this.grid.element.find("tbody"),opts=this.options;if(!this._mouseDownHandler){this._mouseDownHandler=$.proxy(this._mouseDown,this);this._selectStartHandler=$.proxy(this._selectStart,this);this._mouseMoveHandler=$.proxy(this._dragSelectChange,this);this._mouseUpHandler=$.proxy(this._selectInternal,this);if((typeof Modernizr==="object"&&Modernizr.touch===true||window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&opts.multipleSelection===true&&opts.mode==="cell"&&opts.touchDragSelect===true){this._touchStartHandler=$.proxy(this._touchStart,this);this._touchEndHandler=$.proxy(this._touchEnd,this);this._touchMoveHandler=$.proxy(this._touchMove,this);this._touchEvents=true}}else{tbody.unbind({mousedown:this._mouseDownHandler,mousemove:this._mouseMoveHandler,mouseup:this._mouseUpHandler,selectstart:this._selectStartHandler});if(this._touchEvents){tbody.unbind({touchstart:this._touchStartHandler,touchend:this._touchEndHandler,MSPointerDown:this._touchStartHandler,MSPointerMove:this._touchMoveHandler,MSPointerUp:this._touchEndHandler,pointerdown:this._touchStartHandler,pointermove:this._touchMoveHandler,pointerup:this._touchEndHandler});tbody[0].removeEventListener("touchmove",this._touchMoveHandler)}}tbody.bind({mousedown:this._mouseDownHandler,mousemove:this._mouseMoveHandler,mouseup:this._mouseUpHandler,selectstart:this._selectStartHandler});if(this._touchEvents){tbody.bind({touchstart:this._touchStartHandler,touchend:this._touchEndHandler,MSPointerDown:this._touchStartHandler,MSPointerMove:this._touchMoveHandler,MSPointerUp:this._touchEndHandler,pointerdown:this._touchStartHandler,pointermove:this._touchMoveHandler,pointerup:this._touchEndHandler});tbody[0].addEventListener("touchmove",this._touchMoveHandler)}},_registerFixedTbodyEvents:function(){var tbody=this.grid.fixedContainer().find("tbody"),opts=this.options;if(!this._mouseDownFixedHandler){this._mouseDownFixedHandler=$.proxy(this._mouseDown,this);this._selectStartFixedHandler=$.proxy(this._selectStart,this);this._mouseMoveFixedHandler=$.proxy(this._dragSelectChange,this);this._mouseUpFixedHandler=$.proxy(this._selectInternal,this);if((typeof Modernizr==="object"&&Modernizr.touch===true||window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&opts.multipleSelection===true&&opts.mode==="cell"&&opts.touchDragSelect===true){this._touchStartFixedHandler=$.proxy(this._touchStart,this);this._touchEndFixedHandler=$.proxy(this._touchEnd,this);this._touchMoveFixedHandler=$.proxy(this._touchMove,this);this._touchEvents=true}}else{tbody.unbind({mousedown:this._mouseDownFixedHandler,mousemove:this._mouseMoveFixedHandler,mouseup:this._mouseUpFixedHandler,selectstart:this._selectStartFixedHandler});if(this._touchEvents){tbody.unbind({touchstart:this._touchStartFixedHandler,touchend:this._touchEndFixedHandler,MSPointerDown:this._touchStartFixedHandler,MSPointerMove:this._touchMoveFixedHandler,MSPointerUp:this._touchEndFixedHandler,pointerdown:this._touchStartHandler,pointermove:this._touchMoveHandler,pointerup:this._touchEndHandler});tbody[0].removeEventListener("touchmove",this._touchMoveFixedHandler)}}tbody.bind({mousedown:this._mouseDownFixedHandler,mousemove:this._mouseMoveFixedHandler,mouseup:this._mouseUpFixedHandler,selectstart:this._selectStartFixedHandler});if(this._touchEvents){tbody.bind({touchstart:this._touchStartFixedHandler,touchend:this._touchEndFixedHandler,MSPointerDown:this._touchStartFixedHandler,MSPointerMove:this._touchMoveFixedHandler,MSPointerUp:this._touchEndFixedHandler,pointerdown:this._touchStartHandler,pointermove:this._touchMoveHandler,pointerup:this._touchEndHandler});tbody[0].addEventListener("touchmove",this._touchMoveFixedHandler)}},_registerEvents:function(){this._registerTbodyEvents();if(this._releaseMouseHandler===null||this._releaseMouseHandler===undefined){this._releaseMouseHandler=$.proxy(this._releaseMouse,this)}$(document).bind({mouseup:this._releaseMouseHandler});if(this.grid.options.virtualization){$("#"+this.grid.element[0].id+"_scrollContainer").bind({scroll:$.proxy(this._releaseMouse,this)})}else{$("#"+this.grid.element[0].id+"_scroll").bind({scroll:$.proxy(this._releaseMouse,this)})}this._keyDownHandler=$.proxy(this._navigate,this);this._focusHandler=$.proxy(this._navigateFocus,this);this._markMouseDownHandler=$.proxy(this._markMouseDown,this);if(this.grid.options.virtualization||this.grid.options.rowVirtualization){$("#"+this.grid.element[0].id+"_displayContainer_a").bind({keydown:this._keyDownHandler,focus:this._focusHandler})}else{this.grid.container().bind({keydown:this._keyDownHandler,focus:this._focusHandler})}if(this.options.multipleSelection===true){this.grid.element.addClass("ui-iggrid-canceltextselection")}},_unregisterEvents:function(){var tbody=this.grid.element.find("tbody");this.grid.element.unbind("mousedown",this._mouseDownHandler);this.grid.element.unbind("selectstart",this._selectStartHandler);this.grid.element.unbind("mousemove",this._mouseMoveHandler);this.grid.element.unbind("mouseup",this._mouseUpHandler);this.grid.container().unbind("keydown",this._keyDownHandler);this.grid.container().unbind("focus",this._focusHandler);this.grid.container().unbind("mousedown",this._markMouseDownHandler);this.grid.element.unbind("iggriduisoftdirty",this._uiDirtyHandler);this.grid.element.unbind("ighierarchicalgridrowexpanded",this._rowExpandedHandler);this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this.grid.element.unbind("iggridvirtualrecordsrender",this._virtualRecordsRendererHandler);tbody.unbind({mousedown:this._mouseDownHandler,mousemove:this._mouseMoveHandler,mouseup:this._mouseUpHandler,selectstart:this._selectStartHandler});if(this._touchEvents){tbody.unbind({touchstart:this._touchStartHandler,touchend:this._touchEndHandler,MSPointerDown:this._touchStartHandler,MSPointerMove:this._touchMoveHandler,MSPointerUp:this._touchEndHandler,pointerdown:this._touchStartHandler,pointermove:this._touchMoveHandler,pointerup:this._touchEndHandler});tbody[0].removeEventListener("touchmove",this._touchMoveHandler)}if(this._releaseMouseHandler){$(document).unbind({mouseup:this._releaseMouseHandler});delete this._releaseMouseHandler}delete this._mouseDownHandler;delete this._selectStartHandler;delete this._mouseMoveHandler;delete this._mouseUpHandler;delete this._keyDownHandler;delete this._focusHandler;delete this._markMouseDownHandler;delete this._uiDirtyHandler;delete this._rowExpandedHandler;delete this._columnsCollectionModifiedHandler;delete this._virtualRecordsRendererHandler;delete this._touchEvents;this.grid.element.removeClass("ui-iggrid-canceltextselection")},_dragSelectChange:function(event){var selectedCells=[],startRowIndex,startColIndex,endRowIndex,endColIndex,outgrid,currentCell,tmp,noCancel=true,v=this.grid.options.virtualization||this.grid.options.rowVirtualization;if(event&&this._suspend){return}if(!this._prevX&&!this._prevY){this._prevX=event.clientX;this._prevY=event.clientY}if(Math.abs(this._prevX-event.clientX)<5&&Math.abs(this._prevY-event.clientY)<5){return}this._prevX=event.clientX;this._prevY=event.clientY;if(this.options.mouseDragSelect===false||this.options.multipleSelection===false||this.options.mode==="row"){return}if(this._isMouseDown===true){this._isDrag=true}else{return}if(this._isMouseDown!==true||this.options.mode!=="cell"){return}if(this._hc&&event&&event.target){outgrid=$(event.target).closest(".ui-iggrid-table");if(outgrid.length>0&&outgrid.attr("id")!==this.grid.element.attr("id")){event.stopPropagation();event.preventDefault();return}}currentCell=this._cellFromEvent(event);if(!currentCell){return}if(currentCell&&this.activeCell()&&currentCell.index===this.activeCell().index&&currentCell.rowIndex===this.activeCell().rowIndex){return}if(this._touchEvents&&!(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)){event={originalEvent:event}}noCancel=this._trigger(this.events.cellSelectionChanging,event,{cell:currentCell,selectedCells:this.grid._selectedCells,owner:this,manual:false});if(noCancel){if(this.options.activation===true){this._activateCell(currentCell,event)}startRowIndex=this._firstDragCell.rowIndex;startColIndex=this._firstDragCell.index+this._firstDragCell.element.parent().children("[data-skip=true]").length;endRowIndex=currentCell.rowIndex;endColIndex=currentCell.index+this._firstDragCell.element.parent().children("[data-skip=true]").length;if(endRowIndex<startRowIndex){tmp=startRowIndex;startRowIndex=endRowIndex;endRowIndex=tmp}if(currentCell.isFixed===this._firstDragCell.isFixed&&endColIndex<startColIndex){tmp=startColIndex;startColIndex=endColIndex;endColIndex=tmp}if(currentCell.isFixed!==this._firstDragCell.isFixed&&(this._lastSelectedIndex===undefined||this._lastSelectedIndex===null)){if(currentCell.isFixed===true){this._lastSelectedIndex=this.grid._selectedCells[this.grid._selectedCells.length-1].index}else{this._lastSelectedIndex=endColIndex}}this.clearSelection(true);if(v){startRowIndex-=this.grid._startRowIndex;endRowIndex-=this.grid._startRowIndex}this._selectCell(startRowIndex,endRowIndex,startColIndex,endColIndex,currentCell.isFixed);this._currentCells=selectedCells;this._trigger(this.events.cellSelectionChanged,event,{cell:currentCell,selectedCells:this.grid._selectedCells,owner:this,manual:false})}},_touchStart:function(event){event.clientX=event.originalEvent.touches?event.originalEvent.touches[0].pageX:event.originalEvent.clientX;event.clientY=event.originalEvent.touches?event.originalEvent.touches[0].pageY:event.originalEvent.clientY;if(this._cellFromEvent(event).element.hasClass(this.css.selectedCell)){this.grid.element.css("-ms-touch-action","none");this._touchDragStart=true}},_touchEnd:function(event){if(this._touchDragStart){this._isMouseDown=false}this._touchDragStart=false;this._isDrag=false;this.grid.element.find("tbody").css("-ms-touch-action","auto")},_touchMove:function(event){if(!this._touchDragStart){return true}event.preventDefault();event.clientX=event.touches?event.touches[0].pageX:event.originalEvent.clientX;event.clientY=event.touches?event.touches[0].pageY:event.originalEvent.clientY;this._touchDragStart=true;this._isMouseDown=true;this._dragSelectChange(event)},_selectCell:function(startRowIndex,endRowIndex,startColIndex,endColIndex,isFixed){var i,j,cell;for(i=startRowIndex;i<=endRowIndex;i++){for(j=startColIndex;j<=endColIndex;j++){cell=$(this.grid.cellAt(j,i,isFixed)).addClass(this.css.selectedCell);this.grid._selectedCells.push(this._cellFromElement(cell,i+this.grid._startRowIndex,j,isFixed))}}},_cellFromEvent:function(event){var target,$target,isFixed=false;if(this._touchEvents===true){$target=$(document.elementFromPoint(event.clientX,event.clientY))}else{$target=$(event.originalEvent.originalTarget||event.originalEvent.srcElement)}target=$target.is("td,th")?$target[0]:$target.closest("td,th")[0];if(this.grid.hasFixedColumns()){isFixed=$target.closest("div").attr("data-fixed-container")!==undefined}return this._cellFromElement(target,undefined,undefined,isFixed)},_cellFromElement:function(e,row,col,isFixed){var $target,parent,parentIndex,cellIndex,key=null,tmpIndex;if(isFixed===null||isFixed===undefined){isFixed=false}$target=$(e);parent=$target.parent();if(row===undefined||col===undefined){cellIndex=$target.index();parentIndex=parent.index();if(this.grid.options.virtualization||this.grid.options.rowVirtualization||this.grid.options.columnVirtualization){if(this.grid._startRowIndex>0){parentIndex+=this.grid._startRowIndex}if(this.grid._startColIndex>0){cellIndex+=this.grid._startColIndex}}}else{cellIndex=col;parentIndex=row}if(cellIndex===-1){return}if(cellIndex-this.x_exclude_current<0){tmpIndex=0}else if(cellIndex-this.x_exclude_current>=this.grid._visibleColumns().length){tmpIndex=this.grid._visibleColumns().length-1}else{tmpIndex=cellIndex-this.x_exclude_current}if(this._hc===true&&cellIndex-this.x_exclude_current<this.grid._visibleColumns().length||$target.siblings("th").length>0){tmpIndex--}if(tmpIndex>=0&&this.grid._visibleColumns().length>tmpIndex){key=this.grid._visibleColumns()[tmpIndex].key}if(this.y_exclude_current!==undefined){parentIndex-=this.y_exclude_current}if(this.x_exclude_current!==undefined){cellIndex-=this.x_exclude_current}return{element:$target,row:parent,index:cellIndex,rowIndex:parentIndex,columnKey:key,isFixed:isFixed}},_mouseDown:function(event){var v=this.grid.options.virtualization||this.grid.options.rowVirtualization||this.grid.options.columnVirtualization,outgrid,ncv=this.grid.options.virtualizationMode!=="continuous";if(event&&this._suspend){return}if(event.target&&$(event.target).hasClass("ui-iggrid-scrolldiv")){return}if(event&&event.which===0){event.which=1}if(event&&event.which!==1){return}if(this._hc&&event&&event.target){outgrid=$(event.target).closest(".ui-iggrid-table");if(outgrid.length>0&&outgrid.attr("id")!==this.grid.element.attr("id")){return}}if(event.target&&$(event.target).closest("td").attr("data-skip")==="true"){event.stopPropagation();event.preventDefault();$(event.target).trigger("iggridselectionmousedown");return}if(event.which===2){return}this._isMouseDown=true;if(this.options.multipleSelection===false&&v&&ncv){$("#"+this.grid.element[0].id+"_displayContainer_a").focus();if((this.grid.options.virtualization||this.grid.options.rowVirtualization)&&this.grid.options.virtualizationMode==="continuous"){event.preventDefault()}}if(this.options.mouseDragSelect===false||this.options.multipleSelection===false){return}this._mouseLocation={clientX:event.clientX,clientY:event.clientY};this._firstDragCell=this._cellFromEvent(event);this._lastSelectedIndex=null;if(!event.ctrlKey&&!event.shiftKey&&this.options.multipleSelection!==true){this.clearSelection(true)}this._isInternalFocus=true;if(this.options.multipleSelection===true&&v&&ncv){$("#"+this.grid.element[0].id+"_displayContainer_a").focus()}if(!$(event.target).hasClass("ui-iggrid-expandbutton")&&!$(event.target).hasClass("ui-iggrid-expandcolumn")&&!$(event.target).hasClass("ui-iggrid-expandbuttongb")){if(v){event.stopPropagation();event.preventDefault()}$(event.target).trigger("iggridselectionmousedown")}},_markMouseDown:function(event){this._isMouseDown=true},_selectStart:function(event){if(event.target&&$(event.target).closest(".ui-iggrid-table").attr("id")!==this.grid.id()){return}if(event&&this._suspend){return}if(this.options.mouseDragSelect===false||this.options.multipleSelection===false){return false}event.stopPropagation();event.preventDefault()},_releaseMouse:function(){this._isMouseDown=false;this._isDrag=false},_selectInternal:function(event,row,col,isFixed){var target,parent,$target,gridCell,gridRow,i,noCancel=true,isInternal=false,vindex,isRs,outgrid,contSelection,fixedGridRow,cs,self=this,isRowSelection=false,parentIndex,v,excludeTmp,hasFixedColumns=this.grid.hasFixedColumns(),clickedOnFixedContainer=false,selectedRowIndex,sri;sri=this.grid._startRowIndex||0;v=this.grid.options.virtualization||this.grid.options.columnVirtualization||this.grid.options.rowVirtualization;if(!this._isMouseDown&&event){return}if(event&&event.which===0){event.which=1}if(event&&event.which!==1){return}if(event!==null&&event.target&&($(event.target).hasClass("ui-iggrid-childarea")||$(event.target).parent().hasClass("ui-iggrid-childarea")||$(event.target).hasClass("ui-widget-header"))){return}if(event===null){isInternal=true;excludeTmp=this.y_exclude_current;if(this._isContinuous||isInternal){excludeTmp=0}vindex=row-sri<0?0:row-sri+excludeTmp;event={originalEvent:{}};if(col===null||col===undefined){isRowSelection=true;if(v){event.originalEvent.originalTarget=this.grid.rowAt(vindex)}else{event.originalEvent.originalTarget=this.grid.rowAt(row-excludeTmp)}}else{if(v){event.originalEvent.originalTarget=this.grid.cellAt(col,vindex,isFixed)}else{event.originalEvent.originalTarget=this.grid.cellAt(col+this.x_exclude_current,row-excludeTmp,isFixed)}}event.originalEvent.srcElement=event.originalEvent.originalTarget}target=event.originalEvent.originalTarget||event.originalEvent.srcElement;$target=$(target);if(hasFixedColumns){clickedOnFixedContainer=$target.closest("div").attr("data-fixed-container")!==undefined}isRs=$target.closest("th.ui-iggrid-rowselector-class").length===1;if(event&&$target.is("span")&&($target.attr("data-chk")!==undefined||$target.parent().attr("data-chk")!==undefined)){this._mouseCtrlSelect=true;return}if(this._hc){outgrid=$target.closest(".ui-iggrid-table");if(outgrid.length>0&&outgrid.attr("id")!==this.grid.element.attr("id")){if(event&&!isInternal){event.preventDefault();this._isMouseDown=false;this._isDrag=false}return}$target.parents("tr[data-container]").each(function(){if($(this).closest(".ui-iggrid-table").attr("id")===self.grid.element.attr("id")){cs=true;return false}});if(cs){return}if(this._hgrid&&this._hgrid.data("data-selectgrid")!==this.grid.element.attr("id")){this.clearSelectionAllOthers(false,true);this._hgrid.data("data-selectgrid",this.grid.element.attr("id"))}}if(this._hc&&this._hdirty){this.y_exclude_current=this._excludeRowsLt($target.closest("tr"))}else if(!this._hc){this.y_exclude_current=0}if(this.x_exclude_current===undefined){this.x_exclude_current=this._calcExtraCells()}if(event&&this._suspend){return}if(event&&event.which===2){return}if(this._isDrag===true&&event!==null){this._isDrag=false;return}parent=$target.closest("tr");if($target.closest("th").length>0&&isRs===false){return}if($target.closest("td").attr("data-skip")==="true"){return}if(event.ctrlKey){this._isContinuous=false;this._mouseCtrlSelect=true}if(this.options.multipleCellSelectOnClick===true&&this.options.mode==="cell"&&this.activeCell()){this._isContinuous=false;this._mouseCtrlSelect=true;contSelection=true}if(this.options.mode==="cell"&&isRowSelection===false){if(isRs===true){if(isInternal===true){target=$target.is("th")?$target[0]:$target.closest("th")[0]}else{target=$target.is("th")?$target.next()[0]:$target.closest("th").next()[0]}}else{target=$target.is("td")?$target[0]:$target.closest("td")[0]}gridCell=this._cellFromElement(target,undefined,undefined,clickedOnFixedContainer,isFixed);if(this.options.activation===true&&this._rangeSelect!==true&&this._singleShiftSelect!==true&&this._ctrlSelect!==true){if(this.activeCell()&&gridCell&&this._mouseCtrlSelect!==true&&gridCell.isFixed===this.activeCell().isFixed&&gridCell.index===this.activeCell().index&&gridCell.rowIndex===this.activeCell().rowIndex){return}if(this._mouseCtrlSelect!==true){this._activateCell(gridCell,event)}else if(this.activeCell()&&(gridCell.index!==this.activeCell().index||gridCell.rowIndex!==this.activeCell().rowIndex)){this._activateCell(gridCell,event)}}}else{if(isInternal){parent=$(target)}parentIndex=parent.index();selectedRowIndex=parentIndex+sri-this.y_exclude_current;if(clickedOnFixedContainer){parent=this.grid.scrollContainer().find("tr:nth-child("+(selectedRowIndex+1)+")")}gridRow={element:parent,index:selectedRowIndex,id:parent.data()?parent.data().id:null};if(hasFixedColumns){fixedGridRow={element:this.grid.fixedContainer().find("tr:nth-child("+(selectedRowIndex+1)+")"),index:selectedRowIndex,id:parent.data()?parent.data().id:null}}if(gridRow.element.attr("data-container")){return}if(this.options.activation===true&&this._rangeSelect!==true&&this._singleShiftSelect!==true&&this._ctrlSelect!==true){if(!(this.activeRow()&&gridRow&&this._mouseCtrlSelect!==true&&gridRow.index===this.activeRow().index)){if(this._mouseCtrlSelect!==true){this._activateRow(gridRow,event,fixedGridRow)}else if(this.activeRow()&&gridRow.index!==this.activeRow().index){this._activateRow(gridRow,event,fixedGridRow)}}}}if(this.options.mode==="row"&&this.grid._selectedRow&&this._singleShiftSelect!==true&&this._ctrlSelect!==true&&this._mouseCtrlSelect!==true&&this.options.multipleSelection!==true&&gridRow&&gridRow.index===this.grid._selectedRow.index){return}if(this.options.mode==="cell"&&this.grid._selectedCell&&gridCell&&this._singleShiftSelect!==true&&this._ctrlSelect!==true&&this._mouseCtrlSelect!==true&&gridCell.isFixed===this.grid._selectedCell.isFixed&&gridCell.index===this.grid._selectedCell.index&&gridCell.rowIndex===this.grid._selectedCell.rowIndex){return}if(isInternal===false&&this.options.mode==="cell"||isInternal===true&&isRowSelection===false){if(isInternal===false&&!event.shiftKey||this._ctrlSelect===true){noCancel=this._trigger(this.events.cellSelectionChanging,event,{cell:gridCell,selectedCells:this.grid._selectedCells,owner:this,manual:isInternal})}if(noCancel&&gridCell&&gridCell.element&&!gridCell.element.hasClass("ui-iggrid-expandcolumn")&&!gridCell.element.hasClass("ui-iggrid-rowselector-class")){if(this.options.multipleSelection!==true){if(this.grid._selectedCell!==null){if(v){$(this.grid.cellAt(this.grid._selectedCell.index,this.grid._selectedCell.rowIndex-sri,isFixed)).removeClass(this.css.selectedCell)}else{this.grid._selectedCell.element.removeClass(this.css.selectedCell)}}if(this.grid._selectedRow!==null&&this.grid._selectedRow!==undefined){if(v){this.grid.rowAt(this.grid._selectedRow.index-sri).children().removeClass(this.css.selectedCell)}else{this.grid._selectedRow.element.children().removeClass(this.css.selectedCell)}}if(this.grid._selectedFixedRow!==null&&this.grid._selectedFixedRow!==undefined){this.grid._selectedFixedRow.element.children().removeClass(this.css.selectedCell)}}else{if(event.ctrlKey||this._ctrlSelect===true||contSelection===true){if(gridCell.element.hasClass(this.css.selectedCell)){for(i=0;i<this.grid._selectedCells.length;i++){if(this.grid._selectedCells[i].element&&this.grid._selectedCells[i].element.length>0){if(this.grid._selectedCells[i].element.index()===gridCell.rowIndex&&this.grid._selectedCells[i].index===gridCell.index){$.ig.removeFromArray(this.grid._selectedCells,i)}}else{if(this.grid._selectedCells[i].rowIndex===gridCell.rowIndex&&this.grid._selectedCells[i].index===gridCell.index){$.ig.removeFromArray(this.grid._selectedCells,i)}}}}else{this.grid._selectedCells.push(gridCell)}}else if(!event.shiftKey){if(!isInternal){this.clearSelection(true)}if(!this._isCellSelected(gridCell.rowIndex,gridCell.index)){this.grid._selectedCells.push(gridCell)}if(!isInternal){this._realActiveCell=gridCell}}else{this._shiftCellSelection(gridCell);return}}if((event.ctrlKey||this._ctrlSelect===true||contSelection===true)&&gridCell.element.hasClass(this.css.selectedCell)){gridCell.element.removeClass(this.css.selectedCell)}else{gridCell.element.addClass(this.css.selectedCell);this.grid._selectedCell=gridCell}if(isInternal===false||this._ctrlSelect===true){this._trigger(this.events.cellSelectionChanged,event,{cell:gridCell,selectedCells:this.grid._selectedCells,owner:this,manual:isInternal})}}}else if(isInternal===false&&this.options.mode==="row"||isInternal===true&&isRowSelection===true){if(isInternal===false&&!event.shiftKey||this._ctrlSelect===true){noCancel=this._trigger(this.events.rowSelectionChanging,event,{row:gridRow,selectedRows:this.grid._selectedRows,owner:this,manual:isInternal})}if(noCancel){if(this.options.multipleSelection!==true){if(this.grid._selectedRow!==null){if(v){$(this.grid.rowAt(this.grid._selectedRow.index-sri)).children().removeClass(this.css.selectedCell)}else{$(this.grid._selectedRow.element).children().removeClass(this.css.selectedCell)}}if(this.grid._selectedFixedRow!==null&&this.grid._selectedFixedRow!==undefined){$(this.grid._selectedFixedRow.element).children().removeClass(this.css.selectedCell)}if(this.grid._selectedCell!==null&&this.grid._selectedCell!==undefined){if(v){$(this.grid.cellAt(this.grid._selectedCell.index,this.grid._selectedCell.rowIndex-sri,isFixed)).removeClass(this.css.selectedCell)}else{this.grid._selectedCell.element.removeClass(this.css.selectedCell)}}if(this.grid._selectedFixedCell!==null&&this.grid._selectedFixedCell!==undefined){this.grid._selectedFixedCell.element.removeClass(this.css.selectedFixedCell)}}else{if(event.ctrlKey||this._ctrlSelect===true){if(gridRow.element.children().hasClass(this.css.selectedCell)){for(i=0;i<this.grid._selectedRows.length;i++){if(this.grid._selectedRows[i].element&&this.grid._selectedRows[i].element.length>0){if(this.grid._selectedRows[i].element.index()===gridRow.index){$.ig.removeFromArray(this.grid._selectedRows,i)}}else{if(this.grid._selectedRows[i].index===gridRow.index){$.ig.removeFromArray(this.grid._selectedRows,i)}}}if(hasFixedColumns){for(i=0;i<this.grid._selectedFixedRows.length;i++){if(this.grid._selectedFixedRows[i].element&&this.grid._selectedFixedRows[i].element.length>0){if(this.grid._selectedFixedRows[i].element.index()===gridRow.index){$.ig.removeFromArray(this.grid._selectedFixedRows,i)}}else{if(this.grid._selectedFixedRows[i].index===gridRow.index){$.ig.removeFromArray(this.grid._selectedFixedRows,i)}}}}}else{this.grid._selectedRows.push(gridRow);if(hasFixedColumns){this.grid._selectedFixedRows.push(fixedGridRow)}}}else if(!event.shiftKey){if(!isInternal){this.clearSelection(true)}if(!this._isRowSelected(gridRow.index)){this.grid._selectedRows.push(gridRow);if(hasFixedColumns){this.grid._selectedFixedRows.push(fixedGridRow)}}if(!isInternal){this._realActiveRow=gridRow}}else{this._shiftRowSelection(gridRow);return}}if((event.ctrlKey||this._ctrlSelect===true)&&gridRow.element.children().hasClass(this.css.selectedCell)){gridRow.element.removeClass(this.css.selectedRow);gridRow.element.children().removeClass(this.css.selectedCell);if(hasFixedColumns&&fixedGridRow){fixedGridRow.element.removeClass(this.css.selectedRow);fixedGridRow.element.children().removeClass(this.css.selectedCell)}}else if(parent.is("tr")){parent.children(":not(.ui-iggrid-nongrouprowemptycell)").addClass(this.css.selectedCell);if(hasFixedColumns){fixedGridRow.element.children(":not(.ui-iggrid-nongrouprowemptycell)").addClass(this.css.selectedCell)}}this.grid._selectedRow=gridRow;if(hasFixedColumns){this.grid._selectedFixedRow=fixedGridRow}if(isInternal===false||this._ctrlSelect===true){this._trigger(this.events.rowSelectionChanged,event,{row:gridRow,selectedRows:this.grid._selectedRows,owner:this,manual:isInternal})}else if(isInternal===true&&!this._rangeSelect){this._trigger("internalrowselectionchanged",event,{row:gridRow,selectedRows:this.grid._selectedRows,owner:this})}}}this._mouseCtrlSelect=false},_shiftRowSelection:function(row,noClear,singleRowNavigate,currentRow,event){var i,startIndex,endIndex,noCancel=true;this._isContinuous=true;if(this.grid._selectedRows.length===0){this._singleShiftSelect=true;noCancel=this._trigger(this.events.rowSelectionChanging,null,{row:row,startIndex:row.index,endIndex:row.index,selectedRows:this.grid._selectedRows,owner:this,manual:false});if(noCancel){this.selectRow(row.index);this._trigger(this.events.rowSelectionChanged,null,{row:row,selectedRows:this.grid._selectedRows,owner:this,manual:false})}this._singleShiftSelect=false;return}endIndex=row.index;startIndex=this.grid._selectedRows[0].index;noCancel=this._trigger(this.events.rowSelectionChanging,null,{row:row,startIndex:startIndex,endIndex:endIndex,selectedRows:this.grid._selectedRows,owner:this,manual:false});if(noCancel){this._rangeSelect=true;if(!singleRowNavigate){if(this.grid._selectedRows.length>0&&this.grid._selectedRows[0].index<row.index){if(noClear!==false){this.clearSelection(true)}for(i=startIndex;i<=endIndex;i++){this.selectRow(i)}}if(this.grid._selectedRows.length>0&&this.grid._selectedRows[0].index>row.index){if(noClear!==false){this.clearSelection(true)}for(i=startIndex;i>=endIndex;i--){this.selectRow(i)}}}else{if(event){this._activateRow(row,event)}if(this._isRowSelected(this.activeRow().index)){this.deselectRow(currentRow.index)}else{this.selectRow(this.activeRow().index)}this._singleShiftSelect=false}this._rangeSelect=false;this._trigger(this.events.rowSelectionChanged,null,{row:row,selectedRows:this.grid._selectedRows,owner:this,manual:false})}},_shiftCellSelection:function(cell,noClear,singleCellNavigate,currentCell,event){var firstCell,firstRowIndex,lastRowIndex,firstCellIndex,lastCellIndex,i,j,noCancel=true,lastSelRow=0,firstSelRow=Number.MAX_VALUE,lastSelCol=0,firstSelCol=Number.MAX_VALUE;this._isContinuous=true;if(this.grid._selectedCells.length===0){this._singleShiftSelect=true;noCancel=this._trigger(this.events.cellSelectionChanging,null,{cell:cell,firstRowIndex:cell.rowIndex,lastRowIndex:cell.rowIndex,firstColumnIndex:cell.index,lastColumnIndex:cell.index,selectedCells:this.grid._selectedCells,owner:this,manual:false});
if(noCancel){this.selectCell(cell.rowIndex,cell.index);this._trigger(this.events.cellSelectionChanged,null,{cell:cell,selectedCells:this.grid._selectedCells,owner:this,manual:false})}this._singleShiftSelect=false;return}firstCell=this.grid._selectedCells[0];firstRowIndex=firstCell.rowIndex;lastRowIndex=cell.rowIndex;firstCellIndex=firstCell.index;lastCellIndex=cell.index;noCancel=this._trigger(this.events.cellSelectionChanging,null,{cell:cell,firstRowIndex:firstRowIndex,lastRowIndex:lastRowIndex,firstColumnIndex:firstCellIndex,lastColumnIndex:lastCellIndex,selectedCells:this.grid._selectedCells,owner:this,manual:false});if(noCancel){if(noClear!==false){this.clearSelection(true)}this._rangeSelect=true;if(!singleCellNavigate){if(firstCell.isFixed===cell.isFixed){if(firstRowIndex<=lastRowIndex){for(i=firstRowIndex;i<=lastRowIndex;i++){if(firstCellIndex<=lastCellIndex){for(j=firstCellIndex;j<=lastCellIndex;j++){this.selectCell(i,j,cell.isFixed)}}else{for(j=firstCellIndex;j>=lastCellIndex;j--){this.selectCell(i,j,cell.isFixed)}}}}else{for(i=firstRowIndex;i>=lastRowIndex;i--){if(firstCellIndex<=lastCellIndex){for(j=firstCellIndex;j<=lastCellIndex;j++){this.selectCell(i,j,cell.isFixed)}}else{for(j=firstCellIndex;j>=lastCellIndex;j--){this.selectCell(i,j,cell.isFixed)}}}}}}else{this._singleShiftSelect=true;if(event){this._activateCell(cell,event)}if(this._isCellSelected(this.activeCell().rowIndex,this.activeCell().index)){this.deselectCell(currentCell.rowIndex,currentCell.index);for(i=0;i<this.grid._selectedCells.length;i++){if(this.grid._selectedCells[i].rowIndex>lastSelRow){lastSelRow=this.grid._selectedCells[i].rowIndex}if(this.grid._selectedCells[i].rowIndex<firstSelRow){firstSelRow=this.grid._selectedCells[i].rowIndex}if(this.grid._selectedCells[i].index>lastSelCol){lastSelCol=this.grid._selectedCells[i].index}if(this.grid._selectedCells[i].index<firstSelCol){firstSelCol=this.grid._selectedCells[i].index}}if(Math.abs(firstSelRow-lastSelRow)>0&&Math.abs(this.activeCell().index-currentCell.index)>0){if(firstSelRow<=lastSelRow){for(i=firstSelRow;i<=lastSelRow;i++){this.deselectCell(i,currentCell.index)}}else{for(i=firstSelRow;i>=lastSelRow;i--){this.deselectCell(i,currentCell.index)}}}else if(Math.abs(firstSelCol-lastSelCol)>0&&Math.abs(this.activeCell().rowIndex-currentCell.rowIndex)>0){if(firstSelCol<=lastSelCol){for(i=firstSelCol;i<=lastSelCol;i++){this.deselectCell(currentCell.rowIndex,i)}}else{for(i=firstSelCol;i>=lastSelCol;i--){this.deselectCell(currentCell.rowIndex,i)}}}}else{this.selectCell(this.activeCell().rowIndex,this.activeCell().index);for(i=0;i<this.grid._selectedCells.length;i++){if(this.grid._selectedCells[i].rowIndex>lastSelRow){lastSelRow=this.grid._selectedCells[i].rowIndex}if(this.grid._selectedCells[i].rowIndex<firstSelRow){firstSelRow=this.grid._selectedCells[i].rowIndex}if(this.grid._selectedCells[i].index>lastSelCol){lastSelCol=this.grid._selectedCells[i].index}if(this.grid._selectedCells[i].index<firstSelCol){firstSelCol=this.grid._selectedCells[i].index}}if(Math.abs(firstSelRow-lastSelRow)>0&&Math.abs(this.activeCell().index-currentCell.index)>0){if(firstSelRow<=lastSelRow){for(i=firstSelRow;i<=lastSelRow;i++){this.selectCell(i,this.activeCell().index)}}else{for(i=firstSelRow;i>=lastSelRow;i--){this.selectCell(i,this.activeCell().index)}}}else if(Math.abs(firstSelCol-lastSelCol)>0&&Math.abs(this.activeCell().rowIndex-currentCell.rowIndex)>0){if(firstSelCol<=lastSelCol){for(i=firstSelCol;i<=lastSelCol;i++){this.selectCell(this.activeCell().rowIndex,i)}}else{for(i=firstSelCol;i>=lastSelCol;i--){this.selectCell(this.activeCell().rowIndex,i)}}}}this._singleShiftSelect=false}this._rangeSelect=false;this._trigger(this.events.cellSelectionChanged,null,{cell:cell,selectedCells:this.grid._selectedCells,owner:this,manual:false})}},_rowExpanded:function(event,args){this._hdirty=true},_navigate:function(event){var vcontainer=$("#"+this.grid.element[0].id+"_displayContainer_a"),active,shouldNavigate=false;if(event&&this._suspend){return}if(this._isMouseDown===true){return}if(event.keyCode!==$.ui.keyCode.ENTER&&event.keyCode!==$.ui.keyCode.SPACE&&event.keyCode!==$.ui.keyCode.UP&&event.keyCode!==$.ui.keyCode.DOWN&&event.keyCode!==$.ui.keyCode.LEFT&&event.keyCode!==$.ui.keyCode.RIGHT){return}if(this._hc){active=this.options.mode==="row"?this.activeRow():this.activeCell();if(active!==undefined&&active!==null){active=this.options.mode==="row"?active.element:active.element.closest("tr");this.y_exclude_current=this._excludeRowsLt(active)}}else{this.y_exclude_current=0}if(this.x_exclude_current===undefined){this.x_exclude_current=this._calcExtraCells()}if(this.grid.options.virtualization){if($.ig.util.isIE&&document.activeElement&&document.activeElement.id!==this.grid.id()&&document.activeElement.id!==this.grid.container().attr("id")&&!$(document.activeElement).is("td")&&$(document.activeElement).closest("table")[0].id!==this.grid.id()){return}if(!$.ig.util.isIE&&event.target.id!==vcontainer.attr("id")){return}}else{if($.ig.util.isIE&&document.activeElement&&document.activeElement.id!==this.grid.id()&&document.activeElement.id!==this.grid.container().attr("id")&&!$(document.activeElement).is("td")&&$(document.activeElement).closest("table")[0].id!==this.grid.id()){return}if(!$.ig.util.isIE&&event.target.id!==this.grid.container().attr("id")){return}}if(this.options.activation===true){if(this.options.mode==="cell"){if(this.options.multipleSelection===true){if(this.activeCell()===null||this.activeCell()===undefined){this.selectCell(0,0)}else{if(this.options.skipChildren===false&&this._hc&&this._isMovingUpDown(event)){shouldNavigate=this._activateNextGrid(event);if(!shouldNavigate){this._navigateCell(event,false)}}else{this._navigateCell(event,false)}}}else{if(this.activeCell()===null&&this.grid._selectedCell===null||this.activeCell()===undefined&&this.grid._selectedCell===undefined){this.selectCell(0,0)}else{if(this.options.skipChildren===false&&this._hc&&this._isMovingUpDown(event)){shouldNavigate=this._activateNextGrid(event);if(!shouldNavigate){this._navigateCell(event,true)}}else{this._navigateCell(event,true)}}}}else{if(this.options.multipleSelection===true){if(this.activeRow()===null||this.activeRow()===undefined){this.selectRow(0)}else{if(this.options.skipChildren===false&&this._hc&&this._isMovingUpDown(event)){shouldNavigate=this._activateNextGrid(event);if(!shouldNavigate){this._navigateRow(event,false)}}else{this._navigateRow(event,false)}}}else{if(this.activeRow()===null&&this.grid._selectedRow===null||this.activeRow()===undefined&&this.grid._selectedRow===undefined){this.selectRow(0)}else{if(this.options.skipChildren===false&&this._hc&&this._isMovingUpDown(event)){shouldNavigate=this._activateNextGrid(event);if(!shouldNavigate){this._navigateRow(event,true)}}else{this._navigateRow(event,true)}}}}}},_isMovingUpDown:function(event){if(event.keyCode===$.ui.keyCode.UP||event.keyCode===$.ui.keyCode.DOWN){return true}return false},_navigateFocus:function(event){if($.ig.util.isFF&&event.originalEvent&&$(event.originalEvent.explicitOriginalTarget).is("th")){return}if(event.which!==1){$("#"+this.grid.element[0].id+"_displayContainer_a").unbind("focus",this._focusHandler);$("#"+this.grid.element[0].id+"_displayContainer_a").focus();$("#"+this.grid.element[0].id+"_displayContainer_a").bind({focus:this._focusHandler});event.stopPropagation();return}this._navigate(event)},_navigateCell:function(event,select){var nextX,nextY,x,y,currentCell=this.activeCell(),rowCount,newCell,length,newCellObject,noCancel=true,fixingDirection,sri=this.grid._startRowIndex,sci=this.grid._startColIndex,$newCell,hgrid,ptr,indexTmp=0,cKey,parent,cb,isFixedCell=false,v=this.grid.options.virtualization||this.grid.options.rowVirtualization,c,ret=false,rs,hasFixedColumns=this.grid.hasFixedColumns();c=v&&this.grid.options.virtualizationMode==="continuous";if(currentCell===null){return}if(hasFixedColumns){if(currentCell.element.closest("div").attr("data-fixed-container")!==undefined){isFixedCell=true;fixingDirection=currentCell.element.closest("div[data-fixing-direction]").attr("data-fixing-direction")}else{fixingDirection=this.grid.container().find("div[data-fixing-direction]").eq(0).attr("data-fixing-direction")}}if(sri===undefined||sri===null){sri=0}if(sci===undefined||sri===null){sci=0}if(v){x=currentCell.index-sci;y=currentCell.rowIndex-sri}else{x=currentCell.index;y=currentCell.rowIndex}y+=this.y_exclude_current;x+=this.x_exclude_current;if(!this._rowCount||!this._length){this._refresh()}rowCount=this._rowCount;length=this._length;if(hasFixedColumns){length-=this.grid._fixedColumns.length}if(this.x_exclude_current>0){length+=this.x_exclude_current}if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){nextX=x;nextY=y;if(event.ctrlKey&&this._isCellSelected(y+sri-this.y_exclude_current,x+sci-this.x_exclude_current)){noCancel=this._trigger(this.events.cellSelectionChanging,event,{cell:currentCell,selectedCells:this.grid._selectedCells,owner:this,manual:false});if(noCancel){this.deselectCell(y+sri-this.y_exclude_current,x+sci-this.x_exclude_current);this._trigger(this.events.cellSelectionChanged,event,{cell:currentCell,selectedCells:this.grid._selectedCells,owner:this,manual:false})}}else if(event.ctrlKey||!this._isCellSelected(y-this.y_exclude_current,x)){this._ctrlSelect=true;this._selectInternal(null,y-this.y_exclude_current,x-this.x_exclude_current);this._ctrlSelect=false}}else if(event.keyCode===$.ui.keyCode.DOWN){nextX=x;nextY=y+1;if(this._realActiveCell!==null&&this._realActiveCell!==undefined&&this._isContinuous&&this.options.multipleSelection===true&&this.grid._selectedCells.length>1&&!event.shiftKey&&!event.ctrlKey){nextX=this._realActiveCell.index-sci+this.x_exclude_current;nextY=this._realActiveCell.rowIndex+1-sri+this.y_exclude_current}if(nextY-this.y_exclude_current>rowCount-1-sri&&this.options.wrapAround===true&&!v){nextY=this.y_exclude_current}else if(nextY-this.y_exclude_current>rowCount-1-sri&&this.options.wrapAround===false){if(this._hc&&!this.options.skipChildren){this._activateNextGrid(null,true)}return}}else if(event.keyCode===$.ui.keyCode.UP){nextX=x;nextY=y-1;if(this._realActiveCell!==null&&this._realActiveCell!==undefined&&this._isContinuous&&this.options.multipleSelection===true&&this.grid._selectedCells.length>1&&!event.shiftKey&&!event.ctrlKey){nextX=this._realActiveCell.index-sci+this.x_exclude_current;nextY=this._realActiveCell.rowIndex-1-sri+this.y_exclude_current}if(!v){if(nextY-this.y_exclude_current<0&&this.options.wrapAround===true){nextY=rowCount-1}else if(nextY-this.y_exclude_current<0&&this.options.wrapAround===false){if(this._hc&&!this.options.skipChildren){this._activateNextGrid(null,false)}return}}}else if(event.keyCode===$.ui.keyCode.LEFT){nextX=x-1;nextY=y;if(hasFixedColumns){if(isFixedCell){if(nextX<0){isFixedCell=false;if(fixingDirection==="left"){nextX=length-1;nextY-=1}else{nextX=length-1}}}else{if(nextX<0){isFixedCell=true;nextX=this.grid._fixedColumns.length-1;if(fixingDirection==="right"){nextY-=1;if(nextY<0){nextY=rowCount-1}}}}}if(nextX-this.x_exclude_current<0){if(this._hc&&!this.options.skipChildren){ret=this._activateNextGrid(null,false,true)}if(ret){return}nextX=length-1;nextY=y-1}if(this._realActiveCell!==null&&this._realActiveCell!==undefined&&this.options.multipleSelection===true&&this.grid._selectedCells.length>1&&!event.shiftKey&&!event.ctrlKey){nextX=this._realActiveCell.index-1-sci+this.x_exclude_current;nextY=this._realActiveCell.rowIndex-sri+this.y_exclude_current}if(!v){if(nextY<0&&this.options.wrapAround===true){nextX=length-1;nextY=rowCount-1}else if(nextY<0&&this.options.wrapAround===false){if(this._hc&&!this.options.skipChildren){this._activateNextGrid(null,false)}return}}}else if(event.keyCode===$.ui.keyCode.RIGHT){nextX=x+1;nextY=y;if(hasFixedColumns){if(isFixedCell){if(nextX>=this.grid._fixedColumns.length){isFixedCell=false;if(fixingDirection==="right"){nextY+=1}nextX=0}}else{if(nextX>=length){if(fixingDirection==="left"){nextY+=1}isFixedCell=true;nextX=0}}}if(nextX>=length){if(this._hc&&!this.options.skipChildren){ret=this._activateNextGrid(null,true,true)}if(ret){return}nextX=0;nextY=y+1}if(this._realActiveCell!==null&&this._realActiveCell!==undefined&&this.options.multipleSelection===true&&this.grid._selectedCells.length>1&&!event.shiftKey&&!event.ctrlKey){nextX=this._realActiveCell.index+1-sci+this.x_exclude_current;nextY=this._realActiveCell.rowIndex-sri+this.y_exclude_current}if(!v){if(nextY>=rowCount+this.y_exclude_current&&this.options.wrapAround===true){nextX=0;nextY=0}else if(nextY>=rowCount+this.y_exclude_current&&this.options.wrapAround===false){if(this._hc&&!this.options.skipChildren){this._activateNextGrid(null,true)}return}}}else{return}if(v&&!c&&nextY>=this.grid._virtualRowCount){this._setScrollTop(this.grid.element.parent(),newCell,nextY>y?"down":"up",nextY-this.y_exclude_current);nextY=this.grid._virtualRowCount-1}else if(v&&!c&&nextY<0&&sri>0){this._setScrollTop(this.grid.element.parent(),newCell,"up",nextY-this.y_exclude_current);nextY=0}else if(v&&!c&&nextY<0){return}if(this.x_exclude_current>0&&this.grid.rowAt(nextY).cells.length<length){nextX=this.grid.rowAt(nextY).cells.length-1}newCell=this.grid.cellAt(nextX===0?this.x_exclude_current:nextX,nextY-this.y_exclude_current,isFixedCell);if(newCell===undefined&&(event.keyCode===$.ui.keyCode.DOWN||event.keyCode===$.ui.keyCode.UP)){if(event.keyCode===$.ui.keyCode.DOWN){nextY++}else if(event.keyCode===$.ui.keyCode.UP){nextY--}newCell=this.grid.cellAt(nextX,nextY,isFixedCell)}if(!v||c){this._setScrollTop(this.grid.element.parent(),newCell,nextY>=y?"down":"up",nextY-this.y_exclude_current);if(c){if(sri!==this.grid._startRowIndex){nextY=nextY+(nextY>=y?-1:1)*Math.abs(this.grid._startRowIndex-sri);sri=this.grid._startRowIndex}newCell=this.grid.cellAt(nextX,nextY,isFixedCell)}if(this.grid.options.width!==null&&this.grid.options.height!==null){parent=$("#"+this.grid.element[0].id+"_hscroller")}else if(this.grid.scrollContainer().length>0){parent=this.grid.scrollContainer()}else{parent=this.grid.element.parent()}this._setScrollLeft(parent,newCell,nextX>=x?"right":"left",nextX-this.x_exclude_current)}if(newCell===undefined||newCell.length>1){return}$newCell=$(newCell);if(this._hc&&($newCell.hasClass("ui-iggrid-expandbutton")||$newCell.hasClass("ui-iggrid-expandcolumn"))){if(event.keyCode===$.ui.keyCode.ENTER){ptr=$newCell.closest("tr");hgrid=$newCell.closest(".ui-iggrid-root").data("igHierarchicalGrid");hgrid.toggle(ptr)}}if($newCell.hasClass("ui-iggrid-rowselector-class")&&(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE)){rs=this.grid.element.data("igGridRowSelectors");cb=$newCell.find("span[data-role='checkbox']");if(rs&&cb.length>0){rs._handleCheck(cb)}}indexTmp=nextX-this.x_exclude_current;if(event.keyCode!==$.ui.keyCode.ENTER&&event.keyCode!==$.ui.keyCode.SPACE){$(currentCell.element).removeClass(this.css.activeCell);if(nextX===0){indexTmp=this.x_exclude_current}if(nextX>=this.grid.options.columns.length){cKey=this.grid.options.columns[this.grid.options.columns.length-1].key}else{cKey=this.grid.options.columns[nextX===0?0:indexTmp-(this._hc===true?1:0)].key}if(nextX<=0&&this._hc){cKey=null}if(v){newCellObject={element:$(newCell),index:nextX===0?sci:indexTmp+sci,rowIndex:nextY+sri-this.y_exclude_current,row:$(this.grid.rowAt(nextY)),columnKey:cKey}}else{newCellObject={element:$(newCell),index:nextX===0?0:indexTmp,rowIndex:nextY-this.y_exclude_current,row:$(this.grid.rowAt(nextY)),columnKey:cKey}}if(event.ctrlKey&&this.activeCell()&&(this.activeCell().index!==newCellObject.index||this.activeCell().rowIndex!==newCellObject.rowIndex)){this._activateCell(newCellObject,event)}if(!event.ctrlKey&&event.shiftKey&&this.options.multipleSelection===true){this._shiftCellSelection(newCellObject,false,true,currentCell,event)}else if(!event.ctrlKey){noCancel=this._trigger(this.events.cellSelectionChanging,event,{cell:newCellObject,selectedCells:this.grid._selectedCells,owner:this,manual:false});if(noCancel){this.clearSelection(true);this._selectInternal(null,nextY-this.y_exclude_current,nextX===0?0:indexTmp,isFixedCell);this._trigger(this.events.cellSelectionChanged,event,{cell:newCellObject,selectedCells:this.grid._selectedCells,owner:this,manual:false})}}}event.preventDefault();event.stopPropagation()},_navigateRow:function(event,select){var nextY,y,currentRow=this.activeRow(),rowCount,newRowObject,newRow,noCancel=true,v,c,sri=this.grid._startRowIndex;v=this.grid.options.virtualization||this.grid.options.rowVirtualization;c=v&&this.grid.options.virtualizationMode==="continuous";if(!currentRow){return}if(v){y=currentRow.index-sri}else{y=currentRow.index}y+=this.y_exclude_current;rowCount=this._rowCount;if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){nextY=y;if(event.ctrlKey&&this._isRowSelected(y-this.y_exclude_current)){noCancel=this._trigger(this.events.rowSelectionChanging,event,{row:currentRow,selectedRows:this.grid._selectedRows,owner:this,manual:false});if(noCancel){this.deselectRow(y-this.y_exclude_current);this._trigger(this.events.rowSelectionChanged,event,{row:currentRow,selectedRows:this.grid._selectedRows,owner:this,manual:false})}noCancel=true}else{this._ctrlSelect=true;this._selectInternal(null,y-this.y_exclude_current);this._ctrlSelect=false}}else if(event.keyCode===$.ui.keyCode.DOWN){nextY=y+1;if(this._realActiveRow!==null&&this._realActiveRow!==undefined&&this.options.multipleSelection===true&&this.grid._selectedRows.length>1&&!event.shiftKey&&!event.ctrlKey&&this._isContinuous){nextY=this._realActiveRow.index+1+this.y_exclude_current}if(!v){if(nextY-this.y_exclude_current>rowCount-1&&this.options.wrapAround===true){nextY=this.y_exclude_current}else if(nextY-this.y_exclude_current>rowCount-1&&this.options.wrapAround===false){if(this._hc&&!this.options.skipChildren){this._activateNextGrid(null,true)}return}}}else if(event.keyCode===$.ui.keyCode.UP){nextY=y-1;if(this._realActiveRow!==null&&this._realActiveRow!==undefined&&this.options.multipleSelection===true&&this.grid._selectedRows.length>1&&!event.shiftKey&&!event.ctrlKey&&this._isContinuous){nextY=this._realActiveRow.index-1+this.y_exclude_current}if(!v){if(nextY-this.y_exclude_current<0&&this.options.wrapAround===true){nextY=rowCount-1}else if(nextY-this.y_exclude_current<0&&this.options.wrapAround===false){if(this._hc&&!this.options.skipChildren){this._activateNextGrid(null,false)}return}}}else{return}event.preventDefault();event.stopPropagation();if(v&&!c&&nextY>=this.grid._virtualRowCount){nextY=this.grid._virtualRowCount-1;newRow=this.grid.rowAt(nextY-this.y_exclude_current);this._setScrollTop(this.grid.element.parent(),newRow,nextY>=y?"down":"up",nextY-this.y_exclude_current)}else if(v&&!c&&nextY<0&&sri>0){nextY=-1;newRow=this.grid.rowAt(nextY);this._setScrollTop(this.grid.element.parent(),newRow,"up",nextY-this.y_exclude_current)}else if(!(v&&!c&&nextY<0)){newRow=this.grid.rowAt(nextY)}else{return}if(newRow===undefined||newRow.length>1){return}while(newRow&&!$(newRow).is(":visible")&&nextY>0&&nextY<rowCount-1){newRow=this.grid.rowAt(event.keyCode===$.ui.keyCode.UP?--nextY:++nextY)}if(!v||c){this._setScrollTop(this.grid.element.parent(),newRow,nextY>=y?"down":"up",nextY-this.y_exclude_current);if(c){if(sri!==this.grid._startRowIndex){nextY=nextY+(nextY>=y?-1:1)*Math.abs(this.grid._startRowIndex-sri);sri=this.grid._startRowIndex}newRow=this.grid.rowAt(nextY)}}if(event.keyCode!==$.ui.keyCode.ENTER&&event.keyCode!==$.ui.keyCode.SPACE){$(currentRow.element).removeClass(this.css.activeRow);if(v){newRowObject={element:$(newRow),index:nextY+sri-this.y_exclude_current}}else{newRowObject={element:$(newRow),index:nextY-this.y_exclude_current}}if(event.ctrlKey&&this.activeRow()&&this.activeRow().index!==newRowObject.index){this._activateRow(newRowObject,event)}if(!event.ctrlKey&&event.shiftKey&&this.options.multipleSelection===true){this._shiftRowSelection(newRowObject,false,true,currentRow,event)}else if(!event.ctrlKey){noCancel=this._trigger(this.events.rowSelectionChanging,event,{row:newRowObject,selectedRows:this.grid._selectedRows,owner:this,manual:false});if(noCancel){this.clearSelection(true);this._selectInternal(null,nextY-this.y_exclude_current);this._trigger(this.events.rowSelectionChanged,event,{row:newRowObject,selectedRows:this.grid._selectedRows,owner:this,manual:false})}}}},_activateNextGrid:function(event,goingDown,levelDown){var target,nextTarget,currentGrid=this.grid.container(),reset=true;if(this.options.mode==="row"){target=this.activeRow().element}else{target=$(this.activeCell().element).closest("tr")}if(event!==null||levelDown===true){if(!event){event={keyCode:goingDown?$.ui.keyCode.DOWN:$.ui.keyCode.UP}}if(event.keyCode===$.ui.keyCode.UP){nextTarget=target.prev();if(nextTarget.attr("data-container")&&nextTarget.is(":visible")){nextTarget=nextTarget.find(".ui-iggrid-table").last()}else{return false}}else{nextTarget=target.next();if(nextTarget.attr("data-container")&&nextTarget.is(":visible")){nextTarget=nextTarget.find(".ui-iggrid-table").first()}else{return false}}}else{if(goingDown){if(currentGrid.next().length>0){nextTarget=currentGrid.nextAll(".ui-iggrid").first().children(".ui-iggrid-table")}else{nextTarget=currentGrid.closest("tr:[data-container=true]").next();reset=false}}else{if(currentGrid.prev().length>0){nextTarget=currentGrid.prevAll(".ui-iggrid").first().children(".ui-iggrid-table")}else{nextTarget=currentGrid.closest("tr:[data-container=true]").prev();reset=false}}}this.clearSelection(false,true);if(reset){if(this.options.mode==="row"){if(goingDown!==undefined&&!goingDown){nextTarget.igGridSelection("selectRow",nextTarget.find(".ui-iggrid-tablebody > tr").last().index())}else{nextTarget.igGridSelection("selectRow",0)}}else{if(goingDown!==undefined&&!goingDown){nextTarget.igGridSelection("selectCell",nextTarget.find(".ui-iggrid-tablebody > tr").last().index(),0)}else{nextTarget.igGridSelection("selectCell",0,0)}}}else if(nextTarget&&nextTarget.length>0){if(this.options.mode==="row"){nextTarget.closest(".ui-iggrid-table").igGridSelection("selectRow",nextTarget.index())}else{nextTarget.closest(".ui-iggrid-table").igGridSelection("selectCell",nextTarget.index(),0)}}nextTarget.closest(".ui-iggrid").focus();return true},_setScrollTop:function(parent,child,direction,index){var parentOffset=parent.offset(),childOffset=$(child).offset(),childh,isDown,isUp,v,c,st;if(!child){return}v=this.grid.options.virtualization||this.grid.options.rowVirtualization;c=v&&this.grid.options.virtualizationMode==="continuous";childh=v&&!c?parseInt(this.grid.options.avgRowHeight,10):$(child).outerHeight();if(!v||c){isDown=childOffset.top+childh+this.grid._scrollbarWidth()>parentOffset.top+$(parent).outerHeight();isUp=childOffset.top<parentOffset.top||c&&index<0}else{isDown=childh*(index+1)>=parseInt(this.grid.options.height,10);isUp=index<0}if(index===0){parent[0].scrollTop=0}else if(direction==="down"){if(isDown){if(c||!v){st=parent[0].scrollTop+childOffset.top+this.grid._scrollbarWidth()-(parentOffset.top+parent.outerHeight())+$(child).outerHeight();if(c){this.grid._onVirtualVerticalScroll({},childh,direction)}else{parent[0].scrollTop=st}}else{this._scrollVmanual(true)}}}else{if(isUp){if(c||!v){st=parent[0].scrollTop-$(child).outerHeight();if(c){this.grid._onVirtualVerticalScroll({},childh,direction)}else{parent[0].scrollTop=st}}else{this._scrollVmanual(false)}}}},_scrollVmanual:function(down){var sc=$("#"+this.grid.element[0].id+"_scrollContainer"),h=parseInt(this.grid.options.avgRowHeight,10);this.grid._ignoreScroll=true;if(down){sc.scrollTop(sc.scrollTop()+h)}else{sc.scrollTop(sc.scrollTop()-h)}this.grid._onVirtualVerticalScroll();this.grid._ignoreScroll=false},_setScrollLeft:function(parent,child,direction,index){var parentOffset=parent.offset(),childOffset=$(child).offset();if(!child){return}if(index===0){parent[0].scrollLeft=0}else if(direction==="right"){if(childOffset.left+$(child).outerWidth()>parentOffset.left+$(parent).outerWidth()){parent[0].scrollLeft=parent[0].scrollLeft+childOffset.left-(parentOffset.left+parent.outerWidth())+$(child).outerWidth()}}else{if(childOffset.left<parentOffset.left){parent[0].scrollLeft=parent[0].scrollLeft-$(child).outerWidth()}}},_isRowSelected:function(y){var i;for(i=0;i<this.grid._selectedRows.length;i++){if(this.grid._selectedRows[i].index===y){return true}}return false},_isCellSelected:function(y,x){var i;for(i=0;i<this.grid._selectedCells.length;i++){if(this.grid._selectedCells[i].index===x&&this.grid._selectedCells[i].rowIndex===y){return true}}return false},_rs:function(e,args){var dom=args.dom,i=0,j=0,ac=this.activeCell(),ar=this.activeRow(),rows=this.grid.rows(),sri=this.grid._startRowIndex||0,sci=this.grid._startColIndex,dataSkip=this._firstRow?this._firstRow.find("th,[data-skip='true']").length:0;if(this.grid.id()!==args.owner.id()){return}if(this.grid.options.virtualization===true&&this.grid.options.virtualizationMode==="continuous"){this._registerTbodyEvents()}if(this.grid._selectedCell){this.grid._selectedCell.element=rows.eq(this.grid._selectedCell.rowIndex-sri).children("td").eq(this.grid._selectedCell.index-dataSkip);this.grid._selectedCell.row=this.grid._selectedCell.element.parent("tr")}if(this.grid._selectedRow){this.grid._selectedRow.element=rows.eq(this.grid._selectedRow.index-sri)}if(this.grid._activeRow){this.grid._activeRow.element=rows.eq(this.grid._activeRow.index-sri)}if(this.grid._activeCell){this.grid._activeCell.element=rows.eq(this.grid._activeCell.rowIndex-sri).children("td").eq(this.grid._activeCell.index);this.grid._activeCell.row=this.grid._activeCell.element.parent("tr")}if(this.grid._selectedRows&&this.grid._selectedRows.length>0){for(i=0;i<this.grid._selectedRows.length;i++){this.grid._selectedRows[i].element=rows.eq(this.grid._selectedRows[i].index-sri)}}if(this.grid._selectedCells&&this.grid._selectedCells.length>0){for(i=0;i<this.grid._selectedCells.length;i++){this.grid._selectedCells[i].element=rows.eq(this.grid._selectedCells[i].rowIndex-sri).children("td").eq(this.grid._selectedCells[i].index-dataSkip);this.grid._selectedCells[i].row=this.grid._selectedCells[i].element.parent("tr")}}ac=this.activeCell();ar=this.activeRow();for(i=0;i<dom.length;i++){for(j=0;j<dom[i].length;j++){if(this.options.mode==="cell"){if(this.options.multipleSelection){if(this._isCellSelected(i+sri,j+sci+dataSkip)){$(dom[i][j]).addClass(this.css.selectedCell)}}else if(this.grid._selectedCell){if(i+sri===this.grid._selectedCell.rowIndex&&j+sci+dataSkip===this.grid._selectedCell.index){$(dom[i][j]).addClass(this.css.selectedCell)}}}else{if(this.options.multipleSelection){if(this._isRowSelected(i+sri)){$(dom[i][j]).addClass(this.css.selectedRow)}}else if(this.grid._selectedRow){if(i+sri===this.grid._selectedRow.index){$(dom[i][j]).addClass(this.css.selectedRow)}}}}}if(ac){if(ac.rowIndex-sri>=0&&ac.rowIndex-sri<dom.length&&ac.index-sci-dataSkip>0&&ac.index-sci-dataSkip<dom[ac.rowIndex-sri].length){$(dom[ac.rowIndex-sri][ac.index-sci-dataSkip]).addClass(this.css.activeCell)}}if(ar){if(ar.index-sri>=0&&ar.index-sri<dom.length){$(dom[ar.index-sri]).first().closest("tr").addClass(this.css.activeRow)}}},selectCell:function(row,col,isFixed){var rv=this.grid.options.virtualization||this.grid.options.rowVirtualization,cv=this.grid.options.virtualization||this.grid.options.columnVirtualization,sri=this.grid._startRowIndex||0,sci=this.grid._startColIndex||0;if(rv&&(row>=sri+this.grid._virtualRowCount||row<sri)||cv&&(col>=sci+this.grid._virtualColumnCount||col<sci)){if(this.options.multipleSelection===true){this.grid._selectedCells.push({index:col,rowIndex:row});this.grid._selectedCell=null}else{this.clearSelection();this._activateCell({index:col,rowIndex:row},null,false)}this.grid._activeCell={index:col,rowIndex:row}}else{this._selectInternal(null,row,col,isFixed)}},deselectCell:function(row,col){var i;if(this.options.multipleSelection===true){for(i=0;i<this.selectedCells().length;i++){if(this.selectedCells()[i].index===col&&this.selectedCells()[i].rowIndex===row){this._deselectCell(this.selectedCells()[i]);$.ig.removeFromArray(this.selectedCells(),i);this.grid._selectedCell=null;break}}}else{if(this.selectedCell()!==null&&this.selectedCell()!==undefined){this._deselectCell(this.selectedCell());this.grid._selectedCell=null}}this._trigger("internalcellselectionchanged",null,{cell:null,selectedCells:this.grid._selectedCells,owner:this})},selectRow:function(index){var v=this.grid.options.virtualization||this.grid.options.rowVirtualization,sri=this.grid._startRowIndex||0;if(v&&(index>=sri+this.grid._virtualRowCount||index<sri)){if(this.options.multipleSelection===true){this.grid._selectedRows.push({index:index});this.grid._selectedRow=null}else{this.clearSelection();this.grid._selectedRow={index:index}}this._activateRow({index:index},null,false)}else{this._selectInternal(null,index)}},deselectRow:function(index){var i;if(this.options.multipleSelection===true){for(i=0;i<this.selectedRows().length;i++){if(this.selectedRows()[i].index===index||this.selectedRows()[i].element&&this.selectedRows()[i].element.index()===index){this._deselectRow(this.selectedRows()[i]);$.ig.removeFromArray(this.selectedRows(),i);this.grid._selectedRow=null;break}}}else{if(this.selectedRow()!==null&&this.selectedRow()!==undefined){this._deselectRow(this.selectedRow());this.grid._selectedRow=null}}this._trigger("internalrowselectionchanged",null,{row:null,selectedRows:this.grid._selectedRows,owner:this})},_deselectRow:function(row){var el;if(row.element&&row.element instanceof jQuery){el=row.element}else{el=$(this.grid._virtualDom[row.index])}el.removeClass(this.css.selectedRow);el.children().removeClass(this.css.selectedCell)},_deselectCell:function(cell){var el;if(cell.element&&cell.element instanceof jQuery){el=cell.element}else{el=$(this.grid._virtualDom[cell.rowIndex][cell.index])}el.removeClass(this.css.selectedCell)},_activateCell:function(cell,event,isFixed){var noCancel=true,v=this.grid.options.virtualization||this.grid.options.rowVirtualization,sri=this.grid._startRowIndex||0;noCancel=this._trigger(this.events.activeCellChanging,event,{cell:cell,owner:this});if(noCancel){if(this.activeCell()){if(v){$(this.grid.cellAt(this.grid._activeCell.index,this.grid._activeCell.rowIndex-sri)).removeClass(this.css.activeCell)}else{$(this.activeCell().element).removeClass(this.css.activeCell)}}if(this.activeRow()){if(v){$(this.grid.rowAt(this.grid._activeRow.index-sri)).removeClass(this.css.activeRow)}else{$(this.activeRow().element).removeClass(this.css.activeRow)}this.activeRow(null)}this.activeCell(cell);$(this.activeCell().element).addClass(this.css.activeCell);this._trigger(this.events.activeCellChanged,event,{cell:cell,owner:this})}},_activateRow:function(row,event,fixedRow){var noCancel=true,v=this.grid.options.virtualization||this.grid.options.rowVirtualization,sri=this.grid._startRowIndex||0;noCancel=this._trigger(this.events.activeRowChanging,event,{row:row,owner:this});if(noCancel){if(this.activeRow()){if(v){$(this.grid.rowAt(this.grid._activeRow.index-sri)).removeClass(this.css.activeRow)}else{$(this.activeRow().element).removeClass(this.css.activeRow)}}if(this.activeFixedRow()){$(this.activeFixedRow().element).removeClass(this.css.activeRow)}if(this.activeCell()){if(v){$(this.grid.cellAt(this.grid._activeCell.index,this.grid._activeCell.rowIndex-sri)).removeClass(this.css.activeCell)}else{$(this.activeCell().element).removeClass(this.css.activeCell)}this.activeCell(null)}this.activeRow(row);if(fixedRow){$(fixedRow.element).addClass(this.css.activeRow);this.activeFixedRow(fixedRow)}$(this.activeRow().element).addClass(this.css.activeRow);this._trigger(this.events.activeRowChanged,event,{row:row,owner:this})}},selectedCells:function(){return this.grid._selectedCells},selectedRows:function(){return this.grid._selectedRows},selectedCell:function(){return this.grid._selectedCell},selectedRow:function(){return this.grid._selectedRow
},activeCell:function(cell){if(cell!==undefined){this.grid._activeCell=cell}else{return this.grid._activeCell}},activeRow:function(row){if(row!==undefined){this.grid._activeRow=row}else{return this.grid._activeRow}},activeFixedRow:function(row){if(row!==undefined){this.grid._activeFixedRow=row}else{return this.grid._activeFixedRow}},clearSelection:function(internal,uiDirty){var i,v=this.grid.options.virtualization||this.grid.options.rowVirtualization,hasFixedColumns=this.grid.hasFixedColumns();for(i=0;i<this.grid._selectedCells.length;i++){if(!v){this.grid._selectedCells[i].element.removeClass(this.css.selectedCell)}else if(v&&this.grid._selectedCells[i].rowIndex-this.grid._startRowIndex>=0){$(this.grid.cellAt(this.grid._selectedCells[i].index,this.grid._selectedCells[i].rowIndex-this.grid._startRowIndex)).removeClass(this.css.selectedCell)}}if(hasFixedColumns){for(i=0;i<this.grid._selectedFixedCells.length;i++){if(!v||v&&this.grid._selectedFixedCells[i].rowIndex-this.grid._startRowIndex>=0){this.grid._selectedFixedCells[i].element.removeClass(this.css.selectedCell)}}this.grid._selectedFixedCells=[];for(i=0;i<this.grid._selectedFixedRows.length;i++){if(!v||v&&this.grid._selectedFixedRows[i].index-this.grid._startRowIndex>=0){$(this.grid._selectedFixedRows[i].element.children()).removeClass(this.css.selectedCell)}}this.grid._selectedFixedRows=[];if(this.grid._selectedFixedRow!==null&&this.grid._selectedFixedRow!==undefined){if(v&&this.grid._selectedFixedRow.index-this.grid._startRowIndex>=0){$(this.grid.rowAt(this.grid._selectedFixedRow.index-this.grid._startRowIndex)).children().removeClass(this.css.selectedCell)}else{$(this.grid._selectedFixedRow.element.children()).removeClass(this.css.selectedCell)}this.grid._selectedFixedRow=null}if(this.grid._selectedFixedCell!==null&&this.grid._selectedFixedCell!==undefined){if(v&&this.grid._selectedFixedCell.rowIndex-this.grid._startRowIndex>=0){$(this.grid.cellAt(this.grid._selectedFixedCell.index,this.grid._selectedCell.rowIndex-this.grid._startRowIndex)).removeClass(this.css.selectedCell)}else{this.grid._selectedFixedCell.element.removeClass(this.css.selectedCell)}this.grid._selectedFixedCell=null}}this.grid._selectedCells=[];for(i=0;i<this.grid._selectedRows.length;i++){if(!v){$(this.grid._selectedRows[i].element.children()).removeClass(this.css.selectedCell)}else if(v&&this.grid._selectedRows[i].index-this.grid._startRowIndex>=0){$(this.grid.rowAt(this.grid._selectedRows[i].index-this.grid._startRowIndex)).children().removeClass(this.css.selectedCell)}}this.grid._selectedRows=[];if(this.grid._selectedRow!==null&&this.grid._selectedRow!==undefined){if(v&&this.grid._selectedRow.index-this.grid._startRowIndex>=0){$(this.grid.rowAt(this.grid._selectedRow.index-this.grid._startRowIndex)).children().removeClass(this.css.selectedCell)}else{$(this.grid._selectedRow.element.children()).removeClass(this.css.selectedCell)}this.grid._selectedRow=null}if(this.grid._selectedCell!==null&&this.grid._selectedCell!==undefined){if(v&&this.grid._selectedCell.rowIndex-this.grid._startRowIndex>=0){$(this.grid.cellAt(this.grid._selectedCell.index,this.grid._selectedCell.rowIndex-this.grid._startRowIndex)).removeClass(this.css.selectedCell)}else{this.grid._selectedCell.element.removeClass(this.css.selectedCell)}this.grid._selectedCell=null}if(!internal){if(this.activeCell()){if(v){$(this.grid.cellAt(this.grid._activeCell.index,this.grid._activeCell.rowIndex-this.grid._startRowIndex)).removeClass(this.css.activeCell)}else{this.activeCell().element.removeClass(this.css.activeCell)}this.activeCell(null)}if(this._realActiveCell){this._realActiveCell.element.removeClass(this.css.activeCell);this._realActiveCell=null}if(this._realActiveRow){this._realActiveRow.element.removeClass(this.css.activeRow);this._realActiveRow=null}if(this.activeRow()){if(v){$(this.grid.rowAt(this.grid._activeRow.index-this.grid._startRowIndex)).removeClass(this.css.activeRow)}else{this.activeRow().element.removeClass(this.css.activeRow)}this.activeRow(null)}}if(uiDirty){this.activeCell(null);this.activeRow(null)}this._trigger("selectioncleared",this,{owner:this.grid,uiDirty:uiDirty})},clearSelectionAllChildren:function(internal,uiDirty){var children=this.grid.children(),i,sel;for(i=0;i<children.length;i++){sel=$(children[i]).data("igGridSelection");if(sel){sel.clearSelection(internal,uiDirty)}}},clearSelectionAll:function(internal,uiDirty){this.clearSelection(internal,uiDirty);this.clearSelectionAllOthers(internal,uiDirty)},clearSelectionAllOthers:function(internal,uiDirty){var hgrid,children,i,sel,rootSel;if(!this._hgrid){if(this.grid.element.hasClass("ui-iggrid-root")){hgrid=this.grid.element.data("igHierarchicalGrid")}else{hgrid=this.grid.element.closest(".ui-iggrid-root").data("igHierarchicalGrid")}}else{hgrid=this._hgrid.data("igHierarchicalGrid")}if(hgrid){children=hgrid.allChildren();for(i=0;i<children.length;i++){sel=$(children[i]).data("igGridSelection");if(sel&&$(children[i]).attr("id")!==this.grid.element.attr("id")){sel.clearSelection(internal,uiDirty)}}}if(hgrid.element.attr("id")!==this.grid.element.attr("id")&&hgrid.element.is("table")||hgrid.element.is("div")&&$("#"+hgrid.element.attr("id")+"_table").attr("id")!==this.grid.element.attr("id")){if(!hgrid.element.is("table")){rootSel=$("#"+hgrid.element.attr("id")+"_table").data("igGridSelection")}else{rootSel=hgrid.element.data("igGridSelection")}if(rootSel){rootSel.clearSelection(internal,uiDirty)}}},_excludeRows:function(element){return this.grid.element.children("tbody").children("tr:[data-container=true]").length},_excludeRowsLt:function(element){var index=element.index();return this.grid.element.children("tbody").children("tr:lt("+index+")").filter("[data-container=true]").length},_calcExtraCells:function(){return this.grid.element.find("tbody > tr > td[data-skip=true]").first().parent().find("[data-skip=true]").length},_columnsCollectionModified:function(evt,ui){if(ui.owner.id()===this.grid.id()){this._registerTbodyEvents()}},_columnFixed:function(args){var i,rows=[],cells=[];if(args.isFixed){if(this.grid._fixedColumns.length===1){this._registerFixedTbodyEvents();if(this.options.mode==="row"){if(this.grid.selectedRows().length>0){rows=this.grid.selectedRows().clone()}else if(this.grid.selectedRow()!==null){rows=[this.grid.selectedRow()]}if(rows.length>0){this.clearSelection(false);for(i=0;i<rows.length;i++){this.selectRow(rows[i].index)}}}}}if(this.grid.selectedCells().length>0){cells=this.grid.selectedCells()}else if(this.grid.selectedCell()!==null){cells=[this.grid.selectedCell()]}for(i=0;i<cells.length;i++){if(this.grid.columnByKey(cells[i].columnKey).fixed!==cells[i].isFixed){cells[i].isFixed=!cells[i].isFixed}}},destroy:function(){this.clearSelection();this._unregisterEvents();$.Widget.prototype.destroy.call(this);return this},_onUIDirty:function(e,args){if(args.owner===this||args.owner.element[0].id!==this.element[0].id){return}if(!this.grid.options.virtualization&&!this.grid.options.rowVirtualization){this._rowCount=this.grid.dataSource.dataView().length}if(this._groupBy){this._rowCount+=this.grid.element.children("tbody").children("tr[data-grouprow=true]").length}this.clearSelection(true,true)},_injectGrid:function(gridInstance){var i;this.grid=gridInstance;this.activeCell(null);this.grid._selectedCell=null;this.grid._selectedRow=null;this.activeRow(null);this.grid._selectedCells=[];this.grid._selectedRows=[];this.grid._selectedFixedCells=[];this.grid._selectedFixedRows=[];for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="Selection"){this.grid.options.features[i].inherit=true}}if(this._virtualRecordsRendererHandler!==null&&this._virtualRecordsRendererHandler!==undefined){this.grid.element.unbind("iggridvirtualrecordsrender",this._virtualRecordsRendererHandler)}this._virtualRecordsRendererHandler=$.proxy(this._rs,this);this.grid.element.bind("iggridvirtualrecordsrender",this._virtualRecordsRendererHandler);if(this._uiDirtyHandler!==null&&this._uiDirtyHandler!==undefined){this.grid.element.unbind("iggriduisoftdirty",this._uiDirtyHandler)}this._uiDirtyHandler=$.proxy(this._onUIDirty,this);this.grid.element.bind("iggriduisoftdirty",this._uiDirtyHandler);if(this._dataRenderingHandler!==null&&this._dataRenderingHandler!==undefined){this.grid.element.unbind("iggriddatarendering",this._dataRenderingHandler)}this._dataRenderingHandler=$.proxy(this._dataRendering,this);this.grid.element.bind("iggriddatarendering",this._dataRenderingHandler);if(this._rowExpandedHandler!==null&&this._rowExpandedHandler!==undefined){this.grid.element.unbind("ighierarchicalgridrowexpanded",this._rowExpandedHandler)}this._rowExpandedHandler=$.proxy(this._rowExpanded,this);this.grid.element.bind("ighierarchicalgridrowexpanded",this._rowExpandedHandler);if(this._columnsCollectionModifiedHandler!==null&&this._columnsCollectionModifiedHandler!==undefined){this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)}this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this._hdirty=true}});$.extend($.ui.igGridSelection,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Sorting 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridSorting",{css:{sortableColumnHeader:"ui-iggrid-sortableheader ui-state-default",sortableColumnHeaderActive:"ui-iggrid-sortableheaderactive ui-state-active",sortableColumnHeaderHover:"ui-iggrid-sortableheaderhover ui-state-hover",sortableColumnHeaderFocus:"ui-iggrid-sortableheaderfocus ui-state-focus",ascendingColumnHeader:"ui-iggrid-colheaderasc",descendingColumnHeader:"ui-iggrid-colheaderdesc",ascendingColumn:"ui-iggrid-colasc ui-state-highlight",descendingColumn:"ui-iggrid-coldesc ui-state-highlight",sortIndicator:"ui-iggrid-colindicator",sortIndicatorAscending:"ui-iggrid-colindicator-asc ui-icon ui-icon-arrowthick-1-n",sortIndicatorDescending:"ui-iggrid-colindicator-desc ui-icon ui-icon-arrowthick-1-s",dialogSortedColumns:"ui-iggrid-sorting-dialog-sortedcolumns",dialogUnsortedColumns:"ui-iggrid-sorting-dialog-unsortedcolumns",dialogUnsortedColumnsSortByButton:"ui-iggrid-sorting-dialog-unsortedcolumns-sortbybutton",dialogAsdDescButton:"ui-iggrid-sorting-dialog-ascdescbutton",modalDialogSortByColumn:"ui-iggrid-sorting-dialog-sortbybutton",dialogSortedColumnsItem:"ui-widget-content",dialogUnsortedColumnsItem:"ui-widget-content",dialogButtonAsc:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",dialogButtonAscIcon:"ui-button-icon-primary ui-icon ui-icon-arrowthick-1-n",dialogButtonDesc:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",dialogButtonDescIcon:"ui-button-icon-primary ui-icon ui-icon-arrowthick-1-s",dialogButtonUnsort:"ui-iggrid-sorting-dialog-sortbybuttons ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-igbutton ui-widget-content ui-igbutton-remove",dialogButtonUnsortContainer:"ui-button-icon-primary ui-icon ui-icon-circle-close",dialogSortedColumnTextContainer:"ui-iggrid-dialog-text",dialogItemText:"ui-iggrid-dialog-text",dialogButtonsHover:"ui-state-hover",featureChooserModalDialogIcon:"ui-icon ui-icon-newwin"},options:{type:null,caseSensitive:false,applySortedColumnCss:true,sortUrlKey:null,sortUrlKeyAscValue:null,sortUrlKeyDescValue:null,mode:"single",customSortFunction:null,firstSortDirection:"ascending",sortedColumnTooltip:$.ig.GridSorting.locale.sortedColumnTooltipFormat,modalDialogSortOnClick:false,modalDialogSortByButtonText:$.ig.GridSorting.locale.modalDialogSortByButtonText,modalDialogResetButtonLabel:$.ig.GridSorting.locale.modalDialogResetButton,modalDialogCaptionButtonDesc:$.ig.GridSorting.locale.modalDialogCaptionButtonDesc,modalDialogCaptionButtonAsc:$.ig.GridSorting.locale.modalDialogCaptionButtonAsc,modalDialogCaptionButtonUnsort:$.ig.GridSorting.locale.modalDialogCaptionButtonUnsort,modalDialogWidth:350,modalDialogHeight:"",modalDialogAnimationDuration:200,featureChooserText:$.ig.GridSorting.locale.featureChooserText,unsortedColumnTooltip:$.ig.GridSorting.locale.unsortedColumnTooltip,columnSettings:[{columnKey:null,columnIndex:null,firstSortDirection:null,currentSortDirection:null,allowSorting:true}],modalDialogCaptionText:$.ig.GridSorting.locale.modalDialogCaptionText,modalDialogButtonApplyText:$.ig.GridSorting.locale.modalDialogButtonApplyText,modalDialogButtonCancelText:$.ig.GridSorting.locale.modalDialogButtonCancelText,sortingDialogContainment:"owner"},renderInFeatureChooser:true,events:{columnSorting:"columnSorting",columnSorted:"columnSorted",modalDialogOpening:"modalDialogOpening",modalDialogOpened:"modalDialogOpened",modalDialogMoving:"modalDialogMoving",modalDialogClosing:"modalDialogClosing",modalDialogClosed:"modalDialogClosed",modalDialogContentsRendering:"modalDialogContentsRendering",modalDialogContentsRendered:"modalDialogContentsRendered",modalDialogSortingChanged:"modalDialogSortingChanged",modalDialogButtonUnsortClick:"modalDialogButtonUnsortClick",modalDialogSortClick:"modalDialogSortClick",modalDialogButtonApplyClick:"modalDialogButtonApplyClick",modalDialogButtonResetClick:"modalDialogButtonResetClick"},_createWidget:function(options,element){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var self=this;this._headers=[];this._clickHandler=function(event){var th,id;id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}th=$(event.currentTarget).closest("th");if(th.attr("data-skip")!=="true"&&(self.grid._isMultiColumnGrid!==true||th.attr("data-isheadercell")==="true")){th.find("a").focus();self._handleSort(event);if($("#"+self.grid.id()+"_hscroller").scrollLeft()>0&&self.grid.options.fixedHeaders===true){self.grid.headersTable().parent().scrollLeft($("#"+self.grid.id()+"_hscroller").scrollLeft())}}};this._dragStartHandler=function(event){var id,noCancel=true;noCancel=self.grid._trigger("headercelldragcancel",event,{});if(noCancel){id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}event.stopPropagation();event.preventDefault()}else{return true}return false};this._mouseOverHandler=function(event){var id,$target=$(event.currentTarget),cs;id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}cs=self._getColSettingFromElement(event.currentTarget);if(cs&&cs.allowSorting!==false){$target.addClass(self.css.sortableColumnHeaderHover)}};this._mouseOutHandler=function(event){var id;id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}$(event.currentTarget).removeClass(self.css.sortableColumnHeaderHover)};$("#"+this.element[0].id).delegate("thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler});$("#"+this.element[0].id+" thead th").bind("dragstart",this._dragStartHandler);$("#"+this.element[0].id+"_headers thead th").bind("dragstart",this._dragStartHandler);$(document).delegate("#"+this.element[0].id+"_headers thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler});this._keyDownHandler=function(event){self._handleSortKb(event)};this._focusHandler=function(event){self._handleFocusKb(event)};this._blurHandler=function(event){self._handleBlurKb(event)};$("#"+this.element[0].id).delegate("thead th a:not([th-remove-focus])",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler});$(document).delegate("#"+this.element[0].id+"_headers thead th a:not([th-remove-focus])",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler})},_setOption:function(key,value){var i,col,featureChooserInstance,modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"type":throw new Error($.ig.Grid.locale.optionChangeNotSupported+" "+key);case"caseSensitive":this.grid.dataSource.settings.sorting.caseSensitive=this.options.caseSensitive;break;case"modalDialogSortOnClick":modalDialog.remove();this._renderMultipleSortingDialog();break;case"modalDialogAnimationDuration":modalDialog.igGridModalDialog("option","animationDuration",value);break;case"modalDialogWidth":modalDialog.igGridModalDialog("option","modalDialogWidth",value);break;case"modalDialogHeight":modalDialog.igGridModalDialog("option","modalDialogHeight",value);break;case"modalDialogButtonApplyText":modalDialog.igGridModalDialog("option","buttonApplyText",value);break;case"modalDialogButtonCancelText":modalDialog.igGridModalDialog("option","buttonCancelText",value);break;case"modalDialogCaptionText":modalDialog.igGridModalDialog("option","modalDialogCaptionText",value);break;case"featureChooserText":featureChooserInstance=this.grid.element.data("igGridFeatureChooser");if(featureChooserInstance){for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i].key;featureChooserInstance._setListItemText(col,"Sorting",value)}}break;default:break}},_getColSettingFromElement:function(e){var index,cs=this.options.columnSettings,$e=$(e);index=parseInt($e.data("columnIndex"),10);return cs[index]},_handleSortKb:function(event){var index=$(event.currentTarget).closest("th").data("columnIndex"),id;id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(this.grid.element.attr("id")!==id){return}if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){if(this._currentActiveHeader){this._currentActiveHeader.removeClass(this.css.sortableColumnHeaderActive)}$(event.currentTarget).closest("th").addClass(this.css.sortableColumnHeaderActive);this._currentActiveHeader=$(event.currentTarget).closest("th");if(event.shiftKey){this.unsortColumn(index,$(event.currentTarget).closest("th"))}else{this.sortColumn(index,null,$(event.currentTarget).closest("th"));if($.ig.util.isIE){$(event.currentTarget).focus()}}event.stopPropagation();event.preventDefault()}},_handleFocusKb:function(event){if(this._resizing&&this._resizing._resizing){return}var id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(this.grid.element.attr("id")!==id){return}$(event.currentTarget).closest("th").addClass(this.css.sortableColumnHeaderFocus)},_handleBlurKb:function(event){var id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(this.grid.element.attr("id")!==id){return}$(event.currentTarget).closest("th").removeClass(this.css.sortableColumnHeaderFocus)},_handleSort:function(event){if(this._resizing&&this._resizing._resizing){this._resizing._resizing=false;return}var index=$(event.currentTarget).closest("th").data("columnIndex"),isShiftClicked=false;if(this._currentActiveHeader){this._currentActiveHeader.removeClass(this.css.sortableColumnHeaderActive)}isShiftClicked=event.shiftKey;$(event.currentTarget).addClass(this.css.sortableColumnHeaderActive);this._currentActiveHeader=$(event.currentTarget).closest("th");if(isShiftClicked){this._currentHeader=$(event.currentTarget).closest("th");this.unsortColumn(index,$(event.currentTarget).closest("th"))}else{this.sortColumn(index,null,$(event.currentTarget))}event.stopPropagation();event.preventDefault()},_initLoadingIndicator:function(){this._loadingIndicator=this.grid.container().length>0?this.grid.container().igLoading().data("igLoading").indicator():this.grid.element.igLoading().data("igLoading").indicator()},_getHeaderCellByIdentifier:function(identifier){var $headerCell,colKey;if($.type(identifier)==="number"){colKey=this.grid.options.columns[identifier].key}else{colKey=identifier}$headerCell=$("#"+this.grid.element[0].id+"_"+colKey);return $headerCell},sortColumn:function(index,direction,header){var colKey,expr,noCancel=true,s,i,visualIndex,groupby,reset=true,se,newSE=[],apiCall=header===null||header===undefined,addSE=false,isHidden=false;this._currentIdentifier=index;if($.type(index)==="number"){colKey=this.grid.options.columns[index].key;if(this.grid.options.columns[index].hidden){isHidden=true}}else{colKey=index;if(header===null||header===undefined){header=$("#"+this.grid.element[0].id+"_"+colKey)}index=header.data("columnIndex");if(index===undefined){isHidden=true}}expr=this.grid.dataSource.settings.sorting.expressions;s=this._findColumnSetting(colKey);if(this.grid.options.virtualizationMode==="fixed"&&(this.grid.options.virtualization===true||this.grid.options.columnVirtualization===true)){visualIndex=index-this.grid._startColIndex}else{visualIndex=index}if(apiCall&&this._currentActiveHeader){this._currentActiveHeader.removeClass(this.css.sortableColumnHeaderActive)}if(header===null||header===undefined){visualIndex+=this.grid.headersTable().children("thead").children("tr").children("th[data-skip=true]").length;if(colKey){header=$("#"+this.grid.element[0].id+"_"+colKey)}else{header=this.grid.headersTable().children("thead").children("tr").children("th:nth-child("+(visualIndex+1)+")")}apiCall=true}if(s&&s.allowSorting===false){return}if(direction!==null&&direction!==undefined){s.currentSortDirection=direction}else{if(s.currentSortDirection!==undefined&&s.currentSortDirection!==null&&!s.currentSortDirection.startsWith("asc")&&!s.currentSortDirection.startsWith("desc")||s.currentSortDirection===undefined||s.currentSortDirection===null){s.currentSortDirection=s.firstSortDirection===undefined?this.options.firstSortDirection:s.firstSortDirection}else{s.currentSortDirection=s.currentSortDirection!==undefined&&s.currentSortDirection!==null&&s.currentSortDirection.indexOf("asc")!==-1?"descending":"ascending"}}if(!apiCall){noCancel=this._trigger(this.events.columnSorting,null,{columnKey:colKey,direction:s.currentSortDirection,owner:this})}if(noCancel){this._loadingIndicator.show();header.attr("title",s.currentSortDirection.startsWith("asc")?this.options.sortedColumnTooltip.replace("${direction}",$.ig.GridSorting.locale.ascending):this.options.sortedColumnTooltip.replace("${direction}",$.ig.GridSorting.locale.descending));if(this.options.mode==="single"){if(isHidden){this._clearSortStates(header,-1);for(i=0;i<this.grid.options.columns.length;i++){if(this.options.columnSettings[i]&&this.options.columnSettings[i].allowSorting!==false&&this.options.columnSettings[i].columnKey!==colKey){this._clearSortState(header,this.options.columnSettings[i].columnIndex)}}}else{this._clearSortStates(header,index)}for(i=0;this.grid.options.features&&i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="GroupBy"){groupby=this.grid.element.data("igGridGroupBy");if(groupby&&groupby.options.groupedColumns&&groupby.options.groupedColumns.length>0){reset=false}}}if(isHidden&&direction!==null&&direction!==undefined){s.currentSortDirection=direction}if(reset){this.grid.dataSource.settings.sorting.expressions=[{fieldName:colKey,dir:s.currentSortDirection.startsWith("asc")?"asc":"desc"}]}else{se=this.grid.dataSource.settings.sorting.expressions;addSE=true;for(i=0;i<se.length;i++){if(se[i].isGroupBy===true){if(se[i].fieldName===colKey){addSE=false}newSE.push(se[i])}}if(addSE){newSE.push({fieldName:colKey,dir:s.currentSortDirection.startsWith("asc")?"asc":"desc"})}this.grid.dataSource.settings.sorting.expressions=newSE}}else{for(i=0;i<expr.length;i++){if(expr[i].fieldName===colKey){expr.splice(i,1)}}this.grid.dataSource.settings.sorting.expressions=expr.concat([{fieldName:colKey,dir:s.currentSortDirection.startsWith("asc")?"asc":"desc"}])}noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}if(noCancel){this.grid.element.trigger("iggriduisoftdirty",{owner:this});this._currentHeader=header;this._currentIndex=index;if(this.options.type==="remote"){if(!apiCall){this._shouldFireColumnSorted=true}this.grid.dataSource.dataBind()}else{this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions,s.currentSortDirection);this.grid._renderData();if(!apiCall){this._trigger(this.events.columnSorted,null,{columnKey:colKey,direction:s.currentSortDirection,owner:this})}}this._curColKey=colKey;this._curSortDir=s.currentSortDirection}}},sortMultiple:function(){var self=this,noCancel,expr=this.grid.dataSource.settings.sorting.expressions,header;noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});if(noCancel){$.each(this.grid.options.columns,function(index,column){var i,cs,colKey=column.key;header=$("#"+self.grid.element[0].id+"_"+colKey);for(i=0;i<expr.length;i++){if(expr[i].fieldName===colKey){break}}cs=self._findColumnSetting(colKey);if(cs){if(i===expr.length){cs.currentSortDirection=undefined}else{cs.currentSortDirection=expr[i].dir}}self._applySortStyles(header,index)});this.grid.element.trigger("iggriduisoftdirty",{owner:this});if(this._isResetClick===true){this._isResetClick=false}if(this.options.type==="remote"){this.grid.dataSource.dataBind()}else{this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions);this.grid._renderData()}}},unsortColumn:function(index,header){if(this.options.mode==="single"){return}var colKey,expr,noCancel=true,s,i,apiCall=false;if($.type(index)==="number"){colKey=this.grid.options.columns[index].key}else{colKey=index;for(i=0;i<this.grid.options.columns.length;i++){if(this.grid.options.columns[i].key===colKey){index=i;break}}}expr=this.grid.dataSource.settings.sorting.expressions;s=this._findColumnSetting(colKey);if(s===null||s===undefined){return}if(s&&s.allowSorting===false){return}s.currentSortDirection=undefined;for(i=0;i<expr.length;i++){if(expr[i].fieldName===colKey){expr.splice(i,1)}}this._currentIndex=null;this._currentHeader=null;this._applySortStyles($("#"+this.grid.element[0].id+"_"+colKey),index);noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid});if(noCancel){this.grid.element.trigger("iggriduisoftdirty",{owner:this});this._currentHeader=header;if(this.options.type==="remote"){if(!apiCall){this._shouldFireColumnSorted=true}this.grid.dataSource.dataBind()}else{this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions);this.grid._trigger(this.grid.events.dataBound,null,{owner:this.grid});this.grid._renderData();if(!apiCall){this._trigger(this.events.columnSorted,null,{columnKey:colKey,direction:s.currentSortDirection,owner:this})}}this._curColKey=colKey;this._curSortDir=s.currentSortDirection}},_excludeExpr:function(key){var expr=this.grid.dataSource.settings.sorting.expressions,i;for(i=0;i<expr.length;i++){if(expr[i].fieldName===key){$.ig.removeFromArray(expr,i)}}},_applySortStyles:function(header,index,columnKey,ignoreActiveSelection){var oldHeight=null,span,col,indicatorContainer,visualIndex,indexResolved,i,tmpIndexResolved,currentColumnSetting,columnOption=this.grid.options.columns[index],dataSkipColumnCount=0,toolTip=this.options.sortedColumnTooltip,hasFixedColumns=this.grid.hasFixedColumns(),sortAsc=toolTip.replace("${direction}",$.ig.GridSorting.locale.ascending),sortDesc=toolTip.replace("${direction}",$.ig.GridSorting.locale.descending);if(this.grid.options.virtualizationMode==="fixed"&&(this.grid.options.virtualization===true||this.grid.options.columnVirtualization===true)){visualIndex=index-this.grid._startColIndex}else{visualIndex=index}if(this.grid.options.fixedHeaders){oldHeight=this.grid.headersTable().outerHeight()}span=header.find(".ui-iggrid-colindicator");if(span.length===0){span=$("<span></span>").addClass(this.css.sortIndicator)}indicatorContainer=header.find(".ui-iggrid-indicatorcontainer");if(indicatorContainer.length===0){indicatorContainer=$("<div></div>").appendTo(header).addClass("ui-iggrid-indicatorcontainer")}indicatorContainer.append(span);dataSkipColumnCount=header.closest("thead").find(".ui-iggrid-header[data-skip=true]").length;indexResolved=visualIndex+dataSkipColumnCount+1;tmpIndexResolved=indexResolved;for(i=0;i<this.grid.options.columns.length;i++){if(i+dataSkipColumnCount<indexResolved&&this.grid.options.columns[i].hidden){tmpIndexResolved--}}indexResolved=tmpIndexResolved;if(columnKey!==null&&columnKey!==undefined){for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===columnKey){currentColumnSetting=this.options.columnSettings[i];break}}}else{currentColumnSetting=this.options.columnSettings[index]}if(hasFixedColumns&&indexResolved-1<this.grid._fixedColumns.length){col=$("#"+this.element[0].id+"_fixed tbody tr td:nth-child("+indexResolved+")")}else{if(hasFixedColumns){indexResolved-=this.grid._fixedColumns.length}if(this.grid.options.fixedHeaders!==true){col=header.closest("thead").parent().find("tbody tr td:nth-child("+indexResolved+")")}else if(this.options.applySortedColumnCss!==false){col=this.grid.element.find("tr td:nth-child("+indexResolved+")")}}if(currentColumnSetting!==undefined&&currentColumnSetting.currentSortDirection!==undefined&&(!columnOption||columnOption&&columnOption.hidden!==true)){if(currentColumnSetting.currentSortDirection.indexOf("asc")!==-1){span.removeClass(this.css.sortIndicatorDescending).addClass(this.css.sortIndicatorAscending);header.removeClass(this.css.descendingColumnHeader).addClass(this.css.ascendingColumnHeader);header.attr("title",sortAsc);if(this.options.applySortedColumnCss!==false&&ignoreActiveSelection!==true){col.removeClass(this.css.descendingColumn).addClass(this.css.ascendingColumn)}}else{span.removeClass(this.css.sortIndicatorAscending).addClass(this.css.sortIndicatorDescending);header.removeClass(this.css.ascendingColumnHeader).addClass(this.css.descendingColumnHeader);header.attr("title",sortDesc);if(this.options.applySortedColumnCss!==false&&ignoreActiveSelection!==true){col.removeClass(this.css.ascendingColumn).addClass(this.css.descendingColumn)}}}else{header.attr("title",this.options.unsortedColumnTooltip);if(this.grid._isMultiColumnGrid===true){span=header.find(".ui-iggrid-colindicator")}else{span=header.parent("tr").find("th:nth-child("+indexResolved+") .ui-iggrid-colindicator")}span.removeClass(this.css.sortIndicatorAscending).removeClass(this.css.descendingColumnHeader);header.removeClass(this.css.sortableColumnHeaderActive).removeClass(this.css.sortableColumnHeaderFocus).removeClass(this.css.ascendingColumnHeader).removeClass(this.css.descendingColumnHeader)}if(oldHeight!==null&&oldHeight!==this.grid.headersTable().outerHeight()){this.grid._initializeHeights()}},_clearSortStates:function(header,index){var i,cs=this.options.columnSettings,realIndex=index,isSingleMode=this.options.mode==="single";for(i=0;i<this.grid.options.columns.length;i++){if(i<index&&this.grid.options.columns[i].hidden){realIndex--}}index=realIndex;for(i=0;i<this.options.columnSettings.length;i++){if(cs[i].allowSorting!==false){if(index!==undefined&&cs[i].columnIndex!==index){delete cs[i].currentSortDirection;this._clearSortState(header,cs[i].columnIndex)}if(this.grid._detachedHeaderCells&&isSingleMode&&cs[i].columnKey&&this.grid._detachedHeaderCells[cs[i].columnKey]){if(cs[i].currentSortDirection!==undefined&&cs[i].currentSortDirection!==null){delete cs[i].currentSortDirection}this._clearHeaderCellSortState(this.grid._detachedHeaderCells[cs[i].columnKey][0])}}}},_clearSortState:function(header,i){var spanHeader,col,th,ths,fixedColumnsLength;if(this.grid._isMultiColumnGrid===true){ths=this.grid._headerCells;th=ths[i];if(th===undefined){return}}else{if(this.grid.hasFixedColumns()){fixedColumnsLength=this.grid._fixedColumns.length;if(i<fixedColumnsLength){ths=this.grid.fixedHeadersTable().find("thead > tr").first().find("th").not("[data-skip=true]")}else{ths=this.grid.headersTable().find("thead > tr").first().find("th").not("[data-skip=true]");i-=fixedColumnsLength}th=ths.eq(i)}else{ths=this.grid.headersTable().find("thead > tr").first().find("th").not("[data-skip=true]");th=ths.eq(i)}}spanHeader=th;this._clearHeaderCellSortState(spanHeader);if(this.options.columnSettings.length>i&&this.options.columnSettings[i].allowSorting){th.attr("title",this.options.unsortedColumnTooltip)}else{th.attr("title","")}if(this.options.applySortedColumnCss!==false){if(this.grid.options.fixedHeaders!==true){col=header.closest("thead").parent().find("tbody tr td:nth-child("+(i+1)+")")}else if(this.options.applySortedColumnCss!==false){col=this.grid.element.find("tr td:nth-child("+(i+1)+")")}col.removeClass(this.css.descendingColumn).removeClass(this.css.ascendingColumn)}},_clearHeaderCellSortState:function(spanHeader){var span=spanHeader.find(".ui-iggrid-colindicator");if(span.hasClass("ui-iggrid-colindicator-desc")||span.hasClass("ui-iggrid-colindicator-asc")){span.removeClass(this.css.sortIndicatorDescending).removeClass(this.css.sortIndicatorAscending);spanHeader.removeClass(this.css.ascendingColumnHeader).removeClass(this.css.descendingColumnHeader).removeClass(this.css.sortableColumnHeaderFocus)}},_initDefaultSettings:function(){var settings=[],key,cs=this.options.columnSettings,i,j,k,colIndex=0,defaultExpressions=[],defExpLength,isToSkipGroupBySortingExpr=false,dir,allowSorting,isToCheckUnboundColumns=this.grid._hasUnboundColumns===true&&this.options.type==="remote";if(this.grid.dataSource.settings.sorting.expressions!==null&&this.grid.dataSource.settings.sorting.expressions!==undefined){defaultExpressions=this.grid.dataSource.settings.sorting.expressions}defExpLength=defaultExpressions.length;if(this.grid.options.columns&&this.grid.options.columns.length>0){for(i=0;i<this.grid.options.columns.length;i++){allowSorting=true;if(isToCheckUnboundColumns&&this.grid.getUnboundColumnByKey(this.grid.options.columns[i].key)!==null){allowSorting=false}settings[i]={columnIndex:colIndex,columnKey:this.grid.options.columns[i].key,allowSorting:allowSorting};if(this.grid.options.columns[i].hidden!==true){colIndex++}}}for(i=0;i<cs.length;i++){for(key in cs[i]){if(cs[i].hasOwnProperty(key)&&key!=="columnKey"&&key!=="columnIndex"){if(key==="userSet_currentSortDirection"){if(cs[i].userSet_currentSortDirection==="undefined"){delete cs[i].currentSortDirection}else{cs[i].currentSortDirection=cs[i].userSet_currentSortDirection}}else if(key==="userSet_allowSorting"){cs[i].allowSorting=cs[i][key];delete cs[i][key]}}}}if(settings.length===0&&this.grid.options.autoGenerateColumns&&cs.length>0){for(i=0;i<cs.length;i++){if(!cs[i].columnKey){continue}if(!cs[i].currentSortDirection||!cs[i].currentSortDirection.startsWith){dir="asc"}else{dir=cs[i].currentSortDirection.startsWith("asc")?"asc":"desc"}defaultExpressions.push({fieldName:cs[i].columnKey,dir:dir})}}else{for(i=0;i<cs.length;i++){for(j=0;j<settings.length;j++){if(settings[j].columnKey!==null&&settings[j].columnKey!==undefined&&cs[i].columnKey!==null&&cs[i].columnKey!==undefined){if(settings[j].columnKey===cs[i].columnKey){break}}else if(settings[j].columnIndex===cs[i].columnIndex){break}}if(j===settings.length){continue}for(key in cs[i]){if(cs[i].hasOwnProperty(key)&&key!=="columnKey"&&key!=="columnIndex"&&!key.startsWith("userSet")){settings[j][key]=cs[i][key];settings[j]["userSet_"+key]=cs[i][key];if(key==="currentSortDirection"&&cs[i][key]){if($.type(settings[j].columnKey)!=="number"){isToSkipGroupBySortingExpr=false;if(defExpLength>0){for(k=0;k<defExpLength;k++){if(defaultExpressions[k].fieldName===settings[j].columnKey){if(defaultExpressions[k].isGroupBy===true){isToSkipGroupBySortingExpr=true}else{defaultExpressions.splice(k,1)}break}}}if(isToSkipGroupBySortingExpr===true){continue}defaultExpressions.push({fieldName:settings[j].columnKey,dir:cs[i][key].startsWith("asc")?"asc":"desc"})}else{defaultExpressions.push({fieldIndex:settings[j].columnKey,dir:cs[i][key].startsWith("asc")?"asc":"desc"})}}}}}}for(i=0;i<settings.length;i++){if(!settings[i].hasOwnProperty("currentSortDirection")){settings[i].userSet_currentSortDirection="undefined"}}this.options.columnSettings=settings;this.grid.dataSource.settings.sorting.expressions=defaultExpressions;this.grid.dataSource.settings.sorting.defaultFields=defaultExpressions},_headerCellRendered:function(event,ui){var cs=this._findColumnSetting(ui.columnKey),i,col,featureChooserInstance=this.grid.element.data("igGridFeatureChooser");if(event.target.id!==this.grid.element[0].id){return}if(ui.isMultiColumnHeader===true){return}if(ui.columnKey&&cs){this._headers.push({header:ui.th,index:cs.columnIndex});if(cs.allowSorting!==false){ui.th.addClass(this.css.sortableColumnHeader);if(cs.currentSortDirection===undefined||cs.currentSortDirection===null){ui.th.attr("title",this.options.unsortedColumnTooltip)}else{ui.th.attr("title",cs.currentSortDirection.startsWith("asc")?this.options.sortedColumnTooltip.replace("${direction}",$.ig.GridSorting.locale.ascending):this.options.sortedColumnTooltip.replace("${direction}",$.ig.GridSorting.locale.descending))}$("<span></span>").appendTo(ui.th).addClass(this.css.sortIndicator);$(ui.th).wrapInner('<a href="javascript:void(0);"></a>');if(cs.currentSortDirection!==undefined){this._applySortStyles(ui.th,cs.columnIndex)}}else{$(ui.th).wrapInner('<a href="javascript:void(0);"></a>')}}if(this.options.mode!=="single"&&!this._featureChooserInitialized){this._featureChooserInitialized=true;this._hidingIconColumnKeys=[];for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i];if(this._getColumnSettingsByIndex(i).allowSorting){if(featureChooserInstance&&featureChooserInstance._shouldRenderInFeatureChooser(col.key)===true){featureChooserInstance._renderInFeatureChooser(col.key,{name:"Sorting",text:this.options.featureChooserText,secondaryIconClass:this.css.featureChooserModalDialogIcon,method:$.proxy(this.openMultipleSortingDialog,this),groupName:"modaldialog",groupOrder:3,order:2})}}}}},_columnFixed:function(args){var i,colInd=args.colInd,cs,fixedTable=this.grid.fixedHeadersTable(),isAttachedSortingHandlers=false;isAttachedSortingHandlers=fixedTable.data("attachedSortingHandlers");if(isAttachedSortingHandlers!==true){fixedTable.data("attachedSortingHandlers",true);fixedTable.delegate("thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler})}cs=this.options.columnSettings[colInd];if(cs){this.options.columnSettings.splice(colInd,1);this.options.columnSettings.splice(this.grid._fixedColumns.length-1,0,cs)}for(i=0;i<this.options.columnSettings.length;i++){this.options.columnSettings[i].columnIndex=i}},_columnsRearranged:function(event,ui){this._initDefaultSettings()},_columnMap:function(){var self=this,isMultiple=self.options.mode!=="single";return $.map(this.grid.options.columns,function(col,index){var allowSorting=false;if(isMultiple&&self._getColumnSettingsByIndex(index).allowSorting){allowSorting=true}return{columnKey:col.key,enabled:allowSorting}})},_findColumnSetting:function(key){var i;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){return this.options.columnSettings[i]}}},_dataRendered:function(){if(!this._loadingIndicator){this._initLoadingIndicator()}if(this._shouldFireColumnSorted){this._trigger(this.events.columnSorted,null,{columnKey:this._curColKey,direction:this._curSortDir,owner:this});this._shouldFireColumnSorted=false}this._loadingIndicator.hide();if(this._currentIndex!==undefined&&this._currentIndex!==null&&this._currentHeader!==undefined&&this._currentHeader!==null){this._applySortStyles(this._currentHeader,this._currentIndex)}if(this._hc===undefined){this._hc=this.grid.container().find(".ui-iggrid-expandheadercell").length>0}if(this.grid.options.rowVirtualization||this.grid.options.virtualization){$("#"+this.grid.element.attr("id")+"_scrollContainer").scrollTop(0)}},_onUIDirty:function(e,args){var i,j,exprs=this.grid.dataSource.settings.sorting.expressions,defaultExprs=this.grid.dataSource.settings.sorting.defaultFields,cs=this.options.columnSettings,skip=false;if(args.owner===this||args.owner.element[0].id!==this.element[0].id){return}this._currentIdentifier=null;this._currentIndex=null;this._currentHeader=null;this._clearUi(true);for(i=0;i<exprs.length;i++){skip=false;for(j=0;j<cs.length;j++){if(cs[j].columnKey===exprs[i].fieldName&&cs[j].userSet_currentSortDirection){skip=true;break}}if(!skip){if(exprs.length>i){$.ig.removeFromArray(exprs,i)}if(defaultExprs.length>i){$.ig.removeFromArray(defaultExprs,i)}}}},_clearUi:function(resetAll){var i,header,csd;for(i=0;this._headers&&i<this._headers.length;i++){csd=this.options.columnSettings[i].userSet_currentSortDirection;if(csd===undefined||csd===null||csd==="undefined"){this._clearSortState(this._headers[i].header,i);if(this.options.mode!=="single"){delete this.options.columnSettings[i].currentSortDirection;this._excludeExpr(this.options.columnSettings[i].columnKey)}}else{this._applySortStyles(this._headers[i].header,i)}header=this._headers[i].header;header.removeClass(this.css.sortableColumnHeaderActive).removeClass(this.css.sortableColumnHeaderHover).removeClass(this.css.sortableColumnAscending).removeClass(this.css.sortableColumnDescending).addClass(this.grid.css.headerClass);if(this.options.columnSettings[i].allowSorting){header.addClass(this.css.sortableColumnHeader)}}},_virtualHorizontalScroll:function(event,args){var start=args.startColIndex,end=args.endColIndex,i,j,cs=this.options.columnSettings,header,ths=this.grid.headersTable().find("thead > tr").first().find("th").not("[data-skip=true]"),visibleColumns=this.grid._visibleColumns();
for(i=0;i<ths.length;i++){header=ths.eq(i);this._clearSortState(header,i);header.removeClass(this.css.sortableColumnHeaderActive).removeClass(this.css.sortableColumnHeaderHover).removeClass(this.css.sortableColumnAscending).removeClass(this.css.sortableColumnDescending).addClass(this.grid.css.headerClass).addClass(this.css.sortableColumnHeader)}for(i=start;i<=end;i++){header=ths.eq(i-start);header.data("columnIndex",i);for(j=0;j<cs.length;j++){if(cs[j].currentSortDirection&&cs[j].columnKey===visibleColumns[i].key){this._applySortStyles(header,i)}}}},_columnsCollectionModified:function(event,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}var i,j,found,colKey,cs,col,colApplySelection,indexApplySelection;for(i=0;i<this.options.columnSettings.length;i++){j=0;found=false;for(j=0;j<this.grid._visibleColumns().length;j++){if(this.grid._visibleColumns()[j].key===this.options.columnSettings[i].columnKey){found=true;colKey=this.grid._visibleColumns()[j].key;break}}if(found){this.options.columnSettings[i].columnIndex=j;cs=this._findColumnSetting(colKey);if(cs&&cs.currentSortDirection!==undefined&&this.options.applySortedColumnCss!==false){col=$("#"+this.grid.element[0].id+"_"+colKey);this._applySortStyles(col,col.data("columnIndex"),colKey,true)}}}if(this._currentIdentifier){if($.type(this._currentIdentifier)==="number"){if(this._currentIndex!==undefined&&this._currentIndex!==null&&this._currentHeader!==undefined&&this._currentHeader!==null){this._applySortStyles(this._currentHeader,this._currentIndex)}}else{colApplySelection=$("#"+this.grid.element[0].id+"_"+this._currentIdentifier);indexApplySelection=colApplySelection.data("columnIndex");if($.type(indexApplySelection)==="number"){this._applySortStyles(colApplySelection,indexApplySelection,this._currentIdentifier)}}}$("#"+this.element[0].id+" thead th").removeClass(this.css.sortableColumnHeaderHover)},_detachEvents:function(){if(this._headerCellRenderedHandler){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}if(this._virtualHorizontalScrollHandler){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}if(this._uiDirtyHandler){this.grid.element.unbind("iggriduidirty",this._uiDirtyHandler)}if(this._headerRenderedHandler){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}if(this._columnsCollectionModifiedHandler){this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)}if(this._columnsRearangedHandler){this.grid.element.unbind("iggridcolumnmovingcolumnmoved",this._columnsRearangedHandler)}},destroy:function(){var i,a,fc,header,span,text,modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");if(!this.grid){return}$("#"+this.element[0].id).undelegate("thead th","dragstart",this._dragStartHandler);$("#"+this.element[0].id).undelegate("thead th","mouseover",this._mouseOverHandler);$("#"+this.element[0].id).undelegate("thead th","mouseout",this._mouseOutHandler);$("#"+this.element[0].id).undelegate("thead th","click",this._clickHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th","dragstart",this._dragStartHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th","mouseover",this._mouseOverHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th","mouseout",this._mouseOutHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th","click",this._clickHandler);$("#"+this.element[0].id).undelegate("thead th a","keydown",this._keyDownHandler);$("#"+this.element[0].id).undelegate("thead th a","focus",this._focusHandler);$("#"+this.element[0].id).undelegate("thead th a","blur",this._blurHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th a","keydown",this._keyDownHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th a","focus",this._focusHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th a","blur",this._blurHandler);$("#"+this.element[0].id).undelegate("thead th a:not([th-remove-focus])",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler});$(document).undelegate("#"+this.element[0].id+"_headers thead th a:not([th-remove-focus])",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler});this._detachEvents();delete this._blurHandler;delete this._clickHandler;delete this._headerCellRenderedHandler;delete this._focusHandler;delete this._keyDownHandler;delete this._mouseOutHandler;delete this._mouseOverHandler;delete this._dragStartHandler;delete this._uiDirtyHandler;delete this._virtualHorizontalScrollHandler;delete this._headerRenderedHandler;delete this._columnsRearangedHandler;this.grid.element.find(".ui-iggrid-colasc").removeClass("ui-iggrid-colasc ui-state-highlight");this.grid.element.find(".ui-iggrid-coldesc").removeClass("ui-iggrid-coldesc ui-state-highlight");this._clearUi(true);fc=this.grid.element.data("igGridFeatureChooser");for(i=0;this._headers&&i<this._headers.length;i++){header=this._headers[i].header;header.removeClass("ui-iggrid-sortableheader ui-state-default ui-state-active ui-state-hover ui-state-focus");header.attr("title","");span=header.find("a span");text=span.text();a=header.find("a:not([th-remove-focus])");$("<span>"+text+"</span>").appendTo(header).addClass("ui-iggrid-headertext");a.remove()}if(fc&&this.renderInFeatureChooser){fc._removeFeature("Sorting")}this._headers=null;if(this._loadingIndicator){delete this._loadingIndicator}modalDialog.igGridModalDialog("getCaptionButtonContainer");modalDialog.remove();$.Widget.prototype.destroy.apply(this,arguments);return this},_renderMultipleSortingDialog:function(){var $buttonOK,containment,self=this,o=this.options,modalDialogId=this.grid.element[0].id+"_multiplesorting_modalDialog",$captionButtonContainer,modalDialog;$("#"+modalDialogId).remove();modalDialog=$("<div></div>").appendTo("body").attr("id",modalDialogId);if(this.options.sortingDialogContainment==="owner"){containment=this.grid.container()}else{containment="window"}modalDialog.igGridModalDialog({containment:containment,buttonApplyText:o.modalDialogButtonApplyText,buttonCancelText:o.modalDialogButtonCancelText,renderFooterButtons:!o.modalDialogSortOnClick,modalDialogCaptionText:o.modalDialogCaptionText,modalDialogWidth:o.modalDialogWidth,modalDialogHeight:o.modalDialogHeight,animationDuration:o.modalDialogAnimationDuration,gridContainer:this.grid.container(),modalDialogOpening:function(event,args){var noCancel=self._trigger(self.events.modalDialogOpening,null,{modalDialogElement:modalDialog,owner:self});if(noCancel){self._multiplesortingDialogOpening(event,args);self._trigger(self.events.modalDialogOpened,null,{modalDialogElement:modalDialog,owner:self})}return noCancel},modalDialogMoving:function(e,ui){self._trigger(self.events.modalDialogMoving,null,{modalDialogElement:e.target,owner:self,originalPosition:ui.originalPosition,position:ui.position})},modalDialogClosing:function(event,args){return self._trigger(self.events.modalDialogClosing,null,{modalDialogElement:modalDialog,owner:self})},modalDialogClosed:function(event,args){self._trigger(self.events.modalDialogClosed,null,{modalDialogElement:modalDialog,owner:self})}});if(o.modalDialogSortOnClick){$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$("<span></span>").bind("click.hiding",function(event){modalDialog.igGridModalDialog("closeModalDialog",true);event.preventDefault();event.stopPropagation();return false}).addClass("ui-icon ui-icon-closethick").appendTo($("<a></a>").appendTo($captionButtonContainer).attr("title",$.ig.GridHiding.locale.columnChooserCloseButtonTooltip).attr("href","#").attr("role","button").addClass("ui-dialog-titlebar-close ui-corner-all"))}else{$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$buttonOK=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog_footer_buttonok");$buttonOK.bind("igbuttonclick",function(e){self._multiplesortingDialogButtonOKClick(e)})}},openMultipleSortingDialog:function(){var modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");modalDialog.igGridModalDialog("openModalDialog")},closeMultipleSortingDialog:function(){var modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");modalDialog.igGridModalDialog("closeModalDialog")},_multiplesortingDialogOpening:function(){this._tempExpr=this.grid.dataSource.settings.sorting.expressions.slice(0);this.renderMultipleSortingDialogContent(true)},renderMultipleSortingDialogContent:function(isToCallEvents){var $content,$sortedColumns,$unsortedColumns,i,j,noCancel=true,self=this,columns=this.grid.options.columns,css=this.css,se=this.grid.dataSource.settings.sorting.expressions,seLength=se.length,sortedColumns=[],modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");if(isToCallEvents){noCancel=this._trigger(this.events.modalDialogContentsRendering,null,{modalDialogElement:modalDialog,owner:this})}if(noCancel){this.removeDialogClearButton();$content=modalDialog.igGridModalDialog("getContent");$content.empty();$sortedColumns=$("<div></div>").attr("id",this.grid.element[0].id+"_multiplesorting_modalDialog_sortedcolumns").addClass(css.dialogSortedColumns).appendTo($content);$unsortedColumns=$("<div></div>").attr("id",this.grid.element[0].id+"_multiplesorting_modalDialog_unsortedcolumns").addClass(css.dialogUnsortedColumns).appendTo($content);$("<ul></ul>").addClass(css.dialogSortedColumnsList).appendTo($sortedColumns);$("<ul></ul>").addClass(css.dialogUnsortedColumnsList).appendTo($unsortedColumns);$.each(columns,function(columnIndex,column){var cs,columnIdentifier,direction;cs=self._getColumnSettingsByIndex(columnIndex);if(cs===null||cs===undefined||cs.allowSorting===false){return true}columnIdentifier=cs.columnKey||cs.columnIndex||column.key;for(i=0;i<self._tempExpr.length;i++){if(self._tempExpr[i].fieldName===columnIdentifier){break}}if(i!==self._tempExpr.length){sortedColumns.push({column:column,columnIndex:cs.columnIndex,dir:self._tempExpr[i].dir,columnIdentifier:columnIdentifier})}else{direction=cs.currentSortDirection||self.options.firstSortDirection;self._renderDialogUnsortedColumn(column,cs.columnIndex,direction,columnIdentifier)}});for(i=0;i<seLength;i++){for(j=0;j<sortedColumns.length;j++){if(se[i].fieldName===sortedColumns[j].columnIdentifier){self._renderDialogSortedColumn(sortedColumns[j].column,sortedColumns[j].columnIndex,sortedColumns[j].dir,sortedColumns[j].columnIdentifier);break}}}if(isToCallEvents){this._trigger(this.events.modalDialogContentsRendered,null,{modalDialogElement:modalDialog,owner:this})}if(this._checkRenderButtonReset()){this._renderDialogButtonClearAll()}}},_addSlideButtonSortingColumns:function(){var css=this.css,o=this.options,$sortedColumns=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog_sortedcolumns"),buttonId=this.grid.element[0].id+"_multiplesorting_modalDialog_slidebutton",$button,innerHTML;innerHTML='<div class="'+css.dialogSlideArea+'">'+'	<div class="'+css.dialogSlideAreaContainer+'">'+'		<button id="'+buttonId+'" class="'+css.dialogButtonSlide+'" role="button" aria-disabled="false" title="'+o.dialogButtonSlideCaption+'">'+'			<span class="'+css.dialogButtonSlideContainer+'"></span>'+'			<span class="ui-button-text">'+o.dialogButtonSlideCaption+"</span>"+"		</button>"+"	</div>"+"</div>";$(innerHTML).insertAfter($sortedColumns);$button=$("#"+buttonId);$button.bind({click:function(e,args){$sortedColumns.slideToggle("slow");$(this).find("span:eq(0)").toggleClass(css.dialogButtonSlideUp);return false}})},_renderDialogSortedColumn:function(column,columnIndex,direction,columnIdentifier){var self=this,$li,css=this.css,$buttonUnsort,liHTML,o=this.options,buttonAscDescId=this.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_modalDialog_sortedcolumns_buttonascdesc",buttonUnsortId=this.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_modalDialog_sortedcolumns_buttonunsort",$ul=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog_sortedcolumns ul");$ul.css("width");$li=$("<li></li>").attr("id",self.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_sorted_li").addClass(css.dialogSortedColumnsItem);$li.appendTo($ul);if(columnIndex!==null&&columnIndex!==undefined){$li.attr("li-order",columnIndex)}liHTML='<span id="'+buttonAscDescId+'" class="'+css.dialogButtonAsc+'" role="button" title="'+o.modalDialogCaptionButtonDesc+'" >'+'	<span class="'+css.dialogButtonAscIcon+'"></span>'+"</span>"+'<span class="'+css.dialogSortedColumnTextContainer+'">'+column.headerText+"</span>"+'<button id="'+buttonUnsortId+'" class="'+css.dialogButtonUnsort+'" role="button" title="'+o.modalDialogCaptionButtonUnsort+'" >'+'	<span class="'+css.dialogButtonUnsortContainer+'"></span>'+'	<span class="ui-button-text">'+o.modalDialogCaptionButtonUnsort+"</span>"+"</button>";$li.bind({click:function(e,args){self._currentIdentifier=columnIdentifier;self._dialogButtonAscDescClick(columnIdentifier);if(self._checkRenderButtonReset()){self._renderDialogButtonClearAll()}else{self.removeDialogClearButton()}e.preventDefault();e.stopPropagation()}});$li.html(liHTML);$buttonUnsort=$("#"+buttonUnsortId);if(direction!==undefined){if(direction.indexOf("asc")!==-1){self._setDialogButtonAscDesc(true,columnIdentifier);self._setTempExpr(columnIdentifier,"asc")}else{self._setDialogButtonAscDesc(false,columnIdentifier);self._setTempExpr(columnIdentifier,"desc")}}else{self._setDialogButtonAscDesc(true,columnIdentifier);self._setTempExpr(columnIdentifier,"asc")}$buttonUnsort.bind({click:function(e,args){var noCancel,modalDialog=$("#"+self.grid.element[0].id+"_multiplesorting_modalDialog");noCancel=self._trigger(self.events.modalDialogButtonUnsortClick,e,{modalDialogElement:modalDialog,owner:self,columnKey:columnIdentifier});if(noCancel){$li.remove();if(o.modalDialogSortOnClick===true){self.unsortColumn(columnIdentifier)}else{self._setTempExpr(columnIdentifier)}self._renderDialogUnsortedColumn(column,columnIndex,direction,columnIdentifier);if(self._checkRenderButtonReset()){self._renderDialogButtonClearAll()}else{self.removeDialogClearButton()}}e.preventDefault();e.stopPropagation()},mouseover:function(e,args){if(!$(this).hasClass(css.dialogButtonsHover)){$(this).addClass(css.dialogButtonsHover)}},mouseout:function(e,args){if($(this).hasClass(css.dialogButtonsHover)){$(this).removeClass(css.dialogButtonsHover)}}})},_dialogButtonAscDescClick:function(columnIdentifier){var o=this.options,noCancel,modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog"),$buttonAscDesc=$("#"+this.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_modalDialog_sortedcolumns_buttonascdesc"),isAsc=$buttonAscDesc.data("isAsc");noCancel=this._trigger(this.events.modalDialogSortingChanged,null,{modalDialogElement:modalDialog,owner:this,columnKey:columnIdentifier,isAsc:!isAsc});if(noCancel){if(isAsc===true){if(o.modalDialogSortOnClick===true){this.sortColumn(columnIdentifier,"descending",this._getHeaderCellByIdentifier(columnIdentifier))}else{this._setTempExpr(columnIdentifier,"desc")}this._setDialogButtonAscDesc(false,columnIdentifier)}else{if(o.modalDialogSortOnClick===true){this.sortColumn(columnIdentifier,"ascending",this._getHeaderCellByIdentifier(columnIdentifier))}else{this._setTempExpr(columnIdentifier,"asc")}this._setDialogButtonAscDesc(true,columnIdentifier)}}},_setDialogButtonAscDesc:function(isAsc,columnIdentifier){var css=this.css,buttonAscDescId=this.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_modalDialog_sortedcolumns_buttonascdesc",$buttonAscDesc=$("#"+buttonAscDescId),$spanIcon=$buttonAscDesc.find("span:eq(0)");$buttonAscDesc.data("isAsc",isAsc);if(isAsc===true){$buttonAscDesc.attr("title",this.options.modalDialogCaptionButtonDesc).removeClass(css.dialogButtonDesc).addClass(css.dialogButtonAsc);$spanIcon.removeClass(css.dialogButtonDescIcon).addClass(css.dialogButtonAscIcon);this._setTempExpr(columnIdentifier,"asc")}else{$buttonAscDesc.attr("title",this.options.modalDialogCaptionButtonAsc).removeClass(css.dialogButtonAsc).addClass(css.dialogButtonDesc);$spanIcon.removeClass(css.dialogButtonAscIcon).addClass(css.dialogButtonDescIcon);this._setTempExpr(columnIdentifier,"desc")}},_setTempExpr:function(colKey,dir){var i,expr=this._tempExpr;for(i=0;i<expr.length;i++){if(expr[i].fieldName===colKey){expr.splice(i,1);if(dir===null||dir===undefined){this._tempExpr=expr;return}}}this._tempExpr=expr.concat([{fieldName:colKey,dir:dir}])},_renderDialogUnsortedColumn:function(column,columnIndex,direction,columnIdentifier){var self=this,$li,$a,o=this.options,css=this.css,$ul=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog_unsortedcolumns ul");$ul.css("width");$li=$("<li></li>").attr("id",self.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_unsorted_li").addClass(css.dialogUnsortedColumnsItem).append('<span class="'+css.dialogUnsortedColumnsSortByButton+'"><a href="#"></a></span> <span class="'+css.dialogItemText+'">'+column.headerText+"</span>");this._insertColumnModalDialog($ul,$li,columnIndex);if(columnIndex!==null&&columnIndex!==undefined){$li.attr("li-order",columnIndex)}$a=$li.find("a:first");$a.addClass(css.modalDialogSortByColumn);$a.html(o.modalDialogSortByButtonText);$li.bind({click:function(e,args){var noCancel,modalDialog=$("#"+self.grid.element[0].id+"_multiplesorting_modalDialog");noCancel=self._trigger(self.events.modalDialogSortClick,e,{modalDialogElement:modalDialog,owner:self,columnKey:columnIdentifier});if(noCancel){$li.remove();self._renderDialogSortedColumn(column,columnIndex,direction,columnIdentifier);if(o.modalDialogSortOnClick){self.sortColumn(columnIdentifier,null,self._getHeaderCellByIdentifier(columnIdentifier))}else{if(self._checkRenderButtonReset()){self._renderDialogButtonClearAll()}else{self.removeDialogClearButton()}}}e.preventDefault();e.stopPropagation()}})},_checkRenderButtonReset:function(){var i,j,cs,columnKey,expr=this._tempExpr;this._isResetClick=false;for(i=0;i<this.options.columnSettings.length;i++){cs=this.options.columnSettings[i];if(cs.allowSorting===false){continue}columnKey=cs.columnKey;for(j=0;j<expr.length;j++){if(expr[j].fieldName===columnKey){if(cs.userSet_currentSortDirection!==expr[j].dir){return true}break}}if(j===expr.length&&cs.userSet_currentSortDirection!=="undefined"){return true}}this._isResetClick=true;return false},removeDialogClearButton:function(){$("#"+this.grid.element[0].id+"_sorting_modalDialog_reset_button").remove()},_renderDialogButtonClearAll:function(){if(this.options.modalDialogSortOnClick===true){return}var self=this,o=this.options,resetButtonId=self.grid.element[0].id+"_sorting_modalDialog_reset_button",modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog"),$captionButtonContainer,$resetButton;if($("#"+resetButtonId).length===0){$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$resetButton=$("<button></button>").attr("id",resetButtonId).appendTo($captionButtonContainer);$resetButton.igButton({labelText:o.modalDialogResetButtonLabel,click:function(e){var noCancel,i,cs=self.options.columnSettings;noCancel=self._trigger(self.events.modalDialogButtonResetClick,e,{modalDialogElement:modalDialog,owner:self});if(noCancel){self._tempExpr=[];for(i=0;i<cs.length;i++){if(cs[i].allowSorting!==false&&cs[i].userSet_currentSortDirection!=="undefined"){self._tempExpr.push({fieldName:cs[i].columnKey,dir:cs[i].userSet_currentSortDirection})}}self.renderMultipleSortingDialogContent(false);self.removeDialogClearButton();self._isResetClick=true}}})}},_multiplesortingDialogButtonOKClick:function(e,args){var noCancel,modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");noCancel=this._trigger(this.events.modalDialogButtonApplyClick,null,{modalDialogElement:modalDialog,owner:this,columnsToSort:this._tempExpr});if(noCancel){this.grid.dataSource.settings.sorting.expressions=this._tempExpr;this.sortMultiple();modalDialog.igGridModalDialog("closeModalDialog")}},_insertColumnModalDialog:function($ul,$li,pos){var i,$currLi,currPos,listItems=$ul.find("li"),listItemsLength=listItems.length;if(listItemsLength===0||pos===null||pos===undefined){$li.appendTo($ul);return}for(i=0;i<listItemsLength;i++){$currLi=$(listItems[i]);currPos=$currLi.attr("li-order");if(currPos>=pos){$li.insertBefore($currLi);break}}if(i===listItemsLength){$li.appendTo($ul)}},_getColumnSettings:function(index,key){var i,foundByIndex=null;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){foundByIndex=this.options.columnSettings[i];break}if(this.options.columnSettings[i].columnIndex===index){foundByIndex=this.options.columnSettings[i];break}}return foundByIndex},_getColumnSettingsByIndex:function(index){var key=this.grid.options.columns[index].key;return this._getColumnSettings(index,key)},_headerRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this.grid.element.data("igGridResizing")){this._resizing=this.grid.element.data("igGridResizing")}if(this.options.mode!=="single"){this._renderMultipleSortingDialog()}},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;if(this.options.type===null){this.options.type=this.grid._inferOpType()}this._detachEvents();if(this.options.type){this.grid.dataSource.settings.sorting.type=this.options.type}else{this.grid.dataSource.settings.sorting.type="remote"}this.grid.dataSource.settings.sorting.caseSensitive=this.options.caseSensitive;this.grid.dataSource.settings.sorting.defaultFields=this.grid.dataSource.settings.sorting.expressions;this.grid.dataSource.settings.sorting.enabled=true;this.grid.dataSource.settings.sorting.sortUrlKey=this.options.sortUrlKey;this.grid.dataSource.settings.sorting.sortUrlAscValueKey=this.options.sortUrlKeyAscValue;this.grid.dataSource.settings.sorting.sortUrlDescValueKey=this.options.sortUrlKeyDescValue;if($.type(this.options.customSortFunction)==="function"){this.grid.dataSource.settings.sorting.customFunc=this.options.customSortFunction}else if(typeof this.options.customSortFunction==="string"){if(window[this.options.customSortFunction]&&typeof window[this.options.customSortFunction]==="function"){this.grid.dataSource.settings.sorting.customFunc=window[this.options.customSortFunction]}}this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this);this._uiDirtyHandler=$.proxy(this._onUIDirty,this);this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._columnsRearangedHandler=$.proxy(this._columnsRearranged,this);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this._virtualHorizontalScrollHandler=$.proxy(this._virtualHorizontalScroll,this);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this.grid.element.bind("iggriduidirty",this._uiDirtyHandler);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggridcolumnmovingcolumnmoved",this._columnsRearangedHandler);this._initDefaultSettings();this._clearUi();this._currentActiveHeader=null;this._currentHeader=null;this._currentIndex=null;this._currentIdentifier=null}});$.extend($.ui.igGridSorting,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Column Summaries 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridSummaries",{grid:null,css:{columnSummariesDropdown:"ui-iggrid-summaries-dialog",footerRowTextContainer:"ui-iggrid-summaries-footer-text-container",footerRowIconContainer:"ui-iggrid-summaries-footer-icon-container",footerDropdownButtonsContainer:"ui-iggrid-summaries-footer-dialog-buttons-container",footerButtonIcon:"ui-icon ui-icon-calculator",footerButtonIconHover:"ui-corner-all ui-iggrid-filterbuttonhover ui-state-hover",footerButtonIconActive:"ui-iggrid-filterbuttonactive ui-corner-all ui-state-active",featureChooserIconClass:"ui-icon ui-icon-calculator",dropDownListContainer:"ui-iggrid-summaries-dropdown-listcontainer ui-widget",dropDownListItem:"ui-iggrid-summaries-dialog-listitem",headerButtonContainer:"ui-iggrid-summaries-headerbuttoncontainer ui-corner-all",headerButtonIcon:"ui-iggrid-summaries-header-icon ui-corner-all ui-icon ui-icon-calculator",headerButtonIconHover:"ui-iggrid-summaries-header-icon-hover ui-state-hover",footerRowCell:"ui-widget-footer ui-state-default",footerRowCellHover:"ui-state-hover",checkbox:"ui-state-default ui-corner-all ui-igcheckbox-normal",checkboxOff:"ui-icon ui-icon-check ui-igcheckbox-normal-off",checkboxOn:"ui-icon ui-icon-check ui-igcheckbox-normal-on",checkboxHovered:"ui-state-hover",footerRowIconContainerEmpty:"ui-iggrid-summaries-footer-icon-container-empty",footerRowTextContainerEmpty:"ui-iggrid-summaries-footer-text-container-empty",baseClassIE7:"ui-ie7"},defaultDecimalDisplay:2,defaultSummaryMethods:[{rowDisplayLabel:$.ig.GridSummaries.locale.defaultSummaryRowDisplayLabelCount,type:"count",allowed:"all",active:true,order:0,decimalDisplay:this.defaultDecimalDisplay},{rowDisplayLabel:$.ig.GridSummaries.locale.defaultSummaryRowDisplayLabelMin,type:"min",allowed:["number","date","numeric"],active:true,order:1,decimalDisplay:this.defaultDecimalDisplay},{rowDisplayLabel:$.ig.GridSummaries.locale.defaultSummaryRowDisplayLabelMax,type:"max",allowed:["number","date","numeric"],active:true,order:2,decimalDisplay:this.defaultDecimalDisplay},{rowDisplayLabel:$.ig.GridSummaries.locale.defaultSummaryRowDisplayLabelSum,type:"sum",allowed:["number","numeric"],active:true,order:3,decimalDisplay:this.defaultDecimalDisplay},{rowDisplayLabel:$.ig.GridSummaries.locale.defaultSummaryRowDisplayLabelAvg,type:"avg",allowed:["number","numeric"],active:true,order:4,decimalDisplay:this.defaultDecimalDisplay},{rowDisplayLabel:$.ig.GridSummaries.locale.defaultSummaryRowDisplayLabelCustom,type:"custom",allowed:"all",active:true,summaryCalculator:null,order:5,decimalDisplay:this.defaultDecimalDisplay}],renderInFeatureChooser:true,options:{type:null,dialogButtonOKText:$.ig.GridSummaries.locale.dialogButtonOKText,dialogButtonCancelText:$.ig.GridSummaries.locale.dialogButtonCancelText,calculateRenderMode:"okcancelbuttons",featureChooserText:$.ig.GridSummaries.locale.featureChooserText,featureChooserTextHide:$.ig.GridSummaries.locale.featureChooserTextHide,compactRenderingMode:true,defaultDecimalDisplay:2,showSummariesButton:true,summariesResponseKey:"summaries",summaryExprUrlKey:"summaries",callee:null,dropDownHeight:"",dropDownWidth:"",showDropDownButton:true,summaryExecution:"afterfilteringbeforepaging",dropDownDialogAnimationDuration:400,emptyCellText:$.ig.GridSummaries.locale.emptyCellText,summariesHeaderButtonTooltip:$.ig.GridSummaries.locale.summariesHeaderButtonTooltip,resultTemplate:"{0} = {1}",isGridFormatter:true,columnSettings:[{allowSummaries:true,columnKey:null,columnIndex:-1,summaryOperands:[{rowDisplayLabel:"",type:"custom",active:true,summaryCalculator:null,order:5,decimalDisplay:2,isGridFormatter:false}]}]},events:{dropDownOpening:"dropDownOpening",dropDownOpened:"dropDownOpened",dropDownClosing:"dropDownClosing",dropDownClosed:"dropDownClosed",summariesCalculating:"summariesCalculating",summariesCalculated:"summariesCalculated",summariesMethodSelectionChanged:"summariesMethodSelectionChanged",summariesToggling:"summariesToggling",summariesToggled:"summariesToggled",dropDownOKClicked:"dropDownOKClicked",dropDownCancelClicked:"dropDownCancelClicked"},_createWidget:function(){this.options.columnSettings=[];this._summariesRows=[];this._data={};this._currentOpenedColumnKey=null;this._isRenderedSummariesRows=false;this._footerInitialized=false;this._currentRowShownIcons=null;this._customInitMethods=[];this._fcData={};this._isInitFC=false;this._isSummariesRowsHidden=false;this._disallowedSummaries=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var compactRenderingMode=this.options.compactRenderingMode;if(compactRenderingMode==="true"){compactRenderingMode=true}else if(compactRenderingMode==="false"){compactRenderingMode=false}this.options.compactRenderingMode=compactRenderingMode},_initColumnSettings:function(){var settings=[],i,j,k,l,cs=this.options.columnSettings,csetting,columnSettingsLength=cs.length,gridColumnsLength=this.grid.options.columns?this.grid.options.columns.length:0;this.newColumnSettings=[];this._disallowedSummaries=[];for(i=0;i<gridColumnsLength;i++){settings.push({columnIndex:i,columnKey:this.grid.options.columns[i].key,dataType:this.grid.options.columns[i].dataType})}if(columnSettingsLength>0){for(i=0;i<columnSettingsLength;i++){csetting=cs[i];if(csetting.summaryOperands===null||csetting.summaryOperands===undefined){continue}if(csetting.columnKey!==null&&csetting.columnKey!==undefined||csetting.columnIndex!==null&&csetting.columnIndex!==undefined){for(j=0;j<gridColumnsLength;j++){for(l=0;l<csetting.summaryOperands.length;l++){if(csetting.summaryOperands[l].active===null||csetting.summaryOperands[l].active===undefined){csetting.summaryOperands[l].active=true}if(csetting.summaryOperands[l].type.startsWith("custom")===true){if(csetting.summaryOperands[l].type!=="custom"){for(k=0;k<this._customInitMethods.length;k++){if(csetting.summaryOperands[l].summaryCalculator===this._customInitMethods[k].summaryCalculator){break}}if(this._customInitMethods.length===k){this._customInitMethods.push({summaryCalculator:csetting.summaryOperands[l].summaryCalculator,type:csetting.summaryOperands[l].type,index:csetting.summaryOperands[l].type.replace("custom","")})}}}}}}}for(i=0;i<columnSettingsLength;i++){csetting=cs[i];if(csetting.columnKey!==null&&csetting.columnKey!==undefined||csetting.columnIndex!==null&&csetting.columnIndex!==undefined){for(j=0;j<gridColumnsLength;j++){if(settings[j].columnIndex===csetting.columnIndex&&csetting.columnIndex!==undefined&&csetting.columnIndex!==null||settings[j].columnKey===csetting.columnKey&&csetting.columnKey!==undefined&&csetting.columnKey!==null){csetting.dataType=settings[j].dataType;csetting.columnIndex=settings[j].columnIndex;csetting.columnKey=settings[j].columnKey;csetting.summaryOperands=this._initAllowedSummaryMethods(csetting);if(csetting.allowSummaries!==false){this.newColumnSettings.push(csetting)}else{this._disallowedSummaries[settings[j].columnKey]=true}break}}}}for(i=0;i<gridColumnsLength;i++){for(j=0;j<this.newColumnSettings.length;j++){if(this.newColumnSettings[j].columnKey===settings[i].columnKey){break}}if(j===this.newColumnSettings.length&&this._disallowedSummaries[settings[i].columnKey]!==true){this.newColumnSettings.push({dataType:settings[i].dataType,columnIndex:i,columnKey:settings[i].columnKey,summaryOperands:this._initAllowedSummaryMethods(settings[i],false)})}}}else{for(i=0;i<gridColumnsLength;i++){this.newColumnSettings.push({dataType:settings[i].dataType,columnIndex:i,columnKey:settings[i].columnKey,summaryOperands:this._initAllowedSummaryMethods(settings[i])})}}this.columnSettings=this.newColumnSettings},_initAllowedSummaryMethods:function(column,isNotActive){var i,j,k,z,c,lastCustomSummaryOperandIndex,defaultSummaryMethodsLength=this.defaultSummaryMethods.length,columnDataType,methods=[],allowedMethods=[],methodName,methodsLength,isActive,defaultMethodName;if(column===null||column===undefined){return}columnDataType=column.dataType;if(column!==null&&column!==undefined&&column.summaryOperands!==undefined&&column.summaryOperands!==null){for(i=0;i<column.summaryOperands.length;i++){if(column.summaryOperands[i].type===undefined||column.summaryOperands[i].type===null){return}methodName=column.summaryOperands[i].type.toLowerCase();if(this._isAllowedMethodName(methodName)===true){if(isNotActive===true){column.summaryOperands[i].active=false}if(column.summaryOperands[i].type==="custom"){if(column.summaryOperands[i].summaryCalculator===null||column.summaryOperands[i].summaryCalculator===undefined){continue}lastCustomSummaryOperandIndex=1;for(k=0;k<this._customInitMethods.length;k++){if(column.summaryOperands[i].summaryCalculator===this._customInitMethods[k].summaryCalculator){column.summaryOperands[i].type=this._customInitMethods[k].type;break}if(this._customInitMethods[k].index>lastCustomSummaryOperandIndex){lastCustomSummaryOperandIndex=this._customInitMethods[k].index}}if(this._customInitMethods.length===k){lastCustomSummaryOperandIndex++;column.summaryOperands[i].type="custom"+lastCustomSummaryOperandIndex;this._customInitMethods.push({summaryCalculator:column.summaryOperands[i].summaryCalculator,type:"custom"+lastCustomSummaryOperandIndex,index:lastCustomSummaryOperandIndex})}}methods.push(column.summaryOperands[i])}}}else{for(i=0;i<defaultSummaryMethodsLength;i++){c=this.defaultSummaryMethods[i];if(c.type.startsWith("custom")){continue}isActive=c.active;if(isNotActive===true){isActive=false}methods.push({rowDisplayLabel:c.rowDisplayLabel,type:c.type,allowed:c.allowed,active:isActive,order:c.order,decimalDisplay:c.decimalDisplay,isGridFormatter:c.isGridFormatter})}}methodsLength=methods.length;for(i=0;i<methodsLength;i++){for(j=0;j<defaultSummaryMethodsLength;j++){defaultMethodName=this.defaultSummaryMethods[j].type.toUpperCase();if(defaultMethodName===methods[i].type.toUpperCase()||methods[i].type.startsWith("custom")){if(methods[i].type.toLowerCase().startsWith("custom")){if(methods[i].order<this.defaultSummaryMethods[j].order){methods[i].order=this.defaultSummaryMethods[j].order}}else if(methods[i].order!==this.defaultSummaryMethods[j].order){methods[i].order=this.defaultSummaryMethods[j].order}if(methods[i].rowDisplayLabel===null||methods[i].rowDisplayLabel===undefined){methods[i].rowDisplayLabel=this.defaultSummaryMethods[j].rowDisplayLabel}if(this.defaultSummaryMethods[j].allowed==="all"){allowedMethods.push(methods[i])}else{for(z=0;z<this.defaultSummaryMethods[j].allowed.length;z++){if(this.defaultSummaryMethods[j].allowed[z]===columnDataType){allowedMethods.push(methods[i]);break}}}break}}}return allowedMethods},_setOption:function(key,value){var i,o=this.options,columns,columnsLength,cs,csLength,$colCell,columnKey,gridId=this.grid.element[0].id;switch(key){case"dialogButtonOKText":if(o.dialogButtonOKText!==value){columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){$("#"+this._id("summaries","dialog_button_ok",columns[i].key)).igButton("option","labelText",value)}}break;case"dialogButtonCancelText":if(o.dialogButtonCancelText!==value){columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){$("#"+this._id("summaries","dialog_button_cancel",columns[i].key)).igButton("option","labelText",value)}}break;case"calculateRenderMode":if(o.calculateRenderMode!==value){o.calculateRenderMode=value;columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){this._renderDropDown(columns[i].key)}}break;case"compactRenderingMode":if(o.compactRenderingMode!==value){o.compactRenderingMode=value;this._clearAllRows();this.calculateSummaries()}break;case"showSummariesButton":if(o.showSummariesButton!==value){o.showSummariesButton=value;cs=this.columnSettings;csLength=cs.length;for(i=0;i<csLength;i++){columnKey=cs[i].columnKey;if(value===true){$colCell=$("#"+gridId+"_"+columnKey);if(this._fcData!==null&&this._fcData!==undefined&&$colCell.length>0&&this._fcData[columnKey]!==true){this._renderHeaderCellButton($colCell,columnKey)}}else{$("#"+this._id("summaries","header_column_icon",columnKey)).remove()}}}break;case"disabled":if(o.disabled!==value){o.disabled=value;if(value===true){this._clearAllRows()}else{this.calculateSummaries()}}break;case"type":if(o.type!==value){o.type=value;this._setDataSourceColumnSettingsOptions()}break;case"summaryExprUrlKey":if(o.summaryExprUrlKey!==value){o.summaryExprUrlKey=value;this._setDataSourceColumnSettingsOptions()}break;case"dropDownHeight":if(o.dropDownHeight!==value){o.dropDownHeight=value;columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){$("#"+this._id("summaries","methods_dialog",columns[i].key)).css("height",value)}}break;case"dropDownWidth":if(o.dropDownWidth!==value){o.dropDownWidth=value;columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){$("#"+this._id("summaries","methods_dialog",columns[i].key)).css("width",value)}}break;case"showDropDownButton":if(o.showDropDownButton!==value){o.showDropDownButton=value;if(value===true){this._renderFooterIcons()}else{this._clearFooterIcons()}}break;case"emptyCellText":if(o.emptyCellText!==value){o.emptyCellText=value;this._clearAllRows();this.calculateSummaries()}break;case"resultTemplate":if(o.resultTemplate!==value){o.resultTemplate=value;this._clearAllRows();this.calculateSummaries()}break;case"isGridFormatter":if(o.isGridFormatter!==value){o.isGridFormatter=value;this._clearAllRows();this.calculateSummaries()}break;case"defaultDecimalDisplay":if(o.defaultDecimalDisplay!==value){o.defaultDecimalDisplay=value;this._clearAllRows();this.calculateSummaries()}break;case"columnSettings":if(o.columnSettings!==value){o.columnSettings=value;this.columnSettings=[];this.newColumnSettings=[];this._data={};this._clearAllRows();this._initColumnSettings();columns=this.grid.options.columns;columnsLength=columns.length;this.grid.dataSource.dataBind();for(i=0;i<columnsLength;i++){this._renderDropDown(columns[i].key)}}break}$.Widget.prototype._setOption.apply(this,arguments)},_removeHeaderColumnIcons:function(){var i,cs=this.columnSettings,csLength=cs.length;for(i=0;i<csLength;i++){$("#"+this._id("summaries","header_column_icon",cs[i].columnKey)).remove()}},destroy:function(){var i,columns,columnsLength;this._detachEvents();this._clearAllRows();this.newColumnSettings=null;this.options.columnSettings=null;this.options=null;this._summariesRows.length=0;this._summariesRows=null;if(this._activeDialog){this._activeDialog.remove();this._activeDialog=null}this._data=null;this._currentOpenedColumnKey=null;this._isRenderedSummariesRows=null;this._footerInitialized=null;this._currentRowShownIcons=null;this._customInitMethods=null;this._fcData=null;this._isInitFC=null;this._isSummariesRowsHidden=null;this._disallowedSummaries=null;this._activeDialog=null;this.defaultSummaryMethods=null;columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){$("#"+this._id("summaries","methods_dialog",columns[i].key)).remove()}fc=this.grid.element.data("igGridFeatureChooser");if(fc){fc._removeFeature("Summaries")}$.Widget.prototype.destroy.call(this);return this},_detachEvents:function(){this.grid.footersTable().find("tr:first td").unbind(".summaries");if(this._headerRenderedHandler){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}if(this._footerRenderedHandler){this.grid.element.unbind("iggridfooterrendered",this._footerRenderedHandler)}if(this._headerCellRenderedHandler){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}if(this._headerFooterInitHandler){this.grid.element.unbind("iggridheaderextracellsmodified",this._headerFooterInitHandler)}if(this._columnsCollectionModifiedHandler){this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)}if(this._virtualHorizontalScrollHandler){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}if(this._rowUpdatedHandler){this.grid.element.unbind("iggridupdatingeditrowended",this._rowUpdatedHandler);this.grid.element.unbind("iggridupdatinginternalrowdeleted",this._rowUpdatedHandler)}},_headerCellRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this._isInitFC!==true){this._initFC()}},_initFC:function(){var i,fc,o=this.options,cs=this.columnSettings,csLength=cs.length,columnKey;this._isInitFC=true;fc=this.grid.element.data("igGridFeatureChooser");if(fc!==null&&fc!==undefined){for(i=0;i<csLength;i++){if(cs[i].allowSummaries===false){continue}columnKey=cs[i].columnKey;if(fc._shouldRenderInFeatureChooser(columnKey)===true){fc._renderInFeatureChooser(columnKey,{name:"Summaries",text:o.featureChooserText,textHide:o.featureChooserTextHide,iconClass:this.css.featureChooserIconClass,isSelected:true,method:$.proxy(this._togglefromfc,this),updateOnClickAll:true,order:1,groupName:"toggle",groupOrder:1,type:"toggle",state:"hide"});this._fcData[columnKey]=true}}}},_footerRendered:function(sender,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}var i,cs=this.columnSettings,csLength=cs.length,columnKey;for(i=0;i<csLength;i++){if(cs[i].allowSummaries===false){continue}columnKey=cs[i].columnKey;this._renderDropDown(columnKey)}},_headerRendered:function(sender,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}var i,cs=this.columnSettings,csLength=cs.length,$colCell,columnKey,gridId=this.grid.element[0].id;for(i=0;i<csLength;i++){if(cs[i].allowSummaries===false){continue}columnKey=cs[i].columnKey;$colCell=this.grid.headersTable().find("#"+gridId+"_"+columnKey);if($colCell.length>0&&this._fcData[columnKey]!==true&&this.options.showSummariesButton!==false){this._renderHeaderCellButton($colCell,columnKey)}}},_columnMap:function(){var o=this.options,cs=this.newColumnSettings,i,csLength=cs.length,elem,result=[];if(o.showSummariesButton===false){return false}for(i=0;i<csLength;i++){elem={columnKey:cs[i].columnKey,enabled:true};if(cs[i].allowSummaries===false){elem.enabled=false}result.push(elem)}return result},_dataRendered:function(){if(this.options.disabled!==true&&this._isSummariesRowsHidden===false){this.calculateSummaries()}},_rowUpdated:function(){if(this.grid.options.autoCommit&&this._isRenderedSummariesRows){this.calculateSummaries()}},isSummariesRowsHidden:function(){return this._isSummariesRowsHidden},calculateSummaries:function(){this._trigger(this.events.rowsInitialize,null,{});this._calculateInternalSummaries();if(this.options.showDropDownButton===true){this._renderFooterIcons()}this._adjustHeights()},_adjustHeights:function(){var grid=this.grid,gridHeight=grid.options.height,newHeight,hasVScrollbar,oS;if(gridHeight===null||gridHeight===undefined){return}if(this._isVirtualization()===true){newHeight=parseInt(this.grid.options.height,10)-parseInt($("#"+this._id("footer","container")).height(),10);$("#"+this.grid.element[0].id).height(newHeight);$("#"+this.grid.element[0].id+"_displayContainer").height(newHeight);$("#"+this.grid.element[0].id+"_scrollContainer").height(newHeight);grid._initializeHeights();if(grid.options.virtualizationMode==="fixed"){oS=grid._scrollContainer().scrollTop();grid._buildVirtualDom();if(oS>0){if($.ig.util.isFF){grid._scrollContainer().scrollTop(0);setTimeout(function(){grid._scrollContainer().scrollTop(oS)},0)}else{grid._scrollContainer().scrollTop(oS-2);grid._scrollContainer().scrollTop(oS)}}}}else{if(!this.grid.hasFixedColumns()){this.grid._initializeHeights();hasVScrollbar=!(grid.options.autoAdjustHeight&&grid.element.height()<=$("#"+grid.element[0].id+"_scroll").height()||!grid.options.autoAdjustHeight&&grid.options.avgRowHeight*grid.element[0].rows.length<parseInt(grid.options.height,10));if(hasVScrollbar!==grid._hasVerticalScrollbar){this.grid._adjustLastColumnWidth(false)}}else{this._syncFixedUnfixedRowHeights()}}},_removeFooterRows:function(){var i,sr=this._summariesRows,hasFixedColumns=this.grid.hasFixedColumns(),srLength=sr.length;for(i=0;i<srLength;i++){$("#"+this._id("summaries","footer_row",sr[i].type)).remove();if(hasFixedColumns){$("#"+this._id("summaries","footer_row",sr[i].type,"fixed")).remove()}}if(hasFixedColumns){this._syncFixedUnfixedRowHeights()}this._isRenderedSummariesRows=false;this._summariesRows=[]},_calculateSelectedSummaries:function(columnKey){var i,k,methods,hasFixedColumns=this.grid.hasFixedColumns(),res=[],csLength,$checkbox,methodsLength,summariesRowsLength,isToCalculate=false,data,newMax,max,cs=null,isChecked,j,compactRenderingMode=this.options.compactRenderingMode,selectedColumnSettingsIndex,columnSettingsLength=this.columnSettings.length,isToRerender=false,isToRemoveRow=false,methodNameToRemove,unactiveMethods=[],unactiveMethodsLength=0,activeMethods=[],isToRemoveFirstRow=false,elemDataCalculating,rowToRemoveMethodName="";if(columnKey===undefined||columnKey===null){return}for(j=0;j<columnSettingsLength;j++){if(this.columnSettings[j].columnKey===columnKey&&this._isVisibleColumn(columnKey)){cs=this.columnSettings[j];selectedColumnSettingsIndex=j;break}}if(cs===null||cs===undefined){return}methods=cs.summaryOperands;methodsLength=methods.length;for(i=0;i<methodsLength;i++){$checkbox=$("#"+this._id("summaries_footer_checkbox",methods[i].type.toLowerCase(),columnKey));isChecked=$checkbox.attr("data-chk").toLowerCase()==="on";if(isChecked!==methods[i].active){isToRerender=true;this.newColumnSettings[selectedColumnSettingsIndex].summaryOperands[i].active=isChecked;if(isChecked===true){isToCalculate=true;activeMethods.push(this.newColumnSettings[selectedColumnSettingsIndex].summaryOperands[i])}else{unactiveMethods.push(methods[i])}}}this.columnSettings[selectedColumnSettingsIndex].summaryOperands=this.newColumnSettings[selectedColumnSettingsIndex].summaryOperands;this.isToCalculateInRemoteMode=false;if(this.options.compactRenderingMode==="auto"){if(this._summariesRows.length===1&&this._analyzeAutoCompactRenderingMode()===false){$("#"+this._summariesRows[0].id).remove();if(hasFixedColumns){$("#"+this._summariesRows[0].id+"_fixed").remove()}this._summariesRows=[];this.calculateSummaries();return}if(this._summariesRows.length>1&&this._analyzeAutoCompactRenderingMode()===true){for(i=0;i<this._summariesRows.length;i++){$("#"+this._summariesRows[i].id).remove();if(hasFixedColumns){$("#"+this._summariesRows[i].id+"_fixed").remove()}}this._summariesRows=[];this.calculateSummaries();return}}if(isToCalculate===true){if((compactRenderingMode===false||compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===false)&&this._summariesRows.length===1){rowToRemoveMethodName=this._summariesRows[0].type.toLowerCase();isToRemoveFirstRow=true;for(j=0;j<this.columnSettings.length;j++){if(!this._isVisibleColumn(this.columnSettings[j].columnKey)){continue}for(k=0;k<this.columnSettings[j].summaryOperands.length;k++){if(this.columnSettings[j].summaryOperands[k].type.toLowerCase()===rowToRemoveMethodName&&this.columnSettings[j].summaryOperands[k].active!==false){isToRemoveFirstRow=false;break}}if(isToRemoveFirstRow===false){break}}}if(this.options.type==="remote"){if(this.options.calculateRenderMode==="onselect"){this.isToCalculateInRemoteMode=true;elemDataCalculating={type:activeMethods[0].type,result:"calculating",rowDisplayLabel:activeMethods[0].rowDisplayLabel,order:activeMethods[0].order,decimalDisplay:activeMethods[0].decimalDisplay,dataType:this.newColumnSettings[selectedColumnSettingsIndex].dataType};if(this._data[columnKey]===null||this._data[columnKey]===undefined){this._data[columnKey]=[]}this._data[columnKey].push(elemDataCalculating);this._renderFooterColumnInfo(columnKey,this._data[columnKey])}else{this._setDataSourceColumnSettingsOptions();this.grid.dataSource.dataBind()}}else{data=this._dataSummaries();if(this._trigger(this.events.summariesCalculating,null,{owner:this})!==false){res=this.calculateSummaryColumn(columnKey,activeMethods,data,this.newColumnSettings[selectedColumnSettingsIndex].dataType);if(compactRenderingMode===false||compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===false){this._renderFooterColumnInfo(columnKey,res)}this._trigger(this.events.summariesCalculated,null,{data:data,owner:this})}}}unactiveMethodsLength=unactiveMethods.length;if(compactRenderingMode===true||compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===true){cs=this.newColumnSettings;csLength=cs.length;max=0;newMax=0;if(compactRenderingMode==="auto"){unactiveMethods=[];for(i=0;i<methodsLength;i++){$checkbox=$("#"+this._id("summaries_footer_checkbox",methods[i].type.toLowerCase(),columnKey));isChecked=$checkbox.attr("data-chk").toLowerCase()==="on";if(isChecked===false){unactiveMethods.push(methods[i])}}unactiveMethodsLength=unactiveMethods.length}for(i=0;i<unactiveMethodsLength;i++){this._removeDataResult(columnKey,unactiveMethods[i].type.toLowerCase())}if(unactiveMethodsLength>activeMethods.length){for(i=0;i<csLength;i++){if(!this._isVisibleColumn(cs[i].columnKey)){continue}newMax=0;for(j=0;j<cs[i].summaryOperands.length;j++){if(cs[i].summaryOperands[j].active===true){newMax++}}if(newMax>max){max=newMax}}summariesRowsLength=this._summariesRows.length;if(max>summariesRowsLength){return}for(i=0;i<max;i++){$("#"+this._id("summaries","footer_row_text_container",this._summariesRows[i].type.toLowerCase(),columnKey)).html(this.options.emptyCellText)}for(i=max;i<summariesRowsLength;i++){$("#"+this._summariesRows[i].id).remove();if(hasFixedColumns){$("#"+this._summariesRows[i].id+"_fixed").remove()}}for(i=max;i<summariesRowsLength;i++){this._summariesRows.pop()}}else if(activeMethods.length>unactiveMethodsLength){this._initCompactModeSummariesRows()}this._renderFooterColumnInfo(columnKey,this._data[columnKey]);if(this._summariesRows.length===0){this._insertSummariesRows(this.defaultSummaryMethods[0].type.toLowerCase(),this.defaultSummaryMethods[0].order);this._renderFooterIcons()}this._adjustHeights()}if(isToRerender&&(compactRenderingMode===false||compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===false)){for(i=0;i<unactiveMethodsLength;i++){methodNameToRemove=unactiveMethods[i].type.toLowerCase();$("#"+this._id("summaries","footer_row_text_container",methodNameToRemove,columnKey)).html(this.options.emptyCellText);this._removeDataResult(columnKey,methodNameToRemove);if(this._summariesRows.length<=1){continue}isToRemoveRow=true;for(j=0;j<this.columnSettings.length;j++){if(!this._isVisibleColumn(this.columnSettings[j].columnKey)){continue}for(k=0;k<this.columnSettings[j].summaryOperands.length;k++){if(this.columnSettings[j].summaryOperands[k].type.toLowerCase()===methodNameToRemove&&this.columnSettings[j].summaryOperands[k].active!==false){isToRemoveRow=false;break}}if(isToRemoveRow===false){break}}if(isToRemoveRow===true&&this._summariesRows.length>1){this._removeRowsDataByType(methodNameToRemove);$("#"+this._id("summaries","footer_row",methodNameToRemove)).remove();if(hasFixedColumns){$("#"+this._id("summaries","footer_row",methodNameToRemove,"fixed")).remove()}}}if(this._summariesRows.length>=1&&isToRemoveFirstRow===true){for(i=0;i<activeMethods.length;i++){if(activeMethods[i].type.toLowerCase()===rowToRemoveMethodName){break}}if(i===activeMethods.length){this._removeRowsDataByType(rowToRemoveMethodName);$("#"+this._id("summaries","footer_row",rowToRemoveMethodName)).remove();if(hasFixedColumns){$("#"+this._id("summaries","footer_row",rowToRemoveMethodName,"fixed")).remove()}}}if(this._summariesRows.length>0&&$("#"+this._id("summaries","footer_row_button_dd",this._summariesRows[0].type,columnKey)).length===0){this._renderFooterIcons()}this._adjustHeights()}},_analyzeAutoCompactRenderingMode:function(){var i,j,methods,cs,methodsLength,activeMethodsCount,columnSettingsLength=this.columnSettings.length;for(j=0;j<columnSettingsLength;j++){cs=this.columnSettings[j];methods=cs.summaryOperands;methodsLength=methods.length;activeMethodsCount=0;for(i=0;i<methodsLength;i++){if(methods[i].active===true&&++activeMethodsCount>1){return false}}}return true},_removeRowsDataByType:function(methodNameToRemove){if(methodNameToRemove===undefined||methodNameToRemove===null){return}var hasFixedColumns=this.grid.hasFixedColumns();this._summariesRows=$.grep(this._summariesRows,function(n){if(n.type===methodNameToRemove){$(n).remove();if(hasFixedColumns){$("#"+n.id+"_fixed").remove()}}return n.type!==methodNameToRemove})},_syncFixedUnfixedRowHeights:function(){var $tfoot=this.grid.footersTable().find("tfoot"),$fixedTFoot=this.grid.fixedFootersTable().find("tfoot"),summariesRows=$tfoot.find("tr[data-role]"),fixedSummariesRows=$fixedTFoot.find("tr[data-role]");$.each(summariesRows,function(index,r){var h,fixedRowHeight,rowHeight,$row=$(r),$fixedRow=fixedSummariesRows.eq(index);if($fixedRow.length===0){return true}fixedRowHeight=$fixedRow.height();rowHeight=$row.height();if(fixedRowHeight>rowHeight){h=fixedRowHeight}else{h=rowHeight}$row.height(h);$fixedRow.height(h)})},_clearFooterIcons:function(){var i,currentRow=this._currentRowShownIcons,columns,columnsLength;if(currentRow===null||currentRow===undefined){return}columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){$("#"+this._id("summaries","footer_row_button_dd",currentRow.type,columns[i].key)).remove()}},clearAllFooterIcons:function(){var i,j,rows=this._summariesRows,rowsLength=rows.length,columns=this.grid.options.columns,columnsLength=columns.length;for(i=0;i<rowsLength;i++){for(j=0;j<columnsLength;j++){$("#"+this._id("summaries","footer_row_button_dd",rows[i].type,columns[j].key)).remove()}}},_clearAllRows:function(){var i,summaryRowsLength=this._summariesRows.length,hasFixedColumns=this.grid.hasFixedColumns(),$row;for(i=0;i<summaryRowsLength;i++){$row=$("#"+this._summariesRows[i].id);$row.remove();if(hasFixedColumns){$("#"+this._summariesRows[i].id+"_fixed").remove()}}this._summariesRows.length=0},_removeUnusedFooterRows:function(oldRows){var i,j,sr=this._summariesRows,summariesRowsLength=this._summariesRows.length,hasFixedColumns=this.grid.hasFixedColumns(),oldRowsLength=oldRows.length;if(summariesRowsLength===0){for(i=0;i<oldRowsLength;i++){$("#"+oldRows.id).remove()}return}for(i=0;i<oldRowsLength;i++){for(j=0;j<summariesRowsLength;j++){if(sr[j].id===oldRows[i].id){continue}}if(j===summariesRowsLength){$("#"+oldRows[i].id).remove();if(hasFixedColumns){$("#"+oldRows[i].id+"_fixed").remove()}}}},_renderFooterIcons:function(startInd,endInd){var i,columnKey,sr=this._summariesRows,columnSetting,isToRemoveRow=true,gridColumns=this.grid.options.columns,gridColumnsLength=gridColumns.length,methodName;if(startInd===null||startInd===undefined){startInd=0}if(endInd===null||endInd===undefined){endInd=gridColumnsLength}if(sr.length===0){return}this._clearFooterIcons();methodName=sr[0].type;this._currentRowShownIcons=sr[0];for(i=startInd;i<endInd;i++){columnKey=gridColumns[i].key;if(this._disallowedSummaries[columnKey]===true){continue}columnSetting=this._getColumnSettingByKey(columnKey);if(columnSetting===null||columnSetting===undefined||columnSetting.length===0||columnSetting.allowSummaries===false){continue}isToRemoveRow=false;this._renderFooterIconMarkup(methodName,columnKey)}if(isToRemoveRow===true){this._removeRowsDataByType(methodName)}},_renderFooterIconMarkup:function(methodName,columnKey){var self=this,$button;$button=$("<span></span>").appendTo($("#"+this._id("summaries","footer_row_icon_container",methodName,columnKey))).addClass(self.css.footerButtonIcon);$button.wrap('<a id="'+this._id("summaries","footer_row_button_dd",methodName,columnKey)+'" href="#" title="'+'"></a>');$button.data("columnKey",columnKey);$button.closest("td").bind({"mousedown.summaries":function(e){self.toggleDropDown(columnKey,null);e.stopPropagation()}});$button.parent().bind({mousedown:$.proxy(self._onMouseDownFooterIcon,self),click:$.proxy(self._onClickFooterIcon,self),mouseover:$.proxy(self._onMouseOverFooterIcon,self),mouseout:$.proxy(self._onMouseOutFooterIcon,self),focus:$.proxy(self._onMouseOverFooterIcon,self),blur:$.proxy(self._onMouseOutFooterIcon,self),keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){event.stopPropagation();
event.preventDefault();self.toggleDropDown(null,event)}}})},_onMouseOverFooterIcon:function(e){var $button=$(e.target);if($button.closest("div").hasClass(this.css.footerButtonIconActive)===false){$button.closest("div").addClass(this.css.footerButtonIconHover)}},_onMouseOutFooterIcon:function(e){var $button=$(e.target);if($button.closest("div").hasClass(this.css.footerButtonIconActive)===false){$button.closest("div").removeClass(this.css.footerButtonIconHover)}},_onClickFooterIcon:function(e){e.preventDefault()},_onMouseDownFooterIcon:function(event){this.toggleDropDown(null,event)},_isFirstRowEmpty:function(){var i,res=true,columnKey,sr=this._summariesRows,data=null,row,gridColumns=this.grid.options.columns,gridColumnsLength=gridColumns.length;if(sr.length===0){return false}row=sr[0];for(i=0;i<gridColumnsLength;i++){columnKey=gridColumns[i].key;data=this._getDataByKeyMethodName(columnKey,row.type);if(data!==null){return false}}return res},toggleDropDown:function(columnKey,event){var $target,$dialog,top,left,self,isVisible;if(!event){$target=this.grid.footersTable().find("tfoot tr:first-child td[data-key="+columnKey+"] a>span")}else{$target=$(event.target);columnKey=$target.data("columnKey")}if(columnKey===null||columnKey===undefined){$target=$target.find("span");columnKey=$target.data("columnKey")}$dialog=$("#"+this._id("summaries","methods_dialog",columnKey));top=$.ig.util.offset($target).top;left=$.ig.util.offset($target).left;self=this;isVisible=$dialog.is(":visible")===true;if($dialog.length===0||$dialog.data("isAnimating")===true){return}top-=$target.height()-2;if($target.is("span")===true){$dialog.data("buttonId",$target.parent().attr("id"))}if(!isVisible){$dialog.css({top:top-$dialog.height(),left:left})}if(self._activeDialog!==null&&self._activeDialog!==undefined&&$dialog!==self._activeDialog&&columnKey!==self._activeDialog.data("columnKey")){self.showHideDialog(self._activeDialog)}if(isVisible===true){self._currentOpenedColumnKey=null}else{self._currentOpenedColumnKey=columnKey}self.showHideDialog($dialog)},showHideDialog:function($dialog){if($dialog===null||$dialog===undefined){return}var self=this,e=this.events,$button=$("#"+$dialog.data("buttonId")),columnKey=$dialog.data("columnKey"),animationDuration=self.options.dropDownDialogAnimationDuration;if($dialog.data("isAnimating")===true&&self._activeDialog===$dialog){return}if($dialog.is(":visible")===true){if(this._trigger(e.dropDownClosing,null,{columnKey:columnKey,owner:this})===false){return}if($button!==null&&$button!==undefined){$button.closest("div").removeClass(self.css.footerButtonIconActive)}}else{if(this._trigger(e.dropDownOpening,null,{columnKey:columnKey,owner:this})===false){return}if($button!==null&&$button!==undefined){$button.closest("div").removeClass(self.css.footerButtonIconHover);$button.closest("div").addClass(self.css.footerButtonIconActive);this._rollbackCheckboxState(columnKey)}}if(animationDuration<=0){animationDuration=1}$dialog.data("isAnimating",true);$dialog.toggle("slide",{duration:animationDuration,direction:"down"},function(){$dialog.data("isAnimating",false);if($dialog.is(":visible")===true){$dialog.focus();self._activeDialog=$dialog;self._trigger(e.dropDownOpened,null,{columnKey:columnKey,owner:this})}else{self._trigger(e.dropDownClosed,null,{columnKey:columnKey,owner:this});if(self.options.type==="remote"&&self.options.calculateRenderMode==="onselect"&&self.isToCalculateInRemoteMode===true){self.isToCalculateInRemoteMode=false;self._setDataSourceColumnSettingsOptions();self.grid.dataSource.dataBind()}if(self._activeDialog!==null&&self._activeDialog!==undefined&&self._activeDialog.data("columnKey")===columnKey){self._activeDialog=null}}})},_closeDropDown:function(){var $dialog=this._activeDialog;this.showHideDialog($dialog)},_setDataSourceColumnSettingsOptions:function(){var o=this.options;this.grid.dataSource.settings.summaries.columnSettings=this.newColumnSettings;this.grid.dataSource.settings.summaries.type=o.type;this.grid.dataSource.settings.summaries.summaryExecution=o.summaryExecution;this.grid.dataSource.settings.summaries.summaryExprUrlKey=o.summaryExprUrlKey;this.grid.dataSource.settings.summaries.summariesResponseKey=o.summariesResponseKey;if(this.grid.dataSource.type&&this.grid.dataSource.type()==="remoteUrl"&&this.grid._dataOptions&&$.type(this.grid._dataOptions.dataSource)==="string"){this.grid.dataSource.settings.dataSource=this.grid._dataOptions.dataSource}},_getColumnSettingByKey:function(columnKey){var i,len=this.columnSettings.length;if(columnKey===null||columnKey===undefined){return null}for(i=0;i<len;i++){if(this.columnSettings[i].columnKey===columnKey){return this.columnSettings[i]}}return null},_renderHeaderCellButton:function(columnCell,columnKey){var summaryHeaderIconContainer,self=this,css=self.css,buttonId=this._id("summaries","header_column_icon",columnKey),$button,$divHeaderButtonContainer;summaryHeaderIconContainer=columnCell.find(".ui-iggrid-indicatorcontainer");if(summaryHeaderIconContainer.length===0){summaryHeaderIconContainer=$("<div></div>").appendTo(columnCell);summaryHeaderIconContainer.addClass("ui-iggrid-indicatorcontainer")}$("#"+buttonId).remove();$button=$("<a></a>").attr("href","#").attr("id",buttonId).attr("title",this.options.summariesHeaderButtonTooltip);$divHeaderButtonContainer=summaryHeaderIconContainer.find(".ui-iggrid-summaries-headerbuttoncontainer");if($divHeaderButtonContainer.length===0){$divHeaderButtonContainer=$("<div></div>").addClass(css.headerButtonContainer).appendTo(summaryHeaderIconContainer)}$button.appendTo($divHeaderButtonContainer);$("<span></span>").addClass(css.headerButtonIcon).appendTo($button);if($.ig.util.isIE7===true){$button.parent().addClass(this.css.baseClassIE7)}$button.hover(function(){$(this).parent().addClass(css.headerButtonIconHover)},function(){$(this).parent().removeClass(css.headerButtonIconHover)});$button.bind({click:function(event){event.preventDefault();event.stopPropagation();self._internalToggleSummariesRow(null,event)}})},_togglefromfc:function(event,columnKey,isSelected){this._internalToggleSummariesRow(isSelected,event)},_internalToggleSummariesRow:function(isToShow,event){if(isToShow===null||isToShow===undefined){isToShow=!this._isRenderedSummariesRows}if(this._trigger(this.events.summariesToggling,event,{isToShow:isToShow,owner:this})===false){return}this.toggleSummariesRows(isToShow,true);this._trigger(this.events.summariesToggled,event,{isShown:isToShow,owner:this})},toggleSummariesRows:function(isToShow,isInternalCall){var fc,cs,csLength,i,$hScroller,hScrollerLeft;if(isToShow===true){$hScroller=$("#"+this.grid.id()+"_horizontalScrollContainer");if($hScroller.length>0){hScrollerLeft=$hScroller.scrollLeft();$hScroller.scrollLeft(0)}this.calculateSummaries();if(hScrollerLeft){setTimeout(function(){$hScroller.scrollLeft(hScrollerLeft)},0)}this.grid._scrollFooter();this._isSummariesRowsHidden=false;if(this._summariesRows.length===0){cs=this.newColumnSettings;csLength=cs.length;this._insertSummariesRows(this.defaultSummaryMethods[0].type,this.defaultSummaryMethods[0].order);for(i=0;i<csLength;i++){if(!this._isVisibleColumn(cs[i].columnKey)){continue}this._renderFooterIconMarkup(this.defaultSummaryMethods[0].type,cs[i].columnKey)}}}else{this._removeFooterRows();this._isSummariesRowsHidden=true}this._adjustHeights();if(isInternalCall===undefined||isInternalCall===false){fc=this.grid.element.data("igGridFeatureChooser");if(fc!==null&&fc!==undefined){fc._toggleSelectedItems("Summaries",!isToShow)}}},_renderDropDown:function(columnKey){var $dialog,$ul,i,j,$buttonOK,$buttonCancel,$div,minInd,swap,$li,id=this._id("summaries","methods_dialog",columnKey),methodsLength,cs=this._getColumnSettingByKey(columnKey),css=this.css,checkboxId,allowedMethods,self=this,o=this.options,isChecked=false,cssClassCheckBox,onFocusLi,toggleState,onBlurLi,onMousedownLi,onKeydownLi,onMousedown,onMouseover,onMouseout,$checkbox,onClick;if(cs===null||cs===undefined){return}allowedMethods=cs.summaryOperands;if(allowedMethods===null||allowedMethods===undefined){return}$("#"+id).remove();$dialog=$("<div></div>").appendTo("body").attr("id",id).css("position","absolute").css("width",this.options.dropDownWidth).css("height",this.options.dropDownHeight).addClass(this.css.columnSummariesDropdown).attr("tabindex",0).hide();$dialog.data("methods",allowedMethods);$ul=$("<ul></ul>").addClass(css.dropDownListContainer);$ul.appendTo($dialog);methodsLength=allowedMethods.length;for(i=0;i<methodsLength;i++){minInd=i;for(j=i;j<methodsLength;j++){if(allowedMethods[j].order===null||allowedMethods[j].order===undefined){allowedMethods[j].order=0}if(allowedMethods[minInd].order>allowedMethods[j].order){minInd=j}}if(minInd!==i){swap=allowedMethods[minInd];allowedMethods[minInd]=allowedMethods[i];allowedMethods[i]=swap}}toggleState=function($checkbox,event){self.toggleCheckstate($checkbox);self._trigger(self.events.summariesMethodSelectionChanged,event,{columnKey:columnKey,isSelected:$checkbox.attr("data-chk").toLowerCase()==="on",methodName:$checkbox.data("methodName"),owner:this});if(o.calculateRenderMode==="onselect"){self._calculateSelectedSummaries(columnKey)}};onClick=function(event){toggleState($(event.currentTarget),event);if(self._activeDialog){self._activeDialog.data("focussed",true);self._activeDialog.focus()}event.preventDefault();event.stopPropagation()};onMousedown=function(event){if(self._activeDialog){self._activeDialog.data("focussed",true);self._activeDialog.focus()}event.preventDefault();event.stopPropagation()};onMouseover=function(event){$(event.currentTarget).addClass(css.checkboxHovered)};onMouseout=function(event){$(event.currentTarget).removeClass(css.checkboxHovered)};$dialog.bind({blur:function(event){$dialog.data("focussed",false);setTimeout($.proxy(self._checkCloseDropDown,self),300)},focus:function(event){$dialog.data("focussed",true)},keydown:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE||event.keyCode===$.ui.keyCode.SPACE||event.keyCode===$.ui.keyCode.ENTER){event.stopPropagation();event.preventDefault();self.toggleDropDown(null,event);if(self._summariesRows.length>0){$("#"+self._id("summaries","footer_row_button_dd",self._summariesRows[0].type,columnKey)).focus()}}}});onFocusLi=function(event){if(self._activeDialog){self._activeDialog.data("focussed",true)}};onBlurLi=function(e){if(self._activeDialog){self._activeDialog.data("focussed",false)}setTimeout($.proxy(self._checkCloseDropDown,self),300)};onKeydownLi=function(event){var $liFocused=$(this),keyCode=event.keyCode;if(keyCode===$.ui.keyCode.ENTER||keyCode===$.ui.keyCode.SPACE){toggleState($("#"+$liFocused.data("checkboxId")),event);event.stopPropagation();event.preventDefault()}else if(keyCode===$.ui.keyCode.ESCAPE){$dialog.blur()}};onMousedownLi=function(event){toggleState($("#"+$(this).data("checkboxId")),event)};for(i=0;i<methodsLength;i++){checkboxId=this._id("summaries_footer_checkbox",allowedMethods[i].type.toLowerCase(),columnKey);if(allowedMethods[i].active===true||allowedMethods[i].active===1){isChecked="on";cssClassCheckBox=css.checkboxOn}else{isChecked="off";cssClassCheckBox=css.checkboxOff}$li=$("<li></li>").data("checkboxId",checkboxId).addClass(css.dropDownListItem).appendTo($ul).attr("tabindex",0);$li.bind({focus:onFocusLi,blur:onBlurLi,keydown:onKeydownLi,mousedown:onMousedownLi});$('<span id="'+checkboxId+'" class="'+css.checkbox+'"></span>').appendTo($li);$("<label></label>").html(allowedMethods[i].rowDisplayLabel).appendTo($li);$checkbox=$("#"+checkboxId);$('<span class="'+cssClassCheckBox+'"></span>').appendTo($checkbox);$checkbox.attr("data-chk",isChecked).attr("data-role","checkbox");$checkbox.data("methodName",allowedMethods[i].type);$checkbox.bind({click:onClick,mouseover:onMouseover,mouseout:onMouseout,mousedown:onMousedown})}$div=$("<div></div>").addClass(this.css.footerDropdownButtonsContainer).appendTo($dialog);if(o.calculateRenderMode==="okcancelbuttons"){$buttonOK=$('<a href="http://localhost/">'+"</a>");$buttonOK.attr("id",this._id("summaries","dialog_button_ok",columnKey)).appendTo($div);$buttonOK.igButton({link:{href:"#",title:""},labelText:this.options.dialogButtonOKText,keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._clickOKButton(columnKey)}if(event.keyCode!==$.ui.keyCode.TAB){event.stopPropagation();event.preventDefault()}},click:function(e){self._clickOKButton(columnKey);e.preventDefault();e.stopPropagation()},mousedown:function(event){event.preventDefault();event.stopPropagation()},focus:function(event){if(self._activeDialog){self._activeDialog.data("focussed",true)}},blur:function(e){if(self._activeDialog){self._activeDialog.data("focussed",false)}setTimeout($.proxy(self._checkCloseDropDown,self),300)}});$buttonCancel=$("<a></a>");$buttonCancel.attr("id",this._id("summaries","dialog_button_cancel",columnKey)).appendTo($div);$buttonCancel.igButton({link:{href:"#",title:""},labelText:this.options.dialogButtonCancelText,click:function(e){self._clickCancelButton(columnKey);e.preventDefault();e.stopPropagation()},mousedown:function(event){event.preventDefault();event.stopPropagation()},focus:function(event){if(self._activeDialog){self._activeDialog.data("focussed",true)}},blur:function(e){if(self._activeDialog){self._activeDialog.data("focussed",false)}setTimeout($.proxy(self._checkCloseDropDown,self),300)}})}$dialog.data("columnKey",columnKey)},_checkCloseDropDown:function(){if(this._activeDialog===null){return}if(this._activeDialog.data("focussed")===false){setTimeout($.proxy(this._closeDropDown,this),10)}},toggleCheckstate:function($checkbox){var noCancel;noCancel=true;if(noCancel){if($checkbox.attr("data-chk")==="on"){this.selectCheckBox($checkbox,false)}else{this.selectCheckBox($checkbox,true)}}},selectCheckBox:function($checkbox,isToSelect){var css=this.css,$innerSpan=$checkbox.children("span");if(isToSelect===true){$innerSpan.removeClass(css.checkboxOff).addClass(css.checkboxOn);$checkbox.attr("data-chk","on")}else{$innerSpan.removeClass(css.checkboxOn).addClass(css.checkboxOff);$checkbox.attr("data-chk","off")}},_clickOKButton:function(columnKey){var i,j,cs,$checkbox,columnSettingsLength=this.columnSettings.length,methods,methodsLength,eventData=[],elem;if(columnKey===null||columnKey===undefined){return}for(j=0;j<columnSettingsLength;j++){if(this.columnSettings[j].columnKey===columnKey){cs=this.columnSettings[j];break}}if(cs===null||cs===undefined){return}methods=cs.summaryOperands;methodsLength=methods.length;for(i=0;i<methodsLength;i++){$checkbox=$("#"+this._id("summaries_footer_checkbox",methods[i].type.toLowerCase(),columnKey));elem={type:methods[i].type.toLowerCase(),active:false};if($checkbox.attr("data-chk")!==undefined&&$checkbox.attr("data-chk").toLowerCase()==="on"){elem.active=true}eventData.push(elem)}this._trigger(this.events.dropDownOKClicked,null,{columnKey:columnKey,eventData:eventData,owner:this});this.showHideDialog($("#"+this._id("summaries","methods_dialog",columnKey)));this._calculateSelectedSummaries(columnKey)},_clickCancelButton:function(columnKey){this._trigger(this.events.dropDownCancelClicked,null,{columnKey:columnKey,owner:this});this.showHideDialog($("#"+this._id("summaries","methods_dialog",columnKey)))},_rollbackCheckboxState:function(columnKey){var cs,i,isChecked,j,methods,methodsLength,columnSettingsLength=this.columnSettings.length,$checkbox;if(columnKey===undefined||columnKey===null){return}for(j=0;j<columnSettingsLength;j++){if(this.columnSettings[j].columnKey===columnKey){cs=this.columnSettings[j];break}}if(cs===null||cs===undefined){return}methods=cs.summaryOperands;methodsLength=methods.length;for(i=0;i<methodsLength;i++){$checkbox=$("#"+this._id("summaries_footer_checkbox",methods[i].type.toLowerCase(),columnKey));if($checkbox.attr("data-chk")!==undefined){isChecked=$checkbox.attr("data-chk").toLowerCase()==="on";if(methods[i].active!==isChecked){if(methods[i].active===true){this.selectCheckBox($checkbox,true)}else{this.selectCheckBox($checkbox,false)}}}}},_initCompactModeSummariesRows:function(){var i,j,k,cs=this.newColumnSettings,csLength=cs.length,columnMaxMethods=cs[0],cmm,cmmLength,countRowsToAdd,methodName,maxMethods=-1,summariesRowsLength,newMaxMethods;for(i=0;i<csLength;i++){if(!this._isVisibleColumn(cs[i].columnKey)){continue}newMaxMethods=0;if(cs[i].summaryOperands===null||cs[i].summaryOperands===undefined){continue}for(j=0;j<cs[i].summaryOperands.length;j++){if(cs[i].summaryOperands[j].active===true){newMaxMethods++}}if(newMaxMethods>maxMethods){maxMethods=newMaxMethods;columnMaxMethods=cs[i]}}if(columnMaxMethods===undefined||columnMaxMethods===null){return}cmm=columnMaxMethods.summaryOperands;cmmLength=cmm.length;summariesRowsLength=this._summariesRows.length;if(summariesRowsLength>maxMethods){return}countRowsToAdd=maxMethods-summariesRowsLength;if(countRowsToAdd===0){return}k=0;for(i=0;i<cmmLength;i++){methodName=cmm[i].type.toLowerCase();if($("#"+this._id("summaries","footer_row",methodName)).length===0){this._insertSummariesRows(methodName,null);if(++k===countRowsToAdd){break}}}},_calculateInternalSummaries:function(){var cs=this.newColumnSettings,csLength=cs.length,i,o=this.options,data,res,e=this.events;if(this._trigger(e.summariesCalculating,null,{owner:this})===false){return}data=this._dataSummaries();if(o.callee!==null&&o.callee!==undefined&&$.type(o.callee)==="function"){data=o.callee(data)}if(data===null||data===undefined){data=[]}if(o.compactRenderingMode===true||o.compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===true){this._initCompactModeSummariesRows()}for(i=0;i<csLength;i++){if(!this._isVisibleColumn(cs[i].columnKey)){continue}res=this.calculateSummaryColumn(cs[i].columnKey,cs[i].summaryOperands,data,cs[i].dataType);this._renderFooterColumnInfo(cs[i].columnKey,res)}this._isRenderedSummariesRows=true;this._trigger(e.summariesCalculated,null,{data:data,owner:this})},_isVisibleColumn:function(columnKey){var cols=this.grid._visibleColumns(),ret=false;$.each(cols,function(index,value){if(value.key===columnKey){ret=true;return false}});return ret},calculateSummaryColumn:function(ck,columnMethods,data,dataType){var i,j,val,o=this.options,columnMethodsLength,tmpArr=[],rowsCount=0,res=[],order,resultCalculated,resElement,methodName,gridDataSource,isDate;if(ck===null||ck===undefined){throw new Error($.ig.GridSummaries.locale.calculateSummaryColumnKeyNotSpecified)}if(columnMethods===undefined||columnMethods===null){return}columnMethodsLength=columnMethods.length;if(o.type==="local"){rowsCount=data.length;isDate=dataType==="date";if(isDate===true){for(i=0;i<rowsCount;i++){if(data[i][ck]!==null&&data[i][ck]!==undefined){tmpArr.push(data[i][ck].getTime())}}}else{for(i=0;i<rowsCount;i++){if(data[i][ck]===undefined){data[i][ck]=null}tmpArr.push(data[i][ck])}}for(i=0;i<columnMethodsLength;i++){methodName=columnMethods[i].type.toLowerCase();if(methodName.startsWith("custom")){methodName="custom"}if(columnMethods[i].active===true||columnMethods[i].active===1){order=columnMethods[i].order;if(order===undefined){order=null}if(methodName==="count"){resultCalculated=rowsCount}else{resultCalculated=$.ig.calcSummaries(methodName,tmpArr,columnMethods[i].summaryCalculator,dataType)}resElement={type:columnMethods[i].type,result:resultCalculated,rowDisplayLabel:columnMethods[i].rowDisplayLabel,order:order,decimalDisplay:columnMethods[i].decimalDisplay,isGridFormatter:columnMethods[i].isGridFormatter,dataType:dataType};res.push(resElement);this._addDataResult(ck,resElement)}}}else if(o.type==="remote"){if(data[ck]!==undefined&&data[ck]!==null){for(i=0;i<columnMethodsLength;i++){val=data[ck][columnMethods[i].type];if(columnMethods[i].active===true||columnMethods[i].active===1){order=columnMethods[i].order;if(order===undefined){order=null}if(val===null||val===undefined){if(columnMethods[i].summaryCalculator!==undefined){gridDataSource=this.grid.dataSource._data;rowsCount=gridDataSource.length;isDate=dataType==="date";if(isDate===true){for(j=0;j<rowsCount;j++){if(gridDataSource[j][ck]!==null&&gridDataSource[j][ck]!==undefined){tmpArr.push(gridDataSource[j][ck].getTime())}}}else{for(j=0;j<rowsCount;j++){tmpArr.push(gridDataSource[j][ck])}}val=$.ig.calcSummaries(columnMethods[i].type.toLowerCase(),tmpArr,columnMethods[i].summaryCalculator,dataType)}else{val=""}}res.push({type:columnMethods[i].type,result:val,rowDisplayLabel:columnMethods[i].rowDisplayLabel,order:order,decimalDisplay:columnMethods[i].decimalDisplay,isGridFormatter:columnMethods[i].isGridFormatter,dataType:dataType})}}}this._data[ck]=res}return res},summaryCollection:function(){return this._data},summariesFor:function(columnKey){return this._data[columnKey]},_addDataResult:function(columnKey,resElement){var d=this._data[columnKey],i,dLen;if(d===null||d===undefined){this._data[columnKey]=[];this._data[columnKey].push(resElement);return}dLen=d.length;for(i=0;i<dLen;i++){if(d[i].type.toLowerCase()===resElement.type.toLowerCase()){d[i]=resElement;break}}if(i===dLen){this._data[columnKey].push(resElement)}},_removeDataResult:function(columnKey,methodName){var d=this._data[columnKey];if(d===undefined||d===null){return}d=$.grep(d,function(n){return n.type.toLowerCase()!==methodName.toLowerCase()});this._data[columnKey]=d},_getDataByKeyMethodName:function(columnKey,methodName){var i,d=this._data[columnKey],dLength,res=null;methodName=methodName.toLowerCase();if(d===undefined||d===null){return null}dLength=d.length;for(i=0;i<dLength;i++){if(d[i].type.toLowerCase()===methodName){return d[i]}}return res},_renderFooterColumnInfo:function(columnKey,data){if(data===null||data===undefined){return}var i,j,methodName,footerRowId,$footerRow,order,compactRenderingMode=this.options.compactRenderingMode,dataLength=data.length,min,swapElement;if(compactRenderingMode===true||this.options.compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===true){if(dataLength>1){for(i=0;i<dataLength;i++){min=i;for(j=i+1;j<dataLength;j++){if(data[j].order<data[min].order){swapElement=data[j];data[j]=data[min];data[min]=swapElement;min=j}}}}for(i=0;i<dataLength;i++){if(this._summariesRows[i]===undefined||this._summariesRows[i]===null||data[i]===undefined||data[i]===null){continue}this._renderCell(this._summariesRows[i].type,columnKey,data[i])}}else if(compactRenderingMode===false||this.options.compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===false){for(i=0;i<dataLength;i++){methodName=data[i].type.toLowerCase();footerRowId=this._id("summaries","footer_row",methodName);$footerRow=this.grid.container().find("#"+footerRowId);if($footerRow.length===0){order=data[i].order;if(order===undefined){order=null}this._addDataResult(columnKey,data[0]);this._insertSummariesRows(methodName,order)}this._renderCell(methodName,columnKey,data[i])}}},_renderCell:function(methodName,columnKey,data){var resultTemplate=this.options.resultTemplate,column,autoFormat=this.grid.options.autoFormat,res=data.result,i,format,oRes=res,value,isToFixFloat=false,summaryOperand=data.type,rowDisplayLabel=data.rowDisplayLabel,isGridFormatter=data.isGridFormatter,dataType=data.dataType,defaultDecimalDisplay=this.options.defaultDecimalDisplay,decimalDisplay=data.decimalDisplay,isNumber=this._isNumber(res);if(isNumber&&dataType==="bool"){isGridFormatter=false}if(isNumber===true){if(decimalDisplay===undefined||decimalDisplay===null){if(defaultDecimalDisplay!==null&&defaultDecimalDisplay!==undefined){decimalDisplay=defaultDecimalDisplay;isToFixFloat=true}}else{isToFixFloat=true}res=parseFloat(res);if(isToFixFloat&&decimalDisplay>=0){if((autoFormat===true||autoFormat==="dateandnumber")&&dataType||autoFormat&&autoFormat===dataType){format="0.";for(i=0;i<decimalDisplay;i++){format+="0"}if(summaryOperand==="count"){dataType="number"}else{isToFixFloat=false}if(decimalDisplay===0){res=oRes}else{res=$.ig.formatter(oRes,dataType,format)}}else{res=res.toFixed(decimalDisplay);if(summaryOperand!=="count"){isToFixFloat=false}}}}value=res;if(isGridFormatter===true||isGridFormatter===undefined&&this.options.isGridFormatter===true){column=this._getGridColumnFor(columnKey);if(column!==null){if(dataType==="date"&&isNumber&&(summaryOperand==="min"||summaryOperand==="max")){value=new Date(parseInt(value,10))}if(!isToFixFloat||dataType==="date"){res=this.grid._renderCell(value,column)}value=res}}else if(value===null||value===undefined){value=""}else if(dataType==="date"&&isNumber&&(summaryOperand==="min"||summaryOperand==="max")){value=new Date(parseInt(value,10))}if(resultTemplate){res=resultTemplate.replace("{0}",rowDisplayLabel).replace("{1}",value)}this.grid.footersTable().find("#"+this._id("summaries","footer_row_text_container",methodName,columnKey)).html(res);if(resultTemplate){res=resultTemplate.replace("{0}",rowDisplayLabel).replace("{1}",value)}this.grid.container().find("#"+this._id("summaries","footer_row_text_container",methodName,columnKey)).html(res)},_getGridColumnFor:function(columnKey){var i,gridColumnsLength=this.grid.options.columns?this.grid.options.columns.length:0;for(i=0;i<gridColumnsLength;i++){if(this.grid.options.columns[i].key===columnKey){return this.grid.options.columns[i]}}return null},_isNumber:function(n){return!isNaN(parseFloat(n))&&isFinite(n)},_columnsCollectionModified:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this._isSummariesRowsHidden===true){return}this._clearAllRows();this.calculateSummaries()},_insertSummariesRows:function(methodName,order){methodName=methodName.toLowerCase();var srLength,i,j,srOrder,hasFixed=this.grid.hasFixedColumns(),css=this.css,$grid=this.grid,gridColumns=$grid._visibleColumns(),gridColumnsLength=gridColumns.length,$tfoot=this._tfoot,$td,$tfootFixed,$footer=$grid._footer,footerRowIdFixed,$footerRowFixed,footerRowId=this._id("summaries","footer_row",methodName),$footerRow=$("<tr></tr>").attr("id",footerRowId).attr("data-role","summaryrow"),elem={id:footerRowId,type:methodName,order:order},footerRowCellMousein=function(){$(this).addClass(css.footerRowCellHover)},footerRowCellMouseout=function(){$(this).removeClass(css.footerRowCellHover)};if(hasFixed===true){footerRowIdFixed=this._id("summaries","footer_row",methodName,"fixed");$footerRowFixed=$("<tr></tr>").attr("id",footerRowIdFixed).attr("data-role","summaryrow");$tfootFixed=this.grid.fixedFootersTable().find("tfoot")}if($tfoot===null||$tfoot===undefined){if($footer===undefined||$footer===null||$footer.length===0){$grid._renderFooter();$footer=$grid._footer}if($footer===undefined||$footer===null||$footer.length===0){return}$footer.css("display","");if(this._isVirtualization()===true){$tfoot=this.grid.footersTable().find("tfoot")}else if(this._isFixedFooters()===true){$tfoot=$footer.find("tfoot")}else{$tfoot=$footer}this._tfoot=$tfoot}if($tfoot.attr("id")!==""&&$tfoot.attr("id")!==null&&$tfoot.attr("id")!==undefined){$tfoot=$("#"+$tfoot.attr("id"))}if(order===null){elem.order=this._summariesRows.length;this._summariesRows.push(elem);$footerRow.appendTo($tfoot);if(hasFixed){$footerRowFixed.appendTo($tfootFixed)}}else{srLength=this._summariesRows.length;if(srLength===0){this._summariesRows.push(elem);$footerRow.appendTo($tfoot);if(hasFixed){$footerRowFixed.appendTo($tfootFixed)}}else{if(this.options.compactRenderingMode===true||this.options.compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===true){$footerRow.appendTo($tfoot);if(hasFixed){$footerRowFixed.appendTo($tfootFixed)}this._summariesRows.push(elem)}else if(this.options.compactRenderingMode===false||this.options.compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===false){for(i=0;i<srLength;i++){srOrder=this._summariesRows[i].order;if(srOrder===undefined||srOrder===null){continue}if(order<=srOrder){$footerRow.insertBefore($("#"+this._id("summaries","footer_row",this._summariesRows[i].type)));if(hasFixed){$footerRowFixed.insertBefore($("#"+this._id("summaries","footer_row",this._summariesRows[i].type,"fixed")))}this._summariesRows.splice(i,0,elem);break}}if(i===srLength){this._summariesRows.push(elem);$footerRow.appendTo($tfoot);if(hasFixed){$footerRowFixed.appendTo($tfootFixed)}}}}}if(this._isVirtualization()&&this.grid.options.virtualizationMode==="fixed"){gridColumnsLength=this.grid._virtualColumnCount}for(j=0;j<gridColumnsLength;j++){$td=$("<td></td>").addClass(css.footerRowCell).attr("data-key",gridColumns[j].key);if(gridColumns[j].fixed===true){$td.appendTo($footerRowFixed);$("#"+footerRowIdFixed+" td.ui-state-default").hover(footerRowCellMousein,footerRowCellMouseout)}else{$td.appendTo($footerRow);$("#"+footerRowId+" td.ui-state-default").hover(footerRowCellMousein,footerRowCellMouseout)}if(j===gridColumnsLength-1&&$grid.options.height&&parseInt($grid.options.height,10)>0){$td.css("width",parseInt(gridColumns[j].width,10)+$grid._scrollbarWidth())}else{$td.css("width",gridColumns[j].width)}this._renderInnerCellMarkup($td,methodName,gridColumns[j].key)}if(hasFixed){this._syncFixedUnfixedRowHeights()}this.grid._footerInit($footerRow,null,true,css.footerRowCell)},_renderInnerCellMarkup:function($td,methodName,columnKey){var $textContainer,$iconContainer;$textContainer=$("<div></div>").attr("id",this._id("summaries","footer_row_text_container",methodName,columnKey)).addClass(this.css.footerRowTextContainer).appendTo($td).html(this.options.emptyCellText);$iconContainer=$("<div></div>").attr("id",this._id("summaries","footer_row_icon_container",methodName,columnKey)).addClass(this.css.footerRowIconContainer).insertBefore($textContainer);if($.ig.util.isIE7===true){$iconContainer.addClass(this.css.baseClassIE7)}if(this.options.showDropDownButton===false){$iconContainer.addClass(this.css.footerRowIconContainerEmpty);$textContainer.addClass(this.css.footerRowTextContainerEmpty)}},_virtualHorizontalScroll:function(event,args){if(this._isRenderedSummariesRows===false){return}var start=args.startColIndex,end=args.endColIndex,i,j,$row,$children,$td,sr=this._summariesRows,srLength=sr.length,columnSetting,columnKey,cols=this.grid._visibleColumns(),self=this;end=start+this.grid._virtualColumnCount;if(srLength>0){$children=sr[0];$.each($children,function(index,element){$("#"+self._id("summaries","methods_dialog",$(element).attr("data-key"))).remove()})}for(i=0;i<srLength;i++){$row=$("#"+sr[i].id);$children=$row.children();$children.html("");for(j=start;j<=end;j++){$td=$row.find("td:nth-child("+(j-start+1)+")");$td.html("");if(cols[j]===null||cols[j]===undefined){continue}this._renderInnerCellMarkup($td,sr[i].type,cols[j].key)}}for(i=start;i<end;i++){if(cols[i]!==null&&cols[i]!==undefined){columnKey=cols[i].key;columnSetting=this._getColumnSettingByKey(columnKey);if(columnKey===undefined||columnKey===null){continue}this._renderFooterIconMarkup(sr[0].type,columnKey);this._renderDropDown(columnKey);if(columnSetting===null||columnSetting===undefined){continue}this._renderFooterColumnInfo(columnKey,this._data[columnKey])}}},_isFixedFooters:function(){return this.grid.options.fixedFooters===true&&this.grid.options.height!==null},_isVirtualization:function(){var gridOptions=this.grid.options;return gridOptions.virtualization===true||gridOptions.rowVirtualization===true&&gridOptions.height!==null||gridOptions.columnVirtualization===true&&gridOptions.width!==null},_id:function(){var i,res=this.grid.element[0].id,argumentsLength=arguments.length;if(argumentsLength===0){return null}for(i=0;i<argumentsLength;i++){res+="_"+arguments[i]}return res},_isAllowedMethodName:function(methodName){var defaultMethodName,isAllowed=false,len=this.defaultSummaryMethods.length,i;for(i=0;i<len;i++){defaultMethodName=this.defaultSummaryMethods[i].type;if(defaultMethodName===methodName||defaultMethodName===methodName.substr(0,defaultMethodName.length)){isAllowed=true;break}}return isAllowed},_footerInit:function(owner,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}var rows,i;rows=this.grid.footersTable().find("[data-role=summaryrow]");rows.find("[data-skip=true]").remove();
for(i=0;i<rows.length;i++){this.grid._footerInit($(rows[i]),null,true,this.css.footerRowCell)}},_dataSummaries:function(){var ds=this.grid.dataSource;return ds.dataSummaries()},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;if(this.options.type===null){this.options.type=this.grid._inferOpType()}this._detachEvents();this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._footerRenderedHandler=$.proxy(this._footerRendered,this);this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._headerFooterInitHandler=$.proxy(this._footerInit,this);this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this);this._rowUpdatedHandler=$.proxy(this._rowUpdated,this);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggridfooterrendered",this._footerRenderedHandler);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.bind("iggridheaderextracellsmodified",this._headerFooterInitHandler);this.grid.element.bind("iggridupdatingeditrowended",this._rowUpdatedHandler);this.grid.element.bind("iggridupdatinginternalrowdeleted",this._rowUpdatedHandler);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this._virtualHorizontalScrollHandler=$.proxy(this._virtualHorizontalScroll,this);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this._initColumnSettings();this._setDataSourceColumnSettingsOptions();if(this.grid.element.igGridFeatureChooser!==undefined){this.grid.element.igGridFeatureChooser()}else{throw new Error($.ig.GridSummaries.locale.featureChooserNotReferenced)}}});$.extend($.ui.igGridSummaries,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid Tooltips 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.3.js
 *	modernizr.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.grid.framework.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){"use strict";$.widget("ui.igGridTooltips",{options:{visibility:"overflow",style:"tooltip",showDelay:500,hideDelay:300,columnSettings:[{columnKey:null,columnIndex:-1,allowTooltips:true}],fadeTimespan:150,cursorLeftOffset:10,cursorTopOffset:15},css:{tooltip:"ui-iggrid-tooltip",tooltipContent:"ui-iggrid-tooltip-content"},events:{tooltipShowing:"tooltipShowing",tooltipShown:"tooltipShown",tooltipHiding:"tooltipHiding",tooltipHidden:"tooltipHidden"},_createWidget:function(options,element){this.visible=false;this._canFadeIn=true;this._canFadeOut=true;$.Widget.prototype._createWidget.apply(this,arguments)},destroy:function(){this.grid.element.unbind(".tooltip");$("#"+this.id()+"_ruler").remove();this.tooltip.remove();$.Widget.prototype.destroy.call(this);return this},id:function(){return this.tooltip[0].id},_injectGrid:function(gridInstance,isRebind){if(isRebind===true){return}this.grid=gridInstance;this._createTooltip();this._createHandlers();this._unregisterGridEvents();this._registerGridEvents()},_createTooltip:function(){if(this.options.style==="tooltip"){this.tooltip=$("<div></div>").attr("id",this.grid.id()+"_tooltips").attr("role","tooltip").addClass("ui-tooltip").addClass("ui-widget").addClass("ui-corner-all").addClass("ui-widget-content").addClass(this.css.tooltip).css({position:"absolute",display:"none","white-space":"normal","word-wrap":"break-word"});this._createContainer()}else if(this.options.style==="popover"){this.tooltip=$("<div><div>").attr("id",this.grid.id()+"_tooltips").igPopover({fadeTimespan:this.options.fadeTimespan})}this._createRuler();this.tooltip.appendTo(document.body)},_createRuler:function(){$("<span></span>").attr("id",this.id()+"_ruler").css("display","none").css("white-space","normal").css("word-wrap","break-word").appendTo(document.body)},_createContainer:function(){$("<div></div>").attr("id",this.id()+"_container").addClass("ui-tooltip-content").addClass(this.css.tooltipContent).appendTo(this.tooltip).bind("mouseenter.tooltip",$.proxy(this._tooltipMouseEnter,this)).bind("mouseleave.tooltip",$.proxy(this._tooltipMouseLeave,this))},_displayOverflow:function(element){var ruler=$("#"+this.id()+"_ruler"),textHeightInPixels;ruler.text(element.text());ruler.css({"font-family":element.css("font-family"),"font-size":element.css("font-size"),"font-size-adjust":element.css("font-size-adjust"),"font-stretch":element.css("font-stretch"),"font-style":element.css("font-style"),"font-variant":element.css("font-variant"),"font-weight":element.css("font-weight"),"padding-left":element.css("padding-left"),"padding-top":element.css("padding-top"),"padding-right":element.css("padding-right"),"padding-bottom":element.css("padding-bottom")});ruler.width(element.width());textHeightInPixels=ruler.height();if(textHeightInPixels<=element.height()){return false}return true},_dataRendered:function(event,ui){var $tbody,$tbodyFixed;if(ui!==undefined){if($(ui.owner.element).attr("id")!==this.grid.id()){return}}$tbody=this.grid.element.children("tbody");this._registerMouseEvents($tbody);if(this.grid.hasFixedColumns()){$tbodyFixed=this.grid.fixedTable().find("tbody");this._registerMouseEvents($tbodyFixed)}if(this.grid.options.fixedHeaders===true){this._$thead=this.grid.headersTable().find("thead")}else{this._$thead=this.grid.container().find("#"+this.grid.id()+" thead")}},_rowsRendering:function(evt,args){var tbody;if(args.owner.id()!==this.grid.id()){return}tbody=this.grid.element.find("tbody");tbody.unbind("mouseleave.tooltip");tbody.unbind("mousemove.tooltip")},_rowsRendered:function(event,ui){var $tbody;if(ui!==undefined){if($(ui.owner.element).attr("id")!==this.grid.id()){return}}$tbody=this.grid.element.children("tbody");this._registerMouseEvents($tbody)},_registerMouseEvents:function(tbody){tbody.bind("mouseleave.tooltip",this._gridMouseLeaveHandler);tbody.bind("mousemove.tooltip",this._gridMouseMoveHandler)},_gridMouseLeave:function(event,ui){clearTimeout(this.timeoutShowing);clearTimeout(this.timeoutHiding);if(this.tooltip.css("display")!=="none"){this._hideTooltip(true)}this._currentlyHovered=null},_gridMouseMove:function(event,ui){var element=$(event.target).closest("td,th"),elementData,hidePrevious=true,shouldShow,hasFixedCols=this.grid.hasFixedColumns();if(element.closest("table").attr("id")!==this.grid.id()||hasFixedCols&&element.closest("table").attr("id")!==this.grid.id()+"_fixed"){return}this.mouseX=event.pageX;this.mouseY=event.pageY;if(element[0]===this._currentlyHovered||element.length===0){return}elementData=this._getElementValue(element);if(elementData===undefined){hidePrevious=true}if(element[0]===this._currentlyDisplayed&&this.visible===true){hidePrevious=false;clearTimeout(this.timeoutHiding);return}this._currentlyHovered=element[0];this._previouslyHoveredData=this._currentlyHoveredData;this._currentlyHoveredData=elementData;clearTimeout(this.timeoutShowing);shouldShow=this._shouldShowForTarget(element)&&elementData!==undefined&&elementData!==""&&$(event.target).attr("unselectable")===undefined;if(this.visible===true&&hidePrevious===true){this._hideTooltip(!shouldShow)}if(shouldShow===true){this._currentlyDisplayed=this._currentlyHovered;this._showTooltip()}},_tooltipMouseEnter:function(){clearTimeout(this.timeoutHiding)},_tooltipMouseLeave:function(){this._hideTooltip()},_getElementValue:function(element){var col,val,tlog,i,tid,row=element.closest("tr"),vrowidx=-1,$thead,hasFixedCols=this.grid.hasFixedColumns(),hskip=0;if(this.grid.options.virtualization||this.grid.options.columnVirtualization){hskip=this.grid._startColIndex||0}if(hasFixedCols){if(element.closest("div").attr("data-fixed-container")!==undefined){$thead=this.grid.fixedHeadersTable()}else{$thead=this.grid.headersTable()}col=$thead.find("thead th").eq(element.index()).data("columnIndex");col-=$thead.children("th[data-skip='true']").length;if(isNaN(col)){col=-1}}else{if(this._$thead.length>0){col=element.index()-this._$thead.children(":first").children("th[data-skip='true']").length+hskip}else{col=element.index()-element.parent().find("td[data-parent='true'],td[data-skip='true'],th").length+hskip}}if(col<0){return val}this._pRowIdx=this._rowIdx;this._rowIdx=element.closest("tbody").children("tr:not([data-container='true'],[data-grouprow='true'])").index(row);if(this.grid.options.virtualization||this.grid.options.rowVirtualization){if(this.grid.options.virtualizationMode==="fixed"){this._rowIdx+=this.grid._startRowIndex}else{vrowidx=parseInt(row.attr("data-row-idx"),10);this._rowIdx=vrowidx||this._rowIdx}}tlog=this.grid.dataSource.pendingTransactions();tid=parseInt(element.parent().attr("data-id"),10);for(i=tlog.length-1;i>=0;i--){if(tlog[i].type==="deleterow"){continue}if(tlog[i].type==="cell"){if(tlog[i].rowId===tid&&tlog[i].col===this.grid._visibleColumns()[col].key){val=tlog[i].value;break}}else{if(tlog[i].rowId===tid){val=tlog[i].row[this.grid._visibleColumns()[col].key];break}}}if(val===undefined&&this.grid.dataSource.dataView()[this._rowIdx]!==undefined){val=this.grid.dataSource.dataView()[this._rowIdx][this.grid._visibleColumns()[col].key]}if($.type(val)==="date"){if(this.grid.options.enableUTCDates===true){val=$.ig.formatter(val,"date","dateTime",true,this.grid.options.enableUTCDates)}}return val},_shouldShowForTarget:function(element){var shouldShow=true,realIdx,dataIdx,hasFixedColumns=this.grid.hasFixedColumns(),fixingDirection;switch(this.options.visibility){case"always":break;case"never":shouldShow=false;break;case"overflow":shouldShow=this._displayOverflow(element);break}if(shouldShow===false){return false}realIdx=element.index();dataIdx=element.parent().children("td:not([data-parent='true'],[data-skip='true'])").index(element);this._pColumnIdx=this._columnIdx;if(this.grid._isMultiColumnGrid){this._columnIdx=dataIdx}else{if(hasFixedColumns&&element.closest("[data-fixed-container]").length===1){this._columnIdx=this.grid.fixedHeadersTable().find("thead th[id]").not("[data-skip='true']").eq(dataIdx).data("columnIndex")}else{this._columnIdx=this._$thead.find("th[id]").not("[data-skip='true']").eq(dataIdx).data("columnIndex")}}if(this._columnIdx===undefined){this._columnIdx=realIdx}if(this._columnIdx<0||this._columnIdx>=this.grid.options.columns.length){return false}this._pColumnKey=this._columnKey;if(this.grid._isMultiColumnGrid){this._columnKey=this.grid._visibleColumns()[dataIdx].key}else{this._columnKey=this.grid.options.columns[this._columnIdx].key}return shouldShow&&this._shouldShowForColumn()},_shouldShowForColumn:function(){var i,colSettings=this.options.columnSettings;for(i=0;i<colSettings.length;i++){if(colSettings[i].columnKey===this._columnKey||colSettings[i].columnIndex===this._columnIdx){return colSettings[i].allowTooltips!==undefined?colSettings[i].allowTooltips:true}}return true},_hideTooltip:function(current){var self=this,args,fn;args={owner:this,tooltip:current===true?String(this._currentlyHoveredData):String(this._previouslyHoveredData),value:current===true?this._currentlyHoveredData:this._previouslyHoveredData,element:this._currentlyDisplayed,columnKey:current===true?this._columnKey:this._pColumnKey,index:current===true?this._rowIdx:this._pRowIdx,columnIndex:current===true?this._columnIdx:this._pColumnIdx};fn=function(){var noCancel=self._trigger(self.events.tooltipHiding,self,args);if(noCancel===true){self._hideTooltipNoDelay();self._trigger(self.events.tooltipHidden,self,args)}};if(typeof Modernizr==="object"&&Modernizr.touch===true){fn()}else{clearTimeout(this.timeoutHiding);this.timeoutHiding=setTimeout(fn,this.options.hideDelay)}},_showTooltip:function(){var self=this,args,fn;args={owner:this,tooltip:String(this._currentlyHoveredData),value:this._currentlyHoveredData,element:this._currentlyDisplayed,columnKey:this._columnKey,index:this._rowIdx,columnIndex:this._columnIdx};fn=function(){var noCancel=self._trigger(self.events.tooltipShowing,self,args);if(noCancel===true){self._showTooltipNoDelay(args.tooltip);self._trigger(self.events.tooltipShown,self,args)}};if(typeof Modernizr==="object"&&Modernizr.touch===true){fn()}else{this.timeoutShowing=setTimeout(fn,this.options.showDelay)}},_hideTooltipNoDelay:function(){if(this.options.style==="tooltip"){if(this._canFadeOut===true){this._canFadeOut=false;this.tooltip.fadeOut(this.options.fadeTimespan,$.proxy(this._fadeOutEnd,this))}}else if(this.options.style==="popover"){this.tooltip.igPopover("hide")}this.visible=false},_showTooltipNoDelay:function(value){var tooltip;if(this._currentlyDisplayed===null){return}clearTimeout(this.timeoutHiding);tooltip=$("#"+this.id());if(this.options.style==="tooltip"){this._updateTooltip(value);if(this._canFadeIn===true){this._canFadeIn=false;tooltip.fadeIn(this.options.fadeTimespan,$.proxy(this._fadeInEnd,this))}}else if(this.options.style==="popover"){tooltip.igPopover("show",$(this._currentlyDisplayed),value)}this.visible=true},_fadeOutEnd:function(){this._canFadeOut=true},_fadeInEnd:function(){this._canFadeIn=true},_updateTooltip:function(value){var tooltipContainer=$("#"+this.id()+"_container");tooltipContainer.text(value);tooltipContainer.parent().css("max-width",$(this._currentlyDisplayed).width());this._positionTooltip(tooltipContainer.parent())},_positionTooltip:function(tooltip){var win=$(window),left,top,tfullw=tooltip.outerWidth(),tfullh=tooltip.outerHeight();left=this.mouseX-win.scrollLeft()+this.options.cursorLeftOffset;top=this.mouseY-win.scrollTop()+this.options.cursorTopOffset;if(left+tfullw>win.width()){left=win.width()-tfullw}if(top+tfullh>win.height()){top=win.height()-tfullh}tooltip.css({top:top+win.scrollTop(),left:left+win.scrollLeft()})},_columnFixed:function(args){var $tbodyFixed;if(this.grid.hasFixedColumns()){$tbodyFixed=this.grid.fixedTable().find("tbody");this._registerMouseEvents($tbodyFixed)}},_createHandlers:function(){this._dataRenderedHandler=$.proxy(this._dataRendered,this);this._rowsRenderedHandler=$.proxy(this._rowsRendered,this);this._rowsRenderingHandler=$.proxy(this._rowsRendering,this);this._gridMouseLeaveHandler=$.proxy(this._gridMouseLeave,this);this._gridMouseMoveHandler=$.proxy(this._gridMouseMove,this)},_registerGridEvents:function(){this.grid.element.bind("iggrid_rowsrendering.tooltip",this._rowsRenderingHandler);this.grid.element.bind("iggridrendered.tooltip",this._dataRenderedHandler);this.grid.element.bind("iggridrowsrendered.tooltip",this._rowsRenderedHandler)},_unregisterGridEvents:function(){this.grid.element.unbind("iggrid_rowsrendering.tooltip",this._rowsRenderingHandler);this.grid.element.unbind("iggridrendered.tooltip",this._dataRenderedHandler);this.grid.element.unbind("iggridrowsrendered.tooltip",this._rowsRenderedHandler)}});$.extend($.ui.igGridTooltips,{version:"13.1.20131.2523"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Grid Editing 13.1.20131.2523
*
* Copyright (c) 2011-2014 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery-1.4.4.js
* jquery.ui.core.js
* jquery.ui.widget.js
* infragistics.ui.grid.framework.js
* infragistics.ui.editors.js
* infragistics.ui.validator.js
* infragistics.ui.combo.js
* infragistics.ui.rating.js
* infragistics.ui.shared.js
* infragistics.dataSource.js
* infragistics.util.js
*/
(function($){var _aNull=function(v,nan){return v===null||v===undefined||v==="undefined"||nan&&isNaN(v)},_int=function(e,val){val=e?e.css(val):0;try{val=parseInt(val,10)}catch(ignore){}return val&&!isNaN(val)?val:0},_filter=function(elem,name,p1,p2){elem=elem.data("igEditorFilter");return elem?elem.options.provider[name](p1,p2):null},_now=function(){return(new Date).getTime()},_throw=function(def){var str=$.ig.GridUpdating&&$.ig.GridUpdating.locale?$.ig.GridUpdating.locale[def]:def;throw new Error(str||def)},_stop=function(e){if(e&&e!==1){try{e.preventDefault();e.stopPropagation()}catch(ignore){}}};$.widget("ui.igGridUpdating",{grid:null,options:{columnSettings:[{columnKey:null,editorType:null,editorProvider:null,editorOptions:null,required:null,readOnly:null,validation:null,defaultValue:null}],editMode:"row",showReadonlyEditors:true,enableDeleteRow:true,enableAddRow:true,validation:false,doneLabel:null,doneTooltip:null,cancelLabel:null,cancelTooltip:null,addRowLabel:null,addRowTooltip:null,deleteRowLabel:null,deleteRowTooltip:null,rowEditDialogCaptionLabel:null,showDoneCancelButtons:true,enableDataDirtyException:true,rowEditDialogContentHeight:150,rowEditDialogFieldWidth:140,rowEditDialogWidth:370,rowEditDialogHeight:"350",startEditTriggers:"click,F2,enter",rowEditDialogContainment:"owner",rowEditDialogOkCancelButtonWidth:120,rowEditDialogRowTemplate:"<tr><td>${headerText}</td><td data-key='${dataKey}'><input /></td></tr>",rowEditDialogRowTemplateID:null,horizontalMoveOnEnter:false,excelNavigationMode:false,saveChangesSuccessHandler:null,saveChangesErrorHandler:null,swipeDistance:"100px"},events:{editRowStarting:null,editRowStarted:null,editRowEnding:null,editRowEnded:null,editCellStarting:null,editCellStarted:null,editCellEnding:null,editCellEnded:null,rowAdding:null,rowAdded:null,rowDeleting:null,rowDeleted:null,dataDirty:null,generatePrimaryKeyValue:null,rowEditDialogOpening:null,rowEditDialogOpened:null,rowEditDialogContentsRendering:null,rowEditDialogContentsRendered:null,rowEditDialogClosing:null,rowEditDialogClosed:null},css:{buttonContainer:"ui-iggrid-buttoncontainer ui-widget-content ui-corner-all",button:"ui-iggrid-button ui-state-default ui-corner-all",doneButton:"ui-iggrid-donebutton ui-priority-primary ui-corner-all",cancelButton:"ui-iggrid-cancelbutton ui-corner-all",deleteButton:"ui-iggrid-deletebutton ui-state-default ui-corner-all",buttonHover:"ui-iggrid-buttonhover ui-state-hover",buttonDisabled:"ui-iggrid-buttondisabled ui-state-disabled",buttonActive:"ui-iggrid-buttonactive ui-state-active",doneIcon:"ui-iggrid-doneicon ui-icon ui-icon-check",cancelIcon:"ui-iggrid-cancelicon ui-icon ui-icon-cancel",buttonIconOnly:"ui-iggrid-button-icon-only",editingCell:"ui-iggrid-editingcell",addRow:"ui-iggrid-addrow ui-widget-header",addRowHover:"ui-iggrid-addrowhover ui-state-hover",addRowActive:"ui-iggrid-addrowactive ui-state-active",addRowIcon:"ui-iggrid-addrowicon ui-icon ui-icon-circle-plus",deleteIcon:"ui-iggrid-deleteicon ui-icon ui-icon-circle-close",editor:"ui-iggrid-editor",rowEditDialogHeaderCaption:"ui-dialog-titlebar ui-iggrid-filterdialogcaption ui-widget-header ui-corner-all ui-helper-reset ui-helper-clearfix",rowEditDialogHeaderCaptionTitle:"ui-dialog-title",rowEditDialog:"ui-dialog ui-draggable ui-resizable ui-iggrid-dialog ui-widget ui-widget-content ui-corner-all",blockArea:"ui-widget-overlay ui-iggrid-blockarea",rowEditDialogOkCancelButton:"ui-dialog-buttonpane ui-widget-content ui-helper-clearfix ui-iggrid-filterdialogokcancelbuttoncontainer",rowEditDialogTable:"ui-iggrid-filtertable ui-helper-reset"},setCellValue:function(rowId,colKey,value,tr){var $tr,$td,tdi;if(!_aNull(rowId)&&typeof colKey==="string"){$tr=tr?$(tr):this.grid.element.children("tbody").children('tr[data-id="'+rowId+'"]');if($tr.length!==1){$tr=1;$td=$()}else{tdi=this.grid._getCellIndexByColumnKey(colKey);$td=tdi>=0?$tr.children().eq(tdi):$();$tr=$tr[0]}if(this.isEditing()&&this._tds[colKey]&&$td.find(".ui-igedit,.ui-igcombo").length>0&&this.editorForKey(colKey)instanceof jQuery){if(this.editorForKey(colKey).data().hasOwnProperty("igCombo")){this.editorForKey(colKey).igCombo("value",value)}else{this.editorForKey(colKey).igEditor("value",value)}this._notifyChanged()}else{this._update(rowId,$tr,value,colKey,$td)}}},updateRow:function(rowId,values,tr){var key;if(!_aNull(rowId)&&values){tr=tr||this.grid.element.children("tbody").children('tr[data-id="'+rowId+'"]')[0]||1;if(this.isEditing()&&$(tr).find(".ui-igedit,.ui-igcombo").length>0){for(key in values){if(values.hasOwnProperty(key)&&this.editorForKey(key)instanceof jQuery){if(this.editorForKey(key).data().hasOwnProperty("igCombo")){this.editorForKey(key).igCombo("value",values[key])}else{this.editorForKey(key).igEditor("value",values[key])}}}this._notifyChanged()}else{this._update(rowId,tr,values)}}},addRow:function(values){values=values||{};var cols=this.options.columnSettings,i=cols?cols.length:0,key,val;while(i-->0){key=cols[i].columnKey;val=cols[i].defaultValue;if(!_aNull(val)&&!_aNull(key)){if(_aNull(values[key])){values[key]=val}}}this._update(values)},deleteRow:function(rowId,tr){if(!_aNull(rowId)){tr=tr||this.grid.element.children("tbody").children('tr[data-id="'+rowId+'"]')[0]||1;if(this.isEditing()&&$(tr).find(".ui-igedit,.ui-igcombo").length>0){this.endEdit(false)}this._update(rowId,tr)}},startEdit:function(row,col,e){var td=this.grid.cellAt(col,row),tr;if(this.options.editMode==="rowedittemplate"){tr=this.grid.rowAt(row);return this._startEditRowTemplate(e,$(tr))}if(td){td=this._startEdit($(td),e||1,1)===1}return!!td},startAddRowEdit:function(e){var tr=this._newTR;if(this.options.editMode==="rowedittemplate"){return this._startEditRowTemplate(e,null,null,true)}if(tr){tr=this._startEdit($(tr.children()[0]),e||1,1,1,this._addTR.children()[0].offsetHeight)===1}return!!tr},endEdit:function(update,e){if(this.options.editMode==="rowedittemplate"){return update?this._rowEditDialogDoUpdate(e):this._closeRowEditDialog(e)}return!this._endEdit(e||1,update)},findInvalid:function(){var key,all=this._editors;for(key in all){if(all.hasOwnProperty(key)&&all[key]&&!_filter(all[key],"isValid")){return key}}return null},isEditing:function(){return!!this._tds},editorForKey:function(key){var e=this._editors;return e?e[key]:null},editorForCell:function(td,add){var e,key=this._key(td),edits=this._editors;if(!edits){edits=this._editors={}}e=edits[key];if(!e&&add){e=edits[key]=this._createEditor(td,key)}return e},findHiddenComboEditor:function(editor){var combos=this._hCombos,combo=combos&&editor?editor.data("igCombo"):null,hComboID=combo?combo.options._hComboID:null,obj=hComboID?combos[hComboID]:null;combo=obj?obj.combo.data("igCombo"):null;if(combo){combo._colKey=obj.key}return combo},_setOption:function(key,value){var o=this.options;if(o[key]===value){return this}this._endEdit();this._doButtons(2);o[key]=value;if(key.indexOf("ddRow")>0){this._headerRendered();this.grid._initializeHeights();if(this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true){this.grid._onVirtualVerticalScroll()}}else if(key==="saveChangesSuccessHandler"){this._addDSSuccessHandler()}else if(key==="saveChangesErrorHandler"){this._addDSErrorHandler()}return this},_fire:function(name,e,a){if(a&&e&&e!==1){a.owner=this;return this._trigger(name,e,a)}return 1},_loc:function(prop,title){prop+=title?"Tooltip":"Label";title=this.options[prop];if(_aNull(title)){title=$.ig.GridUpdating&&$.ig.GridUpdating.locale?$.ig.GridUpdating.locale[prop]:null}return title||""},_div:function(){return this.grid.container()},_hscroll:function(scroller){if(!this._hscr1){var grid=this.grid.element;this._hscr1=$("#"+grid[0].id+"_hscroller");this._hscr2=this._hscr1.length?this._hscr1:grid.parent()}return scroller?this._hscr1:this._hscr2},_groupedColumnsChanged:function(args){this._groupCols=args.groupedColumns.length;this._mapAdd=this._map=null},_headerRendered:function(i){var th,plus,td,col,colSet,txt,title,me=this,css=me.css,shift=me._addTrShift,colSpan=0,tr=me._addTR,o=me.options,grid=me.grid,cols=grid.options.columns,len=cols.length,hiddenColumns=grid._initialHiddenColumns||[],hiddenKeys=[];if(!o.enableAddRow||i===1){if(tr){tr.remove();me._newTR.remove();me._hierTD=me._newTR=me._addTR=null}return}txt=me._loc("addRow")||"&nbsp;";title=me._loc("addRow",1);if(tr){tr.find(".anr_t").html(txt);tr.find(".ui-iggrid-addrow").attr("title",title);tr.find(".anr_i").css("display","inline-block")}th=me._div().find("thead");if(!th||tr){return}plus=o.showPlusIcon;tr=me._addTR=$("<tr />").addClass(css.addRow).attr("data-skip","true").appendTo(th);if(shift){for(i=0;i<shift.length;i++){$(shift[i]).appendTo(tr)}}else{me._hierOn=_now();grid._headerInit(tr);me._hierTD=tr.children().length}for(i=0;i<len;i++){if(!cols[i].hidden){colSpan++}else{hiddenKeys.push(cols[i].key)}}for(i=0;i<hiddenColumns.length;i++){if($.ig.indexInArray(hiddenKeys,hiddenColumns[i].key)===-1){hiddenKeys.push(hiddenColumns[i].key);colSpan--}}td=$('<td colspan="'+colSpan+'"></td>').attr("title",title).addClass(css.addRow).appendTo(tr);me._addLeft=_int(td,"paddingLeft");$("<span />").css("display","inline-block").addClass(css.addRowIcon).addClass("anr_i").appendTo(td);$("<span>"+txt+"</span>").addClass("anr_t").css("outline",0).attr("tabIndex",me._ti+1).focus(function(e){me._onEvt(e,5)}).blur(function(e){me._onEvt(e,6)}).appendTo(td);tr=me._newTR=$("<tr />").attr("data-skip","true").appendTo(th).hide();shift=this._newTrShift;if(shift){for(i=0;i<shift.length;i++){$(shift[i]).appendTo(tr)}}else{grid._headerInit(tr)}for(i=0;i<len;i++){col=cols[i];if(!col.hidden&&$.ig.indexInArray(hiddenKeys,col.key)===-1){colSet=me._colSet(0,col?col.key:null);plus=colSet&&colSet.readOnly;txt=plus?colSet.defaultValue:null;txt=_aNull(txt)?"&nbsp;":grid._renderCell(txt,col);td=$("<td>"+txt+"</td>").addClass(css.editingCell).appendTo(tr);if(plus&&col&&col.key===grid.options.primaryKey){me._tdAddPrime=td}}}},_hierGridInDiv:function(){var css,kids,len,elem,extra=0,i=-1,tr=this._newTR,trA=this._addTR;kids=tr.parent().children();while(++i<kids.length){if(kids[i]!==trA[0]&&kids[i]!==tr[0]){break}}if(i>kids.length){return}kids=kids[i].childNodes;len=kids.length;for(i=0;i<len;i++){elem=kids[i];css=elem.getAttribute("data-skip")?elem.className:null;if(css&&(css.indexOf("-expand")>=0||css.indexOf("-rowselector")>=0)){extra++}else{break}}kids=tr.children();len=kids.length;for(i=0;i<len;i++){elem=kids[i];if(elem.getAttribute("data-skip")){extra--}else{break}}while(extra-->0){this.grid._headerInit(tr,null,true);this.grid._headerInit(trA,null,true)}},_headerInit:function(){if(this._addTR){this._addTR.find("[data-skip=true]").remove();this.grid._headerInit(this._addTR,null,true)}if(this._newTR){this._newTR.find("[data-skip=true]").remove();this.grid._headerInit(this._newTR,null,true)}this._mapAdd=this._map=null},_dataRendered:function(){if(this._wasInit){return}this._scrollDiv();if(this._renderTouchUI&&this.options.editMode!=="row"){this._div().bind(this._tEvts);delete this._evts.mousemove;delete this._evts.mouseleave}this._div().bind(this._evts);this._wasInit=true},_findCell:function(e){var i=0,td=$(e),grid=this.grid.element[0],headerst=this.grid.headersTable()[0];if(!td.is("td")){td=td.closest("td")}e=td;while(e&&i++<5){e=e.parent();if(e&&(e[0]===grid||e[0]===headerst)){break}}return i===3&&this._col(td)>=0&&this._row(td)>=0?td:null},_td:function(from){var i,tds=this._tds;if(tds){for(i in tds){if(tds.hasOwnProperty(i)&&tds[i]&&(from?i===from:true)){return tds[i]}}}},_row:function(td){return td?td.parent().index():-1},_idForCol:function(id,shift){var last=-1,map=this._col(1),i=map?map.length:0;while(--i>=0){if(map[i]<0){continue}if(shift===-2){return i}if(map[i]===id){if(shift===1){return last}if(shift===-1){shift=-2}else{break}}last=i}return i},_keyForEditor:function(editor){var ckey;editor=editor instanceof jQuery?editor[0]:editor;for(ckey in this._editors){if(this._editors.hasOwnProperty(ckey)&&this._editors[ckey]&&this._editors[ckey][0]==editor){return ckey}}},_isAdd:function(td){return td===1?this._adding:this._isSrc(this._addTR,td)||this._isSrc(this._newTR,td)},_col:function(td){var shift,len,cols,id,i,add=this._isAdd(td),map=add?this._mapAdd:this._map;if(!map){shift=this._colShift(td);map=[];id=i=-1;while(shift-->0){map[++i]=-1}cols=this.grid.options.columns;len=cols.length;while(++id<len){if(cols[id]&&!cols[id].hidden){map[++i]=id}}if(add){this._mapAdd=map}else{this._map=map}}if(td===1){return map}id=td.index()+(this.grid._startColIndex||0);return td&&id<map.length?map[id]:-1},_colSet:function(td,key){var i,cols=this.options.columnSettings;if(!key){key=this._key(td)}i=cols&&key?cols.length:0;while(i-->0){if(cols[i].columnKey===key){return cols[i]}}},_isSame:function(td1,td2){return this._row(td1)===this._row(td2)&&this._col(td1)===this._col(td2)},_gridCol:function(key,id){var i=-1,cols=this.grid.options.columns;while(++i<cols.length){if(cols[i].key===key){return id?i:cols[i]}}},_prime:function(td){var key=td.parent().attr("data-id");return _aNull(key)?this._row(td):this._fixPrime(key)},_defVal:function(key,fire){var col;if(key){col=this._colSet(null,key);col=col?col.defaultValue:null;if(fire&&key===this.grid.options.primaryKey){col=this._defValue;if(!col){col={value:col||this._addRowNum};this._fire("generatePrimaryKeyValue",this._evt||{},col);this._defValue=col=col.value}}}return col},_addReadOnly:function(add){var v,key,prime,cols=this.options.columnSettings,vals={};for(key in cols){if(cols.hasOwnProperty(key)){v=cols[key];key=v.columnKey;if(v.readOnly){if(!add){vals[key]=this._getVal(this._row_,key)}else{v=this._defVal(key,1);if(!_aNull(v)){prime=key;vals[prime]=v}}}}}if(!prime&&add){this._fixPrime(vals,this.grid.dataSource)}return vals},_key:function(td){var cols=this.grid.options.columns,col=this._col(td);col=cols&&col>=0?cols[col]:null;return col?col.key:null},_equals:function(v1,v2){return v1===v2||v1&&v2&&v1.getTime&&v2.getTime&&v1.getTime()===v2.getTime()},_val:function(td,arg,vals){var val,add=this._adding,row=this._row_,key=this._key(td);if(add){val=this._defVal(key,vals&&_aNull(vals[key]))}else{val=this._getVal(row,key)}if(arg){if(add||!this._equals(val,arg.value)){if(vals){return arg.value}this._update(row,td.parent()[0],arg.value,key,td)}return undefined}return val},_colShift:function(td,tr){var i,add,shift=this._cShift,shiftAdd=this._cShiftAdd;if(!tr&&td){tr=td.parent()[0]}if(!tr){return shift<0?0:shift}add=this._isAdd(tr);if(add){if(shiftAdd>=0){return shiftAdd}}else if(shift>=0){return shift}tr=tr?tr.childNodes:null;if(!tr){return 0}shift=0;for(i=0;i<tr.length-1;i++){td=tr[i].className;if(td&&(td.indexOf("-expandcolumn")>=0||td.indexOf("-rowselector")>=0)||tr[i].getAttribute("data-skip")){shift++}else{break}}if(add){this._cShiftAdd=shift}else{this._cShift=shift}return shift},_cur:function(td,i){return{tbl:td.parent().parent().parent(),row:i?this._rowIndex:this._row(td),col:this._col(td)}},_nextTD:function(cur,shift,edit){var i,tds,tr,td,map,tbody=cur.tbl.children("tbody")[0],rows=tbody?tbody.childNodes:0,rowsLen=rows?rows.length:0,row=cur.row;if(rowsLen<1||row<0||row>=rowsLen){return}tr=rows[row];if(!tr){return}tds=tr.childNodes;map=this._col(1);if(shift==="-tr1"||shift===-1&&cur.col===0&&cur.row===0){tr=row-1<0?rowsLen-1:row-1}else{tr=row+(shift||1);tr=tr>=rowsLen?0:tr}i=this._idForCol(cur.col,shift);if(shift&&shift!=="-tr1"){if(i>=0){cur.col=map[i];td=tds[i]}if(!td&&edit){if(tr>=0&&tr<rowsLen){if(shift>0){i=map[0]>=0?0:1}else{i=map.length;while(--i>=0){if(map[i]>=0){break}}}if(i>=0){cur.col=map[i];cur.row=tr;td=rows[cur.row].childNodes[i]}}}}else{if(tr<rowsLen){cur.row=tr;td=rows[cur.row].childNodes[i]}else{td=null}}cur.td=td?$(td):null;return td?cur:null},_nextEditor:function(key,shift){var e,col,ok=null,edits=this._editors;for(col in edits){if(edits.hasOwnProperty(col)){if(shift&&key===col){return ok}if(col){e=edits[col];if(e&&e[0]&&e[0].offsetWidth>0){if(key===null){return e}ok=e}}if(key===col){key=null}}}},_nextEdit:function(e,shift,from){var cur,td=this._td(from);if(!td){return}cur=this._cur(td,true);while(this._nextTD(cur,shift,1)){if(_aNull(this.editorForCell(cur.td))&&this.options.editMode!=="cell"){continue}if(this._startEdit(cur.td,e,this.options.editMode==="cell"?1:false,null,null,null,true)){return}}this._endEdit(e,1)},_createEditor:function(td,key,element){var v,oValid,elem,oEdit={},me=this,gridCol=me._gridCol(key)||{},format=gridCol.format,css=me.css.editor,xy=me._xy,col=me._colSet(td,key),provider=col?col.editorProvider:null,topBorder=me._tdBdrTop,retDone=$("#"+this.grid.container().attr("id")+"_igButton");if(col&&col.readOnly&&!element){return null}if(!xy&&!element){topBorder=me._tdBdrTop=_int(td,"borderTopWidth");v=$("<span />").addClass(css).prependTo(td);me._xy=xy={x:_int(v,"marginLeft"),y:_int(v,"marginTop")};xy.dx=xy.x+_int(v,"marginRight");xy.dy=xy.y+_int(v,"marginBottom");v.remove()}v=null;if(col){oEdit=col.editorOptions||oEdit;oValid=oEdit.validatorOptions;v=col.required;if(!oValid&&(col.validation||v)){oValid={}}if(v){oValid.required=oEdit.required=true}}if(me.options.validation&&!oValid){oValid={}}if(oValid){if(!me.grid.element.igValidator){_throw("igValidatorException")}if(col){col.editorOptions=oEdit}oEdit.validatorOptions=oValid;oValid.bodyAsParent=false;oValid.errorHidden=function(){me._error=null;if(me._butDone){me._butDone.removeClass(me.css.buttonDisabled)}if(retDone.length>0){retDone.igButton("option","disabled",false)}};oValid.errorShowing=function(){if(!_aNull(me._error)&&me._error!==key){return false}};oValid.errorShown=function(evt,ui){me._error=key;if(me._butDone){me._butDone.addClass(me.css.buttonDisabled)}me._scrollTo(key)}}if(!provider){if(gridCol.dataType==="bool"&&(format==="checkbox"||!format&&me.grid.options.renderCheckboxes)&&!element){provider=new $.ig.EditorProviderCheckbox}else if(col&&col.editorType==="combo"){provider=new $.ig.EditorProviderCombo}else if(col&&col.editorType==="rating"){provider=new $.ig.EditorProviderRating}else{provider=new $.ig.EditorProviderDefault}}me._hComboInit(oEdit);elem=provider.createEditor(me,key,col,me._ti,format,gridCol.dataType,me._val(td),element);if(!element){elem.addClass(css).css({marginLeft:xy.x-_int(td,"paddingLeft")+"px",marginTop:xy.y-topBorder-_int(td,"paddingTop")+"px"})}v=elem.igEditorFilter({provider:provider});return v},_notifyChanged:function(){var e=this._butDone;if(e){if(this.findInvalid()){e.addClass(this.css.buttonDisabled)}else{e.removeClass(this.css.buttonDisabled)}}e=$("#"+this.grid.container().attr("id")+"_igButton");if(e.length>0){if(this.findInvalid()){e.igButton("option","disabled",true)}else{e.igButton("option","disabled",false)}}this._modified=1},_notifyEditorKey:function(e,colKey){var but,old,val,next,cur,tar,key=e.keyCode||e.which||0,esc=key===27,o=this.options,shift;if(key!==9&&key!==13&&!esc){return}cur=this._editors[colKey];if(!cur||key===13&&(e.shiftKey||e.ctrlKey||this._13)){return}if(esc){old=cur._oldCellVal;val=_filter(cur,"getValue");if(!this._equals(old,val)){_filter(cur,"setValue",old);if(!this._equals(_filter(cur,"getValue"),val)){_filter(cur,"validate");_stop(e);return}}return this._endEdit(e,null,200)}if(key===13||!this._adding&&o.editMode==="cell"){tar=$(e.target);if(tar.length>0){tar.find("input").first().trigger("blur")}if(this.options.horizontalMoveOnEnter){shift=1}else{shift=key===9?e.shiftKey?-1:1:0}return this._nextEdit(e,shift)}next=this._nextEditor(colKey,e.shiftKey);if(!_filter(cur,"validate")&&_filter(cur,"keepFocus")){_stop(e);return}if((key===13||key===9)&&!next&&!this._adding){tar=$(e.target);if(tar.length>0){tar.find("input").first().trigger("blur")}}_stop(e);try{if(next&&this._adding&&!_aNull(this.grid._startColIndex)&&this.grid.table&&this.grid.table.rows[0]&&!this.grid.cellAt(this._col(next.parent()),0)){next=null}}catch(ex){next=null}if(next){this._scrollTo(next.parent(),next);return}but=this._butDone;if(!but||but[0].offsetWidth===0){return this._nextEdit(e,e.shiftKey?-1:0)}if(but.hasClass(this.css.buttonDisabled)){but=this._butCancel}but[0].focus();this._prevEdit=cur},_evtArg:function(td,editor,val){var arg={rowAdding:!!this._adding,columnIndex:this._col(td),rowID:this._row_,columnKey:this._key(td),editor:editor};arg.value=_aNull(val)?null:val;return arg},_checkHidden:function(vals){var col,key,colG,cols=this.grid.options.columns,i=cols.length;while(i-->0){colG=cols[i];if(colG&&colG.hidden){key=colG.key;col=this._colSet(null,key);col=col&&_aNull(vals[key])?col.defaultValue:null;if(col!==null){vals[key]=col}}}},_isToggle:function(e){e=e&&e.type&&e.type.indexOf("click")>=0?e.target:null;return e&&e.className&&e.className.indexOf("ui-icon-check")>=0},_lastTDWidth:function(td,width){var pad=_int(td,"paddingRight")>12,div=pad||!td.next()[0]?td.closest("div")[0]:null,v=div&&td[0].offsetLeft+td[0].offsetWidth>div.clientWidth+5?div.offsetWidth-div.clientWidth:0;if(v>10){div=pad?null:this._hscroll(1)[0];if(!div||div.offsetWidth<div.clientWidth+3){width-=Math.min(18,v)}}return width},_hComboInit:function(oEdit){var i,gCol,col,key,cols,combo,cell=this.options.editMode==="cell",hComboID=oEdit.parentCombo,combos=this._hCombos;if(!hComboID){return}cols=this.options.columnSettings;i=cols.length;combo=combos?combos[hComboID]:null;if(combo){oEdit._hComboID=hComboID;oEdit.parentCombo=combo.combo;i=0}while(i-->0){col=cols[i];key=col.columnKey;gCol=this._gridCol(key);combo=col.editorType==="combo"&&(cell||gCol&&gCol.hidden)?col.editorOptions:null;if(combo&&combo.id===hComboID){this._hCombos=combos=combos||{};oEdit._hComboID=hComboID;oEdit.parentCombo=combo=$('<span id="'+hComboID+'"></span>').igCombo(combo);combos[hComboID]={key:key,combo:combo};return}}},_hComboEdit:function(editor){var val,o,combo=this.findHiddenComboEditor(editor);if(!combo){return}o=combo.options;if(o.filteringType){combo.selectedIndex(-1);combo.activeIndex(-1);combo.dataBind()}val=this.grid.getCellValue(this._row_,combo._colKey);if(o.allowCustomValue){combo.text(val===null?o.nullText||"":val)}else{combo.value(val)}},_hComboRemove:function(destroy){var i,o,combo,combos=this._hCombos;if(!combos){return}for(i in combos){if(combos.hasOwnProperty(i)){combo=combos[i].combo;if(combo){combo.igCombo("destroy")}}}delete this._hCombos;combos=this.options.columnSettings;i=destroy?0:combos.length;while(i-->0){o=combos[i].editorOptions;combo=o?o._hComboID:null;if(combo){o.parentCombo=combo}}},_startEdit:function(td,e,foc,add,height,toggle,focNoDelay){var i,tds,width,arg,editor,val,grid=this.grid,prime=grid.options.primaryKey,td0=td?td[0]:null,but=null,v=false,o=this.options;if(!td0){return}if(e){delete this._defValue;this._delHover();this._cShift=this._cShiftAdd=-1;this._map=undefined;if(this._tds){if(!add){td=this._cur(td)}if(this._endEdit(e,1)){return 1}if(!add){i=this._idForCol(td.col);tds=td.row<0||td.col<0||i<0?null:td.tbl.children("tbody")[0];td=tds?tds.childNodes[td.row]:null;if(td){td=td.childNodes[i]}if(!td){return}td=$(td)}}if(!add&&!this._checkRow(td.parent())){return}this._row_=add?-1:this._prime(td);this._rowIndex=add?-1:this._row(td);if(!height){height=td[0].offsetHeight}if(add||o.editMode==="row"){arg={rowAdding:!!add,rowID:this._row_};if(!this._fire("editRowStarting",e,arg)){this._row_=null;this._rowIndex=-3;return}if(add){this._adding=add;if(this._tdAddPrime){i=this._gridCol(prime);val=this._defVal(prime,1);this._tdAddPrime.html(i?grid._renderCell(val,i):val)}this._addTR.hide();this._newTR.show();if(!this._addFixScroll){this._addFixScroll={scroll:function(){var cont=grid.scrollContainer()[0],left1=cont?cont.scrollLeft:-1,left2=this.scrollLeft;if(!_aNull(left2)&&left1>=0&&left1!==left2){cont.scrollLeft=left2}}}}this._addTR.closest("div").bind(this._addFixScroll)}tds=td.parent().children();this._evt=e;for(i=0;i<tds.length;i++){td=$(tds[i]);if(this._col(td)<0||tds[i].offsetWidth<3){continue}td.addClass(this.css.editingCell);if(this._startEdit(td,null,foc===1||e&&td[0]===td0,add,height,this._isToggle(e)&&td[0]===td0)){v=1;foc=null;but=but||td}}delete this._evt;if(v&&but&&o.showDoneCancelButtons){this._doButtons(but)}if(this._butDelete){if(add){this._butDelete.addClass(this.css.buttonDisabled)}else{this._butDelete.removeClass(this.css.buttonDisabled)}}if(v){_stop(e);this._fire("editRowStarted",e,arg)}else{tds.removeClass(this.css.editingCell)}this._sel("act",but);if(add&&v){while(height-this._newTR[0].offsetHeight>0){if(v){v=null;td=$(tds[0]);add=_int(td,"paddingTop")+_int(td,"paddingBottom")+_int(td,"borderTopWidth")+_int(td,"borderBottomWidth")+1}if(--add<0){break}td.css("height",height-add)}v=1}return v}toggle=toggle||this._isToggle(e)}editor=this.editorForCell(td,1);if(_aNull(this._row_)||!editor){return}width=td.outerWidth();if(!height){height=td[0].offsetHeight}arg=this._evtArg(td,editor,this._val(td,null,1));if(!width||!height){return}if(!this._fire("editCellStarting",e||this._evt,arg)){return"canceled"}this._hComboEdit(editor);width=this._lastTDWidth(td,width);width-=this._xy.dx+2;height-=this._xy.dy;if(e){_stop(e);td.addClass(this.css.editingCell)}editor.prependTo(td);_filter(editor,"setSize",Math.max(8,width),Math.max(10,height));if(!this._tds){this._tds={}}this._tds[this._key(td)]=td;v=_filter(editor,"validator");if(v&&v._setOption){v._setOption("bodyAsParent",grid.options.fixedHeaders!==false||!grid.options.height)}_filter(editor,"setValue",arg.value);editor._oldCellVal=_filter(editor,"getValue");this._fire("editCellStarted",e||this._evt,arg);if(foc){this._scrollTo(td,editor,false,focNoDelay?false:300,toggle)}if(e){this._sel("act",td)}return 1},_endEdit:function(e,update,foc){var i,editor,val,key,td,arg,oldVals,stop,oldUpdate=update,eArg=e||"undefined",add=this._adding,tr=null,argR=null,vals=null,tds=this._tds,o=this.options;if(!tds||this._skip){return}if(e&&e.type!=="mousedown"){stop=e;_stop(stop)}i=add||o.editMode==="row";if(!this._modified&&!add){update=false}if(i){for(key in tds){if(tds.hasOwnProperty(key)){td=tds[key];if(e&&!_aNull(td)){editor=this.editorForCell(td);if(oldUpdate&&!_aNull(editor)&&editor[0]&&editor[0].offsetWidth&&editor.igEditorFilter("hasInvalidMessage")){if(!stop){stop=e;_stop(stop)}this._scrollTo(td,editor,1);return 1}}}}vals=this._addReadOnly(add);oldVals={};for(key in tds){if(tds.hasOwnProperty(key)){td=tds[key];if(oldUpdate&&!_aNull(td)&&!_aNull(this.editorForCell(td))){editor=this.editorForCell(td);vals[key]=_filter(editor,"getValue");oldVals[key]=editor._oldCellVal;if(e&&editor[0]&&editor[0].offsetWidth&&!_filter(editor,"validate",!o)){if(!stop){stop=e;_stop(stop)}if(o){this._scrollTo(td,editor,1)}o=null}}}}if(e&&!o){return 1}if(add){this._checkHidden(vals)}this._skip=1;argR={oldValues:oldVals,values:vals,rowID:this._row_,keepEditing:false,update:!!update,rowAdding:!!add};if(!this._fire("editRowEnding",eArg,argR)){argR.update=update=oldUpdate=false}delete this._skip;if(e&&argR.keepEditing){return 1}}if(i){this._td().parent().children().removeClass(this.css.editingCell)}tr=null;for(key in tds){if(tds.hasOwnProperty(key)){td=tds[key];if(!_aNull(td)&&!_aNull(this.editorForCell(td))){editor=this.editorForCell(td);if(!vals){if(e&&oldUpdate&&!_filter(editor,"validate")){if(!stop){stop=e;_stop(stop)}this._scrollTo(td,editor,1);return 1}td.removeClass(this.css.editingCell)}this._skip=1;this._doButtons(1);val=_filter(editor,"getValue");arg=this._evtArg(td,editor,val);arg.update=!!update;if(!this._adding){arg.update=arg.update&&!this._equals(this._getVal(this._row_,this._key(td)),val)}arg.oldValue=editor._oldCellVal;if(!vals){arg.keepEditing=false}if(!this._fire("editCellEnding",eArg,arg)){arg.value=editor._oldCellVal}if(oldUpdate&&!vals&&e&&arg.keepEditing){_stop(e);this._scrollTo(td,editor,1);delete this._skip;return 1}val=foc?editor.data("igEditor")||editor.data("igCombo")||editor.data("igRating"):null;if(val&&typeof val.hasFocus==="function"&&val.hasFocus()){try{editor.parent()[0].focus()}catch(ignore){}foc=null}editor.igEditorFilter("remove");val=arg.value;if(update&&vals){vals[key]=val}if(update&&this._val(td,arg,vals)!==undefined&&!tr&&!this._equals(val,editor._oldCellVal)){tr=td.parent()[0]}delete tds[key];this._fire("editCellEnded",eArg,arg);delete this._skip}}}this._skip=1;this._modified=this._prevEdit=this._tds=this._error=null;if(add){this._addTR.closest("div").unbind(this._addFixScroll);this._addTR.show();this._newTR.hide();this._adding=null;if(update&&this._fire("rowAdding",eArg,argR)){this._update(vals);this._sel("refresh");this._fire("rowAdded",eArg,argR)}}else if(tr){this._update(this._row_,tr,vals)}this._fire("editRowEnded",eArg,argR);this._rowIndex=-3;this._row_=null;this._sel("end",e);delete this._skip},_scrollDiv:function(){var me=this,div=me._scrl,tbl=me.grid.element;if(div&&me._sEvts){return div}me._scrl=div=tbl?tbl.parent():null;if(div&&!me._sEvts&&div.is("div")){me._scrollX=div.scrollLeft;me._sEvts={scroll:function(e){me._onEvt(e,9)}};div.bind(me._sEvts)}return div},_scrollTo:function(td,editor,checkError,delay,toggle){var cur,rect,div,x,y,lbl,xy,shift,add=this._adding,errorWidth=0,errorHeight=0,foc=editor;if(!editor&&typeof td==="string"){td=this._tds?this._tds[td]:null;if(!td){return}editor=this.editorForCell(td);if(!editor){return}checkError=1}if(foc){editor.igEditorFilter("setFocus",delay!==false?100:false,toggle);if($.type(delay)==="number"){editor.igEditorFilter("setFocus",delay)}}if(editor&&checkError){lbl=_filter(editor,"validator");lbl=lbl?lbl._lbl:null;if(lbl&&(add||td.has(lbl).length!==0)){errorWidth=lbl[0]._width0||80;errorHeight=lbl[0]._height0||18;cur=this._cur(td)}}div=this._scrollDiv();xy=td.offset();rect=div.offset();div=div[0];rect.w=div.clientWidth;rect.h=div.clientHeight;xy.w=td.outerWidth();xy.h=td.outerHeight();x=xy.left-rect.left;y=xy.top-rect.top;if(errorWidth>xy.w){delay=cur.col;shift=xy.w;errorWidth+=5;xy.w=errorWidth;while(shift<errorWidth&&this._nextTD(cur,1)){shift+=cur.td[0].offsetWidth}shift-=errorWidth;if(shift<0){xy.x+=shift;if(xy.x<0&&!add){shift-=xy.x;xy.x=0}if(this.grid._hasVerticalScrollbar){shift-=this.grid._scrollbarWidth()}lbl.css("marginLeft",shift+"px")}}if(!add&&errorHeight>1&&cur.row>1){cur.col=delay;errorHeight+=3;shift=errorHeight;while(shift>0&&this._nextTD(cur,0)){shift-=cur.td[0].offsetHeight}if(shift>0){lbl.css("marginTop","-"+errorHeight+"px");y-=errorHeight}}if(div.nodeName!=="DIV"){return}if(x>0){x=Math.max(x+xy.w-rect.w,0)}if(y>0){y=Math.max(y+errorHeight+xy.h-rect.h,0)}if(x!==0){this._hscroll()[0].scrollLeft+=x}if(!add&&y!==0){div.scrollTop+=y}},_upDown:function(td){td=td.parent();if(td.prev().length<1){return 1}if(td.next().length>0){return 0}td=this.grid.element;var par=td.parent()[0];return par&&par.clientHeight-td[0].offsetHeight>25?0:-1},_minWidth:function(td,div){var par=div[0];if(par.id.indexOf("_container")<0&&div.parents(".ui-iggrid").length>0){par=div.parent()[0]}div=Math.min(div[0].clientWidth||div[0].offsetWidth,par.clientWidth||par.offsetWidth);return td?Math.min(div,td.closest("table")[0].clientWidth):div},_doButtons:function(td){var xyTD,xyBut,htBut,htTD,txt,div,cont,scroll,down,x,oldOverflow=this._oldOverflow,add=this._adding,css=this.css,grid=this.grid.element,hasHeight=!_aNull(this.grid.options.height),buts=this._buts;if(td===1||td===2){if(oldOverflow){delete this._oldOverflow;oldOverflow.e.css("overflowX",oldOverflow.x).css("overflowY",oldOverflow.y)}if(buts){buts.hide();if(td===2){buts.remove();this._buts=null}}if(td===2&&this._delBut){this._delHover();this._delBut.remove();delete this._delBut}return}div=this._scrollDiv();if(td){cont=hasHeight?grid.parent():grid.closest(".ui-iggrid");x=cont[0]?Math.max(cont[0].scrollHeight,cont[0].offsetHeight):-1;if(x>=0&&x<20){this._oldOverflow={e:cont,x:cont.css("overflowX"),y:cont.css("overflowY")};cont.css("overflowX","visible").css("overflowY","visible")}if(!buts){buts=this._buts=$("<div />").css("position","absolute").addClass(css.buttonContainer).attr("unselectable","on");if(hasHeight){buts.prependTo(cont)}else{buts.appendTo(cont)}this._butDone=x=$("<span />").addClass("done_id").addClass(css.button).addClass(css.doneButton).attr("unselectable","on").attr("tabIndex",this._ti+1).attr("title",this._loc("done",1)).appendTo(buts).bind(this._evts);
$("<span />").css("display","inline-block").addClass(css.doneIcon).attr("unselectable","on").appendTo(x);txt=this._loc("done");if(txt){$("<span />").css("display","inline-block").attr("unselectable","on").html(txt).appendTo(x)}else{x.addClass(css.buttonIconOnly)}this._butCancel=x=$("<span />").addClass(css.button).addClass(css.cancelButton).attr("unselectable","on").attr("tabIndex",this._ti+1).attr("title",this._loc("cancel",1)).appendTo(buts).bind(this._evts);$("<span />").css("display","inline-block").addClass(css.cancelIcon).attr("unselectable","on").appendTo(x);txt=this._loc("cancel");if(txt){$("<span />").css("display","inline-block").attr("unselectable","on").html(txt).appendTo(x)}else{x.addClass(css.buttonIconOnly)}if(this._renderTouchUI&&this.options.enableDeleteRow){this._butDelete=x=$("<span />").addClass(css.button).addClass(css.doneButton).attr({unselectable:"on",tabIndex:this._ti+1,title:this._loc("deleteRow",1)}).prependTo(buts);$("<span />").css("display","inline-block").addClass(css.deleteIcon).attr("unselectable","on").appendTo(x).css("left",0).bind(this._evts);txt=this._loc("deleteRow",true);$("<span />").css("display","inline-block").attr("unselectable","on").html(txt).appendTo(x);x.css("float","left");this._butCancel.css("float","right");this._butDone.css("float","right");buts.css("width",this._minWidth(td,div)-6)}buts._height=buts[0].offsetHeight;buts._width=buts[0].offsetWidth}this._tdelTR=td.parent()}if(!buts){return}if(td){x=Math.max(grid[0].offsetHeight,grid.parent()[0].offsetHeight);buts.show();if(add&&this.findInvalid()===null){this._butDone.removeClass(css.buttonDisabled)}else{this._butDone.addClass(css.buttonDisabled)}this._butsX=0;buts.css({marginLeft:this._butsX+"px",marginTop:"0px"});xyBut=buts.offset();htBut=buts[0].offsetHeight;xyTD=td.offset();htTD=td[0].offsetHeight;xyTD.top-=xyBut.top;scroll=div[0].scrollTop;down=add?1:this._upDown(td);if(!down){down=div[0].clientHeight+scroll-xyTD.top-htTD-5-htBut;if(down<1&&down>xyTD.top-htBut-scroll-5){down=1}}down=down>0?xyTD.top+htTD+5:xyTD.top-htBut-5;if(down+htBut>x){if(down+htBut<x+6){down=x-htBut-2}else{down-=10+htBut+htTD}down=Math.max(0,down)}buts.css({marginTop:down+"px"});this._butsY=add&&grid.has(this._addTR).length===1?down:0}x=this._minWidth(td,div)-(buts.offset().left+buts._width+3-div.offset().left);if(this._renderTouchUI&&this.options.enableDeleteRow){x+=1}if(x!==0){this._butsX+=x;buts.css("marginLeft",this._butsX+"px")}if(add&&this.grid.options.fixedHeaders!==false){buts.css("marginTop",this._butsY+div[0].scrollTop+2+"px")}},_isEditor:function(e){var end,el,editor,key,td,tds=this._tds,o=this.options;if(!tds||_aNull(e)){return}td=this._findCell(e);if(td&&o.editMode==="row"&&this._row(td)===this._rowIndex){return 1}end=this.grid.element[0];for(key in tds){if(tds.hasOwnProperty(key)){td=tds[key];if(td){editor=this.editorForCell(td);if(editor){el=e;editor=editor[0];while(el&&el!==end){if(el===editor){return 1}el=el.parentNode}}}}}},_aCell:function(){var td,i=-1,sel=this._sel("get");td=sel?sel.activeCell():null;if(td){return td.element}td=sel?sel.activeRow():null;if(td){td=td.element.children("td:not([data-parent='true'],[data-skip='true'])");while(++i<td.length){if(td[i].offsetWidth>0){return $(td[i])}}}},_sel:function(flag,td){var i,obj,elem,sel=this.grid.element.data("igGridSelection");if(!sel||flag==="get"){return sel}if(flag==="end"){delete sel._suspend;if(td&&td.type==="mousedown"){sel._mouseDown(td)}return}if(flag==="wait"){obj=sel.selectedRows();i=obj?obj.length:0;while(i-->0){elem=obj[i].element;if(elem&&elem.has(td).length){return}}obj=sel.selectedCells();i=obj?obj.length:0;while(i-->0){elem=obj[i].element;if(elem&&elem[0]===td[0]){return}}obj=sel.selectedRow();elem=obj?obj.element:null;if(elem&&elem.has(td).length){return}obj=sel.selectedCell();elem=obj?obj.element:null;if(elem&&elem[0]===td[0]){return}return 1}if(flag==="refresh"){return sel._refresh()}if(flag==="act"){if(!td){return}sel._suspend=1;if(!sel.options.activation){return}if(sel.options.mode==="row"){sel._realActiveRow={element:td.parent(),index:this._row(td)+this.grid._startRowIndex||0,id:this._prime(td)};return sel._activateRow(sel._realActiveRow)}td=sel._cellFromElement(td[0],this._row(td),td.index());return sel._activateCell(td)}},_doDelete:function(e,tr){var i,sel,arg;if(!tr){sel=this._sel("get");arg=sel?sel.selectedRows():null;for(i=0;i<(arg?arg.length:0);i++){this._doDelete(e,arg[i].element)}arg=sel?sel.selectedRow():null;if(arg){this._doDelete(e,arg.element)}}arg={element:tr,rowID:this._prime($(tr.children()[0]))};if(!tr||!this._fire("rowDeleting",e,arg)){return}this._delHover();this._update(arg.rowID,tr[0]);if(e){this._sel("refresh")}this._fire("rowDeleted",e,arg);return 1},_checkRow:function(tr){tr=tr&&tr.index()<this.grid.rows().length?tr[0]:null;return tr&&tr.className.indexOf(this.grid.css.deletedRecord)<0&&!$(tr).attr("data-grouprow")&&$(tr).parent().is("tbody")&&$(tr).parent()[0]===this.grid.element.find("tbody")[0]?tr:null},_delHover:function(src){var i,v,left,iBut,iTD,iDiv,iScroll,shift,xyBut,xyTD,div,tds,td,down,but=this._delBut,tr=this._delTR,css=this.css;if(but){this._doHov(this._isSrc(but,src)?but[0]:null,css.buttonHover)}src=src?this._checkRow($(src).closest("tr")):null;if(src===tr||!tr&&!src||!but&&!src){return}this._delTR=src;if(!but){this._delBut=but=$("<span />").css("position","absolute").addClass(css.deleteButton).attr("unselectable","on").attr("title",this._loc("deleteRow",1));$("<span />").css("display","inline-block").addClass(css.deleteIcon).attr("unselectable","on").appendTo(but);v=this._loc("deleteRow");if(v){$("<span />").css("display","inline-block").attr("unselectable","on").html(v).appendTo(but)}}if(tr){but.hide()}if(!src){return}i=this._colShift(null,src)-1;tds=src.childNodes;while(++i<tds.length){if(tds[i].offsetWidth>0){break}}src=tds[i];if(!src){return}td=$(src);div=this.grid.element.parent();v=but[0].parentNode;if(v!==div&&v!==div[0]){if(!v){but.bind(this._evts).mouseup(function(e){_stop(e)})}but.prependTo(div)}but.css({marginLeft:"0px",marginTop:"0px"}).show();xyBut=but.offset();xyTD=td.offset();iBut=but[0].offsetHeight;iTD=src.offsetHeight;shift=xyTD.top-xyBut.top;down=shift+Math.round((iTD-iBut)/2);iScroll=div[0].scrollLeft;iDiv=this._minWidth(td,div);iBut=but[0].offsetWidth;left=iDiv+iScroll-iBut-_int(td,"paddingLeft")-_int(td,"borderLeftWidth")-5;but.css({marginTop:down+"px",marginLeft:left+"px"});shift=iBut+but.offset().left-xyTD.left-iScroll-iDiv+5;if(shift>0){but.css("marginLeft",left-shift+"px")}},_isSrc:function(e,src){if(e&&src&&(e[0]===src||e[0]===src[0]||e.has(src).length>0)){return e}},_doHov:function(e,css){var hov=this._hov;if(hov&&css&&hov.e[0]===e){return 1}if(hov){hov.e.removeClass(hov.css)}if(css){e=$(e);this._hov={e:e,css:css};return e.addClass(css)}delete this._hov},_noMove:function(check){var x,y,div,id,noMove=this._nm;if(noMove===1||check&&!noMove){return}if(!noMove){id=this.grid.element[0].id;div=$("#"+id+"_scroll");if(div.length!==1){div=$("#"+id+"_displayContainer")}if(!div.length){this._nm=1;return}}noMove=this._nm=this._nm||{x:0,y:0,div:div[0]};noMove.ex=noMove.ex||$("#"+id+"_hscroller")[0]||$("#"+id+"_horizontalScrollContainer")[0]||noMove.div;x=noMove.ex.scrollLeft;noMove.ey=noMove.ey||$("#"+id+"_scrollContainer")[0]||noMove.div;y=noMove.ey.scrollTop;if(check){return Math.abs(noMove.x-x)>1||Math.abs(noMove.y-y)>1}noMove.x=x;noMove.y=y},_onEvt:function(e,type){var td,cancel,done,addTD,tbody,but,next,me=this,now=_now(),touch=me._hovTouch,src=e?e.target:null,k=e?e.keyCode:0,x=me._lastEvt,y,css=me.css,delBut=me._delBut,rdelBut=me._butDelete,newTR=me._newTR,addTR=me._addTR,tbl=me.grid.element,o=me.options,editor,key,touchX,scrollLeft,scrollWidth;if(type===2&&me._skipMD&&now-me._skipMD<999){me._skipMD=now+200}if(type===1&&me._skipMD&&me._skipMD-now>0||$.ig.util.evtButton(e)){return}if(o.excelNavigationMode===true&&this._isEditor(src)){td=this._findCell(src);if(td){editor=this.editorForCell(td);if(!editor){return}editor=editor.data("igEditor")||editor.data("igCombo")||editor.data("igEditorFilter");key=this._keyForEditor(editor.element);if($.ig.indexInArray([39,37],k)>=0){if(editor._old===null||editor._old===undefined||editor._old!==null&&editor._old!==undefined&&editor.value()!==null&&editor._old.toString()===editor.value().toString()||Object.prototype.toString.call(editor._old)==="[object Date]"&&editor._old.toString()===this._val(td).toString()){if(this.options.editMode==="row"||this._isAdd(td)){next=this._nextEditor(key,k===37?-1:0);if(next){this._scrollTo(next.parent(),next);return}but=this._butDone;if(!but||but[0].offsetWidth===0){this._nextEdit(e,k===37?-1:0);return}}else{if(k===37){this._nextEdit(e,-1)}if(k===39){this._nextEdit(e,1)}return}}}if(k===38){this._nextEdit(e,"-tr1",key);return}if(k===40){this._nextEdit(e,0,key);return}}}if(!tbl||!src||(type<4||k===13)&&(e.shiftKey||e.ctrlKey)||k===13&&me._13){return}if(k===8&&src.readOnly){_stop(e)}if(type!==9&&x&&x.src===src&&x.type===type&&x.x===e.pageX&&x.y===e.pageY&&now<x.now+500){return}me._lastEvt={src:src,now:now,type:type,x:e.pageX,y:e.pageY};if(type>=11&&type!==14){touchX=e.originalEvent.touches&&e.originalEvent.touches[0]?e.originalEvent.touches[0].pageX:e.originalEvent.clientX;switch(type){case 11:me._firstTouchX=touchX;me._lastTouchX=touchX;me._firstTouchRow=e.originalEvent.touches?$(e.originalEvent.touches[0].target).closest("tr"):$(e.originalEvent.target).closest("tr");break;case 12:if(Math.abs(me._lastTouchX-me._firstTouchX)>parseInt(me.options.swipeDistance,10)&&me._firstTouchRow){this._delHover();this._delHover(me._firstTouchRow)}delete me._firstTouchX;delete me._lastTouchX;delete me._firstTouchRow;break;case 13:scrollLeft=me.grid.scrollContainer().scrollLeft()||0;scrollWidth=me.grid.scrollContainer().width()||0;if(touchX>me._lastTouchX&&scrollLeft===0||touchX<me._lastTouchX&&scrollLeft>=me.grid._hscrollbarinner().width()-scrollWidth){e.preventDefault()}if(me._firstTouchRow){me._lastTouchX=touchX}break}return}if(type===8){if(touch){return}this._delHover();return this._doHov()}x=delBut?me._isSrc(delBut,src):null;y=rdelBut&&!rdelBut.hasClass(me.css.buttonDisabled)?me._isSrc(rdelBut,src):null;tbody=tbl.find("tbody");if(type===7){if(o.enableDeleteRow){if(x){delBut.addClass(me.css.buttonHover)}else{if(delBut){delBut.removeClass(me.css.buttonHover)}this._delHover(this._tds||!this._isSrc(tbody,src)||this._noMove(true)?null:src)}}return}if((x||y)&&(type<4||type===14)){if((type===2&&!($.ig.util.isIE&&$.ig.util.browserVersion>=10)||type===14)&&(this._delTR||this._tdelTR)){_stop(e);this._endEdit();if(this._doDelete(e,$(this._delTR||this._tdelTR))){delete this._delTR;delete this._tdelTR}}return}addTD=addTR?addTR.children()[addTR.children().length-1]:null;if(k===46){return o.enableDeleteRow?this._doDelete(e):null}if(type===9){if(this._nm&&!this._noMove(true)){return}this._delHover();x=src.scrollLeft;if(this._tds){this._doButtons()}if(addTR&&x!==this._scrollX){$(addTD).css("paddingLeft",this._addLeft+x+"px")}this._scrollX=x;return}if(this._isSrc(addTR,src)){if(!this._isSrc($(addTD),src)){return}this._delHover();src=addTD;if(type===5){return $(src).addClass(css.addRowActive)}if(type===6){return $(src).removeClass(css.addRowActive)}if(type===7){return this._doHov(src,css.addRowHover)}if(k===32||k===13){return this.startAddRowEdit(e)}}if(k===27){return this._endEdit(e,null,50)}done=this._isSrc(this._butDone,src);cancel=this._isSrc(this._butCancel,src);td=this._isSrc(this._buts,src);if(td||done||cancel){if(done||cancel){if(type<5){_stop(e)}src=done||cancel;if(type===2){if(src.hasClass(css.buttonDisabled)){return}this._endEdit(e,done,1)}else if(type===7&&!src.hasClass(css.buttonDisabled)){this._doHov(src[0],css.buttonHover)}else if(type===5){src.addClass(css.buttonActive)}else if(type===6){src.removeClass(css.buttonActive)}else if(k===13||k===32){this._endEdit(e,done,1)}else if(k===9){if(e.shiftKey){td=done||this._butDone.hasClass(css.buttonDisabled)?null:this._butDone}else{if(!td){return}td=this._butCancel}if(td){td[0].focus();return}src=this._lastEditor();td=src?src.parent():null;if(td){this._scrollTo(td,src)}}}return}if(newTR&&type<4){if(this._isSrc(newTR,src)){return}if(this._isSrc(addTR,src)){if(type===2){if(o.editMode==="rowedittemplate"){this._startEditRowTemplate(e,null,td,1)}else{this.startAddRowEdit(e)}}return}}if(type<4&&!this._isSrc(tbody,src)){if(this._tds&&src!==tbl.parent()[0]&&src!==this._div()[0]&&src!==this._hscroll(1)[0]){this._endEdit(e)}return}if(k===13){this._nextEdit(e,0);if(this._tds){return}}if(this._isEditor(src)||this._isEditor($(src).find("input")[0])){return}td=this._findCell(src);if(this._tds&&type<4&&(type>1||td)){if(this._endEdit(e,this._adding?null:1)){return}}if(type===1){if(td&&this._sel("get")){this._waitSel=this._sel("wait",td)}return}x=o.editMode==="cell";src=o.startEditTriggers;if(src&&!this._tds&&(x||o.editMode==="row"||o.editMode==="rowedittemplate")){if(!src.toLowerCase){src=src.toString()}src=src.toLowerCase();if(k===113&&src.indexOf("f2")>=0||k===13&&src.indexOf("enter")>=0){td=this._aCell()}else if(src.indexOf(e.type)<0||type===2&&src.indexOf("dbl")>=0){td=null}if(touch&&type<3&&touch!==me._delTR){return}if(td&&(this._isToggle(e)||(!this._waitSel||type===4)&&!this._sel("wait",td))){if(o.editMode==="rowedittemplate"&&td.parent().attr("data-grouprow")!=="true"){this._startEditRowTemplate(e,null,td);return}if(this._startEdit(td,e,x)){return}}}},_startEditRowTemplate:function(e,tr,td,addNewRow){var dialog=$("#"+this.grid.container().attr("id")+"_ret"),arg;tr=!_aNull(td)&&td.parent().length>0?td.parent():tr;arg={rowAdding:addNewRow?true:false,rowID:addNewRow?-1:this._prime(td||tr.children().first())};if(!this._fire("editRowStarting",e,arg)){return}if(this._checkRow(tr)||addNewRow){if(dialog[0]===undefined){this._renderRowEditDialog(e,tr)}if(this._openRowEditDialog(e,tr)){this._fire("editRowStarted",e,arg);return 1}}return 0},_calcRowDialogLeftTop:function(dialog){var left,top,pos,h,w,bh,dh,dw,bw,block=$("#"+this.grid.container().attr("id")+"_block_ret"),rootWidget,rootContainer,hScrollbar,cc,bc,tc;if(this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid")){rootWidget=this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid").rootWidget()}else{rootWidget=this.grid}rootContainer=rootWidget.container();hScrollbar=rootWidget.container().children("[id$='_hscroller_container']");pos=rootContainer.offset();left=pos.left;top=pos.top;if(block.outerWidth()!==rootContainer.outerWidth()||$.ig.util.isIE7===true){block.css("width",rootContainer.outerWidth())}if(block.outerHeight()!==rootContainer.outerHeight()||$.ig.util.isIE7===true){block.css("height",rootContainer.outerHeight()+($.ig.util.isIE7?hScrollbar.height():0))}$("#"+this.grid.container().attr("id")+"_dialog_error").hide();block.css({left:left,top:top}).fadeToggle();w=rootContainer.outerWidth();h=rootContainer.outerHeight();bw=$(window).width();bh=$(window).height();if(w+left>bw){w=w-(w+left-bw)}if(w<=0){w=rootContainer.outerWidth()}if(h+top>bh){h=h-(h+top-bh)}if(h<=0){h=rootContainer.outerHeight()}dh=parseInt(this.options.rowEditDialogHeight,10);dw=parseInt(this.options.rowEditDialogWidth,10);if(isNaN(dh)||dh<=0){dh=dialog.outerHeight()}if(isNaN(dw)||dw<=0){dw=dialog.outerWidth()}top=top+parseInt(h/2,10)-dh/2;left=left+parseInt(w/2,10)-dw/2;top=top<0?pos.top:top;left=left<0?pos.left:left;cc=dialog.children(".ui-dialog-content");tc=dialog.children(".ui-dialog-titlebar");bc=dialog.children(".ui-dialog-buttonpane");dialog.css({left:left,top:top,width:dw,height:dh});dialog.fadeToggle($.proxy(this._setResizableEnv,this));cc.css("height",dialog.height()-tc.outerHeight(true)-bc.outerHeight(true)-cc.outerHeight()+cc.height())},_getColumnSettingsByKey:function(colKey){var i;for(i=0;i<this.options.columnSettings.length;++i){if(this.options.columnSettings[i].columnKey===colKey){return this.options.columnSettings[i]}}return null},_doType:function(type,val){if(type==="text"){type=0}if(type==="mask"){type=1}if(type==="date"){type=2}if(type==="datepicker"){type=3}if(type==="numeric"){type=4}if(type==="currency"){type=5}if(type==="percent"){type=6}if(typeof type!=="number"||type<0||type>6){if(typeof val==="number"){type=4}else if(val&&val.getMonth){type=2}else{type=0}}this._type=type;return type},_fillRowEditDialogTable:function(event_tr){var tableBody,cols=this.grid.options.columns,i,tr,input,colVal,colSettings,newColSettings,colKey,templateData,shouldAdd,rowEditDialogRowTemplateID=this.options.rowEditDialogRowTemplateID,buttonId="#"+this.grid.container().attr("id")+"_igButton",parent;tableBody=$("#"+this.grid.container().attr("id")+"_ret table tbody");tableBody.empty();this._editors=this._editors||{};if(!event_tr){this._adding=true}for(i=0;i<cols.length;++i){templateData=[];colKey=cols[i].key;colSettings=this._getColumnSettingsByKey(colKey);shouldAdd=colSettings===null?true:false;colSettings=colSettings||{};if(event_tr){colVal=this._getVal(this._fixPrime(event_tr.attr("data-id")),colKey)}else{colVal=this._defVal(colKey,true)}if(colSettings&&colSettings.readOnly&&!this.options.showReadonlyEditors||cols[i].hidden){continue}templateData.push({headerText:cols[i].headerText,dataKey:colKey});if(rowEditDialogRowTemplateID){tr=$($.ig.tmpl($("#"+rowEditDialogRowTemplateID).html().fullTrim(),templateData))}else{tr=$($.ig.tmpl(this.options.rowEditDialogRowTemplate,templateData))}tr.appendTo(tableBody);input=$(tr.find(">td[data-key] input")[0]);if(input.length&&colSettings.editorOptions&&colSettings.editorOptions.textMode==="multiline"){input.parent().append("<textarea />");input.remove();input=$()}if(!input.length){input=$(tr.find(">td[data-key] textarea")[0])}if(cols[i].dataType==="bool"){$.extend(true,colSettings,{editorOptions:{listItems:[true,false],button:"dropdown"}})}if(colSettings.readOnly){$.extend(true,colSettings,{editorOptions:{readOnly:true}})}if(colSettings.editorOptions){colSettings.editorOptions.width=_aNull(colSettings.editorOptions.width)?this.options.rowEditDialogFieldWidth:colSettings.editorOptions.width}else{colSettings.editorOptions={width:this.options.rowEditDialogFieldWidth}}if(shouldAdd){this.options.columnSettings.push($.extend(true,{},colSettings,{columnKey:colKey}))}this._createEditor(event_tr?event_tr.children().eq(i):this._newTR.children().eq(i),colKey,input);this._editors[colKey]=input;_filter(input,"setValue",colVal)}$(buttonId).igButton("option","disabled",true)},_openRowEditDialog:function(event,tr){var dialog=$("#"+this.grid.container().attr("id")+"_ret"),noCancel,$this=this;noCancel=this._fire("rowEditDialogOpening",event,{dialogElement:dialog,owner:this});if(noCancel){dialog.data("tr",tr);this._fillRowEditDialogTable(tr);this._calcRowDialogLeftTop(dialog);setTimeout(function(){if(dialog.find("input")[0]){dialog.find("input")[0].focus()}else{dialog.focus()}$this._fire("rowEditDialogOpened",event,{dialogElement:dialog,owner:$this})},100);if(event!==null&&event!==undefined){event.preventDefault();event.stopPropagation()}return 1}return 0},_renderRowEditDialog:function(e,tr){var dialog,caption,dialogContent,noCancel,limit,f=this,okCancelContainer;dialog=$("<div></div>").appendTo("body").attr("id",this.grid.container().attr("id")+"_ret").css("position","absolute").addClass(this.css.rowEditDialog).data("efh","1").hide();dialog.data("tr",tr);noCancel=this._fire("rowEditDialogContentsRendering",e,{dialogElement:dialog,owner:f});if(noCancel){$("<div></div>").appendTo("body").attr("id",this.grid.container().attr("id")+"_block_ret").css("position","absolute").addClass(this.css.blockArea).data("efh","1").hide();caption=$("<div></div>").appendTo(dialog).addClass(this.css.rowEditDialogHeaderCaption);$("<span></span>").appendTo(caption).text(this._loc("rowEditDialogCaption")).addClass(this.css.rowEditDialogHeaderCaptionTitle);$("<span></span>").appendTo($("<a></a>").appendTo(caption).attr("href","#").attr("role","button").addClass("ui-dialog-titlebar-close ui-corner-all")).bind({click:$.proxy(this._closeRowEditDialog,this)}).addClass("ui-icon ui-icon-closethick");dialogContent=$("<div></div>").appendTo(dialog).addClass("ui-dialog-content").css("overflow","auto").css("height",this.options.rowEditDialogContentHeight);$("<table><tbody></tbody></table>").appendTo(dialogContent).addClass(this.css.rowEditDialogTable);okCancelContainer=$("<div></div>").appendTo($("<div></div>").appendTo(dialog).addClass(this.css.rowEditDialogOkCancelButton)).addClass("ui-dialog-buttonset");$("<button/>").appendTo(okCancelContainer).igButton({labelText:this._loc("cancel"),width:this.options.rowEditDialogOkCancelButtonWidth}).bind({mousedown:$.proxy(this._closeRowEditDialog,this)});$("<button/>").appendTo(okCancelContainer).igButton({labelText:this._loc("done"),disabled:true,width:this.options.rowEditDialogOkCancelButtonWidth}).bind({click:$.proxy(this._rowEditDialogDoUpdate,this)}).attr("id",this.grid.container().attr("id")+"_igButton");if(this._hc===true){limit=$("#"+this.grid.element[0].id.split("_")[0]+"_container")}else if(this.options.rowEditDialogContainment==="owner"){limit=this.grid.container()}else{limit="window"}dialog.bind({keydown:function(e){if(e.keyCode===$.ui.keyCode.ESCAPE){f._closeRowEditDialog(e)}}}).draggable({containment:limit,handle:caption}).attr("role","dialog").attr("tabIndex",-1);if(typeof Modernizr!=="object"||Modernizr.touch===false){dialog.resizable({minHeight:dialog.outerHeight()/4,minWidth:dialog.outerWidth()/2,containment:"parent",resize:$.proxy(this._resizeHandler,this)})}this._fire("rowEditDialogContentsRendered",e,{dialogElement:dialog,owner:this})}},_setResizableEnv:function(){var e=$("#"+this.grid.container().attr("id")+"_ret"),rCont=e.find(">.ui-dialog-content"),hCont=e.find(">.ui-dialog-titlebar"),bCont=e.find(">.ui-dialog-buttonpane"),pad=rCont.outerHeight()-rCont.height();this._resizeCont=rCont;this._heightDifference=hCont.outerHeight(true)+bCont.outerHeight(true)+pad},_resizeHandler:function(event,ui){var u=ui.originalElement;this._resizeCont.css({height:u.height()-this._heightDifference+"px"})},_rowEditDialogDoUpdate:function(e){var ret=$("#"+this.grid.container().attr("id")+"_ret"),tds=ret.find("table tbody [data-key]"),tr=ret.data("tr"),i,vals={},oldvals={},colKey,arg,rowID,addRow;if(this.findInvalid()){return 0}for(i=0;i<tds.length;++i){colKey=tds.eq(i).attr("data-key");vals[colKey]=_filter(this._editors[colKey],"getValue");oldvals[colKey]=this._editors[colKey]._oldCellVal}addRow=!(tr!==null&&tr!==undefined&&tr.length>0);rowID=addRow?-1:this._prime(tr.children().first());arg={oldValues:oldvals,values:vals,rowID:rowID,keepEditing:false,update:true,rowAdding:addRow};if(!this._fire("editRowEnding",e,arg)){return 0}if(!addRow){this._update(tr.data().id,tr[0],vals)}else{if(this._fire("rowAdding",e,arg)){this._update(vals);this._fire("rowAdded",e,arg)}}this._fire("editRowEnded",e,arg);this._closeRowEditDialog(e);return 1},_closeRowEditDialog:function(e){var noCancel=true,dialog=$("#"+this.grid.container().attr("id")+"_ret");noCancel=this._fire("rowEditDialogClosing",e,{dialogElement:dialog,owner:this});if(noCancel){$("#"+this.grid.container().attr("id")+"_block_ret").fadeToggle();$("#"+this.grid.container().attr("id")+"_ret").data("tr",null).fadeToggle();delete this._defValue;if(e){e.preventDefault();e.stopPropagation()}delete this._editors;this._fire("rowEditDialogClosed",e,{dialogElement:dialog,owner:this});return 1}return 0},_lastEditor:function(){var key,last=this._prevEdit,all=this._editors;if(!last){for(key in all){if(all.hasOwnProperty(key)){last=all[key]||last}}}return last},_end:function(){this._delHover();this._endEdit()},destroy:function(){var div=this._div(),grid=this.grid,el=grid.element;if(!this._evts||!el||!div){return this}this._hComboRemove(true);this._doButtons(2);div.unbind(this._evts);if(this._renderTouchUI&&this.options.editMode!=="row"){div.unbind(this._tEvts)}if(this._sEvts){el.parent().unbind(this._sEvts)}el.unbind(this._gEvts);this._end();this._headerRendered(1);this._evts=this._sEvts=this._gEvts=null;$.Widget.prototype.destroy.call(this);if(this.options.editMode==="rowedittemplate"){$("#"+this.grid.container().attr("id")+"_block_ret").remove();$("#"+this.grid.container().attr("id")+"_ret").remove()}return this},_hidingFinished:function(){this._headerRendered()},_hidingFinishing:function(){var key,shift,tr=this._addTR,grid=this.grid,edits=this._editors;if(!grid._initialized){return}this._endEdit();this._doButtons(2);if(this._groupTD1){this._groupTD1.remove();this._groupTD2.remove();delete this._groupTD1;delete this._groupTD2;this._cShift=this._cShiftAdd=-1}if(tr){shift=this._colShift(null,tr[0]);this._addTrShift=[];this._newTrShift=[];while(shift-->0){this._addTrShift[shift]=tr.children()[shift];this._newTrShift[shift]=this._newTR.children()[shift]}tr.remove();this._newTR.remove()}for(key in edits){if(edits.hasOwnProperty(key)&&edits[key]){edits[key].remove()}}this._newTR=this._addTR=this._editors=this._mapAdd=this._map=null;this._cShiftAdd=this._cShift=-1;this._hComboRemove()},_rerender:function(args){var iTD,val,ta,row,cell,col,td,tds,key,grid=this.grid,tx=grid.pendingTransactions(),i=tx?tx.length:0,tbody=grid.element.children("tbody"),tmpl=grid.options.jQueryTemplating;if(args&&args.owner&&args.owner.id()!==grid.id()){return}while(i-->0){ta=tx[i];cell=ta.type==="cell";row=tbody.find('[data-id="'+ta.rowId+'"]');if(ta.type==="row"||ta.type==="newrow"||cell){row.addClass(grid.css.modifiedRecord);tds=row.length&&!tmpl?row.children("td"):null;iTD=tds?tds.length:0;while(iTD-->0){td=$(tds[iTD]);key=this._key(td);val=undefined;if(ta.row){val=ta.row[key]}else if(cell&&key===ta.col){val=ta.value}if(val!==undefined){col=_aNull(key)?null:this._gridCol(key);val=col?grid._renderCell(val,col):$.ig.formatter(val);td.html(val)}}}if(ta.type==="deleterow"||ta.type==="insertrow"){row.addClass(grid.css.deletedRecord)}}},_bind:function(args){var t1,t2,grid=this.grid,data=grid.dataSource._data,i=data?data.length:0,txNew=this.grid.dataSource.pendingTransactions(),len=txNew?txNew.length:0,txLast=this._txLast,lenLast=txLast?txLast.length:0;this._addRowNum=Math.max(this._addRowNum||1,i+1);this._endEdit();if(!args){if(i&&_aNull(grid.options.primaryKey)&&_aNull(data[0].ig_pk)){while(i-->0){data[i].ig_pk=i}}}else if(args.owner&&args.owner.id()!==this.grid.id()){return}if(len<1){return}if(len===lenLast){while(lenLast-->0){t1=txNew[lenLast];t2=txLast[lenLast];if(t1.tid!==t2.tid||t1.value!==t2.value||t1.row!==t2.row){break}}if(lenLast<0){return}}txLast=this._txLast=[];while(len-->0){txLast[len]={tid:txNew[len].tid,value:txNew[len].value,row:txNew[len].row}}if(this._fire("dataDirty",this._evt||{},{})&&this.options.enableDataDirtyException){_throw("dataDirtyException")}},_fixPrime:function(key,ds){var grid=this.grid,o=grid.options,prime=o.primaryKey,primeType,col=_aNull(prime)?null:this._gridCol(prime),data=grid.dataSource._data;if(ds){if(!col){key.ig_pk=ds=data.length;return ds}ds=key[prime];if(_aNull(ds)){ds=key[prime]=this._defVal(prime,1)}key=ds}primeType=data&&data.length>0&&!_aNull(data[0][prime])?typeof data[0][prime]:null;key=col&&(col.dataType==="number"||col.dataType==="numeric"||primeType==="number")?parseInt(key,10):key;if(!col&&(!data[key]||data[key].ig_pk!==key)){_throw("noPrimaryKeyException")}return key},_getRecord:function(id){var i=-1,data=this.grid.dataSource._data,len=data.length,prime=this.grid.options.primaryKey;id=this._fixPrime(id);if(_aNull(prime)){prime="ig_pk"}while(++i<len){if(data[i][prime]===id){return data[i]}}},_getVal:function(rowId,key){var val,ta,grid=this.grid,tx=grid.dataSource.pendingTransactions(),i=tx?tx.length:0;while(i-->0&&val===undefined){ta=tx[i];if(ta.rowId===rowId){if(ta.row){val=ta.row[key]}else if(ta.type==="cell"&&ta.col===key){val=ta.value}}}if(val===undefined){rowId=this._getRecord(rowId);val=rowId?rowId[key]:null}return grid._fixDate(val,this._gridCol(key))},_childrenWithAddRowEnabled:function(opts,inheritedRule){var i,j,cl,clr;if(opts.columnLayouts){for(i=0;i<opts.columnLayouts.length;i++){cl=opts.columnLayouts[i];clr=inheritedRule||false;if(cl.features&&cl.features.length>0){for(j=0;j<cl.features.length;j++){if(cl.features[j].name==="Updating"){clr=_aNull(cl.features[j].enableAddRow)?clr:cl.features[j].enableAddRow;break}}}if(clr){return true}}}return false},_update:function(rowId,tr,val,col,td){var tx,i,vDiv,vScroll,del=val===undefined,grid=this.grid,oGrid=grid.options,autoCommit=oGrid.autoCommit,ds=grid.dataSource,key=this._fixPrime(rowId,tr?null:ds),fk=this.grid.options.foreignKey,virt=grid._virtualDom,cols,gridCol,nr,$tr,idx,updateObj={},recObj,groupedGrid,layoutKeys=[],tdContent;if(col&&td){updateObj[col]=val;recObj=jQuery.extend(true,{},updateObj)}else{updateObj=jQuery.extend(true,{},val);recObj=this.grid.findRecordByKey(rowId);if(recObj){if(grid.options.columnLayouts&&grid.options.columnLayouts.length){for(i=0;i<grid.options.columnLayouts.length;++i){layoutKeys.push(grid.options.columnLayouts[i].key)}}$.each(recObj,function(prop,propVal){if(updateObj&&!updateObj.hasOwnProperty(prop)&&$.ig.indexInArray(layoutKeys,prop)===-1){updateObj[prop]=propVal}})}}if(tr){if(del){i=ds.deleteRow(rowId,autoCommit)}else{if(col){i=ds.setCellValue(key,col,val,autoCommit)}else{i=ds.updateRow(key,updateObj,autoCommit)}}}else{if(fk&&!rowId[fk]){rowId[fk]=ds._origDs&&ds._origDs.length>0?ds._origDs[0][fk]:null}i=ds.addRow(key,rowId,autoCommit)}tx=ds.pendingTransactions();i=tx?tx.length:0;while(i-->0){if(rowId===tx[i].rowId){if(tx[i].row&&col){tx[i].row[col]=val}break}}if(!del&&(virt||autoCommit&&(rowId===null||rowId===undefined||recObj===null||recObj[grid.options.primaryKey]===null))){vDiv=$("#"+grid.id()+(virt?"_scrollContainer":"_scroll"))[0];vScroll=vDiv?vDiv.scrollTop:0;if(virt&&oGrid.virtualizationMode==="continuous"){grid._rerenderVirtualRecordsContinuous()}if(virt&&oGrid.virtualizationMode==="fixed"){grid._renderVirtualRecords()}if(vScroll){vDiv.scrollTop=vScroll}if(virt){grid._onVirtualVerticalScroll()}return}if(autoCommit&&grid.options.primaryKey&&recObj&&recObj[grid.options.primaryKey]){$(tr).data("id",recObj[grid.options.primaryKey]);$(tr).attr("data-id",recObj[grid.options.primaryKey])}if(!tr){groupedGrid=grid.element.children("tbody").children("tr.ui-iggrid-groupedrow").length>0;tr=groupedGrid===true?grid.element.data("igGridGroupBy")._renderNewRow(rowId,key):grid.renderNewRow(rowId,key);tr=grid.element.children("tbody").children("tr");tr=tr[tr.length-1];if(!oGrid.virtualization&&!oGrid.rowVirtualization){this._addRowNum++}delete this._defValue;this._trigger("internalrowadded",null,{owner:this})}else{if(del){if(autoCommit){if(oGrid.virtualization||oGrid.rowVirtualization){if(oGrid.virtualizationMode==="continuous"){grid._rerenderVirtualRecordsContinuous()}else{if(this.grid._startRowIndex+this.grid._virtualRowCount===this.grid._totalRowCount){this.grid._startRowIndex=Math.max(0,this.grid._startRowIndex-1)}this.grid._totalRowCount--;if(this.grid._virtualRowCount>this.grid._totalRowCount){grid._buildVirtualDom()}else{grid._renderVirtualRecords();this.grid._setScrollContainerHeight(this.grid._totalRowCount*parseInt(this.grid.options.avgRowHeight,10))}}tr=null}else{$tr=$(tr);idx=$tr.parent().children(":not([data-container],[data-grouprow])").index(tr);nr=$tr.next("tr[data-container='true']");$tr.remove();this.grid._reapplyZebraStyle(idx);if(nr.length===1){nr.remove()}}this._trigger("internalrowdeleted",null,{owner:this})}return $(tr).addClass(grid.css.deletedRecord)}cols=oGrid.columns;val={};rowId=recObj&&!_aNull(recObj[grid.options.primaryKey])?recObj[grid.options.primaryKey]:rowId;i=cols.length;while(i-->0){key=cols[i].key;val[key]=this._getVal(rowId,key)}val=tr!==1?grid._renderRow(col&&td?val:updateObj,tr,rowId):null;if(!_aNull(val)){tr=val}}if(tr&&tr!==1&&!autoCommit){$(tr).addClass(grid.css.modifiedRecord)}},_addDSSuccessHandler:function(){var me=this,fS,grid=me.grid;if(me._addChangesSuccessHandler!==null&&me._addChangesSuccessHandler!==undefined){grid.dataSource._removeChangesSuccessHandler(me._addChangesSuccessHandler)}fS=me.options.saveChangesSuccessHandler;
if(fS){if($.type(fS)==="string"&&window[fS]&&$.type(window[fS])==="function"){fS=window[fS]}}if($.type(fS)!=="function"){fS=null}me._addChangesSuccessHandler=function(data){if(data.Success){if(grid.rows().parent().find("."+grid.css.deletedRecord).length){grid._renderData()}grid.rows().removeClass(grid.css.modifiedRecord);if(fS){fS(data)}}};grid.dataSource._addChangesSuccessHandler(me._addChangesSuccessHandler)},_addDSErrorHandler:function(){var me=this,fE,grid=me.grid;if(me._addChangesErrorHandler!==null&&me._addChangesErrorHandler!==undefined){grid.dataSource._removeChangesErrorHandler(me._addChangesErrorHandler)}if(me.options.saveChangesErrorHandler){fE=me.options.saveChangesErrorHandler;if($.type(fE)==="string"&&window[fE]&&$.type(window[fE])==="function"){fE=window[fE]}if($.type(fE)==="function"){me._addChangesErrorHandler=function(jqXHR,textStatus,errorThrown){fE(jqXHR,textStatus,errorThrown)};grid.dataSource._addChangesErrorHandler(me._addChangesErrorHandler)}}},_injectGrid:function(grid){var me=this,hg,cl;me.grid=grid;me._cShiftAdd=me._cShift=-1;if(me._gEvts!==undefined&&me._gEvts!==null){grid.element.unbind(this._gEvts)}me._gEvts={iggridvirtualrendering:function(){me._end()},ighierarchicalgridrowexpanded:function(){me._end()},iggriddatabinding:function(e,args){me._bind(args)},iggriddatarendering:function(e,args){me._bind(args)},iggridrowsrendering:function(e,args){me._bind(args)},iggriduidirty:function(){me._end()},iggridresizingcolumnresizing:function(){me._end()},iggridvirtualrecordsrender:function(e,args){me._rerender(args)},iggridrowsrendered:function(e,args){me._rerender(args)}};if(this.options.enableAddRow){me._gEvts.iggridheaderrenderedinternal=function(){me._headerRendered()};me._gEvts.iggridheaderextracellsmodified=function(){me._headerInit()}}grid.element.bind(this._gEvts);me._ti=parseInt(grid.options.tabIndex||1,10);me._evts={iggridselectionmousedown:function(e){me._onEvt(e,1)},mousedown:function(e){me._onEvt(e,1)},click:function(e){me._onEvt(e,2)},dblclick:function(e){me._onEvt(e,3)},keydown:function(e){me._onEvt(e,4)},focus:function(e){me._onEvt(e,5)},blur:function(e){me._onEvt(e,6)},mousemove:function(e){me._onEvt(e,7)},mouseleave:function(e){me._onEvt(e,8)},MSPointerUp:function(e){me._onEvt(e,14)},pointerup:function(e){me._onEvt(e,14)}};me._tEvts={touchstart:function(e){me._onEvt(e,11)},touchend:function(e){me._onEvt(e,12)},touchmove:function(e){me._onEvt(e,13)}};me._addDSSuccessHandler();me._addDSErrorHandler();if(me.grid.options._isHierarchicalGrid&&me.grid._originalOptions){if(me.options.inherit){me.grid._shouldAlwaysRenderChildIndicator=me._childrenWithAddRowEnabled(me.grid.options,me.options.enableAddRow)}else{me.grid._shouldAlwaysRenderChildIndicator=me._childrenWithAddRowEnabled(me.grid.options)}if(!me.grid.dataSource.settings.schema.layouts){hg=me.grid.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");cl=[];hg._parseLayouts(cl,"",me.grid._originalOptions);me.grid.dataSource.settings.schema.layouts=cl}}this._renderTouchUI=typeof Modernizr==="object"&&Modernizr.touch===true;if(window.navigator.msPointerEnabled||window.navigator.pointerEnabled){me.grid.element.css("-ms-touch-action","none")}}});$.extend($.ui.igGridUpdating,{version:"13.1.20131.2523"});$.widget("ui.igEditorFilter",{setFocus:function(delay,toggle){var provider=this.options.provider;if(delay&&$.type(delay)==="number"&&delay>0){setTimeout(function(){provider.setFocus(toggle)},delay)}else{provider.setFocus(toggle)}},remove:function(){if(!this.options.provider.removeFromParent()){var p,e=this.element;p=e[0].parentNode;if(p&&p.tagName){p.removeChild(e[0])}e=this.validator();if(e){e.hide()}}},validator:function(){return this.options.provider.validator()},hasInvalidMessage:function(){var validator=this.validator();return validator?validator.isMessageDisplayed():false},destroy:function(){this.options.provider.destroy()}});$.extend($.ui.igEditorFilter,{version:"13.1.20131.2523"});$.ig.EditorProvider=$.ig.EditorProvider||Class.extend({createEditor:function(updating,key,columnSetting,tabIndex,format,dataType,cellValue,element){return null},getValue:function(){return""},setValue:function(val,updating){return false},setFocus:function(toggle){return null},setSize:function(width,height){return null},removeFromParent:function(){return false},destroy:function(){return this},validator:function(){return null},validate:function(noLabel){var validator=this.validator();return validator?!validator.validate():true},keepFocus:function(){var validator=this.validator(),foc=validator?validator._foc1(validator.options):false;if(!foc){return false}if(foc===2){return true}foc=validator&&!validator._focTime;validator._focTime=(new Date).getTime();return foc},isValid:function(){var validator=this.validator();return validator?validator.isValidState():true}});$.ig.EditorProviderDefault=$.ig.EditorProviderDefault||$.ig.EditorProvider.extend({createEditor:function(updating,key,columnSetting,tabIndex,format,dataType,cellValue,element){var v,o={};if(columnSetting){o=columnSetting.editorOptions||o;o.type=columnSetting.editorType||o.type}v=o.type;if(o.enableUTCDates!==false&&updating.grid.options.enableUTCDates){o.enableUTCDates=true}if(!v){if(dataType==="bool"){o.listItems=["true","false"];o.button="dropdown";this._bool=o.readOnly=o.dropDownOnReadOnly=o.spinOnReadOnly=o.spinWrapAround=true}else if(format==="currency"||format==="percent"||format==="date"){v=format;o.displayFactor=o.displayFactor||1}else if(dataType==="number"){v="numeric"}else if(dataType==="date"){v="date"}else if(!dataType){v=cellValue;v=typeof v==="number"?"numeric":v&&v.getTime?"date":null}o.type=v}if(format==="int"){o.maxDecimals=0}else if(format==="double"&&!o.maxDecimals){o.maxDecimals=100}else if(format&&v&&v.toString().indexOf("date")===0&&!o.dateInputFormat){o.dateInputFormat=format}if((v==="datepicker"||v===3)&&!o.button){o.button="dropdown"}o.tabIndex=tabIndex;o._eo=o._eo||{tc:o.textChanged,kd:o.keydown};o.textChanged=function(e,ui){updating._notifyChanged();if(o._eo.tc){o._eo.tc(e,ui)}};o.keydown=function(e,ui){updating._13=o.textMode&&!o.hideEnterKey;updating._notifyEditorKey(e,key);if(o._eo.kd){o._eo.kd(e,ui)}};v=element||$("<span />");if(!v.igEditor){_throw("igEditorException")}if(o.id){v.attr("id",o.id)}o.excelNavigationMode=updating.options.excelNavigationMode;v=v.igEditor(o);this.editor=v.data("igEditor");return v},getValue:function(){var val=this.editor.value();return this._bool?val==="true":val},setValue:function(val){return this.editor.value(this._bool?val&&val!=="false"?"true":"false":val)},setSize:function(width,height){this.editor._listRemove();this.editor._width(width);this.editor._height(height)},setFocus:function(){this.editor.setFocus(-1)},removeFromParent:function(){return this.editor.remove()},destroy:function(){this.editor.destroy()},validator:function(){return this.editor.validator()},validate:function(noLabel){return this.editor.validate(noLabel)},isValid:function(){return this.editor.isValid()}});$.ig.EditorProviderCombo=$.ig.EditorProviderCombo||$.ig.EditorProvider.extend({createEditor:function(updating,key,columnSetting,tabIndex,format,dataType,cellValue,element){var v,o={};if(columnSetting){o=columnSetting.editorOptions||o}o.tabIndex=tabIndex;o._eo=o._eo||{tc:o.textChanged,kd:o.keydown};o.textChanged=function(e,ui){updating._notifyChanged();if(o._eo.tc){o._eo.tc(e,ui)}};o.keydown=function(e,ui){if(!ui||ui.keyCode===9||!ui.owner||!ui.owner._ddOn){updating._notifyEditorKey(e,key)}if(o._eo.kd){return o._eo.kd(e,ui)}};v=element||$("<span />");if(!v.igCombo){_throw("igComboException")}if(o.id){v.attr("id",o.id)}v=v.igCombo(o);this.editor=v.data("igCombo");return v},getValue:function(){return this.editor.options.allowCustomValue?this.editor.text():this.editor.value()},setValue:function(val){var combo=this.editor,o=combo.options;if(o.filteringType){combo.selectedIndex(-1);combo.activeIndex(-1);if(!o.parentCombo){combo.dataBind()}}return o.allowCustomValue?combo.text(val===null?o.nullText||"":val):combo.value(val)},setSize:function(width,height){this.editor.options.width=width;this.editor.options.height=height;this.editor._doSize()},setFocus:function(){this.editor.setFocus(-1);this.editor.fieldElem[0].select()},removeFromParent:function(){return this.editor.remove()},validator:function(){return this.editor.validator()},destroy:function(){this.editor.destroy()}});$.ig.EditorProviderRating=$.ig.EditorProviderRating||$.ig.EditorProvider.extend({createEditor:function(updating,key,columnSetting,tabIndex,format,dataType,cellValue,element){var foc,v,o={};if(columnSetting){o=columnSetting.editorOptions||o}o._eo=o._eo||{vc:o.valueChange};o.valueChange=function(e,ui){updating._notifyChanged();if(o._eo.vc){return o._eo.vc(e,ui)}};v=element||$("<div />");if(!v.igRating){_throw("igRatingException")}if(o.id){v.attr("id",o.id)}v=v.igRating(o);this.editor=v.data("igRating");foc=this.editor._foc;if(foc){foc.attr("tabIndex",tabIndex);foc.keydown(function(e){updating._notifyEditorKey(e,key)})}return v},getValue:function(){return this.editor.value()},setValue:function(val){return this.editor.value(val||0)},setSize:function(width,height){if(!this._once){this.editor._doVotes(this.editor.options)}this._once=1;var back=this.editor.element.parent().css("backgroundColor");this.editor.element.css({width:width,height:height,backgroundColor:back})},setFocus:function(){this.editor.focus()},validator:function(){return this.editor.validator()},destroy:function(){this.editor.destroy()}});$.ig.EditorProviderCheckbox=$.ig.EditorProviderCheckbox||$.ig.EditorProvider.extend({createEditor:function(updating,key,columnSetting,tabIndex,format,dataType){var elem,me=this,o=columnSetting;me.updating=updating;me.none=dataType==="bool"?false:null;me.element=elem=$('<span tabindex="'+tabIndex+'"/>').addClass("ui-igedit-field ui-state-default ui-corner-all").css({overflow:"hidden",textAlign:"center",outline:0,background:"#ffffff",display:"block"}).click(function(){me.setValue(0,updating)}).focus(function(){me.css(true,true)}).blur(function(){me.css(true)}).mouseover(function(){me.css(null,true)}).mouseleave(function(){me.css()}).keydown(function(e){updating._notifyEditorKey(e,key);if(e&&e.keyCode===32){_stop(e);me.setValue(0,updating)}});o=o?o.editorOptions:null;if(o&&o.id){elem.attr("id",o.id)}elem=$('<span class="ui-state-default ui-corner-all ui-igcheckbox-small" />').css("display","inline-block").appendTo(elem);$('<span class="ui-icon ui-icon-check ui-igcheckbox-small-on" />').css("display","block").appendTo(elem);return this.element},el:function(depth){var e=this.element;while(depth-->0){e=$(e.children()[0])}return e},getValue:function(){return this.value},setValue:function(val,updating){var css="ui-igcheckbox-small-off";if(updating){val=!this.value}this.value=val||val===false?val:this.none;if(val){this.el(2).removeClass(css)}else{this.el(2).addClass(css)}if(updating){updating._notifyChanged()}},css:function(foc,on){var i=2,css=foc?"ui-state-focus":"ui-state-hover";while(i-->0){if(on){this.el(i).addClass(css)}else{this.el(i).removeClass(css)}}},setSize:function(width,height){var elem=this.el(0);this.el(1).css("marginTop",Math.floor((height-15)/2)+"px");this.css();this.css(true);elem.css({width:width-_int(elem,"borderLeftWidth")-_int(elem,"borderRightWidth"),height:height-_int(elem,"borderTopWidth")-_int(elem,"borderBottomWidth")})},setFocus:function(toggle){this.el(0).focus();if(toggle){this.setValue(0,this.updating)}}})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI HtmlEditor 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 * <Licensing info>
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *   jquery-1.4.4.js
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 *   infragistics.ui.shared.js
 *   infragistics.dataSource.js
 *   infragistics.ui.combo.js
 *   infragistics.ui.dialog.js
 *   infragistics.util.js
 *   infragistics.ui.htmleditor-en.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igHtmlEditor",{options:{showFormattingToolbar:true,showTextToolbar:true,showInsertObjectToolbar:true,showCopyPasteToolbar:true,width:725,height:350,toolbarSettings:[],customToolbars:[],inputName:"source",value:""},events:{rendered:"rendered",rendering:"rendering",actionExecuting:"actionExecuting",actionExecuted:"actionExecuted",toolbarCollapsing:"toolbarCollapsing",toolbarCollapsed:"toolbarCollapsed",toolbarExpanding:"toolbarExpanding",toolbarExpanded:"toolbarExpanded",cut:"cut",copy:"copy",paste:"paste",undo:"undo",redo:"redo"},css:{htmlEditor:"ui-widget ui-widget-content ui-corner-all ui-ightmleditor ui-helper-clearfix",htmlEditorContent:"ui-ightmleditor-content",toolbarsContainer:"ui-igtoolbars-holder",pathFinder:"ui-igPathFinder",workspaceIframe:"ui-widget-content"},defaultToolbars:[{name:"textToolbar",displayName:$.ig.HtmlEditor.locale.defaultToolbars.textToolbar,isExpanded:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"Bold",type:"button",scope:null,props:{allowToggling:{value:true},isBold:{value:false,action:"_isSelectedAction"},boldButtonTooltip:{value:$.ig.HtmlEditor.locale.boldButtonTitle,action:"_tooltipAction"},boldButtonIcon:{value:"ui-igbutton-bold",action:"_buttonIconAction"}}},{name:"Italic",type:"button",props:{isItalic:{value:false,action:"_isSelectedAction"},italicButtonTooltip:{value:$.ig.HtmlEditor.locale.italicButtonTitle,action:"_tooltipAction"},italicButtonIcon:{value:"ui-igbutton-italic",action:"_buttonIconAction"}}},{name:"Underline",type:"button",props:{isUnderline:{value:false,action:"_isSelectedAction"},underlineButtonTooltip:{value:$.ig.HtmlEditor.locale.underlineButtonTitle,action:"_tooltipAction"},underlineButtonIcon:{value:"ui-igbutton-underline",action:"_buttonIconAction"}}},{name:"Strikethrough",type:"button",props:{isStrikethrough:{value:false,action:"_isSelectedAction"},strikethroughButtonTooltip:{value:$.ig.HtmlEditor.locale.strikethroughButtonTitle,action:"_tooltipAction"},strikethroughButtonIcon:{value:"ui-igbutton-strikethrough",action:"_buttonIconAction"}}},{name:"increasefontsize",type:"button",handler:"_increaseFontSize",props:{allowToggling:{value:false},isIncreaseFont:{value:false,action:"_isSelectedAction"},increaseFontButtonTooltip:{value:$.ig.HtmlEditor.locale.increaseFontSizeButtonTitle,action:"_tooltipAction"},increaseFontButtonIcon:{value:"ui-igbutton-increasefontsize",action:"_buttonIconAction"}}},{name:"decreasefontsize",type:"button",handler:"_decreaseFontSize",props:{allowToggling:{value:false},isDecreaseFont:{value:false,action:"_isSelectedAction"},decreaseFontButtonTooltip:{value:$.ig.HtmlEditor.locale.decreaseFontSizeButtonTitle,action:"_tooltipAction"},decreaseFontButtonIcon:{value:"ui-igbutton-decreasefontsize",action:"_buttonIconAction"}}},{name:"fontFamily",type:"combo",scope:null,handler:"_fontNamePlg",props:{fontFamilyComboWidth:{value:135,action:"_comboWidthAction"},fontFamilyComboHeight:{value:"",action:"_comboHeightAction"},fontFamilies:{value:$.ig.HtmlEditor.locale.fontNames[/^win/gi.test(navigator.platform)?"win":"mac"],action:"_comboDataSourceAction"},selectedFontFamily:{value:"Times New Roman",action:"_comboSelectedItem"}}},{type:"combo",name:"fontSize",scope:null,handler:"_fontSizePlg",props:{fontSizeComboWidth:{value:75,action:"_comboWidthAction"},fontSizeComboHeight:{value:"",action:"_comboHeightAction"},fontSizes:{value:$.ig.HtmlEditor.locale.fontSizes,action:"_comboDataSourceAction"},selectedFontSize:{value:"1",action:"_comboSelectedItem"},fontSizeItemsListWidth:{value:115,action:"_comboDropDownListWidth"}}},{type:"combo",name:"formatsList",scope:null,handler:"_formatsListPlg",props:{formatsListComboWidth:{value:120,action:"_comboWidthAction"},formatsListComboHeight:{value:"",action:"_comboHeightAction"},formatsList:{value:$.ig.HtmlEditor.locale.formatsList,action:"_comboDataSourceAction"},selectedFormat:{value:"h1",action:"_comboSelectedItem"}}}]},{name:"formattingToolbar",displayName:$.ig.HtmlEditor.locale.defaultToolbars.formattingToolbar,isExpanded:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"justifyleft",type:"button",props:{isJustifyleft:{value:false,action:"_isSelectedAction"},justifyleftButtonTooltip:{value:$.ig.HtmlEditor.locale.alignTextLeftButtonTitle,action:"_tooltipAction"},justifyleftButtonIcon:{value:"ui-igbutton-justifyleft",action:"_buttonIconAction"}}},{name:"justifycenter",type:"button",props:{isJustifycenter:{value:false,action:"_isSelectedAction"},justifycenterButtonTooltip:{value:$.ig.HtmlEditor.locale.alignTextCenterButtonTitle,action:"_tooltipAction"},justifycenterButtonIcon:{value:"ui-igbutton-justifycenter",action:"_buttonIconAction"}}},{name:"justifyright",type:"button",props:{isJustifyright:{value:false,action:"_isSelectedAction"},justifyrightButtonTooltip:{value:$.ig.HtmlEditor.locale.alignTextRightButtonTitle,action:"_tooltipAction"},justifyrightButtonIcon:{value:"ui-igbutton-justifyright",action:"_buttonIconAction"}}},{name:"justifyfull",type:"button",props:{isJustifyfull:{value:false,action:"_isSelectedAction"},justifyfullButtonTooltip:{value:$.ig.HtmlEditor.locale.justifyButtonTitle,action:"_tooltipAction"},justifyfullButtonIcon:{value:"ui-igbutton-justifyfull",action:"_buttonIconAction"}}},{name:"bullets",type:"splitButton",props:{items:{value:[{name:"InsertUnorderedList",label:$.ig.HtmlEditor.locale.bulletsButtonTitle,icon:"ui-igbutton-unorderedlist"},{name:"InsertOrderedList",label:$.ig.HtmlEditor.locale.numberingButtonTitle,icon:"ui-igbutton-orderedlist"}]},defaultItemName:{value:"InsertUnorderedList"}}},{name:"indents",type:"splitButton",props:{items:{value:[{name:"indent",label:$.ig.HtmlEditor.locale.increaseIndentButtonTitle,icon:"ui-igbutton-indent"},{name:"outdent",label:$.ig.HtmlEditor.locale.decreaseIndentButtonTitle,icon:"ui-igbutton-removeindent"}]},defaultItemName:{value:"indent"}}},{name:"textColor",type:"splitButtonColor",handler:"_fontColorPlg",props:{items:{value:[{name:"textColor",label:$.ig.HtmlEditor.locale.fontColorButtonTitle,icon:"ui-igbutton-forecolor"}]},defaultItemName:{value:"textColor"},selectedTextColor:{value:"red",action:"_spltButtonColorAction"}}},{name:"backgroundTextColor",type:"splitButtonColor",handler:"_fontBackgroundColorPlg",props:{items:{value:[{name:"backgroundTextColor",label:$.ig.HtmlEditor.locale.textHighlightButtonTitle,icon:"ui-igbutton-backcolor"}]},defaultItemName:{value:"backgroundTextColor"},selectedTextBackgroundColor:{value:"",action:"_spltButtonColorAction"}}}]},{name:"insertObjectToolbar",displayName:$.ig.HtmlEditor.locale.defaultToolbars.insertObjectToolbar,isExpanded:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"image",type:"button",handler:"_insertImageDialogPlg",props:{isImage:{value:false,action:"_isSelectedAction"},imageButtonTooltip:{value:$.ig.HtmlEditor.locale.insertPictureButtonTitle,action:"_tooltipAction"},imageButtonIcon:{value:"ui-igbutton-addimage",action:"_buttonIconAction"}}},{name:"link",type:"button",handler:"_insertLinkPlg",props:{isLink:{value:false,action:"_isSelectedAction"},linkButtonTooltip:{value:$.ig.HtmlEditor.locale.insertLinkButtonTitle,action:"_tooltipAction"},linkButtonIcon:{value:"ui-igbutton-addlink",action:"_buttonIconAction"}}},{name:"table",type:"button",handler:"_insertTablePlg",props:{isTable:{value:false,action:"_isSelectedAction"},tableButtonTooltip:{value:$.ig.HtmlEditor.locale.insertTableButtonTitle,action:"_tooltipAction"},tableButtonIcon:{value:"ui-igbutton-table",action:"_buttonIconAction"}}},{name:"addRow",type:"button",handler:"_addTableRowPlg",props:{allowToggling:{value:false},isAddRow:{value:false,action:"_isSelectedAction"},addRowButtonTooltip:{value:$.ig.HtmlEditor.locale.addRowButtonTitle,action:"_tooltipAction"},addRowButtonIcon:{value:"ui-igbutton-addrow",action:"_buttonIconAction"}}},{name:"addColumn",type:"button",handler:"_addTableColumnPlg",props:{allowToggling:{value:false},isAddColumn:{value:false,action:"_isSelectedAction"},addColumnButtonTooltip:{value:$.ig.HtmlEditor.locale.addColumnButtonTitle,action:"_tooltipAction"},addColumnButtonIcon:{value:"ui-igbutton-addcolumn",action:"_buttonIconAction"}}},{name:"removeRow",type:"button",handler:"_removeTableRowPlg",props:{allowToggling:{value:false},isRemoveRow:{value:false,action:"_isSelectedAction"},removeRowButtonTooltip:{value:$.ig.HtmlEditor.locale.removeRowButtonTitle,action:"_tooltipAction"},removeRowButtonIcon:{value:"ui-igbutton-removerow",action:"_buttonIconAction"}}},{name:"removeColumn",type:"button",handler:"_removeTableColumnPlg",props:{allowToggling:{value:false},isRemoveColumn:{value:false,action:"_isSelectedAction"},removeColumnButtonTooltip:{value:$.ig.HtmlEditor.locale.removeColumnButtonTitle,action:"_tooltipAction"},removeColumnButtonIcon:{value:"ui-igbutton-removecolumn",action:"_buttonIconAction"}}}]},{name:"copyPasteToolbar",displayName:$.ig.HtmlEditor.locale.defaultToolbars.copyPasteToolbar,isExpanded:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"copy",type:"button",scope:null,props:{isCopy:{value:false,action:"_isSelectedAction"},copyButtonTooltip:{value:$.ig.HtmlEditor.locale.copyButtonTitle,action:"_tooltipAction"},copyButtonIcon:{value:"ui-igbutton-copy",action:"_buttonIconAction"}}},{name:"cut",type:"button",scope:null,props:{isCut:{value:false,action:"_isSelectedAction"},cutButtonTooltip:{value:$.ig.HtmlEditor.locale.cutButtonTitle,action:"_tooltipAction"},cutButtonIcon:{value:"ui-igbutton-cut",action:"_buttonIconAction"}}},{name:"paste",type:"button",scope:null,props:{isPaste:{value:false,action:"_isSelectedAction"},pasteButtonTooltip:{value:$.ig.HtmlEditor.locale.pasteButtonTitle,action:"_tooltipAction"},pasteButtonIcon:{value:"ui-igbutton-paste",action:"_buttonIconAction"}}},{name:"undo",type:"button",scope:null,props:{allowToggling:{value:false},isUndo:{value:false,action:"_isSelectedAction"},undoButtonTooltip:{value:$.ig.HtmlEditor.locale.undoButtonTitle,action:"_tooltipAction"},undoButtonIcon:{value:"ui-igbutton-undo",action:"_buttonIconAction"}}},{name:"redo",type:"button",scope:null,props:{allowToggling:{value:false},isRedo:{value:false,action:"_isSelectedAction"},redoButtonTooltip:{value:$.ig.HtmlEditor.locale.redoButtonTitle,action:"_tooltipAction"},redoButtonIcon:{value:"ui-igbutton-redo",action:"_buttonIconAction"}}}]}],NODE:new $.ig.XmlNodeType,_toolbarsActiveState:{},_toolbarItemsDescriptors:{button:$.ig.igToolbarButtonDescriptor,0:$.ig.igToolbarButtonDescriptor,combo:$.ig.igToolbarComboDescriptor,1:$.ig.igToolbarComboDescriptor,splitButton:$.ig.igToolbarSplitButtonDescriptor,2:$.ig.igToolbarSplitButtonDescriptor,splitButtonColor:$.ig.igToolbarSplitButtonDescriptor,3:$.ig.igToolbarSplitButtonDescriptor,custom:$.ig.igToolbarItemBaseDescriptor},_isDirty:false,_createWidget:function(){this._allToolbars=[];$.Widget.prototype._createWidget.apply(this,arguments)},_id:function(id){return this.element[0].id+id},widget:function(){return this.element},_render:function(){var html="",inputName=this.options.inputName;this.element.addClass(this.css.htmlEditor);html+='<div id="'+this._id("_toolbars")+'" class="'+this.css.toolbarsContainer+'"></div>';html+='<div id="'+this._id("_content")+'" class="'+this.css.htmlEditorContent+'">';html+='<iframe class="'+this.css.workspaceIframe+'" id="'+this._id("_editor")+'"></iframe>';html+='<textarea name="'+inputName+'" id="'+this._id("_source")+'"></textarea>';html+="</div>";$(html).appendTo(this.element);$("#"+this._id("_source")).hide();this.element.height(this.options.height);this.element.width(this.options.width)},_createWorkspace:function(content){var iFrameContent="<"+"!"+"DOCTYPE html"+">"+"<html>"+"<head>"+"<title>igHtmlEditor</title>"+"</head>"+'<body contentEditable="true" spellcheck="false" style="-webkit-tap-highlight-color: rgba(255, 255, 255, 0);">'+"<p>";if(!document.all){iFrameContent+="<br />"}iFrameContent+="</p></body>"+"</html>";this.workspace=this.element.find("#"+this._id("_editor"))[0];this.workspace.contentWindow.document.open("text/html","replace");this.workspace.contentWindow.document.write(iFrameContent);this.workspace.contentWindow.document.close();if(content&&content.length>0){$(this.workspace).contents().find("body").html(content)}if($.ig.util.isWebKit){this.workspace.contentWindow.document.body.contentEditable=true}if(!document.all){this.workspace.contentWindow.document.execCommand("styleWithCSS",false,true)}},_getToolbar:function(index){if(!isNaN(parseInt(index,10))){return this._toolbars.eq(index)}if(typeof index==="string"){return this._toolbars.find("#"+this._id("_toolbars_"+index))}},_getFirefoxVersion:function(){if($.ig.util.isFF){return parseInt(window.navigator.userAgent.match(/\bFirefox\/[0-9\.]+\b/)[0].split("/").reverse()[0],10)}},_create:function(){var noCancel=this._trigger(this.events.rendering,null,{owner:this}),content=this.options.value||this.element.html();this.element.empty();this._allToolbars=$.extend(true,[],this.defaultToolbars.concat(this.options.customToolbars));this._initToolabrs();this._setActiveToolbars();if(noCancel){this._render();this._createToolbars();this._createWorkspace(content);this._domPathToolbar();this._resizeWorkspace();this._trigger(this.events.rendered,null,{owner:this})}},_resizeWorkspace:function(){var height=this.element.height(),$editor=$("#"+this._id("_editor"));height-=$("#"+this._id("_toolbars")).outerHeight(true);height-=$(".ui-igbutton-viewsource").outerHeight(true);height-=$editor.outerHeight(true)-$editor.height();$editor.height(height);$("#"+this._id("_source")).height(height)},_init:function(){this._bindToToolbarEvents();this._bindWorkspaceEvents();this.sourceWindow=this.element.find("#"+this._id("_source"));this._initFontsCombos();this._initFormatsListCombo();this._initFontSizeCombo();this._analyser=new $.ig.ToolbarHelper(this.workspace.contentWindow,this._toolbars.children());var self=this;this._onSelectionChange(function(){self._initialWorkspaceFormatting()})},_initFontsCombos:function(){var fontFamiliesCombo=this._getToolbar("textToolbar").igToolbar("getItem","fontFamily").addClass("ui-combo-fontfamily");fontFamiliesCombo.igCombo("option",{itemTemplate:'<span style="font-family: ${value}" unselectable="on">${text}</span>'})},_initFormatsListCombo:function(){var formatsListCombo=this._getToolbar("textToolbar").igToolbar("getItem","formatsList");formatsListCombo.igCombo("option","itemTemplate",'<${text} unselectable="on">${value}</${text}>')},_initFontSizeCombo:function(){var fontSizesCombo=this._getToolbar("textToolbar").igToolbar("getItem","fontSize");fontSizesCombo.igCombo("option",{itemTemplate:'<span style="font-size: ${style}; line-height: ${style}" unselectable="on">${value}</span>'})},_setOption:function(name,value){var self=this,updatedItems=[];if(name===undefined||value===undefined){return}if(name==="toolbarSettings"){$.each(value,function(index,toolbar){$.each(toolbar,function(tbPropName,tbPropVal){if(tbPropName!=="name"){self._tbHash[toolbar.name][tbPropName].updateProperty(tbPropName,tbPropVal);updatedItems.push(self._tbHash[toolbar.name][tbPropName])}});self._getToolbar(self._allToolbars[index].name).igToolbar("option","items",updatedItems)})}else if(this._toolbarsActiveState[name]){this._showToolbar(this._toolbarsActiveState[name].name,value)}else if(name==="width"){this.element.width(value)}else if(name==="height"){this.element.find("#"+this._id("_editor")).height(value)}$.Widget.prototype._setOption.apply(this,arguments)},_showToolbar:function(name,show){if(show){this._getToolbar(name).removeClass("hidden").show()}else{this._getToolbar(name).addClass("hidden").hide()}},_setActiveToolbars:function(){var self=this,o=this.options;$.each(o,function(name,value){if(self._toolbarsActiveState[name]){self._toolbarsActiveState[name].value=value;o[name]=value}})},_initToolabrs:function(){var o=this.options,toolbar,item,itemDescriptor,i,j,toolbarName,showToolbar,property;this._wrappedToolbars=[];this._tbHash={};for(i=0;i<this._allToolbars.length;i++){toolbar=this._allToolbars[i];this._tbHash[toolbar.name]={toolbarOpts:toolbar};this._tbHash[toolbar.name].isExpanded=false;this._wrappedToolbars[i]=toolbar;for(j=0;j<toolbar.items.length;j++){item=toolbar.items[j];if(!item.type){item.type="custom"}itemDescriptor=this._wrappedToolbars[i].items[j]=this._getToolbarItemDescriptor(item);for(property in itemDescriptor.getProperties()){if(itemDescriptor.getProperties().hasOwnProperty(property)){if(this._tbHash[toolbar.name]===undefined){this._tbHash[toolbar.name]={}}this._tbHash[toolbar.name][property]=itemDescriptor}}}showToolbar=$.camelCase("show-"+toolbar.name);this._toolbarsActiveState[showToolbar]={name:toolbar.name,value:true}}for(i=0;i<o.toolbarSettings.length;i++){toolbar=o.toolbarSettings[i];for(property in toolbar){if(toolbar.hasOwnProperty(property)){toolbarName=toolbar.name;if(this._tbHash[toolbarName].toolbarOpts[property]!==undefined&&property!=="name"){this._tbHash[toolbarName].toolbarOpts[property]=toolbar[property];continue}if(this._tbHash[toolbarName][property]===undefined||this._tbHash[toolbarName]===undefined){continue}this._tbHash[toolbarName][property].getProperty(property).value=toolbar[property]}}}},_getToolbarItemDescriptor:function(item){return new this._toolbarItemsDescriptors[item.type](item)},_createToolbars:function(){var i,toolbar;this._toolbars=this.element.find("#"+this._id("_toolbars"));for(i=0;i<this._wrappedToolbars.length;i++){toolbar=$('<span id="'+this._id("_toolbars")+"_"+this._wrappedToolbars[i].name+'"></span>').appendTo(this._toolbars).igToolbar(this._wrappedToolbars[i]);if(!this._isToolbarActive(this._wrappedToolbars[i].name)){toolbar.hide().addClass("hidden")}}},_initialWorkspaceFormatting:function(){var o=this.options,i,toolbar,property,commands={isBold:"bold",isItalic:"italic",isUnderline:"underline",isStrikethrough:"strikethrough"};for(i=0;i<o.toolbarSettings.length;i++){toolbar=o.toolbarSettings[i];for(property in toolbar){if(toolbar.hasOwnProperty(property)&&commands.hasOwnProperty(property)){this._execCommand(commands[property])}}}},_isToolbarActive:function(tbName){var key;for(key in this._toolbarsActiveState){if(this._toolbarsActiveState.hasOwnProperty(key)){if(this._toolbarsActiveState[key].name===tbName){return this._toolbarsActiveState[key].value}}}},_execCommand:function(name,args){this._selectionWrapperSaved.focus();this._selectionWrapperSaved.execCommand(name.toLowerCase(),args);this._onSelectionChange()},_bindToToolbarEvents:function(){var self=this,events="igtoolbartoolbarbuttonclick igtoolbartoolbarcomboselected igtoolbartoolbarcustomitemclick igtoolbarcollapsing igtoolbarcollapsed igtoolbarexpanding igtoolbarexpanded",toolbarEvents={igtoolbarcollapsing:this.events.toolbarCollapsing,igtoolbarcollapsed:this.events.toolbarCollapsed,igtoolbarexpanding:this.events.toolbarExpanding,igtoolbarexpanded:this.events.toolbarExpanded};this._toolbars.delegate(":ui-igToolbar",events,function _onToolbarItemClick(e,ui){var scope=ui.scope,handler=ui.handler,noCancel;delete ui.scope;delete ui.handler;if(toolbarEvents.hasOwnProperty(e.type)){self._trigger(toolbarEvents[e.type],e,ui);return}ui.selectedItem=self._selectionWrapperSaved&&self._selectionWrapperSaved.getSelectedItem();noCancel=self._trigger(self.events.actionExecuting,e,{owner:self,toolbar:ui.toolbarName,actionName:ui.name});if(noCancel){if(!handler&&!scope){self._execCommand(ui.name,ui.value)}else if(handler&&!scope){self[handler](self.workspace.contentWindow.document,ui)}else if(handler&&scope){handler.call(ui.scope,self.workspace.contentWindow.document,ui)}self._trigger(self.events.actionExecuted,e,{owner:self,toolbar:ui.toolbarName,actionName:ui.name});e.stopImmediatePropagation()}});$(this.element).delegate(".ui-ightmleditor-dialog-container","iglinkpropertiesdialogshow igtablepropertiesdialogshow igimagepropertiesdialogshow",function(e){$(".ui-ightmleditor-dialog-container").not(e.currentTarget).filter(":ui-igLinkPropertiesDialog").igLinkPropertiesDialog("hide").end().filter(":ui-igTablePropertiesDialog").igTablePropertiesDialog("hide").end().filter(":ui-igImagePropertiesDialog").igImagePropertiesDialog("hide").end()})},_bindWorkspaceEvents:function(){var self=this,KEYS={webKitIE:{CTRLZ:90,CTRLY:89},moz:{CTRLZ:90,CTRLY:89}};$(this.workspace.contentWindow.document).find("html").bind("click",function(e){var target=$(e.target);if(target.is("html")){self.workspace.contentWindow.document.body.focus()}self._isDirty=true;self.element.find(":ui-igSplitButton").igSplitButton("collapse");self.element.find(":ui-igColorPickerSplitButton").igColorPickerSplitButton("collapse");self.element.find(":ui-igLinkPropertiesDialog").igLinkPropertiesDialog("hide");self.element.find(":ui-igTablePropertiesDialog").igTablePropertiesDialog("hide");self.element.find(":ui-igImagePropertiesDialog").igImagePropertiesDialog("hide");e.stopPropagation()}).bind("mouseup",function(e){self._onSelectionChange()});$(this.workspace.contentWindow.document).bind("keydown",function(e){self._isDirty=true;if(e.ctrlKey&&(e.which===KEYS.webKitIE.CTRLZ||e.which===KEYS.moz.CTRLZ)){self._trigger(self.events.undo,e,{owner:self})}if(e.ctrlKey&&(e.which===KEYS.webKitIE.CTRLY||e.which===KEYS.moz.CTRLY)){self._trigger(self.events.redo,e,{owner:self})}self._onSelectionChange()});$(this.workspace.contentWindow.document).bind("cut copy paste",function(e){self._trigger(e.type,e,{owner:self})});this.element.bind("ightmleditoractionexecuted",function(e,ui){if(ui.actionName.toLowerCase()===self.events.undo||ui.actionName.toLowerCase()===self.events.redo){self._trigger(ui.actionName.toLowerCase(),e,{owner:self});e.stopImmediatePropagation()}})},_viewSource:function(){var workspace=$(this.workspace),workSpaceBody=workspace.contents().find("body");if(workspace.is(":visible")){workSpaceBody.attr("contentEditable",false);this.sourceWindow.val(workSpaceBody.html());workspace.hide();this.sourceWindow.show()}else{workSpaceBody.attr("contentEditable",true);workSpaceBody.empty().append($(this.sourceWindow.val()));workspace.show();this.sourceWindow.hide();this.sourceWindow.val(encodeURI(this.sourceWindow.val()))}},_viewSourcePlg:function(ui){this._viewSource()},_insertImageDialogPlg:function(workspace,plgUI){var image=$("<img>",this.workspace.contentWindow.document),self=this;if(plgUI.selectedItem.is("img")){image=plgUI.selectedItem}this._imageDialog=$("#"+this._id("_imageDialog"));if(!this._imageDialog.length){this._imageDialog=$('<div id="'+this._id("_imageDialog")+'"></div>').appendTo(this.element).igImagePropertiesDialog({item:image,target:plgUI.toolbarItem,applyform:function(e,ui){self._selectionWrapperSaved.focus();self._selectionWrapperSaved.replaceNode(ui.image)}})}else{if(this._imageDialog.igImagePropertiesDialog("option","isHidden")){this._imageDialog.igImagePropertiesDialog("show",image)}else{this._imageDialog.igImagePropertiesDialog("hide",image)}}},_insertLinkPlg:function(workspace,ui){var self=this,selectedItem=this._selectionWrapperSaved.getSelectedItem(),selectedItemNodeType=selectedItem[0].nodeType,anchor=$("<a></a>",this.workspace.contentWindow.document);if(selectedItem.parent().is("a")){anchor=selectedItem.parent()}else if(selectedItemNodeType===this.NODE._Text||selectedItemNodeType===this.NODE._Element){anchor.html(this._selectionWrapperSaved.getSelectionAsText())}if(!this._insertLinkDialog){this._insertLinkDialog=$('<div id="'+this._id("_linkDialog")+'"></div>').appendTo(this.element).igLinkPropertiesDialog({item:anchor,target:ui.toolbarItem,applyform:function(e,ui){self._selectionWrapperSaved.focus();self._selectionWrapperSaved.replaceNode(ui.anchor)}})}else{if(this._insertLinkDialog.igLinkPropertiesDialog("option","isHidden")){this._insertLinkDialog.igLinkPropertiesDialog("show",anchor)}else{this._insertLinkDialog.igLinkPropertiesDialog("hide",anchor)}}},_increaseFontSize:function(){this._selectionWrapperSaved.focus();this._execCommand("increasefontsize");this._onSelectionChange()},_decreaseFontSize:function(){this._selectionWrapperSaved.focus();this._execCommand("decreasefontsize");this._onSelectionChange()},_fontNamePlg:function(workspace,ui){this._execCommand("fontname",ui.value)},_fontSizePlg:function(workspace,ui){this._execCommand("fontsize",ui.value)},_formatsListPlg:function(workspace,ui){this._execCommand("formatBlock","<"+ui.value+">")},_insertTablePlg:function(workspace,plgUI){var table=$("<table></table>",this.workspace.contentWindow.document),self=this;if(plgUI.selectedItem.is("table")){table=plgUI.selectedItem}if(!this.insertTableDialog){this.insertTableDialog=$("<div id='"+this._id("_tableDialog")+"'</div>").appendTo(this.element).igTablePropertiesDialog({item:table,target:plgUI.toolbarItem,applyform:function(e,ui){self._selectionWrapperSaved.insertTable(ui.table)}});return}if(this.insertTableDialog.igTablePropertiesDialog("option","isHidden")){this.insertTableDialog.igTablePropertiesDialog("show",table);return}if(!this.insertTableDialog.igTablePropertiesDialog("option","isHidden")){this.insertTableDialog.igTablePropertiesDialog("hide")}},_addTableRowPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("addRow")}else if(selectedItem.is("td")){selectedItem.parents("table").tableManipulator("addRow",selectedItem.parent().index())}},_removeTableRowPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("removeRow")}else if(selectedItem.is("td")){selectedItem.parents("table").tableManipulator("removeRow",selectedItem.parent().index())}},_addTableColumnPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("addColumn")}else if(selectedItem.is("td")){selectedItem.parents("table").tableManipulator("addColumn",selectedItem.index())}},_removeTableColumnPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("removeColumn")}else if(selectedItem.is("td")){selectedItem.parents("table").tableManipulator("removeColumn",selectedItem.index())}},_fontColorPlg:function(workspace,ui){this._execCommand("forecolor",ui.value)},_fontBackgroundColorPlg:function(workspace,ui){var command=this._getFirefoxVersion()?"hilitecolor":"backcolor";this._execCommand(command,ui.value)},_domPathToolbar:function(){var self=this,tableItemPref="#"+this._id("_toolbars_insertObjectToolbar_item_"),tableItemAddRowID=tableItemPref+"addRow",tableItemAddColID=tableItemPref+"addColumn",tableItemRemRowID=tableItemPref+"removeRow",tableItemRemColID=tableItemPref+"removeColumn",doNotEnableToolbarButtonsSelector=tableItemAddRowID+", "+tableItemAddColID+", "+tableItemRemRowID+", "+tableItemRemColID;this._viewSourceBtn=$('<div class="ui-igbutton-viewsource"></div>').appendTo(this.element).igButton({labelText:"&nbsp;",title:$.ig.HtmlEditor.locale.viewSourceButtonTitle,icons:{primary:"ui-igbutton-viewsource-icon"},onlyIcons:true,click:function(){self._viewSourcePlg();if(self._domPathToolbar.igPathFinder("option","disabled")){self._domPathToolbar.igPathFinder("option","disabled",false);self._toolbars.find(":ui-igToolbarButton").not(doNotEnableToolbarButtonsSelector).igToolbarButton("option","disabled",false).end().end().find(":ui-igCombo").igCombo("enable");self._analyser._disableUnsupportedItems();self._onSelectionChange()}else{self._domPathToolbar.igPathFinder("option","disabled",true);self._toolbars.find(":ui-igToolbarButton").igToolbarButton("option","disabled",true).end().find(":ui-igCombo").igCombo("disable").end()}}});this._domPathToolbar=$('<div id="'+this._id("_domPathToolbar")+'" style="display: inline-block"></div>').appendTo(this.element).igPathFinder({click:function(e,ui){var selectionWrapper=self._selectionWrapperSaved;self.workspace.contentWindow.document.body.focus();if(self._domPathToolbar.igPathFinder("option","disabled")){return}e.preventDefault();if(ui.item.is("html")){selectionWrapper.select(ui.item.children("body"))}else if(ui.item.is("body")){selectionWrapper.select(ui.item)}else{selectionWrapper.select(ui.item)}}})},_cutPlg:function(){this._execCommand("cut")},_copyPlg:function(){this._execCommand("copy")},_pastePlg:function(){this._execCommand("paste")},_onSelectionChange:function(callback){var self=this,selectionWrapper,workSpaceBody=$(this.workspace).contents().find("body"),selectionCallback=callback||function(){var selectedItem=this.getSelectedItem();if(selectedItem&&(selectedItem.is("p")||selectedItem.is(":header"))&&selectedItem.children("span").length>0){selectedItem=selectedItem.children("span").first()}else if(selectedItem&&(selectedItem.is("p")||selectedItem.is(":header"))&&selectedItem.children("font").length>0){selectedItem=selectedItem.children("font").first()}if(selectedItem[0].nodeType===self.NODE._Text){selectedItem=selectedItem.parent()}self._analyser.analyse(selectedItem);if(selectedItem.length){self._domPathToolbar.igPathFinder("option","items",$.merge(selectedItem,selectedItem.parents()))}};selectionWrapper=new $.ig.SelectionWrapper(this.workspace.contentWindow,function(){self._selectionWrapperSaved=this;self.sourceWindow.val(encodeURI(workSpaceBody.html()));selectionCallback.call(this)})},getContent:function(format){if(format==="text"){return $(this.workspace).contents().find("body").text()}if(format==="html"){return $(this.workspace).contents().find("body").html()}},setContent:function(content,format){if(format==="text"){$(this.workspace).contents().find("body").text(content)}else if(format==="html"){$(this.workspace).contents().find("body").html(content)}this.sourceWindow.val(encodeURI(content))},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);$(this.workspace.contentWindow).undelegate();this.element.removeClass(this.css.htmlEditor).find("#"+this._id("_content")).removeClass(this.css.htmlEditorContent).end().find("#"+this._id("_domPathToolbar")).removeClass(this.css.pathFinder).end().find("#"+this._id("_toolbars")).removeClass(this.css.toolbarsContainer).end().find(":ui-igToolbar").igToolbar("destroy").end().empty();this._viewSourceBtn.igButton("destroy")},executeAction:function(actionName,args){this._selectionWrapperSaved.execCommand(actionName.toLowerCase(),args);this._onSelectionChange()},isDirty:function(){return this._isDirty}});$.widget("ui.igPathFinder",{options:{items:null},css:{button:"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-igbutton ui-widget-content",buttonLabel:"ui-button-text"},_create:function(){this._addStyles()},_addStyles:function(){this.element.addClass("ui-igPathFinder")},_setOption:function(name,value){$.Widget.prototype._setOption.apply(this,arguments);switch(name){case"items":this._updateToolbar();break;case"disabled":this.element.find("button").attr("disabled",value).attr("aria-disabled",value);break;default:break}},_updateToolbar:function(){var self=this,o=this.options,path=[],parents,html="",buttonsList;if(o.items.length){o.items.each(function(index,element){html='<button aria-disabled="false" role="button" class="'+self.css.button+'">'+'	<span class="'+self.css.buttonLabel+'">'+element.nodeName+"	</span>"+"</button>";path.push(html)});parents=$(o.items.toArray().reverse());buttonsList=$(path.reverse().join("<span> &gt; </span>")).appendTo(this.element.empty()).filter("button").attr("disabled",o.disabled).attr("aria-disabled",o.disabled);buttonsList.mouseover(function(e){if(!o.disabled){$(this).addClass("ui-state-hover")}}).mouseleave(function(e){if(!o.disabled){$(this).removeClass("ui-state-hover")}}).click(function(e){if(!o.disabled){$(this).siblings(".ui-state-active").removeClass("ui-state-active");$(this).addClass("ui-state-active");self._trigger("click",e,{item:parents.eq(buttonsList.index(this))})
}})}}});$.widget("ui.igHtmlEditorPopover",{options:{item:null,target:null,isHidden:true},css:{igHtmlEditorPropertiesDialog:"ui-ightmleditor-dialog",igHtmlEditorPropertiesDialogContainer:"ui-ightmleditor-dialog-container"},events:{apply:"applyform",cancel:"cancelform",show:"show",hide:"hide"},_id:function(id){return this.element[0].id+id},_create:function(){this.element.igPopover({closeOnBlur:false,position:"balanced",direction:"bottom",renderCloseButton:false,target:this.options.target});this.poContent=this.element.igPopover("container");this._createForm()},_init:function(){var o=this.options;this._item=o.item;this.poContent.addClass(this.css.igHtmlEditorPropertiesDialog);this.element.addClass(this.css.igHtmlEditorPropertiesDialogContainer);this._attachFormEvents();this.show(this._item)},_setOption:function(name,val){var o=this.options;$.Widget.prototype._setOption.apply(this,arguments);switch(name){case"isHidden":this.element.igDialog("option","visible",o.isHidden);break}},_createForm:function(){},_attachFormEvents:function(){},_dataBind:function(item){},show:function(item){this._item=item;this._dataBind(item);this.options.isHidden=false;$("#"+this._id().split("_")[0]).find(":ui-igSplitButton").igSplitButton("collapse");$("#"+this._id().split("_")[0]).find(":ui-igColorPickerSplitButton").igColorPickerSplitButton("collapse");this.element.igPopover("show");this._trigger(this.events.show)},hide:function(){this.options.isHidden=true;if(this.options.target.igToolbarButton("option","isSelected")){this.options.target.igToolbarButton("toggle")}this.element.igPopover("hide");this._trigger(this.events.hide)}});$.widget("ui.igLinkPropertiesDialog",$.ui.igHtmlEditorPopover,{_txtUrl:"",_cbTarget:"",_attachFormEvents:function(){var self=this;this.poContent.find("#"+this._id("_cmbOpenIn")).igCombo({selectedItems:[{index:0}],enableClearButton:false,width:155});this.poContent.find("#"+this._id("_btnCancel")).igButton({click:function(){self.hide()}});this.poContent.find("#"+this._id("_btnApply")).igButton({click:function(e){e.stopImmediatePropagation();self._item.attr({href:self._txtUrl.val(),target:self._cbTarget.igCombo("value")}).html(self._displayText.val().length>0?self._displayText.val():self._txtUrl.val());self._trigger("applyform",e,{anchor:self._item});self.hide()}});this.poContent.bind("keypress",function(e){if(e.keyCode===$.ui.keyCode.ESCAPE){self.hide()}});this.element.bind("igpopoverpopovershown",function(e){self.poContent.find("#"+self._id("_linkHref")).focus()})},_createForm:function(){var html="";html+='<div class="'+this.css.igLinkPropertiesDialogContent+'">';html+="<div>";html+='<ol class="layoutList">';html+="<li>";html+='<label for="'+this._id("_linkHref")+'">'+$.ig.HtmlEditor.locale.linkNavigateToUrlDialogText+"</label>";html+='<input autocomplete="off" id="'+this._id("_linkHref")+'" name="href" type="text" value="" />';html+="</li>";html+="<li>";html+='<label for="'+this._id("_linkDisplayText")+'">'+$.ig.HtmlEditor.locale.linkDisplayTextDialogText+"</label>";html+='<input autocomplete="off" id="'+this._id("_linkDisplayText")+'" name="href" type="text" value="" />';html+="</li>";html+="<li>";html+='<label for="'+this._id("_cmbOpenIn")+'">'+$.ig.HtmlEditor.locale.linkOpenInDialogText+"</label>";html+='<select id="'+this._id("_cmbOpenIn")+'" name="target">';html+='<option value="_blank">'+$.ig.HtmlEditor.locale.linkTargetNewWindowDialogText+"</option>";html+='<option value="_self">'+$.ig.HtmlEditor.locale.linkTargetSameWindowDialogText+"</option>";html+='<option value="_parent">'+$.ig.HtmlEditor.locale.linkTargetParentWindowDialogText+"</option>";html+='<option value="_top">'+$.ig.HtmlEditor.locale.linkTargetTopmostWindowDialogText+"</option>";html+="</select>";html+="</li>";html+='<li style="text-align:right">';html+='<button aria-disabled="false" id="'+this._id("_btnApply")+'" name="insertLink" role="button" title="'+$.ig.HtmlEditor.locale.applyButtonTitle+'" type="button">'+$.ig.HtmlEditor.locale.applyButtonTitle+"</button>";html+='<button aria-disabled="false" id="'+this._id("_btnCancel")+'" role="button" title="'+$.ig.HtmlEditor.locale.cancelButtonTitle+'" type="button">'+$.ig.HtmlEditor.locale.cancelButtonTitle+"</button>";html+="</li>";html+="</ol>";html+="</div>";html+="</div>";$(html).appendTo(this.poContent)},_dataBind:function(anchor){this._txtUrl=this.poContent.find("#"+this._id("_linkHref")).val(anchor.attr("href"));this._cbTarget=this.poContent.find("#"+this._id("_cmbOpenIn")).val(anchor.attr("target"));this._displayText=this.poContent.find("#"+this._id("_linkDisplayText")).val(anchor.html())}});$.widget("ui.igTablePropertiesDialog",$.ui.igHtmlEditorPopover,{_init:function(){this.rowsNumField=this.element.find("#"+this._id("_tableRows"));this.columnsNumField=this.element.find("#"+this._id("_tableColumns"));this.widthNumField=this.element.find("#"+this._id("_tableWidth"));this.heightNumField=this.element.find("#"+this._id("_tableHeight"));$.ui.igHtmlEditorPopover.prototype._init.apply(this,arguments)},_createForm:function(){var html="<div>"+"<div>"+'<ol class="layoutList">'+"<li>"+"</li>"+"<li>"+'<div class="ui-igtablepropertiesdialog-cols-rows-num">'+'<input type="hidden" id="'+this._id("_tableRows")+'" name="tableRows" readonly="readonly" value="">'+'<input type="hidden" id="'+this._id("_tableColumns")+'" name="tableColumns" readonly="readonly" value="">'+"</div>"+"</li>"+"</ol>"+"</div>"+"</div>";$(html).appendTo(this.poContent);this._sampleTable=$('<table "'+this._id("_tableModel")+'" class="ui-igtablepropertiesdialog-sample-table"></table>').tableManipulator({rows:8,columns:6}).appendTo(this.poContent.find(".layoutList li:first"))},_attachFormEvents:function(){var tablePreview=this.poContent.find("table"),cells=tablePreview.find("td").addClass("ui-state-default"),rows=tablePreview.find("tr"),self=this;tablePreview.delegate("td","mouseover click",function(e){var target=$(e.target),currentRowNumber=target.parent().index()+1,currentColumnNumber=$(this).index()+1,i;if(e.type==="mouseover"){cells.removeClass("ui-state-hover");for(i=0;i<currentRowNumber;i++){$(rows.get(i)).find("td:lt("+currentColumnNumber+")").addClass("ui-state-hover")}self.rowsNumField.val(currentRowNumber);self.columnsNumField.val(currentColumnNumber)}if(e.type==="click"){self._item.tableManipulator({rows:currentRowNumber,columns:currentColumnNumber,addSpacingChar:true});self._trigger("applyform",e,{table:self._item.attr("border",1)});self.hide()}});tablePreview.bind("mouseout",function(){cells.removeClass("ui-state-hover");self.rowsNumField.val(null);self.columnsNumField.val(null)})},_dataBind:function(table){this.rowsNumField.val();this.columnsNumField.val();this.widthNumField.val();this.heightNumField.val()}});$.widget("ui.igImagePropertiesDialog",$.ui.igHtmlEditorPopover,{_init:function(){this._imgSrcFld=this.poContent.find("#"+this._id("_imgSrc"));this._imgAltFld=this.poContent.find("#"+this._id("_imgAlt"));this._imgWidthFld=this.poContent.find("#"+this._id("_imgWidth")).igNumericEditor({minValue:0,button:"spin",maxDecimals:0});this._imgHeightFld=this.poContent.find("#"+this._id("_imgHeight")).igNumericEditor({minValue:0,button:"spin",maxDecimals:0});$.ui.igHtmlEditorPopover.prototype._init.apply(this,arguments)},_createForm:function(){var html="";html+='<div class="'+this.css.igImagePropertiesDialogContent+'">';html+="	<div>";html+='		<ol class="layoutList">';html+="			<li>";html+='				<label for="'+this._id("_imgSrc")+'">'+$.ig.HtmlEditor.locale.imageUrlDialogText+"</label>";html+='				<input autocomplete="off" id="'+this._id("_imgSrc")+'" name="src" type="text" value="" />';html+="			</li>";html+="			<li>";html+='				<label for="'+this._id("_imgAlt")+'">'+$.ig.HtmlEditor.locale.imageAlternativeTextDialogText+"</label>";html+='				<input autocomplete="off" id="'+this._id("_imgAlt")+'" name="altText" type="text" value="" />';html+="			</li>";html+='			<li style="display:'+(this._item&&this._item.width()?"block":"none")+';">';html+='				<label for="'+this._id("_imgWidth")+'">'+$.ig.HtmlEditor.locale.imageWidthDialogText+"</label>";html+='				<input autocomplete="off" id="'+this._id("_imgWidth")+'" name="width" type="text" value="" />';html+="			</li>";html+='			<li style="display:'+(this._item&&this._item.height()?"block":"none")+';">';html+='				<label for="'+this._id("_imgHeight")+'">'+$.ig.HtmlEditor.locale.imageHeihgtDialogText+"</label>";html+='				<input autocomplete="off" id="'+this._id("_imgHeight")+'" name="height" type="text" value="" />';html+="			</li>";html+='			<li style="text-align:right">';html+='				<button aria-disabled="false" id="'+this._id("_btnApply")+'" name="insertLink" role="button" title="'+$.ig.HtmlEditor.locale.applyButtonTitle+'" type="button">'+$.ig.HtmlEditor.locale.applyButtonTitle+"</button>";html+='				<button aria-disabled="false" id="'+this._id("_btnCancel")+'" role="button" title="'+$.ig.HtmlEditor.locale.cancelButtonTitle+'" type="button">'+$.ig.HtmlEditor.locale.cancelButtonTitle+"</button>";html+="			</li>";html+="		</ol>";html+="	</div>";html+="</div>";this.poContent.append(html)},_attachFormEvents:function(){var self=this;this.poContent.find("#"+this._id("_btnApply")).igButton({click:function(e){self._item.attr({src:self._imgSrcFld.val(),alt:self._imgAltFld.val()});self._trigger(self.events.apply,e,{image:self._item});self.hide()}}).end().find("#"+this._id("_btnCancel")).igButton({click:function(e){self._trigger(self.events.cancel,e);self.hide()}}).end()},_dataBind:function(image){this._imgSrcFld.val(image.attr("src"));this._imgAltFld.val(image.attr("alt"));if(image.width()===0||image.height()===0){return}this._imgWidthFld.igNumericEditor("value",image.width());this._imgHeightFld.igNumericEditor("value",image.height());this.poContent.find(":hidden").show()},_aspectRatio:function(){var aspectRatioBtn=this.poContent.find("#"+this._id("_imgAspectRatio")),o=this.options;aspectRatioBtn.igButton({height:13,width:18,icons:{primary:"ui-igbutton-unlink"},css:{buttonPrimaryIconClass:"ui-icon"},click:function(e,ui){var thisEl=$(this),elIcon="ui-igbutton-link",preserveAspRatio=true;if(thisEl.data("preserveAspRatio")){elIcon="ui-igbutton-unlink";preserveAspRatio=false}thisEl.igButton("option","icons",{primary:elIcon}).data("preserveAspRatio",preserveAspRatio)}});if(this._imgSrcFld.val()){if(o.image.width()!==0&&o.image.height()!==0){this._imgWidthFld.igNumericEditor("value",o.image.width()).bind("ignumericeditorspin",function(e,ui){if(aspectRatioBtn.data("preserveAspRatio")){this._imgHeightFld.val(Math.round(o.image.height()/o.image.width()*ui.value+ui.delta))}});this._imgHeightFld.igNumericEditor("value",o.image.height()).bind("ignumericeditorspin",function(e,ui){this._imgWidthFld.val(Math.round(o.image.width()/o.image.height()*ui.value+ui.delta))})}}else{this._imgWidthFld.igNumericEditor("value",0);this._imgHeightFld.igNumericEditor("value",0)}}});var table,tableNumRows=0,tableNumCols=0,settings={document:document,rows:0,columns:0,addSpacingChar:false},spacingChar="",methods={init:function(options){return this.each(function(){$.extend(settings,options);if(this.nodeName.toLowerCase()!=="table"){return}if(settings.addSpacingChar){spacingChar="&nbsp;"}table=$(this);if(settings.rows&&settings.rows>0){tableNumRows=settings.rows}else{tableNumRows=table.find("tr").length}if(settings.columns&&settings.columns>0){tableNumCols=settings.columns}else if(table.find("tr")[0]){tableNumCols=table.find("tr")[0].cells.length}if(!table.children().length){methods.create()}})},create:function(){var newRow,i,j;table.empty();for(i=0;i<tableNumRows;i++){newRow=$("<tr></tr>",settings.document).appendTo(table);for(j=0;j<tableNumCols;j++){$("<td>"+spacingChar+"</td>",settings.document).appendTo(newRow)}}},addRow:function(position){var newRow=$("<tr></tr>",settings.document),j;if(position){newRow.insertAfter(table.find("tr").eq(position))}else{newRow.appendTo(table)}for(j=0;j<tableNumCols;j++){$("<td>"+spacingChar+"</td>",settings.document).appendTo(newRow)}tableNumRows++;return newRow},removeRow:function(position){var rows=table.find("tr"),removedRow;if(position){removedRow=rows.eq(position).remove()}else{removedRow=rows.last().remove()}tableNumRows--;return removedRow},addColumn:function(position){var columnCellsArr=[];table.find("tbody tr").each(function(idx,el){var row=$(el),columns=row.find("td"),newColumn=$("<td>"+spacingChar+"</td>",settings.document);if(position&&columns.length){columnCellsArr.push(newColumn.insertAfter(columns.eq(position))[0]);return true}columnCellsArr.push(newColumn.appendTo(row)[0])});tableNumCols++;return $([]).pushStack(columnCellsArr)},removeColumn:function(position){var removedRowsArr=[];table.find("tr").each(function(idx,el){var row=$(el);if(position){removedRowsArr.push(row.find("td").eq(position).remove());return true}removedRowsArr.push(row.find("td:last").remove())});tableNumCols--;return $([]).pushStack(removedRowsArr)},getRowsNum:function(){return tableNumRows},getColumnsNum:function(){return tableNumCols}};$.fn.tableManipulator=function(method){if(methods[method]){if(this!==table[0]){table=$(this)}return methods[method].apply(this,Array.prototype.slice.call(arguments,1))}if(typeof method==="object"||!method){return methods.init.apply(this,arguments)}$.error("Method "+method+" does not exist on jQuery.tableManipulator")};$.ig.SelectionWrapper=$.ig.SelectionWrapper||Class.extend({_selection:null,_range:null,_isIeOld:false,_document:null,_commands:{insertunorderedlist:{name:"_insertList",browsers:null,args:["insertunorderedlist"]},insertorderedlist:{name:"_insertList",browsers:null,args:["insertorderedlist"]},increasefontsize:{name:"increaseFontSize",browsers:["msie","safari"],args:[]},decreasefontsize:{name:"decreaseFontSize",browsers:["msie","safari"],atgs:[true]}},NODE:new $.ig.XmlNodeType,init:function(window,callback){var self=this;this._window=window;this._document=this._window.document;if(!this._document.getSelection){this._isIeOld=true}if(this._isIeOld){this.focus();this._selection=this._document.selection;this._window.setTimeout(function(){self._range=self._selection.createRange();if($.isFunction(callback)){callback.call(self)}},50)}else{this._selection=this._window.getSelection();this._window.setTimeout(function(){self._range=self._getSelection().rangeCount===0?self._document.createRange():self._selection.getRangeAt(0);if($.isFunction(callback)){callback.call(self)}},50)}},_getSelection:function(){return this._selection},_getRange:function(){return this._range},_isCommandSupportedByBrowser:function(command){var supportedBrowsers,i;if(command===null||!this._commands.hasOwnProperty(command.toLowerCase())){return}if(this._commands[command].browsers===null){return}supportedBrowsers=this._commands[command].browsers;for(i=0;i<supportedBrowsers.length;i++){if($.browser&&$.browser.hasOwnProperty(supportedBrowsers[i])){return true}if(!$.browser){if($.ig.util.isIE||$.ig.util.isSafari){return true}}}},surroundContents:function(wrapEl){var range=this._getRange();if(this._isIeOld){range.pasteHTML(wrapEl.html(range.text).get(0).outerHTML)}else{this._surroundContents($(range.commonAncestorContainer),$(range.startContainer),$(range.endContainer),wrapEl)}return wrapEl},getSelectedItem:function(){var range=this._getRange(),rangeParent=$(range.commonAncestorContainer);if(!this._isIeOld){if(range.collapsed&&range.endContainer.nodeType===this.NODE._Text){if(rangeParent.parent().is("img")||rangeParent.parent().is("td")){return rangeParent.parent()}return $(range.startContainer)}if(range.collapsed){return $(range.commonAncestorContainer)}if(range.collapsed&&range.endContainer.nodeType===this.NODE._Element){return $(range.commonAncestorContainer.childNodes[range.endOffset-range.startOffset])}return $(range.commonAncestorContainer)}if(range.parentElement!==undefined){return $(range.parentElement())}if(range.commonParentElement!==undefined){return $(range.commonParentElement())}},getSelectionAsText:function(){if(this._getRange().text!==undefined){return this._getRange().text}return this._getRange().toString()},select:function(element){var selectedItem=element||this.getSelectedItem(),newRange;if(!this._isIeOld){this._range.selectNodeContents(selectedItem[0]);this._selection.removeAllRanges();this._selection.addRange(this._range)}else{newRange=this._document.body.createTextRange();if(selectedItem.length===1){newRange.moveToElementText(selectedItem[0])}newRange.select()}},insertElement:function(element){if(!this._isIeOld){this._getRange().insertNode(element.get(0))}else{this._getRange().pasteHTML(element.get(0).outerHTML)}},applyStyle:function(){},execCommand:function(name,args){var range=this._getRange(),customCommand=this._commands[name]?this[this._commands[name].name]:null,customCommandArgs=this._commands[name]?this._commands[name].args:null,browser=this._commands[name]?this._commands[name].browsers:null,startEl,endEl,p,isCommandSupported=this._isCommandSupportedByBrowser(name),shouldExit=false;if(this._isIeOld){range.select();range.execCommand(name,false,args)}else{p=$("<p><br /></p>",this._document);if(this._selection.isCollapsed&&range.collapsed){if($(range.startContainer).is("body")){startEl=$(range.startContainer).find(":first");if(!startEl.length){startEl=$(range.startContainer)}range.selectNodeContents(startEl[0])}else if(range.startContainer.nodeType===this.NODE._Document){startEl=$(range.startContainer.body).find(":first");if(!startEl.length){startEl=$(range.startContainer.body)}range.selectNodeContents(startEl[0])}else if(range.startContainer.nodeType===this.NODE._Text){this._updateSelection(range);this._document.execCommand(name,false,args);shouldExit=true}else{startEl=$(range.startContainer);range.selectNodeContents(startEl[0])}if(shouldExit){return}if(startEl&&startEl.is("br")&&endEl&&endEl.is("br")){startEl.replaceWith(p);range.selectNodeContents(p[0]);this._updateSelection(range)}}if($.ig.util.isIE&&$.ig.util.browserVersion>=9||$.ig.util.isOpera){this._updateSelection(range)}if($.isFunction(customCommand)&&browser===null){customCommand.call(this,name,args)}else if($.isFunction(customCommand)&&isCommandSupported){customCommand.apply(this,customCommandArgs)}else{this._document.execCommand(name,false,args)}}},_insertList:function(listType,args){var self=this,textNodes;this._document.execCommand(listType,false,args);if(!this._document.queryCommandState(listType)){if(this._selection.anchorNode&&this._selection.anchorNode.nodeType===this.NODE._Text&&$(this._selection.focusNode).is("body")){textNodes=$(this._selection.focusNode).contents().filter(function(){if($(this).is("br")){$(this).remove();return false}return this.nodeType===self.NODE._Text})}}},_getTextNodesOnlyCallback:function(){return this.nodeType===this.NODE._Text},increaseFontSize:function(toDecrease){var newTextNode,rangeStartEl=this._range.startContainer,rangeEndEl=this._range.endContainer,rangeStartOffset=this._range.startOffset,rangeEndOffset=this._range.endOffset,big=$("<big></big>",this._document),small=$("<small></small>",this._document),unWrapEl=toDecrease?small:big,unWrapOpositeType=toDecrease?big[0].nodeName.toLowerCase():small[0].nodeName.toLowerCase(),rangeStartElParent,rangeEndElParent,wrapInnerCallback=function(index){var t=$(this);if(toDecrease&&$(rangeStartEl).parent().is(unWrapOpositeType)){t.unwrap();return true}t.wrapInner(unWrapEl)};if(rangeStartEl===rangeEndEl&&rangeStartEl.nodeType===this.NODE._Text){if($(rangeStartEl).parent().is(unWrapOpositeType)){this._range.selectNodeContents($(rangeStartEl).unwrap()[0]);this._updateSelection(this._range);return}newTextNode=this._wrapPartialString(rangeStartEl.data,rangeStartOffset,rangeEndOffset,unWrapEl);$(rangeStartEl).replaceWith(newTextNode);this._range.selectNodeContents(unWrapEl.contents(":first")[0]);this._updateSelection(this._range);return}if(rangeStartEl.nodeType===this.NODE._Text&&rangeEndEl.nodeType===this.NODE._Text){rangeStartElParent=this._getLastParentUntil($(rangeStartEl),$(this._range.commonAncestorContainer));rangeEndElParent=this._getLastParentUntil($(rangeEndEl),$(this._range.commonAncestorContainer));$(rangeStartEl).wrap(unWrapEl);while(rangeStartElParent.next().length>0&&rangeStartElParent.next()[0]!==rangeEndElParent[0]){rangeStartElParent=rangeStartElParent.next().wrapInner(wrapInnerCallback)}$(rangeEndEl).wrap(unWrapEl);return}if(rangeStartEl.nodeType===this.NODE._Element&&rangeEndEl.nodeType===this.NODE._Element){$(this._range.commonAncestorContainer).wrapInner(unWrapEl);return}if(rangeStartOffset===rangeEndOffset&&rangeStartEl.nodeType===this.NODE._Text){newTextNode=this._wrapPartialString(rangeStartEl.data,0,rangeStartEl.data.length,big);$(rangeStartEl).replaceWith(newTextNode);this._range.selectNodeContents(newTextNode.filter(big)[0]);this._updateSelection(this._range)}},decreaseFontSize:function(){this.increaseFontSize(true)},_wrapPartialString:function(string,start,end,wrapElName){var stack=[];stack.push(this._document.createTextNode(string.slice(0,start)));stack.push(wrapElName.text(string.substring(start,end))[0]);stack.push(this._document.createTextNode(string.slice(end)));return $(stack)},_updateSelection:function(range){this._selection.removeAllRanges();this._selection.addRange(range)},_surroundContents:function(commonParrent,startEl,endEl,wrapEl,wholeElement){var self=this,startOffset,endOffset,rangeStart,rangeEnd,startElPar,endElPar,selection=this._getSelection(),range=this._getRange(),startElSiblings;if(startEl[0]===endEl[0]){range.surroundContents(wrapEl.get(0));return wrapEl}startOffset=range.startOffset;endOffset=range.endOffset;rangeStart=this._document.createRange();rangeStart.setStart(startEl.get(0),startOffset);rangeStart.setEnd(startEl.get(0),startEl.text().length);rangeStart.surroundContents(wrapEl.clone().get(0));selection.addRange(rangeStart);startElPar=this._getLastParentUntil(startEl,commonParrent);endElPar=this._getLastParentUntil(endEl,commonParrent);startElSiblings=startElPar.siblings();startElPar.siblings().each(function(i,el){if(startElPar[0]===endElPar[0]){return}var rangeClone=self._document.createRange();rangeClone.setStartBefore(el);rangeClone.setEndAfter(el);rangeClone.surroundContents(wrapEl.clone().get(0));selection.addRange(rangeClone)});rangeEnd=this._document.createRange();rangeEnd.setStart(endEl.get(0),0);rangeEnd.setEnd(endEl.get(0),endOffset);rangeEnd.surroundContents(wrapEl.clone().get(0));selection.addRange(rangeEnd)},_getLastParentUntil:function(root,target){while(root.parent().length){if(root.parent()[0]===target[0]){return root}root=root.parent()}},replaceNode:function(newNode){var range=this._getRange();if(range.startOffset!==range.endOffset){range.deleteContents()}if(range.insertNode!==undefined){range.insertNode(newNode[0])}else if(range.pasteHTML!==undefined){range.pasteHTML(newNode[0].outerHTML)}},insertTable:function(table){var selItem=this.getSelectedItem(),br=$("<br>",this._document);if(selItem[0].nodeType===this.NODE._Document){this._range.selectNodeContents(selItem.find("body > p:first")[0]);this._range.insertNode(table[0])}else if(selItem.is("td")){table.appendTo(selItem)}else if(selItem.is("table")){selItem.replaceWith(table)}else if(selItem.is("br")){selItem.replaceWith(table)}else{if(this._range.insertNode!==undefined){this._range.insertNode(table[0])}else if(this._range.pasteHTML!==undefined){this._range.select();this._range.pasteHTML(table[0].outerHTML)}}if(this._range.selectNodeContents!==undefined){this._range.selectNodeContents(br.insertAfter(table)[0])}},focus:function(){var focusTarget=$(this._document.body).find(":not(br):first");if(this._isIeOld){this._document.body.focus();return}if(this._range.startContainer.nodeType!==this.NODE._Document&&!$(this._range.startContainer).is("body")){return}if(this._range.startContainer.nodeType===this.NODE._Text){this._document.body.focus();return}if(focusTarget.length===0){return}this._range.setStart(focusTarget[0],0);this._range.setEnd(focusTarget[0],0);this._document.body.focus()}});$.extend($.ui.HtmlEditor,{version:"13.1.20131.2523"});$.widget("ui.igSplitButton",{options:{items:[{name:"",label:"",icon:""}],defaultItemName:""},_isExpanded:false,events:{click:"click",expand:"expand",expanding:"expanding",collapse:"collapse",collapsing:"collapsing"},css:{arrow:"ui-splitbutton-arrow",splitButtonConrnersLeft:"ui-corner-left",splitButtonConrnersRight:"ui-corner-right"},_id:function(id){return this.element[0].id+id},widget:function(){return this.element},_create:function(){var o=this.options,defaultItem=this._getDefaultItem(o.defaultItemName),self=this;this.defaultButton=$('<div id="'+this._id("_"+o.defaultItemName)+'"></div>').appendTo(this.element).igToolbarButton({onlyIcons:true,labelText:"&nbsp;",title:defaultItem.label,icons:{primary:defaultItem.icon},name:o.defaultItemName}).addClass("ui-splitbutton-cleargaps").removeClass("ui-corner-all").addClass(this.css.splitButtonConrnersLeft);this.defaultButton.bind("igtoolbarbuttonclick",function(e){e.stopPropagation();self._trigger(self.events.click,e,{name:$(this).igToolbarButton("option").name,item:self.element})});this._expandButton=$("<div id='"+this._id("_arrow")+"' class='"+this.css.arrow+"'></div>").igToolbarButton({onlyIcons:true,labelText:"&nbsp;",icons:{primary:"ui-icon-triangle-1-s"}}).addClass("ui-splitbutton-cleargaps").removeClass("ui-corner-all").addClass(this.css.splitButtonConrnersRight).appendTo(this.element);this._createSplitButtonItemsList()},_hideButtonsList:function(buttonsList,e){var isSelected=this._expandButton.igToolbarButton("option","isSelected"),isVisible=buttonsList.is(":visible"),self=this;if(isVisible&&isSelected){buttonsList.effect("blind",{direction:"vertical"},250,function(){self._expandButton.igToolbarButton("toggle");self._trigger(self.events.collapse,e)})}},_init:function(){this.element.addClass("ui-splitbutton ui-widget");this.element.attr("tabIndex",0);this._attachEvents()},_attachEvents:function(){var self=this;this._expandButton.bind("igtoolbarbuttonclick",$.proxy(this._onShowHidePopover,this));this.element.bind(self.widgetEventPrefix.toLowerCase()+"expanding",$.proxy(this._onExpand,this));this.element.bind(self.widgetEventPrefix.toLowerCase()+"collapsing",$.proxy(this._onCollapse,this));this._splitButtonItemsList.delegate("a","igtoolbarbuttonclick",$.proxy(this._onItemsListClick,this));this.element.bind("keypress",$.proxy(this._onEnterKeypress,this))},_onExpand:function(e){var self=this;this._splitButtonItemsList.effect("blind",{direction:"vertical",mode:"show"},250,function(){self._isExpanded=true;self._trigger(self.events.expand,e)})},_onCollapse:function(e){var self=this;this._splitButtonItemsList.effect("blind",{direction:"vertical",mode:"hide"},250,function(){self._isExpanded=false;self._trigger(self.events.collapse,e)})},_onShowHidePopover:function(e){var self=this;if(e){e.stopPropagation()}if(this._isExpanded){this._shouldClose=true;setTimeout(function(){self._isExpanded=false;self._shouldClose=false;self._trigger("collapsing",e)},150)}else{$("#"+this._id().split("_")[0]).find(":ui-igSplitButton").igSplitButton("collapse");$("#"+this._id().split("_")[0]).find(":ui-igColorPickerSplitButton").igColorPickerSplitButton("collapse");$("#"+this._id().split("_")[0]).find(":ui-igLinkPropertiesDialog").igLinkPropertiesDialog("hide");$("#"+this._id().split("_")[0]).find(":ui-igTablePropertiesDialog").igTablePropertiesDialog("hide");$("#"+this._id().split("_")[0]).find(":ui-igImagePropertiesDialog").igImagePropertiesDialog("hide");if(!this._shouldClose){this._isExpanded=true;this._trigger("expanding",e)}}},_onItemsListClick:function(e,ui){var targetButtonName=$(e.currentTarget).igToolbarButton("option","name");this.switchToButton($(e.currentTarget));e.stopImmediatePropagation();if(ui&&ui.onlySwithButtons){this.defaultButton.igToolbarButton("toggle")}else{this._trigger(this.events.click,e,{name:targetButtonName})}},_onSplitButtonBlur:function(e){var self=this;this._expandButton.removeClass("ui-state-focus");this.defaultButton.removeClass("ui-state-focus");if(this._isExpanded){this._shouldClose=true;setTimeout(function(){self._isExpanded=false;self._shouldClose=false;self._trigger("collapsing",e)},150)}},_onEnterKeypress:function(e){if(e.which===13){this._expandButton.trigger("igtoolbarbuttonclick")}},_getDefaultItem:function(name){var o=this.options,i;for(i=0;i<o.items.length;i++){if(o.items[i].name===name){return o.items[i]}}},_createSplitButtonItemsList:function(){var list=$("<ul class='ui-splitbutton-list ui-menu ui-widget ui-widget-content ui-corner-all'></ul>"),o=this.options,i,splBtnItm;for(i=0;i<o.items.length;i++){if(o.items[i].name===o.defaultItemName){continue}splBtnItm=$('<a id="'+this._id("_"+o.items[i].name)+'" class="ui-corner-all" tabindex="-1"></a>').igToolbarButton({onlyIcons:true,labelText:"",title:o.items[i].label,icons:{primary:o.items[i].icon},name:o.items[i].name}).addClass("ui-splitbutton-cleargaps");$('<li class="ui-menu-item" role="menuitem"></li>').appendTo(list).append(splBtnItm)}this._splitButtonItemsList=list.appendTo(this.element)},switchToButton:function(button){var targetButton=typeof button==="string"?$("#"+this._id("_"+button)):button,defBtnOpts=this.defaultButton.igToolbarButton("option"),defBtnId=this.defaultButton.attr("id"),targetBtnOpts=targetButton.igToolbarButton("option"),targetBtnId=targetButton.attr("id");delete defBtnOpts.click;targetButton.igToolbarButton("option",defBtnOpts).attr("id",defBtnId);this.defaultButton.igToolbarButton("option",targetBtnOpts);this.defaultButton.attr("id",targetBtnId);this.defaultButton.igToolbarButton("toggle")},collapse:function(){if(!this._isExpanded){return}this._expandButton.trigger("igtoolbarbuttonclick");this._expandButton.igToolbarButton("toggle")},expand:function(){if(this._isExpanded){return}this._expandButton.trigger("igtoolbarbuttonclick")},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);this.element.unbind();this._splitButtonItemsList.undelegate();this.element.find(":ui-igToolbarButton").igToolbarButton("destroy").end().removeClass("ui-splitbutton ui-widget").empty();delete this._expandButton;delete this._splitButtonItemsList}});$.widget("ui.igColorPickerSplitButton",$.ui.igSplitButton,{options:{items:[],defaultColor:"#000"},_create:function(){$.ui.igSplitButton.prototype._create.call(this)},_init:function(){this.element.addClass("ui-splitbutton ui-widget");this._setButtonColorIndicator(this.options.defaultColor);this._attachEvents()},_createSplitButtonItemsList:function(){var popoverCont;this._popover=$('<div id="'+this._id("_popover")+'"></div>').appendTo(this.element).igPopover({renderCloseButton:false,direction:"bottom",closeOnBlur:false,width:220,defaultMaxWidth:null});popoverCont=this._popover.igPopover("container");this._splitButtonItemsList=popoverCont.igColorPicker()},_attachEvents:function(){$.ui.igSplitButton.prototype._attachEvents.call(this);this._splitButtonItemsList.bind("igcolorpickercolorselected",$.proxy(this._onColorSelect,this));this.defaultButton.bind("igtoolbarbuttonclick",$.proxy(this._onDefaultButtonClick,this));this.element.bind(this.widgetEventPrefix.toLowerCase()+"expanding",$.proxy(this._onExpand,this));this.element.bind(this.widgetEventPrefix.toLowerCase()+"collapsing",$.proxy(this._onCollapse,this))},_onExpand:function(e){this._popover.igPopover("show",this.element)},_onCollapse:function(e){this._popover.igPopover("hide")},_onItemsListClick:function(e){return false},_onColorSelect:function(e,ui){this._expandButton.igToolbarButton("toggle");this._setButtonColorIndicator(ui.color);this.options.defaultColor=ui.color;this._trigger("colorSelected",e,{value:ui.color,item:this.element});this.collapse()},_onDefaultButtonClick:function(e,ui){e.stopPropagation();this._trigger("colorSelected",e,{value:this.options.defaultColor,item:this.element})},_setButtonColorIndicator:function(color){this.defaultButton.children(":first").css("border-bottom-color",color)},destroy:function(){$.ui.igSplitButton.prototype.destroy.apply(this,arguments)}});$.widget("ui.igColorPicker",{options:{colors:[["#ffffff","#000000","#EEECE1","#1F497D","#4F81BD","#C0504D","#9BBB59","#8064A2","#4BACC6","#F79646"],["#F2F2F2","#7F7F7F","#DDD9C3","#C6D9F0","#DBE5F1","#F2DCDB","#EBF1DD","#E5E0EC","#DBEEF3","#FDEADA"],["#D8D8D8","#595959","#C4BD97","#8DB3E2","#B8CCE4","#E5B9B7","#D7E3BC","#CCC1D9","#B7DDE8","#FAC08F"],["#BFBFBF","#3F3F3F","#938953","#548DD4","#95B3D7","#D99694","#C3D69B","#B2A1C7","#92CDDC","#FAC08F"],["#A5A5A5","#262626","#494429","#17365D","#366092","#953734","#76923C","#5F497A","#31859B","#E36C09"],["7F7F7F#","#0C0C0C","#1D1B10","#0F243E","#244061","#632423","#4F6128","#3F3151","#205867","#974806"]],standartColors:["#C00000","#FF0000","#FFC000","#FFFF00","#92D050","#00B050","#00B0F0","#0070C0","#002060","#7030A0"]},events:{colorSelected:"colorSelected"},css:{standartColorsRow:"ui-colorpicker-standardcolors",baseClass:"ui-igColorPicker"},_create:function(){var o=this.options,cols,rows,colorTable=$('<ul class="color-table"></ul>'),row,color,i,j;
o.colors.push(o.standartColors);rows=o.colors.length;for(i=0;i<rows;i++){row=$("<li><ul></ul></li>").appendTo(colorTable).children();cols=o.colors[i].length;if(i===rows-1){row.addClass(this.css.standartColorsRow)}for(j=0;j<cols;j++){color=$('<a href="#"><span class="color" style="background-color: '+o.colors[i][j]+';"></span></a>');color.children().data("color",o.colors[i][j]);$('<li class="color-item"></li>').appendTo(row).append(color)}}this._colorTable=colorTable.appendTo(this.element)},_init:function(){var self=this;this.element.addClass(this.css.baseClass);this._colorTable.children().first().addClass("color-table-first-row");this._colorTable.delegate("a","click",function(e){var target=$(e.target);e.preventDefault();self._colorTable.find("span.selected-color").removeClass("selected-color");if(target.is("a")){target=target.children()}target.addClass("selected-color");self._trigger(self.events.colorSelected,e,{color:target.data("color")})})}});$.ig.ToolbarHelper=$.ig.ToolbarHelper||Class.extend({_toolbarsItemsLocation:{textToolbar:{name:"textToolbar",bold:{name:"bold"},italic:{name:"Italic"},underline:{name:"Underline"},strikethrough:{name:"Strikethrough"},increasefontsize:{name:"increasefontsize"},decreasefontsize:{name:"decreasefontsize"},fontFamily:{name:"fontFamily"},fontSize:{name:"fontSize"},formatsList:{name:"formatsList"}},formattingToolbar:{name:"formattingToolbar",justifyleft:{name:"justifyleft"},justifycenter:{name:"justifycenter"},justifyright:{name:"justifyright"},justifyfull:{name:"justifyfull"},bullets:{name:"bullets"},indents:{name:"indents"},textColor:{name:"textColor"},backgroundTextColor:{name:"backgroundTextColor"}},insertObjectToolbar:{name:"insertObjectToolbar",image:{name:"image"},link:{name:"link"},table:{name:"table"},addRow:{name:"addRow"},addColumn:{name:"addColumn"},removeRow:{name:"removeRow"},removeColumn:{name:"removeColumn"}},copyPasteToolbar:{name:"copyPasteToolbar",copy:{name:"copy"},cut:{name:"cut"},paste:{name:"paste"},undo:{name:"undo"},redo:{name:"redo"}}},init:function(window,toolbars){this._toolbars={};this._w=window;this._d=window.document;var self=this;toolbars.each(function(idx,el){var igToolbarName=$(el).igToolbar("option","name");self._toolbars[igToolbarName]=$(el)});this._initAlignButtons(toolbars);this._disableUnsupportedItems();this._disableTableControls(true)},_initAlignButtons:function(toolbars){var alignButtonsToolbar=this._toolbars.formattingToolbar,alignButtons={justifyleft:alignButtonsToolbar.igToolbar("getItem","justifyleft"),justifycenter:alignButtonsToolbar.igToolbar("getItem","justifycenter"),justifyright:alignButtonsToolbar.igToolbar("getItem","justifyright"),justifyfull:alignButtonsToolbar.igToolbar("getItem","justifyfull")};toolbars.bind("igtoolbartoolbarbuttonclick",function(e,ui){if(alignButtons.hasOwnProperty(ui.name)){$.each(alignButtons,function(buttonName,button){if(buttonName!==ui.name&&button.igToolbarButton("option","isSelected")){button.igToolbarButton("toggle");return}})}})},_disableUnsupportedItems:function(){var copyPasteToolbar=this._toolbars.copyPasteToolbar;if(!$.ig.util.isIE){copyPasteToolbar.igToolbar("disableItem","cut",true);copyPasteToolbar.igToolbar("disableItem","copy",true);copyPasteToolbar.igToolbar("disableItem","paste",true)}},_disableTableControls:function(toDisable){var insertObjectToolbar=this._toolbars.insertObjectToolbar;if(!toDisable&&this._isTableControlsDisabled){insertObjectToolbar.igToolbar("disableItem","addColumn",false);insertObjectToolbar.igToolbar("disableItem","removeColumn",false);insertObjectToolbar.igToolbar("disableItem","addRow",false);insertObjectToolbar.igToolbar("disableItem","removeRow",false);this._isTableControlsDisabled=false}else if(toDisable&&!this._isTableControlsDisabled){insertObjectToolbar.igToolbar("disableItem","addColumn",true);insertObjectToolbar.igToolbar("disableItem","removeColumn",true);insertObjectToolbar.igToolbar("disableItem","addRow",true);insertObjectToolbar.igToolbar("disableItem","removeRow",true);this._isTableControlsDisabled=true}},_callbackMap:{_isBold:"_onBold",_isItalic:"_onItalic",_isUnderlined:"_onUnderlined",_isLineThrough:"_onLineThrough",_isJustifyCenter:"_onAlign",_isJustifyFull:"_onAlign",_isJustifyLeft:"_onAlign",_isJustifyRight:"_onAlign",_isOrderedList:"_onList",_isUnorderedList:"_onList",_hasFontName:"_onFontName",_hasFontSize:"_onFontSize",_isTable:"_onTable"},analyse:function(el){var self=this;this._resetToolbars();if(el[0].nodeType===9){this._computedStyles=this._w.getComputedStyle&&this._w.getComputedStyle(this._d.body)||this._d.body.currentStyle}else{this._computedStyles=this._w.getComputedStyle&&this._w.getComputedStyle(el[0])||el[0].currentStyle}if(el.is(":header")){this._onHeader(el)}$.each(this._callbackMap,function(isTrueFunc,callback){var isTrueRes=self[isTrueFunc](el);if($.isFunction(self[isTrueFunc])&&isTrueRes&&$.isFunction(self[callback])){self[callback](el,isTrueRes)}});if(!el.is("table")&&!el.is("td")){this._disableTableControls(true)}},_isBold:function(){return this._d.queryCommandState("bold")||this._computedStyles.fontWeight>=700},_isItalic:function(){return this._d.queryCommandState("italic")||this._computedStyles.fontStyle.toLowerCase()==="italic"},_isUnderlined:function(){return this._d.queryCommandState("underline")||this._computedStyles.textDecoration.toLowerCase().indexOf("underline")!==-1},_isLineThrough:function(){return this._d.queryCommandState("strikethrough")||this._computedStyles.textDecoration.toLowerCase().indexOf("line-through")!==-1},_isJustifyCenter:function(){if(this._d.queryCommandState("justifycenter")){return"justifycenter"}},_isJustifyFull:function(){if(this._d.queryCommandState("justifyfull")){return"justifyfull"}},_isJustifyLeft:function(){if(this._d.queryCommandState("justifyleft")){return"justifyleft"}},_isJustifyRight:function(){if(this._d.queryCommandState("justifyright")){return"justifyright"}},_isOrderedList:function(){if(this._d.queryCommandState("insertorderedlist")){return"InsertOrderedList"}},_isUnorderedList:function(){if(this._d.queryCommandState("insertunorderedlist")){return"InsertUnorderedList"}},_isTable:function(el){if(el.is("table")||el.is("td")){return true}},_checkParents:function(el,wanted){while(el.parent()){if(el.parent().is(wanted)){return true}if(el.is("body")){return}el=el.parent()}},_hasFontName:function(){var fontName=this._getFontFamily();if(fontName==="serif"){fontName="Times New Roman"}return fontName},_getFontFamily:function(){return this._computedStyles.fontFamily},_hasFontSize:function(){return this._computedStyles.fontSize},_onBold:function(el){this._toolbars.textToolbar.igToolbar("getItem","Bold").igToolbarButton("toggle")},_onItalic:function(el){this._toolbars.textToolbar.igToolbar("getItem","Italic").igToolbarButton("toggle")},_onUnderlined:function(el){this._toolbars.textToolbar.igToolbar("getItem","Underline").igToolbarButton("toggle")},_onLineThrough:function(el){this._toolbars.textToolbar.igToolbar("getItem","Strikethrough").igToolbarButton("toggle")},_onAlign:function(el,dir){this._toolbars.formattingToolbar.igToolbar("getItem",dir).igToolbarButton("toggle")},_onList:function(el,listType){this._toolbars.formattingToolbar.each(function(i,tb){var bulletsSpltBttn=$(tb).igToolbar("getItem","bullets");if(bulletsSpltBttn.data("igSplitButton")!==undefined){bulletsSpltBttn.igSplitButton("switchToButton",listType);return}})},_onFontName:function(el,fontName){var combo=this._toolbars.textToolbar.igToolbar("getItem","fontFamily");fontName=fontName.replace(/'|"/g,"");this._setComboValue(combo,$.ig.HtmlEditor.locale.fontNames[/^win/gi.test(navigator.platform)?"win":"mac"],fontName)},_onFontSize:function(el){var pxTbl={"11px":1,"13px":3,"16px":4,"19px":5,"18px":7,"24px":7},fontSizeUnits=this._d.queryCommandValue("fontsize")||pxTbl[this._computedStyles.fontSize],fontSizeUnitsStr=fontSizeUnits?fontSizeUnits.toString():"",combo=this._toolbars.textToolbar.igToolbar("getItem","fontSize");this._setComboValue(combo,$.ig.HtmlEditor.locale.fontSizes,fontSizeUnitsStr)},_onHeader:function(element){var combo=this._toolbars.textToolbar.igToolbar("getItem","formatsList");this._setComboValue(combo,$.ig.HtmlEditor.locale.formatsList,element[0].nodeName.toLowerCase())},_onTable:function(){this._disableTableControls(false)},_setComboValue:function(combo,values,newValue,valueKey){var i,dsValueKey=valueKey||"text",currentValue=values[combo.igCombo("selectedIndex")][dsValueKey],dataSourceValue;if(newValue===currentValue){return}for(i=0;i<values.length;i++){dataSourceValue=values[i][dsValueKey];if(newValue===dataSourceValue){combo.igCombo("selectedIndex",i);break}}},_resetToolbars:function(){$.each(this._toolbars,function(idx,el){$(el).igToolbar("deactivateAll")})}})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Grid 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on: 
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igLayoutManager",{css:{item:"ig-layout-item",itemTitle:"ig-layout-item-title",container:"ig-layout",flowItem:"ig-layout-flow-item",flow:"ig-layout-flow",vertical:"ig-layout-vertical",verticalItem:"ig-layout-vertical-item",border:"ig-layout-border",borderItem:"ig-layout-border-item",borderHeader:"ig-layout-border-header",borderFooter:"ig-layout-border-footer",borderLeft:"ig-layout-border-left",borderCenter:"ig-layout-border-center",borderRight:"ig-layout-border-right",borderContainer:"ig-layout-border-container"},options:{layoutMode:"column",itemCount:null,itemSelector:".ig-layout-item",itemWidth:null,itemHeight:null,gridLayout:{cols:null,rows:null,marginLeft:0,marginTop:0,maximizeOnClick:true,itemsRearrangable:false,clickTargetSelector:".ig-layout-item"},borderLayout:{showHeader:true,showFooter:true,showLeft:true,showRight:true,leftWidth:null,rightWidth:null},items:[{rowSpan:1,colSpan:1,colIndex:0,rowIndex:0,width:null,height:null}],width:null,height:null},events:{itemRendering:"itemRendering",itemRendered:"itemRendered",rendered:"rendered"},_createWidget:function(options,element){this.options.items=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var $this=this;this.element.addClass(this.css.container);if(this.options.width!==null){this.element.width(this.options.width)}if(this.options.height!==null){this.element.height(this.options.height)}this.element.on("resize",function(e){$this.reflow(e)});$(window).on("resize",function(e){$this.reflow(e)});switch(this.options.layoutMode){case"grid":this._initGridLayout();break;case"border":this._initBorderLayout();break;case"flow":this._initFlowLayout();break;case"column":break;case"vertical":this._initVerticalLayout();break;default:break}},reflow:function(event,args){if(event){var noCancel=this._trigger("beforeinternalresize",event,args);if(noCancel){this._trigger("internalresize",event,args)}}},_initVerticalLayout:function(){var i,length=this.options.itemCount,items=this.options.items,item;this.element.addClass(this.css.vertical);if(length>0){for(i=0;i<length;i++){this._trigger(this.events.itemRendering,null,{index:i});item=$("<div></div>").appendTo(this.element).addClass(this.css.verticalItem);this._trigger(this.events.itemRendered,null,{item:item,index:i})}}else if(items&&items.length>0){for(i=0;i<items.length;i++){this._trigger(this.events.itemRendering,null,{itemData:items[i],index:i});item=$("<div></div>").appendTo(this.element).addClass(this.css.verticalItem);if(items[i].width){item.css("width",items[i].width)}if(items[i].height){item.css("height",items[i].height)}this._trigger(this.events.itemRendered,null,{item:item,index:i})}}else{this.element.children().addClass(this.css.verticalItem)}},_initGridLayout:function(){var self=this,w=1,h=1,e=this.element,gl=this.options.gridLayout,ih,iw,col,row,rows=0,cols=0,i,j,items=this.options.items,item,width,height,left=0,top=0,iw_percentage,ih_percentage,usePercentages=true,itemsDom,ml=gl.marginLeft,mt=gl.marginTop,offset=e.offset(),useOffset,colSpan,rowSpan,scrollBarWidth=this._getScrollBarWidth();useOffset=this.element.css("position")==="static"?true:false;rows=gl.rows;cols=gl.cols;w=this._getContainerToWindowWidthRatio(scrollBarWidth);h=this._getContainerToWindowHeightRatio();if(gl.columnWidth){iw=gl.columnWidth}else{iw=Math.floor($(window).width()*w/cols-ml)}if(gl.columnHeight){ih=gl.columnHeight}else{ih=$(window).height()*h/rows-mt}if(gl.columnWidth||gl.columnHeight){usePercentages=false}if(usePercentages){iw_percentage=w*100/cols;ih_percentage=h*100/rows}this._allvisible=true;if(items&&items.length>0){usePercentages=false;for(i=0;i<items.length;i++){colSpan=items[i].colSpan;rowSpan=items[i].rowSpan;width=colSpan*iw+(colSpan-1)*ml;height=rowSpan*ih+(rowSpan-1)*mt;row=items[i].rowIndex;col=items[i].colIndex;if(!items[i].element){item=$("<div></div>").appendTo(this.element).addClass("ig-layout-item").attr("id",this.element.attr("id")+"_item_"+col+"_"+row).attr("data-rowspan",rowSpan).attr("data-colspan",colSpan).attr("data-row",row).attr("data-col",col)}else{item=items[i].element.addClass("ig-layout-item").attr("id",this.element.attr("id")+"_item_"+col+"_"+row).attr("data-rowspan",rowSpan).attr("data-colspan",colSpan).attr("data-row",row).attr("data-col",col)}this._trigger(this.events.itemRendered,null,{item:item,itemData:items[i],index:i});if(!usePercentages){item.addClass("ig-layout-griditem-abs");top=row*ih+(row+1)*mt;left=col*iw+(col+1)*ml}else{top=row*ih_percentage+"%";left=col*iw_percentage+"%";item.addClass("ig-layout-griditem-rel")}if(useOffset){top+=offset.top;left+=offset.left}item.css({top:top,left:left,width:width,height:height})}}else if(this.options.itemSelector&&(itemsDom=e.find(this.options.itemSelector)).length>0){e=this.element}else{if(e.children().length===0){if(gl.columnWidth){iw=gl.columnWidth;usePercentages=false}else{iw=parseInt(100/gl.cols,10)+"%"}if(gl.columnHeight){ih=gl.columnHeight;usePercentages=false}else{ih=parseInt(100/gl.rows,10)+"%"}for(i=0;i<gl.rows;i++){for(j=0;j<gl.cols;j++){item=$("<div></div>").appendTo(this.element).addClass("ig-layout-item").attr("id",this.element.attr("id")+"_item_"+i+"_"+j).attr("data-rowspan",1).attr("data-colspan",1).width(iw).height(ih).attr("data-row",i).attr("data-col",j);this._trigger("itemrendered",null,{item:item});if(usePercentages){top=parseInt(i*parseInt(ih,10),10)+"%";left=parseInt(j*parseInt(iw,10),10)+"%";item.addClass("ig-layout-griditem-rel")}else{item.addClass("ig-layout-griditem-abs");top=i*ih+(i+1)*mt;left=j*iw+(j+1)*ml;left+=j===0?ml:0;item.css({top:top,left:left})}}}}}this._trigger(this.events.rendered,null,{items:items});if(!usePercentages){this.element.bind("iglayoutmanagerinternalresize",function(event,args){var ratio,newDim;if(gl.itemsRearrangable){ratio=Math.floor(e.width()/(gl.columnWidth+ml));if(ratio!==gl.cols){gl.cols=ratio;for(i=0;i<items.length;i++){row=items[i].rowIndex;col=items[i].colIndex;items[i].rowIndex=Math.floor(i/ratio);items[i].colIndex=i%ratio;item=$("#"+e.attr("id")+"_item_"+col+"_"+row);item.attr("id",e.attr("id")+"_item_"+items[i].colIndex+"_"+items[i].rowIndex);newDim={top:items[i].rowIndex*gl.columnHeight+(items[i].rowIndex+1)*mt,left:items[i].colIndex*gl.columnWidth+(items[i].colIndex+1)*ml};if(useOffset){newDim.top+=offset.top;newDim.left+=offset.left}item.animate(newDim,250)}}}else{w=self._getContainerToWindowWidthRatio(scrollBarWidth);h=self._getContainerToWindowHeightRatio();iw=Math.floor($(window).width()*w/cols-ml);ih=Math.floor($(window).height()*h/rows)-mt;if(items){for(i=0;i<items.length;i++){row=items[i].rowIndex;col=items[i].colIndex;item=$("#"+e.attr("id")+"_item_"+col+"_"+row);top=row*ih+(row+1)*mt;left=col*iw+(col+1)*ml;colSpan=items[i].colSpan;rowSpan=items[i].rowSpan;if(colSpan===undefined||colSpan===null){colSpan=1}if(rowSpan===undefined||rowSpan===null){rowSpan=1}width=colSpan*iw+(colSpan-1)*ml;height=rowSpan*ih+(rowSpan-1)*mt;if(useOffset){top+=offset.top;left+=offset.left}item.css({left:left,top:top,width:width,height:height})}}}})}},_initBorderLayout:function(){var items=this.options.items,left,right,center,header,footer,bl=this.options.borderLayout,container,cwidth;this.element.addClass(this.css.border);if(items&&items.length&&items.length>0){this.element.empty()}else{left=this.element.find(".left");header=this.element.find(".header");right=this.element.find(".right");center=this.element.find(".center");footer=this.element.find(".footer");if(left.length===0&&bl.showLeft){this._trigger(this.events.itemRendering,null,{region:"left"});left=$("<div></div>").appendTo(this.element);this._trigger(this.events.itemRendered,null,{region:"left",element:left})}left.addClass(this.css.borderItem).addClass(this.css.borderLeft);if(right.length===0&&bl.showRight){this._trigger(this.events.itemRendering,null,{region:"right"});right=$("<div></div>").appendTo(this.element);this._trigger(this.events.itemRendered,null,{region:"right",element:right})}right.addClass(this.css.borderItem).addClass(this.css.borderRight);if(center.length===0){this._trigger(this.events.itemRendering,null,{region:"center"});center=$("<div></div>").appendTo(this.element);this._trigger(this.events.itemRendered,null,{region:"center",element:center})}center.addClass(this.css.borderItem).addClass(this.css.borderCenter);if(footer.length===0&&bl.showFooter){this._trigger(this.events.itemRendering,null,{region:"footer"});footer=$("<div></div>").appendTo(this.element);this._trigger(this.events.itemRendered,null,{region:"footer",element:footer})}footer.addClass(this.css.borderItem).addClass(this.css.borderFooter);if(header.length===0&&bl.showHeader){this._trigger(this.events.itemRendering,null,{region:"header"});header=$("<div></div>").appendTo(this.element);this._trigger(this.events.itemRendered,null,{region:"header",element:header})}header.addClass(this.css.borderItem).addClass(this.css.borderHeader);container=$("<div></div>").appendTo(this.element).addClass(this.css.borderContainer).append(center).append(left).append(right);this.element.append(footer);if(bl.leftWidth!==null&&bl.showLeft){left.css("width",bl.leftWidth);left.css("right",bl.leftWidth);container.css("padding-left",bl.leftWidth)}else if(bl.showLeft===false||left.length===0){container.css("padding-left",0)}if(bl.rightWidth!==null&&bl.showRight){right.css("width",bl.rightWidth);container.css("padding-right",bl.rightWidth)}else if(bl.showRight===false||right.length===0){container.css("padding-right",0)}if(bl.leftWidth&&bl.leftWidth.indexOf&&bl.leftWidth.indexOf("%")!==-1&&bl.rightWidth&&bl.rightWidth.indexOf&&bl.rightWidth.indexOf("%")!==-1){cwidth=100-parseInt(bl.leftWidth,10)-parseInt(bl.rightWidth,10)+"%";center.css("width",cwidth);left.css("margin-left","-"+cwidth);right.css("margin-right","-"+cwidth);container.css("width","100%")}}},_initFlowLayout:function(){var i,length=this.options.itemCount,items=this.options.items,item;this.element.addClass(this.css.flow);if(length>0){for(i=0;i<length;i++){this._trigger(this.events.itemRendering,null,{index:i});item=$("<li></li>").appendTo(this.element).addClass(this.css.flowItem);this._trigger(this.events.itemRendered,null,{item:item,index:i})}}else if(items&&items.length>0){for(i=0;i<items.length;i++){this._trigger(this.events.itemRendering,null,{itemData:items[i],index:i});item=$("<li></li>").appendTo(this.element).addClass(this.css.flowItem);if(items[i].width){item.css("width",items[i].width)}if(items[i].height){item.css("height",items[i].height)}this._trigger(this.events.itemRendered,null,{item:item,index:i})}}else{this.element.children().addClass(this.css.flowItem)}},_getContainerToWindowWidthRatio:function(scrollBarWidth){var e=this.element,w;scrollBarWidth=typeof scrollBarWidth==="number"?scrollBarWidth:0;if(e.css("width")!==""&&e.css("width")!==null&&e.css("width")!==undefined&&e.css("width")!=="0px"){if(e.css("width").indexOf&&e.css("width").indexOf("%")!==-1){w=(parseInt(e.css("width"),10)-scrollBarWidth)/100}else{w=(e.width()-scrollBarWidth)/$(window).width()}}return w},_getContainerToWindowHeightRatio:function(){var e=this.element,h;if(e.css("height")!==""&&e.css("height")!==null&&e.css("height")!==undefined&&e.css("height")!=="0px"){if(e.css("height").indexOf&&e.css("height").indexOf("%")!==-1){h=parseInt(e.css("height"),10)/100}else{h=parseInt(e.css("height"),10)/$(window).height()}}return h},_getScrollBarWidth:function(){var el=$('<div style="width: 100px; height: 100px; position: absolute; top: -10000px; left: -10000px; overflow: scroll"></div>').appendTo($(document.body)),scrollWidth;scrollWidth=el[0].offsetWidth-el[0].clientWidth;el.remove();return scrollWidth},destroy:function(){$.Widget.prototype.destroy.call(this);return this}});$.extend($.ui.igLayoutManager,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI Splitter 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery-1.4.4.js
 *	infragistics.util.js
 *	infragistics.ui.splitter-en.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igSplitter",{_const:{orientations:{horizontal:{size:"height",oppositeSize:"width",outerSize:"outerHeight",dimention:"top",start:"_startY",mouse:"_mouseStartY",page:"pageY",keyboard:["UP","DOWN"]},vertical:{size:"width",oppositeSize:"height",outerSize:"outerWidth",dimention:"left",start:"_startX",mouse:"_mouseStartX",page:"pageX",keyboard:["LEFT","RIGHT"]}},properties:["max","_max","min","_min","size","collapsed","collapsible","resizable"],step:10,touchEvents:{mousedown:"touchstart",mouseup:"touchend",mousemove:"touchmove",mouseenter:"",mouseleave:"",focus:"focus",blur:"blur",keydown:"keydown"}},css:{splitter:"ui-igsplitter ui-widget ui-widget-content",verticalPanel:"ui-igsplitter-panel-vertical ui-widget-content",horizontalPanel:"ui-igsplitter-panel-horizontal ui-widget-content",bar:"ui-igsplitter-splitbar",barNormal:"ui-igsplitter-splitbar-default ui-state-default",barCollapsed:"ui-igsplitter-splitbar-collapsed",barHover:"ui-igsplitter-splitbar-hover ui-state-hover",barActive:"ui-igsplitter-splitbar-focus ui-state-focus",barInvalid:"ui-igsplitter-splitbar-invalid",resizeHandler:"ui-igsplitter-splitbar-resize-handler",resizeHandlerInner:"ui-igsplitter-splitbar-resize-handler-inner",verticalCollapseButtonLeftExpanded:"ui-igsplitter-collapse-button-vertical-left",verticalCollapseButtonLeftExpandedIcon:"ui-icon ui-icon-triangle-1-w",verticalCollapseButtonLeftCollapsed:"ui-igsplitter-collapse-button-vertical-left",verticalCollapseButtonLeftCollapsedIcon:"ui-icon ui-icon-triangle-1-e",verticalCollapseButtonRightExpanded:"ui-igsplitter-collapse-button-vertical-right",verticalCollapseButtonRightExpandedIcon:"ui-icon ui-icon-triangle-1-e",verticalCollapseButtonRightCollapsed:"ui-igsplitter-collapse-button-vertical-right",verticalCollapseButtonRightCollapsedIcon:"ui-icon ui-icon-triangle-1-w",horizontalCollapseButtonLeftExpanded:"ui-igsplitter-collapse-button-horizontal-left",horizontalCollapseButtonLeftExpandedIcon:"ui-icon ui-icon-triangle-1-n",horizontalCollapseButtonLeftCollapsed:"ui-igsplitter-collapse-button-horizontal-left",horizontalCollapseButtonLeftCollapsedIcon:"ui-icon ui-icon-triangle-1-s",horizontalCollapseButtonRightExpanded:"ui-igsplitter-collapse-button-horizontal-right",horizontalCollapseButtonRightExpandedIcon:"ui-icon ui-icon-triangle-1-s",horizontalCollapseButtonRightCollapsed:"ui-igsplitter-collapse-button-horizontal-right",horizontalCollapseButtonRightCollapsedIcon:"ui-icon ui-icon-triangle-1-n",collapseButtonDefault:"ui-state-default",collapseButtonSingle:"ui-igsplitter-collapse-single-button",collapseButtonPressed:"ui-igsplitter-collapse-button-pressed",collapseButtonHover:"ui-igsplitter-collapse-button-hover ui-state-hover",noScroll:"ui-igsplitter-no-scroll"},events:{collapsed:"collapsed",expanded:"expanded",resizeStarted:"resizeStarted",resizing:"resizing",resizeEnded:"resizeEnded",layoutRefreshing:"layoutRefreshing",layoutRefreshed:"layoutRefreshed"},options:{width:null,height:null,orientation:"vertical",panels:[],dragDelta:3},_opt:null,widget:function(){return this.element},_createWidget:function(options,element){this._opt={eventHandlers:{}};$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var splitters,length=$(this.element.children("div")).length;this._htmlMarkup=this.element.html();if(this.options.panels.length>2||length>2){throw new Error($.ig.Splitter.locale.errorPanels)}if(length===1){$(this.element).append("<div/>")}else if(length===0){$(this.element).append("<div/>");$(this.element).append("<div/>")}this._panels=[];this._splitter={};splitters=$.data(document.body,"ig-splitters")||[];splitters.push(this.element);$.data(document.body,"ig-splitters",splitters);if(this.options.width){this.element.css("width",this.options.width)}if(this.options.height){this.element.css("height",this.options.height)}this._render();this._removeClasses();this._addClasses();this._removeEventHandlers();this._addEventHandlers();this._panelsLayout()},_setOption:function(option,value){var oldWidth,oldHeight;if(this.options[option]===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"width":oldWidth=this.element.width();this.element.css("width",value);if(this.options.orientation==="vertical"){this._setPanelsNewWidth(value,oldWidth)}this._panelsLayout();break;case"height":oldHeight=this.element.height();this.element.css("height",value);if(this.options.orientation==="horizontal"){this._setPanelsNewHeight(value,oldHeight)}this._panelsLayout();break;case"orientation":case"panels":throw new Error($.ig.Splitter.locale.errorSettingOption);break;default:break}},_setPanelsNewWidth:function(newWidth,oldWidth){var secondPanelRatio=this.secondPanel().width()/oldWidth;this.setSecondPanelSize(newWidth*secondPanelRatio)},_setPanelsNewHeight:function(newHeight,oldHeight){var secondPanelRatio=this.secondPanel().height()/oldHeight;this.setSecondPanelSize(newHeight*secondPanelRatio)},_render:function(){var panels=$(this.element.children("div")),panel,self=this,reducedSize,defaultSize=0,j,elementSize;reducedSize=this._reducedSize();if(this.options[this._getOrientation("size")]){elementSize=this._getOrientation("size")==="width"?this.element.width():this.element.height();defaultSize=elementSize-reducedSize.size}else{defaultSize=this._getSize(this._getOrientation("size"))-reducedSize.size}if(panels.length-reducedSize.length!==0){defaultSize=Math.floor(defaultSize/(panels.length-reducedSize.length))}if(this._panels.length<1){panels.each(function(i,element){panel=$(element);panel.options={max:9007199254740992,_max:"100%",min:0,_min:"0",collapsible:false,resizable:true,collapsed:false,size:panel[self._getOrientation("size")]()};for(j=0;j<self._const.properties.length;j++){if(self.options.panels[i]&&self.options.panels[i][self._const.properties[j]]!==undefined&&self.options.panels[i][self._const.properties[j]]!==null){panel.options[self._const.properties[j]]=self.options.panels[i][self._const.properties[j]]}else{if(self._const.properties[j]==="size"){if(panel[0].style[self._getOrientation("size")]!=="auto"&&panel[0].style[self._getOrientation("size")]!==""){panel.options.size=panel[self._getOrientation("size")]()}else{panel.options.size=defaultSize}}}}self._panels.push(panel)});this._createSplitter()}},_reducedSize:function(){var i,reducedSize={size:0,length:0},size=0;for(i=0;i<this.options.panels.length;i++){size=0;if(this.options.panels[i].size!==undefined){if(/%/.test(this.options.panels[i].size)){this.options.panels[i].size=this.options.panels[i].size.replace("%","")*this._getSize(this._getOrientation("size"))/100;this._isPercentLayout=true}if(/px/.test(this.options.panels[i].size)){this.options.panels[i].size=parseInt(this.options.panels[i].size,10)}if(/px/.test(this.options.panels[i].min)){this.options.panels[i].min=parseInt(this.options.panels[i].min,10)}if(/%/.test(this.options.panels[i].min)){this.options.panels[i]._min=this.options.panels[i].min;this.options.panels[i].min=this.options.panels[i].min.replace("%","")*this._getSize(this._getOrientation("size"))/100}if(/px/.test(this.options.panels[i].max)){this.options.panels[i].max=parseInt(this.options.panels[i].max,10)}if(/%/.test(this.options.panels[i].max)){this.options.panels[i]._max=this.options.panels[i].max;this.options.panels[i].max=this.options.panels[i].max.replace("%","")*this._getSize(this._getOrientation("size"))/100}size=this.options.panels[i].size;reducedSize.length+=1}reducedSize.size+=size}return reducedSize},_getSize:function(size){var boxSizing=this.element.css("box-sizing"),value;if(window.getComputedStyle!==undefined){value=parseInt(window.getComputedStyle(this.element[0])[size],10);if($.ig.util.isChrome&&boxSizing==="border-box"){value-=parseInt(this.element.css("border-width"),10)*2}return value}return this.element[size]()},_getOrientation:function(property){return this._const.orientations[this.options.orientation][property]},_getEvent:function(event){if(this._isTouch()){return this._const.touchEvents[event]}return event},_isTouch:function(){var isTouch=typeof window.Modernizr==="object"&&window.Modernizr.touch===true;return isTouch},_createSplitter:function(){var collapseButtons=$("<div><span></span></div><div><span></span></div>"),bar=$("<div></div>").attr("tabindex",0),self=this,div,topMarginButtonLeftCollapsed;this._splitter={left:this._panels[0],right:this._panels[1]};bar.insertAfter(this._panels[0]);this._splitter.bar=bar;this._splitter.bar.append(collapseButtons);div=$("<div/>").appendTo(this._splitter.bar);$("<span></span>")[this._getOrientation("size")](this._splitter.bar[this._getOrientation("size")]).attr("title","").appendTo(div);if($.ig.util.isIEOld){setTimeout(function(){topMarginButtonLeftCollapsed=$(".ui-igsplitter-collapse-button-vertical-left.ui-state-default").css("margin-top");$(".ui-igsplitter-collapse-button-vertical-left.ui-state-default").css("margin-top",topMarginButtonLeftCollapsed)},1)}},_removeClasses:function(){var buttonLeft,buttonRight,resizeHandler,i;this.element.removeClass(this.css.splitter);for(i=0;i<this._panels.length;i++){this._panels[i].removeClass(this.css[this.options.orientation+"Panel"])}this._splitter.bar.removeClass(this.css.bar+"-"+this.options.orientation);this._splitter.bar.removeClass(this.css.barNormal);this._splitter.bar.removeClass(this.css.barCollapsed);buttonLeft=$(this._splitter.bar.children()[0]);buttonRight=$(this._splitter.bar.children()[1]);buttonLeft.removeClass(this.css[this.options.orientation+"CollapseButtonLeftExpanded"]);buttonRight.removeClass(this.css[this.options.orientation+"CollapseButtonRightExpanded"]);buttonLeft.removeClass(this.css.collapseButtonDefault);buttonRight.removeClass(this.css.collapseButtonDefault);resizeHandler=$(this._splitter.bar.children()[2]);resizeHandler.removeClass(this.css.resizeHandler+"-"+this.options.orientation);$(resizeHandler.children()[0]).removeClass(this.css.resizeHandlerInner+"-"+this.options.orientation)},_addClasses:function(){var buttonLeft,buttonRight,i,resizeHandler;this.element.addClass(this.css.splitter);for(i=0;i<this._panels.length;i++){this._panels[i].addClass(this.css[this.options.orientation+"Panel"])}this._splitter.bar.addClass(this.css.bar+"-"+this.options.orientation);this._splitter.bar.addClass(this.css.barNormal);if(this._panels[0].options.collapsed||this._panels[1].options.collapsed){this._splitter.bar.addClass(this.css.barCollapsed)}buttonLeft=$(this._splitter.bar.children()[0]);buttonRight=$(this._splitter.bar.children()[1]);buttonLeft.addClass(this.css[this.options.orientation+"CollapseButtonLeftExpanded"]);$(buttonLeft.children()).addClass(this.css[this.options.orientation+"CollapseButtonLeftExpandedIcon"]);buttonRight.addClass(this.css[this.options.orientation+"CollapseButtonRightExpanded"]);$(buttonRight.children()).addClass(this.css[this.options.orientation+"CollapseButtonRightExpandedIcon"]);resizeHandler=$(this._splitter.bar.children()[2]);resizeHandler.addClass(this.css.resizeHandler+"-"+this.options.orientation);$(resizeHandler.children()[0]).addClass(this.css.resizeHandlerInner+"-"+this.options.orientation);if(!this._panels[0].options.collapsible){buttonLeft.hide();buttonRight.addClass(this.css.collapseButtonSingle)}if(!this._panels[1].options.collapsible){buttonRight.hide();buttonLeft.addClass(this.css.collapseButtonSingle)}buttonLeft.addClass(this.css.collapseButtonDefault);buttonRight.addClass(this.css.collapseButtonDefault)},_removeEventHandlers:function(){$(this._splitter.bar).unbind(this._getEvent("focus"),this._getEvent("blur"),this._getEvent("keydown"));$(this._splitter.bar.children()[0]).unbind(this._getEvent("mousedown"));$(this._splitter.bar.children()[1]).unbind(this._getEvent("mousedown"));if(!this._isTouch()){$(this._splitter.bar).unbind(this._getEvent("mouseenter"),this._getEvent("mouseleave"));$(this._splitter.bar.children()[0]).unbind(this._getEvent("mouseenter"),this._getEvent("mouseleave"));$(this._splitter.bar.children()[1]).unbind(this._getEvent("mouseenter"),this._getEvent("mouseleave"))}},_addEventHandlers:function(){var self=this;self.autoResize=true;this._opt.eventHandlers.documentMouseUp=function(){self.autoResize=false;self._stopDrag(self);self.autoResize=true;self._lastMove=null};$(document).bind(this._getEvent("mouseup")+"."+this.element.attr("id"),this._opt.eventHandlers.documentMouseUp);this._opt.eventHandlers.documentMouseMove=function(ev){var noCancel=true;self._currentMove=self._isTouch()?ev.originalEvent.touches[0][self._getOrientation("page")]:ev[self._getOrientation("page")];if(self._capturedElement&&self._isDragging()&&!self._isDrag){self._triggerResizeStarted();self._isDrag=true}if(self._capturedElement&&self._isDragging()){noCancel=self._triggerResizing()}if(noCancel&&self._isDragging()){self._performDrag(self,ev)}else{return false}};$(document).bind(this._getEvent("mousemove")+"."+this.element.attr("id"),this._opt.eventHandlers.documentMouseMove);this._opt.eventHandlers.windowResize=function(ev){var noCancel=self._triggerLayoutRefreshing();if(noCancel){self._panelsLayout();self._triggerLayoutRefreshed()}};$(window).bind("resize."+this.element.attr("id"),this._opt.eventHandlers.windowResize);this._addBarHandlers(this._splitter);this._addCollapseButtonHandlers($(this._splitter.bar.children()[0]),0);this._addCollapseButtonHandlers($(this._splitter.bar.children()[1]),1)},_isDragging:function(){return Math.abs(this._currentMove-this._lastMove)>this.options.dragDelta},_addBarHandlers:function(splitter){var self=this;splitter.bar.bind(this._getEvent("mousedown"),{self:this},this._startDrag);$(splitter.bar.children()[2]).bind(this._getEvent("mousedown"),{self:this},this._startDrag);splitter.bar.bind(this._getEvent("keydown"),{self:this},this._kbNavigation);if(!this._isTouch()){splitter.bar.bind(this._getEvent("mouseenter"),function(){$(this).addClass(self.css.barHover)});splitter.bar.bind(this._getEvent("mouseleave"),function(){$(this).removeClass(self.css.barHover)})}splitter.bar.bind(this._getEvent("focus"),function(){$(this).addClass(self.css.barActive)});splitter.bar.bind(this._getEvent("blur"),function(){$(this).removeClass(self.css.barActive)})},_kbNavigation:function(event){var splitter=event.data.self,noCancel=true;if(event.keyCode===$.ui.keyCode[splitter._getOrientation("keyboard")[0]]){if(event.ctrlKey){splitter._stopDrag(splitter,true,true);if(splitter._panels[1].options.collapsed){splitter.expandAt(1)}else if(!splitter._panels[0].options.collapsed){splitter.collapseAt(0)}}else{splitter._startDrag(event);splitter._kbMove-=splitter._kbLockRight?0:splitter._getStep();if(splitter._capturedElement&&!splitter._isDrag){splitter._triggerResizeStarted();splitter._isDrag=true}if(splitter._capturedElement){noCancel=splitter._triggerResizing()}if(noCancel){splitter._performDrag(splitter,event)}else{return false}if(splitter._capturedElement&&splitter._capturedElement.hasClass(splitter.css.barInvalid)){splitter._kbLockRight=true;splitter._kbLockLeft=false}else{splitter._kbLockRight=false;splitter._kbLockLeft=false}}event.preventDefault()}else if(event.keyCode===$.ui.keyCode[splitter._getOrientation("keyboard")[1]]){if(event.ctrlKey){splitter._stopDrag(splitter,true,true);if(splitter._panels[0].options.collapsed){splitter.expandAt(0)}else if(!splitter._panels[1].options.collapsed){splitter.collapseAt(1)}}else{splitter._startDrag(event);splitter._kbMove+=splitter._kbLockLeft?0:splitter._getStep();if(splitter._capturedElement&&!splitter._isDrag){splitter._triggerResizeStarted();splitter._isDrag=true}if(splitter._capturedElement){noCancel=splitter._triggerResizing()}if(noCancel){splitter._performDrag(splitter,event)}else{return false}if(splitter._capturedElement&&splitter._capturedElement.hasClass(splitter.css.barInvalid)){splitter._kbLockRight=false;splitter._kbLockLeft=true}else{splitter._kbLockRight=false;splitter._kbLockLeft=false}}event.preventDefault()}else if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){splitter._stopDrag(splitter,false,true);event.preventDefault()}else if(event.keyCode===$.ui.keyCode.ESCAPE){splitter._stopDrag(splitter,true)}else if(event.keyCode===$.ui.keyCode.TAB){splitter._stopDrag(splitter,false,true)}},_startDrag:function(event){var splitter=event.data.self,left,right;splitter._splitter.bar.focus();splitter._resizeArea=splitter._splitter;if(splitter._resizeArea!==null){if((splitter._resizeArea.left.options.resizable===undefined||splitter._resizeArea.left.options.resizable)&&(splitter._resizeArea.right.options.resizable===undefined||splitter._resizeArea.right.options.resizable)){left=splitter._resizeArea.left;right=splitter._resizeArea.right;if(!left.options.collapsed&&!right.options.collapsed&&!(right.options.max<=right[splitter._getOrientation("outerSize")]()&&left.options.max<=left[splitter._getOrientation("outerSize")]())){if(!splitter._capturedElement){splitter._lastMove=splitter._isTouch()?event.originalEvent.touches[0][splitter._getOrientation("page")]:event[splitter._getOrientation("page")];if($(event.target).is("span")){splitter._capturedElement=splitter._clone($($(event.target).parent()).parent())}else{splitter._capturedElement=splitter._clone(event.target)}splitter._capturedElement.offset();splitter._startX=splitter._capturedElement.offset().left;splitter._startY=splitter._capturedElement.offset().top;splitter._kbMove=0;splitter._kbLockLeft=false;splitter._kbLockRight=false;splitter._mouseStartX=splitter._isTouch()?event.originalEvent.touches[0].pageX:event.pageX;splitter._mouseStartY=splitter._isTouch()?event.originalEvent.touches[0].pageY:event.pageY}}}return false}return false},_clone:function(bar){var clonedBar=$(bar).clone();clonedBar.css({position:"absolute",top:$(bar).offset().top,left:$(bar).offset().left,"z-index":9999}).fadeTo(0,.7);$(document.body).append(clonedBar);return clonedBar},_addCollapseButtonHandlers:function(button,index){var self=this;button.bind(this._getEvent("mouseenter"),function(e){$($(this).parent()).removeClass(self.css.barHover);$(this).addClass(self.css.collapseButtonHover);if(e.stopPropagation!==undefined){e.stopPropagation()}if(e.preventDefault!==undefined){e.preventDefault()}return false});button.bind(this._getEvent("mouseleave"),function(e){$($(this).parent()).addClass(self.css.barHover);$(this).removeClass(self.css.collapseButtonHover)});button.bind("mousedown touchstart",function(e){$(this).toggleClass(self.css.collapseButtonPressed);if(self._panels[index].options.collapsed){self.expandAt(index)}else{self.collapseAt(index)}if(e.stopPropagation!==undefined){e.stopPropagation()}if(e.preventDefault!==undefined){e.preventDefault()}return false})},_performDrag:function(self,ev){var page=self._isTouch()?ev.originalEvent.touches[0][self._getOrientation("page")]:ev[self._getOrientation("page")],bar;if(ev.which===0&&$.ig.util.isIE&&$.ig.util.isIEOld){self._stopDrag(self);return false}if(self._capturedElement){if(ev.type==="keydown"){bar=self[self._getOrientation("start")]+self._kbMove}else{bar=page-self[self._getOrientation("mouse")]+self[self._getOrientation("start")]}self._moveBar(bar);return false}return true},_moveBar:function(bar){bar=this._validatePosition(bar);if(bar.invalid){this._capturedElement.addClass(this.css.barInvalid)}else{this._capturedElement.removeClass(this.css.barInvalid)}this._capturedElement.css(this._getOrientation("dimention"),bar.position)},_validatePosition:function(bar){var resizeArea=this._resizeArea,rightBoundary=this._getNextBoundary(resizeArea),getPreviousBoundary=this._getPreviousBoundary(resizeArea),min=Math.min(rightBoundary,rightBoundary-resizeArea.right.options.min,getPreviousBoundary+resizeArea.left.options.max),max=Math.max(getPreviousBoundary,getPreviousBoundary+resizeArea.left.options.min,rightBoundary-resizeArea.right.options.max),pos;if(max>min){pos=resizeArea.right.offset()[this._getOrientation("dimention")]-this._capturedElement[this._getOrientation("outerSize")](true);return{position:pos,invalid:true}}if(bar<max){return{position:max,invalid:true}}if(bar>min){return{position:min,invalid:true}}return{position:bar,invalid:false}},_getNextBoundary:function(panel){var size=panel.right.offset()[this._getOrientation("dimention")]+panel.right[this._getOrientation("size")]()-this._capturedElement[this._getOrientation("outerSize")](true);if(panel.right.options.collapsed){size-=panel.right.options.min}return size},_getPreviousBoundary:function(panel){var size=panel.left.offset()[this._getOrientation("dimention")];if(panel.left.options.collapsed){size+=panel.left.options.min}return size},_stopDrag:function(self,cancel,kbMove){if(self._capturedElement){if(!cancel&&(self._isDrag||kbMove)){self._performAreaResize()}self._capturedElement.remove();self._isDrag=false}self._capturedElement=null},_performAreaResize:function(){var resizeArea=this._resizeArea,offset=this._capturedElement.offset()[this._getOrientation("dimention")]-this[this._getOrientation("start")],left=resizeArea.left[this._getOrientation("size")]()+offset,right=resizeArea.right[this._getOrientation("size")]()-offset;this._setPanelSize(resizeArea.left,left);this._setPanelSize(resizeArea.right,right);if(offset!==0){this._triggerResizeEnded()}this._splittersLayout()},_splittersLayout:function(){var splitters=$.data(document.body,"ig-splitters")||[],i;for(i=0;i<splitters.length;i++){if(splitters[i][0]!==this.element){$(splitters[i]).data("igSplitter")._panelsLayout()}}},_panelsLayout:function(){var i,outerSize=(this._panels.length-1)*this._splitter.bar[this._getOrientation("outerSize")](true),size=this._getSize(this._getOrientation("size"));for(i=0;i<this._panels.length;i++){if(!this._panels[i].options.collapsed){outerSize+=this._handlerPanelSize(this._panels[i],outerSize,size)}else{this._handlerPanelSize(this._panels[i],outerSize,size);$(this._splitter.bar.children()[(i+1)%2]).hide();$(this._splitter.bar.children()[i]).removeClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"Expanded"]);$($(this._splitter.bar.children()[i]).children()).removeClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"ExpandedIcon"]);$(this._splitter.bar.children()[i]).addClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"Collapsed"]);$($(this._splitter.bar.children()[i]).children()).addClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"CollapsedIcon"])}}if(outerSize<size){this._createPanel(size,outerSize,this._panels.length-1)}this._splitter.bar[this._getOrientation("oppositeSize")](this.element[this._getOrientation("oppositeSize")]()-2);$(this._splitter.bar.children()[2]).find("span")[this._getOrientation("oppositeSize")](this.element[this._getOrientation("oppositeSize")]())},_getStep:function(){return this._const.step+this._splitter.bar[this._getOrientation("size")]()},_handlerPanelSize:function(panel,outerSize,size){if(this._isPercentLayout){if(panel.options._min!==undefined){panel.options.min=panel.options._min.replace("%","")*this._getSize(this._getOrientation("size"))/100}if(panel.options._max!==undefined){panel.options.max=panel.options._max.replace("%","")*this._getSize(this._getOrientation("size"))/100}}this._setPanelSize(panel,panel.options.size);var newSize;if(outerSize+panel.options.size>=size&&!panel.options.collapsed){newSize=size-outerSize;if(!panel.options.collapsed){if(this._isPercentLayout){panel[this._getOrientation("size")](newSize/this._getSize(this._getOrientation("size"))*100+"%")}else{panel[this._getOrientation("size")](newSize)}panel.options.size=newSize}}return panel[this._getOrientation("outerSize")](true)},_setPanelSize:function(panel,size){if(!panel.options.collapsed){panel.options.size=parseInt(size,10);if(panel.options.size===0||this._isPercentLayout&&panel.options.size<=$.ig.util.getScrollWidth()){panel.addClass(this.css.noScroll)}else{panel.removeClass(this.css.noScroll)}if(this._isPercentLayout){size=parseInt(size,10);panel[this._getOrientation("size")](size/this._getSize(this._getOrientation("size"))*100+"%")}else{panel[this._getOrientation("size")](size)}}else{panel.addClass(this.css.noScroll);panel[this._getOrientation("size")](0)}},_createPanel:function(size,outerSize,index){if(index===undefined){index=0}var panel=this._panels[index],newSize=size-outerSize,panelSize=panel[this._getOrientation("size")](),maxSize=newSize+panelSize;if(index<=this._panels.length){if(panel.options.collapsed){this._panelHelper(outerSize,size)}else{if(maxSize>panel.options.max){panel.options.max=maxSize}if(this._isPercentLayout){panel[this._getOrientation("size")](maxSize/this._getSize(this._getOrientation("size"))*100+"%")}else{panel[this._getOrientation("size")](maxSize)}panel.options.size=maxSize}return}maxSize=Math.min(maxSize,panel.options.max);if(!panel.options.collapsed){panel[this._getOrientation("size")](maxSize);panel.options.size=maxSize}else{maxSize=panelSize=0}if(maxSize+(outerSize-panelSize)<size||panel.options.collapsed){this._createPanel(size,outerSize-panelSize+maxSize,index-1)}},_panelHelper:function(outerSize,size){var panel,flag=false,i;for(i=0;i<this._panels.length&&!flag;i++){panel=this._panels[i];if(!panel.options.collapsed){flag=true}}panel[this._getOrientation("size")](size-outerSize+panel[this._getOrientation("size")]())},expandAt:function(index){var neighborPanel;if(index<=this._panels.length&&index>=0&&this._panels[index].options.collapsed){neighborPanel=this._panels[index%2===0?1:0];this._panels[index].options.collapsed=false;this._panels[index].options.size=Math.min(this._panels[index].options.size,neighborPanel[this._getOrientation("size")]());neighborPanel.options.size=neighborPanel[this._getOrientation("size")]()-this._panels[index].options.size;this._splitter.bar.removeClass(this.css.barCollapsed);if(this._panels[(index+1)%2].options.collapsible){$(this._splitter.bar.children()[(index+1)%2]).show()}$(this._splitter.bar.children()[index]).removeClass(this.css.collapseButtonPressed);$(this._splitter.bar.children()[index]).removeClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"Collapsed"]);$($(this._splitter.bar.children()[index]).children()).removeClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"CollapsedIcon"]);$(this._splitter.bar.children()[index]).addClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"Expanded"]);$($(this._splitter.bar.children()[index]).children()).addClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"ExpandedIcon"]);neighborPanel.css(this._getOrientation("size"),neighborPanel.options.size);this._panels[index].css(this._getOrientation("size"),this._panels[index].options.size);this._splittersLayout();this._triggerExpanded(index)}},collapseAt:function(index){var size,neighborPanel;if(index<this._panels.length&&index>=0&&!this._panels[index].options.collapsed&&this._panels[index].options.collapsible){size=this._panels[index][this._getOrientation("size")]();neighborPanel=this._panels[index%2===0?1:0];this._panels[index].options.size=size||this._panels[index].options.size;this._panels[index].options.collapsed=true;this._splitter.bar.addClass(this.css.barCollapsed);$(this._splitter.bar.children()[(index+1)%2]).hide();$(this._splitter.bar.children()[index]).addClass(this.css.collapseButtonPressed);$(this._splitter.bar.children()[index]).removeClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"Expanded"]);$($(this._splitter.bar.children()[index]).children()).removeClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"ExpandedIcon"]);$(this._splitter.bar.children()[index]).addClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"Collapsed"]);$($(this._splitter.bar.children()[index]).children()).addClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"CollapsedIcon"]);neighborPanel.options.size=neighborPanel[this._getOrientation("size")]()+size;neighborPanel.css(this._getOrientation("size"),neighborPanel.options.size);this._panels[index].css(this._getOrientation("size"),0);this._splittersLayout();this._triggerCollapsed(index)}},_animateResize:function(panel,size,animationDuration,callback){var properties={},self=this;properties[this._getOrientation("size")]=size;panel.animate(properties,{step:function(){self._splittersLayout()},duration:animationDuration,complete:function(){self._splittersLayout();if(callback&&typeof callback==="function"){callback()}}})},_triggerCollapsed:function(index){var args={owner:this,index:index};this._trigger(this.events.collapsed,null,args)},_triggerExpanded:function(index){var args={owner:this,index:index};this._trigger(this.events.expanded,null,args)},_triggerResizeStarted:function(){var args={owner:this};this._trigger(this.events.resizeStarted,null,args)},_triggerResizing:function(){var args={owner:this};return this._trigger(this.events.resizing,null,args)},_triggerResizeEnded:function(){var args={owner:this};this._trigger(this.events.resizeEnded,null,args)},_triggerLayoutRefreshing:function(){var args={owner:this};return this._trigger(this.events.layoutRefreshing,null,args)},_triggerLayoutRefreshed:function(){var args={owner:this};return this._trigger(this.events.layoutRefreshed,null,args)},firstPanel:function(){return this._panels[0]},secondPanel:function(){return this._panels[1]},refreshLayout:function(){this._panelsLayout()},setFirstPanelSize:function(size){if(/%/.test(size)){size=size.replace("%","")*this._getSize(this._getOrientation("size"))/100;this._isPercentLayout=true}if(/px/.test(size)){size=parseInt(size,10)}this._setPanelSize(this._panels[0],size);this._splittersLayout()},setSecondPanelSize:function(size){if(/%/.test(size)){size=size.replace("%","")*this._getSize(this._getOrientation("size"))/100;this._isPercentLayout=true}if(/px/.test(size)){size=parseInt(size,10)}this._setPanelSize(this._panels[0],this._getSize(this._getOrientation("size"))-size);this._splittersLayout()},destroy:function(){var evtHandlers=this._opt.eventHandlers,i,splitters,index;this._removeEventHandlers();this._removeClasses();this.element.empty();this.element.html(this._htmlMarkup);splitters=$.data(document.body,"ig-splitters")||[];for(i=0;i<splitters.length;i++){if(splitters[i][0].id===this.element[0].id){index=i;break}}splitters.splice(index,1);$.data(document.body,"ig-splitters",splitters);$(document).unbind(this._getEvent("mouseup"),evtHandlers.documentMouseUp);$(document).unbind(this._getEvent("mousemove"),evtHandlers.documentMouseMove);$(window).unbind("resize",evtHandlers.windowResize);$.Widget.prototype.destroy.apply(this,arguments);return this}});$.extend($.ui.igSplitter,{version:"13.1.20131.2523"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI infragistics.olapxmladatasource.js 13.1.20131.2523
*
* Copyright (c) 2011-2014 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends:
*     jquery-1.4.4.js
*     jquery.ui.core.js
*     jquery.ui.widget.js
*     infragistics.util.js
*/
$.ig=$.ig||{};$.ig.util.bulkDefine(["AbstractEnumerable","AbstractEnumerator","IEnumerable$1","ICollection$1","IList$1","IArrayList","List$1","Collection$1","IDictionary$2","Dictionary$2","GenericEnumerable$1","IEnumerator$1","GenericEnumerator$1","INotifyCollectionChanged","NotifyCollectionChangedEventHandler","NotifyCollectionChangedEventArgs","NotifyCollectionChangedAction","KeyValuePair$2","LinkedList$1","LinkedListNode$1","ObservableCollection$1","Queue$1","ReadOnlyCollection$1","ReadOnlyObservableCollection$1","NameValueCollection","Stack$1","IComparer$1","Expression","MemberExpression","ParameterExpression","LambdaExpression","MethodCallExpression","IOrderedEnumerable$1","Queryable","Enumerable","SortedList$1","IGrouping$2","IArray","DependencyObject","Test","IQueryable","IQueryable$1","IQueryProvider","Activator","AggregateException","ArgumentException","ArgumentNullException","ArgumentOutOfRangeException","AsyncCompletedEventArgs","AsyncCompletedEventHandler","ListSortDirection","Convert","Environment","InvalidOperationException","Debug","IEquatable$1","BinaryReader","ICredentials","NetworkCredential","UploadStringCompletedEventHandler","UploadStringCompletedEventArgs","WebClient","WebHeaderCollection","FaultCode","FaultException","FaultException$1","FaultReason","StringBuilder","BinaryFileDownloader","NotImplementedException","Random","Encoding","UTF8Encoding","Task","Task$1","TaskCompletionSource$1","TaskFactory","TaskStatus","Tuple$2","Uri","JavaScriptSerializer","UIElement","UIElementCollection","FrameworkElement","Control","ContentControl","Panel","Canvas","Image","TextBlock","DataTemplate","DataTemplatePassInfo","DataTemplateMeasureInfo","DataTemplateRenderInfo","DataTemplateRenderHandler","DataTemplateMeasureHandler","DataTemplatePassHandler","Binding","DependencyProperty","UnsetValue","DependencyPropertiesCollection","DependencyPropertyChangedEventArgs","Key","ModifierKeys","MouseEventArgs","MouseButtonEventArgs","Brush","Color","DoubleCollection","FillRule","GeometryType","Geometry","GeometryCollection","GeometryGroup","LineGeometry","RectangleGeometry","EllipseGeometry","PathGeometry","PathFigure","PathFigureCollection","PathSegmentType","PathSegment","PathSegmentCollection","LineSegment","BezierSegment","PolyBezierSegment","PolyLineSegment","ArcSegment","SweepDirection","HorizontalAlignment","PenLineCap","Stretch","Transform","RotateTransform","TranslateTransform","TransformGroup","TransformCollection","VerticalAlignment","Point","PointCollection","PropertyChangedCallback","CoerceValueCallback","PropertyMetadata","PropertyPath","Rect","Shape","Line","Path","Polygon","Polyline","Rectangle","Size","Style","StyleTypedPropertyAttribute","TemplatePartAttribute","TemplateVisualStateAttribute","Visibility","XObject","XAttribute","XNode","XContainer","XDocument","XElement","XmlUtils","XName","XNamespace","Object","MulticastDelegate","Action","Action$1","Action$2","Action$3","Action$4","Action$5","Action$6","Action$7","Action$8","IEqualityComparer$1","IEnumerable","ICollection","IDictionary","IList","Array","Array","Comparison$1","Attribute","BrowsableAttribute","EventArgs","CancelEventArgs","DesignTimeVisibleAttribute","EditorBrowsableAttribute","ValueType","Enum","EditorBrowsableState","ISupportInitialize","ITypeDescriptorContext","TypeConverter","TypeConverterAttribute","WinMDTypeAttribute","WinMDPropertyToObjectTypeAttribute","Error","IFormatProvider","NotSupportedException","ObsoleteAttribute","MemberInfo","MethodBase","ConstructorInfo","IComparable","Date","Number","SuppressMessageAttribute","EventHandler$1","PlaceholderSystemCollectionsObjectModel","PlaceholderSystemCollectionsSpecialized","PlaceholderSystemWindows","PlaceholderSystemWindowsControls","PlaceholderSystemWindowsData","PlaceholderSystemWindowsInput","PlaceholderSystemWindowsMarkup","PlaceholderSystemWindowsMediaImaging","PlaceholderSystemWindowsShapes","PlaceholderSystemWindowsControlsPrimitives","PlaceholderSystemWindowsAutomation","PlaceholderSystemWindowsAutomationPeers","PlaceholderSystemText","PlaceholderSystemGlobalization","PlaceholderSystemWindowsDocuments","PlaceholderSystemWindowsInk","PlaceholderSystemWindowsMediaAnimation","PlaceholderSystemWindowsMediaEffects","PlaceholderSystemWindowsThreading","PlaceholderInfragisticsControlerChartsAutomationPeers","FlagsAttribute","Func$1","Func$2","Func$3","Func$4","Func$5","Func$6","Func$7","Func$8","Func$9","Math","XMLHttpRequest","Nullable$1","Number","ParamArrayAttribute","Array","AttributeTargets","AttributeUsageAttribute","Boolean","Number","String","Array","CompareCallback","Dictionary","DictionaryEntry","IEnumerator","INotifyPropertyChanged","PropertyChangedEventArgs","PropertyChangedEventHandler","CultureInfo","Delegate","Number","IDisposable","Number","Number","Number","IntPtr","ReflectionUtil","AssemblyTitleAttribute","AssemblyCompanyAttribute","AssemblyConfigurationAttribute","AssemblyCopyrightAttribute","AssemblyCultureAttribute","AssemblyDescriptionAttribute","AssemblyFileVersionAttribute","AssemblyProductAttribute","AssemblyTrademarkAttribute","AssemblyVersionAttribute","DefaultMemberAttribute","MethodInfo","ParameterInfo","PropertyInfo","RuntimeFieldHandle","RuntimeTypeHandle","ClientScriptAttribute","ClientNameAttribute","DontObfuscateAttribute","EmitIgnoreTypeAttribute","ExtensionAttribute","GlobalMemberAttribute","IgnoreAttribute","InlineItemAccessAttribute","InlinePropertyAttribute","InternalsVisibleToAttribute","KeepOriginalNameAttribute","LiteralStringAttribute","NativeMethodAttribute","NativePropertyAttribute","NativeTypeAttribute","RuntimeHelpers","WeakAttribute","WidgetAttribute","MainWidgetAttribute","SuppressWidgetMemberAttribute","SuppressWidgetMemberCopyAttribute","WidgetDefaultStringAttribute","WidgetDefaultNumberAttribute","WidgetDefaultBooleanAttribute","MvcEnumSetStringEnumAttribute","WidgetModuleAttribute","WidgetModuleParentAttribute","WidgetIgnoreDependsAttribute","ComVisibleAttribute","GuidAttribute","OutAttribute","DataContractAttribute","DataMemberAttribute","WaitHandle","EventWaitHandle","Monitor","TypeCode","TargetFrameworkAttribute","Number","Script","Single","String","ManualResetEvent","Thread","Date","Type","Number","Number","Number","UIntPtr","XmlAttributeAttribute","XmlElementAttribute","XmlEnumAttribute","XmlIgnoreAttribute","XmlRootAttribute","XmlTypeAttribute","XmlNode","XmlAttribute","XmlDocument","XmlDocumentParser","XmlLinkedNode","XmlElement","Void","XmlNodeList","XmlNamedNodeMap","XmlNodeType","XmlSchemaForm","Element","CanvasElement","console","DivElement","Document","ElementAttribute","ElementAttributeCollection","ElementCollection","ElementEventHandler","ElementNodeType","EventListener","IElementEventHandler","ImageElement","CanvasContext","CanvasContext2D","ImageData","Gradient","TextMetrics","MSGesture","WebStyle","window","Callback","JQuery","JQueryDeferred","JQueryEvent","JQueryObject","JQueryCallback","JQueryUICallback","JQueryPosition","JQueryPromise"]);$.ig.util.defType("TaskStatus","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("TaskStatus",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ListSortDirection","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("ListSortDirection",$.ig.Object.prototype.$type)},true);$.ig.util.defType("NotifyCollectionChangedAction","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("NotifyCollectionChangedAction",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AbstractEnumerable","Object",{a:null,init:function(a){$.ig.Object.prototype.init.call(this);this.a=a},getEnumerator:function(){return new $.ig.AbstractEnumerator(this.a().getEnumerator())},$type:new $.ig.Type("AbstractEnumerable",$.ig.Object.prototype.$type,[$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("AbstractEnumerator","Object",{a:null,init:function(a){$.ig.Object.prototype.init.call(this);this.a=a},current:function(){return this.a.current()},moveNext:function(){return this.a.moveNext()},reset:function(){this.a.reset()},$type:new $.ig.Type("AbstractEnumerator",$.ig.Object.prototype.$type,[$.ig.IEnumerator.prototype.$type])},true);$.ig.util.defType("IEnumerable$1","Object",{$type:new $.ig.Type("IEnumerable$1",null,[$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("ICollection$1","Object",{$type:new $.ig.Type("ICollection$1",null,[$.ig.IEnumerable$1.prototype.$type.specialize(0),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("IList$1","Object",{$type:new $.ig.Type("IList$1",null,[$.ig.ICollection$1.prototype.$type.specialize(0),$.ig.IEnumerable$1.prototype.$type.specialize(0),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("IArrayList","Object",{$type:new $.ig.Type("IArrayList",null)},true);$.ig.util.defType("List$1","Object",{$t:null,__inner:null,init:function($t,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}this.a={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.__inner=new $.ig.Array},init1:function($t,initNumber,a){this.a={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.__inner=new $.ig.Array;if(this.n(0,a)){return}var c=a.getEnumerator();while(c.moveNext()){var b=c.current();this.add(b)}},init2:function($t,initNumber,a){this.a={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.__inner=new $.ig.Array},i:function(a,b){this.__inner[a]=b},j:function(a,b){this.__inner.insert(a,b)},k:function(a){this.__inner.add(a)},l:function(a){this.__inner.removeAt(a)},m:function(){this.__inner.clear()},item:function(b,a){if(arguments.length===2){this.i(b,a);return a}else{return this.__inner[b]}},indexOf:function(a){return this.__inner.indexOf(a)},insert:function(a,b){this.j(a,b)},removeAt:function(a){this.l(a)},count:function(){return this.__inner.length},isReadOnly:function(){return false},add:function(a){this.k(a)},clear:function(){this.m()},contains:function(a){return this.__inner.contains(a)},copyTo:function(a,b){for(var c=0;c<this.__inner.length;c++){a[b+c]=this.__inner[c]}},remove:function(a){var b=this.indexOf(a);if(b<0){return false}this.l(b);return true},getEnumerator:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$b=this.$this.__inner.getEnumerator();this.$state=4;break;case 2:this.$a=this.$b.current();this.$current=this.$a;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$b.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerator$1(this.$t,$iter())},asArrayList:function(){return this.__inner},n:function(a,collection_){var b=$.ig.util.cast($.ig.IArrayList.prototype.$type,collection_);if(b!=null){this.__inner.insertRange1(a,b.asArrayList());return true}var c=$.ig.util.cast($.ig.IArray.prototype.$type,collection_);if(c!=null){this.__inner.insertRange(a,c.asArray());return true}var d=$.ig.util.cast($.ig.IList$1.prototype.$type.specialize(this.$t),collection_);if(d!=null){for(var e=0;e<d.count();e++){this.__inner.insert(a+e,d.item(e))}return true}var f=$.isArray(collection_)?collection_:null;if(f!=null){this.__inner.insertRange(a,f);return true}return false},o:function(a,b){if(this.n(a,b)){return}var c=0;var e=b.getEnumerator();while(e.moveNext()){var d=e.current();this.__inner.insert(a+c,d);c++}},p:function(a,b){if(this.n(a,b)){return}var c=0;var e=b.getEnumerator();while(e.moveNext()){var d=e.current();this.__inner.insert(a+c,d);c++}},q:function(a,b){this.__inner.splice(a,b)},copyTo1:function(a,b){this.__inner.copyTo(a,b)},isFixedSize:function(){return false},add1:function(c){this.k(c);return this.__inner.length-1},contains1:function(d){return this.__inner.contains(d)},indexOf1:function(e){return this.__inner.indexOf(e)},insert1:function(f,g){this.j(f,g)},remove1:function(h){var i=this.indexOf1(h);this.l(i)},r:function(){var $self=this;var j=null;if(this.$t==Number){j=function(k,l){var m=k;var n=l;if(m<n){return-1}if(m==n){return 0}return 1}}else if(this.$t==$.ig.Single.prototype.$type){j=function(o,p){var q=o;var r=p;if(q<r){return-1}if(q==r){return 0}return 1}}else if(this.$t==$.ig.Number.prototype.$type){j=function(s,t){var u=s;var v=t;if(u<v){return-1}if(u==v){return 0}return 1}}else if(this.$t==$.ig.Date.prototype.$type){j=function(w,x){var y=w;var z=x;if(y.getTime()<z.getTime()){return-1}if(y.getTime()==z.getTime()){return 0}return 1}}else{j=function(aa,ab){return aa.compareTo(ab)}}this.s(j)},s:function(ac){this.__inner.sort(ac)},t:function(ad){var $self=this;this.__inner.sort(function(ae,af){var ag=ae;var ah=af;return ad(ag,ah)})},_h:null,h:function(ai){if(arguments.length===1){this._h=ai;return ai}else{return this._h}},w:function(aj){var al=aj.getEnumerator();while(al.moveNext()){var ak=al.current();this.__inner.add(ak)}},x:function(){return this.__inner.slice(0)},y:function(am){},isSynchronized:function(){return true},a:null,syncRoot:function(){return this.a},$type:new $.ig.Type("List$1",$.ig.Object.prototype.$type,[$.ig.IList$1.prototype.$type.specialize(0),$.ig.IArrayList.prototype.$type,$.ig.IList.prototype.$type])},true);$.ig.util.defType("IDictionary$2","Object",{$type:new $.ig.Type("IDictionary$2",null,[$.ig.ICollection$1.prototype.$type.specialize($.ig.KeyValuePair$2.prototype.$type.specialize(0,1)),$.ig.IEnumerable$1.prototype.$type.specialize($.ig.KeyValuePair$2.prototype.$type.specialize(0,1)),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("Dictionary$2","Object",{$tKey:null,$tValue:null,__inner:null,__keys:null,init:function($tKey,$tValue,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}this.a=null;this._useToString=false;this.b=false;this._needsEnsure=false;this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.Object.prototype.init.call(this);this.__inner=new $.ig.Dictionary(0);this.__keys=new $.ig.Dictionary(0)},init1:function($tKey,$tValue,initNumber,a){this.a=null;this._useToString=false;this.b=false;this._needsEnsure=false;this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.Object.prototype.init.call(this);this.__inner=new $.ig.Dictionary(1,a);this.__keys=new $.ig.Dictionary(0)},a:null,init2:function($tKey,$tValue,initNumber,a){this.a=null;this._useToString=false;this.b=false;this._needsEnsure=false;this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.Object.prototype.init.call(this);this.__inner=new $.ig.Dictionary(0);this.__keys=new $.ig.Dictionary(0);this.a=a},count:function(){return this.__inner.count()},item:function(b,a){if(arguments.length===2){this.__inner.item(this.f(b),a);this.__keys.item(this.f(b),b);return a}else{return this.__inner.item(this.f(b))}},c:function(){return this.__inner.length()},containsKey:function(a){return this.__inner.containsKey(this.f(a))},remove:function(a){var b=this.f(a);if(!this.__keys.containsKey(b)){return false}this.__inner.remove(b);this.__keys.remove(b);return true},clear:function(){this.__inner.clear();this.__keys.clear()},_useToString:null,b:null,_needsEnsure:null,e:function(key_){if(!this.b){this.b=true;this._needsEnsure=typeof key_=="object";if(!this._needsEnsure){this._useToString=!key_.getHashCode}}},f:function(key_){this.e(key_);if(this._needsEnsure){$.ig.util.ensureUniqueId(key_)}if(this.a!=null){return this.a.getHashCode(key_).toString()}if(this._useToString){return key_.toString()}else{return key_.getHashCode().toString()}},add:function(a,b){this.__inner.item(this.f(a),b);this.__keys.item(this.f(a),a)},tryGetValue:function(a,b){if(!this.__inner.containsKey(this.f(a))){b=null;return{ret:false,value:b}}b=this.__inner.item(this.f(a));return{ret:true,value:b};return{value:b}},keys:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.__keys.values().getEnumerator();this.$state=4;break;case 2:this.$b=this.$c.current();this.$current=this.$b;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$c.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1(this.$tKey,$iter)},values:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.__inner.values().getEnumerator();this.$state=4;break;case 2:this.$b=this.$c.current();this.$current=this.$b;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$c.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1(this.$tValue,$iter)},isReadOnly:function(){return false},add1:function(a){this.add(a.key(),a.value())},contains:function(a){return this.containsKey(a.key())},g:function(a,b){throw new $.ig.NotImplementedException},remove1:function(a){this.remove(a.key());return true},h:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$b=this.$this.__keys.values().getEnumerator();this.$state=4;break;case 2:this.$a=this.$b.current();this.$current=new $.ig.KeyValuePair$2(this.$tKey,this.$tValue,this.$a,this.$this.__inner.item(this.$this.f(this.$a)));this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$b.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1($.ig.KeyValuePair$2.prototype.$type.specialize(this.$tKey,this.$tValue),$iter)},getEnumerator:function(){return this.h().getEnumerator()},$type:new $.ig.Type("Dictionary$2",$.ig.Object.prototype.$type,[$.ig.IDictionary$2.prototype.$type.specialize(0,1),$.ig.IDictionary.prototype.$type])},true);$.ig.util.defType("GenericEnumerable$1","Object",{$t:null,a:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.a=a},getEnumerator:function(){return new $.ig.GenericEnumerator$1(this.$t,this.a().getEnumerator())},$type:new $.ig.Type("GenericEnumerable$1",$.ig.Object.prototype.$type,[$.ig.IEnumerable$1.prototype.$type.specialize(0)])},true);$.ig.util.defType("IEnumerator$1","Object",{$type:new $.ig.Type("IEnumerator$1",null,[$.ig.IEnumerator.prototype.$type])},true);$.ig.util.defType("GenericEnumerator$1","Object",{$t:null,a:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.a=a},current:function(){return this.a.current()},moveNext:function(){return this.a.moveNext()},reset:function(){this.a.reset()},$type:new $.ig.Type("GenericEnumerator$1",$.ig.Object.prototype.$type,[$.ig.IEnumerator$1.prototype.$type.specialize(0)])},true);$.ig.util.defType("INotifyCollectionChanged","Object",{$type:new $.ig.Type("INotifyCollectionChanged",null)},true);$.ig.util.defType("NotifyCollectionChangedEventArgs","EventArgs",{init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$.ig.EventArgs.prototype.init.call(this);this.a=a;this.d=new $.ig.List$1($.ig.Object.prototype.$type,0);this.b=new $.ig.List$1($.ig.Object.prototype.$type,0)},init1:function(initNumber,a,b,c){var $self=this;$.ig.EventArgs.prototype.init.call(this);this.a=a;this.d=new $.ig.List$1($.ig.Object.prototype.$type,0);if(this.a==$.ig.NotifyCollectionChangedAction.prototype.remove||this.a==$.ig.NotifyCollectionChangedAction.prototype.replace){this.d.add(b);this.e=c}if(this.a!=$.ig.NotifyCollectionChangedAction.prototype.remove){this.b=function(){var $ret=new $.ig.List$1($.ig.Object.prototype.$type,0);$ret.add(b);return $ret}()}else{this.b=new $.ig.List$1($.ig.Object.prototype.$type,0)}this.c=c},init2:function(initNumber,a,b,c,d){var $self=this;$.ig.EventArgs.prototype.init.call(this);this.a=a;this.c=d;this.e=d;this.b=function(){var $ret=new $.ig.List$1($.ig.Object.prototype.$type,0);$ret.add(b);return $ret}();this.d=function(){var $ret=new $.ig.List$1($.ig.Object.prototype.$type,0);$ret.add(c);return $ret}()},a:null,action:function(){return this.a},b:null,newItems:function(){return this.b},c:null,newStartingIndex:function(){return this.c},d:null,oldItems:function(){return this.d},e:null,oldStartingIndex:function(){return this.e},$type:new $.ig.Type("NotifyCollectionChangedEventArgs",$.ig.EventArgs.prototype.$type)},true);$.ig.util.defType("KeyValuePair$2","ValueType",{$tKey:null,$tValue:null,a:null,b:null,init:function($tKey,$tValue,a,b){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.ValueType.prototype.init.call(this);this.a=a;this.b=b},key:function(){return this.a},value:function(){return this.b},$type:new $.ig.Type("KeyValuePair$2",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ObservableCollection$1","List$1",{$t:null,init:function($t,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.List$1.prototype.init.call(this,this.$t)},init1:function($t,initNumber,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.List$1.prototype.init1.call(this,this.$t,1,a)},init2:function($t,initNumber,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.List$1.prototype.init2.call(this,this.$t,2,a)},i:function(a,b){var c=this.__inner[a];$.ig.List$1.prototype.i.call(this,a,b);if(this.propertyChanged!=null){this.ag(new $.ig.PropertyChangedEventArgs("Item[]"))}if(this.collectionChanged!=null){var d=new $.ig.NotifyCollectionChangedEventArgs(2,$.ig.NotifyCollectionChangedAction.prototype.replace,b,c,a);this.ah(d)}},m:function(){$.ig.List$1.prototype.m.call(this);if(this.propertyChanged!=null){this.ag(new $.ig.PropertyChangedEventArgs("Count"));this.ag(new $.ig.PropertyChangedEventArgs("Item[]"))}if(this.collectionChanged!=null){var a=new $.ig.NotifyCollectionChangedEventArgs(0,$.ig.NotifyCollectionChangedAction.prototype.reset);this.ah(a)}},j:function(a,b){$.ig.List$1.prototype.j.call(this,a,b);if(this.propertyChanged!=null){this.ag(new $.ig.PropertyChangedEventArgs("Count"));this.ag(new $.ig.PropertyChangedEventArgs("Item[]"))}if(this.collectionChanged!=null){var c=new $.ig.NotifyCollectionChangedEventArgs(1,$.ig.NotifyCollectionChangedAction.prototype.add,b,a);this.ah(c)}},k:function(a){$.ig.List$1.prototype.k.call(this,a);if(this.propertyChanged!=null){this.ag(new $.ig.PropertyChangedEventArgs("Count"));this.ag(new $.ig.PropertyChangedEventArgs("Item[]"))}if(this.collectionChanged!=null){var b=new $.ig.NotifyCollectionChangedEventArgs(1,$.ig.NotifyCollectionChangedAction.prototype.add,a,this.count()-1);this.ah(b)}},l:function(a){var b=this.__inner[a];$.ig.List$1.prototype.l.call(this,a);if(this.propertyChanged!=null){this.ag(new $.ig.PropertyChangedEventArgs("Count"));this.ag(new $.ig.PropertyChangedEventArgs("Item[]"))}if(this.collectionChanged!=null){var c=new $.ig.NotifyCollectionChangedEventArgs(1,$.ig.NotifyCollectionChangedAction.prototype.remove,b,a);this.ah(c)}},collectionChanged:null,propertyChanged:null,ag:function(a){if(this.propertyChanged!=null){this.propertyChanged(this,a)}},ah:function(a){if(this.collectionChanged!=null){this.collectionChanged(this,a)}},$type:new $.ig.Type("ObservableCollection$1",$.ig.List$1.prototype.$type.specialize(0),[$.ig.INotifyCollectionChanged.prototype.$type,$.ig.INotifyPropertyChanged.prototype.$type])},true);$.ig.util.defType("ReadOnlyCollection$1","Object",{$t:null,init:function($t,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.b={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this)},init1:function($t,initNumber,a){this.b={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.a=a},a:null,item:function(b,a){if(arguments.length===2){this.a.item(b,a);return a}else{return this.a.item(b)}},indexOf:function(a){return this.a.indexOf(a)},insert:function(a,b){},removeAt:function(a){},count:function(){return this.a.count()},isReadOnly:function(){return true},add:function(a){},clear:function(){},contains:function(a){return this.a.contains(a)},copyTo:function(a,b){this.a.copyTo(a,b)},remove:function(a){return false},getEnumerator:function(){return this.a.getEnumerator()},isFixedSize:function(){return true},add1:function(c){return-1},contains1:function(d){return this.a.contains(d)},indexOf1:function(e){return this.a.indexOf(e)},insert1:function(f,g){},remove1:function(h){},copyTo1:function(i,j){this.a.copyTo(i,j)},c:function(){return this.a},isSynchronized:function(){return true},b:null,syncRoot:function(){return this.b},$type:new $.ig.Type("ReadOnlyCollection$1",$.ig.Object.prototype.$type,[$.ig.IList$1.prototype.$type.specialize(0),$.ig.IList.prototype.$type])},true);$.ig.util.defType("NameValueCollection","Object",{a:null,init:function(){$.ig.Object.prototype.init.call(this);this.a=new $.ig.Dictionary$2(String,String,0)},item:function(b,a){if(arguments.length===2){if(this.a.containsKey(b)){this.a.item(b,a)}else{this.a.add(b,a)}return a}else{if(this.a.containsKey(b)){return this.a.item(b)}else{return null}}},$type:new $.ig.Type("NameValueCollection",$.ig.Object.prototype.$type)},true);$.ig.util.defType("IOrderedEnumerable$1","Object",{$type:new $.ig.Type("IOrderedEnumerable$1",null,[$.ig.IEnumerable$1.prototype.$type.specialize(0),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("Enumerable","Object",{init:function(){$.ig.Object.prototype.init.call(this)},where$1:function($tSource,b){var $self=this;var $iter=function(){return function($tSource,b){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$d=this.$this.getEnumerator();this.$state=7;break;case 2:this.$c=this.$d.current();this.$state=3;break;case 3:if(b(this.$c)){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$c;this.$state=5;return true;case 5:this.$state=6;break;case 6:this.$state=7;break;case 7:if(this.$d.moveNext()){this.$state=2}else{this.$state=8}break;case 8:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,b)};return new $.ig.GenericEnumerable$1($tSource,$iter)},where$11111:function($tSource,b){var $self=this;var $iter=function(){return function($tSource,b){return{$state:0,$this:$self,$current:null,$c:0,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$c=0;this.$state=1;break;case 1:this.$e=this.$this.getEnumerator();this.$state=7;break;case 2:this.$d=this.$e.current();this.$state=3;break;case 3:if(b(this.$d,this.$c)){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$d;this.$state=5;return true;case 5:this.$state=6;break;case 6:this.$c++;this.$state=7;break;case 7:if(this.$e.moveNext()){this.$state=2}else{this.$state=8}break;case 8:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,b)};return new $.ig.GenericEnumerable$1($tSource,$iter)},select$2:function($tSource,$tResult,b){var $self=this;var $iter=function(){return function($tSource,$tResult,b){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$d=this.$this.getEnumerator();this.$state=4;break;case 2:this.$c=this.$d.current();this.$current=b(this.$c);this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$d.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,$tResult,b)};return new $.ig.GenericEnumerable$1($tResult,$iter)},selectMany$2:function($tSource,$tResult,b){var $self=this;var $iter=function(){return function($tSource,$tResult,b){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$d=this.$this.getEnumerator();this.$state=8;break;case 2:this.$c=this.$d.current();this.$state=3;break;case 3:this.$f=b(this.$c).getEnumerator();this.$state=6;break;case 4:this.$e=this.$f.current();this.$current=this.$e;this.$state=5;return true;case 5:this.$state=6;break;case 6:if(this.$f.moveNext()){this.$state=4}else{this.$state=7}break;case 7:this.$state=8;break;case 8:if(this.$d.moveNext()){this.$state=2}else{this.$state=9}break;case 9:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,$tResult,b)};return new $.ig.GenericEnumerable$1($tResult,$iter)},ofType$1:function($tResult){var $self=this;var $iter=function(){return function($tResult){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.getEnumerator();this.$state=7;break;case 2:this.$b=this.$c.current();this.$state=3;break;case 3:if($.ig.util.cast($tResult,this.$b)!==null){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$b;this.$state=5;return true;case 5:this.$state=6;break;case 6:this.$state=7;break;case 7:if(this.$c.moveNext()){this.$state=2}else{this.$state=8}break;case 8:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tResult)};return new $.ig.GenericEnumerable$1($tResult,$iter)},last$1:function($tSource){var b=$.ig.util.cast($.ig.IList$1.prototype.$type.specialize($tSource),this);if(b!=null){return b.item(b.count()-1)}var c=null;var e=this.getEnumerator();while(e.moveNext()){var d=e.current();c=d}return c},first$1:function($tSource){var c=this.getEnumerator();while(c.moveNext()){var b=c.current();return b}return null},firstOrDefault$1:function($tSource){var c=this.getEnumerator();while(c.moveNext()){var b=c.current();return b}return null},orderBy$2:function($tSource,$tKey,b){var $self=this;var c=new $.ig.SortedList$1($tSource,this);c.t(function(d,e){var f=d;var g=e;var h=b(f);var i=b(g);if($.ig.util.cast($.ig.IComparable.prototype.$type,h)!==null){return $.ig.util.cast($.ig.IComparable.prototype.$type,h).compareTo(i)}else{return h.toString().compareTo(i.toString())}});return c},orderByDescending$2:function($tSource,$tKey,b){var $self=this;var c=new $.ig.SortedList$1($tSource,this);c.t(function(d,e){var f=e;var g=d;var h=b(f);var i=b(g);if($.ig.util.cast($.ig.IComparable.prototype.$type,h)!==null){return $.ig.util.cast($.ig.IComparable.prototype.$type,h).compareTo(i)
}else{return h.toString().compareTo(i.toString())}});return c},toList$1:function($tSource){var b=new $.ig.List$1($tSource,1,this);return b},a:function(a,b){var $self=this;var $iter=function(){return function(a,b){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=a;this.$state=5;break;case 2:this.$current=this.$c;this.$state=3;return true;case 3:this.$state=4;break;case 4:this.$c++;this.$state=5;break;case 5:if(this.$c<b){this.$state=2}else{this.$state=6}break;case 6:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}(a,b)};return new $.ig.GenericEnumerable$1($.ig.Number.prototype.$type,$iter)},concat$1:function($tSource,b){var $self=this;var $iter=function(){return function($tSource,b){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$d=this.$this.getEnumerator();this.$state=4;break;case 2:this.$c=this.$d.current();this.$current=this.$c;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$d.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=6;break;case 6:this.$f=b.getEnumerator();this.$state=9;break;case 7:this.$e=this.$f.current();this.$current=this.$e;this.$state=8;return true;case 8:this.$state=9;break;case 9:if(this.$f.moveNext()){this.$state=7}else{this.$state=10}break;case 10:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,b)};return new $.ig.GenericEnumerable$1($tSource,$iter)},max:function(){var b=true;var c=0;var e=this.getEnumerator();while(e.moveNext()){var d=e.current();if(b){b=false;c=d}else{c=Math.max(c,d)}}return c},max$111:function($tSource,b){return this.select$2($tSource,$.ig.Number.prototype.$type,b).max()},min:function(){var b=true;var c=0;var e=this.getEnumerator();while(e.moveNext()){var d=e.current();if(b){b=false;c=d}else{c=Math.min(c,d)}}return c},min$111:function($tSource,b){return this.select$2($tSource,$.ig.Number.prototype.$type,b).max()},count$1:function($tSource){var b=0;var d=this.getEnumerator();while(d.moveNext()){var c=d.current();b++}return b},reverse$1:function($tSource){var $self=this;var $iter=function(){return function($tSource){return{$state:0,$this:$self,$current:null,$b:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$b=new $.ig.List$1($tSource,1,this.$this);this.$state=1;break;case 1:this.$c=this.$b.count()-1;this.$state=5;break;case 2:this.$current=this.$b.__inner[this.$c];this.$state=3;return true;case 3:this.$state=4;break;case 4:this.$c--;this.$state=5;break;case 5:if(this.$c>0){this.$state=2}else{this.$state=6}break;case 6:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource)};return new $.ig.GenericEnumerable$1($tSource,$iter)},cast$1:function($tResult){if(this==null){throw new $.ig.ArgumentNullException("source")}var b=$.ig.util.cast($.ig.IEnumerable$1.prototype.$type.specialize($tResult),this);if(b!=null){return b}var c=new $.ig.List$1($tResult,0);var e=this.getEnumerator();while(e.moveNext()){var d=e.current();if($.ig.util.cast($tResult,d)!==null){c.add(d)}else{c.add(null)}}return c},take$1:function($tSource,b){var $self=this;var $iter=function(){return function($tSource,b){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$d=this.$this.getEnumerator();this.$state=9;break;case 2:this.$c=this.$d.current();this.$state=3;break;case 3:if(b>0){this.$state=4}else{this.$state=6}break;case 4:b--;this.$current=this.$c;this.$state=5;return true;case 5:this.$state=8;break;case 6:this.$state=-2;return false;case 7:this.$state=8;break;case 8:this.$state=9;break;case 9:if(this.$d.moveNext()){this.$state=2}else{this.$state=10}break;case 10:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,b)};return new $.ig.GenericEnumerable$1($tSource,$iter)},skip$1:function($tSource,b){var $self=this;var $iter=function(){return function($tSource,b){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$d=this.$this.getEnumerator();this.$state=8;break;case 2:this.$c=this.$d.current();this.$state=3;break;case 3:if(b<=0){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$c;this.$state=5;return true;case 5:this.$state=7;break;case 6:b--;this.$state=7;break;case 7:this.$state=8;break;case 8:if(this.$d.moveNext()){this.$state=2}else{this.$state=9}break;case 9:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,b)};return new $.ig.GenericEnumerable$1($tSource,$iter)},any$1:function($tSource){var c=this.getEnumerator();while(c.moveNext()){var b=c.current();return true}return false},contains$1:function($tSource,value_){var b=this.getEnumerator();while(b.moveNext()){var item_=b.current();if(item_===value_){return true}}return false},union$1:function($tSource,b){return null},toArray$1:function($tSource){var b=new $.ig.List$1($tSource,1,this);return b.asArrayList()},elementAt$1:function($tSource,b){var c=$.ig.util.cast($.ig.IList$1.prototype.$type.specialize($tSource),this);if(c!=null){return c.item(b)}return this.skip$1($tSource,b).first$1($tSource)},$type:new $.ig.Type("Enumerable",$.ig.Object.prototype.$type)},true);$.ig.util.defType("SortedList$1","List$1",{$tElement:null,init:function($tElement,a){this.$tElement=$tElement;this.$type=this.$type.specialize(this.$tElement);$.ig.List$1.prototype.init1.call(this,this.$tElement,1,a)},getEnumerator:function(){return $.ig.List$1.prototype.getEnumerator.call(this)},$type:new $.ig.Type("SortedList$1",$.ig.List$1.prototype.$type.specialize(0),[$.ig.IOrderedEnumerable$1.prototype.$type.specialize(0)])},true);$.ig.util.defType("IArray","Object",{$type:new $.ig.Type("IArray",null)},true);$.ig.util.defType("AggregateException","Error",{init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$.ig.Error.prototype.init.call(this)},init1:function(initNumber,a){$.ig.Error.prototype.init1.call(this,1,a)},init2:function(initNumber,a,b){$.ig.Error.prototype.init2.call(this,2,a,b)},$type:new $.ig.Type("AggregateException",$.ig.Error.prototype.$type)},true);$.ig.util.defType("ArgumentException","Error",{init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.Error.prototype.init1.call(this,1,a+" is invalid.")},init1:function(initNumber,a,b){$.ig.Error.prototype.init1.call(this,1,a)},$type:new $.ig.Type("ArgumentException",$.ig.Error.prototype.$type)},true);$.ig.util.defType("ArgumentNullException","Error",{init:function(a){$.ig.Error.prototype.init1.call(this,1,a+" cannot be null.")},$type:new $.ig.Type("ArgumentNullException",$.ig.Error.prototype.$type)},true);$.ig.util.defType("AsyncCompletedEventArgs","EventArgs",{a:null,b:null,c:null,init:function(a,b,c){$.ig.EventArgs.prototype.init.call(this);this.b=b;this.a=a;this.c=c},error:function(){return this.a},cancelled:function(){return this.b},userState:function(){return this.c},d:function(){if(this.error()!=null){throw this.error()}},$type:new $.ig.Type("AsyncCompletedEventArgs",$.ig.EventArgs.prototype.$type)},true);$.ig.util.defType("Environment","Object",{init:function(){$.ig.Object.prototype.init.call(this)},a:function(){return"\n"},$type:new $.ig.Type("Environment",$.ig.Object.prototype.$type)},true);$.ig.util.defType("InvalidOperationException","Error",{init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.Error.prototype.init1.call(this,1,"Invalid operation")},init1:function(initNumber,a){$.ig.Error.prototype.init1.call(this,1,a)},$type:new $.ig.Type("InvalidOperationException",$.ig.Error.prototype.$type)},true);$.ig.util.defType("Debug","Object",{init:function(){$.ig.Object.prototype.init.call(this)},a:function(a,b){},b:function(a){},c:function(a){},$type:new $.ig.Type("Debug",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ICredentials","Object",{$type:new $.ig.Type("ICredentials",null)},true);$.ig.util.defType("NetworkCredential","Object",{init:function(initNumber,a,b){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.NetworkCredential.prototype.init1.call(this,1,a,b,String.empty())},init1:function(initNumber,a,b,c){$.ig.Object.prototype.init.call(this);this.d(a);this.e(b);this.f(c)},getCredential:function(a,b){return this},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},$type:new $.ig.Type("NetworkCredential",$.ig.Object.prototype.$type,[$.ig.ICredentials.prototype.$type])},true);$.ig.util.defType("UploadStringCompletedEventArgs","AsyncCompletedEventArgs",{e:null,init:function(a,b,c,d){$.ig.AsyncCompletedEventArgs.prototype.init.call(this,b,c,d);this.e=a},result:function(){this.d();return this.e},$type:new $.ig.Type("UploadStringCompletedEventArgs",$.ig.AsyncCompletedEventArgs.prototype.$type)},true);$.ig.util.defType("WebClient","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.f(new $.ig.WebHeaderCollection)},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},uploadStringCompleted:null,p:function(a,b,c,d){var $self=this;this.q(a,b,c).ac(function(e){if($self.uploadStringCompleted!=null){var f=null;var g=null;try{f=e.aa()}catch(e_){g=e_}$self.uploadStringCompleted($self,new $.ig.UploadStringCompletedEventArgs(f,g,e.i()==$.ig.TaskStatus.prototype.canceled,d))}})},q:function(a,b,c){var url_=a.value();var method_=b;var data_=c;var contentType_=this.f().item("Content-Type");var credentials_=this.g();var d=$.ig.util.ajax(url_,contentType_,data_,method_,credentials_);return new $.ig.Task$1(String,d,null)},r:function(a,b,c,d){a.i(b)},s:function(a,b,c,d){a.h(new $.ig.Error(1,d))},$type:new $.ig.Type("WebClient",$.ig.Object.prototype.$type)},true);$.ig.util.defType("WebHeaderCollection","NameValueCollection",{init:function(){$.ig.NameValueCollection.prototype.init.call(this)},$type:new $.ig.Type("WebHeaderCollection",$.ig.NameValueCollection.prototype.$type)},true);$.ig.util.defType("FaultCode","Object",{init:function(a){$.ig.Object.prototype.init.call(this);this.b(a)},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},$type:new $.ig.Type("FaultCode",$.ig.Object.prototype.$type)},true);$.ig.util.defType("FaultException","Error",{init:function(a,b,c){$.ig.Error.prototype.init.call(this);this.reason(a);this.code(b);this.action(c)},_action:null,action:function(a){if(arguments.length===1){this._action=a;return a}else{return this._action}},_code:null,code:function(a){if(arguments.length===1){this._code=a;return a}else{return this._code}},_reason:null,reason:function(a){if(arguments.length===1){this._reason=a;return a}else{return this._reason}},$type:new $.ig.Type("FaultException",$.ig.Error.prototype.$type)},true);$.ig.util.defType("FaultException$1","FaultException",{$tDetail:null,init:function($tDetail,a,b,c,d){this.$tDetail=$tDetail;this.$type=this.$type.specialize(this.$tDetail);$.ig.FaultException.prototype.init.call(this,b,c,d);this.detail(a)},_detail:null,detail:function(a){if(arguments.length===1){this._detail=a;return a}else{return this._detail}},$type:new $.ig.Type("FaultException$1",$.ig.FaultException.prototype.$type)},true);$.ig.util.defType("FaultReason","Object",{a:null,init:function(a){$.ig.Object.prototype.init.call(this);this.a=a},toString:function(){return this.a},$type:new $.ig.Type("FaultReason",$.ig.Object.prototype.$type)},true);$.ig.util.defType("StringBuilder","Object",{_internal:null,internal:function(a){if(arguments.length===1){this._internal=a;return a}else{return this._internal}},init:function(){$.ig.Object.prototype.init.call(this);this._internal=[]},d:function(str_){this._internal.push(str_);return this},e:function(a){var str_=a.toString();this._internal.push(str_);return this},f:function(chr_){this._internal.push(chr_);return this},g:function(str_){this._internal.push(str_+String.fromCharCode(10));return this},h:function(index_,chr_){this._internal.splice(index_,0,chr_);return this},i:function(index_,str_){this._internal.splice(index_,0,str_);return this},j:function(startIndex_,length_){this._internal.splice(startIndex_,length_);return this},toString:function(){return this._internal.join("")},$type:new $.ig.Type("StringBuilder",$.ig.Object.prototype.$type)},true);$.ig.util.defType("NotImplementedException","Error",{init:function(){$.ig.Error.prototype.init1.call(this,1,"not implemented")},$type:new $.ig.Type("NotImplementedException",$.ig.Error.prototype.$type)},true);$.ig.util.defType("Encoding","Object",{init:function(){$.ig.Object.prototype.init.call(this)},a:null,uTF8:function(){if($.ig.Encoding.prototype.a==null){$.ig.Encoding.prototype.a=new $.ig.UTF8Encoding}return $.ig.Encoding.prototype.a},getString:function(a,b,c){return""},getBytes:function(a){return new Array(0)},$type:new $.ig.Type("Encoding",$.ig.Object.prototype.$type)},true);$.ig.util.defType("UTF8Encoding","Encoding",{init:function(){$.ig.Encoding.prototype.init.call(this)},getString:function(bytes_,a,b){var c="";for(var i_=a;i_<b;i_++){if(bytes_[i_]==0){break}c=c+String.fromCharCode(bytes_[i_])}return c},getBytes:function(input_){var a=new Array(input_.length);for(var i_=0;i_<input_.length;i_++){a[i_]=String.toCharCode(input_.charAt(i_))}return a},$type:new $.ig.Type("UTF8Encoding",$.ig.Encoding.prototype.$type)},true);$.ig.util.defType("Task","Object",{_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.Task.prototype.init1.call(this,1,a,null)},init1:function(initNumber,a,b){var $self=this;$.ig.Object.prototype.init.call(this);var c=function(){};var e=function(d){if(d==null){$self.g(true)}else{$self.h(new $.ig.AggregateException(2,"Exception occurred during task execution",d))}};this.f(a.done(c).fail(e));this.j(b)},i:function(){if(this.g()){return $.ig.TaskStatus.prototype.canceled}switch(this.f().state()){case"pending":return $.ig.TaskStatus.prototype.created;case"resolved":return $.ig.TaskStatus.prototype.ranToCompletion;case"rejected":return $.ig.TaskStatus.prototype.faulted;default:return $.ig.TaskStatus.prototype.created}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},t:function(a){var $self=this;var b=function(){return a($self)};var d=function(c){return a($self)};var e=this.f().done(b).fail(d);return new $.ig.Task(0,e)},v:function($tNewResult,a){var $self=this;var b=new $.ig.TaskCompletionSource$1($tNewResult,0);var d=function(){try{var c=a($self);b.i(c)}catch(e_){b.h(e_)}};var f=function(e){return d()};var h=function(g){return d()};this.f().done(f).fail(h);return b.d()},$type:new $.ig.Type("Task",$.ig.Object.prototype.$type)},true);$.ig.util.defType("Task$1","Task",{$tResult:null,init:function($tResult,a,b){var $self=this;this.y=false;this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$.ig.Task.prototype.init1.call(this,1,a,b);var e=function(c){var d=c;$self.z=d;$self.y=true};var g=function(f){$self.y=true};this.f().done(e).fail(g)},y:null,z:null,aa:function(){if(!this.y){throw"Result is not ready yet"}if(this.h()!=null){throw this.h()}return this.z},ac:function(a){var $self=this;return $.ig.Task.prototype.t.call(this,function(b){return a(b)})},ae:function($tNewResult,a){var $self=this;var c=function(b){return a(b)};return this.ag($.ig.Object.prototype.$type,c).ag($.ig.Object.prototype.$type,function(d){return d.aa()})},ag:function($tNewResult,a){return $.ig.Task.prototype.v.call(this,$tNewResult,a)},$type:new $.ig.Type("Task$1",$.ig.Task.prototype.$type)},true);$.ig.util.defType("TaskCompletionSource$1","Object",{$tResult:null,_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},init:function($tResult,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$.ig.TaskCompletionSource$1.prototype.init1.call(this,1,null)},init1:function($tResult,initNumber,a){this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$.ig.Object.prototype.init.call(this);this.c($.ig.util.deferred());this.d(new $.ig.Task$1(this.$tResult,this.c().promise(),a))},g:function(){this.c().reject(null)},h:function(a){this.c().reject(a)},i:function(a){this.c().resolve(a)},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},$type:new $.ig.Type("TaskCompletionSource$1",$.ig.Object.prototype.$type)},true);$.ig.util.defType("TaskFactory","Object",{init:function(){$.ig.Object.prototype.init.call(this)},a:function(a,b){var $self=this;return new $.ig.Task(0,this.i(this.h(a)).always(function(){return b(a)}))},c:function($tResult,a,b){var $self=this;var c=new $.ig.TaskCompletionSource$1($tResult,0);this.i(this.h(a)).always(function(){try{var d=b(a);c.i(d)}catch(e_){c.h(e_)}});return c.d()},e:function($tAntecedentResult,a,b){var $self=this;return this.e($tAntecedentResult,a,function(c){return b(c)})},g:function($tAntecedentResult,$tResult,a,b){var $self=this;var d=function(c){return b(c)};return this.c($.ig.Object.prototype.$type,a,d).ae($tResult,function(e){return e.aa()})},h:function(a){var b=new Array(a.length);for(var c=0;c<a.length;c++){b[c]=a[c].f()}return b},i:function(a){var promises_=a;var b=function(p){function whenAll(){var whenDeffered=$.ig.util.deferred();if(arguments.length===0){whenDeffered.resolve();return whenDeffered}var count=arguments.length;var resolve=true;for(var i=0;i<arguments.length;i++){arguments[i].done(function(){resolve=resolve&&true}).fail(function(){resolve=resolve&&false}).always(function(){count--;if(count<=0){if(resolve){whenDeffered.resolve()}else{whenDeffered.reject()}}})}return whenDeffered}return whenAll.apply($,p)}(promises_);return b},$type:new $.ig.Type("TaskFactory",$.ig.Object.prototype.$type)},true);$.ig.util.defType("Tuple$2","Object",{$t1:null,$t2:null,_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},init:function($t1,$t2,a,b){this.$t1=$t1;this.$t2=$t2;this.$type=this.$type.specialize(this.$t1,this.$t2);$.ig.Object.prototype.init.call(this);this.c(a);this.d(b)},$type:new $.ig.Type("Tuple$2",$.ig.Object.prototype.$type)},true);$.ig.util.defType("Uri","Object",{init:function(a){$.ig.Object.prototype.init.call(this);this.value(a)},_value:null,value:function(a){if(arguments.length===1){this._value=a;return a}else{return this._value}},$type:new $.ig.Type("Uri",$.ig.Object.prototype.$type)},true);$.ig.util.defType("JavaScriptSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},a:function(a){var text_=a;return JSON.parse(text_)},b:function(a){var value_=a;return JSON.stringify(value_)},$type:new $.ig.Type("JavaScriptSerializer",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XObject","Object",{init:function(a){$.ig.Object.prototype.init.call(this);this.backingNode(a)},_backingNode:null,backingNode:function(a){if(arguments.length===1){this._backingNode=a;return a}else{return this._backingNode}},_b:null,b:function(){return this._b},toString:function(){if(this.backingNode()!=null){return $.ig.XmlUtils.prototype.xmlNodeToString(this.backingNode())}else{return""}},$type:new $.ig.Type("XObject",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XAttribute","XObject",{init:function(a){$.ig.XObject.prototype.init.call(this,a)},g:function(a){this.backingNode(this.backingNode().cloneNode(true));a.setAttributeNode(this.backingNode())},b:function(){return $.ig.XmlNodeType.prototype.attribute},f:function(){return $.ig.XmlUtils.prototype.o(this.backingNode())},$type:new $.ig.Type("XAttribute",$.ig.XObject.prototype.$type)},true);$.ig.util.defType("XNode","XObject",{init:function(a){$.ig.XObject.prototype.init.call(this,a)},$type:new $.ig.Type("XNode",$.ig.XObject.prototype.$type)},true);$.ig.util.defType("XContainer","XNode",{init:function(a){$.ig.XNode.prototype.init.call(this,a)},f:function(a){var b=null;var c=this.backingNode();var d=c.childNodes;var e=d.length;var f=a.c();var g=a.d();for(var h=0;h<e;h++){var i=d.item(h);if(i.namespaceURI==g&&i.nodeType==$.ig.XmlNodeType.prototype.element&&$.ig.XmlUtils.prototype.m(i)==f){b=i}}if(b==null){return null}else{return new $.ig.XElement(0,b)}},g:function(){return this.i(null)},h:function(a){return this.i(a)},i:function(a){var b=new $.ig.List$1($.ig.XElement.prototype.$type,0);for(var c=0;c<this.backingNode().childNodes.length;c++){var d=this.backingNode().childNodes.item(c);if(d.nodeType==$.ig.XmlNodeType.prototype.element){var e=false;if(a!=null){if($.ig.XmlUtils.prototype.m(d)==a.c()&&d.namespaceURI==a.d()){e=true}}else{e=true}if(e){b.add(new $.ig.XElement(0,d))}}}return b},j:function(a){var b=this.backingNode();var c;if($.ig.util.cast($.ig.XDocument.prototype.$type,this)!==null){c=this.backingNode()}else{c=this.backingNode().ownerDocument}if($.ig.util.cast($.ig.XAttribute.prototype.$type,a)!==null){a.g(b)}else if($.ig.util.cast($.ig.XElement.prototype.$type,a)!==null){a.q(b,c)}},$type:new $.ig.Type("XContainer",$.ig.XNode.prototype.$type)},true);$.ig.util.defType("XDocument","XContainer",{init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.XContainer.prototype.init.call(this,a)},init1:function(initNumber){$.ig.XContainer.prototype.init.call(this,$.ig.XmlUtils.prototype.h())},b:function(){return $.ig.XmlNodeType.prototype.document},k:function(a){return new $.ig.XDocument(0,$.ig.XmlUtils.prototype.g(a))},$type:new $.ig.Type("XDocument",$.ig.XContainer.prototype.$type)},true);$.ig.util.defType("XElement","XContainer",{init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$.ig.XContainer.prototype.init.call(this,a)},init1:function(initNumber,a){$.ig.XElement.prototype.init2.call(this,2,a,null)},init2:function(initNumber,a,b){$.ig.XContainer.prototype.init.call(this,$.ig.XmlUtils.prototype.i(a.c(),a.d()));var c=b==null?"":b.toString();this.k(c)},k:function(a){if(arguments.length===1){$.ig.XmlUtils.prototype.k(this.backingNode(),a);return a}else{return $.ig.XmlUtils.prototype.j(this.backingNode())}},b:function(){return $.ig.XmlNodeType.prototype.element},l:function(){return $.ig.XName.prototype.i($.ig.XmlUtils.prototype.m(this.backingNode()),this.backingNode().namespaceURI)},p:function(a){return new $.ig.XAttribute($.ig.XmlUtils.prototype.n(this.backingNode(),a.c(),a.d()))},q:function(a,b){if(this.backingNode().ownerDocument!=b){this.backingNode($.ig.XmlUtils.prototype.l(b,this.backingNode()))}a.appendChild(this.backingNode())},$type:new $.ig.Type("XElement",$.ig.XContainer.prototype.$type)},true);$.ig.util.defType("XmlUtils","Object",{init:function(){$.ig.Object.prototype.init.call(this)},a:function(){return!!window.DOMParser},b:function(a){var text_=a;return(new DOMParser).parseFromString(text_,"text/xml")},c:function(a){var text_=a;return function(xml){var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async=false;xmlDoc.loadXML(xml);return xmlDoc}(text_)},d:function(a){var node_=a;return(new XMLSerializer).serializeToString(node_)},e:function(a){var node_=a;return node_.xml},f:function(){return new ActiveXObject("Microsoft.XMLDOM")},g:function(a){if($.ig.XmlUtils.prototype.a()){return $.ig.XmlUtils.prototype.b(a)}else{return $.ig.XmlUtils.prototype.c(a)}},xmlNodeToString:function(a){if($.ig.XmlUtils.prototype.a()){return $.ig.XmlUtils.prototype.d(a)}else{return $.ig.XmlUtils.prototype.e(a)}},h:function(){var a;if($.ig.XmlUtils.prototype.a()){a=$.ig.XmlUtils.prototype.b("<dummy/>");a.removeChild(a.documentElement)}else{a=$.ig.XmlUtils.prototype.f()}return a},i:function(a,b){var doc_=$.ig.XmlUtils.prototype.h();if($.ig.XmlUtils.prototype.a()){return doc_.createElementNS(b,a)}else{var name_=a;var namespaceURI_=b;return doc_.createNode(1,name_,namespaceURI_)}},j:function(a){if($.ig.XmlUtils.prototype.a()){return a.textContent}else{var node_=a;return node_.text}},k:function(a,b){if($.ig.XmlUtils.prototype.a()){a.textContent=b}else{var node_=a;var text_=b;node_.text=text_}},l:function(a,b){if($.ig.XmlUtils.prototype.a()){return a.importNode(b,true)}else{return b}},m:function(a){if($.ig.XmlUtils.prototype.a()){return a.localName}else{var node_=a;return node_.baseName}},n:function(a,b,c){if($.ig.XmlUtils.prototype.a()){return a.getAttributeNodeNS(c,b)}else{var elem_=a;var ln_=b;var nn_=c;return elem_.attributes.getQualifiedItem(ln_,nn_)}},o:function(a){if($.ig.XmlUtils.prototype.a()){return a.nodeValue}else{var attr_=a;return attr_.value}},$type:new $.ig.Type("XmlUtils",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XName","Object",{a:null,b:null,init:function(a,b){$.ig.Object.prototype.init.call(this);this.a=a;this.b=b},c:function(){return this.a},d:function(){return this.b},e:function(){return $.ig.XNamespace.prototype.d(this.b)},i:function(a,b){return new $.ig.XName(a,b)},$type:new $.ig.Type("XName",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XNamespace","Object",{a:null,init:function(a){$.ig.Object.prototype.init.call(this);this.a=a},d:function(a){return new $.ig.XNamespace(a)},b:function(){return $.ig.XNamespace.prototype.d("http://www.w3.org/2000/xmlns/")},c:function(){return this.a},$type:new $.ig.Type("XNamespace",$.ig.Object.prototype.$type)},true);$.ig.TaskStatus.prototype.created=0;$.ig.TaskStatus.prototype.ranToCompletion=5;$.ig.TaskStatus.prototype.canceled=6;$.ig.TaskStatus.prototype.faulted=7;$.ig.ListSortDirection.prototype.ascending=0;$.ig.ListSortDirection.prototype.descending=1;$.ig.NotifyCollectionChangedAction.prototype.add=0;$.ig.NotifyCollectionChangedAction.prototype.remove=1;$.ig.NotifyCollectionChangedAction.prototype.replace=2;$.ig.NotifyCollectionChangedAction.prototype.reset=4;$.ig.util.extCopy($.ig.Queryable,[[[$.ig.AbstractEnumerable,$.ig.IEnumerable$1,$.ig.ICollection$1,$.ig.IList$1,$.ig.List$1,$.ig.IDictionary$2,$.ig.Dictionary$2,$.ig.GenericEnumerable$1,$.ig.ReadOnlyCollection$1,$.ig.Stack$1,$.ig.IOrderedEnumerable$1,$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ICollection,$.ig.IList,$.ig.Array,$.ig.Dictionary,$.ig.XmlNodeList,$.ig.XmlNamedNodeMap],["asQueryable"]]]);$.ig.util.extCopy($.ig.Enumerable,[[[$.ig.ICollection$1,$.ig.IList$1,$.ig.List$1,$.ig.IDictionary$2,$.ig.Dictionary$2,$.ig.GenericEnumerable$1,$.ig.ReadOnlyCollection$1,$.ig.Stack$1,$.ig.IOrderedEnumerable$1,$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.IEnumerable$1],["where$1","where$11111","select$2","selectMany$2","last$1","first$1","firstOrDefault$1","orderBy$2","orderByDescending$2","toList$1","concat$1","max","max$111","min","min$111","count$1","reverse$1","take$1","skip$1","any$1","contains$1","union$1","toArray$1","elementAt$1"]],[[$.ig.AbstractEnumerable,$.ig.IEnumerable$1,$.ig.ICollection$1,$.ig.IList$1,$.ig.List$1,$.ig.IDictionary$2,$.ig.Dictionary$2,$.ig.GenericEnumerable$1,$.ig.ReadOnlyCollection$1,$.ig.Stack$1,$.ig.IOrderedEnumerable$1,$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ICollection,$.ig.IList,$.ig.Array,$.ig.Dictionary,$.ig.XmlNodeList,$.ig.XmlNamedNodeMap],["ofType$1","cast$1"]]]);$.ig=$.ig||{};$.ig.util.bulkDefine(["ICoreOlapElement","Cube","Catalog","Dimension","CubeType","ScopeType","DimensionType","LevelType","HierarchyOrigin","AggregatorType","CardinalityType","MemberType","Hierarchy","Level","Measure","MeasureGroup","MeasureGroupDimension","Member","OlapResult","OlapResultAxis","IPosition$2","OlapResultTuple","IPositionItem$2","IHierarchicalPositionItem$2","OlapResultAxisMember","OlapResultCell","HeaderCellsLayoutOrientation","LevelSpanManager","SpanSource","ITableViewHeadersFactory","TableViewHeadersFactory","TableCompactViewHeadersFactory","TableViewHeaderCellSource","TableViewImpl","TableViewSettings","OlapResultView","ResultViewHelper","OlapTableViewHeaderCell","OlapTableViewResultCell","ArrayListCollection$1","IOlapDataSource","MeasureList","MeasureListLocation","OlapMetadataTreeItemType","OlapMetadataTreeItem","MetaTreeHelper","HierarchyItemPosition","MeasureGroupMetaItemsCache","DataSourceBaseOptions","CubeMetaItemsCache","SourceInitHelper","AxisDefinitionParser","CoreOlapElementType","CoreOlapElementParseResult","CoreOlapElementParser","AxisElement","PivotActionStatus","PivotAction","AxisItemsChangeType","AxisChangedAction","AxisItemsChangedAction","ExpansionStateChangeType","ExpansionStateChangedAction","PivotActionManager","KeyValueItem","PositionItemInfo$2","PositionResolver$2","LevelSortDirection","LevelSortBehavior","TaskExtensions","HierarchyFilterView","FilterMember","FilterMemberStateChangedEventArgs","ResultSorter$1","ResultHeaderSorter","AxisTupleVisitor","AxisHeaderSortingVisitor","ResultColumnValueSorter","AxisValueSortingVisitor","TupleSortDirection","DataSourceBase","jQueryUtils","OlapUtilities","OlapTableView","Object","MulticastDelegate","Action","Action$1","Action$2","Action$3","Action$4","Action$5","Action$6","Action$7","Action$8","IEqualityComparer$1","IEnumerable","ICollection","IDictionary","IList","Array","Array","Comparison$1","Attribute","BrowsableAttribute","EventArgs","CancelEventArgs","DesignTimeVisibleAttribute","EditorBrowsableAttribute","ValueType","Enum","EditorBrowsableState","ISupportInitialize","ITypeDescriptorContext","TypeConverter","TypeConverterAttribute","WinMDTypeAttribute","WinMDPropertyToObjectTypeAttribute","Error","IFormatProvider","NotSupportedException","ObsoleteAttribute","MemberInfo","MethodBase","ConstructorInfo","IComparable","Date","Number","SuppressMessageAttribute","EventHandler$1","PlaceholderSystemCollectionsObjectModel","PlaceholderSystemCollectionsSpecialized","PlaceholderSystemWindows","PlaceholderSystemWindowsControls","PlaceholderSystemWindowsData","PlaceholderSystemWindowsInput","PlaceholderSystemWindowsMarkup","PlaceholderSystemWindowsMediaImaging","PlaceholderSystemWindowsShapes","PlaceholderSystemWindowsControlsPrimitives","PlaceholderSystemWindowsAutomation","PlaceholderSystemWindowsAutomationPeers","PlaceholderSystemText","PlaceholderSystemGlobalization","PlaceholderSystemWindowsDocuments","PlaceholderSystemWindowsInk","PlaceholderSystemWindowsMediaAnimation","PlaceholderSystemWindowsMediaEffects","PlaceholderSystemWindowsThreading","PlaceholderInfragisticsControlerChartsAutomationPeers","FlagsAttribute","Func$1","Func$2","Func$3","Func$4","Func$5","Func$6","Func$7","Func$8","Func$9","Math","XMLHttpRequest","Nullable$1","Number","ParamArrayAttribute","Array","AttributeTargets","AttributeUsageAttribute","Boolean","Number","String","Array","CompareCallback","Dictionary","DictionaryEntry","IEnumerator","INotifyPropertyChanged","PropertyChangedEventArgs","PropertyChangedEventHandler","CultureInfo","Delegate","Number","IDisposable","Number","Number","Number","IntPtr","ReflectionUtil","AssemblyTitleAttribute","AssemblyCompanyAttribute","AssemblyConfigurationAttribute","AssemblyCopyrightAttribute","AssemblyCultureAttribute","AssemblyDescriptionAttribute","AssemblyFileVersionAttribute","AssemblyProductAttribute","AssemblyTrademarkAttribute","AssemblyVersionAttribute","DefaultMemberAttribute","MethodInfo","ParameterInfo","PropertyInfo","RuntimeFieldHandle","RuntimeTypeHandle","ClientScriptAttribute","ClientNameAttribute","DontObfuscateAttribute","EmitIgnoreTypeAttribute","ExtensionAttribute","GlobalMemberAttribute","IgnoreAttribute","InlineItemAccessAttribute","InlinePropertyAttribute","InternalsVisibleToAttribute","KeepOriginalNameAttribute","LiteralStringAttribute","NativeMethodAttribute","NativePropertyAttribute","NativeTypeAttribute","RuntimeHelpers","WeakAttribute","WidgetAttribute","MainWidgetAttribute","SuppressWidgetMemberAttribute","SuppressWidgetMemberCopyAttribute","WidgetDefaultStringAttribute","WidgetDefaultNumberAttribute","WidgetDefaultBooleanAttribute","MvcEnumSetStringEnumAttribute","WidgetModuleAttribute","WidgetModuleParentAttribute","WidgetIgnoreDependsAttribute","ComVisibleAttribute","GuidAttribute","OutAttribute","DataContractAttribute","DataMemberAttribute","WaitHandle","EventWaitHandle","Monitor","TypeCode","TargetFrameworkAttribute","Number","Script","Single","String","ManualResetEvent","Thread","Date","Type","Number","Number","Number","UIntPtr","XmlAttributeAttribute","XmlElementAttribute","XmlEnumAttribute","XmlIgnoreAttribute","XmlRootAttribute","XmlTypeAttribute","XmlNode","XmlAttribute","XmlDocument","XmlDocumentParser","XmlLinkedNode","XmlElement","Void","XmlNodeList","XmlNamedNodeMap","XmlNodeType","XmlSchemaForm","AbstractEnumerable","AbstractEnumerator","IEnumerable$1","ICollection$1","IList$1","IArrayList","List$1","Collection$1","IDictionary$2","Dictionary$2","GenericEnumerable$1","IEnumerator$1","GenericEnumerator$1","INotifyCollectionChanged","NotifyCollectionChangedEventHandler","NotifyCollectionChangedEventArgs","NotifyCollectionChangedAction","KeyValuePair$2","LinkedList$1","LinkedListNode$1","ObservableCollection$1","Queue$1","ReadOnlyCollection$1","ReadOnlyObservableCollection$1","NameValueCollection","Stack$1","IComparer$1","Expression","MemberExpression","ParameterExpression","LambdaExpression","MethodCallExpression","IOrderedEnumerable$1","Queryable","Enumerable","SortedList$1","IGrouping$2","IArray","DependencyObject","Test","IQueryable","IQueryable$1","IQueryProvider","Activator","AggregateException","ArgumentException","ArgumentNullException","ArgumentOutOfRangeException","AsyncCompletedEventArgs","AsyncCompletedEventHandler","ListSortDirection","Convert","Environment","InvalidOperationException","Debug","IEquatable$1","BinaryReader","ICredentials","NetworkCredential","UploadStringCompletedEventHandler","UploadStringCompletedEventArgs","WebClient","WebHeaderCollection","FaultCode","FaultException","FaultException$1","FaultReason","StringBuilder","BinaryFileDownloader","NotImplementedException","Random","Encoding","UTF8Encoding","Task","Task$1","TaskCompletionSource$1","TaskFactory","TaskStatus","Tuple$2","Uri","JavaScriptSerializer","UIElement","UIElementCollection","FrameworkElement","Control","ContentControl","Panel","Canvas","Image","TextBlock","DataTemplate","DataTemplatePassInfo","DataTemplateMeasureInfo","DataTemplateRenderInfo","DataTemplateRenderHandler","DataTemplateMeasureHandler","DataTemplatePassHandler","Binding","DependencyProperty","UnsetValue","DependencyPropertiesCollection","DependencyPropertyChangedEventArgs","Key","ModifierKeys","MouseEventArgs","MouseButtonEventArgs","Brush","Color","DoubleCollection","FillRule","GeometryType","Geometry","GeometryCollection","GeometryGroup","LineGeometry","RectangleGeometry","EllipseGeometry","PathGeometry","PathFigure","PathFigureCollection","PathSegmentType","PathSegment","PathSegmentCollection","LineSegment","BezierSegment","PolyBezierSegment","PolyLineSegment","ArcSegment","SweepDirection","HorizontalAlignment","PenLineCap","Stretch","Transform","RotateTransform","TranslateTransform","TransformGroup","TransformCollection","VerticalAlignment","Point","PointCollection","PropertyChangedCallback","CoerceValueCallback","PropertyMetadata","PropertyPath","Rect","Shape","Line","Path","Polygon","Polyline","Rectangle","Size","Style","StyleTypedPropertyAttribute","TemplatePartAttribute","TemplateVisualStateAttribute","Visibility","XObject","XAttribute","XNode","XContainer","XDocument","XElement","XmlUtils","XName","XNamespace","Element","CanvasElement","console","DivElement","Document","ElementAttribute","ElementAttributeCollection","ElementCollection","ElementEventHandler","ElementNodeType","EventListener","IElementEventHandler","ImageElement","CanvasContext","CanvasContext2D","ImageData","Gradient","TextMetrics","MSGesture","WebStyle","window","Callback","JQuery","JQueryDeferred","JQueryEvent","JQueryObject","JQueryCallback","JQueryUICallback","JQueryPosition","JQueryPromise"]);
$.ig.util.defType("LevelSortBehavior","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("LevelSortBehavior",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapMetadataTreeItemType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("OlapMetadataTreeItemType",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureListLocation","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("MeasureListLocation",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HeaderCellsLayoutOrientation","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("HeaderCellsLayoutOrientation",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MemberType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("MemberType",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CardinalityType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("CardinalityType",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AggregatorType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("AggregatorType",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyOrigin","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("HierarchyOrigin",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DimensionType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("DimensionType",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CubeType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("CubeType",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ICoreOlapElement","Object",{$type:new $.ig.Type("ICoreOlapElement",null)},true);$.ig.util.defType("Cube","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_cubeType:null,cubeType:function(a){if(arguments.length===1){this._cubeType=a;return a}else{return this._cubeType}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_lastProcessed:null,lastProcessed:function(a){if(arguments.length===1){this._lastProcessed=a;return a}else{return this._lastProcessed}},_lastUpdated:null,lastUpdated:function(a){if(arguments.length===1){this._lastUpdated=a;return a}else{return this._lastUpdated}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},$type:new $.ig.Type("Cube",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Catalog","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},$type:new $.ig.Type("Catalog",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Dimension","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_dimensionType:null,dimensionType:function(a){if(arguments.length===1){this._dimensionType=a;return a}else{return this._dimensionType}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_defaultHierarchy:null,defaultHierarchy:function(a){if(arguments.length===1){this._defaultHierarchy=a;return a}else{return this._defaultHierarchy}},$type:new $.ig.Type("Dimension",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Hierarchy","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_defaultHierarchy:null,defaultHierarchy:function(a){if(arguments.length===1){this._defaultHierarchy=a;return a}else{return this._defaultHierarchy}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_defaultMember:null,defaultMember:function(a){if(arguments.length===1){this._defaultMember=a;return a}else{return this._defaultMember}},_allMember:null,allMember:function(a){if(arguments.length===1){this._allMember=a;return a}else{return this._allMember}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_hierarchyOrigin:null,hierarchyOrigin:function(a){if(arguments.length===1){this._hierarchyOrigin=a;return a}else{return this._hierarchyOrigin}},_hierarchyDisplayFolder:null,hierarchyDisplayFolder:function(a){if(arguments.length===1){this._hierarchyDisplayFolder=a;return a}else{return this._hierarchyDisplayFolder}},$type:new $.ig.Type("Hierarchy",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Level","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_depth:null,depth:function(a){if(arguments.length===1){this._depth=a;return a}else{return this._depth}},_hierarchyUniqueName:null,hierarchyUniqueName:function(a){if(arguments.length===1){this._hierarchyUniqueName=a;return a}else{return this._hierarchyUniqueName}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_membersCount:null,membersCount:function(a){if(arguments.length===1){this._membersCount=a;return a}else{return this._membersCount}},_levelOrigin:null,levelOrigin:function(a){if(arguments.length===1){this._levelOrigin=a;return a}else{return this._levelOrigin}},_levelOrderingProperty:null,levelOrderingProperty:function(a){if(arguments.length===1){this._levelOrderingProperty=a;return a}else{return this._levelOrderingProperty}},$type:new $.ig.Type("Level",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Measure","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_measureGroupName:null,measureGroupName:function(a){if(arguments.length===1){this._measureGroupName=a;return a}else{return this._measureGroupName}},_aggregatorType:null,aggregatorType:function(a){if(arguments.length===1){this._aggregatorType=a;return a}else{return this._aggregatorType}},_defaultFormatString:null,defaultFormatString:function(a){if(arguments.length===1){this._defaultFormatString=a;return a}else{return this._defaultFormatString}},_measureDisplayFolder:null,measureDisplayFolder:function(a){if(arguments.length===1){this._measureDisplayFolder=a;return a}else{return this._measureDisplayFolder}},$type:new $.ig.Type("Measure",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("MeasureGroup","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_cubeName:null,cubeName:function(a){if(arguments.length===1){this._cubeName=a;return a}else{return this._cubeName}},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},$type:new $.ig.Type("MeasureGroup",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("MeasureGroupDimension","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_cubeName:null,cubeName:function(a){if(arguments.length===1){this._cubeName=a;return a}else{return this._cubeName}},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},_measureGroupName:null,measureGroupName:function(a){if(arguments.length===1){this._measureGroupName=a;return a}else{return this._measureGroupName}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_measureGroupCardinality:null,measureGroupCardinality:function(a){if(arguments.length===1){this._measureGroupCardinality=a;return a}else{return this._measureGroupCardinality}},_dimensionCardinality:null,dimensionCardinality:function(a){if(arguments.length===1){this._dimensionCardinality=a;return a}else{return this._dimensionCardinality}},_isDimensionVisible:null,isDimensionVisible:function(a){if(arguments.length===1){this._isDimensionVisible=a;return a}else{return this._isDimensionVisible}},_isFactDimension:null,isFactDimension:function(a){if(arguments.length===1){this._isFactDimension=a;return a}else{return this._isFactDimension}},_dimensionPath:null,dimensionPath:function(a){if(arguments.length===1){this._dimensionPath=a;return a}else{return this._dimensionPath}},_dimensionGranularity:null,dimensionGranularity:function(a){if(arguments.length===1){this._dimensionGranularity=a;return a}else{return this._dimensionGranularity}},$type:new $.ig.Type("MeasureGroupDimension",$.ig.Object.prototype.$type)},true);$.ig.util.defType("Member","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_cubeName:null,cubeName:function(a){if(arguments.length===1){this._cubeName=a;return a}else{return this._cubeName}},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_hierarchyUniqueName:null,hierarchyUniqueName:function(a){if(arguments.length===1){this._hierarchyUniqueName=a;return a}else{return this._hierarchyUniqueName}},_levelUniqueName:null,levelUniqueName:function(a){if(arguments.length===1){this._levelUniqueName=a;return a}else{return this._levelUniqueName}},_levelDepth:null,levelDepth:function(a){if(arguments.length===1){this._levelDepth=a;return a}else{return this._levelDepth}},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_memberType:null,memberType:function(a){if(arguments.length===1){this._memberType=a;return a}else{return this._memberType}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_childrenCardinality:null,childrenCardinality:function(a){if(arguments.length===1){this._childrenCardinality=a;return a}else{return this._childrenCardinality}},_parentLevel:null,parentLevel:function(a){if(arguments.length===1){this._parentLevel=a;return a}else{return this._parentLevel}},_parentUniqueName:null,parentUniqueName:function(a){if(arguments.length===1){this._parentUniqueName=a;return a}else{return this._parentUniqueName}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_scope:null,scope:function(a){if(arguments.length===1){this._scope=a;return a}else{return this._scope}},$type:new $.ig.Type("Member",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("OlapResult","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_isEmpty:null,isEmpty:function(a){if(arguments.length===1){this._isEmpty=a;return a}else{return this._isEmpty}},_axes:null,axes:function(a){if(arguments.length===1){this._axes=a;return a}else{return this._axes}},_cells:null,cells:function(a){if(arguments.length===1){this._cells=a;return a}else{return this._cells}},$type:new $.ig.Type("OlapResult",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapResultAxis","Object",{init:function(a,b){$.ig.Object.prototype.init.call(this);this.tuples(a.toList$1($.ig.OlapResultTuple.prototype.$type));this.tupleSize(b);this.positionResolver(new $.ig.PositionResolver$2(String,$.ig.Object.prototype.$type,a,b))},_positionResolver:null,positionResolver:function(a){if(arguments.length===1){this._positionResolver=a;return a}else{return this._positionResolver}},clone:function(){var $self=this;var a=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);var c=this.tuples().getEnumerator();while(c.moveNext()){var b=c.current();a.add(b.clone())}return function(){var $ret=new $.ig.OlapResultAxis(a,$self.tupleSize());$ret.name($self.name());return $ret}()},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_tupleSize:null,tupleSize:function(a){if(arguments.length===1){this._tupleSize=a;return a}else{return this._tupleSize}},_tuples:null,tuples:function(a){if(arguments.length===1){this._tuples=a;return a}else{return this._tuples}},$type:new $.ig.Type("OlapResultAxis",$.ig.Object.prototype.$type)},true);$.ig.util.defType("IPosition$2","Object",{$type:new $.ig.Type("IPosition$2",null)},true);$.ig.util.defType("OlapResultTuple","Object",{init:function(a){$.ig.Object.prototype.init.call(this);this.members(new $.ig.ReadOnlyCollection$1($.ig.OlapResultAxisMember.prototype.$type,1,a))},_members:null,members:function(a){if(arguments.length===1){this._members=a;return a}else{return this._members}},getItems:function(){return this.members()},itemsCount:function(){return this.members().count()},indexOf:function(a){return this.members().indexOf(a)},item:function(b){return this.members().item(b)},isEmpty:function(){return false},clone:function(){var a=new $.ig.List$1($.ig.OlapResultAxisMember.prototype.$type,0);var c=this.members().getEnumerator();while(c.moveNext()){var b=c.current();a.add(b.clone())}var d=new $.ig.OlapResultTuple(a);var f=a.getEnumerator();while(f.moveNext()){var e=f.current();e.position(d)}return d},$type:new $.ig.Type("OlapResultTuple",$.ig.Object.prototype.$type,[$.ig.IPosition$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)])},true);$.ig.util.defType("IPositionItem$2","Object",{$type:new $.ig.Type("IPositionItem$2",null)},true);$.ig.util.defType("IHierarchicalPositionItem$2","Object",{$type:new $.ig.Type("IHierarchicalPositionItem$2",null,[$.ig.IPositionItem$2.prototype.$type.specialize(0,1)])},true);$.ig.util.defType("OlapResultAxisMember","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.properties(new $.ig.Dictionary$2(String,String,0));this.ordinal(-1)},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_levelUniqueName:null,levelUniqueName:function(a){if(arguments.length===1){this._levelUniqueName=a;return a}else{return this._levelUniqueName}},_hierarchyUniqueName:null,hierarchyUniqueName:function(a){if(arguments.length===1){this._hierarchyUniqueName=a;return a}else{return this._hierarchyUniqueName}},_levelNumber:null,levelNumber:function(a){if(arguments.length===1){this._levelNumber=a;return a}else{return this._levelNumber}},_displayInfo:null,displayInfo:function(a){if(arguments.length===1){this._displayInfo=a;return a}else{return this._displayInfo}},childCount:function(){return this.displayInfo()&~65536&~131072},drilledDown:function(){return(this.displayInfo()&65536)==65536},parentSameAsPrev:function(){return(this.displayInfo()&131072)==131072},_properties:null,properties:function(a){if(arguments.length===1){this._properties=a;return a}else{return this._properties}},_position:null,position:function(a){if(arguments.length===1){this._position=a;return a}else{return this._position}},key:function(){return this.uniqueName()},sortKey:function(){if(this.ordinal()>-1){return this.ordinal()}var b=parseFloat(this.caption());if(!isNaN(b)){return b}return this.caption()},_ordinal:null,ordinal:function(a){if(arguments.length===1){this._ordinal=a;return a}else{return this._ordinal}},hierarchyKey:function(){return this.hierarchyUniqueName()},hierarchyLevelKey:function(){return this.levelUniqueName()},parentKey:function(){var $self=this;var b;(function(){var $ret=$self.properties().tryGetValue("PARENT_UNIQUE_NAME",b);b=$ret.value;return $ret.ret})();return b},depth:function(){return this.levelNumber()},isExpandable:function(){return this.childCount()>0},clone:function(){var a=new $.ig.OlapResultAxisMember;a.caption(this.caption());a.displayInfo(this.displayInfo());a.hierarchyUniqueName(this.hierarchyUniqueName());a.levelNumber(this.levelNumber());a.levelUniqueName(this.levelUniqueName());a.ordinal(this.ordinal());var c=this.properties().getEnumerator();while(c.moveNext()){var b=c.current();a.properties().add(b.key(),b.value())}a.uniqueName(this.uniqueName());a.position(this.position());return a},$type:new $.ig.Type("OlapResultAxisMember",$.ig.Object.prototype.$type,[$.ig.IHierarchicalPositionItem$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)])},true);$.ig.util.defType("OlapResultCell","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.properties(new $.ig.Dictionary$2(String,$.ig.Object.prototype.$type,0))},_cellOrdinal:null,cellOrdinal:function(a){if(arguments.length===1){this._cellOrdinal=a;return a}else{return this._cellOrdinal}},_properties:null,properties:function(a){if(arguments.length===1){this._properties=a;return a}else{return this._properties}},clone:function(){var $self=this;var a=function(){var $ret=new $.ig.OlapResultCell;$ret.cellOrdinal($self.cellOrdinal());return $ret}();var c=this.properties().getEnumerator();while(c.moveNext()){var b=c.current();a.properties().add(b.key(),b.value())}return a},$type:new $.ig.Type("OlapResultCell",$.ig.Object.prototype.$type)},true);$.ig.util.defType("LevelSpanManager","Object",{a:null,init:function(a){$.ig.Object.prototype.init.call(this);this.c(a);this.a=new Array(a)},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},f:function(a,b){var $self=this;var c=this.a[a];if(c==null){c=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.SpanSource.prototype.$type,0);this.a[a]=c}var d;if(!function(){var $ret=c.tryGetValue(b,d);d=$ret.value;return $ret.ret}()){d=new $.ig.SpanSource;if(b>0){var e;if(function(){var $ret=c.tryGetValue(b-1,e);e=$ret.value;return $ret.ret}()){d.d(e);e.j()}}c.add(b,d)}return d},$type:new $.ig.Type("LevelSpanManager",$.ig.Object.prototype.$type)},true);$.ig.util.defType("SpanSource","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.a=1},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},a:null,e:function(a){if(arguments.length===1){if(this.a!=a){var b=a-this.a;if(this.d()!=null){this.d().e(this.d().e()+b)}this.a=a}return a}else{return this.a}},b:null,j:function(){if(!this.b){this.b=true;this.e(this.e()+1)}},$type:new $.ig.Type("SpanSource",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ITableViewHeadersFactory","Object",{$type:new $.ig.Type("ITableViewHeadersFactory",null)},true);$.ig.util.defType("TableViewHeadersFactory","Object",{_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_i:null,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},init:function(a,b,c,d,e){$.ig.Object.prototype.init.call(this);this.f(a);this.g(b);this.h(c);this.i(d);this.j(e)},createHeaderCells:function(){var $self=this;if(this.f().positionResolver().hasUnregisterdPositions()){this.f().positionResolver().completeRegisterPositions()}var a=this.f().positionResolver().rootPositionInfo();var b=new $.ig.List$1($.ig.IList$1.prototype.$type.specialize($.ig.TableViewHeaderCellSource.prototype.$type),0);for(var c=0;c<a.positionSize();c++){b.add(new $.ig.List$1($.ig.TableViewHeaderCellSource.prototype.$type,0))}$.ig.TableViewHeadersFactory.prototype.u(a,a.positionItemDepthMin(),b,this.i(),this.j());var d=new $.ig.ArrayListCollection$1($.ig.OlapTableViewHeaderCell.prototype.$type);var e=0;for(var f=0;f<a.positionSize();f++){var g=b.item(f);var h=0;var i=0;var k=g.getEnumerator();while(k.moveNext()){var j=k.current();var l;var m;var n;var o;if(this.h()==$.ig.HeaderCellsLayoutOrientation.prototype.horizontal){l=h;m=j.p().e();n=j.r().positionItemDepth()+e;o=j.o().e()}else{n=h;o=j.p().e();l=j.r().positionItemDepth()+e;m=j.o().e()}var p=this.f().tuples().__inner[j.r().positionIndex()];var q=p.item(j.r().positionItemIndex());var r=this.f().tuples().__inner[j.s()];if(this.g().positionResolver().hasUnregisterdPositions()){this.g().positionResolver().completeRegisterPositions()}var s=this.g().positionResolver().getPositionIndex(r);var t=function(){var $ret=new $.ig.OlapTableViewHeaderCell;$ret.axisName($self.f().name());$ret.hierarchyNumber(j.r().positionItemIndex());$ret.levelNumber(j.r().positionItemDepth());$ret.caption(q.caption());$ret.columnIndex(l);$ret.columnSpan(m);$ret.isExpanded(j.u());$ret.isExpandable(j.v());$ret.tupleIndex(s);$ret.memberIndex(j.r().positionItemIndex());$ret.rowIndex(n);$ret.rowSpan(o);return $ret}();if(!j.l()){h=h+j.p().e()}i=Math.max(i,j.r().positionItemDepth());d.add(t)}e+=i+1}return d},u:function(a,b,c,d,e){var $self=this;var f=new $.ig.LevelSpanManager(a.positionSize());var i=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(g){return g.positionItemDepth()==b}).getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;(function(){var $ret=$.ig.TableViewHeadersFactory.prototype.w(a,h,c,f,d,e,j,k);j=$ret.headerCellSource;k=$ret.totalSpan;return $ret.ret})()}},v:function(a,b,c,d,e,f){var $self=this;var h=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(g){return g.positionItemDepth()==a.positionItemDepthMin()}).toList$1($.ig.PositionItemInfo$2.prototype.$type);if(h.count()>0){var j=h.getEnumerator();while(j.moveNext()){var i=j.current();var k;var l;(function(){var $ret=$.ig.TableViewHeadersFactory.prototype.w(a,i,b,c,d,f,k,l);k=$ret.headerCellSource;l=$ret.totalSpan;return $ret.ret})();e.p().e(e.p().e()+l);if(k.l()){e.p().e(e.p().e()+1)}}e.p().e(e.p().e()-1)}else{f.add(a.positionIndex())}e.s(a.positionIndex())},w:function(a,b,c,d,e,f,g,h){var $self=this;var i=c.item(b.positionItemIndex());var j=d.f(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.o(j);$ret.r(b);$ret.v(b.isExpandable());return $ret}();g=k;if(e){i.add(k);$.ig.TableViewHeadersFactory.prototype.v(b,c,d,true,k,f)}var l=null;if(b.isExpanded()){l=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(m){return m.parentKey()==b.key()}).toList$1($.ig.PositionItemInfo$2.prototype.$type)}if(l!=null&&l.count()>0){var n=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.l(true);$ret.r(b);$ret.v(b.isExpandable());return $ret}();i.add(n);var p=l.getEnumerator();while(p.moveNext()){var o=p.current();var q;var r;(function(){var $ret=$.ig.TableViewHeadersFactory.prototype.w(a,o,c,d,e,f,q,r);q=$ret.headerCellSource;r=$ret.totalSpan;return $ret.ret})();n.p().e(n.p().e()+r);if(q.l()){n.p().e(n.p().e()+1)}}n.p().e(n.p().e()-1);k.u(true);k.v(false);n.u(true);k.q(n);if(!e){i.add(k);$.ig.TableViewHeadersFactory.prototype.v(b,c,d,false,k,f)}n.s(k.s());g=n;h=k.p().e()+n.p().e()-1}else{if(b.isExpanded()){k.v(false)}if(!e){i.add(k);$.ig.TableViewHeadersFactory.prototype.v(b,c,d,false,k,f)}h=k.p().e()}return{headerCellSource:g,totalSpan:h}},$type:new $.ig.Type("TableViewHeadersFactory",$.ig.Object.prototype.$type,[$.ig.ITableViewHeadersFactory.prototype.$type])},true);$.ig.util.defType("TableCompactViewHeadersFactory","Object",{_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_i:null,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},init:function(a,b,c,d,e){$.ig.Object.prototype.init.call(this);this.f(a);this.g(b);this.h(c);this.i(d);this.j(e)},createHeaderCells:function(){var $self=this;if(this.f().positionResolver().hasUnregisterdPositions()){this.f().positionResolver().completeRegisterPositions()}var a=this.f().positionResolver().rootPositionInfo();var b=new $.ig.List$1($.ig.IList$1.prototype.$type.specialize($.ig.TableViewHeaderCellSource.prototype.$type),0);for(var c=0;c<a.positionSize();c++){b.add(new $.ig.List$1($.ig.TableViewHeaderCellSource.prototype.$type,0))}$.ig.TableCompactViewHeadersFactory.prototype.u(a,a.positionItemDepthMin(),b,this.i(),this.j());var d=new $.ig.ArrayListCollection$1($.ig.OlapTableViewHeaderCell.prototype.$type);var e=0;for(var f=0;f<a.positionSize();f++){var g=b.item(f);var h=0;var i=0;var k=g.getEnumerator();while(k.moveNext()){var j=k.current();var l;var m;var n;var o;if(this.h()==$.ig.HeaderCellsLayoutOrientation.prototype.horizontal){l=h;m=j.p().e();n=e;o=1}else{n=h;o=j.p().e();l=e;m=1}var p=this.f().tuples().__inner[j.r().positionIndex()];var q=p.item(j.r().positionItemIndex());var r=this.f().tuples().__inner[j.s()];if(this.g().positionResolver().hasUnregisterdPositions()){this.g().positionResolver().completeRegisterPositions()}var s=this.g().positionResolver().getPositionIndex(r);var t=function(){var $ret=new $.ig.OlapTableViewHeaderCell;$ret.axisName($self.f().name());$ret.hierarchyNumber(j.r().positionItemIndex());$ret.levelNumber(j.r().positionItemDepth());$ret.caption(q.caption());$ret.columnIndex(l);$ret.columnSpan(m);$ret.isExpanded(j.u());$ret.isExpandable(j.v());$ret.tupleIndex(s);$ret.memberIndex(j.r().positionItemIndex());$ret.rowIndex(n);$ret.rowSpan(o);return $ret}();if(!j.l()){h=h+j.p().e()}d.add(t)}e+=i+1}return d},u:function(a,b,c,d,e){var $self=this;var f=new $.ig.LevelSpanManager(a.positionSize());var i=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(g){return g.positionItemDepth()==b}).getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;(function(){var $ret=$.ig.TableCompactViewHeadersFactory.prototype.w(a,h,c,f,d,e,j,k);j=$ret.headerCellSource;k=$ret.totalSpan;return $ret.ret})()}},v:function(a,b,c,d,e,f){var $self=this;var h=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(g){return g.positionItemDepth()==a.positionItemDepthMin()}).toList$1($.ig.PositionItemInfo$2.prototype.$type);if(h.count()>0){var j=h.getEnumerator();while(j.moveNext()){var i=j.current();var k;var l;(function(){var $ret=$.ig.TableCompactViewHeadersFactory.prototype.w(a,i,b,c,d,f,k,l);k=$ret.headerCellSource;l=$ret.totalSpan;return $ret.ret})();e.p().e(e.p().e()+l);if(k.q()!=null){e.p().e(e.p().e()+1)}}e.p().e(e.p().e()-1)}else{f.add(a.positionIndex())}e.s(a.positionIndex())},w:function(a,b,c,d,e,f,g,h){var $self=this;var i=c.item(b.positionItemIndex());var j=d.f(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.o(j);$ret.r(b);$ret.v(b.isExpandable());return $ret}();g=k;if(e){i.add(k);$.ig.TableCompactViewHeadersFactory.prototype.v(b,c,d,true,k,f)}var l=null;if(b.isExpanded()){l=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(m){return m.parentKey()==b.key()}).toList$1($.ig.PositionItemInfo$2.prototype.$type)}if(l!=null&&l.count()>0){var n=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.l(true);$ret.r(b);$ret.v(b.isExpandable());return $ret}();var p=l.getEnumerator();while(p.moveNext()){var o=p.current();var q;var r;(function(){var $ret=$.ig.TableCompactViewHeadersFactory.prototype.w(a,o,c,d,e,f,q,r);q=$ret.headerCellSource;r=$ret.totalSpan;return $ret.ret})();n.p().e(n.p().e()+r);if(q.q()!=null){n.p().e(n.p().e()+1)}}n.p().e(n.p().e()-1);k.u(true);k.v(true);k.q(n);if(!e){i.add(k);$.ig.TableCompactViewHeadersFactory.prototype.v(b,c,d,false,k,f)}n.s(k.s());h=k.p().e()+n.p().e()-1}else{if(b.isExpanded()){k.v(false)}if(!e){i.add(k);$.ig.TableCompactViewHeadersFactory.prototype.v(b,c,d,false,k,f)}h=k.p().e()}return{headerCellSource:g,totalSpan:h}},$type:new $.ig.Type("TableCompactViewHeadersFactory",$.ig.Object.prototype.$type,[$.ig.ITableViewHeadersFactory.prototype.$type])},true);$.ig.util.defType("TableViewHeaderCellSource","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.p(new $.ig.SpanSource);this.o(new $.ig.SpanSource)},_l:null,l:function(a){if(arguments.length===1){this._l=a;return a}else{return this._l}},_m:null,m:function(a){if(arguments.length===1){this._m=a;return a}else{return this._m}},_n:null,n:function(a){if(arguments.length===1){this._n=a;return a}else{return this._n}},_o:null,o:function(a){if(arguments.length===1){this._o=a;return a}else{return this._o}},_p:null,p:function(a){if(arguments.length===1){this._p=a;return a}else{return this._p}},_q:null,q:function(a){if(arguments.length===1){this._q=a;return a}else{return this._q}},_r:null,r:function(a){if(arguments.length===1){this._r=a;return a}else{return this._r}},_s:null,s:function(a){if(arguments.length===1){this._s=a;return a}else{return this._s}},_t:null,t:function(a){if(arguments.length===1){this._t=a;return a}else{return this._t}},_u:null,u:function(a){if(arguments.length===1){this._u=a;return a}else{return this._u}},_v:null,v:function(a){if(arguments.length===1){this._v=a;return a}else{return this._v}},$type:new $.ig.Type("TableViewHeaderCellSource",$.ig.Object.prototype.$type)},true);
$.ig.util.defType("TableViewImpl","Object",{init:function(a,b,c,d){var $self=this;$.ig.Object.prototype.init.call(this);if(a==null){throw new $.ig.ArgumentNullException("result")}this.result(a);this.originalResult(a);if(d==null){this.viewSettings(new $.ig.TableViewSettings)}else{this.viewSettings(d)}this.hasColumns(b);this.hasRows(c);this.columnSortDirections(new $.ig.ArrayListCollection$1($.ig.TupleSortDirection.prototype.$type));this.columnSortDirections().collectionChanged=$.ig.Delegate.prototype.combine(this.columnSortDirections().collectionChanged,function(e,f){$self.u(true)});this.levelSortDirections(new $.ig.ArrayListCollection$1($.ig.LevelSortDirection.prototype.$type));this.levelSortDirections().collectionChanged=$.ig.Delegate.prototype.combine(this.levelSortDirections().collectionChanged,function(g,h){$self.u(true)});this.appliedColumnSortDirections(new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,0));this.appliedLevelSortDirections(new $.ig.List$1($.ig.LevelSortDirection.prototype.$type,0));this.appliedSortDirectionsMap(new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type)),0))},_viewSettings:null,viewSettings:function(a){if(arguments.length===1){this._viewSettings=a;return a}else{return this._viewSettings}},_result:null,result:function(a){if(arguments.length===1){this._result=a;return a}else{return this._result}},_originalResult:null,originalResult:function(a){if(arguments.length===1){this._originalResult=a;return a}else{return this._originalResult}},_hasRows:null,hasRows:function(a){if(arguments.length===1){this._hasRows=a;return a}else{return this._hasRows}},_hasColumns:null,hasColumns:function(a){if(arguments.length===1){this._hasColumns=a;return a}else{return this._hasColumns}},_r:null,r:function(a){if(arguments.length===1){this._r=a;return a}else{return this._r}},_s:null,s:function(a){if(arguments.length===1){this._s=a;return a}else{return this._s}},_t:null,t:function(a){if(arguments.length===1){this._t=a;return a}else{return this._t}},_u:null,u:function(a){if(arguments.length===1){this._u=a;return a}else{return this._u}},a:null,b:null,c:null,rowHeaders:function(a){if(arguments.length===1){this.a=a;return a}else{if(!this.t()||this.u()){this.initialize()}return this.a}},columnHeaders:function(a){if(arguments.length===1){this.b=a;return a}else{if(!this.t()||this.u()){this.initialize()}return this.b}},resultCells:function(a){if(arguments.length===1){this.c=a;return a}else{if(!this.t()||this.u()){this.initialize()}return this.c}},_columnSortDirections:null,columnSortDirections:function(a){if(arguments.length===1){this._columnSortDirections=a;return a}else{return this._columnSortDirections}},_levelSortDirections:null,levelSortDirections:function(a){if(arguments.length===1){this._levelSortDirections=a;return a}else{return this._levelSortDirections}},_appliedColumnSortDirections:null,appliedColumnSortDirections:function(a){if(arguments.length===1){this._appliedColumnSortDirections=a;return a}else{return this._appliedColumnSortDirections}},_appliedLevelSortDirections:null,appliedLevelSortDirections:function(a){if(arguments.length===1){this._appliedLevelSortDirections=a;return a}else{return this._appliedLevelSortDirections}},_appliedSortDirectionsMap:null,appliedSortDirectionsMap:function(a){if(arguments.length===1){this._appliedSortDirectionsMap=a;return a}else{return this._appliedSortDirectionsMap}},initialize:function(){var $self=this;this.r(null);this.s(null);this.rowHeaders(null);this.columnHeaders(null);this.resultCells(null);this.result(this.originalResult());if(this.result().isEmpty()){this.u(false);this.t(true);return}if(this.levelSortDirections().count()>0){var a=new $.ig.ResultHeaderSorter(this.result(),this.hasRows(),this.hasColumns(),this.levelSortDirections());this.result(a.m());this.appliedLevelSortDirections(a.r());this.appliedSortDirectionsMap(a.s())}else{this.appliedLevelSortDirections(new $.ig.List$1($.ig.LevelSortDirection.prototype.$type,0));this.appliedSortDirectionsMap(new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type)),0))}if(this.hasRows()&&this.columnSortDirections().count()>0){if(this.appliedLevelSortDirections().count()>0){if(this.originalResult().axes().item(0).positionResolver().hasUnregisterdPositions()){this.originalResult().axes().item(0).positionResolver().completeRegisterPositions()}if(this.result().axes().item(0).positionResolver().hasUnregisterdPositions()){this.result().axes().item(0).positionResolver().completeRegisterPositions()}var b=new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,2,this.columnSortDirections().count());var c=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,1,this.appliedColumnSortDirections().count());var e=this.columnSortDirections().getEnumerator();while(e.moveNext()){var d=e.current();var f=this.originalResult().axes().item(0).tuples().__inner[d.tupleIndex()];var g=this.result().axes().item(0).positionResolver().getPositionIndex(f);var h=new $.ig.TupleSortDirection;h.sortDirection(d.sortDirection());h.tupleIndex(g);h.comparer(d.comparer());b.add(h);c.item(g,d.tupleIndex())}var i=new $.ig.ResultColumnValueSorter(this.result(),this.hasRows(),this.hasColumns(),b);this.result(i.m());var k=i.q().getEnumerator();while(k.moveNext()){var j=k.current();j.tupleIndex(c.item(j.tupleIndex()))}this.appliedColumnSortDirections(i.q())}else{var l=new $.ig.ResultColumnValueSorter(this.result(),this.hasRows(),this.hasColumns(),this.columnSortDirections());this.result(l.m());this.appliedColumnSortDirections(l.q())}}else{this.appliedColumnSortDirections(new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,0))}var m=0;var n=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var o=1;if(this.hasColumns()){var p=this.result().axes().item(m);var q=this.originalResult().axes().item(m);var r=this.ap(p,q);for(var s=0;s<r.count();s++){var t=r.item(s);n.add(t,s)}m++;o=p.tuples().count()}var u=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);if(this.hasRows()){var v=this.result().axes().item(m);var w=this.originalResult().axes().item(m);var x=this.aq(v,w);for(var y=0;y<x.count();y++){var z=x.item(y);u.add(z,y)}}var aa=new $.ig.ArrayListCollection$1($.ig.OlapTableViewResultCell.prototype.$type);for(var ab=0;ab<this.result().cells().count();ab++){var ac=this.result().cells().item(ab);var ad;(function(){var $ret=ac.properties().tryGetValue("Value",ad);ad=$ret.value;return $ret.ret})();var ae;(function(){var $ret=ac.properties().tryGetValue("FmtValue",ae);ae=$ret.value;return $ret.ret})();var af=ac.cellOrdinal();if(this.hasColumns()){var ag=af%o;var ah=n.item(ag);if(ag!=ah){var ai=$.ig.intDivide(af,o);af=ai*o+ah}}if(this.hasRows()){var aj=$.ig.intDivide(af,o);var ak=u.item(aj);if(aj!=ak){var al=af%o;af=ak*o+al}}aa.add(function(){var $ret=new $.ig.OlapTableViewResultCell;$ret.value(ad);$ret.formattedValue(ae);$ret.cellOrdinal(af);$ret.resultCellIndex(ab);return $ret}());this.resultCells(aa)}this.u(false);this.t(true)},ap:function(a,b){var c=new $.ig.List$1($.ig.Number.prototype.$type,0);if(this.viewSettings().h()){this.s(new $.ig.TableCompactViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.horizontal,this.viewSettings().e(),c))}else{this.s(new $.ig.TableViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.horizontal,this.viewSettings().e(),c))}this.columnHeaders(this.s().createHeaderCells());return c},aq:function(a,b){var c=new $.ig.List$1($.ig.Number.prototype.$type,0);if(this.viewSettings().g()){this.r(new $.ig.TableCompactViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.vertical,this.viewSettings().f(),c))}else{this.r(new $.ig.TableViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.vertical,this.viewSettings().f(),c))}this.rowHeaders(this.r().createHeaderCells());return c},$type:new $.ig.Type("TableViewImpl",$.ig.Object.prototype.$type)},true);$.ig.util.defType("TableViewSettings","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},$type:new $.ig.Type("TableViewSettings",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapResultView","Object",{init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);if(a==null){throw new $.ig.ArgumentNullException("result")}this.result(a);this.visibleResult(b);this.hasColumns(c);this.hasRows(d)},_result:null,result:function(a){if(arguments.length===1){this._result=a;return a}else{return this._result}},_visibleResult:null,visibleResult:function(a){if(arguments.length===1){this._visibleResult=a;return a}else{return this._visibleResult}},_hasRows:null,hasRows:function(a){if(arguments.length===1){this._hasRows=a;return a}else{return this._hasRows}},_hasColumns:null,hasColumns:function(a){if(arguments.length===1){this._hasColumns=a;return a}else{return this._hasColumns}},i:function(a,b,c,d,e){var $self=this;var f=0;var g=null;var h=1;if(e){g=a.axes().item(f);h=g.tuples().count();f++}var i=null;var j=1;if(d){i=a.axes().item(f);j=i.tuples().count()}var k=1;if(b!=null){k=b.tuples().count()}var l=1;if(c!=null){l=c.tuples().count()}var m=new Array(k*l);if(a.cells().count()>0){var n=0;var o=a.cells().item(n);for(var p=0;p<j;p++){var q=$.ig.intDivide(o.cellOrdinal(),h);if(q!=p){continue}var r=0;if(b!=null&&i!=null){var s=i.tuples().__inner[p];r=b.positionResolver().getPositionIndex(s)}if(r==-1){while(q==p){n++;if(n<a.cells().count()){o=a.cells().item(n);q=$.ig.intDivide(o.cellOrdinal(),h)}else{break}}continue}var t=o.cellOrdinal()%h;for(var u=0;u<h;u++){if(t!=u){continue}var v=-1;if(c==null||g==null){v=0}else{var w=g.tuples().__inner[u];v=c.positionResolver().getPositionIndex(w)}if(v==-1){n++;if(n<a.cells().count()){o=a.cells().item(n);q=$.ig.intDivide(o.cellOrdinal(),h);if(q>p){break}t=o.cellOrdinal()%h}continue}var x=o.clone();x.cellOrdinal(r*l+v);m[x.cellOrdinal()]=x;n++;if(n<a.cells().count()){o=a.cells().item(n);q=$.ig.intDivide(o.cellOrdinal(),h);if(q>p){break}t=o.cellOrdinal()%h}}}}var y=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,0);for(var aa=0;aa<m.length;aa++){var z=m[aa];if(z!=null){y.add(z)}}var ab=new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0);if(e){ab.add(c)}if(d){ab.add(b)}return function(){var $ret=new $.ig.OlapResult;$ret.axes(ab);$ret.cells(y);$ret.isEmpty(!d&&!e&&y.count()==0);return $ret}()},j:function(a,b,c){var $self=this;var d=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);if(c){for(var e=0;e<b.count();e++){var f=b.item(e);d.add(a.tuples().__inner[f].clone())}}else{var g=0;var h=b.item(g);for(var i=0;i<a.tuples().count();i++){if(i==h){g++;if(g<b.count()){h=b.item(g)}}else{d.add(a.tuples().__inner[i].clone())}}}var j=function(){var $ret=new $.ig.OlapResultAxis(d,a.tupleSize());$ret.name(a.name());return $ret}();return j},expandTupleMember:function(a,b,c){var $self=this;var d=this.o(a,b,c,this.visibleResult());if(d==null){return null}if(!d.isExpandable()){throw new $.ig.InvalidOperationException(1,"The position is not expandable.")}if(d.isExpanded()){return this}var f=this.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(e){return e.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var h=this.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(g){return g.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var i=a=="Axis0"&&!this.hasColumns()||a=="Axis1"&&this.hasRows();var j=f.tuples().__inner[b];var k=h.positionResolver().getPositionIndex(j);var l=this.n(a,k,c,this.result());if(l.count()==0){return null}var m=null;var n=null;if(i){m=this.j(h,l,true);if(this.hasColumns()){n=this.visibleResult().axes().item(0)}}else{n=this.j(h,l,true);if(this.hasRows()){m=this.visibleResult().axes().item(1)}}var o=this.i(this.result(),m,n,this.hasRows(),this.hasColumns());var p=this.k(this.visibleResult(),o,h.name());return new $.ig.OlapResultView(this.result(),p,this.hasColumns(),this.hasRows())},collapseTupleMember:function(a,b,c){var $self=this;var d=this.o(a,b,c,this.visibleResult());if(d==null){return null}if(!d.isExpandable()){throw new $.ig.InvalidOperationException(1,"The position is not expandable.")}if(!d.isExpanded()){return this}var e=this.n(a,b,c,this.visibleResult());if(e.count()==0){return null}var g=this.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var h=a=="Axis0"&&!this.hasColumns()||a=="Axis1"&&this.hasRows();var i=null;var j=null;if(h){i=this.j(g,e,false);if(this.hasColumns()){j=this.visibleResult().axes().item(0)}}else{j=this.j(g,e,false);if(this.hasRows()){i=this.visibleResult().axes().item(1)}}var l=this.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(k){return k.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var m=l.tuples().__inner[b];if(l.positionResolver().hasUnregisterdPositions()){l.positionResolver().completeRegisterPositions()}var n=l.positionResolver().getHostPositionItemInfo(m,c);var o=n.item(m.item(c).key());o.isExpanded(false);var p=this.i(this.visibleResult(),i,j,this.hasRows(),this.hasColumns());return new $.ig.OlapResultView(this.result(),p,this.hasColumns(),this.hasRows())},extend:function(a,b){var $self=this;var d=this.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(c){return c.name()==b}).first$1($.ig.OlapResultAxis.prototype.$type);var e=b=="Axis0"&&!this.hasColumns()||b=="Axis1"&&this.hasRows();var f=null;var g=null;var h=null;var i=false;if(e){f=d;if(this.hasColumns()){g=this.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(j){return j.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);h=this.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(k){return k.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);i=g.tuples().count()!=h.tuples().count()}}else{g=d;if(this.hasRows()){f=this.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(l){return l.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);h=this.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(m){return m.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);i=f.tuples().count()!=h.tuples().count()}}var n=null;var o=null;if(h!=null&&i){var p=this.i(this.result(),f,g,this.hasRows(),this.hasColumns());n=this.k(p,a,b);o=this.k(p,a,b)}else{n=this.k(this.result(),a,b);o=this.k(this.visibleResult(),a,b)}return new $.ig.OlapResultView(n,o,this.hasColumns(),this.hasRows())},k:function(a,b,c){var $self=this;var e=a.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(d){return d.name()==c}).first$1($.ig.OlapResultAxis.prototype.$type);if(e==null){return null}var g=b.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==c}).first$1($.ig.OlapResultAxis.prototype.$type);var h=c=="Axis0"&&!this.hasColumns()||c=="Axis1"&&this.hasRows();var i=null;var j=null;if(h){if(this.hasColumns()){i=a.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(k){return k.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type);j=b.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(l){return l.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type)}}else{if(this.hasRows()){i=a.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(m){return m.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type);j=b.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(n){return n.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type)}}var o=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);var q=e.tuples().getEnumerator();while(q.moveNext()){var p=q.current();o.add(p.clone())}var s=g.tuples().getEnumerator();while(s.moveNext()){var r=s.current();o.add(r)}var t=g.tuples().count();var u=j!=null&&j.tuples().count()>0?j.tuples().count():1;var v=e.tuples().count()>0?e.tuples().count():1;var w=i!=null&&i.tuples().count()>0?i.tuples().count():1;var x=v*w;var y=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,0);if(h){var aa=a.cells().getEnumerator();while(aa.moveNext()){var z=aa.current();y.add(z.clone())}var ab=new Array(t*w);var ac=v*w;var ae=b.cells().getEnumerator();while(ae.moveNext()){var ad=ae.current();var af=ad.clone();var ag=this.l(af.cellOrdinal(),i,j);var ah=$.ig.intDivide(af.cellOrdinal(),u);af.cellOrdinal(ah*w+ag);af.cellOrdinal(af.cellOrdinal()+x);ab[af.cellOrdinal()-ac]=af}for(var ai=0;ai<ab.length;ai++){var aj=ab[ai];if(aj!=null){y.add(aj)}}}else{var ak=new Array(w*(v+t));var am=a.cells().getEnumerator();while(am.moveNext()){var al=am.current();var an=al.clone();var ao=$.ig.intDivide(an.cellOrdinal(),v);an.cellOrdinal(an.cellOrdinal()+ao*t);ak[an.cellOrdinal()]=an}var aq=b.cells().getEnumerator();while(aq.moveNext()){var ap=aq.current();var ar=ap.clone();var as=this.m(ar.cellOrdinal(),i,j,t);var at=$.ig.intDivide(ap.cellOrdinal(),t);if(as!=at){}var au=ar.cellOrdinal()%t;ar.cellOrdinal(as*t+au);ar.cellOrdinal(ar.cellOrdinal()+(as+1)*v);ak[ar.cellOrdinal()]=ar}for(var aw=0;aw<ak.length;aw++){var av=ak[aw];if(av!=null){y.add(av)}}}var ax=new $.ig.OlapResult;ax.axes(new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0));var ay=function(){var $ret=new $.ig.OlapResultAxis(o,e.tupleSize());$ret.name(e.name());return $ret}();if(h){if(i!=null){ax.axes().add(i)}ax.axes().add(ay)}else{ax.axes().add(ay);if(i!=null){ax.axes().add(i)}}ax.cells(y);ax.isEmpty(!this.hasColumns()&&!this.hasRows()&&y.count()==0);return ax},l:function(a,b,c){if(c==null){return 0}var d=a%c.tuples().count();var e=c.tuples().__inner[d];var f=b.positionResolver().getPositionIndex(e);return f},m:function(a,b,c,d){if(c==null){return 0}var e=$.ig.intDivide(a,d);var f=c.tuples().__inner[e];var g=b.positionResolver().getPositionIndex(f);return g},n:function(a,b,c,d){var $self=this;var f=d.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(e){return e.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var g=f.tuples().__inner[b];var h=g.item(c);if(f.positionResolver().hasUnregisterdPositions()){f.positionResolver().completeRegisterPositions()}var i=f.positionResolver().n(h,$.ig.ListSortDirection.prototype.ascending);if(i!=null){return i.toList$1($.ig.Number.prototype.$type)}return null},o:function(a,b,c,d){var $self=this;var f=d.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(e){return e.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var g=f.tuples().__inner[b];var h=g.item(c);if(f.positionResolver().hasUnregisterdPositions()){f.positionResolver().completeRegisterPositions()}var i=f.positionResolver().getHostPositionItemInfo(g,c);var j;(function(){var $ret=i.tryGetValue(h.key(),j);j=$ret.value;return $ret.ret})();return j},$type:new $.ig.Type("OlapResultView",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ResultViewHelper","Object",{init:function(){$.ig.Object.prototype.init.call(this)},a:function(a,b,c,d,e){$.ig.ResultViewHelper.prototype.c(a,b,c,true,e.visibleResult());$.ig.ResultViewHelper.prototype.c(a,b,c,true,e.result())},b:function(a,b,c){var $self=this;var e=b.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(d){return d.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var g=c.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);$.ig.ResultViewHelper.prototype.e(e.positionResolver(),g.positionResolver());var i=b.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(h){return h.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var k=c.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(j){return j.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);$.ig.ResultViewHelper.prototype.e(i.positionResolver(),k.positionResolver())},c:function(a,b,c,d,e){var $self=this;var g=e.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);if(g.positionResolver().hasUnregisterdPositions()){g.positionResolver().completeRegisterPositions()}$.ig.ResultViewHelper.prototype.d(b,c,d,g.positionResolver())},d:function(a,b,c,d){if(d.hasUnregisterdPositions()){d.completeRegisterPositions()}var e=d.positions().__inner[a];var f=d.getHostPositionItemInfo(e,b);var g=f.item(e.item(b).key());g.isExpanded(c)},e:function(a,b){if(a.hasUnregisterdPositions()){a.completeRegisterPositions()}if(b.hasUnregisterdPositions()){b.completeRegisterPositions()}$.ig.ResultViewHelper.prototype.f(a.rootPositionInfo(),b.rootPositionInfo())},f:function(a,b){var $self=this;var d=a.getEnumerator();while(d.moveNext()){var c=d.current();var e=c.value();var f;if(function(){var $ret=b.tryGetValue(c.key(),f);f=$ret.value;return $ret.ret}()){if(e.isExpanded()!=true){f.isExpanded(false)}if(f.count()>0){$.ig.ResultViewHelper.prototype.f(e,f)}}}},$type:new $.ig.Type("ResultViewHelper",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapTableViewHeaderCell","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.columnSpan(1);this.rowSpan(1)},_id:null,id:function(a){if(arguments.length===1){this._id=a;return a}else{return this._id}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_isExpanded:null,isExpanded:function(a){if(arguments.length===1){this._isExpanded=a;return a}else{return this._isExpanded}},_isExpandable:null,isExpandable:function(a){if(arguments.length===1){this._isExpandable=a;return a}else{return this._isExpandable}},_rowIndex:null,rowIndex:function(a){if(arguments.length===1){this._rowIndex=a;return a}else{return this._rowIndex}},_rowSpan:null,rowSpan:function(a){if(arguments.length===1){this._rowSpan=a;return a}else{return this._rowSpan}},_columnIndex:null,columnIndex:function(a){if(arguments.length===1){this._columnIndex=a;return a}else{return this._columnIndex}},_columnSpan:null,columnSpan:function(a){if(arguments.length===1){this._columnSpan=a;return a}else{return this._columnSpan}},_axisName:null,axisName:function(a){if(arguments.length===1){this._axisName=a;return a}else{return this._axisName}},_tupleIndex:null,tupleIndex:function(a){if(arguments.length===1){this._tupleIndex=a;return a}else{return this._tupleIndex}},_memberIndex:null,memberIndex:function(a){if(arguments.length===1){this._memberIndex=a;return a}else{return this._memberIndex}},_levelNumber:null,levelNumber:function(a){if(arguments.length===1){this._levelNumber=a;return a}else{return this._levelNumber}},_hierarchyNumber:null,hierarchyNumber:function(a){if(arguments.length===1){this._hierarchyNumber=a;return a}else{return this._hierarchyNumber}},toString:function(){return this.caption()},$type:new $.ig.Type("OlapTableViewHeaderCell",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapTableViewResultCell","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_value:null,value:function(a){if(arguments.length===1){this._value=a;return a}else{return this._value}},_formattedValue:null,formattedValue:function(a){if(arguments.length===1){this._formattedValue=a;return a}else{return this._formattedValue}},_cellOrdinal:null,cellOrdinal:function(a){if(arguments.length===1){this._cellOrdinal=a;return a}else{return this._cellOrdinal}},_resultCellIndex:null,resultCellIndex:function(a){if(arguments.length===1){this._resultCellIndex=a;return a}else{return this._resultCellIndex}},$type:new $.ig.Type("OlapTableViewResultCell",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ArrayListCollection$1","Object",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.inner(new $.ig.Array)},_inner:null,inner:function(a){if(arguments.length===1){this._inner=a;return a}else{return this._inner}},collectionChanged:null,indexOf:function(a){return this.inner().indexOf(a)},insert:function(a,b){this.inner().insert(a,b);this.e(a,b)},removeAt:function(a){var b=this.inner()[a];this.inner().removeAt(a);this.f(a,b)},item:function(b,a){if(arguments.length===2){this.inner()[b]=a;return a}else{return this.inner()[b]}},add:function(a){this.inner().add(a);this.e(this.inner().length-1,a)},clear:function(){this.inner().clear();this.g()},contains:function(a){return this.inner().contains(a)},copyTo:function(a,b){throw new $.ig.NotImplementedException},count:function(){return this.inner().length},isReadOnly:function(){return false},remove:function(a){var b=this.inner().indexOf(a);if(b>=0){this.inner().removeAt(b);this.f(b,a);return true}return false},d:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$a=0;this.$state=5;break;case 2:this.$current=this.$this.inner()[this.$a];this.$state=3;return true;case 3:this.$state=4;break;case 4:this.$a++;this.$state=5;break;case 5:if(this.$a<this.$this.inner().length){this.$state=2}else{this.$state=6}break;case 6:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1(this.$t,$iter)},getEnumerator:function(){return this.d().getEnumerator()},e:function(a,b){if(this.collectionChanged!=null){var c=new $.ig.NotifyCollectionChangedEventArgs(1,$.ig.NotifyCollectionChangedAction.prototype.add,b,a);this.collectionChanged(this,c)}},f:function(a,b){if(this.collectionChanged!=null){var c=new $.ig.NotifyCollectionChangedEventArgs(1,$.ig.NotifyCollectionChangedAction.prototype.remove,b,a);this.collectionChanged(this,c)}},g:function(){if(this.collectionChanged!=null){var a=new $.ig.NotifyCollectionChangedEventArgs(1,$.ig.NotifyCollectionChangedAction.prototype.reset,null,-1);this.collectionChanged(this,a)}},$type:new $.ig.Type("ArrayListCollection$1",$.ig.Object.prototype.$type,[$.ig.IList$1.prototype.$type.specialize(0),$.ig.INotifyCollectionChanged.prototype.$type])},true);$.ig.util.defType("IOlapDataSource","Object",{$type:new $.ig.Type("IOlapDataSource",null)},true);$.ig.util.defType("MeasureList","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},$type:new $.ig.Type("MeasureList",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("OlapMetadataTreeItem","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_item:null,item:function(a){if(arguments.length===1){this._item=a;return a}else{return this._item}},_type:null,type:function(a){if(arguments.length===1){this._type=a;return a}else{return this._type}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_children:null,children:function(a){if(arguments.length===1){this._children=a;return a}else{return this._children}},e:function(a){if(this.children()==null){this.children(new Array(1));this.children()[0]=a;return}var b=new Array(this.children().length+1);$.ig.Array.prototype.copy(this.children(),0,b,0,this.children().length);b[this.children().length]=a;this.children(b)},$type:new $.ig.Type("OlapMetadataTreeItem",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MetaTreeHelper","Object",{init:function(){$.ig.Object.prototype.init.call(this)},getDimensionMetaItems:function(a,b,c,d,e){var $self=this;var f=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);var g=new $.ig.HierarchyItemPosition;g.c(0);g.d(0);var h=new $.ig.List$1($.ig.Hierarchy.prototype.$type,0);var j=c.getEnumerator();while(j.moveNext()){var i=j.current();h.add(i)}var k=new $.ig.List$1($.ig.Level.prototype.$type,0);var m=d.getEnumerator();while(m.moveNext()){var l=m.current();k.add(l)}var o=a.getEnumerator();while(o.moveNext()){var n=o.current();var p=$.ig.MetaTreeHelper.prototype.l(h,k,n,g);if(n.dimensionType()!=$.ig.DimensionType.prototype.measure){var q=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.dimension);$ret.caption(n.caption());$ret.item(n);return $ret}();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(q,p);f.add(q)}else{var r=$.ig.MetaTreeHelper.prototype.n(b,n,e);f.insert(0,r)}}return f},setMetaItemChildren:function(a,b){var $self=this;if(b.count()>0){var e=b.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(c){return c.type()==$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(d){return d.caption()}).toArray$1($.ig.OlapMetadataTreeItem.prototype.$type);var g=b.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(f){return f.type()!=$.ig.OlapMetadataTreeItemType.prototype.group}).toArray$1($.ig.OlapMetadataTreeItem.prototype.$type);var h=new Array(e.length+g.length);for(var i=0;i<e.length;i++){h[i]=e[i]}for(var j=0;j<g.length;j++){h[e.length+j]=g[j]}a.children(h)}},l:function(a,b,c,d){var $self=this;var e=new $.ig.Dictionary$2(String,$.ig.Tuple$2.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type)),0);var f=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);var g=a.item(d.c());while(g.dimensionUniqueName()!=c.uniqueName()){d.c(d.c()+1);g=a.item(d.c())}while(g.dimensionUniqueName()==c.uniqueName()){var h=null;if(!String.isNullOrEmpty(g.hierarchyDisplayFolder())){var i=String.empty();var j=$.ig.MetaTreeHelper.prototype.o(g.hierarchyDisplayFolder());for(var k=0;k<j.length;k++){var l=j[k];i+=l+"\\";var m;if(!function(){var $ret=e.tryGetValue(i,m);m=$ret.value;return $ret.ret}()){var n=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.group);$ret.caption(l);return $ret}();m=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),n,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0));e.add(i,m);if(h!=null){h.d().add(n)}else{f.add(n)}}h=m}}var o;switch(g.hierarchyOrigin()){case $.ig.HierarchyOrigin.prototype.systemEnabled:o=$.ig.OlapMetadataTreeItemType.prototype.systemEnabledHierarchy;break;case $.ig.HierarchyOrigin.prototype.userDefined:o=$.ig.OlapMetadataTreeItemType.prototype.userDefinedHierarchy;break;default:o=$.ig.OlapMetadataTreeItemType.prototype.parentChildHierarchy;break}var p=$.ig.MetaTreeHelper.prototype.m(b,g,d);var q=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type(o);$ret.caption(g.caption());$ret.item(g);return $ret}();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(q,p);if(h!=null){h.d().add(q)}else{f.add(q)}if(d.c()+1>=a.count()){break}d.c(d.c()+1);g=a.item(d.c())}var s=e.values().getEnumerator();while(s.moveNext()){var r=s.current();var t=r.c();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(t,r.d())}return f},m:function(a,b,c){var $self=this;var d=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);if(a==null||a.count()==0){return d}var e=a.item(c.d());while(e.hierarchyUniqueName()!=b.uniqueName()){c.d(c.d()+1);
e=a.item(c.d())}while(e.hierarchyUniqueName()==b.uniqueName()){var f;switch(e.depth()){case 0:case 1:f=$.ig.OlapMetadataTreeItemType.prototype.level1;break;case 2:f=$.ig.OlapMetadataTreeItemType.prototype.level2;break;case 3:f=$.ig.OlapMetadataTreeItemType.prototype.level3;break;case 4:f=$.ig.OlapMetadataTreeItemType.prototype.level4;break;default:f=$.ig.OlapMetadataTreeItemType.prototype.level5;break}var g=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type(f);$ret.caption(e.caption());$ret.item(e);return $ret}();d.add(g);if(c.d()+1>=a.count()){break}c.d(c.d()+1);e=a.item(c.d())}return d},n:function(a,b,c){var $self=this;var d=new $.ig.Dictionary$2(String,$.ig.Tuple$2.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type)),0);var e=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.measure);$ret.caption(b.caption());$ret.item(b);return $ret}();var f=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),e,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0));var h=a.getEnumerator();while(h.moveNext()){var g=h.current();var i=f;if(!String.isNullOrEmpty(g.measureGroupName())){if(!function(){var $ret=d.tryGetValue(g.measureGroupName(),i);i=$ret.value;return $ret.ret}()){var j=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.group);$ret.caption(g.measureGroupName());return $ret}();i=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),j,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0));d.add(g.measureGroupName(),i);f.d().add(i.c())}}var k=i;if(!String.isNullOrEmpty(g.measureDisplayFolder())){var l=g.measureGroupName();var m=$.ig.MetaTreeHelper.prototype.o(g.measureDisplayFolder());for(var n=0;n<m.length;n++){var o=m[n];l+="\\"+o;var p;if(!function(){var $ret=d.tryGetValue(l,p);p=$ret.value;return $ret.ret}()){var q=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.group);$ret.caption(o);return $ret}();p=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),q,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0));d.add(l,p);k.d().add(q)}k=p}}var r=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.measure);$ret.caption(g.caption());$ret.item(g);return $ret}();k.d().add(r)}var s=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);var w=f.d().where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(t){return t.type()==$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(u){return u.caption()}).getEnumerator();while(w.moveNext()){var v=w.current();s.add(v)}var aa=f.d().where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(x){return x.type()!=$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(y){return y.caption()}).getEnumerator();while(aa.moveNext()){var z=aa.current();s.add(z)}$.ig.MetaTreeHelper.prototype.setMetaItemChildren(e,s);var ac=d.values().getEnumerator();while(ac.moveNext()){var ab=ac.current();var ad=ab.d();var ag=ad.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(ae){return ae.type()==$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(af){return af.caption()}).toList$1($.ig.OlapMetadataTreeItem.prototype.$type);var aj=ad.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(ah){return ah.type()!=$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(ai){return ai.caption()}).toList$1($.ig.OlapMetadataTreeItem.prototype.$type);var ak=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);for(var al=0;al<ag.count();al++){ak.add(ag.item(al))}for(var am=0;am<aj.count();am++){ak.add(aj.item(am))}var an=ab.c();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(an,ak)}return e},o:function(a){var b=a.split("\\");return b},$type:new $.ig.Type("MetaTreeHelper",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyItemPosition","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},$type:new $.ig.Type("HierarchyItemPosition",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureGroupMetaItemsCache","Object",{a:null,b:null,c:null,d:null,e:null,init:function(a,b,c){$.ig.Object.prototype.init.call(this);this.a=new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Dimension.prototype.$type),0);this.b=new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Measure.prototype.$type),0);this.c=c;this.d=a;this.e=b},getMeasureGroupDimensions:function(a){var $self=this;var b;if(!function(){var $ret=$self.a.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){var c=new $.ig.List$1(String,0);var e=this.c.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d.dimensionUniqueName())}}var f=new $.ig.List$1($.ig.Dimension.prototype.$type,0);var h=this.d.getEnumerator();while(h.moveNext()){var g=h.current();if(c.contains(g.uniqueName())||g.dimensionType()==$.ig.DimensionType.prototype.measure){f.add(g)}}this.a.add(a,f);b=f}return b},getMeasureGroupMeasures:function(a){var $self=this;var b;if(!function(){var $ret=$self.b.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){var c=new $.ig.List$1($.ig.Measure.prototype.$type,0);var e=this.e.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d)}}this.b.add(a,c);b=c}return b},$type:new $.ig.Type("MeasureGroupMetaItemsCache",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DataSourceBaseOptions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},_filters:null,filters:function(a){if(arguments.length===1){this._filters=a;return a}else{return this._filters}},_columns:null,columns:function(a){if(arguments.length===1){this._columns=a;return a}else{return this._columns}},_rows:null,rows:function(a){if(arguments.length===1){this._rows=a;return a}else{return this._rows}},$type:new $.ig.Type("DataSourceBaseOptions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CubeMetaItemsCache","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.a=new $.ig.Dictionary$2(String,$.ig.Tuple$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.Member.prototype.$type),0);this.b=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Member.prototype.$type,0);this.c=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.Member.prototype.$type),0);this.d=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.Member.prototype.$type),0);this.e=new $.ig.Dictionary$2(String,$.ig.Measure.prototype.$type,0);this.f=new $.ig.Dictionary$2(String,$.ig.Boolean.prototype.$type,0);this.g=new $.ig.Dictionary$2(String,$.ig.Boolean.prototype.$type,0)},a:null,b:null,c:null,d:null,e:null,f:null,g:null,_n:null,n:function(a){if(arguments.length===1){this._n=a;return a}else{return this._n}},_o:null,o:function(a){if(arguments.length===1){this._o=a;return a}else{return this._o}},_p:null,p:function(a){if(arguments.length===1){this._p=a;return a}else{return this._p}},_q:null,q:function(a){if(arguments.length===1){this._q=a;return a}else{return this._q}},_r:null,r:function(a){if(arguments.length===1){this._r=a;return a}else{return this._r}},_s:null,s:function(a){if(arguments.length===1){this._s=a;return a}else{return this._s}},af:function(a){var $self=this;var b;if(!function(){var $ret=$self.f.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){return false}return b},ag:function(a){this.f.item(a,true)},ah:function(a){var $self=this;var b;if(!function(){var $ret=$self.g.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){return false}return b},ai:function(a){var $self=this;this.g.item(a,true);var d=this.q().where$1($.ig.Level.prototype.$type,function(b){return b.hierarchyUniqueName()==a}).getEnumerator();while(d.moveNext()){var c=d.current();this.ag(c.uniqueName())}},aj:function(a){return this.d.containsKey(a)},ak:function(a){var $self=this;var b;if(!function(){var $ret=$self.a.tryGetValue(a.uniqueName(),b);b=$ret.value;return $ret.ret}()){var c=this.a.count();b=new $.ig.Tuple$2($.ig.Number.prototype.$type,$.ig.Member.prototype.$type,c,a);this.a.item(a.uniqueName(),b);this.b.item(c,a);var d;if(!function(){var $ret=$self.c.tryGetValue(a.levelUniqueName(),d);d=$ret.value;return $ret.ret}()){d=new $.ig.ArrayListCollection$1($.ig.Member.prototype.$type);this.c.item(a.levelUniqueName(),d)}if(!String.isNullOrEmpty(a.parentUniqueName())){var e;if(!function(){var $ret=$self.d.tryGetValue(a.parentUniqueName(),e);e=$ret.value;return $ret.ret}()){e=new $.ig.List$1($.ig.Member.prototype.$type,0);this.d.item(a.parentUniqueName(),e)}e.add(a)}d.add(a)}return b.c()},al:function(a,b){var $self=this;var c;if(function(){var $ret=$self.a.tryGetValue(a,c);c=$ret.value;return $ret.ret}()){b=c.c();return{ret:true,memberOrdinal:b}}b=-1;return{ret:false,memberOrdinal:b};return{memberOrdinal:b}},am:function(a,b){var $self=this;var c;if(function(){var $ret=$self.a.tryGetValue(a,c);c=$ret.value;return $ret.ret}()){b=c.d();return{ret:true,member:b}}b=null;return{ret:false,member:b};return{member:b}},an:function(a,b){var $self=this;return{ret:function(){var $ret=$self.b.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),member:b};return{member:b}},ao:function(a,b){var $self=this;return{ret:function(){var $ret=$self.d.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),members:b};return{members:b}},ap:function(a,b){var $self=this;return{ret:function(){var $ret=$self.c.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),members:b};return{members:b}},aq:function(a,b){var $self=this;if(!function(){var $ret=$self.e.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){b=this.n().where$1($.ig.Measure.prototype.$type,function(c){return c.uniqueName()==a}).firstOrDefault$1($.ig.Measure.prototype.$type);if(b==null){return{ret:false,measure:b}}this.e.add(a,b)}return{ret:true,measure:b};return{measure:b}},$type:new $.ig.Type("CubeMetaItemsCache",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AxisDefinitionParser","Object",{init:function(a){$.ig.Object.prototype.init.call(this);this.l(-1);this.m(a)},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},_k:null,k:function(a){if(arguments.length===1){this._k=a;return a}else{return this._k}},_l:null,l:function(a){if(arguments.length===1){this._l=a;return a}else{return this._l}},_m:null,m:function(a){if(arguments.length===1){this._m=a;return a}else{return this._m}},v:function(){if(this.l()==this.m().length-1){return false}var a=-1;var b=-1;var c=false;while(this.l()+1<this.m().length){this.l(this.l()+1);var d=this.m().substr(this.l(),1);switch(d){case $.ig.AxisDefinitionParser.prototype.a:if(a==-1){a=this.l()}break;case $.ig.AxisDefinitionParser.prototype.b:b=this.l();while(this.l()+1<this.m().length){d=this.m().substr(this.l()+1,1);switch(d){case $.ig.AxisDefinitionParser.prototype.b:b=this.l()+1;break;case $.ig.AxisDefinitionParser.prototype.e:if($.ig.AxisDefinitionParser.prototype.b==this.m().substr(this.l(),1)){c=true}break;case $.ig.AxisDefinitionParser.prototype.c:case $.ig.AxisDefinitionParser.prototype.d:c=true;break}if(c){break}this.l(this.l()+1)}c=true;break;case $.ig.AxisDefinitionParser.prototype.e:c=true;break;case $.ig.AxisDefinitionParser.prototype.c:this.j(true);break;case $.ig.AxisDefinitionParser.prototype.d:$.ig.Debug.prototype.c(this.j());c=true;this.j(false);break}if(c){c=false;if(a>-1&&b>-1){break}}}if(this.l()==this.m().length-1){if(b==-1||a==-1){return false}}var e=this.m().substr(a,b-a+1).trim();this.k(e);return true},w:function(){var a=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);var b=null;while(this.v()){if(!this.j()){b=new $.ig.ArrayListCollection$1(String);var c=new $.ig.AxisElement(this.k(),b);a.add(c)}else if(b!=null){b.add(this.k())}}return a},$type:new $.ig.Type("AxisDefinitionParser",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AxisElement","Object",{init:function(a,b){$.ig.Object.prototype.init.call(this);this.name(a);this.memberNames(b)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_memberNames:null,memberNames:function(a){if(arguments.length===1){this._memberNames=a;return a}else{return this._memberNames}},$type:new $.ig.Type("AxisElement",$.ig.Object.prototype.$type)},true);$.ig.util.defType("KeyValueItem","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},$type:new $.ig.Type("KeyValueItem",$.ig.Object.prototype.$type)},true);$.ig.util.defType("PositionItemInfo$2","Dictionary$2",{$tKey:null,$tSortKey:null,init:function($tKey,$tSortKey,a,b,c,d){this.i=new $.ig.Dictionary$2(this.$tKey,$.ig.Object.prototype.$type,0);this.$tKey=$tKey;this.$tSortKey=$tSortKey;this.$type=this.$type.specialize(this.$tKey,this.$tSortKey);$.ig.Dictionary$2.prototype.init.call(this,this.$tKey,$.ig.PositionItemInfo$2.prototype.$type.specialize(this.$tKey,this.$tSortKey));this.positionItem(a);this.positionIndex(b);this.positionItemIndex(c);this.positionItemDepth(0);this.positionItemDepthMin(-1);this.positionItemDepthMax($.ig.Number.prototype.MAX_VALUE);this.positionSize(d);if(a!=null){this.positionItemDepth(this.positionItem().depth());this.key(this.positionItem().key());this.parentKey(this.positionItem().parentKey());this.hierarchyKey(this.positionItem().hierarchyKey());this.hierarchyLevelKey(this.positionItem().hierarchyLevelKey());this.sortKey(this.positionItem().sortKey());this.caption(this.positionItem().caption())}},y:function(a,b,c,d){return new $.ig.PositionItemInfo$2(this.$tKey,this.$tSortKey,a,b,c,d)},_positionItemDepthMin:null,positionItemDepthMin:function(a){if(arguments.length===1){this._positionItemDepthMin=a;return a}else{return this._positionItemDepthMin}},_positionItemDepthMax:null,positionItemDepthMax:function(a){if(arguments.length===1){this._positionItemDepthMax=a;return a}else{return this._positionItemDepthMax}},_positionItem:null,positionItem:function(a){if(arguments.length===1){this._positionItem=a;return a}else{return this._positionItem}},_positionIndex:null,positionIndex:function(a){if(arguments.length===1){this._positionIndex=a;return a}else{return this._positionIndex}},_positionItemDepth:null,positionItemDepth:function(a){if(arguments.length===1){this._positionItemDepth=a;return a}else{return this._positionItemDepth}},_positionItemIndex:null,positionItemIndex:function(a){if(arguments.length===1){this._positionItemIndex=a;return a}else{return this._positionItemIndex}},_positionSize:null,positionSize:function(a){if(arguments.length===1){this._positionSize=a;return a}else{return this._positionSize}},_key:null,key:function(a){if(arguments.length===1){this._key=a;return a}else{return this._key}},_parentKey:null,parentKey:function(a){if(arguments.length===1){this._parentKey=a;return a}else{return this._parentKey}},_hierarchyKey:null,hierarchyKey:function(a){if(arguments.length===1){this._hierarchyKey=a;return a}else{return this._hierarchyKey}},_hierarchyLevelKey:null,hierarchyLevelKey:function(a){if(arguments.length===1){this._hierarchyLevelKey=a;return a}else{return this._hierarchyLevelKey}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_sortKey:null,sortKey:function(a){if(arguments.length===1){this._sortKey=a;return a}else{return this._sortKey}},_isExpandable:null,isExpandable:function(a){if(arguments.length===1){this._isExpandable=a;return a}else{return this._isExpandable}},_isExpanded:null,isExpanded:function(a){if(arguments.length===1){this._isExpanded=a;return a}else{return this._isExpanded}},am:function(a,b,c){var d=false;if(this.positionItemIndex()==-1){d=true}else{if(c!=null){if(a.item(this.positionItemIndex()).key()!=null){var e=c.item(this.positionItemIndex());d=a.item(this.positionItemIndex()).key().equals(e.key())}}}if(this.positionItemIndex()+1==this.positionSize()){return d}var f=this.ao(a,b,this.positionItemIndex()+1,c);return d&&f},an:function(a,b){},i:null,ao:function(a,b,c,d){var $self=this;var e;var f=a.item(c);if(!this.containsKey(f.key())){var g=this.y(f,b,c,this.positionSize());g.isExpandable(f.isExpandable());if(this.i.containsKey(g.key())){this.i.remove(g.key());g.isExpanded(true)}if(f.parentKey()!=null){var h=null;if(function(){var $ret=$self.tryGetValue(f.parentKey(),h);h=$ret.value;return $ret.ret}()){h.isExpanded(true)}else{if(!this.i.containsKey(f.parentKey())){this.i.add(f.parentKey(),null)}}}e=g.am(a,b,d);this.add(f.key(),g);if(this.positionItemDepthMin()==-1){this.positionItemDepthMin(f.depth())}else{this.positionItemDepthMin(Math.min(this.positionItemDepthMin(),f.depth()))}if(this.positionItemDepthMax()==$.ig.Number.prototype.MAX_VALUE){this.positionItemDepthMax(f.depth())}else{this.positionItemDepthMax(Math.max(this.positionItemDepthMax(),f.depth()))}this.an(a,g)}else{var i=this.item(f.key());e=i.am(a,b,d)}return e},getIndex:function(a){var b=new Array(a.count());for(var c=0;c<b.length;c++){b[c]=a.item(c).key()}return this.getIndex1(b)},getIndex1:function(a){return this.ap(a,a.length)},ap:function(a,b){var $self=this;if(this.positionItemIndex()==b-1){return this.positionIndex()}var c;if(!function(){var $ret=$self.tryGetValue(a[$self.positionItemIndex()+1],c);c=$ret.value;return $ret.ret}()){return-1}if(c.count()==0){return c.positionIndex()}return c.ap(a,b)},$type:new $.ig.Type("PositionItemInfo$2",$.ig.Dictionary$2.prototype.$type.specialize(0,$.ig.PositionItemInfo$2.prototype.$type.specialize(0,1)))},true);$.ig.util.defType("PositionResolver$2","Object",{$tKey:null,$tSortKey:null,a:null,b:null,c:null,d:null,init:function($tKey,$tSortKey,a,b){this.a=0;this.$tKey=$tKey;this.$tSortKey=$tSortKey;this.$type=this.$type.specialize(this.$tKey,this.$tSortKey);$.ig.Object.prototype.init.call(this);this.positions(a.toList$1($.ig.IPosition$2.prototype.$type));this.positionSize(b)},getPositionIndexCompleted:null,_positions:null,positions:function(a){if(arguments.length===1){this._positions=a;return a}else{return this._positions}},_positionSize:null,positionSize:function(a){if(arguments.length===1){this._positionSize=a;return a}else{return this._positionSize}},rootPositionInfo:function(){if(this.b==null){this.b=this.m(this.positionSize())}return this.b},m:function(a){return new $.ig.PositionItemInfo$2(this.$tKey,this.$tSortKey,null,-1,-1,a)},hasUnregisterdPositions:function(){return this.a<this.positions().count()},completeRegisterPositions:function(){if(this.hasUnregisterdPositions()){this.r(null)}},resolveParentPositionItem:function(a,b){b=-1;var c=$.ig.util.cast($.ig.IHierarchicalPositionItem$2.prototype.$type.specialize(this.$tKey,this.$tSortKey),a);if(c==null||c.parentKey()==null){return{ret:null,parentPositionIndex:b}}var d=c.position().indexOf(c);var e=new Array(c.position().itemsCount());for(var f=0;f<c.position().itemsCount();f++){e[f]=c.position().item(f).key()}e[d]=c.parentKey();b=this.rootPositionInfo().getIndex1(e);if(b==-1){return{ret:null,parentPositionIndex:b}}var g=this.positions().__inner[b];var h=g.item(d);return{ret:h,parentPositionIndex:b};return{parentPositionIndex:b}},getHostPositionItemInfo:function(a,b){var $self=this;var c=this.rootPositionInfo();var d=a.item(b);for(var e=0;e<b;e++){var f;if(function(){var $ret=c.tryGetValue(a.item(e).key(),f);f=$ret.value;return $ret.ret}()){c=f}else{c=null;break}}if(c==null){return null}if(!c.containsKey(d.key())){return null}return c},n:function(a,b){var $self=this;if(this.rootPositionInfo().count()==0){return null}var c=this.rootPositionInfo();var d=a.position().indexOf(a);for(var e=0;e<d;e++){var f;if(function(){var $ret=c.tryGetValue(a.position().item(e).key(),f);f=$ret.value;return $ret.ret}()){c=f}else{c=null;break}}if(c==null){return null}if(!c.containsKey(a.key())){return null}var g=new $.ig.List$1($.ig.Number.prototype.$type,0);this.o(a.key(),c,g);if(b==$.ig.ListSortDirection.prototype.descending){g.t(function(h,i){if(h==i){return 0}if(h>i){return-1}return 1});return g}g.t(function(j,k){if(j==k){return 0}if(j>k){return 1}return-1});return g},o:function(a,b,c){var $self=this;var f=b.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(d){return a.equals(d.parentKey())}).getEnumerator();while(f.moveNext()){var e=f.current();if(e.count()==0){c.add(e.positionIndex())}else{this.p(e,c)}if(!e.isExpanded()){continue}if(e.positionItemDepth()<b.positionItemDepthMax()){this.o(e.key(),b,c)}}},p:function(a,b){var $self=this;var e=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(c){return c.parentKey()==null}).getEnumerator();while(e.moveNext()){var d=e.current();if(d.count()==0){b.add(d.positionIndex())}else{this.p(d,b)}if(!d.isExpanded()){continue}if(d.positionItemDepth()<a.positionItemDepthMax()){this.o(d.key(),a,b)}}},getChildren:function(a,b){var $self=this;if(this.hasUnregisterdPositions()){this.completeRegisterPositions()}var c=this.getHostPositionItemInfo(a,b);var d=a.item(b);return c.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(e){return d.key().equals(e.parentKey())})},isMemberExpanded:function(a){var $self=this;if(this.hasUnregisterdPositions()){this.completeRegisterPositions()}var b=this.getPositionIndex(a.position());if(b==-1||this.rootPositionInfo().count()==0){return null}var c=a.position().indexOf(a);var d=this.rootPositionInfo();for(var e=0;e<c;e++){var f;if(function(){var $ret=d.tryGetValue(a.position().item(e).key(),f);f=$ret.value;return $ret.ret}()){d=f}else{d=null;break}}if(d==null){return null}if(!d.containsKey(a.key())){return null}var g=null;var h=d.values().getEnumerator();while(h.moveNext()){if(a.key().equals(h.current().parentKey())){g=h.current();break}}return g!=null},getPositionIndex:function(a){if(a==null){return-1}if(a.itemsCount()!=this.positionSize()){return-1}if(a.isEmpty()&&this.positions().count()==1&&this.positions().__inner[0].isEmpty()){return 0}if(this.a>0){var b=this.q(a);if(b>-1){return b}if(this.a==this.positions().count()){return-1}}return this.r(a)},q:function(a){if(a.isEmpty()&&this.positions().count()==1&&this.positions().__inner[0].isEmpty()){return 0}return this.rootPositionInfo().getIndex(a.getItems().toList$1($.ig.IPositionItem$2.prototype.$type))},r:function(a){var b=a==null;var c=-1;for(var d=this.a;d<this.positions().count();d++){var e=this.positions().__inner[d];var f=this.rootPositionInfo().am(e,d,a);this.a++;if(c==-1&&f){c=d;if(!b){break}}}return c},$type:new $.ig.Type("PositionResolver$2",$.ig.Object.prototype.$type)},true);$.ig.util.defType("LevelSortDirection","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.sortBehavior($.ig.LevelSortBehavior.prototype.system)},_levelUniqueName:null,levelUniqueName:function(a){if(arguments.length===1){this._levelUniqueName=a;return a}else{return this._levelUniqueName}},_sortDirection:null,sortDirection:function(a){if(arguments.length===1){this._sortDirection=a;return a}else{return this._sortDirection}},_sortBehavior:null,sortBehavior:function(a){if(arguments.length===1){this._sortBehavior=a;return a}else{return this._sortBehavior}},$type:new $.ig.Type("LevelSortDirection",$.ig.Object.prototype.$type)},true);$.ig.util.defType("TaskExtensions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},continueWithTask$1:function($tResult,b){var $self=this;var c=new $.ig.TaskCompletionSource$1($tResult,0);this.t(function(d){var $self=$self;if(d.h()==null){try{b(d).t(function(e){if(e.h()==null){c.i(e.aa());return}c.h(e.h())})}catch(e_){var f;f=e_;c.h(f)}}else{c.h(d.h())}});return c.d()},continueWithTask$21:function($tResult1,$tResult2,b){var $self=this;return this.continueWithTask$1($tResult2,function(c){return b(c)})},$type:new $.ig.Type("TaskExtensions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyFilterView","Object",{a:null,b:null,c:null,init:function(a){this.c=new $.ig.Dictionary$2(String,$.ig.FilterMember.prototype.$type,0);$.ig.Object.prototype.init.call(this);this.hierarchy(a);this.b=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.FilterMember.prototype.$type),0);this.a=new $.ig.Dictionary$2(String,$.ig.FilterMember.prototype.$type,0)},filterMemberExpansionChanged:null,filterMemberSelectionChanged:null,_hierarchy:null,hierarchy:function(a){if(arguments.length===1){this._hierarchy=a;return a}else{return this._hierarchy}},addFiltersForMembers:function(a){var c=a.getEnumerator();while(c.moveNext()){var b=c.current();this.addFilterForMember(b)}},addFilterForMember:function(a){var $self=this;if(!this.a.containsKey(a.uniqueName())){var b=new $.ig.FilterMember(a);b.propertyChanged=$.ig.Delegate.prototype.combine(b.propertyChanged,this.i.runOn(this));b.selectionChanged=$.ig.Delegate.prototype.combine(b.selectionChanged,this.h.runOn(this));var c;if(!function(){var $ret=$self.b.tryGetValue(a.levelDepth(),c);c=$ret.value;return $ret.ret}()){c=new $.ig.List$1($.ig.FilterMember.prototype.$type,0);this.b.add(a.levelDepth(),c)}this.a.add(a.uniqueName(),b);this.c.add(a.uniqueName(),b);c.add(b);this.l(b);this.k(b)}},tryGetFilterMember:function(a,b){var $self=this;return{ret:function(){var $ret=$self.a.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),filterMember:b};return{filterMember:b}},getRootFilterMembers:function(){var a=-1;var c=this.b.keys().getEnumerator();while(c.moveNext()){var b=c.current();if(a==-1){a=b}else{a=Math.min(b,a)}}if(a==-1){return null}return this.b.item(a)},getSelectedFilterItems:function(){var a=this.getRootFilterMembers();var b=new $.ig.List$1($.ig.FilterMember.prototype.$type,0);var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();if(d.isSelected().hasValue()==true&&d.isSelected().value()==true){c++}}if(c==a.count()){return b}var g=a.getEnumerator();while(g.moveNext()){var f=g.current();if(f.isSelected().hasValue()==false){this.j(f,b)}else if(f.isSelected().hasValue()==true&&f.isSelected().value()==true){b.add(f)}}return b},h:function(a,b){if(this.filterMemberSelectionChanged!=null){this.filterMemberSelectionChanged(this,new $.ig.FilterMemberStateChangedEventArgs(a))}},i:function(a,b){if(b.propertyName()=="IsExpanded"){if(this.filterMemberExpansionChanged!=null){this.filterMemberExpansionChanged(this,new $.ig.FilterMemberStateChangedEventArgs(a))}}},j:function(a,b){if(a.isSelected().hasValue()==true&&a.isSelected().value()==true){b.add(a)}else{if(a.children()==null){return}var d=a.children().getEnumerator();while(d.moveNext()){var c=d.current();this.j(c,b)}}},k:function(a){var $self=this;var b=a.member().parentUniqueName();if(String.isNullOrEmpty(b)){return}var c;if(function(){var $ret=$self.a.tryGetValue(b,c);c=$ret.value;return $ret.ret}()){c.s(a);if(c.isSelected().hasValue()==true&&c.isSelected().value()==false){a.isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,false))}}},l:function(a){var $self=this;var b=a.member().levelDepth();var c;if(function(){var $ret=$self.b.tryGetValue(b+1,c);c=$ret.value;return $ret.ret}()){var e=c.getEnumerator();while(e.moveNext()){var d=e.current();if(d.member().parentUniqueName()==a.member().uniqueName()){a.s(d)}}}},$type:new $.ig.Type("HierarchyFilterView",$.ig.Object.prototype.$type)},true);$.ig.util.defType("FilterMember","Object",{a:null,b:null,c:null,d:null,init:function(a){this.c=false;this.d=false;$.ig.Object.prototype.init.call(this);this.a=$.ig.util.toNullable($.ig.Boolean.prototype.$type,true);this.member(a);this.l(0);this.m(0)},selectionChanged:null,propertyChanged:null,_parent:null,parent:function(a){if(arguments.length===1){this._parent=a;return a}else{return this._parent}},_member:null,member:function(a){if(arguments.length===1){this._member=a;return a}else{return this._member}},isExpandable:function(){return this.member().childrenCardinality()>0},isExpanded:function(a){if(arguments.length===1){if(this.b!=a){this.b=a;this.x("IsExpanded")}return a}else{return this.b}},isSelected:function(a){if(arguments.length===1){var b=$.ig.util.toNullable($.ig.Boolean.prototype.$type,a);if($.ig.util.nullableEquals($.ig.util.nullableEquals(this.a,b),false)){var c=$.ig.util.toNullable($.ig.Boolean.prototype.$type,this.a);this.a=$.ig.util.toNullable($.ig.Boolean.prototype.$type,a);if(!this.d){if(this.a.hasValue()==true){if(this.children()!=null){var e=this.children().getEnumerator();while(e.moveNext()){var d=e.current();d.c=true;d.isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,this.a));d.c=false}}}}if(this.parent()!=null){if(c.hasValue()==true&&c.value()==false){if(this.a.hasValue()==false){this.q(true)}this.p(false)}else if(c.hasValue()==false){if(this.a.hasValue()==true&&this.a.value()==false){this.p(true)}this.q(false)}else{if(this.a.hasValue()==true&&this.a.value()==false){this.p(true)}else if(this.a.hasValue()==false){this.q(true)}}if(!this.c){this.parent().d=true;var f=this.parent().l();var g=this.parent().m();var h=this.parent().children().count();if(g==0){if(f==0){this.parent().isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,true))}else if(f==h){this.parent().isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,false))}else{this.parent().isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,null))}}else{this.parent().isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,null))}this.parent().d=false}}this.x("IsSelected");if(!this.c&&!this.d){if(this.selectionChanged!=null){this.selectionChanged(this,$.ig.EventArgs.prototype.empty)}}}return a}else{return this.a}},p:function(a){if(a){this.parent().l(this.parent().l()+1)}else{this.parent().l(this.parent().l()-1)}},q:function(a){if(a){this.parent().m(this.parent().m()+1)}else{this.parent().m(this.parent().m()-1)}},_children:null,children:function(a){if(arguments.length===1){this._children=a;return a}else{return this._children}},s:function(a){if(this.children()==null){this.children(new $.ig.List$1($.ig.FilterMember.prototype.$type,0))}a.parent(this);this.children().add(a);this.x("Children")},_l:null,l:function(a){if(arguments.length===1){this._l=a;return a}else{return this._l}},_m:null,m:function(a){if(arguments.length===1){this._m=a;return a}else{return this._m}},x:function(a){if(this.propertyChanged!=null){this.propertyChanged(this,new $.ig.PropertyChangedEventArgs(a))}},$type:new $.ig.Type("FilterMember",$.ig.Object.prototype.$type,[$.ig.INotifyPropertyChanged.prototype.$type])},true);$.ig.util.defType("FilterMemberStateChangedEventArgs","EventArgs",{init:function(a){$.ig.EventArgs.prototype.init.call(this);this.filterMember(a)},_filterMember:null,filterMember:function(a){if(arguments.length===1){this._filterMember=a;return a}else{return this._filterMember}},$type:new $.ig.Type("FilterMemberStateChangedEventArgs",$.ig.EventArgs.prototype.$type)},true);$.ig.util.defType("ResultSorter$1","Object",{$t:null,_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},init:function($t,a,b,c){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);
this.d(a);this.e(b);this.f(c)},m:function(){},n:function(a,b,c){a.i();var d=a.d();var e=new Array(d.count());for(var f=0;f<d.count();f++){var g=d.item(f);c.add(g,f)}for(var h=0;h<d.count();h++){var i=d.item(h);var j=b.tuples().__inner[i];e[h]=j}return new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,1,e)},$type:new $.ig.Type("ResultSorter$1",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ResultHeaderSorter","ResultSorter$1",{o:null,_r:null,r:function(a){if(arguments.length===1){this._r=a;return a}else{return this._r}},_s:null,s:function(a){if(arguments.length===1){this._s=a;return a}else{return this._s}},init:function(a,b,c,d){$.ig.ResultSorter$1.prototype.init.call(this,$.ig.AxisHeaderSortingVisitor.prototype.$type,a,b,c);this.o=new $.ig.Dictionary$2(String,$.ig.LevelSortDirection.prototype.$type,1,d.count());var f=d.getEnumerator();while(f.moveNext()){var e=f.current();this.o.item(e.levelUniqueName(),e)}},m:function(){var $self=this;this.r(new $.ig.List$1($.ig.LevelSortDirection.prototype.$type,0));this.s(new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type)),0));if(this.d().isEmpty()){return this.d()}var a=new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0);var b=0;var c=1;var d=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var e=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);if(this.f()){var f=this.d().axes().item(b);var g=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type),0);var h=new $.ig.AxisHeaderSortingVisitor(f,this.o,this.r(),g);var i=this.n(h,f,d);var j=function(){var $ret=new $.ig.OlapResultAxis(i,f.tupleSize());$ret.name(f.name());return $ret}();a.add(j);this.s().item(f.name(),g);c=f.tuples().count();b++}if(this.e()){var k=this.d().axes().item(b);var l=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type),0);var m=new $.ig.AxisHeaderSortingVisitor(k,this.o,this.r(),l);var n=this.n(m,k,e);var o=function(){var $ret=new $.ig.OlapResultAxis(n,k.tupleSize());$ret.name(k.name());return $ret}();a.add(o);this.s().item(k.name(),l)}var p=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,2,this.d().cells().count());var r=this.d().cells().getEnumerator();while(r.moveNext()){var q=r.current();var s=q.clone();var t=s.cellOrdinal();if(this.f()){var u=t%c;var v=d.item(u);if(u!=v){var w=$.ig.intDivide(t,c);t=w*c+v}}if(this.e()){var x=$.ig.intDivide(t,c);var y=e.item(x);if(x!=y){var z=t%c;t=y*c+z}}s.cellOrdinal(t);p.add(s)}var aa=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty($self.d().isEmpty());$ret.axes(a);$ret.cells(p);return $ret}();return aa},$type:new $.ig.Type("ResultHeaderSorter",$.ig.ResultSorter$1.prototype.$type.specialize($.ig.AxisHeaderSortingVisitor.prototype.$type))},true);$.ig.util.defType("AxisTupleVisitor","Object",{_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},init:function(a){$.ig.Object.prototype.init.call(this);this.c(a)},i:function(){var $self=this;if(this.c().positionResolver().hasUnregisterdPositions()){this.c().positionResolver().completeRegisterPositions()}this.d(new $.ig.List$1($.ig.Number.prototype.$type,2,this.c().tuples().count()));var a=this.c().positionResolver().rootPositionInfo();var c=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(b){return b.positionItemDepth()==a.positionItemDepthMin()});var e=this.k(a,c).getEnumerator();while(e.moveNext()){var d=e.current();this.l(a,d)}},j:function(a,b){},k:function(a,b){},l:function(a,b){var $self=this;var d=b.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(c){return c.positionItemDepth()==b.positionItemDepthMin()});if(d.count$1($.ig.PositionItemInfo$2.prototype.$type)>0){var f=d.getEnumerator();while(f.moveNext()){var e=f.current();this.l(b,e)}}else{this.d().add(b.positionIndex())}var g=this.j(a,b);var i=g.getEnumerator();while(i.moveNext()){var h=i.current();this.l(a,h)}},$type:new $.ig.Type("AxisTupleVisitor",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AxisHeaderSortingVisitor","AxisTupleVisitor",{m:null,n:null,o:null,init:function(a,b,c,d){$.ig.AxisTupleVisitor.prototype.init.call(this,a);this.m=b;this.n=c;this.o=d},j:function(a,b){var $self=this;var d=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(c){return c.parentKey()==b.key()}).toList$1($.ig.PositionItemInfo$2.prototype.$type);if(d.count()>0){var e=d.item(0);var f;if(function(){var $ret=$self.m.tryGetValue(e.hierarchyLevelKey(),f);f=$ret.value;return $ret.ret}()){if(f.sortBehavior()==$.ig.LevelSortBehavior.prototype.system){d=f.sortDirection()==$.ig.ListSortDirection.prototype.ascending?d.orderBy$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(g){return g.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type):d.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(h){return h.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type)}else{d=f.sortDirection()==$.ig.ListSortDirection.prototype.ascending?d.orderBy$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(i){return i.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type):d.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(j){return j.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type)}if(!this.n.select$2($.ig.LevelSortDirection.prototype.$type,String,function(k){return k.levelUniqueName()}).contains$1(String,f.levelUniqueName())){this.n.add(f)}var l;if(!function(){var $ret=$self.o.tryGetValue(e.positionItemIndex(),l);l=$ret.value;return $ret.ret}()){l=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type,0);this.o.add(b.positionItemIndex(),l)}l.item(b.positionItemDepth(),f.sortDirection())}}return d},k:function(a,b){var $self=this;var c=b.toList$1($.ig.PositionItemInfo$2.prototype.$type);if(c.count()>0){var d=c.item(0);var e;if(d.hierarchyLevelKey()!=null&&function(){var $ret=$self.m.tryGetValue(d.hierarchyLevelKey(),e);e=$ret.value;return $ret.ret}()){if(e.sortBehavior()==$.ig.LevelSortBehavior.prototype.system){c=e.sortDirection()==$.ig.ListSortDirection.prototype.ascending?c.orderBy$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(f){return f.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type):c.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(g){return g.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type)}else{c=e.sortDirection()==$.ig.ListSortDirection.prototype.ascending?c.orderBy$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(h){return h.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type):c.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(i){return i.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type)}this.n.add(e);var j;if(!function(){var $ret=$self.o.tryGetValue(d.positionItemIndex(),j);j=$ret.value;return $ret.ret}()){j=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type,0);this.o.add(a.positionItemIndex(),j)}j.item(a.positionItemDepth(),e.sortDirection())}}return c},$type:new $.ig.Type("AxisHeaderSortingVisitor",$.ig.AxisTupleVisitor.prototype.$type)},true);$.ig.util.defType("ResultColumnValueSorter","ResultSorter$1",{o:null,_q:null,q:function(a){if(arguments.length===1){this._q=a;return a}else{return this._q}},init:function(a,b,c,d){$.ig.ResultSorter$1.prototype.init.call(this,$.ig.AxisValueSortingVisitor.prototype.$type,a,b,c);this.o=d},m:function(){var $self=this;this.q(new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,0));if(!this.e()||this.d().isEmpty()){return this.d()}var a=new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0);var b=0;var c=null;var d=1;if(this.f()){c=this.d().axes().item(b);d=c.tuples().count();a.add(c.clone());b++}var e=this.d().axes().item(b);var f=this.d().axes().item(b).tuples().count();var g=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Object.prototype.$type,1,this.d().cells().count());var i=this.d().cells().getEnumerator();while(i.moveNext()){var h=i.current();g.item(h.cellOrdinal(),h.properties().item("Value"))}var j=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize($.ig.TupleSortDirection.prototype.$type,$.ig.Array.prototype.$type),2,this.o.count());var l=this.o.getEnumerator();while(l.moveNext()){var k=l.current();var m;if(c!=null&&k.memberNames()!=null){if(c.positionResolver().hasUnregisterdPositions()){c.positionResolver().completeRegisterPositions()}m=c.positionResolver().rootPositionInfo().getIndex1(k.memberNames());k.tupleIndex(m)}else{m=k.tupleIndex()}if(m>-1&&m<d){var n=new Array(f);for(var o=0;o<f;o++){var p=null;(function(){var $ret=g.tryGetValue(o*d+m,p);p=$ret.value;return $ret.ret})();n[o]=p}j.add(new $.ig.KeyValuePair$2($.ig.TupleSortDirection.prototype.$type,$.ig.Array.prototype.$type,k,n));this.q().add(k)}}var q=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var r=new $.ig.AxisValueSortingVisitor(e,j);var s=this.n(r,e,q);var t=function(){var $ret=new $.ig.OlapResultAxis(s,e.tupleSize());$ret.name(e.name());return $ret}();a.add(t);var u=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,2,this.d().cells().count());var w=this.d().cells().getEnumerator();while(w.moveNext()){var v=w.current();var x=v.clone();var y=x.cellOrdinal();var z=$.ig.intDivide(y,d);var aa=q.item(z);if(z!=aa){var ab=y%d;y=aa*d+ab}x.cellOrdinal(y);u.add(x)}var ac=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty($self.d().isEmpty());$ret.axes(a);$ret.cells(u);return $ret}();return ac},$type:new $.ig.Type("ResultColumnValueSorter",$.ig.ResultSorter$1.prototype.$type.specialize($.ig.AxisValueSortingVisitor.prototype.$type))},true);$.ig.util.defType("AxisValueSortingVisitor","AxisTupleVisitor",{m:null,init:function(a,b){$.ig.AxisTupleVisitor.prototype.init.call(this,a);this.m=b},j:function(a,b){var $self=this;var d=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(c){return c.parentKey()==b.key()});return this.k(a,d)},k:function(a,b){var positionItemInfos_=b.toArray$1($.ig.PositionItemInfo$2.prototype.$type);if(positionItemInfos_.length>0){var tupleSortDirections_=this.m.toArray$1($.ig.PositionItemInfo$2.prototype.$type);var sortFunction=function(tupleSortDirections){var compareCells=function(comparer,cell1,cell2){var result=comparer(cell1,cell2);if(result<0){return-1}if(result>0){return 1}return!isNaN(parseFloat(result))&&isFinite(result)?result:0};return function(o1,o2){var i,length,tupleSortDirection,cells,direction,cell1,cell2,arr1=[],arr2=[];for(i=0;i<tupleSortDirections.length;i++){tupleSortDirection=tupleSortDirections[i].key();cells=tupleSortDirections[i].value();if(tupleSortDirection.sortDirection()===$.ig.ListSortDirection.prototype.ascending){direction=1}else{direction=-1}comparer=tupleSortDirection.comparer();cell1=cells[o1.positionIndex()];cell2=cells[o2.positionIndex()];if(tupleSortDirections.length===1){arr1=direction*compareCells(comparer,cell1,cell2);arr2=direction*compareCells(comparer,cell2,cell1)}else{arr1.push(direction*compareCells(comparer,cell1,cell2));arr2.push(direction*compareCells(comparer,cell2,cell1))}}if(arr1<arr2){return-1}if(arr1>arr2){return 1}return 0}};positionItemInfos_.sort(sortFunction(tupleSortDirections_))}return positionItemInfos_},$type:new $.ig.Type("AxisValueSortingVisitor",$.ig.AxisTupleVisitor.prototype.$type)},true);$.ig.util.defType("TupleSortDirection","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_tupleIndex:null,tupleIndex:function(a){if(arguments.length===1){this._tupleIndex=a;return a}else{return this._tupleIndex}},_memberNames:null,memberNames:function(a){if(arguments.length===1){this._memberNames=a;return a}else{return this._memberNames}},_sortDirection:null,sortDirection:function(a){if(arguments.length===1){this._sortDirection=a;return a}else{return this._sortDirection}},_comparer:null,comparer:function(a){if(arguments.length===1){this._comparer=a;return a}else{return this._comparer}},$type:new $.ig.Type("TupleSortDirection",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DataSourceBase","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_dataSource:null,dataSource:function(a){if(arguments.length===1){this._dataSource=a;return a}else{return this._dataSource}},isInitialized:function(){if(this.dataSource()==null){return false}return this.dataSource().isInitialized()},_isModified:null,isModified:function(a){if(arguments.length===1){this._isModified=a;return a}else{return this._isModified}},_isUpdating:null,isUpdating:function(a){if(arguments.length===1){this._isUpdating=a;return a}else{return this._isUpdating}},initialize:function(){var promise_=this.dataSource().initialize().f();var $this=this;if(!this._isInitializedAttached){this._isInitializedAttached=true;promise_.always(function(result){var args={error:null,metadataTreeRoot:null};if(this.state()==="rejected"){args.error=result}else{args.metadataTreeRoot=result}$($this).trigger("initialized",args);$this._isInitializedAttached=false})}return promise_},cubes:function(){return this.dataSource().cubes().inner()},cube:function(){return this.dataSource().cube()},setCube:function(a){var $self=this;return this.dataSource().setCube(a).ae($.ig.OlapMetadataTreeItem.prototype.$type,function(b){return b.aa()}).f()},metadataTree:function(){return this.dataSource().metadataTree()},addRowItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().rowAxis().add(a);this.isModified(true)}},insertRowItem:function(a,b){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,b)!==null){this.dataSource().rowAxis().insert(a,b);this.isModified(true)}},removeRowItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null||$.ig.util.cast($.ig.MeasureList.prototype.$type,a)!==null){this.dataSource().rowAxis().remove(a);this.isModified(true)}},addColumnItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().columnAxis().add(a);this.isModified(true)}},insertColumnItem:function(a,b){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,b)!==null){this.dataSource().columnAxis().insert(a,b);this.isModified(true)}},removeColumnItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null||$.ig.util.cast($.ig.MeasureList.prototype.$type,a)!==null){this.dataSource().columnAxis().remove(a);this.isModified(true)}},addFilterItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().filters().add(a);this.isModified(true)}},insertFilterItem:function(a,b){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,b)!==null){this.dataSource().filters().insert(a,b);this.isModified(true)}},removeFilterItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().filters().remove(a);this.isModified(true)}},addMeasureItem:function(a){if($.ig.util.cast($.ig.Measure.prototype.$type,a)!==null){this.dataSource().measures().add(a);this.isModified(true)}},insertMeasureItem:function(a,b){if($.ig.util.cast($.ig.Measure.prototype.$type,b)!==null){this.dataSource().measures().insert(a,b);this.isModified(true)}},removeMeasureItem:function(a){if($.ig.util.cast($.ig.Measure.prototype.$type,a)!==null){this.dataSource().measures().remove(a);this.isModified(true)}},setMeasureListIndex:function(a){this.dataSource().measureListIndex(a);this.isModified(true)},setMeasureListLocation:function(a){switch(a){case"rows":this.dataSource().measureListLocation($.ig.MeasureListLocation.prototype.rows);break;case"columns":this.dataSource().measureListLocation($.ig.MeasureListLocation.prototype.columns);break;default:break}this.isModified(true)},expandTupleMember:function(a,b,c){this.dataSource().expandTupleMember(a,b,c)},collapseTupleMember:function(a,b,c){this.dataSource().collapseTupleMember(a,b,c)},rowAxis:function(){return this.dataSource().rowAxis().inner()},columnAxis:function(){return this.dataSource().columnAxis().inner()},filters:function(){return this.dataSource().filters().inner()},measures:function(){return this.dataSource().measures().inner()},result:function(){return this.dataSource().result()},bindCollectionChanged:function(a){var options_=a;var ds_=this.dataSource();var attachCollectionChanged=function(collection,handler){collection.collectionChanged=$.ig.Delegate.prototype.combine(collection.collectionChanged,handler)};if($.isFunction(options_["filters"])){attachCollectionChanged(ds_._filters,options_["filters"])}if($.isFunction(options_["rowAxis"])){attachCollectionChanged(ds_._rowAxis,options_["rowAxis"])}if($.isFunction(options_["columnAxis"])){attachCollectionChanged(ds_._columnAxis,options_["columnAxis"])}if($.isFunction(options_["measures"])){attachCollectionChanged(ds_._measures,options_["measures"])}},unbindCollectionChanged:function(a){var options_=a;var ds_=this.dataSource();unbindCollectionChanged=function(collection,handler){collection.collectionChanged=$.ig.Delegate.prototype.remove(collection.collectionChanged,handler)};if($.isFunction(options_["filters"])){unbindCollectionChanged(ds_._filters,options_["filters"])}if($.isFunction(options_["rowAxis"])){unbindCollectionChanged(ds_._rowAxis,options_["rowAxis"])}if($.isFunction(options_["columnAxis"])){unbindCollectionChanged(ds_._columnAxis,options_["columnAxis"])}if($.isFunction(options_["measures"])){unbindCollectionChanged(ds_._measures,options_["measures"])}},clearPendingChanges:function(){this.dataSource().clearPendingChanges()},update:function(){var promise_=this.dataSource().update().f();var $this=this;if(!this.isUpdating()){this.isUpdating(true);promise_.always(function(result){var args={error:null,result:null};if(this.state()==="rejected"){args.error=result}else{args.result=result}$this.isUpdating(false);$this.isModified(false);$($this).trigger("updated",args)})}return promise_},getCoreElement:function(a,b){return this.dataSource().getCoreElement(a,b)},getCoreElements:function(a,b){return this.dataSource().getCoreElements(a,b).inner()},getMembersOfHierarchy:function(a){return this.dataSource().getMembersOfHierarchy(a).f()},getMembersOfLevel:function(a){return this.dataSource().getMembersOfLevel(a).f()},tryGetMember:function(a){var $self=this;var b;if(function(){var $ret=$self.dataSource().tryGetMember(a,b);b=$ret.member;return $ret.ret}()){return b}return null},tryGetMembersForLevel:function(a){var $self=this;var b=new $.ig.ArrayListCollection$1($.ig.Member.prototype.$type);var c=function(){var $ret=$self.dataSource().tryGetMembersForLevel(a,b);b=$ret.members;return $ret.ret}();return c?b.inner():new $.ig.ArrayListCollection$1($.ig.Member.prototype.$type).inner()},getMembersOfMember:function(a){return this.dataSource().getMembersOfMember(a).f()},addFilterMember:function(a,b){this.dataSource().addFilterMember(a,b);this.isModified(true)},removeAllFilterMembers:function(a){this.dataSource().removeAllFilterMembers(a);this.isModified(true)},getFilterMemberNames:function(a){return this.dataSource().getFilterMemberNames(a).inner()},getDimension:function(a){var $self=this;return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Dimension.prototype.$type)},getHierarchy:function(a){var $self=this;return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Hierarchy.prototype.$type)},getLevel:function(a){var $self=this;return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Level.prototype.$type)},getMeasure:function(a){var $self=this;return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Measure.prototype.$type)},getMeasureList:function(){return this.dataSource().getCoreElement(null,$.ig.MeasureList.prototype.$type)},$type:new $.ig.Type("DataSourceBase",$.ig.Object.prototype.$type)},true);$.ig.util.defType("jQueryUtils","Object",{init:function(){$.ig.Object.prototype.init.call(this)},b:function($t,a){if(a==null){return null}var jsObject_=a;var dict_=new $.ig.Dictionary$2(String,$t,0);(function(obj,dict){var tempDict=$.ig.Dictionary.prototype.getDictionary(obj);var keys=tempDict.keys();while(keys.moveNext()){var key=keys.current();var value=tempDict.item(key);dict.add(key,value)}})(jsObject_,dict_);return dict_},d:function($t,a){if(a==null){return null}var dict_=a;return dict_.__inner.proxy},convertToObjectDictionary:function(a){return $.ig.jQueryUtils.prototype.b($.ig.Object.prototype.$type,a)},convertToStringDictionary:function(a){return $.ig.jQueryUtils.prototype.b(String,a)},convertFromObjectDictionary:function(a){return $.ig.jQueryUtils.prototype.d($.ig.Object.prototype.$type,a)},convertFromStringDictionary:function(a){return $.ig.jQueryUtils.prototype.d(String,a)},createJavascriptObject:function(){return{}},getJavascriptObjectProperty:function(a,b){var jsObject_=a;var property_=b;return jsObject_[property_]},setJavascriptObjectProperty:function(a,b,c){var jsObject_=a;var property_=b;var value_=c;jsObject_[property_]=value_},getJavascriptObjectMethodResult:function(a,b,c){var jsObject_=a;var method_=b;var args_=c;return jsObject_[method_].call(jsObject_,args_)},$type:new $.ig.Type("jQueryUtils",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapUtilities","Object",{init:function(){$.ig.Object.prototype.init.call(this)},dateMemberProvider:function(a,b,c,d){if(String.isNullOrEmpty(a)||String.isNullOrEmpty(b)){return null}var propName_=b;var datePartFormat_=d;var format_=c;var yearProvider_;var semesterProvider_;var quarterProvider_;var monthProvider_;a=a.toLowerCase();switch(a){case"year":if(datePartFormat_==null){datePartFormat_="yyyy"}if(format_==null){return function(item){return $.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)}}return function(item){return format_.replace("{0}",$.ig.formatter(new Date(item[propName_]),"date",datePartFormat_))};case"semester":if(format_==null){format_="H{0}"}yearProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("year",b,null,null);return function(item){var year=yearProvider_(item);return format_.replace("{0}",Math.floor(new Date(item[propName_]).getMonth()/6)+1).replace("{1}",year)};case"quarter":if(format_==null){format_="Q{0}"}yearProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("year",b,null,null);semesterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("semester",b,null,null);return function(item){var year=yearProvider_(item);var semester=semesterProvider_(item);return format_.replace("{0}",Math.floor(new Date(item[propName_]).getMonth()/3)+1).replace("{1}",semester).replace("{2}",year)};case"month":if(datePartFormat_==null){datePartFormat_="MMMM"}if(format_==null){return function(item){return $.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)}}yearProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("year",b,null,null);semesterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("semester",b,null,null);quarterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("quarter",b,null,null);return function(item){var year=yearProvider_(item);var semester=semesterProvider_(item);var quarter=quarterProvider_(item);return format_.replace("{0}",$.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)).replace("{1}",quarter).replace("{2}",semester).replace("{3}",year)};case"date":if(datePartFormat_==null){datePartFormat_="MM/dd/yyyy"}if(format_==null){return function(item){return $.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)}}yearProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("year",b,null,null);semesterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("semester",b,null,null);quarterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("quarter",b,null,null);monthProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("month",b,null,null);return function(item){var year=yearProvider_(item);var semester=semesterProvider_(item);var quarter=quarterProvider_(item);var month=monthProvider_(item);return format_.replace("{0}",$.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)).replace("{1}",month).replace("{2}",quarter).replace("{3}",semester).replace("{4}",year)}}return null},getDateHierarchy:function(a,b,c,d,e,f){var $self=this;if(String.isNullOrEmpty(a)){return null}if(b==null||b.length==0){b=function(){var $ret=new Array;$ret.add("year");$ret.add("quarter");$ret.add("month");$ret.add("date");return $ret}()}else{for(var g=0;g<b.length;g++){b[g]=b[g].toLowerCase()}}if(c==null){c="Dates"}if(d==null){d=c}var res_=null;var name_=c;var caption_=d;var rootCaption_=f;var dateParts_=b;if(e==null){e=new Array(b.length);for(var h=0;h<e.length;h++){var i=b[h];e[h]=i.substr(0,1).toUpperCase()+i.substr(1,i.length)+"s"}}var captions_=e;var memberProviders_=new Array(b.length);for(var j=0;j<b.length;j++){var k=b[j];memberProviders_[j]=$.ig.OlapUtilities.prototype.dateMemberProvider(k,a,null,null)}var levelsMetadata=[];var levelOffset=0;if(rootCaption_!=null&&rootCaption_!=""){levelOffset=1;levelsMetadata[0]={name:rootCaption_,caption:rootCaption_,memberProvider:function(item){return rootCaption_}}}for(var i=0;i<memberProviders_.length;i++){levelsMetadata[i+levelOffset]={name:dateParts_[i],caption:captions_[i],memberProvider:memberProviders_[i]}}res_={name:name_,caption:caption_,levels:levelsMetadata};return res_},sumAggregator:function(a,b){var propName_=a;var precision_=b;return function(items,cellMetadata){var sum=0,areAllNullOrUndefined=true,value;for(var i=0;i<items.length;i++){value=items[i][propName_];if(value!==null&&value!==undefined){areAllNullOrUndefined=false;sum+=value}}if(areAllNullOrUndefined)return null;if(precision_!=null){return sum.toFixed(precision_)}return sum}},avgAggregator:function(a,b){var propName_=a;var precision_=b;return function(items,cellMetadata){if(precision_==null){precision_=2}var sum=0,count=0,areAllNullOrUndefined=true,value;for(var i=0;i<items.length;i++){value=items[i][propName_];if(value!==null&&value!==undefined){areAllNullOrUndefined=false;sum+=value;count++}}if(areAllNullOrUndefined)return null;return(sum/count).toFixed(precision_)}},minAggregator:function(a){var propName_=a;return function(items,cellMetadata){var result=items[0][propName_];for(var i=1;i<items.length;i++){result=Math.min(result,items[i][propName_])}return result}},maxAggregator:function(a){var propName_=a;return function(items,cellMetadata){var result=items[0][propName_];for(var i=1;i<items.length;i++){result=Math.max(result,items[i][propName_])}return result}},countAggregator:function(){return function(items,cellMetadata){return items.length}},$type:new $.ig.Type("OlapUtilities",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapTableView","Object",{a:null,init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);var e=this.b(d);this.a=new $.ig.TableViewImpl(a,b,c,e)},rowHeaders:function(){if(this.a.rowHeaders()==null){return null}return this.a.rowHeaders().inner()},columnHeaders:function(){if(this.a.columnHeaders()==null){return null}return this.a.columnHeaders().inner()},resultCells:function(){if(this.a.resultCells()==null){return null}return this.a.resultCells().inner()},columnSortDirections:function(a){if(arguments.length===1){this.a.columnSortDirections().clear();var c=a.getEnumerator();while(c.moveNext()){var b=c.current();var d=this.c(b);this.a.columnSortDirections().add(d)}return a}else{var e=new $.ig.Array;var g=this.a.columnSortDirections().getEnumerator();while(g.moveNext()){var f=g.current();e.add(this.d(f))}return e}},appliedColumnSortDirections:function(){var b=new $.ig.Array;var d=this.a.appliedColumnSortDirections().getEnumerator();while(d.moveNext()){var c=d.current();b.add(this.d(c))}return b},levelSortDirections:function(a){if(arguments.length===1){this.a.levelSortDirections().clear();var c=a.getEnumerator();while(c.moveNext()){var b=c.current();var d=this.e(b);this.a.levelSortDirections().add(d)}return a}else{var e=new $.ig.Array;var g=this.a.levelSortDirections().getEnumerator();while(g.moveNext()){var f=g.current();e.add(this.f(f))}return e}},appliedLevelSortDirections:function(){var b=new $.ig.Array;var d=this.a.appliedLevelSortDirections().getEnumerator();while(d.moveNext()){var c=d.current();b.add(this.f(c))}return b},appliedSortDirectionsMap:function(){var resultMap_=$.ig.jQueryUtils.prototype.createJavascriptObject();var b=this.a.appliedSortDirectionsMap().getEnumerator();while(b.moveNext()){var i_=b.current();var axisMap_=$.ig.jQueryUtils.prototype.createJavascriptObject();var c=i_.value().getEnumerator();while(c.moveNext()){var j_=c.current();var hierarchyMap_=$.ig.jQueryUtils.prototype.createJavascriptObject();var d=j_.value().getEnumerator();while(d.moveNext()){var k_=d.current();var sortDirection_=k_.value()==$.ig.ListSortDirection.prototype.ascending?"ascending":"descending";hierarchyMap_[k_.key()]=sortDirection_}axisMap_[j_.key()]=hierarchyMap_}resultMap_[i_.key()]=axisMap_}return resultMap_},initialize:function(){this.a.initialize()},b:function(a){var $self=this;var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"isParentInFrontForColumns");var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"isParentInFrontForRows");var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"compactColumnHeaders");var e=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"compactRowHeaders");return function(){var $ret=new $.ig.TableViewSettings;$ret.e(b);$ret.f(c);$ret.h(d);$ret.g(e);return $ret}()},c:function(o_){var $self=this;var a=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(o_,"memberNames");var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(o_,"tupleIndex");var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(o_,"sortDirection");var d=$.ig.ListSortDirection.prototype.ascending;if(!String.isNullOrEmpty(c)){c=c.toLowerCase();if(c=="descending"){d=$.ig.ListSortDirection.prototype.descending}}var comparer_=null;if($.isFunction(o_.comparer)){comparer_=o_.comparer}else{comparer_=function(o1,o2){return parseFloat(o1||-Infinity)-parseFloat(o2||-Infinity)}}return function(){var $ret=new $.ig.TupleSortDirection;$ret.memberNames(a);$ret.tupleIndex(b);$ret.sortDirection(d);$ret.comparer(comparer_);return $ret}()},d:function(a){var b=$.ig.jQueryUtils.prototype.createJavascriptObject();$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"memberNames",a.memberNames());$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"tupleIndex",a.tupleIndex());$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"sortDirection",a.sortDirection()==$.ig.ListSortDirection.prototype.ascending?"ascending":"descending");if(a.comparer()!=null){$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"comparer",a.comparer())}return b},e:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"levelUniqueName");var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"sortDirection");var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"sortBehavior");if(!String.isNullOrEmpty(b)){var e=new $.ig.LevelSortDirection;e.sortDirection($.ig.ListSortDirection.prototype.ascending);e.sortBehavior($.ig.LevelSortBehavior.prototype.system);e.levelUniqueName(b);if(!String.isNullOrEmpty(c)){c=c.toLowerCase();if(c=="descending"){e.sortDirection($.ig.ListSortDirection.prototype.descending)}}if(!String.isNullOrEmpty(d)){d=d.toLowerCase();if(d=="alphabetical"){e.sortBehavior($.ig.LevelSortBehavior.prototype.alphabetical)}}return e}else{return null
}},f:function(a){var b=$.ig.jQueryUtils.prototype.createJavascriptObject();$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"levelUniqueName",a.levelUniqueName());$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"sortDirection",a.sortDirection()==$.ig.ListSortDirection.prototype.ascending?"ascending":"descending");return b},$type:new $.ig.Type("OlapTableView",$.ig.Object.prototype.$type)},true);$.ig.LevelSortBehavior.prototype.alphabetical=0;$.ig.LevelSortBehavior.prototype.system=1;$.ig.OlapMetadataTreeItemType.prototype.cube=0;$.ig.OlapMetadataTreeItemType.prototype.dimension=1;$.ig.OlapMetadataTreeItemType.prototype.group=2;$.ig.OlapMetadataTreeItemType.prototype.userDefinedHierarchy=3;$.ig.OlapMetadataTreeItemType.prototype.systemEnabledHierarchy=4;$.ig.OlapMetadataTreeItemType.prototype.parentChildHierarchy=5;$.ig.OlapMetadataTreeItemType.prototype.measure=6;$.ig.OlapMetadataTreeItemType.prototype.level1=7;$.ig.OlapMetadataTreeItemType.prototype.level2=8;$.ig.OlapMetadataTreeItemType.prototype.level3=9;$.ig.OlapMetadataTreeItemType.prototype.level4=10;$.ig.OlapMetadataTreeItemType.prototype.level5=11;$.ig.MeasureListLocation.prototype.rows=0;$.ig.MeasureListLocation.prototype.columns=1;$.ig.HeaderCellsLayoutOrientation.prototype.horizontal=0;$.ig.HeaderCellsLayoutOrientation.prototype.vertical=1;$.ig.MemberType.prototype.unknown=0;$.ig.MemberType.prototype.regular=0;$.ig.MemberType.prototype.all=1;$.ig.MemberType.prototype.measure=2;$.ig.MemberType.prototype.formula=3;$.ig.CardinalityType.prototype.one=0;$.ig.CardinalityType.prototype.many=1;$.ig.AggregatorType.prototype.unknown=0;$.ig.AggregatorType.prototype.sum=1;$.ig.AggregatorType.prototype.count=2;$.ig.AggregatorType.prototype.min=3;$.ig.AggregatorType.prototype.max=4;$.ig.AggregatorType.prototype.average=5;$.ig.AggregatorType.prototype.variance=6;$.ig.AggregatorType.prototype.std=7;$.ig.AggregatorType.prototype.distinctCount=8;$.ig.AggregatorType.prototype.none=9;$.ig.AggregatorType.prototype.averageOfChildren=10;$.ig.AggregatorType.prototype.firstNonEmpty=13;$.ig.AggregatorType.prototype.lastNonEmpty=14;$.ig.AggregatorType.prototype.byAccount=15;$.ig.AggregatorType.prototype.calculated=127;$.ig.HierarchyOrigin.prototype.userDefined=1;$.ig.HierarchyOrigin.prototype.systemEnabled=2;$.ig.HierarchyOrigin.prototype.systemInternal=4;$.ig.DimensionType.prototype.unknown=0;$.ig.DimensionType.prototype.time=1;$.ig.DimensionType.prototype.measure=2;$.ig.DimensionType.prototype.other=3;$.ig.DimensionType.prototype.quantitative=5;$.ig.DimensionType.prototype.accounts=6;$.ig.DimensionType.prototype.customers=7;$.ig.DimensionType.prototype.products=8;$.ig.DimensionType.prototype.scenario=9;$.ig.DimensionType.prototype.utility=10;$.ig.DimensionType.prototype.currency=11;$.ig.DimensionType.prototype.rates=12;$.ig.DimensionType.prototype.channel=13;$.ig.DimensionType.prototype.promotion=14;$.ig.DimensionType.prototype.organization=15;$.ig.DimensionType.prototype.billOfMaterials=16;$.ig.DimensionType.prototype.geography=17;$.ig.CubeType.prototype.cube=0;$.ig.CubeType.prototype.dimension=1;$.ig.CubeType.prototype.unknown=2;$.ig.AxisDefinitionParser.prototype.a="[";$.ig.AxisDefinitionParser.prototype.b="]";$.ig.AxisDefinitionParser.prototype.c="{";$.ig.AxisDefinitionParser.prototype.d="}";$.ig.AxisDefinitionParser.prototype.e=",";$.ig.util.extCopy($.ig.TaskExtensions,[[[$.ig.Task],["continueWithTask$1"]],[[$.ig.Task$1],["continueWithTask$21"]]]);$.ig.util.extCopy($.ig.Enumerable,[[[$.ig.ArrayListCollection$1],["where$1","where$11111","select$2","selectMany$2","last$1","first$1","firstOrDefault$1","orderBy$2","orderByDescending$2","toList$1","concat$1","max","max$111","min","min$111","count$1","reverse$1","take$1","skip$1","any$1","contains$1","union$1","toArray$1","elementAt$1"]],[[$.ig.ArrayListCollection$1],["ofType$1","cast$1"]]]);$.ig.util.extCopy($.ig.Queryable,[[[$.ig.ArrayListCollection$1],["asQueryable"]]]);$.ig=$.ig||{};$.ig.util.bulkDefine(["IConnection","IXmlaDataProvider","XmlaDataProvider","CatalogConstants","ColumnsConstants","ProviderTypeConstants","TableConstants","DbSchemaConstants","CatalogRestrictions","ColumnsRestrictions","ProviderTypeRestrictions","TableRestrictions","CubeConstants","DimensionConstants","HierarchyConstants","InstanceConstants","LevelConstants","MeasureConstants","MeasureGroupConstants","MeasureGroupDimensionConstants","MemberConstants","OlapSchemaConstants","CubeRestrictions","DimensionRestrictions","HierarchyRestrictions","LevelRestrictions","MeasureRestrictions","MeasureGroupRestrictions","MeasureGroupDimensionRestrictions","MemberRestrictions","ICoreXmlaConnection","ArraySerializer","IXmlTypeSerializer$1","AxisXmlTypeSerializer","TupleXmlTypeSerializer","AxisMemberXmlTypeSerializer","CellXmlTypeSerializer","CubeXmlTypeSerializer","DatabaseXmlTypeSerializer","DimensionXmlTypeSerializer","ErrorXmlTypeSerializer","HierarchyXmlTypeSerializer","LevelXmlTypeSerializer","MeasureGroupDimensionXmlTypeSerializer","MeasureGroupXmlTypeSerializer","MeasureXmlTypeSerializer","MemberXmlTypeSerializer","ResultXmlTypeSerializer","SerializerUtils","XmlaConstants","XmlaSoapFaultXmlTypeSerializer","IXmlaMethodResult","XmlaSoapMethodResult","DiscoverResponseResult","XmlaSoapMessageHeader","FaultError","RequestCompletedEventArgs$1","ExecuteResponseResult","FaultDetail","IXmlaSoapMethod","XmlaNamespace","XmlaPropertiesCollection","XmlaQueryProperty","XmlaSoapFault","XmlaSoapMessageBuilder","XmlaSoapMethod","XmlaSoapMethodDiscover","XmlaSoapMethodExecute","XmlaSoapWebClient","XmlaSoapWebClient$1","Session","IMdxExpression","IMdxElement","IAxisFilterElement","IMdxAxis","IMdxAxisProvider","IMdxCalculatedMembersCacheProvider","IMdxCollectionElement","IMdxDimensionAxisProvider","IMdxFilterInfo","IMdxExtendedFilterInfo","IMdxItemElement","IMdxQuery","IMdxSet","MdxAxis","MdxAxisFilterElement","MdxCalculatedMembersCache","MdxElement","MdxSingleElement","MdxDimensionMember","MdxChildrenCollectionElement","MdxConstantElement","MdxElementCollectionElement","MdxElementType","MdxLevelMembersElement","MdxQueryBuilder","MdxSet","MdxSettings","MdxAxisSettings","MdxSlicerAxisSettings","MdxDimensionAxisSettings","MdxSetSettings","IMdxSlicerAxis","MdxSlicerAxis","MdxSlicerSet","MdxDimensionAxisCreateMode","MdxDimensionAxisProvider","MdxSlicerAxisProvider","MdxSlicerAxisBuilder","IXmlaDataProviderFactory","DefaultXmlaDataProviderFactory","RemoteXmlaDataProviderFactory","IRemoteXmlaRequestSerializer","IRemoteXmlaResponseSerializer","JsonRemoteXmlaRequestSerializer","JsonRemoteXmlaResponseSerializer","ArrayJsonSerializer","IJsonTypeSerializer$1","JsonTypeSeriazlierBase$1","AxisJsonTypeSeriazlier","AxisMemberJsonTypeSeriazlier","CatalogJsonTypeSeriazlier","CellJsonTypeSeriazlier","CubeJsonTypeSeriazlier","DimensionJsonTypeSeriazlier","HierarchyJsonTypeSeriazlier","JsonSerializerUtils","LevelJsonTypeSeriazlier","MeasureGroupDimensionJsonTypeSeriazlier","MeasureGroupJsonTypeSeriazlier","MeasureJsonTypeSeriazlier","MemberJsonTypeSeriazlier","RemoteXmlaRequestJsonTypeSeriazlier","ResultJsonTypeSeriazlier","TupleJsonTypeSeriazlier","RemoteXmlaDataProvder","RemoteXmlaRequest","RemoteXmlaRequestType","XmlaConnection","XmlaDataSourceImpl","PositionInfo","XmlaDiscoverProperties","XmlaDataSourceOptions","RequestOptions","CustomRemoteXmlaRequestSerializer","CustomRemoteXmlaResponseSerializer","OlapXmlaDataSource","Object","MulticastDelegate","Action","Action$1","Action$2","Action$3","Action$4","Action$5","Action$6","Action$7","Action$8","IEqualityComparer$1","IEnumerable","ICollection","IDictionary","IList","Array","Array","Comparison$1","Attribute","BrowsableAttribute","EventArgs","CancelEventArgs","DesignTimeVisibleAttribute","EditorBrowsableAttribute","ValueType","Enum","EditorBrowsableState","ISupportInitialize","ITypeDescriptorContext","TypeConverter","TypeConverterAttribute","WinMDTypeAttribute","WinMDPropertyToObjectTypeAttribute","Error","IFormatProvider","NotSupportedException","ObsoleteAttribute","MemberInfo","MethodBase","ConstructorInfo","IComparable","Date","Number","SuppressMessageAttribute","EventHandler$1","PlaceholderSystemCollectionsObjectModel","PlaceholderSystemCollectionsSpecialized","PlaceholderSystemWindows","PlaceholderSystemWindowsControls","PlaceholderSystemWindowsData","PlaceholderSystemWindowsInput","PlaceholderSystemWindowsMarkup","PlaceholderSystemWindowsMediaImaging","PlaceholderSystemWindowsShapes","PlaceholderSystemWindowsControlsPrimitives","PlaceholderSystemWindowsAutomation","PlaceholderSystemWindowsAutomationPeers","PlaceholderSystemText","PlaceholderSystemGlobalization","PlaceholderSystemWindowsDocuments","PlaceholderSystemWindowsInk","PlaceholderSystemWindowsMediaAnimation","PlaceholderSystemWindowsMediaEffects","PlaceholderSystemWindowsThreading","PlaceholderInfragisticsControlerChartsAutomationPeers","FlagsAttribute","Func$1","Func$2","Func$3","Func$4","Func$5","Func$6","Func$7","Func$8","Func$9","Math","XMLHttpRequest","Nullable$1","Number","ParamArrayAttribute","Array","AttributeTargets","AttributeUsageAttribute","Boolean","Number","String","Array","CompareCallback","Dictionary","DictionaryEntry","IEnumerator","INotifyPropertyChanged","PropertyChangedEventArgs","PropertyChangedEventHandler","CultureInfo","Delegate","Number","IDisposable","Number","Number","Number","IntPtr","ReflectionUtil","AssemblyTitleAttribute","AssemblyCompanyAttribute","AssemblyConfigurationAttribute","AssemblyCopyrightAttribute","AssemblyCultureAttribute","AssemblyDescriptionAttribute","AssemblyFileVersionAttribute","AssemblyProductAttribute","AssemblyTrademarkAttribute","AssemblyVersionAttribute","DefaultMemberAttribute","MethodInfo","ParameterInfo","PropertyInfo","RuntimeFieldHandle","RuntimeTypeHandle","ClientScriptAttribute","ClientNameAttribute","DontObfuscateAttribute","EmitIgnoreTypeAttribute","ExtensionAttribute","GlobalMemberAttribute","IgnoreAttribute","InlineItemAccessAttribute","InlinePropertyAttribute","InternalsVisibleToAttribute","KeepOriginalNameAttribute","LiteralStringAttribute","NativeMethodAttribute","NativePropertyAttribute","NativeTypeAttribute","RuntimeHelpers","WeakAttribute","WidgetAttribute","MainWidgetAttribute","SuppressWidgetMemberAttribute","SuppressWidgetMemberCopyAttribute","WidgetDefaultStringAttribute","WidgetDefaultNumberAttribute","WidgetDefaultBooleanAttribute","MvcEnumSetStringEnumAttribute","WidgetModuleAttribute","WidgetModuleParentAttribute","WidgetIgnoreDependsAttribute","ComVisibleAttribute","GuidAttribute","OutAttribute","DataContractAttribute","DataMemberAttribute","WaitHandle","EventWaitHandle","Monitor","TypeCode","TargetFrameworkAttribute","Number","Script","Single","String","ManualResetEvent","Thread","Date","Type","Number","Number","Number","UIntPtr","XmlAttributeAttribute","XmlElementAttribute","XmlEnumAttribute","XmlIgnoreAttribute","XmlRootAttribute","XmlTypeAttribute","XmlNode","XmlAttribute","XmlDocument","XmlDocumentParser","XmlLinkedNode","XmlElement","Void","XmlNodeList","XmlNamedNodeMap","XmlNodeType","XmlSchemaForm","ICoreOlapElement","Cube","Catalog","Dimension","CubeType","ScopeType","DimensionType","LevelType","HierarchyOrigin","AggregatorType","CardinalityType","MemberType","Hierarchy","Level","Measure","MeasureGroup","MeasureGroupDimension","Member","OlapResult","OlapResultAxis","IPosition$2","OlapResultTuple","IPositionItem$2","IHierarchicalPositionItem$2","OlapResultAxisMember","OlapResultCell","HeaderCellsLayoutOrientation","LevelSpanManager","SpanSource","ITableViewHeadersFactory","TableViewHeadersFactory","TableCompactViewHeadersFactory","TableViewHeaderCellSource","TableViewImpl","TableViewSettings","OlapResultView","ResultViewHelper","OlapTableViewHeaderCell","OlapTableViewResultCell","ArrayListCollection$1","IOlapDataSource","MeasureList","MeasureListLocation","OlapMetadataTreeItemType","OlapMetadataTreeItem","MetaTreeHelper","HierarchyItemPosition","MeasureGroupMetaItemsCache","DataSourceBaseOptions","CubeMetaItemsCache","SourceInitHelper","AxisDefinitionParser","CoreOlapElementType","CoreOlapElementParseResult","CoreOlapElementParser","AxisElement","PivotActionStatus","PivotAction","AxisItemsChangeType","AxisChangedAction","AxisItemsChangedAction","ExpansionStateChangeType","ExpansionStateChangedAction","PivotActionManager","KeyValueItem","PositionItemInfo$2","PositionResolver$2","LevelSortDirection","LevelSortBehavior","TaskExtensions","HierarchyFilterView","FilterMember","FilterMemberStateChangedEventArgs","ResultSorter$1","ResultHeaderSorter","AxisTupleVisitor","AxisHeaderSortingVisitor","ResultColumnValueSorter","AxisValueSortingVisitor","TupleSortDirection","DataSourceBase","jQueryUtils","OlapUtilities","OlapTableView","AbstractEnumerable","AbstractEnumerator","IEnumerable$1","ICollection$1","IList$1","IArrayList","List$1","Collection$1","IDictionary$2","Dictionary$2","GenericEnumerable$1","IEnumerator$1","GenericEnumerator$1","INotifyCollectionChanged","NotifyCollectionChangedEventHandler","NotifyCollectionChangedEventArgs","NotifyCollectionChangedAction","KeyValuePair$2","LinkedList$1","LinkedListNode$1","ObservableCollection$1","Queue$1","ReadOnlyCollection$1","ReadOnlyObservableCollection$1","NameValueCollection","Stack$1","IComparer$1","Expression","MemberExpression","ParameterExpression","LambdaExpression","MethodCallExpression","IOrderedEnumerable$1","Queryable","Enumerable","SortedList$1","IGrouping$2","IArray","DependencyObject","Test","IQueryable","IQueryable$1","IQueryProvider","Activator","AggregateException","ArgumentException","ArgumentNullException","ArgumentOutOfRangeException","AsyncCompletedEventArgs","AsyncCompletedEventHandler","ListSortDirection","Convert","Environment","InvalidOperationException","Debug","IEquatable$1","BinaryReader","ICredentials","NetworkCredential","UploadStringCompletedEventHandler","UploadStringCompletedEventArgs","WebClient","WebHeaderCollection","FaultCode","FaultException","FaultException$1","FaultReason","StringBuilder","BinaryFileDownloader","NotImplementedException","Random","Encoding","UTF8Encoding","Task","Task$1","TaskCompletionSource$1","TaskFactory","TaskStatus","Tuple$2","Uri","JavaScriptSerializer","UIElement","UIElementCollection","FrameworkElement","Control","ContentControl","Panel","Canvas","Image","TextBlock","DataTemplate","DataTemplatePassInfo","DataTemplateMeasureInfo","DataTemplateRenderInfo","DataTemplateRenderHandler","DataTemplateMeasureHandler","DataTemplatePassHandler","Binding","DependencyProperty","UnsetValue","DependencyPropertiesCollection","DependencyPropertyChangedEventArgs","Key","ModifierKeys","MouseEventArgs","MouseButtonEventArgs","Brush","Color","DoubleCollection","FillRule","GeometryType","Geometry","GeometryCollection","GeometryGroup","LineGeometry","RectangleGeometry","EllipseGeometry","PathGeometry","PathFigure","PathFigureCollection","PathSegmentType","PathSegment","PathSegmentCollection","LineSegment","BezierSegment","PolyBezierSegment","PolyLineSegment","ArcSegment","SweepDirection","HorizontalAlignment","PenLineCap","Stretch","Transform","RotateTransform","TranslateTransform","TransformGroup","TransformCollection","VerticalAlignment","Point","PointCollection","PropertyChangedCallback","CoerceValueCallback","PropertyMetadata","PropertyPath","Rect","Shape","Line","Path","Polygon","Polyline","Rectangle","Size","Style","StyleTypedPropertyAttribute","TemplatePartAttribute","TemplateVisualStateAttribute","Visibility","XObject","XAttribute","XNode","XContainer","XDocument","XElement","XmlUtils","XName","XNamespace","Element","CanvasElement","console","DivElement","Document","ElementAttribute","ElementAttributeCollection","ElementCollection","ElementEventHandler","ElementNodeType","EventListener","IElementEventHandler","ImageElement","CanvasContext","CanvasContext2D","ImageData","Gradient","TextMetrics","MSGesture","WebStyle","window","Callback","JQuery","JQueryDeferred","JQueryEvent","JQueryObject","JQueryCallback","JQueryUICallback","JQueryPosition","JQueryPromise"]);$.ig.util.defType("RemoteXmlaRequestType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("RemoteXmlaRequestType",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MdxElementType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("MdxElementType",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaSoapMessageHeader","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("XmlaSoapMessageHeader",$.ig.Object.prototype.$type)},true);$.ig.util.defType("IXmlaDataProvider","Object",{$type:new $.ig.Type("IXmlaDataProvider",null)},true);$.ig.util.defType("XmlaDataProvider","Object",{a:null,b:null,init:function(a,b){$.ig.Object.prototype.init.call(this);this.a=a;this.b=b},discoverCatalogsAsync:function(a,b){return this.d($.ig.Catalog.prototype.$type,new $.ig.DatabaseXmlTypeSerializer,$.ig.DbSchemaConstants.prototype.a,a,b)},discoverCubesAsync:function(a,b){return this.d($.ig.Cube.prototype.$type,new $.ig.CubeXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.a,a,b)},discoverDimensionsAsync:function(a,b){return this.d($.ig.Dimension.prototype.$type,new $.ig.DimensionXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.b,a,b)},discoverHierarchiesAsync:function(a,b){return this.d($.ig.Hierarchy.prototype.$type,new $.ig.HierarchyXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.f,a,b)},discoverLevelsAsync:function(a,b){return this.d($.ig.Level.prototype.$type,new $.ig.LevelXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.g,a,b)},discoverMeasuresAsync:function(a,b){return this.d($.ig.Measure.prototype.$type,new $.ig.MeasureXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.e,a,b)},discoverMeasureGroupsAsync:function(a,b){return this.d($.ig.MeasureGroup.prototype.$type,new $.ig.MeasureGroupXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.c,a,b)},discoverMeasureGroupDimensionsAsync:function(a,b){return this.d($.ig.MeasureGroupDimension.prototype.$type,new $.ig.MeasureGroupDimensionXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.d,a,b)},discoverMembersAsync:function(a,b){return this.d($.ig.Member.prototype.$type,new $.ig.MemberXmlTypeSerializer,$.ig.OlapSchemaConstants.prototype.h,a,b)},executeStatementAsync:function(a,b,c){var $self=this;var d=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);var e=this.a.getXmlaSoapWebClient$1($.ig.ExecuteResponseResult.prototype.$type);var f=new $.ig.ResultXmlTypeSerializer;e.requestCompleted=$.ig.Delegate.prototype.combine(e.requestCompleted,function(g,h){return $self.j($.ig.OlapResult.prototype.$type,f,h,d)});var i=new $.ig.XmlaSoapMethodExecute(a);this.f(i,b,c);e.q(i);return d.d()},d:function($t,a,b,c,d){var $self=this;var e=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($t),0);var f=this.a.getXmlaSoapWebClient$1($.ig.DiscoverResponseResult.prototype.$type);f.requestCompleted=$.ig.Delegate.prototype.combine(f.requestCompleted,function(g,h){return $self.h($t,a,h,e)});var i=new $.ig.XmlaSoapMethodDiscover(b);this.e(i,c,d);f.q(i);return e.d()},e:function(a,b,c){if(c!=null){var e=c.getEnumerator();while(e.moveNext()){var d=e.current();a.u().add(d.c(),d.d())}}if(b!=null){var g=b.getEnumerator();while(g.moveNext()){var f=g.current();a.properties().add(new $.ig.XmlaQueryProperty(1,f.c(),f.d()))}}if(this.b!=null){this.b(a)}},f:function(a,b,c){if(c!=null){var e=c.getEnumerator();while(e.moveNext()){var d=e.current()}}if(b!=null){var g=b.getEnumerator();while(g.moveNext()){var f=g.current();a.properties().add(new $.ig.XmlaQueryProperty(1,f.c(),f.d()))}}if(this.b!=null){this.b(a)}},h:function($t,a,b,c){if(b.error()!=null){c.h(b.error())}else if(b.cancelled()){c.g()}else{var d=b.result();if(d!=null){var e=new $.ig.ArraySerializer;var f=e.b($t,b.result().returnElement(),$.ig.XName.prototype.i("row",$.ig.XmlaNamespace.prototype.d),a);c.i(f)}}},j:function($t,a,b,c){if(b.error()!=null){c.h(b.error())}else if(b.cancelled()){c.g()}else{var d=b.result();if(d!=null){var e=a.deserialize(b.result().returnElement());c.i(e)}}},$type:new $.ig.Type("XmlaDataProvider",$.ig.Object.prototype.$type,[$.ig.IXmlaDataProvider.prototype.$type])},true);$.ig.util.defType("CatalogConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("CatalogConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DbSchemaConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("DbSchemaConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CubeConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("CubeConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DimensionConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("DimensionConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("HierarchyConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("InstanceConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("InstanceConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("LevelConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("LevelConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MeasureConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureGroupConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MeasureGroupConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureGroupDimensionConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MeasureGroupDimensionConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MemberConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MemberConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapSchemaConstants","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("OlapSchemaConstants",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CubeRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("CubeRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DimensionRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("DimensionRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("HierarchyRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("LevelRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("LevelRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MeasureRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureGroupRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MeasureGroupRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureGroupDimensionRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MeasureGroupDimensionRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MemberRestrictions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MemberRestrictions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ICoreXmlaConnection","Object",{$type:new $.ig.Type("ICoreXmlaConnection",null,[$.ig.IConnection.prototype.$type])},true);$.ig.util.defType("ArraySerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},b:function($t,a,b,c){var d=new $.ig.List$1($t,0);var f=a.h(b).getEnumerator();while(f.moveNext()){var e=f.current();d.add(c.deserialize(e))}return d},$type:new $.ig.Type("ArraySerializer",$.ig.Object.prototype.$type)},true);$.ig.util.defType("IXmlTypeSerializer$1","Object",{$type:new $.ig.Type("IXmlTypeSerializer$1",null)},true);$.ig.util.defType("AxisXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this);if($.ig.AxisXmlTypeSerializer.prototype.a!=null){return}$.ig.AxisXmlTypeSerializer.prototype.a=new $.ig.Dictionary$2(String,$.ig.XName.prototype.$type,0);$.ig.AxisXmlTypeSerializer.prototype.a.item("0",$.ig.XName.prototype.i("Tuple",$.ig.XmlaNamespace.prototype.c));$.ig.AxisXmlTypeSerializer.prototype.a.item("1",$.ig.XName.prototype.i("Tuples",$.ig.XmlaNamespace.prototype.c))},deserialize:function(a){var $self=this;if(a.b()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.b(b.p($.ig.XName.prototype.i("name","")));var d=b.f($.ig.AxisXmlTypeSerializer.prototype.a.item("1"));var e=new $.ig.ArraySerializer;var f=e.b($.ig.OlapResultTuple.prototype.$type,d,$.ig.AxisXmlTypeSerializer.prototype.a.item("0"),new $.ig.TupleXmlTypeSerializer);var g=0;if(f.count()>0){g=f.__inner[0].members().count()}return function(){var $ret=new $.ig.OlapResultAxis(f,g);$ret.name(c);return $ret}()},$type:new $.ig.Type("AxisXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.OlapResultAxis.prototype.$type)])},true);$.ig.util.defType("TupleXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this);if($.ig.TupleXmlTypeSerializer.prototype.a!=null){return}$.ig.TupleXmlTypeSerializer.prototype.a=new $.ig.Dictionary$2(String,$.ig.XName.prototype.$type,0);$.ig.TupleXmlTypeSerializer.prototype.a.item("0",$.ig.XName.prototype.i("Member",$.ig.XmlaNamespace.prototype.c))},deserialize:function(a){if(a.b()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=new $.ig.ArraySerializer;var d=c.b($.ig.OlapResultAxisMember.prototype.$type,b,$.ig.TupleXmlTypeSerializer.prototype.a.item("0"),new $.ig.AxisMemberXmlTypeSerializer);var e=new $.ig.OlapResultTuple(d);var g=d.getEnumerator();while(g.moveNext()){var f=g.current();f.position(e)}return e},$type:new $.ig.Type("TupleXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.OlapResultTuple.prototype.$type)])},true);$.ig.util.defType("AxisMemberXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this);if($.ig.AxisMemberXmlTypeSerializer.prototype.a!=null){return}$.ig.AxisMemberXmlTypeSerializer.prototype.a=new $.ig.Dictionary$2(String,$.ig.XName.prototype.$type,0);$.ig.AxisMemberXmlTypeSerializer.prototype.a.item("0",$.ig.XName.prototype.i("UName",$.ig.XmlaNamespace.prototype.c));$.ig.AxisMemberXmlTypeSerializer.prototype.a.item("1",$.ig.XName.prototype.i("LName",$.ig.XmlaNamespace.prototype.c));$.ig.AxisMemberXmlTypeSerializer.prototype.a.item("2",$.ig.XName.prototype.i("Caption",$.ig.XmlaNamespace.prototype.c));$.ig.AxisMemberXmlTypeSerializer.prototype.a.item("3",$.ig.XName.prototype.i("LNum",$.ig.XmlaNamespace.prototype.c));$.ig.AxisMemberXmlTypeSerializer.prototype.a.item("4",$.ig.XName.prototype.i("DisplayInfo",$.ig.XmlaNamespace.prototype.c))},deserialize:function(a){var $self=this;if(a.b()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.a(b.f($.ig.AxisMemberXmlTypeSerializer.prototype.a.item("0")));var d=$.ig.SerializerUtils.prototype.a(b.f($.ig.AxisMemberXmlTypeSerializer.prototype.a.item("1")));var e=$.ig.SerializerUtils.prototype.a(b.f($.ig.AxisMemberXmlTypeSerializer.prototype.a.item("2")));var f=$.ig.SerializerUtils.prototype.a(b.f($.ig.AxisMemberXmlTypeSerializer.prototype.a.item("3")));var g=$.ig.SerializerUtils.prototype.a(b.f($.ig.AxisMemberXmlTypeSerializer.prototype.a.item("4")));var h=b.p($.ig.XName.prototype.i("Hierarchy","")).f();var i=function(){var $ret=new $.ig.OlapResultAxisMember;$ret.hierarchyUniqueName(h);$ret.levelUniqueName(d);$ret.levelNumber($.ig.Number.prototype.parseInt(f));$ret.uniqueName(c);$ret.caption(e);$ret.displayInfo(String.isNullOrEmpty(g)?0:$.ig.Number.prototype.parseInt(g));return $ret}();var k=b.g().getEnumerator();while(k.moveNext()){var j=k.current();switch(j.l().c()){case"UName":case"LName":case"Caption":case"LNum":case"DisplayInfo":continue;default:i.properties().add(j.l().c(),j.k());break}}return i},$type:new $.ig.Type("AxisMemberXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.OlapResultAxisMember.prototype.$type)])},true);$.ig.util.defType("CellXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.b()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=b.p($.ig.XName.prototype.i("CellOrdinal","")).f();var d=function(){var $ret=new $.ig.OlapResultCell;$ret.cellOrdinal($.ig.Number.prototype.parseInt(c));return $ret}();var f=b.g().getEnumerator();while(f.moveNext()){var e=f.current();d.properties().add(e.l().c(),e.k())}return d},$type:new $.ig.Type("CellXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.OlapResultCell.prototype.$type)])},true);$.ig.util.defType("CubeXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.b()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.CubeConstants.prototype.c,$.ig.XmlaNamespace.prototype.d)));var d=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.CubeConstants.prototype.l,$.ig.XmlaNamespace.prototype.d)));var e=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.CubeConstants.prototype.g,$.ig.XmlaNamespace.prototype.d)));var f;var g=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.CubeConstants.prototype.d,$.ig.XmlaNamespace.prototype.d)));switch(g){case $.ig.XmlaConstants.prototype.j:f=$.ig.CubeType.prototype.cube;break;case $.ig.XmlaConstants.prototype.k:f=$.ig.CubeType.prototype.dimension;break;default:f=$.ig.CubeType.prototype.unknown;break}var h=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.CubeConstants.prototype.a,$.ig.XmlaNamespace.prototype.d)));var i=$.ig.SerializerUtils.prototype.d(b.f($.ig.XName.prototype.i($.ig.CubeConstants.prototype.f,$.ig.XmlaNamespace.prototype.d)));var j=$.ig.SerializerUtils.prototype.d(b.f($.ig.XName.prototype.i($.ig.CubeConstants.prototype.e,$.ig.XmlaNamespace.prototype.d)));return function(){var $ret=new $.ig.Cube;$ret.name(c);$ret.caption(d);$ret.description(e);$ret.cubeType(f);$ret.catalogName(h);$ret.lastProcessed(i);$ret.lastUpdated(j);return $ret}()},$type:new $.ig.Type("CubeXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.Cube.prototype.$type)])},true);$.ig.util.defType("DatabaseXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.b()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.CatalogConstants.prototype.a,$.ig.XmlaNamespace.prototype.d)));var d=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.CatalogConstants.prototype.b,$.ig.XmlaNamespace.prototype.d)));return function(){var $ret=new $.ig.Catalog;$ret.name(c);$ret.caption(c);$ret.uniqueName(c);$ret.description(d);return $ret}()},$type:new $.ig.Type("DatabaseXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.Catalog.prototype.$type)])},true);$.ig.util.defType("DimensionXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this);
if($.ig.DimensionXmlTypeSerializer.prototype.a!=null){return}$.ig.DimensionXmlTypeSerializer.prototype.a=new $.ig.Dictionary$2(String,$.ig.XName.prototype.$type,0);$.ig.DimensionXmlTypeSerializer.prototype.a.item($.ig.DimensionConstants.prototype.d,$.ig.XName.prototype.i($.ig.DimensionConstants.prototype.d,$.ig.XmlaNamespace.prototype.d));$.ig.DimensionXmlTypeSerializer.prototype.a.item($.ig.DimensionConstants.prototype.e,$.ig.XName.prototype.i($.ig.DimensionConstants.prototype.e,$.ig.XmlaNamespace.prototype.d));$.ig.DimensionXmlTypeSerializer.prototype.a.item($.ig.DimensionConstants.prototype.f,$.ig.XName.prototype.i($.ig.DimensionConstants.prototype.f,$.ig.XmlaNamespace.prototype.d));$.ig.DimensionXmlTypeSerializer.prototype.a.item($.ig.DimensionConstants.prototype.k,$.ig.XName.prototype.i($.ig.DimensionConstants.prototype.k,$.ig.XmlaNamespace.prototype.d));$.ig.DimensionXmlTypeSerializer.prototype.a.item($.ig.DimensionConstants.prototype.h,$.ig.XName.prototype.i($.ig.DimensionConstants.prototype.h,$.ig.XmlaNamespace.prototype.d));$.ig.DimensionXmlTypeSerializer.prototype.a.item($.ig.DimensionConstants.prototype.j,$.ig.XName.prototype.i($.ig.DimensionConstants.prototype.j,$.ig.XmlaNamespace.prototype.d))},deserialize:function(a){var $self=this;if(a.b()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.a(b.f($.ig.DimensionXmlTypeSerializer.prototype.a.item($.ig.DimensionConstants.prototype.d)));var d=$.ig.SerializerUtils.prototype.a(b.f($.ig.DimensionXmlTypeSerializer.prototype.a.item($.ig.DimensionConstants.prototype.e)));var e=$.ig.SerializerUtils.prototype.a(b.f($.ig.DimensionXmlTypeSerializer.prototype.a.item($.ig.DimensionConstants.prototype.f)));var f=$.ig.SerializerUtils.prototype.a(b.f($.ig.DimensionXmlTypeSerializer.prototype.a.item($.ig.DimensionConstants.prototype.k)));var g=$.ig.SerializerUtils.prototype.a(b.f($.ig.DimensionXmlTypeSerializer.prototype.a.item($.ig.DimensionConstants.prototype.h)));var h=$.ig.Number.prototype.parseInt(g);var i=$.ig.SerializerUtils.prototype.a(b.f($.ig.DimensionXmlTypeSerializer.prototype.a.item($.ig.DimensionConstants.prototype.j)));return function(){var $ret=new $.ig.Dimension;$ret.name(c);$ret.uniqueName(d);$ret.caption(e);$ret.description(f);$ret.dimensionType(h);$ret.defaultHierarchy(i);return $ret}()},$type:new $.ig.Type("DimensionXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.Dimension.prototype.$type)])},true);$.ig.util.defType("FaultError","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_errorCode:null,errorCode:function(a){if(arguments.length===1){this._errorCode=a;return a}else{return this._errorCode}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_source:null,source:function(a){if(arguments.length===1){this._source=a;return a}else{return this._source}},_helpFile:null,helpFile:function(a){if(arguments.length===1){this._helpFile=a;return a}else{return this._helpFile}},_severity:null,severity:function(a){if(arguments.length===1){this._severity=a;return a}else{return this._severity}},$type:new $.ig.Type("FaultError",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ErrorXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var b=new $.ig.FaultError;var c=a;b.errorCode($.ig.SerializerUtils.prototype.b(c.p($.ig.XName.prototype.i("ErrorCode",""))));b.description($.ig.SerializerUtils.prototype.b(c.p($.ig.XName.prototype.i("Description",""))));b.source($.ig.SerializerUtils.prototype.b(c.p($.ig.XName.prototype.i("Source",""))));b.helpFile($.ig.SerializerUtils.prototype.b(c.p($.ig.XName.prototype.i("HelpFile",""))));b.severity($.ig.SerializerUtils.prototype.b(c.p($.ig.XName.prototype.i("Severity",""))));return b},$type:new $.ig.Type("ErrorXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.FaultError.prototype.$type)])},true);$.ig.util.defType("HierarchyXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this);if($.ig.HierarchyXmlTypeSerializer.prototype.a!=null){return}$.ig.HierarchyXmlTypeSerializer.prototype.a=new $.ig.Dictionary$2(String,$.ig.XName.prototype.$type,0);$.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.d,$.ig.XName.prototype.i($.ig.HierarchyConstants.prototype.d,$.ig.XmlaNamespace.prototype.d));$.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.e,$.ig.XName.prototype.i($.ig.HierarchyConstants.prototype.e,$.ig.XmlaNamespace.prototype.d));$.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.f,$.ig.XName.prototype.i($.ig.HierarchyConstants.prototype.f,$.ig.XmlaNamespace.prototype.d));$.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.k,$.ig.XName.prototype.i($.ig.HierarchyConstants.prototype.k,$.ig.XmlaNamespace.prototype.d));$.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.i,$.ig.XName.prototype.i($.ig.HierarchyConstants.prototype.i,$.ig.XmlaNamespace.prototype.d));$.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.j,$.ig.XName.prototype.i($.ig.HierarchyConstants.prototype.j,$.ig.XmlaNamespace.prototype.d));$.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.c,$.ig.XName.prototype.i($.ig.HierarchyConstants.prototype.c,$.ig.XmlaNamespace.prototype.d));$.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.u,$.ig.XName.prototype.i($.ig.HierarchyConstants.prototype.u,$.ig.XmlaNamespace.prototype.d));$.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.t,$.ig.XName.prototype.i($.ig.HierarchyConstants.prototype.t,$.ig.XmlaNamespace.prototype.d))},deserialize:function(a){var $self=this;if(a.b()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.a(b.f($.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.d)));var d=$.ig.SerializerUtils.prototype.a(b.f($.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.e)));var e=$.ig.SerializerUtils.prototype.a(b.f($.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.f)));var f=$.ig.SerializerUtils.prototype.a(b.f($.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.k)));var g=$.ig.SerializerUtils.prototype.a(b.f($.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.i)));var h=$.ig.SerializerUtils.prototype.a(b.f($.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.j)));var i=$.ig.SerializerUtils.prototype.a(b.f($.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.c)));var j=$.ig.SerializerUtils.prototype.a(b.f($.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.u)));var k=$.ig.SerializerUtils.prototype.a(b.f($.ig.HierarchyXmlTypeSerializer.prototype.a.item($.ig.HierarchyConstants.prototype.t)));var l=k==null?1:$.ig.Number.prototype.parseInt(k);return function(){var $ret=new $.ig.Hierarchy;$ret.name(c);$ret.uniqueName(d);$ret.caption(e);$ret.description(f);$ret.defaultMember(g);$ret.allMember(h);$ret.dimensionUniqueName(i);$ret.hierarchyDisplayFolder(j);$ret.hierarchyOrigin(l);return $ret}()},$type:new $.ig.Type("HierarchyXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.Hierarchy.prototype.$type)])},true);$.ig.util.defType("LevelXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.b()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.LevelConstants.prototype.e,$.ig.XmlaNamespace.prototype.d)));var d=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.LevelConstants.prototype.f,$.ig.XmlaNamespace.prototype.d)));var e=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.LevelConstants.prototype.g,$.ig.XmlaNamespace.prototype.d)));var f=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.LevelConstants.prototype.k,$.ig.XmlaNamespace.prototype.d)));var g=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.LevelConstants.prototype.c,$.ig.XmlaNamespace.prototype.d)));var h=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.LevelConstants.prototype.d,$.ig.XmlaNamespace.prototype.d)));var i=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.LevelConstants.prototype.h,$.ig.XmlaNamespace.prototype.d)));var j=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.LevelConstants.prototype.i,$.ig.XmlaNamespace.prototype.d)));var k=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.LevelConstants.prototype.r,$.ig.XmlaNamespace.prototype.d)));var l=$.ig.SerializerUtils.prototype.a(b.f($.ig.XName.prototype.i($.ig.LevelConstants.prototype.o,$.ig.XmlaNamespace.prototype.d)));return function(){var $ret=new $.ig.Level;$ret.name(c);$ret.uniqueName(d);$ret.caption(e);$ret.description(f);$ret.dimensionUniqueName(g);$ret.hierarchyUniqueName(h);$ret.depth($.ig.Number.prototype.parseInt(i));$ret.membersCount($.ig.Number.prototype.parseInt(j));$ret.levelOrigin(String.isNullOrEmpty(k)?0:$.ig.Number.prototype.parseInt(k));$ret.levelOrderingProperty(l);return $ret}()},$type:new $.ig.Type("LevelXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.Level.prototype.$type)])},true);$.ig.util.defType("MeasureGroupDimensionXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this);if($.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a!=null){return}$.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a=new $.ig.Dictionary$2(String,$.ig.XName.prototype.$type,0);$.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.a,$.ig.XName.prototype.i($.ig.MeasureGroupDimensionConstants.prototype.a,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.c,$.ig.XName.prototype.i($.ig.MeasureGroupDimensionConstants.prototype.c,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.d,$.ig.XName.prototype.i($.ig.MeasureGroupDimensionConstants.prototype.d,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.f,$.ig.XName.prototype.i($.ig.MeasureGroupDimensionConstants.prototype.f,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.e,$.ig.XName.prototype.i($.ig.MeasureGroupDimensionConstants.prototype.e,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.g,$.ig.XName.prototype.i($.ig.MeasureGroupDimensionConstants.prototype.g,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.h,$.ig.XName.prototype.i($.ig.MeasureGroupDimensionConstants.prototype.h,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.i,$.ig.XName.prototype.i($.ig.MeasureGroupDimensionConstants.prototype.i,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.j,$.ig.XName.prototype.i($.ig.MeasureGroupDimensionConstants.prototype.j,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.k,$.ig.XName.prototype.i($.ig.MeasureGroupDimensionConstants.prototype.k,$.ig.XmlaNamespace.prototype.d))},deserialize:function(a){var $self=this;if(a.b()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.a)));var d=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.c)));var e=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.d)));var f=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.f)));var g=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.e)));var h=g=="ONE"?$.ig.CardinalityType.prototype.one:$.ig.CardinalityType.prototype.many;var i=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.g)));var j=i=="ONE"?$.ig.CardinalityType.prototype.one:$.ig.CardinalityType.prototype.many;var k=$.ig.SerializerUtils.prototype.c(b.f($.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.h)));var l=$.ig.SerializerUtils.prototype.c(b.f($.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.i)));var m=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.j)));var n=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupDimensionConstants.prototype.k)));return function(){var $ret=new $.ig.MeasureGroupDimension;$ret.catalogName(c);$ret.cubeName(d);$ret.measureGroupName(e);$ret.dimensionUniqueName(f);$ret.measureGroupCardinality(h);$ret.dimensionCardinality(j);$ret.isDimensionVisible(k);$ret.isFactDimension(l);$ret.dimensionPath(m);$ret.dimensionGranularity(n);return $ret}()},$type:new $.ig.Type("MeasureGroupDimensionXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.MeasureGroupDimension.prototype.$type)])},true);$.ig.util.defType("MeasureGroupXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this);if($.ig.MeasureGroupXmlTypeSerializer.prototype.a!=null){return}$.ig.MeasureGroupXmlTypeSerializer.prototype.a=new $.ig.Dictionary$2(String,$.ig.XName.prototype.$type,0);$.ig.MeasureGroupXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupConstants.prototype.a,$.ig.XName.prototype.i($.ig.MeasureGroupConstants.prototype.a,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureGroupXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupConstants.prototype.c,$.ig.XName.prototype.i($.ig.MeasureGroupConstants.prototype.c,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureGroupXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupConstants.prototype.d,$.ig.XName.prototype.i($.ig.MeasureGroupConstants.prototype.d,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureGroupXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupConstants.prototype.f,$.ig.XName.prototype.i($.ig.MeasureGroupConstants.prototype.f,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureGroupXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupConstants.prototype.e,$.ig.XName.prototype.i($.ig.MeasureGroupConstants.prototype.e,$.ig.XmlaNamespace.prototype.d))},deserialize:function(a){var $self=this;if(a.b()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureGroupXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupConstants.prototype.a)));var d=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureGroupXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupConstants.prototype.c)));var e=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureGroupXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupConstants.prototype.d)));var f=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureGroupXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupConstants.prototype.f)));var g=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureGroupXmlTypeSerializer.prototype.a.item($.ig.MeasureGroupConstants.prototype.e)));return function(){var $ret=new $.ig.MeasureGroup;$ret.catalogName(c);$ret.cubeName(d);$ret.name(e);$ret.caption(f);$ret.description(g);return $ret}()},$type:new $.ig.Type("MeasureGroupXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.MeasureGroup.prototype.$type)])},true);$.ig.util.defType("MeasureXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this);if($.ig.MeasureXmlTypeSerializer.prototype.a!=null){return}$.ig.MeasureXmlTypeSerializer.prototype.a=new $.ig.Dictionary$2(String,$.ig.XName.prototype.$type,0);$.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.d,$.ig.XName.prototype.i($.ig.MeasureConstants.prototype.d,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.e,$.ig.XName.prototype.i($.ig.MeasureConstants.prototype.e,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.f,$.ig.XName.prototype.i($.ig.MeasureConstants.prototype.f,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.l,$.ig.XName.prototype.i($.ig.MeasureConstants.prototype.l,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.r,$.ig.XName.prototype.i($.ig.MeasureConstants.prototype.r,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.p,$.ig.XName.prototype.i($.ig.MeasureConstants.prototype.p,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.g,$.ig.XName.prototype.i($.ig.MeasureConstants.prototype.g,$.ig.XmlaNamespace.prototype.d));$.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.q,$.ig.XName.prototype.i($.ig.MeasureConstants.prototype.q,$.ig.XmlaNamespace.prototype.d))},deserialize:function(a){var $self=this;if(a.b()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.d)));var d=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.e)));var e=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.f)));var f=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.l)));var g=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.r)));var h=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.p)));var i=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.g)));var j=$.ig.Number.prototype.parseInt(i);var k=$.ig.SerializerUtils.prototype.a(b.f($.ig.MeasureXmlTypeSerializer.prototype.a.item($.ig.MeasureConstants.prototype.q)));return function(){var $ret=new $.ig.Measure;$ret.name(c);$ret.uniqueName(d);$ret.caption(e);$ret.description(f);$ret.defaultFormatString(g);$ret.measureGroupName(h);$ret.aggregatorType(j);$ret.measureDisplayFolder(k);return $ret}()},$type:new $.ig.Type("MeasureXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.Measure.prototype.$type)])},true);$.ig.util.defType("MemberXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this);if($.ig.MemberXmlTypeSerializer.prototype.a!=null){return}$.ig.MemberXmlTypeSerializer.prototype.a=new $.ig.Dictionary$2(String,$.ig.XName.prototype.$type,0);$.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.a,$.ig.XName.prototype.i($.ig.MemberConstants.prototype.a,$.ig.XmlaNamespace.prototype.d));$.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.c,$.ig.XName.prototype.i($.ig.MemberConstants.prototype.c,$.ig.XmlaNamespace.prototype.d));$.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.h,$.ig.XName.prototype.i($.ig.MemberConstants.prototype.h,$.ig.XmlaNamespace.prototype.d));$.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.i,$.ig.XName.prototype.i($.ig.MemberConstants.prototype.i,$.ig.XmlaNamespace.prototype.d));$.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.j,$.ig.XName.prototype.i($.ig.MemberConstants.prototype.j,$.ig.XmlaNamespace.prototype.d));$.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.d,$.ig.XName.prototype.i($.ig.MemberConstants.prototype.d,$.ig.XmlaNamespace.prototype.d));$.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.e,$.ig.XName.prototype.i($.ig.MemberConstants.prototype.e,$.ig.XmlaNamespace.prototype.d));$.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.f,$.ig.XName.prototype.i($.ig.MemberConstants.prototype.f,$.ig.XmlaNamespace.prototype.d));$.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.l,$.ig.XName.prototype.i($.ig.MemberConstants.prototype.l,$.ig.XmlaNamespace.prototype.d));$.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.q,$.ig.XName.prototype.i($.ig.MemberConstants.prototype.q,$.ig.XmlaNamespace.prototype.d));$.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.g,$.ig.XName.prototype.i($.ig.MemberConstants.prototype.g,$.ig.XmlaNamespace.prototype.d));$.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.m,$.ig.XName.prototype.i($.ig.MemberConstants.prototype.m,$.ig.XmlaNamespace.prototype.d));$.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.o,$.ig.XName.prototype.i($.ig.MemberConstants.prototype.o,$.ig.XmlaNamespace.prototype.d));$.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.v,$.ig.XName.prototype.i($.ig.MemberConstants.prototype.v,$.ig.XmlaNamespace.prototype.d));$.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.n,$.ig.XName.prototype.i($.ig.MemberConstants.prototype.n,$.ig.XmlaNamespace.prototype.d))},deserialize:function(a){var $self=this;if(a.b()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=$.ig.SerializerUtils.prototype.a(b.f($.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.a)));var d=$.ig.SerializerUtils.prototype.a(b.f($.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.c)));var e=$.ig.SerializerUtils.prototype.a(b.f($.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.h)));var f=$.ig.SerializerUtils.prototype.a(b.f($.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.i)));var g=$.ig.SerializerUtils.prototype.a(b.f($.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.j)));var h=$.ig.SerializerUtils.prototype.a(b.f($.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.d)));var i=$.ig.SerializerUtils.prototype.a(b.f($.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.e)));var j=$.ig.SerializerUtils.prototype.a(b.f($.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.f)));var k=$.ig.SerializerUtils.prototype.a(b.f($.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.l)));var l=$.ig.SerializerUtils.prototype.a(b.f($.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.q)));var m=$.ig.SerializerUtils.prototype.a(b.f($.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.g)));var n=$.ig.SerializerUtils.prototype.a(b.f($.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.m)));var o=$.ig.SerializerUtils.prototype.a(b.f($.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.o)));var p=$.ig.SerializerUtils.prototype.a(b.f($.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.v)));var q=$.ig.SerializerUtils.prototype.a(b.f($.ig.MemberXmlTypeSerializer.prototype.a.item($.ig.MemberConstants.prototype.n)));return function(){var $ret=new $.ig.Member;$ret.catalogName(c);$ret.cubeName(d);$ret.dimensionUniqueName(h);$ret.hierarchyUniqueName(i);$ret.levelUniqueName(j);$ret.levelDepth($.ig.Number.prototype.parseInt(m));$ret.name(e);$ret.uniqueName(f);$ret.memberType($.ig.Number.prototype.parseInt(g));$ret.caption(k);$ret.childrenCardinality($.ig.Number.prototype.parseInt(n));$ret.description(l);$ret.parentUniqueName(o);$ret.scope($.ig.util.toNullable($.ig.Number.prototype.$type,p==null?null:$.ig.Number.prototype.parseInt(p)));$ret.parentLevel(String.isNullOrEmpty(q)?0:$.ig.Number.prototype.parseInt(q));return $ret}()},$type:new $.ig.Type("MemberXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.Member.prototype.$type)])},true);$.ig.util.defType("ResultXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;if(a.b()!=$.ig.XmlNodeType.prototype.element){return null}var b=a;var c=b.l().d();switch(c){case $.ig.XmlaNamespace.prototype.e:return function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}();case $.ig.XmlaNamespace.prototype.c:var d=b.f($.ig.XName.prototype.i("OlapInfo",$.ig.XmlaNamespace.prototype.c));var e=b.f($.ig.XName.prototype.i("Axes",$.ig.XmlaNamespace.prototype.c));var f=new $.ig.ArraySerializer;var g=f.b($.ig.OlapResultAxis.prototype.$type,e,$.ig.XName.prototype.i("Axis",$.ig.XmlaNamespace.prototype.c),new $.ig.AxisXmlTypeSerializer);var h=b.f($.ig.XName.prototype.i("CellData",$.ig.XmlaNamespace.prototype.c));var i=f.b($.ig.OlapResultAxis.prototype.$type,h,$.ig.XName.prototype.i("Cell",$.ig.XmlaNamespace.prototype.c),new $.ig.CellXmlTypeSerializer);return function(){var $ret=new $.ig.OlapResult;$ret.axes(g);$ret.cells(i);return $ret}()}return null},$type:new $.ig.Type("ResultXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.OlapResult.prototype.$type)])},true);$.ig.util.defType("SerializerUtils","Object",{init:function(){$.ig.Object.prototype.init.call(this)},a:function(a){if(a!=null){return a.k()}else{return null}},b:function(a){if(a!=null){return a.f()}else{return null}},c:function(a){var b=$.ig.SerializerUtils.prototype.a(a).toLowerCase();return b=="true"},d:function(a){if(a!=null&&!String.isNullOrEmpty(a.k())){return $.ig.SerializerUtils.prototype.e(a.k())}else{return $.ig.SerializerUtils.prototype.f()}},e:function(a){var dateString_=a;var b;b=function(text){var match=/^\s*(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(.*)$/.exec(text);if(!match){throw"Invalid textual date representation."}var year=parseInt(match[1],10);var month=parseInt(match[2],10)-1;var day=parseInt(match[3],10);var hours=parseInt(match[4],10);var minutes=parseInt(match[5],10);var seconds=parseInt(match[6],10);return new Date(year,month,day,hours,minutes,seconds)}(dateString_);return b},f:function(){var a;a=new Date(2e3,0,1);return a},$type:new $.ig.Type("SerializerUtils",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaSoapFault","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},$type:new $.ig.Type("XmlaSoapFault",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaSoapFaultXmlTypeSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},deserialize:function(a){var $self=this;var b=a;var c=new $.ig.XmlaSoapFault;var e=b.g().getEnumerator();while(e.moveNext()){var d=e.current();switch(d.l().c()){case"faultcode":c.e($.ig.SerializerUtils.prototype.a(d));break;case"faultstring":c.f($.ig.SerializerUtils.prototype.a(d));break;case"faultactor":c.g($.ig.SerializerUtils.prototype.a(d));break}}var f=b.f($.ig.XName.prototype.i("detail",""));if(f!=null){var g=f.h($.ig.XName.prototype.i("Error",""));var h=new $.ig.List$1($.ig.FaultError.prototype.$type,0);var i=new $.ig.ErrorXmlTypeSerializer;var k=g.getEnumerator();while(k.moveNext()){var j=k.current();var l=i.deserialize(j);h.add(l)}c.h(function(){var $ret=new $.ig.FaultDetail;$ret.b(h.x());return $ret}())}return c},$type:new $.ig.Type("XmlaSoapFaultXmlTypeSerializer",$.ig.Object.prototype.$type,[$.ig.IXmlTypeSerializer$1.prototype.$type.specialize($.ig.XmlaSoapFault.prototype.$type)])},true);$.ig.util.defType("XmlaSoapMethodResult","Object",{init:function(){$.ig.Object.prototype.init.call(this)},b:null,returnElement:function(a){if(arguments.length===1){this.b=a;return a}else{return this.b}},_sessionId:null,sessionId:function(a){if(arguments.length===1){this._sessionId=a;return a}else{return this._sessionId}},$type:new $.ig.Type("XmlaSoapMethodResult",$.ig.Object.prototype.$type,[$.ig.IXmlaMethodResult.prototype.$type])},true);$.ig.util.defType("DiscoverResponseResult","XmlaSoapMethodResult",{init:function(){$.ig.XmlaSoapMethodResult.prototype.init.call(this)},$type:new $.ig.Type("DiscoverResponseResult",$.ig.XmlaSoapMethodResult.prototype.$type)},true);$.ig.util.defType("RequestCompletedEventArgs$1","AsyncCompletedEventArgs",{$t:null,e:null,init:function($t,a,b,c,d){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.AsyncCompletedEventArgs.prototype.init.call(this,b,c,d);this.e=a},result:function(){$.ig.AsyncCompletedEventArgs.prototype.d.call(this);return this.e},$type:new $.ig.Type("RequestCompletedEventArgs$1",$.ig.AsyncCompletedEventArgs.prototype.$type)},true);$.ig.util.defType("ExecuteResponseResult","XmlaSoapMethodResult",{init:function(){$.ig.XmlaSoapMethodResult.prototype.init.call(this)},$type:new $.ig.Type("ExecuteResponseResult",$.ig.XmlaSoapMethodResult.prototype.$type)},true);$.ig.util.defType("FaultDetail","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},$type:new $.ig.Type("FaultDetail",$.ig.Object.prototype.$type)},true);$.ig.util.defType("IXmlaSoapMethod","Object",{$type:new $.ig.Type("IXmlaSoapMethod",null)},true);$.ig.util.defType("XmlaNamespace","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("XmlaNamespace",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaQueryProperty","Object",{init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.Object.prototype.init.call(this)},init1:function(initNumber,a,b){$.ig.Object.prototype.init.call(this);this.c(a);this.d(b)},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},toString:function(){return String.concat5(this.c()," = ",this.d())},$type:new $.ig.Type("XmlaQueryProperty",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaPropertiesCollection","Object",{a:null,b:null,c:null,init:function(){$.ig.Object.prototype.init.call(this);
this.a=new $.ig.Dictionary$2(String,$.ig.XmlaQueryProperty.prototype.$type,0);this.b=new $.ig.Dictionary$2(String,$.ig.Number.prototype.$type,0);this.c=new $.ig.List$1($.ig.XmlaQueryProperty.prototype.$type,0)},d:function(a,b){var $self=this;return{ret:function(){var $ret=$self.a.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),value:b};return{value:b}},contains:function(a){return this.a.containsKey(a)},indexOf:function(a){return this.c.indexOf(a)},insert:function(a,b){this.a.add(b.c(),b);this.c.insert(a,b)},removeAt:function(a){if(a<this.c.count()){var b=this.c.item(a);if(this.a.remove(b.c())){this.c.removeAt(a)}}},item:function(b,a){if(arguments.length===2){var c=this.c.item(b);this.a.remove(c.c());this.a.add(a.c(),a);this.c.item(b,a);return a}else{return this.c.item(b)}},add:function(a){this.a.add(a.c(),a);this.c.add(a)},clear:function(){this.c.clear();this.a.clear()},contains1:function(a){return this.c.contains(a)},e:function(a,b){this.c.copyTo(a,b)},count:function(){return this.c.count()},isReadOnly:function(){return this.c.isReadOnly()},remove:function(a){if(this.c.remove(a)){return this.a.remove(a.c())}return false},getEnumerator:function(){return this.c.getEnumerator()},isFixedSize:function(){return false},isSynchronized:function(){return this.c.isSynchronized()},syncRoot:function(){return this.c.syncRoot()},$type:new $.ig.Type("XmlaPropertiesCollection",$.ig.Object.prototype.$type,[$.ig.IList$1.prototype.$type.specialize($.ig.XmlaQueryProperty.prototype.$type),$.ig.IList.prototype.$type])},true);$.ig.util.defType("XmlaSoapMessageBuilder","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},j:function(){if(this.g()==null){throw new $.ig.InvalidOperationException(1,"XmlaMethod is not specified.")}var a=$.ig.XNamespace.prototype.d($.ig.XmlaSoapMessageBuilder.prototype.e);this.g().construct(a);var b=this.k();return b.toString()},k:function(){var a=new $.ig.XElement(1,$.ig.XName.prototype.i($.ig.XmlaSoapMessageBuilder.prototype.a,$.ig.XmlaSoapMessageBuilder.prototype.e));this.l(a);this.m(a);return a},l:function(a){var b=new $.ig.XElement(1,$.ig.XName.prototype.i($.ig.XmlaSoapMessageBuilder.prototype.b,a.l().e().c()));a.j(b);var d=this.g().headers().getEnumerator();while(d.moveNext()){var c=d.current();b.j(c)}},m:function(a){var b=new $.ig.XElement(1,$.ig.XName.prototype.i($.ig.XmlaSoapMessageBuilder.prototype.c,a.l().e().c()));a.j(b);var c=new $.ig.XElement(1,$.ig.XName.prototype.i(this.g().name(),$.ig.XmlaNamespace.prototype.b));b.j(c);var e=this.g().parameters().getEnumerator();while(e.moveNext()){var d=e.current();c.j(d)}},$type:new $.ig.Type("XmlaSoapMessageBuilder",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaSoapMethod","Object",{c:null,d:null,e:null,f:null,g:null,init:function(){$.ig.Object.prototype.init.call(this);this.e=new $.ig.List$1($.ig.XElement.prototype.$type,0);this.f=new $.ig.List$1($.ig.XElement.prototype.$type,0);this.c=new $.ig.ReadOnlyCollection$1($.ig.XElement.prototype.$type,1,this.e);this.d=new $.ig.ReadOnlyCollection$1($.ig.XElement.prototype.$type,1,this.f);this.g=new $.ig.XmlaPropertiesCollection},properties:function(){return this.g},_name:null,name:function(){return this._name},parameters:function(){return this.c},headers:function(){return this.d},h:function(){return this.e},i:function(){return this.f},construct:function(a){},mergeProperties:function(a){var $self=this;if(a==null){return}var c=a.getEnumerator();while(c.moveNext()){var b=c.current();var d;if(function(){var $ret=$self.properties().d(b.c(),d);d=$ret.value;return $ret.ret}()){d.d(b.d())}else{this.properties().add(b)}}},$type:new $.ig.Type("XmlaSoapMethod",$.ig.Object.prototype.$type,[$.ig.IXmlaSoapMethod.prototype.$type])},true);$.ig.util.defType("XmlaSoapMethodDiscover","XmlaSoapMethod",{q:null,init:function(a){$.ig.XmlaSoapMethod.prototype.init.call(this);this.w($.ig.XmlaSoapMessageHeader.prototype.none);this.v(a);this.q=new $.ig.Dictionary$2(String,$.ig.Object.prototype.$type,0)},u:function(){return this.q},_v:null,v:function(a){if(arguments.length===1){this._v=a;return a}else{return this._v}},name:function(){return $.ig.XmlaSoapMethodDiscover.prototype.l},_w:null,w:function(a){if(arguments.length===1){this._w=a;return a}else{return this._w}},_x:null,x:function(a){if(arguments.length===1){this._x=a;return a}else{return this._x}},construct:function(a){var b=$.ig.XNamespace.prototype.d($.ig.XmlaNamespace.prototype.b);var c=new $.ig.XElement(1,$.ig.XName.prototype.i($.ig.XmlaSoapMethodDiscover.prototype.m,b.c()));c.k(this.v());var d=new $.ig.XElement(1,$.ig.XName.prototype.i($.ig.XmlaSoapMethodDiscover.prototype.a,$.ig.XmlaNamespace.prototype.b));var e=new $.ig.XElement(1,$.ig.XName.prototype.i($.ig.XmlaSoapMethodDiscover.prototype.b,d.l().e().c()));d.j(e);var f=new $.ig.XElement(1,$.ig.XName.prototype.i($.ig.XmlaSoapMethodDiscover.prototype.n,$.ig.XmlaNamespace.prototype.b));var g=new $.ig.XElement(1,$.ig.XName.prototype.i($.ig.XmlaSoapMethodDiscover.prototype.o,f.l().e().c()));f.j(g);var i=this.properties().getEnumerator();while(i.moveNext()){var h=i.current();e.j(new $.ig.XElement(2,$.ig.XName.prototype.i(h.c(),$.ig.XmlaNamespace.prototype.b),h.d()))}var k=this.q.getEnumerator();while(k.moveNext()){var j=k.current();g.j(new $.ig.XElement(2,$.ig.XName.prototype.i(j.key(),""),j.value()))}this.h().add(c);this.h().add(f);this.h().add(d)},$type:new $.ig.Type("XmlaSoapMethodDiscover",$.ig.XmlaSoapMethod.prototype.$type)},true);$.ig.util.defType("XmlaSoapMethodExecute","XmlaSoapMethod",{init:function(a){$.ig.XmlaSoapMethod.prototype.init.call(this);this.p(a)},name:function(){return $.ig.XmlaSoapMethodExecute.prototype.l},_p:null,p:function(a){if(arguments.length===1){this._p=a;return a}else{return this._p}},construct:function(a){var b=$.ig.XNamespace.prototype.d($.ig.XmlaNamespace.prototype.b);var c=new $.ig.XElement(1,$.ig.XName.prototype.i($.ig.XmlaSoapMethodExecute.prototype.m,b.c()));var d=new $.ig.XElement(1,$.ig.XName.prototype.i($.ig.XmlaSoapMethodExecute.prototype.n,b.c()));d.k(this.p());c.j(d);var e=new $.ig.XElement(1,$.ig.XName.prototype.i($.ig.XmlaSoapMethodExecute.prototype.a,$.ig.XmlaNamespace.prototype.b));var f=new $.ig.XElement(1,$.ig.XName.prototype.i($.ig.XmlaSoapMethodExecute.prototype.b,e.l().e().c()));e.j(f);var h=this.properties().getEnumerator();while(h.moveNext()){var g=h.current();f.j(new $.ig.XElement(2,$.ig.XName.prototype.i(g.c(),$.ig.XmlaNamespace.prototype.b),g.d()))}this.h().add(c);this.h().add(e)},$type:new $.ig.Type("XmlaSoapMethodExecute",$.ig.XmlaSoapMethod.prototype.$type)},true);$.ig.util.defType("XmlaSoapWebClient","Object",{init:function(){$.ig.Object.prototype.init.call(this)},a:null,staticInit:function(){$.ig.XmlaSoapWebClient.prototype.a=new $.ig.List$1(String,0)},$type:new $.ig.Type("XmlaSoapWebClient",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaSoapWebClient$1","XmlaSoapWebClient",{$t:null,b:null,c:null,init:function($t,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.XmlaSoapWebClient.prototype.init.call(this);this.b=new $.ig.WebClient;this.b.e(b);this.b.uploadStringCompleted=$.ig.Delegate.prototype.combine(this.b.uploadStringCompleted,this.t.runOn(this));this.h(a)},requestCompleted:null,_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},i:function(){return this.c},q:function(a){this.r(a,null)},r:function(a,b){var c=new $.ig.XmlaSoapMessageBuilder;c.g(a);var d=c.j();if(this.g()!=null){this.b.g(this.g())}else{this.b.g(null)}this.b.f().item("Content-Type","text/xml");this.b.p(this.h(),"POST",d,b)},s:function(a){if(this.requestCompleted!=null){this.requestCompleted(this,a)}},t:function(a,b){this.c=true;this.u(b)},u:function(a){var b=null;var c=null;var d=null;if(!a.cancelled()&&a.error()==null){try{var e=$.ig.XDocument.prototype.k(a.result());var f=e.f($.ig.XName.prototype.i("Envelope","http://schemas.xmlsoap.org/soap/envelope/"));var g=f.f($.ig.XName.prototype.i("Body","http://schemas.xmlsoap.org/soap/envelope/"));var h=g.f($.ig.XName.prototype.i("Fault","http://schemas.xmlsoap.org/soap/envelope/"));if(h!=null){var i=new $.ig.XmlaSoapFaultXmlTypeSerializer;var j=i.deserialize(h);c=new $.ig.FaultException$1($.ig.XmlaSoapFault.prototype.$type,j,new $.ig.FaultReason(j.f()),new $.ig.FaultCode(j.e()),null)}else{if(this.$t==$.ig.DiscoverResponseResult.prototype.$type){var k=g.f($.ig.XName.prototype.i("DiscoverResponse",$.ig.XmlaNamespace.prototype.b));var l=k.f($.ig.XName.prototype.i("return",$.ig.XmlaNamespace.prototype.b));var m=l.f($.ig.XName.prototype.i("root",$.ig.XmlaNamespace.prototype.d));var n=new $.ig.DiscoverResponseResult;n.returnElement(m);b=n}if(this.$t==$.ig.ExecuteResponseResult.prototype.$type){var o=g.f($.ig.XName.prototype.i("ExecuteResponse",$.ig.XmlaNamespace.prototype.b));var p=o.f($.ig.XName.prototype.i("return",$.ig.XmlaNamespace.prototype.b));var q=p.f($.ig.XName.prototype.i("root",$.ig.XmlaNamespace.prototype.c));var r=new $.ig.ExecuteResponseResult;r.returnElement(q);b=r}}}catch(e_){d=e_}}if(d==null){d=a.error()!=null?a.error():c}var s=new $.ig.RequestCompletedEventArgs$1(this.$t,b,d,a.cancelled(),a.userState());this.s(s)},$type:new $.ig.Type("XmlaSoapWebClient$1",$.ig.XmlaSoapWebClient.prototype.$type)},true);$.ig.util.defType("IMdxExpression","Object",{$type:new $.ig.Type("IMdxExpression",null)},true);$.ig.util.defType("IMdxElement","Object",{$type:new $.ig.Type("IMdxElement",null,[$.ig.IMdxExpression.prototype.$type])},true);$.ig.util.defType("IAxisFilterElement","Object",{$type:new $.ig.Type("IAxisFilterElement",null,[$.ig.IMdxElement.prototype.$type])},true);$.ig.util.defType("IMdxAxis","Object",{$type:new $.ig.Type("IMdxAxis",null,[$.ig.IMdxExpression.prototype.$type])},true);$.ig.util.defType("IMdxCollectionElement","Object",{$type:new $.ig.Type("IMdxCollectionElement",null,[$.ig.IMdxElement.prototype.$type])},true);$.ig.util.defType("IMdxFilterInfo","Object",{$type:new $.ig.Type("IMdxFilterInfo",null)},true);$.ig.util.defType("IMdxExtendedFilterInfo","Object",{$type:new $.ig.Type("IMdxExtendedFilterInfo",null,[$.ig.IMdxFilterInfo.prototype.$type])},true);$.ig.util.defType("IMdxSet","Object",{$type:new $.ig.Type("IMdxSet",null,[$.ig.IMdxExpression.prototype.$type])},true);$.ig.util.defType("MdxAxis","Object",{a:null,b:null,c:null,d:null,e:null,f:null,init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.f=function(){var $ret=new Array;$ret.add("COLUMNS");$ret.add("ROWS");$ret.add("PAGES");return $ret}();$.ig.MdxAxis.prototype.init1.call(this,1,a,new $.ig.MdxDimensionAxisSettings)},init1:function(initNumber,a,b){var $self=this;this.f=function(){var $ret=new Array;$ret.add("COLUMNS");$ret.add("ROWS");$ret.add("PAGES");return $ret}();$.ig.Object.prototype.init.call(this);this.axisIndex(a);this.h(b!=null?b:new $.ig.MdxDimensionAxisSettings);this.a=new $.ig.List$1($.ig.IMdxSet.prototype.$type,0);this.b=new $.ig.ReadOnlyCollection$1($.ig.IMdxSet.prototype.$type,1,this.a)},axisIndex:function(a){if(arguments.length===1){if(this.e!=a){this.e=a;this.c=false}return a}else{return this.e}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},i:function(){return $.ig.util.cast($.ig.MdxDimensionAxisSettings.prototype.$type,this.h())},j:function(){return this.b},mdxExpression:function(){if(!this.c){this.d=this.o();this.c=true}return this.d},rebuildExpression:function(){this.d=this.o();this.c=true},getMdxSets:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$a=this.$this.b.getEnumerator();this.$state=1;break;case 1:this.$state=4;break;case 2:this.$current=this.$a.current();this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$a.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1($.ig.IMdxSet.prototype.$type,$iter)},addSet:function(a){this.a.add(a);this.c=false},o:function(){var a=new $.ig.StringBuilder;var b=false;var d=this.j().getEnumerator();while(d.moveNext()){var c=d.current();if(!c.isEnabled()){continue}if(b){a.d(",");a.d($.ig.Environment.prototype.a())}a.d(c.mdxExpression());b=true}if(this.j().count()>1){a.i(0,"{");a.d("}")}this.p(a,this.i());this.q(a,this.i());this.r(a,this.i());this.s(a);return a.toString()},p:function(a,b){if(b.k()){a.i(0,"Distinct(");a.d(")")}},q:function(a,b){if(b.l()){a.i(0,$.ig.Environment.prototype.a());a.i(0,"NON EMPTY")}},r:function(a,b){if(b.m()){a.d($.ig.Environment.prototype.a());a.d("DIMENSION PROPERTIES");var c=b.p();var d=false;var f=c.getEnumerator();while(f.moveNext()){var e=f.current();a.d($.ig.Environment.prototype.a());if(d){a.d(",")}a.d(e);d=true}}},s:function(a){if(this.axisIndex()<2){a.d($.ig.Environment.prototype.a());a.d(String.concat2("ON ",this.f[this.axisIndex()]))}},$type:new $.ig.Type("MdxAxis",$.ig.Object.prototype.$type,[$.ig.IMdxAxis.prototype.$type])},true);$.ig.util.defType("MdxAxisFilterElement","Object",{a:null,b:null,init:function(){$.ig.Object.prototype.init.call(this);this.b=new $.ig.List$1($.ig.IMdxElement.prototype.$type,0);this.singleFilterElements(new $.ig.ReadOnlyCollection$1($.ig.IMdxElement.prototype.$type,1,this.b));this.a=new $.ig.MdxElementCollectionElement},mdxExpression:function(){var $self=this;if(this.a.collectionElements().count()>1){this.a.f(function(){var $ret=new Array;$ret.add("(");$ret.add(")");return $ret}())}return this.a.mdxExpression()},_singleFilterElements:null,singleFilterElements:function(a){if(arguments.length===1){this._singleFilterElements=a;return a}else{return this._singleFilterElements}},filterCollection:function(){return this.a.collectionElements()},rebuildExpression:function(){this.a.rebuildExpression()},addFilterPart:function(a,b){if(a.collectionElements().count()>0){if(a.collectionElements().count()==1&&b){this.b.add(a.collectionElements().item(0));return}this.a.addElement(a)}},elementType:function(){return $.ig.MdxElementType.prototype.filter},$type:new $.ig.Type("MdxAxisFilterElement",$.ig.Object.prototype.$type,[$.ig.IAxisFilterElement.prototype.$type])},true);$.ig.util.defType("MdxCalculatedMembersCache","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.a=new $.ig.List$1(String,0);this.b=new $.ig.Dictionary$2(String,String,0)},a:null,b:null,c:function(a){var b=new $.ig.StringBuilder;var d=a.e().getEnumerator();while(d.moveNext()){var c=d.current();$.ig.MdxCalculatedMembersCache.prototype.g(b,c.key(),c.value())}return b.toString()},d:function(a,b,c){if(!this.a.contains(a)){this.a.add(a)}if(!this.b.containsKey(b)){this.b.add(b,c)}},e:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$a=this.$this.b.getEnumerator();this.$state=1;break;case 1:this.$state=4;break;case 2:this.$current=this.$a.current();this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$a.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1($.ig.KeyValuePair$2.prototype.$type.specialize(String,String),$iter)},f:function(a){return this.a.contains(a)},g:function(a,b,c){a.d(String.concat7("MEMBER ",b," AS",$.ig.Environment.prototype.a()));a.d(c);a.d($.ig.Environment.prototype.a())},$type:new $.ig.Type("MdxCalculatedMembersCache",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MdxElement","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.elementType($.ig.MdxElementType.prototype.userDefined)},_mdxExpression:null,mdxExpression:function(){return this._mdxExpression},_elementType:null,elementType:function(a){if(arguments.length===1){this._elementType=a;return a}else{return this._elementType}},_sourceItemExpression:null,sourceItemExpression:function(a){if(arguments.length===1){this._sourceItemExpression=a;return a}else{return this._sourceItemExpression}},rebuildExpression:function(){},$type:new $.ig.Type("MdxElement",$.ig.Object.prototype.$type,[$.ig.IMdxItemElement.prototype.$type])},true);$.ig.util.defType("MdxSingleElement","MdxElement",{init:function(initNumber,a,b,c){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.MdxSingleElement.prototype.init1.call(this,1,a,b,c,$.ig.MdxElementType.prototype.member)},init1:function(initNumber,a,b,c,d){$.ig.MdxElement.prototype.init.call(this);this.h(c);switch(d){case $.ig.MdxElementType.prototype.member:case $.ig.MdxElementType.prototype.calculated:this.sourceItemExpression(a);this.g(b);this.elementType(d);break;default:throw new $.ig.ArgumentException(1,"Element type could be MdxElementType.Member or MdxElementType.Calculated","elementType")}},mdxExpression:function(){return this.sourceItemExpression()},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},$type:new $.ig.Type("MdxSingleElement",$.ig.MdxElement.prototype.$type)},true);$.ig.util.defType("MdxDimensionMember","MdxSingleElement",{init:function(a,b,c,d,e){$.ig.MdxSingleElement.prototype.init.call(this,a,b,c);this.o(d);this.p(e)},_o:null,o:function(a){if(arguments.length===1){this._o=a;return a}else{return this._o}},_p:null,p:function(a){if(arguments.length===1){this._p=a;return a}else{return this._p}},$type:new $.ig.Type("MdxDimensionMember",$.ig.MdxSingleElement.prototype.$type)},true);$.ig.util.defType("MdxChildrenCollectionElement","MdxDimensionMember",{init:function(a,b,c,d,e){$.ig.MdxDimensionMember.prototype.init.call(this,a,b,c,d,e)},mdxExpression:function(){return String.concat2(this.sourceItemExpression(),".Children")},$type:new $.ig.Type("MdxChildrenCollectionElement",$.ig.MdxDimensionMember.prototype.$type)},true);$.ig.util.defType("MdxElementCollectionElement","Object",{a:null,b:null,c:null,d:null,init:function(){$.ig.Object.prototype.init.call(this);this.a=new $.ig.List$1($.ig.IMdxElement.prototype.$type,0);this.collectionElements(new $.ig.ReadOnlyCollection$1($.ig.IMdxElement.prototype.$type,1,this.a))},f:function(a){if(arguments.length===1){if(this.d!=a){this.b=false;this.d=a}return a}else{return this.d}},_collectionElements:null,collectionElements:function(a){if(arguments.length===1){this._collectionElements=a;return a}else{return this._collectionElements}},elementType:function(){return $.ig.MdxElementType.prototype.collection},mdxExpression:function(){if(!this.b){this.c=this.j();this.b=true}return this.c},rebuildExpression:function(){this.c=this.j();this.b=true},addElement:function(a){var $self=this;this.a.add(a);if(this.collectionElements().count()>1){this.f(function(){var $ret=new Array;$ret.add("{");$ret.add("}");return $ret}())}this.b=false},j:function(){if(this.collectionElements().count()==0){return String.empty()}var a=new $.ig.StringBuilder;var b=false;var d=this.collectionElements().getEnumerator();while(d.moveNext()){var c=d.current();if(b){a.d(",");a.d($.ig.Environment.prototype.a())}a.d(c.mdxExpression());b=true}if(this.f()!=null&&this.f().length==2){a.i(0,this.f()[0]);a.d(this.f()[1])}return a.toString()},$type:new $.ig.Type("MdxElementCollectionElement",$.ig.Object.prototype.$type,[$.ig.IMdxCollectionElement.prototype.$type])},true);$.ig.util.defType("MdxLevelMembersElement","MdxSingleElement",{init:function(a,b,c){$.ig.MdxSingleElement.prototype.init.call(this,a,b,c)},mdxExpression:function(){return String.concat2(this.sourceItemExpression(),".MEMBERS")},$type:new $.ig.Type("MdxLevelMembersElement",$.ig.MdxSingleElement.prototype.$type)},true);$.ig.util.defType("MdxQueryBuilder","Object",{a:null,init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.MdxQueryBuilder.prototype.init1.call(this,1,new $.ig.MdxSettings)},init1:function(initNumber,a){$.ig.Object.prototype.init.call(this);this.b(a)},b:function(a){if(arguments.length===1){this.a=a;return a}else{if(this.a==null){this.a=new $.ig.MdxSettings}return this.a}},e:function(a,b,c,d,e){var f=c;var g=this.f(a,b,f,d);var h=this.j(f);var i=this.g(f,e);var j=new $.ig.StringBuilder;if(!String.isNullOrEmpty(g)){j.d(String.concat2("WITH",$.ig.Environment.prototype.a()))}j.d(g);j.d("SELECT");j.d($.ig.Environment.prototype.a());if(a!=null){j.d(a.mdxExpression())}if(b!=null){if(a==null){b.axisIndex(0)}else{j.d(String.concat2(",",$.ig.Environment.prototype.a()))}j.d(b.mdxExpression())}j.d($.ig.Environment.prototype.a());j.d(i);if(!String.isNullOrEmpty(h)){j.d($.ig.Environment.prototype.a());j.d(h)}var k=j.toString();return k},f:function(a,b,c,d){return $.ig.MdxCalculatedMembersCache.prototype.c(d)},g:function(a,b){var c=String.concat7("FROM ","[",b,"]");var d=$.ig.util.cast($.ig.IMdxExtendedFilterInfo.prototype.$type,a);c=this.i(c,a.filtersFilter());if(a.columnsFilter()!=null){c=this.i(c,a.columnsFilter(),a.rowsFilter())}else{c=this.i(c,a.rowsFilter())}if(d!=null){c=this.h(c,d)}return c},h:function(a,b){if(b.filterElements()!=null&&b.filterElements().count()>0){var d=b.filterElements().getEnumerator();while(d.moveNext()){var c=d.current();var e=new $.ig.StringBuilder;e.i(0,String.concat("FROM",$.ig.Environment.prototype.a(),"(",$.ig.Environment.prototype.a(),"SELECT",$.ig.Environment.prototype.a()));e.d(String.concat5(c.mdxExpression()," ON COLUMNS",$.ig.Environment.prototype.a()));e.d(a);e.d(this.j(b));e.d(String.concat2(")",$.ig.Environment.prototype.a()));a=e.toString()}}return a},i:function(a,b,c){if(b==null||b.filterCollection().count()==0){return a}var d=new $.ig.StringBuilder;d.d("FROM");d.d($.ig.Environment.prototype.a());d.d("(");d.d($.ig.Environment.prototype.a());d.d("SELECT");d.d($.ig.Environment.prototype.a());d.d(b.mdxExpression());d.d(" ON COLUMNS");if(c!=null&&c.filterCollection().count()>0){d.d($.ig.Environment.prototype.a());d.d(", ");d.d(c.mdxExpression());d.d(" ON ROWS")}d.d($.ig.Environment.prototype.a());d.d(a);d.d($.ig.Environment.prototype.a());d.d(")");return d.toString()},j:function(a){var $self=this;var b=new $.ig.MdxElementCollectionElement;if(a.measureFilter()!=null&&a.measureFilter().singleFilterElements().count()==1){b.addElement(a.measureFilter().singleFilterElements().item(0))}if(a.filtersFilter()!=null){var d=a.filtersFilter().singleFilterElements().getEnumerator();while(d.moveNext()){var c=d.current();b.addElement(c)}}if(b.collectionElements().count()==0){return String.empty()}b.f(function(){var $ret=new Array;$ret.add("(");$ret.add(")");return $ret}());return String.concat2("WHERE ",b.mdxExpression())},$type:new $.ig.Type("MdxQueryBuilder",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MdxSet","Object",{a:null,b:null,c:null,d:null,init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.MdxSet.prototype.init1.call(this,1,new $.ig.MdxSetSettings);this.a=new $.ig.List$1($.ig.IMdxElement.prototype.$type,0);this.b=new $.ig.ReadOnlyCollection$1($.ig.IMdxElement.prototype.$type,1,this.a);this.isEnabled(true)},init1:function(initNumber,a){$.ig.Object.prototype.init.call(this);this.a=new $.ig.List$1($.ig.IMdxElement.prototype.$type,0);this.b=new $.ig.ReadOnlyCollection$1($.ig.IMdxElement.prototype.$type,1,this.a);this.isEnabled(true);this.g(a!=null?a:new $.ig.MdxSetSettings)},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_isEnabled:null,isEnabled:function(a){if(arguments.length===1){this._isEnabled=a;return a}else{return this._isEnabled}},h:function(){return this.b},mdxExpression:function(){if(!this.c){this.d=this.m();this.c=true}return this.d},rebuildExpression:function(){this.d=this.m();this.c=true},addElement:function(a){if(this.l(a)){this.a.add(a);this.c=false}},getMdxElements:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,$a:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$a=this.$this.a.getEnumerator();this.$state=1;break;case 1:this.$state=4;break;case 2:this.$current=this.$a.current();this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$a.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1($.ig.IMdxElement.prototype.$type,$iter)},l:function(a){switch(a.elementType()){case $.ig.MdxElementType.prototype.memberTree:case $.ig.MdxElementType.prototype.member:case $.ig.MdxElementType.prototype.calculated:case $.ig.MdxElementType.prototype.collection:return true}return false},m:function(){$.ig.Debug.prototype.a(this.h().count()>0,"MdxSet.Elements collection is empty.");var a=new $.ig.StringBuilder;var b=this.h().item(0);this.n(a,b);for(var c=1;c<this.h().count();c++){a.i(0,"CrossJoin(");a.i(10,$.ig.Environment.prototype.a());a.d(",");a.d($.ig.Environment.prototype.a());var d=this.h().item(c);this.n(a,d);a.d(")")}return a.toString()},n:function(a,b){var c=new $.ig.StringBuilder;switch(b.elementType()){case $.ig.MdxElementType.prototype.calculated:var d=b;var e=d.g();c.d("{");c.d(e);c.d("}");break;case $.ig.MdxElementType.prototype.member:c.d("{");c.d(b.mdxExpression());c.d("}");break;case $.ig.MdxElementType.prototype.collection:case $.ig.MdxElementType.prototype.memberTree:c.d(b.mdxExpression());break}if($.ig.util.cast($.ig.MdxLevelMembersElement.prototype.$type,b)!==null||$.ig.util.cast($.ig.MdxChildrenCollectionElement.prototype.$type,b)!==null){this.p(c,b)}switch(b.elementType()){case $.ig.MdxElementType.prototype.memberTree:case $.ig.MdxElementType.prototype.member:this.o(c,b);break}a.e(c)},o:function(a,b){},p:function(a,b){if(this.g().d()){a.i(0,"AddCalculatedMembers(");a.d(")")}},clone:function(){var a=new $.ig.MdxSet(1,this.g());var c=this.h().getEnumerator();while(c.moveNext()){var b=c.current();a.addElement(b)}return a},$type:new $.ig.Type("MdxSet",$.ig.Object.prototype.$type,[$.ig.IMdxSet.prototype.$type])},true);$.ig.util.defType("MdxSettings","Object",{a:null,b:null,c:null,d:null,e:null,f:null,g:null,h:null,i:null,j:null,k:null,l:null,init:function(){$.ig.Object.prototype.init.call(this);this.r(new $.ig.MdxDimensionAxisSettings);this.s(new $.ig.MdxDimensionAxisSettings);this.t(new $.ig.MdxSlicerAxisSettings);this.ac(true);this.ad(true);var a=new $.ig.ObservableCollection$1(String,0);a.collectionChanged=$.ig.Delegate.prototype.combine(a.collectionChanged,this.ai.runOn(this));this.ag(a);var b=new $.ig.ObservableCollection$1(String,0);b.collectionChanged=$.ig.Delegate.prototype.combine(b.collectionChanged,this.aj.runOn(this));this.ah(b);this.ae(true);this.af(true);this.w(true);this.x(true);this.bj(this.ag());this.bj(this.ah())},ai:function(a,b){this.s().p().clear();var d=this.ag().getEnumerator();while(d.moveNext()){var c=d.current();this.s().p().add(c)}},aj:function(a,b){this.r().p().clear();var d=this.ah().getEnumerator();while(d.moveNext()){var c=d.current();this.r().p().add(c)}},_r:null,r:function(a){if(arguments.length===1){this._r=a;return a}else{return this._r}},_s:null,s:function(a){if(arguments.length===1){this._s=a;return a}else{return this._s}},_t:null,t:function(a){if(arguments.length===1){this._t=a;return a}else{return this._t}},u:function(a){if(arguments.length===1){if(this.a!=a){this.a=a;this.s().n(a)}return a}else{return this.a}},v:function(a){if(arguments.length===1){if(this.b!=a){this.b=a;this.r().n(a)}return a}else{return this.b}},w:function(a){if(arguments.length===1){if(this.c!=a){this.c=a;this.s().o(a)}return a}else{return this.c}},x:function(a){if(arguments.length===1){if(this.d!=a){this.d=a;this.r().o(a)}return a}else{return this.d}},y:function(a){if(arguments.length===1){if(this.e!=a){this.e=a;this.s().j(a)}return a}else{return this.e}},z:function(a){if(arguments.length===1){if(this.f!=a){this.f=a;this.r().j(a)}return a}else{return this.f}},aa:function(a){if(arguments.length===1){if(this.g!=a){this.g=a;this.s().k(a)}return a}else{return this.g}},ab:function(a){if(arguments.length===1){if(this.h!=a){this.h=a;this.r().k(a)}return a}else{return this.h}},ac:function(a){if(arguments.length===1){if(this.i!=a){this.i=a;this.s().l(a)}return a}else{return this.i}},ad:function(a){if(arguments.length===1){if(this.j!=a){this.j=a;this.r().l(a)}return a}else{return this.j}},ae:function(a){if(arguments.length===1){if(this.k!=a){this.k=a;this.s().m(a)}return a}else{return this.k}},af:function(a){if(arguments.length===1){if(this.l!=a){this.l=a;this.r().m(a)}return a}else{return this.l}},_ag:null,ag:function(a){if(arguments.length===1){this._ag=a;return a}else{return this._ag}},_ah:null,ah:function(a){if(arguments.length===1){this._ah=a;return a}else{return this._ah}},bi:function(a){this.bj(a)},bj:function(a){a.clear();a.add("CHILDREN_CARDINALITY");a.add("PARENT_UNIQUE_NAME")},$type:new $.ig.Type("MdxSettings",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MdxAxisSettings","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("MdxAxisSettings",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MdxSlicerAxisSettings","MdxAxisSettings",{init:function(){$.ig.MdxAxisSettings.prototype.init.call(this)},$type:new $.ig.Type("MdxSlicerAxisSettings",$.ig.MdxAxisSettings.prototype.$type)},true);$.ig.util.defType("MdxDimensionAxisSettings","MdxAxisSettings",{a:null,b:null,init:function(){$.ig.MdxAxisSettings.prototype.init.call(this);this.p(new $.ig.List$1(String,0));this.i(new $.ig.MdxSetSettings)},_i:null,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},_k:null,k:function(a){if(arguments.length===1){this._k=a;return a}else{return this._k}},_l:null,l:function(a){if(arguments.length===1){this._l=a;return a}else{return this._l}},_m:null,m:function(a){if(arguments.length===1){this._m=a;return a}else{return this._m}},n:function(a){if(arguments.length===1){if(this.a!=a){this.a=a;this.i().c(a)}return a}else{return this.a}},o:function(a){if(arguments.length===1){if(this.b!=a){this.b=a;this.i().d(a)}return a}else{return this.b}},_p:null,p:function(a){if(arguments.length===1){this._p=a;return a}else{return this._p}},$type:new $.ig.Type("MdxDimensionAxisSettings",$.ig.MdxAxisSettings.prototype.$type)},true);$.ig.util.defType("MdxSetSettings","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},$type:new $.ig.Type("MdxSetSettings",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MdxSlicerAxis","MdxAxis",{init:function(a){$.ig.MdxAxis.prototype.init1.call(this,1,2,a)},_columnsFilter:null,columnsFilter:function(a){if(arguments.length===1){this._columnsFilter=a;return a}else{return this._columnsFilter}},_rowsFilter:null,rowsFilter:function(a){if(arguments.length===1){this._rowsFilter=a;return a}else{return this._rowsFilter}},_filtersFilter:null,filtersFilter:function(a){if(arguments.length===1){this._filtersFilter=a;return a}else{return this._filtersFilter}},_measureFilter:null,measureFilter:function(a){if(arguments.length===1){this._measureFilter=a;return a}else{return this._measureFilter}},_filterElements:null,filterElements:function(a){if(arguments.length===1){this._filterElements=a;
return a}else{return this._filterElements}},$type:new $.ig.Type("MdxSlicerAxis",$.ig.MdxAxis.prototype.$type,[$.ig.IMdxSlicerAxis.prototype.$type])},true);$.ig.util.defType("MdxSlicerSet","MdxSet",{init:function(){$.ig.MdxSet.prototype.init.call(this)},l:function(a){return $.ig.util.cast($.ig.IAxisFilterElement.prototype.$type,a)!==null},$type:new $.ig.Type("MdxSlicerSet",$.ig.MdxSet.prototype.$type)},true);$.ig.util.defType("MdxDimensionAxisProvider","Object",{a:null,b:null,c:null,init:function(initNumber,a,b,c,d){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.a=new $.ig.Dictionary$2(String,$.ig.MdxElementCollectionElement.prototype.$type,0);this.b=new $.ig.List$1(String,0);this.c=-1;$.ig.Object.prototype.init.call(this);if(a==null){throw new $.ig.ArgumentNullException("xmlaDataSource")}this.o(a);this.n(b);this.p(c);this.m(d)},init1:function(initNumber,a,b,c){this.a=new $.ig.Dictionary$2(String,$.ig.MdxElementCollectionElement.prototype.$type,0);this.b=new $.ig.List$1(String,0);this.c=-1;$.ig.Object.prototype.init.call(this);this.n(b);this.r(a);this.q(c)},_l:null,l:function(a){if(arguments.length===1){this._l=a;return a}else{return this._l}},d:null,m:function(a){if(arguments.length===1){this.d=a;return a}else{return this.d}},_n:null,n:function(a){if(arguments.length===1){this._n=a;return a}else{return this._n}},_o:null,o:function(a){if(arguments.length===1){this._o=a;return a}else{return this._o}},_p:null,p:function(a){if(arguments.length===1){this._p=a;return a}else{return this._p}},_q:null,q:function(a){if(arguments.length===1){this._q=a;return a}else{return this._q}},_r:null,r:function(a){if(arguments.length===1){this._r=a;return a}else{return this._r}},ag:function(){this.l(null)},extendAxis:function(a,b){var $self=this;var c=a;var d=this.q();var e=this.r().positionResolver();var f=new $.ig.MdxAxis(1,a.axisIndex(),this.n());var h=d.getEnumerator();while(h.moveNext()){var g=h.current();var i=new $.ig.MdxSet(1,c.h().i());var j=new $.ig.List$1($.ig.IMdxSet.prototype.$type,0);var k=e.getHostPositionItemInfo(g.position(),g.position().indexOf(g));var m=g.position().getItems().getEnumerator();while(m.moveNext()){var l=m.current();var n;if(l==g){n=new $.ig.MdxChildrenCollectionElement(l.key(),l.key(),-1,null,null);i.addElement(n);break}n=new $.ig.MdxSingleElement(0,l.key(),l.key(),l.depth());i.addElement(n)}var p=k.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(o){return o.key()==g.key()}).firstOrDefault$1($.ig.PositionItemInfo$2.prototype.$type);if(p!=null){if(p.count()==0){j.add(i)}else{this.ap(p,i,j,false,true,false)}var r=j.getEnumerator();while(r.moveNext()){var q=r.current();a.addSet(q);f.addSet(q)}}}return f},ah:function(a,b){if(this.c!=0){var c=new $.ig.MdxSet(1,this.n().i());if(this.c==-1){b.add(c)}this.ai(a,c,b);this.ap(a,new $.ig.MdxSet(1,this.n().i()),b,true,false,true)}else{this.ap(a,new $.ig.MdxSet(1,this.n().i()),b,false,false,true)}},ai:function(a,b,c){var $self=this;var e=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(d){return d.positionItemDepth()==a.positionItemDepthMin()}).toList$1($.ig.PositionItemInfo$2.prototype.$type);if(e.count()==0){return}if(this.c==a.positionItemIndex()+1){var h=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(f){return f.positionItemDepth()==0}).getEnumerator();while(h.moveNext()){var g=h.current();var i=b.clone();var j=new $.ig.MdxSingleElement(0,g.positionItem().key(),g.positionItem().key(),0);i.addElement(j);c.add(i);this.ak(g);if(g.count()==0){this.am(this.p(),g.positionItemIndex()+1,i)}else{this.ai(g,i,c)}}}else{var k=e.item(0);var l=new $.ig.MdxLevelMembersElement(k.hierarchyLevelKey(),k.hierarchyLevelKey(),a.positionItemDepthMin());b.addElement(l);this.ak(k);if(k.count()==0){if(this.c!=-1){c.add(b)}this.am(this.p(),k.positionItemIndex()+1,b)}else{this.ai(k,b,c)}}},createAxis:function(a){if(this.l()!=null){return this.l()}if(this.m()==null){this.l(this.al(a,this.p()));return this.l()}this.aj(a);this.ak(this.m());if(this.m().count()==0){this.l(this.al(a,this.p()));return this.l()}var b=new $.ig.List$1($.ig.IMdxSet.prototype.$type,0);this.ah(this.m(),b);var c=new $.ig.MdxAxis(1,a,this.n());var e=b.getEnumerator();while(e.moveNext()){var d=e.current();c.addSet(d)}this.l(c);return c},aj:function(a){var b=this.o().columnAxis().count()>0;var c=this.o().rowAxis().count()>0;var d=this.o().measures().count()>1;if(d){if(a==0){if(b){if(this.o().measureListLocation()==$.ig.MeasureListLocation.prototype.columns){this.c=this.o().measureListIndex()}}else if(c&&this.o().measureListLocation()==$.ig.MeasureListLocation.prototype.rows){this.c=this.o().measureListIndex()}}else if(a==1&&c&&this.o().measureListLocation()==$.ig.MeasureListLocation.prototype.rows){this.c=this.o().measureListIndex()}}var f=this.o().measures().getEnumerator();while(f.moveNext()){var e=f.current();this.b.add(e.uniqueName())}},ak:function(a){if(this.p()!=null){var b=a.positionItemIndex()+1;if(b<this.p().count()){var c=this.p().item(b);var d=$.ig.util.cast($.ig.MeasureList.prototype.$type,c);if(d!=null){var e=a.values().toList$1($.ig.PositionItemInfo$2.prototype.$type);var g=e.getEnumerator();while(g.moveNext()){var f=g.current();if(!this.b.contains(f.key())){a.remove(f.key())}}}var h=$.ig.util.cast($.ig.Hierarchy.prototype.$type,c);if(h!=null){var i=a.values().firstOrDefault$1($.ig.PositionItemInfo$2.prototype.$type);if(i!=null){if(i.hierarchyKey()!=h.uniqueName()){a.clear()}}}}else{a.clear()}}},al:function(a,b){var c=new $.ig.MdxSet(1,this.n().i());this.am(b,0,c);var d=new $.ig.MdxAxis(1,a,this.n());d.addSet(c);return d},am:function(a,b,c){var $self=this;if(a==null){return}for(var d=b;d<a.count();d++){var e=a.item(d);var f=$.ig.util.cast($.ig.Hierarchy.prototype.$type,e);if(f!=null){if(f.allMember()==null){var h=this.o().getCoreElements(function(g){return g.hierarchyUniqueName()==f.uniqueName()},$.ig.Level.prototype.$type).toList$1($.ig.ICoreOlapElement.prototype.$type);var i=h.item(0);c.addElement(new $.ig.MdxLevelMembersElement(i.uniqueName(),i.uniqueName(),0))}else{c.addElement(new $.ig.MdxSingleElement(0,f.defaultMember(),f.defaultMember(),0))}continue}var j=$.ig.util.cast($.ig.Level.prototype.$type,e);if(j!=null){var k;if(!function(){var $ret=$self.a.tryGetValue(j.hierarchyUniqueName(),k);k=$ret.value;return $ret.ret}()){k=new $.ig.MdxElementCollectionElement;c.addElement(k);this.a.add(j.hierarchyUniqueName(),k)}k.addElement(new $.ig.MdxLevelMembersElement(j.uniqueName(),j.uniqueName(),j.depth()));continue}var l=$.ig.util.cast($.ig.MeasureList.prototype.$type,e);if(l!=null){var m=new $.ig.MdxElementCollectionElement;var o=l.measures().getEnumerator();while(o.moveNext()){var n=o.current();m.addElement(new $.ig.MdxSingleElement(0,n.uniqueName(),n.uniqueName(),0))}c.addElement(m)}}},an:function(a,b,c,d,e,f,g){var h=c.clone();h.addElement(new $.ig.MdxSingleElement(0,b.key(),b.key(),b.positionItemDepth()));this.ak(b);if(b.count()==0){if(e){if(f){d.add(h);this.am(this.p(),b.positionItemIndex()+1,h)}}else{d.add(h);this.am(this.p(),b.positionItemIndex()+1,h)}}else{this.ap(b,h,d,e,f,g)}if(g&&b.isExpanded()){this.ao(b,d,a,c)}},ao:function(a,b,c,d){var $self=this;var f=c.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(e){return e.parentKey()==a.key()}).toList$1($.ig.PositionItemInfo$2.prototype.$type);if(f.count()>0){var g=d.clone();g.addElement(new $.ig.MdxChildrenCollectionElement(a.key(),a.key(),a.positionItemDepth(),null,null));this.ak(a);if(a.count()==0){b.add(g);this.am(this.p(),a.positionItemIndex()+1,g)}else{this.ap(a,g,b,true,true,false)}}var i=f.getEnumerator();while(i.moveNext()){var h=i.current();var j=d.clone();j.addElement(new $.ig.MdxSingleElement(0,h.key(),h.key(),h.positionItemDepth()));this.ak(h);if(h.isExpanded()){this.ao(h,b,c,d)}this.ap(h,j,b,true,false,true)}},ap:function(a,b,c,d,e,f){var $self=this;var h=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(g){return g.positionItemDepth()==a.positionItemDepthMin()}).toList$1($.ig.PositionItemInfo$2.prototype.$type);if(h.count()==0){return}var j=h.getEnumerator();while(j.moveNext()){var i=j.current();this.an(a,i,b,c,d,e,f)}},$type:new $.ig.Type("MdxDimensionAxisProvider",$.ig.Object.prototype.$type,[$.ig.IMdxDimensionAxisProvider.prototype.$type])},true);$.ig.util.defType("MdxSlicerAxisProvider","Object",{a:null,b:null,c:null,init:function(a,b,c,d,e){this.a=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);this.b=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);this.c=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);$.ig.Object.prototype.init.call(this);this.f(a);this.g(e);this.a=b;this.b=c;this.c=d},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},createAxis:function(a){var b=new $.ig.MdxSlicerAxis(this.g().t());b.axisIndex(a);b.columnsFilter($.ig.MdxSlicerAxisBuilder.prototype.b(this.a,b));b.rowsFilter($.ig.MdxSlicerAxisBuilder.prototype.b(this.b,b));b.filtersFilter($.ig.MdxSlicerAxisBuilder.prototype.b(this.c,b));b.measureFilter($.ig.MdxSlicerAxisBuilder.prototype.a(this.f().measures(),b));return b},$type:new $.ig.Type("MdxSlicerAxisProvider",$.ig.Object.prototype.$type,[$.ig.IMdxAxisProvider.prototype.$type])},true);$.ig.util.defType("MdxSlicerAxisBuilder","Object",{init:function(){$.ig.Object.prototype.init.call(this)},a:function(a,b){if(a.count$1($.ig.Measure.prototype.$type)==0){return null}var c=new $.ig.MdxAxisFilterElement;var d=new $.ig.MdxElementCollectionElement;var f=a.getEnumerator();while(f.moveNext()){var e=f.current();var g=new $.ig.MdxSingleElement(0,e.uniqueName(),e.uniqueName(),0);d.addElement(g)}var h=new $.ig.MdxSlicerSet;h.addElement(c);b.addSet(h);c.addFilterPart(d,true);return c},b:function(a,b){var $self=this;var c=new $.ig.MdxAxisFilterElement;for(var d=0;d<a.count();d++){var e=a.item(d);var f=new $.ig.MdxElementCollectionElement;var g=new $.ig.Dictionary$2(String,$.ig.MdxSingleElement.prototype.$type,0);var i=e.memberNames().getEnumerator();while(i.moveNext()){var h=i.current();var j;if(!function(){var $ret=g.tryGetValue(h,j);j=$ret.value;return $ret.ret}()){j=new $.ig.MdxSingleElement(0,h,h,-1);g.add(h,j)}f.addElement(j)}c.addFilterPart(f,false)}if(c.filterCollection().count()==0&&c.singleFilterElements().count()==0){return null}var k=new $.ig.MdxSlicerSet;k.addElement(c);b.addSet(k);return c},$type:new $.ig.Type("MdxSlicerAxisBuilder",$.ig.Object.prototype.$type)},true);$.ig.util.defType("IXmlaDataProviderFactory","Object",{$type:new $.ig.Type("IXmlaDataProviderFactory",null)},true);$.ig.util.defType("DefaultXmlaDataProviderFactory","Object",{init:function(){$.ig.Object.prototype.init.call(this)},createDataProvider:function(a,b){return new $.ig.XmlaDataProvider(new $.ig.XmlaConnection(new $.ig.Uri(a),b),null)},$type:new $.ig.Type("DefaultXmlaDataProviderFactory",$.ig.Object.prototype.$type,[$.ig.IXmlaDataProviderFactory.prototype.$type])},true);$.ig.util.defType("RemoteXmlaDataProviderFactory","Object",{a:null,b:null,init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.Object.prototype.init.call(this);this.a=new $.ig.JsonRemoteXmlaRequestSerializer;this.b=new $.ig.JsonRemoteXmlaResponseSerializer},init1:function(initNumber,a,b){$.ig.Object.prototype.init.call(this);this.a=a;this.b=b},createDataProvider:function(a,b){return new $.ig.RemoteXmlaDataProvder(a,b,this.a,this.b)},$type:new $.ig.Type("RemoteXmlaDataProviderFactory",$.ig.Object.prototype.$type,[$.ig.IXmlaDataProviderFactory.prototype.$type])},true);$.ig.util.defType("IRemoteXmlaRequestSerializer","Object",{$type:new $.ig.Type("IRemoteXmlaRequestSerializer",null)},true);$.ig.util.defType("IRemoteXmlaResponseSerializer","Object",{$type:new $.ig.Type("IRemoteXmlaResponseSerializer",null)},true);$.ig.util.defType("JsonRemoteXmlaRequestSerializer","Object",{a:null,init:function(){$.ig.Object.prototype.init.call(this);this.a=new $.ig.JavaScriptSerializer},serializeRequest:function(a){return $.ig.RemoteXmlaRequestJsonTypeSeriazlier.prototype.b().serialize(a,this.a)},deserializeRequest:function(a){return $.ig.RemoteXmlaRequestJsonTypeSeriazlier.prototype.b().deserialize(a,this.a)},$type:new $.ig.Type("JsonRemoteXmlaRequestSerializer",$.ig.Object.prototype.$type,[$.ig.IRemoteXmlaRequestSerializer.prototype.$type])},true);$.ig.util.defType("JsonRemoteXmlaResponseSerializer","Object",{a:null,init:function(){$.ig.Object.prototype.init.call(this);this.a=new $.ig.JavaScriptSerializer},serializeResponse:function(a,b){switch(b){case $.ig.RemoteXmlaRequestType.prototype.discoverCatalogs:return $.ig.ArrayJsonSerializer.prototype.b().g($.ig.Catalog.prototype.$type,a,$.ig.CatalogJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverCubes:return $.ig.ArrayJsonSerializer.prototype.b().g($.ig.Cube.prototype.$type,a,$.ig.CubeJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverDimensions:return $.ig.ArrayJsonSerializer.prototype.b().g($.ig.Dimension.prototype.$type,a,$.ig.DimensionJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverHierarchies:return $.ig.ArrayJsonSerializer.prototype.b().g($.ig.Hierarchy.prototype.$type,a,$.ig.HierarchyJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverLevels:return $.ig.ArrayJsonSerializer.prototype.b().g($.ig.Level.prototype.$type,a,$.ig.LevelJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverMeasures:return $.ig.ArrayJsonSerializer.prototype.b().g($.ig.Measure.prototype.$type,a,$.ig.MeasureJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverMeasureGroups:return $.ig.ArrayJsonSerializer.prototype.b().g($.ig.MeasureGroup.prototype.$type,a,$.ig.MeasureGroupJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverMeasureGroupDimensions:return $.ig.ArrayJsonSerializer.prototype.b().g($.ig.MeasureGroupDimension.prototype.$type,a,$.ig.MeasureGroupDimensionJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverMembers:return $.ig.ArrayJsonSerializer.prototype.b().g($.ig.Member.prototype.$type,a,$.ig.MemberJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.executeStatement:return $.ig.ResultJsonTypeSeriazlier.prototype.b().serialize(a,this.a);default:throw new $.ig.Error(1,"Unknown RemoteXmlaRequestType.")}},deserializeResponse:function(a,b){switch(b){case $.ig.RemoteXmlaRequestType.prototype.discoverCatalogs:return $.ig.ArrayJsonSerializer.prototype.b().e($.ig.Catalog.prototype.$type,a,$.ig.CatalogJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverCubes:return $.ig.ArrayJsonSerializer.prototype.b().e($.ig.Cube.prototype.$type,a,$.ig.CubeJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverDimensions:return $.ig.ArrayJsonSerializer.prototype.b().e($.ig.Dimension.prototype.$type,a,$.ig.DimensionJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverHierarchies:return $.ig.ArrayJsonSerializer.prototype.b().e($.ig.Hierarchy.prototype.$type,a,$.ig.HierarchyJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverLevels:return $.ig.ArrayJsonSerializer.prototype.b().e($.ig.Level.prototype.$type,a,$.ig.LevelJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverMeasures:return $.ig.ArrayJsonSerializer.prototype.b().e($.ig.Measure.prototype.$type,a,$.ig.MeasureJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverMeasureGroups:return $.ig.ArrayJsonSerializer.prototype.b().e($.ig.MeasureGroup.prototype.$type,a,$.ig.MeasureGroupJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverMeasureGroupDimensions:return $.ig.ArrayJsonSerializer.prototype.b().e($.ig.MeasureGroupDimension.prototype.$type,a,$.ig.MeasureGroupDimensionJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.discoverMembers:return $.ig.ArrayJsonSerializer.prototype.b().e($.ig.Member.prototype.$type,a,$.ig.MemberJsonTypeSeriazlier.prototype.b(),this.a);case $.ig.RemoteXmlaRequestType.prototype.executeStatement:return $.ig.ResultJsonTypeSeriazlier.prototype.b().deserialize(a,this.a);default:throw new $.ig.Error(1,"Unknown RemoteXmlaRequestType.")}},$type:new $.ig.Type("JsonRemoteXmlaResponseSerializer",$.ig.Object.prototype.$type,[$.ig.IRemoteXmlaResponseSerializer.prototype.$type])},true);$.ig.util.defType("ArrayJsonSerializer","Object",{init:function(){$.ig.Object.prototype.init.call(this)},b:function(){return $.ig.ArrayJsonSerializer.prototype.a},e:function($t,a,b,c){var d=c.a(a);return this.i($t,d,b)},g:function($t,a,b,c){var d=this.k($t,a,b);return c.b(d)},i:function($t,a,b){var c=new $.ig.List$1($t,0);for(var d=0;d<a.length;d++){var e=a[d];c.add(b.fromJsonObject(e))}return c},k:function($t,a,b){var c=a.toArray$1($t);var d=new Array(c.length);for(var e=0;e<c.length;e++){d[e]=b.toJsonObject(c[e])}return d},$type:new $.ig.Type("ArrayJsonSerializer",$.ig.Object.prototype.$type)},true);$.ig.util.defType("IJsonTypeSerializer$1","Object",{$type:new $.ig.Type("IJsonTypeSerializer$1",null)},true);$.ig.util.defType("JsonTypeSeriazlierBase$1","Object",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this)},deserialize:function(a,b){return this.fromJsonObject(b.a(a))},serialize:function(a,b){return b.b(this.toJsonObject(a))},fromJsonObject:function(a){},toJsonObject:function(a){},$type:new $.ig.Type("JsonTypeSeriazlierBase$1",$.ig.Object.prototype.$type,[$.ig.IJsonTypeSerializer$1.prototype.$type.specialize(0)])},true);$.ig.util.defType("AxisJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.OlapResultAxis.prototype.$type)},b:function(){return $.ig.AxisJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;var b=$.ig.JsonSerializerUtils.prototype.b(a,"n");var c=$.ig.ArrayJsonSerializer.prototype.b().i($.ig.OlapResultTuple.prototype.$type,$.ig.JsonSerializerUtils.prototype.b(a,"t"),$.ig.TupleJsonTypeSeriazlier.prototype.b());var d=0;if(c.count()>0){d=c.item(0).members().count()}return function(){var $ret=new $.ig.OlapResultAxis(c,d);$ret.name(b);return $ret}()},toJsonObject:function(a){var b=$.ig.ArrayJsonSerializer.prototype.b().k($.ig.OlapResultTuple.prototype.$type,a.tuples(),$.ig.TupleJsonTypeSeriazlier.prototype.b());var c=$.ig.JsonSerializerUtils.prototype.a();$.ig.JsonSerializerUtils.prototype.c(c,"n",a.name());$.ig.JsonSerializerUtils.prototype.c(c,"t",b);return c},$type:new $.ig.Type("AxisJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.OlapResultAxis.prototype.$type))},true);$.ig.util.defType("AxisMemberJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.OlapResultAxisMember.prototype.$type)},b:function(){return $.ig.AxisMemberJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.OlapResultAxisMember;$ret.hierarchyUniqueName($.ig.JsonSerializerUtils.prototype.b(a,"hun"));$ret.uniqueName($.ig.JsonSerializerUtils.prototype.b(a,"un"));$ret.levelUniqueName($.ig.JsonSerializerUtils.prototype.b(a,"lun"));$ret.caption($.ig.JsonSerializerUtils.prototype.b(a,"c"));$ret.levelNumber($.ig.JsonSerializerUtils.prototype.b(a,"ln"));$ret.displayInfo($.ig.JsonSerializerUtils.prototype.b(a,"di"));$ret.properties($.ig.JsonSerializerUtils.prototype.f(a,"p"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.a();$.ig.JsonSerializerUtils.prototype.c(b,"hun",a.hierarchyUniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"un",a.uniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"lun",a.levelUniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.c(b,"ln",a.levelNumber());$.ig.JsonSerializerUtils.prototype.c(b,"di",a.displayInfo());$.ig.JsonSerializerUtils.prototype.g(b,"p",a.properties());return b},$type:new $.ig.Type("AxisMemberJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.OlapResultAxisMember.prototype.$type))},true);$.ig.util.defType("CatalogJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.Catalog.prototype.$type)},b:function(){return $.ig.CatalogJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.Catalog;$ret.caption($.ig.JsonSerializerUtils.prototype.b(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.b(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.b(a,"n"));$ret.uniqueName($.ig.JsonSerializerUtils.prototype.b(a,"un"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.a();$.ig.JsonSerializerUtils.prototype.c(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.c(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.c(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.c(b,"un",a.uniqueName());return b},$type:new $.ig.Type("CatalogJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.Catalog.prototype.$type))},true);$.ig.util.defType("CellJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.OlapResultCell.prototype.$type)},b:function(){return $.ig.CellJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.OlapResultCell;$ret.cellOrdinal($.ig.JsonSerializerUtils.prototype.b(a,"co"));$ret.properties($.ig.JsonSerializerUtils.prototype.d(a,"p"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.a();$.ig.JsonSerializerUtils.prototype.c(b,"co",a.cellOrdinal());$.ig.JsonSerializerUtils.prototype.e(b,"p",a.properties());return b},$type:new $.ig.Type("CellJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.OlapResultCell.prototype.$type))},true);$.ig.util.defType("CubeJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.Cube.prototype.$type)},b:function(){return $.ig.CubeJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.Cube;$ret.caption($.ig.JsonSerializerUtils.prototype.b(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.b(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.b(a,"n"));$ret.catalogName($.ig.JsonSerializerUtils.prototype.b(a,"cn"));$ret.cubeType($.ig.JsonSerializerUtils.prototype.b(a,"ct"));$ret.lastProcessed($.ig.JsonSerializerUtils.prototype.b(a,"lp"));$ret.lastUpdated($.ig.JsonSerializerUtils.prototype.b(a,"lu"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.a();$.ig.JsonSerializerUtils.prototype.c(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.c(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.c(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.c(b,"cn",a.catalogName());$.ig.JsonSerializerUtils.prototype.c(b,"ct",a.cubeType());$.ig.JsonSerializerUtils.prototype.c(b,"lp",a.lastProcessed());$.ig.JsonSerializerUtils.prototype.c(b,"lu",a.lastUpdated());return b},$type:new $.ig.Type("CubeJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.Cube.prototype.$type))},true);$.ig.util.defType("DimensionJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.Dimension.prototype.$type)},b:function(){return $.ig.DimensionJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.Dimension;$ret.caption($.ig.JsonSerializerUtils.prototype.b(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.b(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.b(a,"n"));$ret.uniqueName($.ig.JsonSerializerUtils.prototype.b(a,"un"));$ret.dimensionType($.ig.JsonSerializerUtils.prototype.b(a,"dt"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.a();$.ig.JsonSerializerUtils.prototype.c(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.c(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.c(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.c(b,"un",a.uniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"dt",a.dimensionType());return b},$type:new $.ig.Type("DimensionJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.Dimension.prototype.$type))},true);$.ig.util.defType("HierarchyJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.Hierarchy.prototype.$type)},b:function(){return $.ig.HierarchyJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.Hierarchy;$ret.caption($.ig.JsonSerializerUtils.prototype.b(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.b(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.b(a,"n"));$ret.uniqueName($.ig.JsonSerializerUtils.prototype.b(a,"un"));$ret.allMember($.ig.JsonSerializerUtils.prototype.b(a,"am"));$ret.defaultMember($.ig.JsonSerializerUtils.prototype.b(a,"dm"));$ret.dimensionUniqueName($.ig.JsonSerializerUtils.prototype.b(a,"dun"));$ret.hierarchyDisplayFolder($.ig.JsonSerializerUtils.prototype.b(a,"hdf"));$ret.hierarchyOrigin($.ig.JsonSerializerUtils.prototype.b(a,"ho"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.a();$.ig.JsonSerializerUtils.prototype.c(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.c(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.c(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.c(b,"un",a.uniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"am",a.allMember());$.ig.JsonSerializerUtils.prototype.c(b,"dm",a.defaultMember());$.ig.JsonSerializerUtils.prototype.c(b,"dun",a.dimensionUniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"hdf",a.hierarchyDisplayFolder());$.ig.JsonSerializerUtils.prototype.c(b,"ho",a.hierarchyOrigin());return b},$type:new $.ig.Type("HierarchyJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.Hierarchy.prototype.$type))},true);$.ig.util.defType("JsonSerializerUtils","Object",{init:function(){$.ig.Object.prototype.init.call(this)},a:function(){return $.ig.jQueryUtils.prototype.createJavascriptObject()},b:function(a,b){return $.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,b)},c:function(a,b,c){$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(a,b,c)},d:function(a,b){return $.ig.jQueryUtils.prototype.convertToObjectDictionary($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,b))},e:function(a,b,c){var d=$.ig.jQueryUtils.prototype.convertFromObjectDictionary(c);$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(a,b,d)},f:function(a,b){return $.ig.jQueryUtils.prototype.convertToStringDictionary($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,b))},g:function(a,b,c){var d=$.ig.jQueryUtils.prototype.convertFromStringDictionary(c);$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(a,b,d)},$type:new $.ig.Type("JsonSerializerUtils",$.ig.Object.prototype.$type)},true);$.ig.util.defType("LevelJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.Level.prototype.$type)},b:function(){return $.ig.LevelJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.Level;$ret.caption($.ig.JsonSerializerUtils.prototype.b(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.b(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.b(a,"n"));$ret.uniqueName($.ig.JsonSerializerUtils.prototype.b(a,"un"));$ret.depth($.ig.JsonSerializerUtils.prototype.b(a,"d"));$ret.dimensionUniqueName($.ig.JsonSerializerUtils.prototype.b(a,"dun"));$ret.hierarchyUniqueName($.ig.JsonSerializerUtils.prototype.b(a,"hun"));$ret.levelOrderingProperty($.ig.JsonSerializerUtils.prototype.b(a,"lop"));$ret.levelOrigin($.ig.JsonSerializerUtils.prototype.b(a,"lo"));$ret.membersCount($.ig.JsonSerializerUtils.prototype.b(a,"mc"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.a();$.ig.JsonSerializerUtils.prototype.c(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.c(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.c(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.c(b,"un",a.uniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"d",a.depth());$.ig.JsonSerializerUtils.prototype.c(b,"dun",a.dimensionUniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"hun",a.hierarchyUniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"lop",a.levelOrderingProperty());$.ig.JsonSerializerUtils.prototype.c(b,"lo",a.levelOrigin());$.ig.JsonSerializerUtils.prototype.c(b,"mc",a.membersCount());return b},$type:new $.ig.Type("LevelJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.Level.prototype.$type))},true);$.ig.util.defType("MeasureGroupDimensionJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.MeasureGroupDimension.prototype.$type)},b:function(){return $.ig.MeasureGroupDimensionJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.MeasureGroupDimension;$ret.catalogName($.ig.JsonSerializerUtils.prototype.b(a,"cn"));$ret.cubeName($.ig.JsonSerializerUtils.prototype.b(a,"cbn"));$ret.dimensionCardinality($.ig.JsonSerializerUtils.prototype.b(a,"dc"));$ret.dimensionGranularity($.ig.JsonSerializerUtils.prototype.b(a,"dg"));$ret.dimensionPath($.ig.JsonSerializerUtils.prototype.b(a,"dap"));$ret.dimensionUniqueName($.ig.JsonSerializerUtils.prototype.b(a,"dun"));$ret.isDimensionVisible($.ig.JsonSerializerUtils.prototype.b(a,"idv"));$ret.isFactDimension($.ig.JsonSerializerUtils.prototype.b(a,"iafd"));$ret.measureGroupCardinality($.ig.JsonSerializerUtils.prototype.b(a,"mgc"));$ret.measureGroupName($.ig.JsonSerializerUtils.prototype.b(a,"mgn"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.a();$.ig.JsonSerializerUtils.prototype.c(b,"cn",a.catalogName());$.ig.JsonSerializerUtils.prototype.c(b,"cbn",a.cubeName());$.ig.JsonSerializerUtils.prototype.c(b,"dc",a.dimensionCardinality());$.ig.JsonSerializerUtils.prototype.c(b,"dg",a.dimensionGranularity());$.ig.JsonSerializerUtils.prototype.c(b,"dap",a.dimensionPath());$.ig.JsonSerializerUtils.prototype.c(b,"dun",a.dimensionUniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"idv",a.isDimensionVisible());$.ig.JsonSerializerUtils.prototype.c(b,"iafd",a.isFactDimension());$.ig.JsonSerializerUtils.prototype.c(b,"mgc",a.measureGroupCardinality());$.ig.JsonSerializerUtils.prototype.c(b,"mgn",a.measureGroupName());return b},$type:new $.ig.Type("MeasureGroupDimensionJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.MeasureGroupDimension.prototype.$type))},true);$.ig.util.defType("MeasureGroupJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.MeasureGroup.prototype.$type)},b:function(){return $.ig.MeasureGroupJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.MeasureGroup;$ret.caption($.ig.JsonSerializerUtils.prototype.b(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.b(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.b(a,"n"));
$ret.catalogName($.ig.JsonSerializerUtils.prototype.b(a,"cn"));$ret.cubeName($.ig.JsonSerializerUtils.prototype.b(a,"cbn"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.a();$.ig.JsonSerializerUtils.prototype.c(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.c(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.c(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.c(b,"cn",a.catalogName());$.ig.JsonSerializerUtils.prototype.c(b,"cbn",a.cubeName());return b},$type:new $.ig.Type("MeasureGroupJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.MeasureGroup.prototype.$type))},true);$.ig.util.defType("MeasureJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.Measure.prototype.$type)},b:function(){return $.ig.MeasureJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.Measure;$ret.caption($.ig.JsonSerializerUtils.prototype.b(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.b(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.b(a,"n"));$ret.uniqueName($.ig.JsonSerializerUtils.prototype.b(a,"un"));$ret.aggregatorType($.ig.JsonSerializerUtils.prototype.b(a,"at"));$ret.defaultFormatString($.ig.JsonSerializerUtils.prototype.b(a,"dfs"));$ret.measureDisplayFolder($.ig.JsonSerializerUtils.prototype.b(a,"mdf"));$ret.measureGroupName($.ig.JsonSerializerUtils.prototype.b(a,"mgn"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.a();$.ig.JsonSerializerUtils.prototype.c(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.c(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.c(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.c(b,"un",a.uniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"at",a.aggregatorType());$.ig.JsonSerializerUtils.prototype.c(b,"dfs",a.defaultFormatString());$.ig.JsonSerializerUtils.prototype.c(b,"mdf",a.measureDisplayFolder());$.ig.JsonSerializerUtils.prototype.c(b,"mgn",a.measureGroupName());return b},$type:new $.ig.Type("MeasureJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.Measure.prototype.$type))},true);$.ig.util.defType("MemberJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.Member.prototype.$type)},b:function(){return $.ig.MemberJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.Member;$ret.caption($.ig.JsonSerializerUtils.prototype.b(a,"c"));$ret.description($.ig.JsonSerializerUtils.prototype.b(a,"d"));$ret.name($.ig.JsonSerializerUtils.prototype.b(a,"n"));$ret.uniqueName($.ig.JsonSerializerUtils.prototype.b(a,"un"));$ret.catalogName($.ig.JsonSerializerUtils.prototype.b(a,"cn"));$ret.childrenCardinality($.ig.JsonSerializerUtils.prototype.b(a,"cc"));$ret.cubeName($.ig.JsonSerializerUtils.prototype.b(a,"cbn"));$ret.dimensionUniqueName($.ig.JsonSerializerUtils.prototype.b(a,"dun"));$ret.hierarchyUniqueName($.ig.JsonSerializerUtils.prototype.b(a,"hun"));$ret.levelDepth($.ig.JsonSerializerUtils.prototype.b(a,"ld"));$ret.levelUniqueName($.ig.JsonSerializerUtils.prototype.b(a,"lun"));$ret.memberType($.ig.JsonSerializerUtils.prototype.b(a,"mt"));$ret.parentLevel($.ig.JsonSerializerUtils.prototype.b(a,"pl"));$ret.parentUniqueName($.ig.JsonSerializerUtils.prototype.b(a,"pun"));$ret.scope($.ig.util.toNullable($.ig.Number.prototype.$type,$.ig.JsonSerializerUtils.prototype.b(a,"s")));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.a();$.ig.JsonSerializerUtils.prototype.c(b,"c",a.caption());$.ig.JsonSerializerUtils.prototype.c(b,"d",a.description());$.ig.JsonSerializerUtils.prototype.c(b,"n",a.name());$.ig.JsonSerializerUtils.prototype.c(b,"un",a.uniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"cn",a.catalogName());$.ig.JsonSerializerUtils.prototype.c(b,"cc",a.childrenCardinality());$.ig.JsonSerializerUtils.prototype.c(b,"cbn",a.cubeName());$.ig.JsonSerializerUtils.prototype.c(b,"dun",a.dimensionUniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"hun",a.hierarchyUniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"ld",a.levelDepth());$.ig.JsonSerializerUtils.prototype.c(b,"lun",a.levelUniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"mt",a.memberType());$.ig.JsonSerializerUtils.prototype.c(b,"pl",a.parentLevel());$.ig.JsonSerializerUtils.prototype.c(b,"pun",a.parentUniqueName());$.ig.JsonSerializerUtils.prototype.c(b,"s",a.scope());return b},$type:new $.ig.Type("MemberJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.Member.prototype.$type))},true);$.ig.util.defType("RemoteXmlaRequestJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.RemoteXmlaRequest.prototype.$type)},b:function(){return $.ig.RemoteXmlaRequestJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;return function(){var $ret=new $.ig.RemoteXmlaRequest;$ret.f($.ig.JsonSerializerUtils.prototype.b(a,"t"));$ret.g($.ig.JsonSerializerUtils.prototype.f(a,"p"));$ret.h($.ig.JsonSerializerUtils.prototype.f(a,"r"));$ret.i($.ig.JsonSerializerUtils.prototype.f(a,"par"));$ret.j($.ig.JsonSerializerUtils.prototype.b(a,"s"));return $ret}()},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.a();$.ig.JsonSerializerUtils.prototype.c(b,"t",a.f());$.ig.JsonSerializerUtils.prototype.g(b,"p",a.g());$.ig.JsonSerializerUtils.prototype.g(b,"r",a.h());$.ig.JsonSerializerUtils.prototype.g(b,"par",a.i());$.ig.JsonSerializerUtils.prototype.c(b,"s",a.j());return b},$type:new $.ig.Type("RemoteXmlaRequestJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.RemoteXmlaRequest.prototype.$type))},true);$.ig.util.defType("ResultJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.OlapResult.prototype.$type)},b:function(){return $.ig.ResultJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var $self=this;var b=$.ig.JsonSerializerUtils.prototype.b(a,"ie");if(b){return function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}()}else{var c=$.ig.ArrayJsonSerializer.prototype.b().i($.ig.OlapResultAxis.prototype.$type,$.ig.JsonSerializerUtils.prototype.b(a,"a"),$.ig.AxisJsonTypeSeriazlier.prototype.b());var d=$.ig.ArrayJsonSerializer.prototype.b().i($.ig.OlapResultAxis.prototype.$type,$.ig.JsonSerializerUtils.prototype.b(a,"c"),$.ig.CellJsonTypeSeriazlier.prototype.b());return function(){var $ret=new $.ig.OlapResult;$ret.axes(c);$ret.cells(d);return $ret}()}},toJsonObject:function(a){var b=$.ig.JsonSerializerUtils.prototype.a();$.ig.JsonSerializerUtils.prototype.c(b,"ie",a.isEmpty());if(!a.isEmpty()){var c=$.ig.ArrayJsonSerializer.prototype.b().k($.ig.OlapResultAxis.prototype.$type,a.axes(),$.ig.AxisJsonTypeSeriazlier.prototype.b());var d=$.ig.ArrayJsonSerializer.prototype.b().k($.ig.OlapResultAxis.prototype.$type,a.cells(),$.ig.CellJsonTypeSeriazlier.prototype.b());$.ig.JsonSerializerUtils.prototype.c(b,"a",c);$.ig.JsonSerializerUtils.prototype.c(b,"c",d)}return b},$type:new $.ig.Type("ResultJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.OlapResult.prototype.$type))},true);$.ig.util.defType("TupleJsonTypeSeriazlier","JsonTypeSeriazlierBase$1",{init:function(){$.ig.JsonTypeSeriazlierBase$1.prototype.init.call(this,$.ig.OlapResultTuple.prototype.$type)},b:function(){return $.ig.TupleJsonTypeSeriazlier.prototype.a},fromJsonObject:function(a){var b=$.ig.ArrayJsonSerializer.prototype.b().i($.ig.OlapResultAxisMember.prototype.$type,$.ig.JsonSerializerUtils.prototype.b(a,"m"),$.ig.AxisMemberJsonTypeSeriazlier.prototype.b());var c=new $.ig.OlapResultTuple(b);var e=b.getEnumerator();while(e.moveNext()){var d=e.current();d.position(c)}return c},toJsonObject:function(a){var b=$.ig.ArrayJsonSerializer.prototype.b().k($.ig.OlapResultAxisMember.prototype.$type,a.members(),$.ig.AxisMemberJsonTypeSeriazlier.prototype.b());var c=$.ig.JsonSerializerUtils.prototype.a();$.ig.JsonSerializerUtils.prototype.c(c,"m",b);return c},$type:new $.ig.Type("TupleJsonTypeSeriazlier",$.ig.JsonTypeSeriazlierBase$1.prototype.$type.specialize($.ig.OlapResultTuple.prototype.$type))},true);$.ig.util.defType("RemoteXmlaDataProvder","Object",{a:null,b:null,c:null,d:null,init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);this.a=a;this.b=b;this.c=c;this.d=d},discoverCatalogsAsync:function(a,b){var $self=this;var c=this.d;return this.e($.ig.RemoteXmlaRequestType.prototype.discoverCatalogs,a,b,null,null).ae($.ig.IEnumerable$1.prototype.$type,function(d){return c.deserializeResponse(d.aa(),$.ig.RemoteXmlaRequestType.prototype.discoverCatalogs)})},discoverCubesAsync:function(a,b){var $self=this;var c=this.d;return this.e($.ig.RemoteXmlaRequestType.prototype.discoverCubes,a,b,null,null).ae($.ig.IEnumerable$1.prototype.$type,function(d){return c.deserializeResponse(d.aa(),$.ig.RemoteXmlaRequestType.prototype.discoverCubes)})},discoverDimensionsAsync:function(a,b){var $self=this;var c=this.d;return this.e($.ig.RemoteXmlaRequestType.prototype.discoverDimensions,a,b,null,null).ae($.ig.IEnumerable$1.prototype.$type,function(d){return c.deserializeResponse(d.aa(),$.ig.RemoteXmlaRequestType.prototype.discoverDimensions)})},discoverHierarchiesAsync:function(a,b){var $self=this;var c=this.d;return this.e($.ig.RemoteXmlaRequestType.prototype.discoverHierarchies,a,b,null,null).ae($.ig.IEnumerable$1.prototype.$type,function(d){return c.deserializeResponse(d.aa(),$.ig.RemoteXmlaRequestType.prototype.discoverHierarchies)})},discoverLevelsAsync:function(a,b){var $self=this;var c=this.d;return this.e($.ig.RemoteXmlaRequestType.prototype.discoverLevels,a,b,null,null).ae($.ig.IEnumerable$1.prototype.$type,function(d){return c.deserializeResponse(d.aa(),$.ig.RemoteXmlaRequestType.prototype.discoverLevels)})},discoverMeasuresAsync:function(a,b){var $self=this;var c=this.d;return this.e($.ig.RemoteXmlaRequestType.prototype.discoverMeasures,a,b,null,null).ae($.ig.IEnumerable$1.prototype.$type,function(d){return c.deserializeResponse(d.aa(),$.ig.RemoteXmlaRequestType.prototype.discoverMeasures)})},discoverMeasureGroupsAsync:function(a,b){var $self=this;var c=this.d;return this.e($.ig.RemoteXmlaRequestType.prototype.discoverMeasureGroups,a,b,null,null).ae($.ig.IEnumerable$1.prototype.$type,function(d){return c.deserializeResponse(d.aa(),$.ig.RemoteXmlaRequestType.prototype.discoverMeasureGroups)})},discoverMeasureGroupDimensionsAsync:function(a,b){var $self=this;var c=this.d;return this.e($.ig.RemoteXmlaRequestType.prototype.discoverMeasureGroupDimensions,a,b,null,null).ae($.ig.IEnumerable$1.prototype.$type,function(d){return c.deserializeResponse(d.aa(),$.ig.RemoteXmlaRequestType.prototype.discoverMeasureGroupDimensions)})},discoverMembersAsync:function(a,b){var $self=this;var c=this.d;return this.e($.ig.RemoteXmlaRequestType.prototype.discoverMembers,a,b,null,null).ae($.ig.IEnumerable$1.prototype.$type,function(d){return c.deserializeResponse(d.aa(),$.ig.RemoteXmlaRequestType.prototype.discoverMembers)})},executeStatementAsync:function(a,b,c){var $self=this;var d=this.d;return this.e($.ig.RemoteXmlaRequestType.prototype.executeStatement,b,null,c,a).ae($.ig.OlapResult.prototype.$type,function(e){return d.deserializeResponse(e.aa(),$.ig.RemoteXmlaRequestType.prototype.executeStatement)})},e:function(a,b,c,d,e){var $self=this;var f=function(){var $ret=new $.ig.WebClient;$ret.g($self.b);return $ret}();var g=this.c.serializeRequest(function(){var $ret=new $.ig.RemoteXmlaRequest;$ret.f(a);$ret.g($self.g(b));$ret.h($self.g(c));$ret.i($self.g(d));$ret.j(e);return $ret}());var h=new $.ig.TaskCompletionSource$1(String,0);f.uploadStringCompleted=$.ig.Delegate.prototype.combine(f.uploadStringCompleted,this.f.runOn(this));f.p(new $.ig.Uri(this.a),"POST",g,h);return h.d()},f:function(a,b){var c=b.userState();if(b.cancelled()){c.g()}else if(b.error()!=null){c.h(b.error())}else{c.i(b.result())}},g:function(a){if(a==null){return null}var b=new $.ig.Dictionary$2(String,String,0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c.c(),c.d())}return b},$type:new $.ig.Type("RemoteXmlaDataProvder",$.ig.Object.prototype.$type,[$.ig.IXmlaDataProvider.prototype.$type])},true);$.ig.util.defType("RemoteXmlaRequest","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_i:null,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},$type:new $.ig.Type("RemoteXmlaRequest",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaConnection","Object",{a:null,b:null,init:function(a,b){$.ig.Object.prototype.init.call(this);this.a=a;this.b=b},getXmlaSoapWebClient$1:function($t){var a=new $.ig.XmlaSoapWebClient$1($t,this.a,$.ig.Encoding.prototype.uTF8());a.g(this.b);return a},$type:new $.ig.Type("XmlaConnection",$.ig.Object.prototype.$type,[$.ig.ICoreXmlaConnection.prototype.$type])},true);$.ig.util.defType("XmlaDataSourceImpl","Object",{a:null,b:null,c:null,d:null,e:null,f:null,g:null,h:null,i:null,j:null,k:null,l:null,m:null,n:null,o:null,p:null,q:null,r:null,s:null,t:null,u:null,init:function(a){var $self=this;this.b=new $.ig.List$1($.ig.MdxDimensionAxisProvider.prototype.$type,0);this.c=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);this.d=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);this.e=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);this.f=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);this.g=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);this.h=new $.ig.List$1(String,0);$.ig.Object.prototype.init.call(this);this.i=false;this.j=null;this.k=false;this.l=null;this.isInitialized(false);this.mdxSettings(a.mdxSettings());this.sourceOptions(a);if(a.dataProviderFactory()==null){this.dataProviderFactory(new $.ig.DefaultXmlaDataProviderFactory)}else{this.dataProviderFactory(a.dataProviderFactory())}this.catalogs(new $.ig.ArrayListCollection$1($.ig.Catalog.prototype.$type));this.cubes(new $.ig.ArrayListCollection$1($.ig.Cube.prototype.$type));this.measureGroups(new $.ig.ArrayListCollection$1($.ig.MeasureGroup.prototype.$type));this.rowAxis(new $.ig.ArrayListCollection$1($.ig.ICoreOlapElement.prototype.$type));this.columnAxis(new $.ig.ArrayListCollection$1($.ig.ICoreOlapElement.prototype.$type));this.filters(new $.ig.ArrayListCollection$1($.ig.Hierarchy.prototype.$type));this.measures(new $.ig.ArrayListCollection$1($.ig.Measure.prototype.$type));this.measureListLocation($.ig.MeasureListLocation.prototype.columns);this.measureListIndex(-1);this.u=true;if(this.sourceOptions()!=null){this.u=this.sourceOptions().enableResultCache()==true}this.result(function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}())},_isInitialized:null,isInitialized:function(a){if(arguments.length===1){this._isInitialized=a;return a}else{return this._isInitialized}},_catalogs:null,catalogs:function(a){if(arguments.length===1){this._catalogs=a;return a}else{return this._catalogs}},_catalog:null,catalog:function(a){if(arguments.length===1){this._catalog=a;return a}else{return this._catalog}},_cubes:null,cubes:function(a){if(arguments.length===1){this._cubes=a;return a}else{return this._cubes}},_cube:null,cube:function(a){if(arguments.length===1){this._cube=a;return a}else{return this._cube}},_measureGroup:null,measureGroup:function(a){if(arguments.length===1){this._measureGroup=a;return a}else{return this._measureGroup}},_measureGroups:null,measureGroups:function(a){if(arguments.length===1){this._measureGroups=a;return a}else{return this._measureGroups}},_sourceOptions:null,sourceOptions:function(a){if(arguments.length===1){this._sourceOptions=a;return a}else{return this._sourceOptions}},_dataProviderFactory:null,dataProviderFactory:function(a){if(arguments.length===1){this._dataProviderFactory=a;return a}else{return this._dataProviderFactory}},_metadataTree:null,metadataTree:function(a){if(arguments.length===1){this._metadataTree=a;return a}else{return this._metadataTree}},_rowAxis:null,rowAxis:function(a){if(arguments.length===1){this._rowAxis=a;return a}else{return this._rowAxis}},_columnAxis:null,columnAxis:function(a){if(arguments.length===1){this._columnAxis=a;return a}else{return this._columnAxis}},_filters:null,filters:function(a){if(arguments.length===1){this._filters=a;return a}else{return this._filters}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},measureListIndex:function(a){if(arguments.length===1){if(this.s!=a){this.r=true;this.s=a;this.b1();this.r=false}return a}else{return this.s}},measureListLocation:function(a){if(arguments.length===1){if(this.t!=a){this.bk();this.t=a;this.b1()}return a}else{return this.t}},_mdxSettings:null,mdxSettings:function(a){if(arguments.length===1){this._mdxSettings=a;return a}else{return this._mdxSettings}},_result:null,result:function(a){if(arguments.length===1){this._result=a;return a}else{return this._result}},_aq:null,aq:function(a){if(arguments.length===1){this._aq=a;return a}else{return this._aq}},getCoreElement:function(a,b){if(b==$.ig.MeasureList.prototype.$type){var c;if(this.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){c=this.columnAxis()}else{c=this.rowAxis()}var d=null;var f=c.getEnumerator();while(f.moveNext()){var e=f.current();d=$.ig.util.cast($.ig.MeasureList.prototype.$type,e);if(d!=null){break}}return d}else{return this.getCoreElements(a,b).firstOrDefault$1($.ig.ICoreOlapElement.prototype.$type)}},getCoreElements:function(a,b){var $self=this;if(b==$.ig.Dimension.prototype.$type){return this.bs($.ig.Dimension.prototype.$type,this.a.o().where$1($.ig.Dimension.prototype.$type,function(c){return a(c)}))}if(b==$.ig.Hierarchy.prototype.$type){return this.bs($.ig.Dimension.prototype.$type,this.a.p().where$1($.ig.Dimension.prototype.$type,function(d){return a(d)}))}if(b==$.ig.Level.prototype.$type){return this.bs($.ig.Dimension.prototype.$type,this.a.q().where$1($.ig.Dimension.prototype.$type,function(e){return a(e)}))}if(b==$.ig.Measure.prototype.$type){return this.bs($.ig.Dimension.prototype.$type,this.a.n().where$1($.ig.Dimension.prototype.$type,function(f){return a(f)}))}throw new $.ig.NotSupportedException(0,"Supported types are Dimension, Hierarchy, Level and Measure")},expandTupleMember:function(a,b,c){var $self=this;var d=this.ce(a);if(d==null){throw new $.ig.InvalidOperationException(1,"No axis found for the specified index.")}var f=this.c.where$1($.ig.PositionInfo.prototype.$type,function(e){return e.d()==a&&e.e()==b&&e.f()==c}).firstOrDefault$1($.ig.PositionInfo.prototype.$type);if(f==null){f=function(){var $ret=new $.ig.PositionInfo;$ret.d(a);$ret.f(c);$ret.e(b);return $ret}();this.c.add(f)}else{this.c.remove(f)}},collapseTupleMember:function(a,b,c){var $self=this;var d=this.ce(a);if(d==null){throw new $.ig.InvalidOperationException(1,"No axis found for the specified index.")}var f=this.c.where$1($.ig.PositionInfo.prototype.$type,function(e){return e.d()==a&&e.e()==b&&e.f()==c}).firstOrDefault$1($.ig.PositionInfo.prototype.$type);if(f==null){f=function(){var $ret=new $.ig.PositionInfo;$ret.d(a);$ret.f(c);$ret.e(b);return $ret}();this.d.add(f)}else{this.c.remove(f)}},clearPendingChanges:function(){this.d.clear();this.c.clear()},update:function(){var $self=this;if(this.k){return this.l}this.k=true;var a=this.bb(this.c);this.l=a.continueWithTask$1($.ig.OlapResult.prototype.$type,function(b){return $self.ba()});var c=this.l;this.l.ac(function(d){$self.k=false;$self.l=null});return c},a8:function(a,b){if(a.positionItemIndex()==b){a.clear()}else{var d=a.values().getEnumerator();while(d.moveNext()){var c=d.current();this.a8(c,b)}}},a9:function(a,b,c,d){var $self=this;var e=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);var g=c.getEnumerator();while(g.moveNext()){var f=g.current();var h=new $.ig.AxisElement(f.name(),new $.ig.List$1(String,0));for(var i=0;i<f.memberNames().count();i++){var j=f.memberNames().item(i);var k;if(function(){var $ret=$self.a.am(j,k);k=$ret.member;return $ret.ret}()){if(k.scope().hasValue()==false){h.memberNames().add(j)}}}e.add(h)}var l=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);var n=b.getEnumerator();while(n.moveNext()){var m=n.current();var o=new $.ig.AxisElement(m.name(),new $.ig.List$1(String,0));for(var p=0;p<m.memberNames().count();p++){var q=m.memberNames().item(p);var r;if(function(){var $ret=$self.a.am(q,r);r=$ret.member;return $ret.ret}()){if(r.scope().hasValue()==false){o.memberNames().add(q)}}}l.add(o)}var s=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);var u=a.getEnumerator();while(u.moveNext()){var t=u.current();var v=new $.ig.AxisElement(t.name(),new $.ig.List$1(String,0));for(var w=0;w<t.memberNames().count();w++){var x=t.memberNames().item(w);var y;if(function(){var $ret=$self.a.am(x,y);y=$ret.member;return $ret.ret}()){if(y.scope().hasValue()==false){v.memberNames().add(x)}}}s.add(v)}return new $.ig.MdxSlicerAxisProvider(this,s,l,e,d)},ba:function(){var $self=this;var a=this.m;var b=this.n;var c=this.p;var d=this.o;var e=this.c.count()>0;var f=this.d.count()>0;var g=this.h.count()>0;if(!a&&!b&&!c&&!d&&!e&&!f&&!g){var h=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);h.i(this.result());return h.d()}var i=this.columnAxis().count()>0;var j=this.rowAxis().count()>0;if(this.rowAxis().count()==0&&this.columnAxis().count()==0&&this.measures().count()==0){var k=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}();var l=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);l.i(k);this.aq(new $.ig.OlapResultView(k,k,false,false));this.result(k);this.bc(k);this.be(this.aq().visibleResult(),j,i);this.clearPendingChanges();return l.d()}if(this.p){this.bd(i,j)}this.p=false;this.o=false;this.q=false;var m=false;if(this.u&&!this.m&&!this.n){m=true}var n=null;var o=null;var p=0;n=this.bg(this.columnAxis(),this.m,p);this.m=false;if(n!=null){p++}o=this.bg(this.rowAxis(),this.n,p);this.n=false;if(o!=null){o.axisIndex(p);p++}var q;var r=function(){var $ret=$self.bf(i,j,m,q);q=$ret.axisPositionsMap;return $ret.ret}();var s=this.a9(this.e,this.f,this.g,this.mdxSettings());var t=s.createAxis(p);var u=new $.ig.MdxQueryBuilder(1,this.mdxSettings());var v=this.getProviderDefaultProperties();var w=this.getProviderDefaultRestrictions();var x=this.dataProviderFactory().createDataProvider(this.sourceOptions().serverUrl(),this.sourceOptions().requestOptions());if(m&&!g&&(e||f)){var y=null;if(n!=null){var aa=r.where$1($.ig.IMdxAxis.prototype.$type,function(z){return z.axisIndex()==n.axisIndex()}).firstOrDefault$1($.ig.IMdxAxis.prototype.$type);var ab;(function(){var $ret=q.tryGetValue("Axis0",ab);ab=$ret.value;return $ret.ret})();if(aa!=null){var ac=u.e(aa,o,t,new $.ig.MdxCalculatedMembersCache,this.cube().name());y=x.executeStatementAsync(ac,v,w);y=y.continueWithTask$21($.ig.OlapResult.prototype.$type,$.ig.OlapResult.prototype.$type,function(ad){if($self.aq()==null){$self.aq(new $.ig.OlapResultView($self.result(),$self.result(),i,j))}var ae=$self.aq();$self.aq($self.aq().extend(ad.aa(),"Axis0"));$self.result($self.aq().visibleResult());$self.bc($self.result());$.ig.ResultViewHelper.prototype.b("Axis0",ae,$self.aq());var ag=ab.getEnumerator();while(ag.moveNext()){var af=ag.current();$.ig.ResultViewHelper.prototype.a(af.d(),af.e(),af.f(),true,$self.aq())}var ah=j;var ai=i;$self.be($self.aq().visibleResult(),ah,ai);var aj=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);aj.i($self.aq().visibleResult());return aj.d()})}}if(o!=null){var al=r.where$1($.ig.IMdxAxis.prototype.$type,function(ak){return ak.axisIndex()==o.axisIndex()}).firstOrDefault$1($.ig.IMdxAxis.prototype.$type);var am=this.aq().hasColumns()?"Axis1":"Axis0";var an;(function(){var $ret=q.tryGetValue(am,an);an=$ret.value;return $ret.ret})();if(al!=null){if(y!=null){y=y.continueWithTask$21($.ig.OlapResult.prototype.$type,$.ig.OlapResult.prototype.$type,function(ao){n=$self.bg($self.columnAxis(),false,0);var ap=u.e(n,al,t,new $.ig.MdxCalculatedMembersCache,$self.cube().name());return x.executeStatementAsync(ap,v,w)})}else{var aq=u.e(n,al,t,new $.ig.MdxCalculatedMembersCache,this.cube().name());y=x.executeStatementAsync(aq,v,w)}y=y.continueWithTask$21($.ig.OlapResult.prototype.$type,$.ig.OlapResult.prototype.$type,function(ar){if($self.aq()==null){$self.aq(new $.ig.OlapResultView($self.result(),$self.result(),i,j))}var as=$self.aq();$self.aq($self.aq().extend(ar.aa(),am));$self.result($self.aq().visibleResult());$self.bc($self.result());$.ig.ResultViewHelper.prototype.b(am,as,$self.aq());var au=an.getEnumerator();while(au.moveNext()){var at=au.current();$.ig.ResultViewHelper.prototype.a(at.d(),at.e(),at.f(),true,$self.aq())}var av=j;var aw=i;$self.be($self.aq().visibleResult(),av,aw);var ax=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);ax.i($self.aq().visibleResult());return ax.d()})}}if(y!=null){return y}var ay=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);ay.i(this.result());return ay.d()}else{if(g){this.h.clear()}p=0;n=this.bg(this.columnAxis(),this.m,p);if(n!=null){p++}o=this.bg(this.rowAxis(),this.n,p);var az=u.e(n,o,t,new $.ig.MdxCalculatedMembersCache,this.cube().name());return x.executeStatementAsync(az,v,w).ae($.ig.OlapResult.prototype.$type,function(a0){$self.aq(new $.ig.OlapResultView(a0.aa(),a0.aa(),i,j));$self.result($self.aq().visibleResult());$self.bc($self.result());var a1=j;var a2=i;$self.be($self.aq().visibleResult(),a1,a2);$self.clearPendingChanges();return $self.result()})}},bb:function(a){var $self=this;var b=new $.ig.List$1(String,0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();var e=this.ce(c.d()).tuples().__inner[c.e()].members().item(c.f());var g=this.getCoreElement(function(f){return f.hierarchyUniqueName()==e.hierarchyUniqueName()&&f.depth()==e.levelNumber()+1},$.ig.Level.prototype.$type);if(g!=null&&!this.a.af(g.uniqueName())&&!b.contains(g.uniqueName())){b.add(g.uniqueName())}}var h=new Array(b.count());for(var i=0;i<b.count();i++){h[i]=this.getMembersOfLevel(b.item(i))}return(new $.ig.TaskFactory).c($.ig.Array.prototype.$type,h,function(j){return j})},bc:function(a){var $self=this;var c=a.axes().getEnumerator();while(c.moveNext()){var b=c.current();var d=b.tuples();for(var e=0;e<d.count();e++){var f=d.__inner[e].members();for(var g=0;g<f.count();g++){var h=f.item(g);var i;if(function(){var $ret=$self.a.al(h.uniqueName(),i);i=$ret.memberOrdinal;return $ret.ret}()){h.ordinal(i)}}}}},bd:function(a,b){var c=0;var d=this.measureListIndex();if(a){var e=this.cf(c);if(e!=null&&this.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){if(d>-1){var f=e.m();if(f!=null){this.a8(f,d-1)}e.ag()}}c++}if(b){var g=this.cf(c);if(g!=null&&this.measureListLocation()==$.ig.MeasureListLocation.prototype.rows){if(d>-1){var h=g.m();if(h!=null){this.a8(h,d-1)}g.ag()}}}},be:function(a,b,c){var d=0;if(c){var e=a.axes().item(d);var f=this.cf(d);if(f!=null){f.m(e.positionResolver().rootPositionInfo());f.ag()}d++}if(b){var g=a.axes().item(d);var h=this.cf(d);if(h!=null){h.m(g.positionResolver().rootPositionInfo());h.ag()}d++}},bf:function(a,b,c,d){var $self=this;this.bh(a,b,c);var e=new $.ig.Dictionary$2(String,$.ig.Boolean.prototype.$type,0);var f=this.c;d=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.PositionInfo.prototype.$type),0);for(var g=0;g<f.count();g++){var h=f.item(g);var i;if(!function(){var $ret=d.tryGetValue(h.d(),i);i=$ret.value;return $ret.ret}()){i=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);d.add(h.d(),i)}i.add(h);if(this.aq()==null){this.aq(new $.ig.OlapResultView(this.result(),this.result(),a,b))}var j=this.aq().expandTupleMember(h.d(),h.e(),h.f());if(j==null){e.item(h.d(),true)}else{var k=this.aq();this.aq(j);$.ig.ResultViewHelper.prototype.b(h.d(),k,this.aq());$.ig.ResultViewHelper.prototype.a(h.d(),h.e(),h.f(),true,this.aq());this.result(this.aq().visibleResult());this.bc(this.result());this.be(this.aq().visibleResult(),b,a)}}var l=new $.ig.List$1($.ig.IMdxAxis.prototype.$type,0);var n=d.getEnumerator();while(n.moveNext()){var m=n.current();var o=this.ce(m.key());if(o==null){continue}if(o.positionResolver().hasUnregisterdPositions()){o.positionResolver().completeRegisterPositions()}var p=new $.ig.List$1($.ig.IPositionItem$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),0);var r=m.value().getEnumerator();while(r.moveNext()){var q=r.current();if(q.e()<o.tuples().count()){var s=o.tuples().__inner[q.e()];var t=s.item(q.f());p.add(t)}}if(p.count()>0){var u=this.result().axes().indexOf(o);var v=this.cf(u);var w=v.createAxis(u);var x=false;if(function(){var $ret=e.tryGetValue(o.name(),x);x=$ret.value;return $ret.ret}()&&x){v=new $.ig.MdxDimensionAxisProvider(1,o,v.n(),p);var y=v.extendAxis(w,w.axisIndex());l.add(y)}}}this.c.clear();return{ret:l,axisPositionsMap:d};return{axisPositionsMap:d}},bg:function(a,b,c){var d=null;if(a.count()>0){d=this.cf(c);if(b){var e=null;if(d!=null){e=d.m()}var f=c==0?this.mdxSettings().r():this.mdxSettings().s();d=new $.ig.MdxDimensionAxisProvider(0,this,f,a,e);this.cg(c,d)}}if(d!=null){return d.createAxis(c)}return null},bh:function(a,b,c){var $self=this;if(this.result()!=null){var d=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.PositionInfo.prototype.$type),0);var e=this.d;for(var f=0;f<e.count();f++){var g=e.item(f);var h;if(!function(){var $ret=d.tryGetValue(g.d(),h);h=$ret.value;return $ret.ret}()){h=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);d.add(g.d(),h)}h.add(g);if(c){if(this.aq()==null){this.aq(new $.ig.OlapResultView(this.result(),this.result(),a,b))}else{this.aq(this.aq().collapseTupleMember(g.d(),g.e(),g.f()));this.result(this.aq().visibleResult());this.bc(this.result());this.be(this.aq().visibleResult(),b,a)}}}var i=new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0);var k=d.getEnumerator();while(k.moveNext()){var j=k.current();var l=this.ce(j.key());if(l==null){continue}if(l.positionResolver().hasUnregisterdPositions()){l.positionResolver().completeRegisterPositions()}if(!i.contains(l)){i.add(l)}if(!c){var n=j.value().getEnumerator();while(n.moveNext()){var m=n.current();if(m.e()<l.tuples().count()){var o=l.tuples().__inner[m.e()];var p=o.item(m.f());var q=l.positionResolver().getHostPositionItemInfo(o,m.f());var s=q.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(r){return r.key()==p.key()}).firstOrDefault$1($.ig.PositionItemInfo$2.prototype.$type);if(s!=null){s.isExpanded(false)}}}}}if(i.count()>0){if(!c&&!this.result().isEmpty()){this.be(this.result(),b,a)}var u=i.getEnumerator();while(u.moveNext()){var t=u.current();var v=b&&t.name()=="Axis1"?1:0;var w=this.cf(v);w.ag()}}this.d.clear()}},setCatalog:function(a){if(!this.isInitialized()){throw new $.ig.InvalidOperationException(1,"Data source is not initialized.")}return this.b5(a)},setCube:function(a){if(!this.isInitialized()){throw new $.ig.InvalidOperationException(1,"Data source is not initialized.")}return this.b9(a,null)},setMeasureGroup:function(a){if(!this.isInitialized()){throw new $.ig.InvalidOperationException(1,"Data source is not initialized.")}return this.ca(a)},initialize:function(){var $self=this;if(this.i){return this.j}this.i=true;this.j=this.bi();var a=this.j;this.j.ac(function(b){$self.i=false;$self.j=null});return a},bi:function(){var $self=this;var a=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);if(this.isInitialized()){a.i(this.metadataTree());
return a.d()}var b=this.sourceOptions().catalog();var c=this.sourceOptions().cube();var d=this.sourceOptions().measureGroup();this.columnAxis().collectionChanged=$.ig.Delegate.prototype.combine(this.columnAxis().collectionChanged,this.bv.runOn(this));this.rowAxis().collectionChanged=$.ig.Delegate.prototype.combine(this.rowAxis().collectionChanged,this.bw.runOn(this));this.filters().collectionChanged=$.ig.Delegate.prototype.combine(this.filters().collectionChanged,this.bz.runOn(this));this.measures().collectionChanged=$.ig.Delegate.prototype.combine(this.measures().collectionChanged,this.b0.runOn(this));var e=this.b2();if(String.isNullOrEmpty(b)){e.ac(function(f){if(f.h()==null){$self.bq();var g=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}();$self.aq(new $.ig.OlapResultView(g,g,false,false));$self.result(g);a.i(null);return}a.h(f.h())});return a.d()}var j=e.continueWithTask$21($.ig.IEnumerable$1.prototype.$type,$.ig.IList$1.prototype.$type,function(h){if(h.h()==null){return $self.b5(b)}var i=new $.ig.TaskCompletionSource$1($.ig.IList$1.prototype.$type.specialize($.ig.Cube.prototype.$type),0);i.h(h.h());return i.d()});if(String.isNullOrEmpty(c)){j.ac(function(k){if(k.h()==null){$self.bq();var l=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}();$self.aq(new $.ig.OlapResultView(l,l,false,false));$self.result(l);a.i(null);return}a.h(k.h())});return a.d()}var n=j.continueWithTask$21($.ig.IEnumerable$1.prototype.$type,$.ig.IList$1.prototype.$type,function(m){return $self.b9(c,d)});return n.continueWithTask$21($.ig.IEnumerable$1.prototype.$type,$.ig.IList$1.prototype.$type,function(o){return $self.bl()})},addFilterMember:function(a,b){var $self=this;var c;var d=function(){var $ret=$self.ch(a,c);c=$ret.filtersCollection;return $ret.ret}();if(d==null){d=new $.ig.AxisElement(a,function(){var $ret=new $.ig.ArrayListCollection$1(String);$ret.add(b);return $ret}());c.add(d)}else{if(!d.memberNames().contains(b)){d.memberNames().add(b);if(this.h.contains(b)){this.h.remove(b)}else{this.h.add(b)}}}},getFilterMemberNames:function(a){var $self=this;var b;var c=function(){var $ret=$self.ch(a,b);b=$ret.filtersCollection;return $ret.ret}();if(c!=null){return this.bs(String,c.memberNames())}return new $.ig.ArrayListCollection$1(String)},removeFilterMember:function(a,b){var $self=this;var c;var d=function(){var $ret=$self.ch(a,c);c=$ret.filtersCollection;return $ret.ret}();if(d==null){return}if(d.memberNames().remove(b)){if(this.h.contains(b)){this.h.remove(b)}else{this.h.add(b)}}},removeAllFilterMembers:function(a){var $self=this;var b;var c=function(){var $ret=$self.ch(a,b);b=$ret.filtersCollection;return $ret.ret}();if(c==null){return}for(var d=c.memberNames().count()-1;d>=0;d--){var e=c.memberNames().item(d);c.memberNames().removeAt(d);if(this.h.contains(e)){this.h.remove(e)}else{this.h.add(e)}}},getProviderDefaultProperties:function(){var $self=this;var a=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);if(this.sourceOptions().discoverProperties()!=null){var c=this.sourceOptions().discoverProperties().getEnumerator();while(c.moveNext()){var b=c.current();var d=new $.ig.XmlaQueryProperty(1,b.key(),b.value());a.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c(d.c());$ret.d(d.d());return $ret}())}}if(this.catalog()!=null){this.cd(a,$.ig.XmlaDiscoverProperties.prototype.a,this.catalog().name())}return a},getProviderDefaultRestrictions:function(){var $self=this;var a=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);if(this.catalog()!=null){a.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c($.ig.MeasureGroupRestrictions.prototype.a);$ret.d($self.catalog().name());return $ret}());if(this.cube()!=null){a.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c($.ig.MeasureGroupRestrictions.prototype.c);$ret.d($self.cube().name());return $ret}())}}return a},getMembersOfLevel:function(a){var $self=this;var b=a;var c=this.getProviderDefaultProperties();var d=this.getProviderDefaultRestrictions();if(d!=null){d.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c($.ig.MemberRestrictions.prototype.f);$ret.d(a);return $ret}())}var e=this.dataProviderFactory().createDataProvider(this.sourceOptions().serverUrl(),this.sourceOptions().requestOptions());var f=e.discoverMembersAsync(c,d);f.ac(function(g){var i=g.aa().getEnumerator();while(i.moveNext()){var h=i.current();$self.a.ak(h)}$self.a.ag(b)});return f},getMembersOfHierarchy:function(a){var $self=this;var b=a;var c=this.getProviderDefaultProperties();var d=this.getProviderDefaultRestrictions();if(d!=null){d.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c($.ig.MemberRestrictions.prototype.e);$ret.d(a);return $ret}())}var e=this.dataProviderFactory().createDataProvider(this.sourceOptions().serverUrl(),this.sourceOptions().requestOptions());var f=e.discoverMembersAsync(c,d);f.ac(function(g){var i=g.aa().getEnumerator();while(i.moveNext()){var h=i.current();$self.a.ak(h)}$self.a.ai(b)});return f},getMembersOfMember:function(a){var $self=this;var b=this.getProviderDefaultProperties();var c=this.getProviderDefaultRestrictions();if(c!=null){c.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c($.ig.MemberRestrictions.prototype.i);$ret.d(a);return $ret}());c.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c($.ig.MemberRestrictions.prototype.k);$ret.d("1");return $ret}())}var d=this.dataProviderFactory().createDataProvider(this.sourceOptions().serverUrl(),this.sourceOptions().requestOptions());var e=d.discoverMembersAsync(b,c);e.continueWithTask$21($.ig.IEnumerable$1.prototype.$type,$.ig.IEnumerable$1.prototype.$type,function(f){return $self.bj(f.aa())});return e},bj:function(a){var $self=this;var b=new $.ig.List$1($.ig.Member.prototype.$type,0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c);break}if(b.count()>0){var e=b.item(0).levelUniqueName();if(!this.a.af(e)){return this.getMembersOfLevel(e).ae($.ig.IEnumerable$1.prototype.$type,function(f){return a})}}var g=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type),0);g.i(a);return g.d()},tryGetMember:function(a,b){var $self=this;return{ret:function(){var $ret=$self.a.am(a,b);b=$ret.member;return $ret.ret}(),member:b};return{member:b}},tryGetMembersForLevel:function(a,b){var $self=this;return{ret:function(){var $ret=$self.a.ap(a,b);b=$ret.members;return $ret.ret}(),members:b};return{members:b}},bk:function(){var a;if(this.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){a=this.columnAxis()}else{a=this.rowAxis()}if(a==null){return}var b=null;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();b=$.ig.util.cast($.ig.MeasureList.prototype.$type,d);if(b!=null){break}c++}if(b!=null){this.q=true;a.removeAt(c)}},bl:function(){var $self=this;var a=new $.ig.Dictionary$2(String,$.ig.Number.prototype.$type,0);var b=null;var c=null;var d=null;var e=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);if(!String.isNullOrEmpty(this.sourceOptions().columns())){var f=new $.ig.AxisDefinitionParser(this.sourceOptions().columns());b=f.w();var h=b.getEnumerator();while(h.moveNext()){var g=h.current();if(a.containsKey(g.name())){throw new $.ig.ArgumentException(0,"the hierarchy is used more than once")}else{a.add(g.name(),1)}}}if(!String.isNullOrEmpty(this.sourceOptions().rows())){var i=new $.ig.AxisDefinitionParser(this.sourceOptions().rows());c=i.w();var k=c.getEnumerator();while(k.moveNext()){var j=k.current();if(a.containsKey(j.name())){throw new $.ig.ArgumentException(0,"the hierarchy is used more than once")}else{a.add(j.name(),1)}}}if(!String.isNullOrEmpty(this.sourceOptions().filters())){var l=new $.ig.AxisDefinitionParser(this.sourceOptions().filters());d=l.w();var n=d.getEnumerator();while(n.moveNext()){var m=n.current();if(a.containsKey(m.name())){throw new $.ig.ArgumentException(0,"the hierarchy is used more than once")}else{a.add(m.name(),1)}}}if(b!=null&&b.count()>0){var p=b.getEnumerator();while(p.moveNext()){var o=p.current();this.bp($.ig.ICoreOlapElement.prototype.$type,o.name(),this.columnAxis(),$.ig.Hierarchy.prototype.$type);this.e.add(o);if(o.memberNames().count()>0){e.add(o)}}}if(c!=null&&c.count()>0){var r=c.getEnumerator();while(r.moveNext()){var q=r.current();this.bp($.ig.ICoreOlapElement.prototype.$type,q.name(),this.rowAxis(),$.ig.Hierarchy.prototype.$type);this.f.add(q);if(q.memberNames().count()>0){e.add(q)}}}if(d!=null&&d.count()>0){var t=d.getEnumerator();while(t.moveNext()){var s=t.current();this.bp($.ig.Hierarchy.prototype.$type,s.name(),this.filters(),$.ig.Hierarchy.prototype.$type);this.g.add(s);if(s.memberNames().count()>0){e.add(s)}}}var u=null;if(!String.isNullOrEmpty(this.sourceOptions().measures())){var v=new $.ig.AxisDefinitionParser(this.sourceOptions().measures());u=v.w();var x=u.getEnumerator();while(x.moveNext()){var w=x.current();if(a.containsKey(w.name())){throw new $.ig.ArgumentException(0,"the measure is used more than once")}else{a.add(w.name(),1)}}}if(u!=null&&u.count()>0){var z=u.getEnumerator();while(z.moveNext()){var y=z.current();this.bp($.ig.Measure.prototype.$type,y.name(),this.measures(),$.ig.Measure.prototype.$type)}}if(this.m||this.n||this.o||this.p||this.q){if(e.count()>0){var aa=new Array(e.count());for(var ab=0;ab<e.count();ab++){var ac=e.item(ab).name();aa[ab]=this.getMembersOfHierarchy(ac)}var ad=new $.ig.TaskFactory;var af=ad.c($.ig.Task$1.prototype.$type,aa,function(ae){return $self.ba()});return af.continueWithTask$21($.ig.Task$1.prototype.$type,$.ig.OlapResult.prototype.$type,function(ag){return ag.aa()}).continueWithTask$21($.ig.Task$1.prototype.$type,$.ig.OlapResult.prototype.$type,function(ah){$self.bq();var ai=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);ai.i($self.metadataTree());return ai.d()})}return this.ba().continueWithTask$21($.ig.Task$1.prototype.$type,$.ig.OlapResult.prototype.$type,function(aj){$self.bq();var ak=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);ak.i($self.metadataTree());return ak.d()})}this.bq();var al=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);al.i(this.metadataTree());return al.d()},bn:function($t,a,b){a.i(b)},bp:function($tItem,a,b,c){var $self=this;var e=function(d){return d.uniqueName()==a};var f=this.getCoreElement(e,c);if(f!=null&&!b.contains$1($.ig.Object.prototype.$type,f)){b.add(f)}},bq:function(){this.isInitialized(true)},bs:function($t,a){var b=new $.ig.ArrayListCollection$1($t);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},bt:function(a,b){var $self=this;switch(a.action()){case $.ig.NotifyCollectionChangedAction.prototype.add:var d=a.newItems().getEnumerator();while(d.moveNext()){var c=d.current();var e=$.ig.util.cast($.ig.Hierarchy.prototype.$type,c);if(e!=null){if(this.isInitialized()){b.add(new $.ig.AxisElement(e.uniqueName(),new $.ig.ArrayListCollection$1(String)))}}}break;case $.ig.NotifyCollectionChangedAction.prototype.remove:var g=a.oldItems().getEnumerator();while(g.moveNext()){var f=g.current();var h=$.ig.util.cast($.ig.Hierarchy.prototype.$type,f);if(h!=null){var j=b.where$1($.ig.AxisElement.prototype.$type,function(i){return i.name()==h.uniqueName()}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(j!=null){b.remove(j)}}else{var k=$.ig.util.cast($.ig.MeasureList.prototype.$type,f);if(k!=null){if(!this.p&&!this.q&&!this.r){this.measures().clear()}}}}break}},bu:function(a,b){var $self=this;switch(a.action()){case $.ig.NotifyCollectionChangedAction.prototype.add:var d=a.newItems().getEnumerator();while(d.moveNext()){var c=d.current();var e=$.ig.util.cast($.ig.Hierarchy.prototype.$type,c);if(e!=null){var g=$.ig.util.cast($.ig.MeasureList.prototype.$type,b.where$1($.ig.ICoreOlapElement.prototype.$type,function(f){return $.ig.util.cast($.ig.MeasureList.prototype.$type,f)!==null}).firstOrDefault$1($.ig.ICoreOlapElement.prototype.$type));if(g!=null&&this.measureListIndex()>=a.newStartingIndex()){this.measureListIndex(this.measureListIndex()+1)}}}break;case $.ig.NotifyCollectionChangedAction.prototype.remove:var i=a.oldItems().getEnumerator();while(i.moveNext()){var h=i.current();var j=$.ig.util.cast($.ig.Hierarchy.prototype.$type,h);if(j!=null){var l=$.ig.util.cast($.ig.MeasureList.prototype.$type,b.where$1($.ig.ICoreOlapElement.prototype.$type,function(k){return $.ig.util.cast($.ig.MeasureList.prototype.$type,k)!==null}).firstOrDefault$1($.ig.ICoreOlapElement.prototype.$type));if(l!=null&&this.measureListIndex()>a.oldStartingIndex()){this.measureListIndex(this.measureListIndex()-1)}}}break}},bv:function(a,b){this.m=true;this.by(0,this.columnAxis(),this.rowAxis());this.bt(b,this.e);this.bu(b,this.columnAxis());if(b.action()!=$.ig.NotifyCollectionChangedAction.prototype.reset&&this.columnAxis()!=null){var c=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bx("Axis0",c)}},bw:function(a,b){this.n=true;this.by(1,this.rowAxis(),this.columnAxis());this.bt(b,this.f);this.bu(b,this.rowAxis());if(b.action()!=$.ig.NotifyCollectionChangedAction.prototype.reset&&this.rowAxis()!=null){var c=this.columnAxis()==null?"Axis0":"Axis1";var d=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bx(c,d)}},bx:function(a,b){for(var c=this.d.count()-1;c>=0;c--){var d=this.d.item(c);if(d.d()==a&&d.f()>=b){this.d.removeAt(c)}}for(var e=this.c.count()-1;e>=0;e--){var f=this.c.item(e);if(f.d()==a&&f.f()>=b){this.c.removeAt(e)}}},by:function(a,b,c){if(b.count()>0){if(c.count()>0){if(this.b.count()<2){this.b.insert(a,null)}}else{if(this.b.count()==0){this.b.insert(0,null)}}}else{if(this.b.count()>0){if(this.b.count()>1){this.b.removeAt(a)}else{this.b.removeAt(0)}}}},bz:function(a,b){this.o=true;this.bt(b,this.g)},b0:function(a,b){this.p=true;this.b1()},b1:function(){var $self=this;var a;if(this.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){a=this.columnAxis()}else{a=this.rowAxis()}var b=null;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();b=$.ig.util.cast($.ig.MeasureList.prototype.$type,d);if(b!=null){break}c++}if(this.measures().count()>1){if(b==null){b=function(){var $ret=new $.ig.MeasureList;$ret.measures($self.measures());return $ret}();if(this.measureListIndex()<0||this.measureListIndex()>a.count()){this.s=a.count();a.add(b)}else{a.insert(this.measureListIndex(),b)}}else{if(c!=this.measureListIndex()){a.removeAt(c);if(this.measureListIndex()>a.count()){this.s=a.count();a.add(b)}else{a.insert(this.measureListIndex(),b)}}}}else{if(b!=null){a.removeAt(c)}}},b2:function(){var $self=this;var a=this.dataProviderFactory().createDataProvider(this.sourceOptions().serverUrl(),this.sourceOptions().requestOptions());var b=this.getProviderDefaultProperties();var d=a.discoverCatalogsAsync(b,null).continueWithTask$21($.ig.IEnumerable$1.prototype.$type,$.ig.IEnumerable$1.prototype.$type,function(c){$self.catalogs($self.bs($.ig.Catalog.prototype.$type,c.aa()));return c});return d},b3:function(a){var $self=this;var b=this.dataProviderFactory().createDataProvider(this.sourceOptions().serverUrl(),this.sourceOptions().requestOptions());var c=function(){var $ret=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);$ret.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c($.ig.CubeRestrictions.prototype.a);$ret.d(a);return $ret}());return $ret}();var d=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);if(this.sourceOptions().discoverProperties()!=null){var f=this.sourceOptions().discoverProperties().getEnumerator();while(f.moveNext()){var e=f.current();var g=new $.ig.XmlaQueryProperty(1,e.key(),e.value());d.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c(g.c());$ret.d(g.d());return $ret}())}}this.cd(d,$.ig.XmlaDiscoverProperties.prototype.a,a);var i=b.discoverCubesAsync(d,c).ae($.ig.IList$1.prototype.$type,function(h){$self.cubes($self.bs($.ig.Cube.prototype.$type,h.aa()));return $self.cubes()});return i},b4:function(a,b){var $self=this;var c=this.dataProviderFactory().createDataProvider(this.sourceOptions().serverUrl(),this.sourceOptions().requestOptions());var d=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);d.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c($.ig.MeasureGroupRestrictions.prototype.a);$ret.d(a);return $ret}());d.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c($.ig.MeasureGroupRestrictions.prototype.c);$ret.d(b);return $ret}());var e=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);if(this.sourceOptions().discoverProperties()!=null){var g=this.sourceOptions().discoverProperties().getEnumerator();while(g.moveNext()){var f=g.current();var h=new $.ig.XmlaQueryProperty(1,f.key(),f.value());e.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c(h.c());$ret.d(h.d());return $ret}())}}this.cd(e,$.ig.XmlaDiscoverProperties.prototype.a,a);var j=c.discoverMeasureGroupsAsync(e,d).ae($.ig.IList$1.prototype.$type,function(i){$self.measureGroups($self.bs($.ig.MeasureGroup.prototype.$type,i.aa()));return $self.measureGroups()});return j},b5:function(a){var $self=this;if(String.isNullOrEmpty(a)){if(a==null){throw new $.ig.ArgumentNullException("catalogName")}throw new $.ig.InvalidOperationException(1,"catalogName cannot be empty.")}var b=new $.ig.TaskCompletionSource$1($.ig.IList$1.prototype.$type.specialize($.ig.Cube.prototype.$type),0);if(this.catalog()!=null){if(this.catalog().name()==a){b.i(this.cubes());return b.d()}this.b6()}var d=this.catalogs().getEnumerator();while(d.moveNext()){var c=d.current();if(c.name()==a){this.catalog(c);break}}if(this.cubes()==null||this.cubes().count()==0){this.b3(a).ac(function(e){if(e.h()==null){b.i(e.aa());return}b.h(e.h())})}else{b.i(this.cubes())}return b.d()},b6:function(){this.catalog(null);this.cubes(new $.ig.ArrayListCollection$1($.ig.Cube.prototype.$type));this.b7()},b7:function(){this.cube(null);this.measureGroups(new $.ig.ArrayListCollection$1($.ig.MeasureGroup.prototype.$type));this.filters().clear();this.rowAxis().clear();this.columnAxis().clear();this.measures().clear();this.a=null;this.b8()},b8:function(){this.measureGroup(null);this.metadataTree(null)},b9:function(a,b){var $self=this;if(this.catalog()==null){throw new $.ig.InvalidOperationException(1,"Data source has no Catalog set.")}if(String.isNullOrEmpty(a)){if(a==null){throw new $.ig.ArgumentNullException("cubeName")}throw new $.ig.InvalidOperationException(1,"cubeName cannot be empty.")}var c=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);if(this.cube()!=null){if(this.cube().name()==a){c.i(this.metadataTree());return c.d()}this.b7()}var d=new $.ig.List$1($.ig.Task.prototype.$type,0);var f=this.cubes().getEnumerator();while(f.moveNext()){var e=f.current();if(e.name()==a){this.cube(e);break}}var g=this.getProviderDefaultProperties();var h=this.getProviderDefaultRestrictions();this.cd(h,$.ig.DimensionRestrictions.prototype.c,a);var i=this.dataProviderFactory().createDataProvider(this.sourceOptions().serverUrl(),this.sourceOptions().requestOptions());d.add(i.discoverMeasuresAsync(g,h));d.add(i.discoverDimensionsAsync(g,h));d.add(i.discoverHierarchiesAsync(g,h));d.add(i.discoverLevelsAsync(g,h));d.add(i.discoverMeasureGroupDimensionsAsync(g,h));d.add(this.b4(this.catalog().name(),a));var j=new Array(d.count());d.copyTo(j,0);var k=new $.ig.TaskFactory;var n=k.a(j,function(l){return $self.cc(l)}).continueWithTask$1($.ig.OlapMetadataTreeItem.prototype.$type,function(m){return $self.ca(b)});return n},ca:function(a){var $self=this;if(this.catalog()==null){throw new $.ig.InvalidOperationException(1,"Data source has no Catalog set.")}if(this.cube()==null){throw new $.ig.InvalidOperationException(1,"Data source has no Cube set.")}var b=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);if(this.measureGroup()!=null){if(this.measureGroup().name()==a){b.i(this.metadataTree());return b.d()}this.b8()}if(this.measureGroups()==null||this.measureGroups().count()==0){var d=this.b4(this.catalog().name(),this.cube().name()).continueWithTask$21($.ig.IList$1.prototype.$type,$.ig.OlapMetadataTreeItem.prototype.$type,function(c){return $self.ca(a)});return d}var f=this.measureGroups().getEnumerator();while(f.moveNext()){var e=f.current();if(e.name()==a){this.measureGroup(e);break}}this.metadataTree(this.cb(a));b.i(this.metadataTree());return b.d()},cb:function(a){var $self=this;var b=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.cube);$ret.caption($self.cube().caption());$ret.item($self.cube());return $ret}();var c;var d;var e=true;if(String.isNullOrEmpty(a)||this.measureGroups()==null){c=this.a.o();d=this.a.n()}else{e=false;c=this.a.s().getMeasureGroupDimensions(a);d=this.a.s().getMeasureGroupMeasures(a)}var f=$.ig.MetaTreeHelper.prototype.getDimensionMetaItems(c,d,this.a.p(),this.a.q(),e);$.ig.MetaTreeHelper.prototype.setMetaItemChildren(b,f);return b},cc:function(a){this.a=new $.ig.CubeMetaItemsCache;var b=a[0];var c=a[1];var d=a[2];var e=a[3];var f=a[4];this.a.n(b.aa());this.a.o(c.aa());this.a.p(d.aa());this.a.q(e.aa());if(this.measureGroups()!=null){this.a.r(f.aa());this.a.s(new $.ig.MeasureGroupMetaItemsCache(this.a.o(),this.a.n(),this.a.r()))}},cd:function(a,b,c){var $self=this;var d=null;var f=a.getEnumerator();while(f.moveNext()){var e=f.current();if(e.c()==b){d=e;break}}if(d==null){a.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c(b);$ret.d(c);return $ret}())}},ce:function(a){var $self=this;if(this.result()!=null&&this.result().axes().count()>0){return this.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(b){return b.name()==a}).firstOrDefault$1($.ig.OlapResultAxis.prototype.$type)}return null},cf:function(a){if(a<this.b.count()){return this.b.item(a)}return null},cg:function(a,b){this.b.item(a,b)},ch:function(a,b){var $self=this;var d=this.e.where$1($.ig.AxisElement.prototype.$type,function(c){return c.name()==a}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(d!=null){b=this.e;return{ret:d,filtersCollection:b}}d=this.f.where$1($.ig.AxisElement.prototype.$type,function(e){return e.name()==a}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(d!=null){b=this.f;return{ret:d,filtersCollection:b}}d=this.g.where$1($.ig.AxisElement.prototype.$type,function(f){return f.name()==a}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(d!=null){b=this.g;return{ret:d,filtersCollection:b}}b=null;return{ret:null,filtersCollection:b};return{filtersCollection:b}},$type:new $.ig.Type("XmlaDataSourceImpl",$.ig.Object.prototype.$type,[$.ig.IOlapDataSource.prototype.$type])},true);$.ig.util.defType("PositionInfo","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},$type:new $.ig.Type("PositionInfo",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaDiscoverProperties","Object",{init:function(){$.ig.Object.prototype.init.call(this)},$type:new $.ig.Type("XmlaDiscoverProperties",$.ig.Object.prototype.$type)},true);$.ig.util.defType("XmlaDataSourceOptions","DataSourceBaseOptions",{init:function(){$.ig.DataSourceBaseOptions.prototype.init.call(this)},_serverUrl:null,serverUrl:function(a){if(arguments.length===1){this._serverUrl=a;return a}else{return this._serverUrl}},_requestOptions:null,requestOptions:function(a){if(arguments.length===1){this._requestOptions=a;return a}else{return this._requestOptions}},_catalog:null,catalog:function(a){if(arguments.length===1){this._catalog=a;return a}else{return this._catalog}},_cube:null,cube:function(a){if(arguments.length===1){this._cube=a;return a}else{return this._cube}},_measureGroup:null,measureGroup:function(a){if(arguments.length===1){this._measureGroup=a;return a}else{return this._measureGroup}},_discoverProperties:null,discoverProperties:function(a){if(arguments.length===1){this._discoverProperties=a;return a}else{return this._discoverProperties}},_executeProperties:null,executeProperties:function(a){if(arguments.length===1){this._executeProperties=a;return a}else{return this._executeProperties}},_dataProviderFactory:null,dataProviderFactory:function(a){if(arguments.length===1){this._dataProviderFactory=a;return a}else{return this._dataProviderFactory}},_enableResultCache:null,enableResultCache:function(a){if(arguments.length===1){this._enableResultCache=a;return a}else{return this._enableResultCache}},_mdxSettings:null,mdxSettings:function(a){if(arguments.length===1){this._mdxSettings=a;return a}else{return this._mdxSettings}},$type:new $.ig.Type("XmlaDataSourceOptions",$.ig.DataSourceBaseOptions.prototype.$type)},true);$.ig.util.defType("RequestOptions","NetworkCredential",{init:function(initNumber,a,b){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.RequestOptions.prototype.init1.call(this,1,a,b,String.empty())},init1:function(initNumber,a,b,c){$.ig.NetworkCredential.prototype.init1.call(this,1,a,b,c)},$type:new $.ig.Type("RequestOptions",$.ig.NetworkCredential.prototype.$type)},true);$.ig.util.defType("CustomRemoteXmlaRequestSerializer","Object",{a:null,init:function(a){$.ig.Object.prototype.init.call(this);this.a=a},serializeRequest:function(a){return this.a(a)},deserializeRequest:function(a){throw new $.ig.NotSupportedException(1)},$type:new $.ig.Type("CustomRemoteXmlaRequestSerializer",$.ig.Object.prototype.$type,[$.ig.IRemoteXmlaRequestSerializer.prototype.$type])},true);$.ig.util.defType("CustomRemoteXmlaResponseSerializer","Object",{a:null,init:function(a){$.ig.Object.prototype.init.call(this);this.a=a},serializeResponse:function(a,b){throw new $.ig.NotSupportedException(1)},deserializeResponse:function(a,b){return this.a(a,b)},$type:new $.ig.Type("CustomRemoteXmlaResponseSerializer",$.ig.Object.prototype.$type,[$.ig.IRemoteXmlaResponseSerializer.prototype.$type])},true);$.ig.util.defType("OlapXmlaDataSource","DataSourceBase",{staticInit:function(){$.ig.OlapXmlaDataSource.prototype.m()},init:function(a){var $self=this;$.ig.DataSourceBase.prototype.init.call(this);var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"serverUrl");var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"catalog");var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"cube");var e=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"measures");var f=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"measureGroup");var g=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"filters");var h=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"columns");var i=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"rows");var j=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"requestOptions");var k=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"enableResultCache");var l=true;if(k!=null){l=k}var m=$.ig.jQueryUtils.prototype.convertToStringDictionary($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"discoverProperties"));var n=$.ig.jQueryUtils.prototype.convertToStringDictionary($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"executeProperties"));var o=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"isRemote");if(o){if(j==null){j={}}var ro_=j;ro_.isCrossDomain=false}var p=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"serializeRequest");var q=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"deserializeResponse");var r=new $.ig.CustomRemoteXmlaRequestSerializer(p);var s=new $.ig.CustomRemoteXmlaResponseSerializer(q);var t=new $.ig.RemoteXmlaDataProviderFactory(1,r,s);var u=this.l(a);var v=function(){var $ret=new $.ig.XmlaDataSourceOptions;$ret.serverUrl(b);$ret.requestOptions(j);$ret.catalog(c);$ret.cube(d);$ret.measures(e);$ret.measureGroup(f);$ret.filters(g);$ret.columns(h);$ret.rows(i);$ret.discoverProperties(m);$ret.executeProperties(n);$ret.enableResultCache(l);$ret.mdxSettings(u);return $ret}();if(o){v.dataProviderFactory(new $.ig.RemoteXmlaDataProviderFactory(0))}this.dataSource(new $.ig.XmlaDataSourceImpl(v))},catalogs:function(){return this.dataSource().catalogs().inner()},catalog:function(){return this.dataSource().catalog()},setCatalog:function(a){var $self=this;return this.dataSource().setCatalog(a).ae($.ig.Array.prototype.$type,function(b){return b.aa().inner()}).f()},measureGroups:function(){return this.dataSource().measureGroups().inner()},measureGroup:function(){return this.dataSource().measureGroup()},setMeasureGroup:function(a){var $self=this;return this.dataSource().setMeasureGroup(a).ae($.ig.OlapMetadataTreeItem.prototype.$type,function(b){return b.aa()}).f()},l:function(a){var b=new $.ig.MdxSettings;var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"mdxSettings");if(c==null){return b}var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(c,"nonEmptyOnRows");if(d!=null){b.ac(d)}var e=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(c,"nonEmptyOnColumns");if(e!=null){b.ad(e)}var f=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(c,"addCalculatedMembersOnRows");if(f!=null){b.w(f)}var g=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(c,"addCalculatedMembersOnColumns");if(g!=null){b.x(g)}var h=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(c,"dimensionPropertiesOnRows");if(h!=null){for(var i=0;i<h.count();i++){b.ag().add(h.item(i))}}var j=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(c,"dimensionPropertiesOnColumns");if(j!=null){for(var k=0;k<j.count();k++){b.ah().add(j.item(k))}}return b},m:function(){$.ig.StringBuilder.prototype.toString=function(){return this._internal.join("")};$.ig.XObject.prototype.toString=function(){if(this.backingNode()!=null){return $.ig.XmlUtils.prototype.xmlNodeToString(this.backingNode())}else{return""}}},$type:new $.ig.Type("OlapXmlaDataSource",$.ig.DataSourceBase.prototype.$type)},true);$.ig.RemoteXmlaRequestType.prototype.discoverCatalogs=0;$.ig.RemoteXmlaRequestType.prototype.discoverCubes=1;$.ig.RemoteXmlaRequestType.prototype.discoverDimensions=2;$.ig.RemoteXmlaRequestType.prototype.discoverHierarchies=3;$.ig.RemoteXmlaRequestType.prototype.discoverLevels=4;$.ig.RemoteXmlaRequestType.prototype.discoverMeasures=5;$.ig.RemoteXmlaRequestType.prototype.discoverMeasureGroups=6;$.ig.RemoteXmlaRequestType.prototype.discoverMeasureGroupDimensions=7;$.ig.RemoteXmlaRequestType.prototype.discoverMembers=8;$.ig.RemoteXmlaRequestType.prototype.executeStatement=9;$.ig.MdxElementType.prototype.member=0;$.ig.MdxElementType.prototype.memberTree=1;$.ig.MdxElementType.prototype.calculated=2;$.ig.MdxElementType.prototype.filter=3;$.ig.MdxElementType.prototype.collection=4;$.ig.MdxElementType.prototype.userDefined=5;$.ig.XmlaSoapMessageHeader.prototype.none=0;$.ig.XmlaSoapMessageHeader.prototype.session=1;$.ig.XmlaSoapMessageHeader.prototype.beginSession=2;$.ig.XmlaSoapMessageHeader.prototype.endSession=3;$.ig.CatalogConstants.prototype.a="CATALOG_NAME";$.ig.CatalogConstants.prototype.b="DESCRIPTION";$.ig.CatalogConstants.prototype.c="ROLES";$.ig.CatalogConstants.prototype.d="DATE_MODIFIED";$.ig.DbSchemaConstants.prototype.a="DBSCHEMA_CATALOGS";$.ig.DbSchemaConstants.prototype.b="DBSCHEMA_COLUMNS";$.ig.DbSchemaConstants.prototype.c="DBSCHEMA_TABLES";$.ig.DbSchemaConstants.prototype.d="DBSCHEMA_PROVIDER_TYPES";$.ig.CubeConstants.prototype.a="CATALOG_NAME";$.ig.CubeConstants.prototype.b="SCHEMA_NAME";$.ig.CubeConstants.prototype.c="CUBE_NAME";$.ig.CubeConstants.prototype.d="CUBE_TYPE";$.ig.CubeConstants.prototype.e="LAST_SCHEMA_UPDATE";$.ig.CubeConstants.prototype.f="LAST_DATA_UPDATE";$.ig.CubeConstants.prototype.g="DESCRIPTION";$.ig.CubeConstants.prototype.h="IS_DRILLTHROUGH_ENABLED";$.ig.CubeConstants.prototype.i="IS_LINKABLE";$.ig.CubeConstants.prototype.j="IS_WRITE_ENABLED";$.ig.CubeConstants.prototype.k="IS_SQL_ENABLED";$.ig.CubeConstants.prototype.l="CUBE_CAPTION";$.ig.CubeConstants.prototype.m="BASE_CUBE_NAME";
$.ig.CubeConstants.prototype.n="ANNOTATIONS";$.ig.DimensionConstants.prototype.a="CATALOG_NAME";$.ig.DimensionConstants.prototype.b="SCHEMA_NAME";$.ig.DimensionConstants.prototype.c="CUBE_NAME";$.ig.DimensionConstants.prototype.d="DIMENSION_NAME";$.ig.DimensionConstants.prototype.e="DIMENSION_UNIQUE_NAME";$.ig.DimensionConstants.prototype.f="DIMENSION_CAPTION";$.ig.DimensionConstants.prototype.g="DIMENSION_ORDINAL";$.ig.DimensionConstants.prototype.h="DIMENSION_TYPE";$.ig.DimensionConstants.prototype.i="DIMENSION_CARDINALITY";$.ig.DimensionConstants.prototype.j="DEFAULT_HIERARCHY";$.ig.DimensionConstants.prototype.k="DESCRIPTION";$.ig.DimensionConstants.prototype.l="IS_VIRTUAL";$.ig.DimensionConstants.prototype.m="IS_READWRITE";$.ig.DimensionConstants.prototype.n="DIMENSION_UNIQUE_SETTINGS";$.ig.DimensionConstants.prototype.o="DIMENSION_MASTER_NAME";$.ig.DimensionConstants.prototype.p="DIMENSION_IS_VISIBLE";$.ig.HierarchyConstants.prototype.a="CATALOG_NAME";$.ig.HierarchyConstants.prototype.b="CUBE_NAME";$.ig.HierarchyConstants.prototype.c="DIMENSION_UNIQUE_NAME";$.ig.HierarchyConstants.prototype.d="HIERARCHY_NAME";$.ig.HierarchyConstants.prototype.e="HIERARCHY_UNIQUE_NAME";$.ig.HierarchyConstants.prototype.f="HIERARCHY_CAPTION";$.ig.HierarchyConstants.prototype.g="DIMENSION_TYPE";$.ig.HierarchyConstants.prototype.h="HIERARCHY_CARDINALITY";$.ig.HierarchyConstants.prototype.i="DEFAULT_MEMBER";$.ig.HierarchyConstants.prototype.j="ALL_MEMBER";$.ig.HierarchyConstants.prototype.k="DESCRIPTION";$.ig.HierarchyConstants.prototype.l="IS_VIRTUAL";$.ig.HierarchyConstants.prototype.m="IS_READWRITE";$.ig.HierarchyConstants.prototype.n="DIMENSION_UNIQUE_SETTINGS";$.ig.HierarchyConstants.prototype.o="DIMENSION_IS_VISIBLE";$.ig.HierarchyConstants.prototype.p="DIMENSION_MASTER_UNIQUE_NAME";$.ig.HierarchyConstants.prototype.q="HIERARCHY_ORDINAL";$.ig.HierarchyConstants.prototype.r="DIMENSION_IS_SHARED";$.ig.HierarchyConstants.prototype.s="HIERARCHY_IS_VISIBLE";$.ig.HierarchyConstants.prototype.t="HIERARCHY_ORIGIN";$.ig.HierarchyConstants.prototype.u="HIERARCHY_DISPLAY_FOLDER";$.ig.HierarchyConstants.prototype.v="INSTANCE_SELECTION";$.ig.HierarchyConstants.prototype.w="GROUPING_BEHAVIOR";$.ig.HierarchyConstants.prototype.x="STRUCTURE_TYPE";$.ig.InstanceConstants.prototype.a="INSTANCE_NAME";$.ig.InstanceConstants.prototype.b="INSTANCE_PORT_NUMBER";$.ig.InstanceConstants.prototype.c="INSTANCE_STATE";$.ig.LevelConstants.prototype.a="CATALOG_NAME";$.ig.LevelConstants.prototype.b="CUBE_NAME";$.ig.LevelConstants.prototype.c="DIMENSION_UNIQUE_NAME";$.ig.LevelConstants.prototype.d="HIERARCHY_UNIQUE_NAME";$.ig.LevelConstants.prototype.e="LEVEL_NAME";$.ig.LevelConstants.prototype.f="LEVEL_UNIQUE_NAME";$.ig.LevelConstants.prototype.g="LEVEL_CAPTION";$.ig.LevelConstants.prototype.h="LEVEL_NUMBER";$.ig.LevelConstants.prototype.i="LEVEL_CARDINALITY";$.ig.LevelConstants.prototype.j="LEVEL_TYPE";$.ig.LevelConstants.prototype.k="DESCRIPTION";$.ig.LevelConstants.prototype.l="CUSTOM_ROLLUP_SETTINGS";$.ig.LevelConstants.prototype.m="LEVEL_UNIQUE_SETTINGS";$.ig.LevelConstants.prototype.n="LEVEL_IS_VISIBLE";$.ig.LevelConstants.prototype.o="LEVEL_ORDERING_PROPERTY";$.ig.LevelConstants.prototype.p="LEVEL_DBTYPE";$.ig.LevelConstants.prototype.q="LEVEL_KEY_CARDINALITY";$.ig.LevelConstants.prototype.r="LEVEL_ORIGIN";$.ig.MeasureConstants.prototype.a="CATALOG_NAME";$.ig.MeasureConstants.prototype.b="SCHEMA_NAME";$.ig.MeasureConstants.prototype.c="CUBE_NAME";$.ig.MeasureConstants.prototype.d="MEASURE_NAME";$.ig.MeasureConstants.prototype.e="MEASURE_UNIQUE_NAME";$.ig.MeasureConstants.prototype.f="MEASURE_CAPTION";$.ig.MeasureConstants.prototype.g="MEASURE_AGGREGATOR";$.ig.MeasureConstants.prototype.h="DATA_TYPE";$.ig.MeasureConstants.prototype.i="NUMERIC_PRECISION";$.ig.MeasureConstants.prototype.j="NUMERIC_SCALE";$.ig.MeasureConstants.prototype.k="EXPRESSION";$.ig.MeasureConstants.prototype.l="DESCRIPTION";$.ig.MeasureConstants.prototype.m="MEASURE_IS_VISIBLE";$.ig.MeasureConstants.prototype.n="MEASURE_NAME_SQL_COLUMN_NAME";$.ig.MeasureConstants.prototype.o="MEASURE_UNQUALIFIED_CAPTION";$.ig.MeasureConstants.prototype.p="MEASUREGROUP_NAME";$.ig.MeasureConstants.prototype.q="MEASURE_DISPLAY_FOLDER";$.ig.MeasureConstants.prototype.r="DEFAULT_FORMAT_STRING";$.ig.MeasureGroupConstants.prototype.a="CATALOG_NAME";$.ig.MeasureGroupConstants.prototype.b="SCHEMA_NAME";$.ig.MeasureGroupConstants.prototype.c="CUBE_NAME";$.ig.MeasureGroupConstants.prototype.d="MEASUREGROUP_NAME";$.ig.MeasureGroupConstants.prototype.e="DESCRIPTION";$.ig.MeasureGroupConstants.prototype.f="MEASUREGROUP_CAPTION";$.ig.MeasureGroupDimensionConstants.prototype.a="CATALOG_NAME";$.ig.MeasureGroupDimensionConstants.prototype.b="SCHEMA_NAME";$.ig.MeasureGroupDimensionConstants.prototype.c="CUBE_NAME";$.ig.MeasureGroupDimensionConstants.prototype.d="MEASUREGROUP_NAME";$.ig.MeasureGroupDimensionConstants.prototype.e="MEASUREGROUP_CARDINALITY";$.ig.MeasureGroupDimensionConstants.prototype.f="DIMENSION_UNIQUE_NAME";$.ig.MeasureGroupDimensionConstants.prototype.g="DIMENSION_CARDINALITY";$.ig.MeasureGroupDimensionConstants.prototype.h="DIMENSION_IS_VISIBLE";$.ig.MeasureGroupDimensionConstants.prototype.i="DIMENSION_IS_FACT_DIMENSION";$.ig.MeasureGroupDimensionConstants.prototype.j="DIMENSION_PATH";$.ig.MeasureGroupDimensionConstants.prototype.k="DIMENSION_GRANULARITY";$.ig.MemberConstants.prototype.a="CATALOG_NAME";$.ig.MemberConstants.prototype.b="SCHEMA_NAME";$.ig.MemberConstants.prototype.c="CUBE_NAME";$.ig.MemberConstants.prototype.d="DIMENSION_UNIQUE_NAME";$.ig.MemberConstants.prototype.e="HIERARCHY_UNIQUE_NAME";$.ig.MemberConstants.prototype.f="LEVEL_UNIQUE_NAME";$.ig.MemberConstants.prototype.g="LEVEL_NUMBER";$.ig.MemberConstants.prototype.h="MEMBER_NAME";$.ig.MemberConstants.prototype.i="MEMBER_UNIQUE_NAME";$.ig.MemberConstants.prototype.j="MEMBER_TYPE";$.ig.MemberConstants.prototype.k="MEMBER_GUID";$.ig.MemberConstants.prototype.l="MEMBER_CAPTION";$.ig.MemberConstants.prototype.m="CHILDREN_CARDINALITY";$.ig.MemberConstants.prototype.n="PARENT_LEVEL";$.ig.MemberConstants.prototype.o="PARENT_UNIQUE_NAME";$.ig.MemberConstants.prototype.p="PARENT_COUNT";$.ig.MemberConstants.prototype.q="DESCRIPTION";$.ig.MemberConstants.prototype.r="EXPRESSION";$.ig.MemberConstants.prototype.s="MEMBER_KEY";$.ig.MemberConstants.prototype.t="IS_PLACEHOLDERMEMBER";$.ig.MemberConstants.prototype.u="IS_DATAMEMBER";$.ig.MemberConstants.prototype.v="SCOPE";$.ig.OlapSchemaConstants.prototype.a="MDSCHEMA_CUBES";$.ig.OlapSchemaConstants.prototype.b="MDSCHEMA_DIMENSIONS";$.ig.OlapSchemaConstants.prototype.c="MDSCHEMA_MEASUREGROUPS";$.ig.OlapSchemaConstants.prototype.d="MDSCHEMA_MEASUREGROUP_DIMENSIONS";$.ig.OlapSchemaConstants.prototype.e="MDSCHEMA_MEASURES";$.ig.OlapSchemaConstants.prototype.f="MDSCHEMA_HIERARCHIES";$.ig.OlapSchemaConstants.prototype.g="MDSCHEMA_LEVELS";$.ig.OlapSchemaConstants.prototype.h="MDSCHEMA_MEMBERS";$.ig.CubeRestrictions.prototype.a="CATALOG_NAME";$.ig.CubeRestrictions.prototype.b="SCHEMA_NAME";$.ig.CubeRestrictions.prototype.c="CUBE_NAME";$.ig.CubeRestrictions.prototype.d="CUBE_SOURCE";$.ig.DimensionRestrictions.prototype.a="CATALOG_NAME";$.ig.DimensionRestrictions.prototype.b="SCHEMA_NAME";$.ig.DimensionRestrictions.prototype.c="CUBE_NAME";$.ig.DimensionRestrictions.prototype.d="DIMENSION_NAME";$.ig.DimensionRestrictions.prototype.e="DIMENSION_UNIQUE_NAME";$.ig.DimensionRestrictions.prototype.f="CUBE_SOURCE";$.ig.DimensionRestrictions.prototype.g="DIMENSION_VISIBILITY";$.ig.HierarchyRestrictions.prototype.a="CATALOG_NAME";$.ig.HierarchyRestrictions.prototype.b="SCHEMA_NAME";$.ig.HierarchyRestrictions.prototype.c="CUBE_NAME";$.ig.HierarchyRestrictions.prototype.d="DIMENSION_UNIQUE_NAME";$.ig.HierarchyRestrictions.prototype.e="HIERARCHY_NAME";$.ig.HierarchyRestrictions.prototype.f="HIERARCHY_UNIQUE_NAME";$.ig.HierarchyRestrictions.prototype.g="HIERARCHY_ORIGIN";$.ig.HierarchyRestrictions.prototype.h="CUBE_SOURCE";$.ig.HierarchyRestrictions.prototype.i="HIERARCHY_VISIBILITY";$.ig.LevelRestrictions.prototype.a="CATALOG_NAME";$.ig.LevelRestrictions.prototype.b="SCHEMA_NAME";$.ig.LevelRestrictions.prototype.c="CUBE_NAME";$.ig.LevelRestrictions.prototype.d="DIMENSION_UNIQUE_NAME";$.ig.LevelRestrictions.prototype.e="HIERARCHY_UNIQUE_NAME";$.ig.LevelRestrictions.prototype.f="LEVEL_NAME";$.ig.LevelRestrictions.prototype.g="LEVEL_UNIQUE_NAME";$.ig.LevelRestrictions.prototype.h="LEVEL_ORIGIN";$.ig.LevelRestrictions.prototype.i="CUBE_SOURCE";$.ig.LevelRestrictions.prototype.j="LEVEL_VISIBILITY";$.ig.MeasureRestrictions.prototype.a="CATALOG_NAME";$.ig.MeasureRestrictions.prototype.b="SCHEMA_NAME";$.ig.MeasureRestrictions.prototype.c="CUBE_NAME";$.ig.MeasureRestrictions.prototype.d="MEASURE_NAME";$.ig.MeasureRestrictions.prototype.e="MEASURE_UNIQUE_NAME";$.ig.MeasureRestrictions.prototype.f="MEASUREGROUP_NAME";$.ig.MeasureRestrictions.prototype.g="CUBE_SOURCE";$.ig.MeasureRestrictions.prototype.h="MEASURE_VISIBILITY";$.ig.MeasureGroupRestrictions.prototype.a="CATALOG_NAME";$.ig.MeasureGroupRestrictions.prototype.b="SCHEMA_NAME";$.ig.MeasureGroupRestrictions.prototype.c="CUBE_NAME";$.ig.MeasureGroupRestrictions.prototype.d="MEASUREGROUP_NAME";$.ig.MeasureGroupDimensionRestrictions.prototype.a="CATALOG_NAME";$.ig.MeasureGroupDimensionRestrictions.prototype.b="SCHEMA_NAME";$.ig.MeasureGroupDimensionRestrictions.prototype.c="CUBE_NAME";$.ig.MeasureGroupDimensionRestrictions.prototype.d="MEASUREGROUP_NAME";$.ig.MeasureGroupDimensionRestrictions.prototype.e="DIMENSION_UNIQUE_NAME";$.ig.MeasureGroupDimensionRestrictions.prototype.f="DIMENSION_VISIBILITY";$.ig.MemberRestrictions.prototype.a="CATALOG_NAME";$.ig.MemberRestrictions.prototype.b="SCHEMA_NAME";$.ig.MemberRestrictions.prototype.c="CUBE_NAME";$.ig.MemberRestrictions.prototype.d="DIMENSION_UNIQUE_NAME";$.ig.MemberRestrictions.prototype.e="HIERARCHY_UNIQUE_NAME";$.ig.MemberRestrictions.prototype.f="LEVEL_UNIQUE_NAME";$.ig.MemberRestrictions.prototype.g="LEVEL_NUMBER";$.ig.MemberRestrictions.prototype.h="MEMBER_NAME";$.ig.MemberRestrictions.prototype.i="MEMBER_UNIQUE_NAME";$.ig.MemberRestrictions.prototype.j="MEMBER_TYPE";$.ig.MemberRestrictions.prototype.k="TREE_OP";$.ig.MemberRestrictions.prototype.l="CUBE_SOURCE";$.ig.AxisXmlTypeSerializer.prototype.a=null;$.ig.TupleXmlTypeSerializer.prototype.a=null;$.ig.AxisMemberXmlTypeSerializer.prototype.a=null;$.ig.DimensionXmlTypeSerializer.prototype.a=null;$.ig.HierarchyXmlTypeSerializer.prototype.a=null;$.ig.MeasureGroupDimensionXmlTypeSerializer.prototype.a=null;$.ig.MeasureGroupXmlTypeSerializer.prototype.a=null;$.ig.MeasureXmlTypeSerializer.prototype.a=null;$.ig.MemberXmlTypeSerializer.prototype.a=null;$.ig.XmlaSoapMethodResult.prototype.a="return";$.ig.XmlaNamespace.prototype.a="urn:schemas-microsoft-com:xml-sql";$.ig.XmlaNamespace.prototype.b="urn:schemas-microsoft-com:xml-analysis";$.ig.XmlaNamespace.prototype.c="urn:schemas-microsoft-com:xml-analysis:mddataset";$.ig.XmlaNamespace.prototype.d="urn:schemas-microsoft-com:xml-analysis:rowset";$.ig.XmlaNamespace.prototype.e="urn:schemas-microsoft-com:xml-analysis:empty";$.ig.XmlaNamespace.prototype.f="urn:schemas-microsoft-com:xml-analysis:exception";$.ig.XmlaSoapMessageBuilder.prototype.a="Envelope";$.ig.XmlaSoapMessageBuilder.prototype.b="Header";$.ig.XmlaSoapMessageBuilder.prototype.c="Body";$.ig.XmlaSoapMessageBuilder.prototype.d="soap";$.ig.XmlaSoapMessageBuilder.prototype.e="http://schemas.xmlsoap.org/soap/envelope/";$.ig.XmlaSoapMethod.prototype.a="Properties";$.ig.XmlaSoapMethod.prototype.b="PropertyList";$.ig.XmlaSoapMethodDiscover.prototype.l="Discover";$.ig.XmlaSoapMethodDiscover.prototype.m="RequestType";$.ig.XmlaSoapMethodDiscover.prototype.n="Restrictions";$.ig.XmlaSoapMethodDiscover.prototype.o="RestrictionList";$.ig.XmlaSoapMethodDiscover.prototype.p="SessionId";$.ig.XmlaSoapMethodExecute.prototype.l="Execute";$.ig.XmlaSoapMethodExecute.prototype.m="Command";$.ig.XmlaSoapMethodExecute.prototype.n="Statement";$.ig.ArrayJsonSerializer.prototype.a=new $.ig.ArrayJsonSerializer;$.ig.AxisJsonTypeSeriazlier.prototype.a=new $.ig.AxisJsonTypeSeriazlier;$.ig.AxisMemberJsonTypeSeriazlier.prototype.a=new $.ig.AxisMemberJsonTypeSeriazlier;$.ig.CatalogJsonTypeSeriazlier.prototype.a=new $.ig.CatalogJsonTypeSeriazlier;$.ig.CellJsonTypeSeriazlier.prototype.a=new $.ig.CellJsonTypeSeriazlier;$.ig.CubeJsonTypeSeriazlier.prototype.a=new $.ig.CubeJsonTypeSeriazlier;$.ig.DimensionJsonTypeSeriazlier.prototype.a=new $.ig.DimensionJsonTypeSeriazlier;$.ig.HierarchyJsonTypeSeriazlier.prototype.a=new $.ig.HierarchyJsonTypeSeriazlier;$.ig.LevelJsonTypeSeriazlier.prototype.a=new $.ig.LevelJsonTypeSeriazlier;$.ig.MeasureGroupDimensionJsonTypeSeriazlier.prototype.a=new $.ig.MeasureGroupDimensionJsonTypeSeriazlier;$.ig.MeasureGroupJsonTypeSeriazlier.prototype.a=new $.ig.MeasureGroupJsonTypeSeriazlier;$.ig.MeasureJsonTypeSeriazlier.prototype.a=new $.ig.MeasureJsonTypeSeriazlier;$.ig.MemberJsonTypeSeriazlier.prototype.a=new $.ig.MemberJsonTypeSeriazlier;$.ig.RemoteXmlaRequestJsonTypeSeriazlier.prototype.a=new $.ig.RemoteXmlaRequestJsonTypeSeriazlier;$.ig.ResultJsonTypeSeriazlier.prototype.a=new $.ig.ResultJsonTypeSeriazlier;$.ig.TupleJsonTypeSeriazlier.prototype.a=new $.ig.TupleJsonTypeSeriazlier;$.ig.XmlaDiscoverProperties.prototype.a="Catalog";$.ig.util.extCopy($.ig.Enumerable,[[[$.ig.XmlaPropertiesCollection],["where$1","where$11111","select$2","selectMany$2","last$1","first$1","firstOrDefault$1","orderBy$2","orderByDescending$2","toList$1","concat$1","max","max$111","min","min$111","count$1","reverse$1","take$1","skip$1","any$1","contains$1","union$1","toArray$1","elementAt$1"]],[[$.ig.XmlaPropertiesCollection],["ofType$1","cast$1"]]]);$.ig.util.extCopy($.ig.Queryable,[[[$.ig.XmlaPropertiesCollection],["asQueryable"]]]);if($.ig.XmlaSoapWebClient.prototype.staticInit&&!$.ig.XmlaSoapWebClient.prototype.staticInitCalled){$.ig.XmlaSoapWebClient.prototype.staticInit();$.ig.XmlaSoapWebClient.prototype.staticInitCalled=true}if($.ig.OlapXmlaDataSource.prototype.staticInit&&!$.ig.OlapXmlaDataSource.prototype.staticInitCalled){$.ig.OlapXmlaDataSource.prototype.staticInit();$.ig.OlapXmlaDataSource.prototype.staticInitCalled=true}/*!@license
* Infragistics.Web.ClientUI infragistics.olapflatdatasource.js 13.1.20131.2523
*
* Copyright (c) 2011-2014 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends:
*     jquery-1.4.4.js
*     jquery.ui.core.js
*     jquery.ui.widget.js
*     infragistics.util.js
*/
$.ig=$.ig||{};$.ig.util.bulkDefine(["AbstractEnumerable","AbstractEnumerator","IEnumerable$1","ICollection$1","IList$1","IArrayList","List$1","Collection$1","IDictionary$2","Dictionary$2","GenericEnumerable$1","IEnumerator$1","GenericEnumerator$1","INotifyCollectionChanged","NotifyCollectionChangedEventHandler","NotifyCollectionChangedEventArgs","NotifyCollectionChangedAction","KeyValuePair$2","LinkedList$1","LinkedListNode$1","ObservableCollection$1","Queue$1","ReadOnlyCollection$1","ReadOnlyObservableCollection$1","NameValueCollection","Stack$1","IComparer$1","Expression","MemberExpression","ParameterExpression","LambdaExpression","MethodCallExpression","IOrderedEnumerable$1","Queryable","Enumerable","SortedList$1","IGrouping$2","IArray","DependencyObject","Test","IQueryable","IQueryable$1","IQueryProvider","Activator","AggregateException","ArgumentException","ArgumentNullException","ArgumentOutOfRangeException","AsyncCompletedEventArgs","AsyncCompletedEventHandler","ListSortDirection","Convert","Environment","InvalidOperationException","Debug","IEquatable$1","BinaryReader","ICredentials","NetworkCredential","UploadStringCompletedEventHandler","UploadStringCompletedEventArgs","WebClient","WebHeaderCollection","FaultCode","FaultException","FaultException$1","FaultReason","StringBuilder","BinaryFileDownloader","NotImplementedException","Random","Encoding","UTF8Encoding","Task","Task$1","TaskCompletionSource$1","TaskFactory","TaskStatus","Tuple$2","Uri","JavaScriptSerializer","UIElement","UIElementCollection","FrameworkElement","Control","ContentControl","Panel","Canvas","Image","TextBlock","DataTemplate","DataTemplatePassInfo","DataTemplateMeasureInfo","DataTemplateRenderInfo","DataTemplateRenderHandler","DataTemplateMeasureHandler","DataTemplatePassHandler","Binding","DependencyProperty","UnsetValue","DependencyPropertiesCollection","DependencyPropertyChangedEventArgs","Key","ModifierKeys","MouseEventArgs","MouseButtonEventArgs","Brush","Color","DoubleCollection","FillRule","GeometryType","Geometry","GeometryCollection","GeometryGroup","LineGeometry","RectangleGeometry","EllipseGeometry","PathGeometry","PathFigure","PathFigureCollection","PathSegmentType","PathSegment","PathSegmentCollection","LineSegment","BezierSegment","PolyBezierSegment","PolyLineSegment","ArcSegment","SweepDirection","HorizontalAlignment","PenLineCap","Stretch","Transform","RotateTransform","TranslateTransform","TransformGroup","TransformCollection","VerticalAlignment","Point","PointCollection","PropertyChangedCallback","CoerceValueCallback","PropertyMetadata","PropertyPath","Rect","Shape","Line","Path","Polygon","Polyline","Rectangle","Size","Style","StyleTypedPropertyAttribute","TemplatePartAttribute","TemplateVisualStateAttribute","Visibility","XObject","XAttribute","XNode","XContainer","XDocument","XElement","XmlUtils","XName","XNamespace","Object","MulticastDelegate","Action","Action$1","Action$2","Action$3","Action$4","Action$5","Action$6","Action$7","Action$8","IEqualityComparer$1","IEnumerable","ICollection","IDictionary","IList","Array","Array","Comparison$1","Attribute","BrowsableAttribute","EventArgs","CancelEventArgs","DesignTimeVisibleAttribute","EditorBrowsableAttribute","ValueType","Enum","EditorBrowsableState","ISupportInitialize","ITypeDescriptorContext","TypeConverter","TypeConverterAttribute","WinMDTypeAttribute","WinMDPropertyToObjectTypeAttribute","Error","IFormatProvider","NotSupportedException","ObsoleteAttribute","MemberInfo","MethodBase","ConstructorInfo","IComparable","Date","Number","SuppressMessageAttribute","EventHandler$1","PlaceholderSystemCollectionsObjectModel","PlaceholderSystemCollectionsSpecialized","PlaceholderSystemWindows","PlaceholderSystemWindowsControls","PlaceholderSystemWindowsData","PlaceholderSystemWindowsInput","PlaceholderSystemWindowsMarkup","PlaceholderSystemWindowsMediaImaging","PlaceholderSystemWindowsShapes","PlaceholderSystemWindowsControlsPrimitives","PlaceholderSystemWindowsAutomation","PlaceholderSystemWindowsAutomationPeers","PlaceholderSystemText","PlaceholderSystemGlobalization","PlaceholderSystemWindowsDocuments","PlaceholderSystemWindowsInk","PlaceholderSystemWindowsMediaAnimation","PlaceholderSystemWindowsMediaEffects","PlaceholderSystemWindowsThreading","PlaceholderInfragisticsControlerChartsAutomationPeers","FlagsAttribute","Func$1","Func$2","Func$3","Func$4","Func$5","Func$6","Func$7","Func$8","Func$9","Math","XMLHttpRequest","Nullable$1","Number","ParamArrayAttribute","Array","AttributeTargets","AttributeUsageAttribute","Boolean","Number","String","Array","CompareCallback","Dictionary","DictionaryEntry","IEnumerator","INotifyPropertyChanged","PropertyChangedEventArgs","PropertyChangedEventHandler","CultureInfo","Delegate","Number","IDisposable","Number","Number","Number","IntPtr","ReflectionUtil","AssemblyTitleAttribute","AssemblyCompanyAttribute","AssemblyConfigurationAttribute","AssemblyCopyrightAttribute","AssemblyCultureAttribute","AssemblyDescriptionAttribute","AssemblyFileVersionAttribute","AssemblyProductAttribute","AssemblyTrademarkAttribute","AssemblyVersionAttribute","DefaultMemberAttribute","MethodInfo","ParameterInfo","PropertyInfo","RuntimeFieldHandle","RuntimeTypeHandle","ClientScriptAttribute","ClientNameAttribute","DontObfuscateAttribute","EmitIgnoreTypeAttribute","ExtensionAttribute","GlobalMemberAttribute","IgnoreAttribute","InlineItemAccessAttribute","InlinePropertyAttribute","InternalsVisibleToAttribute","KeepOriginalNameAttribute","LiteralStringAttribute","NativeMethodAttribute","NativePropertyAttribute","NativeTypeAttribute","RuntimeHelpers","WeakAttribute","WidgetAttribute","MainWidgetAttribute","SuppressWidgetMemberAttribute","SuppressWidgetMemberCopyAttribute","WidgetDefaultStringAttribute","WidgetDefaultNumberAttribute","WidgetDefaultBooleanAttribute","MvcEnumSetStringEnumAttribute","WidgetModuleAttribute","WidgetModuleParentAttribute","WidgetIgnoreDependsAttribute","ComVisibleAttribute","GuidAttribute","OutAttribute","DataContractAttribute","DataMemberAttribute","WaitHandle","EventWaitHandle","Monitor","TypeCode","TargetFrameworkAttribute","Number","Script","Single","String","ManualResetEvent","Thread","Date","Type","Number","Number","Number","UIntPtr","XmlAttributeAttribute","XmlElementAttribute","XmlEnumAttribute","XmlIgnoreAttribute","XmlRootAttribute","XmlTypeAttribute","XmlNode","XmlAttribute","XmlDocument","XmlDocumentParser","XmlLinkedNode","XmlElement","Void","XmlNodeList","XmlNamedNodeMap","XmlNodeType","XmlSchemaForm","Element","CanvasElement","console","DivElement","Document","ElementAttribute","ElementAttributeCollection","ElementCollection","ElementEventHandler","ElementNodeType","EventListener","IElementEventHandler","ImageElement","CanvasContext","CanvasContext2D","ImageData","Gradient","TextMetrics","MSGesture","WebStyle","window","Callback","JQuery","JQueryDeferred","JQueryEvent","JQueryObject","JQueryCallback","JQueryUICallback","JQueryPosition","JQueryPromise"]);$.ig.util.defType("TaskStatus","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("TaskStatus",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ListSortDirection","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("ListSortDirection",$.ig.Object.prototype.$type)},true);$.ig.util.defType("NotifyCollectionChangedAction","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("NotifyCollectionChangedAction",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AbstractEnumerable","Object",{a:null,init:function(a){$.ig.Object.prototype.init.call(this);this.a=a},getEnumerator:function(){return new $.ig.AbstractEnumerator(this.a().getEnumerator())},$type:new $.ig.Type("AbstractEnumerable",$.ig.Object.prototype.$type,[$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("AbstractEnumerator","Object",{a:null,init:function(a){$.ig.Object.prototype.init.call(this);this.a=a},current:function(){return this.a.current()},moveNext:function(){return this.a.moveNext()},reset:function(){this.a.reset()},$type:new $.ig.Type("AbstractEnumerator",$.ig.Object.prototype.$type,[$.ig.IEnumerator.prototype.$type])},true);$.ig.util.defType("IEnumerable$1","Object",{$type:new $.ig.Type("IEnumerable$1",null,[$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("ICollection$1","Object",{$type:new $.ig.Type("ICollection$1",null,[$.ig.IEnumerable$1.prototype.$type.specialize(0),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("IList$1","Object",{$type:new $.ig.Type("IList$1",null,[$.ig.ICollection$1.prototype.$type.specialize(0),$.ig.IEnumerable$1.prototype.$type.specialize(0),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("IArrayList","Object",{$type:new $.ig.Type("IArrayList",null)},true);$.ig.util.defType("List$1","Object",{$t:null,__inner:null,init:function($t,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}this.a={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.__inner=new $.ig.Array},init1:function($t,initNumber,a){this.a={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.__inner=new $.ig.Array;if(this.n(0,a)){return}var c=a.getEnumerator();while(c.moveNext()){var b=c.current();this.add(b)}},init2:function($t,initNumber,a){this.a={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.__inner=new $.ig.Array},i:function(a,b){this.__inner[a]=b},j:function(a,b){this.__inner.insert(a,b)},k:function(a){this.__inner.add(a)},l:function(a){this.__inner.removeAt(a)},m:function(){this.__inner.clear()},item:function(b,a){if(arguments.length===2){this.i(b,a);return a}else{return this.__inner[b]}},indexOf:function(a){return this.__inner.indexOf(a)},insert:function(a,b){this.j(a,b)},removeAt:function(a){this.l(a)},count:function(){return this.__inner.length},isReadOnly:function(){return false},add:function(a){this.k(a)},clear:function(){this.m()},contains:function(a){return this.__inner.contains(a)},copyTo:function(a,b){for(var c=0;c<this.__inner.length;c++){a[b+c]=this.__inner[c]}},remove:function(a){var b=this.indexOf(a);if(b<0){return false}this.l(b);return true},getEnumerator:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$b=this.$this.__inner.getEnumerator();this.$state=4;break;case 2:this.$a=this.$b.current();this.$current=this.$a;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$b.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerator$1(this.$t,$iter())},asArrayList:function(){return this.__inner},n:function(a,collection_){var b=$.ig.util.cast($.ig.IArrayList.prototype.$type,collection_);if(b!=null){this.__inner.insertRange1(a,b.asArrayList());return true}var c=$.ig.util.cast($.ig.IArray.prototype.$type,collection_);if(c!=null){this.__inner.insertRange(a,c.asArray());return true}var d=$.ig.util.cast($.ig.IList$1.prototype.$type.specialize(this.$t),collection_);if(d!=null){for(var e=0;e<d.count();e++){this.__inner.insert(a+e,d.item(e))}return true}var f=$.isArray(collection_)?collection_:null;if(f!=null){this.__inner.insertRange(a,f);return true}return false},o:function(a,b){if(this.n(a,b)){return}var c=0;var e=b.getEnumerator();while(e.moveNext()){var d=e.current();this.__inner.insert(a+c,d);c++}},p:function(a,b){if(this.n(a,b)){return}var c=0;var e=b.getEnumerator();while(e.moveNext()){var d=e.current();this.__inner.insert(a+c,d);c++}},q:function(a,b){this.__inner.splice(a,b)},copyTo1:function(a,b){this.__inner.copyTo(a,b)},isFixedSize:function(){return false},add1:function(c){this.k(c);return this.__inner.length-1},contains1:function(d){return this.__inner.contains(d)},indexOf1:function(e){return this.__inner.indexOf(e)},insert1:function(f,g){this.j(f,g)},remove1:function(h){var i=this.indexOf1(h);this.l(i)},r:function(){var $self=this;var j=null;if(this.$t==Number){j=function(k,l){var m=k;var n=l;if(m<n){return-1}if(m==n){return 0}return 1}}else if(this.$t==$.ig.Single.prototype.$type){j=function(o,p){var q=o;var r=p;if(q<r){return-1}if(q==r){return 0}return 1}}else if(this.$t==$.ig.Number.prototype.$type){j=function(s,t){var u=s;var v=t;if(u<v){return-1}if(u==v){return 0}return 1}}else if(this.$t==$.ig.Date.prototype.$type){j=function(w,x){var y=w;var z=x;if(y.getTime()<z.getTime()){return-1}if(y.getTime()==z.getTime()){return 0}return 1}}else{j=function(aa,ab){return aa.compareTo(ab)}}this.s(j)},s:function(ac){this.__inner.sort(ac)},t:function(ad){var $self=this;this.__inner.sort(function(ae,af){var ag=ae;var ah=af;return ad(ag,ah)})},_h:null,h:function(ai){if(arguments.length===1){this._h=ai;return ai}else{return this._h}},w:function(aj){var al=aj.getEnumerator();while(al.moveNext()){var ak=al.current();this.__inner.add(ak)}},x:function(){return this.__inner.slice(0)},y:function(am){},isSynchronized:function(){return true},a:null,syncRoot:function(){return this.a},$type:new $.ig.Type("List$1",$.ig.Object.prototype.$type,[$.ig.IList$1.prototype.$type.specialize(0),$.ig.IArrayList.prototype.$type,$.ig.IList.prototype.$type])},true);$.ig.util.defType("IDictionary$2","Object",{$type:new $.ig.Type("IDictionary$2",null,[$.ig.ICollection$1.prototype.$type.specialize($.ig.KeyValuePair$2.prototype.$type.specialize(0,1)),$.ig.IEnumerable$1.prototype.$type.specialize($.ig.KeyValuePair$2.prototype.$type.specialize(0,1)),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("Dictionary$2","Object",{$tKey:null,$tValue:null,__inner:null,__keys:null,init:function($tKey,$tValue,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}this.a=null;this._useToString=false;this.b=false;this._needsEnsure=false;this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.Object.prototype.init.call(this);this.__inner=new $.ig.Dictionary(0);this.__keys=new $.ig.Dictionary(0)},init1:function($tKey,$tValue,initNumber,a){this.a=null;this._useToString=false;this.b=false;this._needsEnsure=false;this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.Object.prototype.init.call(this);this.__inner=new $.ig.Dictionary(1,a);this.__keys=new $.ig.Dictionary(0)},a:null,init2:function($tKey,$tValue,initNumber,a){this.a=null;this._useToString=false;this.b=false;this._needsEnsure=false;this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.Object.prototype.init.call(this);this.__inner=new $.ig.Dictionary(0);this.__keys=new $.ig.Dictionary(0);this.a=a},count:function(){return this.__inner.count()},item:function(b,a){if(arguments.length===2){this.__inner.item(this.f(b),a);this.__keys.item(this.f(b),b);return a}else{return this.__inner.item(this.f(b))}},c:function(){return this.__inner.length()},containsKey:function(a){return this.__inner.containsKey(this.f(a))},remove:function(a){var b=this.f(a);if(!this.__keys.containsKey(b)){return false}this.__inner.remove(b);this.__keys.remove(b);return true},clear:function(){this.__inner.clear();this.__keys.clear()},_useToString:null,b:null,_needsEnsure:null,e:function(key_){if(!this.b){this.b=true;this._needsEnsure=typeof key_=="object";if(!this._needsEnsure){this._useToString=!key_.getHashCode}}},f:function(key_){this.e(key_);if(this._needsEnsure){$.ig.util.ensureUniqueId(key_)}if(this.a!=null){return this.a.getHashCode(key_).toString()}if(this._useToString){return key_.toString()}else{return key_.getHashCode().toString()}},add:function(a,b){this.__inner.item(this.f(a),b);this.__keys.item(this.f(a),a)},tryGetValue:function(a,b){if(!this.__inner.containsKey(this.f(a))){b=null;return{ret:false,value:b}}b=this.__inner.item(this.f(a));return{ret:true,value:b};return{value:b}},keys:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.__keys.values().getEnumerator();this.$state=4;break;case 2:this.$b=this.$c.current();this.$current=this.$b;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$c.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1(this.$tKey,$iter)},values:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.__inner.values().getEnumerator();this.$state=4;break;case 2:this.$b=this.$c.current();this.$current=this.$b;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$c.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1(this.$tValue,$iter)},isReadOnly:function(){return false},add1:function(a){this.add(a.key(),a.value())},contains:function(a){return this.containsKey(a.key())},g:function(a,b){throw new $.ig.NotImplementedException},remove1:function(a){this.remove(a.key());return true},h:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$b=this.$this.__keys.values().getEnumerator();this.$state=4;break;case 2:this.$a=this.$b.current();this.$current=new $.ig.KeyValuePair$2(this.$tKey,this.$tValue,this.$a,this.$this.__inner.item(this.$this.f(this.$a)));this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$b.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1($.ig.KeyValuePair$2.prototype.$type.specialize(this.$tKey,this.$tValue),$iter)},getEnumerator:function(){return this.h().getEnumerator()},$type:new $.ig.Type("Dictionary$2",$.ig.Object.prototype.$type,[$.ig.IDictionary$2.prototype.$type.specialize(0,1),$.ig.IDictionary.prototype.$type])},true);$.ig.util.defType("GenericEnumerable$1","Object",{$t:null,a:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.a=a},getEnumerator:function(){return new $.ig.GenericEnumerator$1(this.$t,this.a().getEnumerator())},$type:new $.ig.Type("GenericEnumerable$1",$.ig.Object.prototype.$type,[$.ig.IEnumerable$1.prototype.$type.specialize(0)])},true);$.ig.util.defType("IEnumerator$1","Object",{$type:new $.ig.Type("IEnumerator$1",null,[$.ig.IEnumerator.prototype.$type])},true);$.ig.util.defType("GenericEnumerator$1","Object",{$t:null,a:null,init:function($t,a){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.a=a},current:function(){return this.a.current()},moveNext:function(){return this.a.moveNext()},reset:function(){this.a.reset()},$type:new $.ig.Type("GenericEnumerator$1",$.ig.Object.prototype.$type,[$.ig.IEnumerator$1.prototype.$type.specialize(0)])},true);$.ig.util.defType("INotifyCollectionChanged","Object",{$type:new $.ig.Type("INotifyCollectionChanged",null)},true);$.ig.util.defType("NotifyCollectionChangedEventArgs","EventArgs",{init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$.ig.EventArgs.prototype.init.call(this);this.a=a;this.d=new $.ig.List$1($.ig.Object.prototype.$type,0);this.b=new $.ig.List$1($.ig.Object.prototype.$type,0)},init1:function(initNumber,a,b,c){var $self=this;$.ig.EventArgs.prototype.init.call(this);this.a=a;this.d=new $.ig.List$1($.ig.Object.prototype.$type,0);if(this.a==$.ig.NotifyCollectionChangedAction.prototype.remove||this.a==$.ig.NotifyCollectionChangedAction.prototype.replace){this.d.add(b);this.e=c}if(this.a!=$.ig.NotifyCollectionChangedAction.prototype.remove){this.b=function(){var $ret=new $.ig.List$1($.ig.Object.prototype.$type,0);$ret.add(b);return $ret}()}else{this.b=new $.ig.List$1($.ig.Object.prototype.$type,0)}this.c=c},init2:function(initNumber,a,b,c,d){var $self=this;$.ig.EventArgs.prototype.init.call(this);this.a=a;this.c=d;this.e=d;this.b=function(){var $ret=new $.ig.List$1($.ig.Object.prototype.$type,0);$ret.add(b);return $ret}();this.d=function(){var $ret=new $.ig.List$1($.ig.Object.prototype.$type,0);$ret.add(c);return $ret}()},a:null,action:function(){return this.a},b:null,newItems:function(){return this.b},c:null,newStartingIndex:function(){return this.c},d:null,oldItems:function(){return this.d},e:null,oldStartingIndex:function(){return this.e},$type:new $.ig.Type("NotifyCollectionChangedEventArgs",$.ig.EventArgs.prototype.$type)},true);$.ig.util.defType("KeyValuePair$2","ValueType",{$tKey:null,$tValue:null,a:null,b:null,init:function($tKey,$tValue,a,b){this.$tKey=$tKey;this.$tValue=$tValue;this.$type=this.$type.specialize(this.$tKey,this.$tValue);$.ig.ValueType.prototype.init.call(this);this.a=a;this.b=b},key:function(){return this.a},value:function(){return this.b},$type:new $.ig.Type("KeyValuePair$2",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ReadOnlyCollection$1","Object",{$t:null,init:function($t,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.b={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this)},init1:function($t,initNumber,a){this.b={};this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.a=a},a:null,item:function(b,a){if(arguments.length===2){this.a.item(b,a);return a}else{return this.a.item(b)}},indexOf:function(a){return this.a.indexOf(a)},insert:function(a,b){},removeAt:function(a){},count:function(){return this.a.count()},isReadOnly:function(){return true},add:function(a){},clear:function(){},contains:function(a){return this.a.contains(a)},copyTo:function(a,b){this.a.copyTo(a,b)},remove:function(a){return false},getEnumerator:function(){return this.a.getEnumerator()},isFixedSize:function(){return true},add1:function(c){return-1},contains1:function(d){return this.a.contains(d)},indexOf1:function(e){return this.a.indexOf(e)},insert1:function(f,g){},remove1:function(h){},copyTo1:function(i,j){this.a.copyTo(i,j)},c:function(){return this.a},isSynchronized:function(){return true},b:null,syncRoot:function(){return this.b},$type:new $.ig.Type("ReadOnlyCollection$1",$.ig.Object.prototype.$type,[$.ig.IList$1.prototype.$type.specialize(0),$.ig.IList.prototype.$type])},true);$.ig.util.defType("IOrderedEnumerable$1","Object",{$type:new $.ig.Type("IOrderedEnumerable$1",null,[$.ig.IEnumerable$1.prototype.$type.specialize(0),$.ig.IEnumerable.prototype.$type])},true);$.ig.util.defType("Enumerable","Object",{init:function(){$.ig.Object.prototype.init.call(this)},where$1:function($tSource,b){var $self=this;var $iter=function(){return function($tSource,b){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$d=this.$this.getEnumerator();this.$state=7;break;case 2:this.$c=this.$d.current();this.$state=3;break;case 3:if(b(this.$c)){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$c;this.$state=5;return true;case 5:this.$state=6;break;case 6:this.$state=7;break;case 7:if(this.$d.moveNext()){this.$state=2}else{this.$state=8}break;case 8:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,b)};return new $.ig.GenericEnumerable$1($tSource,$iter)},where$11111:function($tSource,b){var $self=this;var $iter=function(){return function($tSource,b){return{$state:0,$this:$self,$current:null,$c:0,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$c=0;this.$state=1;break;case 1:this.$e=this.$this.getEnumerator();this.$state=7;break;case 2:this.$d=this.$e.current();this.$state=3;break;case 3:if(b(this.$d,this.$c)){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$d;this.$state=5;return true;case 5:this.$state=6;break;case 6:this.$c++;this.$state=7;break;case 7:if(this.$e.moveNext()){this.$state=2}else{this.$state=8}break;case 8:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,b)};return new $.ig.GenericEnumerable$1($tSource,$iter)},select$2:function($tSource,$tResult,b){var $self=this;var $iter=function(){return function($tSource,$tResult,b){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$d=this.$this.getEnumerator();this.$state=4;break;case 2:this.$c=this.$d.current();this.$current=b(this.$c);this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$d.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,$tResult,b)};return new $.ig.GenericEnumerable$1($tResult,$iter)},selectMany$2:function($tSource,$tResult,b){var $self=this;var $iter=function(){return function($tSource,$tResult,b){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$d=this.$this.getEnumerator();this.$state=8;break;case 2:this.$c=this.$d.current();this.$state=3;break;case 3:this.$f=b(this.$c).getEnumerator();this.$state=6;break;case 4:this.$e=this.$f.current();this.$current=this.$e;this.$state=5;return true;case 5:this.$state=6;break;case 6:if(this.$f.moveNext()){this.$state=4}else{this.$state=7}break;case 7:this.$state=8;break;case 8:if(this.$d.moveNext()){this.$state=2}else{this.$state=9}break;case 9:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,$tResult,b)};return new $.ig.GenericEnumerable$1($tResult,$iter)},ofType$1:function($tResult){var $self=this;var $iter=function(){return function($tResult){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=this.$this.getEnumerator();this.$state=7;break;case 2:this.$b=this.$c.current();this.$state=3;break;case 3:if($.ig.util.cast($tResult,this.$b)!==null){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$b;this.$state=5;return true;case 5:this.$state=6;break;case 6:this.$state=7;break;case 7:if(this.$c.moveNext()){this.$state=2}else{this.$state=8}break;case 8:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tResult)};return new $.ig.GenericEnumerable$1($tResult,$iter)},last$1:function($tSource){var b=$.ig.util.cast($.ig.IList$1.prototype.$type.specialize($tSource),this);if(b!=null){return b.item(b.count()-1)}var c=null;var e=this.getEnumerator();while(e.moveNext()){var d=e.current();c=d}return c},first$1:function($tSource){var c=this.getEnumerator();while(c.moveNext()){var b=c.current();return b}return null},firstOrDefault$1:function($tSource){var c=this.getEnumerator();while(c.moveNext()){var b=c.current();return b}return null},orderBy$2:function($tSource,$tKey,b){var $self=this;var c=new $.ig.SortedList$1($tSource,this);c.t(function(d,e){var f=d;var g=e;var h=b(f);var i=b(g);if($.ig.util.cast($.ig.IComparable.prototype.$type,h)!==null){return $.ig.util.cast($.ig.IComparable.prototype.$type,h).compareTo(i)}else{return h.toString().compareTo(i.toString())}});return c},orderByDescending$2:function($tSource,$tKey,b){var $self=this;var c=new $.ig.SortedList$1($tSource,this);c.t(function(d,e){var f=e;var g=d;var h=b(f);var i=b(g);if($.ig.util.cast($.ig.IComparable.prototype.$type,h)!==null){return $.ig.util.cast($.ig.IComparable.prototype.$type,h).compareTo(i)}else{return h.toString().compareTo(i.toString())}});return c},toList$1:function($tSource){var b=new $.ig.List$1($tSource,1,this);return b},a:function(a,b){var $self=this;var $iter=function(){return function(a,b){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$c=a;this.$state=5;break;case 2:this.$current=this.$c;this.$state=3;return true;case 3:this.$state=4;break;case 4:this.$c++;this.$state=5;break;case 5:if(this.$c<b){this.$state=2}else{this.$state=6}break;case 6:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}(a,b)};return new $.ig.GenericEnumerable$1($.ig.Number.prototype.$type,$iter)},concat$1:function($tSource,b){var $self=this;var $iter=function(){return function($tSource,b){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$d=this.$this.getEnumerator();this.$state=4;break;case 2:this.$c=this.$d.current();this.$current=this.$c;this.$state=3;return true;case 3:this.$state=4;break;case 4:if(this.$d.moveNext()){this.$state=2}else{this.$state=5}break;case 5:this.$state=6;break;case 6:this.$f=b.getEnumerator();this.$state=9;break;case 7:this.$e=this.$f.current();this.$current=this.$e;this.$state=8;return true;case 8:this.$state=9;break;case 9:if(this.$f.moveNext()){this.$state=7}else{this.$state=10}break;case 10:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,b)};return new $.ig.GenericEnumerable$1($tSource,$iter)},max:function(){var b=true;var c=0;var e=this.getEnumerator();while(e.moveNext()){var d=e.current();if(b){b=false;c=d}else{c=Math.max(c,d)}}return c},max$111:function($tSource,b){return this.select$2($tSource,$.ig.Number.prototype.$type,b).max()},min:function(){var b=true;var c=0;var e=this.getEnumerator();while(e.moveNext()){var d=e.current();if(b){b=false;c=d}else{c=Math.min(c,d)}}return c},min$111:function($tSource,b){return this.select$2($tSource,$.ig.Number.prototype.$type,b).max()},count$1:function($tSource){var b=0;var d=this.getEnumerator();while(d.moveNext()){var c=d.current();b++}return b},reverse$1:function($tSource){var $self=this;var $iter=function(){return function($tSource){return{$state:0,$this:$self,$current:null,$b:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$b=new $.ig.List$1($tSource,1,this.$this);this.$state=1;break;case 1:this.$c=this.$b.count()-1;this.$state=5;break;case 2:this.$current=this.$b.__inner[this.$c];this.$state=3;return true;case 3:this.$state=4;break;case 4:this.$c--;this.$state=5;break;case 5:if(this.$c>0){this.$state=2}else{this.$state=6}break;case 6:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource)};return new $.ig.GenericEnumerable$1($tSource,$iter)
},cast$1:function($tResult){if(this==null){throw new $.ig.ArgumentNullException("source")}var b=$.ig.util.cast($.ig.IEnumerable$1.prototype.$type.specialize($tResult),this);if(b!=null){return b}var c=new $.ig.List$1($tResult,0);var e=this.getEnumerator();while(e.moveNext()){var d=e.current();if($.ig.util.cast($tResult,d)!==null){c.add(d)}else{c.add(null)}}return c},take$1:function($tSource,b){var $self=this;var $iter=function(){return function($tSource,b){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$d=this.$this.getEnumerator();this.$state=9;break;case 2:this.$c=this.$d.current();this.$state=3;break;case 3:if(b>0){this.$state=4}else{this.$state=6}break;case 4:b--;this.$current=this.$c;this.$state=5;return true;case 5:this.$state=8;break;case 6:this.$state=-2;return false;case 7:this.$state=8;break;case 8:this.$state=9;break;case 9:if(this.$d.moveNext()){this.$state=2}else{this.$state=10}break;case 10:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,b)};return new $.ig.GenericEnumerable$1($tSource,$iter)},skip$1:function($tSource,b){var $self=this;var $iter=function(){return function($tSource,b){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$d=this.$this.getEnumerator();this.$state=8;break;case 2:this.$c=this.$d.current();this.$state=3;break;case 3:if(b<=0){this.$state=4}else{this.$state=6}break;case 4:this.$current=this.$c;this.$state=5;return true;case 5:this.$state=7;break;case 6:b--;this.$state=7;break;case 7:this.$state=8;break;case 8:if(this.$d.moveNext()){this.$state=2}else{this.$state=9}break;case 9:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}($tSource,b)};return new $.ig.GenericEnumerable$1($tSource,$iter)},any$1:function($tSource){var c=this.getEnumerator();while(c.moveNext()){var b=c.current();return true}return false},contains$1:function($tSource,value_){var b=this.getEnumerator();while(b.moveNext()){var item_=b.current();if(item_===value_){return true}}return false},union$1:function($tSource,b){return null},toArray$1:function($tSource){var b=new $.ig.List$1($tSource,1,this);return b.asArrayList()},elementAt$1:function($tSource,b){var c=$.ig.util.cast($.ig.IList$1.prototype.$type.specialize($tSource),this);if(c!=null){return c.item(b)}return this.skip$1($tSource,b).first$1($tSource)},$type:new $.ig.Type("Enumerable",$.ig.Object.prototype.$type)},true);$.ig.util.defType("SortedList$1","List$1",{$tElement:null,init:function($tElement,a){this.$tElement=$tElement;this.$type=this.$type.specialize(this.$tElement);$.ig.List$1.prototype.init1.call(this,this.$tElement,1,a)},getEnumerator:function(){return $.ig.List$1.prototype.getEnumerator.call(this)},$type:new $.ig.Type("SortedList$1",$.ig.List$1.prototype.$type.specialize(0),[$.ig.IOrderedEnumerable$1.prototype.$type.specialize(0)])},true);$.ig.util.defType("IArray","Object",{$type:new $.ig.Type("IArray",null)},true);$.ig.util.defType("AggregateException","Error",{init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$.ig.Error.prototype.init.call(this)},init1:function(initNumber,a){$.ig.Error.prototype.init1.call(this,1,a)},init2:function(initNumber,a,b){$.ig.Error.prototype.init2.call(this,2,a,b)},$type:new $.ig.Type("AggregateException",$.ig.Error.prototype.$type)},true);$.ig.util.defType("ArgumentException","Error",{init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.Error.prototype.init1.call(this,1,a+" is invalid.")},init1:function(initNumber,a,b){$.ig.Error.prototype.init1.call(this,1,a)},$type:new $.ig.Type("ArgumentException",$.ig.Error.prototype.$type)},true);$.ig.util.defType("ArgumentNullException","Error",{init:function(a){$.ig.Error.prototype.init1.call(this,1,a+" cannot be null.")},$type:new $.ig.Type("ArgumentNullException",$.ig.Error.prototype.$type)},true);$.ig.util.defType("InvalidOperationException","Error",{init:function(initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.Error.prototype.init1.call(this,1,"Invalid operation")},init1:function(initNumber,a){$.ig.Error.prototype.init1.call(this,1,a)},$type:new $.ig.Type("InvalidOperationException",$.ig.Error.prototype.$type)},true);$.ig.util.defType("Debug","Object",{init:function(){$.ig.Object.prototype.init.call(this)},a:function(a,b){},b:function(a){},c:function(a){},$type:new $.ig.Type("Debug",$.ig.Object.prototype.$type)},true);$.ig.util.defType("NotImplementedException","Error",{init:function(){$.ig.Error.prototype.init1.call(this,1,"not implemented")},$type:new $.ig.Type("NotImplementedException",$.ig.Error.prototype.$type)},true);$.ig.util.defType("Task","Object",{_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},init:function(initNumber,a){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}$.ig.Task.prototype.init1.call(this,1,a,null)},init1:function(initNumber,a,b){var $self=this;$.ig.Object.prototype.init.call(this);var c=function(){};var e=function(d){if(d==null){$self.g(true)}else{$self.h(new $.ig.AggregateException(2,"Exception occurred during task execution",d))}};this.f(a.done(c).fail(e));this.j(b)},i:function(){if(this.g()){return $.ig.TaskStatus.prototype.canceled}switch(this.f().state()){case"pending":return $.ig.TaskStatus.prototype.created;case"resolved":return $.ig.TaskStatus.prototype.ranToCompletion;case"rejected":return $.ig.TaskStatus.prototype.faulted;default:return $.ig.TaskStatus.prototype.created}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},t:function(a){var $self=this;var b=function(){return a($self)};var d=function(c){return a($self)};var e=this.f().done(b).fail(d);return new $.ig.Task(0,e)},v:function($tNewResult,a){var $self=this;var b=new $.ig.TaskCompletionSource$1($tNewResult,0);var d=function(){try{var c=a($self);b.i(c)}catch(e_){b.h(e_)}};var f=function(e){return d()};var h=function(g){return d()};this.f().done(f).fail(h);return b.d()},$type:new $.ig.Type("Task",$.ig.Object.prototype.$type)},true);$.ig.util.defType("Task$1","Task",{$tResult:null,init:function($tResult,a,b){var $self=this;this.y=false;this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$.ig.Task.prototype.init1.call(this,1,a,b);var e=function(c){var d=c;$self.z=d;$self.y=true};var g=function(f){$self.y=true};this.f().done(e).fail(g)},y:null,z:null,aa:function(){if(!this.y){throw"Result is not ready yet"}if(this.h()!=null){throw this.h()}return this.z},ac:function(a){var $self=this;return $.ig.Task.prototype.t.call(this,function(b){return a(b)})},ae:function($tNewResult,a){var $self=this;var c=function(b){return a(b)};return this.ag($.ig.Object.prototype.$type,c).ag($.ig.Object.prototype.$type,function(d){return d.aa()})},ag:function($tNewResult,a){return $.ig.Task.prototype.v.call(this,$tNewResult,a)},$type:new $.ig.Type("Task$1",$.ig.Task.prototype.$type)},true);$.ig.util.defType("TaskCompletionSource$1","Object",{$tResult:null,_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},init:function($tResult,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$.ig.TaskCompletionSource$1.prototype.init1.call(this,1,null)},init1:function($tResult,initNumber,a){this.$tResult=$tResult;this.$type=this.$type.specialize(this.$tResult);$.ig.Object.prototype.init.call(this);this.c($.ig.util.deferred());this.d(new $.ig.Task$1(this.$tResult,this.c().promise(),a))},g:function(){this.c().reject(null)},h:function(a){this.c().reject(a)},i:function(a){this.c().resolve(a)},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},$type:new $.ig.Type("TaskCompletionSource$1",$.ig.Object.prototype.$type)},true);$.ig.util.defType("TaskFactory","Object",{init:function(){$.ig.Object.prototype.init.call(this)},a:function(a,b){var $self=this;return new $.ig.Task(0,this.i(this.h(a)).always(function(){return b(a)}))},c:function($tResult,a,b){var $self=this;var c=new $.ig.TaskCompletionSource$1($tResult,0);this.i(this.h(a)).always(function(){try{var d=b(a);c.i(d)}catch(e_){c.h(e_)}});return c.d()},e:function($tAntecedentResult,a,b){var $self=this;return this.e($tAntecedentResult,a,function(c){return b(c)})},g:function($tAntecedentResult,$tResult,a,b){var $self=this;var d=function(c){return b(c)};return this.c($.ig.Object.prototype.$type,a,d).ae($tResult,function(e){return e.aa()})},h:function(a){var b=new Array(a.length);for(var c=0;c<a.length;c++){b[c]=a[c].f()}return b},i:function(a){var promises_=a;var b=function(p){function whenAll(){var whenDeffered=$.ig.util.deferred();if(arguments.length===0){whenDeffered.resolve();return whenDeffered}var count=arguments.length;var resolve=true;for(var i=0;i<arguments.length;i++){arguments[i].done(function(){resolve=resolve&&true}).fail(function(){resolve=resolve&&false}).always(function(){count--;if(count<=0){if(resolve){whenDeffered.resolve()}else{whenDeffered.reject()}}})}return whenDeffered}return whenAll.apply($,p)}(promises_);return b},$type:new $.ig.Type("TaskFactory",$.ig.Object.prototype.$type)},true);$.ig.util.defType("Tuple$2","Object",{$t1:null,$t2:null,_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},init:function($t1,$t2,a,b){this.$t1=$t1;this.$t2=$t2;this.$type=this.$type.specialize(this.$t1,this.$t2);$.ig.Object.prototype.init.call(this);this.c(a);this.d(b)},$type:new $.ig.Type("Tuple$2",$.ig.Object.prototype.$type)},true);$.ig.TaskStatus.prototype.created=0;$.ig.TaskStatus.prototype.ranToCompletion=5;$.ig.TaskStatus.prototype.canceled=6;$.ig.TaskStatus.prototype.faulted=7;$.ig.ListSortDirection.prototype.ascending=0;$.ig.ListSortDirection.prototype.descending=1;$.ig.NotifyCollectionChangedAction.prototype.add=0;$.ig.NotifyCollectionChangedAction.prototype.remove=1;$.ig.NotifyCollectionChangedAction.prototype.replace=2;$.ig.NotifyCollectionChangedAction.prototype.reset=4;$.ig.util.extCopy($.ig.Queryable,[[[$.ig.AbstractEnumerable,$.ig.IEnumerable$1,$.ig.ICollection$1,$.ig.IList$1,$.ig.List$1,$.ig.IDictionary$2,$.ig.Dictionary$2,$.ig.GenericEnumerable$1,$.ig.ReadOnlyCollection$1,$.ig.Stack$1,$.ig.IOrderedEnumerable$1,$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ICollection,$.ig.IList,$.ig.Array,$.ig.Dictionary,$.ig.XmlNodeList,$.ig.XmlNamedNodeMap],["asQueryable"]]]);$.ig.util.extCopy($.ig.Enumerable,[[[$.ig.ICollection$1,$.ig.IList$1,$.ig.List$1,$.ig.IDictionary$2,$.ig.Dictionary$2,$.ig.GenericEnumerable$1,$.ig.ReadOnlyCollection$1,$.ig.Stack$1,$.ig.IOrderedEnumerable$1,$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.IEnumerable$1],["where$1","where$11111","select$2","selectMany$2","last$1","first$1","firstOrDefault$1","orderBy$2","orderByDescending$2","toList$1","concat$1","max","max$111","min","min$111","count$1","reverse$1","take$1","skip$1","any$1","contains$1","union$1","toArray$1","elementAt$1"]],[[$.ig.AbstractEnumerable,$.ig.IEnumerable$1,$.ig.ICollection$1,$.ig.IList$1,$.ig.List$1,$.ig.IDictionary$2,$.ig.Dictionary$2,$.ig.GenericEnumerable$1,$.ig.ReadOnlyCollection$1,$.ig.Stack$1,$.ig.IOrderedEnumerable$1,$.ig.SortedList$1,$.ig.IGrouping$2,$.ig.ICollection,$.ig.IList,$.ig.Array,$.ig.Dictionary,$.ig.XmlNodeList,$.ig.XmlNamedNodeMap],["ofType$1","cast$1"]]]);$.ig=$.ig||{};$.ig.util.bulkDefine(["ICoreOlapElement","Cube","Catalog","Dimension","CubeType","ScopeType","DimensionType","LevelType","HierarchyOrigin","AggregatorType","CardinalityType","MemberType","Hierarchy","Level","Measure","MeasureGroup","MeasureGroupDimension","Member","OlapResult","OlapResultAxis","IPosition$2","OlapResultTuple","IPositionItem$2","IHierarchicalPositionItem$2","OlapResultAxisMember","OlapResultCell","HeaderCellsLayoutOrientation","LevelSpanManager","SpanSource","ITableViewHeadersFactory","TableViewHeadersFactory","TableCompactViewHeadersFactory","TableViewHeaderCellSource","TableViewImpl","TableViewSettings","OlapResultView","ResultViewHelper","OlapTableViewHeaderCell","OlapTableViewResultCell","ArrayListCollection$1","IOlapDataSource","MeasureList","MeasureListLocation","OlapMetadataTreeItemType","OlapMetadataTreeItem","MetaTreeHelper","HierarchyItemPosition","MeasureGroupMetaItemsCache","DataSourceBaseOptions","CubeMetaItemsCache","SourceInitHelper","AxisDefinitionParser","CoreOlapElementType","CoreOlapElementParseResult","CoreOlapElementParser","AxisElement","PivotActionStatus","PivotAction","AxisItemsChangeType","AxisChangedAction","AxisItemsChangedAction","ExpansionStateChangeType","ExpansionStateChangedAction","PivotActionManager","KeyValueItem","PositionItemInfo$2","PositionResolver$2","LevelSortDirection","LevelSortBehavior","TaskExtensions","HierarchyFilterView","FilterMember","FilterMemberStateChangedEventArgs","ResultSorter$1","ResultHeaderSorter","AxisTupleVisitor","AxisHeaderSortingVisitor","ResultColumnValueSorter","AxisValueSortingVisitor","TupleSortDirection","DataSourceBase","jQueryUtils","OlapUtilities","OlapTableView","Object","MulticastDelegate","Action","Action$1","Action$2","Action$3","Action$4","Action$5","Action$6","Action$7","Action$8","IEqualityComparer$1","IEnumerable","ICollection","IDictionary","IList","Array","Array","Comparison$1","Attribute","BrowsableAttribute","EventArgs","CancelEventArgs","DesignTimeVisibleAttribute","EditorBrowsableAttribute","ValueType","Enum","EditorBrowsableState","ISupportInitialize","ITypeDescriptorContext","TypeConverter","TypeConverterAttribute","WinMDTypeAttribute","WinMDPropertyToObjectTypeAttribute","Error","IFormatProvider","NotSupportedException","ObsoleteAttribute","MemberInfo","MethodBase","ConstructorInfo","IComparable","Date","Number","SuppressMessageAttribute","EventHandler$1","PlaceholderSystemCollectionsObjectModel","PlaceholderSystemCollectionsSpecialized","PlaceholderSystemWindows","PlaceholderSystemWindowsControls","PlaceholderSystemWindowsData","PlaceholderSystemWindowsInput","PlaceholderSystemWindowsMarkup","PlaceholderSystemWindowsMediaImaging","PlaceholderSystemWindowsShapes","PlaceholderSystemWindowsControlsPrimitives","PlaceholderSystemWindowsAutomation","PlaceholderSystemWindowsAutomationPeers","PlaceholderSystemText","PlaceholderSystemGlobalization","PlaceholderSystemWindowsDocuments","PlaceholderSystemWindowsInk","PlaceholderSystemWindowsMediaAnimation","PlaceholderSystemWindowsMediaEffects","PlaceholderSystemWindowsThreading","PlaceholderInfragisticsControlerChartsAutomationPeers","FlagsAttribute","Func$1","Func$2","Func$3","Func$4","Func$5","Func$6","Func$7","Func$8","Func$9","Math","XMLHttpRequest","Nullable$1","Number","ParamArrayAttribute","Array","AttributeTargets","AttributeUsageAttribute","Boolean","Number","String","Array","CompareCallback","Dictionary","DictionaryEntry","IEnumerator","INotifyPropertyChanged","PropertyChangedEventArgs","PropertyChangedEventHandler","CultureInfo","Delegate","Number","IDisposable","Number","Number","Number","IntPtr","ReflectionUtil","AssemblyTitleAttribute","AssemblyCompanyAttribute","AssemblyConfigurationAttribute","AssemblyCopyrightAttribute","AssemblyCultureAttribute","AssemblyDescriptionAttribute","AssemblyFileVersionAttribute","AssemblyProductAttribute","AssemblyTrademarkAttribute","AssemblyVersionAttribute","DefaultMemberAttribute","MethodInfo","ParameterInfo","PropertyInfo","RuntimeFieldHandle","RuntimeTypeHandle","ClientScriptAttribute","ClientNameAttribute","DontObfuscateAttribute","EmitIgnoreTypeAttribute","ExtensionAttribute","GlobalMemberAttribute","IgnoreAttribute","InlineItemAccessAttribute","InlinePropertyAttribute","InternalsVisibleToAttribute","KeepOriginalNameAttribute","LiteralStringAttribute","NativeMethodAttribute","NativePropertyAttribute","NativeTypeAttribute","RuntimeHelpers","WeakAttribute","WidgetAttribute","MainWidgetAttribute","SuppressWidgetMemberAttribute","SuppressWidgetMemberCopyAttribute","WidgetDefaultStringAttribute","WidgetDefaultNumberAttribute","WidgetDefaultBooleanAttribute","MvcEnumSetStringEnumAttribute","WidgetModuleAttribute","WidgetModuleParentAttribute","WidgetIgnoreDependsAttribute","ComVisibleAttribute","GuidAttribute","OutAttribute","DataContractAttribute","DataMemberAttribute","WaitHandle","EventWaitHandle","Monitor","TypeCode","TargetFrameworkAttribute","Number","Script","Single","String","ManualResetEvent","Thread","Date","Type","Number","Number","Number","UIntPtr","XmlAttributeAttribute","XmlElementAttribute","XmlEnumAttribute","XmlIgnoreAttribute","XmlRootAttribute","XmlTypeAttribute","XmlNode","XmlAttribute","XmlDocument","XmlDocumentParser","XmlLinkedNode","XmlElement","Void","XmlNodeList","XmlNamedNodeMap","XmlNodeType","XmlSchemaForm","AbstractEnumerable","AbstractEnumerator","IEnumerable$1","ICollection$1","IList$1","IArrayList","List$1","Collection$1","IDictionary$2","Dictionary$2","GenericEnumerable$1","IEnumerator$1","GenericEnumerator$1","INotifyCollectionChanged","NotifyCollectionChangedEventHandler","NotifyCollectionChangedEventArgs","NotifyCollectionChangedAction","KeyValuePair$2","LinkedList$1","LinkedListNode$1","ObservableCollection$1","Queue$1","ReadOnlyCollection$1","ReadOnlyObservableCollection$1","NameValueCollection","Stack$1","IComparer$1","Expression","MemberExpression","ParameterExpression","LambdaExpression","MethodCallExpression","IOrderedEnumerable$1","Queryable","Enumerable","SortedList$1","IGrouping$2","IArray","DependencyObject","Test","IQueryable","IQueryable$1","IQueryProvider","Activator","AggregateException","ArgumentException","ArgumentNullException","ArgumentOutOfRangeException","AsyncCompletedEventArgs","AsyncCompletedEventHandler","ListSortDirection","Convert","Environment","InvalidOperationException","Debug","IEquatable$1","BinaryReader","ICredentials","NetworkCredential","UploadStringCompletedEventHandler","UploadStringCompletedEventArgs","WebClient","WebHeaderCollection","FaultCode","FaultException","FaultException$1","FaultReason","StringBuilder","BinaryFileDownloader","NotImplementedException","Random","Encoding","UTF8Encoding","Task","Task$1","TaskCompletionSource$1","TaskFactory","TaskStatus","Tuple$2","Uri","JavaScriptSerializer","UIElement","UIElementCollection","FrameworkElement","Control","ContentControl","Panel","Canvas","Image","TextBlock","DataTemplate","DataTemplatePassInfo","DataTemplateMeasureInfo","DataTemplateRenderInfo","DataTemplateRenderHandler","DataTemplateMeasureHandler","DataTemplatePassHandler","Binding","DependencyProperty","UnsetValue","DependencyPropertiesCollection","DependencyPropertyChangedEventArgs","Key","ModifierKeys","MouseEventArgs","MouseButtonEventArgs","Brush","Color","DoubleCollection","FillRule","GeometryType","Geometry","GeometryCollection","GeometryGroup","LineGeometry","RectangleGeometry","EllipseGeometry","PathGeometry","PathFigure","PathFigureCollection","PathSegmentType","PathSegment","PathSegmentCollection","LineSegment","BezierSegment","PolyBezierSegment","PolyLineSegment","ArcSegment","SweepDirection","HorizontalAlignment","PenLineCap","Stretch","Transform","RotateTransform","TranslateTransform","TransformGroup","TransformCollection","VerticalAlignment","Point","PointCollection","PropertyChangedCallback","CoerceValueCallback","PropertyMetadata","PropertyPath","Rect","Shape","Line","Path","Polygon","Polyline","Rectangle","Size","Style","StyleTypedPropertyAttribute","TemplatePartAttribute","TemplateVisualStateAttribute","Visibility","XObject","XAttribute","XNode","XContainer","XDocument","XElement","XmlUtils","XName","XNamespace","Element","CanvasElement","console","DivElement","Document","ElementAttribute","ElementAttributeCollection","ElementCollection","ElementEventHandler","ElementNodeType","EventListener","IElementEventHandler","ImageElement","CanvasContext","CanvasContext2D","ImageData","Gradient","TextMetrics","MSGesture","WebStyle","window","Callback","JQuery","JQueryDeferred","JQueryEvent","JQueryObject","JQueryCallback","JQueryUICallback","JQueryPosition","JQueryPromise"]);$.ig.util.defType("LevelSortBehavior","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("LevelSortBehavior",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapMetadataTreeItemType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("OlapMetadataTreeItemType",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureListLocation","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("MeasureListLocation",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HeaderCellsLayoutOrientation","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("HeaderCellsLayoutOrientation",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MemberType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("MemberType",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CardinalityType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("CardinalityType",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AggregatorType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("AggregatorType",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyOrigin","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("HierarchyOrigin",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DimensionType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("DimensionType",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CubeType","Enum",{init:function(){$.ig.Enum.prototype.init.call(this)},$type:new $.ig.Type("CubeType",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ICoreOlapElement","Object",{$type:new $.ig.Type("ICoreOlapElement",null)},true);$.ig.util.defType("Cube","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_cubeType:null,cubeType:function(a){if(arguments.length===1){this._cubeType=a;return a}else{return this._cubeType}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_lastProcessed:null,lastProcessed:function(a){if(arguments.length===1){this._lastProcessed=a;return a}else{return this._lastProcessed}},_lastUpdated:null,lastUpdated:function(a){if(arguments.length===1){this._lastUpdated=a;return a}else{return this._lastUpdated}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},$type:new $.ig.Type("Cube",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Dimension","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_dimensionType:null,dimensionType:function(a){if(arguments.length===1){this._dimensionType=a;return a}else{return this._dimensionType}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_defaultHierarchy:null,defaultHierarchy:function(a){if(arguments.length===1){this._defaultHierarchy=a;return a}else{return this._defaultHierarchy}},$type:new $.ig.Type("Dimension",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Hierarchy","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_defaultHierarchy:null,defaultHierarchy:function(a){if(arguments.length===1){this._defaultHierarchy=a;return a}else{return this._defaultHierarchy}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_defaultMember:null,defaultMember:function(a){if(arguments.length===1){this._defaultMember=a;return a}else{return this._defaultMember}},_allMember:null,allMember:function(a){if(arguments.length===1){this._allMember=a;return a}else{return this._allMember}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_hierarchyOrigin:null,hierarchyOrigin:function(a){if(arguments.length===1){this._hierarchyOrigin=a;return a}else{return this._hierarchyOrigin}},_hierarchyDisplayFolder:null,hierarchyDisplayFolder:function(a){if(arguments.length===1){this._hierarchyDisplayFolder=a;return a}else{return this._hierarchyDisplayFolder}},$type:new $.ig.Type("Hierarchy",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Level","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_depth:null,depth:function(a){if(arguments.length===1){this._depth=a;return a}else{return this._depth}},_hierarchyUniqueName:null,hierarchyUniqueName:function(a){if(arguments.length===1){this._hierarchyUniqueName=a;return a}else{return this._hierarchyUniqueName}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_membersCount:null,membersCount:function(a){if(arguments.length===1){this._membersCount=a;return a}else{return this._membersCount}},_levelOrigin:null,levelOrigin:function(a){if(arguments.length===1){this._levelOrigin=a;return a}else{return this._levelOrigin}},_levelOrderingProperty:null,levelOrderingProperty:function(a){if(arguments.length===1){this._levelOrderingProperty=a;return a}else{return this._levelOrderingProperty}},$type:new $.ig.Type("Level",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("Measure","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_measureGroupName:null,measureGroupName:function(a){if(arguments.length===1){this._measureGroupName=a;return a}else{return this._measureGroupName}},_aggregatorType:null,aggregatorType:function(a){if(arguments.length===1){this._aggregatorType=a;return a}else{return this._aggregatorType}},_defaultFormatString:null,defaultFormatString:function(a){if(arguments.length===1){this._defaultFormatString=a;return a}else{return this._defaultFormatString}},_measureDisplayFolder:null,measureDisplayFolder:function(a){if(arguments.length===1){this._measureDisplayFolder=a;return a}else{return this._measureDisplayFolder}},$type:new $.ig.Type("Measure",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("MeasureGroupDimension","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_cubeName:null,cubeName:function(a){if(arguments.length===1){this._cubeName=a;return a}else{return this._cubeName}},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},_measureGroupName:null,measureGroupName:function(a){if(arguments.length===1){this._measureGroupName=a;return a}else{return this._measureGroupName}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_measureGroupCardinality:null,measureGroupCardinality:function(a){if(arguments.length===1){this._measureGroupCardinality=a;return a}else{return this._measureGroupCardinality}},_dimensionCardinality:null,dimensionCardinality:function(a){if(arguments.length===1){this._dimensionCardinality=a;return a}else{return this._dimensionCardinality}},_isDimensionVisible:null,isDimensionVisible:function(a){if(arguments.length===1){this._isDimensionVisible=a;return a}else{return this._isDimensionVisible}},_isFactDimension:null,isFactDimension:function(a){if(arguments.length===1){this._isFactDimension=a;return a}else{return this._isFactDimension}},_dimensionPath:null,dimensionPath:function(a){if(arguments.length===1){this._dimensionPath=a;return a}else{return this._dimensionPath}},_dimensionGranularity:null,dimensionGranularity:function(a){if(arguments.length===1){this._dimensionGranularity=a;return a}else{return this._dimensionGranularity}},$type:new $.ig.Type("MeasureGroupDimension",$.ig.Object.prototype.$type)},true);$.ig.util.defType("Member","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_cubeName:null,cubeName:function(a){if(arguments.length===1){this._cubeName=a;return a}else{return this._cubeName}},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_hierarchyUniqueName:null,hierarchyUniqueName:function(a){if(arguments.length===1){this._hierarchyUniqueName=a;return a}else{return this._hierarchyUniqueName}},_levelUniqueName:null,levelUniqueName:function(a){if(arguments.length===1){this._levelUniqueName=a;return a}else{return this._levelUniqueName}},_levelDepth:null,levelDepth:function(a){if(arguments.length===1){this._levelDepth=a;return a}else{return this._levelDepth}},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_memberType:null,memberType:function(a){if(arguments.length===1){this._memberType=a;return a}else{return this._memberType}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;
return a}else{return this._caption}},_childrenCardinality:null,childrenCardinality:function(a){if(arguments.length===1){this._childrenCardinality=a;return a}else{return this._childrenCardinality}},_parentLevel:null,parentLevel:function(a){if(arguments.length===1){this._parentLevel=a;return a}else{return this._parentLevel}},_parentUniqueName:null,parentUniqueName:function(a){if(arguments.length===1){this._parentUniqueName=a;return a}else{return this._parentUniqueName}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_scope:null,scope:function(a){if(arguments.length===1){this._scope=a;return a}else{return this._scope}},$type:new $.ig.Type("Member",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("OlapResult","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_isEmpty:null,isEmpty:function(a){if(arguments.length===1){this._isEmpty=a;return a}else{return this._isEmpty}},_axes:null,axes:function(a){if(arguments.length===1){this._axes=a;return a}else{return this._axes}},_cells:null,cells:function(a){if(arguments.length===1){this._cells=a;return a}else{return this._cells}},$type:new $.ig.Type("OlapResult",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapResultAxis","Object",{init:function(a,b){$.ig.Object.prototype.init.call(this);this.tuples(a.toList$1($.ig.OlapResultTuple.prototype.$type));this.tupleSize(b);this.positionResolver(new $.ig.PositionResolver$2(String,$.ig.Object.prototype.$type,a,b))},_positionResolver:null,positionResolver:function(a){if(arguments.length===1){this._positionResolver=a;return a}else{return this._positionResolver}},clone:function(){var $self=this;var a=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);var c=this.tuples().getEnumerator();while(c.moveNext()){var b=c.current();a.add(b.clone())}return function(){var $ret=new $.ig.OlapResultAxis(a,$self.tupleSize());$ret.name($self.name());return $ret}()},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_tupleSize:null,tupleSize:function(a){if(arguments.length===1){this._tupleSize=a;return a}else{return this._tupleSize}},_tuples:null,tuples:function(a){if(arguments.length===1){this._tuples=a;return a}else{return this._tuples}},$type:new $.ig.Type("OlapResultAxis",$.ig.Object.prototype.$type)},true);$.ig.util.defType("IPosition$2","Object",{$type:new $.ig.Type("IPosition$2",null)},true);$.ig.util.defType("OlapResultTuple","Object",{init:function(a){$.ig.Object.prototype.init.call(this);this.members(new $.ig.ReadOnlyCollection$1($.ig.OlapResultAxisMember.prototype.$type,1,a))},_members:null,members:function(a){if(arguments.length===1){this._members=a;return a}else{return this._members}},getItems:function(){return this.members()},itemsCount:function(){return this.members().count()},indexOf:function(a){return this.members().indexOf(a)},item:function(b){return this.members().item(b)},isEmpty:function(){return false},clone:function(){var a=new $.ig.List$1($.ig.OlapResultAxisMember.prototype.$type,0);var c=this.members().getEnumerator();while(c.moveNext()){var b=c.current();a.add(b.clone())}var d=new $.ig.OlapResultTuple(a);var f=a.getEnumerator();while(f.moveNext()){var e=f.current();e.position(d)}return d},$type:new $.ig.Type("OlapResultTuple",$.ig.Object.prototype.$type,[$.ig.IPosition$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)])},true);$.ig.util.defType("IPositionItem$2","Object",{$type:new $.ig.Type("IPositionItem$2",null)},true);$.ig.util.defType("IHierarchicalPositionItem$2","Object",{$type:new $.ig.Type("IHierarchicalPositionItem$2",null,[$.ig.IPositionItem$2.prototype.$type.specialize(0,1)])},true);$.ig.util.defType("OlapResultAxisMember","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.properties(new $.ig.Dictionary$2(String,String,0));this.ordinal(-1)},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_levelUniqueName:null,levelUniqueName:function(a){if(arguments.length===1){this._levelUniqueName=a;return a}else{return this._levelUniqueName}},_hierarchyUniqueName:null,hierarchyUniqueName:function(a){if(arguments.length===1){this._hierarchyUniqueName=a;return a}else{return this._hierarchyUniqueName}},_levelNumber:null,levelNumber:function(a){if(arguments.length===1){this._levelNumber=a;return a}else{return this._levelNumber}},_displayInfo:null,displayInfo:function(a){if(arguments.length===1){this._displayInfo=a;return a}else{return this._displayInfo}},childCount:function(){return this.displayInfo()&~65536&~131072},drilledDown:function(){return(this.displayInfo()&65536)==65536},parentSameAsPrev:function(){return(this.displayInfo()&131072)==131072},_properties:null,properties:function(a){if(arguments.length===1){this._properties=a;return a}else{return this._properties}},_position:null,position:function(a){if(arguments.length===1){this._position=a;return a}else{return this._position}},key:function(){return this.uniqueName()},sortKey:function(){if(this.ordinal()>-1){return this.ordinal()}var b=parseFloat(this.caption());if(!isNaN(b)){return b}return this.caption()},_ordinal:null,ordinal:function(a){if(arguments.length===1){this._ordinal=a;return a}else{return this._ordinal}},hierarchyKey:function(){return this.hierarchyUniqueName()},hierarchyLevelKey:function(){return this.levelUniqueName()},parentKey:function(){var $self=this;var b;(function(){var $ret=$self.properties().tryGetValue("PARENT_UNIQUE_NAME",b);b=$ret.value;return $ret.ret})();return b},depth:function(){return this.levelNumber()},isExpandable:function(){return this.childCount()>0},clone:function(){var a=new $.ig.OlapResultAxisMember;a.caption(this.caption());a.displayInfo(this.displayInfo());a.hierarchyUniqueName(this.hierarchyUniqueName());a.levelNumber(this.levelNumber());a.levelUniqueName(this.levelUniqueName());a.ordinal(this.ordinal());var c=this.properties().getEnumerator();while(c.moveNext()){var b=c.current();a.properties().add(b.key(),b.value())}a.uniqueName(this.uniqueName());a.position(this.position());return a},$type:new $.ig.Type("OlapResultAxisMember",$.ig.Object.prototype.$type,[$.ig.IHierarchicalPositionItem$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type)])},true);$.ig.util.defType("OlapResultCell","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.properties(new $.ig.Dictionary$2(String,$.ig.Object.prototype.$type,0))},_cellOrdinal:null,cellOrdinal:function(a){if(arguments.length===1){this._cellOrdinal=a;return a}else{return this._cellOrdinal}},_properties:null,properties:function(a){if(arguments.length===1){this._properties=a;return a}else{return this._properties}},clone:function(){var $self=this;var a=function(){var $ret=new $.ig.OlapResultCell;$ret.cellOrdinal($self.cellOrdinal());return $ret}();var c=this.properties().getEnumerator();while(c.moveNext()){var b=c.current();a.properties().add(b.key(),b.value())}return a},$type:new $.ig.Type("OlapResultCell",$.ig.Object.prototype.$type)},true);$.ig.util.defType("LevelSpanManager","Object",{a:null,init:function(a){$.ig.Object.prototype.init.call(this);this.c(a);this.a=new Array(a)},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},f:function(a,b){var $self=this;var c=this.a[a];if(c==null){c=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.SpanSource.prototype.$type,0);this.a[a]=c}var d;if(!function(){var $ret=c.tryGetValue(b,d);d=$ret.value;return $ret.ret}()){d=new $.ig.SpanSource;if(b>0){var e;if(function(){var $ret=c.tryGetValue(b-1,e);e=$ret.value;return $ret.ret}()){d.d(e);e.j()}}c.add(b,d)}return d},$type:new $.ig.Type("LevelSpanManager",$.ig.Object.prototype.$type)},true);$.ig.util.defType("SpanSource","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.a=1},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},a:null,e:function(a){if(arguments.length===1){if(this.a!=a){var b=a-this.a;if(this.d()!=null){this.d().e(this.d().e()+b)}this.a=a}return a}else{return this.a}},b:null,j:function(){if(!this.b){this.b=true;this.e(this.e()+1)}},$type:new $.ig.Type("SpanSource",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ITableViewHeadersFactory","Object",{$type:new $.ig.Type("ITableViewHeadersFactory",null)},true);$.ig.util.defType("TableViewHeadersFactory","Object",{_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_i:null,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},init:function(a,b,c,d,e){$.ig.Object.prototype.init.call(this);this.f(a);this.g(b);this.h(c);this.i(d);this.j(e)},createHeaderCells:function(){var $self=this;if(this.f().positionResolver().hasUnregisterdPositions()){this.f().positionResolver().completeRegisterPositions()}var a=this.f().positionResolver().rootPositionInfo();var b=new $.ig.List$1($.ig.IList$1.prototype.$type.specialize($.ig.TableViewHeaderCellSource.prototype.$type),0);for(var c=0;c<a.positionSize();c++){b.add(new $.ig.List$1($.ig.TableViewHeaderCellSource.prototype.$type,0))}$.ig.TableViewHeadersFactory.prototype.u(a,a.positionItemDepthMin(),b,this.i(),this.j());var d=new $.ig.ArrayListCollection$1($.ig.OlapTableViewHeaderCell.prototype.$type);var e=0;for(var f=0;f<a.positionSize();f++){var g=b.item(f);var h=0;var i=0;var k=g.getEnumerator();while(k.moveNext()){var j=k.current();var l;var m;var n;var o;if(this.h()==$.ig.HeaderCellsLayoutOrientation.prototype.horizontal){l=h;m=j.p().e();n=j.r().positionItemDepth()+e;o=j.o().e()}else{n=h;o=j.p().e();l=j.r().positionItemDepth()+e;m=j.o().e()}var p=this.f().tuples().__inner[j.r().positionIndex()];var q=p.item(j.r().positionItemIndex());var r=this.f().tuples().__inner[j.s()];if(this.g().positionResolver().hasUnregisterdPositions()){this.g().positionResolver().completeRegisterPositions()}var s=this.g().positionResolver().getPositionIndex(r);var t=function(){var $ret=new $.ig.OlapTableViewHeaderCell;$ret.axisName($self.f().name());$ret.hierarchyNumber(j.r().positionItemIndex());$ret.levelNumber(j.r().positionItemDepth());$ret.caption(q.caption());$ret.columnIndex(l);$ret.columnSpan(m);$ret.isExpanded(j.u());$ret.isExpandable(j.v());$ret.tupleIndex(s);$ret.memberIndex(j.r().positionItemIndex());$ret.rowIndex(n);$ret.rowSpan(o);return $ret}();if(!j.l()){h=h+j.p().e()}i=Math.max(i,j.r().positionItemDepth());d.add(t)}e+=i+1}return d},u:function(a,b,c,d,e){var $self=this;var f=new $.ig.LevelSpanManager(a.positionSize());var i=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(g){return g.positionItemDepth()==b}).getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;(function(){var $ret=$.ig.TableViewHeadersFactory.prototype.w(a,h,c,f,d,e,j,k);j=$ret.headerCellSource;k=$ret.totalSpan;return $ret.ret})()}},v:function(a,b,c,d,e,f){var $self=this;var h=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(g){return g.positionItemDepth()==a.positionItemDepthMin()}).toList$1($.ig.PositionItemInfo$2.prototype.$type);if(h.count()>0){var j=h.getEnumerator();while(j.moveNext()){var i=j.current();var k;var l;(function(){var $ret=$.ig.TableViewHeadersFactory.prototype.w(a,i,b,c,d,f,k,l);k=$ret.headerCellSource;l=$ret.totalSpan;return $ret.ret})();e.p().e(e.p().e()+l);if(k.l()){e.p().e(e.p().e()+1)}}e.p().e(e.p().e()-1)}else{f.add(a.positionIndex())}e.s(a.positionIndex())},w:function(a,b,c,d,e,f,g,h){var $self=this;var i=c.item(b.positionItemIndex());var j=d.f(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.o(j);$ret.r(b);$ret.v(b.isExpandable());return $ret}();g=k;if(e){i.add(k);$.ig.TableViewHeadersFactory.prototype.v(b,c,d,true,k,f)}var l=null;if(b.isExpanded()){l=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(m){return m.parentKey()==b.key()}).toList$1($.ig.PositionItemInfo$2.prototype.$type)}if(l!=null&&l.count()>0){var n=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.l(true);$ret.r(b);$ret.v(b.isExpandable());return $ret}();i.add(n);var p=l.getEnumerator();while(p.moveNext()){var o=p.current();var q;var r;(function(){var $ret=$.ig.TableViewHeadersFactory.prototype.w(a,o,c,d,e,f,q,r);q=$ret.headerCellSource;r=$ret.totalSpan;return $ret.ret})();n.p().e(n.p().e()+r);if(q.l()){n.p().e(n.p().e()+1)}}n.p().e(n.p().e()-1);k.u(true);k.v(false);n.u(true);k.q(n);if(!e){i.add(k);$.ig.TableViewHeadersFactory.prototype.v(b,c,d,false,k,f)}n.s(k.s());g=n;h=k.p().e()+n.p().e()-1}else{if(b.isExpanded()){k.v(false)}if(!e){i.add(k);$.ig.TableViewHeadersFactory.prototype.v(b,c,d,false,k,f)}h=k.p().e()}return{headerCellSource:g,totalSpan:h}},$type:new $.ig.Type("TableViewHeadersFactory",$.ig.Object.prototype.$type,[$.ig.ITableViewHeadersFactory.prototype.$type])},true);$.ig.util.defType("TableCompactViewHeadersFactory","Object",{_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_i:null,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},init:function(a,b,c,d,e){$.ig.Object.prototype.init.call(this);this.f(a);this.g(b);this.h(c);this.i(d);this.j(e)},createHeaderCells:function(){var $self=this;if(this.f().positionResolver().hasUnregisterdPositions()){this.f().positionResolver().completeRegisterPositions()}var a=this.f().positionResolver().rootPositionInfo();var b=new $.ig.List$1($.ig.IList$1.prototype.$type.specialize($.ig.TableViewHeaderCellSource.prototype.$type),0);for(var c=0;c<a.positionSize();c++){b.add(new $.ig.List$1($.ig.TableViewHeaderCellSource.prototype.$type,0))}$.ig.TableCompactViewHeadersFactory.prototype.u(a,a.positionItemDepthMin(),b,this.i(),this.j());var d=new $.ig.ArrayListCollection$1($.ig.OlapTableViewHeaderCell.prototype.$type);var e=0;for(var f=0;f<a.positionSize();f++){var g=b.item(f);var h=0;var i=0;var k=g.getEnumerator();while(k.moveNext()){var j=k.current();var l;var m;var n;var o;if(this.h()==$.ig.HeaderCellsLayoutOrientation.prototype.horizontal){l=h;m=j.p().e();n=e;o=1}else{n=h;o=j.p().e();l=e;m=1}var p=this.f().tuples().__inner[j.r().positionIndex()];var q=p.item(j.r().positionItemIndex());var r=this.f().tuples().__inner[j.s()];if(this.g().positionResolver().hasUnregisterdPositions()){this.g().positionResolver().completeRegisterPositions()}var s=this.g().positionResolver().getPositionIndex(r);var t=function(){var $ret=new $.ig.OlapTableViewHeaderCell;$ret.axisName($self.f().name());$ret.hierarchyNumber(j.r().positionItemIndex());$ret.levelNumber(j.r().positionItemDepth());$ret.caption(q.caption());$ret.columnIndex(l);$ret.columnSpan(m);$ret.isExpanded(j.u());$ret.isExpandable(j.v());$ret.tupleIndex(s);$ret.memberIndex(j.r().positionItemIndex());$ret.rowIndex(n);$ret.rowSpan(o);return $ret}();if(!j.l()){h=h+j.p().e()}d.add(t)}e+=i+1}return d},u:function(a,b,c,d,e){var $self=this;var f=new $.ig.LevelSpanManager(a.positionSize());var i=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(g){return g.positionItemDepth()==b}).getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;(function(){var $ret=$.ig.TableCompactViewHeadersFactory.prototype.w(a,h,c,f,d,e,j,k);j=$ret.headerCellSource;k=$ret.totalSpan;return $ret.ret})()}},v:function(a,b,c,d,e,f){var $self=this;var h=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(g){return g.positionItemDepth()==a.positionItemDepthMin()}).toList$1($.ig.PositionItemInfo$2.prototype.$type);if(h.count()>0){var j=h.getEnumerator();while(j.moveNext()){var i=j.current();var k;var l;(function(){var $ret=$.ig.TableCompactViewHeadersFactory.prototype.w(a,i,b,c,d,f,k,l);k=$ret.headerCellSource;l=$ret.totalSpan;return $ret.ret})();e.p().e(e.p().e()+l);if(k.q()!=null){e.p().e(e.p().e()+1)}}e.p().e(e.p().e()-1)}else{f.add(a.positionIndex())}e.s(a.positionIndex())},w:function(a,b,c,d,e,f,g,h){var $self=this;var i=c.item(b.positionItemIndex());var j=d.f(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.o(j);$ret.r(b);$ret.v(b.isExpandable());return $ret}();g=k;if(e){i.add(k);$.ig.TableCompactViewHeadersFactory.prototype.v(b,c,d,true,k,f)}var l=null;if(b.isExpanded()){l=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(m){return m.parentKey()==b.key()}).toList$1($.ig.PositionItemInfo$2.prototype.$type)}if(l!=null&&l.count()>0){var n=function(){var $ret=new $.ig.TableViewHeaderCellSource;$ret.l(true);$ret.r(b);$ret.v(b.isExpandable());return $ret}();var p=l.getEnumerator();while(p.moveNext()){var o=p.current();var q;var r;(function(){var $ret=$.ig.TableCompactViewHeadersFactory.prototype.w(a,o,c,d,e,f,q,r);q=$ret.headerCellSource;r=$ret.totalSpan;return $ret.ret})();n.p().e(n.p().e()+r);if(q.q()!=null){n.p().e(n.p().e()+1)}}n.p().e(n.p().e()-1);k.u(true);k.v(true);k.q(n);if(!e){i.add(k);$.ig.TableCompactViewHeadersFactory.prototype.v(b,c,d,false,k,f)}n.s(k.s());h=k.p().e()+n.p().e()-1}else{if(b.isExpanded()){k.v(false)}if(!e){i.add(k);$.ig.TableCompactViewHeadersFactory.prototype.v(b,c,d,false,k,f)}h=k.p().e()}return{headerCellSource:g,totalSpan:h}},$type:new $.ig.Type("TableCompactViewHeadersFactory",$.ig.Object.prototype.$type,[$.ig.ITableViewHeadersFactory.prototype.$type])},true);$.ig.util.defType("TableViewHeaderCellSource","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.p(new $.ig.SpanSource);this.o(new $.ig.SpanSource)},_l:null,l:function(a){if(arguments.length===1){this._l=a;return a}else{return this._l}},_m:null,m:function(a){if(arguments.length===1){this._m=a;return a}else{return this._m}},_n:null,n:function(a){if(arguments.length===1){this._n=a;return a}else{return this._n}},_o:null,o:function(a){if(arguments.length===1){this._o=a;return a}else{return this._o}},_p:null,p:function(a){if(arguments.length===1){this._p=a;return a}else{return this._p}},_q:null,q:function(a){if(arguments.length===1){this._q=a;return a}else{return this._q}},_r:null,r:function(a){if(arguments.length===1){this._r=a;return a}else{return this._r}},_s:null,s:function(a){if(arguments.length===1){this._s=a;return a}else{return this._s}},_t:null,t:function(a){if(arguments.length===1){this._t=a;return a}else{return this._t}},_u:null,u:function(a){if(arguments.length===1){this._u=a;return a}else{return this._u}},_v:null,v:function(a){if(arguments.length===1){this._v=a;return a}else{return this._v}},$type:new $.ig.Type("TableViewHeaderCellSource",$.ig.Object.prototype.$type)},true);$.ig.util.defType("TableViewImpl","Object",{init:function(a,b,c,d){var $self=this;$.ig.Object.prototype.init.call(this);if(a==null){throw new $.ig.ArgumentNullException("result")}this.result(a);this.originalResult(a);if(d==null){this.viewSettings(new $.ig.TableViewSettings)}else{this.viewSettings(d)}this.hasColumns(b);this.hasRows(c);this.columnSortDirections(new $.ig.ArrayListCollection$1($.ig.TupleSortDirection.prototype.$type));this.columnSortDirections().collectionChanged=$.ig.Delegate.prototype.combine(this.columnSortDirections().collectionChanged,function(e,f){$self.u(true)});this.levelSortDirections(new $.ig.ArrayListCollection$1($.ig.LevelSortDirection.prototype.$type));this.levelSortDirections().collectionChanged=$.ig.Delegate.prototype.combine(this.levelSortDirections().collectionChanged,function(g,h){$self.u(true)});this.appliedColumnSortDirections(new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,0));this.appliedLevelSortDirections(new $.ig.List$1($.ig.LevelSortDirection.prototype.$type,0));this.appliedSortDirectionsMap(new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type)),0))},_viewSettings:null,viewSettings:function(a){if(arguments.length===1){this._viewSettings=a;return a}else{return this._viewSettings}},_result:null,result:function(a){if(arguments.length===1){this._result=a;return a}else{return this._result}},_originalResult:null,originalResult:function(a){if(arguments.length===1){this._originalResult=a;return a}else{return this._originalResult}},_hasRows:null,hasRows:function(a){if(arguments.length===1){this._hasRows=a;return a}else{return this._hasRows}},_hasColumns:null,hasColumns:function(a){if(arguments.length===1){this._hasColumns=a;return a}else{return this._hasColumns}},_r:null,r:function(a){if(arguments.length===1){this._r=a;return a}else{return this._r}},_s:null,s:function(a){if(arguments.length===1){this._s=a;return a}else{return this._s}},_t:null,t:function(a){if(arguments.length===1){this._t=a;return a}else{return this._t}},_u:null,u:function(a){if(arguments.length===1){this._u=a;return a}else{return this._u}},a:null,b:null,c:null,rowHeaders:function(a){if(arguments.length===1){this.a=a;return a}else{if(!this.t()||this.u()){this.initialize()}return this.a}},columnHeaders:function(a){if(arguments.length===1){this.b=a;return a}else{if(!this.t()||this.u()){this.initialize()}return this.b}},resultCells:function(a){if(arguments.length===1){this.c=a;return a}else{if(!this.t()||this.u()){this.initialize()}return this.c}},_columnSortDirections:null,columnSortDirections:function(a){if(arguments.length===1){this._columnSortDirections=a;return a}else{return this._columnSortDirections}},_levelSortDirections:null,levelSortDirections:function(a){if(arguments.length===1){this._levelSortDirections=a;return a}else{return this._levelSortDirections}},_appliedColumnSortDirections:null,appliedColumnSortDirections:function(a){if(arguments.length===1){this._appliedColumnSortDirections=a;return a}else{return this._appliedColumnSortDirections}},_appliedLevelSortDirections:null,appliedLevelSortDirections:function(a){if(arguments.length===1){this._appliedLevelSortDirections=a;return a}else{return this._appliedLevelSortDirections}},_appliedSortDirectionsMap:null,appliedSortDirectionsMap:function(a){if(arguments.length===1){this._appliedSortDirectionsMap=a;return a}else{return this._appliedSortDirectionsMap}},initialize:function(){var $self=this;this.r(null);this.s(null);this.rowHeaders(null);this.columnHeaders(null);this.resultCells(null);this.result(this.originalResult());if(this.result().isEmpty()){this.u(false);this.t(true);return}if(this.levelSortDirections().count()>0){var a=new $.ig.ResultHeaderSorter(this.result(),this.hasRows(),this.hasColumns(),this.levelSortDirections());this.result(a.m());this.appliedLevelSortDirections(a.r());this.appliedSortDirectionsMap(a.s())}else{this.appliedLevelSortDirections(new $.ig.List$1($.ig.LevelSortDirection.prototype.$type,0));this.appliedSortDirectionsMap(new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type)),0))}if(this.hasRows()&&this.columnSortDirections().count()>0){if(this.appliedLevelSortDirections().count()>0){if(this.originalResult().axes().item(0).positionResolver().hasUnregisterdPositions()){this.originalResult().axes().item(0).positionResolver().completeRegisterPositions()}if(this.result().axes().item(0).positionResolver().hasUnregisterdPositions()){this.result().axes().item(0).positionResolver().completeRegisterPositions()}var b=new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,2,this.columnSortDirections().count());var c=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,1,this.appliedColumnSortDirections().count());var e=this.columnSortDirections().getEnumerator();while(e.moveNext()){var d=e.current();var f=this.originalResult().axes().item(0).tuples().__inner[d.tupleIndex()];var g=this.result().axes().item(0).positionResolver().getPositionIndex(f);var h=new $.ig.TupleSortDirection;h.sortDirection(d.sortDirection());h.tupleIndex(g);h.comparer(d.comparer());b.add(h);c.item(g,d.tupleIndex())}var i=new $.ig.ResultColumnValueSorter(this.result(),this.hasRows(),this.hasColumns(),b);this.result(i.m());var k=i.q().getEnumerator();while(k.moveNext()){var j=k.current();j.tupleIndex(c.item(j.tupleIndex()))}this.appliedColumnSortDirections(i.q())}else{var l=new $.ig.ResultColumnValueSorter(this.result(),this.hasRows(),this.hasColumns(),this.columnSortDirections());this.result(l.m());this.appliedColumnSortDirections(l.q())}}else{this.appliedColumnSortDirections(new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,0))}var m=0;var n=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var o=1;if(this.hasColumns()){var p=this.result().axes().item(m);var q=this.originalResult().axes().item(m);var r=this.ap(p,q);for(var s=0;s<r.count();s++){var t=r.item(s);n.add(t,s)}m++;o=p.tuples().count()}var u=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);if(this.hasRows()){var v=this.result().axes().item(m);var w=this.originalResult().axes().item(m);var x=this.aq(v,w);for(var y=0;y<x.count();y++){var z=x.item(y);u.add(z,y)}}var aa=new $.ig.ArrayListCollection$1($.ig.OlapTableViewResultCell.prototype.$type);for(var ab=0;ab<this.result().cells().count();ab++){var ac=this.result().cells().item(ab);var ad;(function(){var $ret=ac.properties().tryGetValue("Value",ad);ad=$ret.value;return $ret.ret})();var ae;(function(){var $ret=ac.properties().tryGetValue("FmtValue",ae);ae=$ret.value;return $ret.ret})();var af=ac.cellOrdinal();if(this.hasColumns()){var ag=af%o;var ah=n.item(ag);if(ag!=ah){var ai=$.ig.intDivide(af,o);af=ai*o+ah}}if(this.hasRows()){var aj=$.ig.intDivide(af,o);var ak=u.item(aj);if(aj!=ak){var al=af%o;af=ak*o+al}}aa.add(function(){var $ret=new $.ig.OlapTableViewResultCell;$ret.value(ad);$ret.formattedValue(ae);$ret.cellOrdinal(af);$ret.resultCellIndex(ab);return $ret}());this.resultCells(aa)}this.u(false);this.t(true)},ap:function(a,b){var c=new $.ig.List$1($.ig.Number.prototype.$type,0);if(this.viewSettings().h()){this.s(new $.ig.TableCompactViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.horizontal,this.viewSettings().e(),c))}else{this.s(new $.ig.TableViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.horizontal,this.viewSettings().e(),c))}this.columnHeaders(this.s().createHeaderCells());return c},aq:function(a,b){var c=new $.ig.List$1($.ig.Number.prototype.$type,0);if(this.viewSettings().g()){this.r(new $.ig.TableCompactViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.vertical,this.viewSettings().f(),c))}else{this.r(new $.ig.TableViewHeadersFactory(a,b,$.ig.HeaderCellsLayoutOrientation.prototype.vertical,this.viewSettings().f(),c))}this.rowHeaders(this.r().createHeaderCells());return c},$type:new $.ig.Type("TableViewImpl",$.ig.Object.prototype.$type)},true);$.ig.util.defType("TableViewSettings","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},$type:new $.ig.Type("TableViewSettings",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapResultView","Object",{init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);if(a==null){throw new $.ig.ArgumentNullException("result")}this.result(a);this.visibleResult(b);this.hasColumns(c);this.hasRows(d)},_result:null,result:function(a){if(arguments.length===1){this._result=a;return a}else{return this._result}},_visibleResult:null,visibleResult:function(a){if(arguments.length===1){this._visibleResult=a;return a}else{return this._visibleResult}},_hasRows:null,hasRows:function(a){if(arguments.length===1){this._hasRows=a;return a}else{return this._hasRows}},_hasColumns:null,hasColumns:function(a){if(arguments.length===1){this._hasColumns=a;return a}else{return this._hasColumns}},i:function(a,b,c,d,e){var $self=this;var f=0;var g=null;var h=1;if(e){g=a.axes().item(f);h=g.tuples().count();f++}var i=null;var j=1;if(d){i=a.axes().item(f);j=i.tuples().count()}var k=1;if(b!=null){k=b.tuples().count()}var l=1;if(c!=null){l=c.tuples().count()}var m=new Array(k*l);if(a.cells().count()>0){var n=0;var o=a.cells().item(n);for(var p=0;p<j;p++){var q=$.ig.intDivide(o.cellOrdinal(),h);if(q!=p){continue}var r=0;if(b!=null&&i!=null){var s=i.tuples().__inner[p];r=b.positionResolver().getPositionIndex(s)}if(r==-1){while(q==p){n++;if(n<a.cells().count()){o=a.cells().item(n);q=$.ig.intDivide(o.cellOrdinal(),h)}else{break}}continue}var t=o.cellOrdinal()%h;for(var u=0;u<h;u++){if(t!=u){continue}var v=-1;if(c==null||g==null){v=0}else{var w=g.tuples().__inner[u];v=c.positionResolver().getPositionIndex(w)}if(v==-1){n++;if(n<a.cells().count()){o=a.cells().item(n);q=$.ig.intDivide(o.cellOrdinal(),h);if(q>p){break}t=o.cellOrdinal()%h}continue}var x=o.clone();x.cellOrdinal(r*l+v);m[x.cellOrdinal()]=x;n++;if(n<a.cells().count()){o=a.cells().item(n);q=$.ig.intDivide(o.cellOrdinal(),h);if(q>p){break}t=o.cellOrdinal()%h}}}}var y=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,0);for(var aa=0;aa<m.length;aa++){var z=m[aa];if(z!=null){y.add(z)}}var ab=new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0);if(e){ab.add(c)}if(d){ab.add(b)}return function(){var $ret=new $.ig.OlapResult;$ret.axes(ab);$ret.cells(y);$ret.isEmpty(!d&&!e&&y.count()==0);return $ret}()},j:function(a,b,c){var $self=this;var d=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);if(c){for(var e=0;e<b.count();e++){var f=b.item(e);d.add(a.tuples().__inner[f].clone())}}else{var g=0;var h=b.item(g);for(var i=0;i<a.tuples().count();i++){if(i==h){g++;if(g<b.count()){h=b.item(g)}}else{d.add(a.tuples().__inner[i].clone())}}}var j=function(){var $ret=new $.ig.OlapResultAxis(d,a.tupleSize());$ret.name(a.name());return $ret}();return j},expandTupleMember:function(a,b,c){var $self=this;var d=this.o(a,b,c,this.visibleResult());if(d==null){return null}if(!d.isExpandable()){throw new $.ig.InvalidOperationException(1,"The position is not expandable.")}if(d.isExpanded()){return this}var f=this.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(e){return e.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var h=this.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(g){return g.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var i=a=="Axis0"&&!this.hasColumns()||a=="Axis1"&&this.hasRows();var j=f.tuples().__inner[b];var k=h.positionResolver().getPositionIndex(j);var l=this.n(a,k,c,this.result());if(l.count()==0){return null}var m=null;var n=null;if(i){m=this.j(h,l,true);if(this.hasColumns()){n=this.visibleResult().axes().item(0)}}else{n=this.j(h,l,true);if(this.hasRows()){m=this.visibleResult().axes().item(1)}}var o=this.i(this.result(),m,n,this.hasRows(),this.hasColumns());var p=this.k(this.visibleResult(),o,h.name());return new $.ig.OlapResultView(this.result(),p,this.hasColumns(),this.hasRows())},collapseTupleMember:function(a,b,c){var $self=this;var d=this.o(a,b,c,this.visibleResult());if(d==null){return null}if(!d.isExpandable()){throw new $.ig.InvalidOperationException(1,"The position is not expandable.")}if(!d.isExpanded()){return this}var e=this.n(a,b,c,this.visibleResult());
if(e.count()==0){return null}var g=this.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var h=a=="Axis0"&&!this.hasColumns()||a=="Axis1"&&this.hasRows();var i=null;var j=null;if(h){i=this.j(g,e,false);if(this.hasColumns()){j=this.visibleResult().axes().item(0)}}else{j=this.j(g,e,false);if(this.hasRows()){i=this.visibleResult().axes().item(1)}}var l=this.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(k){return k.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var m=l.tuples().__inner[b];if(l.positionResolver().hasUnregisterdPositions()){l.positionResolver().completeRegisterPositions()}var n=l.positionResolver().getHostPositionItemInfo(m,c);var o=n.item(m.item(c).key());o.isExpanded(false);var p=this.i(this.visibleResult(),i,j,this.hasRows(),this.hasColumns());return new $.ig.OlapResultView(this.result(),p,this.hasColumns(),this.hasRows())},extend:function(a,b){var $self=this;var d=this.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(c){return c.name()==b}).first$1($.ig.OlapResultAxis.prototype.$type);var e=b=="Axis0"&&!this.hasColumns()||b=="Axis1"&&this.hasRows();var f=null;var g=null;var h=null;var i=false;if(e){f=d;if(this.hasColumns()){g=this.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(j){return j.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);h=this.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(k){return k.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);i=g.tuples().count()!=h.tuples().count()}}else{g=d;if(this.hasRows()){f=this.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(l){return l.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);h=this.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(m){return m.name()!=b}).first$1($.ig.OlapResultAxis.prototype.$type);i=f.tuples().count()!=h.tuples().count()}}var n=null;var o=null;if(h!=null&&i){var p=this.i(this.result(),f,g,this.hasRows(),this.hasColumns());n=this.k(p,a,b);o=this.k(p,a,b)}else{n=this.k(this.result(),a,b);o=this.k(this.visibleResult(),a,b)}return new $.ig.OlapResultView(n,o,this.hasColumns(),this.hasRows())},k:function(a,b,c){var $self=this;var e=a.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(d){return d.name()==c}).first$1($.ig.OlapResultAxis.prototype.$type);if(e==null){return null}var g=b.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==c}).first$1($.ig.OlapResultAxis.prototype.$type);var h=c=="Axis0"&&!this.hasColumns()||c=="Axis1"&&this.hasRows();var i=null;var j=null;if(h){if(this.hasColumns()){i=a.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(k){return k.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type);j=b.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(l){return l.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type)}}else{if(this.hasRows()){i=a.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(m){return m.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type);j=b.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(n){return n.name()!=c}).first$1($.ig.OlapResultAxis.prototype.$type)}}var o=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);var q=e.tuples().getEnumerator();while(q.moveNext()){var p=q.current();o.add(p.clone())}var s=g.tuples().getEnumerator();while(s.moveNext()){var r=s.current();o.add(r)}var t=g.tuples().count();var u=j!=null&&j.tuples().count()>0?j.tuples().count():1;var v=e.tuples().count()>0?e.tuples().count():1;var w=i!=null&&i.tuples().count()>0?i.tuples().count():1;var x=v*w;var y=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,0);if(h){var aa=a.cells().getEnumerator();while(aa.moveNext()){var z=aa.current();y.add(z.clone())}var ab=new Array(t*w);var ac=v*w;var ae=b.cells().getEnumerator();while(ae.moveNext()){var ad=ae.current();var af=ad.clone();var ag=this.l(af.cellOrdinal(),i,j);var ah=$.ig.intDivide(af.cellOrdinal(),u);af.cellOrdinal(ah*w+ag);af.cellOrdinal(af.cellOrdinal()+x);ab[af.cellOrdinal()-ac]=af}for(var ai=0;ai<ab.length;ai++){var aj=ab[ai];if(aj!=null){y.add(aj)}}}else{var ak=new Array(w*(v+t));var am=a.cells().getEnumerator();while(am.moveNext()){var al=am.current();var an=al.clone();var ao=$.ig.intDivide(an.cellOrdinal(),v);an.cellOrdinal(an.cellOrdinal()+ao*t);ak[an.cellOrdinal()]=an}var aq=b.cells().getEnumerator();while(aq.moveNext()){var ap=aq.current();var ar=ap.clone();var as=this.m(ar.cellOrdinal(),i,j,t);var at=$.ig.intDivide(ap.cellOrdinal(),t);if(as!=at){}var au=ar.cellOrdinal()%t;ar.cellOrdinal(as*t+au);ar.cellOrdinal(ar.cellOrdinal()+(as+1)*v);ak[ar.cellOrdinal()]=ar}for(var aw=0;aw<ak.length;aw++){var av=ak[aw];if(av!=null){y.add(av)}}}var ax=new $.ig.OlapResult;ax.axes(new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0));var ay=function(){var $ret=new $.ig.OlapResultAxis(o,e.tupleSize());$ret.name(e.name());return $ret}();if(h){if(i!=null){ax.axes().add(i)}ax.axes().add(ay)}else{ax.axes().add(ay);if(i!=null){ax.axes().add(i)}}ax.cells(y);ax.isEmpty(!this.hasColumns()&&!this.hasRows()&&y.count()==0);return ax},l:function(a,b,c){if(c==null){return 0}var d=a%c.tuples().count();var e=c.tuples().__inner[d];var f=b.positionResolver().getPositionIndex(e);return f},m:function(a,b,c,d){if(c==null){return 0}var e=$.ig.intDivide(a,d);var f=c.tuples().__inner[e];var g=b.positionResolver().getPositionIndex(f);return g},n:function(a,b,c,d){var $self=this;var f=d.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(e){return e.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var g=f.tuples().__inner[b];var h=g.item(c);if(f.positionResolver().hasUnregisterdPositions()){f.positionResolver().completeRegisterPositions()}var i=f.positionResolver().n(h,$.ig.ListSortDirection.prototype.ascending);if(i!=null){return i.toList$1($.ig.Number.prototype.$type)}return null},o:function(a,b,c,d){var $self=this;var f=d.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(e){return e.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var g=f.tuples().__inner[b];var h=g.item(c);if(f.positionResolver().hasUnregisterdPositions()){f.positionResolver().completeRegisterPositions()}var i=f.positionResolver().getHostPositionItemInfo(g,c);var j;(function(){var $ret=i.tryGetValue(h.key(),j);j=$ret.value;return $ret.ret})();return j},$type:new $.ig.Type("OlapResultView",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ResultViewHelper","Object",{init:function(){$.ig.Object.prototype.init.call(this)},a:function(a,b,c,d,e){$.ig.ResultViewHelper.prototype.c(a,b,c,true,e.visibleResult());$.ig.ResultViewHelper.prototype.c(a,b,c,true,e.result())},b:function(a,b,c){var $self=this;var e=b.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(d){return d.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var g=c.visibleResult().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);$.ig.ResultViewHelper.prototype.e(e.positionResolver(),g.positionResolver());var i=b.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(h){return h.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);var k=c.result().axes().where$1($.ig.OlapResultAxis.prototype.$type,function(j){return j.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);$.ig.ResultViewHelper.prototype.e(i.positionResolver(),k.positionResolver())},c:function(a,b,c,d,e){var $self=this;var g=e.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(f){return f.name()==a}).first$1($.ig.OlapResultAxis.prototype.$type);if(g.positionResolver().hasUnregisterdPositions()){g.positionResolver().completeRegisterPositions()}$.ig.ResultViewHelper.prototype.d(b,c,d,g.positionResolver())},d:function(a,b,c,d){if(d.hasUnregisterdPositions()){d.completeRegisterPositions()}var e=d.positions().__inner[a];var f=d.getHostPositionItemInfo(e,b);var g=f.item(e.item(b).key());g.isExpanded(c)},e:function(a,b){if(a.hasUnregisterdPositions()){a.completeRegisterPositions()}if(b.hasUnregisterdPositions()){b.completeRegisterPositions()}$.ig.ResultViewHelper.prototype.f(a.rootPositionInfo(),b.rootPositionInfo())},f:function(a,b){var $self=this;var d=a.getEnumerator();while(d.moveNext()){var c=d.current();var e=c.value();var f;if(function(){var $ret=b.tryGetValue(c.key(),f);f=$ret.value;return $ret.ret}()){if(e.isExpanded()!=true){f.isExpanded(false)}if(f.count()>0){$.ig.ResultViewHelper.prototype.f(e,f)}}}},$type:new $.ig.Type("ResultViewHelper",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapTableViewHeaderCell","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.columnSpan(1);this.rowSpan(1)},_id:null,id:function(a){if(arguments.length===1){this._id=a;return a}else{return this._id}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_isExpanded:null,isExpanded:function(a){if(arguments.length===1){this._isExpanded=a;return a}else{return this._isExpanded}},_isExpandable:null,isExpandable:function(a){if(arguments.length===1){this._isExpandable=a;return a}else{return this._isExpandable}},_rowIndex:null,rowIndex:function(a){if(arguments.length===1){this._rowIndex=a;return a}else{return this._rowIndex}},_rowSpan:null,rowSpan:function(a){if(arguments.length===1){this._rowSpan=a;return a}else{return this._rowSpan}},_columnIndex:null,columnIndex:function(a){if(arguments.length===1){this._columnIndex=a;return a}else{return this._columnIndex}},_columnSpan:null,columnSpan:function(a){if(arguments.length===1){this._columnSpan=a;return a}else{return this._columnSpan}},_axisName:null,axisName:function(a){if(arguments.length===1){this._axisName=a;return a}else{return this._axisName}},_tupleIndex:null,tupleIndex:function(a){if(arguments.length===1){this._tupleIndex=a;return a}else{return this._tupleIndex}},_memberIndex:null,memberIndex:function(a){if(arguments.length===1){this._memberIndex=a;return a}else{return this._memberIndex}},_levelNumber:null,levelNumber:function(a){if(arguments.length===1){this._levelNumber=a;return a}else{return this._levelNumber}},_hierarchyNumber:null,hierarchyNumber:function(a){if(arguments.length===1){this._hierarchyNumber=a;return a}else{return this._hierarchyNumber}},toString:function(){return this.caption()},$type:new $.ig.Type("OlapTableViewHeaderCell",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapTableViewResultCell","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_value:null,value:function(a){if(arguments.length===1){this._value=a;return a}else{return this._value}},_formattedValue:null,formattedValue:function(a){if(arguments.length===1){this._formattedValue=a;return a}else{return this._formattedValue}},_cellOrdinal:null,cellOrdinal:function(a){if(arguments.length===1){this._cellOrdinal=a;return a}else{return this._cellOrdinal}},_resultCellIndex:null,resultCellIndex:function(a){if(arguments.length===1){this._resultCellIndex=a;return a}else{return this._resultCellIndex}},$type:new $.ig.Type("OlapTableViewResultCell",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ArrayListCollection$1","Object",{$t:null,init:function($t){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.inner(new $.ig.Array)},_inner:null,inner:function(a){if(arguments.length===1){this._inner=a;return a}else{return this._inner}},collectionChanged:null,indexOf:function(a){return this.inner().indexOf(a)},insert:function(a,b){this.inner().insert(a,b);this.e(a,b)},removeAt:function(a){var b=this.inner()[a];this.inner().removeAt(a);this.f(a,b)},item:function(b,a){if(arguments.length===2){this.inner()[b]=a;return a}else{return this.inner()[b]}},add:function(a){this.inner().add(a);this.e(this.inner().length-1,a)},clear:function(){this.inner().clear();this.g()},contains:function(a){return this.inner().contains(a)},copyTo:function(a,b){throw new $.ig.NotImplementedException},count:function(){return this.inner().length},isReadOnly:function(){return false},remove:function(a){var b=this.inner().indexOf(a);if(b>=0){this.inner().removeAt(b);this.f(b,a);return true}return false},d:function(){var $self=this;var $iter=function(){return function(){return{$state:0,$this:$self,$current:null,getEnumerator:function(){if(this.$state===-1){this.$state=0}return this},current:function(){return this.$current},moveNext:function(){do{switch(this.$state){case 0:this.$state=1;break;case 1:this.$a=0;this.$state=5;break;case 2:this.$current=this.$this.inner()[this.$a];this.$state=3;return true;case 3:this.$state=4;break;case 4:this.$a++;this.$state=5;break;case 5:if(this.$a<this.$this.inner().length){this.$state=2}else{this.$state=6}break;case 6:this.$state=-2;break;case-2:return false}}while(this.$state>0)}}}()};return new $.ig.GenericEnumerable$1(this.$t,$iter)},getEnumerator:function(){return this.d().getEnumerator()},e:function(a,b){if(this.collectionChanged!=null){var c=new $.ig.NotifyCollectionChangedEventArgs(1,$.ig.NotifyCollectionChangedAction.prototype.add,b,a);this.collectionChanged(this,c)}},f:function(a,b){if(this.collectionChanged!=null){var c=new $.ig.NotifyCollectionChangedEventArgs(1,$.ig.NotifyCollectionChangedAction.prototype.remove,b,a);this.collectionChanged(this,c)}},g:function(){if(this.collectionChanged!=null){var a=new $.ig.NotifyCollectionChangedEventArgs(1,$.ig.NotifyCollectionChangedAction.prototype.reset,null,-1);this.collectionChanged(this,a)}},$type:new $.ig.Type("ArrayListCollection$1",$.ig.Object.prototype.$type,[$.ig.IList$1.prototype.$type.specialize(0),$.ig.INotifyCollectionChanged.prototype.$type])},true);$.ig.util.defType("IOlapDataSource","Object",{$type:new $.ig.Type("IOlapDataSource",null)},true);$.ig.util.defType("MeasureList","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},$type:new $.ig.Type("MeasureList",$.ig.Object.prototype.$type,[$.ig.ICoreOlapElement.prototype.$type])},true);$.ig.util.defType("OlapMetadataTreeItem","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_item:null,item:function(a){if(arguments.length===1){this._item=a;return a}else{return this._item}},_type:null,type:function(a){if(arguments.length===1){this._type=a;return a}else{return this._type}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_children:null,children:function(a){if(arguments.length===1){this._children=a;return a}else{return this._children}},e:function(a){if(this.children()==null){this.children(new Array(1));this.children()[0]=a;return}var b=new Array(this.children().length+1);$.ig.Array.prototype.copy(this.children(),0,b,0,this.children().length);b[this.children().length]=a;this.children(b)},$type:new $.ig.Type("OlapMetadataTreeItem",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MetaTreeHelper","Object",{init:function(){$.ig.Object.prototype.init.call(this)},getDimensionMetaItems:function(a,b,c,d,e){var $self=this;var f=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);var g=new $.ig.HierarchyItemPosition;g.c(0);g.d(0);var h=new $.ig.List$1($.ig.Hierarchy.prototype.$type,0);var j=c.getEnumerator();while(j.moveNext()){var i=j.current();h.add(i)}var k=new $.ig.List$1($.ig.Level.prototype.$type,0);var m=d.getEnumerator();while(m.moveNext()){var l=m.current();k.add(l)}var o=a.getEnumerator();while(o.moveNext()){var n=o.current();var p=$.ig.MetaTreeHelper.prototype.l(h,k,n,g);if(n.dimensionType()!=$.ig.DimensionType.prototype.measure){var q=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.dimension);$ret.caption(n.caption());$ret.item(n);return $ret}();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(q,p);f.add(q)}else{var r=$.ig.MetaTreeHelper.prototype.n(b,n,e);f.insert(0,r)}}return f},setMetaItemChildren:function(a,b){var $self=this;if(b.count()>0){var e=b.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(c){return c.type()==$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(d){return d.caption()}).toArray$1($.ig.OlapMetadataTreeItem.prototype.$type);var g=b.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(f){return f.type()!=$.ig.OlapMetadataTreeItemType.prototype.group}).toArray$1($.ig.OlapMetadataTreeItem.prototype.$type);var h=new Array(e.length+g.length);for(var i=0;i<e.length;i++){h[i]=e[i]}for(var j=0;j<g.length;j++){h[e.length+j]=g[j]}a.children(h)}},l:function(a,b,c,d){var $self=this;var e=new $.ig.Dictionary$2(String,$.ig.Tuple$2.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type)),0);var f=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);var g=a.item(d.c());while(g.dimensionUniqueName()!=c.uniqueName()){d.c(d.c()+1);g=a.item(d.c())}while(g.dimensionUniqueName()==c.uniqueName()){var h=null;if(!String.isNullOrEmpty(g.hierarchyDisplayFolder())){var i=String.empty();var j=$.ig.MetaTreeHelper.prototype.o(g.hierarchyDisplayFolder());for(var k=0;k<j.length;k++){var l=j[k];i+=l+"\\";var m;if(!function(){var $ret=e.tryGetValue(i,m);m=$ret.value;return $ret.ret}()){var n=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.group);$ret.caption(l);return $ret}();m=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),n,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0));e.add(i,m);if(h!=null){h.d().add(n)}else{f.add(n)}}h=m}}var o;switch(g.hierarchyOrigin()){case $.ig.HierarchyOrigin.prototype.systemEnabled:o=$.ig.OlapMetadataTreeItemType.prototype.systemEnabledHierarchy;break;case $.ig.HierarchyOrigin.prototype.userDefined:o=$.ig.OlapMetadataTreeItemType.prototype.userDefinedHierarchy;break;default:o=$.ig.OlapMetadataTreeItemType.prototype.parentChildHierarchy;break}var p=$.ig.MetaTreeHelper.prototype.m(b,g,d);var q=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type(o);$ret.caption(g.caption());$ret.item(g);return $ret}();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(q,p);if(h!=null){h.d().add(q)}else{f.add(q)}if(d.c()+1>=a.count()){break}d.c(d.c()+1);g=a.item(d.c())}var s=e.values().getEnumerator();while(s.moveNext()){var r=s.current();var t=r.c();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(t,r.d())}return f},m:function(a,b,c){var $self=this;var d=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);if(a==null||a.count()==0){return d}var e=a.item(c.d());while(e.hierarchyUniqueName()!=b.uniqueName()){c.d(c.d()+1);e=a.item(c.d())}while(e.hierarchyUniqueName()==b.uniqueName()){var f;switch(e.depth()){case 0:case 1:f=$.ig.OlapMetadataTreeItemType.prototype.level1;break;case 2:f=$.ig.OlapMetadataTreeItemType.prototype.level2;break;case 3:f=$.ig.OlapMetadataTreeItemType.prototype.level3;break;case 4:f=$.ig.OlapMetadataTreeItemType.prototype.level4;break;default:f=$.ig.OlapMetadataTreeItemType.prototype.level5;break}var g=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type(f);$ret.caption(e.caption());$ret.item(e);return $ret}();d.add(g);if(c.d()+1>=a.count()){break}c.d(c.d()+1);e=a.item(c.d())}return d},n:function(a,b,c){var $self=this;var d=new $.ig.Dictionary$2(String,$.ig.Tuple$2.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type)),0);var e=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.measure);$ret.caption(b.caption());$ret.item(b);return $ret}();var f=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),e,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0));var h=a.getEnumerator();while(h.moveNext()){var g=h.current();var i=f;if(!String.isNullOrEmpty(g.measureGroupName())){if(!function(){var $ret=d.tryGetValue(g.measureGroupName(),i);i=$ret.value;return $ret.ret}()){var j=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.group);$ret.caption(g.measureGroupName());return $ret}();i=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),j,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0));d.add(g.measureGroupName(),i);f.d().add(i.c())}}var k=i;if(!String.isNullOrEmpty(g.measureDisplayFolder())){var l=g.measureGroupName();var m=$.ig.MetaTreeHelper.prototype.o(g.measureDisplayFolder());for(var n=0;n<m.length;n++){var o=m[n];l+="\\"+o;var p;if(!function(){var $ret=d.tryGetValue(l,p);p=$ret.value;return $ret.ret}()){var q=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.group);$ret.caption(o);return $ret}();p=new $.ig.Tuple$2($.ig.OlapMetadataTreeItem.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.OlapMetadataTreeItem.prototype.$type),q,new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0));d.add(l,p);k.d().add(q)}k=p}}var r=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.measure);$ret.caption(g.caption());$ret.item(g);return $ret}();k.d().add(r)}var s=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);var w=f.d().where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(t){return t.type()==$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(u){return u.caption()}).getEnumerator();while(w.moveNext()){var v=w.current();s.add(v)}var aa=f.d().where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(x){return x.type()!=$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(y){return y.caption()}).getEnumerator();while(aa.moveNext()){var z=aa.current();s.add(z)}$.ig.MetaTreeHelper.prototype.setMetaItemChildren(e,s);var ac=d.values().getEnumerator();while(ac.moveNext()){var ab=ac.current();var ad=ab.d();var ag=ad.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(ae){return ae.type()==$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(af){return af.caption()}).toList$1($.ig.OlapMetadataTreeItem.prototype.$type);var aj=ad.where$1($.ig.OlapMetadataTreeItem.prototype.$type,function(ah){return ah.type()!=$.ig.OlapMetadataTreeItemType.prototype.group}).orderBy$2($.ig.OlapMetadataTreeItem.prototype.$type,String,function(ai){return ai.caption()}).toList$1($.ig.OlapMetadataTreeItem.prototype.$type);var ak=new $.ig.List$1($.ig.OlapMetadataTreeItem.prototype.$type,0);for(var al=0;al<ag.count();al++){ak.add(ag.item(al))}for(var am=0;am<aj.count();am++){ak.add(aj.item(am))}var an=ab.c();$.ig.MetaTreeHelper.prototype.setMetaItemChildren(an,ak)}return e},o:function(a){var b=a.split("\\");return b},$type:new $.ig.Type("MetaTreeHelper",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyItemPosition","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},$type:new $.ig.Type("HierarchyItemPosition",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureGroupMetaItemsCache","Object",{a:null,b:null,c:null,d:null,e:null,init:function(a,b,c){$.ig.Object.prototype.init.call(this);this.a=new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Dimension.prototype.$type),0);this.b=new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Measure.prototype.$type),0);this.c=c;this.d=a;this.e=b},getMeasureGroupDimensions:function(a){var $self=this;var b;if(!function(){var $ret=$self.a.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){var c=new $.ig.List$1(String,0);var e=this.c.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d.dimensionUniqueName())}}var f=new $.ig.List$1($.ig.Dimension.prototype.$type,0);var h=this.d.getEnumerator();while(h.moveNext()){var g=h.current();if(c.contains(g.uniqueName())||g.dimensionType()==$.ig.DimensionType.prototype.measure){f.add(g)}}this.a.add(a,f);b=f}return b},getMeasureGroupMeasures:function(a){var $self=this;var b;if(!function(){var $ret=$self.b.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){var c=new $.ig.List$1($.ig.Measure.prototype.$type,0);var e=this.e.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d)}}this.b.add(a,c);b=c}return b},$type:new $.ig.Type("MeasureGroupMetaItemsCache",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DataSourceBaseOptions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},_filters:null,filters:function(a){if(arguments.length===1){this._filters=a;return a}else{return this._filters}},_columns:null,columns:function(a){if(arguments.length===1){this._columns=a;return a}else{return this._columns}},_rows:null,rows:function(a){if(arguments.length===1){this._rows=a;return a}else{return this._rows}},$type:new $.ig.Type("DataSourceBaseOptions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CubeMetaItemsCache","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.a=new $.ig.Dictionary$2(String,$.ig.Tuple$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.Member.prototype.$type),0);this.b=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Member.prototype.$type,0);this.c=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.Member.prototype.$type),0);this.d=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.Member.prototype.$type),0);this.e=new $.ig.Dictionary$2(String,$.ig.Measure.prototype.$type,0);this.f=new $.ig.Dictionary$2(String,$.ig.Boolean.prototype.$type,0);this.g=new $.ig.Dictionary$2(String,$.ig.Boolean.prototype.$type,0)},a:null,b:null,c:null,d:null,e:null,f:null,g:null,_n:null,n:function(a){if(arguments.length===1){this._n=a;return a}else{return this._n}},_o:null,o:function(a){if(arguments.length===1){this._o=a;return a}else{return this._o}},_p:null,p:function(a){if(arguments.length===1){this._p=a;return a}else{return this._p}},_q:null,q:function(a){if(arguments.length===1){this._q=a;return a}else{return this._q}},_r:null,r:function(a){if(arguments.length===1){this._r=a;return a}else{return this._r}},_s:null,s:function(a){if(arguments.length===1){this._s=a;return a}else{return this._s}},af:function(a){var $self=this;var b;if(!function(){var $ret=$self.f.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){return false}return b},ag:function(a){this.f.item(a,true)},ah:function(a){var $self=this;var b;if(!function(){var $ret=$self.g.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){return false}return b},ai:function(a){var $self=this;this.g.item(a,true);var d=this.q().where$1($.ig.Level.prototype.$type,function(b){return b.hierarchyUniqueName()==a}).getEnumerator();while(d.moveNext()){var c=d.current();this.ag(c.uniqueName())}},aj:function(a){return this.d.containsKey(a)},ak:function(a){var $self=this;var b;if(!function(){var $ret=$self.a.tryGetValue(a.uniqueName(),b);b=$ret.value;return $ret.ret}()){var c=this.a.count();b=new $.ig.Tuple$2($.ig.Number.prototype.$type,$.ig.Member.prototype.$type,c,a);this.a.item(a.uniqueName(),b);this.b.item(c,a);var d;if(!function(){var $ret=$self.c.tryGetValue(a.levelUniqueName(),d);d=$ret.value;return $ret.ret}()){d=new $.ig.ArrayListCollection$1($.ig.Member.prototype.$type);this.c.item(a.levelUniqueName(),d)}if(!String.isNullOrEmpty(a.parentUniqueName())){var e;if(!function(){var $ret=$self.d.tryGetValue(a.parentUniqueName(),e);e=$ret.value;return $ret.ret}()){e=new $.ig.List$1($.ig.Member.prototype.$type,0);this.d.item(a.parentUniqueName(),e)}e.add(a)}d.add(a)}return b.c()},al:function(a,b){var $self=this;var c;if(function(){var $ret=$self.a.tryGetValue(a,c);c=$ret.value;return $ret.ret}()){b=c.c();return{ret:true,memberOrdinal:b}}b=-1;return{ret:false,memberOrdinal:b};return{memberOrdinal:b}},am:function(a,b){var $self=this;var c;if(function(){var $ret=$self.a.tryGetValue(a,c);c=$ret.value;return $ret.ret}()){b=c.d();return{ret:true,member:b}}b=null;return{ret:false,member:b};return{member:b}},an:function(a,b){var $self=this;return{ret:function(){var $ret=$self.b.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),member:b};return{member:b}},ao:function(a,b){var $self=this;return{ret:function(){var $ret=$self.d.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),members:b};return{members:b}},ap:function(a,b){var $self=this;return{ret:function(){var $ret=$self.c.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),members:b};return{members:b}},aq:function(a,b){var $self=this;if(!function(){var $ret=$self.e.tryGetValue(a,b);b=$ret.value;return $ret.ret}()){b=this.n().where$1($.ig.Measure.prototype.$type,function(c){return c.uniqueName()==a}).firstOrDefault$1($.ig.Measure.prototype.$type);if(b==null){return{ret:false,measure:b}}this.e.add(a,b)}return{ret:true,measure:b};return{measure:b}},$type:new $.ig.Type("CubeMetaItemsCache",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AxisDefinitionParser","Object",{init:function(a){$.ig.Object.prototype.init.call(this);this.l(-1);this.m(a)},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},_k:null,k:function(a){if(arguments.length===1){this._k=a;return a}else{return this._k}},_l:null,l:function(a){if(arguments.length===1){this._l=a;return a}else{return this._l}},_m:null,m:function(a){if(arguments.length===1){this._m=a;return a}else{return this._m}},v:function(){if(this.l()==this.m().length-1){return false}var a=-1;var b=-1;var c=false;while(this.l()+1<this.m().length){this.l(this.l()+1);var d=this.m().substr(this.l(),1);switch(d){case $.ig.AxisDefinitionParser.prototype.a:if(a==-1){a=this.l()}break;case $.ig.AxisDefinitionParser.prototype.b:b=this.l();while(this.l()+1<this.m().length){d=this.m().substr(this.l()+1,1);switch(d){case $.ig.AxisDefinitionParser.prototype.b:b=this.l()+1;break;case $.ig.AxisDefinitionParser.prototype.e:if($.ig.AxisDefinitionParser.prototype.b==this.m().substr(this.l(),1)){c=true}break;case $.ig.AxisDefinitionParser.prototype.c:case $.ig.AxisDefinitionParser.prototype.d:c=true;break}if(c){break}this.l(this.l()+1)}c=true;break;case $.ig.AxisDefinitionParser.prototype.e:c=true;break;case $.ig.AxisDefinitionParser.prototype.c:this.j(true);break;case $.ig.AxisDefinitionParser.prototype.d:$.ig.Debug.prototype.c(this.j());c=true;this.j(false);break}if(c){c=false;if(a>-1&&b>-1){break}}}if(this.l()==this.m().length-1){if(b==-1||a==-1){return false}}var e=this.m().substr(a,b-a+1).trim();this.k(e);return true},w:function(){var a=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);var b=null;while(this.v()){if(!this.j()){b=new $.ig.ArrayListCollection$1(String);var c=new $.ig.AxisElement(this.k(),b);a.add(c)}else if(b!=null){b.add(this.k())}}return a},$type:new $.ig.Type("AxisDefinitionParser",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CoreOlapElementParser","Object",{init:function(a){$.ig.Object.prototype.init.call(this);
this.i(-1);this.j(a)},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_i:null,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},q:function(){if(this.i()==this.j().length-1){return false}var a=-1;var b=-1;var c=false;while(this.i()+1<this.j().length){this.i(this.i()+1);var d=this.j().substr(this.i(),1);switch(d){case $.ig.CoreOlapElementParser.prototype.a:if(a==-1){a=this.i()}break;case $.ig.CoreOlapElementParser.prototype.b:b=this.i();while(this.i()+1<this.j().length){d=this.j().substr(this.i()+1,1);switch(d){case $.ig.CoreOlapElementParser.prototype.b:b=this.i()+1;break;case $.ig.CoreOlapElementParser.prototype.c:c=true;break}if(c){break}this.i(this.i()+1)}break;case $.ig.CoreOlapElementParser.prototype.c:c=true;break}if(c){c=false;if(a>-1&&b>-1){break}}}if(this.i()==this.j().length-1){if(b==-1||a==-1){return false}}var e=this.j().substr(a,b-a+1).trim();this.h(e);return true},r:function(){var a=new $.ig.List$1(String,0);while(this.q()){a.add(this.h())}return a},$type:new $.ig.Type("CoreOlapElementParser",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AxisElement","Object",{init:function(a,b){$.ig.Object.prototype.init.call(this);this.name(a);this.memberNames(b)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_memberNames:null,memberNames:function(a){if(arguments.length===1){this._memberNames=a;return a}else{return this._memberNames}},$type:new $.ig.Type("AxisElement",$.ig.Object.prototype.$type)},true);$.ig.util.defType("KeyValueItem","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},$type:new $.ig.Type("KeyValueItem",$.ig.Object.prototype.$type)},true);$.ig.util.defType("PositionItemInfo$2","Dictionary$2",{$tKey:null,$tSortKey:null,init:function($tKey,$tSortKey,a,b,c,d){this.i=new $.ig.Dictionary$2(this.$tKey,$.ig.Object.prototype.$type,0);this.$tKey=$tKey;this.$tSortKey=$tSortKey;this.$type=this.$type.specialize(this.$tKey,this.$tSortKey);$.ig.Dictionary$2.prototype.init.call(this,this.$tKey,$.ig.PositionItemInfo$2.prototype.$type.specialize(this.$tKey,this.$tSortKey));this.positionItem(a);this.positionIndex(b);this.positionItemIndex(c);this.positionItemDepth(0);this.positionItemDepthMin(-1);this.positionItemDepthMax($.ig.Number.prototype.MAX_VALUE);this.positionSize(d);if(a!=null){this.positionItemDepth(this.positionItem().depth());this.key(this.positionItem().key());this.parentKey(this.positionItem().parentKey());this.hierarchyKey(this.positionItem().hierarchyKey());this.hierarchyLevelKey(this.positionItem().hierarchyLevelKey());this.sortKey(this.positionItem().sortKey());this.caption(this.positionItem().caption())}},y:function(a,b,c,d){return new $.ig.PositionItemInfo$2(this.$tKey,this.$tSortKey,a,b,c,d)},_positionItemDepthMin:null,positionItemDepthMin:function(a){if(arguments.length===1){this._positionItemDepthMin=a;return a}else{return this._positionItemDepthMin}},_positionItemDepthMax:null,positionItemDepthMax:function(a){if(arguments.length===1){this._positionItemDepthMax=a;return a}else{return this._positionItemDepthMax}},_positionItem:null,positionItem:function(a){if(arguments.length===1){this._positionItem=a;return a}else{return this._positionItem}},_positionIndex:null,positionIndex:function(a){if(arguments.length===1){this._positionIndex=a;return a}else{return this._positionIndex}},_positionItemDepth:null,positionItemDepth:function(a){if(arguments.length===1){this._positionItemDepth=a;return a}else{return this._positionItemDepth}},_positionItemIndex:null,positionItemIndex:function(a){if(arguments.length===1){this._positionItemIndex=a;return a}else{return this._positionItemIndex}},_positionSize:null,positionSize:function(a){if(arguments.length===1){this._positionSize=a;return a}else{return this._positionSize}},_key:null,key:function(a){if(arguments.length===1){this._key=a;return a}else{return this._key}},_parentKey:null,parentKey:function(a){if(arguments.length===1){this._parentKey=a;return a}else{return this._parentKey}},_hierarchyKey:null,hierarchyKey:function(a){if(arguments.length===1){this._hierarchyKey=a;return a}else{return this._hierarchyKey}},_hierarchyLevelKey:null,hierarchyLevelKey:function(a){if(arguments.length===1){this._hierarchyLevelKey=a;return a}else{return this._hierarchyLevelKey}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_sortKey:null,sortKey:function(a){if(arguments.length===1){this._sortKey=a;return a}else{return this._sortKey}},_isExpandable:null,isExpandable:function(a){if(arguments.length===1){this._isExpandable=a;return a}else{return this._isExpandable}},_isExpanded:null,isExpanded:function(a){if(arguments.length===1){this._isExpanded=a;return a}else{return this._isExpanded}},am:function(a,b,c){var d=false;if(this.positionItemIndex()==-1){d=true}else{if(c!=null){if(a.item(this.positionItemIndex()).key()!=null){var e=c.item(this.positionItemIndex());d=a.item(this.positionItemIndex()).key().equals(e.key())}}}if(this.positionItemIndex()+1==this.positionSize()){return d}var f=this.ao(a,b,this.positionItemIndex()+1,c);return d&&f},an:function(a,b){},i:null,ao:function(a,b,c,d){var $self=this;var e;var f=a.item(c);if(!this.containsKey(f.key())){var g=this.y(f,b,c,this.positionSize());g.isExpandable(f.isExpandable());if(this.i.containsKey(g.key())){this.i.remove(g.key());g.isExpanded(true)}if(f.parentKey()!=null){var h=null;if(function(){var $ret=$self.tryGetValue(f.parentKey(),h);h=$ret.value;return $ret.ret}()){h.isExpanded(true)}else{if(!this.i.containsKey(f.parentKey())){this.i.add(f.parentKey(),null)}}}e=g.am(a,b,d);this.add(f.key(),g);if(this.positionItemDepthMin()==-1){this.positionItemDepthMin(f.depth())}else{this.positionItemDepthMin(Math.min(this.positionItemDepthMin(),f.depth()))}if(this.positionItemDepthMax()==$.ig.Number.prototype.MAX_VALUE){this.positionItemDepthMax(f.depth())}else{this.positionItemDepthMax(Math.max(this.positionItemDepthMax(),f.depth()))}this.an(a,g)}else{var i=this.item(f.key());e=i.am(a,b,d)}return e},getIndex:function(a){var b=new Array(a.count());for(var c=0;c<b.length;c++){b[c]=a.item(c).key()}return this.getIndex1(b)},getIndex1:function(a){return this.ap(a,a.length)},ap:function(a,b){var $self=this;if(this.positionItemIndex()==b-1){return this.positionIndex()}var c;if(!function(){var $ret=$self.tryGetValue(a[$self.positionItemIndex()+1],c);c=$ret.value;return $ret.ret}()){return-1}if(c.count()==0){return c.positionIndex()}return c.ap(a,b)},$type:new $.ig.Type("PositionItemInfo$2",$.ig.Dictionary$2.prototype.$type.specialize(0,$.ig.PositionItemInfo$2.prototype.$type.specialize(0,1)))},true);$.ig.util.defType("PositionResolver$2","Object",{$tKey:null,$tSortKey:null,a:null,b:null,c:null,d:null,init:function($tKey,$tSortKey,a,b){this.a=0;this.$tKey=$tKey;this.$tSortKey=$tSortKey;this.$type=this.$type.specialize(this.$tKey,this.$tSortKey);$.ig.Object.prototype.init.call(this);this.positions(a.toList$1($.ig.IPosition$2.prototype.$type));this.positionSize(b)},getPositionIndexCompleted:null,_positions:null,positions:function(a){if(arguments.length===1){this._positions=a;return a}else{return this._positions}},_positionSize:null,positionSize:function(a){if(arguments.length===1){this._positionSize=a;return a}else{return this._positionSize}},rootPositionInfo:function(){if(this.b==null){this.b=this.m(this.positionSize())}return this.b},m:function(a){return new $.ig.PositionItemInfo$2(this.$tKey,this.$tSortKey,null,-1,-1,a)},hasUnregisterdPositions:function(){return this.a<this.positions().count()},completeRegisterPositions:function(){if(this.hasUnregisterdPositions()){this.r(null)}},resolveParentPositionItem:function(a,b){b=-1;var c=$.ig.util.cast($.ig.IHierarchicalPositionItem$2.prototype.$type.specialize(this.$tKey,this.$tSortKey),a);if(c==null||c.parentKey()==null){return{ret:null,parentPositionIndex:b}}var d=c.position().indexOf(c);var e=new Array(c.position().itemsCount());for(var f=0;f<c.position().itemsCount();f++){e[f]=c.position().item(f).key()}e[d]=c.parentKey();b=this.rootPositionInfo().getIndex1(e);if(b==-1){return{ret:null,parentPositionIndex:b}}var g=this.positions().__inner[b];var h=g.item(d);return{ret:h,parentPositionIndex:b};return{parentPositionIndex:b}},getHostPositionItemInfo:function(a,b){var $self=this;var c=this.rootPositionInfo();var d=a.item(b);for(var e=0;e<b;e++){var f;if(function(){var $ret=c.tryGetValue(a.item(e).key(),f);f=$ret.value;return $ret.ret}()){c=f}else{c=null;break}}if(c==null){return null}if(!c.containsKey(d.key())){return null}return c},n:function(a,b){var $self=this;if(this.rootPositionInfo().count()==0){return null}var c=this.rootPositionInfo();var d=a.position().indexOf(a);for(var e=0;e<d;e++){var f;if(function(){var $ret=c.tryGetValue(a.position().item(e).key(),f);f=$ret.value;return $ret.ret}()){c=f}else{c=null;break}}if(c==null){return null}if(!c.containsKey(a.key())){return null}var g=new $.ig.List$1($.ig.Number.prototype.$type,0);this.o(a.key(),c,g);if(b==$.ig.ListSortDirection.prototype.descending){g.t(function(h,i){if(h==i){return 0}if(h>i){return-1}return 1});return g}g.t(function(j,k){if(j==k){return 0}if(j>k){return 1}return-1});return g},o:function(a,b,c){var $self=this;var f=b.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(d){return a.equals(d.parentKey())}).getEnumerator();while(f.moveNext()){var e=f.current();if(e.count()==0){c.add(e.positionIndex())}else{this.p(e,c)}if(!e.isExpanded()){continue}if(e.positionItemDepth()<b.positionItemDepthMax()){this.o(e.key(),b,c)}}},p:function(a,b){var $self=this;var e=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(c){return c.parentKey()==null}).getEnumerator();while(e.moveNext()){var d=e.current();if(d.count()==0){b.add(d.positionIndex())}else{this.p(d,b)}if(!d.isExpanded()){continue}if(d.positionItemDepth()<a.positionItemDepthMax()){this.o(d.key(),a,b)}}},getChildren:function(a,b){var $self=this;if(this.hasUnregisterdPositions()){this.completeRegisterPositions()}var c=this.getHostPositionItemInfo(a,b);var d=a.item(b);return c.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(e){return d.key().equals(e.parentKey())})},isMemberExpanded:function(a){var $self=this;if(this.hasUnregisterdPositions()){this.completeRegisterPositions()}var b=this.getPositionIndex(a.position());if(b==-1||this.rootPositionInfo().count()==0){return null}var c=a.position().indexOf(a);var d=this.rootPositionInfo();for(var e=0;e<c;e++){var f;if(function(){var $ret=d.tryGetValue(a.position().item(e).key(),f);f=$ret.value;return $ret.ret}()){d=f}else{d=null;break}}if(d==null){return null}if(!d.containsKey(a.key())){return null}var g=null;var h=d.values().getEnumerator();while(h.moveNext()){if(a.key().equals(h.current().parentKey())){g=h.current();break}}return g!=null},getPositionIndex:function(a){if(a==null){return-1}if(a.itemsCount()!=this.positionSize()){return-1}if(a.isEmpty()&&this.positions().count()==1&&this.positions().__inner[0].isEmpty()){return 0}if(this.a>0){var b=this.q(a);if(b>-1){return b}if(this.a==this.positions().count()){return-1}}return this.r(a)},q:function(a){if(a.isEmpty()&&this.positions().count()==1&&this.positions().__inner[0].isEmpty()){return 0}return this.rootPositionInfo().getIndex(a.getItems().toList$1($.ig.IPositionItem$2.prototype.$type))},r:function(a){var b=a==null;var c=-1;for(var d=this.a;d<this.positions().count();d++){var e=this.positions().__inner[d];var f=this.rootPositionInfo().am(e,d,a);this.a++;if(c==-1&&f){c=d;if(!b){break}}}return c},$type:new $.ig.Type("PositionResolver$2",$.ig.Object.prototype.$type)},true);$.ig.util.defType("LevelSortDirection","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.sortBehavior($.ig.LevelSortBehavior.prototype.system)},_levelUniqueName:null,levelUniqueName:function(a){if(arguments.length===1){this._levelUniqueName=a;return a}else{return this._levelUniqueName}},_sortDirection:null,sortDirection:function(a){if(arguments.length===1){this._sortDirection=a;return a}else{return this._sortDirection}},_sortBehavior:null,sortBehavior:function(a){if(arguments.length===1){this._sortBehavior=a;return a}else{return this._sortBehavior}},$type:new $.ig.Type("LevelSortDirection",$.ig.Object.prototype.$type)},true);$.ig.util.defType("TaskExtensions","Object",{init:function(){$.ig.Object.prototype.init.call(this)},continueWithTask$1:function($tResult,b){var $self=this;var c=new $.ig.TaskCompletionSource$1($tResult,0);this.t(function(d){var $self=$self;if(d.h()==null){try{b(d).t(function(e){if(e.h()==null){c.i(e.aa());return}c.h(e.h())})}catch(e_){var f;f=e_;c.h(f)}}else{c.h(d.h())}});return c.d()},continueWithTask$21:function($tResult1,$tResult2,b){var $self=this;return this.continueWithTask$1($tResult2,function(c){return b(c)})},$type:new $.ig.Type("TaskExtensions",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyFilterView","Object",{a:null,b:null,c:null,init:function(a){this.c=new $.ig.Dictionary$2(String,$.ig.FilterMember.prototype.$type,0);$.ig.Object.prototype.init.call(this);this.hierarchy(a);this.b=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.FilterMember.prototype.$type),0);this.a=new $.ig.Dictionary$2(String,$.ig.FilterMember.prototype.$type,0)},filterMemberExpansionChanged:null,filterMemberSelectionChanged:null,_hierarchy:null,hierarchy:function(a){if(arguments.length===1){this._hierarchy=a;return a}else{return this._hierarchy}},addFiltersForMembers:function(a){var c=a.getEnumerator();while(c.moveNext()){var b=c.current();this.addFilterForMember(b)}},addFilterForMember:function(a){var $self=this;if(!this.a.containsKey(a.uniqueName())){var b=new $.ig.FilterMember(a);b.propertyChanged=$.ig.Delegate.prototype.combine(b.propertyChanged,this.i.runOn(this));b.selectionChanged=$.ig.Delegate.prototype.combine(b.selectionChanged,this.h.runOn(this));var c;if(!function(){var $ret=$self.b.tryGetValue(a.levelDepth(),c);c=$ret.value;return $ret.ret}()){c=new $.ig.List$1($.ig.FilterMember.prototype.$type,0);this.b.add(a.levelDepth(),c)}this.a.add(a.uniqueName(),b);this.c.add(a.uniqueName(),b);c.add(b);this.l(b);this.k(b)}},tryGetFilterMember:function(a,b){var $self=this;return{ret:function(){var $ret=$self.a.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),filterMember:b};return{filterMember:b}},getRootFilterMembers:function(){var a=-1;var c=this.b.keys().getEnumerator();while(c.moveNext()){var b=c.current();if(a==-1){a=b}else{a=Math.min(b,a)}}if(a==-1){return null}return this.b.item(a)},getSelectedFilterItems:function(){var a=this.getRootFilterMembers();var b=new $.ig.List$1($.ig.FilterMember.prototype.$type,0);var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();if(d.isSelected().hasValue()==true&&d.isSelected().value()==true){c++}}if(c==a.count()){return b}var g=a.getEnumerator();while(g.moveNext()){var f=g.current();if(f.isSelected().hasValue()==false){this.j(f,b)}else if(f.isSelected().hasValue()==true&&f.isSelected().value()==true){b.add(f)}}return b},h:function(a,b){if(this.filterMemberSelectionChanged!=null){this.filterMemberSelectionChanged(this,new $.ig.FilterMemberStateChangedEventArgs(a))}},i:function(a,b){if(b.propertyName()=="IsExpanded"){if(this.filterMemberExpansionChanged!=null){this.filterMemberExpansionChanged(this,new $.ig.FilterMemberStateChangedEventArgs(a))}}},j:function(a,b){if(a.isSelected().hasValue()==true&&a.isSelected().value()==true){b.add(a)}else{if(a.children()==null){return}var d=a.children().getEnumerator();while(d.moveNext()){var c=d.current();this.j(c,b)}}},k:function(a){var $self=this;var b=a.member().parentUniqueName();if(String.isNullOrEmpty(b)){return}var c;if(function(){var $ret=$self.a.tryGetValue(b,c);c=$ret.value;return $ret.ret}()){c.s(a);if(c.isSelected().hasValue()==true&&c.isSelected().value()==false){a.isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,false))}}},l:function(a){var $self=this;var b=a.member().levelDepth();var c;if(function(){var $ret=$self.b.tryGetValue(b+1,c);c=$ret.value;return $ret.ret}()){var e=c.getEnumerator();while(e.moveNext()){var d=e.current();if(d.member().parentUniqueName()==a.member().uniqueName()){a.s(d)}}}},$type:new $.ig.Type("HierarchyFilterView",$.ig.Object.prototype.$type)},true);$.ig.util.defType("FilterMember","Object",{a:null,b:null,c:null,d:null,init:function(a){this.c=false;this.d=false;$.ig.Object.prototype.init.call(this);this.a=$.ig.util.toNullable($.ig.Boolean.prototype.$type,true);this.member(a);this.l(0);this.m(0)},selectionChanged:null,propertyChanged:null,_parent:null,parent:function(a){if(arguments.length===1){this._parent=a;return a}else{return this._parent}},_member:null,member:function(a){if(arguments.length===1){this._member=a;return a}else{return this._member}},isExpandable:function(){return this.member().childrenCardinality()>0},isExpanded:function(a){if(arguments.length===1){if(this.b!=a){this.b=a;this.x("IsExpanded")}return a}else{return this.b}},isSelected:function(a){if(arguments.length===1){var b=$.ig.util.toNullable($.ig.Boolean.prototype.$type,a);if($.ig.util.nullableEquals($.ig.util.nullableEquals(this.a,b),false)){var c=$.ig.util.toNullable($.ig.Boolean.prototype.$type,this.a);this.a=$.ig.util.toNullable($.ig.Boolean.prototype.$type,a);if(!this.d){if(this.a.hasValue()==true){if(this.children()!=null){var e=this.children().getEnumerator();while(e.moveNext()){var d=e.current();d.c=true;d.isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,this.a));d.c=false}}}}if(this.parent()!=null){if(c.hasValue()==true&&c.value()==false){if(this.a.hasValue()==false){this.q(true)}this.p(false)}else if(c.hasValue()==false){if(this.a.hasValue()==true&&this.a.value()==false){this.p(true)}this.q(false)}else{if(this.a.hasValue()==true&&this.a.value()==false){this.p(true)}else if(this.a.hasValue()==false){this.q(true)}}if(!this.c){this.parent().d=true;var f=this.parent().l();var g=this.parent().m();var h=this.parent().children().count();if(g==0){if(f==0){this.parent().isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,true))}else if(f==h){this.parent().isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,false))}else{this.parent().isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,null))}}else{this.parent().isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,null))}this.parent().d=false}}this.x("IsSelected");if(!this.c&&!this.d){if(this.selectionChanged!=null){this.selectionChanged(this,$.ig.EventArgs.prototype.empty)}}}return a}else{return this.a}},p:function(a){if(a){this.parent().l(this.parent().l()+1)}else{this.parent().l(this.parent().l()-1)}},q:function(a){if(a){this.parent().m(this.parent().m()+1)}else{this.parent().m(this.parent().m()-1)}},_children:null,children:function(a){if(arguments.length===1){this._children=a;return a}else{return this._children}},s:function(a){if(this.children()==null){this.children(new $.ig.List$1($.ig.FilterMember.prototype.$type,0))}a.parent(this);this.children().add(a);this.x("Children")},_l:null,l:function(a){if(arguments.length===1){this._l=a;return a}else{return this._l}},_m:null,m:function(a){if(arguments.length===1){this._m=a;return a}else{return this._m}},x:function(a){if(this.propertyChanged!=null){this.propertyChanged(this,new $.ig.PropertyChangedEventArgs(a))}},$type:new $.ig.Type("FilterMember",$.ig.Object.prototype.$type,[$.ig.INotifyPropertyChanged.prototype.$type])},true);$.ig.util.defType("FilterMemberStateChangedEventArgs","EventArgs",{init:function(a){$.ig.EventArgs.prototype.init.call(this);this.filterMember(a)},_filterMember:null,filterMember:function(a){if(arguments.length===1){this._filterMember=a;return a}else{return this._filterMember}},$type:new $.ig.Type("FilterMemberStateChangedEventArgs",$.ig.EventArgs.prototype.$type)},true);$.ig.util.defType("ResultSorter$1","Object",{$t:null,_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},init:function($t,a,b,c){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.d(a);this.e(b);this.f(c)},m:function(){},n:function(a,b,c){a.i();var d=a.d();var e=new Array(d.count());for(var f=0;f<d.count();f++){var g=d.item(f);c.add(g,f)}for(var h=0;h<d.count();h++){var i=d.item(h);var j=b.tuples().__inner[i];e[h]=j}return new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,1,e)},$type:new $.ig.Type("ResultSorter$1",$.ig.Object.prototype.$type)},true);$.ig.util.defType("ResultHeaderSorter","ResultSorter$1",{o:null,_r:null,r:function(a){if(arguments.length===1){this._r=a;return a}else{return this._r}},_s:null,s:function(a){if(arguments.length===1){this._s=a;return a}else{return this._s}},init:function(a,b,c,d){$.ig.ResultSorter$1.prototype.init.call(this,$.ig.AxisHeaderSortingVisitor.prototype.$type,a,b,c);this.o=new $.ig.Dictionary$2(String,$.ig.LevelSortDirection.prototype.$type,1,d.count());var f=d.getEnumerator();while(f.moveNext()){var e=f.current();this.o.item(e.levelUniqueName(),e)}},m:function(){var $self=this;this.r(new $.ig.List$1($.ig.LevelSortDirection.prototype.$type,0));this.s(new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type)),0));if(this.d().isEmpty()){return this.d()}var a=new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0);var b=0;var c=1;var d=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var e=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);if(this.f()){var f=this.d().axes().item(b);var g=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type),0);var h=new $.ig.AxisHeaderSortingVisitor(f,this.o,this.r(),g);var i=this.n(h,f,d);var j=function(){var $ret=new $.ig.OlapResultAxis(i,f.tupleSize());$ret.name(f.name());return $ret}();a.add(j);this.s().item(f.name(),g);c=f.tuples().count();b++}if(this.e()){var k=this.d().axes().item(b);var l=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type),0);var m=new $.ig.AxisHeaderSortingVisitor(k,this.o,this.r(),l);var n=this.n(m,k,e);var o=function(){var $ret=new $.ig.OlapResultAxis(n,k.tupleSize());$ret.name(k.name());return $ret}();a.add(o);this.s().item(k.name(),l)}var p=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,2,this.d().cells().count());var r=this.d().cells().getEnumerator();while(r.moveNext()){var q=r.current();var s=q.clone();var t=s.cellOrdinal();if(this.f()){var u=t%c;var v=d.item(u);if(u!=v){var w=$.ig.intDivide(t,c);t=w*c+v}}if(this.e()){var x=$.ig.intDivide(t,c);var y=e.item(x);if(x!=y){var z=t%c;t=y*c+z}}s.cellOrdinal(t);p.add(s)}var aa=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty($self.d().isEmpty());$ret.axes(a);$ret.cells(p);return $ret}();return aa},$type:new $.ig.Type("ResultHeaderSorter",$.ig.ResultSorter$1.prototype.$type.specialize($.ig.AxisHeaderSortingVisitor.prototype.$type))},true);$.ig.util.defType("AxisTupleVisitor","Object",{_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},init:function(a){$.ig.Object.prototype.init.call(this);this.c(a)},i:function(){var $self=this;if(this.c().positionResolver().hasUnregisterdPositions()){this.c().positionResolver().completeRegisterPositions()}this.d(new $.ig.List$1($.ig.Number.prototype.$type,2,this.c().tuples().count()));var a=this.c().positionResolver().rootPositionInfo();var c=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(b){return b.positionItemDepth()==a.positionItemDepthMin()});var e=this.k(a,c).getEnumerator();while(e.moveNext()){var d=e.current();this.l(a,d)}},j:function(a,b){},k:function(a,b){},l:function(a,b){var $self=this;var d=b.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(c){return c.positionItemDepth()==b.positionItemDepthMin()});if(d.count$1($.ig.PositionItemInfo$2.prototype.$type)>0){var f=d.getEnumerator();while(f.moveNext()){var e=f.current();this.l(b,e)}}else{this.d().add(b.positionIndex())}var g=this.j(a,b);var i=g.getEnumerator();while(i.moveNext()){var h=i.current();this.l(a,h)}},$type:new $.ig.Type("AxisTupleVisitor",$.ig.Object.prototype.$type)},true);$.ig.util.defType("AxisHeaderSortingVisitor","AxisTupleVisitor",{m:null,n:null,o:null,init:function(a,b,c,d){$.ig.AxisTupleVisitor.prototype.init.call(this,a);this.m=b;this.n=c;this.o=d},j:function(a,b){var $self=this;var d=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(c){return c.parentKey()==b.key()}).toList$1($.ig.PositionItemInfo$2.prototype.$type);if(d.count()>0){var e=d.item(0);var f;if(function(){var $ret=$self.m.tryGetValue(e.hierarchyLevelKey(),f);f=$ret.value;return $ret.ret}()){if(f.sortBehavior()==$.ig.LevelSortBehavior.prototype.system){d=f.sortDirection()==$.ig.ListSortDirection.prototype.ascending?d.orderBy$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(g){return g.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type):d.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(h){return h.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type)}else{d=f.sortDirection()==$.ig.ListSortDirection.prototype.ascending?d.orderBy$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(i){return i.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type):d.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(j){return j.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type)}if(!this.n.select$2($.ig.LevelSortDirection.prototype.$type,String,function(k){return k.levelUniqueName()}).contains$1(String,f.levelUniqueName())){this.n.add(f)}var l;if(!function(){var $ret=$self.o.tryGetValue(e.positionItemIndex(),l);l=$ret.value;return $ret.ret}()){l=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type,0);this.o.add(b.positionItemIndex(),l)}l.item(b.positionItemDepth(),f.sortDirection())}}return d},k:function(a,b){var $self=this;var c=b.toList$1($.ig.PositionItemInfo$2.prototype.$type);if(c.count()>0){var d=c.item(0);var e;if(d.hierarchyLevelKey()!=null&&function(){var $ret=$self.m.tryGetValue(d.hierarchyLevelKey(),e);e=$ret.value;return $ret.ret}()){if(e.sortBehavior()==$.ig.LevelSortBehavior.prototype.system){c=e.sortDirection()==$.ig.ListSortDirection.prototype.ascending?c.orderBy$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(f){return f.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type):c.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(g){return g.sortKey()}).toList$1($.ig.PositionItemInfo$2.prototype.$type)}else{c=e.sortDirection()==$.ig.ListSortDirection.prototype.ascending?c.orderBy$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(h){return h.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type):c.orderByDescending$2($.ig.PositionItemInfo$2.prototype.$type,$.ig.Object.prototype.$type,function(i){return i.caption()}).toList$1($.ig.PositionItemInfo$2.prototype.$type)}this.n.add(e);var j;if(!function(){var $ret=$self.o.tryGetValue(d.positionItemIndex(),j);j=$ret.value;return $ret.ret}()){j=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.ListSortDirection.prototype.$type,0);this.o.add(a.positionItemIndex(),j)}j.item(a.positionItemDepth(),e.sortDirection())}}return c},$type:new $.ig.Type("AxisHeaderSortingVisitor",$.ig.AxisTupleVisitor.prototype.$type)},true);$.ig.util.defType("ResultColumnValueSorter","ResultSorter$1",{o:null,_q:null,q:function(a){if(arguments.length===1){this._q=a;return a}else{return this._q}},init:function(a,b,c,d){$.ig.ResultSorter$1.prototype.init.call(this,$.ig.AxisValueSortingVisitor.prototype.$type,a,b,c);this.o=d},m:function(){var $self=this;this.q(new $.ig.List$1($.ig.TupleSortDirection.prototype.$type,0));if(!this.e()||this.d().isEmpty()){return this.d()}var a=new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0);var b=0;var c=null;var d=1;if(this.f()){c=this.d().axes().item(b);d=c.tuples().count();a.add(c.clone());b++}var e=this.d().axes().item(b);var f=this.d().axes().item(b).tuples().count();var g=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Object.prototype.$type,1,this.d().cells().count());var i=this.d().cells().getEnumerator();while(i.moveNext()){var h=i.current();g.item(h.cellOrdinal(),h.properties().item("Value"))}var j=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize($.ig.TupleSortDirection.prototype.$type,$.ig.Array.prototype.$type),2,this.o.count());var l=this.o.getEnumerator();while(l.moveNext()){var k=l.current();var m;if(c!=null&&k.memberNames()!=null){if(c.positionResolver().hasUnregisterdPositions()){c.positionResolver().completeRegisterPositions()}m=c.positionResolver().rootPositionInfo().getIndex1(k.memberNames());k.tupleIndex(m)}else{m=k.tupleIndex()}if(m>-1&&m<d){var n=new Array(f);for(var o=0;o<f;o++){var p=null;(function(){var $ret=g.tryGetValue(o*d+m,p);p=$ret.value;return $ret.ret})();n[o]=p}j.add(new $.ig.KeyValuePair$2($.ig.TupleSortDirection.prototype.$type,$.ig.Array.prototype.$type,k,n));this.q().add(k)}}var q=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.Number.prototype.$type,0);var r=new $.ig.AxisValueSortingVisitor(e,j);var s=this.n(r,e,q);var t=function(){var $ret=new $.ig.OlapResultAxis(s,e.tupleSize());$ret.name(e.name());return $ret}();a.add(t);var u=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,2,this.d().cells().count());var w=this.d().cells().getEnumerator();while(w.moveNext()){var v=w.current();var x=v.clone();var y=x.cellOrdinal();var z=$.ig.intDivide(y,d);var aa=q.item(z);if(z!=aa){var ab=y%d;y=aa*d+ab}x.cellOrdinal(y);u.add(x)}var ac=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty($self.d().isEmpty());$ret.axes(a);$ret.cells(u);return $ret}();return ac},$type:new $.ig.Type("ResultColumnValueSorter",$.ig.ResultSorter$1.prototype.$type.specialize($.ig.AxisValueSortingVisitor.prototype.$type))},true);$.ig.util.defType("AxisValueSortingVisitor","AxisTupleVisitor",{m:null,init:function(a,b){$.ig.AxisTupleVisitor.prototype.init.call(this,a);this.m=b},j:function(a,b){var $self=this;var d=a.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(c){return c.parentKey()==b.key()});return this.k(a,d)},k:function(a,b){var positionItemInfos_=b.toArray$1($.ig.PositionItemInfo$2.prototype.$type);if(positionItemInfos_.length>0){var tupleSortDirections_=this.m.toArray$1($.ig.PositionItemInfo$2.prototype.$type);var sortFunction=function(tupleSortDirections){var compareCells=function(comparer,cell1,cell2){var result=comparer(cell1,cell2);if(result<0){return-1}if(result>0){return 1}return!isNaN(parseFloat(result))&&isFinite(result)?result:0};return function(o1,o2){var i,length,tupleSortDirection,cells,direction,cell1,cell2,arr1=[],arr2=[];for(i=0;i<tupleSortDirections.length;i++){tupleSortDirection=tupleSortDirections[i].key();cells=tupleSortDirections[i].value();if(tupleSortDirection.sortDirection()===$.ig.ListSortDirection.prototype.ascending){direction=1}else{direction=-1}comparer=tupleSortDirection.comparer();cell1=cells[o1.positionIndex()];
cell2=cells[o2.positionIndex()];if(tupleSortDirections.length===1){arr1=direction*compareCells(comparer,cell1,cell2);arr2=direction*compareCells(comparer,cell2,cell1)}else{arr1.push(direction*compareCells(comparer,cell1,cell2));arr2.push(direction*compareCells(comparer,cell2,cell1))}}if(arr1<arr2){return-1}if(arr1>arr2){return 1}return 0}};positionItemInfos_.sort(sortFunction(tupleSortDirections_))}return positionItemInfos_},$type:new $.ig.Type("AxisValueSortingVisitor",$.ig.AxisTupleVisitor.prototype.$type)},true);$.ig.util.defType("TupleSortDirection","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_tupleIndex:null,tupleIndex:function(a){if(arguments.length===1){this._tupleIndex=a;return a}else{return this._tupleIndex}},_memberNames:null,memberNames:function(a){if(arguments.length===1){this._memberNames=a;return a}else{return this._memberNames}},_sortDirection:null,sortDirection:function(a){if(arguments.length===1){this._sortDirection=a;return a}else{return this._sortDirection}},_comparer:null,comparer:function(a){if(arguments.length===1){this._comparer=a;return a}else{return this._comparer}},$type:new $.ig.Type("TupleSortDirection",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DataSourceBase","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_dataSource:null,dataSource:function(a){if(arguments.length===1){this._dataSource=a;return a}else{return this._dataSource}},isInitialized:function(){if(this.dataSource()==null){return false}return this.dataSource().isInitialized()},_isModified:null,isModified:function(a){if(arguments.length===1){this._isModified=a;return a}else{return this._isModified}},_isUpdating:null,isUpdating:function(a){if(arguments.length===1){this._isUpdating=a;return a}else{return this._isUpdating}},initialize:function(){var promise_=this.dataSource().initialize().f();var $this=this;if(!this._isInitializedAttached){this._isInitializedAttached=true;promise_.always(function(result){var args={error:null,metadataTreeRoot:null};if(this.state()==="rejected"){args.error=result}else{args.metadataTreeRoot=result}$($this).trigger("initialized",args);$this._isInitializedAttached=false})}return promise_},cubes:function(){return this.dataSource().cubes().inner()},cube:function(){return this.dataSource().cube()},setCube:function(a){var $self=this;return this.dataSource().setCube(a).ae($.ig.OlapMetadataTreeItem.prototype.$type,function(b){return b.aa()}).f()},metadataTree:function(){return this.dataSource().metadataTree()},addRowItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().rowAxis().add(a);this.isModified(true)}},insertRowItem:function(a,b){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,b)!==null){this.dataSource().rowAxis().insert(a,b);this.isModified(true)}},removeRowItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null||$.ig.util.cast($.ig.MeasureList.prototype.$type,a)!==null){this.dataSource().rowAxis().remove(a);this.isModified(true)}},addColumnItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().columnAxis().add(a);this.isModified(true)}},insertColumnItem:function(a,b){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,b)!==null){this.dataSource().columnAxis().insert(a,b);this.isModified(true)}},removeColumnItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null||$.ig.util.cast($.ig.MeasureList.prototype.$type,a)!==null){this.dataSource().columnAxis().remove(a);this.isModified(true)}},addFilterItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().filters().add(a);this.isModified(true)}},insertFilterItem:function(a,b){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,b)!==null){this.dataSource().filters().insert(a,b);this.isModified(true)}},removeFilterItem:function(a){if($.ig.util.cast($.ig.Hierarchy.prototype.$type,a)!==null){this.dataSource().filters().remove(a);this.isModified(true)}},addMeasureItem:function(a){if($.ig.util.cast($.ig.Measure.prototype.$type,a)!==null){this.dataSource().measures().add(a);this.isModified(true)}},insertMeasureItem:function(a,b){if($.ig.util.cast($.ig.Measure.prototype.$type,b)!==null){this.dataSource().measures().insert(a,b);this.isModified(true)}},removeMeasureItem:function(a){if($.ig.util.cast($.ig.Measure.prototype.$type,a)!==null){this.dataSource().measures().remove(a);this.isModified(true)}},setMeasureListIndex:function(a){this.dataSource().measureListIndex(a);this.isModified(true)},setMeasureListLocation:function(a){switch(a){case"rows":this.dataSource().measureListLocation($.ig.MeasureListLocation.prototype.rows);break;case"columns":this.dataSource().measureListLocation($.ig.MeasureListLocation.prototype.columns);break;default:break}this.isModified(true)},expandTupleMember:function(a,b,c){this.dataSource().expandTupleMember(a,b,c)},collapseTupleMember:function(a,b,c){this.dataSource().collapseTupleMember(a,b,c)},rowAxis:function(){return this.dataSource().rowAxis().inner()},columnAxis:function(){return this.dataSource().columnAxis().inner()},filters:function(){return this.dataSource().filters().inner()},measures:function(){return this.dataSource().measures().inner()},result:function(){return this.dataSource().result()},bindCollectionChanged:function(a){var options_=a;var ds_=this.dataSource();var attachCollectionChanged=function(collection,handler){collection.collectionChanged=$.ig.Delegate.prototype.combine(collection.collectionChanged,handler)};if($.isFunction(options_["filters"])){attachCollectionChanged(ds_._filters,options_["filters"])}if($.isFunction(options_["rowAxis"])){attachCollectionChanged(ds_._rowAxis,options_["rowAxis"])}if($.isFunction(options_["columnAxis"])){attachCollectionChanged(ds_._columnAxis,options_["columnAxis"])}if($.isFunction(options_["measures"])){attachCollectionChanged(ds_._measures,options_["measures"])}},unbindCollectionChanged:function(a){var options_=a;var ds_=this.dataSource();unbindCollectionChanged=function(collection,handler){collection.collectionChanged=$.ig.Delegate.prototype.remove(collection.collectionChanged,handler)};if($.isFunction(options_["filters"])){unbindCollectionChanged(ds_._filters,options_["filters"])}if($.isFunction(options_["rowAxis"])){unbindCollectionChanged(ds_._rowAxis,options_["rowAxis"])}if($.isFunction(options_["columnAxis"])){unbindCollectionChanged(ds_._columnAxis,options_["columnAxis"])}if($.isFunction(options_["measures"])){unbindCollectionChanged(ds_._measures,options_["measures"])}},clearPendingChanges:function(){this.dataSource().clearPendingChanges()},update:function(){var promise_=this.dataSource().update().f();var $this=this;if(!this.isUpdating()){this.isUpdating(true);promise_.always(function(result){var args={error:null,result:null};if(this.state()==="rejected"){args.error=result}else{args.result=result}$this.isUpdating(false);$this.isModified(false);$($this).trigger("updated",args)})}return promise_},getCoreElement:function(a,b){return this.dataSource().getCoreElement(a,b)},getCoreElements:function(a,b){return this.dataSource().getCoreElements(a,b).inner()},getMembersOfHierarchy:function(a){return this.dataSource().getMembersOfHierarchy(a).f()},getMembersOfLevel:function(a){return this.dataSource().getMembersOfLevel(a).f()},tryGetMember:function(a){var $self=this;var b;if(function(){var $ret=$self.dataSource().tryGetMember(a,b);b=$ret.member;return $ret.ret}()){return b}return null},tryGetMembersForLevel:function(a){var $self=this;var b=new $.ig.ArrayListCollection$1($.ig.Member.prototype.$type);var c=function(){var $ret=$self.dataSource().tryGetMembersForLevel(a,b);b=$ret.members;return $ret.ret}();return c?b.inner():new $.ig.ArrayListCollection$1($.ig.Member.prototype.$type).inner()},getMembersOfMember:function(a){return this.dataSource().getMembersOfMember(a).f()},addFilterMember:function(a,b){this.dataSource().addFilterMember(a,b);this.isModified(true)},removeAllFilterMembers:function(a){this.dataSource().removeAllFilterMembers(a);this.isModified(true)},getFilterMemberNames:function(a){return this.dataSource().getFilterMemberNames(a).inner()},getDimension:function(a){var $self=this;return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Dimension.prototype.$type)},getHierarchy:function(a){var $self=this;return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Hierarchy.prototype.$type)},getLevel:function(a){var $self=this;return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Level.prototype.$type)},getMeasure:function(a){var $self=this;return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$.ig.Measure.prototype.$type)},getMeasureList:function(){return this.dataSource().getCoreElement(null,$.ig.MeasureList.prototype.$type)},$type:new $.ig.Type("DataSourceBase",$.ig.Object.prototype.$type)},true);$.ig.util.defType("jQueryUtils","Object",{init:function(){$.ig.Object.prototype.init.call(this)},b:function($t,a){if(a==null){return null}var jsObject_=a;var dict_=new $.ig.Dictionary$2(String,$t,0);(function(obj,dict){var tempDict=$.ig.Dictionary.prototype.getDictionary(obj);var keys=tempDict.keys();while(keys.moveNext()){var key=keys.current();var value=tempDict.item(key);dict.add(key,value)}})(jsObject_,dict_);return dict_},d:function($t,a){if(a==null){return null}var dict_=a;return dict_.__inner.proxy},convertToObjectDictionary:function(a){return $.ig.jQueryUtils.prototype.b($.ig.Object.prototype.$type,a)},convertToStringDictionary:function(a){return $.ig.jQueryUtils.prototype.b(String,a)},convertFromObjectDictionary:function(a){return $.ig.jQueryUtils.prototype.d($.ig.Object.prototype.$type,a)},convertFromStringDictionary:function(a){return $.ig.jQueryUtils.prototype.d(String,a)},createJavascriptObject:function(){return{}},getJavascriptObjectProperty:function(a,b){var jsObject_=a;var property_=b;return jsObject_[property_]},setJavascriptObjectProperty:function(a,b,c){var jsObject_=a;var property_=b;var value_=c;jsObject_[property_]=value_},getJavascriptObjectMethodResult:function(a,b,c){var jsObject_=a;var method_=b;var args_=c;return jsObject_[method_].call(jsObject_,args_)},$type:new $.ig.Type("jQueryUtils",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapUtilities","Object",{init:function(){$.ig.Object.prototype.init.call(this)},dateMemberProvider:function(a,b,c,d){if(String.isNullOrEmpty(a)||String.isNullOrEmpty(b)){return null}var propName_=b;var datePartFormat_=d;var format_=c;var yearProvider_;var semesterProvider_;var quarterProvider_;var monthProvider_;a=a.toLowerCase();switch(a){case"year":if(datePartFormat_==null){datePartFormat_="yyyy"}if(format_==null){return function(item){return $.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)}}return function(item){return format_.replace("{0}",$.ig.formatter(new Date(item[propName_]),"date",datePartFormat_))};case"semester":if(format_==null){format_="H{0}"}yearProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("year",b,null,null);return function(item){var year=yearProvider_(item);return format_.replace("{0}",Math.floor(new Date(item[propName_]).getMonth()/6)+1).replace("{1}",year)};case"quarter":if(format_==null){format_="Q{0}"}yearProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("year",b,null,null);semesterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("semester",b,null,null);return function(item){var year=yearProvider_(item);var semester=semesterProvider_(item);return format_.replace("{0}",Math.floor(new Date(item[propName_]).getMonth()/3)+1).replace("{1}",semester).replace("{2}",year)};case"month":if(datePartFormat_==null){datePartFormat_="MMMM"}if(format_==null){return function(item){return $.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)}}yearProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("year",b,null,null);semesterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("semester",b,null,null);quarterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("quarter",b,null,null);return function(item){var year=yearProvider_(item);var semester=semesterProvider_(item);var quarter=quarterProvider_(item);return format_.replace("{0}",$.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)).replace("{1}",quarter).replace("{2}",semester).replace("{3}",year)};case"date":if(datePartFormat_==null){datePartFormat_="MM/dd/yyyy"}if(format_==null){return function(item){return $.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)}}yearProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("year",b,null,null);semesterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("semester",b,null,null);quarterProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("quarter",b,null,null);monthProvider_=$.ig.OlapUtilities.prototype.dateMemberProvider("month",b,null,null);return function(item){var year=yearProvider_(item);var semester=semesterProvider_(item);var quarter=quarterProvider_(item);var month=monthProvider_(item);return format_.replace("{0}",$.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)).replace("{1}",month).replace("{2}",quarter).replace("{3}",semester).replace("{4}",year)}}return null},getDateHierarchy:function(a,b,c,d,e,f){var $self=this;if(String.isNullOrEmpty(a)){return null}if(b==null||b.length==0){b=function(){var $ret=new Array;$ret.add("year");$ret.add("quarter");$ret.add("month");$ret.add("date");return $ret}()}else{for(var g=0;g<b.length;g++){b[g]=b[g].toLowerCase()}}if(c==null){c="Dates"}if(d==null){d=c}var res_=null;var name_=c;var caption_=d;var rootCaption_=f;var dateParts_=b;if(e==null){e=new Array(b.length);for(var h=0;h<e.length;h++){var i=b[h];e[h]=i.substr(0,1).toUpperCase()+i.substr(1,i.length)+"s"}}var captions_=e;var memberProviders_=new Array(b.length);for(var j=0;j<b.length;j++){var k=b[j];memberProviders_[j]=$.ig.OlapUtilities.prototype.dateMemberProvider(k,a,null,null)}var levelsMetadata=[];var levelOffset=0;if(rootCaption_!=null&&rootCaption_!=""){levelOffset=1;levelsMetadata[0]={name:rootCaption_,caption:rootCaption_,memberProvider:function(item){return rootCaption_}}}for(var i=0;i<memberProviders_.length;i++){levelsMetadata[i+levelOffset]={name:dateParts_[i],caption:captions_[i],memberProvider:memberProviders_[i]}}res_={name:name_,caption:caption_,levels:levelsMetadata};return res_},sumAggregator:function(a,b){var propName_=a;var precision_=b;return function(items,cellMetadata){var sum=0,areAllNullOrUndefined=true,value;for(var i=0;i<items.length;i++){value=items[i][propName_];if(value!==null&&value!==undefined){areAllNullOrUndefined=false;sum+=value}}if(areAllNullOrUndefined)return null;if(precision_!=null){return sum.toFixed(precision_)}return sum}},avgAggregator:function(a,b){var propName_=a;var precision_=b;return function(items,cellMetadata){if(precision_==null){precision_=2}var sum=0,count=0,areAllNullOrUndefined=true,value;for(var i=0;i<items.length;i++){value=items[i][propName_];if(value!==null&&value!==undefined){areAllNullOrUndefined=false;sum+=value;count++}}if(areAllNullOrUndefined)return null;return(sum/count).toFixed(precision_)}},minAggregator:function(a){var propName_=a;return function(items,cellMetadata){var result=items[0][propName_];for(var i=1;i<items.length;i++){result=Math.min(result,items[i][propName_])}return result}},maxAggregator:function(a){var propName_=a;return function(items,cellMetadata){var result=items[0][propName_];for(var i=1;i<items.length;i++){result=Math.max(result,items[i][propName_])}return result}},countAggregator:function(){return function(items,cellMetadata){return items.length}},$type:new $.ig.Type("OlapUtilities",$.ig.Object.prototype.$type)},true);$.ig.util.defType("OlapTableView","Object",{a:null,init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);var e=this.b(d);this.a=new $.ig.TableViewImpl(a,b,c,e)},rowHeaders:function(){if(this.a.rowHeaders()==null){return null}return this.a.rowHeaders().inner()},columnHeaders:function(){if(this.a.columnHeaders()==null){return null}return this.a.columnHeaders().inner()},resultCells:function(){if(this.a.resultCells()==null){return null}return this.a.resultCells().inner()},columnSortDirections:function(a){if(arguments.length===1){this.a.columnSortDirections().clear();var c=a.getEnumerator();while(c.moveNext()){var b=c.current();var d=this.c(b);this.a.columnSortDirections().add(d)}return a}else{var e=new $.ig.Array;var g=this.a.columnSortDirections().getEnumerator();while(g.moveNext()){var f=g.current();e.add(this.d(f))}return e}},appliedColumnSortDirections:function(){var b=new $.ig.Array;var d=this.a.appliedColumnSortDirections().getEnumerator();while(d.moveNext()){var c=d.current();b.add(this.d(c))}return b},levelSortDirections:function(a){if(arguments.length===1){this.a.levelSortDirections().clear();var c=a.getEnumerator();while(c.moveNext()){var b=c.current();var d=this.e(b);this.a.levelSortDirections().add(d)}return a}else{var e=new $.ig.Array;var g=this.a.levelSortDirections().getEnumerator();while(g.moveNext()){var f=g.current();e.add(this.f(f))}return e}},appliedLevelSortDirections:function(){var b=new $.ig.Array;var d=this.a.appliedLevelSortDirections().getEnumerator();while(d.moveNext()){var c=d.current();b.add(this.f(c))}return b},appliedSortDirectionsMap:function(){var resultMap_=$.ig.jQueryUtils.prototype.createJavascriptObject();var b=this.a.appliedSortDirectionsMap().getEnumerator();while(b.moveNext()){var i_=b.current();var axisMap_=$.ig.jQueryUtils.prototype.createJavascriptObject();var c=i_.value().getEnumerator();while(c.moveNext()){var j_=c.current();var hierarchyMap_=$.ig.jQueryUtils.prototype.createJavascriptObject();var d=j_.value().getEnumerator();while(d.moveNext()){var k_=d.current();var sortDirection_=k_.value()==$.ig.ListSortDirection.prototype.ascending?"ascending":"descending";hierarchyMap_[k_.key()]=sortDirection_}axisMap_[j_.key()]=hierarchyMap_}resultMap_[i_.key()]=axisMap_}return resultMap_},initialize:function(){this.a.initialize()},b:function(a){var $self=this;var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"isParentInFrontForColumns");var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"isParentInFrontForRows");var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"compactColumnHeaders");var e=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"compactRowHeaders");return function(){var $ret=new $.ig.TableViewSettings;$ret.e(b);$ret.f(c);$ret.h(d);$ret.g(e);return $ret}()},c:function(o_){var $self=this;var a=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(o_,"memberNames");var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(o_,"tupleIndex");var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(o_,"sortDirection");var d=$.ig.ListSortDirection.prototype.ascending;if(!String.isNullOrEmpty(c)){c=c.toLowerCase();if(c=="descending"){d=$.ig.ListSortDirection.prototype.descending}}var comparer_=null;if($.isFunction(o_.comparer)){comparer_=o_.comparer}else{comparer_=function(o1,o2){return parseFloat(o1||-Infinity)-parseFloat(o2||-Infinity)}}return function(){var $ret=new $.ig.TupleSortDirection;$ret.memberNames(a);$ret.tupleIndex(b);$ret.sortDirection(d);$ret.comparer(comparer_);return $ret}()},d:function(a){var b=$.ig.jQueryUtils.prototype.createJavascriptObject();$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"memberNames",a.memberNames());$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"tupleIndex",a.tupleIndex());$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"sortDirection",a.sortDirection()==$.ig.ListSortDirection.prototype.ascending?"ascending":"descending");if(a.comparer()!=null){$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"comparer",a.comparer())}return b},e:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"levelUniqueName");var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"sortDirection");var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"sortBehavior");if(!String.isNullOrEmpty(b)){var e=new $.ig.LevelSortDirection;e.sortDirection($.ig.ListSortDirection.prototype.ascending);e.sortBehavior($.ig.LevelSortBehavior.prototype.system);e.levelUniqueName(b);if(!String.isNullOrEmpty(c)){c=c.toLowerCase();if(c=="descending"){e.sortDirection($.ig.ListSortDirection.prototype.descending)}}if(!String.isNullOrEmpty(d)){d=d.toLowerCase();if(d=="alphabetical"){e.sortBehavior($.ig.LevelSortBehavior.prototype.alphabetical)}}return e}else{return null}},f:function(a){var b=$.ig.jQueryUtils.prototype.createJavascriptObject();$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"levelUniqueName",a.levelUniqueName());$.ig.jQueryUtils.prototype.setJavascriptObjectProperty(b,"sortDirection",a.sortDirection()==$.ig.ListSortDirection.prototype.ascending?"ascending":"descending");return b},$type:new $.ig.Type("OlapTableView",$.ig.Object.prototype.$type)},true);$.ig.LevelSortBehavior.prototype.alphabetical=0;$.ig.LevelSortBehavior.prototype.system=1;$.ig.OlapMetadataTreeItemType.prototype.cube=0;$.ig.OlapMetadataTreeItemType.prototype.dimension=1;$.ig.OlapMetadataTreeItemType.prototype.group=2;$.ig.OlapMetadataTreeItemType.prototype.userDefinedHierarchy=3;$.ig.OlapMetadataTreeItemType.prototype.systemEnabledHierarchy=4;$.ig.OlapMetadataTreeItemType.prototype.parentChildHierarchy=5;$.ig.OlapMetadataTreeItemType.prototype.measure=6;$.ig.OlapMetadataTreeItemType.prototype.level1=7;$.ig.OlapMetadataTreeItemType.prototype.level2=8;$.ig.OlapMetadataTreeItemType.prototype.level3=9;$.ig.OlapMetadataTreeItemType.prototype.level4=10;$.ig.OlapMetadataTreeItemType.prototype.level5=11;$.ig.MeasureListLocation.prototype.rows=0;$.ig.MeasureListLocation.prototype.columns=1;$.ig.HeaderCellsLayoutOrientation.prototype.horizontal=0;$.ig.HeaderCellsLayoutOrientation.prototype.vertical=1;$.ig.MemberType.prototype.unknown=0;$.ig.MemberType.prototype.regular=0;$.ig.MemberType.prototype.all=1;$.ig.MemberType.prototype.measure=2;$.ig.MemberType.prototype.formula=3;$.ig.CardinalityType.prototype.one=0;$.ig.CardinalityType.prototype.many=1;$.ig.AggregatorType.prototype.unknown=0;$.ig.AggregatorType.prototype.sum=1;$.ig.AggregatorType.prototype.count=2;$.ig.AggregatorType.prototype.min=3;$.ig.AggregatorType.prototype.max=4;$.ig.AggregatorType.prototype.average=5;$.ig.AggregatorType.prototype.variance=6;$.ig.AggregatorType.prototype.std=7;$.ig.AggregatorType.prototype.distinctCount=8;$.ig.AggregatorType.prototype.none=9;$.ig.AggregatorType.prototype.averageOfChildren=10;$.ig.AggregatorType.prototype.firstNonEmpty=13;$.ig.AggregatorType.prototype.lastNonEmpty=14;$.ig.AggregatorType.prototype.byAccount=15;$.ig.AggregatorType.prototype.calculated=127;$.ig.HierarchyOrigin.prototype.userDefined=1;$.ig.HierarchyOrigin.prototype.systemEnabled=2;$.ig.HierarchyOrigin.prototype.systemInternal=4;$.ig.DimensionType.prototype.unknown=0;$.ig.DimensionType.prototype.time=1;$.ig.DimensionType.prototype.measure=2;$.ig.DimensionType.prototype.other=3;$.ig.DimensionType.prototype.quantitative=5;$.ig.DimensionType.prototype.accounts=6;$.ig.DimensionType.prototype.customers=7;$.ig.DimensionType.prototype.products=8;$.ig.DimensionType.prototype.scenario=9;$.ig.DimensionType.prototype.utility=10;$.ig.DimensionType.prototype.currency=11;$.ig.DimensionType.prototype.rates=12;$.ig.DimensionType.prototype.channel=13;$.ig.DimensionType.prototype.promotion=14;$.ig.DimensionType.prototype.organization=15;$.ig.DimensionType.prototype.billOfMaterials=16;$.ig.DimensionType.prototype.geography=17;$.ig.CubeType.prototype.cube=0;$.ig.CubeType.prototype.dimension=1;$.ig.CubeType.prototype.unknown=2;$.ig.AxisDefinitionParser.prototype.a="[";$.ig.AxisDefinitionParser.prototype.b="]";$.ig.AxisDefinitionParser.prototype.c="{";$.ig.AxisDefinitionParser.prototype.d="}";$.ig.AxisDefinitionParser.prototype.e=",";$.ig.CoreOlapElementParser.prototype.a="[";$.ig.CoreOlapElementParser.prototype.b="]";$.ig.CoreOlapElementParser.prototype.c=".";$.ig.CoreOlapElementParser.prototype.d="&";$.ig.util.extCopy($.ig.TaskExtensions,[[[$.ig.Task],["continueWithTask$1"]],[[$.ig.Task$1],["continueWithTask$21"]]]);$.ig.util.extCopy($.ig.Enumerable,[[[$.ig.ArrayListCollection$1],["where$1","where$11111","select$2","selectMany$2","last$1","first$1","firstOrDefault$1","orderBy$2","orderByDescending$2","toList$1","concat$1","max","max$111","min","min$111","count$1","reverse$1","take$1","skip$1","any$1","contains$1","union$1","toArray$1","elementAt$1"]],[[$.ig.ArrayListCollection$1],["ofType$1","cast$1"]]]);$.ig.util.extCopy($.ig.Queryable,[[[$.ig.ArrayListCollection$1],["asQueryable"]]]);$.ig=$.ig||{};$.ig.util.bulkDefine(["IFlatDataAxisProvider","FlatDataAxisProvider","FlatDataAxisProviderHelper","FlatDataPartialAxisProvider","IFlatDataProvider","FlatDataProvider","KeyListPair$1","CellMetadata","CubeMetadata","MeasuresDimensionMetadata","DataMemberMetadata","DataSourceMetadata","DimensionMetadata","HierarchyMetadata","LevelMetadata","MeasureMetadata","RowMetadata","TableMetadata","FlatDataSourceImpl","IFlatDataProviderFactory","DefaultFlatDataProviderFactory","PositionInfo","FlatDataSourceOptions","OlapFlatDataSource","Object","MulticastDelegate","Action","Action$1","Action$2","Action$3","Action$4","Action$5","Action$6","Action$7","Action$8","IEqualityComparer$1","IEnumerable","ICollection","IDictionary","IList","Array","Array","Comparison$1","Attribute","BrowsableAttribute","EventArgs","CancelEventArgs","DesignTimeVisibleAttribute","EditorBrowsableAttribute","ValueType","Enum","EditorBrowsableState","ISupportInitialize","ITypeDescriptorContext","TypeConverter","TypeConverterAttribute","WinMDTypeAttribute","WinMDPropertyToObjectTypeAttribute","Error","IFormatProvider","NotSupportedException","ObsoleteAttribute","MemberInfo","MethodBase","ConstructorInfo","IComparable","Date","Number","SuppressMessageAttribute","EventHandler$1","PlaceholderSystemCollectionsObjectModel","PlaceholderSystemCollectionsSpecialized","PlaceholderSystemWindows","PlaceholderSystemWindowsControls","PlaceholderSystemWindowsData","PlaceholderSystemWindowsInput","PlaceholderSystemWindowsMarkup","PlaceholderSystemWindowsMediaImaging","PlaceholderSystemWindowsShapes","PlaceholderSystemWindowsControlsPrimitives","PlaceholderSystemWindowsAutomation","PlaceholderSystemWindowsAutomationPeers","PlaceholderSystemText","PlaceholderSystemGlobalization","PlaceholderSystemWindowsDocuments","PlaceholderSystemWindowsInk","PlaceholderSystemWindowsMediaAnimation","PlaceholderSystemWindowsMediaEffects","PlaceholderSystemWindowsThreading","PlaceholderInfragisticsControlerChartsAutomationPeers","FlagsAttribute","Func$1","Func$2","Func$3","Func$4","Func$5","Func$6","Func$7","Func$8","Func$9","Math","XMLHttpRequest","Nullable$1","Number","ParamArrayAttribute","Array","AttributeTargets","AttributeUsageAttribute","Boolean","Number","String","Array","CompareCallback","Dictionary","DictionaryEntry","IEnumerator","INotifyPropertyChanged","PropertyChangedEventArgs","PropertyChangedEventHandler","CultureInfo","Delegate","Number","IDisposable","Number","Number","Number","IntPtr","ReflectionUtil","AssemblyTitleAttribute","AssemblyCompanyAttribute","AssemblyConfigurationAttribute","AssemblyCopyrightAttribute","AssemblyCultureAttribute","AssemblyDescriptionAttribute","AssemblyFileVersionAttribute","AssemblyProductAttribute","AssemblyTrademarkAttribute","AssemblyVersionAttribute","DefaultMemberAttribute","MethodInfo","ParameterInfo","PropertyInfo","RuntimeFieldHandle","RuntimeTypeHandle","ClientScriptAttribute","ClientNameAttribute","DontObfuscateAttribute","EmitIgnoreTypeAttribute","ExtensionAttribute","GlobalMemberAttribute","IgnoreAttribute","InlineItemAccessAttribute","InlinePropertyAttribute","InternalsVisibleToAttribute","KeepOriginalNameAttribute","LiteralStringAttribute","NativeMethodAttribute","NativePropertyAttribute","NativeTypeAttribute","RuntimeHelpers","WeakAttribute","WidgetAttribute","MainWidgetAttribute","SuppressWidgetMemberAttribute","SuppressWidgetMemberCopyAttribute","WidgetDefaultStringAttribute","WidgetDefaultNumberAttribute","WidgetDefaultBooleanAttribute","MvcEnumSetStringEnumAttribute","WidgetModuleAttribute","WidgetModuleParentAttribute","WidgetIgnoreDependsAttribute","ComVisibleAttribute","GuidAttribute","OutAttribute","DataContractAttribute","DataMemberAttribute","WaitHandle","EventWaitHandle","Monitor","TypeCode","TargetFrameworkAttribute","Number","Script","Single","String","ManualResetEvent","Thread","Date","Type","Number","Number","Number","UIntPtr","XmlAttributeAttribute","XmlElementAttribute","XmlEnumAttribute","XmlIgnoreAttribute","XmlRootAttribute","XmlTypeAttribute","XmlNode","XmlAttribute","XmlDocument","XmlDocumentParser","XmlLinkedNode","XmlElement","Void","XmlNodeList","XmlNamedNodeMap","XmlNodeType","XmlSchemaForm","ICoreOlapElement","Cube","Catalog","Dimension","CubeType","ScopeType","DimensionType","LevelType","HierarchyOrigin","AggregatorType","CardinalityType","MemberType","Hierarchy","Level","Measure","MeasureGroup","MeasureGroupDimension","Member","OlapResult","OlapResultAxis","IPosition$2","OlapResultTuple","IPositionItem$2","IHierarchicalPositionItem$2","OlapResultAxisMember","OlapResultCell","HeaderCellsLayoutOrientation","LevelSpanManager","SpanSource","ITableViewHeadersFactory","TableViewHeadersFactory","TableCompactViewHeadersFactory","TableViewHeaderCellSource","TableViewImpl","TableViewSettings","OlapResultView","ResultViewHelper","OlapTableViewHeaderCell","OlapTableViewResultCell","ArrayListCollection$1","IOlapDataSource","MeasureList","MeasureListLocation","OlapMetadataTreeItemType","OlapMetadataTreeItem","MetaTreeHelper","HierarchyItemPosition","MeasureGroupMetaItemsCache","DataSourceBaseOptions","CubeMetaItemsCache","SourceInitHelper","AxisDefinitionParser","CoreOlapElementType","CoreOlapElementParseResult","CoreOlapElementParser","AxisElement","PivotActionStatus","PivotAction","AxisItemsChangeType","AxisChangedAction","AxisItemsChangedAction","ExpansionStateChangeType","ExpansionStateChangedAction","PivotActionManager","KeyValueItem","PositionItemInfo$2","PositionResolver$2","LevelSortDirection","LevelSortBehavior","TaskExtensions","HierarchyFilterView","FilterMember","FilterMemberStateChangedEventArgs","ResultSorter$1","ResultHeaderSorter","AxisTupleVisitor","AxisHeaderSortingVisitor","ResultColumnValueSorter","AxisValueSortingVisitor","TupleSortDirection","DataSourceBase","jQueryUtils","OlapUtilities","OlapTableView","AbstractEnumerable","AbstractEnumerator","IEnumerable$1","ICollection$1","IList$1","IArrayList","List$1","Collection$1","IDictionary$2","Dictionary$2","GenericEnumerable$1","IEnumerator$1","GenericEnumerator$1","INotifyCollectionChanged","NotifyCollectionChangedEventHandler","NotifyCollectionChangedEventArgs","NotifyCollectionChangedAction","KeyValuePair$2","LinkedList$1","LinkedListNode$1","ObservableCollection$1","Queue$1","ReadOnlyCollection$1","ReadOnlyObservableCollection$1","NameValueCollection","Stack$1","IComparer$1","Expression","MemberExpression","ParameterExpression","LambdaExpression","MethodCallExpression","IOrderedEnumerable$1","Queryable","Enumerable","SortedList$1","IGrouping$2","IArray","DependencyObject","Test","IQueryable","IQueryable$1","IQueryProvider","Activator","AggregateException","ArgumentException","ArgumentNullException","ArgumentOutOfRangeException","AsyncCompletedEventArgs","AsyncCompletedEventHandler","ListSortDirection","Convert","Environment","InvalidOperationException","Debug","IEquatable$1","BinaryReader","ICredentials","NetworkCredential","UploadStringCompletedEventHandler","UploadStringCompletedEventArgs","WebClient","WebHeaderCollection","FaultCode","FaultException","FaultException$1","FaultReason","StringBuilder","BinaryFileDownloader","NotImplementedException","Random","Encoding","UTF8Encoding","Task","Task$1","TaskCompletionSource$1","TaskFactory","TaskStatus","Tuple$2","Uri","JavaScriptSerializer","UIElement","UIElementCollection","FrameworkElement","Control","ContentControl","Panel","Canvas","Image","TextBlock","DataTemplate","DataTemplatePassInfo","DataTemplateMeasureInfo","DataTemplateRenderInfo","DataTemplateRenderHandler","DataTemplateMeasureHandler","DataTemplatePassHandler","Binding","DependencyProperty","UnsetValue","DependencyPropertiesCollection","DependencyPropertyChangedEventArgs","Key","ModifierKeys","MouseEventArgs","MouseButtonEventArgs","Brush","Color","DoubleCollection","FillRule","GeometryType","Geometry","GeometryCollection","GeometryGroup","LineGeometry","RectangleGeometry","EllipseGeometry","PathGeometry","PathFigure","PathFigureCollection","PathSegmentType","PathSegment","PathSegmentCollection","LineSegment","BezierSegment","PolyBezierSegment","PolyLineSegment","ArcSegment","SweepDirection","HorizontalAlignment","PenLineCap","Stretch","Transform","RotateTransform","TranslateTransform","TransformGroup","TransformCollection","VerticalAlignment","Point","PointCollection","PropertyChangedCallback","CoerceValueCallback","PropertyMetadata","PropertyPath","Rect","Shape","Line","Path","Polygon","Polyline","Rectangle","Size","Style","StyleTypedPropertyAttribute","TemplatePartAttribute","TemplateVisualStateAttribute","Visibility","XObject","XAttribute","XNode","XContainer","XDocument","XElement","XmlUtils","XName","XNamespace","Element","CanvasElement","console","DivElement","Document","ElementAttribute","ElementAttributeCollection","ElementCollection","ElementEventHandler","ElementNodeType","EventListener","IElementEventHandler","ImageElement","CanvasContext","CanvasContext2D","ImageData","Gradient","TextMetrics","MSGesture","WebStyle","window","Callback","JQuery","JQueryDeferred","JQueryEvent","JQueryObject","JQueryCallback","JQueryUICallback","JQueryPosition","JQueryPromise"]);
$.ig.util.defType("IFlatDataAxisProvider","Object",{$type:new $.ig.Type("IFlatDataAxisProvider",null)},true);$.ig.util.defType("FlatDataAxisProvider","Object",{a:null,b:null,c:null,init:function(a,b,c){var $self=this;this.d=null;this.e=null;this.f=false;this.g=false;$.ig.Object.prototype.init.call(this);this.c=c;this.n(a);this.a=b.select$2($.ig.ICoreOlapElement.prototype.$type,$.ig.ICoreOlapElement.prototype.$type,function(d){return d}).toList$1($.ig.ICoreOlapElement.prototype.$type);this.b=new $.ig.FlatDataAxisProviderHelper(a,b.count(),c)},_n:null,n:function(a){if(arguments.length===1){this._n=a;return a}else{return this._n}},_axis:null,axis:function(a){if(arguments.length===1){this._axis=a;return a}else{return this._axis}},o:function(){return this.b.k()},d:null,e:null,f:null,g:null,t:function(a){var $self=this;if(this.axis()!=null){this.e=this.axis();this.d=a.select$2($.ig.ICoreOlapElement.prototype.$type,$.ig.ICoreOlapElement.prototype.$type,function(b){return b}).toList$1($.ig.ICoreOlapElement.prototype.$type);this.f=true}else{this.b=new $.ig.FlatDataAxisProviderHelper(this.n(),a.count(),this.c);this.a=a}},u:function(){if(this.axis()!=null){this.g=true}},v:function(a){var $self=this;this.f=false;var b=this.d;var c=this.e;var d=new $.ig.TaskCompletionSource$1($.ig.OlapResultAxis.prototype.$type,0);var e=new $.ig.List$1(String,0);for(var f=0;f<this.a.count();f++){var g=this.a.item(f);if($.ig.util.cast($.ig.MeasureList.prototype.$type,g)!==null){e.add(this.n().ag().b().i().e());continue}e.add(g.uniqueName())}this.a=b;var h=new $.ig.List$1(String,0);var i=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize(String,$.ig.Number.prototype.$type),0);for(var j=0;j<this.a.count();j++){var k=this.a.item(j);if($.ig.util.cast($.ig.MeasureList.prototype.$type,k)!==null){h.add(this.n().ag().b().i().e());continue}h.add(k.uniqueName());i.add(new $.ig.KeyValuePair$2(String,$.ig.Number.prototype.$type,k.uniqueName(),0))}var l=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize(String,$.ig.Number.prototype.$type),0);if(e.count()>0){var m=-1;for(var n=0;n<h.count();n++){if(n==e.count()||e.item(n)!=h.item(n)){break}m=n}if(m<i.count()-1){for(var o=m+1;o<i.count();o++){l.add(i.item(o))}}else{l=i}var p=new Array(this.a.count());var q=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);this.b.w(l).ac(function(r){return $self.w(m,b,p,r.aa(),q,c.name(),d,true)});return d.d()}return this.generateAxis(a)},generateAxis:function(a){var $self=this;if(this.g||this.f){var b=null;if(this.g){b=this.z(a)}if(this.f){b=this.v(a)}return b}var c=new $.ig.TaskCompletionSource$1($.ig.OlapResultAxis.prototype.$type,0);if(this.axis()!=null){c.i(this.axis());return c.d()}var d=new Array(this.a.count());var e=new $.ig.List$1(String,0);var f=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);var g=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize(String,$.ig.Number.prototype.$type),0);var h=this.a;for(var i=0;i<this.a.count();i++){var j=this.a.item(i);if($.ig.util.cast($.ig.MeasureList.prototype.$type,j)!==null){e.add(this.n().ag().b().i().e());continue}e.add(j.uniqueName());g.add(new $.ig.KeyValuePair$2(String,$.ig.Number.prototype.$type,j.uniqueName(),0))}var k=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize(String,$.ig.Number.prototype.$type),0);var l=this.n().ae().e();k=g;var m=this.b.w(k);m.ac(function(n){$self.b.v(h,0,d,n.aa(),l,null,f);$self.axis(function(){var $ret=new $.ig.OlapResultAxis(f,h.count());$ret.name(a);return $ret}());c.i($self.axis())});return c.d()},w:function(a,b,c,d,e,f,g,h){var $self=this;var i=this.o();if(h){this.b=new $.ig.FlatDataAxisProviderHelper(this.n(),b.count(),this.c)}if(a>-1&&i.rootPositionInfo().count()>0){this.b.t(b,a,i.rootPositionInfo(),c,d,e)}else{var k=this.n().ae().e().where$1($.ig.RowMetadata.prototype.$type,function(j){return!j.f()}).toList$1($.ig.RowMetadata.prototype.$type);this.b.v(b,0,c,d,k,null,e)}this.axis(function(){var $ret=new $.ig.OlapResultAxis(e,b.count());$ret.name(f);return $ret}());g.i(this.axis())},x:function(a){if(this.axis()==null){throw new $.ig.InvalidOperationException(0)}var c=a.getEnumerator();while(c.moveNext()){var b=c.current();this.b.s(b.key(),b.value())}},y:function(a){var b=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize($.ig.OlapResultTuple.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.RowMetadata.prototype.$type)),0);var d=a.j().getEnumerator();while(d.moveNext()){var c=d.current();var e=a.getTupleRowsMetadata(c);b.add(new $.ig.KeyValuePair$2($.ig.OlapResultTuple.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.RowMetadata.prototype.$type),c,e))}this.x(b)},z:function(a){var $self=this;this.g=false;var b=new $.ig.TaskCompletionSource$1($.ig.OlapResultAxis.prototype.$type,0);var c=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize($.ig.OlapResultTuple.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.RowMetadata.prototype.$type)),0);var d=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);for(var e=0;e<this.b.k().positions().count();e++){var f=this.b.k().positions().__inner[e];var h=this.n().as(f.members().toArray$1($.ig.OlapResultAxisMember.prototype.$type),f.itemsCount()).where$1($.ig.RowMetadata.prototype.$type,function(g){return!g.f()}).toList$1($.ig.RowMetadata.prototype.$type);if(h.count()>0){d.add(f)}c.add(new $.ig.KeyValuePair$2($.ig.OlapResultTuple.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.RowMetadata.prototype.$type),f,h))}if(c.count()>0){this.x(c)}var i=new Array(this.a.count());var j=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize(String,$.ig.Number.prototype.$type),0);for(var k=0;k<this.a.count();k++){var l=this.a.item(k);if($.ig.util.cast($.ig.MeasureList.prototype.$type,l)!==null){continue}j.add(new $.ig.KeyValuePair$2(String,$.ig.Number.prototype.$type,l.uniqueName(),0))}this.b.w(j).ac(function(m){return $self.w($self.a.count()-1,$self.a,i,m.aa(),new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0),a,b,false)});return b.d()},getTupleRowsMetadata:function(a){return this.b.r(a)},$type:new $.ig.Type("FlatDataAxisProvider",$.ig.Object.prototype.$type,[$.ig.IFlatDataAxisProvider.prototype.$type])},true);$.ig.util.defType("FlatDataAxisProviderHelper","Object",{a:null,b:null,_i:null,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},init:function(a,b,c){$.ig.Object.prototype.init.call(this);this.a=c;this.j(a);this.b=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IList$1.prototype.$type.specialize($.ig.RowMetadata.prototype.$type),0);this.k(new $.ig.PositionResolver$2(String,$.ig.Object.prototype.$type,new $.ig.List$1($.ig.IPosition$2.prototype.$type.specialize(String,$.ig.Object.prototype.$type),0),b));this.i(this.k().positions())},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},_k:null,k:function(a){if(arguments.length===1){this._k=a;return a}else{return this._k}},r:function(a){var $self=this;var b=null;var c=this.k().getPositionIndex(a);if(c>-1){(function(){var $ret=$self.b.tryGetValue(c,b);b=$ret.value;return $ret.ret})()}return b},s:function(a,b){var c=this.k().getPositionIndex(a);if(c==-1){this.b.add(this.i().count(),b);this.i().add(a);return true}this.b.item(c,b);return false},t:function(a,b,c,d,e,f){var $self=this;var g=c.positionItemDepthMin();var j=c.values().where$1($.ig.PositionItemInfo$2.prototype.$type,function(h){return h.positionItemDepth()==g}).getEnumerator();while(j.moveNext()){var i=j.current();if(i.positionItemIndex()==b||i.count()==0){if(i.count()==0){b=i.positionItemIndex()}this.u(c,i,d,a,b,e,f)}else{var k=i.positionItem();var l=k.clone();var m=new Array(a.count());$.ig.Array.prototype.copy(d,0,m,0,a.count());m[i.positionItemIndex()]=l;this.t(a,b,i,m,e,f)}}},u:function(a,b,c,d,e,f,g){var $self=this;var h=b.positionItem();var i=h.clone();var j=new Array(d.count());$.ig.Array.prototype.copy(c,0,j,0,d.count());j[b.positionItemIndex()]=i;var k=this.j().as(j,b.positionItemIndex()+1).toList$1($.ig.RowMetadata.prototype.$type);if(k.count()>0){if(e<d.count()-1){this.v(d,e+1,j,f,k,null,g)}else{var l=new $.ig.OlapResultTuple(j);var n=k.where$1($.ig.RowMetadata.prototype.$type,function(m){return!m.f()}).toList$1($.ig.RowMetadata.prototype.$type);var o=this.k().getPositionIndex(l);if(o==-1){this.b.add(this.i().count(),n);this.i().add(l)}else{this.i().item(o,l)}for(var q=0;q<j.length;q++){var p=j[q];p.position(l)}if(n.count()>0){g.add(l)}}if(b.isExpanded()){var t=a.values().where$1($.ig.RowMetadata.prototype.$type,function(r){return r.parentKey()==b.key()}).getEnumerator();while(t.moveNext()){var s=t.current();this.u(a,s,c,d,e,f,g)}}}},v:function(a,b,c,d,e,f,g){var $self=this;var h=a.item(b);if($.ig.util.cast($.ig.Hierarchy.prototype.$type,h)!==null){var i=d.item(h.uniqueName());if(f!=null){i=i.where$1($.ig.Member.prototype.$type,function(j){return j.parentUniqueName()==f})}var l=i.getEnumerator();while(l.moveNext()){var k=l.current();var m;(function(){var $ret=$self.j().at(k.uniqueName(),m);m=$ret.memberId;return $ret.ret})();var o=e.where$1($.ig.Member.prototype.$type,function(n){return n.h(k.levelUniqueName())==m}).toList$1($.ig.RowMetadata.prototype.$type);if(o.count()>0){var p=new Array(a.count());$.ig.Array.prototype.copy(c,0,p,0,a.count());var q=new $.ig.OlapResultAxisMember;q.caption(k.caption());q.hierarchyUniqueName(k.hierarchyUniqueName());q.levelNumber(k.levelDepth());q.levelUniqueName(k.levelUniqueName());q.uniqueName(k.uniqueName());q.displayInfo(k.childrenCardinality());q.properties().add("PARENT_UNIQUE_NAME",k.parentUniqueName());q.properties().add("memberId",m.toString());p[b]=q;if(b==a.count()-1){var s=o.where$1($.ig.Member.prototype.$type,function(r){return!r.f()}).toList$1($.ig.RowMetadata.prototype.$type);var t=new $.ig.OlapResultTuple(p);var u=this.k().getPositionIndex(t);if(u==-1){this.b.add(this.i().count(),s);this.i().add(t)}else{this.i().item(u,t)}for(var w=0;w<p.length;w++){var v=p[w];v.position(t)}if(s.count()>0){g.add(t)}}else{this.v(a,b+1,p,d,o,null,g)}}}}else if($.ig.util.cast($.ig.MeasureList.prototype.$type,h)!==null){var x=h;var z=x.measures().getEnumerator();while(z.moveNext()){var y=z.current();var aa=new Array(a.count());$.ig.Array.prototype.copy(c,0,aa,0,a.count());var ab=new $.ig.OlapResultAxisMember;ab.caption(y.caption());var ac=this.x(this.j().ag().b().i().e());ab.hierarchyUniqueName(ac);ab.levelNumber(0);ab.uniqueName(y.uniqueName());aa[b]=ab;if(b==a.count()-1){var ad=new $.ig.OlapResultTuple(aa);var af=e.where$1($.ig.Member.prototype.$type,function(ae){return!ae.f()}).toList$1($.ig.RowMetadata.prototype.$type);var ag=this.k().getPositionIndex(ad);if(ag==-1){this.b.add(this.i().count(),af);this.i().add(ad)}else{this.i().item(ag,ad)}for(var ai=0;ai<aa.length;ai++){var ah=aa[ai];ah.position(ad)}if(af.count()>0){g.add(ad)}}else{this.v(a,b+1,aa,d,e,null,g)}}}},w:function(a){var $self=this;var b=this.a;if(a.count()==0){var c=new $.ig.TaskCompletionSource$1($.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type)),0);c.i(new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type),0));return c.d()}var d=new $.ig.Dictionary$2(String,$.ig.Level.prototype.$type,0);for(var e=0;e<a.count();e++){var f=a.item(e).key();var g=a.item(e).value();var i=b.q().where$1($.ig.Level.prototype.$type,function(h){return h.hierarchyUniqueName()==f&&h.depth()==g}).firstOrDefault$1($.ig.Level.prototype.$type);if(!d.containsKey(f)){d.add(f,i)}}return this.y(d)},x:function(a){if(a.substr(0,1)!="["){a="["+a}if(a.substr(a.length-1,1)!="]"){a+="]"}return a},y:function(a){var $self=this;var b=this.a;var c=new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type),0);var d=new $.ig.List$1(String,0);var f=a.getEnumerator();while(f.moveNext()){var e=f.current();var g=e.value().uniqueName();var h;if(b.af(g)&&function(){var $ret=b.ap(g,h);h=$ret.members;return $ret.ret}()){c.add(e.key(),h)}else{d.add(e.key())}}if(d.count()==0){var i=new $.ig.TaskCompletionSource$1($.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type)),0);i.i(c);return i.d()}var j=new Array(d.count());var k=0;var m=d.getEnumerator();while(m.moveNext()){var l=m.current();var n=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);n.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c("LEVEL_UNIQUE_NAME");$ret.d(a.item(l).uniqueName());return $ret}());j[k]=this.j().discoverMembersAsync(null,n);k++}var o=new $.ig.TaskFactory;var q=o.c($.ig.IDictionary$2.prototype.$type,j,function(p){return $self.z(p,d,c)});return q},z:function(a,b,c){for(var d=0;d<b.count();d++){var e=b.__inner[d];if(!c.containsKey(e)){var f=a[d].aa();var h=f.getEnumerator();while(h.moveNext()){var g=h.current();this.a.ak(g)}c.add(e,f)}}return c},aa:function(a,b){var $self=this;var c=new $.ig.Dictionary$2(String,$.ig.Level.prototype.$type,0);for(var d=0;d<b.count();d++){var e=a[d];if(e.h()!=null||e.g()){return null}var f=b.item(d);var h=e.aa().where$1($.ig.Level.prototype.$type,function(g){return g.depth()==f}).firstOrDefault$1($.ig.Level.prototype.$type);if(h!=null&&!c.containsKey(h.hierarchyUniqueName())){c.add(h.hierarchyUniqueName(),h)}}return c},$type:new $.ig.Type("FlatDataAxisProviderHelper",$.ig.Object.prototype.$type)},true);$.ig.util.defType("FlatDataPartialAxisProvider","Object",{a:null,b:null,c:null,init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);this.f(a);this.a=new $.ig.FlatDataAxisProviderHelper(a,b.count(),d);this.c=c;this.b=b},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_axis:null,axis:function(a){if(arguments.length===1){this._axis=a;return a}else{return this._axis}},generateAxis:function(a){var $self=this;var b=new $.ig.TaskCompletionSource$1($.ig.OlapResultAxis.prototype.$type,0);if(this.axis()!=null){b.i(this.axis());return b.d()}var c=new Array(this.c.position().itemsCount());var d=new $.ig.List$1($.ig.OlapResultTuple.prototype.$type,0);var e=this.c.position().indexOf(this.c);var f=this.c.position();var g=new $.ig.List$1($.ig.KeyValuePair$2.prototype.$type.specialize(String,$.ig.Number.prototype.$type),0);for(var h=0;h<this.c.position().itemsCount();h++){if(h<e){c[h]=this.c.position().members().item(h).clone()}else if(h==e){if($.ig.util.cast($.ig.MeasureList.prototype.$type,this.b.item(h))!==null){continue}var i=f.members().item(h);g.add(new $.ig.KeyValuePair$2(String,$.ig.Number.prototype.$type,i.hierarchyUniqueName(),i.depth()+1))}else{if($.ig.util.cast($.ig.MeasureList.prototype.$type,this.b.item(h))!==null){continue}var j=f.members().item(h);g.add(new $.ig.KeyValuePair$2(String,$.ig.Number.prototype.$type,j.hierarchyUniqueName(),j.depth()))}}this.a.w(g).ac(function(k){var l=$self.f().as(f.members().toArray$1($.ig.OlapResultAxisMember.prototype.$type),e+1).toList$1($.ig.RowMetadata.prototype.$type);$self.a.v($self.b,e,c,k.aa(),l,$self.c.uniqueName(),d);$self.axis(function(){var $ret=new $.ig.OlapResultAxis(d,f.itemsCount());$ret.name(a);return $ret}());b.i($self.axis())});return b.d()},getTupleRowsMetadata:function(a){return this.a.r(a)},j:function(){return this.a.i()},$type:new $.ig.Type("FlatDataPartialAxisProvider",$.ig.Object.prototype.$type,[$.ig.IFlatDataAxisProvider.prototype.$type])},true);$.ig.util.defType("IFlatDataProvider","Object",{$type:new $.ig.Type("IFlatDataProvider",null)},true);$.ig.util.defType("FlatDataProvider","Object",{b:null,c:null,d:null,e:null,f:null,g:null,h:null,i:null,j:null,k:null,l:null,m:null,_ae:null,ae:function(a){if(arguments.length===1){this._ae=a;return a}else{return this._ae}},init:function(a,b){var $self=this;this.h=new $.ig.Dictionary$2(String,$.ig.Number.prototype.$type,0);this.i=new $.ig.Dictionary$2(String,$.ig.DataMemberMetadata.prototype.$type,0);this.j=new $.ig.Dictionary$2(String,$.ig.DataMemberMetadata.prototype.$type,0);this.n=new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.DataMemberMetadata.prototype.$type),0);$.ig.Object.prototype.init.call(this);this.af(a);this.ag(b);this.ae(new $.ig.TableMetadata(a));if(b.b()!=null){if(b.b().i()==null){b.b().i(function(){var $ret=new $.ig.MeasuresDimensionMetadata;$ret.d("Measures");$ret.e("Measures");return $ret}())}else{if(String.isNullOrEmpty(b.b().i().d())){b.b().i().d("Measures")}if(String.isNullOrEmpty(b.b().i().e())){b.b().i().e("Measures")}}}},_af:null,af:function(a){if(arguments.length===1){this._af=a;return a}else{return this._af}},_ag:null,ag:function(a){if(arguments.length===1){this._ag=a;return a}else{return this._ag}},discoverCubesAsync:function(a,b){var c=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Cube.prototype.$type),0);if(this.b==null){this.b=this.a3()}c.i(this.b);return c.d()},discoverDimensionsAsync:function(a,b){var c=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Dimension.prototype.$type),0);if(this.c==null){this.c=this.a5()}c.i(this.c);return c.d()},discoverHierarchiesAsync:function(a,b){var c=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Hierarchy.prototype.$type),0);if(this.d==null){this.d=this.a6()}c.i(this.d);return c.d()},discoverLevelsAsync:function(a,b){var c=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Level.prototype.$type),0);var d=this.an(a,b);c.i(d);return c.d()},an:function(a,b){var $self=this;if(this.e==null){this.f=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.Level.prototype.$type),0);this.e=this.a7()}var c=null;var d=null;if(b!=null){c=b.where$1($.ig.KeyValueItem.prototype.$type,function(e){return e.c()=="HIERARCHY_UNIQUE_NAME"}).firstOrDefault$1($.ig.KeyValueItem.prototype.$type);d=b.where$1($.ig.KeyValueItem.prototype.$type,function(f){return f.c()=="LEVEL_UNIQUE_NAME"}).firstOrDefault$1($.ig.KeyValueItem.prototype.$type)}var g;if(c!=null){g=this.e.where$1($.ig.KeyValueItem.prototype.$type,function(h){return h.hierarchyUniqueName()==c.d()})}else{g=this.e.toList$1($.ig.Level.prototype.$type)}if(d!=null){g=g.where$1($.ig.KeyValueItem.prototype.$type,function(i){return i.uniqueName()==d.d()})}return g},discoverMeasuresAsync:function(a,b){var c=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Measure.prototype.$type),0);if(this.k==null){this.l=new $.ig.Dictionary$2(String,$.ig.Func$3.prototype.$type.specialize($.ig.IEnumerable.prototype.$type,$.ig.CellMetadata.prototype.$type,$.ig.Object.prototype.$type),0);this.k=this.a4(this.l)}c.i(this.k);return c.d()},discoverMeasureGroupsAsync:function(a,b){throw new $.ig.NotImplementedException},discoverMeasureGroupDimensionsAsync:function(a,b){throw new $.ig.NotImplementedException},discoverMembersAsync:function(a,b){var c=new $.ig.TaskCompletionSource$1($.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type),0);var d=this.ao(a,b);c.i(d);return c.d()},ao:function(a,b){var $self=this;if(this.m==null){this.m=new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.Member.prototype.$type),0)}var d=b.where$1($.ig.KeyValueItem.prototype.$type,function(c){return c.c()=="HIERARCHY_UNIQUE_NAME"}).firstOrDefault$1($.ig.KeyValueItem.prototype.$type);var f=b.where$1($.ig.KeyValueItem.prototype.$type,function(e){return e.c()=="LEVEL_UNIQUE_NAME"}).firstOrDefault$1($.ig.KeyValueItem.prototype.$type);var h=b.where$1($.ig.KeyValueItem.prototype.$type,function(g){return g.c()=="MEMBER_UNIQUE_NAME"}).firstOrDefault$1($.ig.KeyValueItem.prototype.$type);if(this.e==null){this.e=this.a7()}var i=null;var j=this.e;if(d!=null){j=j.where$1($.ig.KeyValueItem.prototype.$type,function(k){return k.hierarchyUniqueName()==d.d()}).toList$1($.ig.Level.prototype.$type)}if(f!=null){var m=j.where$1($.ig.KeyValueItem.prototype.$type,function(l){return l.uniqueName()==f.d()}).first$1($.ig.Level.prototype.$type);var n=m.hierarchyUniqueName();var o=m.depth();var p=0;if(h!=null){p=1}j=j.where$1($.ig.KeyValueItem.prototype.$type,function(q){return q.hierarchyUniqueName()==n&&q.depth()<=o+p}).toList$1($.ig.Level.prototype.$type)}else if(h!=null){throw new $.ig.InvalidOperationException(1,"LEVEL_UNIQUE_NAME restriction is required for MEMBER_UNIQUE_NAME restriction.")}i=new Array(j.count());for(var r=0;r<j.count();r++){i[r]=j.item(r)}var s=null;if(i.length>0){var t=i[0];var v=this.d.where$1($.ig.KeyValueItem.prototype.$type,function(u){return u.uniqueName()==t.hierarchyUniqueName()}).first$1($.ig.Level.prototype.$type);var w=this.ae().e();this.a1(i,0,".",null,v,w);if(d!=null&&f==null&&h==null){var x=new $.ig.List$1($.ig.Member.prototype.$type,0);for(var y=0;y<i.length;y++){var z=i[y];var aa;if(!function(){var $ret=$self.m.tryGetValue(z.uniqueName(),aa);aa=$ret.value;return $ret.ret}()){}var ac=aa.values().getEnumerator();while(ac.moveNext()){var ab=ac.current();x.add(ab)}}s=x}else{t=i[i.length-1];if(h==null){var ad;if(!function(){var $ret=$self.m.tryGetValue(t.uniqueName(),ad);ad=$ret.value;return $ret.ret}()){}s=ad.values()}else{var ae;if(!function(){var $ret=$self.m.tryGetValue(t.uniqueName(),ae);ae=$ret.value;return $ret.ret}()){}var af=new $.ig.List$1($.ig.Member.prototype.$type,0);var ah=ae.values().getEnumerator();while(ah.moveNext()){var ag=ah.current();if(ag.parentUniqueName()==h.d()){af.add(ag)}}s=af}}}else{s=new $.ig.List$1($.ig.Member.prototype.$type,0)}return s},ap:function(a,b,c){var $self=this;var d=new $.ig.List$1($.ig.Task.prototype.$type,0);if(a!=null){d.add(a.generateAxis("Axis0"))}if(b!=null){var e=a==null?"Axis0":"Axis1";d.add(b.generateAxis(e))}if(d.count()>0){var f=new Array(d.count());for(var g=0;g<d.count();g++){f[g]=d.item(g)}var h=new $.ig.TaskFactory;return h.c($.ig.OlapResult.prototype.$type,f,function(i){return $self.ax(a,b,c)})}var j=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);var k=this.ax(null,null,c);j.i(k);return j.d()},aq:function(a){var $self=this;var b=new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.DataMemberMetadata.prototype.$type)),0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();if(c.memberNames().count()>0){for(var e=0;e<c.memberNames().count();e++){var f=c.memberNames().item(e);var g;if(function(){var $ret=$self.i.tryGetValue(f,g);g=$ret.value;return $ret.ret}()){var h;if(!function(){var $ret=b.tryGetValue(c.name(),h);h=$ret.value;return $ret.ret}()){h=new $.ig.Dictionary$2($.ig.Number.prototype.$type,$.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.DataMemberMetadata.prototype.$type),0);b.add(c.name(),h)}var i;if(!function(){var $ret=h.tryGetValue(g.h().levelDepth(),i);i=$ret.value;return $ret.ret}()){i=new $.ig.Dictionary$2(String,$.ig.DataMemberMetadata.prototype.$type,0);h.add(g.h().levelDepth(),i)}if(!i.containsKey(f)){i.add(f,g)}}}}}var j=new $.ig.Dictionary$2(String,$.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.DataMemberMetadata.prototype.$type),0);var l=b.getEnumerator();while(l.moveNext()){var k=l.current();var m=k.value();var p=m.orderBy$2($.ig.KeyValuePair$2.prototype.$type,$.ig.Number.prototype.$type,function(n){return n.key()}).select$2($.ig.KeyValuePair$2.prototype.$type,$.ig.IDictionary$2.prototype.$type,function(o){return o.value()}).toList$1($.ig.IDictionary$2.prototype.$type);for(var q=p.count()-1;q>=0;q--){var s=p.item(q).select$2($.ig.KeyValuePair$2.prototype.$type,$.ig.IDictionary$2.prototype.$type,function(r){return r.value()}).toList$1($.ig.IDictionary$2.prototype.$type);for(var t=0;t<s.count();t++){var u=s.item(t);var v=u.h().levelDepth();if(v>0){var w;if(!function(){var $ret=m.tryGetValue(v-1,w);w=$ret.value;return $ret.ret}()||!w.containsKey(u.h().parentUniqueName())){var x;if(!function(){var $ret=j.tryGetValue(u.h().parentUniqueName(),x);x=$ret.value;return $ret.ret}()){x=new $.ig.Dictionary$2(String,$.ig.DataMemberMetadata.prototype.$type,0);j.add(u.h().parentUniqueName(),x)}x.add(u.h().uniqueName(),u)}}}}var y=p.item(0);var z=y.values().first$1($.ig.DataMemberMetadata.prototype.$type);if(!String.isNullOrEmpty(z.h().parentUniqueName())){z=this.i.item(z.h().parentUniqueName())}var aa=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);aa.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c("LEVEL_UNIQUE_NAME");$ret.d(z.h().levelUniqueName());return $ret}());var ab=this.ao(null,aa).toList$1($.ig.IDictionary$2.prototype.$type);for(var ac=0;ac<ab.count();ac++){var ad=ab.item(ac);if(!y.containsKey(ad.uniqueName())&&!j.containsKey(ad.uniqueName())){j.add(ad.uniqueName(),new $.ig.Dictionary$2(String,$.ig.DataMemberMetadata.prototype.$type,0))}}}var af=this.n.keys().getEnumerator();while(af.moveNext()){var ae=af.current();var ag;if(function(){var $ret=$self.i.tryGetValue(ae,ag);ag=$ret.value;return $ret.ret}()){for(var ah=0;ah<ag.k().count();ah++){var ai=ag.k().item(ah);if(ai.f()){ai.j()}}}}this.n=j;var ak=this.n.keys().getEnumerator();while(ak.moveNext()){var aj=ak.current();var al;if(function(){var $ret=$self.i.tryGetValue(aj,al);al=$ret.value;return $ret.ret}()){if(!this.ar(al)){for(var am=0;am<al.k().count();am++){var an=al.k().item(am);an.i()}}}}var ap=this.n.keys().getEnumerator();while(ap.moveNext()){var ao=ap.current();var aq;if(function(){var $ret=$self.i.tryGetValue(ao,aq);aq=$ret.value;return $ret.ret}()){var ar=this.n.item(ao).values().toList$1($.ig.IDictionary$2.prototype.$type);for(var as=0;as<ar.count();as++){var at=ar.item(as);for(var au=0;au<at.k().count();au++){var av=at.k().item(au);if(av.f()){av.j()}}}}}},ar:function(a){var $self=this;var b=a.h().parentUniqueName();while(!String.isNullOrEmpty(b)){if(this.n.containsKey(b)){return true}var c;if(function(){var $ret=$self.i.tryGetValue(b,c);c=$ret.value;return $ret.ret}()){b=c.h().parentUniqueName()}else{return false}}return false},n:null,as:function(a,b){var $self=this;var c=null;var d=-1;for(var e=0;e<b;e++){var f=a[e];var g=null;var h;if(function(){var $ret=$self.au(f.uniqueName(),h);h=$ret.memberMetadata;return $ret.ret}()){g=h.k()}if(g!=null){if(c==null||c.count()>g.count()){d=e;c=g}}}if(c==null){c=this.ae().e().toList$1($.ig.RowMetadata.prototype.$type)}var i=c;for(var j=0;j<b;j++){if(j!=d){var k=a[j];var l;if(function(){var $ret=k.properties().tryGetValue("memberId",l);l=$ret.value;return $ret.ret}()){var m=k.levelUniqueName();var n=$.ig.Number.prototype.parseInt(l);i=i.where$1($.ig.RowMetadata.prototype.$type,function(o){return o.h(m)==n})}}}return i},at:function(a,b){var $self=this;return{ret:function(){var $ret=$self.h.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),memberId:b};return{memberId:b}},au:function(a,b){var $self=this;return{ret:function(){var $ret=$self.i.tryGetValue(a,b);b=$ret.value;return $ret.ret}(),memberMetadata:b};return{memberMetadata:b}},aw:function($t,a){var b=new $.ig.ArrayListCollection$1($t);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},ax:function(a,b,c){var $self=this;var d=null;if(a!=null){d=a.axis()}var e=null;if(b!=null){e=b.axis()}var f=this.a0(d,e,c);var g=f[0];var h=f[1];var i=null;var j=-1;var k=null;var l=new $.ig.Dictionary$2(String,$.ig.Number.prototype.$type,0);var m=new $.ig.Array;var n=new $.ig.Array;var o=new $.ig.Array;for(var p=0;p<c.count();p++){l.add(c.item(p).uniqueName(),p);m.add(c.item(p))}if(g=="none"&&c.count()>0){i=c.item(0).uniqueName();j=l.item(i);k=this.l.item(i)}if(d==null&&e==null){var q=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,0);if(k!=null){var s=this.ae().e().where$1($.ig.RowMetadata.prototype.$type,function(r){return!r.f()});var t=new $.ig.Array;var w=s.select$2($.ig.RowMetadata.prototype.$type,$.ig.Object.prototype.$type,function(u){return u.e()}).getEnumerator();while(w.moveNext()){var v=w.current();t.add(v)}if(t.length>0){var x=new $.ig.CellMetadata(0,0,0,j,n,o,m);var y=k(t,x);if(y!=null){var z=new $.ig.OlapResultCell;z.cellOrdinal(0);z.properties().add("Value",y);z.properties().add("FmtValue",y.toString());q.add(z)}}}return this.ay(null,null,q)}if(e!=null){var aa=e.tuples();for(var ab=0;ab<aa.count();ab++){n.add(aa.__inner[ab])}}if(d!=null){var ac=d.tuples();for(var ad=0;ad<ac.count();ad++){o.add(ac.__inner[ad])}}var ae=1;if(d!=null){ae=d.tuples().count()}var af=1;if(e!=null){af=e.tuples().count()}var ag=new $.ig.List$1($.ig.OlapResultCell.prototype.$type,0);for(var ah=0;ah<af;ah++){var ai=null;var aj=null;if(e!=null){aj=e.tuples().__inner[ah];ai=b.getTupleRowsMetadata(aj);if(g=="rows"){i=aj.members().item(h).uniqueName();j=l.item(i);k=this.l.item(i)}}for(var ak=0;ak<ae;ak++){var al=ai;var am=null;var an=null;if(d!=null){an=d.tuples().__inner[ak];am=a.getTupleRowsMetadata(an);if(g=="columns"){i=an.members().item(h).uniqueName();j=l.item(i);k=this.l.item(i)}}if(al!=null){if(am!=null){al=this.az(al,am,aj,an,h)}}else{al=am}if(k!=null){var ao=ah*ae+ak;var ap=new $.ig.CellMetadata(ah,ak,ao,j,n,o,m);var aq=new $.ig.Array;var at=al.select$2($.ig.RowMetadata.prototype.$type,$.ig.Object.prototype.$type,function(ar){return ar.e()}).getEnumerator();while(at.moveNext()){var as=at.current();aq.add(as)}if(aq.length>0){var au=k(aq,ap);if(au!=null){var av=new $.ig.OlapResultCell;av.cellOrdinal(ao);av.properties().add("Value",au.toString());av.properties().add("FmtValue",au.toString());ag.add(av)}}}}}var aw=this.ay(d,e,ag);return aw},ay:function(a,b,c){var $self=this;var d=function(){var $ret=new $.ig.OlapResult;$ret.axes(new $.ig.List$1($.ig.OlapResultAxis.prototype.$type,0));return $ret}();if(a!=null){d.axes().add(a)}if(b!=null){d.axes().add(b)}d.cells(c);d.isEmpty(b==null&&a==null&&c.count()==0);return d},az:function(a,b,c,d,e){var $self=this;if(b.count()<a.count()){a=b;d=c}for(var f=0;f<d.members().count();f++){if(f!=e){var g=d.members().item(f);var h;if(function(){var $ret=g.properties().tryGetValue("memberId",h);h=$ret.value;return $ret.ret}()){var i=$.ig.Number.prototype.parseInt(h);a=a.where$1($.ig.RowMetadata.prototype.$type,function(j){return j.h(g.levelUniqueName())==i}).toList$1($.ig.RowMetadata.prototype.$type)}}}return a},a0:function(a,b,c){var $self=this;var d=this.a2(this.ag().b().i().e());var e="none";var f=-1;if(c.count()>0){if(a!=null&&a.tuples().count()>0){var g=a.tuples().__inner[0];for(var h=0;h<g.members().count();h++){var i=g.members().item(h);if(i.hierarchyUniqueName()==d){e="columns";f=h;break}}}if(e=="none"){if(b!=null&&b.tuples().count()>0){var j=b.tuples().__inner[0];for(var k=0;k<j.members().count();k++){var l=j.members().item(k);if(l.hierarchyUniqueName()==d){e="rows";f=k;break}}}}}return function(){var $ret=new Array;$ret.add(e);$ret.add(f);return $ret}()},a1:function(a,b,c,d,e,f){var $self=this;var g=a[b];var h=this.g.item(g.uniqueName());var j=this.e.where$1($.ig.Level.prototype.$type,function(i){return i.hierarchyUniqueName()==e.uniqueName()&&i.depth()==g.depth()+1}).firstOrDefault$1($.ig.Level.prototype.$type);var k=null;if(d!=null){k=d.uniqueName()}var l;if(!function(){var $ret=$self.m.tryGetValue(g.uniqueName(),l);l=$ret.value;return $ret.ret}()){l=new $.ig.Dictionary$2(String,$.ig.Member.prototype.$type,0);this.m.add(g.uniqueName(),l)}var m=new $.ig.List$1($.ig.KeyListPair$1.prototype.$type.specialize($.ig.RowMetadata.prototype.$type),0);var n=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.RowMetadata.prototype.$type),0);var p=f.getEnumerator();while(p.moveNext()){var o=p.current();var q=h(o.e());if(q!=null){var r;if(!function(){var $ret=n.tryGetValue(q,r);r=$ret.value;return $ret.ret}()){r=new $.ig.List$1($.ig.RowMetadata.prototype.$type,0);n.add(q,r);m.add(new $.ig.KeyListPair$1($.ig.RowMetadata.prototype.$type,1,q,r))}r.add(o)}}for(var s=0;s<m.count();s++){var t=m.item(s).c();var u=m.item(s).d();var v=c+"&"+this.a2(t);var w=g.uniqueName()+v;var x;var y;var z;if(!function(){var $ret=l.tryGetValue(w,x);x=$ret.value;return $ret.ret}()){x=new $.ig.Member;x.caption(t);x.dimensionUniqueName(g.dimensionUniqueName());
x.hierarchyUniqueName(g.hierarchyUniqueName());x.levelDepth(g.depth());x.levelUniqueName(g.uniqueName());x.name(t);x.parentLevel(g.depth()-1);x.parentUniqueName(k);x.uniqueName(w);if(j!=null){x.childrenCardinality(1)}if(d!=null){d.childrenCardinality(d.childrenCardinality()+1)}l.add(w,x);y=this.h.count();this.h.add(x.uniqueName(),y);z=new $.ig.DataMemberMetadata(x,v,y,l.count());this.i.add(x.uniqueName(),z);this.j.add(x.uniqueName(),z);for(var aa=0;aa<u.count();aa++){var ab=u.item(aa);ab.g(g.uniqueName(),y);z.x(ab)}}if(b+1<a.length){this.a1(a,b+1,v,x,e,u)}}if(d!=null){d.childrenCardinality(m.count())}},a2:function(a){if(a.substr(0,1)!="["){a="["+a}if(a.substr(a.length-1,1)!="]"){a+="]"}return a},o:null,p:null,a3:function(){var a=new $.ig.List$1($.ig.Cube.prototype.$type,0);if(this.ag()==null||this.ag().b()==null){return a}var b=new $.ig.Cube;b.caption(this.ag().b().g());b.name(this.ag().b().f());b.description(this.ag().b().h());a.add(b);return a},a4:function(a){var b=new $.ig.List$1($.ig.Measure.prototype.$type,0);if(this.ag()==null||this.ag().b()==null||this.ag().b().i()==null||this.ag().b().i().f()==null){return b}var c=this.ag().b().i().e();var e=this.ag().b().i().f().getEnumerator();while(e.moveNext()){var d=e.current();var f=new $.ig.Measure;f.caption(d.k());f.defaultFormatString(d.i());f.measureDisplayFolder(d.l());f.name(d.j());f.uniqueName(this.a2(c)+"."+this.a2(d.j()));b.add(f);a.item(f.uniqueName(),d.g())}return b},a5:function(){if(this.b==null){this.b=this.a3()}var a=new $.ig.List$1($.ig.Dimension.prototype.$type,0);if(this.ag()==null||this.ag().b()==null){return a}var b=new $.ig.Dimension;b.dimensionType($.ig.DimensionType.prototype.measure);b.caption(this.ag().b().i().d());b.uniqueName(this.a2(this.ag().b().i().e()));a.add(b);if(this.ag().b().j()==null){return a}this.o=new $.ig.List$1($.ig.DimensionMetadata.prototype.$type,0);var d=this.ag().b().j().getEnumerator();while(d.moveNext()){var c=d.current();this.o.add(c);var e=new $.ig.Dimension;e.caption(c.h());e.defaultHierarchy(c.g());e.uniqueName(this.a2(c.f()));e.name(c.f());e.description(c.i());a.add(e)}return a},a6:function(){var $self=this;if(this.c==null){this.c=this.a5()}var a=new $.ig.List$1($.ig.Hierarchy.prototype.$type,0);if(this.ag()==null||this.ag().b()==null){return a}var b=new $.ig.Hierarchy;b.uniqueName(this.a2(this.ag().b().i().e()));b.dimensionUniqueName(this.a2(this.ag().b().i().e()));a.add(b);if(this.ag().b().j()==null){return a}this.p=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.HierarchyMetadata.prototype.$type),0);for(var c=0;c<this.o.count();c++){var d=this.o.item(c);if(d.j()!=null){var e;if(!function(){var $ret=$self.p.tryGetValue(d.f(),e);e=$ret.value;return $ret.ret}()){e=new $.ig.List$1($.ig.HierarchyMetadata.prototype.$type,0);this.p.add(d.f(),e)}var g=d.j().getEnumerator();while(g.moveNext()){var f=g.current();e.add(f);var h=new $.ig.Hierarchy;h.caption(f.g());h.description(f.h());h.dimensionUniqueName(this.a2(d.f()));h.hierarchyDisplayFolder(f.i());h.name(f.f());h.uniqueName(h.dimensionUniqueName()+"."+this.a2(h.name()));a.add(h)}}}return a},a7:function(){var $self=this;if(this.d==null){this.d=this.a6()}this.g=new $.ig.Dictionary$2(String,$.ig.Func$2.prototype.$type.specialize($.ig.Object.prototype.$type,String),0);var a=new $.ig.List$1($.ig.Level.prototype.$type,0);if(this.ag()==null||this.ag().b()==null){return a}var b=new $.ig.Level;b.hierarchyUniqueName(this.a2(this.ag().b().i().e()));b.uniqueName(b.hierarchyUniqueName()+".[MeasuresLevel]");b.depth(-1);a.add(b);if(this.ag().b().j()==null){return a}var c=new $.ig.HierarchyMetadata;c.f(this.ag().b().i().e());c.g(this.ag().b().i().d());var d=new $.ig.List$1($.ig.HierarchyMetadata.prototype.$type,0);d.add(c);for(var e=0;e<this.o.count();e++){var f=this.o.item(e);var g;if(function(){var $ret=$self.p.tryGetValue(f.f(),g);g=$ret.value;return $ret.ret}()){for(var h=0;h<g.count();h++){d.add(g.item(h))}}}for(var i=0;i<d.count();i++){var j=d.item(i);if(j.j()==null){continue}var k=this.d.item(i);for(var l=0;l<j.j().count();l++){var m=j.j().item(l);var n=new $.ig.Level;n.caption(m.e());n.depth(l);n.dimensionUniqueName(k.dimensionUniqueName());n.hierarchyUniqueName(k.uniqueName());n.name(m.d());n.uniqueName(k.uniqueName()+"."+this.a2(n.name()));a.add(n);var o;if(!function(){var $ret=$self.f.tryGetValue(k.uniqueName(),o);o=$ret.value;return $ret.ret}()){o=new $.ig.List$1($.ig.Level.prototype.$type,0);this.f.add(k.uniqueName(),o)}o.add(n);this.g.item(n.uniqueName(),m.f())}}return a},$type:new $.ig.Type("FlatDataProvider",$.ig.Object.prototype.$type,[$.ig.IFlatDataProvider.prototype.$type])},true);$.ig.util.defType("KeyListPair$1","Object",{$t:null,_c:null,c:function(a){if(arguments.length===1){this._c=a;return a}else{return this._c}},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},init:function($t,initNumber){if(initNumber>0){switch(initNumber){case 1:this.init1.apply(this,arguments);break}return}this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.c(String.empty());this.d(new $.ig.List$1(this.$t,0))},init1:function($t,initNumber,a,b){this.$t=$t;this.$type=this.$type.specialize(this.$t);$.ig.Object.prototype.init.call(this);this.c(a);this.d(b)},$type:new $.ig.Type("KeyListPair$1",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CellMetadata","Object",{init:function(a,b,c,d,e,f,g){$.ig.Object.prototype.init.call(this);this.rowIndex(a);this.columnIndex(b);this.cellOrdinal(c);this.measureIndex(d);this.rowTuples(e);this.columnTuples(f);this.measures(g)},_rowIndex:null,rowIndex:function(a){if(arguments.length===1){this._rowIndex=a;return a}else{return this._rowIndex}},_columnIndex:null,columnIndex:function(a){if(arguments.length===1){this._columnIndex=a;return a}else{return this._columnIndex}},_cellOrdinal:null,cellOrdinal:function(a){if(arguments.length===1){this._cellOrdinal=a;return a}else{return this._cellOrdinal}},_measureIndex:null,measureIndex:function(a){if(arguments.length===1){this._measureIndex=a;return a}else{return this._measureIndex}},_rowTuples:null,rowTuples:function(a){if(arguments.length===1){this._rowTuples=a;return a}else{return this._rowTuples}},_columnTuples:null,columnTuples:function(a){if(arguments.length===1){this._columnTuples=a;return a}else{return this._columnTuples}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},$type:new $.ig.Type("CellMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("CubeMetadata","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.j(new $.ig.ArrayListCollection$1($.ig.DimensionMetadata.prototype.$type))},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_i:null,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},$type:new $.ig.Type("CubeMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasuresDimensionMetadata","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},$type:new $.ig.Type("MeasuresDimensionMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DataMemberMetadata","Object",{init:function(a,b,c,d){$.ig.Object.prototype.init.call(this);this.h(a);this.i(b);this.g(c);this.j(d);this.k(new $.ig.List$1($.ig.RowMetadata.prototype.$type,0))},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_i:null,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},_k:null,k:function(a){if(arguments.length===1){this._k=a;return a}else{return this._k}},l:function(){var $self=this;return this.k().where$1($.ig.RowMetadata.prototype.$type,function(b){return b.f()==false}).toList$1($.ig.RowMetadata.prototype.$type)},x:function(a){this.k().add(a)},y:function(a){if(this.k().remove(a)){return true}return false},$type:new $.ig.Type("DataMemberMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DataSourceMetadata","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_b:null,b:function(a){if(arguments.length===1){this._b=a;return a}else{return this._b}},$type:new $.ig.Type("DataSourceMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("DimensionMetadata","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_i:null,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},$type:new $.ig.Type("DimensionMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("HierarchyMetadata","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_i:null,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},$type:new $.ig.Type("HierarchyMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("LevelMetadata","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},$type:new $.ig.Type("LevelMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("MeasureMetadata","Object",{init:function(){$.ig.Object.prototype.init.call(this);this.h($.ig.AggregatorType.prototype.sum)},_g:null,g:function(a){if(arguments.length===1){this._g=a;return a}else{return this._g}},_h:null,h:function(a){if(arguments.length===1){this._h=a;return a}else{return this._h}},_i:null,i:function(a){if(arguments.length===1){this._i=a;return a}else{return this._i}},_j:null,j:function(a){if(arguments.length===1){this._j=a;return a}else{return this._j}},_k:null,k:function(a){if(arguments.length===1){this._k=a;return a}else{return this._k}},_l:null,l:function(a){if(arguments.length===1){this._l=a;return a}else{return this._l}},$type:new $.ig.Type("MeasureMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("RowMetadata","Object",{a:null,b:null,init:function(a){$.ig.Object.prototype.init.call(this);this.a=new $.ig.Dictionary$2(String,$.ig.Number.prototype.$type,0);this.b=0;this.f(false);this.e(a)},g:function(a,b){if(this.a.containsKey(a)){return}this.a.item(a,b)},h:function(a){var $self=this;var b;(function(){var $ret=$self.a.tryGetValue(a,b);b=$ret.value;return $ret.ret})();return b},i:function(){this.b++;this.f(true)},j:function(){this.b--;this.f(this.b>0)},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},$type:new $.ig.Type("RowMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("TableMetadata","Object",{a:null,b:null,c:null,d:null,init:function(a){$.ig.Object.prototype.init.call(this);var b=0;var c=$.ig.util.cast($.ig.IList.prototype.$type,a);if(c!=null){b=c.count()}else{var e=a.getEnumerator();while(e.moveNext()){var d=e.current();b++}}this.c=new $.ig.List$1($.ig.RowMetadata.prototype.$type,0);this.b=new Array(b);var g=a.getEnumerator();while(g.moveNext()){var f=g.current();var h=new $.ig.RowMetadata(f);this.k(h);this.c.add(h)}this.a=new $.ig.List$1(String,0)},e:function(){return this.c},f:function(){return this.b},g:function(){return this.d},k:function(a){if(this.d==this.b.length){this.n()}this.b[this.d++]=a},l:function(a,b){if(this.d==this.b.length){this.n()}$.ig.Array.prototype.copy(this.b,a,this.b,a+1,this.d-a);this.b[a]=b;this.d++},m:function(a){var $self=this;this.d--;$.ig.Array.prototype.copy(this.b,a+1,this.b,a,this.d-a);(function(){var $ret=$.ig.Array.prototype.resize$1($.ig.RowMetadata.prototype.$type,$self.b,$self.d);$self.b=$ret.array;return $ret.ret})()},n:function(){var a=new Array(this.d+1);$.ig.Array.prototype.copy(this.b,0,a,0,this.d);this.b=a},$type:new $.ig.Type("TableMetadata",$.ig.Object.prototype.$type)},true);$.ig.util.defType("FlatDataSourceImpl","Object",{a:null,dataProvider:function(){if(this.a==null){this.a=this.dataProviderFactory().createDataProvider(this.sourceOptions().itemsSource(),this.sourceOptions().dataSourceMetadata())}return this.a},b:null,c:null,d:null,e:null,f:null,g:null,h:null,i:null,j:null,k:null,l:null,m:null,n:null,o:null,p:null,q:null,r:null,s:null,t:null,init:function(a){var $self=this;this.c=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);this.d=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);this.e=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);this.f=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);this.g=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);this.h=new $.ig.List$1(String,0);this.u=new $.ig.List$1($.ig.FlatDataAxisProvider.prototype.$type,0);$.ig.Object.prototype.init.call(this);this.i=false;this.j=null;this.k=false;this.l=null;this.p=false;this.o=false;this.q=false;this.isInitialized(false);this.sourceOptions(a);this.cubes(new $.ig.ArrayListCollection$1($.ig.Cube.prototype.$type));this.rowAxis(new $.ig.ArrayListCollection$1($.ig.ICoreOlapElement.prototype.$type));this.columnAxis(new $.ig.ArrayListCollection$1($.ig.ICoreOlapElement.prototype.$type));this.filters(new $.ig.ArrayListCollection$1($.ig.Hierarchy.prototype.$type));this.measures(new $.ig.ArrayListCollection$1($.ig.Measure.prototype.$type));this.dataProviderFactory(a.dataProviderFactory());if(this.dataProviderFactory()==null){this.dataProviderFactory(new $.ig.DefaultFlatDataProviderFactory)}this.measureListLocation($.ig.MeasureListLocation.prototype.columns);this.measureListIndex(-1);this.result(function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}())},_isInitialized:null,isInitialized:function(a){if(arguments.length===1){this._isInitialized=a;return a}else{return this._isInitialized}},_dataProviderFactory:null,dataProviderFactory:function(a){if(arguments.length===1){this._dataProviderFactory=a;return a}else{return this._dataProviderFactory}},_sourceOptions:null,sourceOptions:function(a){if(arguments.length===1){this._sourceOptions=a;return a}else{return this._sourceOptions}},ao:function($t,a){var b=new $.ig.ArrayListCollection$1($t);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},initialize:function(){var $self=this;if(this.i){return this.j}this.i=true;this.j=this.ap();var a=this.j;this.j.ac(function(b){$self.i=false;$self.j=null});return a},ap:function(){var $self=this;var a=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);if(this.isInitialized()){a.i(this.metadataTree());return a.d()}this.columnAxis().collectionChanged=$.ig.Delegate.prototype.combine(this.columnAxis().collectionChanged,this.bs.runOn(this));this.rowAxis().collectionChanged=$.ig.Delegate.prototype.combine(this.rowAxis().collectionChanged,this.bt.runOn(this));this.filters().collectionChanged=$.ig.Delegate.prototype.combine(this.filters().collectionChanged,this.bw.runOn(this));this.measures().collectionChanged=$.ig.Delegate.prototype.combine(this.measures().collectionChanged,this.bx.runOn(this));return this.dataProvider().discoverCubesAsync(null,null).continueWithTask$21($.ig.IEnumerable$1.prototype.$type,$.ig.OlapMetadataTreeItem.prototype.$type,function(b){var c=new $.ig.List$1($.ig.Cube.prototype.$type,0);var e=b.aa().getEnumerator();while(e.moveNext()){var d=e.current();c.add(d)}$self.cubes($self.ao($.ig.Cube.prototype.$type,b.aa()));return $self.ax($self.cubes().first$1($.ig.Cube.prototype.$type).name(),null)}).continueWithTask$21($.ig.IEnumerable$1.prototype.$type,$.ig.OlapMetadataTreeItem.prototype.$type,function(f){return $self.aq()})},aq:function(){var $self=this;var a=null;var b=null;var c=null;var d=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);if(!String.isNullOrEmpty(this.sourceOptions().columns())){var e=new $.ig.AxisDefinitionParser(this.sourceOptions().columns());a=e.w()}if(!String.isNullOrEmpty(this.sourceOptions().rows())){var f=new $.ig.AxisDefinitionParser(this.sourceOptions().rows());b=f.w()}if(!String.isNullOrEmpty(this.sourceOptions().filters())){var g=new $.ig.AxisDefinitionParser(this.sourceOptions().filters());c=g.w()}if(a!=null&&a.count()>0){var i=a.getEnumerator();while(i.moveNext()){var h=i.current();this.as($.ig.ICoreOlapElement.prototype.$type,h.name(),this.columnAxis(),$.ig.Hierarchy.prototype.$type);this.e.add(h);if(h.memberNames().count()>0){d.add(h);var k=h.memberNames().getEnumerator();while(k.moveNext()){var j=k.current();this.h.add(j)}}}}if(b!=null&&b.count()>0){var m=b.getEnumerator();while(m.moveNext()){var l=m.current();this.as($.ig.ICoreOlapElement.prototype.$type,l.name(),this.rowAxis(),$.ig.Hierarchy.prototype.$type);this.f.add(l);if(l.memberNames().count()>0){d.add(l);var o=l.memberNames().getEnumerator();while(o.moveNext()){var n=o.current();this.h.add(n)}}}}if(c!=null&&c.count()>0){var q=c.getEnumerator();while(q.moveNext()){var p=q.current();this.as($.ig.Hierarchy.prototype.$type,p.name(),this.filters(),$.ig.Hierarchy.prototype.$type);this.g.add(p);if(p.memberNames().count()>0){d.add(p);var s=p.memberNames().getEnumerator();while(s.moveNext()){var r=s.current();this.h.add(r)}}}}var t=null;if(!String.isNullOrEmpty(this.sourceOptions().measures())){var u=new $.ig.AxisDefinitionParser(this.sourceOptions().measures());t=u.w()}if(t!=null&&t.count()>0){var w=t.getEnumerator();while(w.moveNext()){var v=w.current();this.as($.ig.Measure.prototype.$type,v.name(),this.measures(),$.ig.Measure.prototype.$type)}}if(this.m||this.n||this.o||this.p||this.q){if(d.count()>0){var x=new Array(d.count());for(var y=0;y<d.count();y++){var z=d.item(y).name();x[y]=this.getMembersOfHierarchy(z)}var aa=new $.ig.TaskFactory;return aa.c($.ig.Task$1.prototype.$type,x,function(ab){return $self.be()}).continueWithTask$21($.ig.Task$1.prototype.$type,$.ig.OlapMetadataTreeItem.prototype.$type,function(ac){$self.at();var ad=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);ad.i($self.metadataTree());return ad.d()})}return this.be().continueWithTask$21($.ig.Task$1.prototype.$type,$.ig.OlapMetadataTreeItem.prototype.$type,function(ae){$self.at();var af=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);af.i($self.metadataTree());return af.d()})}this.at();var ag=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);ag.i(this.metadataTree());return ag.d()},as:function($tItem,a,b,c){var $self=this;var e=function(d){return d.uniqueName()==a};var f=this.getCoreElement(e,c);if(f!=null&&!b.contains$1($.ig.ICoreOlapElement.prototype.$type,f)){b.add(f)}},at:function(){this.isInitialized(true)},au:function(a){this.b=new $.ig.CubeMetaItemsCache;var b=a[0];var c=a[1];var d=a[2];var e=a[3];this.b.n(e.aa());this.b.o(b.aa());this.b.p(c.aa());this.b.q(d.aa())},_cube:null,cube:function(a){if(arguments.length===1){this._cube=a;return a}else{return this._cube}},_cubes:null,cubes:function(a){if(arguments.length===1){this._cubes=a;return a}else{return this._cubes}},setCube:function(a){if(!this.isInitialized()){throw new $.ig.InvalidOperationException(1,"Data source is not initialized.")}return this.ax(a,null)},ax:function(a,b){var $self=this;if(String.isNullOrEmpty(a)){if(a==null){throw new $.ig.ArgumentNullException("cubeName")}throw new $.ig.InvalidOperationException(1,"cubeName cannot be empty.")}var c=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);if(this.cube()!=null){if(this.cube().name()==a){c.i(this.metadataTree());return c.d()}this.ay()}var e=this.cubes().getEnumerator();while(e.moveNext()){var d=e.current();if(d.name()==a){this.cube(d);break}}var f=this.dataProvider();var g=new $.ig.List$1($.ig.Task.prototype.$type,0);g.add(f.discoverDimensionsAsync(null,null));g.add(f.discoverHierarchiesAsync(null,null));g.add(f.discoverLevelsAsync(null,null));g.add(f.discoverMeasuresAsync(null,null));var h=new Array(g.count());g.copyTo(h,0);var i=new $.ig.TaskFactory;return i.a(h,function(j){return $self.au(j)}).continueWithTask$1($.ig.OlapMetadataTreeItem.prototype.$type,function(k){return $self.az(null)})},ay:function(){this.cube(null);this.filters().clear();this.rowAxis().clear();this.columnAxis().clear();this.measures().clear();this.b=null},az:function(a){var $self=this;var b=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);var c=function(){var $ret=new $.ig.OlapMetadataTreeItem;$ret.type($.ig.OlapMetadataTreeItemType.prototype.cube);$ret.caption($self.cube().caption());$ret.item($self.cube());return $ret}();var d;var e;var f=true;if(String.isNullOrEmpty(a)){d=this.b.o();e=this.b.n()}else{f=false;d=this.b.s().getMeasureGroupDimensions(a);e=this.b.s().getMeasureGroupMeasures(a)}var g=$.ig.MetaTreeHelper.prototype.getDimensionMetaItems(d,e,this.b.p(),this.b.q(),f);$.ig.MetaTreeHelper.prototype.setMetaItemChildren(c,g);this.metadataTree(c);b.i(c);return b.d()},_metadataTree:null,metadataTree:function(a){if(arguments.length===1){this._metadataTree=a;return a}else{return this._metadataTree}},_rowAxis:null,rowAxis:function(a){if(arguments.length===1){this._rowAxis=a;return a}else{return this._rowAxis}},_columnAxis:null,columnAxis:function(a){if(arguments.length===1){this._columnAxis=a;return a}else{return this._columnAxis}},_filters:null,filters:function(a){if(arguments.length===1){this._filters=a;return a}else{return this._filters}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},measureListIndex:function(a){if(arguments.length===1){if(this.s!=a){this.r=true;this.s=a;this.bo();this.r=false}return a}else{return this.s}},measureListLocation:function(a){if(arguments.length===1){if(this.t!=a){this.bn();this.t=a;this.bo()}return a}else{return this.t}},expandTupleMember:function(a,b,c){var $self=this;var d=this.bj(a,this.result());if(d==null){throw new $.ig.InvalidOperationException(1,"No axis found for the specified index.")}var f=this.c.where$1($.ig.PositionInfo.prototype.$type,function(e){return e.d()==a&&e.e()==b&&e.f()==c}).firstOrDefault$1($.ig.PositionInfo.prototype.$type);if(f==null){f=function(){var $ret=new $.ig.PositionInfo;$ret.d(a);$ret.f(c);$ret.e(b);return $ret}();this.c.add(f)}else{this.c.remove(f)}},collapseTupleMember:function(a,b,c){var $self=this;var d=this.bj(a,this.result());if(d==null){throw new $.ig.InvalidOperationException(1,"No axis found for the specified index.")}var f=this.c.where$1($.ig.PositionInfo.prototype.$type,function(e){return e.d()==a&&e.e()==b&&e.f()==c}).firstOrDefault$1($.ig.PositionInfo.prototype.$type);if(f==null){f=function(){var $ret=new $.ig.PositionInfo;$ret.d(a);$ret.f(c);$ret.e(b);return $ret}();this.d.add(f)}else{this.c.remove(f)}},_result:null,result:function(a){if(arguments.length===1){this._result=a;return a}else{return this._result}},_aj:null,aj:function(a){if(arguments.length===1){this._aj=a;return a}else{return this._aj}},getCoreElement:function(a,b){if(b==$.ig.MeasureList.prototype.$type){var c;if(this.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){c=this.columnAxis()}else{c=this.rowAxis()}var d=null;var f=c.getEnumerator();while(f.moveNext()){var e=f.current();d=$.ig.util.cast($.ig.MeasureList.prototype.$type,e);if(d!=null){break}}return d}else{return this.getCoreElements(a,b).firstOrDefault$1($.ig.ICoreOlapElement.prototype.$type)}},getCoreElements:function(a,b){var $self=this;if(b==$.ig.Dimension.prototype.$type){return this.ao($.ig.Dimension.prototype.$type,this.b.o().where$1($.ig.Dimension.prototype.$type,function(c){return a(c)}))}if(b==$.ig.Hierarchy.prototype.$type){return this.ao($.ig.Dimension.prototype.$type,this.b.p().where$1($.ig.Dimension.prototype.$type,function(d){return a(d)}))}if(b==$.ig.Level.prototype.$type){return this.ao($.ig.Dimension.prototype.$type,this.b.q().where$1($.ig.Dimension.prototype.$type,function(e){return a(e)}))}if(b==$.ig.Measure.prototype.$type){return this.ao($.ig.Dimension.prototype.$type,this.b.n().where$1($.ig.Dimension.prototype.$type,function(f){return a(f)}))}throw new $.ig.NotSupportedException(0,"Supported types are Dimension, Hierarchy, Level and Measure")},clearPendingChanges:function(){this.d.clear();this.c.clear()},a8:function(a){var $self=this;if(a.count()==0){var b=new $.ig.TaskCompletionSource$1($.ig.IDictionary$2.prototype.$type.specialize(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type)),0);b.i(new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type),0));return b.d()}var c=new $.ig.List$1($.ig.Task.prototype.$type,0);var d=new $.ig.List$1($.ig.Number.prototype.$type,0);for(var e=0;e<a.count();e++){var f=a.item(e);var g=new $.ig.KeyValueItem;g.c("HIERARCHY_UNIQUE_NAME");g.d(f);var h=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);h.add(g);var i=this.dataProvider().discoverLevelsAsync(null,h);c.add(i);d.add(0)}var j=new Array(c.count());for(var k=0;k<c.count();k++){j[k]=c.item(k)}var l=new $.ig.TaskFactory;return l.c($.ig.IDictionary$2.prototype.$type,j,function(m){return $self.bb(m,d)}).continueWithTask$21($.ig.IDictionary$2.prototype.$type,$.ig.IDictionary$2.prototype.$type,function(n){return $self.a9(n.aa())})},a9:function(a){var $self=this;var b=new Array(a.count());var c=new Array(a.count());var d=0;var f=a.getEnumerator();while(f.moveNext()){var e=f.current();var g=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);g.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c("LEVEL_UNIQUE_NAME");$ret.d(e.value().uniqueName());return $ret}());b[d]=this.dataProvider().discoverMembersAsync(null,g);c[d]=e.key();d++}var h=new $.ig.TaskFactory;return h.c($.ig.IDictionary$2.prototype.$type,b,function(i){return $self.ba(i,c)})},ba:function(a,b){var c=new $.ig.Dictionary$2(String,$.ig.IEnumerable$1.prototype.$type.specialize($.ig.Member.prototype.$type),0);for(var d=0;d<b.length;d++){var e=b[d];if(!c.containsKey(e)){c.add(e,a[d].aa())}}return c},bb:function(a,b){var $self=this;var c=new $.ig.Dictionary$2(String,$.ig.Level.prototype.$type,0);for(var d=0;d<b.count();d++){var e=a[d];if(e.h()!=null||e.g()){return null}var f=b.item(d);var h=e.aa().where$1($.ig.Level.prototype.$type,function(g){return g.depth()==f}).firstOrDefault$1($.ig.Level.prototype.$type);if(h!=null&&!c.containsKey(h.hierarchyUniqueName())){c.add(h.hierarchyUniqueName(),h)}}return c},update:function(){var $self=this;if(this.k){return this.l}this.k=true;this.l=this.be();var a=this.l;this.l.ac(function(b){$self.k=false;$self.l=null});return a},bc:function(a,b){var c=0;var d=this.measureListIndex();if(a){var e=this.bm(c);if(e!=null&&this.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){if(d>-1){var f=e.o().rootPositionInfo();if(f!=null){this.bd(f,d-1)}}}c++}if(b){var g=this.bm(c);if(g!=null&&this.measureListLocation()==$.ig.MeasureListLocation.prototype.rows){if(d>-1){var h=g.o().rootPositionInfo();if(h!=null){this.bd(h,d-1)}}}}},bd:function(a,b){if(a.positionItemIndex()==b){a.clear()}else{var d=a.values().getEnumerator();while(d.moveNext()){var c=d.current();this.bd(c,b)}}},be:function(){var $self=this;var a=this.bg();if(!String.isNullOrEmpty(a)){var b=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);b.h(new $.ig.InvalidOperationException(1,a));return b.d()}var c=this.columnAxis().count()>0;var d=this.rowAxis().count()>0;if(!d&&!c&&this.measures().count()==0){var e=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}();var f=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);f.i(e);this.aj(new $.ig.OlapResultView(e,e,false,false));this.result(e);this.clearPendingChanges();return f.d()}var g=this.m;var h=this.n;var i=this.p||this.q;var j=this.o;var k=this.c.count()>0;var l=this.d.count()>0;var m=this.h.count()>0;if(!g&&!h&&!i&&!j&&!k&&!l&&!m){var n=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);n.i(this.result());return n.d()}if(this.p){this.bc(c,d)}var o=null;var p=null;var q=0;var r="Axis0";var s=this.m;if(this.p&&c&&this.measureListIndex()>-1&&this.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){s=true}o=this.bk(this.columnAxis(),s,q);this.m=false;if(o!=null){q++;r="Axis1"}var t=this.n;if(this.p&&d&&this.measureListIndex()>-1&&this.measureListLocation()==$.ig.MeasureListLocation.prototype.rows){t=true}p=this.bk(this.rowAxis(),t,q);this.n=false;if(p!=null){if(p.axis()!=null){p.axis().name(r)}q++}this.p=false;this.o=false;this.q=false;var u=new $.ig.List$1($.ig.AxisElement.prototype.$type,0);var w=this.e.getEnumerator();while(w.moveNext()){var v=w.current();u.add(v)}var y=this.f.getEnumerator();while(y.moveNext()){var x=y.current();u.add(x)}var aa=this.g.getEnumerator();while(aa.moveNext()){var z=aa.current();u.add(z)}var ab=this.bf(u,c,d,k,l,o,p);return ab},bf:function(a,b,c,d,e,f,g){var $self=this;if(this.h.count()>0){this.dataProvider().aq(a);var i=this.u.getEnumerator();while(i.moveNext()){var h=i.current();h.u()}this.h.clear()}this.bh(b,c);this.bi(b,c,true);if(d||e){var j=null;if(b){var l=this.c.where$1($.ig.PositionInfo.prototype.$type,function(k){return k.d()=="Axis0"}).toList$1($.ig.PositionInfo.prototype.$type);if(l.count()>0){var m=l.item(0);this.c.remove(m);var n=this.result().axes().item(0).tuples().__inner[m.e()];var o=n.members().item(m.f());var p=new $.ig.FlatDataPartialAxisProvider(this.dataProvider(),this.columnAxis(),o,this.b);var q=p.generateAxis("Axis0");j=q.continueWithTask$21($.ig.OlapResultAxis.prototype.$type,$.ig.OlapResult.prototype.$type,function(r){var s=$self.dataProvider().ap(p,g,$self.measures());return s});j=j.continueWithTask$21($.ig.OlapResultAxis.prototype.$type,$.ig.OlapResult.prototype.$type,function(t){if($self.bj("Axis0",t.aa()).tuples().count()==0){o.displayInfo(0)}var u=$self.aj();$self.aj($self.aj().extend(t.aa(),"Axis0"));$self.result($self.aj().visibleResult());$.ig.ResultViewHelper.prototype.b("Axis0",u,$self.aj());$.ig.ResultViewHelper.prototype.a(m.d(),m.e(),m.f(),true,$self.aj());f.y(p);f.axis($self.bj("Axis0",$self.result()));var v=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);v.i($self.aj().visibleResult());$.ig.ResultViewHelper.prototype.d(m.e(),m.f(),true,f.o());return v.d()})}}if(c){var w=b?"Axis1":"Axis0";var y=this.c.where$1($.ig.PositionInfo.prototype.$type,function(x){return x.d()==w}).toList$1($.ig.PositionInfo.prototype.$type);if(d&&y.count()>0){var z=y.item(0);this.c.remove(z);var ab=this.result().axes().where$1($.ig.PositionInfo.prototype.$type,function(aa){return aa.name()==w}).first$1($.ig.OlapResultAxis.prototype.$type).tuples().__inner[z.e()];var ac=ab.members().item(z.f());var ad;var ae=new $.ig.FlatDataPartialAxisProvider(this.dataProvider(),this.rowAxis(),ac,this.b);
if(j!=null){ad=j.continueWithTask$21($.ig.OlapResultAxis.prototype.$type,$.ig.OlapResult.prototype.$type,function(af){return ae.generateAxis(w)})}else{ad=ae.generateAxis(w)}j=ad.continueWithTask$21($.ig.OlapResultAxis.prototype.$type,$.ig.OlapResult.prototype.$type,function(ag){var ah=$self.dataProvider().ap(f,ae,$self.measures());return ah});j=j.continueWithTask$21($.ig.OlapResultAxis.prototype.$type,$.ig.OlapResult.prototype.$type,function(ai){if($self.aj()==null){$self.aj(new $.ig.OlapResultView($self.result(),$self.result(),b,c))}var aj=$self.aj().hasColumns()?"Axis1":"Axis0";if($self.bj(aj,ai.aa()).tuples().count()==0){ac.displayInfo(0)}var ak=$self.aj();$self.aj($self.aj().extend(ai.aa(),aj));$self.result($self.aj().visibleResult());$.ig.ResultViewHelper.prototype.b(aj,ak,$self.aj());$.ig.ResultViewHelper.prototype.a(z.d(),z.e(),z.f(),true,$self.aj());var al=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);al.i($self.aj().visibleResult());g.y(ae);g.axis($self.bj(aj,$self.result()));$.ig.ResultViewHelper.prototype.d(z.e(),z.f(),true,g.o());return al.d()})}}if(j!=null){return j}var am=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);am.i(this.result());return am.d()}else{var an=new $.ig.TaskCompletionSource$1($.ig.OlapResult.prototype.$type,0);if(f==null&&g==null&&this.measures().count()==0){var ao=function(){var $ret=new $.ig.OlapResult;$ret.isEmpty(true);return $ret}();this.result(ao);an.i(this.result());return an.d()}var ap=this.dataProvider().ap(f,g,this.measures());return ap.continueWithTask$21($.ig.OlapResultAxis.prototype.$type,$.ig.OlapResult.prototype.$type,function(aq){$self.aj(new $.ig.OlapResultView(aq.aa(),aq.aa(),b,c));$self.result($self.aj().visibleResult());$self.clearPendingChanges();an.i($self.result());return an.d()})}},bg:function(){var $self=this;var a=new $.ig.Dictionary$2(String,String,0);for(var b=0;b<this.columnAxis().count();b++){var c=this.columnAxis().item(b);if($.ig.util.cast($.ig.MeasureList.prototype.$type,c)!==null){continue}if(!a.containsKey(c.uniqueName())){a.add(c.uniqueName(),"columns")}else{return"the "+c.uniqueName()+" hierarchy is used twice in columns"}}for(var d=0;d<this.rowAxis().count();d++){var e=this.rowAxis().item(d);if($.ig.util.cast($.ig.MeasureList.prototype.$type,e)!==null){continue}if(!a.containsKey(e.uniqueName())){a.add(e.uniqueName(),"rows")}else{return"the "+e.uniqueName()+" hierarchy is used in rows and in columns"}}for(var f=0;f<this.filters().count();f++){var g=this.filters().item(f);var h;if(!function(){var $ret=a.tryGetValue(g.uniqueName(),h);h=$ret.value;return $ret.ret}()){a.add(g.uniqueName(),"filters")}else{return"the "+g.uniqueName()+" hierarchy is used in filters and in "+h}}for(var i=0;i<this.measures().count();i++){var j=this.measures().item(i);var k;if(!function(){var $ret=a.tryGetValue(j.uniqueName(),k);k=$ret.value;return $ret.ret}()){a.add(j.uniqueName(),"measures")}else{if(k=="measures"){return"the "+j.uniqueName()+" measure is used twice in measures"}return"the "+j.uniqueName()+" measure is used in measures and in "+k}}return null},bh:function(a,b){var $self=this;var c=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.PositionInfo.prototype.$type),0);var d=this.aj();for(var e=0;e<this.c.count();e++){var f=this.c.item(e);var g;if(!function(){var $ret=c.tryGetValue(f.d(),g);g=$ret.value;return $ret.ret}()){g=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);c.add(f.d(),g)}if(this.aj()==null){this.aj(new $.ig.OlapResultView(this.result(),this.result(),a,b))}var h=this.aj().expandTupleMember(f.d(),f.e(),f.f());if(h!=null){g.add(f);this.aj(h);this.result(this.aj().visibleResult())}}var j=c.getEnumerator();while(j.moveNext()){var i=j.current();var l=i.value().getEnumerator();while(l.moveNext()){var k=l.current();this.c.remove(k)}}var m=0;var n="Axis0";if(a){var p=c.keys().where$1(String,function(o){return o==n}).firstOrDefault$1(String)!=null;var q=this.bm(m);if(q!=null&&p){var r=c.item(n);if(r.count()>0){$.ig.ResultViewHelper.prototype.b(n,d,this.aj());var t=r.getEnumerator();while(t.moveNext()){var s=t.current();$.ig.ResultViewHelper.prototype.a(n,s.e(),s.f(),true,this.aj());$.ig.ResultViewHelper.prototype.d(s.e(),s.f(),true,q.o())}var u=this.bj(n,this.result());q.axis(u);$.ig.ResultViewHelper.prototype.e(u.positionResolver(),q.o())}}m++;n="Axis1"}if(b){var w=c.keys().where$1(String,function(v){return v==n}).firstOrDefault$1(String)!=null;var x=this.bm(m);if(x!=null&&w){var y=c.item(n);if(y.count()>0){$.ig.ResultViewHelper.prototype.b(n,d,this.aj());var aa=y.getEnumerator();while(aa.moveNext()){var z=aa.current();$.ig.ResultViewHelper.prototype.a(n,z.e(),z.f(),true,this.aj());$.ig.ResultViewHelper.prototype.d(z.e(),z.f(),true,x.o())}var ab=this.bj(n,this.result());x.axis(ab);$.ig.ResultViewHelper.prototype.e(ab.positionResolver(),x.o())}}}return this.c.count()>0},bi:function(a,b,c){var $self=this;if(this.result()!=null){var d=new $.ig.Dictionary$2(String,$.ig.IList$1.prototype.$type.specialize($.ig.PositionInfo.prototype.$type),0);var e=this.aj();for(var f=0;f<this.d.count();f++){var g=this.d.item(f);var h;if(!function(){var $ret=d.tryGetValue(g.d(),h);h=$ret.value;return $ret.ret}()){h=new $.ig.List$1($.ig.PositionInfo.prototype.$type,0);d.add(g.d(),h)}h.add(g);if(c){if(this.aj()==null){this.aj(new $.ig.OlapResultView(this.result(),this.result(),a,b))}else{this.aj(this.aj().collapseTupleMember(g.d(),g.e(),g.f()));this.result(this.aj().visibleResult())}}}var i=0;var j="Axis0";if(a){var l=d.keys().where$1(String,function(k){return k==j}).firstOrDefault$1(String)!=null;var m=this.bm(i);if(m!=null&&l){var n=d.item(j);if(n.count()>0){$.ig.ResultViewHelper.prototype.b(j,e,this.aj());var p=n.getEnumerator();while(p.moveNext()){var o=p.current();$.ig.ResultViewHelper.prototype.d(o.e(),o.f(),false,m.o())}var q=this.bj(j,this.result());m.axis(q)}}i++;j="Axis1"}if(b){var s=d.keys().where$1(String,function(r){return r==j}).firstOrDefault$1(String)!=null;var t=this.bm(i);if(t!=null&&s){var u=d.item(j);if(u.count()>0){$.ig.ResultViewHelper.prototype.b(j,e,this.aj());var w=u.getEnumerator();while(w.moveNext()){var v=w.current();$.ig.ResultViewHelper.prototype.d(v.e(),v.f(),false,t.o())}var x=this.bj(j,this.result());t.axis(x)}}}this.d.clear()}},bj:function(a,b){var $self=this;if(b!=null&&b.axes()!=null&&b.axes().count()>0){return b.axes().where$1($.ig.OlapResultAxis.prototype.$type,function(c){return c.name()==a}).firstOrDefault$1($.ig.OlapResultAxis.prototype.$type)}return null},bk:function(a,b,c){var d=null;if(a.count()>0){d=this.bm(c);if(b){if(d!=null){d.t(a)}else{d=new $.ig.FlatDataAxisProvider(this.dataProvider(),a,this.b);this.bl(c,d)}}}return d},bl:function(a,b){this.u.item(a,b)},bm:function(a){if(a<this.u.count()){return this.u.item(a)}return null},bn:function(){var a;if(this.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){a=this.columnAxis()}else{a=this.rowAxis()}if(a==null){return}var b=null;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();b=$.ig.util.cast($.ig.MeasureList.prototype.$type,d);if(b!=null){break}c++}if(b!=null){this.q=true;a.removeAt(c)}},bo:function(){var $self=this;var a;if(this.measureListLocation()==$.ig.MeasureListLocation.prototype.columns){a=this.columnAxis()}else{a=this.rowAxis()}var b=null;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();b=$.ig.util.cast($.ig.MeasureList.prototype.$type,d);if(b!=null){break}c++}if(this.measures().count()>1){if(b==null){b=function(){var $ret=new $.ig.MeasureList;$ret.measures($self.measures());return $ret}();if(this.measureListIndex()<0||this.measureListIndex()>a.count()){this.s=a.count();a.add(b)}else{a.insert(this.measureListIndex(),b)}}else{if(c!=this.measureListIndex()){a.removeAt(c);if(this.measureListIndex()>a.count()){this.s=a.count();a.add(b)}else{a.insert(this.measureListIndex(),b)}}}}else{if(b!=null){a.removeAt(c)}}},bp:function(a,b){var $self=this;var d=this.e.where$1($.ig.AxisElement.prototype.$type,function(c){return c.name()==a}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(d!=null){b=this.e;return{ret:d,filtersCollection:b}}d=this.f.where$1($.ig.AxisElement.prototype.$type,function(e){return e.name()==a}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(d!=null){b=this.f;return{ret:d,filtersCollection:b}}d=this.g.where$1($.ig.AxisElement.prototype.$type,function(f){return f.name()==a}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(d!=null){b=this.g;return{ret:d,filtersCollection:b}}b=null;return{ret:null,filtersCollection:b};return{filtersCollection:b}},getFilterMemberNames:function(a){var $self=this;var b;var c=function(){var $ret=$self.bp(a,b);b=$ret.filtersCollection;return $ret.ret}();if(c!=null){return this.ao(String,c.memberNames())}return new $.ig.ArrayListCollection$1(String)},addFilterMember:function(a,b){var $self=this;var c;var d=function(){var $ret=$self.bp(a,c);c=$ret.filtersCollection;return $ret.ret}();if(d==null){d=new $.ig.AxisElement(a,function(){var $ret=new $.ig.ArrayListCollection$1(String);$ret.add(b);return $ret}());c.add(d)}else{if(!d.memberNames().contains(b)){d.memberNames().add(b);if(this.h.contains(b)){this.h.remove(b)}else{this.h.add(b)}}}},removeFilterMember:function(a,b){var $self=this;var c;var d=function(){var $ret=$self.bp(a,c);c=$ret.filtersCollection;return $ret.ret}();if(d==null){return}if(d.memberNames().remove(b)){if(this.h.contains(b)){this.h.remove(b)}else{this.h.add(b)}}},removeAllFilterMembers:function(a){var $self=this;var b;var c=function(){var $ret=$self.bp(a,b);b=$ret.filtersCollection;return $ret.ret}();if(c==null){return}for(var d=c.memberNames().count()-1;d>=0;d--){var e=c.memberNames().item(d);c.memberNames().removeAt(d);if(this.h.contains(e)){this.h.remove(e)}else{this.h.add(e)}}},getMembersOfLevel:function(a){var $self=this;var b=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);var c=a;b.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c("LEVEL_UNIQUE_NAME");$ret.d(a);return $ret}());var d=this.dataProvider().discoverMembersAsync(null,b);d.ac(function(e){var g=e.aa().getEnumerator();while(g.moveNext()){var f=g.current();$self.b.ak(f)}$self.b.ag(c)});return d},tryGetMember:function(a,b){var $self=this;return{ret:function(){var $ret=$self.b.am(a,b);b=$ret.member;return $ret.ret}(),member:b};return{member:b}},tryGetMembersForLevel:function(a,b){var $self=this;return{ret:function(){var $ret=$self.b.ap(a,b);b=$ret.members;return $ret.ret}(),members:b};return{members:b}},getMembersOfHierarchy:function(a){var $self=this;var b=a;var c=new $.ig.CoreOlapElementParser(a);var d=c.r();if(d.count()<2){throw new $.ig.ArgumentException(1,"Specified value: "+a+" is not valid.",a)}var e=new $.ig.KeyValueItem;e.c("HIERARCHY_UNIQUE_NAME");e.d(d.item(0)+"."+d.item(1));var f=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);f.add(e);var g=this.dataProvider().discoverMembersAsync(null,f);g.ac(function(h){var j=h.aa().getEnumerator();while(j.moveNext()){var i=j.current();$self.b.ak(i)}$self.b.ai(b)});return g},getMembersOfMember:function(a){var $self=this;var b=new $.ig.CoreOlapElementParser(a);var c=b.r();var d=new $.ig.KeyValueItem;if(c.count()<3){throw new $.ig.ArgumentException(1,"Specified value: "+a+" is not valid.",a)}switch(c.count()){case 1:d.c("DIMENSION_UNIQUE_NAME");d.d(c.item(0));break;case 2:d.c("HIERARCHY_UNIQUE_NAME");d.d(c.item(0)+"."+c.item(1));break;default:d.c("LEVEL_UNIQUE_NAME");d.d(c.item(0)+"."+c.item(1)+"."+c.item(2));break}var e=new $.ig.List$1($.ig.KeyValueItem.prototype.$type,0);e.add(d);e.add(function(){var $ret=new $.ig.KeyValueItem;$ret.c("MEMBER_UNIQUE_NAME");$ret.d(a);return $ret}());var f=this.dataProvider().discoverMembersAsync(null,e);f.ac(function(g){var i=g.aa().getEnumerator();while(i.moveNext()){var h=i.current();$self.b.ak(h)}});return f},bq:function(a,b){var $self=this;switch(a.action()){case $.ig.NotifyCollectionChangedAction.prototype.add:var d=a.newItems().getEnumerator();while(d.moveNext()){var c=d.current();var e=$.ig.util.cast($.ig.Hierarchy.prototype.$type,c);if(e!=null){if(this.isInitialized()){b.add(new $.ig.AxisElement(e.uniqueName(),new $.ig.ArrayListCollection$1(String)))}}}break;case $.ig.NotifyCollectionChangedAction.prototype.remove:var g=a.oldItems().getEnumerator();while(g.moveNext()){var f=g.current();var h=$.ig.util.cast($.ig.Hierarchy.prototype.$type,f);if(h!=null){var j=b.where$1($.ig.AxisElement.prototype.$type,function(i){return i.name()==h.uniqueName()}).firstOrDefault$1($.ig.AxisElement.prototype.$type);if(j!=null){var k=new $.ig.List$1(String,0);for(var l=0;l<j.memberNames().count();l++){k.add(j.memberNames().item(l))}for(var m=0;m<k.count();m++){var n=k.item(m);this.removeFilterMember(j.name(),n)}b.remove(j)}}else if(!this.p&&!this.q&&!this.r){var o=$.ig.util.cast($.ig.MeasureList.prototype.$type,f);if(o!=null){this.measures().clear()}}}break}},br:function(a,b){var $self=this;var d=$.ig.util.cast($.ig.MeasureList.prototype.$type,b.where$1($.ig.ICoreOlapElement.prototype.$type,function(c){return $.ig.util.cast($.ig.MeasureList.prototype.$type,c)!==null}).firstOrDefault$1($.ig.ICoreOlapElement.prototype.$type));switch(a.action()){case $.ig.NotifyCollectionChangedAction.prototype.add:var f=a.newItems().getEnumerator();while(f.moveNext()){var e=f.current();var g=$.ig.util.cast($.ig.Hierarchy.prototype.$type,e);if(g!=null){if(d!=null&&this.measureListIndex()>=a.newStartingIndex()){this.measureListIndex(this.measureListIndex()+1)}}}break;case $.ig.NotifyCollectionChangedAction.prototype.remove:var i=a.oldItems().getEnumerator();while(i.moveNext()){var h=i.current();var j=$.ig.util.cast($.ig.Hierarchy.prototype.$type,h);if(j!=null){if(d!=null&&this.measureListIndex()>a.oldStartingIndex()){this.measureListIndex(this.measureListIndex()-1)}}}break}},bs:function(a,b){this.m=true;this.bu(0,this.columnAxis(),this.rowAxis());this.bq(b,this.e);this.br(b,this.columnAxis());if(b.action()!=$.ig.NotifyCollectionChangedAction.prototype.reset&&this.columnAxis()!=null){var c=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bv("Axis0",c)}},bt:function(a,b){this.n=true;this.bu(1,this.rowAxis(),this.columnAxis());this.bq(b,this.f);this.br(b,this.rowAxis());if(b.action()!=$.ig.NotifyCollectionChangedAction.prototype.reset&&this.rowAxis()!=null){var c=this.columnAxis()==null?"Axis0":"Axis1";var d=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bv(c,d)}},u:null,bu:function(a,b,c){if(b.count()>0){if(c.count()>0){if(this.u.count()<2){this.u.insert(a,null)}}else{if(this.u.count()==0){this.u.insert(0,null)}}}else{if(this.u.count()>0){if(this.u.count()>1){this.u.removeAt(a)}else{this.u.removeAt(0)}}}},bv:function(a,b){for(var c=this.d.count()-1;c>=0;c--){var d=this.d.item(c);if(d.d()==a&&d.f()>=b){this.d.removeAt(c)}}for(var e=this.c.count()-1;e>=0;e--){var f=this.c.item(e);if(f.d()==a&&f.f()>=b){this.c.removeAt(e)}}},bw:function(a,b){this.o=true;this.bq(b,this.g)},bx:function(a,b){this.p=true;this.bo()},$type:new $.ig.Type("FlatDataSourceImpl",$.ig.Object.prototype.$type,[$.ig.IOlapDataSource.prototype.$type])},true);$.ig.util.defType("IFlatDataProviderFactory","Object",{$type:new $.ig.Type("IFlatDataProviderFactory",null)},true);$.ig.util.defType("DefaultFlatDataProviderFactory","Object",{init:function(){$.ig.Object.prototype.init.call(this)},createDataProvider:function(a,b){return new $.ig.FlatDataProvider(a,b)},$type:new $.ig.Type("DefaultFlatDataProviderFactory",$.ig.Object.prototype.$type,[$.ig.IFlatDataProviderFactory.prototype.$type])},true);$.ig.util.defType("PositionInfo","Object",{init:function(){$.ig.Object.prototype.init.call(this)},_d:null,d:function(a){if(arguments.length===1){this._d=a;return a}else{return this._d}},_e:null,e:function(a){if(arguments.length===1){this._e=a;return a}else{return this._e}},_f:null,f:function(a){if(arguments.length===1){this._f=a;return a}else{return this._f}},$type:new $.ig.Type("PositionInfo",$.ig.Object.prototype.$type)},true);$.ig.util.defType("FlatDataSourceOptions","DataSourceBaseOptions",{init:function(){$.ig.DataSourceBaseOptions.prototype.init.call(this)},_itemsSource:null,itemsSource:function(a){if(arguments.length===1){this._itemsSource=a;return a}else{return this._itemsSource}},_dataSourceMetadata:null,dataSourceMetadata:function(a){if(arguments.length===1){this._dataSourceMetadata=a;return a}else{return this._dataSourceMetadata}},_dataProviderFactory:null,dataProviderFactory:function(a){if(arguments.length===1){this._dataProviderFactory=a;return a}else{return this._dataProviderFactory}},$type:new $.ig.Type("FlatDataSourceOptions",$.ig.DataSourceBaseOptions.prototype.$type)},true);$.ig.util.defType("OlapFlatDataSource","DataSourceBase",{j:null,init:function(a){this.j=null;this.k=false;$.ig.DataSourceBase.prototype.init.call(this);if(a==null){throw new $.ig.ArgumentNullException("options")}this.j=a;this.t(this.j)},m:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"metadata");if(b==null){throw new $.ig.InvalidOperationException(1,"metadata is null or undefined.")}var c=new $.ig.DataSourceMetadata;var d=this.n(b);c.b(d);return c},n:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"cube");if(b==null){throw new $.ig.InvalidOperationException(1,"metadata.cube is null or undefined.")}var c=new $.ig.CubeMetadata;c.f($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(b,"name"));if(String.isNullOrEmpty(c.f())){throw new $.ig.InvalidOperationException(1,"cube.name is null, empty or undefined")}c.g($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(b,"caption"));if(String.isNullOrEmpty(c.g())){c.g(c.f())}c.i(this.o(b));c.h($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(b,"description"));c.j(this.p(b));return c},o:function(a){var $self=this;var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"measuresDimension");if(b==null){return null}var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(b,"caption");var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(b,"name");var e=function(){var $ret=new $.ig.MeasuresDimensionMetadata;$ret.d(c);$ret.e(d);return $ret}();e.f(this.q(b));return e},p:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"dimensions");if(b==null){return null}var c=new $.ig.ArrayListCollection$1($.ig.DimensionMetadata.prototype.$type);for(var d=0;d<b.length;d++){var e=new $.ig.DimensionMetadata;c.add(e);var f=b[d];e.f($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"name"));if(String.isNullOrEmpty(e.f())){throw new $.ig.InvalidOperationException(1,"dimension.name is null, empty or undefined")}e.h($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"caption"));if(String.isNullOrEmpty(e.h())){e.h(e.f())}e.g($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"defaultHierarchy"));e.j(this.r(f));e.i($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"description"))}return c},q:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"measures");if(b==null){return null}var c=new $.ig.ArrayListCollection$1($.ig.MeasureMetadata.prototype.$type);for(var d=0;d<b.length;d++){var e=new $.ig.MeasureMetadata;c.add(e);var f=b[d];e.j($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"name"));if(String.isNullOrEmpty(e.j())){throw new $.ig.InvalidOperationException(1,"measure.name is null, empty or undefined")}e.k($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"caption"));if(String.isNullOrEmpty(e.k())){e.k(e.j())}e.i($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"displayFormat"));e.l($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"displayFolder"));e.g($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"aggregator"));if(e.g()==null){throw new $.ig.InvalidOperationException(1,"aggregator is null or undefined for measureMetadata: "+e.j())}}return c},r:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"hierarchies");if(b==null){return null}var c=new $.ig.ArrayListCollection$1($.ig.HierarchyMetadata.prototype.$type);for(var d=0;d<b.length;d++){var e=new $.ig.HierarchyMetadata;c.add(e);var f=b[d];e.f($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"name"));if(String.isNullOrEmpty(e.f())){throw new $.ig.InvalidOperationException(1,"hierarchy.hierarchyName is null, empty or undefined")}e.g($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"caption"));if(String.isNullOrEmpty(e.g())){e.g(e.f())}e.i($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"displayFolder"));e.j(this.s(f));if(e.j()==null||e.j().count()==0){throw new $.ig.InvalidOperationException(1,"levelKeys is null, empty or undefined for hierarchyMetadata: "+e.f())}}return c},s:function(a){var b=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(a,"levels");if(b==null){return null}var c=new $.ig.ArrayListCollection$1($.ig.LevelMetadata.prototype.$type);for(var d=0;d<b.length;d++){var e=new $.ig.LevelMetadata;c.add(e);var f=b[d];e.d($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"name"));if(String.isNullOrEmpty(e.d())){throw new $.ig.InvalidOperationException(1,"level.name is null, empty or undefined")}e.e($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"caption"));if(String.isNullOrEmpty(e.e())){e.e(e.d())}e.f($.ig.jQueryUtils.prototype.getJavascriptObjectProperty(f,"memberProvider"));if(e.f()==null){throw new $.ig.InvalidOperationException(1,"levelMetadata.memberProvider is null or undefined")}}return c},t:function(a){var options_=a;var schema_=this.u(a);var dataSource=options_.dataSource;if(!options_.dataSource&&options_.dataSourceUrl){options_.dataSource=options_.dataSourceUrl}var dataOptions={callback:this.dataSourceDataResolved,callee:this,dataSource:options_.dataSource,defaultChildrenDataProperty:options_.bindings.childDataProperty,responseDataType:options_.responseDataType,localSchemaTransform:options_.dataSourceType&&options_.dataSourceType==="xml"?true:false,schema:schema_};if(options_.dataSourceType){dataOptions.type=options_.dataSourceType}if(options_.responseDataKey){dataOptions.responseDataKey=options_.responseDataKey}if(!(options_.dataSource instanceof $.ig.DataSource)){options_.dataSource=new $.ig.DataSource(dataOptions)}options_.dataSource.dataBind(this.dataSourceDataResolved,this)},dataSourceDataResolved:function(){var $self=this;var a=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(this.j,"dataSource");if(a==null){throw new $.ig.InvalidOperationException(1,"dataSource is null or undefined")}var b=this.m(this.j);var c=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(this.j,"measures");var d=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(this.j,"filters");var e=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(this.j,"columns");var f=$.ig.jQueryUtils.prototype.getJavascriptObjectProperty(this.j,"rows");var g=$.ig.jQueryUtils.prototype.getJavascriptObjectMethodResult(a,"data");var h=function(){var $ret=new $.ig.FlatDataSourceOptions;$ret.measures(c);$ret.filters(d);$ret.columns(e);$ret.rows(f);$ret.itemsSource(g);$ret.dataSourceMetadata(b);return $ret}();this.dataSource(new $.ig.FlatDataSourceImpl(h));this.initDataSource()},initDataSource:function(){var $self=this;if(this.k){this.k=false;var a=this.dataSource().initialize();var promise_=a.f();a.ac(function(b){return $self.l.i(b.aa())});var $this=this;if(!this._isInitializedAttached){this._isInitializedAttached=true;promise_.always(function(result){var args={error:null,metadataTreeRoot:null};if(this.state()==="rejected"){args.error=result}else{args.metadataTreeRoot=result}$($this).trigger("initialized",args);$this._isInitializedAttached=false})}}},k:null,l:null,initialize:function(){if(this.dataSource()!=null){return $.ig.DataSourceBase.prototype.initialize.call(this)}this.k=true;this.l=new $.ig.TaskCompletionSource$1($.ig.OlapMetadataTreeItem.prototype.$type,0);return this.l.c().promise()},u:function(a){var options_=a;var schema_=null;var schema={},opt=options_,bindings=options_.bindings;if(bindings==null){opt.bindings={};schema.text={name:"Text",type:"string"};opt.bindings.textKey="Text";schema.value={name:"Value",type:"string"};opt.bindings.valueKey="Value";schema.imageUrl={name:"ImageUrl",type:"string"};opt.bindings.imageUrlKey="ImageUrl";schema.navigateUrl={name:"NavigateUrl",type:"string"};opt.bindings.navigateUrlKey="NavigateUrl";schema.childData={name:"Nodes",type:"object"};opt.bindings.childDataProperty="Nodes";schema.target={name:"Target",type:"string"};opt.bindings.targetKey="Target";bindings=opt.bindings}else if(opt.dataSourceType==="xml"){if(bindings.searchFieldXPath){schema.searchField=bindings.searchFieldXPath}}schema.fields=[];if(bindings.textKey){schema.fields.push({name:bindings.textKey,type:"string",xpath:bindings.textXPath});schema.textKey=bindings.textKey}if(bindings.valueKey){schema.fields.push({name:bindings.valueKey,type:"string",xpath:bindings.valueXPath});schema.valueKey=bindings.valueKey}if(bindings.navigateUrlKey){schema.fields.push({name:bindings.navigateUrlKey,type:"string",xpath:bindings.navigateUrlXPath});schema.navigateUrlKey=bindings.navigateUrlKey}if(bindings.imageUrlKey){schema.fields.push({name:bindings.imageUrlKey,type:"string",xpath:bindings.imageUrlXPath});schema.imageUrlKey=bindings.imageUrlKey}if(bindings.targetKey){schema.fields.push({name:bindings.targetKey,type:"string"});schema.targetKey=bindings.targetKey}if(bindings.expandedKey){schema.fields.push({name:"Expanded",type:"boolean"});schema.expandedKey=bindings.expandedKey}if(bindings.primaryKey){schema.fields.push({name:bindings.primaryKey,type:"string"});schema.primaryKey=bindings.primaryKey}if(bindings.childDataProperty){schema.fields.push({name:bindings.childDataProperty,type:"object",xpath:bindings.childDataXPath});schema.childDataProperty=bindings.childDataProperty}if(!schema.searchField&&opt.responseDataKey){schema.searchField=opt.responseDataKey}schema_=schema;return schema_},$type:new $.ig.Type("OlapFlatDataSource",$.ig.DataSourceBase.prototype.$type)},true);$.ig.FlatDataProvider.prototype.a="(All)";/*!@license
* Infragistics.Web.ClientUI Pivot Shared 13.1.20131.2523
*
* Copyright (c) 2011-2012 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on: 
*   jquery-1.4.4.js
*   jquery.ui.core.js
*   jquery.ui.widget.js
*   jquery.ui.draggable.js
*   jquery.ui.droppable.js
*   infragistics.util.js
*   infragistics.datasource.js
*   infragistics.olapxmladatasource.js
*   infragistics.olapflatdatasource.js
*   infragistics.templating.js
*   infragistics.ui.shared.js
*   infragistics.ui.scroll.js
*   infragistics.ui.tree.js
*/
(function($){var _aNull=function(val){return val===null||val===undefined},_draggable=$.ui.draggable.prototype.widgetFullName||$.ui.draggable.prototype.widgetName,_tree=$.ui.igTree.prototype.widgetFullName||$.ui.igTree.prototype.widgetName;$.ig=$.ig||{};$.ig.Pivot=$.ig.Pivot||{};$.ig.Pivot._pivotShared=$.ig.Pivot._pivotShared||{_isInstance:function(object,typeName){return typeName!==undefined&&!_aNull(object)&&object.$type&&object.$type.name===typeName},_const:{index:0,dragCursorAt:{top:-10,left:10},dragHelperMarkup:"<div class='ui-widget ui-corner-all ui-igpivot-draghelper'><p><span></span><strong>{0}</strong></p></div>",touchEvents:{mousedown:"touchstart",mouseover:"mouseover",mouseout:"mouseover"},ie:!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase())},_insertIndex:0,_showLastLevelExpanders:true,_createDataSource:function(dataSource,dataSourceOptions){var ds=null,dsOptions;if(!_aNull(dataSource)&&(this._isInstance(dataSource,"OlapXmlaDataSource")||this._isInstance(dataSource,"OlapFlatDataSource"))){ds=dataSource}else if(!_aNull(dataSourceOptions)){dsOptions=$.extend({},dataSourceOptions);delete dsOptions.xmlaOptions;delete dsOptions.flatDataOptions;if(!_aNull(dataSourceOptions.xmlaOptions)&&!_aNull(dataSourceOptions.xmlaOptions.serverUrl)){dsOptions=$.extend(dsOptions,dataSourceOptions.xmlaOptions);ds=new $.ig.OlapXmlaDataSource(dsOptions)}else if(!_aNull(dataSourceOptions.flatDataOptions)&&(!_aNull(dataSourceOptions.flatDataOptions.dataSource)||!_aNull(dataSourceOptions.flatDataOptions.dataSourceUrl))){dsOptions=$.extend(dsOptions,dataSourceOptions.flatDataOptions);ds=new $.ig.OlapFlatDataSource(dsOptions)}}return ds},_isTouch:function(){var isTouch=typeof window.Modernizr==="object"&&window.Modernizr.touch===true;if(!isTouch||navigator.appVersion.indexOf("Windows")!==-1){if(navigator.appVersion.indexOf("Windows")!==-1&&navigator.appVersion.indexOf("Tablet")!==-1){return true}}return false},_getEvent:function(event){if(this._isTouch()){return this._const.touchEvents[event]}return event},_makeDroppable:function(droppable){var $this=this;if(!this._isTouch()){droppable.droppable({tolerance:"pointer",accept:function(draggable){return draggable.hasClass("ui-igpivot-dragover")===false&&draggable.closest("li.ui-igtree-node").length===0&&(draggable.hasClass("ui-igpivot-metadataitem")||draggable.find(".ui-igpivot-metadataitem:first").length>0)},over:function(event,ui){var isValid=true,markup=$(ui.helper.html()),element=ui.draggable,typeName,name;if(!element.hasClass("ui-igpivot-metadataitem")){element=element.find(".ui-igpivot-metadataitem:first")}if(element.length>0){typeName=element.attr("data-type");name=element.attr("data-name")}else{return false}if($.isFunction($this.options.customMoveValidation)){isValid=$this.options.customMoveValidation.call($this.element,$this.widgetName,typeName,name)}if(ui.helper.hasClass("ui-igpivot-draghelper")){if(isValid){markup.find("span").removeClass("ui-icon-plus ui-icon-cancel").addClass("ui-icon-close").siblings("strong");ui.helper.removeClass($this.css.dropIndicator).addClass($this.css.invalidDropIndicator).html(markup)}else{markup.find("span").removeClass("ui-icon-plus ui-icon-close").addClass("ui-icon-cancel").siblings("strong");ui.helper.removeClass($this.css.dropIndicator).addClass($this.css.invalidDropIndicator).html(markup)}}},out:function(event,ui){var markup=$(ui.helper.html());if(ui.helper.hasClass("ui-igpivot-draghelper")){markup.find("span").removeClass("ui-icon-close ui-icon-plus").addClass("ui-icon-cancel").siblings("strong");ui.helper.removeClass($this.css.dropIndicator).addClass($this.css.invalidDropIndicator).html(markup)}},drop:function(event,ui){var element=ui.draggable,isValid=true,typeName,type,name,item,noCancel,location,dataRole;ui.draggable.unbind("."+$this.widgetName);if(!element.hasClass("ui-igpivot-metadataitem")){element=element.find(".ui-igpivot-metadataitem:first")}if(element.length>0){typeName=element.attr("data-type");name=element.attr("data-name")}else{return false}if($.isFunction($this.options.customMoveValidation)){dataRole=$(this).attr("data-role");location=dataRole===undefined?$this.widgetName:dataRole;isValid=$this.options.customMoveValidation.call($this.element,location,typeName,name)}if(!isValid){return false}switch(typeName){case $.ig.Dimension.prototype.getType().typeName():type=$.ig.Dimension.prototype.getType();break;case $.ig.Hierarchy.prototype.getType().typeName():type=$.ig.Hierarchy.prototype.getType();break;case $.ig.Measure.prototype.getType().typeName():type=$.ig.Measure.prototype.getType();break;case $.ig.MeasureList.prototype.getType().typeName():type=$.ig.MeasureList.prototype.getType();break;default:return false}item=$this._ds.getCoreElement(function(el){return el.uniqueName()===name},type);if(item){noCancel=$this._triggerMetadataRemoving(event,element,item);if(noCancel){$this._ds.removeFilterItem(item);$this._ds.removeRowItem(item);$this._ds.removeColumnItem(item);$this._ds.removeMeasureItem(item);$this._triggerMetadataRemoved(event,item);$this._updateDataSource();return true}}return false}})}},_createDropAreaOptions:function(){var $this=this,dropAreaOptions={greedy:true,tolerance:"pointer",activeClass:this.css.activeDropArea,accept:function(draggable){return $this._accept($(this),draggable)},over:function(event,ui){$this._onDraggableOver(event,ui)},out:function(event,ui){$this._onDraggableOut(event,ui)},drop:function(event,ui){var element=ui.draggable,type,name;if(!element.hasClass("ui-igpivot-metadataitem")){element=element.find(".ui-igpivot-metadataitem:first")}if(element.length>0){type=element.attr("data-type");name=element.attr("data-name");if(!name){name="null"}return $this._onDrop(event,ui,$(this),element,type,name)}return false}};return dropAreaOptions},_onDataSourceCollectionChanged:function(collection,collectionChangedArgs,dropArea,isDisabled){var action,items,i,length,name,filter,startingIndex,previousItem,destroyDraggable;action=collectionChangedArgs.action();switch(action){case $.ig.NotifyCollectionChangedAction.prototype.add:items=collectionChangedArgs.newItems().__inner;startingIndex=collectionChangedArgs.newStartingIndex();if(startingIndex===0){this._createMetadataElement(items[0],isDisabled,"prependTo",dropArea)}else{previousItem=dropArea.find(".ui-igpivot-metadataitem")[startingIndex-1];this._createMetadataElement(items[0],isDisabled,"insertAfter",previousItem)}break;case $.ig.NotifyCollectionChangedAction.prototype.remove:items=collectionChangedArgs.oldItems().__inner;filter=function(ind,itemElement){return $(itemElement).attr("data-name")===name};destroyDraggable=function(ind,el){var draggable=$(el).data(_draggable);if(draggable){draggable.destroy()}};for(i=0,length=items.length;i<length;i++){if(this._isInstance(items[i],"MeasureList")){dropArea.find(".ui-igpivot-metadataitem[data-type="+$.ig.MeasureList.prototype.getType().typeName()+"]").each(destroyDraggable).remove()}else{name=items[i].uniqueName();dropArea.find(".ui-igpivot-metadataitem").filter(filter).each(destroyDraggable).remove()}}break;case $.ig.NotifyCollectionChangedAction.prototype.reset:destroyDraggable=function(ind,el){var draggable=$(el).data(_draggable);if(draggable){draggable.destroy()}};dropArea.find(".ui-igpivot-metadataitem").each(destroyDraggable).remove();break}},_createMetadataElement:function(item,isDisabled,appendFunc,target){var $this=this,dragAndDropSettings=this.options.dragAndDropSettings,metadataElement,metadataElementMarkup;metadataElementMarkup="<li ";if(this._isInstance(item,"MeasureList")&&item.caption()===null){item.caption($.ig.PivotShared.locale.measureList)}else{metadataElementMarkup+="data-name='"+item.uniqueName()+"' "}metadataElementMarkup+="title='"+item.caption()+"' data-type='"+item.getType().typeName()+"'>";if(this._isInstance(item,"Hierarchy")&&!isDisabled){metadataElementMarkup+="<span style='display:block; float:left;' class='ui-icon "+this.css.filterIcon+"'></span>"}if(this.widget()[0].className.indexOf("ui-igpivotdataselector ui-droppable")!==-1&&target!==undefined){metadataElementMarkup+="<div style='float:left; display:block; width: calc(100%";if("Hierarchy"===item.getType().typeName()){metadataElementMarkup+=" - 28px"}else{metadataElementMarkup+=" - 16px"}metadataElementMarkup+=");overflow-x:hidden !important; text-overflow:ellipsis !important;'>";metadataElementMarkup+="<span data-role='caption'>";metadataElementMarkup+=item.caption();metadataElementMarkup+="</span>";metadataElementMarkup+="</div>"}else{metadataElementMarkup+="<span data-role='caption'>"+item.caption()+"</span>"}if(!isDisabled){metadataElementMarkup+="<span class='ui-icon ui-icon-close'></span>"}metadataElementMarkup+="</li>";metadataElement=$(metadataElementMarkup).addClass(this.css.metadataItem);metadataElement[appendFunc](target);if(!isDisabled){metadataElement.find("span.ui-icon-pivot-smallfilter").click(function(event){$this._createFilterDropDown(event,this,item);return false});metadataElement.find("span.ui-icon-close").click(function(event){var noCancel=$this._triggerMetadataRemoving(event,metadataElement,item);if(noCancel){$this._ds.removeFilterItem(item);$this._ds.removeRowItem(item);$this._ds.removeColumnItem(item);$this._ds.removeMeasureItem(item);$this._triggerMetadataRemoved(event,item);$this._updateDataSource();return false}return false});if(!this._isTouch()){metadataElement.draggable({appendTo:dragAndDropSettings.appendTo,containment:dragAndDropSettings.containment,opacity:dragAndDropSettings.dragOpacity,zIndex:dragAndDropSettings.zIndex,cursorAt:this._const.dragCursorAt,revert:false,cancel:".ui-icon",helper:function(event){var target=$(event.target).closest(".ui-igpivot-metadataitem").find("span[data-role='caption']"),markup=$($this._const.dragHelperMarkup.replace("{0}",target.text()));markup.addClass($this.css.invalidDropIndicator).find("span").addClass("ui-icon");return markup},start:function(event,ui){return $this._triggerDragStart(event,ui,item)},drag:function(event,ui){return $this._triggerDrag(event,ui,item)},over:function(event,ui){$this._onDraggableOver(event,ui)},out:function(event,ui){$this._onDraggableOut(event,ui)},stop:function(event,ui){$this._triggerDragStop(event,ui)}})}metadataElement.click(function(event){$this._createMetadataItemDropDown(event,this,item)})}return metadataElement},_accept:function(targetElement,draggable){var target,typeName,isValid=false,isMeasureDimension,dimension,dataSource=this._ds;if(!draggable.hasClass("ui-igpivot-metadataitem")){draggable=draggable.find(".ui-igpivot-metadataitem:first")}typeName=draggable.attr("data-type");target=targetElement.attr("data-role");$(".ui-igpivot-overlaydroparea").css("display","block");dimension=dataSource.getCoreElement(function(el){return el.dimensionType()===$.ig.DimensionType.prototype.measure},$.ig.Dimension.prototype.getType());isMeasureDimension=draggable.text()===dimension.name()||draggable.text()===dimension.caption();if(typeName){switch(target){case"rows":case"columns":isValid=typeName===$.ig.Hierarchy.prototype.getType().typeName()||typeName===$.ig.Dimension.prototype.getType().typeName()&&!isMeasureDimension||typeName===$.ig.MeasureList.prototype.getType().typeName();break;case"filters":isValid=typeName===$.ig.Hierarchy.prototype.getType().typeName()||typeName===$.ig.Dimension.prototype.getType().typeName()&&!isMeasureDimension;break;case"measures":isValid=(typeName===$.ig.Measure.prototype.getType().typeName()||isMeasureDimension)&&"MeasureList"!==draggable.attr("data-type");break}}return isValid},_onDraggableOver:function(event,ui){var $this=this,isValid=true,markup=$(ui.helper.html()),element=ui.draggable,typeName,name;ui.draggable.addClass("ui-igpivot-dragover");$(".ui-igpivot-overlaydroparea").css("display","none");if(!element.hasClass("ui-igpivot-metadataitem")){element=element.find(".ui-igpivot-metadataitem:first")}if(element.length>0){typeName=element.attr("data-type");name=element.attr("data-name")}else{return false}if($.isFunction(this.options.customMoveValidation)){isValid=this.options.customMoveValidation.call(this.element,$(event.target).attr("data-role"),typeName,name)}if(ui.helper.hasClass("ui-igpivot-draghelper")){if(isValid){markup.find("span").removeClass("ui-icon-cancel ui-icon-close").addClass("ui-icon-plus").siblings("strong");ui.helper.removeClass(this.css.invalidDropIndicator).addClass(this.css.dropIndicator).html(markup)}else{markup.find("span").removeClass("ui-icon-plus ui-icon-close").addClass("ui-icon-cancel").siblings("strong");ui.helper.removeClass(this.css.dropIndicator).addClass(this.css.invalidDropIndicator).html(markup)}}if(!isValid){return false}ui.draggable.bind("drag."+this.widgetName,function(event1,ui1){$this._onDraggableDrag(event1,ui1)})},_onDraggableDrag:function(event,ui){var target=$(event.originalEvent.target),insertItem="<li class='"+this.css.insertItem+"'></li>";if(target.hasClass("ui-igpivot-insertitem")){if(!this._const.ie||this._const.ie&&document.documentMode!==8){return}}$(document).find(".ui-igpivot-insertitem").remove();if(target.is("span")){target=target.closest(".ui-igpivot-metadataitem")}if(!(target.parent().hasClass("ui-igpivot-droparea")||target.hasClass("ui-igpivot-droparea"))){return}if(target.is(".ui-igpivot-metadataitem")){if(this._shouldAppendToTarget(target,ui)){this._insertIndex=target.index()+1;$(insertItem).insertAfter(target)}else{if(target.index()===0){this._insertIndex=0;$(insertItem).insertBefore(target)}else{this._insertIndex=target.index();$(insertItem).insertBefore(target)}}}else if(target.is(".ui-igpivot-droparea")){target=target.find(".ui-igpivot-metadataitem:last");this._insertIndex=target.index()+1;$(insertItem).insertAfter(target)}},_onDraggableOut:function(event,ui){var markup=$(ui.helper.html()),invalidIcon;ui.draggable.removeClass("ui-igpivot-dragover");invalidIcon=ui.draggable.closest("li.ui-igtree-node").length===0?"ui-icon-close":"ui-icon-cancel";if(ui.helper.hasClass("ui-igpivot-draghelper")){markup.find("span").removeClass("ui-icon-plus").addClass(invalidIcon).siblings("strong");ui.helper.removeClass(this.css.dropIndicator).addClass(this.css.invalidDropIndicator).html(markup)}ui.draggable.unbind("drag."+this.widgetName);$(document).find(".ui-igpivot-insertitem").remove();this._insertIndex=0},_getDefaultHierarchy:function(dimensionName,name,dataSource,typeName){var i,firstHierarchy,returnValue;dimensionName=name.substr(1,name.length-2);if(null!==dataSource.getDimension(name)&&$.ig.DimensionType.prototype.measure===dataSource.getDimension(name).dimensionType()){for(i=dataSource.metadataTree().children().length-1;i>=0;i--){if(name===dataSource.metadataTree().children()[i].item().uniqueName()){firstHierarchy=dataSource.metadataTree().children()[i];while(null!==firstHierarchy.children()){firstHierarchy=firstHierarchy.children()[0]}name=firstHierarchy.item().uniqueName();returnValue=dataSource.getMeasure(name)}}}else if(typeName===$.ig.Dimension.prototype.getType().typeName()){for(i=dataSource.metadataTree().children().length-1;i>=0;i--){if(dimensionName===dataSource.metadataTree().children()[i].item().name()||dimensionName===dataSource.metadataTree().children()[i].item().name().replace(" ","")){if(typeof dataSource.metadataTree().children()[i].item().defaultHierarchy==="function"&&dataSource.metadataTree().children()[i].item().defaultHierarchy()){name=dataSource.metadataTree().children()[i].item().defaultHierarchy()}else if(null!==dataSource.metadataTree().children()[i].children()[0].item()){name=dataSource.metadataTree().children()[i].children()[0].item().uniqueName()}else{firstHierarchy=dataSource.metadataTree().children()[i].children()[0];while(null===firstHierarchy.item()){firstHierarchy=firstHierarchy.children()[0]}name=firstHierarchy.item().uniqueName()}break}}returnValue=dataSource.getHierarchy(name)}else{returnValue=null}return returnValue},_onDrop:function(event,ui,targetElement,draggedElement,typeName,name){var dataSource=this._ds,isValid=true,targetRole=$(targetElement).attr("data-role"),targetIndex=this._insertIndex,item,type,sourceRole,sourceIndex,filterMembers,i,noCancel,firstHierarchy,dimensionName;ui.draggable.unbind("."+this.widgetName);$(document).find(".ui-igpivot-insertitem").remove();if($.isFunction(this.options.customMoveValidation)){isValid=this.options.customMoveValidation.call(this.element,$(event.target).attr("data-role"),typeName,name)}if(!isValid){return false}switch(typeName){case $.ig.Dimension.prototype.getType().typeName():type=$.ig.Dimension.prototype.getType();break;case $.ig.Hierarchy.prototype.getType().typeName():type=$.ig.Hierarchy.prototype.getType();break;case $.ig.Measure.prototype.getType().typeName():type=$.ig.Measure.prototype.getType();break;case $.ig.MeasureList.prototype.getType().typeName():type=$.ig.MeasureList.prototype.getType();break;default:return false}item=this._getDefaultHierarchy(dimensionName,name,dataSource,typeName);if(null===item){item=dataSource.getCoreElement(function(el){return el.uniqueName()===name},type)}if(!item){return false}noCancel=this._triggerMetadataDropping(event,ui,targetElement,draggedElement,item,targetIndex);if(noCancel){if((sourceIndex=$.inArray(item,dataSource.filters()))>-1){sourceRole="filters"}else if((sourceIndex=$.inArray(item,dataSource.rowAxis()))>-1){sourceRole="rows"}else if((sourceIndex=$.inArray(item,dataSource.columnAxis()))>-1){sourceRole="columns"}else if((sourceIndex=$.inArray(item,dataSource.measures()))>-1){sourceRole="measures"}else{sourceRole=null}if(sourceRole!==null&&sourceRole===targetRole&&sourceIndex<targetIndex){targetIndex--}if(this._isInstance(item,"MeasureList")){dataSource.setMeasureListLocation(targetRole);dataSource.setMeasureListIndex(targetIndex)}else{if(this._isInstance(item,"Hierarchy")){filterMembers=dataSource.getFilterMemberNames(name)}switch(sourceRole){case"filters":dataSource.removeFilterItem(item);break;case"rows":dataSource.removeRowItem(item);break;case"columns":dataSource.removeColumnItem(item);break;case"measures":dataSource.removeMeasureItem(item);break}switch(targetRole){case"filters":dataSource.insertFilterItem(targetIndex,item);break;case"rows":dataSource.insertRowItem(targetIndex,item);break;case"columns":dataSource.insertColumnItem(targetIndex,item);break;case"measures":dataSource.insertMeasureItem(targetIndex,item);break}if(this._isInstance(item,"Hierarchy")){for(i=0;i<filterMembers.length;i++){dataSource.addFilterMember(name,filterMembers[i])}}}if(this.widgetName==="igPivotGrid"&&ui.draggable.data(_draggable)){delete ui.draggable.data(_draggable).plugins.stop}this._updateDataSource();this._triggerMetadataDropped(event,ui,targetElement,draggedElement,item,targetIndex);return true}return false},_createMetadataItemDropDown:function(event,targetElement,metadataItem){var $this=this,options=this.options,dataSource=this._ds,closestDropArea,dropDownParent,dropDownElement,menu,addMeasureList,addHierarchy,items,customValidation,dimensionName,defaultHierarchy,defaultHierarchyElement;closestDropArea=$(targetElement).closest(".ui-igpivot-droparea").attr("data-role");if($.isFunction(this.options.customMoveValidation)){customValidation=function(location){return $this.options.customMoveValidation.call($this.element,location,metadataItem.getType().name,metadataItem.uniqueName()||undefined)}}else{customValidation=function(){return true}}dropDownParent=$(this.options.dropDownParent).first();dropDownElement=$("<div class='"+this.css.metadataItemDropDown+"'></div>");dropDownElement.data("efh","1");dropDownElement.appendTo(dropDownParent).bind(this._getEvent("mousedown"),function(event1){event1.stopPropagation()});menu=$("<ul class='ui-widget'></ul>").appendTo(dropDownElement);defaultHierarchy=this._getDefaultHierarchy(dimensionName,metadataItem.uniqueName(),dataSource,metadataItem.getType().typeName());if(defaultHierarchy){metadataItem=defaultHierarchy}defaultHierarchyElement=$("li[data-name='"+metadataItem.uniqueName()+"']");if(0<defaultHierarchyElement.length){closestDropArea=defaultHierarchyElement.parent().attr("data-role")}if(this._isInstance(metadataItem,"Measure")){if(!options.disableMeasuresDropArea&&closestDropArea!=="measures"&&customValidation("measures")){$("<li><span class='ui-icon ui-icon-pivot-measures'></span>"+$.ig.PivotShared.locale.addToMeasures+"</li>").appendTo(menu).click(function(){$this._ds.removeMeasureItem(metadataItem);$this._ds.addMeasureItem(metadataItem);dropDownElement.remove();$this._updateDataSource()})}}else if(this._isInstance(metadataItem,"MeasureList")){addMeasureList=function(location,index){$this._ds.setMeasureListLocation(location);$this._ds.setMeasureListIndex(index);dropDownElement.remove();$this._updateDataSource()};if(!options.disableColumnsDropArea&&closestDropArea!=="columns"&&customValidation("columns")){$("<li><span class='ui-icon ui-icon-pivot-clumns'></span>"+$.ig.PivotShared.locale.addToColumns+"</li>").appendTo(menu).click(function(){addMeasureList("columns",$this._ds.columnAxis().length)})}if(!options.disableRowsDropArea&&closestDropArea!=="rows"&&customValidation("rows")){$("<li><span class='ui-icon ui-icon-pivot-rows'></span>"+$.ig.PivotShared.locale.addToRows+"</li>").appendTo(menu).click(function(){addMeasureList("rows",$this._ds.rowAxis().length)})}}else{addHierarchy=function(addMethod){var i,name=metadataItem.uniqueName(),filterMembers=$this._ds.getFilterMemberNames(name);$this._ds.removeFilterItem(metadataItem);$this._ds.removeColumnItem(metadataItem);$this._ds.removeRowItem(metadataItem);$this._ds[addMethod](metadataItem);for(i=0;i<filterMembers.length;i++){$this._ds.addFilterMember(name,filterMembers[i])}dropDownElement.remove();$this._updateDataSource()};if(!options.disableFiltersDropArea&&closestDropArea!=="filters"&&customValidation("filters")){$("<li><span class='ui-icon ui-icon-pivot-filters'></span>"+$.ig.PivotShared.locale.addToFilters+"</li>").appendTo(menu).click(function(){addHierarchy("addFilterItem")})}if(!options.disableColumnsDropArea&&closestDropArea!=="columns"&&customValidation("columns")){$("<li><span class='ui-icon ui-icon-pivot-columns'></span>"+$.ig.PivotShared.locale.addToColumns+"</li>").appendTo(menu).click(function(){addHierarchy("addColumnItem")})}if(!options.disableRowsDropArea&&closestDropArea!=="rows"&&customValidation("rows")){$("<li><span class='ui-icon ui-icon-pivot-rows'></span>"+$.ig.PivotShared.locale.addToRows+"</li>").appendTo(menu).click(function(){addHierarchy("addRowItem")})}}items=dropDownElement.find("li");if(items.length===0){dropDownElement.remove();return}dropDownElement.css("position","absolute").position({of:targetElement,my:"left top",at:"left bottom"});items.bind(this._getEvent("mouseover"),function(){$(this).addClass("ui-state-hover")}).bind(this._getEvent("mouseout"),function(){$(this).removeClass("ui-state-hover")});$(document).bind(this._getEvent("mousedown")+"."+this.widgetName,function(){dropDownElement.remove();$(document).unbind("."+$this.widgetName)})},_createFilterDropDown:function(event,targetElement,hierarchy){var $this=this,hierarchyName,hierarchyFilterView,dropDownParent,dropDownElement,filterMembersTree,buttonContainer,removeFilterDropDown,noCancel;noCancel=this._triggerFilterDropDownOpening(event,hierarchy);if(noCancel){hierarchyName=hierarchy.uniqueName();hierarchyFilterView=new $.ig.HierarchyFilterView(hierarchy);dropDownParent=$(this.options.dropDownParent).first();dropDownElement=$("<div class='"+this.css.filterDropDown+"'></div>");dropDownElement.data("efh","1");dropDownElement.css("position","absolute").attr("data-hierarchy",hierarchyName).appendTo(dropDownParent).position({of:targetElement,my:"left top",at:"left bottom"}).bind(this._getEvent("mousedown"),function(event1){event1.stopPropagation()});filterMembersTree=$("<div class='"+this.css.filterMembers+"'></div>").appendTo(dropDownElement);buttonContainer=$("<div class='ui-igpivot-filterdropdown-buttoncontainer'></div>").appendTo(dropDownElement);removeFilterDropDown=function(event1){$this._removeFilterDropDown(event1,dropDownElement,hierarchy)};$("<button></button>").attr("data-role","ok").text($.ig.PivotShared.locale.ok).appendTo(buttonContainer).igButton().igButton("disable").click(function(event1){$this._onFilterOk(event1,dropDownElement,hierarchyFilterView,hierarchy)});$("<button></button>").attr("data-role","cancel").text($.ig.PivotShared.locale.cancel).appendTo(buttonContainer).igButton().click(removeFilterDropDown);$(document).bind(this._getEvent("mousedown")+"."+this.widgetName,removeFilterDropDown);this._loadFilterMembers(hierarchyFilterView,hierarchy,removeFilterDropDown);this._triggerFilterDropDownOpened(event,dropDownElement,hierarchy)}},_loadFilterMembers:function(hierarchyFilterView,hierarchy,removeFilterDropDown){var $this=this,dataSource,hierarchyName,rootFilterMembers,filterMembers,filterMember,member,members,maxLevel,levels,levelMembers,rootLevel,i;dataSource=this._ds;hierarchyName=hierarchy.uniqueName();filterMembers=dataSource.getFilterMemberNames(hierarchyName);if(filterMembers.length>0){members=[];maxLevel=0;for(i=0;i<filterMembers.length;i++){member=dataSource.tryGetMember(filterMembers[i]);if(member){members.push(member);if(member.levelDepth()>maxLevel){maxLevel=member.levelDepth()}}}levels=dataSource.getCoreElements(function(el){return el.hierarchyUniqueName()===hierarchyName&&el.depth()<=maxLevel},$.ig.Level.prototype.getType());for(i=0;i<levels.length;i++){levelMembers=dataSource.tryGetMembersForLevel(levels[i].uniqueName());hierarchyFilterView.addFiltersForMembers(levelMembers)}rootFilterMembers=hierarchyFilterView.getRootFilterMembers();rootFilterMembers=rootFilterMembers?rootFilterMembers.__inner:[];for(i=0;i<rootFilterMembers.length;i++){rootFilterMembers[i].isSelected(false)}for(i=0;i<members.length;i++){filterMember=hierarchyFilterView.tryGetFilterMember(members[i].uniqueName()).filterMember;if(filterMember){filterMember.isSelected(true)}}}rootLevel=dataSource.getCoreElement(function(el){return el.depth()===0&&el.hierarchyUniqueName()===hierarchyName},$.ig.Level.prototype.getType());this._ds.getMembersOfLevel(rootLevel.uniqueName()).done(function(m){$this._onFilterMembersLoaded(hierarchyFilterView,m,hierarchy)}).fail(removeFilterDropDown)},_onFilterMembersLoaded:function(hierarchyFilterView,members,hierarchy){var hierarchyName,dropDownElement,filterMembersTree;hierarchyName=hierarchy.uniqueName();hierarchyFilterView.addFiltersForMembers(members);dropDownElement=$(".ui-igpivot-filterdropdown").filter(function(){return $(this).attr("data-hierarchy")===hierarchyName});if(dropDownElement.length>0){filterMembersTree=$(dropDownElement[0]).find(".ui-igpivot-filtermembers");this._initTree(filterMembersTree,hierarchyFilterView)}},_getScrollBarWidth:function(){var el=$('<div style="width: 100px; height: 100px; position: absolute; top: -10000px; left: -10000px; overflow: scroll"></div>').appendTo($(document.body)),scrollWidth;scrollWidth=el[0].offsetWidth-el[0].clientWidth;el.remove();return scrollWidth},_getElementSize:function(element){var el=$('<div style="width: 5000px; height: 5000px; position: absolute; top: -10000px; left: -10000px;"></div>').appendTo($(document.body)),result,position,float;position=element.css("position");float=element.css("float");element.css({position:"relative","float":"left"});element.appendTo(el);result=[element.width(),element.height()];element.css("position",position);element.css("float",float);element.detach();el.remove();return result},_arrangeDropDown:function(onExpand){var $this=this,fdd,fm,fmHeight,bcHeight,ddTop,bTop,bHeight,bBottom,fmBottom,fmMaxHeight,ddLeft,bLeft,bWidth,bRight,fmRight,fddMaxWidth,windowHeight,windowInnerHeight,parentOffset,elementSize,fddWidth,scrollTop,dropDownOffsetBottom;dropDownOffsetBottom=30;fdd=$(".ui-igpivot-filterdropdown");fm=$(".ui-igpivot-filterdropdown .ui-igpivot-filtermembers");fmHeight=fm.height();bcHeight=$(".ui-igpivot-filterdropdown-buttoncontainer").innerHeight();ddTop=parseInt(fdd.css("top").replace("px",""),10);bTop=$(document).scrollTop();windowHeight=$(window).height();windowInnerHeight=window.innerHeight;bHeight=windowHeight>windowInnerHeight?windowHeight:windowInnerHeight;bBottom=bTop+bHeight;fmBottom=bBottom-bcHeight-dropDownOffsetBottom;fmMaxHeight=Math.floor(fmBottom-ddTop);ddLeft=parseInt(fdd.css("left").replace("px",""),10);bLeft=$("body").css("left");if(bLeft==="auto"){bLeft=0}else{bLeft=parseInt(bLeft.replace("px",""),10)}bWidth=$("body").width();bRight=bLeft+bWidth;fmRight=bRight;fddMaxWidth=Math.floor(fmRight-ddLeft);fm.css("max-height",fmMaxHeight);fdd.css("max-width",fddMaxWidth);parentOffset=parseInt(fdd.css("padding-left").replace("px",""),10)+parseInt(fdd.css("padding-right").replace("px",""),10)+parseInt(fdd.css("border-left-width").replace("px",""),10)+parseInt(fdd.css("border-right-width").replace("px",""),10);scrollTop=fm[0].scrollTop;fm.detach();elementSize=$this._getElementSize(fm);fdd.prepend(fm);fm[0].scrollTop=scrollTop;fddWidth=elementSize[0]+$this._getScrollBarWidth()+parseInt(fm.css("padding-right").replace("px",""),10)+parentOffset;fddWidth=Math.max(fddWidth,parseInt(fdd.css("min-width").replace("px",""),10));fdd.css("width",fddWidth);if(fmHeight>fmMaxHeight||onExpand===false){if(fddWidth<=fddMaxWidth){fm.css("overflow-x","hidden")}else{fm.css("overflow-x","auto")}}},_initTree:function(filterMembersTree,hierarchyFilterView){var $this=this,dataSource=this._ds,checkChildNodes,parsedFilterMembers;$(filterMembersTree).siblings(".ui-igpivot-filterdropdown-buttoncontainer").children(".ui-igbutton[data-role=ok]").igButton("enable");checkChildNodes=function(nodeElement,filterMembers){var isSelected,state,i,filterMember;for(i=0;i<filterMembers.length;i++){filterMember=filterMembers[i].filterMember;isSelected=filterMember.isSelected();if(isSelected.hasValue()){if(isSelected.value()){state="on"}else{state="off"}}else{state="partial"}$(nodeElement).find(".ui-igtree-node[data-value='"+filterMembers[i].uniqueName+"']").children("[data-role=checkbox]").attr("data-chk",state).children("span").removeClass("ui-state-disabled ui-igcheckbox-normal-on ui-igcheckbox-normal-partial ui-igcheckbox-normal-off").addClass("ui-igcheckbox-normal-"+state+(state==="partial"?" ui-igcheckbox-normal-on ui-state-disabled":""))}};parsedFilterMembers=this._parseFilterMembers(hierarchyFilterView.getRootFilterMembers());filterMembersTree.igTree({dataSource:parsedFilterMembers,loadOnDemand:true,checkboxMode:"triState",bindings:{textKey:"caption",valueKey:"uniqueName",childDataProperty:"children"},nodeCollapsed:function(event,ui){$this._arrangeDropDown(false)},nodeCheckstateChanged:function(event,ui){var okButton,isSelected;okButton=$(this).siblings(".ui-igpivot-filterdropdown-buttoncontainer").children(".ui-igbutton[data-role=ok]");if(ui.newCheckedNodes&&ui.newCheckedNodes.length>0){okButton.igButton("enable")}else{okButton.igButton("disable")}isSelected=$(ui.node.element).children("[data-role=checkbox]").attr("data-chk");isSelected=isSelected==="partial"?null:isSelected==="on"?true:false;ui.node.data.filterMember.isSelected(isSelected)},nodeExpanded:function(ect,ui){$this._arrangeDropDown(true);var i,collection,element;if(!$.ig.Pivot._pivotShared._showLastLevelExpanders){element=ui.node.element;collection=ui.node.data.children;if(collection!==null&&0<collection.length){for(i=0;i<collection.length;i++){if(null!==collection[i].children&&0===collection[i].children.length){element.find(".ui-igtree-node").eq(i).find("span:first").css("display","none")}}}}}}).css("overflow-x","hidden").data(_tree)._executeUrlRequest=function(node,binding,path,key){var $$this=this,nodeData=this.nodeDataFor(node.attr("data-path")),ul,indicator,levels;ul=node.children("ul");$("<li style='width: 20px' data-role='loading'>&nbsp;</li>").appendTo(ul);ul.show();indicator=ul.children("li").igLoading({includeVerticalOffset:false}).data("igLoading").indicator();indicator.show();this._populatingNode={ul:ul,node:node,indicator:indicator};levels=dataSource.getCoreElements(function(el){return el.hierarchyUniqueName()===nodeData.member.hierarchyUniqueName()},$.ig.Level.prototype.$type);
$.ig.Pivot._pivotShared._showLastLevelExpanders=true;dataSource.getMembersOfMember(nodeData.member.uniqueName()).done(function(members){var parsedFilterMembers1;if(members.item(0)&&levels.length-1===members.item(0).levelDepth()){$.ig.Pivot._pivotShared._showLastLevelExpanders=false}hierarchyFilterView.addFiltersForMembers(members);parsedFilterMembers1=$this._parseFilterMembers(nodeData.filterMember.children());$$this._populateNodeData(true,"",{data:function(){return parsedFilterMembers1}});$$this._updateParentState(node);checkChildNodes(node,nodeData.children);$this._triggerFilterMembersLoaded(node,parsedFilterMembers,parsedFilterMembers1)})};checkChildNodes(filterMembersTree,parsedFilterMembers);this._triggerFilterMembersLoaded(filterMembersTree,parsedFilterMembers,parsedFilterMembers)},_parseFilterMembers:function(filterMembers){var parsedFilterMembers,parsedFilterMember,filterMember,member,i;if(filterMembers===null){return[]}filterMembers=filterMembers.__inner;parsedFilterMembers=[];for(i=0;i<filterMembers.length;i++){filterMember=filterMembers[i];member=filterMember.member();parsedFilterMember={};parsedFilterMember.filterMember=filterMember;parsedFilterMember.member=member;parsedFilterMember.caption=member.caption();parsedFilterMember.uniqueName=member.uniqueName();parsedFilterMember.children=[];parsedFilterMembers.push(parsedFilterMember)}return parsedFilterMembers},_onFilterOk:function(event,dropDownElement,hierarchyFilterView,hierarchy){var dataSource=this._ds,hierarchyName=hierarchy.uniqueName(),filterMembers,checkedFilterMembers,i,noCancel;filterMembers=hierarchyFilterView.getSelectedFilterItems().__inner;checkedFilterMembers=[];for(i=0;i<filterMembers.length;i++){checkedFilterMembers.push(filterMembers[i].member().uniqueName())}noCancel=this._triggerFilterDropDownOk(event,dropDownElement,hierarchy,checkedFilterMembers);if(noCancel){dataSource.removeAllFilterMembers(hierarchyName);for(i=0;i<checkedFilterMembers.length;i++){dataSource.addFilterMember(hierarchyName,checkedFilterMembers[i])}this._updateDataSource();this._removeFilterDropDown(event,dropDownElement,hierarchy)}},_removeFilterDropDown:function(event,dropDownElement,hierarchy){var noCancel;noCancel=this._triggerFilterDropDownClosing(event,dropDownElement,hierarchy);if(noCancel){dropDownElement.find(".ui-igtree").igTree("destroy");dropDownElement.find(".ui-button").igButton("destroy");dropDownElement.remove();$(document).unbind("."+this.widgetName);this._triggerFilterDropDownClosed(event,hierarchy)}},_triggerDataSourceInitialized:function(evt,args){this._trigger("dataSourceInitialized",evt,args)},_triggerDataSourceUpdated:function(evt,args){this._trigger("dataSourceUpdated",evt,args)},_triggerDragStart:function(event,ui,item){var args={helper:ui.helper,offset:ui.offset,originalPosition:ui.originalPosition,position:ui.position,metadata:item};$(".ui-igpivot-overlaydroparea").css("display","block");return this._trigger("dragStart",event,args)},_triggerDrag:function(event,ui,item){var args={helper:ui.helper,offset:ui.offset,originalPosition:ui.originalPosition,position:ui.position,metadata:item};return this._trigger("drag",event,args)},_triggerDragStop:function(event,ui){$(".ui-igpivot-overlaydroparea").css("display","none");this._trigger("dragStop",event,ui)},_triggerMetadataDropping:function(event,ui,targetElement,item,itemIndex){var args={helper:ui.helper,offset:ui.offset,position:ui.position,targetElement:targetElement,metadata:item,metadataIndex:itemIndex};return this._trigger("metadataDropping",event,args)},_triggerMetadataDropped:function(event,ui,targetElement,draggedElement,item,itemIndex){var args={helper:ui.helper,offset:ui.offset,position:ui.position,targetElement:targetElement,draggedElement:draggedElement,metadata:item,metadataIndex:itemIndex};this._trigger("metadataDropped",event,args)},_triggerMetadataRemoving:function(event,targetElement,item){var args={targetElement:targetElement,metadata:item};return this._trigger("metadataRemoving",event,args)},_triggerMetadataRemoved:function(event,item){var args={metadata:item};this._trigger("metadataRemoved",event,args)},_triggerFilterDropDownOpening:function(event,hierarchy){var args={hierarchy:hierarchy};return this._trigger("filterDropDownOpening",event,args)},_triggerFilterDropDownOpened:function(event,dropDownElement,hierarchy){var args={dropDownElement:dropDownElement,hierarchy:hierarchy};this._trigger("filterDropDownOpened",event,args)},_triggerFilterMembersLoaded:function(parent,rootFilterMembers,filterMembers){var args={parent:parent,rootFilterMembers:rootFilterMembers,filterMembers:filterMembers};this._trigger("filterMembersLoaded",null,args)},_triggerFilterDropDownOk:function(event,dropDownElement,hierarchy,filterMembers){var args={dropDownElement:dropDownElement,hierarchy:hierarchy,filterMembers:filterMembers};return this._trigger("filterDropDownOk",event,args)},_triggerFilterDropDownClosing:function(event,dropDownElement,hierarchy){var args={dropDownElement:dropDownElement,hierarchy:hierarchy};return this._trigger("filterDropDownClosing",event,args)},_triggerFilterDropDownClosed:function(event,hierarchy){var args={hierarchy:hierarchy};this._trigger("filterDropDownClosed",event,args)}};$.widget("ui.igOlapDataSourceWidget",{_create:function(){this._ds=$.ig.Pivot._pivotShared._createDataSource(null,this.options.dataSourceOptions)},dataSource:function(){return this._ds}})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Pivot Data Selector 13.1.20131.2523
*
* Copyright (c) 2011-2012 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on: 
*	jquery-1.4.4.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	jquery.ui.draggable.js
*	jquery.ui.droppable.js
*	infragistics.util.js
*	infragistics.datasource.js
*	infragistics.olapxmladatasource.js
*	infragistics.olapflatdatasource.js
*	infragistics.templating.js
*	infragistics.ui.shared.js
*   infragistics.ui.scroll.js
*	infragistics.ui.combo.js
*	infragistics.ui.tree.js
*	infragistics.ui.pivot.shared.js
*/
(function($){var _droppable=$.ui.droppable.prototype.widgetFullName||$.ui.droppable.prototype.widgetName;$.widget("ui.igPivotDataSelector",{css:{dataSelector:"ui-igpivotdataselector",dataSelectorRoot:"ui-igpivotdataselector-root",catalog:"ui-igpivotdataselector-catalog",cube:"ui-igpivotdataselector-cube",measureGroup:"ui-igpivotdataselector-measuregroup",metadata:"ui-igpivotdataselector-metadata ui-widget-content",metadataItem:"ui-igpivot-metadataitem ui-widget ui-corner-all ui-state-default",dropAreasTable:"ui-igpivotdataselector-dropareas",dropArea:"ui-igpivot-droparea ui-widget-content",activeDropArea:"active",filtersIcon:"ui-icon ui-icon-pivot-filters",columnsIcon:"ui-icon ui-icon-pivot-columns",rowsIcon:"ui-icon ui-icon-pivot-rows",measuresIcon:"ui-icon ui-icon-pivot-measures",updateLayout:"ui-igpivotdataselector-updatelayout",dropIndicator:"ui-state-highlight",invalidDropIndicator:"ui-state-error",insertItem:"ui-igpivot-insertitem ui-state-highlight ui-corner-all",metadataItemDropDown:"ui-igpivot-metadatadropdown ui-widget ui-widget-content",filterIcon:"ui-icon ui-icon-pivot-smallfilter",filterDropDown:"ui-igpivot-filterdropdown ui-widget ui-widget-content",filterMembers:"ui-igpivot-filtermembers"},options:{width:250,height:null,dataSource:null,dataSourceOptions:{xmlaOptions:{serverUrl:null,catalog:null,cube:null,measureGroup:null,requestOptions:{withCredentials:false,beforeSend:null},enableResultCache:true,discoverProperties:null,executeProperties:null,mdxSettings:{nonEmptyOnRows:true,nonEmptyOnColumns:true,addCalculatedMembersOnRows:true,addCalculatedMembersOnColumns:true,dimensionPropertiesOnRows:[],dimensionPropertiesOnColumns:[]}},flatDataOptions:{dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseDataType:null,metadata:{cube:{name:null,caption:null,measuresDimension:{name:null,caption:null,measures:[{name:null,caption:null,aggregator:null,displayFolder:null}]},dimensions:[{name:null,caption:null,hierarchies:[{name:null,caption:null,displayFolder:null,levels:[{name:null,caption:null,memberProvider:null}]}]}]}}},measures:null,filters:null,rows:null,columns:null},deferUpdate:false,dragAndDropSettings:{appendTo:"body",containment:false,zIndex:10},dropDownParent:"body",disableRowsDropArea:false,disableColumnsDropArea:false,disableMeasuresDropArea:false,disableFiltersDropArea:false,customMoveValidation:null},events:{dataSelectorRendered:null,dataSourceInitialized:null,dataSourceUpdated:null,deferUpdateChanged:null,dragStart:null,drag:null,dragStop:null,metadataDropping:null,metadataDropped:null,metadataRemoving:null,metadataRemoved:null,filterDropDownOpening:null,filterDropDownOpened:null,filterMembersLoaded:null,filterDropDownOk:null,filterDropDownClosing:null,filterDropDownClosed:null},_deferUpdate:false,_create:function(){var $this=this,elementName=this.element[0].nodeName.toUpperCase();if(elementName!=="DIV"){throw new Error(elementName+$.ig.PivotDataSelector.locale.invalidBaseElement)}this.element.addClass(this.css.dataSelector);this._onFiltersChanged=function(collection,collectionChangedArgs){var dropArea=$this.element.find(".ui-igpivot-droparea[data-role=filters]");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableFiltersDropArea)};this._onRowAxisChanged=function(collection,collectionChangedArgs){var dropArea=$this.element.find(".ui-igpivot-droparea[data-role=rows]");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableRowsDropArea)};this._onColumnAxisChanged=function(collection,collectionChangedArgs){var dropArea=$this.element.find(".ui-igpivot-droparea[data-role=columns]");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableColumnsDropArea)};this._onMeasuresChanged=function(collection,collectionChangedArgs){var dropArea=$this.element.find(".ui-igpivot-droparea[data-role=measures]");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableMeasuresDropArea)};this._setDataSource();this._makeDroppable(this.element)},_setOption:function(key,value){var dropArea,droppable;switch(key){case"dataSource":this._clearDataSource();this.options.dataSourceOptions=null;this.options.dataSource=this._createDataSource(value,null);this._setDataSource();break;case"dataSourceOptions":this._clearDataSource();this.options.dataSourceOptions=value;this.options.dataSource=this._createDataSource(null,value);this._setDataSource();break;case"deferUpdate":$.Widget.prototype._setOption.apply(this,arguments);this._deferUpdate=value;this.element.find(".ui-igpivotdataselector-deferupdate").attr("checked",value);this.element.find(".ui-igpivotdataselector-updatelayout").igButton(value?"enable":"disable");break;case"width":$.Widget.prototype._setOption.apply(this,arguments);this.element.width(value);this.element.find(".ui-igpivotdataselector-catalog, .ui-igpivotdataselector-cube, .ui-igpivotdataselector-measuregroup").igCombo("option","width",this.element.children(".ui-igpivotdataselector-root").width());break;case"height":$.Widget.prototype._setOption.apply(this,arguments);this.element.height(value);break;case"dragAndDropSettings":$.Widget.prototype._setOption.apply(this,arguments);this.element.find(":ui-draggable").each(function(ind,el){var draggable=$(el);draggable.draggable("option","appendTo",value.appendTo);draggable.draggable("option","containment",value.containment);draggable.draggable("option","zIndex",value.zIndex)});break;case"disableRowsDropArea":$.Widget.prototype._setOption.apply(this,arguments);dropArea=this.element.find(".ui-igpivot-droparea[data-role=rows]");if(value){droppable=dropArea.data(_droppable);if(droppable){droppable.destroy()}}else if(!this._isTouch()){dropArea.droppable(this._createDropAreaOptions())}this._fillDropArea(dropArea,this._ds.rowAxis(),this.options.disableRowsDropArea);break;case"disableColumnsDropArea":$.Widget.prototype._setOption.apply(this,arguments);dropArea=this.element.find(".ui-igpivot-droparea[data-role=columns]");if(value){droppable=dropArea.data(_droppable);if(droppable){droppable.destroy()}}else if(!this._isTouch()){dropArea.droppable(this._createDropAreaOptions())}this._fillDropArea(dropArea,this._ds.columnAxis(),this.options.disableColumnsDropArea);break;case"disableMeasuresDropArea":$.Widget.prototype._setOption.apply(this,arguments);dropArea=this.element.find(".ui-igpivot-droparea[data-role=measures]");if(value){droppable=dropArea.data(_droppable);if(droppable){droppable.destroy()}}else if(!this._isTouch()){dropArea.droppable(this._createDropAreaOptions())}this._fillDropArea(dropArea,this._ds.measures(),this.options.disableMeasuresDropArea);break;case"disableFiltersDropArea":$.Widget.prototype._setOption.apply(this,arguments);dropArea=this.element.find(".ui-igpivot-droparea[data-role=filters]");if(value){droppable=dropArea.data(_droppable);if(droppable){droppable.destroy()}}else if(!this._isTouch()){dropArea.droppable(this._createDropAreaOptions())}this._fillDropArea(dropArea,this._ds.filters(),this.options.disableFiltersDropArea);break}},_initUI:function(){var $this=this,dataSource=this._ds,rootDiv,comboOptions,droppableOptions,dropAreasTable,tableRow,tableHeader,tableColumn,dropArea,deferUpdateCheck,deferUpdateLabel;if(this.options.width){this.element.width(this.options.width)}if(this.options.height){this.element.height(this.options.height)}rootDiv=$("<div class='ui-widget "+this.css.dataSelectorRoot+"'></div>").appendTo(this.element);if(this._isInstance(dataSource,"OlapXmlaDataSource")){comboOptions={textKey:"_caption",valueKey:"_name",mode:"dropdown",enableClearButton:false,width:rootDiv.width()};$("<input class='"+this.css.catalog+"' />").appendTo(rootDiv).igCombo($.extend({nullText:$.ig.PivotDataSelector.locale.catalog,selectionChanged:function(evt,ui){$this._onCatalogSelected(ui.items[0].value)}},comboOptions));$("<input class='"+this.css.cube+"' />").appendTo(rootDiv).igCombo($.extend({nullText:$.ig.PivotDataSelector.locale.cube,selectionChanged:function(evt,ui){$this._onCubeSelected(ui.items[0].value)}},comboOptions));$("<input class='"+this.css.measureGroup+"' />").appendTo(rootDiv).igCombo($.extend({nullText:$.ig.PivotDataSelector.locale.measureGroup,selectionChanged:function(evt,ui){$this._onMeasureGroupSelected(ui.items[0].value)}},comboOptions))}$("<div class='"+this.css.metadata+"'></div>").appendTo(rootDiv).addClass().igTree({initialExpandDepth:0,bindings:{nodeContentTemplate:"<span class='ui-igpivot-metadataitem' data-name='${name}' data-type='${type}'><span class='${image}'/>${caption}</span>",childDataProperty:"children"},rendered:function(evt,ui){ui.owner.element.removeAttr("data-scroll")}});droppableOptions=this._createDropAreaOptions();dropAreasTable=$("<table class='"+this.css.dropAreasTable+"'></table>").appendTo(rootDiv);tableRow=$("<tr></tr>").appendTo(dropAreasTable);tableHeader=$("<th></th>").appendTo(tableRow);$("<span class='"+this.css.filtersIcon+"'></span>").appendTo(tableHeader);$("<span></span>").text($.ig.PivotDataSelector.locale.filters).appendTo(tableHeader);tableHeader=$("<th></th>").appendTo(tableRow);$("<span class='"+this.css.columnsIcon+"'></span>").appendTo(tableHeader);$("<span></span>").text($.ig.PivotDataSelector.locale.columns).appendTo(tableHeader);tableRow=$("<tr></tr>").appendTo(dropAreasTable);tableColumn=$("<td></td>").appendTo(tableRow);dropArea=$("<ul class='"+this.css.dropArea+"' data-role='filters'></ul>").appendTo(tableColumn);if(!this.options.disableFiltersDropArea&&!this._isTouch()){dropArea.droppable(droppableOptions)}tableColumn=$("<td></td>").appendTo(tableRow);dropArea=$("<ul class='"+this.css.dropArea+"' data-role='columns'></ul>").appendTo(tableColumn);if(!this.options.disableColumnsDropArea&&!this._isTouch()){dropArea.droppable(droppableOptions)}tableRow=$("<tr></tr>").appendTo(dropAreasTable);tableHeader=$("<th></th>").appendTo(tableRow);$("<span class='"+this.css.rowsIcon+"'></span>").appendTo(tableHeader);$("<span></span>").text($.ig.PivotDataSelector.locale.rows).appendTo(tableHeader);tableHeader=$("<th></th>").appendTo(tableRow);$("<span class='"+this.css.measuresIcon+"'></span>").appendTo(tableHeader);$("<span></span>").text($.ig.PivotDataSelector.locale.measures).appendTo(tableHeader);tableRow=$("<tr></tr>").appendTo(dropAreasTable);tableColumn=$("<td></td>").appendTo(tableRow);dropArea=$("<ul class='"+this.css.dropArea+"' data-role='rows'></ul>").appendTo(tableColumn);if(!this.options.disableRowsDropArea&&!this._isTouch()){dropArea.droppable(droppableOptions)}tableColumn=$("<td></td>").appendTo(tableRow);dropArea=$("<ul class='"+this.css.dropArea+"' data-role='measures'></ul>").appendTo(tableColumn);if(!this.options.disableMeasuresDropArea&&!this._isTouch()){dropArea.droppable(droppableOptions)}if(this._isTouch()){dropAreasTable.find(".ui-igpivot-droparea").igScroll()}this._deferUpdate=this.options.deferUpdate;deferUpdateLabel=$("<label></label>").appendTo(rootDiv).text($.ig.PivotDataSelector.locale.deferUpdate);deferUpdateCheck=$("<input class='ui-igpivotdataselector-deferupdate' type='checkbox' />").prependTo(deferUpdateLabel).change(function(event){$this._deferUpdate=$(event.target).is(":checked");if($this._deferUpdate){$this.element.find(".ui-igpivotdataselector-updatelayout").igButton("enable")}else{$this.element.find(".ui-igpivotdataselector-updatelayout").igButton("disable");$this._updateDataSource()}$this._triggerDeferUpdateChanged($this._deferUpdate)});$("<button class='"+this.css.updateLayout+"'></button>").attr("title",$.ig.PivotDataSelector.locale.updateLayout).appendTo(rootDiv).igButton({text:false,icons:{primary:"ui-icon-refresh"}}).igButton(this._deferUpdate?"enable":"disable").click(function(){$this._updateDataSource(true)});this._triggerDataSelectorRendered()},_clearUI:function(){this.element.find(".ui-igpivotdataselector-catalog, .ui-igpivotdataselector-cube, .ui-igpivotdataselector-measuregroup").igCombo("destroy");this.element.find(".ui-igpivotdataselector-metadata").igTree("destroy");this.element.find(".ui-igpivot-droparea .ui-igpivot-metadataitem.ui-draggable").draggable("destroy").remove();this.element.empty()},_setDataSource:function(){var $this=this,dataSource;this._ds=dataSource=this._createDataSource(this.options.dataSource,this.options.dataSourceOptions);this._initUI();if(!dataSource){return}this.timestamp=(new Date).getTime();$(dataSource).bind("initialized.dataselector"+this.timestamp,function(evt,args){$this._onDataSourceInitialized(evt,args)});$(dataSource).bind("updated.dataselector"+this.timestamp,function(evt,args){$this._onDataSourceUpdated(evt,args)});if(dataSource.isInitialized()){if(this._isInstance(dataSource,"OlapXmlaDataSource")){this._onCatalogSelected(this._getItemName(dataSource.catalog()),true)}else{this._fillMetadata(dataSource.metadataTree())}dataSource.bindCollectionChanged({filters:this._onFiltersChanged,rowAxis:this._onRowAxisChanged,columnAxis:this._onColumnAxisChanged,measures:this._onMeasuresChanged})}else{dataSource.initialize()}},_clearDataSource:function(){if(this._ds){$(this._ds).unbind("updated.dataselector");this._ds.unbindCollectionChanged({filters:this._onFiltersChanged,rowAxis:this._onRowAxisChanged,columnAxis:this._onColumnAxisChanged,measures:this._onMeasuresChanged})}this._filterMembersCache=[];this._clearUI()},_onDataSourceInitialized:function(evt,evtArgs){var dataSource=this._ds,args=$.extend({owner:this,dataSource:dataSource},evtArgs);dataSource.bindCollectionChanged({filters:this._onFiltersChanged,rowAxis:this._onRowAxisChanged,columnAxis:this._onColumnAxisChanged,measures:this._onMeasuresChanged});this._triggerDataSourceInitialized(evt,args);if(!evtArgs.error){if(this._isInstance(dataSource,"OlapXmlaDataSource")){this._onCatalogSelected(this._getItemName(dataSource.catalog()),true)}else{this._fillMetadata(dataSource.metadataTree())}}},_updateDataSource:function(deferUpdateOverride){var dataSource=this._ds,shouldUpdate=deferUpdateOverride||this._deferUpdate===false;if(shouldUpdate&&dataSource.cube()!==null){dataSource.update()}},_onDataSourceUpdated:function(evt,evtArgs){var dataSource=this._ds,args=$.extend({owner:this,dataSource:dataSource},evtArgs);this._triggerDataSourceUpdated(evt,args)},_getItemName:function(item){return item&&item.name()},_fillCombo:function(comboSelector,items,selectedItem){var t=typeof selectedItem,selected=null;if(t==="number"){selected=[{index:selectedItem}]}else if(t==="object"&&selectedItem!==null&&$.isFunction(selectedItem.name)){selected=[{value:selectedItem.name()}]}this.element.find(comboSelector).igCombo("option","dataSource",items).igCombo("option","selectedItems",selected)},_clearCombo:function(comboSelector){this.element.find(comboSelector).igCombo("option","dataSource",[])},_fillMetadata:function(metadata){var $this=this,parseMetadata=function(m){var metadataItem={},hasItem=true,item,imgClass,children,i;switch(m.type()){case $.ig.OlapMetadataTreeItemType.prototype.cube:imgClass="cube";break;case $.ig.OlapMetadataTreeItemType.prototype.dimension:imgClass="dimension";break;case $.ig.OlapMetadataTreeItemType.prototype.group:imgClass="folder";hasItem=false;break;case $.ig.OlapMetadataTreeItemType.prototype.userDefinedHierarchy:imgClass="hierarchymultiple";break;case $.ig.OlapMetadataTreeItemType.prototype.systemEnabledHierarchy:imgClass="hierarchysingle";break;case $.ig.OlapMetadataTreeItemType.prototype.parentChildHierarchy:imgClass="hierarchydirect";break;case $.ig.OlapMetadataTreeItemType.prototype.measure:imgClass="measure";break;case $.ig.OlapMetadataTreeItemType.prototype.level1:imgClass="level1";break;case $.ig.OlapMetadataTreeItemType.prototype.level2:imgClass="level2";break;case $.ig.OlapMetadataTreeItemType.prototype.level3:imgClass="level3";break;case $.ig.OlapMetadataTreeItemType.prototype.level4:imgClass="level4";break;case $.ig.OlapMetadataTreeItemType.prototype.level5:imgClass="level5";break;default:imgClass="folder";break}metadataItem.caption=m.caption();metadataItem.image=imgClass;if(hasItem){item=m.item();metadataItem.name=item.uniqueName();metadataItem.type=item.getType().typeName()}children=m.children();if(children){metadataItem.children=[];for(i=0;i<children.length;i++){metadataItem.children[i]=parseMetadata(children[i])}}return metadataItem},parsedMetadata=metadata===null?[]:[parseMetadata(metadata)],dragAndDropSettings=this.options.dragAndDropSettings,tree,items;tree=this.element.find(".ui-igpivotdataselector-metadata").igTree("option","dataSource",parsedMetadata);items=tree.find(".ui-igpivot-metadataitem[data-type='Measure'],.ui-igpivot-metadataitem[data-type='Dimension'],.ui-igpivot-metadataitem[data-type='Hierarchy']");if(!this._isTouch()){items.draggable({appendTo:dragAndDropSettings.appendTo,containment:dragAndDropSettings.containment,zIndex:dragAndDropSettings.zIndex,cursorAt:this._const.dragCursorAt,revert:false,helper:function(event){var markup;markup=$($this._const.dragHelperMarkup.replace("{0}",$(this).text()));markup.addClass($this.css.invalidDropIndicator).find("span").addClass("ui-icon  ui-icon-cancel");return markup},start:function(event,ui){return $this._triggerDragStart(event,ui,tree.igTree("nodeDataFor",$(this).attr("data-path")))},drag:function(event,ui){return $this._triggerDrag(event,ui,tree.igTree("nodeDataFor",$(this).attr("data-path")))},over:function(event,ui){$this._onDraggableOver(event,ui)},out:function(event,ui){$this._onDraggableOut(event,ui)},stop:function(event,ui){$this._triggerDragStop(event,ui)}})}items.click(function(event){var item=tree.igTree("nodeDataFor",$(this).closest("li").attr("data-path")),name=item.name,type=$.ig[item.type].prototype.getType(),metadataItem;metadataItem=$this._ds.getCoreElement(function(el){return el.uniqueName()===name},type);if(metadataItem){$this._createMetadataItemDropDown(event,this,metadataItem)}});this._fillDropArea(".ui-igpivot-droparea[data-role=filters]",this._ds.filters(),this.options.disableFiltersDropArea);this._fillDropArea(".ui-igpivot-droparea[data-role=rows]",this._ds.rowAxis(),this.options.disableRowsDropArea);this._fillDropArea(".ui-igpivot-droparea[data-role=columns]",this._ds.columnAxis(),this.options.disableColumnsDropArea);this._fillDropArea(".ui-igpivot-droparea[data-role=measures]",this._ds.measures(),this.options.disableMeasuresDropArea)},_fillDropArea:function(dropArea,items,isDisabled){var i,length;dropArea=dropArea.jquery?dropArea:this.element.find(dropArea);dropArea.empty();for(i=0,length=items.length;i<length;i++){this._createMetadataElement(items[i],isDisabled,"appendTo",dropArea)}},_clearMetadata:function(){this.element.find(".ui-igpivotdataselector-metadata").igTree("option","dataSource",[])},_onCatalogSelected:function(catalog,isInit){var $this=this,dataSource=this._ds,callback=function(){$this._fillCombo(".ui-igpivotdataselector-catalog",dataSource.catalogs(),dataSource.catalog());$this._fillCombo(".ui-igpivotdataselector-cube",dataSource.cubes(),dataSource.cube());$this._onCubeSelected($this._getItemName(dataSource.cube()),isInit)};this._clearCombo(".ui-igpivotdataselector-cube");if(catalog===null){callback()}else{dataSource.setCatalog(catalog).done(callback)}},_onCubeSelected:function(cube,isInit){var $this=this,dataSource=this._ds,callback=function(){var measureGroup=dataSource.cube()&&(dataSource.measureGroup()||0),measureGroups=dataSource.measureGroups().slice();measureGroups.splice(0,0,{_caption:$.ig.PivotDataSelector.locale.measureGroupAll,_name:null});$this._fillCombo(".ui-igpivotdataselector-measuregroup",measureGroups,measureGroup);$this._onMeasureGroupSelected($this._getItemName(dataSource.measureGroup()),isInit)};this._clearCombo(".ui-igpivotdataselector-measuregroup");if(cube===null){callback()}else{dataSource.setCube(cube).done(callback)}},_onMeasureGroupSelected:function(measureGroup,isInit){var $this=this,dataSource=this._ds,callback=function(){$this._fillMetadata(dataSource.metadataTree());if(!isInit){$this._updateDataSource()}};this._clearMetadata();if(measureGroup===null){callback()}else{dataSource.setMeasureGroup(measureGroup).done(callback)}},_shouldAppendToTarget:function(target,dragged){return target.offset().top+target.height()/2<dragged.offset.top+this._const.dragCursorAt.top},update:function(){this._ds.update()},destroy:function(){this._clearDataSource();this.element.removeClass(this.css.dataSelector);$(this._ds).unbind("updated.dataselector"+this.timestamp);$(this._ds).unbind("initialized.dataselector"+this.timestamp);$.Widget.prototype.destroy.apply(this);return this},_triggerDataSelectorRendered:function(){var args={owner:this};this._trigger("dataSelectorRendered",null,args)},_triggerDeferUpdateChanged:function(deferUpdate){var args={owner:this,deferUpdate:deferUpdate};this._trigger("deferUpdateChanged",null,args)}});$.extend(true,$.ui.igPivotDataSelector.prototype,$.ig.Pivot._pivotShared);$.extend($.ui.igPivotDataSelector,{version:"13.1.20131.2523"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Pivot Grid 13.1.20131.2523
*
* Copyright (c) 2011-2012 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on: 
*	jquery-1.4.4.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	jquery.ui.draggable.js
*	jquery.ui.droppable.js
*	infragistics.util.js
*	infragistics.datasource.js
*	infragistics.olapxmladatasource.js
*	infragistics.olapflatdatasource.js
*	infragistics.ui.shared.js
*   infragistics.ui.scroll.js
*	infragistics.ui.tree.js
*	infragistics.ui.grid.framework.js
*	infragistics.ui.grid.multicolumnheaders.js
*	infragistics.ui.pivot.shared.js
*/
(function($){function Matrix(){this[0]=[]}Matrix.prototype=[];Matrix.prototype.set=function(row,column,value){if(this.length<row+1){this.setRowCount(row+1)}if(this[0].length<column+1){this.setColumnCount(column+1)}this[row][column]=value};Matrix.prototype.setRowCount=function(rowCount){var i,oldRowCount=this.length;this.length=rowCount;for(i=oldRowCount;i<rowCount;i++){this[i]=[];this[i].length=this[0].length}};Matrix.prototype.setColumnCount=function(columnCount){var i;for(i=0;i<this.length;i++){this[i].length=columnCount}};var _aNull=function(val){return val===null||val===undefined},_igGrid=$.ui.igGrid.prototype.widgetFullName||$.ui.igGrid.prototype.widgetName;$.widget("ui.igPivotGrid",{css:{pivotGrid:"ui-igpivotgrid",pivotGridHeader:"ui-igpivotgrid-header",expandButton:"ui-iggrid-headerbutton ui-icon ui-icon-plus",collapseButton:"ui-iggrid-headerbutton ui-iggrid-headerbuttonexpanded ui-icon ui-icon-minus",rowsAscending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-n",rowsDescending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-s",headerRowsAscending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-n",headerRowsDescending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-s",headerColumnsAscending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-n",headerColumnsDescending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-s",blockArea:"ui-igpivotgrid-blockarea",metadataItem:"ui-igpivot-metadataitem ui-widget ui-corner-all ui-state-default",dropAreaHeader:"ui-igpivot-dropareaheader ui-iggrid-header ui-widget-header",scrollButton:"ui-iggrid-headerbutton",scrollLeft:"ui-icon ui-icon-triangle-1-w",scrollRight:"ui-icon ui-icon-triangle-1-e",dropArea:"ui-igpivot-droparea",overlayDropArea:"ui-igpivot-overlaydroparea",activeDropArea:"active",dropIndicator:"ui-state-highlight",invalidDropIndicator:"ui-state-error",insertItem:"ui-igpivot-insertitem ui-state-highlight ui-corner-all",metadataItemDropDown:"ui-igpivot-metadatadropdown ui-widget ui-widget-content",filterIcon:"ui-icon ui-icon-pivot-smallfilter",filterDropDown:"ui-igpivot-filterdropdown ui-widget ui-widget-content",filterMembers:"ui-igpivot-filtermembers"},options:{width:null,height:null,dataSource:null,dataSourceOptions:{xmlaOptions:{serverUrl:null,catalog:null,cube:null,measureGroup:null,requestOptions:{withCredentials:false,beforeSend:null},enableResultCache:true,discoverProperties:null,executeProperties:null,mdxSettings:{nonEmptyOnRows:true,nonEmptyOnColumns:true,addCalculatedMembersOnRows:true,addCalculatedMembersOnColumns:true,dimensionPropertiesOnRows:[],dimensionPropertiesOnColumns:[]}},flatDataOptions:{dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseDataType:null,metadata:{cube:{name:null,caption:null,measuresDimension:{name:null,caption:null,measures:[{name:null,caption:null,aggregator:null,displayFolder:null}]},dimensions:[{name:null,caption:null,hierarchies:[{name:null,caption:null,displayFolder:null,levels:[{name:null,caption:null,memberProvider:null}]}]}]}}},measures:null,filters:null,rows:null,columns:null},deferUpdate:false,isParentInFrontForColumns:false,isParentInFrontForRows:true,compactColumnHeaders:false,compactRowHeaders:true,compactColumnHeaderIndentation:30,compactRowHeaderIndentation:20,defaultRowHeaderWidth:200,allowSorting:false,firstSortDirection:"ascending",allowHeaderRowsSorting:false,allowHeaderColumnsSorting:false,levelSortDirections:[{levelUniqueName:null,sortDirection:null}],firstLevelSortDirection:"ascending",gridOptions:{defaultColumnWidth:null,fixedHeaders:true,caption:null,features:[],tabIndex:0,alternateRowStyles:true,enableHoverStyles:false},dragAndDropSettings:{appendTo:"body",containment:false,zIndex:10},dropDownParent:"body",disableRowsDropArea:false,disableColumnsDropArea:false,disableMeasuresDropArea:false,disableFiltersDropArea:false,hideRowsDropArea:false,hideColumnsDropArea:false,hideMeasuresDropArea:false,hideFiltersDropArea:false,customMoveValidation:null},events:{dataSourceInitialized:null,dataSourceUpdated:null,pivotGridHeadersRendered:null,pivotGridRendered:null,tupleMemberExpanding:null,tupleMemberExpanded:null,tupleMemberCollapsing:null,tupleMemberCollapsed:null,sorting:null,sorted:null,headersSorting:null,headersSorted:null,dragStart:null,drag:null,dragStop:null,metadataDropping:null,metadataDropped:null,metadataRemoving:null,metadataRemoved:null,filterDropDownOpening:null,filterDropDownOpened:null,filterMembersLoaded:null,filterDropDownOk:null,filterDropDownClosing:null,filterDropDownClosed:null},_const:{emptyCell:{headerText:"&nbsp;",key:"empty_cell",axisName:"empty_axis",memberIndex:0,tupleIndex:0},hoverScrollOffset:5,hoverScrollInterval:50},_headerScrollOffsets:{},_gridScrollOffsets:{top:0,left:0},_create:function(){var $this=this;this._onFiltersChanged=function(collection,collectionChangedArgs){var dropArea=$("#"+$this.element.attr("id")+"_filters .ui-igpivot-droparea");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableFiltersDropArea);$this._updateDropArea(dropArea,$this._ds.filters(),$this.options.disableFiltersDropArea,$this.options.disableFiltersDropArea?$.ig.PivotGrid.locale.disabledFiltersHeader:$.ig.PivotGrid.locale.filtersHeader)};this._onRowAxisChanged=function(collection,collectionChangedArgs){var dropArea=$("#"+$this.element.attr("id")+"_rows .ui-igpivot-droparea");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableRowsDropArea);$this._updateDropArea(dropArea,$this._ds.rowAxis(),$this.options.disableRowsDropArea,$this.options.disableRowsDropArea?$.ig.PivotGrid.locale.disabledRowsHeader:$.ig.PivotGrid.locale.rowsHeader)};this._onColumnAxisChanged=function(collection,collectionChangedArgs){var dropArea=$("#"+$this.element.attr("id")+"_columns .ui-igpivot-droparea");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableColumnsDropArea);$this._updateDropArea(dropArea,$this._ds.columnAxis(),$this.options.disableColumnsDropArea,$this.options.disableColumnsDropArea?$.ig.PivotGrid.locale.disabledColumnsHeader:$.ig.PivotGrid.locale.columnsHeader);$this._columnsChanged=true};this._onMeasuresChanged=function(collection,collectionChangedArgs){var dropArea=$("#"+$this.element.attr("id")+"_measures .ui-igpivot-droparea");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableMeasuresDropArea);$this._updateDropArea(dropArea,$this._ds.measures(),$this.options.disableMeasuresDropArea,$this.options.disableMeasuresDropArea?$.ig.PivotGrid.locale.disabledMeasuresHeader:$.ig.PivotGrid.locale.measuresHeader)};this.element.addClass(this.css.pivotGrid);this._setDataSource()},_setOption:function(key,value){var grid;switch(key){case"dataSource":this._clearDataSource();this.options.dataSourceOptions=null;this.options.dataSource=this._createDataSource(value,null);this._setDataSource();break;case"dataSourceOptions":this._clearDataSource();this.options.dataSourceOptions=value;this.options.dataSource=this._createDataSource(null,value);this._setDataSource();break;case"deferUpdate":$.Widget.prototype._setOption.apply(this,arguments);if(value===false){this.updateGrid()}break;case"width":case"height":$.Widget.prototype._setOption.apply(this,arguments);grid=this.grid();if(grid){grid.option(key,value)}break;case"levelSortDirections":case"isParentInFrontForColumns":case"isParentInFrontForRows":case"compactColumnHeaders":case"compactRowHeaders":$.Widget.prototype._setOption.apply(this,arguments);this._createTableView(this._ds);this._onGridUpdated();break;case"dragAndDropSettings":$.Widget.prototype._setOption.apply(this,arguments);this.element.find(":ui-draggable").each(function(ind,el){var draggable=$(el);draggable.draggable("option","appendTo",value.appendTo);draggable.draggable("option","containment",value.containment);draggable.draggable("option","zIndex",value.zIndex)});break;default:$.Widget.prototype._setOption.apply(this,arguments);this._onGridUpdated();break}},_setDataSource:function(){var $this=this,dataSource;this._renderEmptyGrid();this._ds=dataSource=this._createDataSource(this.options.dataSource,this.options.dataSourceOptions);if(!dataSource){return}this.timestamp=(new Date).getTime();$(dataSource).bind("initialized.pivotgrid"+this.timestamp,function(evt,evtArgs){var args=$.extend({owner:$this,dataSource:$this._ds},evtArgs);$this._triggerDataSourceInitialized(evt,args);$this._onGridUpdated()});$(dataSource).bind("updated.pivotgrid"+this.timestamp,function(evt,evtArgs){var args=$.extend({owner:$this,dataSource:$this._ds},evtArgs);$this._triggerDataSourceUpdated(evt,args);$this._onGridUpdated()});if(dataSource.isInitialized()){dataSource.bindCollectionChanged({filters:this._onFiltersChanged,rowAxis:this._onRowAxisChanged,columnAxis:this._onColumnAxisChanged,measures:this._onMeasuresChanged});this._onGridUpdated()}else{this._updateGrid(true).always(function(){dataSource.bindCollectionChanged({filters:$this._onFiltersChanged,rowAxis:$this._onRowAxisChanged,columnAxis:$this._onColumnAxisChanged,measures:$this._onMeasuresChanged})})}},_updateDropArea:function(dropArea,items,isDisabled,emptyMessage){if(!this._ds.isUpdating()&&!this._isTouch()){dropArea.empty().css({display:"",overflow:"",margin:"",padding:""}).siblings().remove();this._fillDropArea(dropArea,items,isDisabled,emptyMessage);this._measureDropArea(dropArea)}},_clearDataSource:function(){var grid=this.grid();if(this._ds){$(this._ds).unbind("updated.pivotgrid");this._ds.unbindCollectionChanged({filters:this._onFiltersChanged,rowAxis:this._onRowAxisChanged,columnAxis:this._onColumnAxisChanged,measures:this._onMeasuresChanged})}if(grid){grid.destroy();this.element.empty()}},_createTableView:function(dataSource){var viewSettings,hasColumns,hasRows,map,appliedColumnSortDirections,appliedLevelSortDirections,userLevelSortDirections,mergedLevelSortDirections;appliedColumnSortDirections=this._columnsChanged?[]:this.appliedColumnSortDirections();map=function(array){var i,m={};if($.isArray(array)){for(i=0;i<array.length;i++){if(!_aNull(array[i].levelUniqueName)){m[array[i].levelUniqueName]=array[i]}}}return m};appliedLevelSortDirections=map(this.appliedLevelSortDirections());userLevelSortDirections=map(this.options.levelSortDirections);mergedLevelSortDirections=$.extend(userLevelSortDirections,appliedLevelSortDirections);mergedLevelSortDirections=$.map(mergedLevelSortDirections,function(sd){return sd});viewSettings={isParentInFrontForColumns:this.options.isParentInFrontForColumns,isParentInFrontForRows:this.options.isParentInFrontForRows,compactRowHeaders:this.options.compactRowHeaders,compactColumnHeaders:this.options.compactColumnHeaders};hasColumns=dataSource.columnAxis().length>0;hasRows=dataSource.rowAxis().length>0;this._tableView=new $.ig.OlapTableView(dataSource.result(),hasColumns,hasRows,viewSettings);this._tableView.columnSortDirections(appliedColumnSortDirections);this._tableView.levelSortDirections(mergedLevelSortDirections);this._tableView.initialize();this._columnsChanged=false},_configureOptions:function(dataSource){var $this=this,cols,dataCols,data,settings,gridDataSource,options;this._rowsMatrix=new Matrix;this._fillMatrixWithHeaderCells(this._rowsMatrix,this._tableView.rowHeaders());this._maxMemberIndex=dataSource.columnAxis().length-1;cols=this._generateAllGridColumns(this._tableView.columnHeaders());dataCols=this._generateDataColumns(this._tableView.columnHeaders());data=this._transformGridData(this._tableView.resultCells(),dataCols,dataCols.length,this._rowsMatrix.length);settings={dataSource:data};gridDataSource=new $.ig.DataSource(settings);options={headerRendered:function(event,ui){if($this._ds){$this._onGridHeadersRendered(event,ui)}},dataRendered:function(event,ui){if($this._ds){$this._onDataRendered(event,ui)}}};$.extend(true,options,this.options.gridOptions);options.dataSource=gridDataSource;options.columns=cols;options.autoGenerateColumns=false;options.virtualization=false;options.fixedFooters=false;options.autoFormat=false;options.renderCheckBoxes=false;options.autoFitLastColumn=false;options.autoAdjustHeight=true;options.width=this.options.width;options.height=this.options.height;$.merge(options.features,[{name:"MultiColumnHeaders"}]);return options},_fillMatrixWithHeaderCells:function(matrix,headerCells){var expandIcon,collapseIcon,allowHeaderRowsSorting,sortHeaderRowsAscendingIcon,sortHeaderRowsDescendingIcon,headerCell,levelSortDirectionsMap,headerMarkup,text,rowSpan,columnSpan,rowIndex,columnIndex,axisName,tupleIndex,memberIndex,sortDirection,isExpandable,isExpanded,expandButtonMarkup,indent,i,css;if(!headerCells||headerCells.length===0){matrix.set(0,0,"<th class='ui-iggrid-header ui-widget-header'></th>");return}allowHeaderRowsSorting=this.options.allowHeaderRowsSorting;expandIcon="<span data-expand='true' class='"+this.css.expandButton+"' style='margin-left: $$margin$$px;'></span>";collapseIcon="<span data-expand='false' class='"+this.css.collapseButton+"' style='margin-left: $$margin$$px;'></span>";sortHeaderRowsAscendingIcon="<span data-sortheader='asc' class='"+this.css.headerRowsAscending+"'></span>";sortHeaderRowsDescendingIcon="<span data-sortheader='desc' class='"+this.css.headerRowsDescending+"'></span>";levelSortDirectionsMap=this._tableView.appliedSortDirectionsMap();for(i=0;i<headerCells.length;i++){headerCell=headerCells[i];text=headerCell.caption();rowSpan=headerCell.rowSpan();columnSpan=headerCell.columnSpan();rowIndex=headerCell.rowIndex();columnIndex=headerCell.columnIndex();axisName=headerCell.axisName();tupleIndex=headerCell.tupleIndex();memberIndex=headerCell.memberIndex();isExpandable=headerCell.isExpandable();isExpanded=headerCell.isExpanded();css="ui-iggrid-header ui-widget-header "+this.css.pivotGridHeader;headerMarkup="<th $$data-sortheader$$ "+"class='"+css+"' "+"title='"+text+"' "+"data-skip='true' "+"rowspan='"+rowSpan+"' "+"colspan='"+columnSpan+"' "+"data-axis='"+axisName+"' "+"data-tuple='"+tupleIndex+"' "+"data-member='"+memberIndex+"'>";if(isExpandable){indent=this.options.compactRowHeaders?this.options.compactRowHeaderIndentation*headerCell.levelNumber():0;expandButtonMarkup=isExpanded?collapseIcon:expandIcon;expandButtonMarkup=expandButtonMarkup.replace("$$margin$$",indent);headerMarkup+=expandButtonMarkup;headerMarkup+="<span class='ui-iggrid-headertext'>"+text+"</span>";if(isExpanded){sortDirection=levelSortDirectionsMap[headerCell.axisName()];if(sortDirection){sortDirection=sortDirection[headerCell.hierarchyNumber()];if(sortDirection){sortDirection=sortDirection[headerCell.levelNumber()]}}if(sortDirection==="ascending"){headerMarkup=headerMarkup.replace("$$data-sortheader$$","data-sortheader='ascending'");headerMarkup+=sortHeaderRowsAscendingIcon}else if(sortDirection==="descending"){headerMarkup=headerMarkup.replace("$$data-sortheader$$","data-sortheader='descending'");headerMarkup+=sortHeaderRowsDescendingIcon}else if(allowHeaderRowsSorting){headerMarkup=headerMarkup.replace("$$data-sortheader$$","data-sortheader=''")}}else{headerMarkup=headerMarkup.replace("$$data-sortheader$$","")}}else{indent=this.options.compactRowHeaders?this.options.compactRowHeaderIndentation*(headerCell.levelNumber()+1):0;text="<span class='ui-iggrid-headertext' style='margin-left:"+indent+"px;'>"+text+"</span>";headerMarkup+=text}headerMarkup+="</th>";matrix.set(rowIndex+rowSpan-1,columnIndex+columnSpan-1,undefined);matrix.set(rowIndex,columnIndex,headerMarkup)}},_generateAllGridColumns:function(headers){var cols,levels=[],i;if(!headers||headers.length===0){return[this._const.emptyCell]}for(i=0;i<headers.length;i++){if(!levels[headers[i].rowIndex()]){levels[headers[i].rowIndex()]=[]}levels[headers[i].rowIndex()].push(headers[i])}this._maxLevel=levels.length;cols=this._processHeadersTree(levels);return cols},_generateDataColumns:function(headers){var cols=[],i;if(!headers||headers.length===0){return[this._const.emptyCell]}for(i=0;i<headers.length;i++){if(headers[i].memberIndex()!==this._maxMemberIndex){continue}if(headers[i].columnSpan()===1&&(headers[i].isExpandable()===false||!headers[i].isExpanded())){cols.push({headerText:headers[i].caption(),key:headers[i].axisName()+"_"+headers[i].tupleIndex()+"_"+headers[i].memberIndex()+"_"+headers[i].isExpandable()})}else if(this.options.compactColumnHeaders){cols.push({headerText:headers[i].caption(),key:headers[i].axisName()+"_"+headers[i].tupleIndex()+"_"+headers[i].memberIndex()+"_"+headers[i].isExpandable()})}}return cols},_transformGridData:function(cells,columns,columnsCount,maxRowCount){var data=[],cellOrdinal,i,colIndex;if(!cells||cells.length===0){if(maxRowCount>0){for(i=0;i<maxRowCount;i++){data.push({})}return data}return[{}]}for(i=0;i<maxRowCount;i++){data.push({})}for(i=0;i<cells.length;i++){cellOrdinal=cells[i].cellOrdinal();colIndex=cellOrdinal%columnsCount;data[Math.floor(cellOrdinal/columnsCount)][columns[colIndex].key]=cells[i].formattedValue()}return data},_processHeadersTree:function(tree){var cols=[],i,j,parent,parents;for(i=0;tree.length>=1&&i<tree[0].length;i++){this._createHeader(cols,tree[0][i])}for(i=1;i<tree.length;i++){parents=this._parentsForLevel(i,cols);for(j=0;j<tree[i].length;j++){parent=this._findParent(parents,tree[i][j]);if(parent){this._createHeader(parent,tree[i][j])}else{if(i-1>=1){this._findAndCreateUp(i-1,i,cols,tree,tree[i][j])}}}}return cols},_findAndCreateUp:function(level,itemsLevel,cols,tree,item){var parents,j,currentItem,parent;parents=this._parentsForLevel(level,cols);for(j=0;j<tree[itemsLevel].length;j++){currentItem=tree[itemsLevel][j];if(currentItem.axisName()===item.axisName()&&currentItem.columnIndex()===item.columnIndex()&&currentItem.memberIndex()===item.memberIndex()&&currentItem.tupleIndex()===item.tupleIndex()&&currentItem.caption()===item.caption()){parent=this._findParent(parents,currentItem,itemsLevel-level+1);if(parent){this._createHeader(parent,currentItem)}else{if(level-1>=1){this._findAndCreateUp(level-1,itemsLevel,cols,tree,item)}}}}},_parentsForLevel:function(level,root){var parents=[],i;for(i=0;i<root.length;i++){this._parentsForLevelRecursive(parents,root[i],1,level)}return parents},_parentsForLevelRecursive:function(parents,currentParent,currentLevel,level){var extraLevel=currentParent.rowspan>1?currentParent.rowspan-1:0,i;if(currentLevel===level){parents.push(currentParent)}else if(currentLevel<level&&currentParent.group!==null&&currentParent.group!==undefined){for(i=0;i<currentParent.group.length;i++){this._parentsForLevelRecursive(parents,currentParent.group[i],currentLevel+1+extraLevel,level)}}},_createHeader:function(parent,col){var column={headerText:col.caption(),key:col.axisName()+"_"+col.tupleIndex()+"_"+col.memberIndex()+"_"+col.isExpandable(),rowspan:col.rowSpan(),colSpan:col.columnSpan(),colIndex:col.columnIndex(),axisName:col.axisName(),tupleIndex:col.tupleIndex(),memberIndex:col.memberIndex(),expandable:col.isExpandable(),expanded:col.isExpanded(),hierarchyNumber:col.hierarchyNumber(),levelNumber:col.levelNumber()};if(!this.options.compactColumnHeaders&&(col.columnSpan()>1||col.columnSpan()===1&&col.isExpanded()&&col.isExpandable())){column.group=[]}parent.push(column)},_findParent:function(cols,header,rowSpan){var i;if(!cols||cols.length===undefined||cols.length===null){return null}for(i=0;i<cols.length;i++){if(rowSpan===undefined||rowSpan!==undefined&&cols[i].rowspan===rowSpan){if(cols[i].colSpan+cols[i].colIndex>=header.columnSpan()+header.columnIndex()&&cols[i].colIndex<=header.columnIndex()){if(!cols[i].group){cols[i].group=[]}return cols[i].group}}}return null},grid:function(){return this.element.data(_igGrid)},updateGrid:function(){this._updateGrid(false,true)},_updateGrid:function(init,deferUpdateOverride){var dataSource=this._ds,container,shouldUpdate=deferUpdateOverride||this.options.deferUpdate===false,promise;if(!init&&!shouldUpdate){return}if(this.element.data(_igGrid)){container=this.grid().container();$("#"+this.grid().element.attr("id")+"_columns_overlay").css("display","none");$("#"+this.grid().element.attr("id")+"_measures_overlay").css("display","none");container.css("position","relative");$("<div class='"+this.css.blockArea+"'></div>").appendTo(container).data("efh","1")}if(init){promise=dataSource.initialize()}else{promise=dataSource.update()}return promise},_onGridUpdated:function(){var dataSource=this._ds,options;this._createTableView(dataSource);options=this._configureOptions(dataSource);this._renderGrid(options)},_renderEmptyGrid:function(){var options;options=$.extend(true,{},this.options.gridOptions);options.width=this.options.width;options.height=this.options.height;this.element.igGrid(options)},_renderGrid:function(options){var id=this.element.attr("id"),grid,container;grid=this.grid();if(grid){this._gridScrollOffsets.top=grid.scrollContainer().scrollTop();this._gridScrollOffsets.left=$("#"+id+"_hscroller").scrollLeft();this.element.igGrid("destroy");this.element.empty()}this.element.igGrid(options);container=this.grid().container();container.addClass(this.css.pivotGrid);this._makeDroppable(container)},_onGridHeadersRendered:function(event,ui){var $this=this,headers=ui.owner._oldCols,table=ui.table,id=this.element.attr("id"),appliedColumnSortDirectionsMap,first,firstParent,rowsCellColSpan,rowsCellRowSpan,columnsCellColSpan,filtersCellColSpan,row,droppableOptions,dropArea,header,dataSource=this._ds,extraColsCount,colgroup,col,i,length,sortableHeaders;table.addClass(this.css.pivotGrid);ui.owner._renderRecord=function(data,rowIndex){return $this._renderPivotRecord.call(this,$this._rowsMatrix,data,rowIndex)};if(headers===null||headers===undefined){headers=ui.owner.options.columns}appliedColumnSortDirectionsMap={};$.each(this._tableView.appliedColumnSortDirections(),function(ind,csd){appliedColumnSortDirectionsMap[csd.tupleIndex]=csd.sortDirection});this._processHeaderMarkupRecursive(this.grid().element[0].id,headers,appliedColumnSortDirectionsMap,this._tableView.appliedSortDirectionsMap());first=table.find("tr").first();firstParent=first.parent();rowsCellColSpan=this._rowsMatrix.length>0?this._rowsMatrix[0].length:1;rowsCellRowSpan=this._maxLevel;columnsCellColSpan=ui.owner.options.columns.length;filtersCellColSpan=rowsCellColSpan+columnsCellColSpan;if(table.find(".ui-igpivot-droparea[data-role=rows], .ui-igpivot-droparea[data-role=columns], .ui-igpivot-droparea[data-role=measures], .ui-igpivot-droparea[data-role=filters]").length===0){droppableOptions=this._createDropAreaOptions();if(!this.options.hideRowsDropArea){header=$("<th id='"+id+"_rows' rowSpan='"+rowsCellRowSpan+"' colSpan='"+rowsCellColSpan+"' data-skip='true' class='"+this.css.dropAreaHeader+"'></th>").prependTo(first);header.height(header.height());dropArea=$("<ul data-role='rows' class='"+this.css.dropArea+"'></ul>").appendTo(header);if(!this.options.disableRowsDropArea&&!this._isTouch()){dropArea.droppable(droppableOptions)}}else{$("<th rowSpan='"+rowsCellRowSpan+"' colSpan='"+rowsCellColSpan+"' data-skip='true' class='ui-iggrid-header ui-widget-header'></th>").prependTo(first)}if(!this.options.hideColumnsDropArea||!this.options.hideMeasuresDropArea){row=$("<tr></tr>").prependTo(firstParent)}if(!this.options.hideColumnsDropArea){header=$("<th id='"+id+"_columns' rowSpan='1' colSpan='"+columnsCellColSpan+"' data-skip='true' class='"+this.css.dropAreaHeader+"'></th>").prependTo(row);dropArea=$("<ul data-role='columns' class='"+this.css.dropArea+"'></ul>").appendTo(header);if(!this.options.disableColumnsDropArea&&!this._isTouch()){dropArea.droppable(droppableOptions);if($("#"+id+"_columns_overlay").length<1){$("<div id='"+id+"_columns_overlay' data-role='columns' class='"+this.css.overlayDropArea+" ui-igpivot-droparea ui-droppable'></div>").appendTo(this.element).droppable(droppableOptions)}}}else if(!this.options.hideMeasuresDropArea){$("<th rowSpan='1' colSpan='"+columnsCellColSpan+"' data-skip='true' class='ui-iggrid-header ui-widget-header'></th>").prependTo(row)}if(!this.options.hideMeasuresDropArea){header=$("<th id='"+id+"_measures' rowSpan='1' colSpan='"+rowsCellColSpan+"' data-skip='true' class='"+this.css.dropAreaHeader+"'></th>").prependTo(row);dropArea=$("<ul data-role='measures' class='"+this.css.dropArea+"'></ul>").appendTo(header);if(!this.options.disableMeasuresDropArea&&!this._isTouch()){dropArea.droppable(droppableOptions)}}else if(!this.options.hideColumnsDropArea){$("<th rowSpan='1' colSpan='"+rowsCellColSpan+"' data-skip='true' class='ui-iggrid-header ui-widget-header'></th>").prependTo(row)}if(!this.options.hideFiltersDropArea){row=$("<tr></tr>").prependTo(firstParent);header=$("<th id='"+id+"_filters' rowSpan='1' colSpan='"+filtersCellColSpan+"' data-skip='true' class='"+this.css.dropAreaHeader+"'></th>").prependTo(row);dropArea=$("<ul data-role='filters' class='"+this.css.dropArea+"'></ul>").appendTo(header);if(!this.options.disableFiltersDropArea&&!this._isTouch()){dropArea.droppable(droppableOptions)}}}else{$("#"+id+"_rows").attr("rowSpan",rowsCellRowSpan).attr("colSpan",rowsCellColSpan);$("#"+id+"_columns").attr("rowSpan",1).attr("colSpan",columnsCellColSpan);$("#"+id+"_measures").attr("rowSpan",1).attr("colSpan",rowsCellColSpan);$("#"+id+"_fiters").attr("rowSpan",1).attr("colSpan",filtersCellColSpan)}colgroup=table.find("colgroup");if(colgroup.length===0){if(this.grid()._isMultiColumnGrid){length=table.find("th[data-isheadercell]").length}else{length=headers.length}colgroup="<colgroup>";for(i=0;i<length;i++){colgroup+="<col></col>"}colgroup+="</colgroup>";colgroup=$(colgroup).prependTo(table)}extraColsCount=this._rowsMatrix.length>0?this._rowsMatrix[0].length:1;for(i=0;i<extraColsCount;i++){col=$("<col></col>").prependTo(colgroup).attr("data-skip","true")}if(this.options.allowSorting){sortableHeaders=table.find(".ui-igpivotgrid-header[data-sort]");sortableHeaders.children(".ui-iggrid-headertext,.ui-iggrid-sortindicator").bind("click",function(evt){$this._onSort(evt)});sortableHeaders.filter("[data-axis='empty_axis']").bind("click",function(evt){$this._onSort(evt)})}if(this.options.allowHeaderColumnsSorting){table.find(".ui-igpivotgrid-header[data-sortheader]").children(".ui-iggrid-headertext,.ui-iggrid-sortindicator").bind("click",function(evt){$this._onSortHeader(evt)})}if(!this.options.hideFiltersDropArea){this._fillDropArea("#"+id+"_filters .ui-igpivot-droparea",dataSource.filters(),this.options.disableFiltersDropArea,this.options.disableFiltersDropArea?$.ig.PivotGrid.locale.disabledFiltersHeader:$.ig.PivotGrid.locale.filtersHeader)}if(!this.options.hideRowsDropArea){this._fillDropArea("#"+id+"_rows .ui-igpivot-droparea",dataSource.rowAxis(),this.options.disableRowsDropArea,this.options.disableRowsDropArea?$.ig.PivotGrid.locale.disabledRowsHeader:$.ig.PivotGrid.locale.rowsHeader)}if(!this.options.hideColumnsDropArea){this._fillDropArea("#"+id+"_columns .ui-igpivot-droparea",dataSource.columnAxis(),this.options.disableColumnsDropArea,this.options.disableColumnsDropArea?$.ig.PivotGrid.locale.disabledColumnsHeader:$.ig.PivotGrid.locale.columnsHeader)}if(!this.options.hideMeasuresDropArea){this._fillDropArea("#"+id+"_measures .ui-igpivot-droparea",dataSource.measures(),this.options.disableMeasuresDropArea,this.options.disableMeasuresDropArea?$.ig.PivotGrid.locale.disabledMeasuresHeader:$.ig.PivotGrid.locale.measuresHeader)}this._measureHeaders(headers);table.find("thead span.ui-iggrid-headerbutton.ui-icon").bind("click",function(evt){$this._onToggleTupleMember(evt);return false});this._triggerPivotGridHeadersRendered(event,ui)},_renderPivotRecord:function(matrix,data,rowIndex){var i,key=this.options.primaryKey,ar=this.options.accessibilityRendering,grid=this,dstr="",cols=this.options.columns,noVisibleColumns,str="";dstr+="<tr";if(rowIndex%2!==0&&this.options.alternateRowStyles){dstr+=" class='"+grid.css.recordAltClass+"'"}if(!_aNull(key)){dstr+=" data-id='"+this._kval_from_key(key,data)+"'"}else if(!_aNull(data.ig_pk)){dstr+=" data-id='"+data.ig_pk+"'"}if(this.options.virtualization&&this.options.virtualizationMode==="continuous"){dstr+=" data-row-idx='"+rowIndex+"'"}if(ar){dstr+=" role='row'>"}else{dstr+=">"}for(i=0;i<matrix[rowIndex].length;i++){if(matrix[rowIndex][i]){str+=matrix[rowIndex][i]}}if(str!==""){dstr+=str}if(cols.length>0){noVisibleColumns=true;$(cols).each(function(colIndex){if(cols[colIndex].hidden){return}noVisibleColumns=false;if(ar){dstr+="<td role='gridcell' aria-describedby='"+this.key+"'"}else{dstr+="<td"}if(data[this.key]===undefined){if(grid.options.rowTemplate&&grid.options.rowTemplate.length>0){dstr+=" ";dstr+=grid._renderTemplatedCell(data,this)}else{dstr+=">";dstr+=grid._renderCell(data[colIndex],this)}dstr+="</td>"}else{if(grid.options.rowTemplate&&grid.options.rowTemplate.length>0){dstr+=" ";dstr+=grid._renderTemplatedCell(data,this)}else{dstr+=">";dstr+=grid._renderCell(data[this.key],this)}dstr+="</td>"}});if(noVisibleColumns){dstr+="<td role='gridcell'></td>"}}else{if($.type(data)==="array"){for(i=0;i<data.length;i++){if(ar){dstr+="<td role='gridcell'>"+data[i]+"</td>"}else{dstr+="<td>";dstr+=data[i];dstr+="</td>"}}}else{for(key in data){if(data.hasOwnProperty(key)){if(ar){dstr+="<td role='gridcell' aria-describedby='"+key+"'>"+data[key]+"</td>"}else{dstr+="<td>";dstr+=data[key];dstr+="</td>"}}}}}dstr+="</tr>";return dstr},_processHeaderMarkupRecursive:function(tableId,headers,columnSortDirectionsMap,levelSortDirectionsMap){var i,headerCell,expanded,expandable,sortDirection,expandIcon,collapseIcon,allowSorting,allowHeaderColumnsSorting,sortRowsAscendingIcon,sortRowsDescendingIcon,sortHeaderColumnsAscendingIcon,sortHeaderColumnsDescendingIcon;allowSorting=this.options.allowSorting;allowHeaderColumnsSorting=this.options.allowHeaderColumnsSorting;expandIcon="<span data-expand='true' class='"+this.css.expandButton+"'/>";collapseIcon="<span data-expand='false' class='"+this.css.collapseButton+"'/>";sortRowsAscendingIcon="<span data-sort='asc' class='"+this.css.rowsAscending+"'/>";sortRowsDescendingIcon="<span data-sort='desc' class='"+this.css.rowsDescending+"'/>";sortHeaderColumnsAscendingIcon="<span data-sortheader='asc' class='"+this.css.headerColumnsAscending+"'></span>";sortHeaderColumnsDescendingIcon="<span data-sortheader='desc' class='"+this.css.headerColumnsDescending+"'></span>";for(i=0;i<headers.length;i++){headerCell=$("#"+tableId+"_"+headers[i].key);headerCell.addClass(this.css.pivotGridHeader).attr("data-axis",headers[i].axisName).attr("data-member",headers[i].memberIndex).attr("data-tuple",headers[i].tupleIndex);if(headers[i].axisName!==this._const.emptyCell.axisName){headerCell.attr("title",headers[i].headerText)}if(this.options.compactColumnHeaders&&headers[i].levelNumber>0){headerCell.css("padding-top",this.options.compactColumnHeaderIndentation*headers[i].levelNumber)}expandable=headers[i].expandable;expanded=headers[i].expanded;if(expandable&&!expanded){$(expandIcon).insertBefore(headerCell.children(".ui-iggrid-headertext"))}else if(expandable&&expanded){$(collapseIcon).insertBefore(headerCell.children(".ui-iggrid-headertext"));sortDirection=levelSortDirectionsMap[headers[i].axisName];if(sortDirection){sortDirection=sortDirection[headers[i].hierarchyNumber];if(sortDirection){sortDirection=sortDirection[headers[i].levelNumber]}}if(sortDirection==="ascending"){headerCell.attr("data-sortheader","ascending");$(sortHeaderColumnsAscendingIcon).appendTo(headerCell)}else if(sortDirection==="descending"){headerCell.attr("data-sortheader","descending");$(sortHeaderColumnsDescendingIcon).appendTo(headerCell)}else if(allowHeaderColumnsSorting){headerCell.attr("data-sortheader","")}}if(!expandable||expandable&&!expanded){sortDirection=columnSortDirectionsMap[headers[i].tupleIndex];if(sortDirection==="ascending"){headerCell.attr("data-sort","ascending");$(sortRowsAscendingIcon).appendTo(headerCell)}else if(sortDirection==="descending"){headerCell.attr("data-sort","descending");$(sortRowsDescendingIcon).appendTo(headerCell)}else if(allowSorting){headerCell.attr("data-sort","")
}}if(headers[i].group){this._processHeaderMarkupRecursive(tableId,headers[i].group,columnSortDirectionsMap,levelSortDirectionsMap)}}},_fillDropArea:function(dropAreaSelector,items,isDisabled,emptyMessage){var dropArea=$(dropAreaSelector),i,length;dropArea.empty();if(items.length>0){for(i=0,length=items.length;i<length;i++){this._createMetadataElement(items[i],isDisabled,"appendTo",dropArea)}}else{dropArea.text(emptyMessage)}},_measureHeaders:function(headers){var $this=this,id=this.element.attr("id"),grid=this.grid(),table=grid.headersTable(),extraColsCount,extraColsWidth,maxWidth,header,measureTh,colsWidth;extraColsCount=this._rowsMatrix.length>0?this._rowsMatrix[0].length:1;if(this.options.defaultRowHeaderWidth){table.find("col:lt("+extraColsCount+")").width(this.options.defaultRowHeaderWidth);if(!this._isTouch()){table.find(".ui-igpivot-droparea[data-role=rows], .ui-igpivot-droparea[data-role=columns], .ui-igpivot-droparea[data-role=measures], .ui-igpivot-droparea[data-role=filters]").each(function(ind,el){$this._measureDropArea($(this))})}else{table.find(".ui-igpivot-droparea[data-role=rows], .ui-igpivot-droparea[data-role=columns], .ui-igpivot-droparea[data-role=measures], .ui-igpivot-droparea[data-role=filters]").each(function(ind,el){$(el).wrap($("<div style='overflow: hidden;'></div>")).parent("div").igScroll()})}extraColsWidth=this.options.defaultRowHeaderWidth*extraColsCount}else{maxWidth=0;table.find("#"+id+"_measures, #"+id+"_rows").each(function(ind,el){var clone,parent;clone=$(el).clone(false);clone.children(".ui-igpivot-droparea").append("<li class='"+$this.css.insertItem+"'></li>");parent=$("<div class='ui-widget ui-widget-header ui-iggrid ui-igpivotgrid'></div>").append(clone).css({position:"absolute",visibility:"hidden",height:"auto",width:"auto",overflow:"visible","text-overflow":"clip",left:"-1000px",top:"-1000px"}).appendTo(document.body);maxWidth=Math.max(maxWidth,parent.outerWidth(true));parent.remove()});table.find("col:lt("+extraColsCount+")").width(Math.ceil(maxWidth/extraColsCount));extraColsWidth=maxWidth}if(grid.options.defaultColumnWidth){table.find("col:gt("+extraColsCount+")").width(grid.options.defaultColumnWidth)}else{header=table.find("th:not(.ui-igpivot-dropareaheader):first");measureTh=$("<th class='"+header.attr("class")+"' style='position:absolute;visibility:hidden;height:auto;width:auto;overflow:visible;text-overflow:clip;left:-1000px;top:-1000px;'></th>").css({"font-family":header.css("fontFamily"),"font-size":header.css("fontSize"),"font-size-adjust":header.css("fontSizeAdjust"),"font-stretch":header.css("fontStretch"),"font-style":header.css("fontStyle"),"font-variant":header.css("fontVariant"),"font-weight":header.css("fontWeight")}).appendTo(document.body);colsWidth=this._measureHeadersRecursive(this.grid().element[0].id,headers,measureTh,extraColsCount);measureTh.remove()}if(table.find("col").length-extraColsCount===1||extraColsWidth+colsWidth<table.width()){table.find("col:last").width("auto")}},_measureHeadersRecursive:function(tableId,headers,measureTh,extraColsCount){var i,headerCell,totalWidth,width;totalWidth=0;for(i=0;i<headers.length;i++){if(headers[i].axisName===this._const.emptyCell.axisName){break}headerCell=$("#"+tableId+"_"+headers[i].key);if(headers[i].group){totalWidth+=this._measureHeadersRecursive(tableId,headers[i].group,measureTh,extraColsCount)}else{width=measureTh.html(headerCell[0].innerHTML)[0].offsetWidth+10;totalWidth+=width;this.grid().headersTable().find("col:eq("+(headerCell.data("columnIndex")+extraColsCount)+")").width(width);headers[i].width=width}}return totalWidth},_measureDropArea:function(dropArea){var $this=this,id,parent,parentClone,parentContainer,parentWidth,left,minLeft,maxLeft,scrollLeft,scrollRight,scrollToLeft,timer,mouseover,mouseout;parent=dropArea.parent("th");id=parent.attr("id");parentClone=$(parent).clone(false);parentClone.children(".ui-igpivot-droparea").append("<li class='"+$this.css.insertItem+"'></li>");parentContainer=$("<div class='ui-widget ui-widget-header ui-iggrid ui-igpivotgrid'></div>").append(parentClone).css({position:"absolute",visibility:"hidden",height:"auto",width:"auto",overflow:"visible","text-overflow":"clip",left:"-1000px",top:"-1000px"}).appendTo(document.body);parentWidth=parent.width();if(parentContainer.find(".ui-igpivot-droparea").outerWidth(true)>parentWidth){dropArea.css({display:"inline-block",overflow:"hidden",margin:0,padding:0});scrollLeft=$("<span class='"+this.css.scrollButton+"'><a class='"+this.css.scrollLeft+"' /></span>").insertBefore(dropArea);scrollRight=$("<span class='"+this.css.scrollButton+"'><a class='"+this.css.scrollRight+"' /></span>").insertAfter(dropArea);if(0===parentWidth){dropArea.width("auto")}else{dropArea.width(parentWidth-scrollLeft.outerWidth(true)-scrollRight.outerWidth(true))}left=this._headerScrollOffsets[id]||0;minLeft=0;maxLeft=dropArea[0].scrollWidth;scrollToLeft=function(){if(left<minLeft){left=minLeft}if(left>maxLeft){left=maxLeft}dropArea.scrollLeft(left);$this._headerScrollOffsets[id]=left};scrollToLeft();mouseover=this._getEvent("mouseover");mouseout=this._getEvent("mouseout");scrollLeft.bind(mouseover,function(){timer=setInterval(function(){left-=$this._const.hoverScrollOffset;scrollToLeft()},$this._const.hoverScrollInterval)}).bind(mouseout,function(){clearInterval(timer)});scrollRight.bind(mouseover,function(){timer=setInterval(function(){left+=$this._const.hoverScrollOffset;scrollToLeft()},$this._const.hoverScrollInterval)}).bind(mouseout,function(){clearInterval(timer)})}else{delete this._headerScrollOffsets[id]}parentContainer.remove()},_onDataRendered:function(event,ui){var $this=this,id=this.element.attr("id"),table=ui.owner.element,grid=this.grid(),overlayDropAreaOptions=this._createDropAreaOptions(),headersCols,colgroup,i,j,colAttributes;table.addClass(this.css.pivotGrid);table.find("tbody th > span[data-expand]").bind("click",function(evt){$this._onToggleTupleMember(evt);return false});if(this.options.allowHeaderRowsSorting){table.find("tbody th.ui-igpivotgrid-header[data-sortheader]").children(".ui-iggrid-headertext,.ui-iggrid-sortindicator").bind("click",function(evt){$this._onSortHeader(evt)})}if(grid.options.fixedHeaders){headersCols=grid.headersTable().find("colgroup").find("col");colgroup=table.find("colgroup");colgroup.empty();for(i=0;i<headersCols.length;i++){colgroup.append($("<col></col>"));colAttributes=headersCols.eq(i)[0].attributes;for(j=0;j<colAttributes.length;j++){colgroup.find("col").eq(i).attr(colAttributes.item(j).name,colAttributes.item(j).value)}}grid._setGridContentWidth(grid.headersTable().width());grid.scrollContainer().scrollTop(this._gridScrollOffsets.top);$("#"+id+"_hscroller").scrollLeft(this._gridScrollOffsets.left)}if(!this.options.disableRowsDropArea&&!this._isTouch()){if($("#"+id+"_rows_overlay").length<1){$("<div id='"+id+"_rows_overlay' data-role='rows' class='"+this.css.overlayDropArea+" ui-igpivot-droparea ui-droppable'></div>").appendTo(this.element).droppable(overlayDropAreaOptions)}}if(!this.options.disableMeasuresDropArea&&!this._isTouch()){if($("#"+id+"_measures_overlay").length<1){$("<div id='"+id+"_measures_overlay' data-role='measures' class='"+this.css.overlayDropArea+" ui-igpivot-droparea ui-droppable'></div>").appendTo(this.element).droppable(overlayDropAreaOptions)}}this._positionOverlayDropAreas();this._triggerPivotGridRendered(event,ui)},_positionOverlayDropAreas:function(){var id=this.element.attr("id"),headersTable=this.grid().headersTable().find("thead"),dataTable=this.grid().element.find("tbody"),firstColumnHeaderPosition,firstRowHeaderPosition,columnHeadersHeight,rowHeadersWidth,measuresArea,container,containerParent,containerPosition,columnsOverlayTop,columnsOverlayLeft,columnHeadersWidth,measuresHeadersWidth,dataTableHeight,rowsOverlayTop,rowsOverlayLeft,containerId,rowHeight,ht,rowsProps,columnsProps,measuresProps,absoluteOffset;firstColumnHeaderPosition=headersTable.find("th[data-axis]:first").position();columnHeadersHeight=0;if($.ig.util.isFF){columnHeadersHeight=headersTable.find("tr[data-header-row], tr[data-mch-level]")[0].scrollHeight}else{headersTable.find("tr[data-header-row], tr[data-mch-level]").each(function(ind,el){columnHeadersHeight+=el.scrollHeight})}if(this.options.height!==null||this.options.width!==null){containerId=this.element.attr("id");container=$("#"+containerId+"_container").length===1?$("#"+containerId+"_container"):$("#"+containerId+"_table_container");containerParent=container.parent();containerPosition=container.position()}if(this.options.height!==null){firstRowHeaderPosition={top:this.grid().headersTable().height()+containerPosition.top,left:containerPosition.left}}else if(this.options.width!==null){rowHeight=this.grid().headersTable().find("tr").eq(0).height();if(this.grid().headersTable().find("tr[data-mch-level]").length===0){firstRowHeaderPosition={top:3*rowHeight+containerPosition.top,left:containerPosition.left}}else{firstRowHeaderPosition={top:2*rowHeight+this.grid().headersTable().find("tr[data-mch-level]").length*this.grid().headersTable().find("tr[data-mch-level]").eq(0).height()+containerPosition.top,left:containerPosition.left}}}if(this.options.height!==null||this.options.width!==null){columnsOverlayTop=firstColumnHeaderPosition.top+containerPosition.top+2*parseInt(containerParent.css("paddingTop")[0].replace("px",""),10);columnsOverlayLeft=firstColumnHeaderPosition.left+containerPosition.left;rowsOverlayTop=firstRowHeaderPosition.top+2*parseInt(containerParent.css("paddingTop")[0].replace("px",""),10);rowsOverlayLeft=firstRowHeaderPosition.left}else{firstRowHeaderPosition=this.grid().headersTable().find("tbody tr:first").position();columnsOverlayTop=firstColumnHeaderPosition.top+headersTable.parent().parent().position().top;columnsOverlayLeft=firstColumnHeaderPosition.left+headersTable.parent().parent().position().left;rowsOverlayTop=firstRowHeaderPosition.top+headersTable.parent().parent().position().top;rowsOverlayLeft=firstRowHeaderPosition.left+headersTable.parent().parent().position().left}ht=headersTable.find("tr").eq(1).find("th").eq(1);if(headersTable[0].scrollWidth<=this.element.width()){columnHeadersWidth=ht.width()+2*(parseInt(ht.css("paddingLeft")[0].substr(0),10)+parseInt(ht.css("borderLeftWidth")[0].substr(0),10))}else{columnHeadersWidth=ht.width()+2*(parseInt(ht.css("paddingLeft")[0].substr(0),10)+parseInt(ht.css("borderLeftWidth")[0].substr(0),10))-(headersTable[0].scrollWidth-this.element.width())}measuresArea=headersTable.find("tr").eq(1).find("th:first");dataTableHeight=this.element.height()-rowsOverlayTop>dataTable[0].scrollHeight?dataTable[0].scrollHeight:this.element.height()-headersTable.height();rowHeadersWidth=measuresArea.width()+2*(parseInt(measuresArea.css("paddingLeft")[0].replace("px",""),10)+parseInt(measuresArea.css("borderLeftWidth")[0].replace("px",""),10));if(headersTable[0].scrollWidth<=this.element.width()){measuresHeadersWidth=dataTable[0].scrollWidth-rowHeadersWidth}else{measuresHeadersWidth=dataTable[0].scrollWidth-rowHeadersWidth-(headersTable[0].scrollWidth-this.element.width())}absoluteOffset=this._calculateOffset(this.element);rowsProps={top:rowsOverlayTop+absoluteOffset.top,left:absoluteOffset.left,width:rowHeadersWidth,height:dataTableHeight};columnsProps={top:columnsOverlayTop+absoluteOffset.top,left:rowHeadersWidth+absoluteOffset.left,width:columnHeadersWidth,height:columnHeadersHeight};measuresProps={top:rowsOverlayTop+absoluteOffset.top,left:rowHeadersWidth+absoluteOffset.left,width:measuresHeadersWidth,height:dataTableHeight};$("#"+id+"_rows_overlay").css(rowsProps);$("#"+id+"_columns_overlay").css(columnsProps);$("#"+id+"_measures_overlay").css(measuresProps);headersTable.parent().parent().on("scroll",{table:headersTable,id:id,rowHeadersWidth:rowHeadersWidth,columnHeadersWidth:columnHeadersWidth,rowsOverlayLeft:rowsOverlayLeft,measuresHeadersWidth:measuresHeadersWidth,columnsOverlayLeft:columnsOverlayLeft},this._handlePivotGridScrolling)},_calculateOffset:function(jQueryObj){var el=jQueryObj,offset={top:0,left:el.offset().left};while(!el[0].tagName&&el.scrollParent()[0].firstChild.name!=="html"){offset.top+=el.scrollParent().scrollTop();offset.left+=el.scrollParent().scrollLeft();el=el.scrollParent()}return offset},_handlePivotGridScrolling:function(evt,ui){var scrollTable=evt.data.table.parent().parent(),id=evt.data.id,offset=scrollTable.scrollLeft(),rowHeadersWidth=evt.data.rowHeadersWidth,columnHeadersWidth=evt.data.columnHeadersWidth,rowsOverlayLeft=evt.data.rowsOverlayLeft,measuresHeadersWidth=evt.data.measuresHeadersWidth,columnsOverlayLeft=evt.data.columnsOverlayLeft;$("#"+id+"_columns_overlay").css({left:columnsOverlayLeft-(rowHeadersWidth>offset?offset:rowHeadersWidth),width:rowHeadersWidth>offset?columnHeadersWidth+offset:scrollTable.width()});$("#"+id+"_rows_overlay").css({width:rowHeadersWidth-offset});$("#"+id+"_measures_overlay").css({left:rowsOverlayLeft+rowHeadersWidth-(rowHeadersWidth>offset?offset:rowHeadersWidth),width:rowHeadersWidth>offset?measuresHeadersWidth+offset:scrollTable.width()})},_updateDataSource:function(deferUpdateOverride){this._updateGrid(false,deferUpdateOverride)},_shouldAppendToTarget:function(target,dragged){return target.offset().left+target.width()/2<dragged.offset.left+this._const.dragCursorAt.left},_onToggleTupleMember:function(evt){var $this=this,target=$(evt.target),header=target.closest("th"),axisName,memberIndex,tupleIndex,expand,noCancel;if(this._performsToggle||this._ds.isModified()){return}axisName=header.attr("data-axis");memberIndex=parseInt(header.attr("data-member"),10);tupleIndex=parseInt(header.attr("data-tuple"),10);expand=target.attr("data-expand")==="true";if(expand){noCancel=this._triggerTupleMemberExpanding(evt,axisName,memberIndex,tupleIndex);if(noCancel){this._ds.expandTupleMember(axisName,tupleIndex,memberIndex);this._performsToggle=true;this._updateGrid(false,true).done(function(){$this._triggerTupleMemberExpanded(null,axisName,memberIndex,tupleIndex)}).always(function(){$this._performsToggle=false})}}else{noCancel=this._triggerTupleMemberCollapsing(evt,axisName,memberIndex,tupleIndex);if(noCancel){this._ds.collapseTupleMember(axisName,tupleIndex,memberIndex);this._performsToggle=true;this._updateGrid(false,true).done(function(){$this._triggerTupleMemberCollapsed(evt,axisName,memberIndex,tupleIndex)}).always(function(){$this._performsToggle=false})}}},_onSort:function(evt){var $this=this,header=$(evt.target).closest("th"),axisName,tupleIndex,tupleIdentifier,axis,axes,tuple,memberNames,columnSortDirections,columnSortDirection,levelSortDirections,options,i,noCancel,en;if(this._ds.isModified()){return}axisName=header.attr("data-axis");tupleIndex=parseInt(header.attr("data-tuple"),10);if(axisName!==this._const.emptyCell.axisName){axes=this._ds.result().axes().__inner;for(i=0;i<axes.length;i++){if(axisName===axes[i].name()){axis=axes[i];break}}if(!axis){return}tuple=axis.tuples().item(tupleIndex);memberNames=[];en=tuple.members().getEnumerator();while(en.moveNext()){memberNames.push(en.current().uniqueName())}tupleIdentifier=memberNames.join("|")}else{memberNames=null;tupleIdentifier=""}columnSortDirections=this._tableView.columnSortDirections();for(i=0;i<columnSortDirections.length;i++){if(columnSortDirections[i].memberNames&&columnSortDirections[i].memberNames.join("|")===tupleIdentifier||columnSortDirections[i].tupleIndex===tupleIndex){columnSortDirection=columnSortDirections[i];break}}if(!evt.ctrlKey){columnSortDirections=[]}if(columnSortDirection){columnSortDirection.sortDirection=columnSortDirection.sortDirection==="ascending"?"descending":"ascending";if(!evt.ctrlKey){columnSortDirections.push(columnSortDirection)}}else{columnSortDirection={memberNames:memberNames,tupleIndex:tupleIndex,sortDirection:this.options.firstSortDirection};columnSortDirections.push(columnSortDirection)}noCancel=this._triggerSorting(evt,columnSortDirections);if(noCancel){levelSortDirections=$.grep(this._tableView.levelSortDirections(),function(sortDirection){var level,hierarchyName;level=$this._ds.getCoreElement(function(l){return l.uniqueName()===sortDirection.levelUniqueName},$.ig.Level.prototype.getType());if(level){hierarchyName=level.hierarchyUniqueName();return $.grep($this._ds.rowAxis(),function(h){return h.uniqueName()===hierarchyName}).length===0}return false});this._tableView.levelSortDirections(levelSortDirections);this._tableView.columnSortDirections(columnSortDirections);this._tableView.initialize();options=this._configureOptions(this._ds);this._renderGrid(options);this._triggerSorted(evt,columnSortDirections,this._tableView.appliedColumnSortDirections())}},_onSortHeader:function(evt){var header=$(evt.target).closest("th"),axisName,tupleIndex,memberIndex,axis,axes,tuple,member,level,levelName,hierarchyName,levelSortDirections,levelSortDirection,options,i,noCancel;if(this._ds.isModified()){return}axisName=header.attr("data-axis");tupleIndex=parseInt(header.attr("data-tuple"),10);memberIndex=parseInt(header.attr("data-member"),10);axes=this._ds.result().axes().__inner;for(i=0;i<axes.length;i++){if(axisName===axes[i].name()){axis=axes[i];break}}if(!axis){return}tuple=axis.tuples().item(tupleIndex);member=tuple.members().item(memberIndex);level=this._ds.getCoreElement(function(l){return l.hierarchyUniqueName()===member.hierarchyUniqueName()&&l.depth()===member.depth()+1},$.ig.Level.prototype.getType());if(!level){return}levelName=level.uniqueName();levelSortDirections=this._tableView.appliedLevelSortDirections();for(i=0;i<levelSortDirections.length;i++){if(levelSortDirections[i].levelUniqueName===levelName){levelSortDirection=levelSortDirections[i];break}}if(levelSortDirection){levelSortDirection.sortDirection=levelSortDirection.sortDirection==="ascending"?"descending":"ascending"}else{levelSortDirection={levelUniqueName:levelName,sortDirection:this.options.firstLevelSortDirection};levelSortDirections.push(levelSortDirection)}noCancel=this._triggerHeadersSorting(evt,levelSortDirections);if(noCancel){hierarchyName=level.hierarchyUniqueName();if($.grep(this._ds.rowAxis(),function(h){return h.uniqueName()===hierarchyName}).length>0){this._tableView.columnSortDirections([])}this._tableView.levelSortDirections(levelSortDirections);this._tableView.initialize();options=this._configureOptions(this._ds);this._renderGrid(options);this._triggerHeadersSorted(evt,levelSortDirections,this._tableView.appliedLevelSortDirections())}},expandTupleMember:function(tupleLocation,tupleIndex,memberIndex,shouldUpdate){var dataSource=this._ds,hasColumns,hasRows,axisName;hasColumns=dataSource.columnAxis().length>0;hasRows=dataSource.rowAxis().length>0;if(this._ds.isModified()){return false}if(tupleLocation==="columnAxis"&&hasColumns){if(hasColumns){axisName="Axis0"}}else if(tupleLocation==="rowAxis"&&hasRows){if(hasColumns){axisName="Axis1"}else{axisName="Axis0"}}if(!axisName){throw new Error($.ig.PivotGrid.locale.noSuchAxis)}this._ds.expandTupleMember(axisName,tupleIndex,memberIndex);if(shouldUpdate){this._updateGrid(null,true)}},collapseTupleMember:function(tupleLocation,tupleIndex,memberIndex,shouldUpdate){var dataSource=this._ds,hasColumns,hasRows,axisName;hasColumns=dataSource.columnAxis().length>0;hasRows=dataSource.rowAxis().length>0;if(this._ds.isModified()){return false}if(tupleLocation==="columnAxis"&&hasColumns){if(hasColumns){axisName="Axis0"}}else if(tupleLocation==="rowAxis"&&hasRows){if(hasColumns){axisName="Axis1"}else{axisName="Axis0"}}if(!axisName){throw new Error($.ig.PivotGrid.locale.noSuchAxis)}this._ds.collapseTupleMember(axisName,tupleIndex,memberIndex);if(shouldUpdate){this._updateGrid()}},appliedColumnSortDirections:function(){return this._tableView?this._tableView.appliedColumnSortDirections():[]},appliedLevelSortDirections:function(){return this._tableView?this._tableView.appliedLevelSortDirections():[]},destroy:function(){var grid=this.grid();if(grid){grid.destroy()}$("#"+this.element.attr("id")+"_container_block").remove();this.element.removeClass(this.css.pivotGrid);$(this._ds).unbind("initialized.pivotgrid"+this.timestamp);$(this._ds).unbind("updated.pivotgrid"+this.timestamp);$.Widget.prototype.destroy.call(this)},_triggerPivotGridHeadersRendered:function(evt,ui){var args={owner:this,grid:ui.owner,table:ui.table};this._trigger("pivotGridHeadersRendered",evt,args)},_triggerPivotGridRendered:function(evt,ui){var args={owner:this,grid:ui.owner};this._trigger("pivotGridRendered",evt,args)},_triggerTupleMemberExpanding:function(evt,axisName,memberIndex,tupleIndex){var args={owner:this,dataSource:this._ds,axisName:axisName,memberIndex:memberIndex,tupleIndex:tupleIndex};return this._trigger("tupleMemberExpanding",evt,args)},_triggerTupleMemberExpanded:function(evt,axisName,memberIndex,tupleIndex){var args={owner:this,dataSource:this._ds,axisName:axisName,memberIndex:memberIndex,tupleIndex:tupleIndex};this._trigger("tupleMemberExpanded",evt,args)},_triggerTupleMemberCollapsing:function(evt,axisName,memberIndex,tupleIndex){var args={owner:this,dataSource:this._ds,axisName:axisName,memberIndex:memberIndex,tupleIndex:tupleIndex};return this._trigger("tupleMemberCollapsing",evt,args)},_triggerTupleMemberCollapsed:function(evt,axisName,memberIndex,tupleIndex){var args={owner:this,dataSource:this._ds,axisName:axisName,memberIndex:memberIndex,tupleIndex:tupleIndex};this._trigger("tupleMemberCollapsed",evt,args)},_triggerSorting:function(evt,columnSortDirections){var args={owner:this,sortDirections:columnSortDirections};return this._trigger("sorting",evt,args)},_triggerSorted:function(evt,columnSortDirections,appliedColumnSortDirections){var args={owner:this,sortDirections:columnSortDirections,appliedSortDirections:appliedColumnSortDirections};this._trigger("sorted",evt,args)},_triggerHeadersSorting:function(evt,levelSortDirections){var args={owner:this,levelSortDirections:levelSortDirections};return this._trigger("headersSorting",evt,args)},_triggerHeadersSorted:function(evt,levelSortDirections,appliedLevelSortDirections){var args={owner:this,levelSortDirections:levelSortDirections,appliedLevelSortDirections:appliedLevelSortDirections};this._trigger("headersSorted",evt,args)}});$.extend(true,$.ui.igPivotGrid.prototype,$.ig.Pivot._pivotShared);$.extend($.ui.igPivotGrid,{version:"13.1.20131.2523"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Pivot View 13.1.20131.2523
*
* Copyright (c) 2011-2012 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on: 
*	jquery-1.4.4.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	jquery.ui.draggable.js
*	jquery.ui.droppable.js
*	infragistics.util.js
*	infragistics.datasource.js
*	infragistics.olapxmladatasource.js
*	infragistics.olapflatdatasource.js
*	infragistics.ui.shared.js
*	infragistics.ui.scroll.js
*	infragistics.ui.splitter.js
*	infragistics.ui.tree.js
*	infragistics.ui.grid.framework.js
*	infragistics.ui.grid.multicolumnheaders.js
*	infragistics.ui.pivot.shared.js
*	infragistics.ui.pivotdataselector.js
*	infragistics.ui.pivotgrid.js
*/
(function($){var _igPivotGrid=$.ui.igPivotGrid.prototype.widgetFullName||$.ui.igPivotGrid.prototype.widgetName,_igPivotDataSelector=$.ui.igPivotDataSelector.prototype.widgetFullName||$.ui.igPivotDataSelector.prototype.widgetName,_igSplitter=$.ui.igSplitter.prototype.widgetFullName||$.ui.igSplitter.prototype.widgetName;$.widget("ui.igPivotView",{options:{width:null,height:null,dataSource:null,dataSourceOptions:{xmlaOptions:{serverUrl:null,catalog:null,cube:null,measureGroup:null,requestOptions:{withCredentials:false,beforeSend:null},enableResultCache:true,discoverProperties:null,executeProperties:null,mdxSettings:{nonEmptyOnRows:true,nonEmptyOnColumns:true,addCalculatedMembersOnRows:true,addCalculatedMembersOnColumns:true,dimensionPropertiesOnRows:[],dimensionPropertiesOnColumns:[]}},flatDataOptions:{dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseDataType:null,metadata:{cube:{name:null,caption:null,measuresDimension:{name:null,caption:null,measures:[{name:null,caption:null,aggregator:null,displayFolder:null}]},dimensions:[{name:null,caption:null,hierarchies:[{name:null,caption:null,displayFolder:null,levels:[{name:null,caption:null,memberProvider:null}]}]}]}}},measures:null,filters:null,rows:null,columns:null},pivotGridOptions:{isParentInFrontForColumns:false,isParentInFrontForRows:true,compactColumnHeaders:false,compactRowHeaders:true,compactColumnHeaderIndentation:30,compactRowHeaderIndentation:20,defaultRowHeaderWidth:200,allowSorting:false,firstSortDirection:"ascending",allowHeaderRowsSorting:false,allowHeaderColumnsSorting:false,levelSortDirections:[{levelUniqueName:null,sortDirection:null}],firstLevelSortDirection:"ascending",gridOptions:{defaultColumnWidth:null,fixedHeaders:true,caption:null,features:[],tabIndex:0,alternateRowStyles:true,enableHoverStyles:false},dragAndDropSettings:{appendTo:"body",containment:false,zIndex:10},dropDownParent:"body",disableRowsDropArea:false,disableColumnsDropArea:false,disableMeasuresDropArea:false,disableFiltersDropArea:false,hideRowsDropArea:false,hideColumnsDropArea:false,hideMeasuresDropArea:false,hideFiltersDropArea:false,customMoveValidation:null},dataSelectorOptions:{dragAndDropSettings:{appendTo:"body",containment:false,zIndex:10},dropDownParent:"body",customMoveValidation:null},pivotGridPanel:{resizable:true,collapsible:false,collapsed:false,size:null},dataSelectorPanel:{location:"right",resizable:true,collapsible:true,collapsed:false,size:250}},_create:function(){var $this=this,elementName,splitter,panel,pivotGrid,dataSelector,panels,dataSelectorLocation,dataSource;elementName=this.element[0].nodeName.toUpperCase();if(elementName!=="DIV"){throw new Error(elementName+$.ig.PivotDataSelector.locale.invalidBaseElement)}this.element.addClass("ui-igpivotview");if(this.options.width){this.element.width(this.options.width)}if(this.options.height){this.element.height(this.options.height)}dataSelectorLocation=this.options.dataSelectorPanel.location;splitter=$("<div></div>").appendTo(this.element);panel=$("<div></div>").appendTo(splitter);pivotGrid=$("<table></table>").attr("id",this.element.attr("id")+"_pivotGrid").appendTo(panel);panel=$("<div></div>")[dataSelectorLocation==="right"?"appendTo":"prependTo"](splitter);dataSelector=$("<div></div>").attr("id",this.element.attr("id")+"_dataSelector").appendTo(panel);panels=[this.options.pivotGridPanel,this.options.dataSelectorPanel];if(dataSelectorLocation!=="right"){panels.reverse()}dataSource=$.ig.Pivot._pivotShared._createDataSource(this.options.dataSource,this.options.dataSourceOptions);dataSelector.igPivotDataSelector($.extend(true,this.options.dataSelectorOptions,{dataSource:dataSource}));splitter.igSplitter({width:this.options.width||this.element.width(),height:this.options.height||this.element.height(),panels:panels}).bind("igsplitterresizeended igsplitterexpanded igsplittercollapsed",function(evt,ui){$this._setSize()}).bind("igsplitterresizestarted",function(){$(".ui-igpivot-metadatadropdown,.ui-igpivot-filterdropdown").remove()});if($.ui.igSplitter.prototype.css.verticalPanel){$($.ui.igSplitter.prototype.css.verticalPanel.replace(/ui-/g,".ui-").replace(/ /g,"")).css("overflow","hidden")}pivotGrid.igPivotGrid($.extend(true,this.options.pivotGridOptions,{dataSource:dataSource,width:(dataSelectorLocation==="right"?splitter.igSplitter("firstPanel"):splitter.igSplitter("secondPanel")).width(),height:splitter.igSplitter("option","height")}));splitter.igSplitter("refreshLayout");this._setSize();dataSelector.bind("igpivotdataselectordeferupdatechanged",function(evt,ui){pivotGrid.igPivotGrid("option","deferUpdate",ui.deferUpdate)})},_setOption:function(key,value){switch(key){case"dataSource":this.options.dataSourceOptions=null;this.options.dataSource=$.ig.Pivot._pivotShared._createDataSource(value,null);this.dataSelector().option("dataSource",this.options.dataSource);this.pivotGrid().option("dataSource",this.options.dataSource);break;case"dataSourceOptions":this.options.dataSourceOptions=value;this.options.dataSource=$.ig.Pivot._pivotShared._createDataSource(null,value);this.dataSelector().option("dataSource",this.options.dataSource);this.pivotGrid().option("dataSource",this.options.dataSource);break;case"width":case"height":$.Widget.prototype._setOption.call(this,arguments);this.splitter().element[key](value);this._setSize();break}},_setSize:function(){var splitter=this.splitter(),pivotGrid=this.pivotGrid(),dataSelector=this.dataSelector(),height=this.element.height(),dataSelectorLocation,pivotGridPanelWidth,dataSelectorPanelWidth;dataSelectorLocation=this.options.dataSelectorPanel.location;if(dataSelectorLocation==="right"){pivotGridPanelWidth=splitter.firstPanel().width();dataSelectorPanelWidth=splitter.secondPanel().width()}else{pivotGridPanelWidth=splitter.secondPanel().width();dataSelectorPanelWidth=splitter.firstPanel().width()}pivotGrid.option("width",pivotGridPanelWidth);pivotGrid.option("height",height);dataSelector.option("width",dataSelectorPanelWidth);dataSelector.option("height",height)},pivotGrid:function(){try{return this.element.find(":ui-igPivotGrid").data(_igPivotGrid)}catch(e){if(e==="Syntax error, unrecognized expression: Syntax error, unrecognized expression: ui-igPivotGrid"||e.message==="Syntax error, unrecognized expression: ui-igPivotGrid"){return this.element.find(":ui-igpivotgrid").data(_igPivotGrid)}throw e}},dataSelector:function(){try{return this.element.find(":ui-igPivotDataSelector").data(_igPivotDataSelector)}catch(e){if(e==="Syntax error, unrecognized expression: Syntax error, unrecognized expression: ui-igPivotDataSelector"||e.message==="Syntax error, unrecognized expression: ui-igPivotDataSelector"){return this.element.find(":ui-igpivotdataselector").data(_igPivotDataSelector)}throw e}},splitter:function(){try{return this.element.find(":ui-igSplitter").data(_igSplitter)}catch(e){if(e==="Syntax error, unrecognized expression: Syntax error, unrecognized expression: ui-igSplitter"||e.message==="Syntax error, unrecognized expression: ui-igSplitter"){return this.element.find(":ui-igsplitter").data(_igSplitter)}throw e}},destroy:function(){this.element.removeClass("ui-igpivotview");try{this.element.find(":ui-igPivotGrid").igPivotGrid("destroy");this.element.find(":ui-igPivotDataSelector").igPivotDataSelector("destroy");this.element.find(":ui-igSplitter").igSplitter("destroy").remove()}catch(e){if(typeof e==="string"){if(e.indexOf("unrecognized expression: ui-ig")!==-1){this.element.find(":ui-igpivotgrid").igPivotGrid("destroy");this.element.find(":ui-igpivotdataselector").igPivotDataSelector("destroy");this.element.find(":ui-igsplitter").igSplitter("destroy").remove();$.Widget.prototype.destroy.call(this);return}}else{if(e.message.indexOf("unrecognized expression: ui-ig")!==-1){this.element.find(":ui-igpivotgrid").igPivotGrid("destroy");this.element.find(":ui-igpivotdataselector").igPivotDataSelector("destroy");this.element.find(":ui-igsplitter").igSplitter("destroy").remove();$.Widget.prototype.destroy.call(this);return}}throw e}}});$.extend($.ui.igPivotView,{version:"13.1.20131.2523"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Editors 13.1.20131.2523
*
* Copyright (c) 2011-2014 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery-1.4.4.js
* jquery.ui.core.js
* jquery.ui.widget.js
*
* Example to use:
*	<script type="text/javascript">
*	$(function () {
*		$('#rating1').igRating({ voteCount:3, value:0.5, vertical:true });
*	});
*	</script>
*	<div id="rating1"></div>
*/
(function($){var _aNull=function(v){return v===null||v===undefined||typeof v==="number"&&isNaN(v)};$.widget("ui.igRating",{options:{vertical:false,value:null,valueHover:null,voteCount:5,voteWidth:0,voteHeight:0,swapDirection:false,valueAsPercent:true,focusable:true,precision:"whole",precisionZeroVote:.25,roundedDecimalPlaces:3,theme:null,validatorOptions:null,cssVotes:null},css:{normal:"ui-igrating ui-state-default ui-widget-content",active:"ui-igrating-active",selected:"ui-igrating-selected ui-state-highlight",hover:"ui-igrating-hover ui-state-hover",vote:"ui-igrating-vote ui-icon ui-icon-star",voteSelected:"ui-igrating-voteselected",voteDisabled:"ui-igrating-votedisabled ui-state-disabled",voteHover:"ui-igrating-votehover",voteDisabledSelected:"ui-igrating-votedisabledselected ui-state-disabled"},events:{hoverChange:null,valueChange:null},_create:function(){var inp,cont,elem,sto={fontSize:"1px",width:"100%",height:"100%",position:"relative",overflow:"hidden"},o=this.options,elem0=this.element,me=this,css=this.css,count=this._count(o),v=elem0[0].style,id=o.inputName;me._old={width:v.width,height:v.height,html:elem0[0].innerHTML};if(!id){elem0[0].innerHTML=""}if(o.theme){elem0.addClass(o.theme)}me._swap=o.swapDirection;me._rtl=elem0.css("direction")==="rtl";if(me._rtl){me._swap=!me._swap;elem0.css("direction","ltr")}me._hasHov=0;elem=me._elem=$("<div/>").css(sto).addClass(css.normal).appendTo(elem0).bind(me._evts={mousedown:function(e){me._doEvt(e,1)},mousemove:function(e){me._doEvt(e,2)},mouseleave:function(e){me._doEvt(e,3)}});cont=$("<div/>").css(sto).appendTo(elem);if(o.focusable){v={left:"5px",top:"5px",opacity:.1,position:"absolute",width:"1px",height:"1px",padding:"0px",zIndex:-1,border:"0px",outline:0};me._foc=$('<input type="button"/>').css(v).appendTo(cont).focus(function(evt){if(o.disabled||me._fcs){return}me._fcs=1;if(me._hasHov<2){me._hasHov+=2}if(me._hov){me._doVal(me._valH,1,evt);me._hov.css("visibility","visible")}me._elem.addClass(css.active)}).blur(function(){if(o.disabled||!me._fcs){return}me._fcs=null;me._hasHov%=2;if(me._hov&&me._hasHov===0){me._hov.css("visibility","hidden")}me._elem.removeClass(css.active)}).keydown(function(evt){var old,arrow=0,k=evt.keyCode,kc=$.ui.keyCode,val=me._valH,swap=me._swap?-1:1,vertical=o.vertical,d=1/me._count(o);if(o.disabled){return}old=val;d/=me._prec(o);if(k===kc.SPACE||k===kc.ENTER){me._doVal(val,false,evt);return}if(k===kc.HOME){val=0}else if(k===kc.END){val=1}else if(k===kc.PAGE_DOWN){val+=d*4}else if(k===kc.PAGE_UP){val-=d*4}else if(k===kc.UP&&vertical){val+=arrow=-d*swap}else if(k===kc.DOWN&&vertical){val+=arrow=d*swap}else if(k===kc.LEFT&&!vertical){val+=arrow=-d*swap}else if(k===kc.RIGHT&&!vertical){val+=arrow=d*swap}if(k>32&&k<41){try{evt.preventDefault();evt.stopPropagation()}catch(ex){}}for(k=0;k<3;k++){if(old!==(val=Math.max(Math.min(val,1),0))&&me._doVal(val,1,evt)&&arrow){val+=arrow}else{break}}})}me._doVotes(o,cont);if(id){inp=$('input[name="'+id+'"]');if(inp.length<=0){inp=$("#"+id)}v=inp[0]?inp[0].value:null;if(v){o.value=me._toNum(v,o)}}me._val=me._toNum(o.value,o);v=o.valueHover;me._valH=_aNull(v)?me._val:me._toNum(v,o);if(!o.valueAsPercent){me._val/=count;me._valH/=count}me.validator();me._set=true;me._doVal(me._val,null,inp?2:inp);me._doVal(me._valH,1);delete me._set},_toNum:function(v,o){if(!v){return 0}o=o._vsFormat;if(typeof v==="string"){v=parseFloat(o?v.replace(o,"_").replace(/[`,\. \':]/g,"").replace("_","."):v)}return isNaN(v)||v<0?0:v},_count:function(o){o=parseInt(o.voteCount,10);return isNaN(o)?5:Math.max(o,1)},_doVotes:function(o,cont){var hov,sel,cssV,height,width,div,span,cssi,val=cont,count=this._count(o),sto={width:"100%",height:"100%"},abs={left:"0px",top:"0px",position:"absolute",overflow:"hidden",border:"none",background:"none"},i=-1,me=this,css=this.css,elem=this._elem,elem0=this.element,touch={touchstart:function(e){e.preventDefault();$(this).trigger("mousedown")}};if(!cont){cont=me._div.parent();me._div.remove();me._hov.remove();me._sel.remove();me._selSwap=me._hovSwap=null}div=me._div=$("<div/>").addClass(css.vote).css(abs).appendTo(cont);if(!o.vertical){div.css("whiteSpace","nowrap")}height=parseInt(o.voteHeight,10);width=parseInt(o.voteWidth,10);if(isNaN(height)||height<2){height=div.css("height");height=!height||height.indexOf("px")<1?16:parseInt(height,10)}if(isNaN(width)||width<2){width=div.css("width");width=!width||width.indexOf("px")<1?16:parseInt(width,10)}div.removeClass(css.vote);sel=me._sel=$("<div/>").addClass(css.selected).css(sto).css(abs).appendTo(cont);if(!o.vertical){sel.css("whiteSpace","nowrap")}hov=me._hov=$("<div/>").addClass(css.hover).css(sto).css(abs).css("visibility","hidden").appendTo(cont);if(!o.vertical){hov.css("whiteSpace","nowrap")}if(me._swap&&!o.vertical){me._hovSwap=hov=$("<div/>").css(sto).appendTo(me._hov);me._selSwap=sel=$("<div/>").css(sto).appendTo(me._sel)}cssV={display:o.vertical?"block":"inline-block",width:width,height:height,textIndent:"0px",overflow:"visible"};while(++i<count){span=$("<span />").addClass(css.vote).css(cssV).appendTo(div).bind(touch);if(o.disabled){span.addClass(css.voteDisabled)}cssi=o.cssVotes?o.cssVotes[i]:null;if(cssi&&cssi[0]){span.addClass(cssi[0])}span[0]._i=i;span=$("<span />").addClass(css.vote).addClass(css.voteSelected).css(cssV).appendTo(sel).bind(touch);if(o.disabled){span.addClass(css.voteDisabledSelected)}if(cssi&&cssi[1]){span.addClass(cssi[1])}span[0]._i=i;if(me._swap&&!me._selSwap){me._selSwap=span}span=$("<span />").addClass(css.vote).addClass(css.voteHover).css(cssV).appendTo(hov).bind(touch);if(cssi&&cssi[2]){span.addClass(cssi[2])}span[0]._i=i;if(me._swap&&!me._hovSwap){me._hovSwap=span}}if(o.vertical){me._size=height;height*=count}else{me._size=width;width*=count}elem.css({height:height+"px",width:width+"px"});try{height+=(i=Math.max(elem.outerHeight()-elem.innerHeight(),0))>10?2:i;width+=(i=Math.max(elem.outerWidth()-elem.innerWidth(),0))>10?2:i}catch(ex){}elem0.css({height:height+"px",width:width+"px"});div.css(sto);if(!val){me.value(me.value())}},validator:function(destroy){var o=this.options.validatorOptions,foc=this._foc,v=this._validator;if(v&&(destroy||!o)){v.destroy();delete this._validator}else if(!v&&!destroy&&o&&foc&&foc.igValidator){o.element=this.element.find(":first-child");this._validator=foc.igValidator(o).data("igValidator")}return this._validator},validate:function(){return this._validator?this._validator.validate():null},_doEvt:function(evt,type){var val,me=this,o=this.options;if(o.disabled){return}if(type===3){me._hasHov-=me._hasHov%2;if(me._hov&&me._hasHov===0){me._hov[0].style.visibility="hidden"}return}val=me._valFromEvt(evt);if(val<0){return}if(type===1){if(!me._sel){return}val=me._lastHov||val;me._doVal(val,false,evt);me._doVal(val,1,evt);if(me._foc&&document.hasFocus&&!document.hasFocus()){return setTimeout(function(){me.focus()},0)}me.focus()}if(type===2){me._lastHov=val;if(!me._hov){return}if(me._hasHov%2===0){me._hasHov++}me._hov[0].style.visibility="visible";me._doVal(val,1,evt)}evt.preventDefault()},_setOption:function(key,val){var spans,count,css,o=this.options;if(o[key]===val||key==="swapDirection"||key==="vertical"||key==="focusable"){return this}count=this._count(o);if(key==="disabled"){spans=$("SPAN",this._div);css=this.css.voteDisabled;if(spans.length!==count){return this}if(val){spans.addClass(css)}else{spans.removeClass(css)}spans=$("SPAN",this._sel);css=this.css.voteDisabledSelected;if(spans.length!==count&&this._selSwap){spans=$("SPAN",this._selSwap)}if(spans.length===count){if(val){spans.addClass(css)}else{spans.removeClass(css)}}}if(key==="theme"){if(o.theme){this.element.removeClass(o.theme)}if(val){this.element.addClass(val)}}o[key]=val;if(typeof val==="function"){return this}this._set=true;if(key==="precision"||key==="valueAsPercent"){this._doVal(this._val,false,1);this._doVal(this._valH,1,1)}if(key.indexOf("vote")===0||key==="theme"||key==="cssVotes"){this._doVotes(o)}if(key.indexOf("value")>=0){this._doVal(val,key.length>6,1,1)}if(key==="validatorOptions"){this.validator()}delete this._set;return this},_evtOffset:function(evt,xy){var val,oEvt=evt.originalEvent||evt,offset="offset"+xy;if(_aNull(val=evt[offset])){if(_aNull(val=oEvt[offset])){if(_aNull(val=evt[offset="layer"+xy])){val=oEvt[offset]}}}return val||1},_valFromEvt:function(evt){var plus,fix,val,offset,i,o=this.options,targ=evt?evt.target:null;i=targ&&targ.nodeName==="SPAN"?targ._i:null;if(_aNull(i)){return-1}if(!targ.unselectable){targ.unselectable="on"}offset=this._evtOffset(evt,o.vertical?"Y":"X");plus=this._size;fix=-(o.vertical?targ.offsetTop:targ.offsetLeft);if(this._swap&&$.ig.util.isFF&&fix<plus){offset+=fix}plus*=i;if(plus>offset){offset+=plus}val=offset/this._count(o)/this._size;if(this._swap){val=1-val}return Math.max(Math.min(val,1),0)},_doVal:function(val,hov,evt,v0){var id,inp,v1,count,o=this.options,style=hov?this._hov:this._sel,size=this._size,swap=this._swap?hov?this._hovSwap:this._selSwap:null;if(style){style=style[0];if(style){style=style.style}}if(!style){return}count=this._count(o);if(v0){val=parseFloat(val)}if(isNaN(val)){val=-1}else if(v0&&!o.valueAsPercent){val/=count}if(evt&&evt.type&&val>=0){v0=this._fixVal(hov?this._valH:this._val,1);v1=this._fixVal(val,1);if(v0===v1){return 1}if(!this._trigger(hov?"hoverChange":"valueChange",evt,{value:v1,oldValue:v0})){return}}if(val<0&&hov){val=this._val}val=this._fixVal(val);if(evt){v0=this._round(o.valueAsPercent?val:val*count,o);if(hov){this._valH=val;o.valueHover=v0}else{if(evt!==2){this._val=val;o.value=v0}id=o.inputName;if(id){inp=$('input[name="'+id+'"]');if(inp.length===0){inp=$('<input type="hidden" name="'+id+'" />').appendTo(this.element.parent())}v1=o._vsFormat;inp.val(v1?v0.toString().replace(".",v1):v0)}}}if(!hov&&this._foc){this._foc.val(this._fixVal(val,1))}if(swap){val=1-val}val=Math.floor(val*size*count+.3);val+="px";if(swap){swap=swap[0];if(swap){swap=swap.style}}if(o.vertical){if(swap){style.top=val;swap.marginTop="-"+val}else{style.height=val}}else{if(swap){style.left=val;swap.marginLeft="-"+val}else{style.width=val}}},_prec:function(o){o=this._set?null:o.precision;if(o){o=o.toLowerCase()}return o==="half"?2:o==="whole"?1:4},_fixVal:function(val,full,prec){var fix,count,o=this.options;prec=prec||this._prec(o);count=this._count(o);val=Math.max(Math.min(val,1),0);if(prec<4){fix=count*prec;val*=fix;val=val<o.precisionZeroVote?0:Math.floor(Math.floor(val+.99)+.499*prec)/fix}if(!full){return val}if(!o.valueAsPercent){val*=count;val=prec>1?val:Math.floor(val+.1)}return this._round(val,o)},_round:function(val,o){var pow=1,fix=parseInt(o.roundedDecimalPlaces,10);if(isNaN(fix)||fix<0){return val}fix=Math.min(15,Math.max(fix,this._prec(o)<4?3:o.valueAsPercent?1:0));while(fix-->0){pow*=10}return Math.round(val*pow)/pow},value:function(val){if(typeof val!=="number"){return this._fixVal(this._val,1,4)}this._set=true;this._doVal(val,false,1,1);delete this._set;return this},valueHover:function(val){if(typeof val!=="number"){return this._fixVal(this._valH,1,4)}this._set=true;this._doVal(val,1,1,1);delete this._set;return this},hasFocus:function(){return this._fcs===1},focus:function(){if(this._foc){try{this._foc[0].focus()}catch(ex){}}return this},destroy:function(){var o=this.options,old=this._old,e=this.element;if(!this._elem){return this}this.validator(1);if(this._foc){this._foc.unbind().remove()}this._elem.remove();if(o.theme){e.removeClass(o.theme)}e[0].style.width=old.width;e[0].style.height=old.height;if(!o.inputName){e[0].innerHTML=old.html}if(this._rtl){e.css("direction","rtl")}$.Widget.prototype.destroy.apply(this,arguments);this._elem=this._hov=this._sel=this._selSwap=this._hovSwap=this._foc=this._evts=null;return this}});$.extend($.ui.igRating,{version:"13.1.20131.2523"})})(jQuery);(function($){$.widget("ui.igTileManager",{css:{container:"ui-widget ui-igtilemanager",header:"ui-widget-header ui-igtile-header",content:"ui-widget-content ui-igtile",innerContainer:"ui-igtile-inner-container",expandButton:"ig-button ig-tile-expand-button ui-state-default",expandIcon:"ui-icon ig-tile-expand-icon",collapseIcon:"ui-icon ig-tile-collapse-icon",minimizeButton:"ig-button ig-tile-minimize-button ui-state-default",minimizeIcon:"ui-icon ig-tile-minimize-icon",unminimizeIcon:"ui-icon ig-tile-unminimize-icon",hoverClass:"ui-state-hover"},options:{layoutConfiguration:null,dataSource:null,headerTemplate:null,contentTemplate:null,headerSelector:null,minimizeSelector:".ig-tile-minimize-button",maximizeSelector:".ig-tile-expand-button",animationDuration:500,dataSourceUrl:null,responseDataKey:null,responseDataType:null,dataSourceType:null,requestType:"GET",responseContentType:null},events:{dataBinding:"dataBinding",dataBound:"dataBound",rendering:"rendering",rendered:"rendered",tileFocusing:"tileFocusing",tileFocused:"tileFocused",tilesRestoring:"tilesRestoring",tilesRestored:"tilesRestored",tileMinimizing:"tileMinimizing",tileMinimized:"tileMinimized",tileMaximizing:"tileMaximizing",tileMaximized:"tileMaximized"},_createWidget:function(options,element){this.options.layoutConfiguration={layoutMode:"grid",items:[],gridLayout:{marginTop:0,marginLeft:0}};$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var opt=this.options;this.element.addClass(this.css.container);this._analyzeConfig();if(opt.dataSource!==null){this.dataBind()}else{this._fromMarkup=true;opt.maximizeSelector=opt.maximizeSelector===".ig-tile-expand-button"?".ui-igtile":opt.maximizeSelector;opt.minimizeSelector=opt.minimizeSelector===".ig-tile-minimize-button"?null:opt.minimizeSelector;this._initFromMarkup()}this._attachEvents()},_setOption:function(option,value){if(this.options[option]===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"dataSource":this.element.igLayoutManager("destroy");this.element.empty();this.dataBind();break;case"layoutConfiguration":this._analyzeConfig();if(this._fromMarkup){this.element.igLayoutManager("destroy");this._initFromMarkup()}else{this.element.igLayoutManager("destroy");this.element.empty();this.dataBind()}break;default:break}},_analyzeConfig:function(){this._analyzeHeight();this._analyzeWidth()},_analyzeWidth:function(){var config=this.options.layoutConfiguration.gridLayout,units;if(typeof config.columnWidth==="string"){if(config.columnWidth.indexOf("%")!==-1){units=config.columnWidth.substring(0,config.columnWidth.length-1);units=parseInt(units,10)/100;if(!isNaN(units)){config.columnWidth=Math.floor((this.element.width()-this._getScrollBarWidth())*units-config.marginLeft)}}else if(config.columnWidth.indexOf("px")!==-1){units=config.columnWidth.substring(0,config.columnWidth.length-2);units=parseInt(units,10);if(!isNaN(units)){config.columnWidth=units;config.itemsRearrangable=true}else{throw new Error($.ig.TileManager.columnWidthUnitError+config.columnWidth)}}}else if(typeof config.columnWidth==="number"){config.itemsRearrangable=true}else if(!config.columnWidth&&!config.cols){config.cols=4}},_analyzeHeight:function(){var config=this.options.layoutConfiguration.gridLayout,units;if(config.rows&&!config.columnHeight){config.columnHeight=Math.floor(this.element.height()/config.rows)}else if(typeof config.columnHeight==="string"){if(config.columnHeight.indexOf("%")!==-1){units=config.columnHeight.substring(0,config.columnHeight.length-1);units=parseInt(units,10)/100;if(!isNaN(units)){config.columnHeight=Math.floor(this.element.height()*units-config.marginTop);config.rows=Math.floor(1/units)}}else if(config.columnHeight.indexOf("px")!==-1){units=config.columnHeight.substring(0,config.columnHeight.length-2);units=parseInt(units,10);if(!isNaN(units)){config.columnHeight=units}else{throw new Error($.ig.TileManager.columnHeightUnitError+config.columnHeight)}}}},_initFromMarkup:function(){var opt=this.options,elements,i,ratio,cols=0,rows=0,temp;elements=opt.itemSelector?this.element.children(opt.itemSelector):this.element.children();if(opt.layoutConfiguration.items.length===0){if(opt.layoutConfiguration.gridLayout.columnWidth){ratio=Math.floor(this.element.width()/(opt.layoutConfiguration.gridLayout.columnWidth+opt.layoutConfiguration.gridLayout.marginLeft))}else{ratio=opt.layoutConfiguration.gridLayout.cols}for(i=0;i<elements.length;i++){opt.layoutConfiguration.items.push({rowSpan:1,colSpan:1,colIndex:i%ratio,rowIndex:Math.floor(i/ratio),element:$(elements[i])})}if(!opt.layoutConfiguration.gridLayout.rows){opt.layoutConfiguration.gridLayout.rows=Math.ceil(opt.layoutConfiguration.items.length/ratio);if(!opt.layoutConfiguration.gridLayout.columnHeight){opt.layoutConfiguration.gridLayout.columnHeight=Math.floor(this.element.height()/rows-opt.layoutConfiguration.gridLayout.marginTop)}}if(!opt.layoutConfiguration.gridLayout.cols){opt.layoutConfiguration.gridLayout.cols=ratio}elements.addClass(this.css.content)}else{for(i=0;i<opt.layoutConfiguration.items.length;i++){temp=opt.layoutConfiguration.items[i].colIndex+opt.layoutConfiguration.items[i].colSpan;if(temp>cols){cols=temp}temp=opt.layoutConfiguration.items[i].rowIndex+opt.layoutConfiguration.items[i].rowSpan;if(temp>rows){rows=temp}if(!opt.layoutConfiguration.items[i].element){opt.layoutConfiguration.items[i].element=this.element.children(":eq("+i+")").addClass(this.css.content)}}if(!opt.layoutConfiguration.gridLayout.rows){opt.layoutConfiguration.gridLayout.rows=rows;if(!opt.layoutConfiguration.gridLayout.columnHeight){opt.layoutConfiguration.gridLayout.columnHeight=Math.floor(this.element.height()/rows-opt.layoutConfiguration.gridLayout.marginTop)}}if(!opt.layoutConfiguration.gridLayout.cols){opt.layoutConfiguration.gridLayout.cols=cols}}this.element.igLayoutManager(opt.layoutConfiguration);this.options.layoutConfiguration.gridLayout=this.element.igLayoutManager("option","gridLayout")},_initDataSource:function(){var opt=this.options,dataOpt;if(!opt.dataSource&&opt.dataSourceUrl){opt.dataSource=opt.dataSourceUrl}if(!(opt.dataSource instanceof $.ig.DataSource)){dataOpt={callback:this._renderData,callee:this,dataSource:opt.dataSource,requestType:opt.requestType,responseContentType:opt.responseContentType,responseDataType:opt.responseDataType,localSchemaTransform:false};if(opt.responseDataKey){dataOpt.responseDataKey=opt.responseDataKey}if(opt.dataSourceType){dataOpt.dataSourceType=opt.dataSourceType}opt.dataSource=new $.ig.DataSource(dataOpt)}},_renderData:function(success,msg,data){this._triggerDataBound(success,msg,data._data);if(success){var opt=this.options,ratio,self=this,i,cols=0,rows=0,temp,noCancel;if(opt.layoutConfiguration.items.length===0){if(opt.layoutConfiguration.gridLayout.columnWidth){ratio=Math.floor(this.element.width()/(opt.layoutConfiguration.gridLayout.columnWidth+opt.layoutConfiguration.gridLayout.marginLeft))}else{ratio=opt.layoutConfiguration.gridLayout.cols}for(i=0;i<data._data.length;i++){opt.layoutConfiguration.items.push({rowSpan:1,colSpan:1,colIndex:i%ratio,rowIndex:Math.floor(i/ratio)})}if(!opt.layoutConfiguration.gridLayout.rows){opt.layoutConfiguration.gridLayout.rows=Math.ceil(opt.layoutConfiguration.items.length/ratio);if(!opt.layoutConfiguration.gridLayout.columnHeight){opt.layoutConfiguration.gridLayout.columnHeight=Math.floor(this.element.height()/rows-opt.layoutConfiguration.gridLayout.marginTop)}}if(!opt.layoutConfiguration.gridLayout.cols){opt.layoutConfiguration.gridLayout.cols=ratio}}else{for(i=0;i<opt.layoutConfiguration.items.length;i++){temp=opt.layoutConfiguration.items[i].colIndex+opt.layoutConfiguration.items[i].colSpan;if(temp>cols){cols=temp}temp=opt.layoutConfiguration.items[i].rowIndex+opt.layoutConfiguration.items[i].rowSpan;if(temp>rows){rows=temp}}if(!opt.layoutConfiguration.gridLayout.rows){opt.layoutConfiguration.gridLayout.rows=rows;if(!opt.layoutConfiguration.gridLayout.columnHeight){opt.layoutConfiguration.gridLayout.columnHeight=Math.floor(this.element.height()/rows-opt.layoutConfiguration.gridLayout.marginTop)}}if(!opt.layoutConfiguration.gridLayout.cols){opt.layoutConfiguration.gridLayout.cols=cols}}noCancel=this._triggerRendering(data._data,opt.layoutConfiguration.items);if(noCancel){this.element.igLayoutManager($.extend(false,opt.layoutConfiguration,{itemRendered:function(event,ui){self._itemRendered(event,ui)},rendered:function(event,ui){self.element.find(".ui-igtile").each(function(index,element){self._setInnerContainerHeight($(this))});self._triggerRendered()}}));this.options.layoutConfiguration.gridLayout=this.element.igLayoutManager("option","gridLayout")}}else{throw new Error($.ig.TileManager.renderDataError)}},_itemRendered:function(event,ui){var element=ui.item,data=this.options.dataSource.data(),header,innerContainer;header='<div class="'+this.css.header+'">';if(this.options.headerTemplate){header+=$.ig.tmpl(this.options.headerTemplate,data[ui.index])}header+=this._renderExpandButton()+"</div>";innerContainer='<div class="'+this.css.innerContainer+'">'+$.ig.tmpl(this.options.contentTemplate,data[ui.index])+"</div>";element.addClass(this.css.content).html(header+innerContainer).attr("data-exp","expanded")},_renderMinimizeButton:function(){return'<span data-role="minimize" class="'+this.css.minimizeButton+'"><span class="'+this.css.minimizeIcon+'"></span></span>'},_renderExpandButton:function(){return'<span data-role="maximize" class="'+this.css.expandButton+'"><span class="'+this.css.expandIcon+'"></span></span>'},_attachEvents:function(){var self=this,noCancel;this._allvisible=true;this._animating=false;this.element.on("click",this.options.maximizeSelector,function(event){var item=$(this).closest(".ui-igtile");if(!self._animating){self._animating=true;if(!self._item||self._item.attr("id")!==item.attr("id")){noCancel=self._triggerTileFocusing(event,item);if(noCancel){self._handleFocusing(item,event)}else{self._animating=false}}else{if(self._item){noCancel=self._triggerTilesRestoring(event,self._item);if(noCancel){self._handleRestoring(item,event)}else{self._animating=false}}}}}).on("mouseover",".ig-button",function(event){$(this).addClass(self.css.hoverClass)}).on("mouseout",".ig-button",function(event){$(this).removeClass(self.css.hoverClass)}).on("iglayoutmanagerbeforeinternalresize",function(event){if(self._item){self._animating=true;noCancel=self._triggerTilesRestoring(event,self._item);if(noCancel){self._handleRestoring(self._item,event)}else{self._animating=false}}})},_handleFocusing:function(item,event){var self=this,gl=this.options.layoutConfiguration.gridLayout,newDimensions,useOffset=self.element.css("position")==="static",offset=self.element.offset(),previousFocusedTile=this._item,visibleRows=Math.floor(this.element.height()/(gl.columnHeight+gl.marginTop));this.element.find(".ui-igtile").not(item).each(function(index,element){var $el=$(this),isBelowTheFocusedTile=index>visibleRows-1,newDim={width:gl.columnWidth,height:gl.columnHeight,top:gl.marginTop+(gl.marginTop+gl.columnHeight)*(!isBelowTheFocusedTile?index:visibleRows+Math.floor((index-visibleRows)/gl.cols))+(useOffset?offset.top:0),left:gl.marginLeft+(gl.marginLeft+gl.columnWidth)*(!isBelowTheFocusedTile?gl.cols-1:(index-visibleRows)%gl.cols)+(useOffset?offset.left:0)};if(!self._item){$el.attr("data-old-left",$el.css("left"));$el.attr("data-old-top",$el.css("top"));$el.attr("data-height",$el.css("height"));$el.attr("data-width",$el.css("width"))}$el.animate(newDim,self.options.animationDuration,function(){if(!self._fromMarkup&&previousFocusedTile&&previousFocusedTile.attr("id")===$el.attr("id")){self._setInnerContainerHeight($el)}});if(!self._fromMarkup){$el.find(self.options.maximizeSelector).children().removeClass(self.css.collapseIcon).addClass(self.css.expandIcon)}});if(!this._item){item.attr("data-old-left",item.css("left"));item.attr("data-old-top",item.css("top"));item.attr("data-height",item.css("height"));item.attr("data-width",item.css("width"))}newDimensions={width:(gl.cols-1)*gl.columnWidth+(gl.cols-2>=0?gl.cols-2:0)*gl.marginLeft,height:visibleRows*gl.columnHeight+(visibleRows-1)*gl.marginTop,top:gl.marginTop+(useOffset?offset.top:0),left:gl.marginLeft+(useOffset?offset.left:0)};if(!self._fromMarkup){item.find(".ui-igtile-inner-container").height("100%")}item.animate(newDimensions,self.options.animationDuration,function(){self._animating=false;if(!self._fromMarkup){item.find(self.options.maximizeSelector).children().removeClass(self.css.expandIcon).addClass(self.css.collapseIcon);self._setInnerContainerHeight(item)}self._triggerTileFocused(null,item)});this._item=item},_handleRestoring:function(item,event){var self=this,oldDimensions={width:item.attr("data-width"),height:item.attr("data-height"),top:item.attr("data-old-top"),left:item.attr("data-old-left")};this._item.animate(oldDimensions,self.options.animationDuration,function(){item.removeAttr("data-width").removeAttr("data-height").removeAttr("data-old-left").removeAttr("data-old-top");self._animating=false;if(!self._fromMarkup){self._setInnerContainerHeight(item)}self._triggerTilesRestored(null)});this.element.find(".ui-igtile").not(this._item).each(function(index,element){var $el=$(this),oldDim={width:$el.attr("data-width"),height:$el.attr("data-height"),left:$el.attr("data-old-left"),top:$el.attr("data-old-top")};$el.animate(oldDim,self.options.animationDuration,function(){$el.removeAttr("data-width").removeAttr("data-height").removeAttr("data-old-left").removeAttr("data-old-top")})});if(!this._fromMarkup){item.find(self.options.maximizeSelector).children().removeClass(this.css.collapseIcon).addClass(this.css.expandIcon)}delete this._item},_getScrollBarWidth:function(){var el=$('<div style="width: 100px; height: 100px; position: absolute; top: -10000px; left: -10000px; overflow: scroll"></div>').appendTo($(document.body)),scrollWidth;scrollWidth=el[0].offsetWidth-el[0].clientWidth;el.remove();return scrollWidth},_setInnerContainerHeight:function(igTile){var innerContainer=igTile.find(".ui-igtile-inner-container");innerContainer.height(igTile.height()-(innerContainer.outerHeight(true)-innerContainer.height())-igTile.find(".ui-igtile-header").outerHeight(true))},_triggerDataBinding:function(){var args={owner:this,dataSource:this.options.dataSource};return this._trigger(this.events.dataBinding,null,args)},_triggerDataBound:function(success,msg,dataView){var args={owner:this,success:success,errorMessage:msg,dataView:dataView};this._trigger(this.events.dataBound,null,args)},_triggerRendering:function(data,items){var args={owner:this,data:data,items:items};return this._trigger(this.events.rendering,null,args)},_triggerRendered:function(){this._trigger(this.events.rendered,null,{owner:this})},_triggerTileFocusing:function(event,tile){var args={owner:this,index:tile.index(),element:tile};return this._trigger(this.events.tileFocusing,event,args)},_triggerTileFocused:function(event,tile){var args={owner:this,index:tile.index(),element:tile};this._trigger(this.events.tileFocused,event,args)},_triggerTilesRestoring:function(event,tile){var args={owner:this,focusedTile:tile};return this._trigger(this.events.tilesRestoring,event,args)},_triggerTilesRestored:function(){this._trigger(this.events.tilesRestored,null,{owner:this})},_triggerTileMinimizing:function(event,tile){var args={owner:this,index:tile.index(),element:tile};return this._trigger(this.events.tileMinimizing,event,args)},_triggerTileMinimized:function(tile){var args={owner:this,index:tile.index(),element:tile};this._trigger(this.events.tileMinimized,null,args)},_triggerTileMaximizing:function(event,tile){var args={owner:this,index:tile.index(),element:tile};return this._trigger(this.events.tileMaximizing,event,args)},_triggerTileMaximized:function(tile){var args={owner:this,index:tile.index(),element:tile};this._trigger(this.events.tileMaximized,null,args)},dataBind:function(){var noCancel;this._initDataSource();noCancel=this._triggerDataBinding();if(noCancel){this.options.dataSource.dataBind(this._renderData,this)}},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);this.element.igLayoutManager("destroy");this.element.removeClass(this.css.container);if(!this._fromMarkup){this.element.empty()}else{this.element.children().removeClass(this.css.content)}this.element.unbind();return this}});$.extend($.ui.igTileManager,{version:"13.1.20131.2523"})})(jQuery);/*!@license
 * Infragistics.Web.ClientUI jQuery File Upload 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery-1.4.2.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *  infragistics.util.js
 *  infragistics.ui.shared.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igBrowseButton",$.ui.igButton,{_const:{filePickerWidth:"220px",filePickerHeight:"30px"},css:{filePickerClass:"ui-igbrowsebutton-filepicker"},options:{autoselect:true,multipleFiles:false},_id:function(id){return this.element[0].id+id},_create:function(){var filepickerId=this._id("_fp"),self=this;$.extend($.ui.igBrowseButton.prototype.options,$.ui.igButton.prototype.options);$.extend($.ui.igBrowseButton.prototype.css,$.ui.igButton.prototype.css);$.ui.igButton.prototype._create.apply(this);this._createFilePicker(filepickerId);this._attachBrowseButtonEvents();if(this.options.disabled===true){this._enableFilePicker(true)}else{this.element.bind({click:function(e){e.preventDefault()},drop:function(e){var files=e.originalEvent.dataTransfer.files;e.stopPropagation();e.preventDefault();if(files===null||files===undefined){return false}if(!self._trigger("fileselect",e,{files:files,multiple:true})){return}return false}})}},_createFilePicker:function(filepickerId){$("#"+filepickerId).remove();var multiple="";if(this.options.multipleFiles===true){multiple=' multiple=""'}this.filePicker=$('<input type="file" id="'+filepickerId+'"'+multiple+"/>").appendTo($(document.body));this.filePicker.css({position:"absolute",margin:"-5px 0 0 -175px",padding:"0",width:"1px",height:"1px",fontSize:"14px",opacity:"0",cursor:"pointer",display:"block",zIndex:"1000000",filter:"alpha(opacity=0)"});this._setTitle(this.options.title)},_setTitle:function(title){var filePicker=$("#"+this._id("_fp"));if(title===false){filePicker.removeAttr("title")}else{filePicker.attr("title",title)}},_attachBrowseButtonEvents:function(){var self=this;this.mouseMoveEvent={mousemove:function(event){self._mousemove(event)}};this._internalEvents={mouseover:function(event){self._mousemove(event);self._attachMouseMove(true)}};self.element.bind(this._internalEvents);self._filePickerBindChange()},_filePickerBindChange:function(){var self=this,filePath,filePicker=$("#"+this._id("_fp"));self.tempClicked=false;self._filePickerEvents={change:function(event){var files=null,multiple=false;filePath=self._fileFromPath(filePicker.val());if(filePicker[0].files){files=filePicker[0].files;multiple=true}self._mousemove(event);if(!self._trigger("fileselect",event,{filePath:filePath,files:files,multiple:multiple})){return}},click:function(event){if(!self._trigger("click",event)){return false}}};filePicker.bind(self._filePickerEvents)},attachFilePicker:function(e,isHidden){var self=this,right,bottom,fileUploadButton=self.element,filePicker=this.filePicker,offset=fileUploadButton.offset(),left=parseInt(offset.left,10),top=parseInt(offset.top,10),filePickerDOM=filePicker[0];right=parseInt(left+fileUploadButton[0].offsetWidth,10);bottom=parseInt(top+fileUploadButton[0].offsetHeight,10);if(e.pageX>=left&&e.pageX<=right&&e.pageY>=top&&e.pageY<=bottom){filePickerDOM.style.top=e.pageY+"px";filePickerDOM.style.left=e.pageX+"px";if(isHidden===true){filePicker.css({width:"1px",height:"1px"})}else{self.isVisibleFilePicker=true;filePicker.css({width:self._const.filePickerWidth,height:self._const.filePickerHeight})}filePickerDOM.style.display="block";self._onMouseOver(e)}},getFilePicker:function(){var filepickerId=this._id("_fp"),filePicker=$("#"+filepickerId);filePicker.attr("id","").css({display:"none"});this._createFilePicker(filepickerId);this._filePickerBindChange();return filePicker},_mousemove:function(e){var self=this,right,bottom,fileUploadButton=self.element,filePicker=this.filePicker,left=$.ig.util.offset(fileUploadButton).left,top=$.ig.util.offset(fileUploadButton).top,filePickerDOM=filePicker[0];right=parseInt(left+fileUploadButton[0].offsetWidth,10);bottom=parseInt(top+fileUploadButton[0].offsetHeight,10);if(e.pageX>=left&&e.pageX<=right&&e.pageY>=top&&e.pageY<=bottom){filePickerDOM.style.top=e.pageY+"px";filePickerDOM.style.left=e.pageX+"px";if(!self.isVisibleFilePicker){filePicker.css({width:self._const.filePickerWidth,height:self._const.filePickerHeight});self.isVisibleFilePicker=true}filePickerDOM.style.display="block";self._onMouseOver(e)}else{if(self.isVisibleFilePicker){filePicker.css({width:"1px",height:"1px"});self.isVisibleFilePicker=false}self._attachMouseMove(false);self._onMouseOut(e)}},_attachMouseMove:function(isToAttach){if(isToAttach){$(document).bind(this.mouseMoveEvent)}else{$(document).unbind(this.mouseMoveEvent)}},_setOption:function(key,value){$.ui.igButton.prototype._setOption.apply(this,arguments);$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"disabled":this._enableFilePicker(value);$.ui.igButton.prototype._setOption.apply(this,arguments);break;case"title":this._setTitle(value);break;default:break}},_enableFilePicker:function(isDisabled){var filePicker=$("#"+this._id("_fp"));if(isDisabled===false){this.isVisibleFilePicker=false;this._attachMouseMove(true);this.element.bind(this._internalEvents).mouseover()}else{this._attachMouseMove(false);filePicker.css({width:"1px",height:"1px"});this.element.unbind(this._internalEvents)}},destroy:function(){this.element.unbind(this._internalEvents);this.element.unbind(this.mouseMoveEvent);$.Widget.prototype.destroy.apply(this,arguments);$.ui.igButton.prototype.destroy.apply(this);$("#"+this._id("_fp")).remove()},_fileFromPath:function(file){return file.replace(/(\/|\\)$/,"")}});$.extend($.ui.igBrowseButton,{version:"13.1.20131.2523"});$.widget("ui.igUpload",{_const:{fileNameLimit:100,AjaxQueueName:"uploadrequestsqueue",debug:true,isProgressBarAnimationEnabled:true,isProgressBarRange:false,timeoutGetFileSize:1e3,status:{NotStarted:0,Started:1,Finished:2,NoSuchFile:3,Canceled:4},errorCode:{MimeTypeValidation:1,FileSizeExceeded:2},clientSideErrorCode:{maxAllowedUploadingFiles:1,extensionValidation:2,startUpload:3,ajaxErrorGetFileStatus:4,ajaxErrorCancelUpload:5,removeFileUpload:6,ajaxErrorRequestFileSize:7,checkCanUpload:8},fileStatusNoError:-1,progressUpdateInterval:800,animateProgressBarInterval:10,showHideDetailsAnimationTimeout:500,doubleCheckRequestInterval:1e3,removeSingleUploadAnimationTimeout:300,maxUploadFilesDefault:-1},defaultFileExtensionIcons:[{ext:[],css:"ui-icon ui-icon-document ui-igupload-progressbar-icon ui-igupload-progressbar-icon-default",def:true},{ext:["exe","app"],css:"ui-icon ui-icon-gear ui-igupload-progressbar-icon ui-igupload-progressbar-icon-exe",def:false},{ext:["gif","jpg","jpeg","png","bmp","yuv","tif","thm","psd"],css:"ui-icon ui-icon-image ui-igupload-progressbar-icon ui-igupload-progressbar-icon-images",def:false},{ext:["mp3","wav","mp4","aac","mid","wma","ra","iff","aif","m3u","mpa"],css:"ui-icon ui-icon-volume-on ui-icon ui-icon-image ui-igupload-progressbar-icon ui-igupload-progressbar-icon-music",def:false},{ext:["doc","docx","xls","xlsx","txt","ppt","pptx","pdf"],css:"ui-icon ui-icon-document ui-igupload-progressbar-icon ui-igupload-progressbar-icon-docs",def:false},{ext:["3gp","asf","asx","avi","flv","mov","mp4","mpg","rm","swf","vob","wmv"],css:"ui-icon ui-icon-video ui-igupload-progressbar-icon ui-igupload-progressbar-icon-video",def:false}],css:{clearClass:"ui-helper-clearfix",hiddenClass:"ui-helper-hidden",baseClassIE6:"ui-ie6",baseClassIE7:"ui-ie7",baseClassMoz:"ui-moz",baseClassOpera:"ui-opera",baseClassWebkit:"ui-webkit",startupBrowseButtonClasses:"ui-igstartupbrowsebutton",baseClass:"ui-widget ui-widget ui-widget-content ui-corner-all ui-igupload",baseMainContainerClass:"ui-igupload-basemaincontainer",multipleDialogClasses:"ui-iguploadmultiple",singleDialogClass:"ui-iguploadsingle",browseButtonClass:"ui-igupload-browsebutton",containerClass:"ui-igupload-container ui-widget-content",uploadProgressClass:"ui-igupload-uploadprogress",fileInfoMainContainer:"ui-igupload-fimaincontainer",progressContainer:"ui-helper-clearfix",progressBarUploadClass:"ui-igupload-progressbar-upload ui-igupload-progressbar-upload-single ui-helper-clearfix",progressBarFileNameClass:"ui-igupload-progressbar-filename",progressBarFileSizeClass:"ui-igupload-progressbar-filesize",progressBarInnerHTMLContainerClass:"ui-igupload-progressbar-container ui-helper-clearfix",containerButtonCancelClass:"ui-container-button-cancel-class  ui-helper-clearfix",summaryProgressBarClass:"ui-igupload-summaryprogressbar",summaryProgressContainerClass:"ui-igupload-summaryprogresscontainer",summaryProgressbarLabelClass:"ui-igupload-summaryprogress-label",summaryInformationContainerClass:"ui-igupload-summaryinformation-container ui-helper-clearfix",summaryUploadedFilesLabelClass:"ui-igupload-summaryuploadedfiles-label",summaryShowHideDetailsButtonClass:"ui-igupload-showhidedetails-button",summaryButtonClass:"ui-igupload-summary-button",summaryProgressBarInnerProgress:"ui-igupload-summaryprogres_summpbar_progress",summaryProgressBarSecondaryLabel:"ui-igupload-summaryprogress-label ui-igupload-summaryprogress-secondary-label",containerFUS:"ui-widget-content ui-igupload-progress-container ui-corner-all ui-helper-clearfix"},options:{width:"",height:"",autostartupload:false,labelUploadButton:$.ig.Upload.locale.labelUploadButton,labelAddButton:$.ig.Upload.locale.labelAddButton,labelClearAllButton:$.ig.Upload.locale.labelClearAllButton,labelSummaryTemplate:$.ig.Upload.locale.labelSummaryTemplate,labelSummaryProgressBarTemplate:$.ig.Upload.locale.labelSummaryProgressBarTemplate,labelShowDetails:$.ig.Upload.locale.labelShowDetails,labelHideDetails:$.ig.Upload.locale.labelHideDetails,labelSummaryProgressButtonCancel:$.ig.Upload.locale.labelSummaryProgressButtonCancel,labelSummaryProgressButtonContinue:$.ig.Upload.locale.labelSummaryProgressButtonContinue,labelSummaryProgressButtonDone:$.ig.Upload.locale.labelSummaryProgressButtonDone,labelProgressBarFileNameContinue:$.ig.Upload.locale.labelProgressBarFileNameContinue,errorMessageMaxFileSizeExceeded:$.ig.Upload.locale.errorMessageFileSizeExceeded,errorMessageGetFileStatus:$.ig.Upload.locale.errorMessageGetFileStatus,errorMessageCancelUpload:$.ig.Upload.locale.errorMessageCancelUpload,errorMessageNoSuchFile:$.ig.Upload.locale.errorMessageNoSuchFile,errorMessageOther:$.ig.Upload.locale.errorMessageOther,errorMessageValidatingFileExtension:$.ig.Upload.locale.errorMessageValidatingFileExtension,errorMessageAJAXRequestFileSize:$.ig.Upload.locale.errorMessageAJAXRequestFileSize,errorMessageTryToRemoveNonExistingFile:$.ig.Upload.locale.errorMessageTryToRemoveNonExistingFile,errorMessageTryToStartNonExistingFile:$.ig.Upload.locale.errorMessageTryToStartNonExistingFile,errorMessageMaxUploadedFiles:$.ig.Upload.locale.errorMessageMaxUploadedFiles,errorMessageMaxSimultaneousFiles:$.ig.Upload.locale.errorMessageMaxSimultaneousFiles,uploadUrl:"ig_fua34sf345sdf13sdf3454erdsf2345asd3425df5235d54df345.aspx",progressUrl:"IGUploadStatusHandler.ashx",allowedExtensions:[],showFileExtensionIcon:true,css:null,fileExtensionIcons:[{ext:[],css:"",def:false}],mode:"single",multipleFiles:false,maxUploadedFiles:-1,maxSimultaneousFilesUploads:1,fileSizeMetric:"auto",controlId:"",fileSizeDecimalDisplay:2},events:{fileSelecting:"fileSelecting",fileSelected:"fileSelected",fileUploading:"fileUploading",fileUploaded:"fileUploaded",fileUploadAborted:"fileUploadAborted",cancelAllClicked:"cancelAllClicked",onError:"onError",fileExtensionsValidating:"fileExtensionsValidating"},summaryButtonModes:{cancel:1,startupload:2,done:3},container:function(){return $("#"+this.element[0].id+"_wrprinit")},widget:function(){return this.element},_id:function(suffix,formNumber){var id=this.element[0].id;if(formNumber!==undefined){return id+"_"+formNumber+"_"+suffix}return id+suffix},_create:function(){var data={formNumber:0,iframe:{ids:[]},pendingQueueIDs:[],uploadingIDs:[],batch:[],lastId:-1,filesInfo:[],countUploadingFiles:0,countTotalFiles:0,fileSizeUploaded:0,fileSizeTotal:0};this.allCancelled=false;this.fileInfoData=data;this._renderStartupBrowseButton();this.container().bind("drop",$.proxy(this._dropFiles,this)).width(this.options.width).height(this.options.height);this._attachFakeIframe();this._analyzeFileExtensionIcons();$(document).bind("dragenter."+this.element[0].id,$.proxy(this._docEnter,this));$(document).bind("dragover."+this.element[0].id,$.proxy(this._docOver,this));$(document).bind("dragleave."+this.element[0].id,$.proxy(this._docLeave,this))},_dropFiles:function(e){var isInit=$("#"+this._id("_ibb")).is(":visible"),data={files:e.originalEvent.dataTransfer.files,multiple:true};e.preventDefault();if(isInit){this._initBrowserFileSelect(e,data)}else{this._onBrowseButtonFileSelected(e,false,data)}return false},_docEnter:function(e){e.preventDefault();return false},_docOver:function(e){e.preventDefault();return false},_docLeave:function(e){e.preventDefault();return false},_analyzeFileExtensionIcons:function(){var i,j,arrIconExtensions=this.options.fileExtensionIcons,lengthIconExtensions,defIconExtensions=$.extend(true,[],this.defaultFileExtensionIcons),lengthDefaultIconExtensions=defIconExtensions.length,resArr=[],isDefaultDefined=false;if(arrIconExtensions===undefined||arrIconExtensions===null){this.options.fileExtensionIcons=defIconExtensions;return}lengthIconExtensions=arrIconExtensions.length;if(lengthIconExtensions===1&&arrIconExtensions[0].css===""){this.options.fileExtensionIcons=defIconExtensions;return}for(j=0;j<lengthIconExtensions;j++){for(i=0;i<lengthDefaultIconExtensions;i++){defIconExtensions[i].ext=this._removeCommonElementsInArrays(defIconExtensions[i].ext,arrIconExtensions[j].ext)}if(arrIconExtensions[j].def===true){isDefaultDefined=true}resArr.push(arrIconExtensions[j])}for(i=0;i<lengthDefaultIconExtensions;i++){if(defIconExtensions[i].ext.length>0||isDefaultDefined===false&&defIconExtensions[i].def===true){resArr.push(defIconExtensions[i])}}this.options.fileExtensionIcons=resArr},_removeCommonElementsInArrays:function(arr1,arr2){return $.grep(arr1,function(n){return $.inArray(n,arr2)===-1})},_attachFakeIframe:function(){var idTempIframe=this._id("_tempIframe");if($.ig.util.isIE7||$.ig.util.isIE8||$.ig.util.isIEQuircks){$("#"+idTempIframe).remove();setTimeout($('<iframe src="javascript:false;" id="'+idTempIframe+'" style="display: none;"></iframe>').appendTo($("#"+this._id("_fu"))),300)}},_renderStartupBrowseButton:function(){var self=this,css=self.css,e=self.element,o=self.options,bbId=this._id("_ibb"),isMultipleFiles=o.mode==="multiple"&&o.multipleFiles,wrapperElementId=this._id("_wrprinit"),containerDiv,button;this.originalElement=e;containerDiv='<div id="'+wrapperElementId+'" class="ig-upload-container"></div>';e.wrap(containerDiv);e.hide();e=$("#"+wrapperElementId);bbId=this._id("_ibb");if($.ig.util.isIE7){e.addClass(css.baseClassIE7)}else if($.ig.util.isOpera){e.addClass(css.baseClassOpera)}else if($.ig.util.isOpera){e.addClass(css.baseClassMoz)}else if($.ig.util.isOpera){e.addClass(css.baseClassWebkit)}button=$("<button></button>").appendTo(e).attr("id",bbId).addClass(css.startupBrowseButtonClasses);button.igBrowseButton({multipleFiles:isMultipleFiles,labelText:o.labelUploadButton,title:$.ig.Upload.locale.titleUploadFileButtonInit,fileselect:function(event,data){self._initBrowserFileSelect(event,data)},disabled:o.disabled,click:function(event){var isCancelEvent=false;if(self._trigger(self.events.fileSelecting,event)===false){isCancelEvent=true}return!isCancelEvent}})},_initBrowserFileSelect:function(event,data){var countFiles=1,filePicker;if(!data||!data.files||data.files.length===0){filePicker=$("#"+this._id("_ibb_fp"));if(this._validateFileExtension(filePicker[0].value,true)===false){return}}if(this._checkMaxUploadingFilesCount(countFiles,true)===true){$("#"+this._id("_ibb")).css({display:"none"});this._HTMLUpload();this._onBrowseButtonFileSelected(event,true,data)}},_HTMLUpload:function(){var uploaderId=this._id("_fu"),baseMainContainerId=this._id("_bmncntr"),o=this.options,e=this.container(),self=this,css=self.css,fileContainerId=this._id("_fc"),browseButtonId=this._id("_bb"),clearAllButtonId=this._id("_clrabtn"),uploaderContainerId=this._id("_fi_main_cntnr"),clearAllButton,html="";if(o.mode==="single"){html+='<div  class="'+css.singleDialogClass+'" id="$baseMainContainerId">';html+='   <div id="$uploaderId$" class="$baseMainContainerClass">';html+='       <div id="$fileContainerId$"></div>';html+='       <button id="$browseButtonId$" class="$browseButtonClass$"></button>';html+="   </div>";html+="</div>"}else if(o.mode==="multiple"){html='<div class="'+css.multipleDialogClasses+'" id="$baseMainContainerId">';html+='   <div  id="$uploaderId$" class="$baseMainContainerClass">';html+='       <div id="$uploaderFilesContainer" class="$fuMainContainerClass">';html+='           <button id="$browseButtonId$" class="$browseButtonClass$"></button>';html+='           <button id="$clearAllButtonId$"></button>';html+='           <div id="$fileContainerId$"></div>';html+="       </div>";html+="   </div>";html+="</div>"}html=html.replace("$uploaderId$",uploaderId).replace("$browseButtonId$",browseButtonId).replace("$baseMainContainerId",baseMainContainerId).replace("$browseButtonClass$",css.browseButtonClass).replace("$fileContainerId$",fileContainerId).replace("$clearAllButtonId$",clearAllButtonId).replace("$uploaderFilesContainer",uploaderContainerId).replace("$fuMainContainerClass",css.fileInfoMainContainer).replace("$baseMainContainerClass",css.baseMainContainerClass);$(html).appendTo(e).css({width:o.width,height:o.height}).addClass(css.baseClass);clearAllButton=$("#"+clearAllButtonId);if(clearAllButton.length>0){clearAllButton.igButton({title:$.ig.Upload.locale.titleClearAllButton,labelText:o.labelClearAllButton,disabled:true,click:function(event){event.preventDefault();self.clearAll()},css:{buttonClasses:"ui-igbutton ui-igupload-button-clear-all",buttonHoverClasses:"",buttonActiveClasses:"",buttonFocusClasses:"",buttonLabelClass:""}})}$("#"+browseButtonId).igBrowseButton({multipleFiles:o.mode==="multiple"&&o.multipleFiles,labelText:this.options.labelAddButton,title:$.ig.Upload.locale.titleAddFileButton,fileselect:function(event,data){self._onBrowseButtonFileSelected(event,false,data)},click:function(event){var isCancelEvent=false;if(self._trigger(self.events.fileSelecting,event)===false){isCancelEvent=true}return!isCancelEvent}});$("#"+fileContainerId).addClass(css.containerClass);if(o.mode==="multiple"){self._spbRenderInit()}},_disableBrowseButton:function(isToDisable){$("#"+this._id("_bb")).igBrowseButton("option","disabled",isToDisable);$("#"+this._id("_ibb")).igBrowseButton("option","disabled",isToDisable)},_checkMaxUploadingFilesCount:function(count,callEvent){if(count===null||count===undefined){count=1}var o=this.options,allowUpload=true,totalFiles=this.fileInfoData.countTotalFiles+count;if(o.maxUploadedFiles!==this._const.maxUploadFilesDefault&&o.maxUploadedFiles!==null&&totalFiles>o.maxUploadedFiles){allowUpload=false;if(callEvent===true){this._setError(o.errorMessageMaxUploadedFiles,this._const.clientSideErrorCode.maxAllowedUploadingFiles,"clientside")}}return allowUpload},_onBrowseButtonFileSelected:function(event,isInitBrowseButton,data){var self=this,fileData=this.fileInfoData,filePicker,o=self.options,countFiles=1;if(data&&data.files&&data.files.length>=1){countFiles=data.files.length}if(self._checkMaxUploadingFilesCount(countFiles,true)===false){if(data.multiple===true){return}self._disableBrowseButton(true);return}if(o.maxUploadedFiles!==null&&o.maxUploadedFiles!==this._const.maxUploadFilesDefault&&o.maxUploadedFiles===fileData.countTotalFiles+countFiles){self._disableBrowseButton(true)}if(o.mode==="single"){if(fileData.iframe.ids.length===0){self._removeSingleUpload(fileData.lastId);if(self._attachIframe(event,isInitBrowseButton,fileData.files)===true){self._disableBrowseButton(true)}}}else if(o.mode==="multiple"){if(isInitBrowseButton===true){filePicker=$("#"+self._id("_ibb"))}else{filePicker=$("#"+self._id("_bb"))}if(self._attachIframe(event,isInitBrowseButton,data)===false){self._disableBrowseButton(false)}}},clearAll:function(){var e=this.container(),arr=e.data("finishedIDs"),id,l;if(arr===undefined){return}l=arr.length;for(id=0;id<l;id++){this._removeSingleUpload(arr[id])}arr=[];e.data("finishedIDs",arr);this._disableClearAllButton()},_enableClearAllButton:function(){$("#"+this._id("_clrabtn")).igButton({disabled:false})},_disableClearAllButton:function(){$("#"+this._id("_clrabtn")).igButton("option","disabled",true)},_attachIframe:function(event,isInitBrowseButton,data){var res,files,filePicker,browse=$("#"+this._id("_bb"));if(data&&data.files){files=data.files}if(isInitBrowseButton===true){filePicker=$("#"+this._id("_ibb")).igBrowseButton("getFilePicker")}else{filePicker=browse.igBrowseButton("getFilePicker")}if(filePicker[0].files&&(files===null||files===undefined)){files=filePicker[0].files}if(files&&files.length>=1){res=this._uploadMultiple(files);filePicker.remove()}else{res=this._createForm(filePicker)}return res},_uploadMultiple:function(files){var res,i,filesLength=files.length,data=this.fileInfoData,fileId=data.formNumber;for(i=0;i<filesLength;i++){res=this._html5createForm(files[i],i,fileId)}return res},_html5upload:function(fileId){var xhr=new XMLHttpRequest,formData=new FormData,o=this.options,self=this,file=this.fileInfoData.filesInfo[fileId].file,key=this.fileInfoData.filesInfo[fileId].key,cid=o.controlId,upload=xhr.upload,uploadUrl=o.uploadUrl+"?key="+key+"&cid="+cid+"&multiple=true";xhr.open("POST",uploadUrl);xhr.withCredentials="true";formData.append(this._id("_frm",fileId)+"_if",file);upload.addEventListener("progress",function(e){self._html5progress(e,fileId)},false);upload.addEventListener("error",function(e){self._getFileStatus(fileId,true)},false);this.fileInfoData.filesInfo[fileId].xhr=xhr;xhr.onload=function(e){var response,error;if(xhr.status>=200&&xhr.status<=299){response=xhr.responseText;if(response){error=response.substring(response.indexOf("<error>"),response.indexOf("</error>")).replace("<error>","");if(error!==""){error=parseInt(error,10);if(!isNaN(error)){self._getFileStatus(fileId,true);return}}self._html5progress(e,fileId,true)}}else{self._getFileStatus(fileId,true)}};xhr.send(formData)},_html5progress:function(e,formNumber,isFinish){var self=this,singleFileData,data={};if(e.lengthComputable||isFinish){data.bytesUploaded=e.loaded;if(isNaN(data.bytesUploaded)){data.bytesUploaded=0}if(isNaN(e.total)){e.total=0}singleFileData=this._getFileInfo(formNumber);if(singleFileData&&singleFileData.innerStatus===self._const.status.Canceled){return}if(isFinish){data.total=data.bytesUploaded=singleFileData.sizeBytes;data.status=self._const.status.Finished}else{data.status=self._const.status.Started}data.size=e.total;self._setFileStatus(formNumber,true,data)}else{self.cancelUpload(formNumber)}},_html5createForm:function(fileInfo,ind,formNumber){var self=this,o=self.options,fileName=fileInfo.name,fileSize=fileInfo.size,data=this.fileInfoData,fileId=data.formNumber++,key=self._randomString(30),status=self._const.status.Started;if(self._validateFileExtension(fileInfo.name,true)===false){if(o.mode==="multiple"){self._spbRenderProgress()}if(o.maxUploadedFiles!==null&&o.maxUploadedFiles>=data.countTotalFiles+1){self._disableBrowseButton(false)}return false}if(isNaN(fileSize)){fileSize=0}data.filesInfo[fileId]={path:fileName,key:key,sizeBytes:fileSize,uploadedBytes:0,status:self._const.status.NotStarted,checksNoSuchFile:0,innerStatus:self._const.status.NotStarted,multipleFiles:true,file:fileInfo,formNumber:formNumber};data.countTotalFiles++;self._spbRenderProgress();self._HTMLSingleUpload(fileId);this._saveFileSize(fileSize,fileId);if(o.autostartupload===true){if(self._checkCanUpload()===true){self.startUpload(fileId)}else{self._addPendingId(fileId);status=self._const.status.NotStarted}}else{if(o.mode==="single"){self._showSingleUploadStartUpload(true,fileId)}else{self._addIDBatch(fileId);status=self._const.status.NotStarted}}data.iframe.ids[data.iframe.ids.fileId]={id:fileId,status:status};if(o.mode==="multiple"){self._spbCheckModeButton()}self._trigger(self.events.fileSelected,null,{fileId:fileId,filePath:self._getOnlyFileName(fileName)});return true},_createForm:function(filePicker){var self=this,o=self.options,data=this.fileInfoData,fileId=data.formNumber++,iframeId=this._id("_ifrm",fileId),formId=this._id("_frm",fileId),iframe,form,key=self._randomString(30),status=self._const.status.Started,cid=o.controlId,uploadUrl=o.uploadUrl+"?key="+key+"&cid="+cid;if(self._validateFileExtension(filePicker[0].value,true)===false){filePicker.remove();if(o.mode==="multiple"){self._spbRenderProgress()}if(o.maxUploadedFiles!==null&&o.maxUploadedFiles>=data.countTotalFiles+1){self._disableBrowseButton(false)}return false}data.filesInfo[fileId]={path:filePicker.val(),key:key,sizeBytes:0,uploadedBytes:0,status:self._const.status.NotStarted,checksNoSuchFile:0,innerStatus:self._const.status.NotStarted};data.countTotalFiles++;self._spbRenderProgress();iframe=$('<iframe src="javascript:false;" id="'+iframeId+'" name="'+iframeId+'"></iframe>').appendTo($(document.body)).css({display:"none"});form=$('<form method="post" enctype="multipart/form-data"></form>').attr("id",formId).attr("target",iframeId).attr("action",uploadUrl).appendTo($(document.body));filePicker.attr("name",formId+"_if").attr("id",formId+"_if").appendTo(form);self._HTMLSingleUpload(fileId);if(o.autostartupload===true){if(self._checkCanUpload()===true){self.startUpload(fileId)}else{self._addPendingId(fileId);status=self._const.status.NotStarted;self._getFileSize(fileId,key)}}else{if(o.mode==="single"){self._showSingleUploadStartUpload(true,fileId);self._getFileSize(fileId,key)}else{self._addIDBatch(fileId);status=self._const.status.NotStarted;self._getFileSize(fileId,key)}}data.iframe.ids[data.iframe.ids.fileId]={id:fileId,status:status};if(o.mode==="multiple"){self._spbCheckModeButton()}self._trigger(self.events.fileSelected,event,{fileId:fileId,filePath:self._getOnlyFileName(filePicker.val())});return true},_showSingleUploadStartUpload:function(){var self=this,o=self.options,startUploadButtonId="_strtuplbtn",startUploadButton=$("#"+this._id(startUploadButtonId)),browseButton=$("#"+this._id("_bb"));if(startUploadButton.length===0){$('<button id="'+self._id(startUploadButtonId)+'"></button>').appendTo($("#"+self._id("_fu"))).igButton({labelText:o.labelSummaryProgressButtonContinue,title:$.ig.Upload.locale.titleSingleUploadButtonContinue,click:function(e){e.preventDefault();self.startUpload(self.fileInfoData.formNumber-1,e);browseButton.igBrowseButton("attachFilePicker",e,true)}});startUploadButton=$("#"+this._id(startUploadButtonId))}browseButton.hide();startUploadButton.show()},_removeIframe:function(iframeNumber){var self=this,data=this.fileInfoData,iframeId=this._id("_ifrm",iframeNumber),formId=this._id("_frm",iframeNumber),browseButton=$("#"+self._id("_bb"));$("#"+iframeId).remove();$("#"+formId).remove();data.iframe.ids=self._removeElementArrayById(data.iframe.ids,iframeNumber);if(self.options.mode==="single"){browseButton.igBrowseButton("option","disabled",false);data.lastId=iframeNumber}this._attachFakeIframe()},_HTMLSingleUpload:function(formNumber){var self=this,o=this.options,css=self.css,fileContainerId=self._id("_fc"),fileUploadStatusId=self._id("_fus",formNumber),singleProgressBarId=self._id("_snglpbar",formNumber),iconId=self._id("_icn",formNumber),cancelButtonId=self._id("_cbtn",formNumber),fileContainer=$("#"+fileContainerId),fileUploadStatus,fileName=this.fileInfoData.filesInfo[formNumber].path,html,progressBarFileNameId=self._id("_pbrflnm",formNumber),progressBarFileSizeId=self._id("_pbrflsz",formNumber),progressBarFileName,progressBarFileSize,singleProgressBar,iconClass=self._getFileExtensionIconPath(self._getFileExtension(fileName));html='<div id="'+fileUploadStatusId+'">';html+='   <div class="'+css.containerFUS+'">';html+='       <div class="'+css.containerButtonCancelClass+'">';html+='           <button id="'+cancelButtonId+'"></button>';html+="       </div>";html+='       <div class="'+css.progressContainer+'">';html+='           <div class="'+css.progressBarInnerHTMLContainerClass+'" title="'+fileName+'">';html+='               <span id="'+iconId+'" class="'+iconClass+'"></span>';html+='               <span class="'+css.progressBarFileNameClass+'" id="'+progressBarFileNameId+'"></span>';html+='               <span class="'+css.progressBarFileSizeClass+'" id="'+progressBarFileSizeId+'"></span>';html+="           </div>";html+='           <div id="'+singleProgressBarId+'" class="'+css.progressBarUploadClass+'"></div>';html+="       </div>";html+="   </div>";html+="</div>";$(html).appendTo(fileContainer);fileUploadStatus=$("#"+fileUploadStatusId).addClass(css.uploadProgressClass+" "+css.clearClass);singleProgressBar=$("#"+singleProgressBarId);$("#"+cancelButtonId).igButton({onlyIcons:true,icons:{primary:"ui-icon-closethick"},title:$.ig.Upload.locale.titleCancelUploadButton,click:function(event){event.preventDefault();self.cancelUpload(formNumber);$("#"+cancelButtonId).igButton("option","disabled",true).igButton("option","icons",{primary:"ui-icon-check",secondary:null})},css:{buttonClasses:"ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-igbutton ui-igupload-cancel-button",buttonHoverClasses:"ui-state-hover",buttonActiveClasses:"ui-state-active",buttonFocusClasses:"ui-state-focus",buttonLabelClass:"ui-button-text",buttonDisabledClass:"ui-state-disabled",buttonPrimaryIconClass:"ui-button-icon-primary ui-icon",buttonMainElementPrimaryIconClass:" ui-button-text-icon-primary",buttonMainElementSecondaryIconClass:" ui-button-text-icon-secondary",buttonSecondaryIconClass:"ui-button-icon-secondary ui-icon",buttonIconsOnly:"ui-button-icons-only",buttonIconOnly:"ui-button-icon-only",buttonIcons:"ui-button-text-icons",buttonTextOnlyClass:"ui-button-text-only"}});singleProgressBar.igProgressBar({animate:self._const.isProgressBarAnimationEnabled,animateTimeout:self._const.animateProgressBarInterval,range:self._const.isProgressBarRange,value:0,queue:false});if(!o.showFileExtensionIcon){$("#"+iconId).css("display","none")}progressBarFileName=$("#"+progressBarFileNameId);progressBarFileSize=$("#"+progressBarFileSizeId);fileName=self._getOnlyFileName(fileName);singleProgressBar.data("originalFileName",fileName);if(fileName.length>self._const.fileNameLimit){fileName=fileName.substr(0,self._const.fileNameLimit)}progressBarFileName.text(self._formatFilePath(fileName));self._renderFileName(formNumber,0,fileName)},_renderFileName:function(formNumber,fileSize,fn){var self=this,o=self.options,fileName=fn,previousFileName="",originalFileSize,progressBarFileName=$("#"+self._id("_pbrflnm",formNumber)),progressBarFileSize=$("#"+self._id("_pbrflsz",formNumber)),singleProgressBarWidth=$("#"+self._id("_snglpbar",formNumber)).width(),singleProgressBar=$("#"+self._id("_snglpbar",formNumber)),progressBarFileSizeWidth=progressBarFileSize.width();if(progressBarFileName.length===0){return}if(fileName===undefined||fileName===null){fileName=singleProgressBar.data("fileName")}if(singleProgressBarWidth<=0){fileName=o.labelProgressBarFileNameContinue;progressBarFileName.text(fileName)}else{if(fileSize!==0&&fileSize!==undefined&&fileSize!==null){originalFileSize=progressBarFileSize.text();progressBarFileSizeWidth=progressBarFileSize.text(self._formatFileSize(fileSize)+"/"+self._formatFileSize(fileSize)).width();progressBarFileSize.text(originalFileSize)}while(progressBarFileName.position().left+progressBarFileName.width()+progressBarFileSizeWidth>=singleProgressBarWidth&&previousFileName!==fileName){previousFileName=fileName;fileName=fileName.substr(0,fileName.length/2);if(previousFileName===fileName&&fileName.length-1>1){fileName=fileName.substr(0,(fileName.length-1)/2)}progressBarFileName.text(fileName+o.labelProgressBarFileNameContinue)}if(progressBarFileName.position().left+progressBarFileName.width()+progressBarFileSize.width()>=singleProgressBarWidth){fileName=o.labelProgressBarFileNameContinue}}singleProgressBar.data("fileName",fileName)},_removeSingleUpload:function(formNumber){var self=this,fileUploadStatusId=self._id("_fus",formNumber),fileUploadStatusTmpId=fileUploadStatusId+"_"+self._randomString(20);
if(self.options.mode==="multiple"){$("#"+fileUploadStatusId).attr("id",fileUploadStatusTmpId);self._renderAnimatedRemovingUpload(fileUploadStatusTmpId)}else if(self.options.mode==="single"){$("#"+fileUploadStatusId).hide().remove()}},_renderAnimatedRemovingUpload:function(id){$("#"+id).slideUp(this._const.removeSingleUploadAnimationTimeout,function(){$(this).remove()})},startUpload:function(formNumber){var self=this,formId=self._id("_frm",formNumber),fileData=this.fileInfoData,isHTML5=false;if(formNumber===null||fileData.filesInfo[formNumber]===null||fileData.filesInfo[formNumber]===undefined){self._setError(self.options.errorMessageTryToStartNonExistingFile.replace("{0}",formNumber),self._const.clientSideErrorCode.startUpload,"clientside");return}if(fileData.filesInfo[formNumber].status!==self._const.status.NotStarted){return}isHTML5=fileData.filesInfo[formNumber].multipleFiles;if(isHTML5!==true){$("#"+formId).submit()}else{this._html5upload(formNumber)}self._addUploadingID(formNumber);self._removeIDBatch(formNumber);self._spbCheckModeButton();fileData.filesInfo[formNumber].status=self._const.status.Started;fileData.filesInfo[formNumber].innerStatus=self._const.status.Started;self._spbRenderProgress();if(this.options.mode==="single"){$("#"+self._id("_strtuplbtn")).hide();$("#"+self._id("_bb")).igBrowseButton("option","disabled",true).show()}if(isHTML5===true){return}setTimeout(function(){self._getFileStatus(formNumber,true)},self._const.progressUpdateInterval)},_setFileStatus:function(formNumber,isNewFile,data){var self=this,o=self.options,isFinishUpload=false,status="",bytesUploaded=0,fileSize=0,singleFileData=this._getFileInfo(formNumber),fileData=this.fileInfoData,key=self._getKey(formNumber),fileDetails=fileData.filesInfo[formNumber],fileName=fileDetails.path,error,isError,serverMessage="";if(key===null||key===undefined){return false}bytesUploaded=parseInt(data.bytesUploaded,10);status=parseInt(data.status,10);fileSize=parseInt(data.size,10);serverMessage=data.serverMessage;isFinishUpload=status===self._const.status.Finished;error=parseInt(data.error,10);isError=!isNaN(error)&&error!==self._const.fileStatusNoError;if(fileDetails.innerStatus===self._const.status.Canceled&&isError){self._setError(o.errorMessageOther.replace("{0}",error),error,"serverside",serverMessage);return false}if(isError===true&&status!==self._const.status.NoSuchFile){self._removeUploadSetError(formNumber,o.errorMessageOther.replace("{0}",error),error,"serverside",serverMessage);return false}if(singleFileData!==null&&singleFileData.status!==self._const.status.Canceled){fileData.fileSizeUploaded-=singleFileData.uploadedBytes;if(singleFileData.sizeBytes===0||singleFileData.sizeBytes===null){singleFileData.sizeBytes=fileSize;fileData.fileSizeTotal+=fileSize}else if(singleFileData.sizeBytes!==fileSize){fileSize=singleFileData.sizeBytes}if(isFinishUpload){fileData.countUploadingFiles++}if(bytesUploaded===0&&singleFileData.uploadedBytes>0){bytesUploaded=singleFileData.uploadedBytes}singleFileData.uploadedBytes=bytesUploaded;singleFileData.status=status;fileData.fileSizeUploaded+=singleFileData.uploadedBytes;self._spbRenderProgress();if(self._trigger(self.events.fileUploading,null,{fileId:formNumber,filePath:self._getOnlyFileName(fileName),totalSize:fileSize,uploadedBytes:bytesUploaded,fileStatus:status})===false){self.cancelUpload(formNumber)}}if(isFinishUpload||status===self._const.status.Started){if(isFinishUpload){self._removeUploadingID(formNumber);if(o.mode==="multiple"){self._spbCheckModeButton();self._submitNextPendingId()}}self._renderStatus(formNumber,bytesUploaded,fileSize,isFinishUpload,isNewFile);if(!isFinishUpload){return true}}else if(status===self._const.status.NoSuchFile){if(fileDetails!==null&&fileDetails!==undefined&&fileDetails.checksNoSuchFile===0){fileDetails.checksNoSuchFile++;return true}self._removeUploadSetError(formNumber,o.errorMessageNoSuchFile,"nosuchfilekeyid","serverside",serverMessage)}return false},_getFileStatus:function(formNumber,isNewFile){var self=this,o=self.options,key=self._getKey(formNumber);if(key===null||key===undefined){return}key=key.replace("-$#","").replace("#$-","");$.ajaxQueue("uploadrequestsqueue",{url:self._formatURL(o.progressUrl,$.param({key:key,command:"status"})),dataType:"json",cache:false,success:function(data){if(self._setFileStatus(formNumber,isNewFile,data)===true){setTimeout(function(){self._getFileStatus(formNumber,false)},self._const.progressUpdateInterval)}},error:function(){self._setError(o.errorMessageGetFileStatus,self._const.clientSideErrorCode.ajaxErrorGetFileStatus,"clientside")}})},_removeUploadSetError:function(formNumber,errorMessage,errorCode,errorType,serverMessage){var self=this,o=this.options;self._removeIframe(formNumber);self._removeFileUpload(formNumber);self._setError(errorMessage,errorCode,errorType,serverMessage);if(o.mode==="multiple"){self._spbCheckModeButton();self._submitNextPendingId()}},cancelUpload:function(formNumber){var self=this,o=self.options,singleProgressBarId=self._id("_snglpbar",formNumber),singleProgressBar=$("#"+singleProgressBarId),filePicker=$("#"+self._id("_frm",formNumber)+"_if"),fileName=filePicker.val(),totalSize=0,bytesUploaded=0,key=this._getKey(formNumber),singleFileInfo=this._getFileInfo(formNumber);totalSize=singleProgressBar.data("totalSize");bytesUploaded=singleProgressBar.data("bytesUploaded");if(totalSize===undefined){totalSize=0}if(bytesUploaded===undefined){bytesUploaded=0}if(singleFileInfo!==null){if(singleFileInfo.status===self._const.status.Started){singleFileInfo.innerStatus=self._const.status.Canceled;if(singleFileInfo.multipleFiles===true){singleFileInfo.xhr.abort();self._onCancelUpload(formNumber)}else{$.ajaxQueue("uploadrequestsqueue",{url:self._formatURL(o.progressUrl,$.param({key:key,command:"cancel"})),dataType:"json",cache:false,success:function(){self._onCancelUpload(formNumber)},error:function(){self._setError(o.errorMessageCancelUpload,self._const.clientSideErrorCode.ajaxErrorCancelUpload,"clientside");self._removeFileUpload(formNumber)}})}}else if(singleFileInfo.status===self._const.status.NotStarted){if(o.mode==="single"){$("#"+this._id("_strtuplbtn")).hide();$("#"+this._id("_bb")).igBrowseButton("option","disabled","false").show()}self._trigger(self.events.fileUploadAborted,null,{fileId:formNumber,filePath:self._getOnlyFileName(fileName),uploadedBytes:0,totalSize:totalSize,status:self._const.status.NotStarted});self._removeFileUpload(formNumber)}}},_onCancelUpload:function(formNumber){var self=this,o=self.options,continueButton=null,totalSize=0,bytesUploaded=0,allIds=null,singleFileInfo=this._getFileInfo(formNumber),fileName=singleFileInfo.path;if(o.autostartupload===false&&o.mode==="multiple"){continueButton=$("#"+self._id("_spbtncncl"));allIds=continueButton.data("ids");allIds=self._removeElementFromArray(allIds,formNumber);continueButton.data("ids",allIds)}self._trigger(self.events.fileUploadAborted,null,{fileId:formNumber,filePath:self._getOnlyFileName(fileName),uploadedBytes:bytesUploaded,totalSize:totalSize,status:self._const.status.Canceled});self._removeFileUpload(formNumber)},_removeFileUpload:function(formNumber){var self=this,o=self.options,cancelButtonId=self._id("_cbtn",formNumber),singleProgressBarId=self._id("_snglpbar",formNumber),singleProgressBar=$("#"+singleProgressBarId),totalSize=0,bytesUploaded=0,fileData=this.fileInfoData,singleFileInfo=this._getFileInfo(formNumber);if(singleFileInfo===null){self._setError(o.errorMessageTryToRemoveNonExistingFile.replace("{0}",formNumber),self._const.clientSideErrorCode.removeFileUpload,"clientside");return}totalSize=singleProgressBar.data("totalSize");bytesUploaded=singleProgressBar.data("bytesUploaded");if(totalSize===undefined){totalSize=0}if(bytesUploaded===undefined){bytesUploaded=0}fileData.countTotalFiles--;singleFileInfo.status=self._const.status.Canceled;fileData.fileSizeUploaded-=singleFileInfo.uploadedBytes;fileData.fileSizeTotal-=singleFileInfo.sizeBytes;self._spbRenderProgress();if(o.mode==="multiple"){self._removeUploadingID(formNumber);self._removePendingId(formNumber);self._removeIDBatch(formNumber);if(this.allCancelled===false){self._submitNextPendingId()}self._spbCheckModeButton()}$("#"+cancelButtonId).remove();self._removeIframe(formNumber);self._removeSingleUpload(formNumber);self._disableBrowseButton(!self._checkMaxUploadingFilesCount())},_getKey:function(formNumber){var a=this.fileInfoData.filesInfo[formNumber];if(a!==null&&a!==undefined){return a.key}return null},_singleFileUploadFinished:function(formNumber){var e=this.container(),self=this,arr;$("#"+self._id("_cbtn",formNumber)).igButton("option","disabled",true).igButton("option","icons",{primary:"ui-icon-check",secondary:null});self._removeIframe(formNumber);if(self.options.mode==="multiple"){self._enableClearAllButton();arr=e.data("finishedIDs");if(arr===undefined){arr=[]}arr.push(formNumber);e.data("finishedIDs",arr)}},_renderStatus:function(formNumber,bytesUploaded,fileSize,isFinished){var self=this,fileName,originalFileName,statusLabel=$("#"+self._id("_pbrflsz",formNumber)),singleProgressBarId=self._id("_snglpbar",formNumber),singleProgressBar=$("#"+singleProgressBarId),percentUploaded=0,fileNameRendered;if(isFinished){bytesUploaded=fileSize;self._singleFileUploadFinished(formNumber)}if(fileSize!==0&&isNaN(bytesUploaded)===false&&isNaN(fileSize)===false){percentUploaded=bytesUploaded/fileSize*100}singleProgressBar.data("totalSize",fileSize);singleProgressBar.data("bytesUploaded",bytesUploaded);fileNameRendered=singleProgressBar.data("isFileNameRendered");fileName=singleProgressBar.data("fileName");originalFileName=singleProgressBar.data("originalFileName");singleProgressBar.igProgressBar("option","value",percentUploaded);statusLabel.text(self._formatFileSize(bytesUploaded)+"/"+self._formatFileSize(fileSize));if(fileNameRendered!==true){singleProgressBar.data("isFileNameRendered",true);self._renderFileName(formNumber,fileSize)}if(isFinished){self._trigger(self.events.fileUploaded,null,{fileId:formNumber,filePath:originalFileName,totalSize:bytesUploaded});if(self._checkMaxUploadingFilesCount()===false){self._disableBrowseButton(true);return}}},_formatURL:function(url,args){if(url.indexOf("?")===-1){url+="?"}url+=args;return url},_showHideIcons:function(properties){var files=this.fileInfoData.filesInfo,i;for(i in files){if(files[i]!==undefined){$("#"+this._id("_icn",i)).css(properties)}}},_setWidthHeightAllUploads:function(value,isHeight){var files=this.fileInfoData.filesInfo,option=isHeight?"height":"width",i;for(i in files){if(files[i]!==undefined){$("#"+this._id("_snglpbar",i)).igProgressBar("option",option,value)}}},_setOption:function(key,value){var originalMode=this.options.mode,originalAutoStartUpload=this.options.autostartupload;$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"width":this.container().width(value);$("#"+this._id("_bmncntr")).width(value);this._reRenderFileSizeMetrics();this._reRenderFileNames();break;case"height":this.container().height(value);$("#"+this._id("_bmncntr")).height(value);break;case"labelUploadButton":$("#"+this._id("_ibb")).igBrowseButton("option","labelText",value);break;case"labelAddButton":$("#"+this._id("_bb")).igBrowseButton("option","labelText",value);break;case"labelClearAllButton":$("#"+this._id("_clrabtn")).igButton("option","labelText",value);break;case"labelSummaryTemplate":case"labelSummaryProgressBarTemplate":this._spbRenderProgress();break;case"labelShowDetails":case"labelHideDetails":this._setShowHideDetailsButtonText($("#"+this._id("_shdbtn")).is("hidden"));$("#"+this._id("_shdbtn")).text(value);break;case"labelSummaryProgressButtonCancel":if(this.spbButtonMode===this.summaryButtonModes.cancel){$("#"+this._id("_spbtncncl")).igButton("option","labelText",value)}break;case"labelSummaryProgressButtonContinue":if(this.spbButtonMode===this.summaryButtonModes.startupload){$("#"+this._id("_spbtncncl")).igButton("option","labelText",value)}break;case"labelSummaryProgressButtonDone":if(this.spbButtonMode===this.summaryButtonModes.done){$("#"+this._id("_spbtncncl")).igButton("option","labelText",value)}break;case"showFileExtensionIcon":this._showHideIcons({display:!value?"none":"block"});break;case"fileSizeMetric":this._reRenderFileSizeMetrics();break;case"fileSizeDecimalDisplay":this._reRenderFileSizeMetrics();break;case"maxUploadedFiles":this._disableBrowseButton(!this._checkMaxUploadingFilesCount());break;case"mode":if(originalMode!==value){this._destroyMarkup();this._create()}break;case"disabled":this._disableBrowseButton(value);break;case"autostartupload":if(value===true&&value!==originalAutoStartUpload){this._spbSubmitAllButton()}break}},_reRenderFileSizeMetrics:function(){var data=this.fileInfoData.filesInfo,l=data.length,i,bytesUploaded=0,self=this,fileSize,fileName,originalFileName,statusLabel,singleProgressBar,percentUploaded=0;for(i=0;i<l;i++){statusLabel=$("#"+self._id("_pbrflsz",i));if(statusLabel.length===0){continue}fileSize=data[i].sizeBytes;bytesUploaded=data[i].uploadedBytes;singleProgressBar=$("#"+self._id("_snglpbar",i));if(fileSize!==0&&isNaN(bytesUploaded)===false&&isNaN(fileSize)===false){percentUploaded=bytesUploaded/fileSize*100}fileName=singleProgressBar.data("fileName");originalFileName=singleProgressBar.data("originalFileName");statusLabel.text(self._formatFileSize(bytesUploaded)+"/"+self._formatFileSize(fileSize));singleProgressBar.data("isFileNameRendered",true);self._renderFileName(i,fileSize);$("#"+self._id("_summpbrlbl_1")).width($("#"+this._id("_summpbar")).width())}this._spbRenderProgress()},_destroyMarkup:function(){var startupButton=$("#"+this._id("_ibb")),browseButton=$("#"+this._id("_bb")),baseMainContainer=$("#"+this._id("_bmncntr"));this.originalElement.show().unwrap();startupButton.igBrowseButton("destroy");browseButton.igBrowseButton("destroy");startupButton.remove();baseMainContainer.remove();this.container().remove()},destroy:function(){this._destroyMarkup();$.Widget.prototype.destroy.apply(this,arguments)},_getFileSize:function(formNumber,key){var self=this,o=this.options,formId=this._id("_fszfrm",formNumber),filePicker=$("#"+self._id("_frm",formNumber)+"_if"),iframeId=this._id("_fszifrm",formNumber),form,url=self._formatURL(o.uploadUrl,$.param({key:key,command:"fileSize"}));$('<iframe src="javascript:false;" id="'+iframeId+'" name="'+iframeId+'"></iframe>').appendTo($(document.body)).css({display:"none"});$('<form method="post" id="'+formId+'" target="'+iframeId+'" enctype="multipart/form-data"></form>').appendTo($(document.body)).css({display:"none"}).attr("action",url);form=$("#"+formId);filePicker.appendTo(form);form.submit();form.remove();$("#"+iframeId).ready(function(){setTimeout(function(){self._sendRequestFileSize(formNumber,key)},self._const.timeoutGetFileSize)});filePicker.appendTo($("#"+self._id("_frm",formNumber)))},_removeGetFileSizeHTML:function(formNumber){var iframeGetFileSize=$("#"+this._id("_fszifrm",formNumber)),formGetFileSize=$("#"+this._id("_fszfrm",formNumber));iframeGetFileSize.remove();formGetFileSize.remove()},_sendRequestFileSize:function(formNumber,key){var self=this,o=this.options,singleFileData=this._getFileInfo(formNumber);if(singleFileData.sizeBytes!==0){return}$.ajaxQueue("uploadrequestsqueue",{url:self._formatURL(o.progressUrl,$.param({key:key,command:"fileSize"})),dataType:"json",cache:false,success:function(data){var fileSize=parseInt(data.fileSize,10);self._saveFileSize(fileSize,formNumber);self._removeGetFileSizeHTML(formNumber)},error:function(){self._setError(o.errorMessageAJAXRequestFileSize,self._const.clientSideErrorCode.ajaxErrorRequestFileSize,"clientside");self._removeGetFileSizeHTML(formNumber)}})},_saveFileSize:function(fileSize,formNumber){var self=this,singleProgressBarId=self._id("_snglpbar",formNumber),singleProgressBar=$("#"+singleProgressBarId),fileData=this.fileInfoData,singleFileData=this._getFileInfo(formNumber);if(isNaN(fileSize)===true){return}singleProgressBar.data("totalSize",fileSize);if(singleFileData!==null){singleFileData.sizeBytes=fileSize;fileData.fileSizeTotal+=fileSize;self._spbRenderProgress()}self._renderStatus(formNumber,0,fileSize,false,false)},_onShowHideDetailsClick:function(){var self=this,fileContainer=$("#"+self._id("_fc")),marginTop=fileContainer.css("margin-top"),marginBottom=fileContainer.css("margin-bottom");if($.ig.util.isIE7||$.ig.util.isIEQuircks){self._setShowHideDetailsButtonText(fileContainer.is(":hidden"));if(fileContainer.is(":hidden")){fileContainer.show();self._reRenderFileNames()}else{fileContainer.hide()}self._setShowHideDetailsButtonText(fileContainer.is(":hidden"))}else{fileContainer.css({"margin-top":0,"margin-bottom":0});fileContainer.slideToggle(self._const.showHideDetailsAnimationTimeout,function(){fileContainer.css({"margin-top":marginTop,"margin-bottom":marginBottom});self._setShowHideDetailsButtonText(fileContainer.is(":hidden"));if(fileContainer.is(":hidden")===false){self._reRenderFileNames()}})}},_reRenderFileNames:function(){var data=this.fileInfoData.filesInfo,l=data.length,i,originalFileName;for(i=0;i<l;i++){originalFileName=$("#"+this._id("_snglpbar",i)).data("originalFileName");$("#"+this._id("_pbrflnm",i)).text(originalFileName);this._renderFileName(i,0,originalFileName)}},_setShowHideDetailsButtonText:function(isHidden){var o=this.options,showHideDetailsButton=$("#"+this._id("_shdbtn"));if(isHidden){showHideDetailsButton.text(o.labelShowDetails);showHideDetailsButton.attr("title",$.ig.Upload.locale.titleShowDetailsButton)}else{showHideDetailsButton.text(o.labelHideDetails);showHideDetailsButton.attr("title",$.ig.Upload.locale.titleHideDetailsButton)}},getFileInfoData:function(){return this.fileInfoData},cancelAll:function(){var i,data=this.fileInfoData,uploadingIDs=data.uploadingIDs,luploadingIDs=uploadingIDs.length,pendingIDs=data.pendingQueueIDs,lpendingIDs=pendingIDs.length,batch=data.batch,lbatch=batch.length;this.allCancelled=true;for(i=0;i<luploadingIDs;i++){if(uploadingIDs[i]!==undefined){this.cancelUpload(uploadingIDs[i])}}for(i=0;i<lpendingIDs;i++){if(pendingIDs[i]!==undefined){this.cancelUpload(pendingIDs[i])}}for(i=0;i<lbatch;i++){if(batch[i]!==undefined){this.cancelUpload(batch[i])}}uploadingIDs=[];pendingIDs=[];batch=[];$("#"+this._id("_spbtncncl")).data("ids",[]);this.allCancelled=false},_submitAllFormsUpload:function(){var self=this,i,id,idsToSubmit=this.fileInfoData.batch,l=idsToSubmit.length,pendingIDs=[];for(i=0;i<l;i++){id=idsToSubmit[i];if(self._checkCanUpload()){self.startUpload(id)}else{self._addPendingId(id);pendingIDs.push(id)}}this.fileInfoData.batch=[]},_spbRenderInit:function(){var self=this,o=this.options,css=self.css,uploaderId=this._id("_fu"),labelSummaryButton=o.labelSummaryProgressButtonContinue,summaryProgressContainerId=this._id("_spbcntr"),summaryProgressBarLabelId=this._id("_summpbrlbl"),summaryProgressBarId=this._id("_summpbar"),summaryProgressLabelId=this._id("_summplbl"),showHideDetailsId=this._id("_shdbtn"),summaryProgressButtonCancelId=this._id("_spbtncncl"),summaryProgressDetailsButtonId=this._id("_spdtlbtn"),summaryProgressBar,html="",data,progressData="progressData",titleSummaryButton=$.ig.Upload.locale.titleSummaryProgressButtonContinue;html+='<div id="$summaryProgressContainerId$">';html+='   <div  class="'+css.summaryInformationContainerClass+'">';html+='       <span id="$summaryProgressLabelId$" class="'+css.summaryUploadedFilesLabelClass+'"></span><a href="javascript:void(0);" id="$showHideDetailsId$" class="'+css.summaryShowHideDetailsButtonClass+'">$labelShowHideDetails$</a>';html+="   </div>";html+='   <div class="'+css.clearClass+'">';html+='       <button id="$summaryProgressButtonCancelId$"></button>';html+='       <div id="$summaryProgressBarId$"></div>';html+="   </div>";html+="</div>";html=html.replace("$summaryProgressContainerId$",summaryProgressContainerId).replace("$summaryProgressLabelId$",summaryProgressLabelId).replace("$summaryProgressDetailsButtonId$",summaryProgressDetailsButtonId).replace("$summaryProgressBarId$",summaryProgressBarId).replace("$showHideDetailsId$",showHideDetailsId).replace("$labelShowHideDetails$",o.labelHideDetails).replace("$labelSummaryProgressButtonCancel$",o.labelSummaryProgressButtonCancel).replace("$summaryProgressButtonCancelId$",summaryProgressButtonCancelId);$(html).appendTo($("#"+uploaderId));data={IDs:{},CurrentUploadedFiles:0,CurrentUploadedSize:0,TotalFileSize:0,TotalFiles:0,UploadingFiles:0};$("#"+summaryProgressContainerId).data(progressData,data).addClass(css.summaryProgressContainerClass+" "+css.clearClass);summaryProgressBar=$("#"+summaryProgressBarId);$('<span id="'+summaryProgressBarLabelId+'"></span>').addClass(css.summaryProgressbarLabelClass).appendTo(summaryProgressBar.igProgressBar({animate:self._const.isProgressBarAnimationEnabled,animateTimeout:self._const.animateProgressBarInterval,range:self._const.isProgressBarRange,value:0,queue:false}).addClass(css.summaryProgressBarClass));$('<div id="'+summaryProgressBarLabelId+'_1"></div>').width(summaryProgressBar.width()).addClass(css.summaryProgressBarSecondaryLabel).appendTo($("#"+this._id("_summpbar_progress")).addClass(css.summaryProgressBarInnerProgress));$("#"+showHideDetailsId).bind({click:function(event){event.preventDefault();self._onShowHideDetailsClick()}});if($.ig.Upload.locale.titleHideDetailsButton!==false){$("#"+showHideDetailsId).attr("title",$.ig.Upload.locale.titleHideDetailsButton)}if(o.autostartupload){labelSummaryButton=o.labelSummaryProgressButtonCancel;titleSummaryButton=$.ig.Upload.locale.titleSummaryProgressButtonCancel;this.spbButtonMode=this.summaryButtonModes.cancel}$("#"+summaryProgressButtonCancelId).igButton({labelText:labelSummaryButton,title:titleSummaryButton,disabled:false,click:function(event){event.preventDefault();self._spbOnClickButton(event)}}).addClass(css.summaryButtonClass)},_spbRenderProgress:function(){var o=this.options,summaryProgressBar=$("#"+this._id("_summpbar")),summaryProgressLabel=$("#"+this._id("_summplbl")),summaryProgressBarLabel=$("#"+this._id("_summpbrlbl")),summaryProgressBarLabel_1=$("#"+this._id("_summpbrlbl_1")),textSummaryProgressBarLabel="",value=0,data=this.fileInfoData,fileSizeTotal=data.fileSizeTotal,fileSizeUploaded=data.fileSizeUploaded;if(fileSizeTotal!==0&&isNaN(fileSizeTotal)===false){value=fileSizeUploaded/fileSizeTotal*100}else if(fileSizeTotal===0){value=0}if(data.countUploadingFiles===data.countTotalFiles){if(data.countTotalFiles===0){value=0}else{value=100}data.fileSizeUploaded=fileSizeTotal;fileSizeUploaded=fileSizeTotal}summaryProgressBar.igProgressBar("option","value",value);textSummaryProgressBarLabel=o.labelSummaryProgressBarTemplate.replace("{0}",this._formatFileSize(fileSizeUploaded)).replace("{1}",this._formatFileSize(fileSizeTotal)).replace("{2}",value);summaryProgressLabel.html(o.labelSummaryTemplate.replace("{0}",data.countUploadingFiles).replace("{1}",data.countTotalFiles));summaryProgressBarLabel.text(textSummaryProgressBarLabel);summaryProgressBarLabel_1.text(textSummaryProgressBarLabel)},_spbOnClickButton:function(event){var modes=this.summaryButtonModes,m=this.spbButtonMode;event.preventDefault();if(m===modes.cancel){this._trigger(this.events.cancelAllClicked,event);this.cancelAll()}else if(m===modes.startupload){this._spbSubmitAllButton()}},_spbSubmitAllButton:function(){this._submitAllFormsUpload();this._spbCheckModeButton()},_spbCheckModeButton:function(){var fileData=this.fileInfoData;if(this.options.autostartupload){if(fileData.pendingQueueIDs.length>0||fileData.uploadingIDs.length>0){this._spbSetCancelButton()}else{this._spbSetButtonDone()}}else{if(fileData.pendingQueueIDs.length===0&&fileData.uploadingIDs.length===0){if(fileData.batch.length>0){this._spbSetContinueButton()}else{this._spbSetButtonDone()}}else{this._spbSetCancelButton()}}},_spbSetButtonDone:function(){var o=this.options,button=$("#"+this._id("_spbtncncl"));this.spbButtonMode=this.summaryButtonModes.done;button.igButton("option","labelText",o.labelSummaryProgressButtonDone).igButton("option","title",$.ig.Upload.locale.titleSummaryProgressButtonDone).igButton("option","disabled",true)},_spbSetContinueButton:function(){var o=this.options,button=$("#"+this._id("_spbtncncl"));this.spbButtonMode=this.summaryButtonModes.startupload;button.igButton({title:$.ig.Upload.locale.titleSummaryProgressButtonContinue,labelText:o.labelSummaryProgressButtonContinue,disabled:false})},_spbSetCancelButton:function(){var cancelButton=$("#"+this._id("_spbtncncl"));this.spbButtonMode=this.summaryButtonModes.cancel;cancelButton.igButton("option","labelText",this.options.labelSummaryProgressButtonCancel).igButton("option","title",$.ig.Upload.locale.titleSummaryProgressButtonCancel).igButton("option","disabled",false)},_getFileInfo:function(length){var fid=this.fileInfoData.filesInfo[length];if(fid===undefined||fid===null){return null}return fid},_formatFilePath:function(file){var ind=file.lastIndexOf("/");file=file.replace(/(\/|\\)$/,"");if(ind===-1){ind=file.lastIndexOf("\\")}return file.substring(ind+1)},_checkCanUpload:function(){var o=this.options,data=this.fileInfoData,canUpload=true,maxSimultaneousFilesUploads=o.maxSimultaneousFilesUploads;if(o.mode==="multiple"&&maxSimultaneousFilesUploads!==null&&data.uploadingIDs.length>=maxSimultaneousFilesUploads){canUpload=false;if(maxSimultaneousFilesUploads<=0){this._setError(o.errorMessageMaxSimultaneousFiles,this._const.clientSideErrorCode.checkCanUpload,"clientside")}}return canUpload},_addPendingId:function(id){this.fileInfoData.pendingQueueIDs.push(id)},_removePendingId:function(formNumber){var pendingIDs=this.fileInfoData.pendingQueueIDs,id;if(formNumber!==undefined&&formNumber!==null){id=formNumber;this.fileInfoData.pendingQueueIDs=this._removeElementFromArray(pendingIDs,id)}else{id=pendingIDs.shift();if(id===undefined){id=null}}return id},_addUploadingID:function(id){this.fileInfoData.uploadingIDs.push(id)},_removeUploadingID:function(id){this.fileInfoData.uploadingIDs=this._removeElementFromArray(this.fileInfoData.uploadingIDs,id)},_addIDBatch:function(id){this.fileInfoData.batch.push(id)},_removeIDBatch:function(id){this.fileInfoData.batch=this._removeElementFromArray(this.fileInfoData.batch,id)},_submitNextPendingId:function(){var self=this,nextFormToSubmitId;if(self._checkCanUpload()===true){nextFormToSubmitId=self._removePendingId();if(nextFormToSubmitId!==null){self.startUpload(nextFormToSubmitId)}}},_randomString:function(string_length){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",randomstring="",i,rnum;for(i=0;i<string_length;i++){rnum=Math.floor(Math.random()*chars.length);randomstring+=chars.substring(rnum,rnum+1)}return randomstring},_cutFilePath:function(fileName,length){var fileNameSize=fileName.length;if(fileNameSize<=length){return fileName}},_getOnlyFileName:function(fileName){var delimeter="";if(fileName===null||fileName===undefined){return""}if(fileName.indexOf("/")!==-1){delimeter="/"}else if(fileName.indexOf("\\")!==-1){delimeter="\\"}if(delimeter!==""){fileName=fileName.substr(fileName.lastIndexOf(delimeter)+1)}return fileName},_getFileExtension:function(fileName){return fileName.substring(fileName.lastIndexOf(".")+1)},_validateFileExtension:function(fileName,callEvent){var ext="",arrE=this.options.allowedExtensions,res,noCancel;if(arrE.length===0){return true}ext=fileName.substring(fileName.lastIndexOf(".")+1);ext=ext.toLowerCase();noCancel=this._trigger(this.events.fileExtensionsValidating,this,{fileName:fileName,fileExtension:ext});res=$.inArray(ext,arrE)>=0;if(callEvent===true&&res===false||!noCancel){res=false;this._setError(this.options.errorMessageValidatingFileExtension,this._const.clientSideErrorCode.extensionValidation,"clientside")}return res},_getFileExtensionIconPath:function(ext){var arrIE=this.options.fileExtensionIcons,i,icon="",l=arrIE.length;ext=String(ext).toLowerCase();for(i=0;i<l;i++){if(arrIE[i].ext!==undefined&&(arrIE[i].ext===ext||$.inArray(ext,arrIE[i].ext)!==-1)){icon=arrIE[i].css;break}else if(icon===""&&(arrIE[i].def===true||$.isArray(arrIE[i].ext)&&arrIE[i].ext.length===0)){icon=arrIE[i].css}}return icon},_setError:function(message,errorCode,errorType,serverMessage){var o=this.options,errC=this._const.errorCode;if(serverMessage===undefined){serverMessage=""}if(errorType==="serverside"){switch(errorCode){case errC.MimeTypeValidation:message=o.errorMessageValidatingFileExtension;break;case errC.FileSizeExceeded:message=o.errorMessageMaxFileSizeExceeded;break}}this._spbCheckModeButton();this._trigger(this.events.onError,null,{errorCode:errorCode,errorMessage:message,errorType:errorType,serverMessage:serverMessage})},_formatFileSize:function(val){var fsm=this.options.fileSizeMetric,res=val;switch(fsm){case"bytes":res=val+"B";break;case"kbytes":res=this._convertToKBytes(val);break;case"mbytes":res=this._convertToMBytes(val);break;case"gbytes":res=this._convertToGBytes(val);break;case"auto":if(val<1024){res=val+"B"}else if(val<1024*1024){res=this._convertToKBytes(val)}else if(val<1024*1024*1024){res=this._convertToMBytes(val)}else{res=this._convertToGBytes(val)}break;default:break}return res},_convertToKBytes:function(val){var res=val/1024;return res.toFixed(this.options.fileSizeDecimalDisplay)+"KB"},_convertToMBytes:function(val){var res=val/(1024*1024);return res.toFixed(this.options.fileSizeDecimalDisplay)+"MB"},_convertToGBytes:function(val){var res=val/(1024*1024*1024);return res.toFixed(this.options.fileSizeDecimalDisplay)+"GB"},_removeElementArrayById:function(array,keyValue){if(array===undefined||array===null){return[]}return $.grep(array,function(n){return n.id!==keyValue})},_removeElementFromArray:function(array,keyValue){if(array===undefined||array===null){return[]}return $.grep(array,function(n){return n!==keyValue})}});$.extend($.ui.igUpload,{version:"13.1.20131.2523"})})(jQuery);/*!@license
* Infragistics.Web.ClientUI Editors 13.1.20131.2523
*
* Copyright (c) 2011-2014 Infragistics Inc.
*
* http://www.infragistics.com/
* Depends on:
* jquery-1.4.4.js
* jquery.ui.core.js
* jquery.ui.widget.js

* Example to use:
*	<script type="text/javascript">
*	$(function () {
*		$('#text1').igValidator({ minLength: 3 });
*	});
*	</script>
*	<input id="text1" type="text" />
*/
(function($){var _id="=id",_cur=null,_submit={},_stop=function(e){try{e.preventDefault();e.stopPropagation()}catch(ignore){}},_fid=function(form,fid){var id=form.id;if(!id&&fid){form._fid=fid}return id||form._fid};$.widget("ui.igValidator",{options:{showIcon:null,animationShow:null,animationHide:null,enableTargetErrorCss:null,alignment:null,keepFocus:null,onchange:null,onblur:null,formSubmit:null,onsubmit:null,bodyAsParent:true,required:false,minLength:-1,maxLength:-1,min:null,max:null,regExp:null,checkboxesName:false,locale:null,errorLabel:null,element:null,theme:null,errorMessage:null},css:{label:"ui-igvalidator ui-widget ui-state-error ui-corner-all",icon:"ui-igvalidator-icon ui-icon ui-icon-alert",target:"ui-igvalidator-target"},locale:{defaultMessage:"Please fix this field",selectMessage:"Please select a value",rangeSelectMessage:"Please select no more than {0} and not less than {1} items",minSelectMessage:"Please select at least {0} items",maxSelectMessage:"Please select no more than {0} items",rangeLengthMessage:"Please enter a value between {0} and {1} characters long",minLengthMessage:"Please enter at least {0} characters",maxLengthMessage:"Please enter no more than {0} characters",requiredMessage:"This field is required",regExpMessage:"Please fix pattern of this field",maskMessage:"Please fill all required positions",dateFieldsMessage:"Please enter values in date fields",invalidDayMessage:"Invalid day of month. Please enter correct day",dateMessage:"Please enter a valid date",numberMessage:"Please enter a valid number",rangeMessage:"Please enter a value between {0} and {1}",minMessage:"Please enter a value greater than or equal to {0}",maxMessage:"Please enter a value less than or equal to {0}"},events:{checkValue:null,validation:null,errorShowing:null,errorHiding:null,errorShown:null,errorHidden:null},_create:function(){var v,t,elem,o=this.options,me=this,def=$.ui.igValidator.defaults;for(v in o){if(o.hasOwnProperty(v)&&o[v]===null&&def[v]!==undefined){o[v]=def[v]}}elem=me.element;me._state=3;me._focTime=0;me._init0();t=elem[0].nodeName;if(t==="SELECT"){t=5}else{t=elem[0].type;if(t==="checkbox"){t=o.checkboxesName?6:4}else if(t==="radio"){t=6}else{t=0}}me._elem=t!==6?elem:$("[name="+elem[0].name+"]").map(function(){return this.form===elem[0].form?this:null});me._t=t;if(!o.ctl&&!o.combo){me._evts={keydown:function(e){v=e.keyCode;if(v<15||v>20){me._evt(e,v===9?null:me,v===9)}},change:function(e){me._evt(e,me)},cut:function(e){me._evt(e,me)},paste:function(e){me._evt(e,me)},beforecut:function(e){me._evt(e,me)},drop:function(e){me._evt(e,me)},dragend:function(e){me._evt(e,me)},blur:function(e){me._evt(e,me,1)}};me._elem.bind(me._evts);if(o.element){me._evtsE={mousedown:function(e){me._evt(e,me)},mouseup:function(e){me._evt(e)}};o.element.bind(me._evtsE)}}},_evt:function(e,me,blur){var o=this.options;if(blur&&!o.onblur||!blur&&!o.onchange||$.ig&&$.ig.util&&$.ig.util.evtButton(e)){return}if(me){setTimeout(function(){me.validate(e)},20)}else{this.validate(e)}},_loc:function(key,m){key+=m?"":"Message";var o=this.options,v=o.errorMessage||o[key]||(o.locale?o.locale[key]:null);v=v||($.ig&&$.ig.Validator&&$.ig.Validator.locale?$.ig.Validator.locale[key]:null);return v||this.locale[key]},_foc1:function(o){o=o.keepFocus;return o&&this._t!==6&&!(o.indexOf&&o.indexOf("n")===0)?o==="once"||o===1?1:2:null},_onTab:function(e){if(e&&e.keyCode===9&&this._foc1(this.options)===2){_stop(e);return 1}},_init0:function(end){var form,fid,obj,id=this._id,o=this.options;if(end){this._doError()}else{if(o.ctl){o.ctl._validator=this}}form=this.element[0].form;if(!form){return}fid=_fid(form,"fid");if(!id){id=this.element[0].id;if(!id){_id+=_id.length;id=_id}this._id=id}obj=_submit[fid];if(!end&&(o.onsubmit||o.formSubmit)){if(!form._ig_onsubmit&&o.onsubmit){form._ig_onsubmit=1;$(form).submit(function(e){var f=_submit[_fid(this)];if(f){f.validate(e)}})}if(!form._ig_formsubmit&&o.formSubmit){form._ig_formsubmit=form.submit;form.submit=function(){var f=_submit[_fid(this)];if(f&&f.validate()){return}if(this._ig_formsubmit){this._ig_formsubmit()}}}if(!obj){obj=_submit[fid]={ctls:{},validate:function(e){var i,inv=false,lbl=1,ctls=this.ctls;for(i in ctls){if(ctls.hasOwnProperty(i)&&ctls[i].validate(e,lbl)){inv=true;if(!$.ui.igValidator.defaults.showAllErrorsOnSubmit){lbl=2}}}if(e&&inv){_stop(e)}return inv}}}obj.ctls[id]=this}else if(obj&&obj.ctls&&obj.ctls[id]){delete obj.ctls[id]}},getLocaleOption:function(name){return this._loc(name,1)},isMessageDisplayed:function(){return this._state>6},isValidState:function(){return!(this._state>=6||this.validate(null,null,1))},hide:function(keepCss){this._doError(null,null,keepCss?5:6)},validate:function(e,submit,check){var v,v2,val,txt=null,mes="Length",t=this._t,len=-1,o=this.options,el=this.element;if(!el||el.closest("body").length===0){return}if(t>3){mes="Select";len=val=t===5?el[0].multiple?$("option:selected",el[0]).length:el[0].selectedIndex:this._elem.filter(":checked").length}else{val=el.hasClass("ui-igcombo-nulltext")?"":el.val();len=val.length}if(o.ctl){delete o.ctl._invPlus}v2={owner:this,message:this._loc("default"),value:o.ctl?o.ctl.value():val};if(!this._trigger("checkValue",e,v2)){if(o.ctl&&!check){o.ctl._invPlus=v2.message}return check?2:this._doError(v2.message,e,submit)}if(len===0){if(check){if(o.required){return 2}}else if(!o.required){return this._doError(null,e,submit)}}v=o.regExp;if(v&&len>0){if(!v.test){v=new RegExp(v.toString())}txt=v.test(val)?null:this._loc("regExp");if(o.ctl){o.ctl._invPlus=txt}}if(!txt&&o.required&&(len===0||!val)){txt=this._loc(t>4?"select":"required")}if(!txt){v=o.minLength;v2=o.maxLength;if(len>=0&&(v>len||v2>0&&v2<len)){if(v>0&&v2>0){txt=this._loc("range"+mes).replace("{0}",v2).replace("{1}",v)}else{txt=this._loc((v>0?"min":"max")+mes).replace("{0}",v>0?v:v2)}if(o.ctl){o.ctl._invPlus=txt}}}if(txt){return check?txt:this._doError(txt,e,submit)}if(o.ctl){v=o.ctl._doInvalid(null,9);v=v?v.message:null;return check?v:this._doError(v,e,submit)}v=(typeof o.min==="number"?1:0)+(typeof o.max==="number"?2:0);if(!txt&&t<2&&len>0&&v>0){val=parseFloat(val);if(isNaN(val)){txt=this._loc("number")}else if(v===3&&(val<o.min||val>o.max)){txt=this._loc("range").replace("{0}",o.min).replace("{1}",o.max)}else if(v===1&&val<o.min){txt=this._loc("min").replace("{0}",o.min)}else if(v===2&&val>o.max){txt=this._loc("max").replace("{0}",o.max)}}return check?txt:this._doError(txt,e,submit)},_xyCheck:function(stop){var shift,xyE,xy=this._xy;if(!xy){return}if(this._elem&&this._elem[0].offsetWidth){xyE=xy.e.offset();shift=xyE.left-xy.x;if(shift!==xy.x0){xy.x0=shift;this._dd.css("left",xy.xDD+shift+"px")}shift=xyE.top-xy.y;if(shift!==xy.y0){xy.y0=shift;this._dd.css("top",xy.yDD+shift+"px")}}if(stop||!xyE){delete this._xy;clearInterval(xy.i)}if(!xyE){this._doError()}},_doError:function(txt,e,submit){var marg,elem0,end,xy0,xy,arg,elem,val,ctl,align,same,aLbl,x0,y0,el,zi=1,me=this,css=me.css,x="left",y="top",state=me._state,show=txt,dd=me._lbl,o=me.options;if(!submit){submit=0}ctl=o.ctl;align=o.alignment==="bottom"?0:o.alignment==="left"?-1:1;if(!txt&&dd){txt=dd[0]._txt}if(state<6&&!show){return}same=dd&&dd[0]._txt===txt&&!me._changed;this._changed=null;if(show&&me._onTab(e)&&same){return 2}if(show&&same){if(state>5){if(_cur===me){me._focus(o,submit,e)}return 2}}if(!submit&&show&&_cur&&(new Date).getTime()-_cur._focTime<100){return 2}arg={owner:me,message:txt,invalid:!!show};if(submit<5&&!me._trigger("validation",e,arg)){return}me._state=show?6:1;elem=o.element||me.element;elem0=ctl?ctl._element:elem;if(o.enableTargetErrorCss){if(show){elem0.addClass(css.target)}else if(submit!==5){elem0.removeClass(css.target)}}if(submit===2){return 2}if(!me._trigger(show?"errorShowing":"errorHiding",e,arg)){return 1}if(!show&&!dd){return}txt=arg.message;me._state++;marg=!o.bodyAsParent;if(marg){x="marginLeft";y="marginTop"}aLbl=o.errorLabel;if(typeof aLbl==="string"){aLbl=$("body").find('[data-valmsg-for="'+aLbl+'"]').removeClass("field-validation-valid").addClass("field-validation-error")}if(aLbl&&(!aLbl.length||!aLbl.find)){aLbl=null}if(aLbl){dd=aLbl}else if(!dd){dd=me.element[0].id;if(dd){dd=' for="'+dd+'"'}dd=$("<label"+dd+"/>").addClass(css.label).css({position:"absolute",visibility:"hidden"});dd[0].unselectable="on";dd.html(txt);dd[0]._id=98;me._dd=o.theme?$("<span/>").addClass(o.theme).css("position","absolute").append(dd):dd;if(marg){MSApp.execUnsafeLocalFunction(function(){me._dd.prependTo(elem0.parent())})}else{MSApp.execUnsafeLocalFunction(function(){me._dd.appendTo($("body"))})}}me._lbl=dd;if(show){dd[0]._txt=txt;if(aLbl){dd.html(txt).show()}else{me._dd.css(x,"0px").css(y,"0px");if(o.showIcon){if(txt===" "||txt==="&nbsp;"){txt=""}txt='<span class="'+css.icon+'"></span><span style="display:inline-block;width:18px;"></span>'+txt}dd.html(txt);dd.css("width","auto").css("height","auto");dd[0]._width0=dd[0].offsetWidth;dd[0]._height0=dd[0].offsetHeight;me._width=Math.max(dd.width(),5);me._height=Math.max(dd.height(),10);if(o.showIcon){me._height=Math.max(dd.children()[0].offsetHeight,me._height)}}try{elem0.parentsUntil(document.body).add(elem0).add(elem).add(dd).each(function(){val=this.style?this.style.zIndex:0;val=val?parseInt(val,10):null;if(val&&!isNaN(val)&&val>zi){zi=val}})}catch(ignore){}dd.css("zIndex",zi);me._focTime=0;_cur=me}end=function(){if(show){dd.css("filter","")}else{if(aLbl){aLbl.html(" ").hide()}else{me._dd.remove()}me._dd=me._lbl=_cur=null}me._state++};if(show){me._focus(o,submit,e);val=o.animationShow;if(val<5){val=null}if(aLbl){dd.css("opacity",0).show()}else{dd.css({opacity:val?0:1,height:(val?0:me._height)+"px",width:Math.floor(me._width/(val&&align>=0?2:1))+"px",display:"",visibility:"visible"});el=ctl&&ctl._swap?me.element:elem;xy=el.offset();if(!marg){x0=xy.left;y0=xy.top}xy.top+=align?0:el.outerHeight();if(ctl&&ctl._swap){xy.left-=ctl._leftShift()}if(align){xy.left+=align<0?-dd[0].offsetWidth:elem0[0].offsetWidth}if(marg){xy0=dd.offset();xy.left-=xy0.left;xy.top-=xy0.top}else{me._xy={x0:0,y0:0,x:x0,y:y0,e:el,xDD:xy.left,yDD:xy.top,i:setInterval(function(){me._xyCheck()},300)}}me._dd.css(x,xy.left+"px").css(y,xy.top+"px")}if(val){dd.animate(aLbl?{opacity:1}:{opacity:1,height:me._height,width:me._width},val,null,end)}else{end()}me._trigger("errorShown",e,arg);return 2}me._xyCheck(true);val=o.animationHide;if(val<5){val=null}if(val){if(aLbl){dd.animate({opacity:0},val,null,end)}else{dd.animate({opacity:.6},Math.floor(val*.34)).animate({opacity:0,height:0,width:Math.floor(me._width/(align<0?1:2))},Math.floor(val*.66),null,end)}}else{end()}me._trigger("errorHidden",e,arg)},_focus:function(o,submit,e){var el=!submit&&this._foc1(o)?this.element:null;e=e&&e.keyCode!==9?e.type:"";if(el&&!(o.ctl&&o.ctl._fcs)&&(this._foc1(o)!==1||!this._focTime)&&e.indexOf("key")<0&&e.indexOf("mouse")<0){$.ui.igValidator._keepFoc=o.ctl;e=$.ui.igValidator._dd;if(e){e._doDrop()}this._focTime=(new Date).getTime();setTimeout(function(){try{el.focus()}catch(ignore){}},0)}},_setOption:function(key,val){if(this.options[key]===val){return this}$.Widget.prototype._setOption.apply(this,arguments);if(typeof val!=="function"&&key!=="locale"){this._init0()}return this},destroy:function(){if(!this._elem){return this}var o=this.options;if(!o.ctl){this._elem.unbind(this._evts);if(this._evtsE){o.element.unbind(this._evtsE)}}this._init0(1);o.element=o.ctl=this._evts=this._evtsE=this._elem=null;$.Widget.prototype.destroy.apply(this,arguments);return this}});$.ui.igValidator._act=function(editor,act){var d,f,v=$.ui.igValidator;if(!v){return}d=v._dd;if(d&&(!d._ddOn||!(d._field||d.mainElem))){d=null;delete v._dd}f=v._keepFoc;if(f&&!f._field){f=null;delete v._keepFoc}if(act==="drop"){if(f&&f!==editor&&!f.validate()){return true}v._dd=editor;return}if(act==="hide"){if(d===editor){delete v._dd}return}if(!act&&f===editor){delete v._keepFoc}return f&&f!==editor};$.extend($.ui.igValidator,{version:"13.1.20131.2523"});$.ui.igValidator.defaults={showAllErrorsOnSubmit:false,showIcon:true,animationShow:300,animationHide:300,enableTargetErrorCss:true,alignment:"bottom",keepFocus:null,onchange:true,onblur:true,formSubmit:false,onsubmit:true}})(jQuery);/*!@license
 * Infragistics.Web.ClientUI jQuery HTML5 Video Player 13.1.20131.2523
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery-1.4.2.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	modernizr.js
 *  infragistics.util.js
 *  infragistics.ui.shared.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igVideoPlayer",{_const:{VOLUME_MAX:1,VOLUME_MIN:0,VIDEO_STATE_TIMEOUT:200,SCROLL_TIMEOUT:100,COMMERCIAL_SEEK_DELTA:2,SLIDE_SEEK_TIMEOUT:500,HREF:"#"},_id:function(id){return this.element[0].id+id},options:{sources:[],width:null,height:null,posterUrl:"",preload:false,autoplay:false,autohide:true,volumeAutohideDelay:1e3,centerButtonHideDelay:1200,loop:false,browserControls:false,fullscreen:false,volume:.5,muted:false,title:"",showSeekTime:true,progressLabelFormat:"${currentTime} / ${duration}",bookmarks:[{time:0,title:"",disabled:false}],relatedVideos:[{imageUrl:"",title:"",width:null,height:null,link:"",sources:[],css:null}],banners:[{imageUrl:"",times:[],closeBanner:true,animate:true,visible:true,duration:1e3,autohide:false,hidedelay:1e4,link:null,width:null,height:null,css:null}],commercials:{linkedCommercials:[{sources:[],startTime:10,link:"",title:""}],embeddedCommercials:[{startTime:20,endTime:30,link:"",title:""}],alwaysPlayCommercials:false,showBookmarks:true,adMessage:{animate:true,autoHide:true,hideDelay:2e4,animationDuration:1e3}}},events:{ended:"ended",playing:"playing",paused:"paused",buffering:"buffering",progress:"progress",waiting:"waiting",bookmarkHit:"bookmarkHit",bookmarkClick:"bookmarkClick",enterFullScreen:"enterFullScreen",exitFullScreen:"exitFullScreen",relatedVideoClick:"relatedVideoClick",bannerVisible:"bannerVisible",bannerHidden:"bannerHidden",bannerClick:"bannerClick",browserNotSupported:"browserNotSupported"},css:{baseClasses:"ui-widget ui-igplayer",controlsClass:"ui-widget-header ui-igplayer-controls ui-igplayer-grid ui-igplayer-autohide ui-corner-all",controlsHideClass:"ui-igplayer-controls-hide",videoClass:"ui-igplayer-video",unsupportedBrowserClass:"ui-html5-non-html5-supported-message ui-helper-clearfix",activeVideoClass:"ui-igplayer-active-video",playButtonClass:"ui-igplayer-playbutton",progressBarClass:"ui-igplayer-progressbar ui-corner-all",fullScreenClass:"ui-igplayer-fullscreen-button",fullScreenIconClass:"ui-icon ui-igbutton-icon ui-icon-arrow-4-diag",volumeControlClass:"ui-igplayer-volumecontrol",volumeSliderClass:"ui-igplayer-volumeslider",progressLabelClass:"ui-igplayer-progresslabel",bookmarkContainerClass:"ui-widget ui-igplayer-bookmark-container",bookmarkContainerHeaderClass:"ui-widget-header ui-igplayer-bookmark-header",bookmarkListClass:"ui-widget-content ui-igplayer-bookmark-list",bookmarkItemDisabledClass:"ui-igplayer-bookmark-item-disabled",bookmarkItemTimeClass:"ui-igplayer-bookmark-item-time",bookmarkItemTitleClass:"ui-igplayer-bookmark-item-title",bookmarkActiveItemClass:"ui-igplayer-bookmark-active-item",relatedVideosContainerClass:"ui-igplayer-related-video-container",relatedVideosOuterContainerClass:"ui-igplayer-related-video-outer-container",relatedVideoClass:"ui-igplayer-related-video",relatedVideoFirstClass:"ui-igplayer-related-video-first",relatedVideoLastClass:"ui-igplayer-related-video-last",relatedVideoHoverClass:"ui-igplayer-related-video-hover",relatedVideoScrollLeftClass:"ui-igplayer-related-scroller-left",relatedVideoScrollLeftIconClass:"ui-icon-triangle-1-w",relatedVideoScrollRightClass:"ui-igplayer-related-scroller-right",relatedVideoScrollRightIconClass:"ui-icon-triangle-1-e",relatedVideoScrollListClass:"ui-igplayer-related-list",relatedVideosHeaderClass:"ui-igplayer-related-video-header",relatedVideoBarClass:"ui-igplayer-related-video-bar",relatedVideoReplayClass:"ui-igplayer-related-video-replay",relatedVideoReplayIconClass:"ui-icon-arrowrefresh-1-s",bannerContainerClass:"ui-igplayer-banner-container",bannerClass:"ui-igplayer-banner ui-corner-all",bannerCloseClass:"ui-igplayer-banner-close",bannerCloseIconClass:"ui-icon-close",adMsgContainerClass:"ui-igplayer-ad-msg-container",adMsgClass:"ui-igplayer-ad-msg",adMsgCloseClass:"ui-igplayer-ad-msg-close",adMsgCloseIconClass:"ui-icon-close",linkedBookmarkClass:"ui-igplayer-linked-bookmark",adBookmarkClass:"ui-igplayer-ad-bookmark",unsupportedVideoSourceClass:"ui-igplayer-not-supported-video-source",unsupportedVideoSourceIconClass:"ui-igplayer-not-supported-video-source-icon",centerPlayButtonClass:"ui-igplayer-centerplaybutton-play",centerPauseButtonClass:"ui-igplayer-centerplaybutton-pause",centerPlayButtonIconClass:"ui-igplayer-centerplaybutton-icon",waitingIndicatorClass:"ui-igplayer-waiting",waitingIndicatorIconClass:"ui-igplayer-waiting-icon",seekTooltipClass:"ui-igplayer-seektooltip"},widget:function(){return this.element},_createWidget:function(){var o=this.options;o.bookmarks=[];o.relatedVideos=[];o.banners=[];o.commercials.linkedCommercials=[];o.commercials.embeddedCommercials=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this.supportsVideo=this.supports_video();if(typeof Modernizr==="object"&&Modernizr.touch){this.options.browserControls=true}if(this.element.is("div")){this.container=this.element}else if(this.element.is("video")){this.container=$("<div></div>").attr("id",this._id("_container")).insertBefore(this.element);this.element.appendTo(this.container)}else{throw new Error($.ig.VideoPlayer.locale.nonDivException)}this._oldWidth=this.element.css("width");this._oldHeight=this.element.css("height");this._renderControl()},_renderControl:function(){var o=this.options,video,css=this.css;this._prevReadyState=0;this._bookmarksRendered=false;if(this.supportsVideo){this._renderBanners()}this.currentVideo=video=this._createMainVideoElement().addClass(css.videoClass);if(o.disabled){this.container.addClass("ui-state-disabled")}if(o.width){video.css("width",o.width);this.container.css("width",o.width)}if(o.height){video.css("height",o.height);this.container.css("height",o.height)}if(this.supportsVideo){this._baseZIndex=parseInt(this.container.css("z-index"),10)||0;this._attachEvents(video);this._renderSources(o.sources,video);this._analyzeSource(video);setTimeout($.proxy(this._onVideoStateChange,this),this._const.VIDEO_STATE_TIMEOUT);this._createBigPlayButton();this._createWaitingIndicator();this._renderEmbeddedCommercials();this._renderCommercials();video[0].muted=o.muted;if(o.muted&&$.ig.util.isWebKit){video[0].volume=0}else if(o.volume>=this._const.VOLUME_MIN&&o.volume<=this._const.VOLUME_MAX){video[0].volume=o.volume}if(!o.browserControls){this._renderControls()}this._lastPausedState=video[0].paused;if(o.fullscreen){this._setOption("fullscreen",true,true)}this._renderRelatedVideos()}else{this.currentVideo.hide();$.ig.util._renderUnsupportedBrowser(this,$.ig.VideoPlayer.locale)}$("#"+this._id("_detectError")).appendTo(this.container).bind({click:function(event){event.preventDefault()}});this.container.addClass(css.baseClasses)},_createVideoElement:function(id){var video=$("<video></video>").attr("id",id);return video},_saveExistingVideoProperties:function(video){this._oldAutoPlay=video.attr("autoplay");this._oldPreload=video.attr("preload");this._oldLoop=video.attr("loop");this._oldPoster=video.attr("poster");this._oldControls=video.attr("controls");this._oldSrc=video.attr("src");this._oldMuted=video[0].muted;this._oldVolume=video[0].volume;video.removeAttr("autoplay");video.removeAttr("preload");video.removeAttr("loop");video.removeAttr("poster");video.removeAttr("controls");video.removeAttr("src")},_restoreExistingVideoProperties:function(video){video.attr("autoplay",this._oldAutoPlay);video.attr("preload",this._oldPreload);video.attr("loop",this._oldLoop);video.attr("poster",this._oldPoster);video.attr("controls",this._oldControls);video.attr("src",this._oldSrc);video[0].muted=this._oldMuted;video[0].volume=this._oldVolume},_createMainVideoElement:function(){var o=this.options,isVideoExisting=this.element.is("video"),video=isVideoExisting?this.element:this._createVideoElement(this._id("_video"));if(isVideoExisting){this._saveExistingVideoProperties(video)}if(o.autoplay){video.attr("autoplay",true)}video.attr("preload","metadata");if(o.preload){video.attr("preload","auto")}if(o.browserControls){video.attr("controls",true)}if(o.loop){video.attr("loop",true)}if(o.posterUrl.length>0){video.attr("poster",o.posterUrl)}return video.appendTo(this.container)},_renderUnsupportedBrowser:function(){if(this._trigger(this.events.browserNotSupported)){var container=$("<div></div>").addClass(this.css.unsupportedBrowserClass).appendTo(this.container),ul,browserUnsupported;if($.ig.util.isIE){browserUnsupported="Internet Explorer "+$.ig.util.browserVersion}else if($.ig.util.isOpera){browserUnsupported="Opera "+$.ig.util.browserVersion}else if($.ig.util.isWebKit){browserUnsupported="Webkit "+$.ig.util.browserVersion}else if($.ig.util.isFF){browserUnsupported="Mozilla Firefox "+$.ig.util.browserVersion}else{browserUnsupported=$.ig.util.browserVersion}$("<div></div>").addClass("ui-igvideoplayer-current-browser-label").html($.ig.VideoPlayer.locale.currentBrowser.replace("{0}",browserUnsupported)).appendTo(container);$("<div></div>").addClass("ui-igvideoplayer-non-html5-text").html($.ig.VideoPlayer.locale.unsupportedBrowser).appendTo(container);ul=$("<ul></ul>").addClass("ui-igplayer-browsers-list").appendTo(container);$("<a></a>").attr("href",$.ig.VideoPlayer.locale.chromeDownload).attr("target","_blank").addClass("ui-igplayer-chrome-icon").html($.ig.VideoPlayer.locale.chrome8).appendTo($("<li></li>").addClass("ui-corner-all").appendTo(ul));$("<a></a>").attr("href",$.ig.VideoPlayer.locale.firefoxDownload).attr("target","_blank").addClass("ui-igplayer-firefox-icon").html($.ig.VideoPlayer.locale.firefox36).appendTo($("<li></li>").addClass("ui-corner-all").appendTo(ul));$("<a></a>").attr("href",$.ig.VideoPlayer.locale.operaDownload).attr("target","_blank").addClass("ui-igplayer-Opera-icon").html($.ig.VideoPlayer.locale.opera11).appendTo($("<li></li>").addClass("ui-corner-all").appendTo(ul));$("<a></a>").attr("href",$.ig.VideoPlayer.locale.safariDownload).attr("target","_blank").addClass("ui-igplayer-safari-icon").html($.ig.VideoPlayer.locale.safari5).appendTo($("<li></li>").addClass("ui-corner-all").appendTo(ul));$("<a></a>").attr("href",$.ig.VideoPlayer.locale.ieDownload).attr("target","_blank").addClass("ui-igplayer-ie-icon").html($.ig.VideoPlayer.locale.ie9).appendTo($("<li></li>").addClass("ui-corner-all").appendTo(ul));this.container.addClass("ui-igvideoplayer-non-html5")}},_renderRelatedVideoBar:function(container){var css=this.css,control=this,relatedVideoBar=$("<div></div>").attr("id",this._id("_rv_bar")).addClass(css.relatedVideoBarClass).appendTo(container);$("<a></a>").attr("id",this._id("_rv_bar_fs")).appendTo($("<div></div>").css({position:"absolute",top:0,left:0,"text-align":"right",width:"100%",height:"100%"}).appendTo(relatedVideoBar)).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:css.fullScreenIconClass}}).attr("title",$.ig.VideoPlayer.locale.enterFullscreen).addClass(css.fullScreenClass).bind({click:function(event){event.preventDefault();control._setOption("fullscreen",!control.options.fullscreen)}});$("<a></a>").attr("id",this._id("_rv_bar_replay")).appendTo(relatedVideoBar).igButton({onlyIcons:false,labelText:$.ig.VideoPlayer.locale.replayButton,icons:{primary:css.relatedVideoReplayIconClass},link:{href:this._const.HREF}}).attr("title",$.ig.VideoPlayer.locale.replayTooltip).bind({click:function(event){event.preventDefault();if(!$(this).igButton("option","disabled")){control.togglePlay()}}}).addClass(css.relatedVideoReplayClass)},_renderScrollButtons:function(container){var css=this.css,ul;$("<a></a>").attr("id",this._id("_rv_left")).appendTo(container).igButton({onlyIcons:true,icons:{primary:css.relatedVideoScrollLeftIconClass},link:{href:this._const.HREF}}).addClass(css.relatedVideoScrollLeftClass).css("position","absolute").hide();ul=$("<ul></ul>").addClass(css.relatedVideoScrollListClass).appendTo(container);$("<a></a>").attr("id",this._id("_rv_right")).appendTo(container).igButton({onlyIcons:true,icons:{primary:css.relatedVideoScrollRightIconClass},link:{href:this._const.HREF}}).addClass(css.relatedVideoScrollRightClass).css("position","absolute");return ul},_renderRelatedVideos:function(){var o=this.options,related=o.relatedVideos||[],len=related.length,i=0,css=this.css,container,scrollContainer,ulContainer,ulContainerWidth=10,currentVideo,control=this;if(len>0){container=$("<div></div>").attr("id",this._id("_rvcc")).addClass(css.relatedVideosOuterContainerClass).appendTo(this.container).hide();$("<div><div>").html($.ig.VideoPlayer.locale.relatedVideos).addClass(css.relatedVideosHeaderClass).appendTo(container);scrollContainer=$("<div></div>").attr("id",this._id("_rvc")).appendTo(container).addClass(css.relatedVideosContainerClass);ulContainer=this._renderScrollButtons(scrollContainer);this._renderRelatedVideoBar(container);this._rvUlWidth=0;this._rvImagesToLoad=0;this._rvImagesLoaded=0;for(i;i<len;i++){if(related[i].imageUrl&&related[i].imageUrl!==""){currentVideo=this._renderRelatedVideo(related[i],ulContainer,i===0,i===len-1);this._rvImagesToLoad++;ulContainerWidth+=currentVideo.outerWidth(true)}}if(ulContainerWidth>container.width()&&ulContainerWidth>ulContainer.width()){ulContainer.width(ulContainerWidth)}this.relatedScrollers=$("a",scrollContainer).bind({mouseover:function(){if(!control._isScrolling){control._isScrolling=true;control._leftDirection=$(this).hasClass(control.css.relatedVideoScrollLeftClass);control._rvDoScroll()}},mouseout:function(){control._rvStopScroll()}});this.relatedVideoElements=$("."+this.css.relatedVideoClass.split(" ")[0],ulContainer).each(function(i){$(this).data("related-index",i)}).bind({mouseover:function(){$(this).addClass(control.css.relatedVideoHoverClass).children().filter("div").show()},mouseout:function(){$(this).removeClass(control.css.relatedVideoHoverClass).children().filter("div").hide()},click:function(event){var relatedVideo=control.options.relatedVideos[$(this).data("related-index")];if(control._relatedVideoClick(relatedVideo,$(this),event)){if(relatedVideo.link&&relatedVideo.link.length>0){window.open(relatedVideo.link,"_blank")}else if(relatedVideo.sources){control._renderSources(relatedVideo.sources,control.currentVideo);control._analyzeSource(control.currentVideo,true);control.play()}}}})}},_rvScrollOnce:function(){var container=$("#"+this._id("_rvc")),ul=$("ul",container),currentLeftStr=ul[0].style.left,currentLeft=parseInt(currentLeftStr===""||currentLeftStr==="auto"?"0px":currentLeftStr,10),pixelsToScroll=10,newLeft=this._leftDirection?currentLeft+pixelsToScroll:currentLeft-pixelsToScroll,left=$("#"+this._id("_rv_left")),right=$("#"+this._id("_rv_right")),ulWidth=ul.width(),scrollContainerWidth=container.width(),continueScrolling=true;ul[0].style.left=newLeft+"px";if(currentLeft===0&&newLeft<0){left.show()}if(newLeft>=0&&currentLeft!==0&&left[0].style.display!=="none"){left.hide();continueScrolling=false}if(scrollContainerWidth-newLeft>=ulWidth&&right[0].style.display!=="none"){continueScrolling=false;right.hide()}else if(right[0].style.display==="none"){right.show()}return continueScrolling},_rvDoScroll:function(){var continueScrolling=this._isScrolling&&this._rvScrollOnce();if(continueScrolling){this._scrollingTimoutId=setTimeout($.proxy(this._rvDoScroll,this),this._const.SCROLL_TIMEOUT)}else{this._rvStopScroll()}},_rvStopScroll:function(){if(this._isScrolling){clearTimeout(this._scrollingTimoutId);this._isScrolling=false}},_relatedVideoClick:function(relatedVideo,relatedElement,event){var args={relatedVideo:relatedVideo,relatedVideoElement:relatedElement};return this._trigger(this.events.relatedVideoClick,event,args)},_renderRelatedVideo:function(related,container,isFirst,isLast){var rv=$("<li></li>").appendTo(container).addClass(this.css.relatedVideoClass),relatedImg=$("<img/>").appendTo(rv),self=this;if(isFirst||isLast){rv.addClass(isFirst?this.css.relatedVideoFirstClass:this.css.relatedVideoLastClass)}if(related.imageUrl&&related.imageUrl!==""){relatedImg.attr("src",related.imageUrl)}if(related.title&&related.title!==""){relatedImg.attr("title",related.title)}if(related.css&&related.css!==""){relatedImg.addClass(related.css)}if(related.width&&related.width!==""){relatedImg.css("width",related.width)}if(related.height&&related.height!==""){relatedImg.css("height",related.height)}$("<div></div>").appendTo(relatedImg.parent()).css("position","absolute").hide();relatedImg.bind({load:function(){self._imageLoaded(this)},error:function(){self._rvImagesLoaded++;self._onImagesLoaded()},readystatechange:function(){self._imageLoaded(this)}});return rv},_imageLoaded:function(img){var rs=img.readyState,width=parseInt(img.style.width,10),height=parseInt(img.style.height,10),spanSize;if(!rs||new RegExp("loaded|complete").test(rs)){this._rvUlWidth+=width+parseInt($(img).parent().css("marginRight"),10)+parseInt($(img).parent().css("marginLeft"),10);this._rvImagesLoaded++;if(width>24&&height>24){if(width>50&&height>50){spanSize=48}else if(width>34&&height>34){spanSize=32}else{spanSize=24}$(img).parent().children().filter("div").addClass("ui-igplayer-related-video-hover-x"+spanSize).css({width:spanSize,height:spanSize,top:height/2-spanSize/2,left:width/2-spanSize/2})}}this._onImagesLoaded()},_onImagesLoaded:function(){if(this._rvImagesLoaded===this._rvImagesToLoad){var container=$("#"+this._id("_rvc"));$("ul",container).css("width",this._rvUlWidth+4);container.parent().show();if(this._rvUlWidth<container.width()){this.relatedScrollers.hide()}else{$(this.relatedScrollers[1]).show()}container.parent().hide();delete this._rvUlWidth;delete this._rvImagesLoaded;delete this._rvImagesToLoad}},_renderEmbeddedCommercials:function(){var ec=this.options.commercials.embeddedCommercials||[],i=0,len=ec.length,filtered=[],val;for(i;i<len;i++){val=ec[i];if(val&&val.startTime&&val.endTime&&val.startTime<val.endTime){filtered.push(val)}}ec=filtered;len=ec.length;if(ec&&len>0){this._embeddedCommercialsShow=$.extend(true,[],ec);this._embeddedCommercialIndex=0;this._renderAdMessage()}},_renderCommercials:function(){var o=this.options,com=o.commercials.linkedCommercials||[],control=this;if(com.length>0){this._createVideoElement(this._id("_com_video")).attr("preload","auto").appendTo(this.container).addClass(this.css.videoClass).bind({ended:function(){var slider=$("#"+control._id("_ctrls_s")),bookmarks=slider.data("igSlider").bookmarks;control._hideWaitingIndicator();control._commercialIndex++;control._commercialsShow.shift();control._commercialPlaying=false;control.currentVideo=control._getMainVideo();control.currentVideo.show();$(this).hide();slider.igSlider("option","disabled",false);if(bookmarks){bookmarks.show()}control.currentVideo[0].muted=this.muted;control.currentVideo[0].play();control.currentVideo.addClass(control.css.videoClass);control.controls[control._activeControlsIndex].css("z-index","");$("#"+control._id("_seek_tooltip")).css("z-index","");$("#"+control._id("_play")).css("z-index","")},waiting:function(event){control._onVideoWaiting(event);control._waiting(this.currentSrc,this.currentTime,this.duration,event)},timeupdate:function(event){control._changeCurrentTime(event)},playing:function(event){control._hideWaitingIndicator();$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-pause").removeClass("ui-icon-play");control._playing(this.currentSrc,this.duration,event)},pause:function(event){$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-play").removeClass("ui-icon-pause");control._paused(this.currentSrc,this.duration,event)},click:function(event){event.preventDefault();var link=control.options.commercials.linkedCommercials[control._commercialIndex].link;if(link&&link.length>0){window.open(link,"_blank")}}}).hide();this._buildCommercialsShow();this._renderAdMessage()}},_renderAdClose:function(container){var control=this;$("<a></a>").attr("id",this._id("_ad_msg_close")).appendTo(container).igButton({onlyIcons:true,icons:{primary:this.css.adMsgCloseIconClass},link:{href:this._const.HREF}}).addClass(this.css.adMsgCloseClass).bind("click",function(event){event.preventDefault();event.stopPropagation();control.hideAdMessage()})},_renderAdMessage:function(){if($("#"+this._id("_ad_msg_c")).length===0){var css=this.css,container;container=$("<div></div>").attr("id",this._id("_ad_msg_c")).addClass(css.adMsgContainerClass).prependTo(this.container).bind({mouseover:function(){$(this).addClass("ui-state-hover")},mouseout:function(){$(this).removeClass("ui-state-hover")}}).hide();$("<span></span>").attr("id",this._id("_ad_msg")).appendTo(container).addClass(css.adMsgClass).html($.ig.VideoPlayer.locale.adMessage);this._renderAdClose(container)}},_showAdMessage:function(seconds){var adMsgContainer=$("#"+this._id("_ad_msg_c")),msgOpt=this.options.commercials.adMessage;this._updateAdMessage(seconds,true);adMsgContainer.css("width",this.container.css("width"));if(msgOpt.animate){adMsgContainer.slideToggle(msgOpt.animationDuration)}else{adMsgContainer.show()}if(msgOpt.autoHide){this._adHideTimeout=setTimeout($.proxy(this.hideAdMessage,this),msgOpt.hideDelay)}},_updateAdMessage:function(seconds,force){var msg=$("#"+this._id("_ad_msg"));if(msg.is(":visible")||force){if(isNaN(seconds)){msg.html($.ig.VideoPlayer.locale.adMessageNoDuration)}else{seconds=parseInt(seconds,10);if(seconds>60){msg.html($.ig.VideoPlayer.locale.adMessageLong.replace("$duration$",this._toTimeString(seconds)))}else{msg.html($.ig.VideoPlayer.locale.adMessage.replace("$duration$",seconds))}}this._isHiddenAdMessage=false}else if(!this._isHiddenAdMessage){this._showAdMessage(seconds)}},hideAdMessage:function(){clearTimeout(this._adHideTimeout);var msg=$("#"+this._id("_ad_msg_c")),msgOpt=this.options.commercials.adMessage;if(msg.is(":visible")){if(msgOpt.animate){msg.slideToggle(msgOpt.animationDuration)}else{msg.hide()}this._isHiddenAdMessage=true}},_buildCommercialsShow:function(){var com=this.options.commercials.linkedCommercials||[],len=com.length,i=0;this._commercialsShow=[];this._commercialIndex=0;for(i;i<len;i++){this._commercialsShow.push(com[i].startTime)}this._commercialsShow=$.extend(true,[],this._commercialsShow)},playCommercial:function(commercial){if(!commercial||!commercial.sources){return}var comVideo=$("#"+this._id("_com_video")),videoOffset=this.currentVideo.offset(),slider=$("#"+this._id("_ctrls_s")),bookmarks=slider.data("igSlider").bookmarks,bookmarkTitle=$("#"+this._id("_ctrls_s_tooltip"));this._commercialPlaying=true;$("source",comVideo).remove();this._renderSources(commercial.sources,comVideo);this._analyzeSource(comVideo);this.currentVideo[0].pause();this.currentVideo.removeClass(this.css.videoClass);this.controls[this._activeControlsIndex].css("z-index",this._baseZIndex+5e3);$("#"+this._id("_seek_tooltip")).css("z-index",this._baseZIndex+5e3);$("#"+this._id("_play")).css("z-index",this._baseZIndex+5e3);slider.igSlider("option","disabled",true);if(bookmarks&&bookmarkTitle){bookmarks.hide();bookmarkTitle.hide()}comVideo[0].muted=this.currentVideo[0].muted;comVideo[0].play();if(commercial.link&&commercial.link.length>0){comVideo.attr("title",$.ig.VideoPlayer.locale.adNewWindowTip)}else{comVideo.removeAttr("title")}comVideo.css("top",videoOffset.top).css("left",videoOffset.left).css("width",this.currentVideo.css("width")).css("height",this.currentVideo.css("height")).show();this.currentVideo.hide();this.currentVideo=comVideo},_renderBanners:function(){var banners=this.options.banners||[],len=banners.length,i=0,parent=$("<div></div>").appendTo(this.container).addClass(this.css.bannerContainerClass),banner;this._bannerShow=[];for(i;i<len;i++){banner=banners[i];if(banner.imageUrl&&banner.imageUrl.length>0){this._renderBannerContainer(banner,this._id("_banner_grid"+i),parent).data("banner-index",i)}this._bannerShow.push($.extend(true,[],banner.times))}},_buildBannersShow:function(){var banners=this.options.banners||[],len=banners.length,i=0;if(len>0){this._bannerShow=[]}for(i;i<len;i++){this._bannerShow.push($.extend(true,[],banners[i].times))}},_renderBannerClose:function(container,id){var css=this.css,control=this;$("<a></a>").attr("id",id+"_banner_close").appendTo($("<div></div>").css({position:"absolute",top:0,left:0,"text-align":"right",width:"100%",height:"100%"}).appendTo(container)).addClass(css.bannerCloseClass).igButton({onlyIcons:true,icons:{primary:css.bannerCloseIconClass},link:{href:this._const.HREF}}).bind("click",function(event){event.preventDefault();event.stopPropagation();control.hideBanner($(this).parent().parent().data("banner-index"))})},_renderBannerContainer:function(banner,id,parent){var css=this.css,control=this,container=$("<div></div>").attr("id",id).appendTo(parent),img=$("<img></img>").attr("id",id+"_img").attr("src",banner.imageUrl).appendTo(container);this.banner=container.addClass(css.bannerClass);if(!banner.visible){container.hide()}if(banner.closeBanner){this._renderBannerClose(container,id)}if(banner.width){container.css("width",banner.width);img.attr("width",parseInt(banner.width,10))}if(banner.height){container.css("height",banner.height);img.attr("height",parseInt(banner.height,10))}if(banner.css){container.addClass(banner.css)}container.bind("click",function(event){var noCancel=true,args={bannerElement:$(event.currentTarget)};noCancel=control._trigger(control.events.bannerClick,event,args);if(banner.link&&banner.link.length>0&&noCancel){window.open(banner.link,"_blank")}});return container},showBanner:function(index){if(this.options.banners&&index>=0&&index<this.options.banners.length){var banner=this.options.banners[index],id=this._id("_banner_grid"+index),container=$("#"+id);if(banner.animate){container.fadeIn(banner.duration)}else{container.show()}this._bannerVisible(index,container);if(banner.autohide){this._bannerHideTimeout=setTimeout(this._createDelegate(this,this.hideBanner,[index]),banner.hidedelay)}}},_createDelegate:function(instance,method,args){return function(){return method.apply(instance,args)}},hideBanner:function(index){if(this.options.banners&&index>=0&&index<this.options.banners.length){clearTimeout(this._bannerHideTimeout);var banner=this.options.banners[index],container=$("#"+this._id("_banner_grid"+index));if(banner.animate){container.fadeOut(banner.duration)}else{container.hide()}this._bannerHidden(index,container)}},_renderSources:function(sources,video){var control=this;$(sources).each(function(){control._renderSource(this,video)})},_renderSource:function(source,video){var qmIndex=source.indexOf("?"),extStartIndex=source.lastIndexOf(".")+1,extEndIndex=qmIndex>-1?qmIndex:source.length,extension=source.substring(extStartIndex,extEndIndex);$("<source></source>").attr("src",source).attr("type",("video/"+source.substring(source.lastIndexOf(".")+1,source.length)).replace("/ogv","/ogg")).appendTo(video);video.data(extension,source)},_getMainVideo:function(){return this.element.is("video")?this.element:$("#"+this._id("_video"))},_setOption:function(key,value,force){var video=this.currentVideo,videoElem=video[0],mainVideo=this._getMainVideo(),videoOffset=video.offset(),options=this.options,noCancel=true,fsVideoH=0;if(this.options[key]===value){return}switch(key){case"disabled":if(value){this.container.addClass("ui-state-disabled")}else{this.container.removeClass("ui-state-disabled")}break;case"sources":$("source",mainVideo).remove();this._renderSources(value,mainVideo);this._analyzeSource(mainVideo);break;case"width":if(value!==options.width){video.css("width",value);this.container.css("width",value);if(!options.browserControls){$("#"+this._id("_ctrls")).parent().css("width",value);$("#"+this._id("_title_ctrls")).parent().css("width",value)}options.width=value}break;case"height":if(value!==options.height){video.css("height",value);this.container.css("height",value);options.height=value}break;case"posterUrl":if(value!==options.posterUrl){video.attr("poster",value);options.posterUrl=value}break;case"loop":if(value!==options.loop){videoElem.loop=value;options.loop=value}break;case"browserControls":if(typeof Modernizr==="object"&&Modernizr.touch){return}if(value!==options.browserControls){if(!value){videoElem.controls=false;this._ensureVolume();this._renderControls();this._detectBuffered()}else{videoElem.controls=true;this._destroyControls()}options.browserControls=value}break;case"autohide":if(!options.browserControls){if(value){this._onControlMouseOut()}else{this._onControlMouseOver()}}options.autohide=value;break;case"fullscreen":if(value!==options.fullscreen||force){if(value){noCancel=this._enterFullScreen(videoElem.currentSrc);if(noCancel){this.container.data("style.position",this.container.css("position"));this.container.data("document.scrollTop",$(document).scrollTop());this.container.data("document.scrollLeft",$(document).scrollLeft());this.container.data("style.left",this.container.css("left"));this.container.data("style.top",this.container.css("top"));this.container.css("z-index",this._baseZIndex+1e4);$(document).scrollTop(0);$(document).scrollLeft(0);this.container.css("position","fixed").css("height","100%").css("width","100%").css("left","0px").css("top","0px");$("#"+this._id("_ctrls")).parent().css("width","100%");if(this._commercialPlaying){video.css("top",0).css("left",0);mainVideo.css("height","100%").css("width","100%")}video.css("height","100%").css("width","100%");if(!options.browserControls){$("span",$("#"+this._id("_ctrls_fs_btn"))).removeClass("ui-icon-arrow-4-diag").addClass("ui-icon-closethick")}if($("#"+this._id("_rv_bar_fs")).is(":visible")){$("span",$("#"+this._id("_rv_bar_fs"))).removeClass("ui-icon-arrow-4-diag").addClass("ui-icon-closethick")}if(options.bookmarks&&options.bookmarks.length>0){$("#"+this._id("_bookmarks")).hide()}}}else{noCancel=this._exitFullScreen(videoElem.currentSrc);if(noCancel){this.container.css("position",this.container.data("style.position")).css("left",this.container.data("style.left")).css("top",this.container.data("style.top"));this.container.css("z-index",this._baseZIndex);$(document).scrollTop(this.container.data("document.scrollTop"));$(document).scrollLeft(this.container.data("document.scrollLeft"));if(options.height){if(options.bookmarks&&options.bookmarks.length>0){fsVideoH=parseInt(options.height,10)-parseInt($("#"+this._id("_bookmarks")).css("height"),10);if(this._commercialPlaying){mainVideo.css("height",fsVideoH)}video.css("height",fsVideoH)}else{if(this._commercialPlaying){mainVideo.css("height",options.height)}video.css("height",options.height)}this.container.css("height",options.height)}else{if(this._commercialPlaying){mainVideo.css("height","")}video.css("height","");this.container.css("height","")}if(options.width){if(this._commercialPlaying){mainVideo.css("width",options.width)}video.css("width",options.width);$("#"+this._id("_ctrls")).parent().css("width",options.width);this.container.css("width",options.width)}else{if(this._commercialPlaying){mainVideo.css("width","")}video.css("width","");$("#"+this._id("_ctrls")).parent().css("width","");this.container.css("width","")}if(this._commercialPlaying){video.css("top",videoOffset.top).css("left",videoOffset.left)}if(!options.browserControls){$("span",$("#"+this._id("_ctrls_fs_btn"))).removeClass("ui-icon-closethick").addClass("ui-icon-arrow-4-diag")}if($("#"+this._id("_rv_bar_fs")).is(":visible")){$("span",$("#"+this._id("_rv_bar_fs"))).removeClass("ui-icon-closethick").addClass("ui-icon-arrow-4-diag")}if(options.bookmarks&&options.bookmarks.length>0){$("#"+this._id("_bookmarks")).show()}}}if(!noCancel){return}if($("#"+this._id("_waiting")).is(":visible")){this._showWaitingIndicator()}if($("#"+this._id("_play")).is(":visible")){this._showCenterPlayButton()}if($("#"+this._id("_ad_msg_c")).is(":visible")){$("#"+this._id("_ad_msg_c")).css("width",this.container.css("width"))}if($("#"+this._id("_ctrls_vs")).is(":visible")){this._hideVolumeSlider()}if($("#"+this._id("_detectError")).is(":visible")){this._showUnsupportedVideoSourceMsg()}$("body").toggleClass("ui-igplayer-full-screen-mode");if(!options.browserControls){$("#"+this._id("_ctrls_fs_btn")).attr("title",value?$.ig.VideoPlayer.locale.exitFullscreen:$.ig.VideoPlayer.locale.enterFullscreen)
}if($("#"+this._id("_rv_bar_fs")).is(":visible")){$("#"+this._id("_rv_bar_fs")).attr("title",value?$.ig.VideoPlayer.locale.exitFullscreen:$.ig.VideoPlayer.locale.enterFullscreen)}options.fullscreen=value}break;case"volume":if(value!==options.volume&&value>=this._const.VOLUME_MIN&&value<=this._const.VOLUME_MAX){options.volume=videoElem.volume=value;if(value>0&&videoElem.muted){options.muted=videoElem.muted=false}else if(value===0&&!videoElem.muted){options.muted=videoElem.muted=true}if(!options.browserControls){this._adjustVolumeButton(value);$("#"+this._id("_ctrls_vs")).igSlider("option","value",value*100)}}break;case"muted":if(value!==options.muted){options.muted=videoElem.muted=value;$("#"+this._id("_ctrls_vs")).igSlider("option","value",value?0:(options.volume!==0?options.volume:.3)*100);if(options.volume===0){options.volume=.3}if(!value&&videoElem.volume===0){videoElem.volume=options.volume}if(!options.browserControls){this._adjustVolumeButton($("#"+this._id("_ctrls_vs")).igSlider("option","value"))}}break;case"title":$("#"+this._id("_title_ctrls_t")).html(value);break;case"progressLabelFormat":options.progressLabelFormat=value;this._updateProgressLabel();break;case"alwaysPlayCommercials":if(value!==options.commercials.alwaysPlayCommercials){options.commercials.alwaysPlayCommercials=value;if(value){this.resetCommercialsShow()}}break;case"bookmarks":this._destroyBookmarks();options.bookmarks=value;this._renderBookmarks();break;case"relatedVideos":this._destroyRelatedVideos();options.relatedVideos=value;this._renderRelatedVideos();break;default:break}$.Widget.prototype._setOption.apply(this,arguments)},_onVideoStateChange:function(){var video=this.currentVideo,videoElem=video[0],o=this.options,prevReadyState=this._prevReadyState,readyState=videoElem.readyState;if(prevReadyState>=videoElem.HAVE_FUTURE_DATA&&readyState<=videoElem.HAVE_CURRENT_DATA){if(!videoElem.ended){this._showWaitingIndicator()}}else if(prevReadyState<=videoElem.HAVE_CURRENT_DATA&&readyState===videoElem.HAVE_FUTURE_DATA){this._hideWaitingIndicator()}else if(readyState===videoElem.HAVE_ENOUGH_DATA){if(prevReadyState<=videoElem.HAVE_CURRENT_DATA){this._hideWaitingIndicator()}else{return}}this._prevReadyState=readyState;this._detectBuffered();if(this._lastPausedState!==videoElem.paused){if(this._lastPausedState){this._showCenterPlayButton().removeClass(this.css.centerPauseButtonClass).addClass(this.css.centerPlayButtonClass)}else{this._showCenterPlayButton().removeClass(this.css.centerPlayButtonClass).addClass(this.css.centerPauseButtonClass)}setTimeout($.proxy(this._hideCenterPlayButton,this),o.centerButtonHideDelay);this._prepareForPlay();this._lastPausedState=videoElem.paused}this._setOption("muted",videoElem.muted);this._refreshDuration();this._onVideoStateChangeId=setTimeout($.proxy(this._onVideoStateChange,this),this._const.VIDEO_STATE_TIMEOUT)},_updateTitleControlsTimeString:function(timeString,title){if(this._activeControlsIndex===1&&timeString){if(!title){title=timeString}$("span.ui-igplayer-playbutton-text",$("#"+this._id("_title_ctrls"))).attr("title",title).html(timeString)}},_analyzeSource:function(video,doNotShowError){var detected=false;if(this.supports_h264_baseline_video()&&video.data("mp4")!==undefined){video.attr("src",video.data("mp4"));detected=true}else if(this.supports_webm_video()&&video.data("webm")!==undefined){video.attr("src",video.data("webm"));detected=true}else if(this.supports_ogg_theora_video()){if(video.data("ogv")!==undefined){video.attr("src",video.data("ogv"));detected=true}else if(video.data("ogg")!==undefined){video.attr("src",video.data("ogg"));detected=true}}video.data("sourceDetected",detected);if(!detected&&!doNotShowError){this._showUnsupportedVideoSourceMsg();if(!this.options.browserControls){if(this._activeControlsIndex===0){$("#"+this._id("_ctrls_play")).igButton("option","disabled",true)}}}else{this._hideUnsupportedVideoSourceMsg();if(!this.options.browserControls){if(this._activeControlsIndex===0){$("#"+this._id("_ctrls_play")).igButton("option","disabled",false)}}}},resetCommercialsShow:function(){this._buildCommercialsShow();this._embeddedCommercialsShow=$.extend(true,[],this.options.commercials.embeddedCommercials);this._embeddedCommercialIndex=0},_attachVideoEvents:function(video){var control=this;this._videoEvents={error:function(event){control._onVideoError(event)},progress:function(event){control._onVideoLoading(event)},waiting:function(event){control._onVideoWaiting(event);control._waiting(this.currentSrc,this.currentTime,this.duration,event)},seeking:function(event){control._showWaitingIndicator()},seeked:function(event){control._hideWaitingIndicator()},timeupdate:function(event){control._changeCurrentTime(event)},ended:function(event){control._showCenterPlayButton().removeClass("ui-igplayer-centerplaybutton-pause").addClass("ui-igplayer-centerplaybutton-play");control._hideWaitingIndicator();if(!control.options.browserControls){$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-play").removeClass("ui-icon-pause")}$("#"+control._id("_ctrls_pb")).igProgressBar("option","value",0);if(control.options.relatedVideos.length>0){control._onControlMouseOut(null);$("#"+control._id("_rvcc")).show()}control._buildBannersShow();if(control.options.commercials.alwaysPlayCommercials){control.resetCommercialsShow()}control._ended(this.currentSrc,this.duration,event)},playing:function(event){control._hideWaitingIndicator();$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-pause").removeClass("ui-icon-play");control._playing(this.currentSrc,this.duration,event)},pause:function(event){$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-play").removeClass("ui-icon-pause");control._paused(this.currentSrc,this.duration,event)},click:function(event){var o=control.options;if(!o.browserControls){event.preventDefault()}if(event.button===0&&!o.disabled){control._onVideoClick(!o.browserControls)}},dblclick:function(event){event.preventDefault();if(event.button===0&&!control.options.disabled){control._onVideoDblClick()}},selectstart:function(){return false},loadedmetadata:function(event){control._refreshDuration()}};video.bind(this._videoEvents)},_onVideoClick:function(allowPlay){if(this._embeddedCommercialPlaying){var link=this.options.commercials.embeddedCommercials[this._embeddedCommercialIndex].link;if(link&&link.length>0){window.open(link,"_blank")}}else if(allowPlay){this.togglePlay()}},_onVideoDblClick:function(){var o=this.options;this._setOption("fullscreen",!o.fullscreen);if(!o.browserControls){this._toggleCenterPlayButton()}},_attachEvents:function(video){var control=this;this._attachVideoEvents(video);this._generalEvts={keydown:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE){if(control.options.fullscreen){control._setOption("fullscreen",false);event.preventDefault();event.stopPropagation()}}else if(event.keyCode===$.ui.keyCode.SPACE){event.preventDefault();event.stopPropagation();control.togglePlay()}}};this._documentEvts={contextmenu:function(e){if($(e.target).is("video")&&control.options.disabled){e.preventDefault();e.stopPropagation()}}};$(document).bind(this._documentEvts);if(!this.options.browserControls){this._controlsEvts={mouseover:function(event){control._onControlMouseOver(event)},mouseout:function(event){control._onControlMouseOut(event)}};this.container.bind(this._controlsEvts)}this.container.bind(this._generalEvts)},_handleKbNavigation:function(event){if(event.keyCode===$.ui.keyCode.HOME){$(this.controlButtons[0]).focus();event.stopPropagation();event.preventDefault()}else if(event.keyCode===$.ui.keyCode.END){$(this.controlButtons[this.controlButtons.length-1]).focus();event.stopPropagation();event.preventDefault()}},_handleBlurKb:function(){this.currentVideo.removeClass(this.css.activeVideoClass)},_handleFocusKb:function(){this.currentVideo.addClass(this.css.activeVideoClass)},_onVideoLoading:function(event){this._detectBuffered(event)},_detectBuffered:function(event){var videoElem=this.currentVideo[0],buffered=videoElem.buffered,duration=parseInt(videoElem.duration,10),len=buffered?buffered.length:0,firstBuffered=len>0?parseInt(buffered.start(len-1),10):0,lastBuffered=len>0?parseInt(buffered.end(len-1),10):0,bufferSize=lastBuffered/duration*100;if(len>0&&this._previouslyBuffered!==bufferSize){if(this._previousBuffer&&lastBuffered<parseInt(this._previousBuffer.end(0),10)){$("#"+this._id("_ctrls_pb")).igProgressBar("option","value",firstBuffered)}$("#"+this._id("_ctrls_pb")).igProgressBar("option","endValue",lastBuffered/duration*100);this._buffering(videoElem.currentSrc,bufferSize,event);this._previouslyBuffered=bufferSize;this._previousBuffer=buffered}},_getActiveControls:function(){var ai=this._activeControlsIndex;if(ai!==undefined&&this.controls&&ai>=0&&ai<this.controls.length){return this.controls[ai].parent()}return null},_onControlMouseOver:function(){var controlsDiv=this._getActiveControls(),o=this.options;if(controlsDiv&&!o.browserControls&&o.autohide&&!$("#"+this._id("_rvcc")).is(":visible")){controlsDiv.show().removeClass(this.css.controlsHideClass)}},_onControlMouseOut:function(){var o=this.options,controlsDiv=this._getActiveControls();if(controlsDiv&&!o.browserControls&&o.autohide){controlsDiv.addClass(this.css.controlsHideClass).hide()}},_onVideoError:function(e){var error=e.target.error;switch(error.code){case error.MEDIA_ERR_ABORTED:break;case error.MEDIA_ERR_NETWORK:this.play();break;case error.MEDIA_ERR_DECODE:case error.MEDIA_ERR_SRC_NOT_SUPPORTED:this._showUnsupportedVideoSourceMsg();break;default:break}},_changeCurrentTime:function(event){var videoElem=this.currentVideo[0],rawDuration=videoElem.duration,currentTime;if(rawDuration===Infinity){this._updateProgressLabel()}else if(!isNaN(rawDuration)){currentTime=parseInt(videoElem.currentTime,10);if(!this._userSliding){$("#"+this._id("_ctrls_s")).igSlider("option","value",currentTime/rawDuration*100)}this._updateProgressLabel();if(this._embeddedCommercialPlaying){this._updateAdMessage(this.options.commercials.embeddedCommercials[this._embeddedCommercialIndex].endTime-currentTime);this._checkEmbeddedCommercialShow(currentTime)}else if(!this._commercialPlaying){this._checkBannerShow(currentTime);this._checkCommercialsShow(currentTime);this._checkEmbeddedCommercialShow(currentTime)}else{this._updateAdMessage(rawDuration-currentTime)}}this._progress(videoElem.currentSrc,currentTime,rawDuration,event)},_checkBannerShow:function(currentTime){var show=this._bannerShow||[],len=show.length,i=0;for(i;i<len;i++){if(show[i].length>0&&currentTime>=show[i][0]){show[i].shift();this.showBanner(i)}}},_checkCommercialsShow:function(currentTime){if(this._commercialsShow&&this._commercialsShow.length>0&&currentTime>=this._commercialsShow[0]&&!this._commercialPlaying){this._commercialPlaying=true;if(currentTime-this._commercialsShow[0]>this._const.COMMERCIAL_SEEK_DELTA){this.currentTime(this._commercialsShow[0])}this.playCommercial(this.options.commercials.linkedCommercials[this._commercialIndex])}},_checkEmbeddedCommercialShow:function(currentTime){if(this._embeddedCommercialsShow&&this._embeddedCommercialsShow.length>0&&!this.currentVideo[0].seeking){var currentCommercial=this._embeddedCommercialsShow[0];if(currentTime>=currentCommercial.startTime&&!this._embeddedCommercialPlaying){this._embeddedCommercialPlaying=true;if(currentTime-currentCommercial.startTime>this._const.COMMERCIAL_SEEK_DELTA){this.currentTime(currentCommercial.startTime)}$("#"+this._id("_ctrls_s")).igSlider("option","disabled",true);this._showAdMessage(currentCommercial.endTime-currentCommercial.startTime);if(currentCommercial.link&&currentCommercial.link.length>0){this.currentVideo.attr("title",$.ig.VideoPlayer.locale.adNewWindowTip)}}else if(currentTime>=currentCommercial.endTime&&this._embeddedCommercialPlaying){this._embeddedCommercialsShow.shift();this._embeddedCommercialIndex++;this._embeddedCommercialPlaying=false;this.hideAdMessage();$("#"+this._id("_ctrls_s")).igSlider("option","disabled",false);if(currentCommercial.link&&currentCommercial.link.length>0){this.currentVideo.removeAttr("title")}}}},_updateProgressLabel:function(){var videoElem=this.currentVideo[0],progressLabel=$("#"+this._id("_ctrls_pl")),rawDuration=videoElem.duration,duration=parseInt(rawDuration,10),currentTime=parseInt(videoElem.currentTime,10),progressString=this.options.progressLabelFormat;progressString=progressString.replace("${currentTime}",this._toTimeString(currentTime)).replace("${duration}",rawDuration===Infinity?$.ig.VideoPlayer.locale.liveStream:this._toTimeString(duration));progressLabel.html(progressString)},_toTimeString:function(val){if(typeof val==="number"){var secs=parseInt(val%60,10),mins=parseInt(val/60,10),hours=parseInt(mins/60,10),days=parseInt(hours/24,10),timeFormat="{0}d {1}:{2}:{3}";mins=parseInt(mins%60,10);hours=parseInt(hours%60,10);timeFormat=timeFormat.replace("{3}",secs<10?"0"+secs:secs).replace("{2}",mins);if(hours>0){timeFormat=timeFormat.replace("{1}",hours);if(days>0){timeFormat=timeFormat.replace("{0}",days)}else{timeFormat=timeFormat.replace("{0}d ","")}}else{timeFormat=timeFormat.replace("{0}d {1}:","")}return timeFormat}return"NaN"},_onVideoWaiting:function(){this._showWaitingIndicator()},_createUnsupportedVideoSourceMsg:function(){var css=this.css;return this._createButton(this._id("_detectError"),css.unsupportedVideoSourceClass,css.unsupportedVideoSourceIconClass,$.ig.VideoPlayer.locale.missingVideoSource).attr("title",$.ig.VideoPlayer.locale.unsupportedVideoSource)},_showUnsupportedVideoSourceMsg:function(){var error=$("#"+this._id("_detectError"));if(error.length===0){error=this._createUnsupportedVideoSourceMsg()}return error.show()},_hideUnsupportedVideoSourceMsg:function(){$("#"+this._id("_detectError")).hide()},_createBigPlayButton:function(){var control=this,css=this.css;this._createButton(this._id("_play"),css.centerPlayButtonClass,css.centerPlayButtonIconClass,"").bind({click:function(event){event.preventDefault();if(event.button===0){control._onVideoClick(true)}},dblclick:function(event){event.preventDefault();if(event.button===0){control._onVideoDblClick()}}})},_createButton:function(buttonId,buttonClass,spanClass,text){$("<span></span>").html(text).addClass(spanClass).appendTo($("<a></a>").attr("id",buttonId).attr("href",this._const.HREF).attr("tabIndex",-1).addClass("ui-state-default").addClass(buttonClass).appendTo(this.container));return $("#"+buttonId).bind({mouseover:function(){$(this).addClass("ui-state-hover")},mouseout:function(){$(this).removeClass("ui-state-hover")}}).hide()},_showCenterPlayButton:function(){var video=this.currentVideo,button=$("#"+this._id("_play")),videoCenterTop=Math.floor(video.height()/2),videoCenterLeft=Math.floor(video.width()/2),top=videoCenterTop-Math.floor(button.innerHeight()/2),left=videoCenterLeft-Math.floor(button.innerWidth()/2);button.css("position","absolute").css("left",left).css("top",top);return button.show()},_toggleCenterPlayButton:function(){var videoElem=this.currentVideo[0],o=this.options,css=this.css;if(videoElem.paused||videoElem.ended){this._showCenterPlayButton().removeClass(css.centerPauseButtonClass).addClass(css.centerPlayButtonClass)}else{this._showCenterPlayButton().removeClass(css.centerPlayButtonClass).addClass(css.centerPauseButtonClass)}setTimeout($.proxy(this._hideCenterPlayButton,this),o.centerButtonHideDelay)},_hideCenterPlayButton:function(){return $("#"+this._id("_play")).hide()},_createWaitingIndicator:function(){var css=this.css;this._createButton(this._id("_waiting"),css.waitingIndicatorClass,css.waitingIndicatorIconClass,$.ig.VideoPlayer.locale.buffering)},_createSeekTimeToolTip:function(){$("<div></div>").attr("id",this._id("_seek_tooltip")).hide().igTooltip({text:"00:00",arrowLocation:"bottom"}).appendTo(this.container).addClass(this.css.seekTooltipClass)},_showSeekTimeToolTip:function(x,y,seconds){var toolTip=$("#"+this._id("_seek_tooltip"));toolTip.css("top",y-toolTip.outerHeight()).css("left",x-toolTip.width()/2).igTooltip("option","text",this._toTimeString(seconds)).show()},_showWaitingIndicator:function(){if($("#"+this._id("_detectError")).is(":visible")){return}var video=this.currentVideo,button=$("#"+this._id("_waiting")),videoCenterTop=Math.floor(video.height()/2),videoCenterLeft=Math.floor(video.width()/2),top=videoCenterTop-Math.floor(button.innerHeight()/2),left=videoCenterLeft-Math.floor(button.innerWidth()/2);button.css("position","absolute").css("left",left).css("top",top).show()},_hideWaitingIndicator:function(){$("#"+this._id("_waiting")).hide()},_renderTitleControls:function(){var title=this.options.title,control=this,controlsDiv,html='<div id="'+this._id("_title_ctrls")+'" class="ui-widget-header ui-igplayer-controls ui-igplayer-grid ui-igplayer-title-controls ui-corner-all">';html+='<div class="ui-igplayer-row">';html+='<div class="ui-igplayer-container ui-igplayer-cell ui-igplayer-playback-alone">';html+='		<a id="'+this._id("_title_ctrls_play")+'" class="ui-button ui-igplayer-playbutton ui-igplayer-playback-with-time ui-state-default ui-corner-all ui-priority-primary" href="'+this._const.HREF+'">';html+='			<span title="'+$.ig.VideoPlayer.locale.play+'" class="ui-icon ui-icon-play ui-igplayer-playbutton-icon"></span>';html+='			<span title="00:00" class="ui-button-text ui-igplayer-playbutton-text">00:00</span>';html+="		</a>";html+="</div>";html+='<div id="'+this._id("_title_ctrls_t")+'" class="ui-igplayer-container ui-igplayer-cell ui-igplayer-video-title">';if(title&&title.length>0){html+=title}html+="</div></div></div>";controlsDiv=$(html).appendTo(this.container).wrap('<div style="position:absolute; width: 100%;"></div>');if(this.options.width){controlsDiv.parent().css("width",this.options.width)}$("#"+this._id("_title_ctrls_play")).bind({click:function(event){event.preventDefault();if(event.button===0&&!control.options.disabled){control.togglePlay()}}});return controlsDiv},_hideTitleControls:function(){if(this._activeControlsIndex!==0){this._activeControlsIndex=0;$("#"+this._id("_title_ctrls")).addClass(this.css.controlsHideClass).parent().remove();$("#"+this._id("_ctrls")).parent().show()}},_convertBookmarks:function(prop,bookmarks,duration,css){var len=bookmarks.length,newBookmarks=[],i=0,mark,newMark,value;for(i;i<len;i++){mark=bookmarks[i];if(mark[prop]>0&&mark[prop]<duration){value=parseInt(mark[prop]/duration*100,10);newMark={value:value,secondsValue:mark[prop],displayTime:this._toTimeString(mark[prop]),index:i,title:mark.title,disabled:mark.disabled};if(css&&css.length>0){newMark.css=css}newBookmarks.push(newMark)}}return newBookmarks},_renderBookmarks:function(){var o=this.options,bookmarks=o.bookmarks||[],com=o.commercials,ads=com.linkedCommercials||[],eads=com.embeddedCommercials||[],duration=this.currentVideo[0].duration,newBookmarks=[],newAdBookmarks=[],newEAdBookmarks=[];if(com.showBookmarks){if(ads.length>0){newAdBookmarks=this._convertBookmarks("startTime",ads,duration,this.css.linkedBookmarkClass)}if(eads.length>0){newEAdBookmarks=this._convertBookmarks("startTime",eads,duration,this.css.adBookmarkClass)}}if(bookmarks.length>0){newBookmarks=this._convertBookmarks("time",bookmarks,duration);if(newBookmarks.length>0){this._renderBookmarkArea(newBookmarks)}}if(newAdBookmarks.length>0){$.merge(newBookmarks,newAdBookmarks)}if(newEAdBookmarks.length>0){$.merge(newBookmarks,newEAdBookmarks)}if(newBookmarks.length>0){$("#"+this._id("_ctrls_s")).igSlider("option","bookmarks",newBookmarks)}this._bookmarksRendered=true},_renderBookmarkArea:function(bookmarks){if(bookmarks&&bookmarks.length>0){var css=this.css,bookmarkStr='<li class="ui-corner-all $class$"><span class="'+css.bookmarkItemTimeClass+'">11/6/2015 11:25:01 AM</span><span class="'+css.bookmarkItemTitleClass+'" title="$titleAttr$">$title$</span></li>',bookmarkAreaStr='<div id="$id$" class="$bookmarkContainerClass$"><div class="$headerClass$">$headerText$</div><ul class="$bookmarkListClass$">$list$</ul></div>',bookmarkList="",bookmarkArea,mark,i=0,len=bookmarks.length,control=this;for(i;i<len;i++){mark=bookmarks[i];bookmarkList+=bookmarkStr.replace("11/6/2015 11:25:01 AM",mark.displayTime).replace("$titleAttr$",mark.title).replace("$title$",mark.title).replace("$class$",mark.disabled?css.bookmarkItemDisabledClass:"")}bookmarkAreaStr=bookmarkAreaStr.replace("$id$",this._id("_bookmarks")).replace("$bookmarkContainerClass$",css.bookmarkContainerClass).replace("$headerClass$",css.bookmarkContainerHeaderClass).replace("$bookmarkListClass$",css.bookmarkListClass).replace("$headerText$",$.ig.VideoPlayer.locale.skipTo).replace("$list$",bookmarkList);bookmarkArea=$(bookmarkAreaStr).appendTo(this.container);this.bookmarkElements=$("li",$("#"+this._id("_bookmarks")));this.bookmarkElements.each(function(i){$(this).data("bookmark-index",bookmarks[i].index);$(this).data("bookmark-sec-value",bookmarks[i].secondsValue)});this.bookmarkElements.bind({click:function(event){var index=$(this).data("bookmark-index"),mark=control.options.bookmarks[index];event.stopPropagation();event.preventDefault();if(!mark.disabled){if(control.paused()){control.togglePlay()}control.currentTime($(this).data("bookmark-sec-value"));control._changeActiveBookmark(index);control._bookmarkClick(mark,bookmarks[index],event)}}});if(this.options.height){this.currentVideo.css("height",this.container.height()-bookmarkArea.height());this._resizeBookmarkAreaTimeoutId=setTimeout($.proxy(this._onPlayerResize,this),500)}}},_onPlayerResize:function(){var o=this.options,containerH=this.container.height(),containerW=this.container.width(),bookmarkArea=$("#"+this._id("_bookmarks"));if((o.height||o.width)&&(this._oldContainerHeight!==containerH||this._oldContainerWidth!==containerW)){this.currentVideo.css("height",containerH-bookmarkArea.height());this._oldContainerHeight=containerH;this._oldContainerWidth=containerW}this._resizeBookmarkAreaTimeoutId=setTimeout($.proxy(this._onPlayerResize,this),250)},_ensureVolume:function(){this.options.volume=this.currentVideo[0].volume},_renderControls:function(){$("body").addClass("ui-igplayer-normal-screen-mode");if(this.options.showSeekTime){this._createSeekTimeToolTip()}var videoElem=this.currentVideo[0],control=this,controlsDiv,controlsArray=[],autoPlay=this.options.autoplay,href=this._const.HREF,html='<div id="'+this._id("_ctrls")+'" class="$controlsClass$">',cachedTime;html+='			<div class="ui-igplayer-row">';html+='				<div class="ui-igplayer-container ui-igplayer-cell ui-igplayer-playback">';html+='					<a id="$playButtonId$" class="$playButtonClass$" href="'+href+'"></a>';html+="				</div>";html+='				<div class="ui-igplayer-container ui-igplayer-cell ui-igplayer-progress-bar">';html+='					<div id="$progressBarId$" class="$progressBarClass$"></div>';html+="				</div>";html+='				<div class="ui-igplayer-container ui-igplayer-extra">';html+='					<div class="ui-igplayer-grid">';html+='						<div class="ui-igplayer-row">';html+='							<div class="ui-igplayer-cell">';html+='								<a id="$progressLabelId$" class="$progressLabelClass$" href="'+href+'"></a>';html+="							</div>";html+='							<div class="ui-igplayer-cell">';html+="                               <div>";html+='								    <div id="$volumeSliderId$" class="$volumeSliderClass$"></div>';html+="									<div>";html+='										<a id="$volumeControlId$" class="$volumeControlClass$" href="'+href+'"></a>';html+="									</div>";html+="                               </div>";html+="							</div>";html+='							<div class="ui-igplayer-cell">';html+='								<a id="$fullScreenId$" class="$fullScreenClass$" href="'+href+'"></a>';html+="							</div>";html+="						</div>";html+="					</div>";html+="				</div>";html+="			</div>";html+="		</div>";html=html.replace("$playButtonClass$",this.css.playButtonClass).replace("$progressBarClass$",this.css.progressBarClass).replace("$fullScreenClass$",this.css.fullScreenClass).replace("$controlsClass$",this.css.controlsClass).replace("$volumeControlClass$",this.css.volumeControlClass).replace("$volumeSliderClass$",this.css.volumeSliderClass).replace("$progressLabelClass$",this.css.progressLabelClass);html=html.replace("$playButtonId$",this._id("_ctrls_play")).replace("$progressBarId$",this._id("_ctrls_s")).replace("$fullScreenId$",this._id("_ctrls_fs_btn")).replace("$volumeControlId$",this._id("_ctrls_vc_btn")).replace("$volumeSliderId$",this._id("_ctrls_vs")).replace("$progressLabelId$",this._id("_ctrls_pl"));controlsDiv=$(html).appendTo(this.container).wrap('<div style="position:absolute; width: 100%;"></div>');if(this.options.width){controlsDiv.parent().css("width",this.options.width)}controlsArray.push(controlsDiv);if(!autoPlay&&videoElem.currentTime===0){controlsDiv.parent().hide();this._activeControlsIndex=1;controlsArray.push(this._renderTitleControls())}else{this._activeControlsIndex=0}this.controls=$(controlsArray);$("#"+this._id("_ctrls_play")).bind({click:function(event){event.preventDefault();if(!$(this).igButton("option","disabled")){control.togglePlay()}}}).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:"ui-icon "+(autoPlay?"ui-icon-pause ":"ui-icon-play ")+"ui-igplayer-playbutton-icon "}}).addClass("ui-priority-primary").attr("title",autoPlay?$.ig.VideoPlayer.locale.playing:$.ig.VideoPlayer.locale.paused);$("#"+this._id("_ctrls_fs_btn")).bind({click:function(event){event.preventDefault();control._setOption("fullscreen",!control.options.fullscreen)}}).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:this.css.fullScreenIconClass}}).attr("title",$.ig.VideoPlayer.locale.enterFullscreen);$('<div id="'+this._id("_ctrls_pb")+'"></div>').appendTo($("#"+this._id("_ctrls_s")).igSlider({slide:function(event,ui){if(event.originalEvent===undefined){return false}clearTimeout(control._slideTimeout);control._slideTimeout=setTimeout(control._createDelegate(control,control._slide,[ui]),control._const.SLIDE_SEEK_TIMEOUT)},start:function(){control._userSliding=true},stop:function(){control._userSliding=false},bookmarkhit:function(event,ui){var index=ui.bookmark.index,elems=control.bookmarkElements;if(elems&&elems.length>0){control._changeActiveBookmark(index);control._bookmarkHit(control.currentVideo[0].currentSrc,control.options.bookmarks[index],elems[index],event)}},bookmarkclick:function(event,ui){var mark;if($(ui.bookmarkElement).hasClass("ui-igplayer-linked-bookmark")){mark=control.options.commercials.linkedCommercials[ui.bookmark.index]}else if($(ui.bookmarkElement).hasClass("ui-igplayer-ad-bookmark")){mark=control.options.commercials.embeddedCommercials[ui.bookmark.index]}else{mark=control.options.bookmarks[ui.bookmark.index];control._changeActiveBookmark(ui.bookmark.index)}if(mark.time){cachedTime=mark.time}else{cachedTime=mark.startTime}control.currentTime(cachedTime);control._bookmarkClick(mark,ui.bookmarkElement,event);return false},min:0,max:100,animate:true}).css("display","block")).igProgressBar({range:true,endValue:0});$("#"+this._id("_ctrls_pb")).bind({mousemove:function(e){if(control.options.showSeekTime&&this.offsetWidth>0){var relativeX=e.pageX-this.offsetLeft-$(this).offset().left,percentLocation=parseInt(relativeX/this.offsetWidth*100,10),duration=videoElem.duration,seconds,controlOffset=control.container.offset();if(!isNaN(duration)&&duration!==Infinity&&!control._commercialPlaying){seconds=parseInt(percentLocation*duration/100,10);control._showSeekTimeToolTip(e.pageX-controlOffset.left,e.pageY-controlOffset.top,seconds)}}},mouseout:function(){$("#"+control._id("_seek_tooltip")).hide()}});$("#"+this._id("_ctrls_pl")).bind({click:function(event){event.preventDefault()}});$("#"+this._id("_ctrls_vc_btn")).bind({mouseover:function(){control._showVolumeSlider()},mouseout:function(event){if(!jQuery.contains(event.currentTarget,event.relatedTarget)&&event.currentTarget!==event.relatedTarget){control._volumeSliderTimeoutId=setTimeout($.proxy(control._hideVolumeSlider,control),control.options.volumeAutohideDelay)}},click:function(event){event.preventDefault();control._setOption("muted",!control.options.muted)}}).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:"ui-icon "+(this.options.muted?"ui-icon-volume-off ":"ui-icon-volume-on ")+"ui-igbutton-icon"}}).attr("title",$.ig.VideoPlayer.locale.volume);$("#"+this._id("_ctrls_vs")).hide().bind({mouseover:function(){control._volumeSliderMouseOut=false;clearTimeout(control._volumeSliderTimeoutId)},mouseout:function(){if(!control._userSlidingVolume){control._volumeSliderTimeoutId=setTimeout($.proxy(control._hideVolumeSlider,control),control.options.volumeAutohideDelay)}control._volumeSliderMouseOut=true}}).igSlider({slide:function(event,ui){if(event.originalEvent===undefined){return}control._setOption("volume",parseFloat(parseInt(ui.value,10)/100))},start:function(){control._userSlidingVolume=true},stop:function(){control._userSlidingVolume=false},min:0,max:100,step:10,orientation:"vertical",value:this.options.muted?0:this.options.volume*100});$("#"+this._id("_ctrls_vs")).data("igSlider").handle.attr("tabIndex",-1).bind({blur:function(){control._volumeSliderTimeoutId=setTimeout($.proxy(control._hideVolumeSlider,control),control.options.volumeAutohideDelay)}});this.controlButtons=$([document.getElementById(this._id("_ctrls_play")),$("a.ui-state-default",$("#"+this._id("_ctrls_s")))[0],document.getElementById(this._id("_ctrls_vc_btn")),document.getElementById(this._id("_ctrls_fs_btn"))]);this.controlButtons.each(function(i){$(this).data("index.control-button",i)});this.controlButtons.bind({keydown:function(event){control._handleKbNavigation(event)},focus:function(event){control._handleFocusKb(event)},blur:function(event){control._handleBlurKb(event)}});$("#"+this._id("_ctrls_vc_btn")).bind({focus:function(){control._showVolumeSlider()},blur:function(){if(!control._transferFocusFromVolumeButtonToVolumeSlider){control._hideVolumeSlider()}control._transferFocusFromVolumeButtonToVolumeSlider=false},keydown:function(event){if(event.keyCode===$.ui.keyCode.TAB){event.preventDefault();event.stopPropagation();control._transferFocusFromVolumeButtonToVolumeSlider=true;$("#"+control._id("_ctrls_vs")).data("igSlider").handle.focus()}}});$("#"+control._id("_ctrls_vs")).data("igSlider").handle.bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.TAB){event.preventDefault();event.stopPropagation();$("#"+control._id("_ctrls_fs_btn")).focus()}}})},_slide:function(ui){var value=ui.value,rawDuration=this.currentVideo[0].duration,currentTime=rawDuration*(value/100);if(!isNaN(rawDuration)&&rawDuration!==Infinity){this.currentTime(currentTime)}this._userSliding=false},_changeActiveBookmark:function(index){var activeBookmarkIndex=this._activeBookmarkIndex,bkElems=this.bookmarkElements;if(bkElems&&bkElems.length>0&&index!==activeBookmarkIndex){if(activeBookmarkIndex>=0&&activeBookmarkIndex<bkElems.length){$(bkElems[activeBookmarkIndex]).removeClass(this.css.bookmarkActiveItemClass)}if(index>=0&&index<bkElems.length){$(bkElems[index]).addClass(this.css.bookmarkActiveItemClass);this._activeBookmarkIndex=index}}},_adjustVolumeButton:function(value){var volumeButton=$("#"+this._id("_ctrls_vc_btn"));if(value===0){$("span",volumeButton).removeClass("ui-icon-volume-on").addClass("ui-icon-volume-off")}else{$("span",volumeButton).removeClass("ui-icon-volume-off").addClass("ui-icon-volume-on")}},_hideVolumeSlider:function(){var slider=$("#"+this._id("_ctrls_vs"));slider.data("igSlider").handle.attr("tabIndex",-1);slider.hide()},_showVolumeSlider:function(){clearTimeout(this._volumeSliderTimeoutId);var slider=$("#"+this._id("_ctrls_vs"));slider.data("igSlider").handle.removeAttr("tabIndex");slider.show()},_ended:function(source,duration,event){var args={source:source,duration:duration};return this._trigger(this.events.ended,event,args)},_playing:function(source,duration,event){var args={source:source,duration:duration,currentTime:this.currentVideo[0].currentTime};return this._trigger(this.events.playing,event,args)},_paused:function(source,duration,event){var args={source:source,duration:duration,currentTime:this.currentVideo[0].currentTime};
return this._trigger(this.events.paused,event,args)},_buffering:function(source,bufferedPercent,event){var args={source:source,buffered:bufferedPercent};return this._trigger(this.events.buffering,event,args)},_progress:function(source,currentTime,duration,event){var args={source:source,currentTime:currentTime,duration:duration};return this._trigger(this.events.progress,event,args)},_waiting:function(source,currentTime,duration,event){var args={source:source,currentTime:currentTime,duration:duration};return this._trigger(this.events.waiting,event,args)},_bookmarkHit:function(source,bookmark,bookmarkElement,event){var args={source:source,bookmark:bookmark,bookmarkElement:bookmarkElement};return this._trigger(this.events.bookmarkHit,event,args)},_bookmarkClick:function(bookmark,bookmarkElement,event){var args={bookmark:bookmark,bookmarkElement:bookmarkElement};return this._trigger(this.events.bookmarkClick,event,args)},_enterFullScreen:function(source){var args={source:source};return this._trigger(this.events.enterFullScreen,null,args)},_exitFullScreen:function(source){var args={source:source};return this._trigger(this.events.exitFullScreen,null,args)},_bannerVisible:function(index,element){var args={index:index,banner:this.options.banners[index],bannerElement:element};return this._trigger(this.events.bannerVisible,null,args)},_bannerHidden:function(index,element){var args={index:index,banner:this.options.banners[index],bannerElement:element};return this._trigger(this.events.bannerHidden,null,args)},_prepareForPlay:function(){var o=this.options,video=this.currentVideo;if($("source",video).length===0){this._renderSources(o.sources,video)}if(!video.data("sourceDetected")){this._analyzeSource(video)}this._hideTitleControls();if(o.relatedVideos&&o.relatedVideos.length>0){$("#"+this._id("_rvcc")).hide()}},togglePlay:function(){var videoElem=this.currentVideo[0];this._prepareForPlay();this._toggleCenterPlayButton();if(videoElem.paused||videoElem.ended){if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr("title",$.ig.VideoPlayer.locale.playing)}videoElem.play()}else{if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr("title",$.ig.VideoPlayer.locale.paused)}videoElem.pause()}},play:function(){var videoElem=this.currentVideo[0];if(videoElem.paused||videoElem.ended){this._prepareForPlay();this._toggleCenterPlayButton();if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr("title",$.ig.VideoPlayer.locale.playing)}videoElem.play()}},pause:function(){var videoElem=this.currentVideo[0];if(!videoElem.paused){this._toggleCenterPlayButton();if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr("title",$.ig.VideoPlayer.locale.paused)}videoElem.pause()}},currentTime:function(val){var videoElem=this.currentVideo[0],rawDuration=videoElem.duration;if(val!==null&&val!==undefined){try{videoElem.currentTime=val;$("#"+this._id("_ctrls_pb")).igProgressBar("option","value",(val/rawDuration).toFixed(2)*100);this._checkCommercialsShow(val);this._checkEmbeddedCommercialShow(val)}catch(ex){}if(videoElem.paused&&!isNaN(rawDuration)){$("#"+this._id("_ctrls_s")).igSlider("option","value",(val/rawDuration).toFixed(2)*100)}}return parseInt(videoElem.currentTime,10)},screenshot:function(scaleFactor){if(!scaleFactor||$.type(scaleFactor)!=="number"){scaleFactor=1}var videoElem=this.currentVideo[0],w=videoElem.videoWidth*scaleFactor,h=videoElem.videoHeight*scaleFactor,canvas=document.createElement("canvas"),ctx;if(canvas.getContext){canvas.width=w;canvas.height=h;ctx=canvas.getContext("2d");ctx.drawImage(videoElem,0,0,w,h)}return canvas},supports_video:function(){return!!document.createElement("video").canPlayType},supports_h264_baseline_video:function(){if(!this.supports_video()){return false}var v=document.createElement("video");return v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')!==""},supports_ogg_theora_video:function(){if(!this.supports_video()){return false}var v=document.createElement("video");return v.canPlayType('video/ogg; codecs="theora, vorbis"')!==""},supports_webm_video:function(){if(!this.supports_video()){return false}var v=document.createElement("video");return v.canPlayType('video/webm; codecs="vp8, vorbis"')!==""},paused:function(){return this.currentVideo[0].paused},ended:function(){return this._getMainVideo()[0].ended},duration:function(){this._refreshDuration();return this._duration},_refreshDuration:function(){var duration=this.currentVideo[0].duration;if(duration!==this._duration){this._duration=duration;if(duration===Infinity){this._updateTitleControlsTimeString($.ig.VideoPlayer.locale.live,$.ig.VideoPlayer.locale.liveStream);$("#"+this._id("_ctrls_s")).data("igSlider").handle.hide();$("#"+this._id("_ctrls_s")).igSlider("option","disabled",true)}else if(!isNaN(duration)){if(this._commercialPlaying){this._showAdMessage(parseInt(duration,10))}else{this._updateTitleControlsTimeString(this._toTimeString(duration));if(!this._bookmarksRendered&&duration>0){this._renderBookmarks()}}}}},seeking:function(){return this.currentVideo[0].seeking},destroy:function(){var css=this.css;clearTimeout(this._scrollingTimoutId);clearTimeout(this._volumeSliderTimeoutId);clearTimeout(this._onVideoStateChangeId);clearTimeout(this._resizeBookmarkAreaTimeoutId);if(this._oldWidth){this.element.css("width",this._oldWidth)}if(this._oldHeight){this.element.css("height",this._oldHeight)}this.container.unbind(this._generalEvts);$(document).unbind(this._documentEvts);if(this._controlsEvts){this.container.unbind(this._controlsEvts)}this.container.removeClass(css.baseClasses);$("#"+this._id("_ctrls_s")).igSlider("destroy");$("#"+this._id("_ctrls_pb")).igProgressBar("destroy");$("#"+this._id("_ctrls_vs")).igSlider("destroy");$("#"+this._id("_seek_tooltip")).igTooltip("destroy");if(this._commercialsShow){delete this._commercialsShow;delete this._commercialIndex;delete this._commercialPlaying}if(this._embeddedCommercialsShow){delete this._embeddedCommercialPlaying;delete this._embeddedCommercialIndex;delete this._embeddedCommercialsShow}delete this.bookmarkElements;delete this.relatedVideoElements;delete this.controlButtons;delete this._bannerShow;delete this.banner;if(this.element.is("video")){this.element.unbind(this._videoEvents);this.element.removeClass(css.videoClass);this._restoreExistingVideoProperties(this.element);$(":not(video)",this.container).remove();this.element.unwrap()}else{this.container.children().remove()}$.Widget.prototype.destroy.apply(this,arguments)},_destroyBookmarks:function(){if(this.bookmarkElements&&this.bookmarkElements.length>0){this.bookmarkElements.unbind();this.bookmarkElements.removeData();delete this.bookmarkElements;$("#"+this._id("_bookmarks")).remove();$("#"+this._id("_ctrls_s")).igSlider("clearBookmarks");this._bookmarksRendered=false}},_destroyRelatedVideos:function(){var related=this.options.relatedVideos;if(related&&related.length>0){$("#"+this._id("_rvcc")).remove();delete this.relatedVideoElements;related=[]}},_destroyControls:function(){var controls=this.options.browserControls;if(!controls){$("#"+this._id("_ctrls_play")).igButton("destroy");$("#"+this._id("_ctrls_vc_btn")).igButton("destroy");$("#"+this._id("_ctrls_fs_btn")).igButton("destroy");$("#"+this._id("_ctrls_pb")).igProgressBar("destroy");$("#"+this._id("_ctrls_s")).igSlider("destroy");$("#"+this._id("_ctrls_vs")).igSlider("destroy");this.controls.each(function(){$(this).parent().remove()});delete this.controls;delete this.controlButtons;delete this._activeControlsIndex}}});$.extend($.ui.igVideoPlayer,{version:"13.1.20131.2523"})})(jQuery);