//START IngrPL.WebClient.Core.Platform.MapServices.MapServiceDefinitionManager.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapServices");IngrPL.WebClient.Core.Platform.MapServices._MapServiceDefinitionManager=function(){this._mapServiceDefinitions={}};IngrPL.WebClient.Core.Platform.MapServices._MapServiceDefinitionManager.prototype={registerMapServiceDefinition:function(a){this._mapServiceDefinitions[a.name]=a},findMapServiceDefinition:function(a){return this._mapServiceDefinitions[a]},get_mapServiceDefinitions:function(){return this._mapServiceDefinitions}};IngrPL.WebClient.Core.Platform.MapServices._MapServiceDefinitionManager.registerClass("IngrPL.WebClient.Core.Platform.MapServices._MapServiceDefinitionManager");IngrPL.WebClient.Core.Platform.MapServices.MapServiceDefinitionManager=new IngrPL.WebClient.Core.Platform.MapServices._MapServiceDefinitionManager();var $mapServiceDefinitionManager=IngrPL.WebClient.Core.Platform.MapServices.MapServiceDefinitionManager;
//END IngrPL.WebClient.Core.Platform.MapServices.MapServiceDefinitionManager.js
//START IngrPL.WebClient.Core.Platform.Web.WebRequestWrapper.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.Web");IngrPL.WebClient.Core.Platform.Web._WebRequestWrapper=function(){this._types=[String,Number,Boolean,Date]};IngrPL.WebClient.Core.Platform.Web._WebRequestWrapper.prototype={create:function(c){if(c==null){throw Error.argumentNull("config")}if(!c.name&&!c.url){throw Error.argument("config",IngrPL.WebClient.Core.Platform.Translate.E_NoHandlerNameNorUrl)}var d=new Sys.Net.WebRequest();var e=this._createArgString(c.query);var a=this._createArgString(c.body);var b=c.name?c.name+".WebClient.ashx":c.url;if(e){b=[b,e].join("?")}d.set_url(b);if(c.includeMapStates){$mapStateManager.saveMapStates();a=this._createArgString({__wc_mapstates:theForm.__wc_mapstates.value},a)}if(c.includeCRS==null||c.includeCRS){a=this._createArgString({__wc_crs:theForm.__wc_crs.value,__wc_currentcrsid:theForm.__wc_currentcrsid.value},a)}if(c.mapService){a=this._createArgString({name:c.mapService.get_definition().name,config:Sys.Serialization.JavaScriptSerializer.serialize(c.mapService.get_minimalConfigStub())},a)}if(c.filter){a=this._createArgString({filterId:c.filter.id,filteredValues:Sys.Serialization.JavaScriptSerializer.serialize(c.filter.filteredValues)},a)}if(c.includeSelectedFeatures&&theForm.SelectedFeatures){a=this._createArgString({SelectedFeatures:theForm.SelectedFeatures.value},a)}if(c.callback){if(c.scope){d.add_completed(Function.createDelegate(c.scope,c.callback))}else{d.add_completed(c.callback)}}if(c.context){d.set_userContext(c.context)}if(a){d.set_body(a)}d.set_httpVerb(a?"POST":"GET");return d},_createArgString:function(d,c){if(!d){return c||null}var b=new Sys.StringBuilder(c);for(var f in d){if(d[f]==null){continue}for(var e=0,a=this._types.length;e<a;e++){if(this._types[e].isInstanceOfType(d[f])){var g=encodeURIComponent(d[f].toString());b.append([f,g].join("="));break}}}return b.toString("&")}};IngrPL.WebClient.Core.Platform.Web._WebRequestWrapper.registerClass("IngrPL.WebClient.Core.Platform.Web._WebRequestWrapper");IngrPL.WebClient.Core.Platform.Web.WebRequestWrapper=new IngrPL.WebClient.Core.Platform.Web._WebRequestWrapper();var $webRequest=IngrPL.WebClient.Core.Platform.Web.WebRequestWrapper;
//END IngrPL.WebClient.Core.Platform.Web.WebRequestWrapper.js
//START IngrPL.WebClient.Core.Platform.ClientScript.ClientLogWriter.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.ClientScript");IngrPL.WebClient.Core.Platform.ClientScript.TraceLevel=function(){};IngrPL.WebClient.Core.Platform.ClientScript.TraceLevel.prototype={Off:0,Error:1,Warning:2,Info:3,Verbose:4};IngrPL.WebClient.Core.Platform.ClientScript.TraceLevel.registerEnum("IngrPL.WebClient.Core.Platform.ClientScript.TraceLevel");IngrPL.WebClient.Core.Platform.ClientScript._ClientLogWriter=function(){this._level=IngrPL.WebClient.Core.Platform.ClientScript.TraceLevel.Off};IngrPL.WebClient.Core.Platform.ClientScript._ClientLogWriter.prototype={get_level:function(){return this._level},set_level:function(a){this._level=a},writeError:function(a,b){this._writeLog(IngrPL.WebClient.Core.Platform.ClientScript.TraceLevel.Error,arguments)},writeWarning:function(a,b){this._writeLog(IngrPL.WebClient.Core.Platform.ClientScript.TraceLevel.Warning,arguments)},writeInfo:function(a,b){this._writeLog(IngrPL.WebClient.Core.Platform.ClientScript.TraceLevel.Info,arguments)},writeVerbose:function(a,b){this._writeLog(IngrPL.WebClient.Core.Platform.ClientScript.TraceLevel.Verbose,arguments)},_writeLog:function(e,b){if(!b.length){throw Error.argumentNull("message")}if(!String.isInstanceOfType(b[0])){throw Error.argumentType("message",Object.getType(b[0]),String)}if(e<=this._level){var c=new Sys.StringBuilder("[");var a=new Date();c.append(a.localeFormat("T"));c.append(" ");c.append(this._getLevelString(e));c.append("] ");c.append(String.format.apply(null,b));Sys.Debug.trace(c.toString(""));var d=document.getElementById("TraceConsole");if(d&&(d.tagName.toUpperCase()==="TEXTAREA")){d.scrollTop=d.scrollHeight-d.clientHeight}}},_getLevelString:function(a){if(a==IngrPL.WebClient.Core.Platform.ClientScript.TraceLevel.Verbose){return"Verbose"}else{if(a==IngrPL.WebClient.Core.Platform.ClientScript.TraceLevel.Info){return"Info"}else{if(a==IngrPL.WebClient.Core.Platform.ClientScript.TraceLevel.Warning){return"Warning"}else{if(a==IngrPL.WebClient.Core.Platform.ClientScript.TraceLevel.Error){return"Error"}else{return"Off"}}}}}};IngrPL.WebClient.Core.Platform.ClientScript._ClientLogWriter.registerClass("IngrPL.WebClient.Core.Platform.ClientScript._ClientLogWriter");IngrPL.WebClient.Core.Platform.ClientScript.ClientLogWriter=new IngrPL.WebClient.Core.Platform.ClientScript._ClientLogWriter();var $log=IngrPL.WebClient.Core.Platform.ClientScript.ClientLogWriter;
//END IngrPL.WebClient.Core.Platform.ClientScript.ClientLogWriter.js
//START IngrPL.WebClient.Core.Platform.MapLayers.SvgLayerHelper.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");IngrPL.WebClient.Core.Platform.MapLayers.SvgLayerHelper=function(c,b,a){this._gwmCore=new _gwmCoreObject();this._gwmCore.featureClicked=a||Function.emptyFunction;this._embedLoadedDelegate=Function.createDelegate(this,this._embedLoaded);this._mouseEventDelegate=Function.createDelegate(this,this._mouseEvent);this._gwmBasME=new _gwmBasicMouseEventsObject();if(Sys.Browser.agent==Sys.Browser.InternetExplorer){this.displaySvg=this._displaySvg_Embed}else{this.displaySvg=this._displaySvg_DOM}this._svgLoadedDelegate=c;this._svgInitializedDelegate=b};IngrPL.WebClient.Core.Platform.MapLayers.SvgLayerHelper.prototype={_invokeRequest:function(a){if(this._request){this._request.get_executor().abort()}this._request=$webRequest.create({url:a,includeCRS:false,callback:this._requestCompleted,scope:this});this._request.invoke()},_requestCompleted:function(d){this._request=null;if(!IngrPL.WebClient.Core.Platform.Common.Util.checkExecutor(d,IngrPL.WebClient.Core.Platform.Common.Util.showError)){return}try{var b=d.get_xml();this._fixDocumentForWebKit(b);var a=document.importNode(b.documentElement,true);this._svgLoaded(a)}catch(c){IngrPL.WebClient.Core.Platform.Common.Util.showError(c)}},_displaySvg_DOM:function(b,a){this._currentBounds=a;if(b){if(this._svg){this._svg.style.display=""}this._invokeRequest(b)}else{if(this._svg){this._svg.style.display="none"}this._clearSvgLegend()}},_svgLoaded:function(svg){this._setSvgEventHandlers(false);this._gwmCore.svgDoc=null;svg.style.width="100%";svg.style.height="100%";if(this._svg){this._mapLayerDiv.replaceChild(svg,this._svg)}else{this._mapLayerDiv.appendChild(svg)}this._svg=svg;var svgDoc=new IngrPL.WebClient.Core.Platform.MapLayers._SvgDoc(svg);this._gwmCore.svgDoc=svgDoc;if(!window._GWMLegendDisplayOrder){var gwmLegendScript=$get("gwmlegendscript");if(gwmLegendScript&&gwmLegendScript.textContent){$log.writeVerbose("force eval on gwmlegendscript content");eval(gwmLegendScript.textContent);window._GWMLegendDisplayOrder=_GWMLegendDisplayOrder;window._GWMLegendGroup=_GWMLegendGroup}}if(window._GWMLegendDisplayOrder){this._initSvg()}if(this._svgLoadedDelegate){this._svgLoadedDelegate()}this.setViewBox()},_fixDocumentForWebKit:function(d){if(!navigator.userAgent||navigator.userAgent.indexOf("WebKit")<0){return}var a=d.getElementById("gwmstyles");var c=a.childNodes.item(0);if(c&&c.nodeType==4){$log.writeVerbose("fix map for WebKit");var b=c.data;c.parentNode.removeChild(c);a.appendChild(d.createTextNode(b))}},_displaySvg_Embed:function(b,a){this._currentBounds=a;if(b){if(this._embed){this._embed.style.display=""}}else{if(this._embed){this._embed.style.display="none"}this._clearSvgLegend();return}this._setSvgEventHandlers(false);this._gwmCore.svgDoc=null;this._mapLayerDiv.innerHTML=['<embed width="100%" height="100%" type="image/svg+xml" wmode="transparent" ','src="',b,'"></embed>'].join("");this._embed=this._mapLayerDiv.firstChild;setTimeout(this._embedLoadedDelegate,50)},_embedLoaded:function(a){if(this._embed.readystate!=4){setTimeout(this._embedLoadedDelegate,50);return}this._gwmCore.svgDoc=this._embed.getSVGDocument();window._GWMLegendDisplayOrder=this._embed.window._GWMLegendDisplayOrder;window._GWMLegendGroup=this._embed.window._GWMLegendGroup;this._initSvg();if(this._svgLoadedDelegate){this._svgLoadedDelegate()}this.setViewBox()},_initSvg:function(){this._gwmCore.iViewCtrlWidth=this._currentBounds.width;this._gwmCore.iViewCtrlHeight=this._currentBounds.height;window._gwmCore=this._gwmCore;_gwmOnSVGLoad();this._setSvgEventHandlers(true);var a=$get("gwmlegendscript");if(a){a.parentNode.removeChild(a)}_GWMLegendDisplayOrder=null;_GWMLegendGroup=null;if(this._svgInitializedDelegate){this._svgInitializedDelegate()}},_setSvgEventHandlers:function(b){if(!this._gwmCore.svgDoc){return}var c=this._gwmCore.svgDoc.documentElement;var a=b?"addEventListener":"removeEventListener";c[a]("click",this._mouseEventDelegate,false);c[a]("mouseover",this._mouseEventDelegate,false);c[a]("mouseout",this._mouseEventDelegate,false)},_mouseEvent:function(a){window._gwmCore=this._gwmCore;window._gwmBasME=this._gwmBasME;switch(a.type){case"click":_gwmMouseClick(a);break;case"mouseover":_gwmMouseOver(a);break;case"mouseout":_gwmMouseOut(a);break}},setViewBox:function(){if(!this._currentMapRange||!this._gwmCore.svgDoc){return}var a={width:this._gwmCore.iViewCtrlWidth,height:this._gwmCore.iViewCtrlHeight};var c=this._currentMapRange.getSize();var g=this._pendingMapRange.getSize();var b=Math.round(a.width*g.width/c.width);var h=Math.round(a.height*g.height/c.height);var e=Math.round((this._pendingMapRange.getBottomLeft().x-this._currentMapRange.getBottomLeft().x)*a.width/c.width);var d=Math.round((this._currentMapRange.getUpperRight().y-this._pendingMapRange.getUpperRight().y)*a.height/c.height);var i=[e,d,b,h].join(" ");var f=this._gwmCore.svgDoc.documentElement;f.setAttribute("viewBox",i)},_clearSvgLegend:function(){if(this._gwmCore.Legend){this._gwmCore.Legend.displayEntries=this._gwmCore.initDisplayEntries();this._gwmCore.Legend.groupEntries=this._gwmCore.initGroupEntries()}},legendItemMoved:function(k,m,n,b){if(!this._gwmCore.svgDoc){return true}window._gwmCore=this._gwmCore;var o=_gwmCore.Legend.displayEntries;var f=b.get_mapState();var c=f.get_legend().get_flatLegend();function l(p){var i=c[b.get_firstLegendItemPriority()+p];return o.item("gwmle:"+i.get_id())}var a=o.item("gwmle:"+k.get_id());if(a){if(n<m){var d=null;for(var h=n-1;h>=0;h--){d=l(h);if(d){break}}var e=d==null?null:d.name;o.move(a,e,null)}else{if(n>m){var g=null;var j=b.get_lastLegendItemPriority()-b.get_firstLegendItemPriority()+1;for(var h=n+1;h<j;h++){g=l(h);if(g){break}}if(g){o.move(a,null,g.name)}else{o.move(a,o.item(0).name,null)}}}}return false},updateLegendItemsVisibility:function(d){if(!this._gwmCore.svgDoc){return true}window._gwmCore=this._gwmCore;var e=false;for(var c=0;c<d.length;c++){var a=d[c];var f=a.get_isVisible()&&a.get_isInRange();var b=_gwmCore.Legend.groupEntries.item("gwmle:"+a.get_id());if(b){b.setDisplayMode(_gwmCore.DisplayMode[f?"on":"off"])}else{if(f){e=true}}}return e},removeLegendItems:function(e){if(!this._gwmCore.svgDoc){return true}window._gwmCore=this._gwmCore;var a=_gwmCore.Legend.displayEntries;for(var d=0;d<e.length;d++){var b=e[d];var c=a.item("gwmle:"+b.get_id());if(c){a.remove(c)}}return false},destroy:function(){if(this._request){this._request.get_executor().abort()}},get_mapLayerDiv:function(){return this._mapLayerDiv},set_mapLayerDiv:function(a){this._mapLayerDiv=a},get_currentMapRange:function(){return this._currentMapRange},set_currentMapRange:function(a){this._currentMapRange=a},get_pendingMapRange:function(){return this._pendingMapRange},set_pendingMapRange:function(a){this._pendingMapRange=a},get_gwmCore:function(){return this._gwmCore}};IngrPL.WebClient.Core.Platform.MapLayers.SvgLayerHelper.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.SvgLayerHelper");IngrPL.WebClient.Core.Platform.MapLayers._SvgDoc=function(a){this.documentElement=a};IngrPL.WebClient.Core.Platform.MapLayers._SvgDoc.prototype={createTextNode:function(a){return document.createTextNode(a)},getElementById:function(a){return this._getElementById(this.documentElement,a)},_getElementById:function(b,d){if(b.getAttribute){if(b.getAttribute("id")==d){return b}for(var a=0;a<b.childNodes.length;a++){var c=this._getElementById(b.childNodes.item(a),d);if(c){return c}}}else{return null}},createElementNS:function(b,a){return document.createElementNS(b,a)}};IngrPL.WebClient.Core.Platform.MapLayers._SvgDoc.registerClass("IngrPL.WebClient.Core.Platform.MapLayers._SvgDoc");
//END IngrPL.WebClient.Core.Platform.MapLayers.SvgLayerHelper.js
//START IngrPL.WebClient.Core.Platform.MapLayers.SVG.BasicMouseEvents.js
function _gwmBasicMouseEventsObject(){this.onCompletionHandler=_gwmMEDone;this.onInterruptHandler=_gwmMEInterrupt;this.onMoveHandler=_gwmMEMove;this.keyPress=_gwmKeyPress;this.IDLE=0;this.PANREADY=2;this.PAN=3;this.GETELEMENT=15;this.GETSELECTEDFEATURE=16;this.GETLOCATABLEFEATURE=32;this.POINTMODE=101;this.LINEMODE=102;this.POLYLINEMODE=103;this.POLYGONMODE=104;this.RECTANGLEMODE=105;this.CIRCLEMODE=106;this.TEXTMODE=107;this.CALLOUTMODE=108;this.TEXTKEYINSTART=109;this.TEXTKEYINMODE=110;this.iListenerState=0}function _gwmMEDone(){return}function _gwmMEInterrupt(){return}function _gwmMEMove(){return}function _gwmMouseOver(a){var e=_gwmBasME.iListenerState;if(e!=_gwmBasME.IDLE&&e!=_gwmBasME.GETELEMENT&&e!=_gwmBasME.GETSELECTEDFEATURE&&e!=_gwmBasME.GETLOCATABLEFEATURE){return}var d=a.target;var c=_gwmCore.getFeature(d);if(!c||!c.legendEntry){if(d.getAttribute("id")=="gwmlogorect"){_gwmCore.tooltipHandler(a,"",true)}return}var b=c.legendEntry;if(b.isEnabled()){if(e!=_gwmBasME.GETSELECTEDFEATURE&&e!=_gwmBasME.GETLOCATABLEFEATURE){if(b.tooltipsEnabled()){_gwmCore.tooltipHandler(a,c.tooltip(),true)}if(b.hotspotsEnabled()){c.highlight()}}else{if((e==_gwmBasME.GETSELECTEDFEATURE&&c.isSelected())||(e==_gwmBasME.GETLOCATABLEFEATURE&&b.isLocatable())){if(b.tooltipsEnabled()){_gwmCore.tooltipHandler(a,c.tooltip(),true)}c.highlight()}}}}function _gwmMouseOut(a){var e=_gwmBasME.iListenerState;if(e!=_gwmBasME.IDLE&&e!=_gwmBasME.GETELEMENT&&e!=_gwmBasME.GETSELECTEDFEATURE&&e!=_gwmBasME.GETLOCATABLEFEATURE){return}var d=a.target;var c=_gwmCore.getFeature(d);if(!c||!c.legendEntry){if(d.getAttribute("id")=="gwmlogorect"){_gwmCore.tooltipHandler(a,"",false)}return}var b=c.legendEntry;if(b.isEnabled()){if(b.tooltipsEnabled()){_gwmCore.tooltipHandler(a,"",false)}if(c.isHighlighted()){c.unhighlight()}}}function _gwmMouseMove(a){var c=_gwmBasME.iListenerState;if(c==_gwmBasME.IDLE){return}switch(c){case _gwmBasME.PAN:case _gwmBasME.PANREADY:var b=_gwmCore.getTransSVGPoint(a);_gwmBas.attachActiveCursor(b);if(c==_gwmBasME.PAN){var e=_gwmCore.svgRoot.createSVGPoint();e.x=a.clientX;e.y=a.clientY;var f=_gwmBas.ptArray[0];if(f.x==e.x&&f.y==e.y){return}_gwmBas.ptArray[1]=e;setTimeout("_gwmCore.svgRoot.currentTranslate.x += "+(e.x-f.x),10);setTimeout("_gwmCore.svgRoot.currentTranslate.y += "+(e.y-f.y),15);_gwmBas.ptArray[0]=e}break;case _gwmBasME.POINTMODE:case _gwmBasME.LINEMODE:case _gwmBasME.POLYLINEMODE:case _gwmBasME.POLYGONMODE:case _gwmBasME.RECTANGLEMODE:case _gwmBasME.CIRCLEMODE:case _gwmBasME.TEXTMODE:case _gwmBasME.CALLOUTMODE:case _gwmBasME.TEXTKEYINSTART:var d=_gwmCore.getTransSVGPoint(a);_gwmBas.attachActiveCursor(d);if(_gwmBas.ptArray.length<=0&&(c!=_gwmBasME.TEXTMODE&&c!=_gwmBasME.CALLOUTMODE)){break}if(c==_gwmBasME.LINEMODE){_gwmBas.drawPath(_gwmBas.sEleDrawLine,null,_gwmBas.ptArray,d,false)}else{if(c==_gwmBasME.POLYLINEMODE){_gwmBas.drawPath(_gwmBas.sEleDrawPolyline,null,_gwmBas.ptArray,d,false)}else{if(c==_gwmBasME.TEXTMODE){_gwmBas.clearMultiple(_gwmBas.sEleDrawText,null);_gwmBas.drawText(_gwmBas.sEleDrawText,null,d,_gwmBas.sDrawText)}else{if(c==_gwmBasME.CALLOUTMODE){_gwmBas.drawPath(_gwmBas.sEleDrawCalloutLine,null,_gwmBas.ptArray,d,false);_gwmBas.clearMultiple(_gwmBas.sEleDrawText,null);_gwmBas.drawText(_gwmBas.sEleDrawText,null,d,_gwmBas.sDrawText)}else{if(c==_gwmBasME.POLYGONMODE){_gwmBas.drawPath(_gwmBas.sEleDrawPolygon,null,_gwmBas.ptArray,d,true)}else{if(c==_gwmBasME.RECTANGLEMODE){_gwmBas.drawRectangle(_gwmBas.sEleDrawRect,null,_gwmBas.ptArray[0],d)}else{if(c==_gwmBasME.CIRCLEMODE){_gwmBas.drawCircle(_gwmBas.sEleDrawCircle,null,_gwmBas.ptArray[0],d)}}}}}}}break}}function _gwmMouseDown(a){if(_gwmBasME.iListenerState!=_gwmBasME.IDLE&&_gwmBas.bNavKeys==false){a.preventDefault()}if(_gwmIsRightClick(a)){if(_gwmBasME.onInterruptHandler){_gwmBasME.onInterruptHandler()}return}if(_gwmBasME.iListenerState==_gwmBasME.PANREADY){_gwmBas.sCoordList="";_gwmBas.ptArray=null;_gwmBas.ptArray=new Array();_gwmBas.mtxHolder=_gwmCore.getSVGTransMatrix();var b=_gwmCore.getTransSVGPoint(a);_gwmBas.attachActiveCursor(b);var c=_gwmCore.svgRoot.createSVGPoint();c.x=a.clientX;c.y=a.clientY;_gwmBas.ptArray[0]=c;_gwmBasME.iListenerState=_gwmBasME.PAN}}function _gwmMouseUp(a){if(_gwmBasME.iListenerState==_gwmBasME.PAN){var b=_gwmCore.getTransSVGPointMtx(a,_gwmBas.mtxHolder);_gwmBas.ptArray[1]=b;if(_gwmBasME.onCompletionHandler){_gwmBasME.onCompletionHandler()}}}function _gwmOnSVGScroll(a){if(_gwmBas.evtHandlerSVGScroll){_gwmBas.evtHandlerSVGScroll(a)}}function _gwmOnSVGZoom(a){if(_gwmBas.evtHandlerSVGZoom){_gwmBas.evtHandlerSVGZoom(a)}}function _gwmMouseClick(a){var h;var g=_gwmBasME.iListenerState;var d=_gwmIsRightClick(a);switch(g){case _gwmBasME.IDLE:if(d){return}h=a.target;if(null!=_gwmBas.evtHandlerClick&&typeof(_gwmBas.evtHandlerClick)!="undefined"){var i=_gwmCore.getTransSVGPoint(a);_gwmBas.evtHandlerClick(h,i.x,i.y)}var e=_gwmCore.getFeature(h);if(null!=e&&null!=e.legendEntry&&e.legendEntry.isEnabled()&&e.legendEntry.hotspotsEnabled()){e.launchAction(a)}else{if(h.getAttribute("id")=="gwmlogorect"){_gwmCore.launchAction(_gwmGetEleAttributeGWM(h,"gmwmsvg:act",false))}}break;case _gwmBasME.POINTMODE:case _gwmBasME.LINEMODE:case _gwmBasME.POLYLINEMODE:case _gwmBasME.POLYGONMODE:case _gwmBasME.RECTANGLEMODE:case _gwmBasME.CIRCLEMODE:case _gwmBasME.TEXTMODE:case _gwmBasME.CALLOUTMODE:case _gwmBasME.TEXTKEYINSTART:case _gwmBasME.TEXTKEYINMODE:case _gwmBasME.PAN:if(d){if(_gwmBasME.onInterruptHandler){_gwmBasME.onInterruptHandler()}break}if(g==_gwmBasME.PAN){return}var i=_gwmCore.getTransSVGPoint(a);var b=_gwmIsDblClick(i);if(!b){_gwmBas.ptArray[_gwmBas.ptArray.length]=i}var c=false;if(_gwmBas.ptArray.length==1){if(g==_gwmBasME.POINTMODE){c=true;_gwmBas.drawPoint(_gwmBas.sEleDrawPoint,null,_gwmBas.ptArray[0])}else{if(g==_gwmBasME.TEXTMODE){c=true;_gwmBas.clearMultiple(_gwmBas.sEleDrawText,null);_gwmBas.drawText(_gwmBas.sEleDrawText,null,_gwmBas.ptArray[0],_gwmBas.sDrawText)}else{if(g==_gwmBasME.TEXTKEYINSTART){c=true}}}}else{if(_gwmBas.ptArray.length==2){if(g==_gwmBasME.LINEMODE||g==_gwmBasME.RECTANGLEMODE||g==_gwmBasME.CIRCLEMODE||((g==_gwmBasME.POLYLINEMODE||g==_gwmBasME.CALLOUTMODE)&&b)){c=true}}else{if(b){c=true}}}if(c){if(_gwmBasME.onCompletionHandler){_gwmBasME.onCompletionHandler()}}break;case _gwmBasME.GETELEMENT:case _gwmBasME.GETSELECTEDFEATURE:case _gwmBasME.GETLOCATABLEFEATURE:if(d){if(_gwmBasME.onInterruptHandler){_gwmBasME.onInterruptHandler()}break}h=a.target;if(_gwmBasME.onCompletionHandler){_gwmBasME.onCompletionHandler(h)}break}}function _gwmIsRightClick(a){var b=-1;if(a.getButton){b=a.getButton()}else{b=a.button}return(b==2)}function _gwmIsDblClick(b){var a=false;var c=_gwmBas.ptArray;if(c.length>0){a=(b.x==c[c.length-1].x&&b.y==c[c.length-1].y)}return a}function _gwmKeyPress(a){var c=_gwmBasME.iListenerState;if(c==_gwmBasME.IDLE){return}var b=a.charCode;switch(c){case _gwmBasME.TEXTKEYINMODE:if(b==27&&_gwmBasME.onInterruptHandler){_gwmBasME.onInterruptHandler();break}_gwmBas.drawTextKeyin(_gwmBas.sEleDrawTextKeyinT,b);break}};
//END IngrPL.WebClient.Core.Platform.MapLayers.SVG.BasicMouseEvents.js
//START IngrPL.WebClient.Core.Platform.MapLayers.SVG.LegendObjects.js
Legend=function(b,a){if(null==b){this.displayEntries=new LegendEntries(null,this,true)}else{this.displayEntries=b;this.displayEntries.parent=this;this.displayEntries.display=true}if(null==a){this.groupEntries=new LegendEntries(null,this,false)}else{this.groupEntries=a;this.groupEntries.parent=this;this.groupEntries.display=false}this.isLegend=true};Legend.prototype={toString:function(){return"Legend:\n\tDisplayEntries: "+this.displayEntries.toString()+"\n\tGroupEntries: "+this.groupEntries.toString()}};LegendEntries=function(a,c,d){if(!a){this.entries=new Array()}else{this.entries=a}this.count=this.entries.length;this.parent=c;this.display=Boolean(d);this.names=new Object();if(this.entries.length>0){for(var b=0;b<this.entries.length;b++){this.names[this.entries[b].name]=this.entries[b];if(this.display){this.entries[b].displayParent=c}else{this.entries[b].groupParent=c}}}};LegendEntries.prototype={execute:function(d,a){if(null==d||"function"!=typeof(d)){throw _gwmCore.Resources.nullOrInvalidArg}if(null==a){a=false}else{a=Boolean(a)}if(this.count>0){if(!a){for(var c=0;c<this.count;c++){var b=this.item(c);d(b);b.groupEntries.execute(d);b.displayEntries.execute(d)}}else{for(var c=this.count-1;c>=0;c--){var b=this.item(c);d(b);b.groupEntries.execute(d,true);b.displayEntries.execute(d,true)}}}return this},toString:function(){var b="{";if(this.count>0){b+=" ("+this.count+") ";for(var a=0;a<this.count;a++){b+="\n"+this.item(a).toString()}}else{b+="(empty)"}b+="}";return b},item:function(a){if(null==a){return null}else{if("number"!=typeof(a)){return this.names[a]}else{if(a<0||a>this.entries.length-1){throw _gwmCore.Resources.indexOutOfRange}else{return this.entries[a]}}}},move:function(a,b,c){if(null!=a){return this.append(this.remove(a,true),b,c)}},append:function(a,l,b){if(null!=a){var e=1;var c=a.name;var n=c;while(null!=this.names[n]){n=c+String(e++)}a.name=n;var e=0;var k=-1;var g=this.entries.length;if(null!=l&&""!=l){if("number"!=typeof(l)){var f=this.item(l);for(e=0;this.entries[e]!=f&&e<g;e++){}}else{e=l}if(e<g){for(var d=g;d>=e;d--){this.entries[d]=this.entries[d-1]}}this.entries[e]=a;k=e}else{if(null!=b){if("number"!=typeof(b)){var m=this.item(b);for(e=0;this.entries[e]!=m&&e<g;e++){}}else{e=b}if(e<g){for(var d=g;d>e;d--){this.entries[d]=this.entries[d-1]}this.entries[e+1]=a;k=e+1}else{this.entries[g]=a;k=g}}else{this.entries[g]=a;k=g}}this.names[a.name]=a;this.count++;if(this.display){a.displayParent=this.parent;var h=a.displayParent;while(h&&h.displayParent){h=h.displayParent}if(h.isLegend){var o=null;var l=false;if(0==k&&this.count>1){o=this.entries[1];l=true}else{if(k>0){o=this.entries[k-1]}else{o=null}}a.loadGraphics(o,l)}}else{a.groupParent=this.parent}}return a},remove:function(g,b){if(null==g){return null}if(null==b){b=false}else{b=Boolean(b)}var e=null;var f=0;switch(typeof(g)){case"number":if(g<0||g>=this.entries.length){throw _gwmCore.Resources.indexOutOfRange}f=g;break;case"object":e=g.name;break;default:e=g}var a=this.entries.length;if(null!=e){for(f=0;f<a;f++){if(e==this.entries[f].name){break}}}if(f<a){var c=this.entries[f];this.names[c.name]=null;this.entries[f]=null;for(var d=f;d<a-1;d++){this.entries[d]=this.entries[d+1]}this.entries.length--;this.count--;if(this.display){if(!b){c.clearSelectedFeatures();c.clearHighlightedFeatures()}c.unloadGraphics();c.displayParent=null}else{c.groupParent=null}return c}else{throw"Legend Entry '"+e+"' not found"}}};LegendEntry=function(a,l,e,d,h,j,i,b,f,c,k){this.name=a;this.displayMode=e;this.title=l;this.isLeafEntry=b;this.locatable=d;this.hotspots=h;this.tooltips=j;this.enabled=i;this.setGraphics(f);this.displayParent=c;this.groupParent=k;this.displayEntries=new LegendEntries(null,this,true);this.groupEntries=new LegendEntries(null,this,false);this.highlightedFeatures=new Features(this,false,true);this.selectedFeatures=new Features(this,false,true);this.features=new Features(this,true)};LegendEntry.prototype={toString:function(a){a=Boolean(a);var b="";if(a){b=" { name: "+this.name+"; displayMode: "+this.displayMode+"; title: "+this.title+"; isLeafEntry: "+this.isLeafEntry+"; locatable: "+this.locatable+"; hotspots: "+this.hotspots+"; tooltips: "+this.tooltips+"; enabled: "+this.enabled+"; g: "+((null!=this.g)?"(object)":"(null)")+"; displayParent: "+((null!=this.displayParent)?"(object)":"(null)")+"; groupParent: "+((null!=this.groupParent)?"(object)":"(null)")+"; \ngroupEntries: "+this.groupEntries.toString()+"; \ndisplayEntries: "+this.displayEntries.toString()+"; }"}else{b=" { name: "+this.name;if(this.groupEntries.count>0){b+="; groupEntries: "+this.groupEntries.toString()}if(this.displayEntries.count>0){b+="; displayEntries: "+this.displayEntries.toString()}b+="; }"}return b},setGraphics:function(g){this.g=g;if(null!=this.g){this.g.le=this;this.g.findFeatureElement=_gwmFindFeatureElementInGroup;this.g.getFeatureElements=_gwmGetFeatureElements;this.pkFields=eval(_gwmCore.getEleAttributeGWM(this.g,"gmwmsvg:pk",false))}else{this.pkFields=null}return this},unloadGraphics:function(){if(null!=this.g&&null!=this.g.parentNode){this.g.parentNode.removeChild(this.g)}this.displayEntries.execute(function(a){a.unloadGraphics()});return this},loadGraphics:function(d,c){var e=_gwmCore.legendLayer;if(null!=this.g&&this.g.parentNode!=e){this.g.setAttribute("id",_gwmBas.getUnusedElementName(this.g.getAttribute("id")));if(null==d){if(e.hasChildNodes()){var b=_gwmCore.$("gwmbg");if(null!=b){d=b.nextSibling}else{d=e.firstChild}e.insertBefore(this.g,d)}else{e.appendChild(this.g)}}else{var a=null;if(d.isLeafEntry&&d.displayEntries.count==0){a=d.g}else{if(d.displayEntries.count>0){if(!c){a=d.displayEntries.item(d.displayEntries.count-1).g}else{a=d.displayEntries.item(0).g}}}if(c){if(a&&a.nextSibling){while(a.nextSibling){a=a.nextSibling;if("g"==a.nodeName&&"l"==_gwmCore.getEleAttributeGWM(a,"gmwmsvg:typ",false)){break}}if(a){e.insertBefore(this.g,a)}else{e.appendChild(this.g)}}else{e.appendChild(this.g)}}else{e.insertBefore(this.g,a)}}}this.displayEntries.execute(function(f){f.loadGraphics(d,c)},true);return this},hotspotsEnabled:function(){return this.hotspots},_enableHotspots:function(b){this.hotspots=Boolean(b);var a=function(c){c._enableHotspots(b)};this.displayEntries.execute(a);this.groupEntries.execute(a);return this},enableHotspots:function(){return this._enableHotspots(true)},disableHotspots:function(){return this._enableHotspots(false)},isLocatable:function(){return this.locatable},setLocatable:function(b){this.locatable=Boolean(b);var a=function(c){c.setLocatable(b)};this.displayEntries.execute(a);this.groupEntries.execute(a);return this},tooltipsEnabled:function(){return this.tooltips},_enableTooltips:function(b){this.tooltips=Boolean(b);var a=function(c){c.enableTooltips(b)};this.displayEntries.execute(a);this.groupEntries.execute(a);return this},enableTooltips:function(){return this._enableTooltips(true)},disableTooltips:function(){return this._enableTooltips(false)},isEnabled:function(){return this.enabled},_enable:function(b){this.enabled=Boolean(b);var a=function(c){c.enable(b)};this.displayEntries.execute(a);this.groupEntries.execute(a);return this},enable:function(){return this._enable(true)},disable:function(){return this._enable(false)},getDisplayMode:function(){return this.displayMode},clearSelectedFeatures:function(){this.selectedFeatures.execute(function(a){a.unselect()});return this},clearHighlightedFeatures:function(){this.highlightedFeatures.execute(function(a){a.unhighlight()});return this},setDisplayMode:function(c,b){this.displayMode=c;if(null==b){b=true}if(this.g){switch(c){case _gwmCore.DisplayMode.on:this.g.setAttribute("visibility","visible");break;case _gwmCore.DisplayMode.off:this.g.setAttribute("visibility","hidden");this.clearSelectedFeatures();this.clearHighlightedFeatures();break}if(Boolean(b)){this.features.execute(function(d){d.removeVisibility()})}}var a=function(d){d.setDisplayMode(c)};this.displayEntries.execute(a);this.groupEntries.execute(a);return this}};PrimaryKey=function(a,b){this._values=new Object();if(null!=a&&null!=b){if(a.length>0&&a.length==b.length){for(var c=0;c<a.length;c++){this._values[a[c]]=b[c]}}else{throw _gwmCore.Resources.nullOrInvalidArg}}};PrimaryKey.prototype={equals:function(b){if(null==b){throw _gwmCore.Resources.nullOrInvalidArg}else{var a=null;if("object"==typeof(b)){a=b.serialize()}else{a=new PrimaryKey().deserialize(b).serialize()}return(this.serialize().localeCompare(a)==0)}},toString:function(){var a="";for(var b in this._values){if(a.length>0){a+=", "}a+=b+": "+this._values[b]}return(a.length>0?"{"+a+"}":"{ empty }")},set:function(b,a){if(null==b){throw _gwmCore.Resources.nullOrInvalidArg}else{this._values[b]=a;return this}},remove:function(a){if(null==a){throw"Field not specified"}else{if(this._values[a]!=null){this._values[a]=null;return this}}},get:function(a){if(null==a){throw _gwmCore.Resources.nullOrInvalidArg}else{return this._values[a]}},serialize:function(){var a=new Array();for(var d in this._values){a.push(d)}a.sort(function(f,e){return String(f).localeCompare(String(e))});var c="";for(var b=0;b<a.length;b++){if(c.length>0){c+=_gwmCore.PrimaryKeyFormat.fieldDelimiter}c+=a[b]+_gwmCore.PrimaryKeyFormat.valueDelimiter+this._values[a[b]]}return c},deserialize:function(b){if(null==b){throw _gwmCore.Resources.nullOrInvalidArg}var c=new Object();var d=b.split(_gwmCore.PrimaryKeyFormat.fieldDelimiter);for(var a=0;a<d.length;a++){var e=d[a].split(_gwmCore.PrimaryKeyFormat.valueDelimiter);if(2!=e.length){throw _gwmCore.Resources.invalidPKFormat}else{c[e[0]]=e[1]}}this._values=c;return this}};FeatureElements=function(b,a){this.elements=b;this.count=(null!=b)?b.length:0;this.parent=a};FeatureElements.prototype={toString:function(){var b="";for(var a=0;a<this.elements.length;a++){if(b.length>0){b+=", "}b+=this.elements[a].getAttribute("id")}return"{ "+b+" }"},item:function(a){return this.elements[a]},getElementZero:function(){var b=this.elements[0];if("g"==b.nodeName){for(var a=0;a<b.childNodes.length&&1!=b.childNodes.item(a).nodeType;a++){}b=b.childNodes.item(a)}return b},execute:function(b){if(null==b||"function"!=typeof(b)){throw _gwmCore.Resources.nullOrInvalidArg}for(var a=0;a<this.elements.length;a++){b(this.elements[a])}return this},clone:function(){var a=new Array();this.execute(function(b){a.push(b.cloneNode(true))});return new FeatureElements(a,this.parent)}};Feature=function(c,b,d,a){this.elements=(c==null)?new FeatureElements(null,this):c;this.highlightElements=new FeatureElements(null,this);this.selectElements=new FeatureElements(null,this);this.elements.parent=this;this.highlightElements.parent=this;this.selectElements.parent=this;if(null!=b){this.primaryKey=b}else{if(this.elements.count>0){try{this.primaryKey=_gwmCore.getPrimaryKey(this.elements.getElementZero())}catch(c){}}}this.parent=d;this.legendEntry=a;this.visible=true;this.selected=false;this.highlighted=false;if(this.elements.count>0){this.id=this.elements.item(0).getAttribute("id").split(".")[0]}else{this.id=null}this.bbox=null};Feature.prototype={toString:function(){return"{ "+((null==this.primaryKey)?this.id:this.primaryKey.toString())+": "+this.elements.toString()+" }"},showTooltip:function(d){var i=this.elements.getElementZero();if(i.correspondingUseElement){i=i.correspondingUseElement}if(null==d||""==d){d=this.tooltip()}var g=_gwmCore.svgRoot;var e=this.getBBox();var h=e.x+e.width/2;var f=e.y+e.height/2;var a=_gwmBas.getPntViewCtrlPixDim();var c=(_gwmCore.iViewW/a.x);var b=(_gwmCore.iViewH/a.y);h=h/c;f=f/b;a.x=h;a.y=f;_gwmCore.showTooltip(null,a,d);return this},getBBox:function(){if(null==this.bbox){var a=NaN;var d=NaN;var b=NaN;var c=NaN;this.elements.execute(function(h){if("g"==h.nodeName){for(var g=0;g<h.childNodes.length;g++){var f=_gwmBas.getEleBBox(h);if(isNaN(a)||f.x<a){a=f.x}if(isNaN(d)||f.y<d){d=f.y}if(isNaN(b)||(f.x+f.width)>b){b=f.x+f.width}if(isNaN(c)||(f.y+f.height)>c){c=f.y+f.height}}}else{var f=_gwmBas.getEleBBox(h);if(isNaN(a)||f.x<a){a=f.x}if(isNaN(d)||f.y<d){d=f.y}if(isNaN(b)||(f.x+f.width)>b){b=f.x+f.width}if(isNaN(c)||(f.y+f.height)>c){c=f.y+f.height}}});this.bbox={x:a,y:d,width:b-a,height:c-d}}return this.bbox},fit:function(g){var f=this.getBBox();var c,e,b,d;c=_gwmBas.transXCoordFromViewer(f.x,_gwmBas.iCoordUnits);e=_gwmBas.transYCoordFromViewer(f.y,_gwmBas.iCoordUnits);b=_gwmBas.transXCoordFromViewer(f.x+f.width,_gwmBas.iCoordUnits);d=_gwmBas.transYCoordFromViewer(f.y+f.height,_gwmBas.iCoordUnits);if(_gwmBas.isNull(g)){g=_gwmAPI.fZoomFactor}else{g=parseFloat(g)}if(g<1){g=1}if(1!=g){var a=(g*(b-c)-(b-c))/2;var h=(g*(d-e)-(d-e))/2;c-=a;e-=h;b+=a;d+=h}_gwmBas.viewCtrl.setViewRange(c,e,b,d);return this},setTooltip:function(a){var b=this.elements.getElementZero();if(b.correspondingUseElement){b=b.correspondingUseElement}b.setAttribute(_gwmCore.ns+":tt",a);return this},tooltip:function(){return _gwmCore.getEleAttributeGWM(this.elements.getElementZero(),"gmwmsvg:tt",false)},isVisible:function(){return this.visible},show:function(){this.visible=true;this.elements.execute(function(a){a.style.setProperty("visibility","visible")});return this},hide:function(){this.visible=false;this.unhighlight();this.unselect();this.elements.execute(function(a){a.style.setProperty("visibility","hidden")});return this},action:function(){var a=this.elements.getElementZero();if(a.correspondingUseElement>""){a=a.correspondingUseElement}return _gwmCore.getEleAttributeGWM(a,"gmwmsvg:act",true)},setAction:function(b){var c=this.elements.getElementZero();if(c.correspondingUseElement>""){c=c.correspondingUseElement}c.setAttribute(_gwmCore.ns+":act",b)},launchAction:function(evt){var a=this.action();if(null==a||""==a){return}var temp=a.toLowerCase();if(temp.indexOf("javascript")!=-1){eval(a)}else{window.location=a}return this},isHighlighted:function(){return this.highlighted},isSelected:function(){return this.selected},highlight:function(){if(this.highlighted||null==_gwmCore.highlightLayer){return}else{if(0==this.highlightElements.count){this.highlightElements=this.elements.clone();this.highlightElements.execute(function(b){b.setAttribute("id","highlighted$"+b.getAttribute("id"));b.highlightElement=true;if("g"==b.nodeName){for(var a=0;a<b.childNodes.length;a++){var c=b.childNodes.item(a);if(1==c.nodeType){c.setAttribute("id","highlighted$"+c.getAttribute("id"));c.highlightElement=true;_gwmCore.decorateFeatureElement(c,true,0)}}}else{_gwmCore.decorateFeatureElement(b,true,0)}})}if(this.highlightElements.count>0){this.highlightElements.execute(function(a){_gwmCore.highlightLayer.appendChild(a)});this.highlighted=true;this.legendEntry.highlightedFeatures.add(this)}}return this},unhighlight:function(){if(!this.highlighted||this.highlightElements.count==0){return}else{this.highlightElements.execute(function(a){a.parentNode.removeChild(a)});this.legendEntry.highlightedFeatures.remove(this);this.highlighted=false}return this},select:function(){if(this.selected||null==_gwmCore.selectedLayer){return}else{if(0==this.selectElements.count){this.selectElements=this.elements.clone();this.selectElements.execute(function(b){b.setAttribute("id","selected$"+b.getAttribute("id"));b.selectElement=true;if("g"==b.nodeName){for(var a=0;a<b.childNodes.length;a++){var c=b.childNodes.item(a);if(1==c.nodeType){c.setAttribute("id","selected$"+c.getAttribute("id"));c.selectElement=true;_gwmCore.decorateFeatureElement(c,true,1)}}}else{_gwmCore.decorateFeatureElement(b,true,1)}})}if(this.selectElements.count>0){this.selectElements.execute(function(a){_gwmCore.selectedLayer.appendChild(a)});this.selected=true;this.legendEntry.selectedFeatures.add(this);_gwmCore.selectSet.add(this)}}return this},unselect:function(){if(!this.selected||this.selectElements.count==0){return}else{this.selectElements.execute(function(a){a.parentNode.removeChild(a)});this.legendEntry.selectedFeatures.remove(this);_gwmCore.selectSet.remove(this);this.selected=false}return this},removeVisibility:function(){this.elements.execute(function(a){a.style.removeProperty("visibility")})}};Features=function(c,a,b){this.parent=c;this._detached=(null==b)?false:Boolean(b);this._pks=new Object();this._ids=new Object();this.count=0;this._create=this._detached?false:Boolean(a)};Features.prototype={toString:function(){var a="";this.execute(function(b){if(a.length>0){a+=", "}a+=b.toString()});return(a.length>0?"{ ("+this.count+") "+a+"}":"{ empty }")},clear:function(){var b=this.toArray();for(var a=0;a<b.length;a++){this.remove(b[a])}return this},toArray:function(){var a=new Array();for(var b in this._ids){if(null!=this._ids[b]){a.push(this._ids[b])}}return a},execute:function(c){if(null==c||"function"!=typeof(c)){throw _gwmCore.Resources.nullOrInvalidArg}if(this.count>0){var b=this.toArray();for(var a=0;a<b.length;a++){c(b[a])}}return this},item:function(d){if(null==d){return null}else{var b=null;var c=null;var a=true;if("object"==typeof(d)){b=this._pks;c=d.serialize()}else{if(d.indexOf(_gwmCore.PrimaryKeyFormat.valueDelimiter)!=-1){b=this._pks;c=new PrimaryKey().deserialize(d).serialize()}else{b=this._ids;c=d;a=false}}var e=b[c];if(null==e&&null!=this.parent&&null!=this.parent.g&&this._create){e=new Feature(this.parent.g.getFeatureElements(d),(a?d:null),null,null);this.add(e)}return e}},add:function(a){if(null==a){throw _gwmCore.Resources.nullOrInvalidArg}else{if((null!=a.primaryKey&&null!=this._pks[a.primaryKey.serialize()])||(null!=a.id&&null!=this._ids[a.id])){throw _gwmCore.Resources.duplicateItem}if(!this._detached&&null!=a.parent&&null!=a.legendEntry){throw _gwmCore.Resources.featureHasParent}if(null!=a.primaryKey){this._pks[a.primaryKey.serialize()]=a}if(null!=a.id){this._ids[a.id]=a}if(!this._detached){a.parent=this;a.legendEntry=this.parent}this.count++;return a}},remove:function(b){if(null==b){return null}var a=null;if("object"==typeof(b)){if(null!=b.elements){a=b}else{a=this._pks[b.serialize()]}}else{if(b.indexOf(_gwmCore.PrimaryKeyFormat.valueDelimiter)!=-1){a=this._pks[new PrimaryKey().deserialize(b).serialize()]}else{a=this._ids[b]}}if(null!=a){if(null!=a.id){this._ids[a.id]=null}if(null!=a.primaryKey){this._pks[a.primaryKey.serialize()]=null}if(!this._detached){a.parent=null;a.legendEntry=null}this.count--}return a}};SelectSet=function(){this.features=new Features(this,false,true)};SelectSet.prototype={toString:function(){return this.features.toString()},toArray:function(){return this.features.toArray()},execute:function(a){this.features.execute(a);return this},item:function(a){return this.features.item(a)},add:function(a){return this.features.add(a)},remove:function(a){return this.features.remove(a)},clear:function(){var a=this.features.toArray();for(var b=0;b<a.length;b++){a[b].unselect()}this.features.clear();return this}};function _gwmFindFeatureElementInGroup(pk){if(null==pk){throw _gwmCore.Resources.nullOrInvalidArg}if(null==this.le){throw _gwmCore.Resources.noLegendEntry}if(null==this.le.pkFields){throw _gwmCore.Resources.noPrimaryKey}var fields=this.le.pkFields;var children=this.childNodes;var len=children.length;var child=null;for(var i=0;i<len;i++){child=children.item(i);if(1==child.nodeType){var values=eval(_gwmCore.getEleAttributeGWM(child,"gmwmsvg:pk",false));var temppk=new PrimaryKey(fields,values);if(pk.equals(temppk)){return child}}}return null}function _gwmGetFeatureElements(g){var l=null;var m=null;if("object"==typeof(g)){l=this.findFeatureElement(g)}else{if(g.indexOf(_gwmCore.PrimaryKeyFormat.valueDelimiter)!=-1){l=this.findFeatureElement(new PrimaryKey().deserialize(g))}else{l=this.ownerDocument.getElementById(g+"."+0);m=g}}if(null!=l){if(null==m){var b=l.getAttribute("id");m=b.split(".")[0]}var a=new Array();var h=0,f=0,k=0,d=0;var c=null;b=(null!=l.parentNode)?l.parentNode.getAttribute("id"):"";if(b.indexOf(".")>0&&b.split(".")[0]==m){c=l.parentNode;a[h++]=c;for(var d=c.childNodes.length-1;d>=0&&c.childNodes.item(d).nodeType!=1;d--){}b=c.childNodes.item(d).getAttribute("id");f=parseInt(b.split(".")[1])+1}else{a[h++]=l;f++}l=this.ownerDocument.getElementById(m+"."+f);while(null!=l){b=(null!=l.parentNode)?l.parentNode.getAttribute("id"):"";if(b.indexOf(".")>0&&b.split(".")[0]==m){c=l.parentNode;a[h++]=c;for(var d=c.childNodes.length-1;d>=0&&c.childNodes.item(d).nodeType!=1;d--){}f=parseInt(c.childNodes.item(d).getAttribute("id").split(".")[1])+1}else{a[h++]=l;f++}l=this.ownerDocument.getElementById(m+"."+f)}return new FeatureElements(a)}};
//END IngrPL.WebClient.Core.Platform.MapLayers.SVG.LegendObjects.js
//START IngrPL.WebClient.Core.Platform.MapLayers.SVG.BasicFunctions.js
function _gwmInitMOZObject(){this.initGWMSVG=initializeGWMSVG}var _gwmInitMOZ=new _gwmInitMOZObject();function _gwmBasicFunctionsObject(){this.applyPrecision=_gwmApplyPrecision;this.attachActiveCursor=_gwmAttachActiveCursor;this.calcDistance=_gwmCalcDistance;this.clearCircle=_gwmClearCircle;this.clearPath=_gwmClearPath;this.clearPoint=_gwmClearPoint;this.clearRectangle=_gwmClearRectangle;this.clearMultiple=_gwmClearMultiple;this.cmdCaptureDone=_gwmCmdCaptureDone;this.cmdCaptureInit=_gwmCmdCaptureInit;this.cmdCaptureInterrupt=_gwmCmdCaptureInterrupt;this.cmdCaptureReset=_gwmCmdCaptureReset;this.cmdViewNavDone=_gwmCmdViewNavDone;this.cmdViewNavInit=_gwmCmdViewNavInit;this.cmdPanInit=_gwmCmdPanInit;this.cmdPanDone=_gwmCmdPanDone;this.drawCircle=_gwmDrawCircle;this.drawPath=_gwmDrawPath;this.drawPoint=_gwmDrawPoint;this.drawRectangle=_gwmDrawRectangle;this.drawText=_gwmDrawText;this.getDynamicLineStyle=_gwmGetDynLineStyle;this.getDynamicShapeStyle=_gwmGetDynShapeStyle;this.getEleChild=_gwmGetEleChild;this.getEleLayer=_gwmGetEleLayer;this.getEleLegendEntry=_gwmGetEleLegendEntry;this.getEleBBox=_gwmGetEleBBox;this.getMetadata=_gwmGetMetadataImp;this.getPntViewCtrlPixDim=_gwmGetPntViewCtrlPixDim;this.getSVGPntViewCtrlPixDim=_gwmGetSVGPntViewCtrlPixDim;this.getTextEleText=_gwmGetTextEleText;this.getViewRange=_gwmGetViewRange;this.initMeasure=_gwmInitMeasure;this.initGWMSVG=initializeGWMSVG;this.isValidFunction=_gwmIsValidFunction;this.isNull=_gwmIsNull;this.getNewLegendEntryName=_gwmGetNewLegendEntryName;this.getUnusedElementName=_gwmGetUnusedElementName;this.findStub=_gwmFindStub;this.moveObject=_gwmMoveObject;this.resetProperty=_gwmResetBASProperty;this.replaceNLMarker=_gwmReplaceNLMarker;this.setActiveCursor=_gwmSetActiveCursor;this.setCalloutTextPlacement=_gwmSetCalloutTextPlacement;this.setDrawingState=_gwmSetDrawingState;this.setDynamicLineStyle=_gwmSetDynLineStyle;this.setDynamicShapeStyle=_gwmSetDynShapeStyle;this.setGlobalCoordArray=_gwmSetGlobalCoordArray;this.setGlobalCoordlist=_gwmSetGlobalCoordlist;this.shiftViewProcess=_gwmShiftViewProcess;this.transGlobalPnts=_gwmTransGlobalPnts;this.transGlobalPntsMeasureToViewer=_gwmTransGlobalPntsMeasureToViewer;this.transGlobalPntsReadoutToViewer=_gwmTransGlobalPntsReadoutToViewer;this.transGlobalPntsStorageToViewer=_gwmTransGlobalPntsStorageToViewer;this.transGlobalPntsToViewer=_gwmTransGlobalPntsToViewer;this.transGlobalPntsViewerToMeasure=_gwmTransGlobalPntsViewerToMeasure;this.transGlobalPntsViewerToReadout=_gwmTransGlobalPntsViewerToReadout;this.transGlobalPntsViewerToStorage=_gwmTransGlobalPntsViewerToStorage;this.transXCoordFromViewer=_gwmTransXCoordFromViewer;this.transXCoordMeasureToViewer=_gwmTransXCoordMeasureToViewer;this.transXCoordReadoutToViewer=_gwmTransXCoordReadoutToViewer;this.transXCoordStorageToViewer=_gwmTransXCoordStorageToViewer;this.transXCoordToViewer=_gwmTransXCoordToViewer;this.transXCoordViewerToMeasure=_gwmTransXCoordViewerToMeasure;this.transXCoordViewerToReadout=_gwmTransXCoordViewerToReadout;this.transXCoordViewerToStorage=_gwmTransXCoordViewerToStorage;this.transYCoordFromViewer=_gwmTransYCoordFromViewer;this.transYCoordMeasureToViewer=_gwmTransYCoordMeasureToViewer;this.transYCoordReadoutToViewer=_gwmTransYCoordReadoutToViewer;this.transYCoordStorageToViewer=_gwmTransYCoordStorageToViewer;this.transYCoordToViewer=_gwmTransYCoordToViewer;this.transYCoordViewerToMeasure=_gwmTransYCoordViewerToMeasure;this.transYCoordViewerToReadout=_gwmTransYCoordViewerToReadout;this.transYCoordViewerToStorage=_gwmTransYCoordViewerToStorage;this.viewCtrl=null;this.bIsMOZ=false;this.captureCallback=_gwmCmdCaptureCB;this.panCallback=_gwmCmdPanCB;this.evtHandlerGeomCancel=null;this.evtHandlerClick=null;this.evtHandlerSVGScroll=null;this.evtHandlerSVGZoom=null;this.bApplyCoordPrecision=true;this.sListSeparator="|";this.iCoordPrecision=8;this.iCoordUnits=0;this.bAutoRep=false;this.sUserInfo="";this.bNavKeys=false;this.bARConstraint=false;this.bARCUsed=false;this.sCoordList="";this.ptArray=new Array();this.sCmdCaptureCoordList="";this.ptMapCenter=null;this.mtxHolder=null;this.fStorageOffsetX=0;this.fStorageOffsetY=0;this.fReadoutOffsetX=0;this.fReadoutOffsetY=0;this.fStorageToReadoutScaleX=0;this.fStorageToReadoutScaleY=0;this.fStorageToDistanceScale=1;this.fDisplayToStorageScale=0;this.fRotation=0;this.sReadoutUnit="m";this.sDistanceUnit="m";this.sEleDrawPoint="";this.sEleDrawLine="";this.sEleDrawPolyline="";this.sEleDrawPolygon="";this.sEleDrawRect="";this.sEleDrawCircle="";this.sEleDrawText="";this.sEleDrawCallout="";this.sEleDrawCalloutLine="";this.sEleDrawTextKeyin="";this.sEleDrawTextKeyinT="";this.sEleDrawTextKeyinR="";this.sDrawText="";this.activeCursorEle=null;this.activeCursorTrans="";this.sNewlineMarker="GWMNL";this.bUseNLMarker=false;this.CALLOUTTEXTOFFSET=6.5;this.ptARRectArray=null;this.fARRectDx=0;this.fARRectDy=0;this.sDynTxtAnchor="left";this.sDynTxtAlign="middle";this.fDynTxtLocPntX=0;this.fDynTxtLocPntY=0;this.dynTxtAnchorPt=null;this.iDynTxtW=0;this.iDynTxtH=0;this.iDynTxtNumLines=0;this.iDynTxtHgtPerLine=0;this.iDynTxtStrokeW=0;this.fDynTxtOffsetRefPntX=0;this.fDynTxtOffsetRefPntY=0;this.sDynTxtVectorDirX="";this.sDynTxtVectorDirY="";this.fDynTxtVectorSlope=0;this.NLREPATTERN=String.fromCharCode(13,10)+"|"+String.fromCharCode(10,13);this.NL=String.fromCharCode(13,10);this.ELEID_DRAWPOINT="gwmdynpoint";this.ELEID_DRAWLINE="gwmdynline";this.ELEID_DRAWPOLYLINE="gwmdynpolyline";this.ELEID_DRAWPOLYGON="gwmdynpolygon";this.ELEID_DRAWRECT="gwmdynrect";this.ELEID_DRAWCIRCLE="gwmdyncircle";this.ELEID_DRAWTEXT="gwmdyntext";this.ELEID_CURSCROSSHAIR="gwmcursorcrosshair";this.ELEID_CURSPANARRW="gwmcursorpanarrows";this.COORDUNIT_READOUT=0;this.COORDUNIT_STORAGE=1;this.COORDUNIT_MEASURE=2;this.COORDUNIT_VIEWER=100;this.DEF_NEWLINEMARKER="GWMNL";this.DBGTEXT=""}var _gwmBas=new _gwmBasicFunctionsObject();function _gwmGetNewLegendEntryName(b){if(_gwmCore.Legend.displayEntries.item(b)||_gwmCore.Legend.groupEntries.item(b)||_gwmCore.$(b)){for(var a=1;_gwmCore.Legend.displayEntries.item(b+String(a))||_gwmCore.Legend.groupEntries.item(b+String(a))||_gwmCore.$(b+String(a));a++){}return b+String(a)}else{return b}}function _gwmGetUnusedElementName(b){if(_gwmCore.$(b)){for(var a=1;_gwmCore.$(b+String(a));a++){}return b+String(a)}else{return b}}function _gwmPoint(){this.x=0;this.y=0}function initializeGWMSVG(c,b,f,g){if(null==c||c==""){return _gwm_E_PARAMNULL}try{_gwmCore.iViewCtrlWidth=c.offsetWidth;_gwmCore.iViewCtrlHeight=c.offsetHeight}catch(d){return _gwm_E_UNKNOWN}_gwmBas.viewCtrl=c;if(undefined==g||null==g){_gwmBas.bIsMOZ=false}else{_gwmBas.bIsMOZ=g}try{if(null==_gwmCore.svgDoc){var a=_gwmCore.init(c.getSVGDocument());if(a<0){return a}}if(null==_gwmCore.svgRoot.getAttributeNS(null,"onclick")||""==_gwmCore.svgRoot.getAttributeNS(null,"onclick")){_gwmCore.svgRoot.setAttributeNS(null,"onclick","_gwmMouseClick(evt);")}if(null==_gwmCore.svgRoot.getAttributeNS(null,"onmouseover")||""==_gwmCore.svgRoot.getAttributeNS(null,"onmouseover")){_gwmCore.svgRoot.setAttributeNS(null,"onmouseover","_gwmMouseOver(evt);")}if(null==_gwmCore.svgRoot.getAttributeNS(null,"onmouseout")||""==_gwmCore.svgRoot.getAttributeNS(null,"onmouseout")){_gwmCore.svgRoot.setAttributeNS(null,"onmouseout","_gwmMouseOut(evt);")}if(null==_gwmCore.svgRoot.getAttributeNS(null,"onmousemove")||""==_gwmCore.svgRoot.getAttributeNS(null,"onmousemove")){_gwmCore.svgRoot.setAttributeNS(null,"onmousemove","_gwmMouseMove(evt);")}if(null==_gwmCore.svgRoot.getAttributeNS(null,"onmousedown")||""==_gwmCore.svgRoot.getAttributeNS(null,"onmousedown")){_gwmCore.svgRoot.setAttributeNS(null,"onmousedown","_gwmMouseDown(evt);")}if(null==_gwmCore.svgRoot.getAttributeNS(null,"onmouseup")||""==_gwmCore.svgRoot.getAttributeNS(null,"onmouseup")){_gwmCore.svgRoot.setAttributeNS(null,"onmouseup","_gwmMouseUp(evt);")}_gwmCore.svgRoot.addEventListener("SVGScroll",_gwmOnSVGScroll,false);_gwmCore.svgRoot.addEventListener("SVGZoom",_gwmOnSVGZoom,false)}catch(d){return _gwm_E_UNKNOWN}_gwmInitMeasure();if(b){_gwmAPI.initAPI(_gwmBas.viewCtrl)}if(f){_gwmRL.initAPI(_gwmBas.viewCtrl)}if(_gwmBas.bIsMOZ){return _gwmBas.viewCtrl}else{return _gwm_E_SUCCESS}}function _gwmInitMeasure(){var a="";try{var c=_gwmCore.svgDoc.getElementsByTagNameNS("http://www.intergraph.com/GeoMedia/wmsvg","metadata");var b=c.item(0);if(null==b||""==b||undefined==b){return _gwm_E_UNSPECIFIED}_gwmBas.fStorageOffsetX=parseFloat(b.getAttributeNS("http://www.intergraph.com/GeoMedia/wmsvg","storageoffsetx"));_gwmBas.fStorageOffsetY=parseFloat(b.getAttributeNS("http://www.intergraph.com/GeoMedia/wmsvg","storageoffsety"));_gwmBas.fStorageToReadoutScaleX=parseFloat(b.getAttributeNS("http://www.intergraph.com/GeoMedia/wmsvg","storagetoreadoutscale"));_gwmBas.fStorageToReadoutScaleY=_gwmBas.fStorageToReadoutScaleX;_gwmBas.fReadoutOffsetX=parseFloat(b.getAttributeNS("http://www.intergraph.com/GeoMedia/wmsvg","readoutoffsetx"));_gwmBas.fReadoutOffsetY=parseFloat(b.getAttributeNS("http://www.intergraph.com/GeoMedia/wmsvg","readoutoffsety"));_gwmBas.fStorageToDistanceScale=parseFloat(b.getAttributeNS("http://www.intergraph.com/GeoMedia/wmsvg","storagetodistancescale"));_gwmBas.fDisplayToStorageScale=parseFloat(b.getAttributeNS("http://www.intergraph.com/GeoMedia/wmsvg","displaytostoragescale"));_gwmBas.sDistanceUnit=b.getAttributeNS("http://www.intergraph.com/GeoMedia/wmsvg","distanceunit");_gwmBas.sReadoutUnit=b.getAttributeNS("http://www.intergraph.com/GeoMedia/wmsvg","readoutunit");a=b.getAttributeNS("http://www.intergraph.com/GeoMedia/wmsvg","rotationangle");if(null!=a&&a!=""){_gwmBas.fRotation=parseFloat(a);_gwmSetMapCenterPnt()}}catch(b){return _gwm_E_UNKNOWN}}function _gwmGetEleLegendEntry(b){var a=_gwmGetEleLayer(b);if(null!=a&&("gwmselected"==a.getAttribute("id")||"gwmhighlighted"==a.getAttribute("id"))){var d=String(b.getAttribute("id"));d=d.replace("selected$","").replace("highlighted$","");var c=_gwmCore.$(d);a=_gwmGetEleLayer(c)}return((null==a)||(null==a.le))?null:a.le}function _gwmGetEleLayer(c){try{if(c==null||c==""){return null}var d=c;if(d.correspondingUseElement>""){d=d.correspondingUseElement}var a=d.parentNode;while(a&&a.getAttribute("id")!="gwmroot"&&_gwmCore.getEleAttributeGWM(a,"gmwmsvg:typ",false)!="l"){a=a.parentNode}if(a&&a.getAttribute("id")=="gwmroot"){return null}return a}catch(b){return null}}function _gwmFindStub(d,a){for(var c=0;c<d.length;c++){if(d[c].name==a){return d[c]}if(d[c].members){var b=_gwmFindStub(d[c].members,a);if(b){return b}}}return null}function _gwmGetTextEleText(d){if(!d){return""}if(!d.hasChildNodes()){return""}if(d.firstChild.nodeType!=3){return""}var b=d.childNodes;var e=null;var c="";for(var a=0;a<b.length;++a){e=b.item(a);if(e.nodeName=="tspan"){if(!_gwmBas.bUseNLMarker){c=c+_gwmBas.NL}else{c=c+_gwmBas.sNewlineMarker}c=c+e.firstChild.nodeValue}else{c=c+e.nodeValue}}return c}function _gwmGetTextEleNumLines(d){if(!d){return _gwm_E_GETELEMENT}var c=0;if(d.hasChildNodes()&&d.firstChild.nodeType==3){++c;var b=d.childNodes;var e=null;for(var a=0;a<b.length;++a){e=b.item(a);if(e.nodeName=="tspan"){++c}}}return c}function _gwmGetEleChild(e,b,d){if(!e){return null}var c=e.childNodes;var f=null;for(var a=0;a<c.length;++a){f=c.item(a);if(f.nodeType==b&&f.getAttribute("id")==d){return f}}return null}function _gwmGetEleBBox(p){var l=null;try{if(_gwmBas.isNull(p)){return _gwm_E_PARAMNULL}var a=0;var q=0;var f=1;var b=1;var c=p.getCTM();var g=p.getAttribute("transform");l=p.getBBox();a=c.e;q=c.f;f=c.a;b=c.d;if(_gwmBas.bIsMOZ){if(!(_gwmBas.isNull(g))){var o=_gwmCore.getTransSVGXY(a,q);a=o.x;q=o.y;var m=_gwmCore.getSVGTransMatrix();var n=m.a;f*=n;b*=n}else{a=0;q=0;f=1;b=1}}if(p.nodeName=="use"){var d=p.getAttributeNS("http://www.w3.org/1999/xlink","href");if(!(_gwmBas.isNull(d))){d=_gwmCore.svgDoc.getElementById(d.substr(1))}if(!(_gwmBas.isNull(d))){l=d.getBBox()}}else{if(l.x==0&&l.y==0&&l.width==0&&l.height==0){if(p.nodeName=="circle"||p.nodeName=="ellipse"){var k=parseInt(p.getAttribute("cx"));var j=parseInt(p.getAttribute("cy"))}else{var k=parseInt(p.getAttribute("x"));var j=parseInt(p.getAttribute("y"))}if(!(isNaN(a))&&!(isNaN(q))&&!(_gwmBas.isNull(g))){a=k;q=j}}}l.x+=a;l.y+=q;if(!isNaN(f)){l.width*=f}if(!isNaN(b)){l.height*=b}}catch(h){return null}return l}function _gwmCmdCaptureCB(){return _gwm_E_SUCCESS}function _gwmCmdPanCB(){return _gwm_E_SUCCESS}function _gwmCmdCaptureInit(c,a,b){_gwmSetDrawingState(false);_gwmBasME.iListenerState=c;_gwmBasME.onCompletionHandler=_gwmCmdCaptureDone;_gwmBasME.onInterruptHandler=_gwmCmdCaptureInterrupt;_gwmBas.captureCallback=a;_gwmBas.sUserInfo=b;_gwmBas.sCoordList="";_gwmBas.ptArray=null;_gwmBas.ptArray=new Array();_gwmBas.sEleDrawLine=_gwmBas.ELEID_DRAWLINE;_gwmBas.sEleDrawPolyline=_gwmBas.ELEID_DRAWPOLYLINE;_gwmBas.sEleDrawPolygon=_gwmBas.ELEID_DRAWPOLYGON;_gwmBas.sEleDrawRect=_gwmBas.ELEID_DRAWRECT;_gwmBas.sEleDrawCircle=_gwmBas.ELEID_DRAWCIRCLE;_gwmSetDrawingState(true)}function _gwmCmdCaptureDone(){var b=false;if(_gwmBas.bARCUsed==true){_gwmBas.bARCUsed=false;_gwmCalcARRect(null,null,true);_gwmBas.ptArray=_gwmBas.ptARRectArray}_gwmTransGlobalPnts(true);_gwmSetGlobalCoordlist();if(_gwmIsValidFunction(_gwmBas.captureCallback)){var a=_gwmBas.sCoordList;var c=_gwmBas.sUserInfo;b=true}_gwmCmdCaptureReset(false);if(b){_gwmBas.captureCallback(a,c)}return}function _gwmCmdCaptureInterrupt(){_gwmCmdCaptureReset(true);if(_gwmIsValidFunction(_gwmBas.evtHandlerGeomCancel)){_gwmBas.evtHandlerGeomCancel(_gwmBas.sUserInfo)}}function _gwmCmdCaptureReset(a){_gwmSetDrawingState(false);if(a||!_gwmBas.bAutoRep){_gwmBasME.iListenerState=_gwmBasME.IDLE}else{if(_gwmBas.bAutoRep){_gwmSetDrawingState(true)}}_gwmBas.ptArray=null;_gwmBas.ptArray=new Array();_gwmBas.sCoordList="";_gwmBas.bARCUsed=false}function _gwmCmdViewNavInterrupt(){_gwmBasME.iListenerState=_gwmBasME.IDLE}function _gwmCmdPanInit(a,b){_gwmBasME.onCompletionHandler=_gwmCmdPanDone;_gwmBas.panCallback=a;_gwmBas.sUserInfo=b;_gwmBas.bApplyCoordPrecision=false;_gwmBas.sCoordList="";_gwmBas.ptArray=null;_gwmBas.ptArray=new Array();_gwmBasME.onInterruptHandler=_gwmCmdPanInterupt;_gwmSetActiveCursor("gwmcursorcrosshair",true);_gwmBasME.iListenerState=_gwmBasME.PANREADY}function _gwmCmdPanDone(){if(!(_gwmBas.bAutoRep)){_gwmCmdPanReset(false)}if(_gwmIsValidFunction(_gwmBas.panCallback)){_gwmTransGlobalPnts(true);_gwmBas.bApplyCoordPrecision=true;_gwmSetGlobalCoordlist();_gwmBas.panCallback(_gwmBas.sCoordList,_gwmBas.sUserInfo)}if(_gwmBas.bAutoRep){_gwmBas.sCoordList="";_gwmBas.ptArray=null;_gwmBas.ptArray=new Array();_gwmBasME.iListenerState=_gwmBasME.PANREADY}return}function _gwmCmdPanInterupt(){_gwmCmdPanReset(true)}function _gwmCmdPanReset(a){_gwmBasME.iListenerState=_gwmBasME.IDLE;_gwmSetActiveCursor("",false);_gwmBasME.onCompletionHandler=null;_gwmBasME.onInterruptHandler=null;_gwmBas.activeCursorTrans="";if(a){_gwmBas.panCallback=null;_gwmBas.sUserInfo=""}return}function _gwmCmdViewNavInit(b,c,a){_gwmBasME.iListenerState=b;_gwmBasME.onCompletionHandler=_gwmCmdViewNavDone;_gwmBas.captureCallback=c;_gwmBas.sUserInfo=a;_gwmBasME.onInterruptHandler=_gwmCmdViewNavInterrupt}function _gwmCmdViewNavDone(d){var e=true;var c=d;var g=false;var b=_gwmBasME.iListenerState;if(b==_gwmBasME.IDLE){return}if(b==_gwmBasME.GETELEMENT||b==_gwmBasME.GETSELECTEDFEATURE||b==_gwmBasME.GETLOCATABLEFEATURE){if(null!=d&&""!=d){if(b==_gwmBasME.GETSELECTEDFEATURE||b==_gwmBasME.GETLOCATABLEFEATURE){var a=_gwmCore.getFeature(d);if(null!=a){c=a;if((b==_gwmBasME.GETSELECTEDFEATURE&&a.isSelected())||(b==_gwmBasME.GETLOCATABLEFEATURE&&a.legendEntry.isLocatable())){g=true}}}else{g=true}if(g){if(_gwmIsValidFunction(_gwmBas.captureCallback)){_gwmBas.captureCallback(c,_gwmBas.sUserInfo)}}else{e=false}}}if(!(_gwmBas.bAutoRep)&&e){_gwmBasME.iListenerState=_gwmBasME.IDLE}return}function _gwmShiftViewProcess(g){try{var n=g.split(_gwmBas.sListSeparator);var b=n[1];var o=n[2];var a=n[3];var m=n[4];var c=_gwmBas.getViewRange();n=c.split(_gwmBas.sListSeparator);var p=n[0];var j=n[1];var l=n[2];var h=n[3];var f=((a-b)/(l-p));var d=(-(m-o)/(h-j));_gwmShiftView(f,d);return _gwm_E_SUCCESS}catch(k){return _gwm_E_UNKNOWN}}function _gwmShiftView(f,c){try{if(_gwmIsNull(f)||_gwmIsNull(c)){return _gwm_E_PARAMNULL}var b=_gwmCore.svgRoot;var g=_gwmBas.getPntViewCtrlPixDim();var d=g.x*f;var a=g.y*c;b.currentTranslate.x+=d;b.currentTranslate.y-=a;return _gwm_E_SUCCESS}catch(h){return _gwm_E_UNKNOWN}}function _gwmMoveObject(f,b,a){try{var c=document.getElementById(a);if(!c){return}if(b){c.setAttribute("transform","translate("+f.x+","+f.y+")")}else{c.setAttribute("x",f.x);c.setAttribute("y",f.y)}}catch(d){return}return}function _gwmGetViewRange(g){try{var b,a,l,j;var k=_gwmCore.svgRoot;var n=_gwmBas.getSVGPntViewCtrlPixDim();var m=_gwmCore.getSVGTransMatrix();var d=k.createSVGPoint();var c=k.createSVGPoint();c=n.matrixTransform(m);n.x=0;n.y=0;d=n.matrixTransform(m);if(g==undefined){b=_gwmBas.applyPrecision(_gwmBas.transXCoordFromViewer(d.x,_gwmBas.iCoordUnits));l=_gwmBas.applyPrecision(_gwmBas.transYCoordFromViewer(d.y,_gwmBas.iCoordUnits));a=_gwmBas.applyPrecision(_gwmBas.transXCoordFromViewer(c.x,_gwmBas.iCoordUnits));j=_gwmBas.applyPrecision(_gwmBas.transYCoordFromViewer(c.y,_gwmBas.iCoordUnits))}else{b=d.x;l=d.y;a=c.x;j=c.y}var h=_gwmGetListSeparator();return b+h+l+h+a+h+j}catch(f){return _gwm_E_UNKNOWN}}function _gwmApplyPrecision(b){var d=String(b);var e="";var a="";if(_gwmBas.iCoordPrecision==0){d=String(parseInt(b))}else{if(_gwmBas.iCoordPrecision>0){if(d.indexOf(".")==-1){return d}a=d.substring(d.indexOf(".")+1,d.length);e=d.substring(0,d.indexOf("."));numdeci=a.length;if(numdeci>_gwmBas.iCoordPrecision){a=a.substr(0,_gwmBas.iCoordPrecision)}else{for(var c=0;c<(_gwmBas.iCoordPrecision-numdeci);c++){a+="0"}}d=e+"."+a}}return d}function _gwmSetGlobalCoordlist(){var h=_gwmBas.ptArray;if(h.length<1){return}var a=null;var c="";var j=_gwmBas.sListSeparator;var f="";var e="";var b="";var g="";for(var d=0;d<h.length;++d){a=h[d];if(_gwmBas.bApplyCoordPrecision){f=_gwmApplyPrecision(a.x);e=_gwmApplyPrecision(a.y)}else{f=a.x;e=a.y}if(c!=""){c=c+j+f+j+e}else{c=f+j+e;b=f;g=e}}if(_gwmBasME.iListenerState!=_gwmBasME.POLYGONMODE){c=h.length+j+c}else{c=(h.length+1)+j+c;c=c+j+b+j+g}_gwmBas.sCoordList=c;return}function _gwmSetGlobalCoordArray(h){if(h==""){return h}var a,d;var c,e;var g,f,b;var j=_gwmBas.sListSeparator;c=h;a=c.indexOf(j);d=parseInt(c.substring(0,a));if(d<1){return""}e=String(c);c=c.substring(a+1,e.length);_gwmBas.ptArray=null;_gwmBas.ptArray=new Array();for(i=0;i<d;++i){a=c.indexOf(j);g=parseFloat(c.substring(0,a));e=String(c);c=c.substring(a+1,e.length);a=c.indexOf(j);if(a!=-1){f=parseFloat(c.substring(0,a));e=String(c);c=c.substring(a+1,e.length)}else{e=String(c);f=parseFloat(c.substring(0,e.length));c=""}b=new _gwmPoint();b.x=g;b.y=f;_gwmBas.ptArray[i]=b}}function _gwmSetMapCenterPnt(){_gwmBas.ptMapCenter=null;_gwmBas.ptMapCenter=new _gwmPoint();_gwmBas.ptMapCenter.x=_gwmCore.iViewW/2;_gwmBas.ptMapCenter.y=_gwmCore.iViewH/2}function _gwmTransGlobalPntsStorageToViewer(){if(_gwmBas.ptArray.length<=0){return}var d=_gwmBas.ptArray;var c,b;for(var a=0;a<d.length;++a){c=d[a];b=new _gwmPoint();b.x=_gwmTransXCoordStorageToViewer(c.x);b.y=_gwmTransYCoordStorageToViewer(c.y);d[a]=b}_gwmBas.ptArray=d}function _gwmTransGlobalPntsMeasureToViewer(){if(_gwmBas.ptArray.length<=0){return}var d=_gwmBas.ptArray;var c,b;for(var a=0;a<d.length;++a){c=d[a];b=new _gwmPoint();b.x=_gwmTransXCoordMeasureToViewer(c.x);b.y=_gwmTransYCoordMeasureToViewer(c.y);d[a]=b}_gwmBas.ptArray=d}function _gwmTransGlobalPntsReadoutToViewer(){if(_gwmBas.ptArray.length<=0){return}var d=_gwmBas.ptArray;var c,b=null;for(var a=0;a<d.length;++a){c=d[a];b=new _gwmPoint();b.x=_gwmTransXCoordReadoutToViewer(c.x);b.y=_gwmTransYCoordReadoutToViewer(c.y);d[a]=b}_gwmBas.ptArray=d}function _gwmTransGlobalPntsToViewer(){if(_gwmBas.iCoordUnits==_gwmBas.COORDUNIT_READOUT){_gwmTransGlobalPntsReadoutToViewer()}else{if(_gwmBas.iCoordUnits==_gwmBas.COORDUNIT_STORAGE){_gwmTransGlobalPntsStorageToViewer()}else{if(_gwmBas.iCoordUnits==_gwmBas.COORDUNIT_MEASURE){_gwmTransGlobalPntsMeasureToViewer()}}}}function _gwmTransGlobalPntsUnRotate(){if(_gwmBas.fRotation==0||_gwmBas.ptMapCenter==null){return}if(_gwmBas.ptArray.length<=0){return}var f=_gwmBas.ptArray;var c,b;var h,e;var g=_gwmBas.ptMapCenter.x;var d=_gwmBas.ptMapCenter.y;if(_gwmBas.iCoordUnits==_gwmBas.COORDUNIT_READOUT){h=_gwmTransXCoordViewerToReadout(g);e=_gwmTransYCoordViewerToReadout(d)}else{if(_gwmBas.iCoordUnits==_gwmBas.COORDUNIT_STORAGE){h=_gwmTransXCoordViewerToStorage(g);e=_gwmTransYCoordViewerToStorage(d)}else{if(_gwmBas.iCoordUnits==_gwmBas.COORDUNIT_MEASURE){h=_gwmTransXCoordViewerToMeasure(g);e=_gwmTransYCoordViewerToMeasure(d)}else{h=g;e=d}}}for(var a=0;a<f.length;++a){c=f[a];b=new _gwmPoint();b.x=_gwmUnRotateCoord(h,e,c.x,c.y,true);b.y=_gwmUnRotateCoord(h,e,c.x,c.y,false);f[a]=b}_gwmBas.ptArray=f}function _gwmUnRotateCoord(g,f,d,c,h){var j=Math.sin(_gwmBas.fRotation*Math.PI/180);var b=Math.cos(_gwmBas.fRotation*Math.PI/180);var e=0;var k=d-g;var a=c-f;if(h){e=g+((d-g)*b)+((c-f)*j)}else{e=f-((d-g)*j)+((c-f)*b)}return(e)}function _gwmTransGlobalPntsViewerToStorage(){if(_gwmBas.ptArray.length<=0){return}var d=_gwmBas.ptArray;var c,b;for(var a=0;a<d.length;++a){c=d[a];b=new _gwmPoint();b.x=_gwmTransXCoordViewerToStorage(c.x);b.y=_gwmTransYCoordViewerToStorage(c.y);d[a]=b}_gwmBas.ptArray=d}function _gwmTransGlobalPntsViewerToMeasure(){if(_gwmBas.ptArray.length<=0){return}var d=_gwmBas.ptArray;var c,b;for(var a=0;a<d.length;++a){c=d[a];b=new _gwmPoint();b.x=_gwmTransXCoordViewerToMeasure(c.x);b.y=_gwmTransYCoordViewerToMeasure(c.y);d[a]=b}_gwmBas.ptArray=d}function _gwmTransGlobalPntsViewerToReadout(){if(_gwmBas.ptArray.length<=0){return}var d=_gwmBas.ptArray;var c,b;for(var a=0;a<d.length;++a){c=d[a];b=new _gwmPoint();b.x=_gwmTransXCoordViewerToReadout(c.x);b.y=_gwmTransYCoordViewerToReadout(c.y);d[a]=b}_gwmBas.ptArray=d}function _gwmTransGlobalPnts(a){if(_gwmBas.iCoordUnits==_gwmBas.COORDUNIT_READOUT){_gwmTransGlobalPntsViewerToReadout()}else{if(_gwmBas.iCoordUnits==_gwmBas.COORDUNIT_STORAGE){_gwmTransGlobalPntsViewerToStorage()}else{if(_gwmBas.iCoordUnits==_gwmBas.COORDUNIT_MEASURE){_gwmTransGlobalPntsViewerToMeasure()}}}if(a){_gwmTransGlobalPntsUnRotate()}}function _gwmTransXCoordViewerToReadout(b){var a=0;a=(((b/_gwmBas.fDisplayToStorageScale)+_gwmBas.fStorageOffsetX)*_gwmBas.fStorageToReadoutScaleX)+_gwmBas.fReadoutOffsetX;return a}function _gwmTransYCoordViewerToReadout(b){var a=0;a=((_gwmBas.fStorageOffsetY-(b/_gwmBas.fDisplayToStorageScale))*_gwmBas.fStorageToReadoutScaleY)+_gwmBas.fReadoutOffsetY;return a}function _gwmTransXCoordViewerToStorage(b){var a=0;a=(b/_gwmBas.fDisplayToStorageScale)+_gwmBas.fStorageOffsetX;return a}function _gwmTransYCoordViewerToStorage(b){var a=0;a=_gwmBas.fStorageOffsetY-(b/_gwmBas.fDisplayToStorageScale);return a}function _gwmTransXCoordViewerToMeasure(b){var a=0;a=((b/_gwmBas.fDisplayToStorageScale)+_gwmBas.fStorageOffsetX)*_gwmBas.fStorageToDistanceScale;return a}function _gwmTransYCoordViewerToMeasure(b){var a=0;a=(_gwmBas.fStorageOffsetY-(b/_gwmBas.fDisplayToStorageScale))*_gwmBas.fStorageToDistanceScale;return a}function _gwmTransXCoordMeasureToViewer(a){return(((a/_gwmBas.fStorageToDistanceScale)-_gwmBas.fStorageOffsetX)*_gwmBas.fDisplayToStorageScale)}function _gwmTransYCoordMeasureToViewer(a){return(-((a/_gwmBas.fStorageToDistanceScale)-_gwmBas.fStorageOffsetY)*_gwmBas.fDisplayToStorageScale)}function _gwmTransXCoordStorageToViewer(a){return((a-_gwmBas.fStorageOffsetX)*_gwmBas.fDisplayToStorageScale)}function _gwmTransYCoordStorageToViewer(a){return(-(a-_gwmBas.fStorageOffsetY)*_gwmBas.fDisplayToStorageScale)}function _gwmTransXCoordReadoutToViewer(b){var a=(((b-_gwmBas.fReadoutOffsetX)/_gwmBas.fStorageToReadoutScaleX)-_gwmBas.fStorageOffsetX)*_gwmBas.fDisplayToStorageScale;return a}function _gwmTransYCoordReadoutToViewer(b){var a=(-(((b-_gwmBas.fReadoutOffsetY)/_gwmBas.fStorageToReadoutScaleY)-_gwmBas.fStorageOffsetY)*_gwmBas.fDisplayToStorageScale);return a}function _gwmTransXCoordToViewer(a,b){switch(b){case _gwmBas.COORDUNIT_READOUT:return _gwmTransXCoordReadoutToViewer(a);break;case _gwmBas.COORDUNIT_STORAGE:return _gwmTransXCoordStorageToViewer(a);break;case _gwmBas.COORDUNIT_MEASURE:return _gwmTransXCoordMeasureToViewer(a);break}return a}function _gwmTransYCoordToViewer(b,a){switch(a){case _gwmBas.COORDUNIT_READOUT:return _gwmTransYCoordReadoutToViewer(b);break;case _gwmBas.COORDUNIT_STORAGE:return _gwmTransYCoordStorageToViewer(b);break;case _gwmBas.COORDUNIT_MEASURE:return _gwmTransYCoordMeasureToViewer(b);break}return b}function _gwmTransXCoordFromViewer(a,b){switch(b){case _gwmBas.COORDUNIT_READOUT:return _gwmTransXCoordViewerToReadout(a);break;case _gwmBas.COORDUNIT_STORAGE:return _gwmTransXCoordViewerToStorage(a);break;case _gwmBas.COORDUNIT_MEASURE:return _gwmTransXCoordViewerToMeasure(a);break}return a}function _gwmTransYCoordFromViewer(b,a){switch(a){case _gwmBas.COORDUNIT_READOUT:return _gwmTransYCoordViewerToReadout(b);break;case _gwmBas.COORDUNIT_STORAGE:return _gwmTransYCoordViewerToStorage(b);break;case _gwmBas.COORDUNIT_MEASURE:return _gwmTransYCoordViewerToMeasure(b);break}return b}function _gwmGetDynLineStyle(){if(!_gwmCore.svgDoc){return _gwm_E_GETELEMENT}var a=_gwmCore.svgDoc.getElementById(_gwmBas.ELEID_DRAWLINE);if(!a){return _gwm_E_GETELEMENT}return(a.getAttribute("style"))}function _gwmGetDynShapeStyle(){if(!_gwmCore.svgDoc){return _gwm_E_GETELEMENT}var a=_gwmCore.svgDoc.getElementById(_gwmBas.ELEID_DRAWRECT);if(!a){return _gwm_E_GETELEMENT}return(a.getAttribute("style"))}function _gwmSetDynLineStyle(c){var b=_gwmCore.svgDoc;var a=null;if(null==c||c==""){return _gwm_E_PARAMNULL}if(!b){return _gwm_E_GETELEMENT}a=b.getElementById(_gwmBas.ELEID_DRAWLINE);if(a){a.setAttribute("style",c)}a=b.getElementById(_gwmBas.ELEID_DRAWPOLYLINE);if(a){a.setAttribute("style",c)}return _gwm_E_SUCCESS}function _gwmSetDynShapeStyle(c){var b=_gwmCore.svgDoc;var a=null;if(null==c||c==""){return _gwm_E_PARAMNULL}if(!b){return _gwm_E_GETELEMENT}a=b.getElementById(_gwmBas.ELEID_DRAWPOLYGON);if(a){a.setAttribute("style",c)}a=b.getElementById(_gwmBas.ELEID_DRAWRECT);if(a){a.setAttribute("style",c)}a=b.getElementById(_gwmBas.ELEID_DRAWCIRCLE);if(a){a.setAttribute("style",c)}a=b.getElementById(_gwmBas.ELEID_DRAWTEXT);if(a){a.setAttribute("style",c)}return _gwm_E_SUCCESS}function _gwmAttachActiveCursor(b){if(null==_gwmBas.activeCursorEle){return}var a="translate("+b.x+" "+b.y+") "+_gwmBas.activeCursorTrans;_gwmBas.activeCursorEle.setAttribute("transform",a)}function _gwmSetActiveCursor(b,d){if(d&&b!=""){_gwmBas.activeCursorEle=_gwmCore.svgDoc.getElementById(b);if(_gwmBas.activeCursorEle){var c=_gwmCore.getSVGTransMatrix();var a=c.a;if(b==_gwmBas.ELEID_CURSCROSSHAIR){_gwmBas.activeCursorEle.style.setProperty("stroke-width",a,"")}else{if(b==_gwmBas.ELEID_CURSPANARRW){_gwmBas.activeCursorTrans="scale("+a/9+")";_gwmBas.activeCursorEle.setAttribute("transform",_gwmBas.activeCursorTrans)}}_gwmBas.activeCursorEle.style.setProperty("display","inline","")}}else{if(!d&&null!=_gwmBas.activeCursorEle){_gwmBas.activeCursorEle.style.setProperty("display","none","");_gwmBas.activeCursorEle=null}}}function _gwmSetDrawingState(b){var a=_gwmBasME.iListenerState;if(b){_gwmSetActiveCursor("gwmcursorcrosshair",true)}else{_gwmSetActiveCursor("",false);if(a==_gwmBasME.IDLE){return}if(a==_gwmBasME.LINEMODE){_gwmClearPath(_gwmBas.sEleDrawLine,null)}else{if(a==_gwmBasME.POLYLINEMODE){_gwmClearPath(_gwmBas.sEleDrawPolyline,null)}else{if(a==_gwmBasME.POLYGONMODE){_gwmClearPath(_gwmBas.sEleDrawPolygon,null)}else{if(a==_gwmBasME.RECTANGLEMODE){_gwmClearRectangle(_gwmBas.sEleDrawRect,null)}else{if(a==_gwmBasME.CIRCLEMODE){_gwmClearCircle(_gwmBas.sEleDrawCircle,null)}else{if(a==_gwmBasME.POINTMODE){_gwmClearPoint(_gwmBas.sEleDrawPoint,null)}else{if(a==_gwmBasME.TEXTMODE){_gwmClearMultiple(_gwmBas.sEleDrawText,null);_gwmBas.sDrawText=""}else{if(a==_gwmBasME.TEXTKEYINMODE||a==_gwmBasME.TEXTKEYINSTART||a==_gwmBasME.CALLOUTMODE){_gwmBas.sDrawText="";_gwmClearPath(_gwmBas.sEleDrawCalloutLine,null);_gwmClearMultiple(_gwmBas.sEleDrawText,null)}}}}}}}}}}function _gwmDrawRectangle(d,a,b,c){var f,e,j,g;var h=null;if(null!=d&&d!=""){h=_gwmCore.svgDoc.getElementById(d)}else{h=a}if(!h){return}if(c.x<b.x){f=c.x;j=b.x-f}else{f=b.x;j=c.x-f}if(c.y<b.y){e=c.y;g=b.y-e}else{e=b.y;g=c.y-e}if(_gwmBas.bARConstraint==true){_gwmBas.bARCUsed=true;_gwmCalcARRect(j,g,false);j=_gwmBas.ARRectDx;g=_gwmBas.ARRectDy}h.setAttribute("x",f);h.setAttribute("width",j);h.setAttribute("y",e);h.setAttribute("height",g);h.style.setProperty("display","inline","");return}function _gwmCalcARRect(k,h,b){var e=k;var d=h;var a=0;var j=0;var g=null;var f=null;if(null==e||null==d||b==true){g=_gwmCore.svgRoot.createSVGPoint();f=_gwmCore.svgRoot.createSVGPoint();g.x=_gwmBas.ptArray[0].x;g.y=_gwmBas.ptArray[0].y;f.x=_gwmBas.ptArray[1].x;f.y=_gwmBas.ptArray[1].y}if(null==e){if(f.x<g.x){e=g.x-f.x;a=f.x}else{e=f.x-g.x;a=g.x}}if(null==d){if(f.y<g.y){d=g.y-f.y;j=f.y}else{d=f.y-g.y;j=g.y}}_gwmBas.ARRectDx=e;_gwmBas.ARRectDy=d;var c=_gwmCore.iViewW/_gwmCore.iViewH;if((e/d)<c){_gwmBas.ARRectDx=d*c}else{_gwmBas.ARRectDy=e/c}if(b==true){g.x=a;g.y=j;f.x=a+_gwmBas.ARRectDx;f.y=j+_gwmBas.ARRectDy;_gwmBas.ptARRectArray=null;_gwmBas.ptARRectArray=new Array();_gwmBas.ptARRectArray[0]=g;_gwmBas.ptARRectArray[1]=f}}function _gwmClearRectangle(a,b){var c=null;if(null!=a&&a!=""){c=_gwmCore.svgDoc.getElementById(a)}else{c=b}if(!c){return}c.setAttribute("x",0);c.setAttribute("width",0);c.setAttribute("y",0);c.setAttribute("height",0);c.style.setProperty("display","none","")}function _gwmDrawPath(f,a,j,d,h){var b="";var k=null;var e=j.length;if(e<1){return}if(null!=f&&f!=""){k=_gwmCore.svgDoc.getElementById(f)}else{k=a}if(!k){return}for(var c=0;c<e;++c){if(c!=0){b=b+" L "+j[c].x+" "+j[c].y}else{b="M "+j[c].x+" "+j[c].y}}if(d!=null){var g=(d.x==j[e-1].x&&d.y==j[e-1].y);if(!g){b=b+" L "+d.x+" "+d.y}}if(h){b=b+" Z"}k.setAttribute("d",b);k.style.setProperty("display","inline","");return}function _gwmClearPath(a,b){var c=null;if(null!=a&&a!=""){c=_gwmCore.svgDoc.getElementById(a)}else{c=b}if(!c){return}c.setAttribute("d"," ");c.style.setProperty("display","none","")}function _gwmDrawCircle(b,d,a,f){var c;var e=null;if(null!=b&&b!=""){e=_gwmCore.svgDoc.getElementById(b)}else{e=d}if(!e){return}c=_gwmCalcDistance(a.x,a.y,f.x,f.y);e.setAttribute("cx",a.x);e.setAttribute("cy",a.y);e.setAttribute("r",c);e.style.setProperty("display","inline","");return}function _gwmClearCircle(a,b){var c=null;if(null!=a&&a!=""){c=_gwmCore.svgDoc.getElementById(a)}else{c=b}if(!c){return}c.setAttribute("cx",0);c.setAttribute("cy",0);c.setAttribute("r",0);c.style.setProperty("display","none","")}function _gwmDrawText(g,a,f,b){var e=null;var h=null;var k=null;var j=_gwmCore.svgDoc;if(null==b){return}if(null!=g&&g!=""){k=j.getElementById(g)}else{k=a}if(!k){return}k.setAttribute("x",String(f.x));k.setAttribute("y",String(f.y));re=new RegExp(_gwmBas.NLREPATTERN,"g");var c=b.split(re);e=j.createTextNode(c[0]);k.appendChild(e);for(var d=1;d<c.length;d++){h=_gwmCore.createTspan(c[d],k.getAttribute("x"),"1em");k.appendChild(h)}k.style.setProperty("display","inline","");return}function _gwmClearMultiple(a,b){var c=null;if(null!=a&&a!=""){c=_gwmCore.svgDoc.getElementById(a)}else{c=b}if(!c){return}while(c.hasChildNodes()){c.removeChild(c.firstChild)}c.setAttribute("x",0);c.setAttribute("y",0);c.style.setProperty("display","none","")}function _gwmDrawPoint(d,f,b){var a,j;var g=null;if(null!=d&&d!=""){g=_gwmCore.svgDoc.getElementById(d)}else{g=f}if(!g){return}a=b.x;j=b.y;var c=g.getAttribute("width");var e=g.getAttribute("height");if(c==""||null==c){c=0}else{c=parseInt(c)}if(e==""||null==e){e=0}else{e=parseInt(e)}a=a-(c/2);j=j-(e/2);g.setAttribute("x",a);g.setAttribute("y",j);g.style.setProperty("display","inline","");return}function _gwmClearPoint(a,b){var c=null;if(null!=a&&a!=""){c=_gwmCore.svgDoc.getElementById(a)}else{c=b}if(!c){return}c.setAttribute("x",0);c.setAttribute("y",0);c.style.setProperty("display","none","")}function _gwmSetCalloutTextPlacement(d,c,b){var a=0;if(!d||d==""||!c||!b){return _gwm_E_UNSPECIFIED}a=_gwmSetDynTextProps(d);if(a!=_gwm_E_SUCCESS){return a}a=_gwmSetCalloutTextPlacementParams(c,b);if(a!=_gwm_E_SUCCESS){return a}a=_gwmSetCalloutTextLocation();if(a!=_gwm_E_SUCCESS){return a}return _gwm_E_SUCCESS}function _gwmSetDynTextProps(f){var d=null;try{if(!_gwmCore.svgDoc){return _gwm_E_GETELEMENT}d=_gwmCore.svgDoc.getElementById(f);if(!d){return _gwm_E_GETELEMENT}}catch(c){return _gwm_E_UNKNOWN}_gwmBas.iDynTxtW=0;_gwmBas.iDynTxtH=0;_gwmBas.iDynTxtNumLines=0;_gwmBas.iDynTxtHgtPerLine=0;_gwmBas.iDynTxtStrokeW=0;var b=d.getBBox();if(b.width<0){b.width=0}if(b.height<0){b.height=0}_gwmBas.iDynTxtW=b.width;_gwmBas.iDynTxtH=b.height;var a=_gwmGetTextEleNumLines(d);if(a<1){a=1}_gwmBas.iDynTxtNumLines=a;_gwmBas.iDynTxtHgtPerLine=b.height/a;try{_gwmBas.iDynTxtStrokeW=parseInt(d.style.getPropertyValue("stroke-width"))}catch(c){_gwmBas.iDynTxtStrokeW=0}if(!_gwmBas.iDynTxtStrokeW){_gwmBas.iDynTxtStrokeW=0}return _gwm_E_SUCCESS}function _gwmSetCalloutTextPlacementParams(g,f){if(!g||!f){return _gwm_E_UNSPECIFIED}var a="middle";var e="left";var b="";var c="";var d=Math.atan2(f.x-g.x,g.y-f.y);if(d>0){if(d<0.395){e="bottom"}else{if(d>2.355){e="top"}else{e="left"}}}else{if(d<0){if(d>(-1*0.395)){e="bottom"}else{if(d<(-1*2.355)){e="top"}else{e="right"}}}else{if(d==0){e="bottom"}}}if(d==0||d==Math.PI){}else{if(d<Math.PI/2&&d>(-1*(Math.PI/2))){b="decrease"}else{b="increase"}}if(d<0){c="decrease"}else{if(d>0&&d<Math.PI){c="increase"}}_gwmBas.sDynTxtAnchor=e;_gwmBas.sDynTxtAlign=a;_gwmBas.sDynTxtVectorDirX=c;_gwmBas.sDynTxtVectorDirY=b;_gwmBas.fDynTxtVectorSlope=((g.y-f.y)/(f.x-g.x));_gwmBas.fDynTxtOffsetRefPntX=f.x;_gwmBas.fDynTxtOffsetRefPntY=f.y;return _gwm_E_SUCCESS}function _gwmSetCalloutTextLocation(){var f=_gwmBas.sDynTxtAnchor;var e=_gwmBas.sDynTxtVectorDirX;var d=_gwmBas.sDynTxtVectorDirY;var g=_gwmBas.fDynTxtVectorSlope;var c=_gwmBas.iDynTxtNumLines;var k=0;var a=0;var b=0;var h=0;var j=_gwmBas.CALLOUTTEXTOFFSET;if(f=="left"||f=="right"){j+=_gwmBas.iDynTxtStrokeW;a=j;b=c>1?-1*(((_gwmBas.iDynTxtHgtPerLine*(c-1))/2)):(_gwmBas.iDynTxtH/4);if(c>1&&Math.abs(g)>1){b/=(Math.abs(g))}h=_gwmBas.iDynTxtW/2;if(d!=""){k=Math.abs(a*g);if(d=="decrease"){k*=-1}}a+=h;k+=b;if(f=="right"){a*=-1}}else{if(f=="top"||f=="bottom"){if(f=="bottom"){b=c>1?((_gwmBas.iDynTxtH/c)*(c-1)):0;j+=(_gwmBas.iDynTxtStrokeW*c)}else{b=_gwmBas.iDynTxtHgtPerLine/2;j+=_gwmBas.iDynTxtStrokeW}k=j+b;if(e!=""){a=Math.abs(k/g);if(e=="decrease"){a*=-1}}if(f=="bottom"){k*=-1}}}_gwmBas.fDynTxtLocPntX=_gwmBas.fDynTxtOffsetRefPntX+a;_gwmBas.fDynTxtLocPntY=_gwmBas.fDynTxtOffsetRefPntY+k;_gwmBas.dynTxtAnchorPt=null;_gwmBas.dynTxtAnchorPt=new _gwmPoint();_gwmBas.dynTxtAnchorPt.x=_gwmBas.fDynTxtLocPntX;_gwmBas.dynTxtAnchorPt.y=_gwmBas.fDynTxtLocPntY;return _gwm_E_SUCCESS}function _gwmGetMetadataImp(a){try{var d=_gwmCore.svgDoc.getElementById("_GWMMetadata");return d.getAttribute(a)}catch(c){try{var d=_gwmCore.svgDoc.getElementsByTagNameNS("http://www.intergraph.com/GeoMedia/wmsvg","metadata");var c=d.item(0);return c.getAttributeNS("http://www.intergraph.com/GeoMedia/wmsvg",a)}catch(b){}}}function _gwmCalcDistance(e,g,d,f){var c=0;var b=0;var a=0;c=d-e;b=f-g;a=Math.sqrt(((c*c)+(b*b)));return a}function _gwmResetBASProperty(a){if(null!=a){a=a.toLowerCase()}if(null==a||""==a){_gwmBas.sNewlineMarker=_gwmBas.DEF_NEWLINEMARKER}else{if(a=="newlinemarker"){_gwmBas.sNewlineMarker=_gwmBas.DEF_NEWLINEMARKER}}return}function _gwmReplaceNLMarker(b){if(null==b||""==b||(b.indexOf(_gwmBas.sNewlineMarker)==-1)){return b}var d="";var a=b.split(_gwmBas.sNewlineMarker);for(var c=0;c<a.length;++c){d=d+a[c]+_gwmBas.NL}if(d==""){d=b}return d}function _gwmGetPntViewCtrlPixDim(){var a=new _gwmPoint();a.x=_gwmCore.iViewCtrlWidth;a.y=_gwmCore.iViewCtrlHeight;return a}function _gwmGetSVGPntViewCtrlPixDim(){var a=_gwmCore.svgRoot.createSVGPoint();a.x=_gwmCore.iViewCtrlWidth;a.y=_gwmCore.iViewCtrlHeight;return a}function _gwmTrimString(a){a=a.replace(/^ +/,"");a=a.replace(/$ +/,"");return a}function _gwmIsNull(a){if(null==a||(("string"==typeof(a))&&""==a)){return true}else{return false}}function _gwmIsValidFunction(a){if(null==a||""==a||undefined==a||"function"!=typeof(a)){return false}return true};
//END IngrPL.WebClient.Core.Platform.MapLayers.SVG.BasicFunctions.js
//START IngrPL.WebClient.Core.Platform.MapLayers.SVG.CoreFunctions.js
var _gwm_E_SUCCESS=0;var _gwm_E_UNSPECIFIED=-1;var _gwm_E_VIEWERMENU=-51;var _gwm_E_VIEWERMENUITEM=-52;var _gwm_E_GETELEMENT=-100;var _gwm_E_UNKNOWN=-101;var _gwm_E_GETLAYER=-102;var _gwm_E_PARAMNULL=-103;var _gwm_E_HANDLERNOTFUNCTION=-104;var _gwm_E_ELEATTR=-105;var _gwm_E_PARAMINVALID=-110;var _gwm_E_ELEIDINVALID=-111;var _gwm_E_NOREDLINES=-150;var _gwm_E_INTERNAL=-200;function _gwmCoreObject(){this.svgDoc=null;this.svgRoot=null;this.tooltipText=null;this.tooltipRect=null;this.tooltipGroup=null;this.tooltipFontSize=12;this.iViewH=0;this.iViewW=0;this.iViewCtrlWidth=0;this.iViewCtrlHeight=0;this.ns="gmwmsvg";this.xmlns='xmlns:gmwmsvg="http://www.intergraph.com/GeoMedia/wmsvg"';this.init=_gwmCoreInit;this.getSVGTransMatrix=_gwmGetSVGTransMatrix;this.getTransSVGPoint=_gwmGetTransSVGPoint;this.getTransSVGPointMtx=_gwmGetTransSVGPointMtx;this.getTransSVGXY=_gwmGetTransSVGXY;this.getEleAttributeGWM=_gwmGetEleAttributeGWM;this.createTspan=_gwmCreateTspan;this.getTooltip=_gwmGetEleTooltip;this.showTooltip=_gwmShowTooltip;this.clearTooltip=_gwmClearTooltip;this.getTooltipRectStyle=_gwmGetTtipRectStyle;this.getTooltipTextStyle=_gwmGetTtipTextStyle;this.setTooltipRectStyle=_gwmSetTtipRectStyle;this.setTooltipFontSize=_gwmSetTooltipFontSize;this.setTooltipTextStyle=_gwmSetTtipTextStyle;this.tooltipHandler=_gwmTooltipHandler;this.launchAction=_gwmLaunchAction;this.updateLogo=_gwmUpdateLogo;this.updateView=_gwmUpdateView;this.getEleZero=_gwmGetEleZero;this.$=_gwm$;this.decorateFeatureElement=_gwmDecorateFeatureElement;this.Legend=null;this.initDisplayEntries=_gwmInitDisplayEntries;this.initGroupEntries=_gwmInitGroupEntries;this.getPrimaryKey=_gwmGetPrimaryKey;this.getFeature=_gwmGetFeature;this.selectSet=new SelectSet();this.DisplayMode={on:1,off:2};this.Decorators=["-H-","-S-"];this.Resources={nullOrInvalidArg:"One or more of the arguments are null or invalid",indexOutOfRange:"Index out of range",noLegendEntry:"SVG group is missing corresponding legend entry",noPrimaryKey:"LegendEntry doesn't contain primary key information",duplicateItem:"An item already exists with this key, id, or index",invalidPKFormat:"The serialized string is not of the correct format",featureHasParent:"Cannot add a feature to multiple attached Features collections"};this.PrimaryKeyFormat={fieldDelimiter:"@@@",valueDelimiter:"~~~"}}function _gwmGetFeature(c){if(c.correspondingUseElement){c=c.correspondingUseElement}if(null==c||1!=c.nodeType){return null}var g=c.getAttribute("id");if(null!=g&&(g.indexOf("highlighted$")>-1||g.indexOf("selected$")>-1)){g=g.replace("highlighted$","").replace("selected$","");c=_gwmCore.$(g)}var d=_gwmCore.getEleZero(c);if(null!=d){var a=_gwmBas.getEleLegendEntry(d);if(null==a){throw _gwmCore.Resources.noLegendEntry}else{var e=d.getAttribute("id").split(".")[0];var b=a.features.item(e);return b}}else{return null}}function _gwmGetPrimaryKey(ele){var eleZero=_gwmCore.getEleZero(ele);var le=_gwmBas.getEleLegendEntry(ele);if(null==le){throw _gwmCore.Resources.noLegendEntry}else{if(null==le.pkFields){throw _gwmCore.Resources.noPrimaryKey}else{var pk=_gwmCore.getEleAttributeGWM(eleZero,"gmwmsvg:pk",false);if(null!=pk&&""!=pk){var values=eval(pk);return new PrimaryKey(le.pkFields,values)}else{throw _gwmCore.Resources.noPrimaryKey}}}}function _gwmOnSVGLoadEx(a){_gwmCore.svgDoc=a.target.ownerDocument;var b=_gwmCoreInit(null)}function _gwmOnSVGLoad(){var a=_gwmCoreInit(null);_gwmCore.Legend=new Legend();_gwmCore.Legend.displayEntries=_gwmInitDisplayEntries(_gwmCore.svgDoc,_GWMLegendDisplayOrder,_gwmCore.Legend);_gwmCore.Legend.groupEntries=_gwmInitGroupEntries(_GWMLegendGroup,_gwmCore.Legend.displayEntries,_gwmCore.Legend);var c=null;try{if(getGWMSVGInitFunction&&_gwmBas.isValidFunction(getGWMSVGInitFunction)){c=getGWMSVGInitFunction()}}catch(b){}if(c&&_gwmBas.isValidFunction(c)){c(_gwmInitMOZ)}}function _gwmInitGroupEntries(b,g,f){var a=new LegendEntries(null,f,false);if(b&&b.length>0){for(var e=0;e<b.length;e++){if(!b[e].skip){var h=b[e];var d=null;d=g.item(h.name);if(!d){d=new LegendEntry(h.name,h.title,_gwmCore.DisplayMode.on,true,true,true,true,false,null,null,parent)}if(!d.isLeafEntry){d.groupEntries=_gwmInitGroupEntries(h.members,g,d)}else{if(d.displayEntries.count>d.groupEntries.count){for(var c=0;c<d.displayEntries.count;c++){d.groupEntries.append(d.displayEntries.item(c))}}}a.append(d)}}}return a}function _gwmInitDisplayEntries(j,b,e){var a=new LegendEntries(null,e,true);if(j&&b&&b.length>0){for(var d=0;d<b.length;d++){var h=b[d];var f=j.getElementById(h.name);var c=new LegendEntry(h.name,h.title,_gwmCore.DisplayMode.on,h.locatable,h.hotspot,true,true,h.leaf,f,e,null);if(h.members&&h.members.length>0){c.displayEntries=_gwmInitDisplayEntries(j,h.members,c)}if(f){f.le=c}a.append(c)}}return a}function _gwmCoreInit(a){var c=null;if(!_gwmCore.svgDoc&&null!=a){_gwmCore.svgDoc=a}c=_gwmCore.svgDoc;if(!c){return _gwm_E_UNKNOWN}_gwmCore.svgRoot=c.getElementById("gwmroot");_gwmCore.tooltipText=c.getElementById("gwmtooltiptext");_gwmCore.tooltipRect=c.getElementById("gwmtooltiprect");_gwmCore.tooltipGroup=c.getElementById("gwmtooltip");_gwmCore.setTooltipFontSize();var b=c.getElementById("gwmmaskrect");_gwmCore.iViewH=b.getAttribute("height");_gwmCore.iViewW=b.getAttribute("width");_gwmCore.updateLogo();_gwmCore.highlightLayer=_gwmCore.$("gwmhighlighted");_gwmCore.selectedLayer=_gwmCore.$("gwmselected");_gwmCore.legendLayer=_gwmCore.$("_GWMAll");return _gwm_E_SUCCESS}function _gwmUpdateLogo(){var b=_gwmCore.svgDoc.getElementById("gwmlogo");if(b){var c=b.getBBox();var a=_gwmCore.svgDoc.getElementById("gwmlogorect");a.setAttribute("x",2.5);a.setAttribute("y",_gwmCore.iViewH-15-c.height);a.setAttribute("width",c.width+10);a.setAttribute("height",c.height+10);b.setAttribute("x",7.5);b.setAttribute("y",_gwmCore.iViewH-10-c.height-c.y)}}function _gwmLaunchAction(a){if(null==a||a==""){return}var sBuf=a.toLowerCase();if(sBuf.indexOf("javascript")!=-1){window.eval(a)}else{window.location=a}return}function _gwmTooltipHandler(a,c,e){if(!e){_gwmCore.clearTooltip()}else{var b="";var d=a.target;if(!d){return}if(d.correspondingUseElement>""){d=d.correspondingUseElement}if(null==c||c==""){b=_gwmCore.getTooltip(d)}else{b=c}if(null!=b&&b!=""){_gwmCore.showTooltip(a,null,b)}}}function _gwmGetEleTooltip(b){var a=_gwmGetFeature(b);if(null!=a){return a.tooltip()}else{if(_gwmGetEleAttributeGWM(b,"id",false)=="gwmlogorect"){return _gwmGetEleAttributeGWM(b,"gmwmsvg:tt",false)}return null}}function _gwmClearTooltip(){_gwmCore.tooltipRect.style.setProperty("display","none","");_gwmCore.tooltipText.style.setProperty("display","none","")}function _gwmShowTooltip(t,w,a){var m,k;if(a==""||(!t&&!w)){return}m=k=0;var z=8;try{if(null!=t){var r=t.target;if(r.correspondingUseElement>""){r=r.correspondingUseElement}if(r.getAttribute("id")=="gwmbg"){return}m=t.clientX;k=t.clientY}else{m=w.x;k=w.y}var f=_gwmCore.getSVGTransMatrix();var C=f.a;var j=_gwmCore.svgRoot.createSVGPoint();var b=_gwmCore.svgRoot.createSVGPoint();b.x=m;b.y=k;j=b.matrixTransform(f);var x=_gwmCore.tooltipText;var c=_gwmCore.tooltipRect;while(x.hasChildNodes()){x.removeChild(x.firstChild)}var p=a.split("GWMNL");var n=p.length;var H=_gwmCore.svgDoc;var F=n-1;var h=0;if(p[0]==""){if(h+1<=F){p[0]=" ";++h}}var o=null;var q=true;var d=false;var l=false;var E=H.createTextNode(p[0]);x.appendChild(E);for(var y=1;y<n;y++){q=true;d=false;if(p[y]==""){if(h+1<=F){p[y]=" ";++h;d=true}else{q=false;l=true}}if(q){o=_gwmCreateTspan(p[y],x.getAttribute("x"),"1.1em");x.appendChild(o)}}var G=new String(_gwmCore.tooltipFontSize*C);G=G+"px";x.style.setProperty("font-size",G,"");x.style.setProperty("display","inline","");var v=x.getBBox();if(n>1&&!l){v.height+=(parseFloat(_gwmCore.tooltipFontSize)*C)}var s=v.height/C;var A=v.width/C;b.x=m+z;if(b.x+A+z>_gwmCore.iViewCtrlWidth){b.x=_gwmCore.iViewCtrlWidth-z-A}b.y=k-s-(z*2);if(b.y<0){b.y=0}j=b.matrixTransform(f);_gwmCore.tooltipGroup.setAttribute("transform","translate("+j.x+","+j.y+")");var D=(A+z)*C;var g=(s+z)*C;c.setAttribute("width",D);c.setAttribute("height",g);c.style.setProperty("display","inline","");c.style.setProperty("stroke-width",C,"");var u=((g/2)/n)+((v.height/2)/n);x.setAttribute("y",u);x.setAttribute("x",C*3)}catch(B){return""}}function _gwmGetTtipTextStyle(){if(_gwmCore.tooltipText){return(_gwmCore.tooltipText.getAttribute("style"))}return""}function _gwmGetTtipRectStyle(){if(_gwmCore.tooltipRect){return(_gwmCore.tooltipRect.getAttribute("style"))}return""}function _gwmSetTtipTextStyle(a){if(null==a||a==""){return _gwm_E_PARAMNULL}if(_gwmCore.tooltipText){_gwmCore.tooltipText.setAttribute("style",a);_gwmCore.setTooltipFontSize()}return _gwm_E_SUCCESS}function _gwmSetTooltipFontSize(){if(!_gwmCore.tooltipText){return}var a=_gwmCore.tooltipText.style.getPropertyValue("font-size");if(null!=a&&""!=a&&"undefined"!=a){var b=parseFloat(a);if(!(isNaN(b))){_gwmCore.tooltipFontSize=b}}}function _gwmSetTtipRectStyle(a){if(null==a||a==""){return _gwm_E_PARAMNULL}if(_gwmCore.tooltipRect){_gwmCore.tooltipRect.setAttribute("style",a)}return _gwm_E_SUCCESS}function _gwmGetSVGTransMatrix(){var h=_gwmCore.svgRoot;if(!h){return}var a=h.createSVGMatrix();var g=_gwmCore.iViewCtrlWidth;if(g<=0){g=1}var d=_gwmCore.iViewCtrlHeight;if(d<=0){d=1}var i=_gwmCore.iViewW/g;var e=_gwmCore.iViewH/d;if(i<e){var c=g*e-_gwmCore.iViewW;a=a.translate(-c/2,0);a=a.scale(e)}else{if(i>e){var j=0;var f=d*i-_gwmCore.iViewH;a=a.translate(0,-f/2);a=a.scale(i)}else{a=a.scale(i)}}var k=h.currentTranslate;var b=h.currentScale;a=a.scale(1/b);a=a.translate(-k.x,-k.y);return a}function _gwmGetTransSVGPoint(c){var b=_gwmCore.svgRoot;var d=_gwmCore.getSVGTransMatrix();var e=b.createSVGPoint();var a=b.createSVGPoint();a.x=c.clientX;a.y=c.clientY;e=a.matrixTransform(d);return e}function _gwmGetTransSVGPointMtx(c,d){var b=_gwmCore.svgRoot;var e=b.createSVGPoint();var a=b.createSVGPoint();a.x=c.clientX;a.y=c.clientY;e=a.matrixTransform(d);return e}function _gwmGetTransSVGXY(a,h){try{var c=_gwmCore.svgRoot;var d=_gwmCore.getSVGTransMatrix();var f=c.createSVGPoint();var b=c.createSVGPoint();b.x=a;b.y=h;f=b.matrixTransform(d);return f}catch(g){return null}return null}function _gwmCreateTspan(c,b,a){var g=_gwmCore.svgDoc;var d="http://www.w3.org/2000/svg";var f=g.createElementNS(d,"tspan");var e=g.createTextNode(c);if(null==a||""==a||undefined==a){a="1em"}if(null==b||""==b||undefined==b){b="0"}f.setAttributeNS(null,"x",b);f.setAttributeNS(null,"dy",a);f.appendChild(e);return f}function _gwmUpdateView(){var a=_gwmCore.svgDoc.getElementById("gwmmaskrect");_gwmCore.iViewH=a.getAttribute("height");_gwmCore.iViewW=a.getAttribute("width")}function _gwmGetEleAttributeGWM(f,b,d){var c="";try{if(f.getAttribute("id")=="gwmroot"){return""}c=f.getAttribute(b);if(null==c||""==c||undefined==c){c=f.getAttributeNS("http://www.intergraph.com/GeoMedia/wmsvg",b);if(null==c||undefined==c){c=""}}else{return c}if(d&&(null==c||""==c||undefined==c)){var h=f.parentNode;if(null==h||""==h||undefined==h){return""}if(h.getAttribute("id")=="gwmroot"){return""}c=h.getAttribute(b);if(null==c||""==c||undefined==c){c=h.getAttributeNS("http://www.intergraph.com/GeoMedia/wmsvg",b)}else{return c}if(null==c||undefined==c){c=""}}}catch(g){return""}return c}function _gwmGetEleZero(a){try{if(a.correspondingUseElement){a=a.correspondingUseElement}var c=a.getAttribute("id");if(null!=c&&c.indexOf(".")>-1){return _gwm$(a.getAttribute("id").split(".")[0]+".0")}else{return null}}catch(b){return null}}function _gwm$(b){try{return _gwmCore.svgDoc.getElementById(b)}catch(a){return null}}function _gwmDecorateFeatureElement(g,f,c){var b="";var d=null;var a=false;if("use"==g.nodeName){b=_gwmRemoveDecorations(g.getAttributeNS("http://www.w3.org/1999/xlink","href"));d=_gwm$(b.slice(1));a=("s"==_gwmGetEleAttributeGWM(d,"gmwmsvg:typ",false))}else{a=false}if(a){if(f){b+=_gwmCore.Decorators[c]}g.setAttributeNS("http://www.w3.org/1999/xlink","href",b)}else{b=_gwmRemoveDecorations(g.getAttribute("class"));if(f){b+=_gwmCore.Decorators[c]}g.setAttribute("class",b)}}function _gwmRemoveDecorations(c){var b=c;for(var a=0;a<_gwmCore.Decorators.length;a++){b=b.replace(_gwmCore.Decorators[a],"")}return b};
//END IngrPL.WebClient.Core.Platform.MapLayers.SVG.CoreFunctions.js
//START IngrPL.WebClient.Core.Platform.ScriptResources.ScriptTranslate.js
Type.registerNamespace('IngrPL.WebClient.Core.Platform');
IngrPL.WebClient.Core.Platform.Translate={
"ShowCrosshair":"Show crosshair","ShowNavigator":"Show navigator","SessionResume":"Do you want to resume session?","E_MapServiceDoesNotSupportAuthentication":"The map service does not support authentication","E_NoHandlerNameNorUrl":"No handler name no handler URL has been specified","ErrorRequestingGIMap_Format":"Error requesting GeoIntegrator map: {0}","SessionResuming":"Session resuming. Please wait ...","MapServiceAuthError_Format":"Error authenticating in the map service \u0027{0}\u0027","SessionExpired":"Session Expired","Error":"Error","E_MapLayerDefinitionNotFound_Format":"Cannot find a map layer definition for the legend item \u0027{0}\u0027","NoResponse":"No response","E_MapServiceDoesNotSupportTransformation":"The map service does not support transformations","E_LegendItemNotInLegend":"The specified legend item is not a part of the legend","MapServiceInitializationError_Format":"Error initializing map service \u0027{0}\u0027","ForItemsInSelectSet":"For items in select set","ShowCoords":"Show coordinates","ShowScale":"Show scale","Info":"Information","ScreenSize":"The size of the screen in inches"};
//END IngrPL.WebClient.Core.Platform.ScriptResources.ScriptTranslate.js
//START IngrPL.WebClient.Core.Platform.Common.Common.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.Common");IngrPL.WebClient.Core.Platform.Common.Point=function(a,b){if(a==null){throw Error.argumentNull("x")}if(!Number.isInstanceOfType(a)){throw Error.argumentType("x",Object.getType(a),Number)}if(b==null){throw Error.argumentNull("y")}if(!Number.isInstanceOfType(b)){throw Error.argumentType("y",Object.getType(b),Number)}this.x=a;this.y=b};IngrPL.WebClient.Core.Platform.Common.Point.prototype={clone:function(){return new IngrPL.WebClient.Core.Platform.Common.Point(this.x,this.y)},equals:function(a){if(a==null){return false}else{if(!IngrPL.WebClient.Core.Platform.Common.Point.isInstanceOfType(a)){throw Error.argumentType("point",Object.getType(a),IngrPL.WebClient.Core.Platform.Common.Point)}return this.x==a.x&&this.y==a.y}}};IngrPL.WebClient.Core.Platform.Common.Point.registerClass("IngrPL.WebClient.Core.Platform.Common.Point");IngrPL.WebClient.Core.Platform.Common.Size=function(b,a){if(b==null){throw Error.argumentNull("width")}if(!Number.isInstanceOfType(b)){throw Error.argumentType("width",Object.getType(b),Number)}if(a==null){throw Error.argumentNull("height")}if(!Number.isInstanceOfType(a)){throw Error.argumentType("height",Object.getType(a),Number)}this.width=b;this.height=a};IngrPL.WebClient.Core.Platform.Common.Size.prototype={clone:function(){return new IngrPL.WebClient.Core.Platform.Common.Size(this.width,this.height)},equals:function(a){if(a==null){return false}else{if(!IngrPL.WebClient.Core.Platform.Common.Size.isInstanceOfType(a)){throw Error.argumentType("size",Object.getType(a),IngrPL.WebClient.Core.Platform.Common.Size)}return this.width==a.width&&this.height==a.height}}};IngrPL.WebClient.Core.Platform.Common.Size.registerClass("IngrPL.WebClient.Core.Platform.Common.Size");IngrPL.WebClient.Core.Platform.Common._Util=function(){};IngrPL.WebClient.Core.Platform.Common._Util.prototype={showError:function(a,b){if(a){if(a instanceof Error){a=a.message}if(!(a instanceof String)){a=a.toString()}}if(window.Ext&&Ext.MessageBox&&Ext.util&&Ext.util.Format){if(a){a=Ext.util.Format.nl2br(a)}else{a=""}b=b||IngrPL.WebClient.Core.Platform.Translate.Error;Ext.MessageBox.show({msg:a,title:b,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.ERROR})}else{alert(a)}},showInfo:function(a){if(a){if(!(a instanceof String)){a=a.toString()}}else{return}if(window.Ext&&Ext.MessageBox){Ext.MessageBox.show({msg:a,title:IngrPL.WebClient.Core.Platform.Translate.Info,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.INFO})}else{alert(error)}},checkExecutor:function(c,a){if(c.get_aborted()){return false}else{if(!c.get_responseAvailable()){if(a){a(IngrPL.WebClient.Core.Platform.Translate.NoResponse)}}else{if(c.get_statusCode()==200){return true}else{var b=[c.get_statusCode(),c.get_statusText()].join(" ");$log.writeError(b);if(a){a(b)}return false}}}},checkBounds:function(c,b,a){if(!c||!b){return true}return this._intersectsBounds(c,b,a||true)},_intersectsBounds:function(a,g,h){if(h==null){h=true}var f=a[$crs.getCurrent().get_id()],b=f.bottomLeft,e=f.upperRight;var i=(g.bottomLeft.y==b.y&&g.upperRight.y==e.y)?true:(((g.bottomLeft.y>b.y)&&(g.bottomLeft.y<e.y))||((b.y>g.bottomLeft.y)&&(b.y<g.upperRight.y)));var j=(g.bottomLeft.y==b.y&&g.upperRight.y==e.y)?true:(((g.upperRight.y>b.y)&&(g.upperRight.y<e.y))||((e.y>g.bottomLeft.y)&&(e.y<g.upperRight.y)));var d=(g.bottomLeft.x==b.x&&g.upperRight.x==e.x)?true:(((g.bottomLeft.x>b.x)&&(g.bottomLeft.x<e.x))||((b.x>g.bottomLeft.x)&&(b.x<g.upperRight.x)));var c=(g.bottomLeft.x==b.x&&g.upperRight.x==e.x)?true:(((g.upperRight.x>b.x)&&(g.upperRight.x<e.x))||((e.x>g.bottomLeft.x)&&(e.x<g.upperRight.x)));return(this._containsBounds(g,f,true,h)||this._containsBounds(f,g,true,h)||((j||i)&&(c||d)))},_containsBounds:function(e,h,d,b){if(d==null){d=false}if(b==null){b=true}var c;var g;var a;var f;if(b){c=(e.upperRight.x>=h.bottomLeft.x)&&(e.upperRight.x<=h.upperRight.x);g=(e.upperRight.y>=h.bottomLeft.y)&&(e.upperRight.y<=h.upperRight.y);a=(e.bottomLeft.x>=h.bottomLeft.x)&&(e.bottomLeft.x<=h.upperRight.x);f=(e.bottomLeft.y>=h.bottomLeft.y)&&(e.bottomLeft.y<=h.upperRight.y)}else{c=(e.upperRight.x>h.bottomLeft.x)&&(e.upperRight.x<h.upperRight.x);g=(e.upperRight.y>h.bottomLeft.y)&&(e.upperRight.y<h.upperRight.y);a=(e.bottomLeft.x>h.bottomLeft.x)&&(e.bottomLeft.x<h.upperRight.x);f=(e.bottomLeft.y>h.bottomLeft.y)&&(e.bottomLeft.y<h.upperRight.y)}return(d)?(g||f)&&(c||a):(g&&c&&f&&a)}};IngrPL.WebClient.Core.Platform.Common._Util.registerClass("IngrPL.WebClient.Core.Platform.Common._Util");IngrPL.WebClient.Core.Platform.Common.Util=new IngrPL.WebClient.Core.Platform.Common._Util();
//END IngrPL.WebClient.Core.Platform.Common.Common.js
//START IngrPL.WebClient.Core.Platform.ClientScript.ClientEventManager.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.ClientScript");IngrPL.WebClient.Core.Platform.ClientScript._ClientEventManager=function(){this._events={}};IngrPL.WebClient.Core.Platform.ClientScript._ClientEventManager.prototype={register:function(a,c,b){if(a==null){throw Error.argumentNull("eventName")}if(!String.isInstanceOfType(a)){throw Error.argumentType("eventName",Object.getType(a),String)}if(c==null){throw Error.argumentNull("handler")}if(!Function.isInstanceOfType(c)){throw Error.argumentType("handler",Object.getType(c),Function)}if(!this._events[a]){this._events[a]=[]}this._events[a].push({handler:c,scope:b})},unregister:function(a,e,d){if(a==null){throw Error.argumentNull("eventName")}if(!String.isInstanceOfType(a)){throw Error.argumentType("eventName",Object.getType(a),String)}if(e==null){throw Error.argumentNull("handler")}if(!Function.isInstanceOfType(e)){throw Error.argumentType("handler",Object.getType(e),Function)}if(this._events[a]){for(var c=0;c<this._events[a].length;c++){var b=this._events[a][c].handler;var f=this._events[a][c].scope;if(b==e&&(!d||f==d)){this._events[a].splice(c,1);break}}}},notify:function(d,c,f){if(d==null){throw Error.argumentNull("eventName")}if(!String.isInstanceOfType(d)){throw Error.argumentType("eventName",Object.getType(d),String)}if(c&&c.mapStateId){$log.writeInfo("Event: '{0}' ({1})",d,c.mapStateId)}else{$log.writeInfo("Event: '{0}'",d)}if(this._events[d]){var b=this._events[d].slice(0);for(var e=0,a=b.length;e<a;e++){var h=b[e].handler;var g=b[e].scope;if(g){h.call(g,d,c,f)}else{h(d,c,f)}}}}};IngrPL.WebClient.Core.Platform.ClientScript._ClientEventManager.registerClass("IngrPL.WebClient.Core.Platform.ClientScript._ClientEventManager");IngrPL.WebClient.Core.Platform.ClientScript.ClientEventManager=new IngrPL.WebClient.Core.Platform.ClientScript._ClientEventManager();var $event=IngrPL.WebClient.Core.Platform.ClientScript.ClientEventManager;
//END IngrPL.WebClient.Core.Platform.ClientScript.ClientEventManager.js
//START IngrPL.WebClient.Core.Platform.MapLayers.MapLayer.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");IngrPL.WebClient.Core.Platform.MapLayers.MapLayer=function(a){if(a==null){throw Error.argumentNull("config")}if(!IngrPL.WebClient.Core.Platform.MapLayers.MapLayerConfig.isInstanceOfType(a)){throw Error.argumentType("config",Object.getType(a),IngrPL.WebClient.Core.Platform.MapLayers.MapLayerConfig)}this._config=a;this._mapLayerDiv=null;this._currentMapRange=null;this._renderingMapRange=null;this._pendingMapRange=null;this._isDirty=false;$event.register("featuresRemoved",this._featuresRemoved,this);$event.register("crsChanged",this._resetDisplayableContent,this);$event.register("scaleChanged",this._resetDisplayableContent,this)};IngrPL.WebClient.Core.Platform.MapLayers.MapLayer.prototype={render:function(){if(!this._mapLayerDiv){return}if(!this._pendingMapRange&&!this._isDirty){return}if(!this._renderingMapRange&&!this._pendingMapRange){return}if(!this._isDirty&&this._pendingMapRange.equals(this._renderingMapRange)){return}if(this._pendingMapRange){this._renderingMapRange=this._pendingMapRange.clone()}this._render()},_render:function(){throw Error.notImplemented()},_onRendering:function(){$event.notify("mapLayerRendering",this._getEventArgs(),this)},_onRendered:function(){this._currentMapRange=this._renderingMapRange;this._isDirty=false;$event.notify("mapLayerRendered",this._getEventArgs(),this)},_getEventArgs:function(){return{mapStateId:this._config.get_mapState().get_id(),mapLayerConfigId:this._config.get_id()}},moveLegendItem:function(a,d,c){if(a==null){throw Error.argumentNull("legendItem")}if(d==null){throw Error.argumentNull("from")}if(!Number.isInstanceOfType(d)){throw Error.argumentType("from",Object.getType(d),Number)}if(c==null){throw Error.argumentNull("to")}if(!Number.isInstanceOfType(c)){throw Error.argumentType("to",Object.getType(c),Number)}var b=this._config.get_lastLegendItemPriority-this._config.get_firstLegendItemPriority+1;if(d<0||d>=b){throw Error.argumentOutOfRange("from",d)}if(c<0||c>b){throw Error.argumentOutOfRange("to",c)}if(c==d){return}this._legendItemMoved(a,d,c);this._resetDisplayableContent()},_legendItemMoved:function(a,c,b){},updateLegendItemsVisibility:function(a){this._updateLegendItemsVisibility(a);this._resetDisplayableContent()},_updateLegendItemsVisibility:function(a){},updateScaleBands:function(a){this._updateScaleBands(a);this._resetDisplayableContent()},_updateScaleBands:function(a){},removeLegendItems:function(a){this._removeLegendItems(a);this._resetDisplayableContent()},_removeLegendItems:function(a){},adjustMapRange:function(a,b){if(a==null){throw Error.argumentNull("factor")}if(!Number.isInstanceOfType(a)){throw Error.argumentType("factor",Object.getType(a),Number)}return this._adjustMapRange(a,b)},_adjustMapRange:function(a,b){return null},destroy:function(){$event.unregister("featuresRemoved",this._featuresRemoved,this);$event.unregister("crsChanged",this._resetDisplayableContent,this);$event.unregister("scaleChanged",this._resetDisplayableContent,this);this._destroy()},_destroy:function(){},get_config:function(){return this._config},get_mapLayerDiv:function(){return this._mapLayerDiv},set_mapLayerDiv:function(a){this._mapLayerDiv=a},get_currentMapRange:function(){return this_currentMapRange},get_pendingMapRange:function(){return this._pendingMapRange},set_pendingMapRange:function(a){if(!a.equals(this._pendingMapRange)){this._pendingMapRange=a;this._pendingMapRangeChanged()}},_pendingMapRangeChanged:function(){},_setOpacity:function(b,a,c){},get_isActive:function(){return this._isActive()},_isActive:function(){return false},get_featureClickedHandler:function(){return this._featureClickedHandler},set_featureClickedHandler:function(a){this._featureClickedHandler=a},selectFeature:function(c,a,b){},selectFeatures:function(h,k){var b=this._config.get_mapState().get_legend().get_flatLegend();var c=[];for(var g=this._config.get_firstLegendItemPriority(),e=this._config.get_lastLegendItemPriority();g<=e;g++){var j=b[g];if(j.canBeDisplayed()&&j.get_isLocatable()){var d=j.get_definition();c.push(d.get_sourceLegendItemDefinition()||d)}}if(c.length){var f=this._config.get_mapState().get_mapRange().getSize().width;var m=this._config.get_mapService();var a=this._config.get_filter();m.findFeatures(c,h,k,f*0.001,a,this._selectFeatures,this)}},_selectFeatures:function(a){},_featuresRemoved:function(j,c,g){if(g==this||!this._config.get_mapState()){return}var d=this._config.get_mapState().get_legend().get_flatLegend();var b=false;if(c.legendItemDefinitions){var a={};for(var h=0,f=c.legendItemDefinitions.length;h<f;h++){a[c.legendItemDefinitions[h].get_id()]=true}for(var h=this._config.get_firstLegendItemPriority(),f=this._config.get_lastLegendItemPriority();h<=f;h++){var k=d[h];var e=k.get_definition();if(a[(e.get_sourceLegendItemDefinition()||e).get_id()]){b=true;break}}}if(!c.legendItemDefinitions||b){this._isDirty=true;this._render()}},_getMapServiceConfig:function(){var b=this._config.get_mapService().get_config();var d=this._config.get_mapServiceConfigOverride();if(d){var a={};for(var c in b){a[c]=b[c]}for(var c in d){a[c]=d[c]}return a}else{return b}},_resetDisplayableContent:function(b,a,d){var c=this._config.get_mapState();if(a&&a.mapStateId&&c&&c.get_id()!=a.mapStateId){return}this._displayableContent=null},_getDisplayableContent:function(){if(this._displayableContent){return this._displayableContent}if(!this._config.get_mapState()){return null}this._displayableContent={};var b=this._displayableContent.legendItems=[];var c,d,a;this._config.forEachLegendItem(function(g){if(g.canBeDisplayed()){b.push(g)}c=g.get_definition();if(!c.isCRSValid(null,true)){d=$crs.getMappings();for(var f=0,e=d.length;f<e;f++){a=d[f];if(c.isCRSValid(a,true)){this._displayableContent.crsId=a;break}}}},this);return this._displayableContent}};IngrPL.WebClient.Core.Platform.MapLayers.MapLayer.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.MapLayer");
//END IngrPL.WebClient.Core.Platform.MapLayers.MapLayer.js
//START IngrPL.WebClient.Core.Platform.Data.Analysis.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.Data");IngrPL.WebClient.Core.Platform.Data.Analysis=function(a){this._id=a.i;this._mapServiceId=a.m;this._firstLegendItemDefinitionId=a.l;this._firstWhereClause=a.w;this._firstBuffer=a.b;this._secondLegendItemDefinitionId=a.l2;this._secondWhereClause=a.w2;this._secondBuffer=a.b2;this._spatialOperator=a.s;this._spatialOperatorNegation=a.n;this._color=a.c};IngrPL.WebClient.Core.Platform.Data.Analysis.prototype={get_analysisStub:function(){return{i:this._id,m:this._mapServiceId,l:this._firstLegendItemDefinitionId,w:this._firstWhereClause,b:this._firstBuffer,l2:this._secondLegendItemDefinitionId,w2:this._secondWhereClause,b2:this._secondBuffer,s:this._spatialOperator,n:this._spatialOperatorNegation,c:this._color}},get_analysisStubString:function(){var a={i:this._id,m:this._mapServiceId,l:this._firstLegendItemDefinitionId,w:this._firstWhereClause,b:this._firstBuffer,l2:this._secondLegendItemDefinitionId,w2:this._secondWhereClause,b2:this._secondBuffer,s:this._spatialOperator,n:this._spatialOperatorNegation,c:this._color};return Sys.Serialization.JavaScriptSerializer.serialize(a)},get_id:function(){return this._id},get_mapServiceId:function(){return this._mapServiceId}};IngrPL.WebClient.Core.Platform.Data.Analysis.registerClass("IngrPL.WebClient.Core.Platform.Data.Analysis");
//END IngrPL.WebClient.Core.Platform.Data.Analysis.js
//START IngrPL.WebClient.Core.Platform.Data.AnalysisManager.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.Data");IngrPL.WebClient.Core.Platform.Data._AnalysisManager=function(){this._analyses={}};IngrPL.WebClient.Core.Platform.Data._AnalysisManager.prototype={registerAnalysis:function(a){var b=new IngrPL.WebClient.Core.Platform.Data.Analysis(a);this._analyses[a.i]=b},findAnalysis:function(a){return this._analyses[a]},containsAnalysis:function(a){if(this._analyses[a]){return true}return false}};IngrPL.WebClient.Core.Platform.Data._AnalysisManager.registerClass("IngrPL.WebClient.Core.Platform.Data._AnalysisManager");IngrPL.WebClient.Core.Platform.Data.AnalysisManager=new IngrPL.WebClient.Core.Platform.Data._AnalysisManager();var $analysisManager=IngrPL.WebClient.Core.Platform.Data.AnalysisManager;
//END IngrPL.WebClient.Core.Platform.Data.AnalysisManager.js
//START AjaxControlToolkit.Common.Common.js
Type.registerNamespace('AjaxControlToolkit');AjaxControlToolkit.BoxSide = function() {
}
AjaxControlToolkit.BoxSide.prototype = {
Top : 0,
Right : 1,
Bottom : 2,
Left : 3
}
AjaxControlToolkit.BoxSide.registerEnum("AjaxControlToolkit.BoxSide", false);AjaxControlToolkit._CommonToolkitScripts = function() {
}
AjaxControlToolkit._CommonToolkitScripts.prototype = {
_borderStyleNames : ["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],
_borderWidthNames : ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"],
_paddingWidthNames : ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
_marginWidthNames : ["marginTop", "marginRight", "marginBottom", "marginLeft"],
getCurrentStyle : function(element, attribute, defaultValue) {
var currentValue = null;if (element) {
if (element.currentStyle) {
currentValue = element.currentStyle[attribute];} else if (document.defaultView && document.defaultView.getComputedStyle) {
var style = document.defaultView.getComputedStyle(element, null);if (style) {
currentValue = style[attribute];}
}
if (!currentValue && element.style.getPropertyValue) {
currentValue = element.style.getPropertyValue(attribute);}
else if (!currentValue && element.style.getAttribute) {
currentValue = element.style.getAttribute(attribute);} 
}
if ((!currentValue || currentValue == "" || typeof(currentValue) === 'undefined')) {
if (typeof(defaultValue) != 'undefined') {
currentValue = defaultValue;}
else {
currentValue = null;}
} 
return currentValue;},
getInheritedBackgroundColor : function(element) {
if (!element) return '#FFFFFF';var background = this.getCurrentStyle(element, 'backgroundColor');try {
while (!background || background == '' || background == 'transparent' || background == 'rgba(0, 0, 0, 0)') {
element = element.parentNode;if (!element) {
background = '#FFFFFF';} else {
background = this.getCurrentStyle(element, 'backgroundColor');}
}
} catch(ex) {
background = '#FFFFFF';}
return background;},
getLocation : function(element) {
if (element === document.documentElement) {
return new Sys.UI.Point(0,0);}
if (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version < 7) {
if (element.window === element || element.nodeType === 9 || !element.getClientRects || !element.getBoundingClientRect) return new Sys.UI.Point(0,0);var screenRects = element.getClientRects();if (!screenRects || !screenRects.length) {
return new Sys.UI.Point(0,0);}
var first = screenRects[0];var dLeft = 0;var dTop = 0;var inFrame = false;try {
inFrame = element.ownerDocument.parentWindow.frameElement;} catch(ex) {
inFrame = true;}
if (inFrame) {
var clientRect = element.getBoundingClientRect();if (!clientRect) {
return new Sys.UI.Point(0,0);}
var minLeft = first.left;var minTop = first.top;for (var i = 1;i < screenRects.length;i++) {
var r = screenRects[i];if (r.left < minLeft) {
minLeft = r.left;}
if (r.top < minTop) {
minTop = r.top;}
}
dLeft = minLeft - clientRect.left;dTop = minTop - clientRect.top;}
var ownerDocument = element.document.documentElement;return new Sys.UI.Point(first.left - 2 - dLeft + ownerDocument.scrollLeft, first.top - 2 - dTop + ownerDocument.scrollTop);}
return Sys.UI.DomElement.getLocation(element);},
setLocation : function(element, point) {
Sys.UI.DomElement.setLocation(element, point.x, point.y);},
getContentSize : function(element) {
if (!element) {
throw Error.argumentNull('element');}
var size = this.getSize(element);var borderBox = this.getBorderBox(element);var paddingBox = this.getPaddingBox(element);return {
width : size.width - borderBox.horizontal - paddingBox.horizontal,
height : size.height - borderBox.vertical - paddingBox.vertical
}
},
getSize : function(element) {
if (!element) {
throw Error.argumentNull('element');}
return {
width: element.offsetWidth,
height: element.offsetHeight
};},
setContentSize : function(element, size) {
if (!element) {
throw Error.argumentNull('element');}
if (!size) {
throw Error.argumentNull('size');}
if(this.getCurrentStyle(element, 'MozBoxSizing') == 'border-box' || this.getCurrentStyle(element, 'BoxSizing') == 'border-box') {
var borderBox = this.getBorderBox(element);var paddingBox = this.getPaddingBox(element);size = {
width: size.width + borderBox.horizontal + paddingBox.horizontal,
height: size.height + borderBox.vertical + paddingBox.vertical
};}
element.style.width = size.width.toString() + 'px';element.style.height = size.height.toString() + 'px';},
setSize : function(element, size) {
if (!element) {
throw Error.argumentNull('element');}
if (!size) {
throw Error.argumentNull('size');}
var borderBox = this.getBorderBox(element);var paddingBox = this.getPaddingBox(element);var contentSize = {
width: size.width - borderBox.horizontal - paddingBox.horizontal,
height: size.height - borderBox.vertical - paddingBox.vertical
};this.setContentSize(element, contentSize);},
getBounds : function(element) {
var offset = $common.getLocation(element);return new Sys.UI.Bounds(offset.x, offset.y, element.offsetWidth || 0, element.offsetHeight || 0);}, 
setBounds : function(element, bounds) {
if (!element) {
throw Error.argumentNull('element');}
if (!bounds) {
throw Error.argumentNull('bounds');}
this.setSize(element, bounds);$common.setLocation(element, bounds);},
getClientBounds : function() {
var clientWidth;var clientHeight;switch(Sys.Browser.agent) {
case Sys.Browser.InternetExplorer:
clientWidth = document.documentElement.clientWidth;clientHeight = document.documentElement.clientHeight;break;case Sys.Browser.Safari:
clientWidth = window.innerWidth;clientHeight = window.innerHeight;break;case Sys.Browser.Opera:
clientWidth = Math.min(window.innerWidth, document.body.clientWidth);clientHeight = Math.min(window.innerHeight, document.body.clientHeight);break;default: 
clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);break;}
return new Sys.UI.Bounds(0, 0, clientWidth, clientHeight);},
getMarginBox : function(element) {
if (!element) {
throw Error.argumentNull('element');}
var box = {
top: this.getMargin(element, AjaxControlToolkit.BoxSide.Top),
right: this.getMargin(element, AjaxControlToolkit.BoxSide.Right),
bottom: this.getMargin(element, AjaxControlToolkit.BoxSide.Bottom),
left: this.getMargin(element, AjaxControlToolkit.BoxSide.Left)
};box.horizontal = box.left + box.right;box.vertical = box.top + box.bottom;return box;},
getBorderBox : function(element) {
if (!element) {
throw Error.argumentNull('element');}
var box = {
top: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Top),
right: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Right),
bottom: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Bottom),
left: this.getBorderWidth(element, AjaxControlToolkit.BoxSide.Left)
};box.horizontal = box.left + box.right;box.vertical = box.top + box.bottom;return box;},
getPaddingBox : function(element) {
if (!element) {
throw Error.argumentNull('element');}
var box = {
top: this.getPadding(element, AjaxControlToolkit.BoxSide.Top),
right: this.getPadding(element, AjaxControlToolkit.BoxSide.Right),
bottom: this.getPadding(element, AjaxControlToolkit.BoxSide.Bottom),
left: this.getPadding(element, AjaxControlToolkit.BoxSide.Left)
};box.horizontal = box.left + box.right;box.vertical = box.top + box.bottom;return box;},
isBorderVisible : function(element, boxSide) {
if (!element) {
throw Error.argumentNull('element');}
if(boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));}
var styleName = this._borderStyleNames[boxSide];var styleValue = this.getCurrentStyle(element, styleName);return styleValue != "none";},
getMargin : function(element, boxSide) {
if (!element) {
throw Error.argumentNull('element');}
if(boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));}
var styleName = this._marginWidthNames[boxSide];var styleValue = this.getCurrentStyle(element, styleName);try { return this.parsePadding(styleValue);} catch(ex) { return 0;}
},
getBorderWidth : function(element, boxSide) {
if (!element) {
throw Error.argumentNull('element');}
if(boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));}
if(!this.isBorderVisible(element, boxSide)) {
return 0;} 
var styleName = this._borderWidthNames[boxSide];var styleValue = this.getCurrentStyle(element, styleName);return this.parseBorderWidth(styleValue);},
getPadding : function(element, boxSide) {
if (!element) {
throw Error.argumentNull('element');}
if(boxSide < AjaxControlToolkit.BoxSide.Top || boxSide > AjaxControlToolkit.BoxSide.Left) {
throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue, boxSide, 'AjaxControlToolkit.BoxSide'));}
var styleName = this._paddingWidthNames[boxSide];var styleValue = this.getCurrentStyle(element, styleName);return this.parsePadding(styleValue);},
parseBorderWidth : function(borderWidth) {
if (!this._borderThicknesses) {
var borderThicknesses = { };var div0 = document.createElement('div');div0.style.visibility = 'hidden';div0.style.position = 'absolute';div0.style.fontSize = '1px';document.body.appendChild(div0)
var div1 = document.createElement('div');div1.style.height = '0px';div1.style.overflow = 'hidden';div0.appendChild(div1);var base = div0.offsetHeight;div1.style.borderTop = 'solid black';div1.style.borderTopWidth = 'thin';borderThicknesses['thin'] = div0.offsetHeight - base;div1.style.borderTopWidth = 'medium';borderThicknesses['medium'] = div0.offsetHeight - base;div1.style.borderTopWidth = 'thick';borderThicknesses['thick'] = div0.offsetHeight - base;div0.removeChild(div1);document.body.removeChild(div0);this._borderThicknesses = borderThicknesses;}
if (borderWidth) {
switch(borderWidth) {
case 'thin':
case 'medium':
case 'thick':
return this._borderThicknesses[borderWidth];case 'inherit':
return 0;}
var unit = this.parseUnit(borderWidth);Sys.Debug.assert(unit.type == 'px', String.format(AjaxControlToolkit.Resources.Common_InvalidBorderWidthUnit, unit.type));return unit.size;}
return 0;},
parsePadding : function(padding) {
if(padding) {
if(padding == 'inherit') {
return 0;}
var unit = this.parseUnit(padding);Sys.Debug.assert(unit.type == 'px', String.format(AjaxControlToolkit.Resources.Common_InvalidPaddingUnit, unit.type));return unit.size;}
return 0;},
parseUnit : function(value) {
if (!value) {
throw Error.argumentNull('value');}
value = value.trim().toLowerCase();var l = value.length;var s = -1;for(var i = 0;i < l;i++) {
var ch = value.substr(i, 1);if((ch < '0' || ch > '9') && ch != '-' && ch != '.' && ch != ',') {
break;}
s = i;}
if(s == -1) {
throw Error.create(AjaxControlToolkit.Resources.Common_UnitHasNoDigits);}
var type;var size;if(s < (l - 1)) {
type = value.substring(s + 1).trim();} else {
type = 'px';}
size = parseFloat(value.substr(0, s + 1));if(type == 'px') {
size = Math.floor(size);}
return { 
size: size,
type: type
};},
getElementOpacity : function(element) {
if (!element) {
throw Error.argumentNull('element');}
var hasOpacity = false;var opacity;if (element.filters) {
var filters = element.filters;if (filters.length !== 0) {
var alphaFilter = filters['DXImageTransform.Microsoft.Alpha'];if (alphaFilter) {
opacity = alphaFilter.opacity / 100.0;hasOpacity = true;}
}
}
else {
opacity = this.getCurrentStyle(element, 'opacity', 1);hasOpacity = true;}
if (hasOpacity === false) {
return 1.0;}
return parseFloat(opacity);},
setElementOpacity : function(element, value) {
if (!element) {
throw Error.argumentNull('element');}
if (element.filters) {
var filters = element.filters;var createFilter = true;if (filters.length !== 0) {
var alphaFilter = filters['DXImageTransform.Microsoft.Alpha'];if (alphaFilter) {
createFilter = false;alphaFilter.opacity = value * 100;}
}
if (createFilter) {
element.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + (value * 100) + ')';}
}
else {
element.style.opacity = value;}
},
getVisible : function(element) {
return (element &&
("none" != $common.getCurrentStyle(element, "display")) &&
("hidden" != $common.getCurrentStyle(element, "visibility")));},
setVisible : function(element, value) {
if (element && value != $common.getVisible(element)) {
if (value) {
if (element.style.removeAttribute) {
element.style.removeAttribute("display");} else {
element.style.removeProperty("display");}
} else {
element.style.display = 'none';}
element.style.visibility = value ? 'visible' : 'hidden';}
},
resolveFunction : function(value) {
if (value) {
if (value instanceof Function) {
return value;} else if (String.isInstanceOfType(value) && value.length > 0) {
var func;if ((func = window[value]) instanceof Function) {
return func;} else if ((func = eval(value)) instanceof Function) {
return func;}
}
}
return null;},
addCssClasses : function(element, classNames) {
for(var i = 0;i < classNames.length;i++) {
Sys.UI.DomElement.addCssClass(element, classNames[i]);}
},
removeCssClasses : function(element, classNames) {
for(var i = 0;i < classNames.length;i++) {
Sys.UI.DomElement.removeCssClass(element, classNames[i]);}
},
setStyle : function(element, style) {
$common.applyProperties(element.style, style);},
removeHandlers : function(element, events) {
for (var name in events) {
$removeHandler(element, name, events[name]);}
},
overlaps : function(r1, r2) {
return r1.x < (r2.x + r2.width)
&& r2.x < (r1.x + r1.width)
&& r1.y < (r2.y + r2.height)
&& r2.y < (r1.y + r1.height);},
containsPoint : function(rect, x, y) {
return x >= rect.x && x < (rect.x + rect.width) && y >= rect.y && y < (rect.y + rect.height);},
isKeyDigit : function(keyCode) { 
return (0x30 <= keyCode && keyCode <= 0x39);},
isKeyNavigation : function(keyCode) { 
return (Sys.UI.Key.left <= keyCode && keyCode <= Sys.UI.Key.down);},
padLeft : function(text, size, ch, truncate) { 
return $common._pad(text, size || 2, ch || ' ', 'l', truncate || false);},
padRight : function(text, size, ch, truncate) { 
return $common._pad(text, size || 2, ch || ' ', 'r', truncate || false);},
_pad : function(text, size, ch, side, truncate) {
text = text.toString();var length = text.length;var builder = new Sys.StringBuilder();if (side == 'r') {
builder.append(text);} 
while (length < size) {
builder.append(ch);length++;}
if (side == 'l') {
builder.append(text);}
var result = builder.toString();if (truncate && result.length > size) {
if (side == 'l') {
result = result.substr(result.length - size, size);} else {
result = result.substr(0, size);}
}
return result;},
__DOMEvents : {
focusin : { eventGroup : "UIEvents", init : function(e, p) { e.initUIEvent("focusin", true, false, window, 1);} },
focusout : { eventGroup : "UIEvents", init : function(e, p) { e.initUIEvent("focusout", true, false, window, 1);} },
activate : { eventGroup : "UIEvents", init : function(e, p) { e.initUIEvent("activate", true, true, window, 1);} },
focus : { eventGroup : "UIEvents", init : function(e, p) { e.initUIEvent("focus", false, false, window, 1);} },
blur : { eventGroup : "UIEvents", init : function(e, p) { e.initUIEvent("blur", false, false, window, 1);} },
click : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("click", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);} },
dblclick : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("click", true, true, window, 2, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);} },
mousedown : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("mousedown", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);} },
mouseup : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("mouseup", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);} },
mouseover : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("mouseover", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);} },
mousemove : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("mousemove", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);} },
mouseout : { eventGroup : "MouseEvents", init : function(e, p) { e.initMouseEvent("mousemove", true, true, window, 1, p.screenX || 0, p.screenY || 0, p.clientX || 0, p.clientY || 0, p.ctrlKey || false, p.altKey || false, p.shiftKey || false, p.metaKey || false, p.button || 0, p.relatedTarget || null);} },
load : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("load", false, false);} },
unload : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("unload", false, false);} },
select : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("select", true, false);} },
change : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("change", true, false);} },
submit : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("submit", true, true);} },
reset : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("reset", true, false);} },
resize : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("resize", true, false);} },
scroll : { eventGroup : "HTMLEvents", init : function(e, p) { e.initEvent("scroll", true, false);} }
},
tryFireRawEvent : function(element, rawEvent) {
try {
if (element.fireEvent) {
element.fireEvent("on" + rawEvent.type, rawEvent);return true;} else if (element.dispatchEvent) {
element.dispatchEvent(rawEvent);return true;}
} catch (e) {
}
return false;}, 
tryFireEvent : function(element, eventName, properties) {
try {
if (document.createEventObject) {
var e = document.createEventObject();$common.applyProperties(e, properties || {});element.fireEvent("on" + eventName, e);return true;} else if (document.createEvent) {
var def = $common.__DOMEvents[eventName];if (def) {
var e = document.createEvent(def.eventGroup);def.init(e, properties || {});element.dispatchEvent(e);return true;}
}
} catch (e) {
}
return false;},
wrapElement : function(innerElement, newOuterElement, newInnerParentElement) {
var parent = innerElement.parentNode;parent.replaceChild(newOuterElement, innerElement);(newInnerParentElement || newOuterElement).appendChild(innerElement);},
unwrapElement : function(innerElement, oldOuterElement) {
var parent = oldOuterElement.parentNode;if (parent != null) {
$common.removeElement(innerElement);parent.replaceChild(innerElement, oldOuterElement);}
},
removeElement : function(element) {
var parent = element.parentNode;if (parent != null) {
parent.removeChild(element);}
},
applyProperties : function(target, properties) {
for (var p in properties) {
var pv = properties[p];if (pv != null && Object.getType(pv)===Object) {
var tv = target[p];$common.applyProperties(tv, pv);} else {
target[p] = pv;}
}
},
createElementFromTemplate : function(template, appendToParent, nameTable) {
if (typeof(template.nameTable)!='undefined') {
var newNameTable = template.nameTable;if (String.isInstanceOfType(newNameTable)) {
newNameTable = nameTable[newNameTable];}
if (newNameTable != null) {
nameTable = newNameTable;}
}
var elementName = null;if (typeof(template.name)!=='undefined') {
elementName = template.name;}
var elt = document.createElement(template.nodeName);if (typeof(template.name)!=='undefined' && nameTable) {
nameTable[template.name] = elt;}
if (typeof(template.parent)!=='undefined' && appendToParent == null) {
var newParent = template.parent;if (String.isInstanceOfType(newParent)) {
newParent = nameTable[newParent];}
if (newParent != null) {
appendToParent = newParent;}
}
if (typeof(template.properties)!=='undefined' && template.properties != null) {
$common.applyProperties(elt, template.properties);}
if (typeof(template.cssClasses)!=='undefined' && template.cssClasses != null) {
$common.addCssClasses(elt, template.cssClasses);}
if (typeof(template.events)!=='undefined' && template.events != null) {
$addHandlers(elt, template.events);}
if (typeof(template.visible)!=='undefined' && template.visible != null) {
this.setVisible(elt, template.visible);}
if (appendToParent) {
appendToParent.appendChild(elt);}
if (typeof(template.opacity)!=='undefined' && template.opacity != null) {
$common.setElementOpacity(elt, template.opacity);}
if (typeof(template.children)!=='undefined' && template.children != null) {
for (var i = 0;i < template.children.length;i++) {
var subtemplate = template.children[i];$common.createElementFromTemplate(subtemplate, elt, nameTable);}
}
var contentPresenter = elt;if (typeof(template.contentPresenter)!=='undefined' && template.contentPresenter != null) {
contentPresenter = nameTable[contentPresenter];}
if (typeof(template.content)!=='undefined' && template.content != null) {
var content = template.content;if (String.isInstanceOfType(content)) {
content = nameTable[content];}
if (content.parentNode) {
$common.wrapElement(content, elt, contentPresenter);} else {
contentPresenter.appendChild(content);}
}
return elt;},
prepareHiddenElementForATDeviceUpdate : function () {
var objHidden = document.getElementById('hiddenInputToUpdateATBuffer_CommonToolkitScripts');if (!objHidden) {
var objHidden = document.createElement('input');objHidden.setAttribute('type', 'hidden');objHidden.setAttribute('value', '1');objHidden.setAttribute('id', 'hiddenInputToUpdateATBuffer_CommonToolkitScripts');objHidden.setAttribute('name', 'hiddenInputToUpdateATBuffer_CommonToolkitScripts');if ( document.forms[0] ) {
document.forms[0].appendChild(objHidden);}
}
},
updateFormToRefreshATDeviceBuffer : function () {
var objHidden = document.getElementById('hiddenInputToUpdateATBuffer_CommonToolkitScripts');if (objHidden) {
if (objHidden.getAttribute('value') == '1') {
objHidden.setAttribute('value', '0');} else {
objHidden.setAttribute('value', '1');}
}
}
}
var CommonToolkitScripts = AjaxControlToolkit.CommonToolkitScripts = new AjaxControlToolkit._CommonToolkitScripts();var $common = CommonToolkitScripts;Sys.UI.DomElement.getVisible = $common.getVisible;Sys.UI.DomElement.setVisible = $common.setVisible;Sys.UI.Control.overlaps = $common.overlaps;AjaxControlToolkit._DomUtility = function() {
}
AjaxControlToolkit._DomUtility.prototype = {
isDescendant : function(ancestor, descendant) {
for (var n = descendant.parentNode;n != null;n = n.parentNode) {
if (n == ancestor) return true;}
return false;},
isDescendantOrSelf : function(ancestor, descendant) {
if (ancestor === descendant) 
return true;return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);},
isAncestor : function(descendant, ancestor) {
return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);},
isAncestorOrSelf : function(descendant, ancestor) {
if (descendant === ancestor)
return true;return AjaxControlToolkit.DomUtility.isDescendant(ancestor, descendant);},
isSibling : function(self, sibling) {
var parent = self.parentNode;for (var i = 0;i < parent.childNodes.length;i++) {
if (parent.childNodes[i] == sibling) return true;}
return false;}
}
AjaxControlToolkit._DomUtility.registerClass("AjaxControlToolkit._DomUtility");AjaxControlToolkit.DomUtility = new AjaxControlToolkit._DomUtility();AjaxControlToolkit.TextBoxWrapper = function(element) {
AjaxControlToolkit.TextBoxWrapper.initializeBase(this, [element]);this._current = element.value;this._watermark = null;this._isWatermarked = false;}
AjaxControlToolkit.TextBoxWrapper.prototype = {
dispose : function() {
this.get_element().AjaxControlToolkitTextBoxWrapper = null;AjaxControlToolkit.TextBoxWrapper.callBaseMethod(this, 'dispose');},
get_Current : function() {
this._current = this.get_element().value;return this._current;},
set_Current : function(value) {
this._current = value;this._updateElement();},
get_Value : function() {
if (this.get_IsWatermarked()) {
return "";} else {
return this.get_Current();}
},
set_Value : function(text) {
this.set_Current(text);if (!text || (0 == text.length)) {
if (null != this._watermark) {
this.set_IsWatermarked(true);}
} else {
this.set_IsWatermarked(false);}
},
get_Watermark : function() {
return this._watermark;},
set_Watermark : function(value) {
this._watermark = value;this._updateElement();},
get_IsWatermarked : function() {
return this._isWatermarked;},
set_IsWatermarked : function(isWatermarked) {
if (this._isWatermarked != isWatermarked) {
this._isWatermarked = isWatermarked;this._updateElement();this._raiseWatermarkChanged();}
},
_updateElement : function() {
var element = this.get_element();if (this._isWatermarked) {
if (element.value != this._watermark) {
element.value = this._watermark;}
} else {
if (element.value != this._current) {
element.value = this._current;}
}
},
add_WatermarkChanged : function(handler) {
this.get_events().addHandler("WatermarkChanged", handler);},
remove_WatermarkChanged : function(handler) {
this.get_events().removeHandler("WatermarkChanged", handler);},
_raiseWatermarkChanged : function() {
var onWatermarkChangedHandler = this.get_events().getHandler("WatermarkChanged");if (onWatermarkChangedHandler) {
onWatermarkChangedHandler(this, Sys.EventArgs.Empty);}
}
}
AjaxControlToolkit.TextBoxWrapper.get_Wrapper = function(element) {
if (null == element.AjaxControlToolkitTextBoxWrapper) {
element.AjaxControlToolkitTextBoxWrapper = new AjaxControlToolkit.TextBoxWrapper(element);}
return element.AjaxControlToolkitTextBoxWrapper;}
AjaxControlToolkit.TextBoxWrapper.registerClass('AjaxControlToolkit.TextBoxWrapper', Sys.UI.Behavior);AjaxControlToolkit.TextBoxWrapper.validatorGetValue = function(id) {
var control = $get(id);if (control && control.AjaxControlToolkitTextBoxWrapper) {
return control.AjaxControlToolkitTextBoxWrapper.get_Value();}
return AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue(id);}
if (typeof(ValidatorGetValue) == 'function') {
AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue = ValidatorGetValue;ValidatorGetValue = AjaxControlToolkit.TextBoxWrapper.validatorGetValue;}
if (Sys.CultureInfo.prototype._getAbbrMonthIndex) {
try {
Sys.CultureInfo.prototype._getAbbrMonthIndex('');} catch(ex) {
Sys.CultureInfo.prototype._getAbbrMonthIndex = function(value) {
if (!this._upperAbbrMonths) {
this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);}
return Array.indexOf(this._upperAbbrMonths, this._toUpper(value));}
Sys.CultureInfo.CurrentCulture._getAbbrMonthIndex = Sys.CultureInfo.prototype._getAbbrMonthIndex;Sys.CultureInfo.InvariantCulture._getAbbrMonthIndex = Sys.CultureInfo.prototype._getAbbrMonthIndex;}
}

//END AjaxControlToolkit.Common.Common.js
//START IngrPL.WebClient.Core.Platform.MapLayers.SingleImageLayerHelper.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");IngrPL.WebClient.Core.Platform.MapLayers.SingleImageLayerHelper=function(a){this._replaceImageDelegate=Function.createDelegate(this,this._replaceImage);this._imageReplaceDelegate=a};IngrPL.WebClient.Core.Platform.MapLayers.SingleImageLayerHelper.prototype={setImage:function(e,c,a,b){if(this._pendingImage){$removeHandler(this._pendingImage,"load",this._replaceImageDelegate);this._pendingImage=null}if(e){var d=this._pendingImage=document.createElement("img");$addHandler(this._pendingImage,"load",this._replaceImageDelegate);d.style.position="absolute";d.width=c;d.height=a;d.src=e;if(b<100){d.style.opacity=b/100;d.style.filter="alpha(opacity="+b+")"}}if(this._image&&!e&&this._image.style.display!="none"){$log.writeVerbose("hide image");this._image.style.display="none"}},_replaceImage:function(){$log.writeVerbose("replaceImage");$removeHandler(this._pendingImage,"load",this._replaceImageDelegate);if(this._image){this._mapLayerDiv.replaceChild(this._pendingImage,this._image)}else{this._mapLayerDiv.appendChild(this._pendingImage)}this._image=this._pendingImage;this._pendingImage=null;if(this._imageReplaceDelegate){this._imageReplaceDelegate()}this.setImagePosition()},setImagePosition:function(){if(!this._image){return}var b={width:this._mapLayerDiv.clientWidth,height:this._mapLayerDiv.clientHeight};var a=this._currentMapRange.getSize();var c=this._pendingMapRange.getSize();this._image.width=Math.round(b.width*a.width/c.width);this._image.height=Math.round(b.height*a.height/c.height);this._image.style.left=Math.round((this._currentMapRange.getBottomLeft().x-this._pendingMapRange.getBottomLeft().x)*b.width/c.width)+"px";this._image.style.top=Math.round((this._pendingMapRange.getUpperRight().y-this._currentMapRange.getUpperRight().y)*b.height/c.height)+"px"},setOpacity:function(a){if(a<100){if(this._pendingImage){this._pendingImage.style.opacity=a/100;this._pendingImage.style.filter="alpha(opacity="+a+")"}else{if(this._image){this._image.style.opacity=a/100;this._image.style.filter="alpha(opacity="+a+")"}}}},destroy:function(){if(this._pendingImage){$removeHandler(this._pendingImage,"load",this._replaceImageDelegate)}},get_mapLayerDiv:function(){return this._mapLayerDiv},set_mapLayerDiv:function(a){this._mapLayerDiv=a},get_currentMapRange:function(){return this._currentMapRange},set_currentMapRange:function(a){this._currentMapRange=a},get_pendingMapRange:function(){return this._pendingMapRange},set_pendingMapRange:function(a){this._pendingMapRange=a}};IngrPL.WebClient.Core.Platform.MapLayers.SingleImageLayerHelper.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.SingleImageLayerHelper");
//END IngrPL.WebClient.Core.Platform.MapLayers.SingleImageLayerHelper.js
//START IngrPL.WebClient.Core.Platform.Data.SelectedFeaturesManager.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.Data");IngrPL.WebClient.Core.Platform.Data._SelectedFeaturesManager=function(){this._selectedFeatures={};this._count=0};IngrPL.WebClient.Core.Platform.Data._SelectedFeaturesManager.prototype={init:function(f){this._selectedFeatures={};for(var e=0;e<f.length;e++){var c=f[e].Key;this._selectedFeatures[c]={};for(var d=0;d<f[e].Value.length;d++){var a=f[e].Value[d].Key;this._selectedFeatures[c][a]={};for(var b=0;b<f[e].Value[d].Value.length;b++){var g=f[e].Value[d].Value[b];this._selectedFeatures[c][a][g]=true;this._count++}}}this._saveSelectedFeatures()},setSelection:function(b,a){var e=false;var d=this.getSelectedFeatures(b);for(var c=0;c<a.length;c++){var f=a[c].id;if(a[c].selected){if(!d[f]){d[f]=true;this._count++;e=true}}else{if(d[f]){delete d[f];this._count--;e=true}}}if(e){this._saveSelectedFeatures()}return e},getSelectedFeatures:function(b){var c=b.get_mapService().get_id();var d=b.get_sourceLegendItemDefinition();var a;if(d){a=d.get_id()}else{a=b.get_id()}if(!this._selectedFeatures[c]){this._selectedFeatures[c]={}}if(!this._selectedFeatures[c][a]){this._selectedFeatures[c][a]={}}return this._selectedFeatures[c][a]},clear:function(){var d=false;for(var b in this._selectedFeatures){for(var a in this._selectedFeatures[b]){for(var c in this._selectedFeatures[b][a]){d=true;break}if(d){break}}if(d){break}}this._selectedFeatures={};this._count=0;if(d){this._saveSelectedFeatures()}return d},get_count:function(){return this._count},_saveSelectedFeatures:function(){var g=theForm.SelectedFeatures;if(!g){return}var c=[];for(var a in this._selectedFeatures){var i=false;var f=[];for(var b in this._selectedFeatures[a]){var h=false;var d=[];for(var e in this._selectedFeatures[a][b]){d.push(e);h=true}if(h){f.push({Key:b,Value:d});i=true}}if(i){c.push({Key:a,Value:f})}}g.value=Sys.Serialization.JavaScriptSerializer.serialize(c)}};IngrPL.WebClient.Core.Platform.Data.SelectedFeaturesManager=new IngrPL.WebClient.Core.Platform.Data._SelectedFeaturesManager();var $selectedFeatures=IngrPL.WebClient.Core.Platform.Data.SelectedFeaturesManager;
//END IngrPL.WebClient.Core.Platform.Data.SelectedFeaturesManager.js
//START IngrPL.WebClient.Core.Platform.MapLayers.GeoIntegratorMapServiceLayer.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");IngrPL.WebClient.Core.Platform.MapLayers.GeoIntegratorMapServiceLayer=function(a){IngrPL.WebClient.Core.Platform.MapLayers.GeoIntegratorMapServiceLayer.initializeBase(this,[a]);$event.register("opacityChanged",this._setOpacity,this);$event.register("selectedFeaturesChanged",this._onSelectedFeaturesChanged,this);this._mapId=IngrPL.WebClient.Core.Platform.MapLayers.GeoIntegratorMapServiceLayer._mapId||0;IngrPL.WebClient.Core.Platform.MapLayers.GeoIntegratorMapServiceLayer._mapId=this._mapId+1;var b=this._getMapServiceConfig().imageFormat;if(b==IngrPL.WebClient.Core.Platform.MapServices.ImageFormat.PNG||b==IngrPL.WebClient.Core.Platform.MapServices.ImageFormat.JPEG){this._isRaster=true;this._imageHelper=new IngrPL.WebClient.Core.Platform.MapLayers.SingleImageLayerHelper(Function.createDelegate(this,this._imageReplaced))}else{this._svgHelper=new IngrPL.WebClient.Core.Platform.MapLayers.SvgLayerHelper(Function.createDelegate(this,this._svgLoaded),Function.createDelegate(this,this._svgInitialized),Function.createDelegate(this,this._featureClicked));this.cDblClick=false}};IngrPL.WebClient.Core.Platform.MapLayers.GeoIntegratorMapServiceLayer.prototype={_render:function(){var b=this._getLegendItemDefinitionStubsString();if(b){this._currentBounds=$common.getBounds(this._mapLayerDiv);var a=this._renderingMapRange.getBottomLeft();var c=this._renderingMapRange.getUpperRight();if(this._request){this._request.get_executor().abort()}this._request=$webRequest.create({name:"GeoIntegratorMapService",filter:this._config.get_filter(),query:{action:"getmap",mapServiceId:this._config.get_mapService().get_id(),mapId:this._mapId,mapRange:[a.x,a.y,c.x,c.y].join(","),mapWidth:this._currentBounds.width,mapHeight:this._currentBounds.height,scaleDenominator:this._config.get_mapState().get_mapControl().get_scaleDenominator(),format:this._getMapServiceConfig().imageFormat},body:{legendItems:b},callback:this._requestCompleted,scope:this});this._request.invoke();this._onRendering();this._rendering=true}else{this._displayMap("")}},_requestCompleted:function(c){this._request=null;if(!IngrPL.WebClient.Core.Platform.Common.Util.checkExecutor(c,Function.createDelegate(this,function(d){this._handleError(String.format(IngrPL.WebClient.Core.Platform.Translate.ErrorRequestingGIMap_Format,d))}))){return}var a;try{a=Sys.Serialization.JavaScriptSerializer.deserialize(c.get_responseData())}catch(b){this._handleError(b)}if(a.error){this._handleError(a)}else{$log.writeInfo("GI3 map: {0}",a.url);this._displayMap(a.url)}},_handleError:function(a){if(this._rendering){this._onRendered();this._rendering=false}if(a.sessionExpired){$sessionManager.resume()}else{if(a.error){a=a.error}IngrPL.WebClient.Core.Platform.Common.Util.showError(a.toString())}},_displayMap:function(a){this._currentBounds=this._currentBounds||{width:0,height:0};if(this._isRaster){this._imageHelper.setImage(a,this._currentBounds.width,this._currentBounds.height,this._config.get_opacity())}else{this._svgHelper.displaySvg(a,this._currentBounds)}if(!a&&this._rendering){this._rendering=false;this._onRendered()}},_imageReplaced:function(){this._rendering=false;this._onRendered();this._imageHelper.set_currentMapRange(this._currentMapRange)},_svgLoaded:function(){this._onRendered();this._rendering=false;this._svgHelper.set_currentMapRange(this._currentMapRange)},_svgInitialized:function(){this._updateSelection()},_featureClicked:function(f,a,d,c){if(this._featureClickedHandler&&c.stopPropagation){c.stopPropagation()}if(c.preventDefault){c.preventDefault()}if(this.cDblClick&&this.cF){if(this.cF.fid==f&&this.cF.lid==a){clearTimeout(this._clickDblTimeoutId);$log.writeInfo("feature double clicked ID={0}, legend item ID={1}",f,a);if(this._featureClickedHandler){this._featureClickedHandler(f,a,d,c,true)}this.cF=null;this.cDblClick=false;return}}var b={fid:f,lid:a,tci:d,ev:{shiftKey:c.shiftKey,ctrlKey:c.ctrlKey},scope:this};this.cF=b;this.cDblClick=true;this._clickDblTimeoutId=setTimeout(Function.createDelegate(b,this._checkDblClick),300)},_checkDblClick:function(){this.cDblClick=false;$log.writeInfo("feature clicked ID={0}, legend item ID={1}",this.fid,this.lid);if(this.scope._featureClickedHandler){this.scope._featureClickedHandler(this.fid,this.lid,this.tci,this.ev)}this.scope.cF=null},_legendItemMoved:function(a,c,b){this._isDirty=true},_updateLegendItemsVisibility:function(a){if(this._isRaster){this._isDirty=true}else{this._isDirty=this._svgHelper.updateLegendItemsVisibility(a)||this._rendering||this._isDirty}},_updateScaleBands:function(a){this._isDirty=true},_removeLegendItems:function(a){if(this._isRaster){this._isDirty=true}else{this._isDirty=this._svgHelper.removeLegendItems(a)||this._rendering||this._isDirty}},_destroy:function(){if(this._rendering){this._onRendered()}if(this._isRaster){this._imageHelper.destroy()}else{this._svgHelper.destroy()}if(this._request){this._request.get_executor().abort()}$event.unregister("opacityChanged",this._setOpacity,this);$event.unregister("selectedFeaturesChanged",this._onSelectedFeaturesChanged,this)},refresh:function(){this._render()},_pendingMapRangeChanged:function(){if(this._isRaster){this._imageHelper.set_pendingMapRange(this._pendingMapRange);this._imageHelper.setImagePosition()}else{this._svgHelper.set_pendingMapRange(this._pendingMapRange);this._svgHelper.setViewBox()}},_setOpacity:function(b,a,c){if(this._config.get_id()!=a.mapLayerConfigId){return}if(this._isRaster){this._imageHelper.setOpacity(this._config.get_opacity())}},_getLegendItemDefinitionStubsString:function(){var f=this._config.get_mapState().get_legend().get_flatLegend();var h=[];for(var e=this._config.get_firstLegendItemPriority();e<=this._config.get_lastLegendItemPriority();e++){var a=f[e];if(a.canBeDisplayed()){var g=null;var d=a.get_analysisId();if(d){g=$analysisManager.findAnalysis(d)}var c=a.get_definition();var b=c.get_legendDefinition();h.push({i:a.get_id(),d:c.get_id(),l:a.get_isLocatable(),lg:b!=null,a:g?g.get_analysisStub():null})}}if(h.length){return Sys.Serialization.JavaScriptSerializer.serialize(h)}else{return""}},set_mapLayerDiv:function(a){IngrPL.WebClient.Core.Platform.MapLayers.GeoIntegratorMapServiceLayer.callBaseMethod(this,"set_mapLayerDiv",[a]);if(this._isRaster){this._imageHelper.set_mapLayerDiv(a)}else{this._svgHelper.set_mapLayerDiv(a)}},_isActive:function(){return !this._isRaster},_onSelectedFeaturesChanged:function(b,a,c){if(c==this){return}this._updateSelection(a.legendItemDefinitions)},_updateSelection:function(b){if(this._isRaster||!this._svgHelper.get_gwmCore().Legend){return}window._gwmCore=this._svgHelper.get_gwmCore();if(!b){_gwmCore.selectSet.clear()}var a=this._config.get_mapState().get_legend().get_flatLegend();var n=_gwmCore.Legend.groupEntries;for(var g=this._config.get_firstLegendItemPriority();g<=this._config.get_lastLegendItemPriority();g++){var m=a[g];var c=m.get_definition();if(b){var p=false;for(var e=0,d=b.length;e<d;e++){if(b[e]==(c.get_sourceLegendItemDefinition()||c)){p=true;break}}if(!p){continue}}var k=n.item("gwmle:"+m.get_id());if(k){if(b){this._clearSelectSet(k)}var h=$selectedFeatures.getSelectedFeatures(m.get_definition());for(var f in h){var o=this._findFeature(f,k);if(o){o.select()}}}}},selectFeature:function(f,j,n,c){window._gwmCore=this._svgHelper.get_gwmCore();var i=_gwmCore.Legend.groupEntries;var d="gwmle:"+j;var h=i.item(d);if(h&&n){d+=":"+n;h=h.groupEntries.item(d)}var l=this._config.get_mapState().get_legend();var g=l.findLegendItem(j);var m=false;var a=false;if(h){var o=this._findFeature(f,h);if(o){if(c){var e=o.isSelected();o[e?"unselect":"select"]();var k=[{id:f,selected:!e}];m=$selectedFeatures.setSelection(g.get_definition(),k)}else{_gwmCore.selectSet.clear();o.select();var k=[{id:f,selected:true}];a=$selectedFeatures.clear();m=$selectedFeatures.setSelection(g.get_definition(),k)}}}if(a){$event.notify("selectedFeaturesChanged",{},this)}else{if(m){var b=g.get_definition();$event.notify("selectedFeaturesChanged",{legendItemDefinitions:[b.get_sourceLegendItemDefinition()||b]},this)}}},_selectFeatures:function(c){window._gwmCore=this._svgHelper.get_gwmCore();_gwmCore.selectSet.clear();var r=$selectedFeatures.clear();var a=this._config.get_mapState().get_legend().get_flatLegend();var o=_gwmCore.Legend.groupEntries;for(var k=this._config.get_firstLegendItemPriority(),f=this._config.get_lastLegendItemPriority();k<=f;k++){var n=a[k];var d=n.get_definition();d=d.get_sourceLegendItemDefinition()||d;var b=d.get_id();if(c[b]){var e="gwmle:"+n.get_id();var m=o.item(e);var p=[];for(var g=0,q=c[b].length;g<q;g++){var h=c[b][g];p.push({id:h,selected:true});if(m){var s=this._findFeature(h,m);if(s){s.select()}}}r=$selectedFeatures.setSelection(d,p)||r}}if(r){$event.notify("selectedFeaturesChanged",{},this)}},_findFeature:function(g,f){if(f.locatable&&f.pkFields&&f.pkFields.length==1){var e=new PrimaryKey(f.pkFields,[g]);var d=f.g.findFeatureElement(e);if(d){return _gwmCore.getFeature(d)}}for(var c=0;c<f.groupEntries.count;c++){var a=f.groupEntries.item(c);var b=this._findFeature(g,a);if(b){return b}}return null},_clearSelectSet:function(c){var b=c.selectedFeatures.toArray();for(var a=0;a<b.length;a++){b[a].unselect()}for(var a=0;a<c.groupEntries.count;a++){this._clearSelectSet(c.groupEntries.item(a))}}};IngrPL.WebClient.Core.Platform.MapLayers.GeoIntegratorMapServiceLayer.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.GeoIntegratorMapServiceLayer",IngrPL.WebClient.Core.Platform.MapLayers.MapLayer);
//END IngrPL.WebClient.Core.Platform.MapLayers.GeoIntegratorMapServiceLayer.js
//START IngrPL.WebClient.Core.Platform.Common.CoordinateReferenceSystemManager.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.Common");IngrPL.WebClient.Core.Platform.Common.CoordinateReferenceSystem=function(a){this._id=a.id;this._isGeographic=a.isGeographic?true:false;this._isPersistent=a.isPersistent?true:false};IngrPL.WebClient.Core.Platform.Common.CoordinateReferenceSystem.prototype={get_id:function(){return this._id},get_name:function(){if(IngrPL.WebClient.Core.Platform.Common._CRSNames){return IngrPL.WebClient.Core.Platform.Common._CRSNames[this._id]||null}else{return null}},get_isGeographic:function(){return this._isGeographic},serialize:function(){return{id:this._id,isGeographic:this._isGeographic}}};IngrPL.WebClient.Core.Platform.Common._CoordinateReferenceSystemManager=function(){this._crsDict={};this._save();this._toDegreesConverters={};this._toMetersConverters={}};IngrPL.WebClient.Core.Platform.Common._CoordinateReferenceSystemManager.prototype={registerCRS:function(a){this.registerCRSs([a])},registerCRSs:function(b){if(b==null){throw Error.argumentNull("crsStubs")}if(!Array.isInstanceOfType(b)){throw Error.argumentType("crsStubs",Object.getType(b),Array)}var e=false;for(var d=0,a=b.length;d<a;d++){var f=b[d];var c=this._crsDict[f.id];if(!c){if(String.isInstanceOfType(f)){c=new IngrPL.WebClient.Core.Platform.Common.CoordinateReferenceSystem({id:f})}else{c=new IngrPL.WebClient.Core.Platform.Common.CoordinateReferenceSystem(f)}this._crsDict[c.get_id()]=c;e=true}if(!this._current||f.isDefault){if(this._current!=c){e=true}this._current=c}}this._save();if(e){$event.notify("crsListChanged")}},getCurrent:function(){return this._current||null},setCurrent:function(m,d,c,b){var n=IngrPL.WebClient.Core.Platform.MapContent.MapRange;function g(){if(c){c.apply(b||window,arguments)}}function e(A){this._current=this._crsDict[m];this._save(true);var B=0,D,C;for(var z=0,y=j.length;z<y;z++){var E=j[z];if(!o[E]){D=A[B++];C=A[B++];h[E].setMapRangeByPoints(D.x,D.y,C.x,C.y);if(!h[E].get_fitAllRange(m)){D=A[B++];C=A[B++];h[E].set_fitAllRange(m,new n([D.x,D.y,C.x,C.y]))}}}g(true)}var q=this._current.get_id();if(m&&m!=q&&this._crsDict[m]){var h=$mapStateManager.get_mapStates();var j=[];for(var f in h){j.push(f)}var o={};if(d){for(var u=0,r=d.length;u<r;u++){o[d[u]]=true}}var a=$mapServiceManager.get_mapServices();var t=[];function k(i){var y=i.getBottomLeft(),l=i.getUpperRight();t.push(y,l)}for(var u=0,r=j.length;u<r;u++){var p=j[u];if(!o[p]){k(h[p].get_mapRange());if(!h[p].get_fitAllRange(m)){k(h[p].get_fitAllRange())}}}if(t.length){var v=false;for(var x in a){var s=a[x];if(s.get_definition().supportsTransformation){s.transformPoints(this._current,this._crsDict[m],t,e,this);v=true;break}}if(!v){t=[];for(var u=0,r=j.length;u<r;u++){var p=j[u];if(!o[p]){var w=h[p].get_fitAllRange(m,true);if(w){k(w)}else{g(false);return}}}e.call(this,t)}}else{e.call(this,[])}}else{g(false)}},_save:function(c){if(!c){var d=[];for(var b in this._crsDict){var a=this._crsDict[b];if(!a._isPersistent){d.push(a.serialize())}}if(!this._crsField){this._crsField=document.createElement("input");this._crsField.type="hidden";this._crsField.id=this._crsField.name="__wc_crs";theForm.appendChild(this._crsField)}this._crsField.value=Sys.Serialization.JavaScriptSerializer.serialize(d)}if(!this._currentCRSIdField){this._currentCRSIdField=document.createElement("input");this._currentCRSIdField.type="hidden";this._currentCRSIdField.id=this._currentCRSIdField.name="__wc_currentcrsid";theForm.appendChild(this._currentCRSIdField)}if(this._current){this._currentCRSIdField.value=this._current.get_id()}this._initExtRequests()},_initExtRequests:function(){if(this._extRequestsInitialized){return}if(!window.Ext||!Ext.Ajax){return}Ext.Ajax.on("beforerequest",function(d,b){var e=["__wc_crs","__wc_currentcrsid"];if(String.isInstanceOfType(b.params)){for(var c=0,a=e.length;c<a;c++){if(b.params.length){b.params+="&"}b.params+=e[c]+"="+theForm[e[c]].value}return}else{if(!b.params){b.params={}}}for(var c=0,a=e.length;c<a;c++){b.params[e[c]]=theForm[e[c]].value}});this._extRequestsInitialized=true},get_crsDict:function(){return this._crsDict},canConvertToDegrees:function(){if(!this._current){return false}return typeof(this._toDegreesConverters[this._current.get_id()])=="function"},canConvertToMeters:function(){if(!this._current){return false}return typeof(this._toMetersConverters[this._current.get_id()])=="function"},convertToDegrees:function(a,b){if(this.canConvertToDegrees()){return this._toDegreesConverters[this._current.get_id()](a,b)}else{return null}},convertToMeters:function(b,a){if(this.canConvertToMeters()){return this._toMetersConverters[this._current.get_id()](b,a)}else{return null}},registerConverter:function(a,b,c){if(c){this._toDegreesConverters[a]=b}else{this._toMetersConverters[a]=b}},registerMapping:function(b,a){if(!this._mappings){this._mappings={}}if(!this._mappings[b]){this._mappings[b]=[]}this._mappings[b].push(a);if(!this._mappings[a]){this._mappings[a]=[]}this._mappings[a].push(b)},getMappings:function(a){if(!a||!String.isInstanceOfType(a)){if(!this._current){return false}a=this._current.get_id()}if(this._mappings){return this._mappings[a]||[]}else{return[]}},isGoogle:function(a){if(!a||!String.isInstanceOfType(a)){if(!this._current){return false}a=this._current.get_id()}return a=="EPSG:3785"}};IngrPL.WebClient.Core.Platform.Common._CoordinateReferenceSystemManager.registerClass("IngrPL.WebClient.Core.Platform.Common._CoordinateReferenceSystemManager");IngrPL.WebClient.Core.Platform.Common.CoordinateReferenceSystemManager=new IngrPL.WebClient.Core.Platform.Common._CoordinateReferenceSystemManager;var $crs=IngrPL.WebClient.Core.Platform.Common.CoordinateReferenceSystemManager;(function(){var a=2*Math.PI*6378137/2;$crs.registerConverter("EPSG:3785",function(b,e){var d=(b/a)*180;var c=(e/a)*180;c=180/Math.PI*(2*Math.atan(Math.exp(c*Math.PI/180))-Math.PI/2);return{lat:c,lon:d}},true);$crs.registerConverter("EPSG:3785",function(d,c){var b=d*a/180;var e=Math.log(Math.tan((90+c)*Math.PI/360))/(Math.PI/180);e=e*a/180;return{x:b,y:e}},false)})();$crs.registerMapping("CRS:84","EPSG:4326");
//END IngrPL.WebClient.Core.Platform.Common.CoordinateReferenceSystemManager.js
//START IngrPL.WebClient.Core.Platform.MapLayers.MapPublisherLayer.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");IngrPL.WebClient.Core.Platform.MapLayers.MapPublisherLayer=function(a){IngrPL.WebClient.Core.Platform.MapLayers.MapPublisherLayer.initializeBase(this,[a]);$event.register("opacityChanged",this._setOpacity,this);this._useTransparency=true;var c=this._getMapServiceConfig();var b=c.boundingBox;if(b!=null&&b.length==4){this._bounds={bottomLeft:{x:b[0],y:b[1]},upperRight:{x:b[2],y:b[3]}}}else{this._bounds=null}};IngrPL.WebClient.Core.Platform.MapLayers.MapPublisherLayer.prototype={_render:function(){var a=$common.getBounds(this._mapLayerDiv);var b;if(layers&&this._checkBounds()){this._onRendering();this._rendering=true}else{b=""}if(!b&&this._rendering){this._rendering=false;this._onRendered()}},_legendItemMoved:function(a,c,b){this._isDirty=true},_updateLegendItemsVisibility:function(a){this._isDirty=true},_updateScaleBands:function(a){this._isDirty=true},_removeLegendItems:function(a){this._isDirty=true},_setOpacity:function(b,a,c){},_checkBounds:function(){if(this._bounds==null){$log.writeInfo("\nLack of BoundingBox\nMapPublisher: "+this._config.get_name()+"\nURL: "+this._getMapServiceConfig().url);return true}var a={bottomLeft:this._renderingMapRange.getBottomLeft(),upperRight:this._renderingMapRange.getUpperRight()};return this._intersectsBounds(a,true)},_intersectsBounds:function(d,b){if(b==null){b=true}var f=(d.bottomLeft.y==this._bounds.bottomLeft.y&&d.upperRight.y==this._bounds.upperRight.y)?true:(((d.bottomLeft.y>this._bounds.bottomLeft.y)&&(d.bottomLeft.y<this._bounds.upperRight.y))||((this._bounds.bottomLeft.y>d.bottomLeft.y)&&(this._bounds.bottomLeft.y<d.upperRight.y)));var e=(d.bottomLeft.y==this._bounds.bottomLeft.y&&d.upperRight.y==this._bounds.upperRight.y)?true:(((d.upperRight.y>this._bounds.bottomLeft.y)&&(d.upperRight.y<this._bounds.upperRight.y))||((this._bounds.upperRight.y>d.bottomLeft.y)&&(this._bounds.upperRight.y<d.upperRight.y)));var a=(d.bottomLeft.x==this._bounds.bottomLeft.x&&d.upperRight.x==this._bounds.upperRight.x)?true:(((d.bottomLeft.x>this._bounds.bottomLeft.x)&&(d.bottomLeft.x<this._bounds.upperRight.x))||((this._bounds.bottomLeft.x>d.bottomLeft.x)&&(this._bounds.bottomLeft.x<d.upperRight.x)));var c=(d.bottomLeft.x==this._bounds.bottomLeft.x&&d.upperRight.x==this._bounds.upperRight.x)?true:(((d.upperRight.x>this._bounds.bottomLeft.x)&&(d.upperRight.x<this._bounds.upperRight.x))||((this._bounds.upperRight.x>d.bottomLeft.x)&&(this._bounds.upperRight.x<d.upperRight.x)));return(this._containsBounds(d,this._bounds,true,b)||this._containsBounds(this._bounds,d,true,b)||((e||f)&&(c||a)))},_containsBounds:function(e,h,d,b){if(d==null){d=false}if(b==null){b=true}var c;var g;var a;var f;if(b){c=(e.upperRight.x>=h.bottomLeft.x)&&(e.upperRight.x<=h.upperRight.x);g=(e.upperRight.y>=h.bottomLeft.y)&&(e.upperRight.y<=h.upperRight.y);a=(e.bottomLeft.x>=h.bottomLeft.x)&&(e.bottomLeft.x<=h.upperRight.x);f=(e.bottomLeft.y>=h.bottomLeft.y)&&(e.bottomLeft.y<=h.upperRight.y)}else{c=(e.upperRight.x>h.bottomLeft.x)&&(e.upperRight.x<h.upperRight.x);g=(e.upperRight.y>h.bottomLeft.y)&&(e.upperRight.y<h.upperRight.y);a=(e.bottomLeft.x>h.bottomLeft.x)&&(e.bottomLeft.x<h.upperRight.x);f=(e.bottomLeft.y>h.bottomLeft.y)&&(e.bottomLeft.y<h.upperRight.y)}return(d)?(g||f)&&(c||a):(g&&c&&f&&a)},_destroy:function(){if(this._rendering){this._onRendered()}$event.unregister("opacityChanged",this._setOpacity,this)},set_mapLayerDiv:function(a){IngrPL.WebClient.Core.Platform.MapLayers.MapPublisherLayer.callBaseMethod(this,"set_mapLayerDiv",[a])}};IngrPL.WebClient.Core.Platform.MapLayers.MapPublisherLayer.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.MapPublisherLayer",IngrPL.WebClient.Core.Platform.MapLayers.MapLayer);
//END IngrPL.WebClient.Core.Platform.MapLayers.MapPublisherLayer.js
//START IngrPL.WebClient.Core.Platform.MapLayers.mWMSLayer.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");IngrPL.WebClient.Core.Platform.MapLayers.mWMSLayer=function(a){IngrPL.WebClient.Core.Platform.MapLayers.mWMSLayer.initializeBase(this,[a]);$event.register("opacityChanged",this._setOpacity,this);this._useTransparency=true;this._isRaster=true;var c=this._getMapServiceConfig();var b=IngrPL.WebClient.Core.Platform.MapServices.ImageFormat;switch(c.imageFormat){case b.JPEG:this._imageFormat="image/jpeg";this._useTransparency=false;break;case b.SVG:case b.SVGZ:this._imageFormat="image/svg+xml";this._isRaster=false;break;default:this._imageFormat="image/png";break}this._isInitialized=false;this._WMSStubContainer=[];this._subWMSContainer=[];this._rendering=[];if(a.get_mapService().get_definition().name=="WMS"){this._createWMSStub()}else{this._createmWMSStub()}this._appendWMSCapabilitiesDelegate=Function.createDelegate(this,this._appendWMSCapabilities)};IngrPL.WebClient.Core.Platform.MapLayers.mWMSLayer.prototype={_initialize:function(){for(var b=0,a=this._WMSStubContainer.length;b<a;b++){this._subWMSContainer.push(new IngrPL.WebClient.Core.Platform.MapLayers._subWMSLayer(this,this._WMSStubContainer[b]));this._rendering.push(false)}this._isInitialized=true},_getSubWMSCapabilities:function(a,d){var c=new Sys.Net.WebRequest();var b=new Sys.StringBuilder();b.append("mapServiceId="+this._config._mapService._id);b.append("url="+a);b.append("index="+d);var e=b.toString("&");c.set_url("mWMSLayer.WebClient.ashx?"+e);c.set_httpVerb("GET");c.add_completed(this._appendWMSCapabilitiesDelegate);$log.writeInfo("\nSub mWMS service initialization request:\n"+a);c.invoke()},_appendWMSCapabilities:function(g,c){var d=IngrPL.WebClient.Core.Platform.Common.Util;if(!d.checkExecutor(g,d.showError)){return}var b=Sys.Serialization.JavaScriptSerializer.deserialize(g.get_responseData());if(!b.error){if(b.initialized){$log.writeInfo("\nSub mWMS service initialized:\n"+b.url);this._subWMSContainer[b.clientSideServiceIndex].isSubLayerInitialized=true;this._subWMSContainer[b.clientSideServiceIndex].isSubLayerValid=true;if(!this._subWMSContainer[b.clientSideServiceIndex].get_version()){this._subWMSContainer[b.clientSideServiceIndex].set_version(b.version)}if(!this._subWMSContainer[b.clientSideServiceIndex].get_bounds()){var f={};for(var e=0,a=b.bBox.length;e<a;e++){f[b.bBox[e].Key]=b.bBox[e].Value}this._subWMSContainer[b.clientSideServiceIndex].set_bounds(f)}this._subWMSContainer[b.clientSideServiceIndex].render()}else{this._subWMSContainer[b.clientSideServiceIndex].isSubLayerInitialized=true;$log.writeInfo("Failed to initialize sub mWMS service:\n"+b.url)}}else{$log.writeInfo("Sub mWMS service initialization throws response error.")}},_render:function(){if(!this._isInitialized){this._initialize()}for(var a=0;a<this._subWMSContainer.length;a++){if(this._getVisibleLegendItemDefinitionIdsString()&&this._subWMSContainer[a].checkBounds()&&!this._subWMSContainer[a].isSubLayerInitialized){this._getSubWMSCapabilities(this._subWMSContainer[a].get_url(),a)}else{if(this._subWMSContainer[a].isSubLayerValid){this._subWMSContainer[a].render()}}}},_callOnRendered:function(){for(var b=0;b<this._rendering.length;b++){if(this._rendering[b]==true){return}}var a=this._currentMapRange;this._onRendered();this._currentmapRange=a},_isRendering:function(){for(var a=0;a<this._rendering.length;a++){if(this._rendering[a]==true){return true}}return false},_pendingMapRangeChanged:function(){if(!this._isInitialized){this._initialize()}for(var a=0;a<this._subWMSContainer.length;a++){this._subWMSContainer[a].onPendingMapRangeChanged()}},_legendItemMoved:function(a,c,b){this._isDirty=true},_updateLegendItemsVisibility:function(a){this._isDirty=true},_updateScaleBands:function(a){this._isDirty=true},_removeLegendItems:function(a){this._isDirty=true},_getVisibleLegendItemDefinitionIdsString:function(c){var d=[],b,a=this._getDisplayableContent().legendItems;var e=this;Array.forEach(a,function(h){b=h.get_definition();var j=b.get_id();var f=e._config.get_mapService().get_config().suportedLayers;if(c&&f){for(var g in f){if(f[g]==j&&c[g]!=null){j=c[g];break}}}d.push(j)});return d.join(",")},_setOpacity:function(b,a,d){if(this._config.get_id()!=a.mapLayerConfigId){return}for(var c=0;c<this._subWMSContainer.length;c++){this._subWMSContainer[c].setOpacity()}},_createWMSStub:function(){var g=this._getMapServiceConfig();var d=g.boundingBoxes;var f={};for(var c=0,a=d.length;c<a;c++){var e=d[c].value;if(e&&e.length==4){f[d[c].key]={bottomLeft:{x:e[0],y:e[1]},upperRight:{x:e[2],y:e[3]}}}}var b={index:0,url:g.url,version:g.version,bBox:f};this._WMSStubContainer.push(b)},_createmWMSStub:function(){var g=this._getMapServiceConfig();g.boundingBoxList=this._createConfigObject(g.boundingBoxList);g.aliases=this._createConfigObject(g.aliases);for(var d=0,a=g.urls.length;d<a;d++){var e=g.boundingBoxList[g.urls[d]];var f={};for(var b in e){if(e[b]&&e[b].length==4){f[b]={bottomLeft:{x:e[b][0],y:e[b][1]},upperRight:{x:e[b][2],y:e[b][3]}}}}var c={index:d,url:g.urls[d],alias:g.aliases[g.urls[d]],version:g.versions[d],bBox:f};this._WMSStubContainer.push(c)}},_createConfigObject:function(c){if(!c.length){return c}var a={};if(c!=null){for(var b=0;b<c.length;b++){if(c[b]!=null&&c[b].key){if(c[b].value.length&&typeof(c[b].value)!="string"&&c[b].value.length>0){a[c[b].key]=this._createConfigObject(c[b].value)}else{a[c[b].key]=c[b].value}}else{if(Array.isInstanceOfType(c)){return c}else{a[b]=c[b]}}}}return a},_destroy:function(){$event.unregister("opacityChanged",this._setOpacity,this);var b=false;for(var a=0;a<this._subWMSContainer.length;a++){this._subWMSContainer[a].destroy();if(this._rendering[a]==true){b=true}}if(b){this._onRendered()}}};IngrPL.WebClient.Core.Platform.MapLayers.mWMSLayer.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.mWMSLayer",IngrPL.WebClient.Core.Platform.MapLayers.MapLayer);IngrPL.WebClient.Core.Platform.MapLayers._subWMSLayer=function(a,b){this._subLayerDiv;this._mapLayer=a;this._WmsLayerStub=b;this._subLayerCurrentMapRange;var c=this._mapLayer._getMapServiceConfig();this._url=this._WmsLayerStub.url;this._version=this._WmsLayerStub.version;this._bounds=this._WmsLayerStub.bBox;this._alias=this._WmsLayerStub.alias;if(!c.firstInitialized||this._url==c.firstInitialized){this.isSubLayerInitialized=true;this.isSubLayerValid=true}else{this.isSubLayerInitialized=false;this.isSubLayerValid=false}if(this._mapLayer._isRaster){this._imageHelper=new IngrPL.WebClient.Core.Platform.MapLayers.SingleImageLayerHelper(Function.createDelegate(this,this._imageReplaced))}else{this._svgHelper=new IngrPL.WebClient.Core.Platform.MapLayers.SvgLayerHelper(Function.createDelegate(this,this._svgLoaded))}};IngrPL.WebClient.Core.Platform.MapLayers._subWMSLayer.prototype={render:function(){if(!this._subLayerDiv){this._createSubLayerDiv()}var b=$common.getBounds(this._mapLayer._mapLayerDiv);var d=this._mapLayer._getVisibleLegendItemDefinitionIdsString(this._alias);var a;var j=this._mapLayer._getDisplayableContent().crsId||$crs.getCurrent().get_id();if(d&&this.checkBounds()){var g=new Sys.StringBuilder();g.append("service=WMS");g.append("request=GetMap");g.append("version="+this._version);g.append("width="+b.width);g.append("height="+b.height);if(this._version.indexOf("1.3.")==0){g.append("CRS="+j)}else{g.append("SRS="+j)}g.append("layers="+d);var f=this._mapLayer._renderingMapRange.getBottomLeft();var h=this._mapLayer._renderingMapRange.getUpperRight();g.append("bbox="+[f.x,f.y,h.x,h.y].join(","));g.append("format="+this._mapLayer._imageFormat);if(this._mapLayer._useTransparency){g.append("TRANSPARENT=TRUE")}var k="styles=";for(var c=0;c<d.split(",").length-1;c++){k+=","}g.append(k);var e=this._url.indexOf("?")<0?"?":"&";a=String.format("{0}{1}{2}",this._url,e,g.toString("&"));if(!this._mapLayer._isRendering()){this._mapLayer._onRendering()}this._mapLayer._rendering[this._WmsLayerStub.index]=true}else{a=""}if(this._mapLayer._isRaster){this._imageHelper.setImage(a,b.width,b.height,this._mapLayer._config.get_opacity())}else{if(a){a="SVGLayer.WebClient.ashx?url="+encodeURIComponent(a)}this._svgHelper.displaySvg(a,b)}if(!a&&this._mapLayer._rendering[this._WmsLayerStub.index]){this._mapLayer._rendering[this._WmsLayerStub.index]=false;this._subLayerCurrentMapRange=this._mapLayer._renderingMapRange;this._mapLayer._callOnRendered()}},_imageReplaced:function(){this._mapLayer._rendering[this._WmsLayerStub.index]=false;this._imageHelper.set_currentMapRange(this._mapLayer._renderingMapRange);this._mapLayer._callOnRendered()},_svgLoaded:function(){this._mapLayer._rendering[this._WmsLayerStub.index]=false;this._svgHelper.set_currentMapRange(this._mapLayer._renderingMapRange);this._mapLayer._callOnRendered()},_createSubLayerDiv:function(){this._subLayerDiv=document.createElement("div");this._subLayerDiv.style.position="absolute";this._subLayerDiv.style.padding="0";this._subLayerDiv.style.margin="0";this._subLayerDiv.style.width="100%";this._subLayerDiv.style.height="100%";this._mapLayer._mapLayerDiv.appendChild(this._subLayerDiv);if(this._mapLayer._isRaster){this._imageHelper.set_mapLayerDiv(this._subLayerDiv)}else{this._svgHelper.set_mapLayerDiv(this._subLayerDiv)}},destroy:function(){if(this._mapLayer._isRaster){this._imageHelper.destroy()}else{this._svgHelper.destroy()}if(this._subLayerDiv){this._mapLayer._mapLayerDiv.removeChild(this._subLayerDiv)}},setOpacity:function(){if(this._mapLayer._isRaster){this._imageHelper.setOpacity(this._mapLayer._config.get_opacity())}},onPendingMapRangeChanged:function(){if(this._mapLayer._isRaster){this._imageHelper.set_pendingMapRange(this._mapLayer._pendingMapRange);this._imageHelper.setImagePosition()}else{this._svgHelper.set_pendingMapRange(this._mapLayer._pendingMapRange);this._svgHelper.setViewBox()}},checkBounds:function(){if(this._bounds==null){$log.writeInfo("\nLack of BoundingBox\nmWMS: "+this._mapLayer._config.get_name()+"\nWMS URL: "+this._url);return true}var a={bottomLeft:this._mapLayer._renderingMapRange.getBottomLeft(),upperRight:this._mapLayer._renderingMapRange.getUpperRight()};return IngrPL.WebClient.Core.Platform.Common.Util.checkBounds(this._bounds,a)},get_bounds:function(){return this._bounds},set_bounds:function(b){this._bounds={};for(var a in b){if(b[a]&&b[a].length==4){this._bounds[a]={bottomLeft:{x:b[a][0],y:b[a][1]},upperRight:{x:b[a][2],y:b[a][3]}}}}},get_url:function(){return this._url},get_version:function(){return this._version},set_version:function(a){this._version=a}};IngrPL.WebClient.Core.Platform.MapLayers._subWMSLayer.registerClass("IngrPL.WebClient.Core.Platform.MapLayers._subWMSLayer");IngrPL.WebClient.Core.Platform.MapLayers.mWMSLayer.preparemWMSServiceArray=function(d){function c(g){return Array.isInstanceOfType(g)}var b=[];for(var f=0,a=d.length;f<a;f++){var e=d[f];if(e.url!==undefined){b.push(e.url)}else{continue}if(e.alias!==undefined&&c(e.alias)){b.push(e.alias)}else{b.push(null)}if(e.version!==undefined){b.push(e.version)}else{b.push(null)}if(e.boundingBox!==undefined){b.push(IngrPL.WebClient.Core.Platform.MapLayers.mWMSLayer.preparemWMSBoundingBoxList([e.boundingBox]))}else{b.push(null)}}return b};IngrPL.WebClient.Core.Platform.MapLayers.mWMSLayer.preparemWMSBoundingBoxList=function(e){function f(b){return Array.isInstanceOfType(b)}function g(o,n){if(n<=0){return}var b=0;for(var m=0,c=o.length-1;m<c;m++){if((m+1)%n==0){o.splice(m+b+1,0,null);b++}}}var d=$crs.getCurrent();var j=[];var k=[];for(var a in e){if(typeof e[a]=="function"){continue}if(f(e[a])){var l={};l[d.get_id()]=e[a];e[a]=l}for(var h in j){if(typeof j[h]=="function"){continue}if(e[a][j[h]]){k.push(e[a][j[h]]);delete e[a][j[h]]}else{k.push(null)}}for(var i in e[a]){if(typeof e[a][i]=="function"){continue}j.push(i);g(k,j.length-1);k.push(e[a][i])}}return j.concat(k)};
//END IngrPL.WebClient.Core.Platform.MapLayers.mWMSLayer.js
//START IngrPL.WebClient.Core.Platform.ClientScript.Settings.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.ClientScript");IngrPL.WebClient.Core.Platform.ClientScript._Settings=function(){this._settings=[];this._settingsByName={};this._initialValues={};var g=document.cookie+";";var d=/\s?(.*?)=(.*?);/g;var f;while((f=d.exec(g))!=null){var a=f[1];var e=f[2];this._initialValues[a]=e}var b=IngrPL.WebClient.Core.Platform.Translate;this._addSetting(new IngrPL.WebClient.Core.Platform.ClientScript.NumberSetting({name:"screenSize",displayName:b.ScreenSize,defaultValue:19,minValue:7,allowNull:false}));this._addSetting(new IngrPL.WebClient.Core.Platform.ClientScript.BooleanSetting({name:"showCoords",displayName:b.ShowCoords,defaultValue:true,allowNull:false}));this._addSetting(new IngrPL.WebClient.Core.Platform.ClientScript.BooleanSetting({name:"showScale",displayName:b.ShowScale,defaultValue:true,allowNull:false}));this._addSetting(new IngrPL.WebClient.Core.Platform.ClientScript.BooleanSetting({name:"showNavigator",displayName:b.ShowNavigator,defaultValue:true,allowNull:false}));this._addSetting(new IngrPL.WebClient.Core.Platform.ClientScript.BooleanSetting({name:"showCrosshair",displayName:b.ShowCrosshair,defaultValue:true,allowNull:false}));this._addSetting(new IngrPL.WebClient.Core.Platform.ClientScript.SelectSetSetting({name:"selectSet",displayName:b.ForItemsInSelectSet,defaultValue:0,allowNull:false}))};IngrPL.WebClient.Core.Platform.ClientScript._Settings.prototype={_addSetting:function(b){var a=b.get_name();if(this._initialValues[a]!=null){var c=b.parseValue(this._initialValues[a]);b.validateValue(c);b._value=c}this._settings.push(b);this._settingsByName[a]=b},getValue:function(a){if(this._settingsByName[a]!=null){return this._settingsByName[a].get_value()}else{return null}},getSettings:function(){return this._settings},reset:function(){var c=false;for(var a=0;a<this._settings.length;a++){var b=this._settings[a];if(b.get_value()!=b.get_defaultValue()){b._value=b.get_defaultValue();c=true}}if(c){this._saveCookies()}return c},setValue:function(a,b){var c=this._setValue(a,b);if(c){this._saveCookies()}return c},setValues:function(a){var c=false;for(var b in a){if(this._setValue(b,a[b])){c=true}}if(c){this._saveCookies()}return c},_setValue:function(a,c){var b=this._settingsByName[a];if(b){b.validateValue(c);if(c!=b.get_value()){b._value=c;return true}}return false},_saveCookies:function(){for(var a=0;a<this._settings.length;a++){var b=this._settings[a];if(b.get_value()==b.get_defaultValue()){this._clearCookie(b.get_name())}else{this._saveCookie(b.get_name(),b.get_value())}}$log.writeInfo("cookie: {0}",document.cookie)},_saveCookie:function(a,b){this._writeCookie(a,b,365)},_clearCookie:function(a){this._writeCookie(a,"",-1)},_writeCookie:function(b,c,d){var a=new Date(new Date().getTime()+(1000*60*60*24*d));document.cookie=String.format("{0}={1};expires={2}",b,c,a.toGMTString())}};IngrPL.WebClient.Core.Platform.ClientScript._Settings.registerClass("IngrPL.WebClient.Core.Platform.ClientScript._Settings");IngrPL.WebClient.Core.Platform.ClientScript.Setting=function(a){this._name=a.name;this._displayName=a.displayName;this._value=this._defaultValue=a.defaultValue;this._allowNull=a.allowNull==null?true:a.allowNull;this._expectedType=String};IngrPL.WebClient.Core.Platform.ClientScript.Setting.prototype={parseValue:function(a){if(a!=null){return a.toString()}else{return null}},validateValue:function(a){if(a==null){if(!this._allowNull){throw Error.argumentNull("value")}}else{if(!this._expectedType.isInstanceOfType(a)){throw Error.argumentType("value",Object.getType(a),this._expectedType)}}},get_name:function(){return this._name},get_displayName:function(){return this._displayName},get_defaultValue:function(){return this._defaultValue},get_value:function(){return this._value},get_allowNull:function(){return this._allowNull}};IngrPL.WebClient.Core.Platform.ClientScript.Setting.registerClass("IngrPL.WebClient.Core.Platform.ClientScript.Setting");IngrPL.WebClient.Core.Platform.ClientScript.NumberSetting=function(a){IngrPL.WebClient.Core.Platform.ClientScript.NumberSetting.initializeBase(this,[a]);this._minValue=a.minValue==null?-Infinity:a.minValue;this._maxValue=a.maxValue==null?Infinity:a.maxValue;this._allowDecimals=a.allowDecimals==null?true:a.allowDecimals;this._expectedType=Number};IngrPL.WebClient.Core.Platform.ClientScript.NumberSetting.prototype={parseValue:function(a){if(a!=null){if(Number.isInstanceOfType(a)){return a}else{return parseFloat(a)}}else{return null}},validateValue:function(a){IngrPL.WebClient.Core.Platform.ClientScript.NumberSetting.callBaseMethod(this,"validateValue",[a]);if(a<this._minValue||a>this._maxValue){throw Error.argumentOutOfRange("value",a)}if(!this._allowDecimals){if(/\./.test(a)){throw Error.argument("value",IngrPL.WebClient.Core.Platform.Translate.OnlyIntegerValuesAllowed)}}},get_minValue:function(){return this._minValue},get_maxValue:function(){return this._maxValue},get_allowDecimals:function(){return this._allowDecimals}};IngrPL.WebClient.Core.Platform.ClientScript.NumberSetting.registerClass("IngrPL.WebClient.Core.Platform.ClientScript.NumberSetting",IngrPL.WebClient.Core.Platform.ClientScript.Setting);IngrPL.WebClient.Core.Platform.ClientScript.BooleanSetting=function(a){IngrPL.WebClient.Core.Platform.ClientScript.BooleanSetting.initializeBase(this,[a]);this._expectedType=Boolean};IngrPL.WebClient.Core.Platform.ClientScript.BooleanSetting.prototype={parseValue:function(a){if(a!=null){if(String.isInstanceOfType(a)){return a.toLowerCase()=="true"}else{if(a){return true}else{return false}}}else{return null}}};IngrPL.WebClient.Core.Platform.ClientScript.BooleanSetting.registerClass("IngrPL.WebClient.Core.Platform.ClientScript.BooleanSetting",IngrPL.WebClient.Core.Platform.ClientScript.Setting);IngrPL.WebClient.Core.Platform.ClientScript.SelectSetSetting=function(a){IngrPL.WebClient.Core.Platform.ClientScript.SelectSetSetting.initializeBase(this,[a]);this._expectedType=Number};IngrPL.WebClient.Core.Platform.ClientScript.SelectSetSetting.prototype={parseValue:function(a){if(a!=null){if(Number.isInstanceOfType(a)){return Math.round(a)}else{return parseInt(a)}}else{return 0}},validateValue:function(a){IngrPL.WebClient.Core.Platform.ClientScript.SelectSetSetting.callBaseMethod(this,"validateValue",[a]);if(a<100&&a!=0&&a!=1||a>900){throw Error.argumentOutOfRange("value",a)}}};IngrPL.WebClient.Core.Platform.ClientScript.SelectSetSetting.registerClass("IngrPL.WebClient.Core.Platform.ClientScript.SelectSetSetting",IngrPL.WebClient.Core.Platform.ClientScript.Setting);IngrPL.WebClient.Core.Platform.ClientScript.Settings=new IngrPL.WebClient.Core.Platform.ClientScript._Settings();var $settings=IngrPL.WebClient.Core.Platform.ClientScript.Settings;
//END IngrPL.WebClient.Core.Platform.ClientScript.Settings.js
//START IngrPL.WebClient.Core.Platform.MapLayers.GoogleMapsServiceLayer.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");(function(){var c=false,h=false,i=[],g;var d=2*Math.PI*6378137/256;var j=Math.log(d);var k=Math.log(2);var e=IngrPL.WebClient.Core.Platform.MapLayers;var f=e.GoogleMapType=function(){};f.prototype={Map:0,Satellite:1,Hybrid:2,Terrain:3};f.registerEnum("IngrPL.WebClient.Core.Platform.MapLayers.GoogleMapType");var a=e.GoogleMapsServiceLayer=function(l){a.initializeBase(this,[l]);$event.register("opacityChanged",this._setOpacity,this);$event.register("settingsChanged",this._settingsChanged,this);$event.register("googleMapTypeChanged",this._updateMapType,this)};a.prototype={_ensureApiLoaded:function(l){args=Array.prototype.slice.call(arguments,1);if(c){l.apply(this,args)}else{b(l,this,args)}},_render:function(){if(!this._canDisplay()){this._mapLayerDiv.style.display="none";return}this._mapLayerDiv.style.display="";this._ensureApiLoaded(this._render_callback)},_render_callback:function(){this._ensureMap();var l=this._pendingMapRange,t=l.getSize(),n=l.getBottomLeft();var o=this._mapLayerDiv.clientWidth,s=this._mapLayerDiv.clientHeight;var p=t.width/o;if(p!=this._lastFactor){this._level=(j-Math.log(p))/k;this._level=Math.round(this._level);this._level=Math.max(0,this._level);this._lastFactor=p;$log.writeVerbose("google maps level {0}",this._level)}if(o!=this._lastMapWidthPx||s!=this._lastMapHeightPx){this._lastMapWidthPx=o;this._lastMapHeightPx=s;this._map.checkResize()}var r=n.x+t.width/2;var q=n.y+t.height/2;var m=$crs.convertToDegrees(r,q);this._map.setCenter(new g.LatLng(m.lat,m.lon),this._level)},_ensureMap:function(){if(this._map){return}var m=document.createElement("div");m.className="wc_google_maps_container";this._mapLayerDiv.appendChild(m);this._map=new g.Map2(m,{backgroundColor:"transparent"});this._map.disableDragging();this._map.disableDoubleClickZoom();this._map.disableScrollWheelZoom();var l=document.createElement("div");l.className="wc_google_maps_mask";m.appendChild(l);this._logo=m.childNodes.item(1);this._logo.style.zIndex="1";this._copyright=m.childNodes.item(2);this._copyright.style.zIndex="1";this._updatePositions();this._updateMapType();this._setOpacity()},_updateMapType:function(m,l,o){if(l&&l.mapLayerConfigId!=this._config.get_id()){return}if(!this._map){return}var n=this._getMapServiceConfig();var p=n.mapType||f.Map,q;switch(p){case f.Map:q=g.NORMAL_MAP;break;case f.Satellite:q=g.SATELLITE_MAP;break;case f.Hybrid:q=g.HYBRID_MAP;break;case f.Terrain:q=g.PHYSICAL_MAP;break;default:q=g.NORMAL_MAP;break}this._map.setMapType(q)},_updatePositions:function(){if(this._logo){this._logo.style.bottom=$settings.getValue("showCoords")?"25px":"2px"}if(this._copyright){this._copyright.style.bottom=$settings.getValue("showScale")?"35px":"2px"}},_pendingMapRangeChanged:function(){this._render()},_adjustMapRange:function(l,o){if(!this._canDisplay()){return null}var p=(j-Math.log(l))/k;if(o){return d/Math.pow(2,Math.floor(p))}var n=d/Math.pow(2,Math.floor(p));var m=n/2;return Math.abs(n-l)<=Math.abs(m-l)?n:m},_canDisplay:function(){var n=this._config.get_mapState().get_legend().get_flatLegend();var m=this._config.get_lastLegendItemPriority(),o=this._config.get_firstLegendItemPriority();var l;if(m>=o){l=n[o]}return l&&l.canBeDisplayed()},_setOpacity:function(m,l,o){if(l&&this._config.get_id()!=l.mapLayerConfigId){return}if(!this._map){return}var p=this._mapLayerDiv.firstChild.firstChild,n=this._config.get_opacity();p.style.opacity=n/100;p.style.filter="alpha(opacity="+n+")"},_updateLegendItemsVisibility:function(l){this._isDirty=true},_settingsChanged:function(){this._updatePositions()},_destroy:function(){$event.unregister("opacityChanged",this._setOpacity,this);$event.unregister("settingsChanged",this._settingsChanged,this);$event.unregister("googleMapTypeChanged",this._updateMapType,this);for(var o=0,m=i.length;o<m;o++){var n=i[o];if(n.scope==this){i.splice(o--,1);m--}}}};a.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.GoogleMapsServiceLayer",e.MapLayer);function b(s,r,p){if(c){if(typeof(s)=="function"){s.apply(r||window,p)}return}for(var q=0,m=i.length;q<m;q++){var o=i[q];if(o.callback==s&&o.scope==r){o.args=p;return}}i[q]={callback:s,scope:r,args:p};if(h){return}h=true;if(!window.google||!google.load){return}google.load("maps","2",{callback:n,other_params:"file=googleapionly&sensor=false"});function n(){h=false;c=true;g=google.maps;for(var v=0,t=i.length;v<t;v++){var u=i[v];if(typeof(u.callback)=="function"){u.callback.apply(u.scope||window,u.args)}}}}})();
//END IngrPL.WebClient.Core.Platform.MapLayers.GoogleMapsServiceLayer.js
//START IngrPL.WebClient.Core.Platform.MapLayers.OpenLSLayer.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");IngrPL.WebClient.Core.Platform.MapLayers.OpenLSLayer=function(a){IngrPL.WebClient.Core.Platform.MapLayers.OpenLSLayer.initializeBase(this,[a]);$event.register("opacityChanged",this._setOpacity,this);this._useTransparency=true;var c=this._getMapServiceConfig();var b=c.boundingBox;if(b!=null&&b.length==4){this._bounds={bottomLeft:{x:b[0],y:b[1]},upperRight:{x:b[2],y:b[3]}}}else{this._bounds=null}};IngrPL.WebClient.Core.Platform.MapLayers.OpenLSLayer.prototype={_render:function(){var a=$common.getBounds(this._mapLayerDiv);var b;if(layers&&this._checkBounds()){this._onRendering();this._rendering=true}else{b=""}if(!b&&this._rendering){this._rendering=false;this._onRendered()}},_legendItemMoved:function(a,c,b){this._isDirty=true},_updateLegendItemsVisibility:function(a){this._isDirty=true},_updateScaleBands:function(a){this._isDirty=true},_removeLegendItems:function(a){this._isDirty=true},_setOpacity:function(b,a,c){},_checkBounds:function(){if(this._bounds==null){$log.writeInfo("\nLack of BoundingBox\nOpenLS: "+this._config.get_name()+"\nURL: "+this._getMapServiceConfig().url);return true}var a={bottomLeft:this._renderingMapRange.getBottomLeft(),upperRight:this._renderingMapRange.getUpperRight()};return this._intersectsBounds(a,true)},_intersectsBounds:function(d,b){if(b==null){b=true}var f=(d.bottomLeft.y==this._bounds.bottomLeft.y&&d.upperRight.y==this._bounds.upperRight.y)?true:(((d.bottomLeft.y>this._bounds.bottomLeft.y)&&(d.bottomLeft.y<this._bounds.upperRight.y))||((this._bounds.bottomLeft.y>d.bottomLeft.y)&&(this._bounds.bottomLeft.y<d.upperRight.y)));var e=(d.bottomLeft.y==this._bounds.bottomLeft.y&&d.upperRight.y==this._bounds.upperRight.y)?true:(((d.upperRight.y>this._bounds.bottomLeft.y)&&(d.upperRight.y<this._bounds.upperRight.y))||((this._bounds.upperRight.y>d.bottomLeft.y)&&(this._bounds.upperRight.y<d.upperRight.y)));var a=(d.bottomLeft.x==this._bounds.bottomLeft.x&&d.upperRight.x==this._bounds.upperRight.x)?true:(((d.bottomLeft.x>this._bounds.bottomLeft.x)&&(d.bottomLeft.x<this._bounds.upperRight.x))||((this._bounds.bottomLeft.x>d.bottomLeft.x)&&(this._bounds.bottomLeft.x<d.upperRight.x)));var c=(d.bottomLeft.x==this._bounds.bottomLeft.x&&d.upperRight.x==this._bounds.upperRight.x)?true:(((d.upperRight.x>this._bounds.bottomLeft.x)&&(d.upperRight.x<this._bounds.upperRight.x))||((this._bounds.upperRight.x>d.bottomLeft.x)&&(this._bounds.upperRight.x<d.upperRight.x)));return(this._containsBounds(d,this._bounds,true,b)||this._containsBounds(this._bounds,d,true,b)||((e||f)&&(c||a)))},_containsBounds:function(e,h,d,b){if(d==null){d=false}if(b==null){b=true}var c;var g;var a;var f;if(b){c=(e.upperRight.x>=h.bottomLeft.x)&&(e.upperRight.x<=h.upperRight.x);g=(e.upperRight.y>=h.bottomLeft.y)&&(e.upperRight.y<=h.upperRight.y);a=(e.bottomLeft.x>=h.bottomLeft.x)&&(e.bottomLeft.x<=h.upperRight.x);f=(e.bottomLeft.y>=h.bottomLeft.y)&&(e.bottomLeft.y<=h.upperRight.y)}else{c=(e.upperRight.x>h.bottomLeft.x)&&(e.upperRight.x<h.upperRight.x);g=(e.upperRight.y>h.bottomLeft.y)&&(e.upperRight.y<h.upperRight.y);a=(e.bottomLeft.x>h.bottomLeft.x)&&(e.bottomLeft.x<h.upperRight.x);f=(e.bottomLeft.y>h.bottomLeft.y)&&(e.bottomLeft.y<h.upperRight.y)}return(d)?(g||f)&&(c||a):(g&&c&&f&&a)},_destroy:function(){if(this._rendering){this._onRendered()}$event.unregister("opacityChanged",this._setOpacity,this)},set_mapLayerDiv:function(a){IngrPL.WebClient.Core.Platform.MapLayers.OpenLSLayer.callBaseMethod(this,"set_mapLayerDiv",[a])}};IngrPL.WebClient.Core.Platform.MapLayers.OpenLSLayer.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.OpenLSLayer",IngrPL.WebClient.Core.Platform.MapLayers.MapLayer);
//END IngrPL.WebClient.Core.Platform.MapLayers.OpenLSLayer.js
//START IngrPL.WebClient.Core.Platform.MapLayers.CSWLayer.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");IngrPL.WebClient.Core.Platform.MapLayers.CSWLayer=function(a){IngrPL.WebClient.Core.Platform.MapLayers.CSWLayer.initializeBase(this,[a]);$event.register("opacityChanged",this._setOpacity,this);this._useTransparency=true;var c=this._getMapServiceConfig();var b=c.boundingBox;if(b!=null&&b.length==4){this._bounds={bottomLeft:{x:b[0],y:b[1]},upperRight:{x:b[2],y:b[3]}}}else{this._bounds=null}};IngrPL.WebClient.Core.Platform.MapLayers.CSWLayer.prototype={_render:function(){var a=$common.getBounds(this._mapLayerDiv);var b;if(layers&&this._checkBounds()){this._onRendering();this._rendering=true}else{b=""}if(!b&&this._rendering){this._rendering=false;this._onRendered()}},_legendItemMoved:function(a,c,b){this._isDirty=true},_updateLegendItemsVisibility:function(a){this._isDirty=true},_updateScaleBands:function(a){this._isDirty=true},_removeLegendItems:function(a){this._isDirty=true},_setOpacity:function(b,a,c){},_checkBounds:function(){if(this._bounds==null){$log.writeInfo("\nLack of BoundingBox\nCSW: "+this._config.get_name()+"\nURL: "+this._getMapServiceConfig().url);return true}var a={bottomLeft:this._renderingMapRange.getBottomLeft(),upperRight:this._renderingMapRange.getUpperRight()};return this._intersectsBounds(a,true)},_intersectsBounds:function(d,b){if(b==null){b=true}var f=(d.bottomLeft.y==this._bounds.bottomLeft.y&&d.upperRight.y==this._bounds.upperRight.y)?true:(((d.bottomLeft.y>this._bounds.bottomLeft.y)&&(d.bottomLeft.y<this._bounds.upperRight.y))||((this._bounds.bottomLeft.y>d.bottomLeft.y)&&(this._bounds.bottomLeft.y<d.upperRight.y)));var e=(d.bottomLeft.y==this._bounds.bottomLeft.y&&d.upperRight.y==this._bounds.upperRight.y)?true:(((d.upperRight.y>this._bounds.bottomLeft.y)&&(d.upperRight.y<this._bounds.upperRight.y))||((this._bounds.upperRight.y>d.bottomLeft.y)&&(this._bounds.upperRight.y<d.upperRight.y)));var a=(d.bottomLeft.x==this._bounds.bottomLeft.x&&d.upperRight.x==this._bounds.upperRight.x)?true:(((d.bottomLeft.x>this._bounds.bottomLeft.x)&&(d.bottomLeft.x<this._bounds.upperRight.x))||((this._bounds.bottomLeft.x>d.bottomLeft.x)&&(this._bounds.bottomLeft.x<d.upperRight.x)));var c=(d.bottomLeft.x==this._bounds.bottomLeft.x&&d.upperRight.x==this._bounds.upperRight.x)?true:(((d.upperRight.x>this._bounds.bottomLeft.x)&&(d.upperRight.x<this._bounds.upperRight.x))||((this._bounds.upperRight.x>d.bottomLeft.x)&&(this._bounds.upperRight.x<d.upperRight.x)));return(this._containsBounds(d,this._bounds,true,b)||this._containsBounds(this._bounds,d,true,b)||((e||f)&&(c||a)))},_containsBounds:function(e,h,d,b){if(d==null){d=false}if(b==null){b=true}var c;var g;var a;var f;if(b){c=(e.upperRight.x>=h.bottomLeft.x)&&(e.upperRight.x<=h.upperRight.x);g=(e.upperRight.y>=h.bottomLeft.y)&&(e.upperRight.y<=h.upperRight.y);a=(e.bottomLeft.x>=h.bottomLeft.x)&&(e.bottomLeft.x<=h.upperRight.x);f=(e.bottomLeft.y>=h.bottomLeft.y)&&(e.bottomLeft.y<=h.upperRight.y)}else{c=(e.upperRight.x>h.bottomLeft.x)&&(e.upperRight.x<h.upperRight.x);g=(e.upperRight.y>h.bottomLeft.y)&&(e.upperRight.y<h.upperRight.y);a=(e.bottomLeft.x>h.bottomLeft.x)&&(e.bottomLeft.x<h.upperRight.x);f=(e.bottomLeft.y>h.bottomLeft.y)&&(e.bottomLeft.y<h.upperRight.y)}return(d)?(g||f)&&(c||a):(g&&c&&f&&a)},_destroy:function(){if(this._rendering){this._onRendered()}$event.unregister("opacityChanged",this._setOpacity,this)},set_mapLayerDiv:function(a){IngrPL.WebClient.Core.Platform.MapLayers.CSWLayer.callBaseMethod(this,"set_mapLayerDiv",[a])}};IngrPL.WebClient.Core.Platform.MapLayers.CSWLayer.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.CSWLayer",IngrPL.WebClient.Core.Platform.MapLayers.MapLayer);
//END IngrPL.WebClient.Core.Platform.MapLayers.CSWLayer.js
//START IngrPL.WebClient.Core.Platform.MapLayers.VirtualEarthServiceLayer.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");(function(){var b=false,e=false,f=[],j;var c=2*Math.PI*6378137/256;var i=Math.log(c);var k=Math.log(2);var d=IngrPL.WebClient.Core.Platform.MapLayers;var h=d.VirtualEarthMapType=function(){};h.prototype={Road:0,Shaded:1,Aerial:2,Hybrid:3,Oblique:4};h.registerEnum("IngrPL.WebClient.Core.Platform.MapLayers.VirtualEarthMapType");var g=d.VirtualEarthServiceLayer=function(l){g.initializeBase(this,[l]);$event.register("opacityChanged",this._setOpacity,this);$event.register("settingsChanged",this._settingsChanged,this);$event.register("virtualEarthMapTypeChanged",this._updateMapType,this)};g.prototype={_ensureApiLoaded:function(l){args=Array.prototype.slice.call(arguments,1);if(b){l.apply(this,args)}else{a(l,this,args)}},_render:function(){if(!this._canDisplay()){this._mapLayerDiv.style.display="none";return}this._mapLayerDiv.style.display="";this._ensureApiLoaded(this._render_callback)},_render_callback:function(){this._ensureMap();var l=this._pendingMapRange,t=l.getSize(),n=l.getBottomLeft();var o=this._mapLayerDiv.clientWidth,s=this._mapLayerDiv.clientHeight;var p=t.width/o;if(p!=this._lastFactor){this._level=(i-Math.log(p))/k;this._level=Math.round(this._level);this._level=Math.max(0,this._level);this._lastFactor=p;$log.writeVerbose("virtual earth level {0}",this._level)}if(o!=this._lastMapWidthPx||s!=this._lastMapHeightPx){this._lastMapWidthPx=o;this._lastMapHeightPx=s;this._map.Resize()}var r=n.x+t.width/2;var q=n.y+t.height/2;var m=$crs.convertToDegrees(r,q);this._map.SetCenterAndZoom(new VELatLong(m.lat,m.lon),this._level)},_ensureMap:function(){if(this._map){return}var m=document.createElement("div");m.className="wc_virtual_earth_container";var l="ve_ID_"+this.get_config().get_id();m.setAttribute("id",l);m._config=this.get_config();this._mapLayerDiv.appendChild(m);this._map=new VEMap(l);this._map.HideDashboard();this._map.HideScalebar();this._map.onLoadMap=n;this._map.LoadMap();this._map.vemapcontrol.SetAnimationEnabled(false);this._map.AttachEvent("onchangeview",n);function n(){m.style.backgroundColor=null;m.style.zIndex=0;var o=m._config.get_opacity();m.style.opacity=o/100;m.style.filter="alpha(opacity="+o+")"}this._updateMapType();this._setOpacity()},_updateMapType:function(m,l,o){if(l&&l.mapLayerConfigId!=this._config.get_id()){return}if(!this._map){return}var n=this._getMapServiceConfig();var q=n.mapType||h.Map,p;switch(q){case h.Road:p=VEMapStyle.Road;break;case h.Shaded:p=VEMapStyle.Shaded;break;case h.Aerial:p=VEMapStyle.Aerial;break;case h.Hybrid:p=VEMapStyle.Hybrid;break;case h.Oblique:p=VEMapStyle.Oblique;break;default:p=VEMapStyle.Road;break}this._map.SetMapStyle(p)},_updatePositions:function(){if(this._logo){this._logo.style.bottom=$settings.getValue("showCoords")?"25px":"2px"}if(this._copyright){this._copyright.style.bottom=$settings.getValue("showScale")?"35px":"2px"}},_pendingMapRangeChanged:function(){this._render()},_adjustMapRange:function(l,o){if(!this._canDisplay()){return null}var p=(i-Math.log(l))/k;if(o){return c/Math.pow(2,Math.floor(p))}var n=c/Math.pow(2,Math.floor(p));var m=n/2;return Math.abs(n-l)<=Math.abs(m-l)?n:m},_canDisplay:function(){var n=this._config.get_mapState().get_legend().get_flatLegend();var m=this._config.get_lastLegendItemPriority(),o=this._config.get_firstLegendItemPriority();var l;if(m>=o){l=n[o]}return l&&l.canBeDisplayed()},_setOpacity:function(m,l,o){if(l&&this._config.get_id()!=l.mapLayerConfigId){return}if(!this._map){return}var p=this._mapLayerDiv.firstChild,n=this._config.get_opacity();p.style.opacity=n/100;p.style.filter="alpha(opacity="+n+")"},_updateLegendItemsVisibility:function(l){this._isDirty=true},_settingsChanged:function(){this._updatePositions()},_destroy:function(){$event.unregister("opacityChanged",this._setOpacity,this);$event.unregister("settingsChanged",this._settingsChanged,this);$event.unregister("virtualEarthMapTypeChanged",this._updateMapType,this);for(var o=0,m=f.length;o<m;o++){var n=f[o];if(n.scope==this){f.splice(o--,1);m--}}}};g.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.VirtualEarthServiceLayer",d.MapLayer);function a(s,r,p){b=true;if(b){if(typeof(s)=="function"){s.apply(r||window,p)}return}for(var q=0,m=f.length;q<m;q++){var o=f[q];if(o.callback==s&&o.scope==r){o.args=p;return}}f[q]={callback:s,scope:r,args:p};if(e){return}e=true;if(!window.google||!google.load){return}google.load("maps","2",{callback:n,other_params:"file=googleapionly&sensor=false"});function n(){e=false;b=true;gm=google.maps;for(var v=0,t=f.length;v<t;v++){var u=f[v];if(typeof(u.callback)=="function"){u.callback.apply(u.scope||window,u.args)}}}}})();
//END IngrPL.WebClient.Core.Platform.MapLayers.VirtualEarthServiceLayer.js
//START IngrPL.WebClient.Core.Platform.MapLayers.WFSGLayer.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");IngrPL.WebClient.Core.Platform.MapLayers.WFSGLayer=function(a){IngrPL.WebClient.Core.Platform.MapLayers.WFSGLayer.initializeBase(this,[a]);$event.register("opacityChanged",this._setOpacity,this);this._useTransparency=true;var c=this._getMapServiceConfig();var b=c.boundingBox;if(b!=null&&b.length==4){this._bounds={bottomLeft:{x:b[0],y:b[1]},upperRight:{x:b[2],y:b[3]}}}else{this._bounds=null}};IngrPL.WebClient.Core.Platform.MapLayers.WFSGLayer.prototype={_render:function(){var a=$common.getBounds(this._mapLayerDiv);var b;if(layers&&this._checkBounds()){this._onRendering();this._rendering=true}else{b=""}if(!b&&this._rendering){this._rendering=false;this._onRendered()}},_legendItemMoved:function(a,c,b){this._isDirty=true},_updateLegendItemsVisibility:function(a){this._isDirty=true},_updateScaleBands:function(a){this._isDirty=true},_removeLegendItems:function(a){this._isDirty=true},_setOpacity:function(b,a,c){},_checkBounds:function(){if(this._bounds==null){$log.writeInfo("\nLack of BoundingBox\nWFSG: "+this._config.get_name()+"\nURL: "+this._getMapServiceConfig().url);return true}var a={bottomLeft:this._renderingMapRange.getBottomLeft(),upperRight:this._renderingMapRange.getUpperRight()};return this._intersectsBounds(a,true)},_intersectsBounds:function(d,b){if(b==null){b=true}var f=(d.bottomLeft.y==this._bounds.bottomLeft.y&&d.upperRight.y==this._bounds.upperRight.y)?true:(((d.bottomLeft.y>this._bounds.bottomLeft.y)&&(d.bottomLeft.y<this._bounds.upperRight.y))||((this._bounds.bottomLeft.y>d.bottomLeft.y)&&(this._bounds.bottomLeft.y<d.upperRight.y)));var e=(d.bottomLeft.y==this._bounds.bottomLeft.y&&d.upperRight.y==this._bounds.upperRight.y)?true:(((d.upperRight.y>this._bounds.bottomLeft.y)&&(d.upperRight.y<this._bounds.upperRight.y))||((this._bounds.upperRight.y>d.bottomLeft.y)&&(this._bounds.upperRight.y<d.upperRight.y)));var a=(d.bottomLeft.x==this._bounds.bottomLeft.x&&d.upperRight.x==this._bounds.upperRight.x)?true:(((d.bottomLeft.x>this._bounds.bottomLeft.x)&&(d.bottomLeft.x<this._bounds.upperRight.x))||((this._bounds.bottomLeft.x>d.bottomLeft.x)&&(this._bounds.bottomLeft.x<d.upperRight.x)));var c=(d.bottomLeft.x==this._bounds.bottomLeft.x&&d.upperRight.x==this._bounds.upperRight.x)?true:(((d.upperRight.x>this._bounds.bottomLeft.x)&&(d.upperRight.x<this._bounds.upperRight.x))||((this._bounds.upperRight.x>d.bottomLeft.x)&&(this._bounds.upperRight.x<d.upperRight.x)));return(this._containsBounds(d,this._bounds,true,b)||this._containsBounds(this._bounds,d,true,b)||((e||f)&&(c||a)))},_containsBounds:function(e,h,d,b){if(d==null){d=false}if(b==null){b=true}var c;var g;var a;var f;if(b){c=(e.upperRight.x>=h.bottomLeft.x)&&(e.upperRight.x<=h.upperRight.x);g=(e.upperRight.y>=h.bottomLeft.y)&&(e.upperRight.y<=h.upperRight.y);a=(e.bottomLeft.x>=h.bottomLeft.x)&&(e.bottomLeft.x<=h.upperRight.x);f=(e.bottomLeft.y>=h.bottomLeft.y)&&(e.bottomLeft.y<=h.upperRight.y)}else{c=(e.upperRight.x>h.bottomLeft.x)&&(e.upperRight.x<h.upperRight.x);g=(e.upperRight.y>h.bottomLeft.y)&&(e.upperRight.y<h.upperRight.y);a=(e.bottomLeft.x>h.bottomLeft.x)&&(e.bottomLeft.x<h.upperRight.x);f=(e.bottomLeft.y>h.bottomLeft.y)&&(e.bottomLeft.y<h.upperRight.y)}return(d)?(g||f)&&(c||a):(g&&c&&f&&a)},_destroy:function(){if(this._rendering){this._onRendered()}$event.unregister("opacityChanged",this._setOpacity,this)},set_mapLayerDiv:function(a){IngrPL.WebClient.Core.Platform.MapLayers.WFSGLayer.callBaseMethod(this,"set_mapLayerDiv",[a])}};IngrPL.WebClient.Core.Platform.MapLayers.WFSGLayer.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.WFSGLayer",IngrPL.WebClient.Core.Platform.MapLayers.MapLayer);
//END IngrPL.WebClient.Core.Platform.MapLayers.WFSGLayer.js
//START IngrPL.WebClient.Core.Platform.MapLayers.WFSLayer.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");IngrPL.WebClient.Core.Platform.MapLayers.WFSLayer=function(a){IngrPL.WebClient.Core.Platform.MapLayers.WFSLayer.initializeBase(this,[a]);$event.register("opacityChanged",this._setOpacity,this);this._useTransparency=true;var c=this._getMapServiceConfig();var b=c.boundingBox;if(b!=null&&b.length==4){this._bounds={bottomLeft:{x:b[0],y:b[1]},upperRight:{x:b[2],y:b[3]}}}else{this._bounds=null}};IngrPL.WebClient.Core.Platform.MapLayers.WFSLayer.prototype={_render:function(){var a=$common.getBounds(this._mapLayerDiv);var b;if(layers&&this._checkBounds()){this._onRendering();this._rendering=true}else{b=""}if(!b&&this._rendering){this._rendering=false;this._onRendered()}},_legendItemMoved:function(a,c,b){this._isDirty=true},_updateLegendItemsVisibility:function(a){this._isDirty=true},_updateScaleBands:function(a){this._isDirty=true},_removeLegendItems:function(a){this._isDirty=true},_setOpacity:function(b,a,c){},_checkBounds:function(){if(this._bounds==null){$log.writeInfo("\nLack of BoundingBox\nWFS: "+this._config.get_name()+"\nURL: "+this._getMapServiceConfig().url);return true}var a={bottomLeft:this._renderingMapRange.getBottomLeft(),upperRight:this._renderingMapRange.getUpperRight()};return this._intersectsBounds(a,true)},_intersectsBounds:function(d,b){if(b==null){b=true}var f=(d.bottomLeft.y==this._bounds.bottomLeft.y&&d.upperRight.y==this._bounds.upperRight.y)?true:(((d.bottomLeft.y>this._bounds.bottomLeft.y)&&(d.bottomLeft.y<this._bounds.upperRight.y))||((this._bounds.bottomLeft.y>d.bottomLeft.y)&&(this._bounds.bottomLeft.y<d.upperRight.y)));var e=(d.bottomLeft.y==this._bounds.bottomLeft.y&&d.upperRight.y==this._bounds.upperRight.y)?true:(((d.upperRight.y>this._bounds.bottomLeft.y)&&(d.upperRight.y<this._bounds.upperRight.y))||((this._bounds.upperRight.y>d.bottomLeft.y)&&(this._bounds.upperRight.y<d.upperRight.y)));var a=(d.bottomLeft.x==this._bounds.bottomLeft.x&&d.upperRight.x==this._bounds.upperRight.x)?true:(((d.bottomLeft.x>this._bounds.bottomLeft.x)&&(d.bottomLeft.x<this._bounds.upperRight.x))||((this._bounds.bottomLeft.x>d.bottomLeft.x)&&(this._bounds.bottomLeft.x<d.upperRight.x)));var c=(d.bottomLeft.x==this._bounds.bottomLeft.x&&d.upperRight.x==this._bounds.upperRight.x)?true:(((d.upperRight.x>this._bounds.bottomLeft.x)&&(d.upperRight.x<this._bounds.upperRight.x))||((this._bounds.upperRight.x>d.bottomLeft.x)&&(this._bounds.upperRight.x<d.upperRight.x)));return(this._containsBounds(d,this._bounds,true,b)||this._containsBounds(this._bounds,d,true,b)||((e||f)&&(c||a)))},_containsBounds:function(e,h,d,b){if(d==null){d=false}if(b==null){b=true}var c;var g;var a;var f;if(b){c=(e.upperRight.x>=h.bottomLeft.x)&&(e.upperRight.x<=h.upperRight.x);g=(e.upperRight.y>=h.bottomLeft.y)&&(e.upperRight.y<=h.upperRight.y);a=(e.bottomLeft.x>=h.bottomLeft.x)&&(e.bottomLeft.x<=h.upperRight.x);f=(e.bottomLeft.y>=h.bottomLeft.y)&&(e.bottomLeft.y<=h.upperRight.y)}else{c=(e.upperRight.x>h.bottomLeft.x)&&(e.upperRight.x<h.upperRight.x);g=(e.upperRight.y>h.bottomLeft.y)&&(e.upperRight.y<h.upperRight.y);a=(e.bottomLeft.x>h.bottomLeft.x)&&(e.bottomLeft.x<h.upperRight.x);f=(e.bottomLeft.y>h.bottomLeft.y)&&(e.bottomLeft.y<h.upperRight.y)}return(d)?(g||f)&&(c||a):(g&&c&&f&&a)},_destroy:function(){if(this._rendering){this._onRendered()}$event.unregister("opacityChanged",this._setOpacity,this)},set_mapLayerDiv:function(a){IngrPL.WebClient.Core.Platform.MapLayers.WFSLayer.callBaseMethod(this,"set_mapLayerDiv",[a])}};IngrPL.WebClient.Core.Platform.MapLayers.WFSLayer.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.WFSLayer",IngrPL.WebClient.Core.Platform.MapLayers.MapLayer);
//END IngrPL.WebClient.Core.Platform.MapLayers.WFSLayer.js
//START IngrPL.WebClient.Core.Platform.Common.Dictionary.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.Common");IngrPL.WebClient.Core.Platform.Common.Dictionary=function(){this._length=0;this._items={}};IngrPL.WebClient.Core.Platform.Common.Dictionary.prototype={removeItem:function(b){var a;if(typeof(this._items[b])!="undefined"){this._length--;var a=this._items[b];delete this._items[b]}return a},getItem:function(a){return this._items[a]},setItem:function(a,b){if(typeof(b)!="undefined"){if(typeof(this._items[a])=="undefined"){this._length++}this._items[a]=b}return b},forEach:function(c,b){for(var a in this._items){if(c(this._items[a],b,a)){break}}},appendDictionary:function(a){if(!IngrPL.WebClient.Core.Platform.Common.Dictionary.isInstanceOfType(a)){throw Error.argumentType("dictionary",Object.getType(a),IngrPL.WebClient.Core.Platform.Common.Dictionary)}a.forEach(function(d,c,b){c.dictionary.setItem(b,d)},{dictionary:this})},hasItem:function(a){return typeof(this._items[a])!="undefined"},size:function(){return this._length},clear:function(){for(var a in this._items){delete this._items[a]}this._length=0;this._items={}},cloneDictionary:function(){var a=new IngrPL.WebClient.Core.Platform.Common.Dictionary;a._length=this._length;a._items=this._clone(this._items);return a},_clone:function(c){if(typeof(c)!="object"){return c}if(c==null){return c}if(typeof(c.nodeType)!="undefined"){return c}var b={};for(var a in c){b[a]=this._clone(c[a])}return b}};IngrPL.WebClient.Core.Platform.Common.Dictionary.registerClass("IngrPL.WebClient.Core.Platform.Common.Dictionary");
//END IngrPL.WebClient.Core.Platform.Common.Dictionary.js
//START IngrPL.WebClient.Core.Platform.MapContent.MapRange.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapContent");IngrPL.WebClient.Core.Platform.MapContent.MapRange=function(a){if(a==null){throw Error.argumentNull("mapRangeStub")}if(!Array.isInstanceOfType(a)){throw Error.argumentType("mapRangeStub",Object.getType(a),Array)}this._bottomLeft=new IngrPL.WebClient.Core.Platform.Common.Point(a[0],a[1]);this._size=new IngrPL.WebClient.Core.Platform.Common.Size(a[2]-a[0],a[3]-a[1])};IngrPL.WebClient.Core.Platform.MapContent.MapRange.prototype={zoom:function(c,b){if(c==null){throw new Error.argumentNull("zoomFactor")}if(!Number.isInstanceOfType(c)){throw new Error.argumentType("zoomFactor",Object.getType(c),Number)}var a;var d;if(b==null){$log.writeVerbose("zoom {0}",c);b=new IngrPL.WebClient.Core.Platform.Common.Point(this._bottomLeft.x+this._size.width/2,this._bottomLeft.y+this._size.height/2);a=d=0.5}else{if(!IngrPL.WebClient.Core.Platform.Common.Point.isInstanceOfType(b)){throw Error.argumentType("zoomCenter",Object.getType(b),IngrPL.WebClient.Core.Platform.Common.Point)}a=(b.x-this._bottomLeft.x)/this._size.width;d=(b.y-this._bottomLeft.y)/this._size.height}this._size.width*=c;this._size.height*=c;this._bottomLeft.x=b.x-this._size.width*a;this._bottomLeft.y=b.y-this._size.height*d},zoomPx:function(d,a,c){if(d==null){throw new Error.argumentNull("zoomFactor")}if(!Number.isInstanceOfType(d)){throw new Error.argumentType("zoomFactor",Object.getType(d),Number)}if(a!=null&&c!=null){if(!IngrPL.WebClient.Core.Platform.Common.Point.isInstanceOfType(a)){throw Error.argumentType("zoomCenter",Object.getType(a),IngrPL.WebClient.Core.Platform.Common.Point)}if(!IngrPL.WebClient.Core.Platform.Common.Size.isInstanceOfType(c)){throw Error.argumentType("mapSize",Object.getType(c),IngrPL.WebClient.Core.Platform.Common.Size)}$log.writeVerbose("zoom {0} @ {1} {2}",d,a.x,a.y);var b=new IngrPL.WebClient.Core.Platform.Common.Point(this._bottomLeft.x+this._size.width*a.x/c.width,this._bottomLeft.y+this._size.height*(1-a.y/c.height));this.zoom(d,b)}else{this.zoom(d)}},move:function(a){if(a==null){throw Error.argumentNull("vector")}if(!IngrPL.WebClient.Core.Platform.Common.Size.isInstanceOfType(a)){throw Error.argumentType("vector",Object.getType(a),IngrPL.WebClient.Core.Platform.Common.Size)}this._bottomLeft.x+=a.width;this._bottomLeft.y+=a.height},movePx:function(a,c){if(a==null){throw Error.argumentNull("vector")}if(!IngrPL.WebClient.Core.Platform.Common.Size.isInstanceOfType(a)){throw Error.argumentType("vector",Object.getType(a),IngrPL.WebClient.Core.Platform.Common.Size)}if(c==null){throw Error.argumentNull("mapSize")}if(!IngrPL.WebClient.Core.Platform.Common.Size.isInstanceOfType(c)){throw Error.argumentType("mapSize",Object.getType(c),IngrPL.WebClient.Core.Platform.Common.Size)}var b=new IngrPL.WebClient.Core.Platform.Common.Size(a.width*this._size.width/c.width,a.height*this._size.height/c.height);this.move(b)},resize:function(b,c){if(b==null){throw Error.argumentNull("newMapSize")}if(!IngrPL.WebClient.Core.Platform.Common.Size.isInstanceOfType(b)){throw Error.argumentType("newMapSize",Object.getType(b),IngrPL.WebClient.Core.Platform.Common.Size)}if(c!=null&&!IngrPL.WebClient.Core.Platform.Common.Point.isInstanceOfType(c)){throw Error.argumentType("anchor",Object.getType(c),IngrPL.WebClient.Core.Platform.Common.Point)}var a;var d;if(c==null){c=new IngrPL.WebClient.Core.Platform.Common.Point(this._bottomLeft.x+this._size.width/2,this._bottomLeft.y+this._size.height/2);a=d=0.5}else{a=(c.x-this._bottomLeft.x)/this._size.width;d=(c.y-this._bottomLeft.y)/this._size.height}this._size=b.clone();this._bottomLeft.x=c.x-this._size.width*a;this._bottomLeft.y=c.y-this._size.height*d},resizePx:function(b,d,c){if(b==null){throw Error.argumentNull("newMapSize")}if(!IngrPL.WebClient.Core.Platform.Common.Size.isInstanceOfType(b)){throw Error.argumentType("newMapSize",Object.getType(b),IngrPL.WebClient.Core.Platform.Common.Size)}if(d==null){throw Error.argumentNull("oldMapSize")}if(!IngrPL.WebClient.Core.Platform.Common.Size.isInstanceOfType(d)){throw Error.argumentType("oldMapSize",Object.getType(d),IngrPL.WebClient.Core.Platform.Common.Size)}if(c!=null&&!IngrPL.WebClient.Core.Platform.Common.Point.isInstanceOfType(c)){throw Error.argumentType("anchor",Object.getType(c),IngrPL.WebClient.Core.Platform.Common.Point)}if(d.width<=0||d.height<=0){return}var e=new IngrPL.WebClient.Core.Platform.Common.Size(this._size.width*(b.width/d.width),this._size.height*(b.height/d.height));var a=null;if(c){a=new IngrPL.WebClient.Core.Platform.Common.Point(this._bottomLeft.x+this._size.width*c.x/d.width,this._bottomLeft.y+this._size.height*(1-c.y/d.height))}this.resize(e,a)},correctAspectRatio:function(e){if(e==null){throw Error.argumentNull("mapSize")}if(!IngrPL.WebClient.Core.Platform.Common.Size.isInstanceOfType(e)){throw Error.argumentType("mapSize",Object.getType(e),IngrPL.WebClient.Core.Platform.Common.Size)}var a=e.width/e.height;var b=this._size.width/this._size.height;if(a>b){var c=this._size.height*a;this._bottomLeft.x-=(c-this._size.width)/2;this._size.width=c}else{if(a<b){var d=this._size.width/a;this._bottomLeft.y-=(d-this._size.height)/2;this._size.height=d}}},updateFromRange:function(a){if(a==null){throw Error.argumentNull("mapRange")}if(!IngrPL.WebClient.Core.Platform.MapContent.MapRange.isInstanceOfType(a)){throw Error.argumentType("mapRange",Object.getType(a),IngrPL.WebClient.Core.Platform.MapContent.MapRange)}this._bottomLeft.x=a._bottomLeft.x;this._bottomLeft.y=a._bottomLeft.y;this._size.width=a._size.width;this._size.height=a._size.height},updateFromPoints:function(b,a){if(b==null){throw Error.argumentNull("p1")}if(!IngrPL.WebClient.Core.Platform.Common.Point.isInstanceOfType(b)){throw Error.argumentType("p1",Object.getType(b),IngrPL.WebClient.Core.Platform.Common.Point)}if(a==null){throw Error.argumentNull("p2")}if(!IngrPL.WebClient.Core.Platform.Common.Point.isInstanceOfType(a)){throw Error.argumentType("p2",Object.getType(a),IngrPL.WebClient.Core.Platform.Common.Point)}this._bottomLeft.x=Math.min(b.x,a.x);this._bottomLeft.y=Math.min(b.y,a.y);this._size.width=Math.abs(b.x-a.x);this._size.height=Math.abs(b.y-a.y)},updateFromPointsPx:function(e,d,c){if(e==null){throw Error.argumentNull("p1")}if(!IngrPL.WebClient.Core.Platform.Common.Point.isInstanceOfType(e)){throw Error.argumentType("p1",Object.getType(e),IngrPL.WebClient.Core.Platform.Common.Point)}if(d==null){throw Error.argumentNull("p2")}if(!IngrPL.WebClient.Core.Platform.Common.Point.isInstanceOfType(d)){throw Error.argumentType("p2",Object.getType(d),IngrPL.WebClient.Core.Platform.Common.Point)}if(c==null){throw Error.argumentType("mapSize")}if(!IngrPL.WebClient.Core.Platform.Common.Size.isInstanceOfType(c)){throw Error.argumentType("mapSize",Object.getType(c),IngrPL.WebClient.Core.Platform.Common.Size)}$log.writeVerbose("updateFromPointsPx {0}x{1} {2}x{3}",e.x,e.y,d.x,d.y);var a=new IngrPL.WebClient.Core.Platform.Common.Point(this._bottomLeft.x+e.x*this._size.width/c.width,this._bottomLeft.y+(1-e.y/c.height)*this._size.height);var b=new IngrPL.WebClient.Core.Platform.Common.Point(this._bottomLeft.x+d.x*this._size.width/c.width,this._bottomLeft.y+(1-d.y/c.height)*this._size.height);this.updateFromPoints(a,b)},clone:function(){var a=new IngrPL.WebClient.Core.Platform.MapContent.MapRange([0,0,0,0]);a._bottomLeft.x=this._bottomLeft.x;a._bottomLeft.y=this._bottomLeft.y;a._size.width=this._size.width;a._size.height=this._size.height;return a},equals:function(b,a){if(b==null){return false}else{if(!IngrPL.WebClient.Core.Platform.MapContent.MapRange.isInstanceOfType(b)){throw Error.argumentType("range",Object.getType(b),IngrPL.WebClient.Core.Platform.MapContent.MapRange)}if(typeof(a)=="undefined"||a==null){a=false}return this._bottomLeft.equals(b._bottomLeft)&&this._size.equals(b._size)||a&&this._equalsWithTolerance(b)}},_equalsWithTolerance:function(b){var a=this._size.width/10000;return Math.abs(this._bottomLeft.x-b._bottomLeft.x)<a&&Math.abs(this._bottomLeft.y-b._bottomLeft.y)<a&&Math.abs(this._size.width-b._size.width)<a&&Math.abs(this._size.height-b._size.height)<a},serialize:function(){return[this._bottomLeft.x,this._bottomLeft.y,this._bottomLeft.x+this._size.width,this._bottomLeft.y+this._size.height]},getBottomLeft:function(){return this._bottomLeft.clone()},getUpperRight:function(){return new IngrPL.WebClient.Core.Platform.Common.Point(this._bottomLeft.x+this._size.width,this._bottomLeft.y+this._size.height)},getSize:function(){return this._size.clone()}};IngrPL.WebClient.Core.Platform.MapContent.MapRange.registerClass("IngrPL.WebClient.Core.Platform.MapContent.MapRange");
//END IngrPL.WebClient.Core.Platform.MapContent.MapRange.js
//START IngrPL.WebClient.Core.Platform.MapLayers.TileManager.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");IngrPL.WebClient.Core.Platform.MapLayers.TileManager=function(c,d,b,a,e){if(typeof(c)=="undefined"){throw Error.argumentNull("maxConcurrentTileDownloadLimit")}if(typeof(d)=="undefined"){throw Error.argumentNull("layerContainer")}if(typeof(b)=="undefined"){throw Error.argumentNull("layerId")}if(typeof(a)=="undefined"){throw Error.argumentNull("tilesSrcLocation")}this._maxTilesCount=c;this._layerContainer=d;this._layerId=b;this._levelId=b.substr(0,b.lastIndexOf("_"));this._curLvl=this._levelId.substr(this._levelId.lastIndexOf("_")+1);this._currentLayer=this._layerContainer.levels.getItem(this._levelId).layers.getItem(this._layerId);this._innerTilesCollection=this._currentLayer.tiles.cloneDictionary();this._mainFrameTilesCount=this._currentLayer.tiles.size();this._location=a;if(typeof(e)=="undefined"||isNaN(parseInt(e))||parseInt(e)>100||parseInt(e)<0){this._opacity=100}else{this._opacity=parseInt(e)}this._imageCounter=0;this._insideCall=false;this._awaitingImages=new IngrPL.WebClient.Core.Platform.Common.Dictionary();this._break=false};IngrPL.WebClient.Core.Platform.MapLayers.TileManager.prototype={SetNewTilesList:function(a){if(typeof(a)=="undefined"){throw Error.argumentNull("layer")}if(this._innerTilesCollection.size()>0){this._Clear()}this._innerTilesCollection=a.tiles.cloneDictionary();this._currentLayer=a;this._currentLayer.loadedTilesCount=0;this._mainFrameTilesCount=a.tiles.size()},AppendNewTilesList:function(a){if(typeof(a)=="undefined"){throw Error.argumentNull("tiles")}this._innerTilesCollection.appendDictionary(a);this._currentLayer.tiles.appendDictionary(a)},SetNewOpacity:function(a){if(typeof(a)=="undefined"||isNaN(parseInt(a))||parseInt(a)>100||parseInt(a)<0){return}else{this._opacity=parseInt(a)}},DontRemoveUpperLevels:function(){this._mainFrameTilesCount=null},Stop:function(){this._break=true},Destroy:function(){this._Clear();this._innerTilesCollection=null;this._awaitingImages.clear();this._awaitingImages=null},_Clear:function(){this._RemoveAwaitingImagesEvents();this._innerTilesCollection.forEach(function(b,a){delete b.element},{});this._innerTilesCollection.clear()},BeginLoading:function(){this._imageCounter=0;this._break=false;this._RemoveSpareTiles();this._BuildImgGrid();this._ImgQueue()},_BuildImgGrid:function(){this._layerContainer.element.style.left="0px";this._layerContainer.element.style.top="0px";if(!this._currentLayer.element){this._currentLayer.element=document.createElement("div");this._currentLayer.element.style.position="absolute";this._currentLayer.element.id=this._layerId;this._layerContainer.levels.getItem(this._levelId).element.appendChild(this._currentLayer.element)}if(this._currentLayer.tiles.size()>0){this._currentLayer.tiles.forEach(function(c,b,a){if(c.isLoaded=="false"){c.element=document.createElement("img");if(Sys.Browser.agent==Sys.Browser.Firefox){c.element.style.cssText="-moz-user-select: none;"}else{if(Sys.Browser.agent==Sys.Browser.InternetExplorer){c.element.setAttribute("unselectable","on")}}c.element.style.display="none";c.element.name=a;c.element.style.border="0px none";c.element.style.margin="0px";c.element.style.padding="0px";c.element.style.position="absolute";c.element.width=c.element.height=c.curTilePixels;c.element.style.left=String.format("{0}px",c.insertX);c.element.style.top=String.format("{0}px",c.insertY);if(b.opacity<100){c.element.style.opacity=b.opacity/100;c.element.style.filter="alpha(opacity="+b.opacity+")"}b.div.appendChild(c.element)}else{if(!c.element){return}c.element.width=c.element.height=c.curTilePixels;c.element.style.left=String.format("{0}px",c.insertX);c.element.style.top=String.format("{0}px",c.insertY)}},{div:this._currentLayer.element,opacity:this._opacity})}},_ImgQueue:function(){while(this._imageCounter<this._maxTilesCount){if(this._break){this._Clear();return}if(this._mainFrameTilesCount!=null&&this._currentLayer.loadedTilesCount>=this._mainFrameTilesCount){this._RemoveUpperLevels()}if(this._innerTilesCollection.size()<=0){return}this._innerTilesCollection.forEach(function(d,c,b){var a=c._currentLayer.tiles.getItem(b);if(a.isLoaded!="false"){c._currentLayer.loadedTilesCount++;c._innerTilesCollection.removeItem(b);return true}c._innerTilesCollection.removeItem(b);c._PreloadImg(a);return true},this)}},_PreloadImg:function(b){this._insideCall=true;this._imageCounter++;var a=new Image();this._awaitingImages.setItem(b.name,a);a.onload=Function.createDelegate({context:this,img:a,tile:b},this._SwapImg);a.onerror=Function.createDelegate({context:this,img:a,tile:b},this._SubstDiv);a.src=String.format(this._location,b.name);this._insideCall=false},_SwapImg:function(){if(this.context._currentLayer.tiles.hasItem(this.tile.name)&&this.tile.element){this.tile.element.src=this.img.src;this.tile.element.style.display="";this.tile.element.className="";this.context._currentLayer.tiles.getItem(this.tile.name).isLoaded="true";this.context._currentLayer.loadedTilesCount++}if(this.context._awaitingImages.hasItem(this.tile.name)){this.context._awaitingImages.getItem(this.tile.name).onerror=null;this.context._awaitingImages.getItem(this.tile.name).onload=null;this.context._awaitingImages.removeItem(this.tile.name)}this.img=null;if(this.context._imageCounter>0){this.context._imageCounter--}if(!this.context._insideCall){this.context._ImgQueue()}},_SubstDiv:function(){if(this.context._awaitingImages.hasItem(this.tile.name)){this.context._awaitingImages.getItem(this.tile.name).onerror=null;this.context._awaitingImages.getItem(this.tile.name).onload=null;this.context._awaitingImages.removeItem(this.tile.name)}this.img=null;if(this.tile.element){this.tile.element.className="brokenLink";this.tile.element.src="";this.tile.element.style.display="none";this.context._currentLayer.loadedTilesCount++}if(this.context._imageCounter>0){this.context._imageCounter--}if(!this.context._insideCall){this.context._ImgQueue()}},_RemoveSpareTiles:function(){if(!this._currentLayer.element){return}if(this._currentLayer.element.childNodes.length>0){for(var a=this._currentLayer.element.childNodes.length-1;a>=0;a--){if(!this._currentLayer.tiles.hasItem(this._currentLayer.element.childNodes[a].name)||this._currentLayer.element.childNodes[a].className=="brokenLink"||this._currentLayer.element.childNodes[a].style.display=="none"){if(this._awaitingImages.hasItem(this._currentLayer.element.childNodes[a].name)){this._awaitingImages.getItem(this._currentLayer.element.childNodes[a].name).onload=null;this._awaitingImages.getItem(this._currentLayer.element.childNodes[a].name).onerror=null;this._awaitingImages.removeItem(this._currentLayer.element.childNodes[a].name)}this._currentLayer.element.removeChild(this._currentLayer.element.childNodes[a])}else{this._currentLayer.tiles.getItem(this._currentLayer.element.childNodes[a].name).isLoaded="true"}}}},_RemoveAwaitingImagesEvents:function(){this._awaitingImages.forEach(function(a,c,b){a.onload=null;a.onerror=null;a=null;c.parent.removeItem(b)},{parent:this._awaitingImages})},_RemoveUpperLevels:function(){this._layerContainer.levels.forEach(function(c,b,a){if(!c.element){return}if(b.currentLvl>a.substr(a.lastIndexOf("_")+1)){b._RemoveImgNodes(c.element);b.layerContainer.element.removeChild(c.element);b.layerContainer.levels.removeItem(a)}},{currentLvl:this._curLvl,_RemoveImgNodes:this._RemoveImgNodes,_awaitingImages:this._awaitingImages,layerContainer:this._layerContainer})},_RemoveImgNodes:function(b){if(b.nodeName=="DIV"){if(b.childNodes.length>0){for(var a=b.childNodes.length-1;a>=0;a--){this._RemoveImgNodes(b.childNodes[a])}}}else{if(b.nodeName=="IMG"){if(this._awaitingImages.hasItem(b.name)){this._awaitingImages.getItem(b.name).onload=null;this._awaitingImages.getItem(b.name).onerror=null;this._awaitingImages.removeItem(b.name)}var c=b.parentNode;c.removeChild(b)}}}};IngrPL.WebClient.Core.Platform.MapLayers.TileManager.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.TileManager");
//END IngrPL.WebClient.Core.Platform.MapLayers.TileManager.js
//START IngrPL.WebClient.Core.Platform.MapLayers.ARSLayer.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");IngrPL.WebClient.Core.Platform.MapLayers.ARSLayer=function(a){IngrPL.WebClient.Core.Platform.MapLayers.ARSLayer.initializeBase(this,[a]);this._maxRangeVisibilityRatio=1;var b=this._getMapServiceConfig();this._firstExtentTilesCount=b.firstExtentTilesCount;this._secondExtentTilesCount=b.secondExtentTilesCount;this._maxConcurrentTileDownloadLimit=b.maxConcurrentTileDownloadLimit;this._belowLayersCount=0;$event.register("opacityChanged",this._setOpacity,this);this._curScaleDenominator=-1;this._prevScaleDenominator=-1;this._prevMapLayerDivBounds=null;this._layerContainer={};this._layerContainer.levels=new IngrPL.WebClient.Core.Platform.Common.Dictionary();this._layerContainer.element=null;this._tilesAwaiting=new IngrPL.WebClient.Core.Platform.Common.Dictionary();this._tileUploadManager=new IngrPL.WebClient.Core.Platform.Common.Dictionary();$event.register("crsChanged",this._crsChanged,this)};IngrPL.WebClient.Core.Platform.MapLayers.ARSLayer.prototype={_getRenderingMapRange:function(){if(this._geographicFactor==1){return this._renderingMapRange}var a=this._renderingMapRange.clone();var c=new IngrPL.WebClient.Core.Platform.Common.Point(a.getBottomLeft().x*this._geographicFactor,a.getBottomLeft().y*this._geographicFactor);var b=new IngrPL.WebClient.Core.Platform.Common.Point(a.getUpperRight().x*this._geographicFactor,a.getUpperRight().y*this._geographicFactor);return new IngrPL.WebClient.Core.Platform.MapContent.MapRange([c.x,c.y,b.x,b.y])},_getPendingMapRange:function(){if(this._geographicFactor==1){return this._pendingMapRange}var a=this._pendingMapRange.clone();var c=new IngrPL.WebClient.Core.Platform.Common.Point(a.getBottomLeft().x*this._geographicFactor,a.getBottomLeft().y*this._geographicFactor);var b=new IngrPL.WebClient.Core.Platform.Common.Point(a.getUpperRight().x*this._geographicFactor,a.getUpperRight().y*this._geographicFactor);return new IngrPL.WebClient.Core.Platform.MapContent.MapRange([c.x,c.y,b.x,b.y])},_getCurrentMapRange:function(){if(this._geographicFactor==1){return this._currentMapRange}var a=this._currentMapRange.clone();var c=new IngrPL.WebClient.Core.Platform.Common.Point(a.getBottomLeft().x*this._geographicFactor,a.getBottomLeft().y*this._geographicFactor);var b=new IngrPL.WebClient.Core.Platform.Common.Point(a.getUpperRight().x*this._geographicFactor,a.getUpperRight().y*this._geographicFactor);return new IngrPL.WebClient.Core.Platform.MapContent.MapRange([c.x,c.y,b.x,b.y])},_getGeographicFator:function(){this._rasterServiceConfig=this._rasterServiceConfig||this._getRasterServiceConfig();return this._rasterServiceConfig.Geographic[$crs.getCurrent().get_id()]?3600:1},_render:function(){this._currentCrsId=$crs.getCurrent().get_id();if(this._config.get_mapState().get_mapControl()!=null){this._prevScaleDenominator=this._curScaleDenominator;this._curScaleDenominator=this._config.get_mapState().get_mapControl().get_scaleDenominator()}this._mapChanged=false;this._allTilesLoaded=true;this._rasterServiceConfig=this._rasterServiceConfig||this._getRasterServiceConfig();this._geographicFactor=this._getGeographicFator();var a=this._prevMapLayerDivBounds=$common.getBounds(this._mapLayerDiv);var l=this._getRenderingMapRange().getBottomLeft();var o=this._getRenderingMapRange().getUpperRight();this._setBounds();var e=this._getVisibleLegendItemDefinitionIdsString();if(e!=null&&this._checkBounds()){if(!this._layerContainer.element){this._layerContainer.element=document.createElement("div");this._layerContainer.element.style.position="absolute";this._layerContainer.element.style.left="0px";this._layerContainer.element.style.top="0px";this._mapLayerDiv.appendChild(this._layerContainer.element)}if(this._layerContainer.element.style.display=="none"){this._layerContainer.element.style.display=""}var h=this._getMapServiceConfig();this._mapFactor=this._getMapFactor(a.width>=a.height?a.width:a.height,a.width>=a.height?(o.x-l.x):(o.y-l.y));this._rasterFactors=this._getRasterLevelsFactors(this._rasterServiceConfig.MapSize[$crs.getCurrent().get_id()],this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()]);this._currentLvl=this._getProperLevel(this._mapFactor,this._rasterFactors);if(this._currentLvl==-1){this._onRendered();return}if(this._isOutOfRange(this._mapFactor)){this._clearLayer();this._onRendered();return}var k=this._getCurrentTileSizeFactor(this._mapFactor,this._rasterFactors[this._currentLvl]);var f=this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][this._currentLvl].levelNumber;if(this._tileUploadManager.size()>0){this._tileUploadManager.forEach(function(s,r,q){s.Stop();if(r.curLvl!=q){s.Destroy();r.container.removeItem(q)}},{curLvl:String.format("{0}{1}_{2}",e.rasterId,e.layerId,this._currentLvl),container:this._tileUploadManager})}if(this._layerContainer.levels.size()>0){this._layerContainer.levels.forEach(function(v,s,r){if(!v.element){return}if(s.rasterFactors[s.currentLvl]==s.rasterFactors[r.substr(r.lastIndexOf("_")+1)]){v.element.style.display=""}else{if(s.rasterFactors[s.currentLvl]>s.rasterFactors[r.substr(r.lastIndexOf("_")+1)]){s._removeImgNodes(v.element);s.layerContainer.element.removeChild(v.element);s.layerContainer.levels.removeItem(r)}else{if(s.rasterFactors[s.currentLvl]<s.rasterFactors[r.substr(r.lastIndexOf("_")+1)]){if(s.curScaleDenominator==s.prevScaleDenominator){var u=r.substr(r.lastIndexOf("_")+1);var t=s.getCurrentTileSizeFactor(s.curMapFactor,s.rasterFactors[u]);var q=Math.round(s.MapSize*t);if(v&&v.layers.size()>0){v.layers.forEach(function(y,x,w){if(w.substr(w.lastIndexOf("_")+1)!="mainFrame"&&x.maxConcurrentTileDownloadLimit>0){return}x.alterTilesInLayer(y.tiles,x.realSize,x.mapSize,q,x.curMapFactor)},{alterTilesInLayer:s.alterTilesInLayer,realSize:s.realSize,mapSize:s.mapSize,curMapFactor:s.curMapFactor,tileUploadManager:s.tileUploadManager,maxConcurrentTileDownloadLimit:s.maxConcurrentTileDownloadLimit})}}}}}},{rasterFactors:this._rasterFactors,currentLvl:this._currentLvl,_removeImgNodes:this._removeImgNodes,_tilesAwaiting:this._tilesAwaiting,layerContainer:this._layerContainer,curScaleDenominator:this._curScaleDenominator,prevScaleDenominator:this._prevScaleDenominator,getCurrentTileSizeFactor:this._getCurrentTileSizeFactor,curMapFactor:this._mapFactor,alterTilesInLayer:this._alterTilesInLayer,realSize:{bottomLeft:l,upperRight:o},mapSize:{width:a.width,height:a.height},maxConcurrentTileDownloadLimit:this._maxConcurrentTileDownloadLimit,MapSize:this._rasterServiceConfig.MapSize[$crs.getCurrent().get_id()]})}var i;var c;var d;if(!this._layerContainer.levels.hasItem(String.format("{0}{1}_{2}",e.rasterId,e.layerId,this._currentLvl))){i={};i.layers=new IngrPL.WebClient.Core.Platform.Common.Dictionary();i.element=document.createElement("div");i.element.style.position="absolute";this._layerContainer.levels.setItem(String.format("{0}{1}_{2}",e.rasterId,e.layerId,this._currentLvl),i);this._layerContainer.element.appendChild(i.element);c={};c.tiles=new IngrPL.WebClient.Core.Platform.Common.Dictionary();c.element=document.createElement("div");c.element.style.position="absolute";c.parameters=null;c.loadedTilesCount=0;i.element.appendChild(c.element)}else{i=this._layerContainer.levels.getItem(String.format("{0}{1}_{2}",e.rasterId,e.layerId,this._currentLvl));c=i.layers.getItem(String.format("{0}{1}_{2}_mainFrame",e.rasterId,e.layerId,this._currentLvl));if(this._maxConcurrentTileDownloadLimit>0){if(i.layers.hasItem(String.format("{0}{1}_{2}_firstExtent",e.rasterId,e.layerId,this._currentLvl))){i.layers.getItem(String.format("{0}{1}_{2}_firstExtent",e.rasterId,e.layerId,this._currentLvl)).tiles=c.tiles.cloneDictionary()}if(i.layers.hasItem(String.format("{0}{1}_{2}_secondExtent",e.rasterId,e.layerId,this._currentLvl))){i.layers.getItem(String.format("{0}{1}_{2}_secondExtent",e.rasterId,e.layerId,this._currentLvl)).tiles=c.tiles.cloneDictionary()}}}c.parameters=this._getTiles(c,{bottomLeft:l,upperRight:o},{width:a.width,height:a.height},this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][this._currentLvl].tileSize,Math.round(this._rasterServiceConfig.MapSize[$crs.getCurrent().get_id()]*k),this._mapFactor,f,String.format("{0}{1}_{2}_mainFrame",e.rasterId,e.layerId,this._currentLvl));i.layers.setItem(String.format("{0}{1}_{2}_mainFrame",e.rasterId,e.layerId,this._currentLvl),c);var j;if(this._maxConcurrentTileDownloadLimit>0){if(!this._tileUploadManager.hasItem(String.format("{0}{1}_{2}",e.rasterId,e.layerId,this._currentLvl))){j=new IngrPL.WebClient.Core.Platform.MapLayers.TileManager(this._maxConcurrentTileDownloadLimit,this._layerContainer,String.format("{0}{1}_{2}_mainFrame",e.rasterId,e.layerId,this._currentLvl),String.format("{0}/getTile.aspx?service={1}&cs={2}&fileIDX={{0}}.{3}&DateStamp={4}",h.url,this._rasterServiceConfig.Code,$crs.getCurrent().get_id().replace(":",""),this._rasterServiceConfig.MapType[$crs.getCurrent().get_id()].toLowerCase(),this._rasterServiceConfig.DateStamp[$crs.getCurrent().get_id()]),this._config.get_opacity());this._tileUploadManager.setItem(String.format("{0}{1}_{2}",e.rasterId,e.layerId,this._currentLvl),j)}else{j=this._tileUploadManager.getItem(String.format("{0}{1}_{2}",e.rasterId,e.layerId,this._currentLvl));j.SetNewTilesList(c);j.SetNewOpacity(this._config.get_opacity())}}var m=0;if(this._firstExtentTilesCount>0&&this._maxConcurrentTileDownloadLimit>0){var b;if(!i.layers.hasItem(String.format("{0}{1}_{2}_firstExtent",e.rasterId,e.layerId,this._currentLvl))){b={};b.tiles=new IngrPL.WebClient.Core.Platform.Common.Dictionary();b.element=c.element;b.parameters=null;b.loadedTilesCount=null;i.layers.setItem(String.format("{0}{1}_{2}_firstExtent",e.rasterId,e.layerId,this._currentLvl),b)}else{b=i.layers.getItem(String.format("{0}{1}_{2}_firstExtent",e.rasterId,e.layerId,this._currentLvl))}this._getSideTiles(b,c.parameters,{width:a.width,height:a.height},this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][this._currentLvl].tileSize,Math.round(this._rasterServiceConfig.MapSize[$crs.getCurrent().get_id()]*k),this._mapFactor,f,"first");j.AppendNewTilesList(b.tiles)}else{if(i.layers.hasItem(String.format("{0}{1}_{2}_firstExtent",e.rasterId,e.layerId,this._currentLvl))){var n=i.layers.getItem(String.format("{0}{1}_{2}_firstExtent",e.rasterId,e.layerId,this._currentLvl));this._getSideTiles(n,c.parameters,{width:a.width,height:a.height},this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][this._currentLvl].tileSize,Math.round(this._rasterServiceConfig.MapSize[$crs.getCurrent().get_id()]*k),this._mapFactor,f,"first");m++}}if(this._secondExtentTilesCount>0&&this._maxConcurrentTileDownloadLimit>0){var g;if(!i.layers.hasItem(String.format("{0}{1}_{2}_secondExtent",e.rasterId,e.layerId,this._currentLvl))){g={};g.tiles=new IngrPL.WebClient.Core.Platform.Common.Dictionary();g.element=c.element;g.parameters=null;g.loadedTilesCount=null;i.layers.setItem(String.format("{0}{1}_{2}_secondExtent",e.rasterId,e.layerId,this._currentLvl),g)}else{g=i.layers.getItem(String.format("{0}{1}_{2}_secondExtent",e.rasterId,e.layerId,this._currentLvl))}this._getSideTiles(g,c.parameters,{width:a.width,height:a.height},this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][this._currentLvl].tileSize,Math.round(this._rasterServiceConfig.MapSize[$crs.getCurrent().get_id()]*k),this._mapFactor,f,"second");j.AppendNewTilesList(g.tiles)}else{if(i.layers.hasItem(String.format("{0}{1}_{2}_secondExtent",e.rasterId,e.layerId,this._currentLvl))){var p=i.layers.getItem(String.format("{0}{1}_{2}_secondExtent",e.rasterId,e.layerId,this._currentLvl));this._getSideTiles(p,c.parameters,{width:a.width,height:a.height},this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][this._currentLvl].tileSize,Math.round(this._rasterServiceConfig.MapSize[$crs.getCurrent().get_id()]*k),this._mapFactor,f,"second");m++}}if(m&&this._maxConcurrentTileDownloadLimit==0){this._moveTilesOnLevel(String.format("{0}{1}_{2}",e.rasterId,e.layerId,this._currentLvl))}if(this._maxConcurrentTileDownloadLimit>0){j.BeginLoading()}else{this._renderTiles(c,String.format("{0}/getTile.aspx?service={1}&cs={2}&fileIDX={{0}}.{3}&DateStamp={4}",h.url,this._rasterServiceConfig.Code,$crs.getCurrent().get_id().replace(":",""),this._rasterServiceConfig.MapType[$crs.getCurrent().get_id()].toLowerCase(),this._rasterServiceConfig.DateStamp[$crs.getCurrent().get_id()]))}this._layerContainer.levels.forEach(function(s,r,q){if(!s.element){return}if(!r.jpgTile&&r.rasterFactors[r.currentLvl]<r.rasterFactors[q.substr(q.lastIndexOf("_")+1)]){r._removeImgNodes(s.element);r.layerContainer.element.removeChild(s.element);r.layerContainer.levels.removeItem(q)}else{if(r.jpgTile&&r.rasterFactors[r.currentLvl]<r.rasterFactors[q.substr(q.lastIndexOf("_")+1)]){if(r.rasterFactors[r.currentLvl-1]&&r.rasterFactors[r.currentLvl-1]<r.rasterFactors[q.substr(q.lastIndexOf("_")+1)]){r._removeImgNodes(s.element);r.layerContainer.element.removeChild(s.element);r.layerContainer.levels.removeItem(q)}}}},{rasterFactors:this._rasterFactors,currentLvl:this._currentLvl,_removeImgNodes:this._removeImgNodes,layerContainer:this._layerContainer,_tilesAwaiting:this._tilesAwaiting,jpgTile:this._rasterServiceConfig.MapType[$crs.getCurrent().get_id()].toLowerCase()=="jpg"});if(this._allTilesLoaded&&this._maxConcurrentTileDownloadLimit==0){this._onLayerLoaded("first",String.format("{0}{1}_{2}",e.rasterId,e.layerId,this._currentLvl))}}else{if(this._tileUploadManager.size()>0){this._tileUploadManager.forEach(function(r,q){r.Stop()},{})}this._clearLayer()}this._onRendered()},_clearLayer:function(){if(this._layerContainer&&this._layerContainer.levels){this._layerContainer.levels.forEach(function(c,b,a){if(!c.element){return}b._removeImgNodes(c.element);b.layerContainer.element.removeChild(c.element)},{_removeImgNodes:this._removeImgNodes,layerContainer:this._layerContainer,_tilesAwaiting:this._tilesAwaiting});this._layerContainer.levels.clear()}},_destroy:function(){$event.unregister("opacityChanged",this._setOpacity,this);this._clearLayer();this._layerContainer=null;this._tilesAwaiting.clear();this._tilesAwaiting=null;this._tileUploadManager.forEach(function(b,a){b.Stop();b.Destroy()},{});this._tileUploadManager.clear();this._tileUploadManager=null},_setBounds:function(){if(this._rasterServiceConfig&&(typeof(this._bounds)=="undefined"||this._bounds==null)){var b=this._rasterServiceConfig.boundingBox;this._bounds={};for(var a in b){if(b[a]&&b[a].length==4){this._bounds[a]={bottomLeft:{x:b[a][0],y:b[a][1]},upperRight:{x:b[a][2],y:b[a][3]}}}}}},_crsChanged:function(){this._clearLayer()},_alterTilesOnMap:function(){this._layerContainer.element.style.left="0px";this._layerContainer.element.style.top="0px";var b=this._prevMapLayerDivBounds=$common.getBounds(this._mapLayerDiv);var a=this._getPendingMapRange().getBottomLeft();var c=this._getPendingMapRange().getUpperRight();var d=this._getMapFactor(b.width>=b.height?b.width:b.height,b.width>=b.height?(c.x-a.x):(c.y-a.y));if(this._layerContainer&&this._layerContainer.levels.size()>0){this._layerContainer.levels.forEach(function(j,g,f){var i=f.substr(f.lastIndexOf("_")+1);var h=g.getCurrentTileSizeFactor(g.curMapFactor,g.rasterFactors[i]);var e=Math.round(g.MapSize*h);if(j&&j.layers.size()>0){j.layers.forEach(function(m,l,k){if(k.substr(k.lastIndexOf("_")+1)=="mainFrame"){if(l.tileUploadManager.hasItem(k.substr(0,k.lastIndexOf("_")))){l.tileUploadManager.getItem(k.substr(0,k.lastIndexOf("_"))).DontRemoveUpperLevels()}else{m.loadedTilesCount=-1}}l.alterTilesInLayer(m.tiles,l.realSize,l.mapSize,e,l.curMapFactor)},{alterTilesInLayer:g.alterTilesInLayer,realSize:g.realSize,mapSize:g.mapSize,curMapFactor:g.curMapFactor,tileUploadManager:g.tileUploadManager})}},{getCurrentTileSizeFactor:this._getCurrentTileSizeFactor,curMapFactor:d,rasterFactors:this._rasterFactors,MapSize:this._rasterServiceConfig.MapSize[$crs.getCurrent().get_id()],alterTilesInLayer:this._alterTilesInLayer,realSize:{bottomLeft:a,upperRight:c},mapSize:{width:b.width,height:b.height},tileUploadManager:this._tileUploadManager})}if(this._config.get_mapState().get_mapControl()!=null){this._prevScaleDenominator=this._curScaleDenominator;this._curScaleDenominator=this._config.get_mapState().get_mapControl().get_scaleDenominator()}this._currentMapRange=this._pendingMapRange},_alterTilesInLayer:function(b,d,a,e,c){if(b&&b.size()>0){b.forEach(function(i,h){var g=Math.round((i.baseRealX-h.mapBBox.bottomLeft.x)/h.factor);var f=Math.round((i.baseRealY-h.mapBBox.bottomLeft.y)/h.factor);i.curTilePixels=h.tilePixel;i.pixelX=g+(i.posX*i.curTilePixels);i.pixelY=f+(i.posY*i.curTilePixels);i.insertX=i.pixelX;i.insertY=h.frameSize.height-(i.pixelY+i.curTilePixels);if(i.element){i.element.width=i.curTilePixels;i.element.height=i.curTilePixels;i.element.style.left=String.format("{0}px",i.insertX);i.element.style.top=String.format("{0}px",i.insertY)}},{mapBBox:d,frameSize:a,tilePixel:e,factor:c})}},_shiftMap:function(){var b=this._prevMapLayerDivBounds=$common.getBounds(this._mapLayerDiv);var a=this._getPendingMapRange().getBottomLeft();var c=this._getPendingMapRange().getUpperRight();var e=this._getMapFactor(b.width>=b.height?b.width:b.height,b.width>=b.height?(c.x-a.x):(c.y-a.y));var f=this._getCurrentMapRange().getBottomLeft();var g=Math.round((f.x-a.x)/e);var d=Math.round((a.y-f.y)/e);this._layerContainer.element.style.left=g+"px";this._layerContainer.element.style.top=d+"px"},_getTiles:function(u,v,q,n,o,p,a){var r=new IngrPL.WebClient.Core.Platform.Common.Dictionary();var c=v.bottomLeft.x+((v.upperRight.x-v.bottomLeft.x)/2);var b=v.bottomLeft.y+((v.upperRight.y-v.bottomLeft.y)/2);var f=parseInt(c/n)*n;var d=parseInt(b/n)*n;var g=Math.round((f-v.bottomLeft.x)/p);var e=Math.round((d-v.bottomLeft.y)/p);var s=0;while((f+((s+1)*n))<v.upperRight.x){s++}var h=0;while((f+(h*n))>v.bottomLeft.x){h--}var m=0;while((d+(m*n))>v.bottomLeft.y){m--}var l=0;while((d+((l+1)*n))<v.upperRight.y){l++}for(var k=h;k<=s;k++){for(var j=l;j>=m;j--){var t={};t.pixelX=g+(k*o);t.pixelY=e+(j*o);t.insertX=t.pixelX;t.insertY=q.height-(t.pixelY+o);t.baseRealX=f;t.baseRealY=d;t.posX=k;t.posY=j;t.tileSize=n;t.curTilePixels=o;t.name=String.format("L{0}X{1}Y{2}",a,((f/n)+k),((d/n)+j));if(u.tiles.hasItem(t.name)){if(u.tiles.getItem(t.name).isLoaded=="true"&&u.tiles.getItem(t.name).element){if(u.element!=u.tiles.getItem(t.name).element.parentNode){var i=u.tiles.getItem(t.name).element.parentNode;i.removeChild(u.tiles.getItem(t.name).element);u.tiles.removeItem(t.name);t.element=null;t.isLoaded="false"}else{t.element=u.tiles.getItem(t.name).element;t.isLoaded=u.tiles.getItem(t.name).isLoaded}}else{t.element=null;t.isLoaded="false"}}else{t.element=null;t.isLoaded="false"}r.setItem(t.name,t)}}u.tiles.forEach(function(x,w){delete x.element},{});u.tiles.clear();u.tiles.appendDictionary(r);r.clear();r=null;return{tileSpread:{right:s,left:h,up:l,down:m},tileSize:n,tilePixel:o,baseRealPosition:{x:f,y:d},basePixelPosition:{x:g,y:e}}},_getSideTiles:function(f,d,c,n,k,h,b,o){var m=new IngrPL.WebClient.Core.Platform.Common.Dictionary();var e;var a;if(o=="first"){e=this._firstExtentTilesCount;a=0}else{if(o=="second"){e=this._secondExtentTilesCount;a=this._firstExtentTilesCount}else{return}}for(var j=-1*e+d.tileSpread.left-a;j<=d.tileSpread.right+a+e;j++){for(var i=d.tileSpread.up+a+e;i>=-1*e+d.tileSpread.down-a;i--){if(j>=d.tileSpread.left-a&&j<=d.tileSpread.right+a&&i>=d.tileSpread.down-a&&i<=d.tileSpread.up+a){continue}var g={};g.pixelX=d.basePixelPosition.x+(j*k);g.pixelY=d.basePixelPosition.y+(i*k);g.insertX=g.pixelX;g.insertY=c.height-(g.pixelY+k);g.baseRealX=d.baseRealPosition.x;g.baseRealY=d.baseRealPosition.y;g.posX=j;g.posY=i;g.tileSize=n;g.curTilePixels=k;g.name=String.format("L{0}X{1}Y{2}",b,((d.baseRealPosition.x/n)+j),((d.baseRealPosition.y/n)+i));if(f.tiles.hasItem(g.name)){if(f.tiles.getItem(g.name).isLoaded=="true"&&f.tiles.getItem(g.name).element){if(f.element!=f.tiles.getItem(g.name).element.parentNode){var l=f.tiles.getItem(g.name).element.parentNode;l.removeChild(f.tiles.getItem(g.name).element);f.tiles.removeItem(g.name);g.element=null;g.isLoaded="false"}else{g.element=f.tiles.getItem(g.name).element;g.isLoaded=f.tiles.getItem(g.name).isLoaded}}else{g.element=null;g.isLoaded="false"}}else{g.element=null;g.isLoaded="false"}m.setItem(g.name,g)}}f.tiles.forEach(function(q,p){delete q.element},{});f.tiles.clear();f.tiles.appendDictionary(m);m.clear();m=null},_renderTiles:function(b,a){if(!b.element){return}this._removeSpareTiles(b.element,b.tiles);this._layerContainer.element.style.left="0px";this._layerContainer.element.style.top="0px";if(b.tiles.size()>0){b.tiles.forEach(function(e,d,c){if(e.isLoaded=="false"){e.element=document.createElement("img");if(Sys.Browser.agent==Sys.Browser.Firefox){e.element.style.cssText="-moz-user-select: none;"}else{if(Sys.Browser.agent==Sys.Browser.InternetExplorer){e.element.setAttribute("unselectable","on")}}e.element.style.display="none";e.element.name=c;e.element.onload=Function.createDelegate({that:d.that,tile:e,layer:d.layer},d.onLoad);e.element.onerror=Function.createDelegate({that:d.that,tile:e},d.onError);e.element.style.border="0px none";e.element.style.margin="0px";e.element.style.padding="0px";e.element.style.position="absolute";e.element.src=String.format(d.location,c);e.element.width=e.curTilePixels;e.element.height=e.curTilePixels;e.element.style.left=String.format("{0}px",e.insertX);e.element.style.top=String.format("{0}px",e.insertY);if(d.opacity<100){e.element.style.opacity=d.opacity/100;e.element.style.filter="alpha(opacity="+d.opacity+")"}d.div.appendChild(e.element);d.tilesAwaiting.setItem(c,e.element)}else{if(!e.element){return}e.element.width=e.curTilePixels;e.element.height=e.curTilePixels;e.element.style.left=String.format("{0}px",e.insertX);e.element.style.top=String.format("{0}px",e.insertY);if(d.layer.loadedTilesCount!=null){d.layer.loadedTilesCount++}}},{div:b.element,location:a,that:this,layer:b,onLoad:this._isLayerLoaded,onError:this._onEmptyTile,opacity:this._config.get_opacity(),tilesAwaiting:this._tilesAwaiting})}},_removeSpareTiles:function(c,a){if(!c){return}if(c.childNodes.length>0){for(var b=c.childNodes.length-1;b>=0;b--){if(!a.hasItem(c.childNodes[b].name)||c.childNodes[b].className=="brokenLink"||c.childNodes[b].style.display=="none"){if(this._tilesAwaiting.hasItem(c.childNodes[b].name)){this._tilesAwaiting.getItem(c.childNodes[b].name).onload=null;this._tilesAwaiting.getItem(c.childNodes[b].name).onerror=null;this._tilesAwaiting.removeItem(c.childNodes[b].name)}c.removeChild(c.childNodes[b])}else{a.getItem(c.childNodes[b].name).isLoaded="true"}}}},_moveTilesOnLevel:function(d){var a=String.format("{0}_mainFrame",d);var e=String.format("{0}_firstExtent",d);var b=String.format("{0}_secondExtent",d);if(this._layerContainer.levels.hasItem(d)){if(!this._layerContainer.levels.getItem(d).layers.hasItem(a)){return}var c=2;if(this._layerContainer.levels.getItem(d).layers.hasItem(e)){this._moveTiles(a,e);this._moveTiles(e,a);c--}if(this._layerContainer.levels.getItem(d).layers.hasItem(b)){this._moveTiles(a,b);this._moveTiles(b,a);c--}if(!c){this._moveTiles(e,b);this._moveTiles(b,e)}}},_moveTiles:function(c,f){if(!c||!f){return}var a=c.substr(0,c.lastIndexOf("_"));var b=this._layerContainer.levels.getItem(a).layers.getItem(c);var e=this._layerContainer.levels.getItem(a).layers.getItem(f);if(b.element&&e.element){for(var d=e.element.childNodes.length-1;d>=0;d--){if(b.tiles.hasItem(e.element.childNodes[d].name)){b.element.appendChild(e.element.childNodes[d])}}}},_onEmptyTile:function(){if(this.that._tilesAwaiting.hasItem(this.tile.name)){this.tile.element.onload=null;this.tile.element.onerror=null;this.that._tilesAwaiting.removeItem(this.tile.name)}this.tile.element.className="brokenLink";this.tile.element.src="";this.tile.element.style.display="none"},_isLayerLoaded:function(){this.tile.element.style.display="";this.tile.element.className="";if(this.that._tilesAwaiting.hasItem(this.tile.name)){this.tile.element.onload=null;this.tile.element.onerror=null;this.that._tilesAwaiting.removeItem(this.tile.name)}this.tile.isLoaded="true";if(this.layer.parameters!=null){this.layer.loadedTilesCount++}if(this.layer.loadedTilesCount==this.layer.tiles.size()){this.that._removeUpperLevels()}},_onLayerLoaded:function(b,a){this._allTilesLoaded=true;if(this._mapChanged){return}if(b=="main"){this._loadMainFrame(a)}else{if(b=="first"){this._loadFirstExtent(a)}else{if(b=="second"){this._loadSecondExtent(a)}}}},_loadMainFrame:function(b){if(this._mapChanged){return}var a=parseInt(b.substr(b.lastIndexOf("_")+1))-1;if(a>=0){if(this._belowLayerCount==-1){this._onLayerLoaded("main",String.format("{0}{1}",b.substr(0,b.lastIndexOf("_")+1),a))}else{if(this._currentLvl-a<=this._belowLayersCount){this._onLayerLoaded("main",String.format("{0}{1}",b.substr(0,b.lastIndexOf("_")+1),a))}}}},_loadFirstExtent:function(c){if(this._firstExtentTilesCount>0&&!this._mapChanged){var f;if(this._layerContainer&&this._layerContainer.levels.hasItem(c)&&!this._layerContainer.levels.getItem(c).layers.hasItem(String.format("{0}_firstExtent",c))){f={};f.tiles=new IngrPL.WebClient.Core.Platform.Common.Dictionary();f.element=document.createElement("div");f.element.style.position="absolute";f.parameters=null;f.loadedTilesCount=null;this._layerContainer.levels.getItem(c).element.appendChild(f.element);this._layerContainer.levels.getItem(c).layers.setItem(String.format("{0}_firstExtent",c),f)}else{f=this._layerContainer.levels.getItem(c).layers.getItem(String.format("{0}_firstExtent",c))}var e=$common.getBounds(this._mapLayerDiv);var b=c.substr(c.lastIndexOf("_")+1);var d=this._getCurrentTileSizeFactor(this._mapFactor,this._rasterFactors[b]);var a=Math.round(this._rasterServiceConfig.MapSize[$crs.getCurrent().get_id()]*d);this._getSideTiles(f,this._layerContainer.levels.getItem(c).layers.getItem(String.format("{0}_mainFrame",c)).parameters,{width:e.width,height:e.height},this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][b].tileSize,a,this._mapFactor,b,"first");this._renderTiles(f,String.format("{0}/getTile.aspx?service={1}&cs={2}&fileIDX={{0}}.{3}&DateStamp={4}",this._getMapServiceConfig().url,this._rasterServiceConfig.Code,$crs.getCurrent().get_id().replace(":",""),this._rasterServiceConfig.MapType[$crs.getCurrent().get_id()].toLowerCase(),this._rasterServiceConfig.DateStamp[$crs.getCurrent().get_id()]))}this._onLayerLoaded("second",c)},_loadSecondExtent:function(d){if(this._secondExtentTilesCount>0&&!this._mapChanged){var g;if(this._layerContainer&&this._layerContainer.hasItem(d)&&!this._layerContainer.getItem(d).hasItem(String.format("{0}_secondExtent",d))){g={};g.tiles=new IngrPL.WebClient.Core.Platform.Common.Dictionary();g.element=document.createElement("div");g.element.style.position="absolute";g.parameters=null;g.loadedTilesCount=null;this._layerContainer.levels.getItem(d).element.appendChild(g.element);this._layerContainer.levels.getItem(d).layers.setItem(String.format("{0}_firstExtent",d),g)}else{g=this._layerContainer.levels.getItem(d).layers.getItem(String.format("{0}_firstExtent",d))}var f=$common.getBounds(this._mapLayerDiv);var b=d.substr(d.lastIndexOf("_")+1);var e=this._getCurrentTileSizeFactor(this._mapFactor,this._rasterFactors[b]);var a=Math.round(this._rasterServiceConfig.MapSize[$crs.getCurrent().get_id()]*e);this._getSideTiles(g,this._layerContainer.getItem(d).getItem(String.format("{0}_mainFrame",d)).parameters,{width:f.width,height:f.height},this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][b].tileSize,a,this._mapFactor,b,"second");this._renderTiles(g,String.format("{0}/getTile.aspx?service={1}&cs={2}&fileIDX={{0}}.{3}&DateStamp={4}",this._getMapServiceConfig().url,this._rasterServiceConfig.Code,$crs.getCurrent().get_id().replace(":",""),this._rasterServiceConfig.MapType[$crs.getCurrent().get_id()].toLowerCase(),this._rasterServiceConfig.DateStamp[$crs.getCurrent().get_id()]))}var c=parseInt(d.substr(d.lastIndexOf("_")+1))-1;if(c>=0){if(this._belowLayerCount==-1){this._onLayerLoaded("main",String.format("{0}{1}",d.substr(0,d.lastIndexOf("_")+1),c))}else{if(this._currentLvl-c<=this._belowLayersCount){this._onLayerLoaded("main",String.format("{0}{1}",d.substr(0,d.lastIndexOf("_")+1),c))}}}},_removeUpperLevels:function(){this._layerContainer.levels.forEach(function(c,b,a){if(!c.element){return}if(b.rasterFactors[b.currentLvl]<b.rasterFactors[a.substr(a.lastIndexOf("_")+1)]){b._removeImgNodes(c.element);b.layerContainer.element.removeChild(c.element);b.layerContainer.levels.removeItem(a)}},{rasterFactors:this._rasterFactors,currentLvl:this._currentLvl,_removeImgNodes:this._removeImgNodes,_tilesAwaiting:this._tilesAwaiting,layerContainer:this._layerContainer})},_removeImgNodes:function(b){if(b.nodeName=="DIV"){if(b.childNodes.length>0){for(var a=b.childNodes.length-1;a>=0;a--){this._removeImgNodes(b.childNodes[a])}}}else{if(b.nodeName=="IMG"){if(this._tilesAwaiting.hasItem(b.name)){this._tilesAwaiting.getItem(b.name).onload=null;this._tilesAwaiting.getItem(b.name).onerror=null;this._tilesAwaiting.removeItem(b.name)}var c=b.parentNode;c.removeChild(b)}}},_setOpacity:function(b,a,c){if(this._config.get_id()!=a.mapLayerConfigId){return}if(this._layerContainer&&this._layerContainer.levels.size()>0){this._layerContainer.levels.forEach(function(e,d){if(e&&e.layers.size()>0){e.layers.forEach(function(h,g){var f;f=h.tiles;f.forEach(function(j,i){if(j.element&&i.opacity<100){j.element.style.opacity=i.opacity/100;j.element.style.filter="alpha(opacity="+i.opacity+")"}},{opacity:g.opacity})},{opacity:d.opacity})}},{opacity:this._config.get_opacity()})}},_getRasterServiceConfig:function(a){var c=this._config.get_mapState().get_legend().get_flatLegend();var b=this._config.get_firstLegendItemPriority();if(b==this._config.get_lastLegendItemPriority()){var d=c[b].get_definition().get_id();return this._getRasterServiceData(this._getCurrentRasterService(d,this._getMapServiceConfig().rasterServices))}else{return null}},_getRasterServiceData:function(c){var a={};if(c!=null){for(var b=0;b<c.length;b++){if(c[b].key){if(c[b].value.length&&typeof(c[b].value)!="string"&&c[b].value.length>0){a[c[b].key]=this._getRasterServiceData(c[b].value)}else{a[c[b].key]=c[b].value}}else{if(Array.isInstanceOfType(c)){return c}else{a[b]=c[b]}}}}return a},_getCurrentRasterService:function(c,b){if(c!=""&&b!=null){for(var a=0;a<b.length;a++){if(b[a].key==c){return b[a].value}}}return null},_getMapFactor:function(a,b){return b/a},_getMaxMapLevel:function(){var a=null;for(var b in this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()]){if(!a){a=b}else{if(this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][b].tileSize>this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][a].tileSize){a=b}}}return a},_getMinMapLevel:function(){var b=null;for(var a in this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()]){if(!b){b=a}else{if(this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][a].tileSize<this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][b].tileSize){b=a}}}return b},_getLayersMultiplayer:function(){var a=this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][this._getMinMapLevel()].tileSize;var b=this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][this._getMaxMapLevel()].tileSize;for(var c in this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()]){if(this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][c].tileSize>a&&this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][c].tileSize<b){b=this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()][c].tileSize}}return Math.round(b/a)},_isOutOfRange:function(a){if((this._rasterFactors[this._getMaxMapLevel()]*(this._getLayersMultiplayer()*this._maxRangeVisibilityRatio))<a||(this._rasterFactors[this._getMinMapLevel()]/(this._getLayersMultiplayer()*this._maxRangeVisibilityRatio))>a){return true}else{return false}},_getRasterLevelsFactors:function(b,c){var a=[];for(var d in c){a.push(c[d].tileSize/b)}return a},_getProperLevel:function(b,d){var a=-1;if(d.length>0){a=0;for(var c=0;c<d.length;c++){if(d[c]<=b){if(d[a]>b&&d[c]<d[a]){a=c}else{if(d[c]>d[a]&&d[c]<=b){a=c}}}else{if(d[c]<d[a]){a=c}}}}return a},_getUpperLevel:function(b,d){var a=-1;if(d.length>0){a=0;for(var c=0;c<d.length;c++){if(d[c]>=b){if(d[a]<b&&d[c]>d[a]){a=c}else{if(d[c]<d[a]&&d[c]>=b){a=c}}}else{if(d[c]>d[a]){a=c}}}}return a},_getProximateLevel:function(d,c){var a=-1;if(c.length>0){a=0;for(var b=0;b<c.length;b++){if(Math.abs(c[a]-d)>Math.abs(c[b]-d)){a=b}}}return a},_getCurrentTileSizeFactor:function(a,b){return b/a},_pendingMapRangeChanged:function(){if(this._currentCrsId!=$crs.getCurrent().get_id()){this._clearLayer();return}this._mapChanged=true;if(this._layerContainer&&this._layerContainer.levels.size()>0){var c=$common.getBounds(this._mapLayerDiv);var b=this._getPendingMapRange().getBottomLeft();var d=this._getPendingMapRange().getUpperRight();var f=this._getMapFactor(c.width>=c.height?c.width:c.height,c.width>=c.height?(d.x-b.x):(d.y-b.y));if(f>this._mapFactor){var e=this._getProperLevel(f,this._rasterFactors);this._layerContainer.levels.forEach(function(i,h,g){if(!i.element){return}if(h.rasterFactors[h.currentLvl]==h.rasterFactors[g.substr(g.lastIndexOf("_")+1)]){i.element.style.display=""}},{rasterFactors:this._rasterFactors,currentLvl:e})}var a=(this._prevMapLayerDivBounds.width!=c.width||this._prevMapLayerDivBounds.height!=c.height)?true:false;if(!a&&f==this._mapFactor){this._shiftMap()}else{this._alterTilesOnMap()}}},_legendItemMoved:function(a,c,b){this._isDirty=true},_updateLegendItemsVisibility:function(a){this._isDirty=true},_updateScaleBands:function(a){this._isDirty=true},_removeLegendItems:function(a){this._isDirty=true},_adjustMapRange:function(c,d){var b=null;var a=this._getVisibleLegendItemDefinitionIdsString();if(a){this._rasterServiceConfig=this._rasterServiceConfig||this._getRasterServiceConfig();this._geographicFactor=this._getGeographicFator();if(this._geographicFactor&&this._geographicFactor==3600){c=c*this._geographicFactor}if(!this._rasterServiceConfig){return b}this._rasterFactors=this._getRasterLevelsFactors(this._rasterServiceConfig.MapSize[$crs.getCurrent().get_id()],this._rasterServiceConfig.ArsLevels[$crs.getCurrent().get_id()]);if(d&&d==true){b=this._rasterFactors[this._getUpperLevel(c,this._rasterFactors)]}else{b=this._rasterFactors[this._getProximateLevel(c,this._rasterFactors)]}if(this._geographicFactor&&this._geographicFactor==3600){b=b/this._geographicFactor}}return b},_getVisibleLegendItemDefinitionIdsString:function(){var d=null;var c=this._config.get_mapState().get_legend().get_flatLegend();var b=this._config.get_firstLegendItemPriority();if(b==this._config.get_lastLegendItemPriority()&&c[b].canBeDisplayed()){var a=c[b].get_definition();d={layerId:c[b].get_id(),rasterId:a.get_id()}}return d},_checkBounds:function(){if(this._bounds==null){$log.writeInfo("\nLack of BoundingBox\nARS: "+this._config.get_name());return true}var a={bottomLeft:this._renderingMapRange.getBottomLeft(),upperRight:this._renderingMapRange.getUpperRight()};return IngrPL.WebClient.Core.Platform.Common.Util.checkBounds(this._bounds,a)}};IngrPL.WebClient.Core.Platform.MapLayers.ARSLayer.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.ARSLayer",IngrPL.WebClient.Core.Platform.MapLayers.MapLayer);
//END IngrPL.WebClient.Core.Platform.MapLayers.ARSLayer.js
//START IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinitionTreeContainer.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapServices");IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinitionTreeContainer=function(a){this._legendItemDefinitions=[];if(a.legendItemDefinitions){this._setLegendItemDefinitions(a.legendItemDefinitions)}};IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinitionTreeContainer.prototype={_setLegendItemDefinitions:function(b){var a=null,e=null;if(IngrPL.WebClient.Core.Platform.MapServices.MapService.isInstanceOfType(this)){a=this}else{if(IngrPL.WebClient.Core.Platform.MapServices.LegendDefinition.isInstanceOfType(this)){a=this._mapService;e=this}}this._legendItemDefinitions=[];this._legendItemDefinitionsById=null;for(var f=0;f<b.length;f++){var d=b[f];var c=new IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinition(d,a,e);this._legendItemDefinitions.push(c)}},_clearLegendItemDefinitions:function(){this._legendItemDefinitions=[];this._legendItemDefinitionsById=null},findLegendItemDefinition:function(a){this._ensureLegendItemDefinitionsById();return this._legendItemDefinitionsById[a]},_ensureLegendItemDefinitionsById:function(){if(!this._legendItemDefinitionsById){this._legendItemDefinitionsById={};this._addLegendItemDefinitionsById(this._legendItemDefinitions)}},addLegendItemDefinitions:function(a){this._ensureLegendItemDefinitionsById();for(var c=0;c<a.length;c++){var b=a[c];this._legendItemDefinitions.push(b)}this._addLegendItemDefinitionsById(a)},_addLegendItemDefinitionsById:function(a){for(var c=0;c<a.length;c++){var b=a[c];this._legendItemDefinitionsById[b.get_id()]=b;this._addLegendItemDefinitionsById(b.get_legendItemDefinitions())}},get_legendItemDefinitions:function(){return this._legendItemDefinitions}};IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinitionTreeContainer.registerClass("IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinitionTreeContainer");
//END IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinitionTreeContainer.js
//START IngrPL.WebClient.Core.Platform.Functions.Function.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.Functions");IngrPL.WebClient.Core.Platform.Functions.FunctionType=function(){};IngrPL.WebClient.Core.Platform.Functions.FunctionType.prototype={Link:0,Kiosk:1};IngrPL.WebClient.Core.Platform.Functions.FunctionType.registerEnum("IngrPL.WebClient.Core.Platform.Functions.FunctionType");IngrPL.WebClient.Core.Platform.Functions.Function=function(a){this._functionType=a.functionType;IngrPL.WebClient.Core.Platform.Functions.Function.initializeBase(this,[a])};IngrPL.WebClient.Core.Platform.Functions.Function.prototype={get_functionType:function(){return this._functionType}};IngrPL.WebClient.Core.Platform.Functions.Function.registerClass("IngrPL.WebClient.Core.Platform.Functions.Function");
//END IngrPL.WebClient.Core.Platform.Functions.Function.js
//START IngrPL.WebClient.Core.Platform.Functions.Kiosk.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.Functions");IngrPL.WebClient.Core.Platform.Functions.Kiosk=function(a){IngrPL.WebClient.Core.Platform.Functions.Kiosk.initializeBase(this,[a]);this._functionType=IngrPL.WebClient.Core.Platform.Functions.FunctionType.Kiosk;this._categoryName=a.categoryName;this._categoryUrl=a.categoryUrl;this._productDescription=a.productDescription};IngrPL.WebClient.Core.Platform.Functions.Kiosk.prototype={get_categoryName:function(){return this._categoryName},get_categoryUrl:function(){return this._categoryUrl},get_productDescription:function(){return this._productDescription}};IngrPL.WebClient.Core.Platform.Functions.Kiosk.registerClass("IngrPL.WebClient.Core.Platform.Functions.Kiosk",IngrPL.WebClient.Core.Platform.Functions.Function);
//END IngrPL.WebClient.Core.Platform.Functions.Kiosk.js
//START IngrPL.WebClient.Core.Platform.Functions.Link.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.Functions");IngrPL.WebClient.Core.Platform.Functions.Link=function(a){IngrPL.WebClient.Core.Platform.Functions.Link.initializeBase(this,[a]);this._functionType=IngrPL.WebClient.Core.Platform.Functions.FunctionType.Link;this._linkName=a.linkName;this._linkValue=a.linkValue};IngrPL.WebClient.Core.Platform.Functions.Link.prototype={get_linkName:function(){return this._linkName},get_linkValue:function(){return this._linkValue}};IngrPL.WebClient.Core.Platform.Functions.Link.registerClass("IngrPL.WebClient.Core.Platform.Functions.Link",IngrPL.WebClient.Core.Platform.Functions.Function);
//END IngrPL.WebClient.Core.Platform.Functions.Link.js
//START IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinition.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapServices");IngrPL.WebClient.Core.Platform.MapServices.LegendItemType=function(){};IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.prototype={Normal:0,ThematicItem:1,Folder:2,Data:3,Analysis:4};IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.registerEnum("IngrPL.WebClient.Core.Platform.MapServices.LegendItemType");IngrPL.WebClient.Core.Platform.MapServices.GeometryType=function(){};IngrPL.WebClient.Core.Platform.MapServices.GeometryType.prototype={SpatialPoint:512,SpatialLinear:1024,SpatialAreal:2048,SpatialAnySpatial:4096,SpatialCoverage:8192,SpatialGraphicsText:16384};IngrPL.WebClient.Core.Platform.MapServices.GeometryType.registerEnum("IngrPL.WebClient.Core.Platform.MapServices.GeometryType");IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinition=function(d,m,h,j){if(d==null){throw Error.argumentNull("legendItemDefinitionStub")}if(m==null){throw Error.argumentNull("mapService")}if(!IngrPL.WebClient.Core.Platform.MapServices.MapService.isInstanceOfType(m)){throw Error.argumentType("mapService",Object.getType(m),IngrPL.WebClient.Core.Platform.MapServices.MapService)}if(h!=null&&!IngrPL.WebClient.Core.Platform.MapServices.LegendDefinition.isInstanceOfType(h)){throw Error.argumentType("legendDefinition",Object.getType(h),IngrPL.WebClient.Core.Platform.MapServices.LegendDefinition)}if(j!=null&&!IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinition.isInstanceOfType(j)){throw Error.argumentType("parent",Object.getType(j),IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinition)}this._id=d.id;this._name=d.name;this._description=d.description||null;this._canDeleteData=d.canDeleteData||false;this._canModifyData=d.canModifyData||false;this._geometryType=d.geometryType||null;this._type=d.type;var a=d.style||{};this._isVisible=a.isVisible;this._isLocatable=a.isLocatable;this._minScaleDenominator=a.minScale;this._maxScaleDenominator=a.maxScale;this._minScaleHint=isNaN(a.minScaleHint)?null:a.minScaleHint;this._maxScaleHint=isNaN(a.maxScaleHint)?null:a.maxScaleHint;this._pictogramDefinition=a.pictogram||d.pictogramDefinition;this._sourceLegendItemDefinitionId=d.sourceLegendItemDefinitionId;this._shop=d.shop||{};if(d.functions!=null){this._functions=[];for(var g=0;g<d.functions.length;g++){var k=d.functions[g];if(k.functionType==IngrPL.WebClient.Core.Platform.Functions.FunctionType.Link){var b=new IngrPL.WebClient.Core.Platform.Functions.Link(k)}else{if(k.functionType==IngrPL.WebClient.Core.Platform.Functions.FunctionType.Kiosk){var b=new IngrPL.WebClient.Core.Platform.Functions.Kiosk(k)}}if(b!=null){this._functions.push(b)}}}this._mapService=m;this._parent=j;this._legendDefinition=h;this._legendItemDefinitions=[];this._setMetadata(d.metadata);if(d.validCRS){this._validCRSIds={};for(var g=0,e=d.validCRS.length;g<e;g++){this._validCRSIds[d.validCRS[g]]=true}}else{if(j){this._validCRSIds=j._validCRSIds}}if(d.legendItemDefinitions){for(var g=0;g<d.legendItemDefinitions.length;g++){var f=d.legendItemDefinitions[g];var c=new IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinition(f,m,h,this);this._legendItemDefinitions.push(c)}}};IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinition.prototype={_setMetadata:function(b){this._metadata={};if(b){for(var a=0;a<b.length;a++){if(b[a].Key){this._metadata[b[a].Key]=b[a].Value}}}},getLegendItemDefaultPriority:function(){if(this._legendDefinition){return this._legendDefinition.getLegendItemDefaultPriority(this)}else{return null}},isCRSValid:function(c,e){if(!this._validCRSIds){return true}if(!c){var b=$crs.getCurrent();if(!b){return false}c=b.get_id()}if(this._validCRSIds[c]){return true}else{if(!e){var f=$crs.getMappings(c);for(var d=0,a=f.length;d<a;d++){if(this._validCRSIds[f[d]]){return true}}}}return false},get_id:function(){return this._id},get_legendItemDefinitions:function(){return this._legendItemDefinitions},get_mapService:function(){return this._mapService},get_parent:function(){return this._parent},get_sourceLegendItemDefinition:function(){if(!this._sourceLegendItemDefinition&&this._sourceLegendItemDefinitionId){this._sourceLegendItemDefinition=this._mapService.findLegendItemDefinition(this._sourceLegendItemDefinitionId)}return this._sourceLegendItemDefinition||null},get_legendDefinition:function(){return this._legendDefinition},get_name:function(){return this._name},get_description:function(){return this._description},get_canDeleteData:function(){return this._canDeleteData},get_canModifyData:function(){return this._canModifyData},get_type:function(){return this._type},get_isVisible:function(){return this._isVisible},get_isLocatable:function(){return this._isLocatable},get_minScaleDenominator:function(){return this._minScaleDenominator},get_maxScaleDenominator:function(){return this._maxScaleDenominator},get_minScaleHint:function(){return this._minScaleHint},get_maxScaleHint:function(){return this._maxScaleHint},get_pictogramDefinition:function(){return this._pictogramDefinition},get_shop:function(){return this._shop},get_functions:function(){return this._functions},get_columns:function(){return this._columns},set_columns:function(a){this._columns=a},get_metadata:function(){return this._metadata},get_geometryType:function(){return this._geometryType}};IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinition.registerClass("IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinition");
//END IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinition.js
//START IngrPL.WebClient.Core.Platform.MapServices.LegendDefinition.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapServices");IngrPL.WebClient.Core.Platform.MapServices.LegendDefinition=function(d,a){if(d==null){throw Error.argumentNull("legendDefinitionStub")}if(a==null){throw Error.argumentNull("mapService")}if(!IngrPL.WebClient.Core.Platform.MapServices.MapService.isInstanceOfType(a)){throw Error.argumentType("mapService",Object.getType(a),IngrPL.WebClient.Core.Platform.MapServices.MapService)}this._mapService=a;IngrPL.WebClient.Core.Platform.MapServices.LegendDefinition.initializeBase(this,[d]);this._id=d.id;this._isDefault=d.isDefault?true:false;this._name=d.name;this._legendItemDefaultPriorities={};for(var c=0;c<d.legendItemDefaultPriorities.length;c++){var b=d.legendItemDefaultPriorities[c];this._legendItemDefaultPriorities[b.Key]=b.Value}};IngrPL.WebClient.Core.Platform.MapServices.LegendDefinition.prototype={getLegendItemDefaultPriority:function(a){if(a==null){throw Error.argumentNull("legendItemDefinition")}if(a.get_legendDefinition()!=this){throw Error.invalidOperation("TODO")}return this._legendItemDefaultPriorities[a.get_id()]},addToMapState:function(c,d){var a=IngrPL.WebClient.Core.Platform.MapContent.MapState;if(c==null){throw Error.argumentNull("mapState")}if(!a.isInstanceOfType(c)){throw Error.argumentType("mapState",Object.getType(c),a)}if(c.get_isInitialized()){this._addToMapState(c,d)}else{if(d){throw Error.invalidOperation()}else{var b={legendDefinition:this,addToMapState:function(f,e,g){if(g!=c){return}this.legendDefinition._addToMapState(c,d);$event.unregister("mapStateVariantChanged",this.addToMapState,this)}};$event.register("mapStateVariantChanged",b.addToMapState,b)}}},_addToMapState:function(d,g){var f=d.addLegend(this);var b=[];for(var c=0,a=f.length;c<a;c++){b[c]=f[c][0]}d.addMapLayerDefinition({mapServiceId:this._mapService.get_id(),legendItemIds:b,name:this._name,defaultOpacity:this._defaultOpacity,defaultFilter:this._mapService.get_activeFilter()});if(!g){var e=d.addMapLayerConfigs();$event.notify("newLegendItemAdded",{mapStateId:d.get_id(),mapLayerConfigs:e},this);$event.notify("refreshMapLegendControl",{mapStateId:d.get_id()},this)}},get_id:function(){return this._id},get_name:function(){return this._name},get_mapService:function(){return this._mapService},get_isDefault:function(){return this._isDefault},set_defaultOpacity:function(a){if(a&&Math.max(0,a)==Math.min(100,a)){this._defaultOpacity=100-a}}};IngrPL.WebClient.Core.Platform.MapServices.LegendDefinition.registerClass("IngrPL.WebClient.Core.Platform.MapServices.LegendDefinition",IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinitionTreeContainer);
//END IngrPL.WebClient.Core.Platform.MapServices.LegendDefinition.js
//START IngrPL.WebClient.Core.Platform.MapServices.MapService.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapServices");IngrPL.WebClient.Core.Platform.MapServices.MapServiceStatus=function(){};IngrPL.WebClient.Core.Platform.MapServices.MapServiceStatus.prototype={Uninitialized:0,Initialized:1,Error:2};IngrPL.WebClient.Core.Platform.MapServices.MapServiceStatus.registerEnum("IngrPL.WebClient.Core.Platform.MapServices.MapServiceStatus");IngrPL.WebClient.Core.Platform.MapServices.MapServiceUserStatus=function(){};IngrPL.WebClient.Core.Platform.MapServices.MapServiceUserStatus.prototype={NotLogged:0,ManuallyLogged:1,AutomaticallyLogged:2};IngrPL.WebClient.Core.Platform.MapServices.MapServiceUserStatus.registerEnum("IngrPL.WebClient.Core.Platform.MapServices.MapServiceUserStatus");IngrPL.WebClient.Core.Platform.MapServices.ImageFormat=function(){};IngrPL.WebClient.Core.Platform.MapServices.ImageFormat.prototype={PNG:0,JPEG:1,SVG:2,SVGZ:3};IngrPL.WebClient.Core.Platform.MapServices.ImageFormat.registerEnum("IngrPL.WebClient.Core.Platform.MapServices.ImageFormat");IngrPL.WebClient.Core.Platform.MapServices.MapService=function(a){IngrPL.WebClient.Core.Platform.MapServices.MapService.initializeBase(this,[a]);this._id=a.id;this._name=a.name;this._legendDefinitions=[];if(a.legendDefinitions){this._setLegendDefinitions(a.legendDefinitions)}this._setConfig(a.config||[]);this._minimalConfigKeys=a.minimalConfigKeys||null;this._setMetadata(a.metadata);this._definitionName=a.definitionName;if(!this._definitionName&&a.definition){this._definitionName=a.definition.name}this._status=a.status==null?IngrPL.WebClient.Core.Platform.MapServices.MapServiceStatus.Uninitialized:a.status;this._isShopService=a.isShopService;this._userName=a.userName;this._userFullName=a.userFullName;this._userStatus=a.userStatus};IngrPL.WebClient.Core.Platform.MapServices.MapService.prototype={_setLegendDefinitions:function(a){for(var c=0;c<a.length;c++){var b=new IngrPL.WebClient.Core.Platform.MapServices.LegendDefinition(a[c],this);this._legendDefinitions.push(b)}},_setConfig:function(a){this._config={};this._configStub=a;for(var b=0;b<a.length;b++){if(a[b].Key){this._config[a[b].Key]=a[b].Value}}},_setMetadata:function(b){this._metadata={};if(b){for(var a=0;a<b.length;a++){if(b[a].Key){this._metadata[b[a].Key]=b[a].Value}}}},initialize:function(){this._initialize()},refresh:function(){var a=this._status!=IngrPL.WebClient.Core.Platform.MapServices.MapServiceStatus.Uninitialized;if(a){this.clear()}this._initialize(a)},_initialize:function(a){if(!this._processingRequest&&this._status==IngrPL.WebClient.Core.Platform.MapServices.MapServiceStatus.Uninitialized){this._processingRequest=true;var b=$webRequest.create({name:"MapServiceManager",query:{action:a?"refresh":"init",id:this._id},mapService:a?undefined:this,callback:this._initializeCompleted,scope:this});b.invoke()}},_initializeCompleted:function(e,b){this._processingRequest=false;var d=IngrPL.WebClient.Core.Platform.Common.Util;if(!d.checkExecutor(e)){this._status=IngrPL.WebClient.Core.Platform.MapServices.MapServiceStatus.Error;var c=String.format(IngrPL.WebClient.Core.Platform.Translate.MapServiceInitializationError_Format,this._id);$event.notify("mapServiceInitFailed",{error:c},this);return}var a=e.get_object();if(a.error){this._status=IngrPL.WebClient.Core.Platform.MapServices.MapServiceStatus.Error;$event.notify("mapServiceInitFailed",{error:a.error},this)}else{this._name=a.name;if(a.legendDefinitions){this._setLegendDefinitions(a.legendDefinitions)}if(a.legendItemDefinitions){this._setLegendItemDefinitions(a.legendItemDefinitions)}this._setConfig(a.config);this._minimalConfigKeys=a.minimalConfigKeys||null;this._setMetadata(a.metadata);this._definitionName=a.definitionName;this._status=a.status;this._isShopService=a.isShopService;this._userName=a.userName;this._userFullName=a.userFullName;this._userStatus=a.userStatus;$event.notify("mapServiceInitialized",null,this)}},getMapLayerType:function(){var a=this.get_definition().mapLayerClientTypeName;return Type.parse(a)},findLegendDefinition:function(a){for(var b=0;b<this._legendDefinitions.length;b++){if(this._legendDefinitions[b].get_id()==a){return this._legendDefinitions[b]}}return null},getDefaultLegendDefinition:function(){for(var a=0;a<this._legendDefinitions.length;a++){if(this._legendDefinitions[a].get_isDefault()){return this._legendDefinitions[a]}}return this._legendDefinitions.length?this._legendDefinitions[0]:null},logIn:function(b,a){if(!this.get_definition().supportsAuthentication){throw Error.invalidOperation(IngrPL.WebClient.Core.Platform.Translate.E_MapServiceDoesNotSupportAuthentication)}this._authenticate({action:"logIn",id:this._id,userName:b,password:a})},logOut:function(){if(!this.get_definition().supportsAuthentication){throw Error.invalidOperation(IngrPL.WebClient.Core.Platform.Translate.E_MapServiceDoesNotSupportAuthentication)}this._authenticate({action:"logOut",id:this._id})},_authenticate:function(b){if(!this._processingRequest){this._processingRequest=true;var a=$webRequest.create({name:"MapServiceManager",query:b,mapService:this.get_isInitialized()?undefined:this,callback:this._authenticateCompleted,scope:this});a.invoke()}},clear:function(){this._setConfig(this._configStub);this._legendDefinitions=[];this._metadata={};this._clearLegendItemDefinitions();this._status=IngrPL.WebClient.Core.Platform.MapServices.MapServiceStatus.Uninitialized;$event.notify("mapServiceCleared",null,this)},_authenticateCompleted:function(e,b){this._processingRequest=false;var d=IngrPL.WebClient.Core.Platform.Common.Util;if(!d.checkExecutor(e)){var c=String.format(IngrPL.WebClient.Core.Platform.Translate.MapServiceAuthError_Format,this._id);$event.notify("mapServiceAuthenticationFailed",{error:c},this);return}var a=e.get_object();if(a.error){$event.notify("mapServiceAuthenticationFailed",{error:a.error},this)}else{if(this._status==IngrPL.WebClient.Core.Platform.MapServices.MapServiceStatus.Uninitialized){this._initialize(true)}else{this.clear();this._initialize(true)}}},ensureColumns:function(a,d,c){var f=[];for(var b=0;b<a.length;b++){if(!a[b].get_columns()){f.push(a[b].get_id())}}if(f&&!this._processingRequest){this._processingRequest=true;var e=$webRequest.create({name:"MapServiceManager",query:{action:"columns",id:this._id,legendItemDefinitionIds:Sys.Serialization.JavaScriptSerializer.serialize(f)},mapService:this.get_isInitialized()?undefined:this,callback:this._ensureColumnsCompleted,scope:this,context:{handler:d,scope:c}});e.invoke()}else{this._ensureColumns_executeHandler(d,c)}},_ensureColumnsCompleted:function(f){this._processingRequest=false;var b=IngrPL.WebClient.Core.Platform.Common.Util;if(!b.checkExecutor(f,b.showError)){return}var e=f.get_webRequest().get_userContext();var d=f.get_object();if(d.error){this._ensureColumns_executeHandler(e.handler,e.scope,d.error)}else{for(var c=0;c<d.length;c++){var a=this.findLegendItemDefinition(d[c].Key);if(a){a.set_columns(d[c].Value)}}this._ensureColumns_executeHandler(e.handler,e.scope)}},_ensureColumns_executeHandler:function(c,b,a){if(b){c.call(b,this,a)}else{c(this,a)}},findFeatures:function(c,e,j,g,b,k,m){if(!this._processingRequest){this._processingRequest=true;var a=[];for(var h=0,d=c.length;h<d;h++){a.push(c[h].get_id())}var f=$webRequest.create({name:"MapServiceManager",query:{action:"findfeatures",id:this._id,legendItemDefinitionIds:Sys.Serialization.JavaScriptSerializer.serialize(a),searchPoints:Sys.Serialization.JavaScriptSerializer.serialize(e),isArea:j,buffer:g||0},filter:b,mapService:this.get_isInitialized()?undefined:this,callback:this._findFeaturesCompleted,scope:this,context:{handler:k,scope:m}});f.invoke()}},_findFeaturesCompleted:function(c){this._processingRequest=false;var a=IngrPL.WebClient.Core.Platform.Common.Util;if(!a.checkExecutor(c,a.showError)){return}var b=c.get_webRequest().get_userContext();this._findFeatures_executeHandler(c.get_object(),b.handler,b.scope)},_findFeatures_executeHandler:function(a,f,e){if(a.error){IngrPL.WebClient.Core.Platform.Common.Util.showError(a.error);return}var d={};for(var c=0,b=a.length;c<b;c++){d[a[c].Key]=a[c].Value}if(e){f.call(e,d)}else{f(d)}},transformPoints:function(f,a,d,c,b){if(!this.get_definition().supportsTransformation){throw Error.invalidOperation(IngrPL.WebClient.Core.Platform.Translate.E_MapServiceDoesNotSupportTransformation)}if(!this._processingRequest){this._processingRequest=true;var e=$webRequest.create({name:"MapServiceManager",query:{action:"transform",id:this._id,inputCRS:f.get_id(),outputCRS:a.get_id(),points:Sys.Serialization.JavaScriptSerializer.serialize(d)},mapService:this.get_isInitialized()?undefined:this,callback:this._transformPointsCompleted,scope:this,context:{handler:c,scope:b}});e.invoke()}},_transformPointsCompleted:function(d){this._processingRequest=false;var a=IngrPL.WebClient.Core.Platform.Common.Util;if(!a.checkExecutor(d,a.showError)){return}var c=d.get_object();if(c.error){a.showError(c.error);return}var b=d.get_webRequest().get_userContext();if(b.scope){b.handler.call(b.scope,c)}else{b.handler(c)}},get_id:function(){return this._id},get_config:function(){return this._config},get_configStub:function(){return this._configStub},get_minimalConfigStub:function(){if(this._minimalConfigKeys){var e=[];for(var d=0,a=this._minimalConfigKeys.length;d<a;d++){var c=this._minimalConfigKeys[d];var b=this._config||{};e[d]={Key:c,Value:b[c]}}return e}else{return this._configStub||[]}},get_metadata:function(){return this._metadata},get_name:function(){return this._name},set_name:function(a){this._name=a},get_definition:function(){return $mapServiceDefinitionManager.findMapServiceDefinition(this._definitionName)},get_legendDefinitions:function(){return this._legendDefinitions},get_isInitialized:function(){return this._status==IngrPL.WebClient.Core.Platform.MapServices.MapServiceStatus.Initialized},get_status:function(){return this._status},get_userName:function(){return this._userName},get_userFullName:function(){return this._userFullName},get_userStatus:function(){return this._userStatus},get_activeFilter:function(){if(!this._activeFilter){return null}return this._activeFilter},set_activeFilter:function(a){if(typeof a!="undefined"&&a!=null){this._activeFilter=a}else{this._activeFilter=undefined}},get_isShopService:function(){return this._isShopService}};IngrPL.WebClient.Core.Platform.MapServices.MapService.registerClass("IngrPL.WebClient.Core.Platform.MapServices.MapService",IngrPL.WebClient.Core.Platform.MapServices.LegendItemDefinitionTreeContainer);
//END IngrPL.WebClient.Core.Platform.MapServices.MapService.js
//START IngrPL.WebClient.Core.Platform.MapServices.MapServiceManager.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapServices");IngrPL.WebClient.Core.Platform.MapServices._MapServiceManager=function(){this._mapServices={};this._mapServicesUrls={};$event.register("mapServiceInitFailed",this._mapServiceInitFailed,this);$event.register("mapServiceAuthenticationFailed",this._mapServiceAuthenticationFailed,this)};IngrPL.WebClient.Core.Platform.MapServices._MapServiceManager.prototype={registerMapService:function(c){var a=new IngrPL.WebClient.Core.Platform.MapServices.MapService(c);this._mapServices[c.id]=a;var b=this._ensureUrl(a.get_config().url);if(b){this._mapServicesUrls[b]=c.id}},findMapService:function(a){return this._mapServices[a]},checkUrlExists:function(a){return this._mapServicesUrls[this._ensureUrl(a)]},_ensureUrl:function(a){if(typeof(a)=="undefined"){return null}while(a.charAt(a.length-1)=="/"){a=a.substr(0,a.length-1)}return a.toLowerCase()},get_mapServices:function(){return this._mapServices},isMapServiceInitialized:function(b){var a=this._mapServices[b];if(a){return a.get_isInitialized()}else{return false}},_mapServiceInitFailed:function(b,a,c){$log.writeError(a.error);IngrPL.WebClient.Core.Platform.Common.Util.showError(a.error)},_mapServiceAuthenticationFailed:function(b,a,c){IngrPL.WebClient.Core.Platform.Common.Util.showError(a.error)}};IngrPL.WebClient.Core.Platform.MapServices._MapServiceManager.registerClass("IngrPL.WebClient.Core.Platform.MapServices._MapServiceManager");IngrPL.WebClient.Core.Platform.MapServices.MapServiceManager=new IngrPL.WebClient.Core.Platform.MapServices._MapServiceManager();var $mapServiceManager=IngrPL.WebClient.Core.Platform.MapServices.MapServiceManager;
//END IngrPL.WebClient.Core.Platform.MapServices.MapServiceManager.js
//START IngrPL.WebClient.Core.Platform.MapLayers.MapLayerConfig.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");IngrPL.WebClient.Core.Platform.MapLayers.MapLayerConfig=function(a){this._id=(IngrPL.WebClient.Core.Platform.MapLayers.MapLayerConfig._id++).toString();this._name=a.name;this._firstLegendItemPriority=a.firstLegendItemPriority;this._lastLegendItemPriority=a.lastLegendItemPriority;this._mapState=$mapStateManager.findMapState(a.mapStateId);this._mapService=$mapServiceManager.findMapService(a.mapServiceId);this._opacity=a.opacity;this._filter=a.filter||null;this._mapServiceConfigOverrideStub=a.mapServiceConfigOverride||null};IngrPL.WebClient.Core.Platform.MapLayers.MapLayerConfig.prototype={moveLegendItems:function(a){if(a==null){throw Error.argumentNull("offset")}if(!Number.isInstanceOfType(a)){throw Error.argumentType("offset",Object.getType(a),Number)}this._firstLegendItemPriority+=a;this._lastLegendItemPriority+=a},serialize:function(){return{name:this._name,firstLegendItemPriority:this._firstLegendItemPriority,lastLegendItemPriority:this._lastLegendItemPriority,mapStateId:this._mapState.get_id(),mapServiceId:this._mapService.get_id(),opacity:this._opacity==undefined?null:this._opacity,filter:this._filter,mapServiceConfigOverride:this._mapServiceConfigOverrideStub}},get_id:function(){return this._id},get_name:function(){return this._name},get_firstLegendItemPriority:function(){return this._firstLegendItemPriority},set_firstLegendItemPriority:function(a){this._firstLegendItemPriority=a},get_lastLegendItemPriority:function(){return this._lastLegendItemPriority},set_lastLegendItemPriority:function(a){this._lastLegendItemPriority=a},get_mapState:function(){return this._mapState},get_mapService:function(){return this._mapService},get_priority:function(){return Array.indexOf(this._mapState.get_mapLayerConfigs(),this)},get_opacity:function(){if(typeof(this._opacity)=="undefined"||this._opacity==null){this._opacity=100}return this._opacity},set_opacity:function(a){a=Math.max(0,a);a=Math.min(100,a);this._opacity=a},get_filter:function(){return this._filter},set_filter:function(a){this._filter=a},get_mapServiceConfigOverride:function(){if(!this._mapServiceConfigOverride&&this._mapServiceConfigOverrideStub){this._mapServiceConfigOverride={};for(var b=0,a=this._mapServiceConfigOverrideStub.length;b<a;b++){var c=this._mapServiceConfigOverrideStub[b];this._mapServiceConfigOverride[c.Key]=c.Value}}return this._mapServiceConfigOverride||null},setConfigValue:function(c,e){if(!this._mapServiceConfigOverrideStub){this._mapServiceConfigOverrideStub=[]}var f=this._mapServiceConfigOverrideStub;var d=false;for(var b=0,a=f.length;b<a;b++){if(f[b].Key==c){f[b].Value=e;d=true;break}}if(!d){f.push({Key:c,Value:e})}this._mapServiceConfigOverride=null},forEachLegendItem:function(e,d,b){if(typeof(e)!="function"){return}var g=this._mapState.get_legend().get_flatLegend();for(var c=this._firstLegendItemPriority,a=this._lastLegendItemPriority;c<=a;c++){var f=[g[c],c,g];if(Array.isInstanceOfType(b)){f.push.apply(f,b)}if(e.apply(d||window,f)){break}}}};IngrPL.WebClient.Core.Platform.MapLayers.MapLayerConfig.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.MapLayerConfig");IngrPL.WebClient.Core.Platform.MapLayers.MapLayerConfig._id=0;
//END IngrPL.WebClient.Core.Platform.MapLayers.MapLayerConfig.js
//START IngrPL.WebClient.Core.Platform.MapContent.ScaleBand.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapContent");IngrPL.WebClient.Core.Platform.MapContent.ScaleBand=function(a){this._name=a.name;this._minScaleDenominator=a.minScaleDenominator;this._legendItemIds=a.legendItemIds};IngrPL.WebClient.Core.Platform.MapContent.ScaleBand.prototype={serialize:function(){return{name:this._name,minScaleDenominator:this._minScaleDenominator,legendItemIds:this._legendItemIds}},add_legendItemId:function(a){if(!this.contains_legendItem(a)){this._legendItemIds.push(a)}},add_legendItemIds:function(a){for(var b=0;b<a.length;b++){if(!this.contains_legendItem){this._legendItemIds.push(a[b])}}},remove_legendItemId:function(a){for(var b=0;b<this._legendItemIds.length;b++){if(a==this._legendItemIds[b]){this._legendItemIds.splice(b,1);return}}},contains_legendItem:function(a){for(var b=0;b<this._legendItemIds.length;b++){if(this._legendItemIds[b]==a){return true}}return false},get_name:function(){return this._name},get_minScaleDenominator:function(){return this._minScaleDenominator},get_legendItemIds:function(){return this._legendItemIds}};IngrPL.WebClient.Core.Platform.MapContent.ScaleBand.registerClass("IngrPL.WebClient.Core.Platform.MapContent.ScaleBand");
//END IngrPL.WebClient.Core.Platform.MapContent.ScaleBand.js
//START IngrPL.WebClient.Core.Platform.MapLayers.MapLayerDefinition.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapLayers");IngrPL.WebClient.Core.Platform.MapLayers.MapLayerDefinition=function(b){this._mapService=$mapServiceManager.findMapService(b.mapServiceId);this._legendItemIds=b.legendItemIds;var a;if(b.name){a=b.name}else{if(this._mapService.get_name()){a=this._mapService.get_name()}else{a=this._mapService.get_id()}}this._name=a;this._defaultOpacity=b.defaultOpacity;this._defaultFilter=b.defaultFilter||null;this._mapServiceConfigOverrideStub=b.mapServiceConfigOverride||null};IngrPL.WebClient.Core.Platform.MapLayers.MapLayerDefinition.prototype={serialize:function(){return{mapServiceId:this._mapService.get_id(),legendItemIds:this._legendItemIds,name:this._name,defaultOpacity:this._defaultOpacity==null?100:this._defaultOpacity,defaultFilter:this._defaultFilter,mapServiceConfigOverride:this._mapServiceConfigOverrideStub}},get_mapService:function(){return this._mapService},get_legendItemIds:function(){return this._legendItemIds},get_name:function(){return this._name},get_defaultOpacity:function(){return this._defaultOpacity},get_defaultFilter:function(){return this._defaultFilter},set_defaultFilter:function(a){this._defaultFilter=a},get_mapServiceConfigOverrideStub:function(){return this._mapServiceConfigOverrideStub}};IngrPL.WebClient.Core.Platform.MapLayers.MapLayerDefinition.registerClass("IngrPL.WebClient.Core.Platform.MapLayers.MapLayerDefinition");
//END IngrPL.WebClient.Core.Platform.MapLayers.MapLayerDefinition.js
//START IngrPL.WebClient.Core.Platform.MapContent.Legend.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapContent");IngrPL.WebClient.Core.Platform.MapContent.Legend=function(b,e){if(b==null){throw new Error.argumentNull(b)}if(e==null){throw new Error.argumentNull("mapState")}if(!IngrPL.WebClient.Core.Platform.MapContent.MapState.isInstanceOfType(e)){throw new Error.argumentType("mapState",Object.getType(e),IngrPL.WebClient.Core.Platform.MapContent.MapState)}this._mapState=e;this._legendItems=[];this._flatLegend=[];this._notInitializedPriorities=[];for(var d=0;d<b.length;d++){var c=b[d];if($mapServiceManager.isMapServiceInitialized(c.mapServiceId)&&IngrPL.WebClient.Core.Platform.MapContent.LegendItem.canCreateLegendItem(c)){var a=new IngrPL.WebClient.Core.Platform.MapContent.LegendItem(c,this,null);this._legendItems.push(a);this._notInitializedPriorities.push.apply(this._notInitializedPriorities,a.get_notInitializedPriorities())}else{this._notInitializedPriorities.push.apply(this._notInitializedPriorities,IngrPL.WebClient.Core.Platform.MapContent.LegendItem._getPriorities(c))}}this._setFlatLegend()};IngrPL.WebClient.Core.Platform.MapContent.Legend.prototype={addLegendItem:function(g,f){this._notInitializedPriorities=[];var b=[];for(var d=0;d<g.length;d++){if(IngrPL.WebClient.Core.Platform.MapContent.LegendItem.canCreateLegendItem(g[d])){var a=new IngrPL.WebClient.Core.Platform.MapContent.LegendItem(g[d],this,f);this._legendItems.push(a);var e=a.get_idsAndNames();for(var c=0;c<e.length;c++){b.push(e[c])}this._notInitializedPriorities.push.apply(this._notInitializedPriorities,a.get_notInitializedPriorities())}else{this._notInitializedPriorities.push.apply(this._notInitializedPriorities,IngrPL.WebClient.Core.Platform.MapContent.LegendItem._getPriorities(g[d]))}}this._setFlatLegend();return b},removeLegendItem:function(b,c){var a=[];if(b){this._legendItems=this._removeLegendItem(b.get_id(),this._legendItems);a=this._removeFlatLegendItem(b.get_ids(),c)}return a},_removeLegendItem:function(a,d){for(var c=0;c<d.length;c++){if(d[c].get_id()==a){d.splice(c,1);return d}var b=d[c].get_legendItems();if(b&&b.length>0){b=this._removeLegendItem(a,b);if(!b||b.length==0){d.splice(c,1);return d}}}return d},_removeFlatLegendItem:function(b,e){var a=[];e=e?e:false;for(var c=0;c<b.length;c++){for(var d=0;d<this._flatLegend.length;d++){if(this._flatLegend[d]&&this._flatLegend[d].get_id()==b[c]){this._flatLegend[d]=null;a.push(d);b.splice(c,1);c--;break}}}if(!e){this._cleanFlatLegend()}return a},cleanFlatLegend:function(){this._cleanFlatLegend()},_cleanFlatLegend:function(){for(var a=0;a<this._flatLegend.length;a++){if(this._flatLegend[a]==null){this._flatLegend.splice(a,1);a--}}},_setFlatLegend:function(){var g=[this._legendItems];var f;while(f=g.pop()){for(var e=0;e<f.length;e++){var a=f[e];var d=a.get_definition();if(d.get_type()==IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.Normal||d.get_type()==IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.Analysis){var c=a.get_priority();for(var b=0;b<this._notInitializedPriorities.length;b++){if(this._notInitializedPriorities[b]<a.get_priority()){c--}}this._flatLegend[c]=a}g.push(a.get_legendItems())}}},findLegendItem:function(a){return this._findLegendItem(a,this._legendItems)},_findLegendItem:function(a,d){for(var c=0;c<d.length;c++){if(d[c].get_id()==a){return d[c]}var b=this._findLegendItem(a,d[c].get_legendItems());if(b){return b}}return},findLegendItemByDefinitionId:function(b,a){return this._findLegendItemByDefinitionId(b,a,this._legendItems)},_findLegendItemByDefinitionId:function(b,a,g){var h=[];for(var f=0;f<g.length;f++){var e=g[f].get_definition();if(e.get_mapService().get_id()==b&&e.get_id()==a){h.push(g[f])}var d=this._findLegendItemByDefinitionId(b,a,g[f].get_legendItems());for(var c=0;c<d.length;c++){h.push(d[c])}}return h},findLegendItemsByMapServiceId:function(a){return this._findLegendItemsByMapServiceId(a,this._legendItems)},_findLegendItemsByMapServiceId:function(b,d){var e=[];for(var c=0;c<d.length;c++){var a=d[c];if(a.get_definition().get_mapService().get_id()==b){e.push(a)}e.push.apply(e,this._findLegendItemsByMapServiceId(b,a.get_legendItems()))}return e},serialize:function(){return IngrPL.WebClient.Core.Platform.MapContent.LegendItem._serializeLegendItems(this._legendItems)},get_legendItems:function(){return this._legendItems},get_flatLegend:function(){return this._flatLegend},get_mapState:function(){return this._mapState},get_notInitializedPriorities:function(){return this._notInitializedPriorities}};IngrPL.WebClient.Core.Platform.MapContent.Legend.registerClass("IngrPL.WebClient.Core.Platform.MapContent.Legend");IngrPL.WebClient.Core.Platform.MapContent.LegendItem=function(e,g,h){if(e==null){throw Error.argumentNull("legendItemStub")}if(g==null){throw Error.argumentNull("legend")}if(!IngrPL.WebClient.Core.Platform.MapContent.Legend.isInstanceOfType(g)){throw Error.argumentType("legend",Object.getType(g),IngrPL.WebClient.Core.Platform.MapContent.Legend)}if(h!=null&&!IngrPL.WebClient.Core.Platform.MapContent.LegendItem.isInstanceOfType(h)){throw Error.argumentType("parent",Object.getType(h),IngrPL.WebClient.Core.Platform.MapContent.LegendItem)}if(e.id!=null){this._id=e.id;IngrPL.WebClient.Core.Platform.MapContent.LegendItem._counter=Math.max(IngrPL.WebClient.Core.Platform.MapContent.LegendItem._counter||0,e.id+1)}else{this._id=IngrPL.WebClient.Core.Platform.MapContent.LegendItem._counter||0;IngrPL.WebClient.Core.Platform.MapContent.LegendItem._counter=(IngrPL.WebClient.Core.Platform.MapContent.LegendItem._counter||0)+1}var j=$mapServiceManager.findMapService(e.mapServiceId);var f;if(e.legendDefinitionId){f=j.findLegendDefinition(e.legendDefinitionId)}else{f=j}var b=f.findLegendItemDefinition(e.legendItemDefinitionId);this._definition=b;this._parent=h;this._legend=g;this._isVisible=e.isVisible==null?true:e.isVisible;this._isLocatable=e.isLocatable==null?true:e.isLocatable;this._analysisId=e.analysisId;this._legendItems=[];this._notInitializedPriorities=[];this._priority=e.priority;this._name=e.name;if(e.legendItems){for(var c=0;c<e.legendItems.length;c++){var a=e.legendItems[c];if(IngrPL.WebClient.Core.Platform.MapContent.LegendItem.canCreateLegendItem(a)){var d=new IngrPL.WebClient.Core.Platform.MapContent.LegendItem(a,g,this);this._legendItems.push(d);this._notInitializedPriorities.push.apply(this._notInitializedPriorities,d.get_notInitializedPriorities())}else{this._notInitializedPriorities.push.apply(this._notInitializedPriorities,IngrPL.WebClient.Core.Platform.MapContent.LegendItem._getPriorities(a))}}}};IngrPL.WebClient.Core.Platform.MapContent.LegendItem.prototype={get_ids:function(){var a=[];a.push(this._id);for(var c=0;c<this._legendItems.length;c++){var d=this._legendItems[c].get_ids();for(var b=0;b<d.length;b++){a.push(d[b])}}return a},get_idsAndNames:function(){var a=[];var f=false;if(this._legendItems.length>0||this._definition.get_type()==IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.ThematicItem){a.push([this._id,""])}else{f=true;var c=this._name?this._name:this._definition.get_name();a.push([this._id,c])}for(var d=0;d<this._legendItems.length;d++){var e=this._legendItems[d].get_idsAndNames();for(var b=0;b<e.length;b++){if(e[b][1]!=""){f=true}a.push(e[b])}}if(this._legendItems.length>0&&!f){a[0][1]=this._definition.get_name()}return a},canBeDisplayed:function(){return this.get_isVisible()&&this._definition.isCRSValid()&&this.get_isInRange()},serialize:function(){var b=this._definition.get_legendDefinition();var a;if(b){a=b.get_id()}return{id:this._id,mapServiceId:this._definition.get_mapService().get_id(),legendDefinitionId:a,legendItemDefinitionId:this._definition.get_id(),priority:this.get_priority(),isVisible:this._isVisible,isLocatable:this._isLocatable,analysisId:this._analysisId,name:this._name,legendItems:IngrPL.WebClient.Core.Platform.MapContent.LegendItem._serializeLegendItems(this._legendItems)}},get_id:function(){return this._id},get_name:function(){return this._name},get_definition:function(){return this._definition},get_parent:function(){return this._parent},get_legend:function(){return this._legend},get_priority:function(){if(this._definition.get_type()==IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.Normal||this._definition.get_type()==IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.Analysis){var a=Array.indexOf(this._legend.get_flatLegend(),this);return a>=0?a:this._priority}else{return null}},get_isVisible:function(){return this._isVisible},get_isLocatable:function(){return this._isLocatable},get_analysisId:function(){return this._analysisId},set_isVisible:function(a){this._isVisible=a},get_isInRange:function(){if(this._definition.get_type()!=IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.Normal&&this._definition.get_type()!=IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.Analysis){return true}var j=true;var c=this._legend.get_mapState(),g=c.get_mapControl();if(g){var e=this._definition.get_minScaleHint();var a=this._definition.get_maxScaleHint();if(e!=null||a!=null){var k=c.get_mapRange().getSize();var d=g.get_mapSize();var i=k.width*c.get_storageToProjectionScale()/d.width;j=(e==null||i>=e/Math.sqrt(2))&&(a==null||i<=a/Math.sqrt(2))}else{var b=this._definition.get_minScaleDenominator();var h=this._definition.get_maxScaleDenominator();var f=g.get_scaleDenominator();j=(b==null||f>=b)&&(h==null||f<=h)}}return j&&this._legend.get_mapState().isInRange(this)},get_legendItems:function(){return this._legendItems},set_legendItems:function(a){this._legendItems=a},get_notInitializedPriorities:function(){return this._notInitializedPriorities}};IngrPL.WebClient.Core.Platform.MapContent.LegendItem.canCreateLegendItem=function(d){var a=$mapServiceManager.findMapService(d.mapServiceId);if(!a){return false}if(d.legendDefinitionId){var c=a.findLegendDefinition(d.legendDefinitionId);if(!c){return false}}var b=(c||a).findLegendItemDefinition(d.legendItemDefinitionId);if(!b){return false}return true};IngrPL.WebClient.Core.Platform.MapContent.LegendItem._getPriorities=function(c){var a=[];if(c.priority!=null){a.push(c.priority)}if(c.legendItems){for(var b=0;b<c.legendItems.length;b++){a.push.apply(a,IngrPL.WebClient.Core.Platform.MapContent.LegendItem._getPriorities(c.legendItems[b]))}}return a};IngrPL.WebClient.Core.Platform.MapContent.LegendItem._serializeLegendItems=function(c){var a=new Array();for(var b=0;b<c.length;b++){a.push(c[b].serialize())}return a};IngrPL.WebClient.Core.Platform.MapContent.LegendItem.registerClass("IngrPL.WebClient.Core.Platform.MapContent.LegendItem");
//END IngrPL.WebClient.Core.Platform.MapContent.Legend.js
//START IngrPL.WebClient.Core.Platform.MapContent.MapState.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapContent");IngrPL.WebClient.Core.Platform.MapContent.MapState=function(a){this._id=a.id;this._setMapRanges(a.mapRange,a.fitAllRange,true);this._mapLayerDefinitions=null;this._mapLayerDefinitionsByKey=null;this._mapLayerConfigs=null;this._scaleBands=null;this._currentScaleBand=null;this._legendItemPriority;this._mapControlId=a.configuration.mapControlId;this._defaultMapRangeServiceId=a.configuration.defaultMapRangeServiceId;this._minScaleDenominator=a.configuration.minScaleDenominator;this._maxScaleDenominator=a.configuration.maxScaleDenominator;this._variants=new Array();this._variantsByKey=new Object();this._rangeHistoryCapacity=20;this._initRangeHistory();this._mapSize=new IngrPL.WebClient.Core.Platform.Common.Size(0,0);this._isInitialized=false;this._translate=IngrPL.WebClient.Core.Platform.Translate;this._defaultVariant={id:"__default_",configuration:{mapLayerDefinitions:a.configuration.mapLayerDefinitions,scaleBands:a.configuration.scaleBands},legend:a.legend,mapLayerConfigs:a.mapLayerConfigs};$event.register("mapServiceInitialized",this._checkMapServices,this);$event.register("mapServiceInitFailed",this._checkMapServices,this);$event.register("mapServiceCleared",this._mapServiceCleared,this);$event.register("setPreviousMapRange",this._setPreviousMapRange,this);$event.register("setNextMapRange",this._setNextMapRange,this)};IngrPL.WebClient.Core.Platform.MapContent.MapState.prototype={initialize:function(){if(!this._isInitialized){this._pendingVariant=this._defaultVariant;this._checkMapServices()}},setVariant:function(a,b){if(b||!this._currentVariant||this._currentVariant.id!=a){this._pendingVariant=this._variantsByKey[a].variant;if(this._pendingVariant){this._setMapRanges(this._pendingVariant.mapRange,this._pendingVariant.fitAllRange);this._checkMapServices()}}},_checkMapServices:function(c){if(this._pendingVariant){for(var b=0;b<this._pendingVariant.configuration.mapLayerDefinitions.length;b++){var a=$mapServiceManager.findMapService(this._pendingVariant.configuration.mapLayerDefinitions[b].mapServiceId);if(a.get_status()==IngrPL.WebClient.Core.Platform.MapServices.MapServiceStatus.Uninitialized){if(!this._variantWaiting){$event.notify("mapStateVariantChanging",{mapStateId:this._id,mapStateVariantId:this._pendingVariant.id},this);this._variantWaiting=true}a.initialize();return}}this._setVariant_Finalize(c)}},_setVariant_Finalize:function(a){if(this._currentVariant&&this._currentVariant.id!="__default_"){if(this._mapLayerDefinitions){this._currentVariant.configuration.mapLayerDefinitions=this._serializeMapLayerDefinitions()}if(this._legend){this._currentVariant.legend=this._legend.serialize()}if(this._mapLayerConfigs){this._currentVariant.mapLayerConfigs=this._serializeMapLayerConfigs()}}this._currentVariant=this._pendingVariant;this._mapLayerDefinitions=null;this._mapLayerDefinitionsByKey=null;this._legend=null;this._mapLayerConfigs=null;this._scaleBands=null;this._currentScaleBand=null;this._variantWaiting=false;this._isInitialized=true;$event.notify("mapStateVariantChanged",{mapStateId:this._id,mapStateVariantId:this._pendingVariant.id,callEventName:a},this);this._pendingVariant=null},_setMapRanges:function(b,d){var g=IngrPL.WebClient.Core.Platform.MapContent.MapRange;var j=$crs.getCurrent();if(!j){throw Error.invalidOperation("No CRS")}var k=j.get_id();function f(i){return Array.isInstanceOfType(i)}if(f(b)){this._mapRange=new g(b)}else{if(b&&f(b[k])){this._mapRange=new g(b[k])}}if(!this._fitAllRangeDict){this._fitAllRangeDict={};if(f(b)){this._fitAllRangeDict[k]=new g(b)}else{if(b){for(var a in b){if(f(b[a])){this._fitAllRangeDict[a]=new g(b[a])}}}}}if(d){var h=false;for(var e=0,c=d.length;e<c;e++){if(f(d[e].Value)){this._fitAllRangeDict[d[e].Key]=new g(d[e].Value);h=true}}if(!h&&f(d)){this._fitAllRangeDict[k]=new g(d)}}if(!this._mapRange){throw Error.invalidOperation("No map range")}},_ensureMapContent:function(){if(this._scaleBands==null){this._scaleBands=new Array();if(this._currentVariant.configuration.scaleBands){var c=this._currentVariant.configuration.scaleBands;for(var m=0;m<c.length;m++){this._scaleBands.push(new IngrPL.WebClient.Core.Platform.MapContent.ScaleBand(c[m]))}}this.updateScaleBand()}if(this._legend==null){this._legend=new IngrPL.WebClient.Core.Platform.MapContent.Legend(this._currentVariant.legend,this)}if(this._mapLayerDefinitions==null||this._mapLayerDefinitionsByKey==null){var s=this._currentVariant.configuration.mapLayerDefinitions;this._mapLayerDefinitions=new Array();this._mapLayerDefinitionsByKey={};var n=this._legend.get_notInitializedPriorities();for(var m=0;m<s.length;m++){var a=s[m];var t=false;for(var h=0;h<a.legendItemIds.length;h++){var b=a.legendItemIds[h];var r=true;for(var g=0;g<n.length;g++){if(b==n[g]){r=false;break}}if(r){t=true;break}}if(t){this._addMapLayerDefinition(a)}}}if(this._mapLayerConfigs==null){if(this._currentVariant.mapLayerConfigs){var n=this._legend.get_notInitializedPriorities();this._mapLayerConfigs=[];var q=this._currentVariant.mapLayerConfigs;for(var m=0;m<q.length;m++){var d=q[m];var p=new IngrPL.WebClient.Core.Platform.MapLayers.MapLayerConfig(d);var o=d.firstLegendItemPriority;var e=d.lastLegendItemPriority;for(var h=0;h<n.length;h++){if(n[h]<d.firstLegendItemPriority){o--}if(n[h]<=d.lastLegendItemPriority){e--}}p.set_firstLegendItemPriority(o);p.set_lastLegendItemPriority(e);this._mapLayerConfigs.push(p)}delete this._currentVariant.mapLayerConfigs}else{this._createMapLayerConfigs()}}},_createMapLayerConfigs:function(){var g=[];var d=this._legend.get_flatLegend();if(d.length){var e=this._findMapLayerDefinition(d[0].get_id());var a=0;for(var c=0;c<d.length;c++){var b=d[c];var f=this._findMapLayerDefinition(b.get_id());if(f!=e){g.push(this._createMapLayerConfig(e.get_name(),a,Math.max(0,c-1),e.get_mapService(),e.get_defaultOpacity(),e.get_defaultFilter(),e.get_mapServiceConfigOverrideStub()));e=f;a=c}}g.push(this._createMapLayerConfig(e.get_name(),a,Math.max(0,c-1),e.get_mapService(),e.get_defaultOpacity(),e.get_defaultFilter(),e.get_mapServiceConfigOverrideStub()))}this._mapLayerConfigs=g},addMapLayerConfigs:function(){var g=-1;for(var d=0;d<this._mapLayerConfigs.length;d++){g=Math.max(g,this._mapLayerConfigs[d].get_lastLegendItemPriority())}g++;var h=[];var c=this._legend.get_flatLegend();if(c.length>g){var e=this._findMapLayerDefinition(c[g].get_id());var a=g;for(var d=g;d<c.length;d++){var b=c[d];var f=this._findMapLayerDefinition(b.get_id());if(f!=e){h.push(this._createMapLayerConfig(e.get_name(),a,Math.max(0,d-1),e.get_mapService()));e=f;a=d}}h.push(this._createMapLayerConfig(e.get_name(),a,Math.max(0,d-1),e.get_mapService(),e.get_defaultOpacity(),e.get_defaultFilter()))}for(var d=0;d<h.length;d++){this._mapLayerConfigs.push(h[d])}return h},_createMapLayerConfig:function(f,c,b,a,e,g,h){var d=new IngrPL.WebClient.Core.Platform.MapLayers.MapLayerConfig({name:f,firstLegendItemPriority:c,lastLegendItemPriority:b,mapStateId:this._id,mapServiceId:a.get_id(),opacity:e,filter:g,mapServiceConfigOverride:h});return d},createMapLayers:function(){var a=[];this._ensureMapContent();for(var b=0;b<this._mapLayerConfigs.length;b++){var c=this._mapLayerConfigs[b].get_mapService().getMapLayerType();a.push(new c(this._mapLayerConfigs[b]))}return a},addMapLayers:function(c){var a=[];this._ensureMapContent();for(var b=0;b<c.length;b++){var d=c[b].get_mapService().getMapLayerType();a.push(new d(c[b]))}return a},refreshMapLayerConfigs:function(a){this._ensureMapContent();return this._refreshMapLayerConfigs(a)},removeMapLayerConfig:function(a){this._ensureMapContent();return this._removeMapLayerConfig(a)},_findMapLayerDefinition:function(a){if(this._mapLayerDefinitionsByKey[a]){var b=this._mapLayerDefinitionsByKey[a].index;return this._mapLayerDefinitions[b]}else{throw new Error(String.format(this._translate.E_MapLayerDefinitionNotFound_Format,a))}},addMapLayerDefinition:function(a){if(this._mapLayerDefinitionsByKey==null){return}this._addMapLayerDefinition(a)},_addMapLayerDefinition:function(e){if(!$mapServiceManager.isMapServiceInitialized(e.mapServiceId)){return}var d=new IngrPL.WebClient.Core.Platform.MapLayers.MapLayerDefinition(e);var a=d.get_legendItemIds();this._mapLayerDefinitions.push(d);for(var b=0;b<a.length;b++){var c=a[b];if(!this._mapLayerDefinitionsByKey[c]){this._mapLayerDefinitionsByKey[c]={index:this._mapLayerDefinitions.length-1}}}},addLegend:function(h){function d(i,l){var m=l.getLegendItemDefaultPriority();var o=0;var k=i.length;while(k-o>0){var n=Math.floor((o+k)/2);if(m>i[n].getLegendItemDefaultPriority()){o=n+1}else{k=n}}i.splice(o,0,l)}var e=[];var b=[];var a=h.get_legendItemDefinitions();var j={};while(a){for(var g=0;g<a.length;g++){var c=a[g];if(c.get_type()==IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.Normal||c.get_type()==IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.Analysis){d(b,c)}e.push(c.get_legendItemDefinitions())}a=e.pop()}this._ensureMapContent();var f=this._legend.get_flatLegend().length;for(var g=0;g<b.length;g++){j[b[g].get_id()]=f+g}return this.addLegendItems(h.get_legendItemDefinitions(),j)},addLegendItems:function(b,k,c,a){if(this._legend==null){return}var f=[];this._legendItemPriority=this._legend.get_flatLegend().length;for(var e=0;e<b.length;e++){var h=this._generateLegendItemStub(b[e],k,c,a);f.push(h)}var g=this._legend.addLegendItem(f);if(this._scaleBands&&g.length>0){for(var e=0;e<this._scaleBands.length;e++){for(var d=0;d<g.length;d++){this._scaleBands[e].add_legendItemId(g[d][0])}}}return g},removeLegendItems:function(e){if(this._legend==null){return}changedMapLayerConfigs={};for(var c=0;c<e.length;c++){var g=e[c].get_priority();for(var f=0;f<this._mapLayerConfigs.length;f++){id=this._mapLayerConfigs[f].get_id();var b=this._mapLayerConfigs[f].get_firstLegendItemPriority();var h=this._mapLayerConfigs[f].get_lastLegendItemPriority();if(g>=b&&g<=h){if(!changedMapLayerConfigs[id]){changedMapLayerConfigs[id]=[]}changedMapLayerConfigs[id].push(e[c]);break}}}var l=[];var a=[];for(var f=e.length-1;f>=0;f--){var d=e[f].get_definition().get_id();if(d){a.push(d)}var m=this._legend.removeLegendItem(e[f],true);if(m.length>0){l=l.concat(m)}}this._legend.cleanFlatLegend();var k=this._refreshMapLayerConfigs(l);$event.notify("legendItemRemoved",{mapStateId:this._id,changedMapLayerConfigs:changedMapLayerConfigs,removedMapLayerConfigs:k,removedLegendItemsDefinitionId:a},this);$event.notify("refreshMapLegendControl",{mapStateId:this._id},this)},_refreshMapLayerConfigs:function(m){var l=[];var c=[];for(var e=0;e<m.length;e++){var g=m[e];for(var f=0;f<this._mapLayerConfigs.length;f++){var d=this._mapLayerConfigs[f].get_firstLegendItemPriority();var h=this._mapLayerConfigs[f].get_lastLegendItemPriority();if(g>=d&&g<=h){if(c[f]==null){c[f]=[]}c[f].push(g);break}}}var b=0;for(var f=0;f<this._mapLayerConfigs.length;f++){var d=this._mapLayerConfigs[f].get_firstLegendItemPriority();var h=this._mapLayerConfigs[f].get_lastLegendItemPriority();var n=1+(h-d);if(c[f]==null){c[f]=[]}if(n==c[f].length){b+=c[f].length;l.push(this._mapLayerConfigs[f]);var k=this._mapLayerConfigs[f].get_id();this._mapLayerConfigs.splice(f,1);c.splice(f,1);$event.notify("mapLayerRemoved",{mapStateId:this._id,mapLayerConfigId:k},this);f--}else{var a=this._mapLayerConfigs[f];a.set_firstLegendItemPriority(d-b);b+=c[f].length;a.set_lastLegendItemPriority(h-b);this._mapLayerConfigs.splice(f,1,a)}}return l},_removeMapLayerConfig:function(a){var f=[];var b=1+a.get_lastLegendItemPriority()-a.get_firstLegendItemPriority();var d=false;for(var e=0;e<this._mapLayerConfigs.length;e++){if(d){var c=this._mapLayerConfigs[e];c.moveLegendItems(-b);this._mapLayerConfigs.splice(e,1,c)}if(this._mapLayerConfigs[e]==a){f.push(this._mapLayerConfigs[e]);var g=this._mapLayerConfigs[e].get_id();this._mapLayerConfigs.splice(e,1);d=true;$event.notify("mapLayerRemoved",{mapStateId:this._id,mapLayerConfigId:g},this);e--}}return f},addLegendItemByDefinitionId:function(o,d,c,h,b){if(!o||!d||this._legend==null||o.length!=d.length){return}if(c&&c instanceof Array&&o.length!=c.length){return}var q=false;var g=[];for(var l=0;l<d.length;l++){var a=o[l];var s=$mapServiceManager.findMapService(a);var e=[];for(var k=0;k<d[l].length;k++){var f=s.findLegendItemDefinition(d[l][k]);if(f){e.push(f)}}if(e.length>0){var p=this.addLegendItemsHierarchy(e,null,h,b);if(s.get_definition().name.toUpperCase()=="ARS"){for(var k=0;k<p.length;k++){g.push(p[k][0]);this.addMapLayerDefinition({mapServiceId:a,legendItemIds:[p[k][0]],name:p[k][1]})}}else{var b="";var n=[];for(var k=p.length-1;k>=0;k--){if(p[k][1]!=""){b+=p[k][1]+", "}n.push(p[k][0]);g.push(p[k][0])}if(b.substr(b.length-2)==", "){b=b.substr(0,b.length-2)}var r=undefined;if(c!=undefined){r=c[l]||c}this.addMapLayerDefinition({mapServiceId:a,legendItemIds:n,name:r||b,defaultFilter:s.get_activeFilter()})}q=true}}if(q){var m=this.addMapLayerConfigs();$event.notify("newLegendItemAdded",{mapStateId:this._id,legendItemIds:g,mapLayerConfigs:m},null);$event.notify("refreshMapLegendControl",{mapStateId:this._id},this)}return g},addLegendItemsHierarchy:function(b,n,c,a){if(this._legend==null){return}var f=[];this._legendItemPriority=this._legend.get_flatLegend().length;for(var e=0;e<b.length;e++){var m=[];var l=b[e].get_parent();while(l){if(l.get_type()==IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.Folder){m.push(this._generateLegendItemStub(l,n,c,a,false))}var l=l.get_parent()}var h=this._generateLegendItemStub(b[e],n,c,a);if(m.length>0){m[0].legendItems.push(h);for(var d=0;d<m.length-1;d++){m[d+1].legendItems.push(m[d])}var k=m.pop();if(f.length==0){f.push(k)}else{this._addToStubs(h,f,k)}}else{f.push(h)}}var g=this._legend.addLegendItem(f);if(this._scaleBands&&g.length>0){for(var e=0;e<this._scaleBands.length;e++){for(var d=0;d<g.length;d++){this._scaleBands[e].add_legendItemId(g[d][0])}}}return g},_createInStub:function(b,a){if(!a.legendItems||a.legendItems.length==0){a.legendItems=b}else{this._createInStub(b,a.legendItems)}},_addToStubs:function(f,g,d){if(d){var c=false;var b=d.legendItemDefinitionId;var a=d.legendItems;if(d.length>0){b=d[0].legendItemDefinitionId;a=d[0].legendItems}for(var e=0;e<g.length;e++){if(g[e].legendItemDefinitionId==b){this._addToStubs(f,g[e].legendItems,a);c=true}}if(!c){if(b==f.legendItemDefinitionId){g.push(f)}else{this._createInStub(f,d[0]||d);g.push(d[0]||d)}}}else{g.push(f)}},_generateLegendItemStub:function(e,o,f,a,p){var d=e.get_isVisible();var c=e.get_isLocatable();var n=null;var m=null;var i=null;if(e.get_type()==IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.Normal||e.get_type()==IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.Analysis){if(o!=null){n=o[e.get_id()]}else{n=this._legendItemPriority}this._legendItemPriority++;if(e.get_type()==IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.Analysis){m=e.get_id()}else{if(f!=null){m=f[e.get_id()]}}if(a!=null){i=a[e.get_id()]}}var b=e.get_legendItemDefinitions();var h=[];if(p!=false){for(var g=0;g<b.length;g++){if(!(e.get_type()==IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.Normal&&b[g].get_type()==IngrPL.WebClient.Core.Platform.MapServices.LegendItemType.Normal)){var k=this._generateLegendItemStub(b[g],o,f,a);if(k){h.push(k)}if(!k.isVisible){d=false}}}}var l=null;if(e.get_legendDefinition()){l=e.get_legendDefinition().get_id()}return{isVisible:d,isLocatable:c,legendItemDefinitionId:e.get_id(),legendItems:h,mapServiceId:e.get_mapService().get_id(),priority:n,legendDefinitionId:l,analysisId:m,name:i}},setLegendItemPriority:function(b,h){if(this._legend==null){return}if(b==null){throw Error.argumentNull("legendItem")}if(!IngrPL.WebClient.Core.Platform.MapContent.LegendItem.isInstanceOfType(b)){throw Error.argumentType("legendItem",Object.getType(b),IngrPL.WebClient.Core.Platform.MapContent.LegendItem)}if(h==null){throw new Error.argumentNull("newPriority")}if(!Number.isInstanceOfType(h)){throw Error.argumentType("newPriority",Object.getType(h),Number)}var e=this._legend.get_flatLegend();var f=b.get_priority();if(e[f]!=b){throw Error.invalidOperation(this._translate.E_LegendItemNotInLegend)}if(h<0||h>e.length){throw Error.argumentOutOfRange("newPriority",h)}e.splice(f,1);e.splice(h,0,b);if(this._mapLayerConfigs){var g=true;for(var d=0;d<this._mapLayerConfigs.length;d++){var c=this._mapLayerConfigs[d].get_firstLegendItemPriority();var a=this._mapLayerConfigs[d].get_lastLegendItemPriority();if(f>=c&&f<=a&&h>=c&&h<=a){g=false;break}}if(g){this._mapLayerConfigs=null}}},setMapLayerPriority:function(a,k){if(!this._mapLayerConfigs){return}if(a==null){throw Error.argumentNull("mapLayerConfig")}if(!IngrPL.WebClient.Core.Platform.MapLayers.MapLayerConfig.isInstanceOfType(a)){throw Error.argumentType("mapLayerConfig",Object.getType(a),IngrPL.WebClient.Core.Platform.MapContent.MapLayerStub)}if(k==null){throw Error.argumentNull("newPriority")}if(!Number.isInstanceOfType(k)){throw Error.argumentType("newPriority",Object.getType(k),Number)}var b=a.get_priority();if(this._mapLayerConfigs[b]!=a){throw Error.invalidOperation("TODO")}if(k<0||k>this._mapLayerConfigs.length){throw Error.argumentOutOfRange("newPriority",k)}this._mapLayerConfigs.splice(b,1);this._mapLayerConfigs.splice(k,0,a);var c=a.get_lastLegendItemPriority()-a.get_firstLegendItemPriority()+1;var j=k<b?1:-1;var h=0;for(var g=Math.min(b,k);g<=Math.max(b,k);g++){if(g!=k){var e=this._mapLayerConfigs[g];h+=e.get_lastLegendItemPriority()-e.get_firstLegendItemPriority()+1;e.moveLegendItems(c*j)}}var f=this._legend.get_flatLegend();var d=f.splice(a.get_firstLegendItemPriority(),c);var l=0;if(k>0){l=this._mapLayerConfigs[k-1].get_lastLegendItemPriority()+1}Array.prototype.splice.apply(f,[l,0].concat(d));a.moveLegendItems(h*-j)},addMapStateVariant:function(b){var a=this._variantsByKey[b.id]?this._variantsByKey[b.id].index:this._variants.length;this._variants[a]=b;this._variantsByKey[b.id]={variant:b,index:a};if(b.isDefault&&!this.isInitialized){this._defaultVariant=b}},applyFilter:function(e,b){var a=$mapServiceManager.findMapService(b);var c=this._getMapLayersByMapServiceId(b);for(var d=0;d<c.length;d++){var g=this._getLayerItemsID(c[d]);var f=e==null?[]:this._getFilteredElements(a,e.id);if(this._isFilterApplayable(g,f)){this._setFilter(c[d],e)}else{this._setFilter(c[d],null)}c[d].refresh()}},_getMapLayersByMapServiceId:function(a){var d=[];var c=this.get_mapControl().get_mapLayers();for(var b=0;b<c.length;b++){if(c[b].get_config().get_mapService().get_id()==a){d.push(c[b])}}return d},_getLayerItemsID:function(c){var e=[];var d=this.get_legend().get_flatLegend();for(var b=c.get_config().get_firstLegendItemPriority();b<=c.get_config().get_lastLegendItemPriority();b++){var a=d[b].get_definition();if(a.get_sourceLegendItemDefinition()!=null){e.push(a.get_sourceLegendItemDefinition().get_id())}else{e.push(a.get_id())}}return e},_getLayerDefinition:function(a){return this._findMapLayerDefinition(this.get_legend().get_flatLegend()[a.get_config().get_firstLegendItemPriority()].get_id())},_getFilteredElements:function(a,b){var g=[];var e=a.get_config().filters;for(var f in e){if(typeof e[f]=="function"){continue}if(e[f].Id==b){var d=e[f];for(var c in d.FilteredElements){if(typeof d.FilteredElements[c]=="function"){continue}g.push(d.FilteredElements[c])}break}}return g},_isFilterApplayable:function(d,c){for(var b=0;b<d.length;b++){for(var a=0;a<c.length;a++){if(d[b]==c[a]){return true}}}return false},_setFilter:function(a,b){a.get_config().set_filter(b);this._getLayerDefinition(a).set_defaultFilter(b)},serialize:function(){this._ensureMapContent();var b=[];for(var a in this._fitAllRangeDict){b.push({Key:a,Value:this._fitAllRangeDict[a].serialize()})}return{id:this._id,configuration:{mapLayerDefinitions:this._serializeMapLayerDefinitions(),scaleBands:this._serializeScaleBands(),defaultMapRangeServiceId:this._defaultMapRangeServiceId,minScaleDenominator:this._minScaleDenominator,maxScaleDenominator:this._maxScaleDenominator},legend:this._legend.serialize(),mapRange:this._mapRange.serialize(),fitAllRange:b,mapLayerConfigs:this._serializeMapLayerConfigs()}},_serializeMapLayerDefinitions:function(){return this._serializeArray(this._mapLayerDefinitions)},_serializeMapLayerConfigs:function(){return this._serializeArray(this._mapLayerConfigs)},_serializeScaleBands:function(){return this._serializeArray(this._scaleBands)},_serializeArray:function(c){var a=new Array();for(var b=0;b<c.length;b++){a[b]=c[b].serialize()}return a},updateScaleBand:function(){this._ensureMapContent();var a=this._currentScaleBand;this._setCurrentScaleBand();if(a!=null&&a!=this._currentScaleBand){$event.notify("scaleBandChanged",{mapStateId:this._id},this)}},_setCurrentScaleBand:function(){var c=this.get_mapControl();if(c){var a=c.get_scaleDenominator();for(var b=0;b<this._scaleBands.length;b++){if(this._scaleBands[b].get_minScaleDenominator()<a){this._currentScaleBand=this._scaleBands[b];return}}}this._currentScaleBand=this._getZeroScaleBand()},isInRange:function(a){this._ensureMapContent();if(!this._scaleBands.length||!this.get_mapControl()){return true}var b=this._currentScaleBand.get_legendItemIds();for(var c=0;c<b.length;c++){if(b[c]==a.get_id()){return true}}return false},_getZeroScaleBand:function(){if(!this._zeroScaleBand){this._zeroScaleBand=new IngrPL.WebClient.Core.Platform.MapContent.ScaleBand({minScaleDenominator:0,legendItemIds:[]})}return this._zeroScaleBand},_mapServiceCleared:function(b,a,d){this._ensureMapContent();var c=this._legend.findLegendItemsByMapServiceId(d.get_id());this.removeLegendItems(c)},clearMap:function(){var a=this._legend.get_legendItems();this.removeLegendItems(a)},get_id:function(){return this._id},get_variants:function(){return this._variants},initRangeHistory:function(){this._initRangeHistory()},_setPreviousMapRange:function(c,b,d){if(this._id!=b.mapStateId){return}this._rangeHistoryIndex--;if(this._rangeHistoryIndex>0&&this._rangeHistoryIndex<this._rangeHistory.length-1){$event.notify("rangeHistoryMiddlePointReached",{mapStateId:this._id},this)}else{if(this._rangeHistoryIndex<=0){$event.notify("rangeHistoryStartPointReached",{mapStateId:this._id},this)}}var a=this._rangeHistory[this._rangeHistoryIndex].clone();a.correctAspectRatio(this.get_mapControl().get_mapSize().clone());this.set_mapRange(a,true)},_setNextMapRange:function(c,b,d){if(this._id!=b.mapStateId){return}this._rangeHistoryIndex++;if(this._rangeHistoryIndex>0&&this._rangeHistoryIndex<this._rangeHistory.length-1){$event.notify("rangeHistoryMiddlePointReached",{mapStateId:this._id},this)}else{if(this._rangeHistoryIndex>=this._rangeHistory.length-1){$event.notify("rangeHistoryEndPointReached",{mapStateId:this._id},this)}}var a=this._rangeHistory[this._rangeHistoryIndex].clone();a.correctAspectRatio(this.get_mapControl().get_mapSize().clone());this.set_mapRange(a,true)},_initRangeHistory:function(){this._rangeHistory=new Array();this._rangeHistory.push(this._mapRange.clone());this._rangeHistoryIndex=0;var a=this.get_mapControl();if(a){this._mapSize=a.get_mapSize().clone()}$event.notify("rangeHistoryCleared",{mapStateId:this._id},this)},updateRangeHistory:function(){this._updateRangeHistory()},_updateRangeHistory:function(){var a=this._mapRange.clone();if(a.equals(this._rangeHistory[this._rangeHistoryIndex],true)){return}var b=this.get_mapControl();if(b&&!this._mapSize.equals(b.get_mapSize())){this._mapSize=b.get_mapSize().clone();this._rangeHistory=new Array();this._rangeHistoryIndex=-1}if(this._rangeHistoryIndex<this._rangeHistory.length-1){this._rangeHistory.splice(this._rangeHistoryIndex+1,this._rangeHistory.length-this._rangeHistoryIndex-1)}if(this._rangeHistory.length>=this._rangeHistoryCapacity){this._rangeHistory.shift();this._rangeHistoryIndex--}this._rangeHistory.push(a);this._rangeHistoryIndex++;if(this._rangeHistory.length<=1){$event.notify("rangeHistoryCleared",{mapStateId:this._id},this)}else{$event.notify("rangeHistoryEndPointReached",{mapStateId:this._id},this)}},get_mapRange:function(){return this._mapRange},set_mapRange:function(f,d){if(f==null){throw Error.argumentNull("value")}if(!IngrPL.WebClient.Core.Platform.MapContent.MapRange.isInstanceOfType(f)){throw Error.argumentType("value",Object.getType(f),IngrPL.WebClient.Core.Platform.MapContent.MapRange)}if(Boolean.isInstanceOfType(d)){d={exact:d}}if(!d){d={}}var g=!d.exact;if(d.center){var a=((f.getBottomLeft().x+f.getUpperRight().x)/2)-(this._mapRange.getBottomLeft().x+this._mapRange.getSize().width/2);var h=((f.getBottomLeft().y+f.getUpperRight().y)/2)-(this._mapRange.getBottomLeft().y+this._mapRange.getSize().height/2);var b=new IngrPL.WebClient.Core.Platform.Common.Size(a,h);f=this._mapRange.clone();f.move(b)}else{if(Number.isInstanceOfType(d.zoomFactor)){f.zoom(d.zoomFactor)}}var e=!f.equals(this._mapRange);this._mapRange=f;var c={mapStateId:this._id,adjust:g,forceZoomOut:g};if(e){$event.notify("mapRangeChanged",c,this)}if(!c.mapRangeAdjusted){this._updateRangeHistory()}},setMapRangeByPointArray:function(b,a){if(b==null){throw Error.argumentNull("points")}this.setMapRangeByPoints(b[0],b[1],b[2],b[3],a)},setMapRangeByPoints:function(c,e,a,d,b){if(c==null){throw Error.argumentNull("x1")}if(!Number.isInstanceOfType(c)){throw Error.argumentType("x1",Object.getType(c),Number)}if(e==null){throw Error.argumentNull("y1")}if(!Number.isInstanceOfType(e)){throw Error.argumentType("y1",Object.getType(e),Number)}if(a==null){throw Error.argumentNull("x2")}if(!Number.isInstanceOfType(a)){throw Error.argumentType("x2",Object.getType(a),Number)}if(d==null){throw Error.argumentNull("y2")}if(!Number.isInstanceOfType(d)){throw Error.argumentType("y2",Object.getType(d),Number)}this.set_mapRange(new IngrPL.WebClient.Core.Platform.MapContent.MapRange([c,e,a,d]),b)},zoom:function(b){this._mapRange.zoom(b);var a={mapStateId:this._id,adjust:true};$event.notify("mapRangeChanged",a,this);if(!a.mapRangeAdjusted){this._updateRangeHistory()}},fitAll:function(){if(!this.get_fitAllRange().equals(this._mapRange)){this._mapRange=this.get_fitAllRange().clone();var a={mapStateId:this._id,adjust:true,forceZoomOut:true};$event.notify("mapRangeChanged",a,this);if(!a.mapRangeAdjusted){this._updateRangeHistory()}}},printMap:function(){$event.notify("openPrintMapPage",{mapStateId:this._id},this)},get_isInitialized:function(){return this._isInitialized},get_legend:function(){this._ensureMapContent();return this._legend},get_mapLayerConfigs:function(){this._ensureMapContent();return this._mapLayerConfigs},get_mapServices:function(){var d={};var c=[];for(var b=0;b<this._mapLayerDefinitions.length;b++){if(typeof d[this._mapLayerDefinitions[b].get_mapService().get_id()]=="undefined"){d[this._mapLayerDefinitions[b].get_mapService().get_id()]=this._mapLayerDefinitions[b].get_mapService()}}for(var a in d){c.push(d[a])}return c},_mpd:Math.PI*6378137/180,get_storageToProjectionScale:function(){if($crs.getCurrent().get_isGeographic()||$crs.isGoogle()){var a=1;var f=this._mapRange.getBottomLeft(),d=this._mapRange.getUpperRight();var e=Math.abs((f.y+d.y)/2);if($crs.isGoogle()){var c=$crs.convertToDegrees(f.x,e),b=$crs.convertToDegrees(d.x,e);e=c.lat;a=(b.lon-c.lon)/(d.x-f.x)}if(e>90){e=90}if(e<0){e=0}if(e!=this._lastLatitude){this._stps=Math.cos(Math.PI*e/180)*this._mpd*a;$log.writeVerbose("storage to projection scale: {0}",this._stps);this._lastLatitude=e}return this._stps}else{return 1}},get_mapControl:function(){if(!this._mapControl&&this._mapControlId){this._mapControl=$find(this._mapControlId)}return this._mapControl},set_mapControl:function(a){if(a!=null){if(!IngrPL.WebClient.Core.Platform.MapContent.IMapControl.isInstanceOfType(a)){throw Error.argumentType("value",Object.getType(a),IngrPL.WebClient.Core.Platform.MapContent.IMapControl)}}this._mapControl=a},get_scaleBands:function(){return this._scaleBands},set_scaleBands:function(a){this._scaleBands=a},get_minScaleDenominator:function(){return this._minScaleDenominator},set_minScaleDenominator:function(a){this._minScaleDenominator=a},get_maxScaleDenominator:function(){return this._maxScaleDenominator},set_maxScaleDenominator:function(a){this._maxScaleDenominator=a},get_currentScaleBand:function(){return this._currentScaleBand},get_fitAllRange:function(c,d){if(!c){var b=$crs.getCurrent();if(!b){throw Error.invalidOperation("No CRS")}c=b.get_id()}if(this._fitAllRangeDict[c]){return this._fitAllRangeDict[c]}else{if(d){var f=$crs.getMappings(c);for(var e=0,a=f.length;e<a;e++){if(this._fitAllRangeDict[f[e]]){return this._fitAllRangeDict[f[e]]}}}}return null},set_fitAllRange:function(b,a){var c=IngrPL.WebClient.Core.Platform.MapContent.MapRange;if(b==null){throw Error.argumentNull("crsId")}if(!String.isInstanceOfType(b)){throw Error.argumentType("crsId",Object.getType(b),String)}if(a==null){throw Error.argumentNull("mapRange")}if(!c.isInstanceOfType(a)){throw Error.argumentType("mapRange",Object.getType(a),c)}this._fitAllRangeDict[b]=a},get_currentVariantId:function(){return(this._currentVariant||this._pendingVariant).id}};IngrPL.WebClient.Core.Platform.MapContent.MapState.registerClass("IngrPL.WebClient.Core.Platform.MapContent.MapState");IngrPL.WebClient.Core.Platform.MapContent.IMapControl=function(){};IngrPL.WebClient.Core.Platform.MapContent.IMapControl.prototype={get_scaleDenominator:function(){},set_scaleDenominator:function(a){},get_mapSize:function(){}};IngrPL.WebClient.Core.Platform.MapContent.IMapControl.registerInterface("IngrPL.WebClient.Core.Platform.MapContent.IMapControl");
//END IngrPL.WebClient.Core.Platform.MapContent.MapState.js
//START IngrPL.WebClient.Core.Platform.MapContent.MapStateManager.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapContent");IngrPL.WebClient.Core.Platform.MapContent._MapStateManager=function(){this._mapStates={};this._mapStateVariants={}};IngrPL.WebClient.Core.Platform.MapContent._MapStateManager.prototype={registerMapState:function(d){var c=new IngrPL.WebClient.Core.Platform.MapContent.MapState(d);this._mapStates[d.id]=c;if(this._mapStateVariants[d.id]){var a=this._mapStateVariants[d.id];for(var b=0;b<a.length;b++){c.addMapStateVariant(a[b])}}c.initialize()},registerMapStateVariant:function(b,a){if(this._mapStates[b]){this._mapStates[b].addMapStateVariant(a)}else{if(!this._mapStateVariants[b]){this._mapStateVariants[b]=new Array()}this._mapStateVariants[b].push(a)}},findMapState:function(a){return this._mapStates[a]},saveMapStates:function(){if(!this._mapStatesField){this._mapStatesField=document.createElement("input");this._mapStatesField.type="hidden";this._mapStatesField.id=this._mapStatesField.name="__wc_mapstates";theForm.appendChild(this._mapStatesField)}var b=[];for(var a in this._mapStates){b.push(this._mapStates[a].serialize())}this._mapStatesField.value=Sys.Serialization.JavaScriptSerializer.serialize(b)},get_mapStates:function(){return this._mapStates}};IngrPL.WebClient.Core.Platform.MapContent._MapStateManager.registerClass("IngrPL.WebClient.Core.Platform.MapContent._MapStateManager");IngrPL.WebClient.Core.Platform.MapContent.MapStateManager=new IngrPL.WebClient.Core.Platform.MapContent._MapStateManager();var $mapStateManager=IngrPL.WebClient.Core.Platform.MapContent.MapStateManager;(function(){var a=theForm.onsubmit;theForm.onsubmit=function(){$mapStateManager.saveMapStates();if(typeof(a)=="function"){return a()}else{return true}}})();
//END IngrPL.WebClient.Core.Platform.MapContent.MapStateManager.js
//START IngrPL.WebClient.Core.Platform.ClientScript.MapPageScript.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.Common");IngrPL.WebClient.Core.Platform.Common.MapPageUtils=(function(){function e(j){if(!Array.isInstanceOfType(j)){return false}if(j.length<4){return false}for(var h=0;h<4;h++){if(!Number.isInstanceOfType(j[h])){return false}}return true}function b(m){var i=$crs.getCurrent();if(!i){throw Error.invalidOperation("No CRS")}var k=mapInfo.getDefaultMapRange();var l=mapInfo.getDefaultCRSId()||i.get_id();if(e(m.mapRange)){var j=m.mapRange;m.mapRange={};m.mapRange[i.get_id()]=j}if(e(m.fitAllRange)){m.fitAllRange=[{Key:i.get_id(),Value:m.fitAllRange}]}if(e(k)){for(var h in m.mapRange){if(l==h){if(!m.fitAllRange){m.fitAllRange=[]}m.fitAllRange.push({Key:h,Value:m.mapRange[h]});m.mapRange[h]=k;return}}m.mapRange[l]=k}}function g(m){var k=mapInfo.getDefaultCRSId();for(var j=0,h=m.length;j<h;j++){if(String.isInstanceOfType(m[j])){m[j]={id:m[j]}}if(k){m[j].isDefault=k==m[j].id}}$crs.registerCRSs(m)}function d(h){if(!$mapServiceManager.findMapService(h.id)){$mapServiceManager.registerMapService(h)}}function a(i,h){if(!h){h={}}if(!$mapStateManager.findMapState(i.id)){if(h.processMapRanges!==false){b(i)}$mapStateManager.registerMapState(i)}}function f(j,i){if(!$mapStateManager.findMapState(j)){var h=mapInfo.getDefaultVariantId();if(h){i.isDefault=i.id==h}$mapStateManager.registerMapStateVariant(j,i)}}function c(w){function m(j,i,y){if(s[y.get_id()]){var l=y.getDefaultLegendDefinition();if(l){if(this.defaultOpacity!==undefined&&this.defaultOpacity>=0&&this.defaultOpacity<=100){l.set_defaultOpacity(this.defaultOpacity)}l.addToMapState(p)}delete s[y.get_id()]}var z=false;for(var A in s){z=true;break}if(!z){$event.unregister("mapServiceInitialized",m)}}var p,s={},v,x=mapInfo.getExtraServices(),u;if(w){p=$mapStateManager.findMapState(w)}var q=0,t,k=function(){return"__extra_"+q};for(var r=0,o=x.length;r<o;r++){def=x[r];t=$mapServiceManager.checkUrlExists(def.url);if(!t){while($mapServiceManager.findMapService(k())){q++}var n={id:k(),definitionName:def.name,config:[{Key:"url",Value:def.url}]};d(n)}v=$mapServiceManager.findMapService(t||k());if(v.get_isInitialized()){var h=v.getDefaultLegendDefinition();if(h){if(def.defaultOpacity!==undefined&&def.defaultOpacity>=0&&def.defaultOpacity<=100){h.set_defaultOpacity(def.defaultOpacity)}h.addToMapState(p)}}else{if(!u&&p){$event.register("mapServiceInitialized",m,{defaultOpacity:def.defaultOpacity});u=true}s[v.get_id()]=true;v.initialize()}}}return{regCRSs:g,regCRS:function(h){g([h])},regService:d,regState:a,regVariant:f,regExtraServices:c}})();
//END IngrPL.WebClient.Core.Platform.ClientScript.MapPageScript.js
//START IngrPL.WebClient.Core.Platform.MapStorage.MapStorageManager.js
Type.registerNamespace("IngrPL.WebClient.Core.Platform.MapStorage");IngrPL.WebClient.Core.Platform.MapStorage._MapStorageManager=function(){this._maps={};var b=/mapStorageUserId=(.*?);/;var a=b.exec(document.cookie+";");if(a){this._userId=a[1];this._writeCookie()}};IngrPL.WebClient.Core.Platform.MapStorage._MapStorageManager.prototype={get_userId:function(){return this._userId||null},getMaps:function(c,b){var d=this;var a={handler:c,scope:b};this._doCallback({action:"getMaps"},a)},saveMap:function(d,e,c,b){var a={handler:c,scope:b};this._doCallback({action:"saveMap",mapName:d,mapStateId:e},a)},setMapName:function(c,a,e,d){var b={handler:e,scope:d};this._doCallback({action:"setMapName",mapId:c,mapName:a},b)},setMapPublic:function(b,e,d,c){var a={handler:d,scope:c};this._doCallback({action:"setMapPublic",mapId:b,isPublic:e},a)},deleteMap:function(b,d,c){var a={handler:d,scope:c};this._doCallback({action:"deleteMap",mapId:b},a)},displayMap:function(d,e,c,b){if(String.isInstanceOfType(d)){var a={handler:c,scope:b,mapStateId:e};this._doCallback({action:"readMap",mapId:d},a)}else{if(d){this._displayMap_Callback(d,e);this._callHandler({handler:c,scope:b})}}},_displayMap_Callback:function(g,h){for(var c in g.mapServices){if(!$mapServiceManager.findMapService(c)){$mapServiceManager.registerMapService(g.mapServices[c])}}var f=$mapStateManager.findMapState(h);var e=g.mapState;if(e.mapLayerConfigs){for(var d=0,b=e.mapLayerConfigs.length;d<b;d++){e.mapLayerConfigs[d].mapStateId=h}}function a(i){if(f){e.id="__mapStorage_";f.addMapStateVariant(e);f.setVariant(e.id,true)}else{e.id=h;$mapStateManager.registerMapState(e)}if(i){$event.notify("crsChanged",null,this)}}if(g.crs){delete g.crs.isDefault;delete g.crs.isPersistent;$crs.registerCRSs([g.crs]);$crs.setCurrent(g.crs.id,[h],a,this)}else{a()}},_writeCookie:function(){var c="mapStorageUserId";var b=this._userId;var a=60*60*24*365;document.cookie=String.format("{0}={1};max-age={2};expires={3};",c,b,a,new Date(new Date().getTime()+(1000*a)).toGMTString());$log.writeInfo("cookie: {0}",document.cookie)},_doCallback:function(a,b){if(!this._processingRequest){this._processingRequest=true;if(this._userId){a.userId=this._userId}var c=$webRequest.create({name:"MapStorageManager",query:a,includeMapStates:a.action=="saveMap",includeCRS:a.action=="saveMap",callback:this._callbackCompleted,scope:this,context:b});c.invoke()}},_callbackCompleted:function(d){this._processingRequest=false;var k=IngrPL.WebClient.Core.Platform.Common.Util;var b=d.get_webRequest().get_userContext();if(!k.checkExecutor(d,k.showError)){this._callHandler(b,null,true);return}try{var h=d.get_object()}catch(g){k.showError(g);this._callHandler(b,null,true);return}if(h.error){k.showError(h.error);this._callHandler(b,null,true);return}if(h.userId){this._userId=h.userId;this._writeCookie()}var j;if(h.maps){this._maps={};j=[[]];for(var f=0,c=h.maps.length;f<c;f++){var a=h.maps[f];this._maps[a.id]=a;j[0][f]=a}}else{if(h.map){this._maps[h.map.id]=h.map;j=[h.map]}else{if(h.mapId){j=[h.mapId]}}}if(h.mapServices&&h.mapState&&b.mapStateId){this._displayMap_Callback(h,b.mapStateId)}this._callHandler(b,j)},_callHandler:function(c,b,a){if(c.handler){if(a){b=[false]}c.handler.apply(c.scope||window,b||[])}}};IngrPL.WebClient.Core.Platform.MapStorage._MapStorageManager.registerClass("IngrPL.WebClient.Core.Platform.MapStorage._MapStorageManager");IngrPL.WebClient.Core.Platform.MapStorage.MapStorageManager=new IngrPL.WebClient.Core.Platform.MapStorage._MapStorageManager();
//END IngrPL.WebClient.Core.Platform.MapStorage.MapStorageManager.js
//START AjaxControlToolkit.ExtenderBase.BaseScripts.js
Type.registerNamespace('AjaxControlToolkit');AjaxControlToolkit.BehaviorBase = function(element) {
AjaxControlToolkit.BehaviorBase.initializeBase(this,[element]);this._clientStateFieldID = null;this._pageRequestManager = null;this._partialUpdateBeginRequestHandler = null;this._partialUpdateEndRequestHandler = null;}
AjaxControlToolkit.BehaviorBase.prototype = {
initialize : function() {
AjaxControlToolkit.BehaviorBase.callBaseMethod(this, 'initialize');},
dispose : function() {
AjaxControlToolkit.BehaviorBase.callBaseMethod(this, 'dispose');if (this._pageRequestManager) {
if (this._partialUpdateBeginRequestHandler) {
this._pageRequestManager.remove_beginRequest(this._partialUpdateBeginRequestHandler);this._partialUpdateBeginRequestHandler = null;}
if (this._partialUpdateEndRequestHandler) {
this._pageRequestManager.remove_endRequest(this._partialUpdateEndRequestHandler);this._partialUpdateEndRequestHandler = null;}
this._pageRequestManager = null;}
},
get_ClientStateFieldID : function() {
return this._clientStateFieldID;},
set_ClientStateFieldID : function(value) {
if (this._clientStateFieldID != value) {
this._clientStateFieldID = value;this.raisePropertyChanged('ClientStateFieldID');}
},
get_ClientState : function() {
if (this._clientStateFieldID) {
var input = document.getElementById(this._clientStateFieldID);if (input) {
return input.value;}
}
return null;},
set_ClientState : function(value) {
if (this._clientStateFieldID) {
var input = document.getElementById(this._clientStateFieldID);if (input) {
input.value = value;}
}
},
registerPartialUpdateEvents : function() {
if (Sys && Sys.WebForms && Sys.WebForms.PageRequestManager){
this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();if (this._pageRequestManager) {
this._partialUpdateBeginRequestHandler = Function.createDelegate(this, this._partialUpdateBeginRequest);this._pageRequestManager.add_beginRequest(this._partialUpdateBeginRequestHandler);this._partialUpdateEndRequestHandler = Function.createDelegate(this, this._partialUpdateEndRequest);this._pageRequestManager.add_endRequest(this._partialUpdateEndRequestHandler);}
}
},
_partialUpdateBeginRequest : function(sender, beginRequestEventArgs) {
},
_partialUpdateEndRequest : function(sender, endRequestEventArgs) {
}
}
AjaxControlToolkit.BehaviorBase.registerClass('AjaxControlToolkit.BehaviorBase', Sys.UI.Behavior);AjaxControlToolkit.DynamicPopulateBehaviorBase = function(element) {
AjaxControlToolkit.DynamicPopulateBehaviorBase.initializeBase(this, [element]);this._DynamicControlID = null;this._DynamicContextKey = null;this._DynamicServicePath = null;this._DynamicServiceMethod = null;this._cacheDynamicResults = false;this._dynamicPopulateBehavior = null;this._populatingHandler = null;this._populatedHandler = null;}
AjaxControlToolkit.DynamicPopulateBehaviorBase.prototype = {
initialize : function() {
AjaxControlToolkit.DynamicPopulateBehaviorBase.callBaseMethod(this, 'initialize');this._populatingHandler = Function.createDelegate(this, this._onPopulating);this._populatedHandler = Function.createDelegate(this, this._onPopulated);},
dispose : function() {
if (this._populatedHandler) {
if (this._dynamicPopulateBehavior) {
this._dynamicPopulateBehavior.remove_populated(this._populatedHandler);}
this._populatedHandler = null;}
if (this._populatingHandler) {
if (this._dynamicPopulateBehavior) {
this._dynamicPopulateBehavior.remove_populating(this._populatingHandler);}
this._populatingHandler = null;}
if (this._dynamicPopulateBehavior) {
this._dynamicPopulateBehavior.dispose();this._dynamicPopulateBehavior = null;}
AjaxControlToolkit.DynamicPopulateBehaviorBase.callBaseMethod(this, 'dispose');},
populate : function(contextKeyOverride) {
if (this._dynamicPopulateBehavior && (this._dynamicPopulateBehavior.get_element() != $get(this._DynamicControlID))) {
this._dynamicPopulateBehavior.dispose();this._dynamicPopulateBehavior = null;}
if (!this._dynamicPopulateBehavior && this._DynamicControlID && this._DynamicServiceMethod) {
this._dynamicPopulateBehavior = $create(AjaxControlToolkit.DynamicPopulateBehavior,
{
"id" : this.get_id() + "_DynamicPopulateBehavior",
"ContextKey" : this._DynamicContextKey,
"ServicePath" : this._DynamicServicePath,
"ServiceMethod" : this._DynamicServiceMethod,
"cacheDynamicResults" : this._cacheDynamicResults
}, null, null, $get(this._DynamicControlID));this._dynamicPopulateBehavior.add_populating(this._populatingHandler);this._dynamicPopulateBehavior.add_populated(this._populatedHandler);}
if (this._dynamicPopulateBehavior) {
this._dynamicPopulateBehavior.populate(contextKeyOverride ? contextKeyOverride : this._DynamicContextKey);}
},
_onPopulating : function(sender, eventArgs) {
this.raisePopulating(eventArgs);},
_onPopulated : function(sender, eventArgs) {
this.raisePopulated(eventArgs);},
get_dynamicControlID : function() {
return this._DynamicControlID;},
get_DynamicControlID : this.get_dynamicControlID,
set_dynamicControlID : function(value) {
if (this._DynamicControlID != value) {
this._DynamicControlID = value;this.raisePropertyChanged('dynamicControlID');this.raisePropertyChanged('DynamicControlID');}
},
set_DynamicControlID : this.set_dynamicControlID,
get_dynamicContextKey : function() {
return this._DynamicContextKey;},
get_DynamicContextKey : this.get_dynamicContextKey,
set_dynamicContextKey : function(value) {
if (this._DynamicContextKey != value) {
this._DynamicContextKey = value;this.raisePropertyChanged('dynamicContextKey');this.raisePropertyChanged('DynamicContextKey');}
},
set_DynamicContextKey : this.set_dynamicContextKey,
get_dynamicServicePath : function() {
return this._DynamicServicePath;},
get_DynamicServicePath : this.get_dynamicServicePath,
set_dynamicServicePath : function(value) {
if (this._DynamicServicePath != value) {
this._DynamicServicePath = value;this.raisePropertyChanged('dynamicServicePath');this.raisePropertyChanged('DynamicServicePath');}
},
set_DynamicServicePath : this.set_dynamicServicePath,
get_dynamicServiceMethod : function() {
return this._DynamicServiceMethod;},
get_DynamicServiceMethod : this.get_dynamicServiceMethod,
set_dynamicServiceMethod : function(value) {
if (this._DynamicServiceMethod != value) {
this._DynamicServiceMethod = value;this.raisePropertyChanged('dynamicServiceMethod');this.raisePropertyChanged('DynamicServiceMethod');}
},
set_DynamicServiceMethod : this.set_dynamicServiceMethod,
get_cacheDynamicResults : function() {
return this._cacheDynamicResults;},
set_cacheDynamicResults : function(value) {
if (this._cacheDynamicResults != value) {
this._cacheDynamicResults = value;this.raisePropertyChanged('cacheDynamicResults');}
},
add_populated : function(handler) {
this.get_events().addHandler("populated", handler);},
remove_populated : function(handler) {
this.get_events().removeHandler("populated", handler);},
raisePopulated : function(arg) {
var handler = this.get_events().getHandler("populated");if (handler) handler(this, arg);},
add_populating : function(handler) {
this.get_events().addHandler('populating', handler);},
remove_populating : function(handler) {
this.get_events().removeHandler('populating', handler);},
raisePopulating : function(eventArgs) {
var handler = this.get_events().getHandler('populating');if (handler) {
handler(this, eventArgs);}
}
}
AjaxControlToolkit.DynamicPopulateBehaviorBase.registerClass('AjaxControlToolkit.DynamicPopulateBehaviorBase', AjaxControlToolkit.BehaviorBase);AjaxControlToolkit.ControlBase = function(element) {
AjaxControlToolkit.ControlBase.initializeBase(this, [element]);this._clientStateField = null;this._callbackTarget = null;this._onsubmit$delegate = Function.createDelegate(this, this._onsubmit);this._oncomplete$delegate = Function.createDelegate(this, this._oncomplete);this._onerror$delegate = Function.createDelegate(this, this._onerror);}
AjaxControlToolkit.ControlBase.prototype = {
initialize : function() {
AjaxControlToolkit.ControlBase.callBaseMethod(this, "initialize");if (this._clientStateField) {
this.loadClientState(this._clientStateField.value);}
if (typeof(Sys.WebForms)!=="undefined" && typeof(Sys.WebForms.PageRequestManager)!=="undefined") {
Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, this._onsubmit$delegate);} else {
$addHandler(document.forms[0], "submit", this._onsubmit$delegate);}
},
dispose : function() {
if (typeof(Sys.WebForms)!=="undefined" && typeof(Sys.WebForms.PageRequestManager)!=="undefined") {
Array.remove(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements, this._onsubmit$delegate);} else {
$removeHandler(document.forms[0], "submit", this._onsubmit$delegate);}
AjaxControlToolkit.ControlBase.callBaseMethod(this, "dispose");},
findElement : function(id) {
return $get(this.get_id() + '_' + id.split(':').join('_'));},
get_clientStateField : function() {
return this._clientStateField;},
set_clientStateField : function(value) {
if (this.get_isInitialized()) throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_CannotSetClientStateField);if (this._clientStateField != value) {
this._clientStateField = value;this.raisePropertyChanged('clientStateField');}
},
loadClientState : function(value) {
},
saveClientState : function() {
return null;},
_invoke : function(name, args, cb) {
if (!this._callbackTarget) {
throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_ControlNotRegisteredForCallbacks);}
if (typeof(WebForm_DoCallback)==="undefined") {
throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_PageNotRegisteredForCallbacks);}
var ar = [];for (var i = 0;i < args.length;i++) 
ar[i] = args[i];var clientState = this.saveClientState();if (clientState != null && !String.isInstanceOfType(clientState)) {
throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_InvalidClientStateType);}
var payload = Sys.Serialization.JavaScriptSerializer.serialize({name:name,args:ar,state:this.saveClientState()});WebForm_DoCallback(this._callbackTarget, payload, this._oncomplete$delegate, cb, this._onerror$delegate, true);},
_oncomplete : function(result, context) {
result = Sys.Serialization.JavaScriptSerializer.deserialize(result);if (result.error) {
throw Error.create(result.error);}
this.loadClientState(result.state);context(result.result);},
_onerror : function(message, context) {
throw Error.create(message);},
_onsubmit : function() {
if (this._clientStateField) {
this._clientStateField.value = this.saveClientState();}
return true;} 
}
AjaxControlToolkit.ControlBase.registerClass("AjaxControlToolkit.ControlBase", Sys.UI.Control);
AjaxControlToolkit.Resources={
"PasswordStrength_InvalidWeightingRatios":"Strength Weighting ratios must have 4 elements","Animation_ChildrenNotAllowed":"AjaxControlToolkit.Animation.createAnimation cannot add child animations to type \"{0}\" that does not derive from AjaxControlToolkit.Animation.ParentAnimation","PasswordStrength_RemainingSymbols":"{0} symbol characters","ExtenderBase_CannotSetClientStateField":"clientStateField can only be set before initialization","RTE_PreviewHTML":"Preview HTML","RTE_JustifyCenter":"Justify Center","PasswordStrength_RemainingUpperCase":"{0} more upper case characters","Animation_TargetNotFound":"AjaxControlToolkit.Animation.Animation.set_animationTarget requires the ID of a Sys.UI.DomElement or Sys.UI.Control.  No element or control could be found corresponding to \"{0}\"","RTE_FontColor":"Font Color","RTE_LabelColor":"Label Color","Common_InvalidBorderWidthUnit":"A unit type of \"{0}\"\u0027 is invalid for parseBorderWidth","RTE_Heading":"Heading","Tabs_PropertySetBeforeInitialization":"{0} cannot be changed before initialization","RTE_OrderedList":"Ordered List","ReorderList_DropWatcherBehavior_NoChild":"Could not find child of list with id \"{0}\"","CascadingDropDown_MethodTimeout":"[Method timeout]","RTE_Columns":"Columns","RTE_InsertImage":"Insert Image","RTE_InsertTable":"Insert Table","RTE_Values":"Values","RTE_OK":"OK","ExtenderBase_PageNotRegisteredForCallbacks":"This Page has not been registered for callbacks","Animation_NoDynamicPropertyFound":"AjaxControlToolkit.Animation.createAnimation found no property corresponding to \"{0}\" or \"{1}\"","Animation_InvalidBaseType":"AjaxControlToolkit.Animation.registerAnimation can only register types that inherit from AjaxControlToolkit.Animation.Animation","RTE_UnorderedList":"Unordered List","ResizableControlBehavior_InvalidHandler":"{0} handler not a function, function name, or function text","Animation_InvalidColor":"Color must be a 7-character hex representation (e.g. #246ACF), not \"{0}\"","RTE_CellColor":"Cell Color","PasswordStrength_RemainingMixedCase":"Mixed case characters","RTE_Italic":"Italic","CascadingDropDown_NoParentElement":"Failed to find parent element \"{0}\"","ValidatorCallout_DefaultErrorMessage":"This control is invalid","RTE_Indent":"Indent","ReorderList_DropWatcherBehavior_CallbackError":"Reorder failed, see details below.\\r\\n\\r\\n{0}","PopupControl_NoDefaultProperty":"No default property supported for control \"{0}\" of type \"{1}\"","RTE_Normal":"Normal","PopupExtender_NoParentElement":"Couldn\u0027t find parent element \"{0}\"","RTE_ViewValues":"View Values","RTE_Legend":"Legend","RTE_Labels":"Labels","RTE_CellSpacing":"Cell Spacing","PasswordStrength_RemainingNumbers":"{0} more numbers","RTE_Border":"Border","RTE_Create":"Create","RTE_BackgroundColor":"Background Color","RTE_Cancel":"Cancel","RTE_JustifyFull":"Justify Full","RTE_JustifyLeft":"Justify Left","RTE_Cut":"Cut","ResizableControlBehavior_CannotChangeProperty":"Changes to {0} not supported","RTE_ViewSource":"View Source","Common_InvalidPaddingUnit":"A unit type of \"{0}\" is invalid for parsePadding","RTE_Paste":"Paste","ExtenderBase_ControlNotRegisteredForCallbacks":"This Control has not been registered for callbacks","Calendar_Today":"Today: {0}","Common_DateTime_InvalidFormat":"Invalid format","ListSearch_DefaultPrompt":"Type to search","CollapsiblePanel_NoControlID":"Failed to find element \"{0}\"","RTE_ViewEditor":"View Editor","RTE_BarColor":"Bar Color","PasswordStrength_DefaultStrengthDescriptions":"NonExistent;Very Weak;Weak;Poor;Almost OK;Barely Acceptable;Average;Good;Strong;Excellent;Unbreakable!","RTE_Inserttexthere":"Insert text here","Animation_UknownAnimationName":"AjaxControlToolkit.Animation.createAnimation could not find an Animation corresponding to the name \"{0}\"","ExtenderBase_InvalidClientStateType":"saveClientState must return a value of type String","Rating_CallbackError":"An unhandled exception has occurred:\\r\\n{0}","Tabs_OwnerExpected":"owner must be set before initialize","DynamicPopulate_WebServiceTimeout":"Web service call timed out","PasswordStrength_RemainingLowerCase":"{0} more lower case characters","Animation_MissingAnimationName":"AjaxControlToolkit.Animation.createAnimation requires an object with an AnimationName property","RTE_JustifyRight":"Justify Right","Tabs_ActiveTabArgumentOutOfRange":"Argument is not a member of the tabs collection","RTE_CellPadding":"Cell Padding","RTE_ClearFormatting":"Clear Formatting","AlwaysVisible_ElementRequired":"AjaxControlToolkit.AlwaysVisibleControlBehavior must have an element","Slider_NoSizeProvided":"Please set valid values for the height and width attributes in the slider\u0027s CSS classes","DynamicPopulate_WebServiceError":"Web Service call failed: {0}","PasswordStrength_StrengthPrompt":"Strength: ","PasswordStrength_RemainingCharacters":"{0} more characters","PasswordStrength_Satisfied":"Nothing more required","RTE_Hyperlink":"Hyperlink","Animation_NoPropertyFound":"AjaxControlToolkit.Animation.createAnimation found no property corresponding to \"{0}\"","PasswordStrength_InvalidStrengthDescriptionStyles":"Text Strength description style classes must match the number of text descriptions.","PasswordStrength_GetHelpRequirements":"Get help on password requirements","PasswordStrength_InvalidStrengthDescriptions":"Invalid number of text strength descriptions specified","RTE_Underline":"Underline","Tabs_PropertySetAfterInitialization":"{0} cannot be changed after initialization","RTE_Rows":"Rows","RTE_Redo":"Redo","RTE_Size":"Size","RTE_Undo":"Undo","RTE_Bold":"Bold","RTE_Copy":"Copy","RTE_Font":"Font","CascadingDropDown_MethodError":"[Method error {0}]","RTE_BorderColor":"Border Color","RTE_Paragraph":"Paragraph","RTE_InsertHorizontalRule":"Insert Horizontal Rule","Common_UnitHasNoDigits":"No digits","RTE_Outdent":"Outdent","Common_DateTime_InvalidTimeSpan":"\"{0}\" is not a valid TimeSpan format","Animation_CannotNestSequence":"AjaxControlToolkit.Animation.SequenceAnimation cannot be nested inside AjaxControlToolkit.Animation.ParallelAnimation","Shared_BrowserSecurityPreventsPaste":"Your browser security settings don\u0027t permit the automatic execution of paste operations. Please use the keyboard shortcut Ctrl+V instead."};
//END AjaxControlToolkit.ExtenderBase.BaseScripts.js
//START IngrPL.WebClient.Core.Controls.Layout.LoadingIndicator.LoadingIndicator.js
Type.registerNamespace("IngrPL.WebClient.Core.Controls.Layout");IngrPL.WebClient.Core.Controls.Layout.LoadingIndicator=function(a){IngrPL.WebClient.Core.Controls.Layout.LoadingIndicator.initializeBase(this,[a]);this._loadedDelegate=Function.createDelegate(this,this._loaded)};IngrPL.WebClient.Core.Controls.Layout.LoadingIndicator.prototype={initialize:function(){IngrPL.WebClient.Core.Controls.Layout.LoadingIndicator.callBaseMethod(this,"initialize");Sys.Application.add_load(this._loadedDelegate)},dispose:function(){IngrPL.WebClient.Core.Controls.Layout.LoadingIndicator.callBaseMethod(this,"dispose")},_loaded:function(){Sys.Application.remove_load(this._loadedDelegate);var a=$get(this.get_id()+"Mask");if(!a){return}if(window.Ext){Ext.fly(a).fadeOut({remove:true})}else{a.parentNode.removeChild(a)}}};IngrPL.WebClient.Core.Controls.Layout.LoadingIndicator.registerClass("IngrPL.WebClient.Core.Controls.Layout.LoadingIndicator",AjaxControlToolkit.ControlBase);
//END IngrPL.WebClient.Core.Controls.Layout.LoadingIndicator.LoadingIndicator.js
//START ExtJS.ext.adapter.ext.ext-base.js
/*
 * Ext JS Library 2.2.1
 * Copyright(c) 2006-2009, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */

Ext={version:"2.2.1"};window["undefined"]=window["undefined"];Ext.apply=function(d,e,b){if(b){Ext.apply(d,b)}if(d&&e&&typeof e=="object"){for(var a in e){d[a]=e[a]}}return d};(function(){var idSeed=0;var ua=navigator.userAgent.toLowerCase();var isStrict=document.compatMode=="CSS1Compat",isOpera=ua.indexOf("opera")>-1,isChrome=ua.indexOf("chrome")>-1,isSafari=!isChrome&&(/webkit|khtml/).test(ua),isSafari3=isSafari&&ua.indexOf("webkit/5")!=-1,isIE=!isOpera&&ua.indexOf("msie")>-1,isIE7=!isOpera&&ua.indexOf("msie 7")>-1,isIE8=!isOpera&&ua.indexOf("msie 8")>-1,isGecko=!isSafari&&!isChrome&&ua.indexOf("gecko")>-1,isGecko3=isGecko&&ua.indexOf("rv:1.9")>-1,isBorderBox=isIE&&!isStrict,isWindows=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),isMac=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),isAir=(ua.indexOf("adobeair")!=-1),isLinux=(ua.indexOf("linux")!=-1),isSecure=window.location.href.toLowerCase().indexOf("https")===0;if(isIE&&!isIE7){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}Ext.apply(Ext,{isStrict:isStrict,isSecure:isSecure,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http://extjs.com/s.gif",emptyFn:function(){},applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p]}}}return o},addBehaviors:function(o){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(o)});return}var cache={};for(var b in o){var parts=b.split("@");if(parts[1]){var s=parts[0];if(!cache[s]){cache[s]=Ext.select(s)}cache[s].on(parts[1],o[b])}}cache=null},id:function(el,prefix){prefix=prefix||"ext-gen";el=Ext.getDom(el);var id=prefix+(++idSeed);return el?(el.id?el.id:(el.id=id)):id},extend:function(){var io=function(o){for(var m in o){this[m]=o[m]}};var oc=Object.prototype.constructor;return function(sb,sp,overrides){if(typeof sp=="object"){overrides=sp;sp=sb;sb=overrides.constructor!=oc?overrides.constructor:function(){sp.apply(this,arguments)}}var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==oc){spp.constructor=sp}sb.override=function(o){Ext.override(sb,o)};sbp.override=io;Ext.override(sb,overrides);sb.extend=function(o){Ext.extend(sb,o)};return sb}}(),override:function(origclass,overrides){if(overrides){var p=origclass.prototype;for(var method in overrides){p[method]=overrides[method]}if(Ext.isIE&&overrides.toString!=origclass.toString){p.toString=overrides.toString}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval("if (typeof "+rt+' == "undefined"){'+rt+" = {};} o = "+rt+";");for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]]}}},urlEncode:function(o){if(!o){return""}var buf=[];for(var key in o){var ov=o[key],k=encodeURIComponent(key);var type=typeof ov;if(type=="undefined"){buf.push(k,"=&")}else{if(type!="function"&&type!="object"){buf.push(k,"=",encodeURIComponent(ov),"&")}else{if(Ext.isDate(ov)){var s=Ext.encode(ov).replace(/"/g,"");buf.push(k,"=",s,"&")}else{if(Ext.isArray(ov)){if(ov.length){for(var i=0,len=ov.length;i<len;i++){buf.push(k,"=",encodeURIComponent(ov[i]===undefined?"":ov[i]),"&")}}else{buf.push(k,"=&")}}}}}}buf.pop();return buf.join("")},urlDecode:function(string,overwrite){if(!string||!string.length){return{}}var obj={};var pairs=string.split("&");var pair,name,value;for(var i=0,len=pairs.length;i<len;i++){pair=pairs[i].split("=");name=decodeURIComponent(pair[0]);value=decodeURIComponent(pair[1]);if(overwrite!==true){if(typeof obj[name]=="undefined"){obj[name]=value}else{if(typeof obj[name]=="string"){obj[name]=[obj[name]];obj[name].push(value)}else{obj[name].push(value)}}}else{obj[name]=value}}return obj},each:function(array,fn,scope){if(typeof array.length=="undefined"||typeof array=="string"){array=[array]}for(var i=0,len=array.length;i<len;i++){if(fn.call(scope||array[i],array[i],i,array)===false){return i}}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;i<l;i++){var a=as[i];if(Ext.isArray(a)){r=r.concat(a)}else{if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0))}else{r.push(a)}}}return r},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},callback:function(cb,scope,args,delay){if(typeof cb=="function"){if(delay){cb.defer(delay,scope,args||[])}else{cb.apply(scope,args||[])}}},getDom:function(el){if(!el||!document){return null}return el.dom?el.dom:(typeof el=="string"?document.getElementById(el):el)},getDoc:function(){return Ext.get(document)},getBody:function(){return Ext.get(document.body||document.documentElement)},getCmp:function(id){return Ext.ComponentMgr.get(id)},num:function(v,defaultValue){if(typeof v!="number"||isNaN(v)){return defaultValue}return v},destroy:function(){for(var i=0,a=arguments,len=a.length;i<len;i++){var as=a[i];if(as){if(typeof as.destroy=="function"){as.destroy()}else{if(as.dom){as.removeAllListeners();as.remove()}}}}},removeNode:isIE?function(){var d;return function(n){if(n&&n.tagName!="BODY"){d=d||document.createElement("div");d.appendChild(n);d.innerHTML=""}}}():function(n){if(n&&n.parentNode&&n.tagName!="BODY"){n.parentNode.removeChild(n)}},type:function(o){if(o===undefined||o===null){return false}if(o.htmlElement){return"element"}var t=typeof o;if(t=="object"&&o.nodeName){switch(o.nodeType){case 1:return"element";case 3:return(/\S/).test(o.nodeValue)?"textnode":"whitespace"}}if(t=="object"||t=="function"){switch(o.constructor){case Array:return"array";case RegExp:return"regexp";case Date:return"date"}if(typeof o.length=="number"&&typeof o.item=="function"){return"nodelist"}}return t},isEmpty:function(v,allowBlank){return v===null||v===undefined||(!allowBlank?v==="":false)},value:function(v,defaultValue,allowBlank){return Ext.isEmpty(v,allowBlank)?defaultValue:v},isArray:function(v){return v&&typeof v.length=="number"&&typeof v.splice=="function"},isDate:function(v){return v&&typeof v.getFullYear=="function"},isOpera:isOpera,isChrome:isChrome,isSafari:isSafari,isSafari3:isSafari3,isSafari2:isSafari&&!isSafari3,isIE:isIE,isIE6:isIE&&!isIE7&&!isIE8,isIE7:isIE7,isIE8:isIE8,isGecko:isGecko,isGecko2:isGecko&&!isGecko3,isGecko3:isGecko3,isBorderBox:isBorderBox,isLinux:isLinux,isWindows:isWindows,isMac:isMac,isAir:isAir,useShims:((isIE&&!isIE7)||(isMac&&isGecko&&!isGecko3))});Ext.ns=Ext.namespace})();Ext.ns("Ext","Ext.util","Ext.grid","Ext.dd","Ext.tree","Ext.data","Ext.form","Ext.menu","Ext.state","Ext.lib","Ext.layout","Ext.app","Ext.ux");Ext.apply(Function.prototype,{createCallback:function(){var a=arguments;var b=this;return function(){return b.apply(window,a)}},createDelegate:function(c,b,a){var d=this;return function(){var f=b||arguments;if(a===true){f=Array.prototype.slice.call(arguments,0);f=f.concat(b)}else{if(typeof a=="number"){f=Array.prototype.slice.call(arguments,0);var e=[a,0].concat(b);Array.prototype.splice.apply(f,e)}}return d.apply(c||window,f)}},defer:function(c,e,b,a){var d=this.createDelegate(e,b,a);if(c){return setTimeout(d,c)}d();return 0},createSequence:function(b,a){if(typeof b!="function"){return this}var c=this;return function(){var d=c.apply(this||window,arguments);b.apply(a||this||window,arguments);return d}},createInterceptor:function(b,a){if(typeof b!="function"){return this}var c=this;return function(){b.target=this;b.method=c;if(b.apply(a||this||window,arguments)===false){return}return c.apply(this||window,arguments)}}});Ext.applyIf(String,{escape:function(a){return a.replace(/('|\\)/g,"\\$1")},leftPad:function(d,b,c){var a=new String(d);if(!c){c=" "}while(a.length<b){a=c+a}return a.toString()},format:function(b){var a=Array.prototype.slice.call(arguments,1);return b.replace(/\{(\d+)\}/g,function(c,d){return a[d]})}});String.prototype.toggle=function(b,a){return this==b?a:b};String.prototype.trim=function(){var a=/^\s+|\s+$/g;return function(){return this.replace(a,"")}}();Ext.applyIf(Number.prototype,{constrain:function(b,a){return Math.min(Math.max(this,b),a)}});Ext.applyIf(Array.prototype,{indexOf:function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return -1},remove:function(b){var a=this.indexOf(b);if(a!=-1){this.splice(a,1)}return this}});Date.prototype.getElapsed=function(a){return Math.abs((a||new Date()).getTime()-this.getTime())};(function(){var b;Ext.lib.Dom={getViewWidth:function(e){return e?this.getDocumentWidth():this.getViewportWidth()},getViewHeight:function(e){return e?this.getDocumentHeight():this.getViewportHeight()},getDocumentHeight:function(){var e=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;return Math.max(e,this.getViewportHeight())},getDocumentWidth:function(){var e=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(e,this.getViewportWidth())},getViewportHeight:function(){if(Ext.isIE){return Ext.isStrict?document.documentElement.clientHeight:document.body.clientHeight}else{return self.innerHeight}},getViewportWidth:function(){if(Ext.isIE){return Ext.isStrict?document.documentElement.clientWidth:document.body.clientWidth}else{return self.innerWidth}},isAncestor:function(f,g){f=Ext.getDom(f);g=Ext.getDom(g);if(!f||!g){return false}if(f.contains&&!Ext.isSafari){return f.contains(g)}else{if(f.compareDocumentPosition){return !!(f.compareDocumentPosition(g)&16)}else{var e=g.parentNode;while(e){if(e==f){return true}else{if(!e.tagName||e.tagName.toUpperCase()=="HTML"){return false}}e=e.parentNode}return false}}},getRegion:function(e){return Ext.lib.Region.getRegion(e)},getY:function(e){return this.getXY(e)[1]},getX:function(e){return this.getXY(e)[0]},getXY:function(g){var f,k,m,n,j=(document.body||document.documentElement);g=Ext.getDom(g);if(g==j){return[0,0]}if(g.getBoundingClientRect){m=g.getBoundingClientRect();n=c(document).getScroll();return[m.left+n.left,m.top+n.top]}var o=0,l=0;f=g;var e=c(g).getStyle("position")=="absolute";while(f){o+=f.offsetLeft;l+=f.offsetTop;if(!e&&c(f).getStyle("position")=="absolute"){e=true}if(Ext.isGecko){k=c(f);var q=parseInt(k.getStyle("borderTopWidth"),10)||0;var h=parseInt(k.getStyle("borderLeftWidth"),10)||0;o+=h;l+=q;if(f!=g&&k.getStyle("overflow")!="visible"){o+=h;l+=q}}f=f.offsetParent}if(Ext.isSafari&&e){o-=j.offsetLeft;l-=j.offsetTop}if(Ext.isGecko&&!e){var i=c(j);o+=parseInt(i.getStyle("borderLeftWidth"),10)||0;l+=parseInt(i.getStyle("borderTopWidth"),10)||0}f=g.parentNode;while(f&&f!=j){if(!Ext.isOpera||(f.tagName!="TR"&&c(f).getStyle("display")!="inline")){o-=f.scrollLeft;l-=f.scrollTop}f=f.parentNode}return[o,l]},setXY:function(e,f){e=Ext.fly(e,"_setXY");e.position();var g=e.translatePoints(f);if(f[0]!==false){e.dom.style.left=g.left+"px"}if(f[1]!==false){e.dom.style.top=g.top+"px"}},setX:function(f,e){this.setXY(f,[e,false])},setY:function(e,f){this.setXY(e,[false,f])}};Ext.lib.Event=function(){var f=false;var g=[];var k=[];var i=0;var h=[];var e=0;var j=null;return{POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,_interval:null,startInterval:function(){if(!this._interval){var l=this;var m=function(){l._tryPreloadAttach()};this._interval=setInterval(m,this.POLL_INTERVAL)}},onAvailable:function(n,l,o,m){h.push({id:n,fn:l,obj:o,override:m,checkReady:false});i=this.POLL_RETRYS;this.startInterval()},addListener:function(q,m,p){q=Ext.getDom(q);if(!q||!p){return false}if("unload"==m){k[k.length]=[q,m,p];return true}var o=function(r){return typeof Ext!="undefined"?p(Ext.lib.Event.getEvent(r)):false};var l=[q,m,p,o];var n=g.length;g[n]=l;this.doAdd(q,m,o,false);return true},removeListener:function(s,o,r){var q,n;s=Ext.getDom(s);if(!r){return this.purgeElement(s,false,o)}if("unload"==o){for(q=0,n=k.length;q<n;q++){var m=k[q];if(m&&m[0]==s&&m[1]==o&&m[2]==r){k.splice(q,1);return true}}return false}var l=null;var p=arguments[3];if("undefined"==typeof p){p=this._getCacheIndex(s,o,r)}if(p>=0){l=g[p]}if(!s||!l){return false}this.doRemove(s,o,l[this.WFN],false);delete g[p][this.WFN];delete g[p][this.FN];g.splice(p,1);return true},getTarget:function(n,m){n=n.browserEvent||n;var l=n.target||n.srcElement;return this.resolveTextNode(l)},resolveTextNode:function(l){if(Ext.isSafari&&l&&3==l.nodeType){return l.parentNode}else{return l}},getPageX:function(m){m=m.browserEvent||m;var l=m.pageX;if(!l&&0!==l){l=m.clientX||0;if(Ext.isIE){l+=this.getScroll()[1]}}return l},getPageY:function(l){l=l.browserEvent||l;var m=l.pageY;if(!m&&0!==m){m=l.clientY||0;if(Ext.isIE){m+=this.getScroll()[0]}}return m},getXY:function(l){l=l.browserEvent||l;return[this.getPageX(l),this.getPageY(l)]},getRelatedTarget:function(m){m=m.browserEvent||m;var l=m.relatedTarget;if(!l){if(m.type=="mouseout"){l=m.toElement}else{if(m.type=="mouseover"){l=m.fromElement}}}return this.resolveTextNode(l)},getTime:function(n){n=n.browserEvent||n;if(!n.time){var m=new Date().getTime();try{n.time=m}catch(l){this.lastError=l;return m}}return n.time},stopEvent:function(l){this.stopPropagation(l);this.preventDefault(l)},stopPropagation:function(l){l=l.browserEvent||l;if(l.stopPropagation){l.stopPropagation()}else{l.cancelBubble=true}},preventDefault:function(l){l=l.browserEvent||l;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}},getEvent:function(m){var l=m||window.event;if(!l){var n=this.getEvent.caller;while(n){l=n.arguments[0];if(l&&Event==l.constructor){break}n=n.caller}}return l},getCharCode:function(l){l=l.browserEvent||l;return l.charCode||l.keyCode||0},_getCacheIndex:function(q,n,p){for(var o=0,m=g.length;o<m;++o){var l=g[o];if(l&&l[this.FN]==p&&l[this.EL]==q&&l[this.TYPE]==n){return o}}return -1},elCache:{},getEl:function(l){return document.getElementById(l)},clearCache:function(){},_load:function(m){f=true;var l=Ext.lib.Event;if(Ext.isIE){l.doRemove(window,"load",l._load)}},_tryPreloadAttach:function(){if(this.locked){return false}this.locked=true;var r=!f;if(!r){r=(i>0)}var q=[];for(var m=0,l=h.length;m<l;++m){var p=h[m];if(p){var o=this.getEl(p.id);if(o){if(!p.checkReady||f||o.nextSibling||(document&&document.body)){var n=o;if(p.override){if(p.override===true){n=p.obj}else{n=p.override}}p.fn.call(n,p.obj);h[m]=null}}else{q.push(p)}}}i=(q.length===0)?0:i-1;if(r){this.startInterval()}else{clearInterval(this._interval);this._interval=null}this.locked=false;return true},purgeElement:function(q,r,o){var s=this.getListeners(q,o);if(s){for(var p=0,m=s.length;p<m;++p){var n=s[p];this.removeListener(q,n.type,n.fn)}}if(r&&q&&q.childNodes){for(p=0,m=q.childNodes.length;p<m;++p){this.purgeElement(q.childNodes[p],r,o)}}},getListeners:function(n,s){var q=[],m;if(!s){m=[g,k]}else{if(s=="unload"){m=[k]}else{m=[g]}}for(var p=0;p<m.length;++p){var u=m[p];if(u&&u.length>0){for(var r=0,t=u.length;r<t;++r){var o=u[r];if(o&&o[this.EL]===n&&(!s||s===o[this.TYPE])){q.push({type:o[this.TYPE],fn:o[this.FN],obj:o[this.OBJ],adjust:o[this.ADJ_SCOPE],index:r})}}}}return(q.length)?q:null},_unload:function(t){var s=Ext.lib.Event,q,p,n,m,o;for(q=0,m=k.length;q<m;++q){n=k[q];if(n){var r=window;if(n[s.ADJ_SCOPE]){if(n[s.ADJ_SCOPE]===true){r=n[s.OBJ]}else{r=n[s.ADJ_SCOPE]}}n[s.FN].call(r,s.getEvent(t),n[s.OBJ]);k[q]=null;n=null;r=null}}k=null;if(g&&g.length>0){p=g.length;while(p){o=p-1;n=g[o];if(n){s.removeListener(n[s.EL],n[s.TYPE],n[s.FN],o)}p=p-1}n=null;s.clearCache()}s.doRemove(window,"unload",s._unload)},getScroll:function(){var l=document.documentElement,m=document.body;if(l&&(l.scrollTop||l.scrollLeft)){return[l.scrollTop,l.scrollLeft]}else{if(m){return[m.scrollTop,m.scrollLeft]}else{return[0,0]}}},doAdd:function(){if(window.addEventListener){return function(o,m,n,l){o.addEventListener(m,n,(l))}}else{if(window.attachEvent){return function(o,m,n,l){o.attachEvent("on"+m,n)}}else{return function(){}}}}(),doRemove:function(){if(window.removeEventListener){return function(o,m,n,l){o.removeEventListener(m,n,(l))}}else{if(window.detachEvent){return function(n,l,m){n.detachEvent("on"+l,m)}}else{return function(){}}}}()}}();var d=Ext.lib.Event;d.on=d.addListener;d.un=d.removeListener;if(document&&document.body){d._load()}else{d.doAdd(window,"load",d._load)}d.doAdd(window,"unload",d._unload);d._tryPreloadAttach();Ext.lib.Ajax={request:function(l,j,e,k,f){if(f){var g=f.headers;if(g){for(var i in g){if(g.hasOwnProperty(i)){this.initHeader(i,g[i],false)}}}if(f.xmlData){if(!g||!g["Content-Type"]){this.initHeader("Content-Type","text/xml",false)}l=(l?l:(f.method?f.method:"POST"));k=f.xmlData}else{if(f.jsonData){if(!g||!g["Content-Type"]){this.initHeader("Content-Type","application/json",false)}l=(l?l:(f.method?f.method:"POST"));k=typeof f.jsonData=="object"?Ext.encode(f.jsonData):f.jsonData}}}return this.asyncRequest(l,j,e,k)},serializeForm:function(f){if(typeof f=="string"){f=(document.getElementById(f)||document.forms[f])}var g,e,h,l,m="",o=false;for(var n=0;n<f.elements.length;n++){g=f.elements[n];l=f.elements[n].disabled;e=f.elements[n].name;h=f.elements[n].value;if(!l&&e){switch(g.type){case"select-one":case"select-multiple":for(var k=0;k<g.options.length;k++){if(g.options[k].selected){if(Ext.isIE){m+=encodeURIComponent(e)+"="+encodeURIComponent(g.options[k].attributes.value.specified?g.options[k].value:g.options[k].text)+"&"}else{m+=encodeURIComponent(e)+"="+encodeURIComponent(g.options[k].hasAttribute("value")?g.options[k].value:g.options[k].text)+"&"}}}break;case"radio":case"checkbox":if(g.checked){m+=encodeURIComponent(e)+"="+encodeURIComponent(h)+"&"}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(o==false){m+=encodeURIComponent(e)+"="+encodeURIComponent(h)+"&";o=true}break;default:m+=encodeURIComponent(e)+"="+encodeURIComponent(h)+"&";break}}}m=m.substr(0,m.length-1);return m},headers:{},hasHeaders:false,useDefaultHeader:true,defaultPostHeader:"application/x-www-form-urlencoded; charset=UTF-8",useDefaultXhrHeader:true,defaultXhrHeader:"XMLHttpRequest",hasDefaultHeaders:true,defaultHeaders:{},poll:{},timeout:{},pollInterval:50,transactionId:0,setProgId:function(e){this.activeX.unshift(e)},setDefaultPostHeader:function(e){this.useDefaultHeader=e},setDefaultXhrHeader:function(e){this.useDefaultXhrHeader=e},setPollingInterval:function(e){if(typeof e=="number"&&isFinite(e)){this.pollInterval=e}},createXhrObject:function(k){var j,f;try{f=new XMLHttpRequest();j={conn:f,tId:k}}catch(h){for(var g=0;g<this.activeX.length;++g){try{f=new ActiveXObject(this.activeX[g]);j={conn:f,tId:k};break}catch(h){}}}finally{return j}},getConnectionObject:function(){var g;var h=this.transactionId;try{g=this.createXhrObject(h);if(g){this.transactionId++}}catch(f){}finally{return g}},asyncRequest:function(i,f,h,e){var g=this.getConnectionObject();if(!g){return null}else{g.conn.open(i,f,true);if(this.useDefaultXhrHeader){if(!this.defaultHeaders["X-Requested-With"]){this.initHeader("X-Requested-With",this.defaultXhrHeader,true)}}if(e&&this.useDefaultHeader&&(!this.hasHeaders||!this.headers["Content-Type"])){this.initHeader("Content-Type",this.defaultPostHeader)}if(this.hasDefaultHeaders||this.hasHeaders){this.setHeader(g)}this.handleReadyState(g,h);g.conn.send(e||null);return g}},handleReadyState:function(f,g){var e=this;if(g&&g.timeout){this.timeout[f.tId]=window.setTimeout(function(){e.abort(f,g,true)},g.timeout)}this.poll[f.tId]=window.setInterval(function(){if(f.conn&&f.conn.readyState==4){window.clearInterval(e.poll[f.tId]);delete e.poll[f.tId];if(g&&g.timeout){window.clearTimeout(e.timeout[f.tId]);delete e.timeout[f.tId]}e.handleTransactionResponse(f,g)}},this.pollInterval)},handleTransactionResponse:function(j,k,f){if(!k){this.releaseObject(j);return}var h,g;try{if(j.conn.status!==undefined&&j.conn.status!=0){h=j.conn.status}else{h=13030}}catch(i){h=13030}if((h>=200&&h<300)||(Ext.isIE&&h==1223)){g=this.createResponseObject(j,k.argument);if(k.success){if(!k.scope){k.success(g)}else{k.success.apply(k.scope,[g])}}}else{switch(h){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:g=this.createExceptionObject(j.tId,k.argument,(f?f:false));if(k.failure){if(!k.scope){k.failure(g)}else{k.failure.apply(k.scope,[g])}}break;default:g=this.createResponseObject(j,k.argument);if(k.failure){if(!k.scope){k.failure(g)}else{k.failure.apply(k.scope,[g])}}}}this.releaseObject(j);g=null},createResponseObject:function(f,m){var j={};var p={};try{var h=f.conn.getAllResponseHeaders();var l=h.split("\n");for(var k=0;k<l.length;k++){var g=l[k].indexOf(":");if(g!=-1){p[l[k].substring(0,g)]=l[k].substring(g+2)}}}catch(n){}j.tId=f.tId;j.status=f.conn.status;j.statusText=f.conn.statusText;j.getResponseHeader=p;j.getAllResponseHeaders=h;j.responseText=f.conn.responseText;j.responseXML=f.conn.responseXML;if(typeof m!==undefined){j.argument=m}return j},createExceptionObject:function(l,h,e){var j=0;var k="communication failure";var g=-1;var f="transaction aborted";var i={};i.tId=l;if(e){i.status=g;i.statusText=f}else{i.status=j;i.statusText=k}if(h){i.argument=h}return i},initHeader:function(e,h,g){var f=(g)?this.defaultHeaders:this.headers;if(f[e]===undefined){f[e]=h}else{f[e]=h+","+f[e]}if(g){this.hasDefaultHeaders=true}else{this.hasHeaders=true}},setHeader:function(e){if(this.hasDefaultHeaders){for(var f in this.defaultHeaders){if(this.defaultHeaders.hasOwnProperty(f)){e.conn.setRequestHeader(f,this.defaultHeaders[f])}}}if(this.hasHeaders){for(var f in this.headers){if(this.headers.hasOwnProperty(f)){e.conn.setRequestHeader(f,this.headers[f])}}this.headers={};this.hasHeaders=false}},resetDefaultHeaders:function(){delete this.defaultHeaders;this.defaultHeaders={};this.hasDefaultHeaders=false},abort:function(f,g,e){if(this.isCallInProgress(f)){f.conn.abort();window.clearInterval(this.poll[f.tId]);delete this.poll[f.tId];if(e){delete this.timeout[f.tId]}this.handleTransactionResponse(f,g,true);return true}else{return false}},isCallInProgress:function(e){if(e.conn){return e.conn.readyState!=4&&e.conn.readyState!=0}else{return false}},releaseObject:function(e){e.conn=null;e=null},activeX:["MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"]};Ext.lib.Region=function(g,h,e,f){this.top=g;this[1]=g;this.right=h;this.bottom=e;this.left=f;this[0]=f};Ext.lib.Region.prototype={contains:function(e){return(e.left>=this.left&&e.right<=this.right&&e.top>=this.top&&e.bottom<=this.bottom)},getArea:function(){return((this.bottom-this.top)*(this.right-this.left))},intersect:function(i){var g=Math.max(this.top,i.top);var h=Math.min(this.right,i.right);var e=Math.min(this.bottom,i.bottom);var f=Math.max(this.left,i.left);if(e>=g&&h>=f){return new Ext.lib.Region(g,h,e,f)}else{return null}},union:function(i){var g=Math.min(this.top,i.top);var h=Math.max(this.right,i.right);var e=Math.max(this.bottom,i.bottom);var f=Math.min(this.left,i.left);return new Ext.lib.Region(g,h,e,f)},constrainTo:function(e){this.top=this.top.constrain(e.top,e.bottom);this.bottom=this.bottom.constrain(e.top,e.bottom);this.left=this.left.constrain(e.left,e.right);this.right=this.right.constrain(e.left,e.right);return this},adjust:function(g,f,e,h){this.top+=g;this.left+=f;this.right+=h;this.bottom+=e;return this}};Ext.lib.Region.getRegion=function(h){var j=Ext.lib.Dom.getXY(h);var g=j[1];var i=j[0]+h.offsetWidth;var e=j[1]+h.offsetHeight;var f=j[0];return new Ext.lib.Region(g,i,e,f)};Ext.lib.Point=function(e,f){if(Ext.isArray(e)){f=e[1];e=e[0]}this.x=this.right=this.left=this[0]=e;this.y=this.top=this.bottom=this[1]=f};Ext.lib.Point.prototype=new Ext.lib.Region();Ext.lib.Anim={scroll:function(h,f,i,j,e,g){return this.run(h,f,i,j,e,g,Ext.lib.Scroll)},motion:function(h,f,i,j,e,g){return this.run(h,f,i,j,e,g,Ext.lib.Motion)},color:function(h,f,i,j,e,g){return this.run(h,f,i,j,e,g,Ext.lib.ColorAnim)},run:function(i,f,k,l,e,h,g){g=g||Ext.lib.AnimBase;if(typeof l=="string"){l=Ext.lib.Easing[l]}var j=new g(i,f,k,l);j.animateX(function(){Ext.callback(e,h)});return j}};function c(e){if(!b){b=new Ext.Element.Flyweight()}b.dom=e;return b}if(Ext.isIE){function a(){var e=Function.prototype;delete e.createSequence;delete e.defer;delete e.createDelegate;delete e.createCallback;delete e.createInterceptor;window.detachEvent("onunload",a)}window.attachEvent("onunload",a)}Ext.lib.AnimBase=function(f,e,g,h){if(f){this.init(f,e,g,h)}};Ext.lib.AnimBase.prototype={toString:function(){var e=this.getEl();var f=e.id||e.tagName;return("Anim "+f)},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(e,g,f){return this.method(this.currentFrame,g,f-g,this.totalFrames)},setAttribute:function(e,g,f){if(this.patterns.noNegatives.test(e)){g=(g>0)?g:0}Ext.fly(this.getEl(),"_anim").setStyle(e,g+f)},getAttribute:function(e){var g=this.getEl();var i=c(g).getStyle(e);if(i!=="auto"&&!this.patterns.offsetUnit.test(i)){return parseFloat(i)}var f=this.patterns.offsetAttribute.exec(e)||[];var j=!!(f[3]);var h=!!(f[2]);if(h||(c(g).getStyle("position")=="absolute"&&j)){i=g["offset"+f[0].charAt(0).toUpperCase()+f[0].substr(1)]}else{i=0}return i},getDefaultUnit:function(e){if(this.patterns.defaultUnit.test(e)){return"px"}return""},animateX:function(h,e){var g=function(){this.onComplete.removeListener(g);if(typeof h=="function"){h.call(e||this,this)}};this.onComplete.addListener(g,this);this.animate()},setRuntimeAttribute:function(f){var l;var g;var h=this.attributes;this.runtimeAttributes[f]={};var k=function(i){return(typeof i!=="undefined")};if(!k(h[f]["to"])&&!k(h[f]["by"])){return false}l=(k(h[f]["from"]))?h[f]["from"]:this.getAttribute(f);if(k(h[f]["to"])){g=h[f]["to"]}else{if(k(h[f]["by"])){if(l.constructor==Array){g=[];for(var j=0,e=l.length;j<e;++j){g[j]=l[j]+h[f]["by"][j]}}else{g=l+h[f]["by"]}}}this.runtimeAttributes[f].start=l;this.runtimeAttributes[f].end=g;this.runtimeAttributes[f].unit=(k(h[f].unit))?h[f]["unit"]:this.getDefaultUnit(f)},init:function(g,l,k,e){var f=false;var h=null;var j=0;g=Ext.getDom(g);this.attributes=l||{};this.duration=k||1;this.method=e||Ext.lib.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=Ext.lib.AnimMgr.fps;this.getEl=function(){return g};this.isAnimated=function(){return f};this.getStartTime=function(){return h};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(Ext.lib.AnimMgr.fps*this.duration):this.duration;Ext.lib.AnimMgr.registerElement(this)};this.stop=function(o){if(o){this.currentFrame=this.totalFrames;this._onTween.fire()}Ext.lib.AnimMgr.stop(this)};var n=function(){this.onStart.fire();this.runtimeAttributes={};for(var o in this.attributes){this.setRuntimeAttribute(o)}f=true;j=0;h=new Date()};var m=function(){var q={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};q.toString=function(){return("duration: "+q.duration+", currentFrame: "+q.currentFrame)};this.onTween.fire(q);var p=this.runtimeAttributes;for(var o in p){this.setAttribute(o,this.doMethod(o,p[o].start,p[o].end),p[o].unit)}j+=1};var i=function(){var o=(new Date()-h)/1000;var p={duration:o,frames:j,fps:j/o};p.toString=function(){return("duration: "+p.duration+", frames: "+p.frames+", fps: "+p.fps)};f=false;j=0;this.onComplete.fire(p)};this._onStart=new Ext.util.Event(this);this.onStart=new Ext.util.Event(this);this.onTween=new Ext.util.Event(this);this._onTween=new Ext.util.Event(this);this.onComplete=new Ext.util.Event(this);this._onComplete=new Ext.util.Event(this);this._onStart.addListener(n);this._onTween.addListener(m);this._onComplete.addListener(i)}};Ext.lib.AnimMgr=new function(){var g=null;var f=[];var e=0;this.fps=1000;this.delay=1;this.registerElement=function(j){f[f.length]=j;e+=1;j._onStart.fire();this.start()};this.unRegister=function(k,j){k._onComplete.fire();j=j||i(k);if(j!=-1){f.splice(j,1)}e-=1;if(e<=0){this.stop()}};this.start=function(){if(g===null){g=setInterval(this.run,this.delay)}};this.stop=function(l){if(!l){clearInterval(g);for(var k=0,j=f.length;k<j;++k){if(f[0].isAnimated()){this.unRegister(f[0],0)}}f=[];g=null;e=0}else{this.unRegister(l)}};this.run=function(){for(var l=0,j=f.length;l<j;++l){var k=f[l];if(!k||!k.isAnimated()){continue}if(k.currentFrame<k.totalFrames||k.totalFrames===null){k.currentFrame+=1;if(k.useSeconds){h(k)}k._onTween.fire()}else{Ext.lib.AnimMgr.stop(k,l)}}};var i=function(l){for(var k=0,j=f.length;k<j;++k){if(f[k]==l){return k}}return -1};var h=function(k){var n=k.totalFrames;var m=k.currentFrame;var l=(k.currentFrame*k.duration*1000/k.totalFrames);var j=(new Date()-k.getStartTime());var o=0;if(j<k.duration*1000){o=Math.round((j/l-1)*k.currentFrame)}else{o=n-(m+1)}if(o>0&&isFinite(o)){if(k.currentFrame+o>=n){o=n-(m+1)}k.currentFrame+=o}}};Ext.lib.Bezier=new function(){this.getPosition=function(k,h){var l=k.length;var g=[];for(var f=0;f<l;++f){g[f]=[k[f][0],k[f][1]]}for(var e=1;e<l;++e){for(f=0;f<l-e;++f){g[f][0]=(1-h)*g[f][0]+h*g[parseInt(f+1,10)][0];g[f][1]=(1-h)*g[f][1]+h*g[parseInt(f+1,10)][1]}}return[g[0][0],g[0][1]]}};(function(){Ext.lib.ColorAnim=function(i,h,j,k){Ext.lib.ColorAnim.superclass.constructor.call(this,i,h,j,k)};Ext.extend(Ext.lib.ColorAnim,Ext.lib.AnimBase);var f=Ext.lib;var g=f.ColorAnim.superclass;var e=f.ColorAnim.prototype;e.toString=function(){var h=this.getEl();var i=h.id||h.tagName;return("ColorAnim "+i)};e.patterns.color=/color$/i;e.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;e.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;e.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;e.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;e.parseColor=function(h){if(h.length==3){return h}var i=this.patterns.hex.exec(h);if(i&&i.length==4){return[parseInt(i[1],16),parseInt(i[2],16),parseInt(i[3],16)]}i=this.patterns.rgb.exec(h);if(i&&i.length==4){return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10)]}i=this.patterns.hex3.exec(h);if(i&&i.length==4){return[parseInt(i[1]+i[1],16),parseInt(i[2]+i[2],16),parseInt(i[3]+i[3],16)]}return null};e.getAttribute=function(h){var j=this.getEl();if(this.patterns.color.test(h)){var k=c(j).getStyle(h);if(this.patterns.transparent.test(k)){var i=j.parentNode;k=c(i).getStyle(h);while(i&&this.patterns.transparent.test(k)){i=i.parentNode;k=c(i).getStyle(h);if(i.tagName.toUpperCase()=="HTML"){k="#fff"}}}}else{k=g.getAttribute.call(this,h)}return k};e.doMethod=function(j,n,k){var m;if(this.patterns.color.test(j)){m=[];for(var l=0,h=n.length;l<h;++l){m[l]=g.doMethod.call(this,j,n[l],k[l])}m="rgb("+Math.floor(m[0])+","+Math.floor(m[1])+","+Math.floor(m[2])+")"}else{m=g.doMethod.call(this,j,n,k)}return m};e.setRuntimeAttribute=function(j){g.setRuntimeAttribute.call(this,j);if(this.patterns.color.test(j)){var l=this.attributes;var n=this.parseColor(this.runtimeAttributes[j].start);var k=this.parseColor(this.runtimeAttributes[j].end);if(typeof l[j]["to"]==="undefined"&&typeof l[j]["by"]!=="undefined"){k=this.parseColor(l[j].by);for(var m=0,h=n.length;m<h;++m){k[m]=n[m]+k[m]}}this.runtimeAttributes[j].start=n;this.runtimeAttributes[j].end=k}}})();Ext.lib.Easing={easeNone:function(f,e,h,g){return h*f/g+e},easeIn:function(f,e,h,g){return h*(f/=g)*f+e},easeOut:function(f,e,h,g){return -h*(f/=g)*(f-2)+e},easeBoth:function(f,e,h,g){if((f/=g/2)<1){return h/2*f*f+e}return -h/2*((--f)*(f-2)-1)+e},easeInStrong:function(f,e,h,g){return h*(f/=g)*f*f*f+e},easeOutStrong:function(f,e,h,g){return -h*((f=f/g-1)*f*f*f-1)+e},easeBothStrong:function(f,e,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+e}return -h/2*((f-=2)*f*f*f-2)+e},elasticIn:function(g,e,k,j,f,i){if(g==0){return e}if((g/=j)==1){return e+k}if(!i){i=j*0.3}if(!f||f<Math.abs(k)){f=k;var h=i/4}else{var h=i/(2*Math.PI)*Math.asin(k/f)}return -(f*Math.pow(2,10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i))+e},elasticOut:function(g,e,k,j,f,i){if(g==0){return e}if((g/=j)==1){return e+k}if(!i){i=j*0.3}if(!f||f<Math.abs(k)){f=k;var h=i/4}else{var h=i/(2*Math.PI)*Math.asin(k/f)}return f*Math.pow(2,-10*g)*Math.sin((g*j-h)*(2*Math.PI)/i)+k+e},elasticBoth:function(g,e,k,j,f,i){if(g==0){return e}if((g/=j/2)==2){return e+k}if(!i){i=j*(0.3*1.5)}if(!f||f<Math.abs(k)){f=k;var h=i/4}else{var h=i/(2*Math.PI)*Math.asin(k/f)}if(g<1){return -0.5*(f*Math.pow(2,10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i))+e}return f*Math.pow(2,-10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i)*0.5+k+e},backIn:function(f,e,i,h,g){if(typeof g=="undefined"){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+e},backOut:function(f,e,i,h,g){if(typeof g=="undefined"){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+e},backBoth:function(f,e,i,h,g){if(typeof g=="undefined"){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+e}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+e},bounceIn:function(f,e,h,g){return h-Ext.lib.Easing.bounceOut(g-f,0,h,g)+e},bounceOut:function(f,e,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+e}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+e}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+e}}}return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+e},bounceBoth:function(f,e,h,g){if(f<g/2){return Ext.lib.Easing.bounceIn(f*2,0,h,g)*0.5+e}return Ext.lib.Easing.bounceOut(f*2-g,0,h,g)*0.5+h*0.5+e}};(function(){Ext.lib.Motion=function(k,j,l,m){if(k){Ext.lib.Motion.superclass.constructor.call(this,k,j,l,m)}};Ext.extend(Ext.lib.Motion,Ext.lib.ColorAnim);var h=Ext.lib;var i=h.Motion.superclass;var f=h.Motion.prototype;f.toString=function(){var j=this.getEl();var k=j.id||j.tagName;return("Motion "+k)};f.patterns.points=/^points$/i;f.setAttribute=function(j,l,k){if(this.patterns.points.test(j)){k=k||"px";i.setAttribute.call(this,"left",l[0],k);i.setAttribute.call(this,"top",l[1],k)}else{i.setAttribute.call(this,j,l,k)}};f.getAttribute=function(j){if(this.patterns.points.test(j)){var k=[i.getAttribute.call(this,"left"),i.getAttribute.call(this,"top")]}else{k=i.getAttribute.call(this,j)}return k};f.doMethod=function(j,n,k){var m=null;if(this.patterns.points.test(j)){var l=this.method(this.currentFrame,0,100,this.totalFrames)/100;m=h.Bezier.getPosition(this.runtimeAttributes[j],l)}else{m=i.doMethod.call(this,j,n,k)}return m};f.setRuntimeAttribute=function(s){if(this.patterns.points.test(s)){var k=this.getEl();var m=this.attributes;var j;var o=m.points["control"]||[];var l;var p,r;if(o.length>0&&!Ext.isArray(o[0])){o=[o]}else{var n=[];for(p=0,r=o.length;p<r;++p){n[p]=o[p]}o=n}Ext.fly(k,"_anim").position();if(g(m.points["from"])){Ext.lib.Dom.setXY(k,m.points["from"])}else{Ext.lib.Dom.setXY(k,Ext.lib.Dom.getXY(k))}j=this.getAttribute("points");if(g(m.points["to"])){l=e.call(this,m.points["to"],j);var q=Ext.lib.Dom.getXY(this.getEl());for(p=0,r=o.length;p<r;++p){o[p]=e.call(this,o[p],j)}}else{if(g(m.points["by"])){l=[j[0]+m.points["by"][0],j[1]+m.points["by"][1]];for(p=0,r=o.length;p<r;++p){o[p]=[j[0]+o[p][0],j[1]+o[p][1]]}}}this.runtimeAttributes[s]=[j];if(o.length>0){this.runtimeAttributes[s]=this.runtimeAttributes[s].concat(o)}this.runtimeAttributes[s][this.runtimeAttributes[s].length]=l}else{i.setRuntimeAttribute.call(this,s)}};var e=function(j,l){var k=Ext.lib.Dom.getXY(this.getEl());j=[j[0]-k[0]+l[0],j[1]-k[1]+l[1]];return j};var g=function(j){return(typeof j!=="undefined")}})();(function(){Ext.lib.Scroll=function(i,h,j,k){if(i){Ext.lib.Scroll.superclass.constructor.call(this,i,h,j,k)}};Ext.extend(Ext.lib.Scroll,Ext.lib.ColorAnim);var f=Ext.lib;var g=f.Scroll.superclass;var e=f.Scroll.prototype;e.toString=function(){var h=this.getEl();var i=h.id||h.tagName;return("Scroll "+i)};e.doMethod=function(h,k,i){var j=null;if(h=="scroll"){j=[this.method(this.currentFrame,k[0],i[0]-k[0],this.totalFrames),this.method(this.currentFrame,k[1],i[1]-k[1],this.totalFrames)]}else{j=g.doMethod.call(this,h,k,i)}return j};e.getAttribute=function(h){var j=null;var i=this.getEl();if(h=="scroll"){j=[i.scrollLeft,i.scrollTop]}else{j=g.getAttribute.call(this,h)}return j};e.setAttribute=function(h,k,j){var i=this.getEl();if(h=="scroll"){i.scrollLeft=k[0];i.scrollTop=k[1]}else{g.setAttribute.call(this,h,k,j)}}})()})();

//END ExtJS.ext.adapter.ext.ext-base.js
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
(function() {var fn = function() {$get('ctl09_HiddenField').value += ';IngrPL.WebClient.Core.Platform, Version=1.1.936.0, Culture=neutral, PublicKeyToken=4cb508dfbee734e0:en-US:2c45bee6-def8-464b-aec6-219d00b78ce9;AjaxControlToolkit, Version=3.0.20229.20843, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:en-US:3b7d1b28-161f-426a-ab77-b345f2c428f5;IngrPL.WebClient.Core.Controls, Version=1.1.936.0, Culture=neutral, PublicKeyToken=4cb508dfbee734e0:en-US:0ab51830-805a-46e4-9a8e-1f5473132f74;ExtJS35, Version=2.2.934.0, Culture=neutral, PublicKeyToken=4cb508dfbee734e0:en-US:f8efc885-8ca6-491a-a149-afea33f7c66b|:0:1fb1cc60:0:500a6ff9:0:815f1cb8:0:265079e7:0:cb0487d1:0:8c06596c:0:193df59e:0:74fcfdf6:0:cf1a962d:0:c0f00d94:0:68e19e61:0:742e4268:0:2a0355a9:0:b7be283:1:e2e86ef9:0:afa40ba1:0:e152b6c9:0:8b39657e:0:5bc6599e:0:404d4d4f:0:29a592a:0:4d3e912e:0:b9c8b669:0:e4fde04e:0:a8a1cdaa:0:41f94478:0:c0011113:0:59e21177:0:fd27e543:0:949eb9a5:0:52b0aeac:0:a14333bb:0:65662ce5:0:215a71d3:0:1fbc7732:0:bfdd9de8:0:e645568c:0:abc8ee82:0:7a90fc08:0:ae08a520:0:cf7d684:0:195fed66:0:ae291514:0:a47fe4f:0:82f8c813:0:a112d5d4:0:65bb21dc:0:4c136fe3:1:1df13a87:2:e56596d:3:a2aba139';Sys.Application.remove_load(fn);};Sys.Application.add_load(fn);})();
