var iwconst = {DEFAULT_MAPTYPE: 'bing_mapdispatcher',MAPTYPES:[{NAME:'airBing_mapdispatcher',TYPE:'IW_MAPDISPATCHER',MAXLEVEL:19,PREFERREDLEVEL:15,MINLEVEL:0,COPYRIGHT:'GeoContent',PROJECTIONTYPE:'1',TILESIZE_METER:[2.0037508352E7,1.0018754176E7,5009377.088,2504688.544,1252344.272,626172.136,313086.068,156543.034,78271.517,39135.7585,19567.87925,9783.939625,4891.9698125,2445.98490625,1222.992453125,611.4962265625,305.74811328125,152.874056640625,76.4370283203125,38.2185141601563,19.1092570800781],TILESSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://ecn.t0.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2','http://ecn.t1.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2','http://ecn.t2.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2','http://ecn.t3.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[9999],IMAGETYPE:'jpg',CACHEENABELD:false},LABELSSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5224],IMAGETYPE:'gif',CACHEENABELD:false}},{NAME:'hybrid_mapdispatcher',TYPE:'IW_MAPDISPATCHER',MAXLEVEL:19,PREFERREDLEVEL:15,MINLEVEL:0,COPYRIGHT:'GeoContent, Navteq',PROJECTIONTYPE:'1',TILESIZE_METER:[2.0037508352E7,1.0018754176E7,5009377.088,2504688.544,1252344.272,626172.136,313086.068,156543.034,78271.517,39135.7585,19567.87925,9783.939625,4891.9698125,2445.98490625,1222.992453125,611.4962265625,305.74811328125,152.874056640625,76.4370283203125,38.2185141601563,19.1092570800781],TILESSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://a0.md.mapandroute.de/mapdispatcher/10000-9999/msiwae/a','http://a1.md.mapandroute.de/mapdispatcher/10000-9999/msiwae/a','http://a2.md.mapandroute.de/mapdispatcher/10000-9999/msiwae/a','http://a3.md.mapandroute.de/mapdispatcher/10000-9999/msiwae/a'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[9999],IMAGETYPE:'gif',CACHEENABELD:false},LABELSSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5221],IMAGETYPE:'gif',CACHEENABELD:false}},{NAME:'dastelefonbuch',TYPE:'IW_MAPDISPATCHER',MAXLEVEL:18,PREFERREDLEVEL:15,MINLEVEL:4,COPYRIGHT:'',PROJECTIONTYPE:'1',TILESIZE_METER:[2.0037508352E7,1.0018754176E7,5009377.088,2504688.544,1252344.272,626172.136,313086.068,156543.034,78271.517,39135.7585,19567.87925,9783.939625,4891.9698125,2445.98490625,1222.992453125,611.4962265625,305.74811328125,152.874056640625,76.4370283203125,38.2185141601563,19.1092570800781],TILESSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://ecn.t0.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2','http://ecn.t1.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2','http://ecn.t2.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2','http://ecn.t3.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[9999],IMAGETYPE:'gif',CACHEENABELD:false},LABELSSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5224],IMAGETYPE:'gif',CACHEENABELD:false}},{NAME:'roadmap',TYPE:'IW',MAXLEVEL:20,PREFERREDLEVEL:15,MINLEVEL:0,COPYRIGHT:'Tele\u0020Atlas',PROJECTIONTYPE:'1',TILESIZE_METER:[2.0037508352E7,1.0018754176E7,5009377.088,2504688.544,1252344.272,626172.136,313086.068,156543.034,78271.517,39135.7585,19567.87925,9783.939625,4891.9698125,2445.98490625,1222.992453125,611.4962265625,305.74811328125,152.874056640625,76.4370283203125,38.2185141601563,19.1092570800781],TILESSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5251],IMAGETYPE:'gif',CACHEENABELD:false},LABELSSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5252],IMAGETYPE:'gif',CACHEENABELD:false}},{NAME:'virtualearth',TYPE:'VE',MAXLEVEL:18,PREFERREDLEVEL:3,MINLEVEL:0,COPYRIGHT:'Microsoft Virtual Earth',PROJECTIONTYPE:'1',TILESIZE_METER:[2.0037508352E7,1.0018754176E7,5009377.088,2504688.544,1252344.272,626172.136,313086.068,156543.034,78271.517,39135.7585,19567.87925,9783.939625,4891.9698125,2445.98490625,1222.992453125,611.4962265625,305.74811328125,152.874056640625,76.4370283203125,38.2185141601563,19.1092570800781],TILESSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://t0.tiles.virtualearth.net/','http://t1.tiles.virtualearth.net/','http://t2.tiles.virtualearth.net/','http://t3.tiles.virtualearth.net/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5415],IMAGETYPE:'png',CACHEENABELD:false}},{NAME:'air',TYPE:'IW',MAXLEVEL:19,PREFERREDLEVEL:15,MINLEVEL:0,COPYRIGHT:'GeoContent',PROJECTIONTYPE:'1',TILESIZE_METER:[2.0037508352E7,1.0018754176E7,5009377.088,2504688.544,1252344.272,626172.136,313086.068,156543.034,78271.517,39135.7585,19567.87925,9783.939625,4891.9698125,2445.98490625,1222.992453125,611.4962265625,305.74811328125,152.874056640625,76.4370283203125,38.2185141601563,19.1092570800781],TILESSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5513],IMAGETYPE:'jpg',CACHEENABELD:false},LABELSSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5224],IMAGETYPE:'gif',CACHEENABELD:false}},{NAME:'bing_mapdispatcher',TYPE:'IW_MAPDISPATCHER',MAXLEVEL:20,PREFERREDLEVEL:15,MINLEVEL:0,COPYRIGHT:'Tele\u0020Atlas',PROJECTIONTYPE:'1',TILESIZE_METER:[2.0037508352E7,1.0018754176E7,5009377.088,2504688.544,1252344.272,626172.136,313086.068,156543.034,78271.517,39135.7585,19567.87925,9783.939625,4891.9698125,2445.98490625,1222.992453125,611.4962265625,305.74811328125,152.874056640625,76.4370283203125,38.2185141601563,19.1092570800781],TILESSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://ecn.t0.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2','http://ecn.t1.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2','http://ecn.t2.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2','http://ecn.t3.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[9999],IMAGETYPE:'gif',CACHEENABELD:false},LABELSSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5224],IMAGETYPE:'gif',CACHEENABELD:false}},{NAME:'hybrid',TYPE:'IW',MAXLEVEL:19,PREFERREDLEVEL:15,MINLEVEL:0,COPYRIGHT:'GeoContent,\u0020Tele\u0020Atlas',PROJECTIONTYPE:'1',TILESIZE_METER:[2.0037508352E7,1.0018754176E7,5009377.088,2504688.544,1252344.272,626172.136,313086.068,156543.034,78271.517,39135.7585,19567.87925,9783.939625,4891.9698125,2445.98490625,1222.992453125,611.4962265625,305.74811328125,152.874056640625,76.4370283203125,38.2185141601563,19.1092570800781],TILESSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5860],IMAGETYPE:'jpg',CACHEENABELD:false},LABELSSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5710],IMAGETYPE:'gif',CACHEENABELD:false}},{NAME:'dastelefonbuch-hybrid',TYPE:'IW_MAPDISPATCHER',MAXLEVEL:18,PREFERREDLEVEL:15,MINLEVEL:4,COPYRIGHT:'',PROJECTIONTYPE:'1',TILESIZE_METER:[2.0037508352E7,1.0018754176E7,5009377.088,2504688.544,1252344.272,626172.136,313086.068,156543.034,78271.517,39135.7585,19567.87925,9783.939625,4891.9698125,2445.98490625,1222.992453125,611.4962265625,305.74811328125,152.874056640625,76.4370283203125,38.2185141601563,19.1092570800781],TILESSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://ecn.t0.tiles.virtualearth.net/tiles/h%1?g=304&mkt=de-de&token=%2','http://ecn.t1.tiles.virtualearth.net/tiles/h%1?g=304&mkt=de-de&token=%2','http://ecn.t2.tiles.virtualearth.net/tiles/h%1?g=304&mkt=de-de&token=%2','http://ecn.t3.tiles.virtualearth.net/tiles/h%1?g=304&mkt=de-de&token=%2'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[9999],IMAGETYPE:'gif',CACHEENABELD:false},LABELSSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5225],IMAGETYPE:'gif',CACHEENABELD:false}},{NAME:'birdsview',TYPE:'IW',MAXLEVEL:19,PREFERREDLEVEL:19,MINLEVEL:18,COPYRIGHT:'Blom\u0020ASA',PROJECTIONTYPE:'2',TILESIZE_METER:[2.0037508352E7,1.0018754176E7,5009377.088,2504688.544,1252344.272,626172.136,313086.068,156543.034,78271.517,39135.7585,19567.87925,9783.939625,4891.9698125,2445.98490625,1222.992453125,611.4962265625,305.74811328125,152.874056640625,76.4370283203125,38.2185141601563,19.1092570800781],TILESSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://picto.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5211],IMAGETYPE:'jpg',CACHEENABELD:false}},{NAME:'hybridBing_mapdispatcher',TYPE:'IW_MAPDISPATCHER',MAXLEVEL:19,PREFERREDLEVEL:15,MINLEVEL:0,COPYRIGHT:'',PROJECTIONTYPE:'1',TILESIZE_METER:[2.0037508352E7,1.0018754176E7,5009377.088,2504688.544,1252344.272,626172.136,313086.068,156543.034,78271.517,39135.7585,19567.87925,9783.939625,4891.9698125,2445.98490625,1222.992453125,611.4962265625,305.74811328125,152.874056640625,76.4370283203125,38.2185141601563,19.1092570800781],TILESSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://a0.md.mapandroute.de/mapdispatcher/10000-9999/msiwae/a','http://a1.md.mapandroute.de/mapdispatcher/10000-9999/msiwae/a','http://a2.md.mapandroute.de/mapdispatcher/10000-9999/msiwae/a','http://a3.md.mapandroute.de/mapdispatcher/10000-9999/msiwae/a'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[9999],IMAGETYPE:'gif',CACHEENABELD:false},LABELSSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5224],IMAGETYPE:'gif',CACHEENABELD:false}},{NAME:'dasoertliche',TYPE:'IW_MAPDISPATCHER',MAXLEVEL:18,PREFERREDLEVEL:15,MINLEVEL:4,COPYRIGHT:'',PROJECTIONTYPE:'1',TILESIZE_METER:[2.0037508352E7,1.0018754176E7,5009377.088,2504688.544,1252344.272,626172.136,313086.068,156543.034,78271.517,39135.7585,19567.87925,9783.939625,4891.9698125,2445.98490625,1222.992453125,611.4962265625,305.74811328125,152.874056640625,76.4370283203125,38.2185141601563,19.1092570800781],TILESSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://ecn.t0.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2','http://ecn.t1.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2','http://ecn.t2.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2','http://ecn.t3.tiles.virtualearth.net/tiles/r%1?g=304&mkt=de-de&token=%2'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[9999],IMAGETYPE:'gif',CACHEENABELD:false},LABELSSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5224],IMAGETYPE:'gif',CACHEENABELD:false}},{NAME:'air_mapdispatcher',TYPE:'IW_MAPDISPATCHER',MAXLEVEL:19,PREFERREDLEVEL:15,MINLEVEL:0,COPYRIGHT:'GeoContent',PROJECTIONTYPE:'1',TILESIZE_METER:[2.0037508352E7,1.0018754176E7,5009377.088,2504688.544,1252344.272,626172.136,313086.068,156543.034,78271.517,39135.7585,19567.87925,9783.939625,4891.9698125,2445.98490625,1222.992453125,611.4962265625,305.74811328125,152.874056640625,76.4370283203125,38.2185141601563,19.1092570800781],TILESSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://a0.md.mapandroute.de/mapdispatcher/10000-9999/msiwae/a','http://a1.md.mapandroute.de/mapdispatcher/10000-9999/msiwae/a','http://a2.md.mapandroute.de/mapdispatcher/10000-9999/msiwae/a','http://a3.md.mapandroute.de/mapdispatcher/10000-9999/msiwae/a'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[9999],IMAGETYPE:'jpg',CACHEENABELD:false},LABELSSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5224],IMAGETYPE:'gif',CACHEENABELD:false}},{NAME:'birdsviewarea',TYPE:'IW',MAXLEVEL:19,PREFERREDLEVEL:15,MINLEVEL:0,COPYRIGHT:'Blom\u0020ASA',PROJECTIONTYPE:'1',TILESIZE_METER:[2.0037508352E7,1.0018754176E7,5009377.088,2504688.544,1252344.272,626172.136,313086.068,156543.034,78271.517,39135.7585,19567.87925,9783.939625,4891.9698125,2445.98490625,1222.992453125,611.4962265625,305.74811328125,152.874056640625,76.4370283203125,38.2185141601563,19.1092570800781],TILESSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5253],IMAGETYPE:'gif',CACHEENABELD:false},LABELSSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5222],IMAGETYPE:'gif',CACHEENABELD:false}},{NAME:'roadmap_mapdispatcher',TYPE:'IW_MAPDISPATCHER',MAXLEVEL:20,PREFERREDLEVEL:15,MINLEVEL:0,COPYRIGHT:'Navteq',PROJECTIONTYPE:'1',TILESIZE_METER:[2.0037508352E7,1.0018754176E7,5009377.088,2504688.544,1252344.272,626172.136,313086.068,156543.034,78271.517,39135.7585,19567.87925,9783.939625,4891.9698125,2445.98490625,1222.992453125,611.4962265625,305.74811328125,152.874056640625,76.4370283203125,38.2185141601563,19.1092570800781],TILESSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://m0.md.mapandroute.de/mapdispatcher/10000-9999/msiwpr/r','http://m1.md.mapandroute.de/mapdispatcher/10000-9999/msiwpr/r','http://m2.md.mapandroute.de/mapdispatcher/10000-9999/msiwpr/r','http://m3.md.mapandroute.de/mapdispatcher/10000-9999/msiwpr/r'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[9999],IMAGETYPE:'gif',CACHEENABELD:false},LABELSSERVER:{BASE_DIR:'MapAPI-1.0',ALIAS: ['http://iw.mapandroute.de/'],URL:'localhost',PROJECTION:'LCC_EUROPE',PORTLIST:[5224],IMAGETYPE:'gif',CACHEENABELD:false}}],GEOCODERSERVER_PROXY_URL:'http://iw.mapandroute.de/MapAPI-1.0/XMLHttpRequestProxy',ROUTINGSERVER_PROXY_URL:'http://iw.mapandroute.de/MapAPI-1.0/XMLHttpRequestProxy',ROUTING_SERVER_PROJECTION:'MERCATOR',PROJECTIONSERVER_PROXY_URL:'http://iw.mapandroute.de/MapAPI-1.0/XMLHttpRequestProxy',SHAPESERVER_PROXY_URL:'http://iw.mapandroute.de/MapAPI-1.0/XMLHttpRequestProxy',WEBSERVER_PORT:'80',LOCAL_APP_URL:'http://localhost/MapAPI-1.0/',GLOBAL_APP_URL:'http://iw.mapandroute.de/MapAPI-1.0/',GLOBAL_PROXY_URL:'http://iw.mapandroute.de/MapAPI-1.0/XMLHttpRequestProxy',GLOBAL_GETMAPTYPES_URL:'http://picto.mapandroute.de/MapAPI-1.0/XMLHttpRequestProxy',CACHE_CLIENT_URL:'http://m1.mapandroute.com/cache/Mobile/',CACHE_GROUP_SIZE:'10',CACHE_GROUP_LEVEL:'4',CACHE_BLOCK_SIZE:'10',CACHE_URL_USE:'false',CACHE_MAPSERVER_GROUP:'',KEEPALIVE_INTERVAL:'120',A_TILESIZE_METER:[26214400, 13107200, 6553600, 3276800, 1638400, 819200, 409600, 204800, 102400, 51200, 25600, 12800, 6400, 3200, 1600, 800, 400, 200, 100, 50],SESSION_ID: '30A562E88696E9E0AECCF600F3D159BC', BMX_TOKEN: '', TILE_SIZE: 256};Function.prototype.iwclosure=function(c){if(!window.__objs){window.__objs=[]}if(!window.__funs){window.__funs=[]}var a=this;var b=c.__objId;if(!b){__objs[b=c.__objId=__objs.length]=c}var d=a.__funId;if(!d){__funs[d=a.__funId=__funs.length]=a}if(!c.__closures){c.__closures=[]}var f=c.__closures[d];if(f){return f}c=null;a=null;return __objs[b].__closures[d]=function(){return __funs[d].apply(__objs[b],arguments)}};var log4javascript;(function(){function d(){return function(){}}function i(k,j){for(var f in j){k[f]=j[f]}}var g=d();var c=d();i(c.prototype,{addAppender:g,removeAppender:g,removeAllAppenders:g,log:g,setLevel:g,getLevel:g,trace:g,debug:g,info:g,warn:g,error:g,fatal:g});var a=function(){return new c()};log4javascript={isStub:true,version:"dummy",logLog:{setQuietMode:g,setAlertAllErrors:g,debug:g,warn:g,error:g},addErrorListener:g,removeErrorListener:g,setEnabled:g,setShowStackTraces:g,isEnabled:g,evalInScope:g,getLogger:a,getDefaultLogger:a,getNullLogger:a,Level:d(),LoggingEvent:d(),Layout:d(),Appender:d()};log4javascript.LoggingEvent.prototype={getThrowableStrRep:g};log4javascript.Level.prototype={toString:g,equals:g,isGreaterOrEqual:g};var h=new log4javascript.Level();i(log4javascript.Level,{ALL:h,TRACE:h,DEBUG:h,INFO:h,WARN:h,ERROR:h,FATAL:h,OFF:h});log4javascript.Layout.prototype={defaults:{},format:g,ignoresThrowable:g,getContentType:g,allowBatching:g,getDataValues:g,setKeys:g,setCustomField:g,hasCustomFields:g};log4javascript.SimpleLayout=d();log4javascript.SimpleLayout.prototype=new log4javascript.Layout();log4javascript.XmlLayout=d();log4javascript.XmlLayout.prototype=new log4javascript.Layout();log4javascript.XmlLayout.prototype.escapeCdata=g;log4javascript.JsonLayout=d();log4javascript.JsonLayout.prototype=new log4javascript.Layout();i(log4javascript.JsonLayout.prototype,{setReadable:g,isReadable:g});log4javascript.HttpPostDataLayout=d();log4javascript.HttpPostDataLayout.prototype=new log4javascript.Layout();log4javascript.PatternLayout=d();log4javascript.PatternLayout.prototype=new log4javascript.Layout();log4javascript.NullLayout=d();log4javascript.NullLayout.prototype=new log4javascript.Layout();log4javascript.Appender=d();log4javascript.Appender.prototype={layout:new log4javascript.PatternLayout(),threshold:log4javascript.Level.ALL,doAppend:g,append:g,setLayout:g,getLayout:g,setThreshold:g,getThreshold:g,toString:g};log4javascript.AlertAppender=d();log4javascript.AlertAppender.prototype=new log4javascript.Appender();log4javascript.ArrayAppender=d();log4javascript.ArrayAppender.prototype=new log4javascript.Appender();log4javascript.AjaxAppender=d();log4javascript.AjaxAppender.prototype=new log4javascript.Appender();i(log4javascript.AjaxAppender.prototype,{isTimed:g,setTimed:g,getTimerInterval:g,setTimerInterval:g,isWaitForResponse:g,setWaitForResponse:g,getBatchSize:g,setBatchSize:g,setRequestSuccessCallback:g,setFailCallback:g,sendAll:g,defaults:{requestSuccessCallback:null,failCallback:null}});function b(){}b.prototype=new log4javascript.Appender();i(b.prototype,{create:g,isNewestMessageAtTop:g,setNewestMessageAtTop:g,isScrollToLatestMessage:g,setScrollToLatestMessage:g,getWidth:g,setWidth:g,getHeight:g,setHeight:g,getMaxMessages:g,setMaxMessages:g});log4javascript.InPageAppender=d();log4javascript.InPageAppender.prototype=new b();i(log4javascript.InPageAppender.prototype,{isInitiallyMinimized:g,setInitiallyMinimized:g,hide:g,show:g,isVisible:g,close:g,defaults:{layout:new log4javascript.PatternLayout(),maxMessages:null}});log4javascript.InlineAppender=log4javascript.InPageAppender;log4javascript.PopUpAppender=d();log4javascript.PopUpAppender.prototype=new b();i(log4javascript.PopUpAppender.prototype,{isUseOldPopUp:g,setUseOldPopUp:g,isComplainAboutPopUpBlocking:g,setComplainAboutPopUpBlocking:g,isFocusPopUp:g,setFocusPopUp:g,isReopenWhenClosed:g,setReopenWhenClosed:g,close:g,defaults:{layout:new log4javascript.PatternLayout(),maxMessages:null}});log4javascript.BrowserConsoleAppender=d();log4javascript.BrowserConsoleAppender.prototype=new log4javascript.Appender()})();var log4javascript_dummy=log4javascript;function IWXMLHttpRequest(){var o=this;var n=log4javascript.getLogger("IWXMLHttpRequest");var a="";var m="";var g=null;var c=null;var h=null;this.isActive=false;this.url=null;this.onreadystatechange=null;this.readyState=0;this.status=null;this.statusText=null;this.responseText=null;var i=function(){if(g){o.readyState=4;o.responseText=g.loadedText;o.status=g.statusCode;o.statusText=g.statusText;if(o.onreadystatechange!=null){o.onreadystatechange()}o.isActive=false}};this.open=function(s,r,q){this.readyState=1;if(q==false){throw"IWXMLHttpRequest: synchronious calls are not supported yet"}if(s!="GET"&&s!="POST"){throw"IWXMLHttpRequest: unsupported method. Use GET or POST."}h=s;this.url=r};this.send=function(q){if(this.url==null||this.readyState!=1){throw"IWXMLHttpRequest: Call open before send"}if(h=="GET"){k()}else{if(h=="POST"){f()}else{this.abort()}}};this.abort=function(){this.onreadystatechange=function(){};this.isActive=false;if(g){iw.remove(g);g=null}};function k(){if(!o.url.match(/^https?:\/\//)){o.url=iwconst.LOCAL_APP_URL+o.url}g=iw.create("script");iw.append(j,g);g.type="text/javascript";g.id=a;g.loadedText="";g.callback=i;if(o.url.indexOf("?")>-1){g.src=o.url+"&callerID="+g.id}else{if(o.url==iwconst.LOCAL_APP_URL){g.src=null}else{g.src=o.url+"?callerID="+g.id}}}function f(){try{g=iw.create('<iframe name="'+a+'">');g.attachEvent("onload",d)}catch(u){g=iw.create("iframe");g.name=a;g.onload=d}g.id=a;g.style.display="none";g.style.visibility="hidden";g.style.width="1px";g.style.height="1px";iw.append(j,g);o.url=unescape(o.url);var r=o.url.split("?");o.url=r[0]+";jsessionid="+iwconst.SESSION_ID;c=iw.create("form");iw.append(j,c);c.method="post";c.target=a;c.action=o.url;for(var s=1;s<r.length;s++){var q=r[s].split("&");for(var t=0;t<q.length;t++){var v=q[t].split("=");b(c,v[0],v[1])}}b(c,"callerID",a);c.submit()}function d(){if(!IWBrowser.isInternetExplorer()){g.src=""}iw.destroy(g);iw.destroy(c);c=null;g=null;h="GET";o.url+="?fetchPostResults=1";o.send(null)}function b(s,r,t){var q=iw.create("input");q.type="hidden";q.name=r;q.value=t;iw.append(s,q);return q}a="IWXMLHttpRequest_"+new Date().getTime()+"_"+iw.random(1,10000000);var j=iw.id("iw-ajax");if(!j){j=iw.create("div");iw.append(document.body,j);j.id="iw-ajax"}}function IWServerConfig(){var d=null;var a="";var g="";var c=null;var b=null;var f=0;var h=null;var i=false;this.setAliases=function(j){b=j};this.getAliases=function(){return b};this.getNextAlias=function(){var j=b[f];f=(f+1)%b.length;return j};this.setUrl=function(j){d=j};this.getUrl=function(){return d};this.setProjection=function(j){a=j};this.getProjection=function(){return a};this.setPortList=function(j){c=j};this.getPortList=function(){return c};this.setImageType=function(j){h=j};this.getImageType=function(){return h};this.setCacheEnabled=function(j){i=j};this.isCacheEnabled=function(){return i};this.setBaseDir=function(j){g=j};this.getBaseDir=function(){return g};this.toString=function(){return"[IWServerConfig]"}}var IWAlignment=new function(){this.CENTER=0;this.LEFT=1;this.RIGHT=2;this.TOP=4;this.BOTTOM=8};var IWButton=new function(){this.NONE=0;this.LEFT=1;this.RIGHT=2;this.MIDDLE=4};function IWAddressSearchControl(u){IWWindowControl.call(this,u,"IWAddressSearchControl");var o=this;var y=new IWGeocoderClient();var r=null;var i=false;var x=log4javascript.getLogger("IWAddressSearchControl");var q=null;var b=100;var v=0;var w=1;var d=2;var a=3;var h=4;var s=new IWLanguagePack();s.addLanguage(new IWLanguage("de",iwconst.LOCAL_APP_URL+"lang/IWAddressSearchControl.lang.de"));s.addLanguage(new IWLanguage("en",iwconst.LOCAL_APP_URL+"lang/IWAddressSearchControl.lang.en"));s.addLanguage(new IWLanguage("es",iwconst.LOCAL_APP_URL+"lang/IWAddressSearchControl.lang.es"));s.addLanguage(new IWLanguage("fr",iwconst.LOCAL_APP_URL+"lang/IWAddressSearchControl.lang.fr"));s.addLanguage(new IWLanguage("tr",iwconst.LOCAL_APP_URL+"lang/IWAddressSearchControl.lang.tr"));IWMultiLanguageSupport.call(this,u,s);function f(z,C){var B=iw.create("div");z.appendChild(B);B.id=C;B.name="address";iw.append(B,j("street","ADDRESS_STREET"));iw.append(B,j("housenumber","ADDRESS_HOUSE_NUMBER"));iw.append(B,j("zipcode","ADDRESS_ZIPCODE"));iw.append(B,j("city","ADDRESS_CITY"));var A=iw.create("select");A.className="country";A.options[0]=n("ANDORRA","AND");A.options[1]=n("BELGIUM","B");A.options[2]=n("DENMARK","DK");A.options[3]=n("GERMANY","D");A.options[4]=n("FINNLAND","FIN");A.options[5]=n("FRANCE","F");A.options[6]=n("GREECE","GR");A.options[7]=n("GREAT_BRITAIN","GB");A.options[8]=n("IRELAND","IRL");A.options[9]=n("ITALY","I");A.options[10]=n("LUXEMBOURG","L");A.options[11]=n("NETHERLANDS","NL");A.options[12]=n("AUSTRIA","A");A.options[13]=n("NORWAY","N");A.options[14]=n("POLAND","PL");A.options[15]=n("PORTUGAL","P");A.options[16]=n("SAN_MARINO","RSM");A.options[17]=n("SWEDEN","S");A.options[18]=n("SWITZERLAND","CH");A.options[19]=n("SLOVAKIA","SK");A.options[20]=n("SPAIN","E");A.options[21]=n("CZECH_REPUBLIC","CZ");A.options[22]=n("HUNGARY","H");g(A,"D");iw.append(B,A);return B}function n(B,z){var A=new Option(r.get(B),z);o.addLabelFor(new IWLabel(B,A,"text"));return A}function g(A,B){for(var z=0;z<A.options.length;z++){if(A.options[z].value==B){A.selectedIndex=z;return}}}function c(z){return z.options[z.selectedIndex].text}function j(A,B){var z=iw.create("input");z.name=A;z.className=A;z.value=r.get(B);z.onfocus=function(){if(z.value==r.get(B)){z.value=""}};z.onblur=function(){if(z.value==""){z.value=r.get(B)}};z.onkeypress=function(C){if(C.keyCode==13){t()}};o.addLabelFor(new IWLabel(B,z,"value"));return z}function m(E){var z=new IWAddress();var D=E.childNodes[v].value;if(D!=r.get("ADDRESS_STREET")){z.setStreet(D)}var C=E.childNodes[w].value;if(C!=r.get("ADDRESS_HOUSE_NUMBER")){z.setHouseNumber(C)}var A=E.childNodes[d].value;if(A!=r.get("ADDRESS_ZIPCODE")){z.setZipCode(A)}var B=E.childNodes[a].value;if(B!=r.get("ADDRESS_CITY")){z.setCity(B)}z.setCountry(c(E.childNodes[h]));z.setCountryCode(E.childNodes[h].value);return z}function k(z){var B=iw.create("div");iw.append(z,B);B.style.position="absolute";B.style.left="0px";B.style.height="140px";B.style.width="340px";B.style.top="0px";B.style.padding="5px";B.style.left="0px";B.style.overflowX="hidden";B.style.overflowY="auto";q=f(B,"addressFields");var A=iw.create("button");iw.append(B,A);A.className="searchButton";o.addLabelFor(new IWLabel("BUTTON_SEARCH",A,"innerHTML"));A.onclick=function(){t()}}function t(){var z=m(q);if((z.getZipCode()==null||z.getZipCode().length==0)&&(z.getCity()==null||z.getCity().length==0)){alert(r.get("ERROR_INPUT_ADDRESS"));return}o.searchAddress(z)}this.buildBody=function(z){IWEventManager.addListener(this,"onlanguagepackload",function(A){r=A.language;o.setTitle(r.get("ADDRESS_SEARCH"));if(i==false){k(z);i=true}});this.loadLanguagePack(u.getOptions().getLanguage())};this.searchAddressString=function(A,z){y.geocodeAddressString(A,z,b)};this.searchAddress=function(z){y.geocodeAddress(z,b)};this.triggerOnAddressFound=function(z){IWEventManager.trigger(this,"onaddressfound",z)};this.toString=function(){return"[IWAddressSearchControl]"};this.setId("IWAddressSearchControl");this.setSize(new IWSize(350,150));this.setRedrawable(false);this.close();IWEventManager.addListener(y,"ongeocode",function(z){o.triggerOnAddressFound(z)})}function IWBirdsViewControl(a){IWControl.call(this,a,"IWBirdsViewControl");var m=this;var b=m.getContainer();var i=iw.create("div");var f=iw.create("div");var c=iw.create("div");var j=iw.create("div");var k=new IWLanguagePack();k.addLanguage(new IWLanguage("de",iwconst.LOCAL_APP_URL+"lang/IWBirdsViewControl.lang.de"));k.addLanguage(new IWLanguage("en",iwconst.LOCAL_APP_URL+"lang/IWBirdsViewControl.lang.en"));k.addLanguage(new IWLanguage("es",iwconst.LOCAL_APP_URL+"lang/IWBirdsViewControl.lang.es"));k.addLanguage(new IWLanguage("tr",iwconst.LOCAL_APP_URL+"lang/IWBirdsViewControl.lang.tr"));k.addLanguage(new IWLanguage("fr",iwconst.LOCAL_APP_URL+"lang/IWBirdsViewControl.lang.fr"));k.addLanguage(new IWLanguage("it",iwconst.LOCAL_APP_URL+"lang/IWBirdsViewControl.lang.it"));IWMultiLanguageSupport.call(this,a,k);IWEventManager.addListener(this,"onlanguagepackload",function(n){i.title=n.language.get("NORTH");f.title=n.language.get("WEST");c.title=n.language.get("EAST");j.title=n.language.get("SOUTH")});this.afterAppend=function(){d();g()};this.toString=function(){return"[IWBirdsViewControl]"};function h(t){var s=a.getOptions().getMapTypeByName("birdsview");var r=s.getRequestParameters();var o=r.indexOf("&direction=");if(o>-1){var n="&direction=".length+1;var u=r.substr(0,o);var q=r.substr(o+n);r=u+q}switch(t){case IWBirdsViewControl.EAST:s.setRequestParameters(r+"&direction=E");b.style.backgroundPosition="0 0";break;case IWBirdsViewControl.WEST:s.setRequestParameters(r+"&direction=W");b.style.backgroundPosition="0 -330px";break;case IWBirdsViewControl.NORTH:s.setRequestParameters(r+"&direction=N");b.style.backgroundPosition="0 -110px";break;case IWBirdsViewControl.SOUTH:s.setRequestParameters(r+"&direction=S");b.style.backgroundPosition="0 -220px";break}a.setCenter(a.getCenter(),a.getZoom())}function g(){m.setVisible(a.getCurrentMapType().getName()=="birdsview")}function d(){b.id="IWBirdsViewControl";b.style.width="60px";b.style.height="60px";b.style.background="url("+iwconst.GLOBAL_APP_URL+"img/controls/birdsview/sprite-bv.png) no-repeat top left";b.style.backgroundPosition="0 -110px";iw.append(b,i);i.onclick=function(){h(IWBirdsViewControl.NORTH)};i.style.position="absolute";i.style.top="3px";i.style.left="20px";i.style.height="15px";i.style.width="18px";iw.append(b,j);j.onclick=function(){h(IWBirdsViewControl.SOUTH)};j.style.position="absolute";j.style.top="39px";j.style.left="20px";j.style.height="15px";j.style.width="18px";iw.append(b,c);c.onclick=function(){h(IWBirdsViewControl.EAST)};c.style.position="absolute";c.style.top="20px";c.style.right="3px";c.style.height="17px";c.style.width="16px";iw.append(b,f);f.onclick=function(){h(IWBirdsViewControl.WEST)};f.style.position="absolute";f.style.top="20px";f.style.left="3px";f.style.height="17px";f.style.width="16px"}IWEventManager.addListener(a,"onmaptypechange",g);this.loadLanguagePack(a.getOptions().getLanguage())}IWBirdsViewControl.NORTH=1;IWBirdsViewControl.WEST=2;IWBirdsViewControl.EAST=3;IWBirdsViewControl.SOUTH=4;function IWControl(g,c){IWMapElement.call(this,g.getControlContainer());this.isControl=function(){return true};this.isRedrawable=function(){return d};this.setRedrawable=function(h){d=h};this.getPadding=function(){return f};this.setPadding=function(h){f=h};this.setFirstOrientation=function(h){b=h};this.getFirstOrientation=function(){return b};this.setSecondOrientation=function(h){a=h};this.getSecondOrientation=function(){return a};this.getName=function(){return c};this.toString=function(){return"[IWControl] Name: "+c+", Padding: "+f+", Orientation: "+b+"/"+a+", Visible: "+this.isVisible()+", Draggable: "+this.isDraggable()+", Drag button: "+this.getDragButton()+", Drag container: "+this.getDraggableContainer()+", Allow dragging outside parent: "+this.isDraggingOutsideParentAllowed()+", Printable: "+this.isPrintable()+", Redrawable: "+this.isRedrawable()};var f=new IWSize(0,0);var b=IWAlignment.CENTER;var a=IWAlignment.CENTER;var d=true;IWDraggable.call(this,this.getContainer(),g.getZoomingAndDraggingContainer());this.setPrintable(false)}function IWCopyrightControl(g){IWControl.call(this,g,"IWCopyrightControl");var a=this.getContainer();var b=this;var d="";var c=log4javascript.getLogger("IWCopyrightControl");this.getCopyrightText=function(){return d};this.afterAppend=function(){h();f()};function h(){c.debug("Calling buildGUI.");b.setId("IWCopyrightControl");a.className="IWCopyrightControl";a.style.overflow="hidden";iw.backgroundImage(a,iwconst.GLOBAL_APP_URL+"img/symbols/background_white_transparency.png");var j=iw.create("div");iw.append(a,j);j.style.position="absolute";j.style.top="0px";j.style.left="2px";var i=iw.create("span");iw.append(j,i);i.style.whiteSpace="nowrap";i.innerHTML="&nbsp;"}function f(){var m=g.getCurrentMapType();if(m!=null){var n="&#169;&nbsp;"+new Date().getFullYear()+'&nbsp;<a href="http://www.mapandroute.de" target="_blank">Map and Route</a>,\u0020infoware,&nbsp;'+m.getCopyright();var i=g.getOptions().getApplicationCopyright();if(i!=null&&i.length>0){n=n+i}if(d!=n){d=n;var k=a.lastChild.firstChild;k.innerHTML=d;var j=0;if(a.style.width){j=parseInt(a.style.width)}a.style.width=k.offsetWidth+5+"px";a.style.height=k.offsetHeight+1+"px";a.style.left=(parseInt(a.style.left)+j-k.offsetWidth-5)+"px";g.getLayoutManager().redraw()}}}this.setPrintable(true);IWEventManager.addListener(g,"onmaptypechange",f);IWEventManager.addListener(g,"oncopyrightchange",f)}function IWLayerSelectinControl(a){IWControl.call(this,a,"IWLayerSelectionControl");var i=new Object();i.de=new Object();i.en=new Object();i.de["DISPLAYED"]="Dargestellte Statistik";i.de["NONE"]="Statistik ausblenden";i.de["LEGEND"]="Legende";i.de["QUERY_MODE"]="Abfragemodus";i.de["POPULATION"]="Einwohnerzahl";i.en["DISPLAYED"]="Displayed statistic";i.en["NONE"]="No statistic";i.en["LEGEND"]="Legend";i.en["QUERY_MODE"]="Query mode";i.en["POPULATION"]="Population";var s=a.getOptions().getLanguage();if(!i[s]){s="en"}var n=this;var f=a;var g=this.getContainer();var t=new Array(4);var k=null;var m=null;var j=["#ffff00","#ffdf00","#ffbf00","#ff9f00","#ff8000","#ff6000","#ff3900","#ff0000"];g.id="layerSelectionDiv";function h(){var y=document.createElement("form");y.id="formLayerSelection";g.appendChild(y);var L=document.createElement("h1");L.appendChild(document.createTextNode(i[s]["DISPLAYED"]));y.appendChild(L);var A=document.createElement("div");A.className="category";var R=document.createElement("span");R.className="header";R.appendChild(document.createTextNode(i[s]["POPULATION"]));A.appendChild(R);A.appendChild(document.createElement("br"));for(var M=0;M<6;M++){var F=d();F.value=t[M].getName();var C=new q(F);IWEventManager.addDomListener(F,"onclick",C);var I=document.createElement("div");I.className="subcategory";I.appendChild(F);I.appendChild(document.createTextNode(t[M].getName()));A.appendChild(I)}y.appendChild(A);for(var M=6;M<t.length;M++){var K=document.createElement("div");K.className="category";var E=document.createElement("div");E.className="radio";var F=d();E.appendChild(F);F.value=t[M].getName();var C=new q(F);IWEventManager.addDomListener(F,"onclick",C);var R=document.createElement("div");R.className="header";R.appendChild(document.createTextNode(t[M].getName()));K.appendChild(E);K.appendChild(R);y.appendChild(K)}var O=document.createElement("div");O.className="category";var x=document.createElement("div");x.className="radio";var F=d();F.value="Karte ausblenden";F.selected="selected";x.appendChild(F);var R=document.createElement("div");R.className="header";R.appendChild(document.createTextNode(i[s]["NONE"]));O.appendChild(x);O.appendChild(R);y.appendChild(O);var C=new q(F);IWEventManager.addDomListener(F,"onclick",C);var H=document.createElement("div");y.appendChild(H);H.id="divShowStatistic";H.style.display="none";H.appendChild(document.createElement("br"));var G=document.createElement("h1");H.appendChild(G);G.appendChild(document.createTextNode(i[s]["LEGEND"]));var Q=document.createElement("div");Q.className="category";H.appendChild(Q);var N=document.createElement("table");Q.appendChild(N);N.id="tableLegend";N.style.padding="5px;";var u=document.createElement("tbody");N.appendChild(u);for(var M=0;M<j.length;M++){var w=document.createElement("tr");u.appendChild(w);var B=document.createElement("td");w.appendChild(B);var J=document.createElement("div");B.appendChild(J);J.style.width="25px";J.style.height="16px";J.style.border="1px solid black";J.style.backgroundColor=j[M];var z=document.createElement("td");w.appendChild(z);z.appendChild(document.createTextNode(""))}var F;try{F=document.createElement('<input name="queryPoint" type="checkbox">')}catch(D){F=document.createElement("input");F.name="queryPoint";F.type="checkbox"}H.appendChild(F);var v=document.createElement("div");v.className="category";var P=document.createElement("div");P.className="radio";P.appendChild(F);var R=document.createElement("div");R.className="header";R.appendChild(document.createTextNode(i[s]["QUERY_MODE"]));v.appendChild(P);v.appendChild(R);H.appendChild(v);IWEventManager.addDomListener(F,"onclick",function(S){if(!S){S=window.event}var T=S.target;if(!T){T=S.srcElement}if(T.nodeType==3){T=T.parentNode}if(T.checked){m=IWEventManager.addListener(f,"onclick",function(U){b(U.position,k.getLayer(),k.getShape())}.iwclosure(this))}else{IWEventManager.removeListener(m)}})}function q(v){var u=v;return function(){k=null;for(var w=0;w<t.length;w++){if(t[w].getName()==u.value){k=t[w]}r("layer"+t[w].getLayer())}c(k);if(k!=null){szExtraUrlParm+="&layer"+k.getLayer()+"="+k.getShape()}f.setCenter(f.getCenter())}}function c(y){var A=document.getElementById("divShowStatistic");if(y==null){A.style.display="none"}else{A.style.display="block";var z=document.getElementById("tableLegend");var u=y.getLegend().split(";");for(var x=0;x<z.firstChild.childNodes.length;x++){var v=z.firstChild.childNodes[x].lastChild;var w=document.createTextNode(u[x]+" - "+u[x+1]);v.replaceChild(w,v.firstChild)}}IWEventManager.trigger(n,"onredraw",null)}function b(u,y,w){var A=f.fromPixelToCoordinate(u);var v=new IWXMLHttpRequest();if(v==null){alert("Browser does not support HTTP Request");return}var z=iwconst.LOCAL_APP_URL+"servlet/FrontController?cmd=getLocationStatistics&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&app=ms&layer="+y+"&shape="+w+"&x="+A.getX()+"&y="+A.getY();try{v.open("GET",z,true);v.onreadystatechange=function(){if(v.readyState==4){if(v.status==200){var N=IWXMLHelper.parse(v.responseText);var H=N.getElementsByTagName("G_NAME")[0].firstChild.nodeValue;var Q=N.getElementsByTagName("KGS22")[0].firstChild.nodeValue;var F=N.getElementsByTagName("EW")[0].firstChild.nodeValue;var L=parseFloat(N.getElementsByTagName("EWp0014")[0].firstChild.nodeValue).toFixed(1);var B=parseFloat(N.getElementsByTagName("EWp1524")[0].firstChild.nodeValue).toFixed(1);var P=parseFloat(N.getElementsByTagName("EWp2549")[0].firstChild.nodeValue).toFixed(1);var J=parseFloat(N.getElementsByTagName("EWp5064")[0].firstChild.nodeValue).toFixed(1);var O=parseFloat(N.getElementsByTagName("EWp65")[0].firstChild.nodeValue).toFixed(1);var I=new IWCoordinate(A.getX().toFixed(0),A.getY().toFixed(0));var K="Koordinate:&nbsp;"+I.toString()+"<br>Ort:&nbsp;"+H+"<br>KGS22:&nbsp;"+Q+"<br><br>Einwohner:&nbsp;"+F+"<br>Anteil 0 bis 14:&nbsp;"+L+"%<br>Anteil 15 bis 24:&nbsp;"+B+"%<br>Anteil 25 bis 49:&nbsp;"+P+"%<br>Anteil 50 bis 64:&nbsp;"+J+"%<br>Anteil \u00FCber 65:&nbsp;"+O+"%";var M=globalPOIList.getPOIList();for(var G=0;G<M.length;G++){var E=M[G];var D=document.getElementById("divPopup_"+E);if(D!=null){D.parentNode.removeChild(D)}}globalPOIList.clear();globalPOIList.addPOI("1_Window");var C=new Sprechblase_Schatten();C.activateMapSlide=true;C.setContent(new StatisticsContent(A,K));C.show(u.getX(),u.getY())}else{if(v.status==401){alert(v.statusText)}else{alert("Unable to query data from server")}}}}.iwclosure(this);v.send(null)}catch(x){alert("Exception: "+x)}}function r(w){var v=szExtraUrlParm.indexOf("&"+w);if(v>-1){var u=szExtraUrlParm.indexOf("&",v+1);if(u>-1){szExtraUrlParm=szExtraUrlParm.substring(0,v)+szExtraUrlParm.substring(u)}else{szExtraUrlParm=szExtraUrlParm.substring(0,v)}}}function o(w){alert(w.language);if(i[w.language]){s=w.language;var x=document.getElementById("headerDisplayedStatistics").firstChild;x.data=i[s]["DISPLAYED"];var v=document.getElementById("formLayerSelection").children[1];v.data=i[s]["NONE"];var u=document.getElementById("headerLegend").firstChild;u.data=i[s]["LEGEND"]}}function d(){var u;try{u=document.createElement('<input name="layer" type="radio">')}catch(v){u=document.createElement("input");u.name="layer";u.type="radio"}return u}t[0]=new IWStatisticLayer("insgesamt","EW","wq06gk300_lcc_europe","0;347;637;921;1182;1465;1839;2429;3767");t[1]=new IWStatisticLayer("0- bis 14-j\u00E4hrig","EWp0014","wq06gk300_lcc_europe","0%;4,3%;9,8%;12,4%;14,8%;17,4%;20,4%;25,5%;45,6%");t[2]=new IWStatisticLayer("15- bis 24-j\u00E4hrig","EWp1524","wq06gk300_lcc_europe","0,0%;4,0%;8,3%;9,6%;10,7%;11,8%;13,2%;15,3%;60,0%");t[3]=new IWStatisticLayer("25- bis 49-j\u00E4hrig","EWp2549","wq06gk300_lcc_europe","0,0%;14,4%;28,6%;32,6%;35,6%;38,5%;42,2%;47,3%;72,4%");t[4]=new IWStatisticLayer("50- bis 64-j\u00E4hrig","EWp5064","wq06gk300_lcc_europe","0,0%;13,2%;15,4%;17,1%;18,5%;19,9%;21,6%;24,0%;40,0%");t[5]=new IWStatisticLayer("\u00DCber 65-j\u00E4hrig","EWp65","wq06gk300_lcc_europe","0,0%;6.7%;14,4%;17,3%;19,9%;22,6%;25,9%;31,4%;57,3%");t[6]=new IWStatisticLayer("Kaufkraft pro Einwohner in Euro","KK_EW","wq06gk300_lcc_europe","0;14859;16294;17554;18980;20667;23059;27296;55025");t[7]=new IWStatisticLayer("Firmen pro km²","FZ_QKM","wq06gk300_lcc_europe","0;1,5;3,1;7,0;17,6;47,0;106,2;248,5;4711,8");h();IWEventManager.trigger(n,"onredraw",null);IWEventManager.addListener(f,"onlanguagechange",o)}function IWStatisticLayer(c,d,b,f){var a=c;var i=d;var g=b;var h=f;this.getName=function(){return a};this.getLayer=function(){return i};this.getShape=function(){return g};this.getLegend=function(){return h};this.toString=function(){return"IWStatisticLayer: "+c}}function IWMeasuringControl(b){IWControl.call(this,b,"IWMeasuringControl");var o=this;var c=false;var m=null;var a=iw.create("div");var g=iw.create("img");var d=iw.create("div");var j=new IWMouseAdapter();var k=new IWGraphics(d);var h=new IWMeasuringInfoWindowControl(b,this);var n=log4javascript.getLogger("IWMeasuringControl");this.afterAppend=function(){f(this.getContainer())};this.activate=function(){a.style.display="block";if(!h.isVisible()){h.open()}};this.deactivate=function(){a.style.display="none";if(h.isVisible()){h.close()}};this.getRenderer=function(){return k};this.getInfoWindow=function(){return h};this.reset=function(){n.info("Calling reset");var r=m;while(r!=null){var q=r;r=r.getPreviousSegment();q.destroy();q=null}r=null;m=null;o.triggerOnDistanceChange()};this.setLastPoint=function(q){m=q};this.addPoint=function(r){n.info("Calling addPoint with coordinate x:"+r.getX()+", y:"+r.getY());var q=new IWMeasuringPoint(b,o,r);q.setPreviousSegment(m);if(m!=null){m.setNextSegment(q)}n.error("AAAAAAAAAAAAAAAAAAAAAA");n.error("newPoint.getDistance() "+q.getDistance());n.error("BBBBBBBBBBBBBBBBBBBBBB");n.error("---------> lastPoint = newPoint <------------");m=q;n.error("AAAAAAAAAAAAAAAAAAAAAA");n.error("lastPoint.getDistance() "+m.getDistance());n.error("BBBBBBBBBBBBBBBBBBBBBB");o.triggerOnDistanceChange()};this.triggerOnDistanceChange=function(){n.error("Calling triggerOnDistanceChange");var q=new IWMeasuringEvent();n.error("xxx lastPoint = "+m);if(m!=null){n.error("xxx lastPoint.getDistance() = "+m.getDistance());q.distance=parseFloat(m.getDistance())}IWEventManager.trigger(this,"ondistancechange",q)};this.toString=function(){return"[IWMeasuringControl]"};function f(q){o.setId("IWMeasuringControl");q.style.width="0px";q.style.height="0px";h.getContainer().style.position="absolute";h.getContainer().style.left="20px";h.getContainer().style.top="20px";h.getContainer().style.zIndex="150";var r=o.getParent();r.appendChild(h.getContainer());a.id="measuringDiv";a.style.position="absolute";a.style.top="0px";a.style.left="0px";a.style.display="none";r.insertBefore(a,r.lastChild.nextSibling);g.id="captureImg";g.src=iwconst.GLOBAL_APP_URL+"img/symbols/blank.gif";g.style.position="absolute";g.style.top="0px";g.style.left="0px";g.style.cursor="crosshair";a.appendChild(g);d.id="drawDiv";d.style.position="absolute";d.style.top="0px";d.style.left="0px";d.style.cursor="crosshair";a.appendChild(d);i(b.getOptions().getSize())}function i(r){var s=r.getWidth();var q=r.getHeight();a.style.width=s+"px";a.style.height=q+"px";g.style.width=s+"px";g.style.height=q+"px";d.style.width=s+"px";d.style.height=q+"px"}IWEventManager.addListener(b,"onresize",function(q){i(q.newSize)});IWEventManager.addDomListener(a,"onmousedown",function(q){iw.noPropagation(q)});IWEventManager.addDomListener(a,"onmouseup",function(q){iw.noPropagation(q)});IWEventManager.addDomListener(a,"ondblclick",function(q){iw.noPropagation(q)});IWEventManager.addDomListener(a,"onclick",function(q){iw.noPropagation(q);var r=j.toMouseEvent(q,a);var s=b.getCurrentMapType().getProjection().pixelToMeter(r.position);o.addPoint(s)});IWEventManager.addListener(h,"onreset",this.reset);IWEventManager.addListener(h,"oncloseend",this.deactivate)}function IWMeasuringPoint(I,s,F){var v=this;var i=0;var G=null;var z=null;var y=null;var H=null;var D=null;var K=null;var t=null;var w=null;var b=null;var o=null;var u=null;var q=false;var C=new IWMouseAdapter();var x=s.getRenderer();var B=x.getContainer();var J=log4javascript.getLogger("IWMeasuringPoint");var a="#0033FF";var g="#660000";var E="#FFFFFF";this.getPosition=function(){return I.getCurrentMapType().getProjection().meterToPixel(F)};this.getPreviousSegment=function(){return G};this.setPreviousSegment=function(M){var L=G;G=M;if((L!=null&&G==null)||(L==null&&G!=null)){c()}if(G!=null){if(o==null){A()}x.move(o,G.getPosition(),v.getPosition())}else{if(o!=null){h()}}v.calculateDistance()};this.setNextSegment=function(M){var L=z;z=M;if((L!=null&&z==null)||(L==null&&z!=null)){c()}if(z==null){s.setLastPoint(this);v.calculateDistance()}};this.moveTailOfLine=function(L){if(o!=null){x.move(o,L,v.getPosition())}};this.destroy=function(){IWEventManager.clearInstanceListeners(v);k();h();y=null;G=null;z=null};this.getDistance=function(){return i};this.getCoordinate=function(){return F};this.calculateDistance=function(){if(G==null){i=0}else{i=G.getDistance()+G.getCoordinate().distanceFrom(F)}if(z!=null){z.calculateDistance()}else{s.triggerOnDistanceChange()}};this.toString=function(){return"[IWMeasuringPoint]"};function A(){o=x.drawLine(G.getPosition(),v.getPosition(),4,a);o.style.opacity="0.75";o.style.filter="alpha(opacity=75)";o.style.cursor="pointer";x.moveToBottom(o);lineOnMouseClickListener=IWEventManager.addDomListener(o,"onclick",function(L){iw.noPropagation(L);var M=C.toMouseEvent(L,B);n(M.position)})}function h(){if(o!=null){IWEventManager.removeListener(u);x.removeElement(o);o=null}}function c(){k();if(G==null){y=x.drawEllipse(v.getPosition(),new IWSize(8,8),1,a,g)}else{if(z==null){y=x.drawEllipse(v.getPosition(),new IWSize(8,8),1,a,E)}else{y=x.drawEllipse(v.getPosition(),new IWSize(6,6),1,a,a)}}y.style.cursor="pointer";H=IWEventManager.addDomListener(y,"onmousedown",function(L){iw.noPropagation(L);var M=C.toMouseEvent(L,B);if(M.button==IWButton.RIGHT){if(q){m()}j()}else{if(q){m()}else{y.style.cursor="move";d()}}});b=IWEventManager.addDomListener(y,"onclick",function(L){iw.noPropagation(L);m()});if(G!=null&&z!=null){t=IWEventManager.addDomListener(y,"onmouseover",function(M){if(!q){var L=new IWDistanceFormatter(v.getDistance());I.openTooltip(F,L.getDistance()+"&nbsp;"+L.getUnit())}});w=IWEventManager.addDomListener(y,"onmouseout",function(L){I.removeTooltip()})}}function k(){if(y!=null){x.removeElement(y)}IWEventManager.removeListener(H);IWEventManager.removeListener(D);IWEventManager.removeListener(K);IWEventManager.removeListener(t);IWEventManager.removeListener(w);IWEventManager.removeListener(b);H=null;D=null;K=null;t=null;w=null;b=null}function n(L){var N=I.getCurrentMapType().getProjection().pixelToMeter(L);var M=new IWMeasuringPoint(I,s,N);M.setPreviousSegment(G);M.setNextSegment(v);G.setNextSegment(M);v.setPreviousSegment(M)}function j(){I.removeTooltip();if(G!=null){G.setNextSegment(z)}if(z!=null){z.setPreviousSegment(G)}if(z==null){if(G==null){s.setLastPoint(null)}else{s.setLastPoint(G);G.calculateDistance()}}v.destroy()}function d(){D=IWEventManager.addDomListener(document,"onmousemove",function(L){iw.noPropagation(L);I.removeTooltip();var M=C.toMouseEvent(L,B);x.moveToTop(y);x.move(y,M.position);if(G!=null){x.move(o,G.getPosition(),M.position)}if(z!=null){z.moveTailOfLine(M.position)}F=I.getCurrentMapType().getProjection().pixelToMeter(M.position);v.calculateDistance();q=true});K=IWEventManager.addDomListener(y,"onmouseup",function(L){iw.noPropagation(L);if(q){m()}})}function m(){y.style.cursor="pointer";IWEventManager.removeListener(K);IWEventManager.removeListener(D);K=null;D=null;F=I.getCurrentMapType().getProjection().pixelToMeter(x.getPosition(y));x.move(y,v.getPosition());v.calculateDistance();q=false}function f(L){y.style.visibility="hidden";y.style.display="none";if(o!=null){o.style.visibility="hidden";o.style.display="none"}}function r(){x.move(y,v.getPosition());if(o!=null&&G!=null){x.move(o,G.getPosition(),v.getPosition());o.style.visibility="visible";o.style.display=""}y.style.visibility="visible";y.style.display=""}c();IWEventManager.addDomListener(I,"onzoomstart",f);IWEventManager.addDomListener(I,"onzoomend",r);IWEventManager.addDomListener(I,"onmovestart",f);IWEventManager.addDomListener(I,"onmoveend",r);IWEventManager.addDomListener(I,"oncenter",r);IWEventManager.addDomListener(I,"onmaptypechange",r);IWEventManager.addDomListener(I,"onresize",r)}function IWMeasuringInfoWindowControl(h,g){IWWindowControl.call(this,h,"",new IWSize(150,70));var b=this;var f=iw.create("div");var a=false;var c=log4javascript.getLogger("IWMeasuringInfoWindowControl");var d=new IWLanguagePack();d.addLanguage(new IWLanguage("de",iwconst.LOCAL_APP_URL+"lang/IWMeasuringControl.lang.de"));d.addLanguage(new IWLanguage("en",iwconst.LOCAL_APP_URL+"lang/IWMeasuringControl.lang.en"));d.addLanguage(new IWLanguage("es",iwconst.LOCAL_APP_URL+"lang/IWMeasuringControl.lang.es"));d.addLanguage(new IWLanguage("it",iwconst.LOCAL_APP_URL+"lang/IWMeasuringControl.lang.it"));d.addLanguage(new IWLanguage("fr",iwconst.LOCAL_APP_URL+"lang/IWMeasuringControl.lang.fr"));d.addLanguage(new IWLanguage("tr",iwconst.LOCAL_APP_URL+"lang/IWMeasuringControl.lang.tr"));IWMultiLanguageSupport.call(this,h,d);this.buildBody=function(j){c.info("Calling buildBody");IWEventManager.addListener(this,"onlanguagepackload",function(k){b.setTitle(k.language.get("TITLE"));if(a==false){i(j);a=true}});this.loadLanguagePack(h.getOptions().getLanguage())};this.setDistance=function(k){var j=new IWDistanceFormatter(k);f.innerHTML='<span style="font-size:30px; font-weight:bold;">'+j.getDistance()+'</span>&nbsp;<span style="font-size:16px; font-weight:bold;">'+j.getUnit()+"</span><br><br>"};this.toString=function(){return"[IWMeasuringInfoWindowControl]"};this.triggerOnReset=function(){IWEventManager.trigger(b,"onreset",null)};function i(k){f.style.position="absolute";f.style.top="0px";f.style.left="0px";f.style.width=b.getSize().getWidth()-10+"px";f.align="right";iw.append(k,f);var j=iw.create("button");j.style.position="absolute";j.style.top=b.getSize().getHeight()-28+"px";j.style.left="20px";j.style.width=b.getSize().getWidth()-40+"px";b.addLabelFor(new IWLabel("RESET",j,"innerHTML"));iw.append(k,j);IWEventManager.addDomListener(j,"onclick",b.triggerOnReset)}IWEventManager.addListener(g,"ondistancechange",function(j){b.setDistance(j.distance)});this.setRedrawable(false);this.close();this.setDistance(0)}function IWNavigationControl(g){IWControl.call(this,g,"IWNavigationControl");var a=this.getContainer();var i=iw.create("area");var b=iw.create("area");var f=iw.create("area");var d=iw.create("area");var c=new IWLanguagePack();c.addLanguage(new IWLanguage("de",iwconst.LOCAL_APP_URL+"lang/IWNavigationControl.lang.de"));c.addLanguage(new IWLanguage("en",iwconst.LOCAL_APP_URL+"lang/IWNavigationControl.lang.en"));c.addLanguage(new IWLanguage("es",iwconst.LOCAL_APP_URL+"lang/IWNavigationControl.lang.es"));c.addLanguage(new IWLanguage("tr",iwconst.LOCAL_APP_URL+"lang/IWNavigationControl.lang.tr"));c.addLanguage(new IWLanguage("fr",iwconst.LOCAL_APP_URL+"lang/IWNavigationControl.lang.fr"));c.addLanguage(new IWLanguage("it",iwconst.LOCAL_APP_URL+"lang/IWNavigationControl.lang.it"));IWMultiLanguageSupport.call(this,g,c);this.addLabelFor(new IWLabel("UP",i,"title"));this.addLabelFor(new IWLabel("UP",i,"alt"));this.addLabelFor(new IWLabel("LEFT",d,"title"));this.addLabelFor(new IWLabel("LEFT",d,"alt"));this.addLabelFor(new IWLabel("RIGHT",b,"title"));this.addLabelFor(new IWLabel("RIGHT",b,"alt"));this.addLabelFor(new IWLabel("DOWN",f,"title"));this.addLabelFor(new IWLabel("DOWN",f,"alt"));this.afterAppend=function(){h()};this.toString=function(){return"[IWNavigationControl]"};function h(){var j=iw.create("img");iw.append(a,j);j.onload=function(){correctPNG(this)}.iwclosure(j);j.src=iwconst.GLOBAL_APP_URL+"img/controls/navigation/navicross.png";j.width="58";j.height="55";j.border="0";j.useMap="#mapNaviCross";var k=iw.create("map");iw.append(a,k);k.id="mapNaviCross";k.name="mapNaviCross";iw.append(k,i);i.shape="rect";i.coords="18,4,38,18";i.style.cursor="pointer";IWEventManager.addDomListener(i,"onmousedown",function(m){var n=new IWPoint(0,Math.floor(g.getOptions().getSize().getHeight()/2));g.panBy(n)});iw.append(k,d);d.shape="rect";d.coords="4,18,18,38";d.style.cursor="pointer";IWEventManager.addDomListener(d,"onmousedown",function(m){var n=new IWPoint(Math.floor(g.getOptions().getSize().getWidth()/2),0);g.panBy(n)});iw.append(k,b);b.shape="rect";b.coords="38,18,50,38";b.style.cursor="pointer";IWEventManager.addDomListener(b,"onmousedown",function(m){var n=new IWPoint(-Math.floor(g.getOptions().getSize().getWidth()/2),0);g.panBy(n)});iw.append(k,f);f.shape="rect";f.coords="18,38,38,50";f.style.cursor="pointer";IWEventManager.addDomListener(f,"onmousedown",function(m){var n=new IWPoint(0,-Math.floor(g.getOptions().getSize().getHeight()/2));g.panBy(n)})}a.id="IWNavigationControl";a.style.width="58px";a.style.height="55px";this.loadLanguagePack(g.getOptions().getLanguage())}function IWOverlaySelectionControl(h){IWWindowControl.call(this,h,"IWOverlaySelectionControl");var b=this;var g=null;var a=false;var f=iw.create("div");var c=log4javascript.getLogger("IWOverlaySelectionControl");var d=new IWLanguagePack();d.addLanguage(new IWLanguage("de",iwconst.LOCAL_APP_URL+"lang/IWOverlaySelectionControl.lang.de"));d.addLanguage(new IWLanguage("en",iwconst.LOCAL_APP_URL+"lang/IWOverlaySelectionControl.lang.en"));d.addLanguage(new IWLanguage("es",iwconst.LOCAL_APP_URL+"lang/IWOverlaySelectionControl.lang.es"));d.addLanguage(new IWLanguage("tr",iwconst.LOCAL_APP_URL+"lang/IWOverlaySelectionControl.lang.tr"));d.addLanguage(new IWLanguage("fr",iwconst.LOCAL_APP_URL+"lang/IWOverlaySelectionControl.lang.fr"));d.addLanguage(new IWLanguage("it",iwconst.LOCAL_APP_URL+"lang/IWOverlaySelectionControl.lang.it"));IWMultiLanguageSupport.call(this,h,d);this.buildBody=function(j){c.info("Calling buildBody with "+j);IWEventManager.addListener(this,"onlanguagepackload",function(k){b.setTitle(k.language.get("TITLE"));if(a==false){i(j);a=true}});this.loadLanguagePack(h.getOptions().getLanguage())};this.getTreeView=function(){return g};function i(j){c.debug("Calling buildGUI with "+j);b.setId("IWOverlaySelectionControl");j.style.height="295px";j.style.width="220px";iw.append(j,f)}this.setSize(new IWSize(220,270));this.setRedrawable(false);f.style.position="absolute";f.style.left="1px";f.style.height="270px";f.style.width="218px";f.style.top="0px";f.style.left="0px";f.style.overflowX="hidden";f.style.overflowY="auto";g=new IWTreeView(f);g.addNodes(h.getLayers());IWEventManager.addListener(g,"onnodeclick",function(j){h.redraw()})}function IWOverviewMapControl(b,f,q){IWControl.call(this,b,"IWOverviewMapControl");var n=this;var g=null;var c=null;var i=4;var j=null;var d=IWAlignment.BOTTOM+IWAlignment.RIGHT;var a=this.getContainer();var m=log4javascript.getLogger("IWOverviewMapControl");if(q==null||typeof q=="undefined"){q=new IWSize(120,120)}this.getSize=function(){return q};this.getMap=function(){return b};this.setZoomStep=function(r){r=r};this.getZoomStep=function(){return i};this.afterAppend=function(){h()};this.getOverviewMap=function(){return g};function h(){n.setId("IWOverviewMapControl");a.className="iwoverviewmapcontrol";a.style.overflow="hidden";g=new IWMap(a);g.getCopyrightControl().getContainer().style.display="none";var r=g.getOptions();r.setIsOverviewMap(true);b.getOptions().setHasOverviewMap(true);j=r.getMapTypeByName(f);j.setLabelsServerConfig(null);r.setBorderTiles(0);r.setSize(q);r.setLeftMouseAction(IWMapOptions.CONTROL_NONE);r.setRightMouseAction(IWMapOptions.CONTROL_NONE);r.setDoubleClickAction(IWMapOptions.CONTROL_NONE);r.setMouseWheelAction(IWMapOptions.CONTROL_NONE);r.setPlusMinusKeyAction(IWMapOptions.CONTROL_NONE);r.setArrowKeyAction(IWMapOptions.CONTROL_NONE);IWEventManager.addListener(g,"oninitialize",function(s){c=new IWOverviewDragBoxControl(n);g.getLayoutManager().getLayer(0).addControl(c,IWAlignment.CENTER,IWAlignment.CENTER)});g.setCenter(b.getCenter(),k(b.getZoom()),j)}function k(r){if(r-i>=j.getMinLevel()){return r-i}else{return j.getMinLevel()}}function o(u,t,w){m.debug("Calling updateView with "+u+", "+t+", "+w);var z=k(w);if(g.getZoom()!=z){g.setCenter(new IWCoordinate(u,t),z)}else{var x=g.getCurrentMapType().getProjection();var y=x.meterToPixel(g.getCenter());var r=x.meterToPixelXY(u,t);var v=y.getX()-r.x;var s=y.getY()-r.y;if(Math.abs(v)>1||Math.abs(s)>1){g.panTo(new IWCoordinate(u,t))}}}a.style.height=q.getHeight()+"px";a.style.width=q.getWidth()+"px";IWEventManager.addListener(b,"onzoomend",function(r){o(r.newCenterX,r.newCenterY,r.newZoomLevel)});IWEventManager.addListener(b,"oncenter",function(r){o(r.coordinateX,r.coordinateY,r.zoom)})}function IWOverviewDragBoxControl(d){IWControl.call(this,d.getOverviewMap(),"IWOverviewDragBoxControl");var r=this;var b=this.getContainer();var a=d.getMap();var f=d.getOverviewMap();var i=IWMapOptions.CONTROL_NONE;var o=log4javascript.getLogger("IWOverviewDragBoxControl");var s=false;this.afterAppend=function(){g()};function g(){r.setId("IWOverviewDragBoxControl");b.style.position="absolute";b.className="iwoverviewdragboxcontrol_outer";var u=iw.create("div");u.style.position="absolute";u.style.top="0px";u.style.left="0px";u.className="iwoverviewdragboxcontrol_inner";iw.append(b,u);iw.backgroundImage(u,iwconst.GLOBAL_APP_URL+"img/symbols/background_white_transparency.png");var t=iw.create("div");h();f.getLayoutManager().redraw()}function h(){var t=c();if(t.getWidth()<f.getOptions().getSize().getWidth()||t.getHeight()<f.getOptions().getSize().getHeight()){b.style.width=t.getWidth()+"px";b.style.height=t.getHeight()+"px";var u=b.firstChild;u.style.width=t.getWidth()-2+"px";u.style.height=t.getHeight()-2+"px";r.setVisible(true)}else{r.setVisible(false)}}function c(){var y=a.getMapWidthInMeter();var x=a.getMapHeightInMeter();var v=f.getMapWidthInMeter();var u=f.getMapHeightInMeter();var w=f.getOptions().getSize();var B=w.getWidth();var A=w.getHeight();var t=B/(v/y);var z=A/(u/x);return new IWSize(Math.round(t),Math.round(z))}function n(w){o.debug("Calling moveTo with "+w);var u=f.getCurrentMapType().getProjection().meterToPixel(w);var t=u.getX()-(parseInt(b.style.width)/2);var v=u.getY()-(parseInt(b.style.height)/2);o.trace("New upper left drag box corner is "+t+", "+v);b.style.top=v+"px";b.style.left=t+"px"}function k(u){o.debug("Calling moveBy with "+u);var t=parseInt(b.style.left)+u.getX();var v=parseInt(b.style.top)+u.getY();o.trace("New upper left drag box corner is "+t+", "+v);b.style.top=v+"px";b.style.left=t+"px"}function q(){h();f.getLayoutManager().redraw()}function m(u){var t=a.getOptions();i=t.getMouseWheelAction();t.setMouseWheelAction(IWMapOptions.CONTROL_NONE)}function j(w){var A=r.getContainer();var y=A.offsetTop;var x=A.offsetLeft;var v=A.offsetWidth;var u=A.offsetHeight;var t=new IWPoint(x+(v/2),y+(u/2));var z=f.getCurrentMapType().getProjection().pixelToMeter(t);a.getOptions().setMouseWheelAction(i);s=true;f.panTo(z);a.panTo(z)}this.setDragButton(IWButton.LEFT+IWButton.RIGHT);this.allowDraggingOutsideParent(true);this.setDraggingBounds(f.getOptions().getSize());this.setDraggable(true);IWEventManager.addListener(a,"onresize",q);IWEventManager.addListener(a,"onmove",function(){if(s==false){n(a.getCenter())}});IWEventManager.addListener(a,"onmoveend",function(){f.panTo(a.getCenter())});IWEventManager.addListener(f,"onzoomend",q);IWEventManager.addListener(f,"onmove",function(t){k(t.offset)});IWEventManager.addListener(f,"onmoveend",function(){s=false});IWEventManager.addListener(f,"oncenter",function(){n(f.getCenter())});IWEventManager.addListener(this,"ondragstart",m);IWEventManager.addListener(this,"ondragend",j)}function IWPanelControl(a,m){IWControl.call(this,a,"IWPanelControl");var h=0.8;var j="";var c=this.getContainer();var f=new IWLayoutManager(c);var i=null;if(typeof m=="undefined"){i=new IWSize(100,100)}else{i=m.clone()}var b=iw.create("div");b.id="divPanelBackground";b.style.zIndex=-1;c.appendChild(b);function k(){f.redraw()}function g(q){var n=q.newSize.getHeight();var o=q.newSize.getWidth();if((i.getWidth()<o)||(i.getHeight()<n)){i=new IWSize(o,n);b.style.width=o+"px";b.style.height=n+"px"}}function d(n,s){var r=s.childNodes;for(var q=0;q<r.length;q++){if(r.item(q).nodeName=="DIV"){n=d(n,r.item(q))}var o=new IWSize(r.item(q).offsetWidth,r.item(q).offsetHeight);if((o.getWidth()>n.getWidth())&&(r.item(q).id!="divPanelBackground")&&(r.item(q).style.visibility!="hidden")&&(r.item(q).style.display!="none")){n=new IWSize(o.getWidth(),n.getHeight())}if((o.getHeight()>n.getHeight())&&(r.item(q).id!="divPanelBackground")&&(r.item(q).style.visibility!="hidden")&&(r.item(q).style.display!="none")){n=new IWSize(n.getWidth(),o.getHeight())}if((o.getHeight()>n.getHeight())&&(o.getWidth()>n.getWidth())&&(r.item(q).id!="divPanelBackground")&&(r.item(q).style.visibility!="hidden")&&(r.item(q).style.display!="none")){n=new IWSize(o.getWidth(),o.getHeight())}}return n}this.isPanelControl=function(){return true};this.getLayoutManager=function(){return f};this.setSize=function(o){i=o.clone();var q=i.getWidth();var n=i.getHeight();c.style.width=q+"px";c.style.height=n+"px";b.style.width=q+"px";b.style.height=n+"px";k()};this.setVerticalScroll=function(n){if(typeof c.style.overflowY!="undefined"){c.style.overflowY=n}else{c.style.overflow=n}};this.setHorizontalScroll=function(n){if(typeof c.style.overflowX!="undefined"){c.style.overflowX=n}else{c.style.overflow=n}};this.adjustBackground=function(){var n=this.getSize();n=d(this.getSize(),c);b.style.width=n.getWidth()+"px";if(n.getHeight()<=i.getHeight()){b.style.height=n.getHeight()+"px"}else{b.style.height=n.getHeight()+15+"px"}};this.getSize=function(){return new IWSize(parseInt(c.style.width),parseInt(c.style.height))};this.setOpacity=function(o){var n=parseFloat(o);if(n<0||n>1){throw ("setOpacity: parameter not between 0 and 1.")}else{h=n;b.style.opacity=n;b.style.filter="alpha(opacity="+n*100+")"}};this.getOpacity=function(){return h};this.setBackgroundColor=function(n){b.style.backgroundColor=n};this.getBackgroundColor=function(){return b.style.backgroundColor};this.toString=function(){return"[IWPanelControl] Size: "+this.getSize()+", Backgroundcolor: "+this.getBackgroundColor()+", Opacity: "+this.getOpacity()};c.id="divPanelControl";this.setSize(i);this.setOpacity(h);this.setBackgroundColor(j);IWEventManager.addListener(f,"onresize",function(n){g(n)}.iwclosure(this))}function IWRoutingControl(G,af){IWControl.call(this,G,"IWRoutingControl");var k=this;var H=log4javascript.getLogger("IWRoutingControl");var g=new IWGeocoderClient();var V=new IWRoutingClient();var ab=null;var z=null;var J=false;var T=0;var aa=null;var j=0;var S=null;var ag=false;var y=new IWRoutingMagnifierFactory(G);var M=new IWShape("");var x=new IWLayer(G,"Route","ROUTE");var Q=null;var F=null;var X=new Array();var N=null;var r=iw.create("div");var o=iw.create("div");var m=iw.create("div");var n=null;var L=100;var u=100;var i=0;var v=1;var B=2;var P=3;var s=4;var w=new IWLanguagePack();w.addLanguage(new IWLanguage("de",iwconst.LOCAL_APP_URL+"lang/IWRoutingControl.lang.de"));w.addLanguage(new IWLanguage("en",iwconst.LOCAL_APP_URL+"lang/IWRoutingControl.lang.en"));IWMultiLanguageSupport.call(this,G,w);this.afterAppend=function(){IWEventManager.addListener(this,"onlanguagepackload",function(ah){z=ah.language;if(J==false){ac();J=true}});this.loadLanguagePack(G.getOptions().getLanguage())};this.setStartAddress=function(ah){iw.strict([IWAddress],[ah]);if(!Q){throw ("You should add the routing control to the DOM before calling this method.")}else{C(Q,ah)}};this.getStartAddress=function(){if(!Q){throw ("You should add the routing control to the DOM before calling this method.")}else{return ad(Q)}};this.resetStartAddress=function(){if(!Q){throw ("You should add the routing control to the DOM before calling this method.")}else{C(Q,new IWAddress())}};this.setDestinationAddress=function(ah){iw.strict([IWAddress],[ah]);if(!F){throw ("You should add the routing control to the DOM before calling this method.")}else{C(F,ah)}};this.getDestinationAddress=function(){if(!F){throw ("You should add the routing control to the DOM before calling this method.")}else{return ad(F)}};this.resetDestinationAddress=function(){if(!F){throw ("You should add the routing control to the DOM before calling this method.")}else{C(F,new IWAddress())}};this.addInterstationAddress=function(ah){iw.strict([IWAddress],[ah]);if(!N){throw ("You should add the routing control to the DOM before calling this method.")}else{var ak=f("interstationAddress"+T++);ak.className="interstation";var aj=iw.create("button");this.addLabelFor(new IWLabel("INTERSTATION_DELETE",aj,"innerHTML"));ak.appendChild(aj);X.push(ak);var ai=iw.create("h1");this.addLabelFor(new IWLabel("INTERSTATION",ai,"innerHTML"));var an=iw.create("div");an.appendChild(ai);an.appendChild(ak);var am=N.childNodes[1];am.insertBefore(an,am.lastChild);C(ak,ah);IWEventManager.trigger(k,"onredraw",null);var al=IWEventManager.addDomListener(aj,"onclick",function(){k.removeInterstationAddress(an);IWEventManager.removeListener(al);IWEventManager.trigger(k,"onredraw",null)}.iwclosure(k))}};this.setInterstationAddresses=function(ai){iw.strict(IWAddress,[ai]);for(var ah=0;ah<ai.length;ah++){this.addInterstationAddress(ai[ah])}};this.removeInterstationAddress=function(ai){ai.parentNode.removeChild(ai);for(var ah=0;ah<X.length;ah++){if(ai.lastChild.id==X[ah].id){X.splice(ah,1);break}}IWEventManager.trigger(k,"onredraw",null)};this.removeInterstationAddresses=function(){for(var ah=0;ah<X.length;ah++){this.removeInterstationAddress(X[0].parentNode)}};this.getInterstationAddresses=function(){var ai=new Array();for(var ah=0;ah<X.length;ah++){ai.push(ad(X[ah]))}return ai};this.changeAddressOrder=function(){var ah=iw.tag("select",o);var aj=new Array();for(var ai=0;ai<ah.length;ai++){aj.push(n[ai][ah[ai].selectedIndex].getAddress())}aj.reverse();C(Q,aj[0]);C(F,aj[aj.length-1]);for(var ai=0;ai<X.length;ai++){C(X[ai],aj[ai+1])}};this.getRoute=function(){return ab};this.getRouteLayer=function(){return x};this.getLayerIndexOfRoutingPoints=function(){return L};this.toString=function(){return"[IWRoutingControl]"};function t(){if(ag){return}ag=true;aa=new Array();var al=iw.tag("div",r);for(var ak=0;ak<al.length;ak++){if(al[ak].name=="address"){var ah=ad(al[ak]);if((ah.getZipCode()==null||ah.getZipCode().length==0)&&(ah.getCity()==null||ah.getCity().length==0)){alert(z.get("ERROR_INPUT_ADDRESS"));ag=false;return}aa.push(ah)}}addressNodes=null;var al=o.childNodes;while(al.length>0){al[0].parentNode.removeChild(al[0])}var ai=iw.create("h2");k.addLabelFor(new IWLabel("ROUTE_SELECT",ai,"innerHTML"));o.appendChild(ai);var aj=iw.create("button");o.appendChild(aj);k.addLabelFor(new IWLabel("BACK",aj,"innerHTML"));aj.onclick=function(){Y(o);O(r);IWEventManager.trigger(k,"onredraw",null)};j=0;n=new Array();g.geocodeAddress(aa[j],u)}function ac(){var ai=k.getContainer();ai.id="IWRoutingControl";r.id="routePane1";r.style.width="350px";r.className="routing";ai.appendChild(r);var aj=iw.create("h2");k.addLabelFor(new IWLabel("SEARCH_ROUTE",aj,"innerHTML"));r.appendChild(aj);iw.append(r,ae());N=D();iw.append(r,N);iw.append(r,a());r.appendChild(I());var ak=iw.create("button");ak.style.width="190px";r.appendChild(ak);k.addLabelFor(new IWLabel("SEARCH_ROUTE",ak,"innerHTML"));IWEventManager.addDomListener(ak,"onclick",t.iwclosure(ak));var al=IWEventManager.addListener(g,"ongeocode",function(ar){var au=ar.results;if(au.length==0){alert(z.get("ERROR_GEOCODING_ADDRESS")+": "+Z(ar.inputAddress));return}else{var az="";if(j==0){az=z.get("START_ADDRESS")}else{if(j==aa.length-1){az=z.get("DESTINATION_ADDRESS")}else{az=z.get("INTERSTATION")}}var aq=iw.create("div");aq.className="dropDownContent";aq.style.display="block";aq.style.visibility="visible";aq.style.marginBottom="5px";aq.style.marginTop="5px";var aw=iw.create("h1");aw.innerHTML=az;o.appendChild(aq);var ax=iw.create("select");ax.name="address";ax.style.width="280px";n.push(au);for(var av=0,at=0;av<au.length;av++,at++){var ay=au[av].getAddress();ax.options[at]=new Option(Z(ay));ax.options[at].address=ay}aq.appendChild(aw);aq.appendChild(ax);o.appendChild(aq)}if(j<aa.length-1){j++;g.geocodeAddress(aa[j],u)}else{Y(r);o.appendChild(ap);O(o);ap.focus();IWEventManager.trigger(k,"onredraw",null);ag=false}}.iwclosure(this));ai.appendChild(o);o.id="routePane2";o.className="routing";o.style.width="350px";Y(o);var ap=iw.create("button");ap.style.width="190px";k.addLabelFor(new IWLabel("CALCULATE_ROUTE",ap,"innerHTML"));IWEventManager.addDomListener(ap,"onclick",function(aq){var az=new IWRouteOptions();var av=iw.name("routeMode");for(var at=0;at<av.length;at++){if(av[at].checked){az.setType(av[at].value);break}}az.setCitySpeed(A(iw.id("routeSpeedCity")));az.setCountryRoadSpeed(A(iw.id("routeSpeedCountryRoad")));az.setHighwaySpeed(A(iw.id("routeSpeedHighway")));V.setRouteOptions(az);var au=iw.tag("select",o);if(au.length>=2){var ar=au[0].options[au[0].selectedIndex].address;var ax=au[au.length-1].options[au[au.length-1].selectedIndex].address;var aw=null;if(au.length>=3){var aw=new Array();for(var at=1;at<au.length-1;at++){var ay=au[at].options[au[at].selectedIndex].address;aw.push(ay)}}V.route(ar,ax,aw)}else{}});IWEventManager.addListener(V,"onroute",function(au){Y(o);ab=au.route;var ar=new IWRouteFormatter(ab);ar.setLanguage("de");iw.id("headerRoute").innerHTML=ar.createSummaryAsHTML();var at=iw.id("routeTable");for(var aq=at.rows.length-1;aq>=0;aq--){at.deleteRow(aq)}if(ab.getSegments()==0){alert(z.get("ERROR_ROUTING"))}else{for(var aq=0;aq<ab.getSegments();aq++){var av=at.insertRow(aq);av.className=(aq%2?"even":"odd");av.style.cursor="pointer";var ax=ab.getEntry(aq).getCoordinate();U(aq+1,ax);av.onclick=function(){var ay=y.createRoutingMagnifierContent(this);G.openInfoBalloon(this,ay)}.iwclosure(ax);var aw=av.insertCell(0);aw.style.verticalAlign="top";aw.innerHTML=aq+1;aw=av.insertCell(1);aw.style.verticalAlign="top";aw.innerHTML=ar.createImageAsHTML(aq);aw=av.insertCell(2);aw.style.verticalAlign="top";aw.innerHTML=ar.createDescriptionAsHTML(aq);aw=av.insertCell(3);aw.style.verticalAlign="top";aw.innerHTML=ar.createDistanceAsHTML(aq)}}M.setShapeName(ab.getShape());G.setCenter(ab.getBounds().getCenter(),G.getBoundsZoomlevel(ab.getBounds()));O(m);IWEventManager.trigger(k,"onredraw",null);return true}.iwclosure(this));ai.appendChild(m);m.id="routePane3";m.className="routing";m.style.width="350px";Y(m);var aj=iw.create("h2");iw.append(m,aj);k.addLabelFor(new IWLabel("ROUTE_DESCRIPTION",aj,"innerHTML"));var an=iw.create("span");iw.append(m,an);an.id="headerRoute";var ah=iw.create("button");m.appendChild(ah);ah.style.width="190px";ah.style.marginBottom="10px";k.addLabelFor(new IWLabel("CALCULATE_WAYBACK",ah,"innerHTML"));ah.onclick=function(){K();this.changeAddressOrder();Y(m);O(r);IWEventManager.trigger(k,"onredraw",null)}.iwclosure(k);var am=iw.create("button");m.appendChild(am);am.style.width="190px";am.style.marginBottom="10px";k.addLabelFor(new IWLabel("CALCULATE_NEW_ROUTE",am,"innerHTML"));am.onclick=function(){K();k.resetStartAddress();k.resetDestinationAddress();k.removeInterstationAddresses();Y(m);O(r);IWEventManager.trigger(k,"onredraw",null)}.iwclosure(k);var ao=iw.create("table");m.appendChild(ao);ao.id="routeTable"}function O(ah){ah.style.visibility="visible";ah.style.display="block"}function Y(ah){ah.style.visibility="hidden";ah.style.display="none"}function K(){G.getOverlayManager().removeLayer(L);M.setShapeName("");G.setCenter(G.getCenter());ab=null}function ae(){var ai=iw.create("div");ai.className="dropDownContent";ai.style.display="block";ai.style.visibility="visible";var ah=iw.create("H1");k.addLabelFor(new IWLabel("START_ADDRESS",ah,"innerHTML"));ai.appendChild(ah);Q=f("startAddress");iw.append(ai,Q);return ai}function a(){var ai=iw.create("div");ai.className="dropDownContent";ai.style.display="block";ai.style.visibility="visible";var ah=iw.create("H1");k.addLabelFor(new IWLabel("DESTINATION_ADDRESS",ah,"innerHTML"));ai.appendChild(ah);F=f("destinationAddress");iw.append(ai,F);return ai}function f(aj){var ai=iw.create("div");ai.id=aj;ai.name="address";iw.append(ai,c("street","ADDRESS_STREET"));iw.append(ai,c("housenumber","ADDRESS_HOUSE_NUMBER"));iw.append(ai,c("zipcode","ADDRESS_ZIPCODE"));iw.append(ai,c("city","ADDRESS_CITY"));var ah=iw.create("select");ah.className="country";ah.options[0]=q("ANDORRA","AND");ah.options[1]=q("BELGIUM","B");ah.options[2]=q("DENMARK","DK");ah.options[3]=q("GERMANY","D");ah.options[4]=q("FINNLAND","FIN");ah.options[5]=q("FRANCE","F");ah.options[6]=q("GREECE","GR");ah.options[7]=q("GREAT_BRITAIN","GB");ah.options[8]=q("IRELAND","IRL");ah.options[9]=q("ITALY","I");ah.options[10]=q("LUXEMBOURG","L");ah.options[11]=q("NETHERLANDS","NL");ah.options[12]=q("AUSTRIA","A");ah.options[13]=q("NORWAY","N");ah.options[14]=q("POLAND","PL");ah.options[15]=q("PORTUGAL","P");ah.options[16]=q("SAN_MARINO","RSM");ah.options[17]=q("SWEDEN","S");ah.options[18]=q("SWITZERLAND","CH");ah.options[19]=q("SLOVAKIA","SK");ah.options[20]=q("SPAIN","E");ah.options[21]=q("CZECH_REPUBLIC","CZ");ah.options[22]=q("HUNGARY","H");h(ah,"D");iw.append(ai,ah);return ai}function q(aj,ah){var ai=new Option(z.get(aj),ah);k.addLabelFor(new IWLabel(aj,ai,"text"));return ai}function h(ai,aj){for(var ah=0;ah<ai.options.length;ah++){if(ai.options[ah].value==aj){ai.selectedIndex=ah;return}}}function A(ah){return ah.options[ah.selectedIndex].text}function C(an,ah){var am=ah.getStreet();an.childNodes[i].value=(am!=null&&am.length>0?am:z.get("ADDRESS_STREET"));var aj=ah.getHouseNumber();an.childNodes[v].value=(aj!=0&&aj!=null?aj:z.get("ADDRESS_HOUSE_NUMBER"));var ai=ah.getZipCode();an.childNodes[B].value=(ai!=null&&ai.length>0?ai:z.get("ADDRESS_ZIPCODE"));var al=ah.getCity();an.childNodes[P].value=(al!=null&&al.length>0?al:z.get("ADDRESS_CITY"));var ak=ah.getCountryCode();if(ak!=null&&ak.length>0){h(an.childNodes[s],ak)}else{h(an.childNodes[s],"D")}}function ad(am){var ah=new IWAddress();var al=am.childNodes[i].value;if(al!=z.get("ADDRESS_STREET")){ah.setStreet(al)}var ak=am.childNodes[v].value;if(ak!=z.get("ADDRESS_HOUSE_NUMBER")){ah.setHouseNumber(ak)}var ai=am.childNodes[B].value;if(ai!=z.get("ADDRESS_ZIPCODE")){ah.setZipCode(ai)}var aj=am.childNodes[P].value;if(aj!=z.get("ADDRESS_CITY")){ah.setCity(aj)}ah.setCountry(A(am.childNodes[s]));ah.setCountryCode(am.childNodes[s].value);return ah}function c(ai,aj){var ah=iw.create("input");ah.name=ai;ah.className=ai;ah.value=z.get(aj);ah.onfocus=function(){if(this.value==z.get(aj)){this.value=""}}.iwclosure(ah);ah.onblur=function(){if(this.value==""){this.value=z.get(aj)}}.iwclosure(ah);IWEventManager.addDomListener(ah,"onkeypress",function(ak){if(ak.keyCode==13){t()}}.iwclosure(ah));k.addLabelFor(new IWLabel(aj,ah,"value"));return ah}function I(){S=iw.create("div");S.id="optionsMenu";S.className="dropDownMenu";var ak=iw.create("div");ak.className="dropDownHeader";ak.name="modus";S.appendChild(ak);ak.onclick=function(){W(ak)};var ah=iw.create("img");ak.appendChild(ah);ah.src=iwconst.GLOBAL_APP_URL+"img/controls/routing/oeffnen_route.gif";ah.className="img";var aj=iw.create("p");ak.appendChild(aj);k.addLabelFor(new IWLabel("ROUTE_OPTIONS",aj,"innerHTML"));var ai=iw.create("div");ai.className="dropDownContent";S.appendChild(ai);ai.appendChild(E());ai.appendChild(R());return S}function D(){var am=iw.create("div");am.id="interstationMenu";am.className="dropDownMenu";var al=iw.create("div");al.className="dropDownHeader";al.name="modus";am.appendChild(al);al.onclick=function(){W(al)};var ah=iw.create("img");al.appendChild(ah);ah.src=iwconst.GLOBAL_APP_URL+"img/controls/routing/oeffnen_route.gif";ah.className="img";var ak=iw.create("p");k.addLabelFor(new IWLabel("INTERSTATIONS",ak,"innerHTML"));al.appendChild(ak);var aj=iw.create("div");aj.id="routeInterstationContent";aj.className="dropDownContent";var ai=iw.create("button");aj.appendChild(ai);ai.style.width="190px";k.addLabelFor(new IWLabel("INTERSTATION_ADD",ai,"innerHTML"));ai.onclick=function(){k.addInterstationAddress(new IWAddress())};iw.append(am,aj);return am}function E(){var ai=iw.create("div");ai.id="modusDiv";var ah=iw.create("h1");k.addLabelFor(new IWLabel("ROUTE_MODE_SETTINGS",ah,"innerHTML"));ai.appendChild(ah);ai.appendChild(d());return ai}function d(){var am=null;var ak=null;var aj=null;if(IWBrowser.isInternetExplorer()){am=iw.create('<input type="radio" name="mode" value="1" className="modus" checked>');ak=iw.create('<input type="radio" name="mode" value="2" className="modus">');aj=iw.create('<input type="radio" name="mode" value="3" className="modus">')}else{am=iw.create("input");am.type="radio";am.name="routeMode";am.value="SPEED";am.checked=true;am.className="modus";ak=iw.create("input");ak.type="radio";ak.name="routeMode";ak.value="LENGTH";ak.className="modus";aj=iw.create("input");aj.type="radio";aj.name="routeMode";aj.value="ECONOMY";aj.className="modus"}var ah=iw.create("table");var ai=ah.insertRow(0);var al=ai.insertCell(0);al.style.width="65px";iw.append(al,am);k.addLabelFor(new IWLabel("ROUTE_FASTEST",ai.insertCell(1),"innerHTML"));var ai=ah.insertRow(1);ai.insertCell(0).appendChild(ak);k.addLabelFor(new IWLabel("ROUTE_SHORTEST",ai.insertCell(1),"innerHTML"));var ai=ah.insertRow(2);ai.insertCell(0).appendChild(aj);k.addLabelFor(new IWLabel("ROUTE_ECONOMIEST",ai.insertCell(1),"innerHTML"));return ah}function R(){var ai=iw.create("div");ai.id="speedDiv";var ah=iw.create("h1");k.addLabelFor(new IWLabel("ROUTE_SPEED_SETTINGS",ah,"innerHTML"));ai.appendChild(ah);ai.appendChild(b());return ai}function b(){var ah=iw.create("select");ah.id="routeSpeedHighway";ah.className="speed";ah.options[0]=new Option("130");ah.options[1]=new Option("120");ah.options[2]=new Option("110");ah.options[3]=new Option("100");ah.options[4]=new Option("90");ah.options[5]=new Option("80");ah.selectedIndex=3;var al=iw.create("select");al.id="routeSpeedCountryRoad";al.className="speed";al.options[0]=new Option("100");al.options[1]=new Option("90");al.options[2]=new Option("80");al.options[3]=new Option("70");al.options[4]=new Option("60");al.options[5]=new Option("50");al.selectedIndex=4;var ak=iw.create("select");ak.id="routeSpeedCity";ak.className="speed";ak.options[0]=new Option("50");ak.options[1]=new Option("40");ak.options[2]=new Option("30");ak.selectedIndex=2;var ai=iw.create("table");ai.id="speedTable";var aj=ai.insertRow(0);var am=aj.insertCell(0);am.style.width="65px";iw.append(am,ah);k.addLabelFor(new IWLabel("ROUTE_SPEED_HIGHWAY",aj.insertCell(1),"innerHTML"));var aj=ai.insertRow(1);aj.insertCell(0).appendChild(al);k.addLabelFor(new IWLabel("ROUTE_SPEED_COUNTRYROAD",aj.insertCell(1),"innerHTML"));var aj=ai.insertRow(2);aj.insertCell(0).appendChild(ak);k.addLabelFor(new IWLabel("ROUTE_SPEED_CITY",aj.insertCell(1),"innerHTML"));return ai}function W(al){var ah=null;var ak=null;for(var ai=0;ai<al.childNodes.length;ai++){if(al.childNodes[ai].className){if(al.childNodes[ai].className=="img"){ah=al.childNodes[ai];break}}}var aj=al.nextSibling;while(aj){if(aj.className=="dropDownContent"){ak=aj;break}aj=aj.nextSibling}if(ak.style.display=="block"){ak.style.display="none";ah.src=iwconst.GLOBAL_APP_URL+"img/controls/routing/oeffnen_route.gif"}else{ak.style.display="block";ah.src=iwconst.GLOBAL_APP_URL+"img/controls/routing/schliessen_route.gif"}IWEventManager.trigger(k,"onredraw",null)}function Z(ah){var ai="";if(ah.getStreet()!=null){ai=ai.concat(ah.getStreet());if(ah.getHouseNumber()!=null){ai=ai.concat(ah.getHouseNumber())}}if(ah.getZipCode()!=null){if(ai.length>0){ai=ai.concat(", ")}ai=ai.concat(ah.getZipCode()).concat(" ")}if(ah.getCity()!=null){ai=ai.concat(ah.getCity())}return ai}function U(ai,ak){var ah=new IWMarker(G,ak);ah.setDefaultIcon(new IWIcon(iwconst.GLOBAL_APP_URL+"/img/controls/routing/bullet_white_10.gif",new IWPoint(10,10)));var aj=iw.create("div");ah.getContainer().appendChild(aj);aj.innerHTML='<p align="center" style="margin: 0px">'+ai+"</p>";aj.style.position="absolute";aj.style.top="2px";aj.style.left="0px";aj.style.width="20px";aj.style.color="black";aj.style.fontSize="8pt";aj.style.fontWeight="bold";ah.onclick=function(){var al=y.createRoutingMagnifierContent(ak);G.openInfoBalloon(ak,al)};G.getOverlayManager().getLayer(L).addOverlay(ah)}if(typeof af!="undefined"){L=parseInt(af)}G.getOverlayManager().getLayer(L).setVisibilityRange(new IWRange(0,120));x.addShape(M);G.addLayer(x)}function IWScalarControl(map){IWControl.call(this,map,"IWScalarControl");var self=this;var _container=this.getContainer();var logger=log4javascript.getLogger("IWScalarControl");var _left=5;var _width=0;var _scaleUnits=[20,50,100,200,500,1000,2000,5000,10000,20000,50000,100000,200000,500000,1000000,2000000,5000000];var _scaleUnitsText=["20 m","50 m","100 m","200 m","500 m","1 km","2 km","5 km","10 km","20 km","50 km","100 km","200 km","500 km","1000 km","2000 km","5000 km"];this.afterAppend=function(){buildGUI();redraw()};this.toString=function(){return"[IWScalarControl]"};function buildGUI(){var container=self.getContainer();self.setId("IWScalarControl");var divBackground=iw.create("div");iw.append(container,divBackground);iw.backgroundImage(divBackground,iwconst.GLOBAL_APP_URL+"img/symbols/background_white_transparency.png");with(divBackground.style){position="absolute";top="0px";left="0px";width="120px";height="25px";zIndex="3";border="1px solid #dddddd"}var divForeground=iw.create("div");iw.append(container,divForeground);with(divForeground.style){position="absolute";textAlign="center";top="0px";left="0px";zIndex="3"}var divText=iw.create("div");iw.append(_container.lastChild,divText);with(divText.style){fontSize="9px";textAlign="center";width=divText.parentNode.style.width}createSeperator();createBlueBox();createSeperator();createWhiteBox();createSeperator();createBlueBox();createSeperator();createWhiteBox();createSeperator()}function createSeperator(){var div=iw.create("div");iw.append(_container.lastChild,div);with(div.style){position="absolute";borderBottom="1px solid #0066CC";width="1px";height="8px";top="15px"}iw.backgroundImage(div,iwconst.GLOBAL_APP_URL+"img/symbols/background_blue.jpg");return div}function createBlueBox(){var div=createBox();iw.append(_container.lastChild,div);iw.backgroundImage(div,iwconst.GLOBAL_APP_URL+"img/symbols/background_blue.jpg")}function createWhiteBox(){var div=createBox();iw.append(_container.lastChild,div);iw.backgroundImage(div,iwconst.GLOBAL_APP_URL+"img/symbols/background_white.jpg");return div}function createBox(){var div=iw.create("div");with(div.style){position="absolute";borderBottom="1px solid #0066CC";height="5px";top="18px"}return div}function redraw(){logger.debug("Calling redraw.");var size=map.getOptions().getSize();var coord1XY=IWVEUtils.pixelToLatLon(map,0,size.getHeight()/2);var coord2XY=IWVEUtils.pixelToLatLon(map,size.getWidth(),size.getHeight()/2);var coord1=new IWCoordinate(coord1XY.x,coord1XY.y,IWCoordinate.WGS84);var coord2=new IWCoordinate(coord2XY.x,coord2XY.y,IWCoordinate.WGS84);var mapWidthInMeter=coord1.distanceFrom(coord2);var meter=Math.round(mapWidthInMeter/10);var i=0;while(meter>=_scaleUnits[i]&&i<(_scaleUnits.length-1)){i++}var left=5;var pixelPerMeter=map.getOptions().getSize().getWidth()/mapWidthInMeter;var width=Math.round(_scaleUnits[i]*pixelPerMeter/4)-1;_container.style.width=_container.firstChild.style.width=_container.lastChild.style.width=(4*width+15)+"px";var nodes=_container.lastChild.childNodes;nodes[0].innerHTML=_scaleUnitsText[i];nodes[1].style.left=left+"px";left=left+1;nodes[2].style.left=left+"px";nodes[2].style.width=width+"px";left=left+width;nodes[3].style.left=left+"px";left=left+1;nodes[4].style.left=left+"px";nodes[4].style.width=width+"px";left=left+width;nodes[5].style.left=left+"px";left=left+1;nodes[6].style.left=left+"px";nodes[6].style.width=width+"px";left=left+width;nodes[7].style.left=left+"px";left=left+1;nodes[8].style.left=left+"px";nodes[8].style.width=width+"px";left=left+width;nodes[9].style.left=left-1+"px"}_container.style.width="120px";_container.style.height="25px";this.setPrintable(true);IWEventManager.addListener(map,"onzoomend",redraw);IWEventManager.addListener(map,"onresize",redraw);IWEventManager.addListener(map,"oncenter",redraw);IWEventManager.addListener(map,"onmoveend",redraw);IWEventManager.addListener(map,"onmaptypechange",redraw)}function IWSlideInMenuControl(v,q,a){IWControl.call(this,v,"IWSlideInMenuControl");function m(){var z=null;var A=null;if(i==IWAlignment.LEFT){z=k.getWidth();A=-1;if(!x){r.getContainer().style.width=k.getWidth()+11+"px";r.getContainer().style.left=parseInt(r.getContainer().style.left)-k.getWidth()+"px";n.style.left=k.getWidth()+"px"}}else{if(i==IWAlignment.RIGHT){z=k.getWidth();A=1;if(!x){r.getContainer().style.width=k.getWidth()+11+"px"}}else{if(i==IWAlignment.TOP){z=k.getHeight();A=-1;if(!x){r.getContainer().style.height=k.getHeight()+11+"px";r.getContainer().style.top=parseInt(r.getContainer().style.top)-k.getHeight()+"px";n.style.top=k.getHeight()+"px"}}else{if(i==IWAlignment.BOTTOM){z=k.getHeight();A=1;if(!x){r.getContainer().style.height=k.getHeight()+11+"px"}}}}}x=!x;if(!x){r.triggerOnCloseStart();g=f.getContainer().style.overflowX;b=f.getContainer().style.overflowY;f.getContainer().style.overflowX="hidden";f.getContainer().style.overflowY="hidden";j(f.getContainer());h(z,A,0,0)}else{r.triggerOnOpenStart();h(z,-1*A,0,0);f.getContainer().style.overflowX=g;f.getContainer().style.overflowY=b;for(var y=0;y<s.length;y++){if(s[y][0]=="v"){s[y][1].style.overflow=s[y][2]}if(s[y][0]=="x"){s[y][1].style.overflowX=s[y][2]}if(s[y][0]=="y"){s[y][1].style.overflowY=s[y][2]}}s=new Array()}}function j(z){for(var y=0;y<z.childNodes.length;y++){if(z.childNodes.item(y).nodeName=="DIV"){j(z.childNodes.item(y))}}if(z.style.overflow=="auto"||z.style.overflow=="scroll"){s.push(new Array("v",z,z.style.overflow));z.style.overflow="hidden"}if(z.style.overflowY=="auto"||z.style.overflowY=="scroll"){s.push(new Array("y",z,z.style.overflowY));z.style.overflowY="hidden"}if(z.style.overflowX=="auto"||z.style.overflowX=="scroll"){s.push(new Array("x",z,z.style.overflowX));z.style.overflowX="hidden"}}function h(C,E,B,A){if(B<t.length){var y=Math.round(t[B]*C);y+=A;A=y-Math.round(y);if(i==IWAlignment.LEFT||i==IWAlignment.RIGHT){var D=parseInt(n.style.left)-E*y;n.style.left=D+"px"}else{if(i==IWAlignment.TOP||i==IWAlignment.BOTTOM){var z=parseInt(n.style.top)-E*y;n.style.top=z+"px"}}window.setTimeout(function(){h(C,E,++B,A)},35)}else{o();u()}}function o(){if(x){if(i==IWAlignment.LEFT){n.style.left="11px"}else{if(i==IWAlignment.RIGHT){n.style.left="0px"}else{if(i==IWAlignment.TOP){n.style.top="11px"}else{if(i==IWAlignment.BOTTOM){n.style.top="0px"}}}}}else{if(i==IWAlignment.LEFT){n.style.left="11px";r.getContainer().style.width="11px";if(!r.getContainer().style.left){r.getContainer().style.left=k.getWidth()+"px"}else{r.getContainer().style.left=parseInt(r.getContainer().style.left)+k.getWidth()+"px"}}else{if(i==IWAlignment.RIGHT){n.style.left=-k.getWidth()+"px";r.getContainer().style.width="11px"}else{if(i==IWAlignment.TOP){n.style.top="11px";r.getContainer().style.height="11px";if(!r.getContainer().style.top){r.getContainer().style.top=k.getHeight()+"px"}else{r.getContainer().style.top=parseInt(r.getContainer().style.top)+k.getHeight()+"px"}}else{if(i==IWAlignment.BOTTOM){n.style.top=-k.getHeight()+"px";r.getContainer().style.height="11px"}}}}}}function u(){if(i==IWAlignment.RIGHT){w.src=iwconst.GLOBAL_APP_URL+(x?"img/controls/slidemenu/links.gif":"img/controls/slidemenu/rechts.gif")}else{if(i==IWAlignment.LEFT){w.src=iwconst.GLOBAL_APP_URL+(x?"img/controls/slidemenu/rechts.gif":"img/controls/slidemenu/links.gif")}else{if(i==IWAlignment.TOP){w.src=iwconst.GLOBAL_APP_URL+(x?"img/controls/slidemenu/unten.gif":"img/controls/slidemenu/oben.gif")}else{if(i==IWAlignment.BOTTOM){w.src=iwconst.GLOBAL_APP_URL+(x?"img/controls/slidemenu/oben.gif":"img/controls/slidemenu/unten.gif")}}}}}this.triggerOnOpenStart=function(){IWEventManager.trigger(this,"onopenstart",null)};this.triggerOnCloseStart=function(){IWEventManager.trigger(this,"onclosestart",null)};this.setSize=function(z){k=z;var A=k.getWidth();var y=k.getHeight();if(i==IWAlignment.LEFT||i==IWAlignment.RIGHT){n.style.width=A+11+"px";n.style.height=y+"px";this.getContainer().style.width=A+11+"px";this.getContainer().style.height=y+"px";d.style.height=y-2+"px";d.style.width="9px";c.style.top=(y/2-10)+"px";c.style.left="0px";d.style.top="0px"}else{if(i==IWAlignment.TOP||i==IWAlignment.BOTTOM){n.style.width=A+"px";n.style.height=y+11+"px";this.getContainer().style.width=A+"px";this.getContainer().style.height=y+11+"px";d.style.width=A-2+"px";d.style.height="9px";c.style.left=(A/2-10)+"px";c.style.bottom="0px";d.style.left="0px"}}f.setSize(z);o()};this.setVerticalScroll=function(y){b=y;f.setVerticalScroll(y)};this.setHorizontalScroll=function(y){g=y;f.setHorizontalScroll(y)};this.getSize=function(){return f.getSize()};this.setBackgroundColor=function(y){f.setBackgroundColor(y);d.style.backgroundColor=y};this.adjustBackground=function(){f.adjustBackground()};this.setOpacity=function(y){f.setOpacity(y);d.style.opacity=y;d.style.filter="alpha(opacity="+y*100+")"};this.getOpacity=function(){return f.getOpacity()};this.getBackgroundColor=function(){return f.getBackgroundColor()};this.getLayoutManager=function(){return f.getLayoutManager()};this.expand=function(){if(!x){m()}};this.collapse=function(){if(x){m()}};this.open=function(){if(x){return}this.triggerOnOpenStart();x=true;u();if(i==IWAlignment.LEFT){r.getContainer().style.width=k.getWidth()+11+"px";r.getContainer().style.left=parseInt(r.getContainer().style.left)-k.getWidth()+"px";n.style.left=k.getWidth()+"px"}else{if(i==IWAlignment.RIGHT){r.getContainer().style.width=k.getWidth()+11+"px"}else{if(i==IWAlignment.TOP){r.getContainer().style.height=k.getHeight()+11+"px";r.getContainer().style.top=parseInt(r.getContainer().style.top)-k.getHeight()+"px";n.style.top=k.getHeight()+"px"}else{if(i==IWAlignment.BOTTOM){r.getContainer().style.height=k.getHeight()+11+"px"}}}}o()};this.close=function(){if(!x){return}this.triggerOnCloseStart();x=false;u();o()};this.isOpen=function(){return x};this.toString=function(){return"[IWSlideInMenuControl] Size: "+this.getSize()+", Backgroundcolor: "+this.getBackgroundColor()+", Opacity: "+this.getOpacity()};if(typeof a=="undefined"||a<0||a>4){throw ("IWSlideInMenuControl: adding control failed: slideDirection not valid!")}var r=this;var t=[0.03,0.07,0.12,0.18,0.2,0.18,0.12,0.07,0.03];this.getContainer().id="divSlideInMenu";var i=a;var x=false;var g="inherit";var b="inherit";var s=new Array();var k=null;if(typeof q=="undefined"){k=new IWSize(100,100)}else{k=q}var n=iw.create("div");n.style.position="absolute";this.getContainer().appendChild(n);this.getContainer().style.overflow="hidden";var f=new IWPanelControl(v);n.appendChild(f.getContainer());var d=iw.create("div");n.appendChild(d);var c=iw.create("div");var w=iw.create("img");c.appendChild(w);d.appendChild(c);c.style.position="absolute";u();d.style.position="absolute";d.style.right="0px";d.style.cursor="pointer";d.style.borderLeftWidth="1px";d.style.borderLeftStyle="solid";d.style.borderLeftColor="#689acd";d.style.borderRightWidth="1px";d.style.borderRightStyle="solid";d.style.borderRightColor="#689acd";d.style.borderTopWidth="1px";d.style.borderTopStyle="solid";d.style.borderTopColor="#689acd";d.style.borderBottomWidth="1px";d.style.borderBottomStyle="solid";d.style.borderBottomColor="#689acd";this.setOpacity(0.8);this.setBackgroundColor("");this.setSize(k);o();IWEventManager.addDomListener(d,"onclick",m)}function IWSliderControl(t){IWControl.call(this,t,"IWSliderControl");var m=this;var g=t.getCurrentMapType().getMinLevel();var u=t.getCurrentMapType().getMaxLevel();var r=23;var q=18;var c=161-q;var j=t.getZoom();var o=new IWMouseAdapter();var i=this.getContainer();var w=log4javascript.getLogger("IWSliderControl");var f=new IWMouseWheelAdapter(i);var v=null;var b=null;var n=new IWLanguagePack();n.addLanguage(new IWLanguage("de",iwconst.LOCAL_APP_URL+"lang/IWSliderControl.lang.de"));n.addLanguage(new IWLanguage("en",iwconst.LOCAL_APP_URL+"lang/IWSliderControl.lang.en"));n.addLanguage(new IWLanguage("es",iwconst.LOCAL_APP_URL+"lang/IWSliderControl.lang.es"));n.addLanguage(new IWLanguage("tr",iwconst.LOCAL_APP_URL+"lang/IWSliderControl.lang.tr"));n.addLanguage(new IWLanguage("fr",iwconst.LOCAL_APP_URL+"lang/IWSliderControl.lang.fr"));n.addLanguage(new IWLanguage("it",iwconst.LOCAL_APP_URL+"lang/IWSliderControl.lang.it"));IWMultiLanguageSupport.call(this,t,n);function d(x){var z=(x-q)/c;var y=u-g;return u-(y*z)}this.getValue=function(x){if(typeof(x)=="undefined"){x=true}var y=d(parseInt(b.style.top));if(x){return Math.round(y)}else{return y}};this.setValue=function(B){if(typeof(B)=="string"){B=parseInt(B)}var A=t.getCurrentMapType();var x=A.getMaxLevel();var D=A.getMinLevel();var y;if(B<D){y=D}else{if(B>x){y=x}else{y=B}}var B=y-D;var z=x-D;var C=c/z;b.style.top=q+(c-C*B)+"px"};this.afterAppend=function(){h();this.setValue(t.getZoom());this.loadLanguagePack(t.getOptions().getLanguage())};this.toString=function(){return"[IWSliderControl]"};function s(y){var x=t.getCurrentMapType().getMaxLevel();j=t.getZoom();if(j<x){var y=new IWZoomEvent();y.newZoomLevel=j+1;y.newCenter=t.getCenter();t.triggerOnZoomStart(y);if(t.zoomIn()){m.setValue(j+1)}}}function k(x){var y=t.getCurrentMapType().getMinLevel();j=t.getZoom();if(j>y){var x=new IWZoomEvent();x.newZoomLevel=j-1;x.newCenter=t.getCenter();t.triggerOnZoomStart(x);if(t.zoomOut()){m.setValue(j-1)}}}function a(x){if(!x){x=window.event}var z=o.toMouseEvent(x,i);var A=z.position.getY()-20;if(A>=0&&A<=170){var x=new IWZoomEvent();x.newZoomLevel=Math.min(Math.round(d(A),t.getCurrentMapType().getMaxLevel()));x.newCenter=t.getCenter();t.triggerOnZoomStart(x);t.zoom(t.getZoom(),x.newZoomLevel)}}function h(){var A=iw.create("div");if(IWBrowserDetect.browser=="Explorer"&&IWBrowserDetect.version<7){i.id="IWSliderControl_IE6";A.id="IWSliderControlFilter_IE6";A.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+iwconst.GLOBAL_APP_URL+'img/controls/slider/sprite-slider.png",sizingMethod="crop")'}else{i.id="IWSliderControl";A.id="IWSliderControlFilter"}iw.append(i,A);var x=iw.create("div");iw.append(i,x);x.id="IWSliderControlZoomIn";x.onclick=s;m.addLabelFor(new IWLabel("ZOOM_IN",x,"title"));var z=iw.create("div");iw.append(i,z);z.id="IWSliderControlZoomOut";z.onclick=k;m.addLabelFor(new IWLabel("ZOOM_OUT",z,"title"));var y=iw.create("div");iw.append(i,y);y.id="IWSliderControlZoomClick";y.onclick=a;b=iw.create("div");iw.append(i,b);b.id="IWSliderControlZoomButton";b.style.left=r+"px";b.style.top=q+"px";IWEventManager.addDomListener(b,"onmousedown",function(F){if(!F){F=window.event}if(F.cancelable){F.preventDefault()}F.cancelBubble=false;F.returnValue=false;if(o.getButton(F)!=IWButton.LEFT){return}var E=o.getPositionXY(F,i);var C=E.y;IWEventManager.trigger(t,"onzoomstart",null);limitHigh=q;limitLow=c+q;var D=IWEventManager.addListener(document.body,"onmousemove",function(J){if(!J){J=window.event}var I=o.getPositionXY(J,i);var G=I.y-C;C=I.y;if(J.cancelable){J.preventDefault()}J.cancelBubble=false;J.returnValue=false;var L=Math.min(Math.max(parseInt(b.style.top)+G,limitHigh),limitLow);var H=m.getValue();b.style.top=L+"px";var K=m.getValue();if(H!=K){t.opticalZoom(H,K)}});var B=IWEventManager.addListener(document.body,"onmouseup",function(G){t.zoom(m.getValue(),m.getValue());IWEventManager.removeListener(D);IWEventManager.removeListener(B)})})}i.style.height="218px";i.style.width="58px";IWEventManager.addListener(f,"onmousewheel",function(z){if(t.getOptions().getMouseWheelAction()!=IWMapOptions.CONTROL_ZOOM){return}if(v==null){j=t.getZoom();var x=new IWZoomEvent();t.triggerOnZoomStart(x)}else{window.clearTimeout(v)}v=window.setTimeout(function(){t.zoom(j,j);v=null},500);var x=new IWZoomEvent();x.oldZoomLevel=j;var y=t.getCurrentMapType();j=j+z.delta;if(j>y.getMaxLevel()){j=y.getMaxLevel()}if(j<y.getMinLevel()){j=y.getMinLevel()}x.newZoomLevel=j;m.setValue(j);t.triggerOnZoom(x);t.opticalZoom(x.oldZoomLevel,x.newZoomLevel)});IWEventManager.addListener(t,"onzoom",function(x){m.setValue(x.newZoomLevel)});IWEventManager.addListener(t,"onzoomend",function(x){m.setValue(x.newZoomLevel)});IWEventManager.addListener(t,"oncenter",function(x){m.setValue(t.getZoom())});IWEventManager.addListener(t,"onmaptypechange",function(x){g=t.getCurrentMapType().getMinLevel();u=t.getCurrentMapType().getMaxLevel();m.setValue(t.getZoom())})}function IWTabbedPanelControl(a,n){IWControl.call(this,a,"IWTabbedPanelControl");this.setSize=function(o){j=o;f.style.width=j.getWidth()+"px";f.style.height=j.getHeight()+"px"};this.setTabTextSize=function(o){d.style.fontSize=o};this.setTabColor=function(o){d.style.color=o;h=o;g.style.borderLeftColor=h;g.style.borderRightColor=h;g.style.borderBottomColor=h};this.setTabHeight=function(o){c=parseInt(o)};this.addPanel=function(o,s){if((typeof o.isPanelControl=="undefined")||!o.isPanelControl()){alert("IWTabbedPanelControl: Only IWPanelControls allowed!");return}for(var q=0;q<_panels.length;q++){if(_panels[q][0]==o){alert("IWTabbedPanelControl: Panel already added: "+o);return}}var r=document.createElement("div");r.style.position="absolute";r.style.height=c+"px";r.style.cursor="pointer";r.style.whiteSpace="nowrap";r.appendChild(document.createTextNode(s));d.appendChild(r);IWEventManager.addDomListener(r,"onclick",function(){this.showTab(o)}.iwclosure(this));o.setSize(new IWSize(j.getWidth(),j.getHeight()-c-1));_panels.push(new Array(o,s,r));m();if(_panels.length>=1){this.showTab(_panels[0][0])}};this.removePanel=function(o){for(var s=0;s<_panels.length;s++){if(_panels[s][0]==o){d.removeChild(_panels[s][2]);if(b==o){g.removeChild(_panels[s][0].getContainer())}var q=new Array();for(var r=0;r<_panels.length;r++){if(s!=r){q.push(_panels[r])}}_panels=q;m();if(b==o){this.showTab(_panels[0][0])}else{k()}return true}}return false};this.showTab=function(o){for(var q=0;q<_panels.length;q++){if(_panels[q][0]==o){if(b){g.removeChild(b.getContainer())}g.appendChild(o.getContainer());b=o;k();return true}}return false};function m(){var o=j.getWidth()/_panels.length;for(var q=0;q<_panels.length;q++){if(q==_panels.length-1){_panels[q][2].style.width=o-2+"px"}else{_panels[q][2].style.width=o-1+"px"}_panels[q][2].style.left=o*q+"px"}}function k(){var s=new Array("dddddd","cccccc","bbbbbb","aaaaaa","999999","888888","777777","666666","555555");if(_panels.length-1<s.length){step=parseInt(s.length/_panels.length-1)}if(step==0){step++}var r=false;for(var q=0;q<_panels.length;q++){if(_panels[q][0]==b){_panels[q][2].style.backgroundColor=_panels[q][0].getBackgroundColor();_panels[q][2].style.borderLeftWidth="1px";_panels[q][2].style.borderLeftStyle="solid";_panels[q][2].style.borderLeftColor=h;_panels[q][2].style.borderTopWidth="1px";_panels[q][2].style.borderTopStyle="solid";_panels[q][2].style.borderTopColor=h;_panels[q][2].style.borderBottomWidth="0px";_panels[q][2].style.borderBottomStyle="solid";_panels[q][2].style.borderBottomColor=h;r=true}else{var o=q;if(r){o--}if(q<s.length){_panels[q][2].style.backgroundColor="#"+s[step*o]}else{_panels[q][2].style.backgroundColor="#"+s[s.length-1]}_panels[q][2].style.borderLeftWidth="1px";_panels[q][2].style.borderLeftStyle="solid";_panels[q][2].style.borderLeftColor=h;_panels[q][2].style.borderTopWidth="1px";_panels[q][2].style.borderTopStyle="solid";_panels[q][2].style.borderTopColor=h;_panels[q][2].style.borderBottomWidth="1px";_panels[q][2].style.borderBottomStyle="solid";_panels[q][2].style.borderBottomColor=h}if(q==_panels.length-1){_panels[q][2].style.borderRightWidth="1px";_panels[q][2].style.borderRightStyle="solid";_panels[q][2].style.borderRightColor=h}else{_panels[q][2].style.borderRightWidth="0px";_panels[q][2].style.borderRightStyle="solid";_panels[q][2].style.borderRightColor=h}}}this.getContainer().id="divTabbedPanelControl";var i=this;var f=this.getContainer();var c=15;var h="black";var b=null;_panels=new Array();var j;if(typeof n=="undefined"){j=new IWSize(100,100)}else{j=n}var d=document.createElement("div");d.id="divTabs";f.appendChild(d);d.style.position="absolute";d.style.top="0px";d.style.left="0px";d.style.width=j.getWidth()+"px";d.style.height=c+"px";this.setTabTextSize("9pt");var g=document.createElement("div");g.id="divPanels";f.appendChild(g);g.style.position="absolute";g.style.visibility="inherit";g.style.top=c+1+"px";g.style.left="0px";g.style.width=j.getWidth()-2+"px";g.style.height=j.getHeight()-c-2+"px";g.style.borderLeftWidth="1px";g.style.borderLeftStyle="solid";g.style.borderLeftColor=h;g.style.borderRightWidth="1px";g.style.borderRightStyle="solid";g.style.borderRightColor=h;g.style.borderBottomWidth="1px";g.style.borderBottomStyle="solid";g.style.borderBottomColor=h;this.setSize(n)}function IWToolbarControl(f){IWControl.call(this,f,"IWToolbarControl");var c=this;var b=new Object();var a=this.getContainer();var d=0;this.addItem=function(r){b[r.getName()]=r;var h=new IWToolbarEvent();h.item=r;this.triggerOnAppendStart(h);var k=h.item.getNode();if(k==null){throw"IWToolbarControl.addItem failed. The item.getNode() returns null."}iw.append(a,k);var q=parseInt(k.style.width);var i=parseInt(k.style.height);a.style.width=parseInt(a.style.width)+q+"px";this.triggerOnAppendEnd(h);k.style.left=d+"px";d+=q;if(i>parseInt(a.style.height)){a.style.height=i+"px"}var n=null;try{n=iw.create('<map name="toolbarMap'+r.getName()+'">')}catch(o){n=iw.create("map");n.name="toolbarMap"+r.getName()}n.id="toolbarMap"+r.getName();var j=iw.create("area");iw.append(n,j);j.shape="rect";j.coords="0,0,"+q+","+i;try{iw.append(k,n)}catch(o){return}var m=iw.create("img");iw.append(k,m);m.useMap="#toolbarMap"+r.getName();m.src=iwconst.GLOBAL_APP_URL+"img/symbols/blank.gif";m.border="0px";m.style.position="absolute";m.style.top="0px";m.style.left="0px";m.style.height="100%";m.style.width="100%";IWEventManager.addDomListener(j,"onclick",function(t){var s=new IWToolbarEvent();s.item=r;c.triggerOnClick(s)}.iwclosure(r));IWEventManager.addDomListener(j,"onmouseover",function(t){var s=new IWToolbarEvent();s.item=r;c.triggerOnMouseOver(s)}.iwclosure(r));IWEventManager.addDomListener(j,"onmouseout",function(t){var s=new IWToolbarEvent();s.item=r;c.triggerOnMouseOut(s)}.iwclosure(r))};this.removeItem=function(k){if(k!=null&&b[k.getName()]){var j=k.getNode();var h=parseInt(j.style.width);a.style.width=parseInt(a.style.width)-h+"px";d=d-h;var m=j.nextSibling;while(m){m.style.left=parseInt(m.style.left)-h+"px";m=m.nextSibling}b[k.getName()]=null;iw.remove(j);var i=new IWToolbarEvent();i.item=k;this.triggerOnRemove(i)}};this.getItem=function(h){return b[h]};this.toString=function(){return"[IWToolbarControl]"};this.triggerOnMouseOver=function(h){IWEventManager.trigger(this,"onmouseover",h)};this.triggerOnMouseOut=function(h){IWEventManager.trigger(this,"onmouseout",h)};this.triggerOnClick=function(h){IWEventManager.trigger(this,"onclick",h)};this.triggerOnAppendStart=function(h){IWEventManager.trigger(this,"onappendstart",h)};this.triggerOnAppendEnd=function(h){IWEventManager.trigger(this,"onappendend",h)};this.triggerOnRemove=function(h){IWEventManager.trigger(this,"onremove",h)};function g(){a.id="IWToolbarControl";a.style.position="absolute";a.style.height="0px";a.style.width="0px"}g()}function IWToolbarItem(a){var b=null;this.getName=function(){return a};this.getNode=function(){return b};this.setNode=function(c){b=c};this.toString=function(){return"[IWToolbarItem] name: "+a}}function IWToolbarEvent(){this.item=null;this.toString=function(){return"[IWToolbarEvent]\u0020"+(this.item!=null?this.item.getName():"")}}function IWWindowControl(b,k,o){IWControl.call(this,b,"IWWindowControl");var m=this;var c=this.getContainer();var n=iw.create("div");var i=iw.create("span");var d=true;var a=new IWPanelControl(b,o);var f=false;var j=new IWLanguagePack();j.addLanguage(new IWLanguage("de",iwconst.LOCAL_APP_URL+"lang/IWWindowControl.lang.de"));j.addLanguage(new IWLanguage("en",iwconst.LOCAL_APP_URL+"lang/IWWindowControl.lang.en"));j.addLanguage(new IWLanguage("es",iwconst.LOCAL_APP_URL+"lang/IWWindowControl.lang.es"));j.addLanguage(new IWLanguage("tr",iwconst.LOCAL_APP_URL+"lang/IWWindowControl.lang.tr"));j.addLanguage(new IWLanguage("fr",iwconst.LOCAL_APP_URL+"lang/IWWindowControl.lang.fr"));j.addLanguage(new IWLanguage("it",iwconst.LOCAL_APP_URL+"lang/IWWindowControl.lang.it"));var h=new Object();IWMultiLanguageSupport.call(h,b,j);this.buildBody=function(q){};this.beforeOpen=function(){};this.afterOpen=function(){};this.beforeClose=function(){};this.afterClose=function(){};this.setCloseable=function(q){d=q};this.isCloseable=function(){return d};this.close=function(){m.triggerOnCloseStart();m.beforeClose();m.setVisible(false);m.afterClose();m.triggerOnCloseEnd()};this.open=function(){m.triggerOnOpenStart();m.beforeOpen();m.setVisible(true);m.afterOpen();m.triggerOnOpenEnd()};this.getSize=function(){return a.getSize()};this.setSize=function(q){o=q;c.style.height=o.getHeight()+25+"px";c.style.width=o.getWidth()+"px";n.style.width=o.getWidth()-10+"px";a.setSize(o)};this.getContentPanel=function(){return a};this.getTitle=function(){return i.innerHTML};this.setTitle=function(q){i.innerHTML=q};this.afterAppend=function(){IWEventManager.addListener(h,"onlanguagepackload",function(q){if(f==false){g();f=true}});h.loadLanguagePack(b.getOptions().getLanguage())};this.triggerOnOpenStart=function(){IWEventManager.trigger(this,"onopenstart",null)};this.triggerOnOpenEnd=function(){IWEventManager.trigger(this,"onopenend",null)};this.triggerOnCloseStart=function(){IWEventManager.trigger(this,"onclosestart",null)};this.triggerOnCloseEnd=function(){IWEventManager.trigger(this,"oncloseend",null)};function g(){n.style.position="absolute";n.style.top="0px";n.style.font="bold 12px Arial";n.style.color="#ffffff";n.style.backgroundColor="#1B57B1";n.style.padding="4px";n.style.border="1px solid #ffffff";iw.append(n,i);if(m.isCloseable()){var q=iw.create("img");n.appendChild(q);q.style.position="absolute";q.style.right="4px";q.style.top="6px";q.src=iwconst.GLOBAL_APP_URL+"img/symbols/close.png";q.style.cursor="pointer";h.addLabelFor(new IWLabel("CLOSE",q,"alt"));h.addLabelFor(new IWLabel("CLOSE",q,"title"));IWEventManager.addDomListener(q,"onclick",m.close)}iw.append(c,n);a.getContainer().style.position="absolute";a.getContainer().style.top="25px";a.getContainer().style.left="0px";a.setBackgroundColor("#FFFFFF");a.setOpacity(1);iw.append(c,a.getContainer());m.buildBody(m.getContentPanel().getContainer())}if(typeof o=="undefined"){o=new IWSize(100,100)}if(typeof k=="undefined"){k="IWWindowControl"}this.setSize(o);this.setTitle(k);this.allowDraggingOutsideParent(false);this.setDraggableContainer(n);this.setDraggable(true);this.setVisible(false)}function IWZoomBoxControl(map){IWControl.call(this,map,"IWZoomBoxControl");var self=this;var divZoomBox=this.getContainer();var divMiddel=null;var divContent=null;var mouseAdapter=new IWMouseAdapter();var logger=log4javascript.getLogger("IWZoomBoxControl");var lastMousePositionX=null;var lastMousePositionY=null;var startPositionX=0;var startPositionY=0;var mapHeightPixel=0;var mapWidthPixel=0;this.afterAppend=function(){buildGUI()};this.toString=function(){return"[IWZoomBoxControl]"};function buildGUI(){self.setId("IWZoomBoxControl");with(divZoomBox.style){backgroundColor="#ffffff";opacity="0.6";filter="alpha(opacity=60)";position="absolute";overflow="hidden";zIndex="0";width="0px";height="0px"}var divHorizontal=iw.create("div");iw.append(divZoomBox,divHorizontal);with(divHorizontal.style){position="absolute";top="50%";left="0px";width="100%";height="1px";overflow="visible"}divMiddel=iw.create("div");iw.append(divHorizontal,divMiddel);with(divMiddel.style){marginLeft="-48px";position="absolute";top="50%";left="50%";width="96px";height="96px";textAlign="center";color="#d0d0d0";overflow="visible"}divContent=iw.create("div");iw.append(divMiddel,divContent);divContent.style.fontSize="96px"}function redrawZoomingBox(mousePositionXY){var boxLeft=0;var boxRight=0;var boxTop=0;var boxBottom=0;if(mousePositionXY.x<startPositionX){boxLeft=mousePositionXY.x;boxRight=startPositionX}else{boxLeft=startPositionX;boxRight=mousePositionXY.x}var boxWidth=boxRight-boxLeft;if(mousePositionXY.y<startPositionY){boxTop=mousePositionXY.y;boxBottom=startPositionY}else{boxTop=startPositionY;boxBottom=mousePositionXY.y}var boxHeight=boxBottom-boxTop;divZoomBox.style.height=boxHeight+"px";divZoomBox.style.width=boxWidth+"px";divZoomBox.style.top=boxTop+"px";divZoomBox.style.left=boxLeft+"px";if(startPositionX<mousePositionXY.x){divMiddel.style.marginTop="-54px";divContent.innerHTML="+"}else{divMiddel.style.marginTop="-63px";divContent.innerHTML="-"}if(divZoomBox.style.visibility!="visible"){divZoomBox.style.visibility="visible"}}function isMouseCursorInsideMap(mousePositionX,mousePositionY){if(mousePositionX<0||mousePositionX>mapWidthPixel){return false}if(mousePositionY<0||mousePositionY>mapHeightPixel){return false}return true}function prepareMouseZooming(mousePositionXY){startPositionX=mousePositionXY.x;startPositionY=mousePositionXY.y;var onMouseMoveListener=IWEventManager.addDomListener(window.document,"onmousemove",function(event){if(!event){event=window.event}var mousePositionXY=mouseAdapter.getPositionXY(event,map.getContainer());if(lastMousePositionX==mousePositionXY.x&&lastMousePositionY==mousePositionXY.y){return}lastMousePositionX=mousePositionXY.x;lastMousePositionY=mousePositionXY.y;if(isMouseCursorInsideMap(mousePositionXY.x,mousePositionXY.y)){redrawZoomingBox(mousePositionXY)}});var onMouseUpListener=IWEventManager.addListener(map,"onmouseup",function(mouseEvent){divZoomBox.style.visibility="hidden";IWEventManager.removeListener(onMouseMoveListener);IWEventManager.removeListener(onMouseUpListener);onMouseMoveListener=null;onMouseUpListener=null;map.getZoomingAndDraggingContainer().style.cursor="auto";var maptype=map.getCurrentMapType();var projection=maptype.getProjection();var endPositionX=mouseEvent.position.getX();var endPositionY=mouseEvent.position.getY();if(Math.abs(startPositionX-endPositionX)<5&&Math.abs(startPositionY-endPositionY)<5){return}var zoomCenterX=0;var zoomCenterY=0;var newZoomLevel=0;if(startPositionX<endPositionX){var coordNW=projection.pixelToMeter(new IWPoint(startPositionX,startPositionY));var coordSE=projection.pixelToMeter(mouseEvent.position);newZoomLevel=map.getBoundsZoomlevel(new IWBounds(coordNW,coordSE));zoomCenterX=((endPositionX-startPositionX)/2)+startPositionX}else{var distanceX=Math.abs(startPositionX-endPositionX);var distanceY=Math.abs(startPositionY-endPositionY);var size=map.getOptions().getSize();var currentWidth=size.getWidth();var currentHeight=size.getHeight();var factorX=currentWidth/distanceX;var factorY=currentHeight/distanceY;var offsetX=(factorX*currentWidth)/4;var offsetY=(factorY*currentHeight)/4;var coordNW=projection.pixelToMeter(new IWPoint(0-offsetX,0-offsetY));var coordSE=projection.pixelToMeter(new IWPoint(currentWidth+offsetX,currentHeight+offsetY));newZoomLevel=map.getZoomByMeter(coordSE.getX()-coordNW.getX());zoomCenterX=((startPositionX-endPositionX)/2)+endPositionX}if(startPositionY<endPositionY){zoomCenterY=((endPositionY-startPositionY)/2)+startPositionY}else{zoomCenterY=((startPositionY-endPositionY)/2)+endPositionY}var event=new IWZoomEvent();event.newZoomLevel=newZoomLevel;map.triggerOnZoomStart(event);map.zoom(map.getZoom(),newZoomLevel,zoomCenterX,zoomCenterY,true)})}IWEventManager.addDomListener(map.getZoomingAndDraggingContainer(),"onmousedown",function(event){var mouseButton=mouseAdapter.getButton(event);var options=map.getOptions();if((mouseButton==IWButton.LEFT&&options.getLeftMouseAction()==IWMapOptions.CONTROL_ZOOM)||(mouseButton==IWButton.RIGHT&&options.getRightMouseAction()==IWMapOptions.CONTROL_ZOOM)){var size=options.getSize();mapHeightPixel=size.getHeight();mapWidthPixel=size.getWidth();map.getZoomingAndDraggingContainer().style.cursor="crosshair";var mousePositionXY=mouseAdapter.getPositionXY(event,map.getContainer());prepareMouseZooming(mousePositionXY)}})}var iw={id:function(a){return document.getElementById(a)},search:function(c,d){if(c.id==d){return c}for(var a=0;a<c.childNodes.length;a++){var b=this.search(c.childNodes[a],d);if(b!=null){return b}}return null},name:function(a){return document.getElementsByName(a)},tag:function(a,b){return(b||document).getElementsByTagName(a)},hasClass:function(a,d){var f=[];var c=new RegExp("(^|\\s)"+a+"(\\s|$)");var g=document.getElementsByTagName(d||"*");for(var b=0;b<g.length;b++){if(c.test(g[b])){f.push(g[b])}}return f},clone:function(c){if(c==null||typeof(c)!="object"){return c}var a=new c.constructor();for(var b in c){if(c[b].cloneNode){a[b]=c[b].cloneNode(true)}else{a[b]=clone(c[b])}}return a},create:function(a){return document.createElement(a)},before:function(a,c,b){if(b==null){b=c;c=a;a=c.parentNode}try{a.insertBefore(iw.checkElem(b),c)}catch(d){}},append:function(a,b){a.appendChild(iw.checkElem(b))},checkElem:function(b){if(b!=null&&b.constructor==String){var a=iw.create("span");a.innerHTML=b;return a}return b},remove:function(a){if(a&&a.parentNode){a.parentNode.removeChild(a)}},getMousePositionXY:function(a){if(a.clientX||a.clientY){return{x:a.clientX,y:a.clientY}}else{if(a.pageX||a.pageY){return{x:a.pageX+document.body.scrollLeft+document.documentElement.scrollLeft,y:a.pageY+document.body.scrollTop+document.documentElement.scrollTop}}}},empty:function(a){while(a.firstChild){if(a.firstChild.firstChild){iw.empty(a.firstChild.firstChild)}iw.remove(a.firstChild)}},absolute:function(c,b){var g=c;var a=0;var h=0;do{var f=(g.style.left?parseInt(g.style.left):0);var d=(g.style.top?parseInt(g.style.top):0);if(g.style.position!="absolute"&&(f!=0||d!=0)){throw"Invalid positioning attribute: "+g.style.position+". Require absolute positioning."}a+=f;h+=d;g=g.parentNode}while(g.parentNode!=null&&g!=b);return new IWPoint(a,h)},backgroundImage:function(parent,imageURL){var img=iw.create("img");with(img.style){position="absolute";top="0px";left="0px";width="100%";height="100%"}if(imageURL.match(".*.png$")){img.onload=function(){correctPNG(this)}.iwclosure(img)}iw.append(parent,img);img.src=imageURL},strict:function(c,a){if(c.length!=a.length){throw"Invalid number of arguments. Excepted "+c.length+", received "+a.length+" instead."}for(var b=0;b<a.length;b++){if(a[b].constructor!=c[b]){throw"Invalid argument type. Excepted "+c[b].name+", received "+a[b].constructor.name+" instead."}}},extractFilePath:function(b){var a=b.match(/(.*)\/([^\/\\]+)(\.\w+)$/);if(a==null||a.length<=3){throw"extractFilePath: invalid filepath "+b}return{path:a[1],file:a[2],extension:a[3]}},fireMouseEvent:function(g,i,a){var f=0;var d=0;var c=0;var b=0;var h=0;if(typeof a!="undefined"){f=a.screenX;d=a.screenY;c=a.clientX;b=a.clientY;h=a.button}if(document.createEvent){var j=document.createEvent("MouseEvents");j.initMouseEvent(i,true,false,window,0,0,0,c,b,false,false,false,false,h,null);g.dispatchEvent(j)}else{if(document.createEventObject){var j=document.createEventObject();j.detail=0;j.screenX=f;j.screenY=d;j.clientX=c;j.clientY=b;j.ctrlKey=false;j.altKey=false;j.shiftKey=false;j.metaKey=false;j.button=h;j.relatedTarget=null;g.fireEvent("on"+i,j)}}},destroy:function(f){if(f==null){return}var c=f.attributes,d,b,h;if(c){b=c.length;for(d=0;d<b;d+=1){h=c[d].name;if(typeof f[h]==="function"){f[h]=null}}}c=f.childNodes;if(c){b=c.length;for(d=b;d>0;d--){iw.destroy(c[d-1])}}iw.remove(f);if(typeof f.outerHTML!="undefined"){try{f.outerHTML=null}catch(g){}}},getPageOffset:function(){var a=null;if(window.pageYOffset){a=new IWPoint(window.pageXOffset,window.pageYOffset)}else{if(document.documentElement&&document.documentElement.scrollTop){a=new IWPoint(document.documentElement.scrollLeft,document.documentElement.scrollTop)}else{if(document.body){a=new IWPoint(document.body.scrollLeft,document.body.scrollTop)}else{a=new IWPoint(0,0)}}}return a},getPageOffsetXY:function(){if(window.pageYOffset){return{x:window.pageXOffset,y:window.pageYOffset}}else{if(document.documentElement&&document.documentElement.scrollTop){return{x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}}else{if(document.body){return{x:document.body.scrollLeft,y:document.body.scrollTop}}else{return{x:0,y:0}}}}},random:function(b,a){return Math.floor(Math.random()*(a-b+1))+b},windowSize:function(){var b=0;var a=0;if(window.innerWidth&&window.innerHeight){b=window.innerWidth;a=window.innerHeight}else{if(document.documentElement.clientWidth&&document.documentElement.clientHeight){b=document.documentElement.clientWidth;a=document.documentElement.clientHeight}else{alert("Error reading window size!");return}}return new IWSize(b,a)},replace:function(f,c,a){if(f==null||c==null){return null}if(f.length==0||c.length==0){return f}if(a==null||a.length==0){a=""}var b=c.length;var d=a.length;var g=f.indexOf(c,0);while(g>=0){f=f.substring(0,g)+a+f.substring(g+b);g=f.indexOf(c,g+d)}return f},noPropagation:function(a){if(!a){a=window.event}a.cancelBubble=true;if(a.stopPropagation){a.stopPropagation()}return false},disableSelection:function(a){if(typeof a.onselectstart!="undefined"){a.onselectstart=function(c){var f=c?c:window.event;if(f.button!=1){var b=null;if(f.target){b=f.target}else{if(f.srcElement){b=f.srcElement}}var d=b.tagName.toLowerCase();if((d!="input")&&(d!="textarea")){return false}}}}else{if(typeof a.style.MozUserSelect!="undefined"){a.style.MozUserSelect="-moz-none"}else{a.onmousedown=function(){return false}}}},enableSelection:function(a){if(typeof a.onselectstart!="undefined"){}else{if(typeof a.style.MozUserSelect!="undefined"){a.style.MozUserSelect="text"}else{a.onmousedown=function(){return true}}}}};function IWCloneable(){this.clone=function(){alert("Methode clone is not implemented.")}}function IWDraggable(m,j){var n=this;var v=log4javascript.getLogger("IWDraggable");var f=false;var g=null;var k=false;var w=IWButton.LEFT;var b=null;var d=null;var s=null;var u=new IWMouseAdapter();var i=null;var c=null;var o=null;var q=null;var r=window.document;if(typeof m=="undefined"){m=null}if(typeof j=="undefined"){j=null}this.allowDraggingOutsideParent=function(x){if(x==true||x==false){k=x}else{throw"Type exception allowDraggingOutsideParent: "+x+". A boolean value is needed."}};this.isDraggingOutsideParentAllowed=function(){return k};this.setOnMouseMoveContainer=function(x){r=x};this.getOnMouseMoveContainer=function(){return r};this.setDraggingBounds=function(x){q=x};this.getDraggingBounds=function(){return q};this.setDraggable=function(x){if(x==true||x==false){f=x}else{throw"Type exception draggable: "+x+". A boolean value is needed."}if(f){IWEventManager.addDomListener(g,"ondrag",function(y){return iw.noPropagation(y)});s=IWEventManager.addDomListener(g,"onmousedown",function(A){if(!A){A=window.event}if(A.cancelable){A.preventDefault()}var z=u.toMouseEvent(A,j);if(f&&(w&z.button)){var H=parseInt(m.style.left);var G=parseInt(m.style.top);var D=iw.absolute(m,j);var C=z.position.getX()-D.getX();var B=z.position.getY()-D.getY();c=new IWPoint(C,B);var F=z.position.getX()-c.getX()-(D.getX()-H);var E=z.position.getY()-c.getY()-(D.getY()-G);i=new IWPoint(F,E);o=i;document.body.style.cursor=g.style.cursor="move";a()}})}else{if(s!=null){document.body.style.cursor=g.style.cursor="auto";IWEventManager.removeListener(s)}}};this.isDraggable=function(){return f};this.setDraggableContainer=function(x){if(x.style){g=x}else{throw"Type exception container: "+x+"."}};this.getDraggableContainer=function(){return g};this.setDragButton=function(x){var y=parseInt(x);if(y&(IWButton.LEFT+IWButton.MIDDLE+IWButton.RIGHT)){w=x}else{throw"Invalid drag button "+x+". Use one of the following constants: IWButton.LEFT, IWButton.MIDDLE or IWButton.RIGHT."}};this.getDragButton=function(){return w};this.triggerOnDragStart=function(x){v.info("Calling triggerOnDragStart with "+x+".");IWEventManager.trigger(this,"ondragstart",x)};this.triggerOnDrag=function(x){v.info("Calling triggerOnDrag with "+x+".");IWEventManager.trigger(this,"ondrag",x)};this.triggerOnDragEnd=function(x){v.info("Calling triggerOnDragEnd with "+x+".");IWEventManager.trigger(this,"ondragend",x)};function a(){v.debug("Function prepareDragging is called.");var x=new IWMouseEvent();x.position=o;x.lastPosition=o;x.offset=new IWPoint(0,0);n.triggerOnDragStart(x);IWEventManager.removeListener(b);IWEventManager.removeListener(d);b=null;d=null;b=IWEventManager.addDomListener(r,"onmousemove",function(y){var z=u.toMouseEvent(y,j);if(q==null||q.containsPoint(z.position)){t(z)}else{h()}});d=IWEventManager.addDomListener(r,"onmouseup",function(){h()})}function t(z){v.debug("Calling drag with "+z+".");var G=z.position;var C=new IWPoint(G.getX()-c.getX(),G.getY()-c.getY());if(!k){var A=parseInt(j.style.width);var H=parseInt(j.style.height);if(C.getX()+m.offsetWidth>=A){C.setX(A-m.offsetWidth)}else{if(C.getX()<=0){C.setX(0)}}if(C.getY()+m.offsetHeight>=H){C.setY(H-m.offsetHeight)}else{if(C.getY()<=0){C.setY(0)}}}var F=parseInt(m.style.left);var D=parseInt(m.style.top);var B=iw.absolute(m,j);m.style.left=C.getX()-(B.getX()-F)+"px";m.style.top=C.getY()-(B.getY()-D)+"px";var J=C.getX()-o.getX();var I=C.getY()-o.getY();var E=new IWMoveEvent();E.position=C;E.lastPosition=o;E.offset=new IWPoint(J,I);o=C;n.triggerOnDrag(E)}function h(){v.debug("Calling drop.");IWEventManager.removeListener(b);IWEventManager.removeListener(d);b=null;d=null;g.style.cursor="pointer";document.body.style.cursor="auto";var z=o.getX()-i.getX();var y=o.getY()-i.getY();var x=new IWMoveEvent();x.position=o;x.lastPosition=i;x.offset=new IWPoint(z,y);n.triggerOnDragEnd(x)}this.setDraggableContainer(m)}function IWNodeElement(b){var f=null;var d=new Array();var c=false;var g=false;var a=log4javascript.getLogger("IWNodeElement");this.isNodeElement=true;this.setParent=function(h){if(h!=null&&!h.isNodeElement){throw'NodeElement.setParent: "'+h+'" does not implement tree functionality!'}f=h};this.hasChildren=function(){return(d!=null&&d.length!=0)};this.hasChild=function(j){for(var h=0;h<d.length;h++){if(j==d[h]){return true}}return false};this.getChildren=function(){return d};this.getParent=function(){return f};this.add=function(h){if(!h.isNodeElement){throw'NodeElement.add: "'+h+'" does not implement tree functionality!'}if(this.hasChild(h)||this.checkIfExistsAsParent(h)||h.getParent()!=null){throw'NodeElement.add: Node "'+h.getName()+'" could not be added'}h.setParent(this);this.getChildren().push(h)};this.remove=function(j){if(!this.hasChild(j)){throw"NodeElement.remove: Node not found"}j.setParent(null);for(var h=0;h<this.getChildren().length;h++){if(j==this.getChildren()[h]){this.getChildren().splice(h,1);break}}};this.getName=function(){return b};this.setName=function(h){b=h};this.checkIfExistsAsParent=function(h){if(h==this){return true}if(this.getParent()==null){return false}return this.getParent().checkIfExistsAsParent(h)};this.mark=function(){var h=c;c=true;if(h!=c){this.triggerOnStateChange()}};this.unmark=function(){var h=c;c=false;if(h!=c){this.triggerOnStateChange()}};this.isMarked=function(){return c};this.collapse=function(){var h=g;g=true;if(h!=g){this.triggerOnViewChange()}};this.expand=function(){var h=g;g=false;if(h!=g){this.triggerOnViewChange()}};this.isCollapsed=function(){return g};this.triggerOnStateChange=function(){IWEventManager.trigger(this,"onstatechange",null)};this.triggerOnViewChange=function(){IWEventManager.trigger(this,"onviewchange",null)}}function IWSessionKeeper(){var a=iw.create("img");a.width="0px";a.height="0px";a.style.position="absolute";a.style.left="0px";a.style.top="0px";a.style.display="none";document.body.appendChild(a);if(iwconst.KEEPALIVE_INTERVAL>0){window.setInterval(function(){a.src=iwconst.GLOBAL_APP_URL+"img/symbols/blank.gif?randomKey="+iw.random(0,1000000000)},iwconst.KEEPALIVE_INTERVAL*1000)}}function IWFormatNodeEvent(){this.obj=null;this.node=null;this.toString=function(){return"[IWFormatNodeEvent]"}}function IWTreeNode(f){var a=null;var c=null;var b=null;var g=null;var i=null;var d=new Array();var h=null;var j=log4javascript.getLogger("IWTreeNode");this.hasParent=function(){return i!=null};this.setParent=function(k){i=k};this.hasChildren=function(){return(d.length>0)};this.addChild=function(k){d.push(k)};this.getChildren=function(){return d};this.getNode=function(){return f};this.getCheckbox=function(){return h};this.setCheckbox=function(k){h=k};this.setState=function(m){var k=m.toLowerCase();if(k=="expanded"||k=="collapsed"){a=k}else{throw"Invalid state: "+a}};this.getState=function(){return a};this.setContainer=function(k){b=k};this.getContainer=function(){return b};this.setLastChild=function(k){c=k};this.isLastChild=function(){return c};this.isExpanded=function(){return(a=="expanded")};this.isCollapsed=function(){return(a=="collapsed")};this.getDomNode=function(){return g};this.getTreeImage=function(){return treeImage};this.setDomNode=function(k){g=k};this.toString=function(){return"[IWTreeNode] node: "+f.toString()+", state: "+a+", hasParent: "+this.hasParent()+", hasChildren: "+this.hasChildren()+", isLastChild: "+c+", isExpanded: "+this.isExpanded()+", isCollapsed: "+this.isCollapsed()}}function IWTreeNodeClickedEvent(){this.treeNode=null;this.toString=function(){return"[IWTreeNodeClickedEvent] treeNode: "+this.treeNode.toString()}}function IWTreeView(m){var o=this;var b=new Array();var i=new Array();var c=iw.create("div");var n=log4javascript.getLogger("IWTreeView");this.addNodes=function(q){for(var r=0;r<q.length;r++){this.addNode(q[r])}};this.addNode=function(q){b.push(q)};this.getNodes=function(){return b};this.getContainer=function(){return c};this.getParent=function(){return m};this.getTreenodes=function(){return i};this.build=function(){iw.empty(m);c.style.visibility="hidden";iw.append(m,c);for(var q=0;q<b.length;q++){var r=b[q];if(q==(b.length-1)){h(null,r,2,"1",false)}else{h(null,r,2,"0",false)}}c.style.visibility="visible"};function d(q){q.id="treeview";q.style.position="relative";q.style.top="0px";q.style.left="0px";q.style.width=m.style.width;q.style.height=m.style.height;q.style.overflow="auto"}function f(q){if(q.isCollapsed()){k(q)}else{if(q.isExpanded()){j(q)}}}function h(B,x,A,w,t){var D=iw.create("div");iw.append(c,D);D.style.display="block";var F=new IWTreeNode(x);if(x.isCollapsed()){F.setState("collapsed")}else{F.setState("expanded")}F.setContainer(D);F.setLastChild(w.charAt(w.length-1)=="1");IWEventManager.addListener(x,"onstatechange",function(){this.getCheckbox().checked=this.getNode().isMarked()}.iwclosure(F));IWEventManager.addListener(x,"onviewchange",function(){n.debug("Receiving viewchanged event for "+x);if(this.getNode().isCollapsed()){j(this)}else{k(this)}}.iwclosure(F));if(B!=null){B.addChild(F);F.setParent(B)}else{i.push(F)}var G=iw.create("table");iw.append(D,G);G.border="0px";G.cellPadding="0px";G.cellSpacing="0px";var E=G.insertRow(0);for(z=0;z<A;z++){var y=iw.create("td");iw.append(E,y);y.style.verticalAlign="top";y.style.margin="0px";if(z==(A-1)){var C=null;if(IWBrowser.isInternetExplorer()){if(x.isMarked()){C=iw.create("<input type='checkbox' checked>")}else{C=iw.create("<input type='checkbox'>")}}else{C=iw.create("input");C.type="checkbox";C.checked=x.isMarked()}C.style.border="0px";F.setCheckbox(C);y.className="treeviewNode";iw.append(y,C);var q=new IWFormatNodeEvent();q.obj=null;q.node=x;o.triggerOnFormatNode(q);if(q.obj!=null){iw.append(y,q.obj)}else{iw.append(y,x.getName())}IWEventManager.addDomListener(C,"onclick",function(){this.getNode().setVisible(this.getCheckbox().checked);var s=new IWTreeNodeClickedEvent();s.treeNode=this;o.triggerOnNodeClick(s)}.iwclosure(F))}else{y.style.width="16px";y.style.height="22px";var r=iw.create("div");r.style.height="22px";r.style.width="16px";iw.append(y,r);F.setDomNode(y);y.style.background="url("+iwconst.GLOBAL_APP_URL+"img/controls/treeview/sprite-treeview.gif) no-repeat top left";if(z==(A-2)){if(x.hasChildren()){if(F.isExpanded()){y.title="collapse";if(w.charAt(z)=="1"){y.style.backgroundPosition="0 -388px"}else{y.style.backgroundPosition="0 -532px"}}else{y.title="expand";if(w.charAt(z)=="1"){y.style.backgroundPosition="0 -316px"}else{y.style.backgroundPosition="0 -460px"}}y.style.cursor="pointer";y.onclick=function(){f(this)}.iwclosure(F)}else{if(w.charAt(z)=="1"){y.style.backgroundPosition="0 -244px"}else{y.style.backgroundPosition="0 -172px"}}}else{if(w.charAt(z)=="0"){y.style.backgroundPosition="0 0";y.style.backgroundRepeat="repeat-y"}else{y.style.backgroundPosition="0 -100px"}}}}if(t){F.getContainer().style.display="none";F.getContainer().style.visibility="hidden"}if(x.hasChildren()){A++;var v=x.getChildren();for(var z=0;z<v.length;z++){var u=v[z];var H=w;if(z==(v.length-1)){H+="1"}else{H+="0"}h(F,u,A,H,(t||F.isCollapsed()))}}}this.triggerOnNodeClick=function(q){IWEventManager.trigger(this,"onnodeclick",q)};this.triggerOnFormatNode=function(q){IWEventManager.trigger(this,"onformatnode",q)};function j(r){g(r);r.setState("collapsed");var q=r.getDomNode();q.title="expand";if(r.isLastChild()==true){q.style.backgroundPosition="0 -316px"}else{q.style.backgroundPosition="0 -460px"}}function g(s){var r=s.getChildren();for(var q=0;q<r.length;q++){var s=r[q];s.getContainer().style.display="none";s.getContainer().style.visibility="hidden";if(s.hasChildren()){g(s)}}}function k(r){a(r);r.setState("expanded");var q=r.getDomNode();q.title="collapse";if(r.isLastChild()==true){q.style.backgroundPosition="0 -388px"}else{q.style.backgroundPosition="0 -532px"}}function a(s){var r=s.getChildren();for(var q=0;q<r.length;q++){var s=r[q];s.getContainer().style.display="block";s.getContainer().style.visibility="visible";if(s.hasChildren()&&s.isExpanded()){a(s)}}}d(c)}function IWBounds(b,a){this.getNorthWest=function(){return b};this.getSouthEast=function(){return a};this.getCenter=function(){var d=b.getX()+(a.getX()-b.getX())/2;var c=a.getY()+(b.getY()-a.getY())/2;return new b.constructor(d,c)};this.getSize=function(){var d=a.getX()-b.getX();var c=b.getY()-a.getY();return new IWSize(d,c)};this.isEmpty=function(){return b.equals(a)};this.containsCoordinate=function(h){var c=Math.min(b.getX(),a.getX());var f=Math.max(b.getX(),a.getX());if(c<=h.getX()&&f>=h.getX()){var g=Math.min(b.getY(),a.getY());var d=Math.max(b.getY(),a.getY());if(g<=h.getY()&&d>=h.getY()){return true}}return false};this.extendBy=function(c){if(c.getX()<b.getX()){b=new b.constructor(c.getX(),b.getY())}else{if(c.getX()>a.getX()){a=new a.constructor(c.getX(),a.getY())}}if(c.getY()>b.getY()){b=new b.constructor(b.getX(),c.getY())}else{if(c.getY()<a.getY()){a=new a.constructor(a.getX(),c.getY())}}};this.equals=function(c){if(this.getNorthWest().equals(c.getNorthWest())){if(this.getSouthEast().equals(c.getSouthEast())){return true}}return false};this.contains=function(c){if(this.containsCoordinate(c.getNorthWest())){if(this.containsCoordinate(c.getSouthEast())){return true}}return false};this.intersects=function(h){if(this.containsCoordinate(h.getNorthWest())||h.containsCoordinate(this.getNorthWest())){return true}if(this.containsCoordinate(h.getSouthEast())||h.containsCoordinate(this.getSouthEast())){return true}var f=new b.constructor(a.getX(),b.getY());var c=new b.constructor(h.getSouthEast().getX(),h.getNorthWest().getY());if(this.containsCoordinate(c)||h.containsCoordinate(f)){return true}var g=new b.constructor(b.getX(),a.getY());var d=new b.constructor(h.getNorthWest().getX(),h.getSouthEast().getY());if(this.containsCoordinate(d)||h.containsCoordinate(g)){return true}return false};this.toString=function(){return"[IWBounds] coordNW: "+b.toString()+", coordSE: "+a.toString()}}function IWCoordinate(g,d,f){IWCloneable.call(this);var b=5;var j=0;var i=0;var c=IWCoordinate.MERCATOR;var h=log4javascript.getLogger("IWCoordinate");this.getX=function(){return j};this.setX=function(k){j=k};this.getY=function(){return i};this.setY=function(k){i=k};this.setProjectionType=function(k){c=k};this.getProjectionType=function(){return c};this.toWGS84=function(){if(c==IWCoordinate.WGS84){return this.clone()}else{if(c==IWCoordinate.MERCATOR){var k=j/PROJECTION_CONST_MERCATOR_LONGITUDE_FACTOR;var m=(2*Math.atan(Math.exp(i/PROJECTION_CONST_MERCATOR_A))-PROJECTION_CONST_MERCATOR_PI_OVER_2)/PROJECTION_CONST_MERCATOR_PI_OVER_180;return new IWCoordinate(k,m,IWCoordinate.WGS84)}}};this.toMercator=function(){if(c==IWCoordinate.MERCATOR){return this.clone()}else{if(c==IWCoordinate.WGS84){var n=j*PROJECTION_CONST_MERCATOR_LONGITUDE_FACTOR;var k=Math.sin(i*PROJECTION_CONST_MERCATOR_PI_OVER_180);var m=0.5*Math.log((1+k)/(1-k))*PROJECTION_CONST_MERCATOR_A;return new IWCoordinate(n,m,IWCoordinate.MERCATOR)}}};this.equals=function(k){return this.distanceFrom(k)<b};this.distanceFrom=function(m){var y=this.toWGS84();var x=m.toWGS84();var o=y.getY();var s=y.getX();var n=x.getY();var r=x.getX();var q=6378137;var u=a(n-o);var k=a(r-s);var w=Math.sin(u/2)*Math.sin(u/2)+Math.cos(a(o))*Math.cos(a(n))*Math.sin(k/2)*Math.sin(k/2);var v=2*Math.atan2(Math.sqrt(w),Math.sqrt(1-w));var t=q*v;return t};function a(k){return k*(Math.PI/180)}this.clone=function(){return new IWCoordinate(j,i,f)};this.toString=function(){return"("+j+"/"+i+") "+c};if(typeof d!="undefined"){j=parseFloat(g);i=parseFloat(d);if(typeof f!="undefined"){c=f}}}IWCoordinate.LCC="LCC_EUROPE";IWCoordinate.MERCATOR="MERCATOR";IWCoordinate.WGS84="WGS84";var PROJECTION_CONST_MERCATOR_A=6378137;var PROJECTION_CONST_MERCATOR_LONGITUDE_FACTOR=Math.PI/180*6378137;var PROJECTION_CONST_MERCATOR_PI_OVER_2=Math.PI/2;var PROJECTION_CONST_MERCATOR_PI_OVER_180=Math.PI/180;function IWIcon(g,a,b){var c="";var f=new IWPoint(0,0);var d=null;this.setUrl=function(h){c=h};this.getUrl=function(){return c};this.setHotspot=function(h){f=h};this.getHotspot=function(){return f};this.setSize=function(h){iw.strict([IWSize],[h]);d=h};this.getSize=function(){return d};this.toString=function(){return"[IWIcon] url: "+c+", hotspot: "+(f!=null?f.toString():"null")+", size: "+(d!=null?d.toString():"null")};if(typeof g!="undefined"){this.setUrl(g)}if(typeof a!="undefined"){this.setHotspot(a)}if(typeof b!="undefined"){this.setSize(b)}}function IWLine(c,b){var a;var d;this.getSlope=function(){return a};this.getIntercept=function(){return d};this.getIntersection=function(g){var f;var h;if(a==g.getSlope()){f=-1000000}else{f=(g.getIntercept()-d)/(a-g.getSlope())}h=a*f+d;return new IWCoordinate(f,h)};this.toString=function(){return"y = "+a+" * x + "+d};if(c.getX()==b.getX()){a=1000}else{a=(b.getY()-c.getY())/(b.getX()-c.getX())}d=c.getY()-a*c.getX()}function IWPoint(a,d){IWCloneable.call(this);var c=0;var b=0;this.setX=function(g){var f=parseFloat(g);if(isNaN(f)){throw"IWPoint: x parameter is not a number."}c=f};this.getX=function(){return c};this.setY=function(g){var f=parseFloat(g);if(isNaN(f)){throw"IWPoint: y parameter is not a number."}b=f};this.getY=function(){return b};this.substract=function(f){return new IWPoint(c-f.getX(),b-f.getY())};this.add=function(f){return new IWPoint(c+f.getX(),b+f.getY())};this.distanceFrom=function(f){var h=c-f.getX();var g=b-f.getY();return Math.sqrt(h*h+g*g)};this.equals=function(f){return(f.getX()==c&&f.getY()==b)};this.clone=function(){return new IWPoint(c,b)};this.toString=function(){return"[IWPoint] ("+c+"/"+b+")"};if(typeof a!="undefined"&&typeof d!="undefined"){this.setX(a);this.setY(d)}}function IWRange(c,d){var b=Number.MIN_VALUE;var a=Number.MAX_VALUE;this.setMin=function(f){if(isNaN(f)){throw"Minimum value is not a number: "+f}if(f>a){throw"Minimum value is greater than the maximum value: "+f+">"+a}b=f};this.setMax=function(f){if(isNaN(f)){throw"Maximum value is not a number: "+f}if(f<b){throw"Maximum value is less than the minimum value: "+f+"<"+b}a=f};this.getMin=function(){return b};this.getMax=function(){return a};this.contains=function(f){iw.strict([Number],arguments);return(b<=f&&f<=a)};this.toString=function(){return"[IWRange] "+b+" .. "+a};this.setMin(c);this.setMax(d)}function IWScaleDependentIcon(d,c,b,a){IWIcon.call(this,d,c,b);var f=new IWRange(0,100);this.setRange=function(g){iw.strict([IWRange],[g]);f=g};this.getRange=function(){return f};this.toString=function(){return"[IWScaleDependentIcon]"};if(typeof a!="undefined"){this.setRange(a)}}function IWSize(d,b){IWCloneable.call(this);var a=0;var c=0;this.setWidth=function(g){var f=parseInt(g);if(f==NaN||f<0){throw"IWSize: Width parameter must be a positive integer value: "+g}a=f};this.getWidth=function(){return a};this.setHeight=function(f){var g=parseInt(f);if(g==NaN||g<0){throw"IWSize: Height parameter must be a positive integer value: "+f}c=g};this.getHeight=function(){return c};this.equals=function(f){return(this.getWidth()==f.getWidth()&&this.getHeight()==f.getHeight())};this.compareTo=function(h){var g=a*c;var f=h.getWidth()*h.getHeight();if(g>f){return 1}else{if(g<f){return -1}else{return 0}}};this.containsPoint=function(f){return(f.getX()>=0&&f.getX()<=this.getWidth()&&f.getY()>=0&&f.getY()<=this.getHeight())};this.multiplicate=function(f){return new IWSize(a*f,c*f)};this.divide=function(f){return new IWSize(a/f,c/f)};this.clone=function(){return new IWSize(a,c)};this.toString=function(){return"[IWSize] "+a+" x "+c};this.setWidth(d);this.setHeight(b)}function IWCopyrightChangeEvent(){this.copyright=""}function IWEventListener(){this.id=IWEventListener.prototype.instanceId++;this.type="";this.objectHandler=null;this.removeFunction=null;this.obj=null;this.toString=function(){return"[IWEventListener] id: "+this.id+", type: "+this.type+", objectHandler: "+this.objectHandler+", removeFunction: "+this.removeFunction+", obj: "+this.obj}}IWEventListener.prototype.instanceId=0;var IWEventManager=new function(){var logger=log4javascript.getLogger("IWEventManager");this.addListener=function(obj,eventName,eventHandler){var eventListener=this.bind(obj,eventName,null,eventHandler);return eventListener};this.addDomListener=function(obj,eventName,eventHandler){var eventListener=null;if(obj.addEventListener||obj.attachEvent){eventListener=new IWEventListener();if(!obj.domListenerDelegate){obj.domListenerDelegate=new Object()}if(!obj.domListenerDelegate[eventName]){obj.domListenerDelegate[eventName]=new Array()}if(obj.addEventListener){var name=eventName.indexOf("on")==0?eventName.substring(2):eventName;obj.addEventListener(name,eventHandler,false);eventListener.type="W3C";eventListener.removeFunction=function(){obj.removeEventListener(name,eventHandler,false);var arr=obj.domListenerDelegate[eventName];for(var i=arr.length;i>0;i--){if(arr[(i-1)].method==eventHandler){arr.splice(i-1,1)}}}}else{if(obj.attachEvent){obj.attachEvent(eventName,eventHandler);eventListener.type="MS";eventListener.removeFunction=function(){obj.detachEvent(eventName,eventHandler);var arr=obj.domListenerDelegate[eventName];for(var i=arr.length;i>0;i--){if(arr[(i-1)].method==eventHandler){arr.splice(i-1,i)}}}}}var objectHandler=new Object();objectHandler.listenerObject=eventListener;objectHandler.method=eventHandler;obj.domListenerDelegate[eventName].push(objectHandler)}else{eventListener=this.bind(obj,eventName,null,eventHandler)}return eventListener};this.trigger=function(obj,eventName,theEvent){logger.trace("Triggering "+eventName+" on "+obj+" with parameter "+theEvent);try{var f=eval("obj."+eventName);if(typeof f!="undefined"){f(theEvent)}}catch(e){logger.error("Trigger error: "+e)}};this.removeListener=function(eventListener){if(eventListener==null){}else{if(eventListener.removeFunction){eventListener.removeFunction()}else{logger.error("Could not remove event listener "+eventListener+" "+this.removeListener.caller)}}return null};this.clearListeners=function(obj,eventName){if(obj.iwListenerDelegate&&obj.iwListenerDelegate[eventName]){obj.iwListenerDelegate[eventName]=null;logger.debug("Removed all "+eventName+" listeners from "+obj)}if(obj.domListenerDelegate&&obj.domListenerDelegate[eventName]){var arr=obj.domListenerDelegate[eventName];for(var i=arr.length;i>0;i--){arr[(i-1)].listenerObject.removeFunction()}logger.debug("Removed all "+eventName+" listeners from "+obj)}else{logger.debug("Removing "+eventName+" listeners from "+obj+": Nothing registered")}};this.clearInstanceListeners=function(obj){if(typeof obj.iwListenerDelegate!="undefined"){obj.iwListenerDelegate=null}if(typeof obj.domListenerDelegate!="undefined"){for(eventName in obj.domListenerDelegate){var arr=obj.domListenerDelegate[eventName];for(var i=arr.length;i>0;i--){arr[(i-1)].listenerObject.removeFunction()}}}};this.bind=function(obj,eventName,listenerObj,eventHandler){if(!obj.iwListenerDelegate){obj.iwListenerDelegate=new Object()}if(!obj.iwListenerDelegate[eventName]){obj.iwListenerDelegate[eventName]=new Array()}var objectHandler=new Object();objectHandler.listenerObject=listenerObj;objectHandler.method=eventHandler;obj.iwListenerDelegate[eventName].push(objectHandler);obj[eventName]=function(e){if(obj.iwListenerDelegate!=null&&obj.iwListenerDelegate[eventName]!=null){var objectHandlerArr=obj.iwListenerDelegate[eventName];for(var i=objectHandlerArr.length;i>0;i--){var theObjectHandler=objectHandlerArr[(i-1)];var theObject=theObjectHandler.listenerObject;var theMethod=theObjectHandler.method;try{if(theObject!=null){theMethod.call(theObject,e)}else{theMethod(e)}}catch(ex){logger.warn("Listener method for "+eventName+" threw an exception: "+theMethod+" exception: "+ex)}}}};var eventListener=new IWEventListener();eventListener.type="IW";eventListener.objectHandler=objectHandler;eventListener.removeFunction=function(){if(obj==null){logger.debug("Removing event listener aborted. The object is not accessible.")}if(obj.iwListenerDelegate==null){logger.debug("Removing event listener aborted. The object has no listener delegate.")}else{var arr=obj.iwListenerDelegate[eventName];for(var i=arr.length;i>0;i--){if(arr[(i-1)]==eventListener.objectHandler){arr.splice(i-1,1)}}}};return eventListener};function getObjectName(obj){if(obj.id&&((""+obj.id).length>0)){return obj.id}else{if(obj.name&&((""+obj.name).length>0)){return obj.name}else{if(obj.toString&&obj.toString().length>0){return obj.toString()}else{return"unnamed object"}}}}};function IWKeyboardAdapter(){var a=this;var c=log4javascript.getLogger("IWKeyboardAdapter");this.triggerOnKeyDown=function(h){IWEventManager.trigger(this,"onkeydown",h)};this.triggerOnKeyUp=function(h){IWEventManager.trigger(this,"onkeyup",h)};this.triggerOnKeyPress=function(h){IWEventManager.trigger(this,"onkeypress",h)};function g(h){c.debug("Calling onKeyDownHandler with "+h);a.triggerOnKeyDown(d(h))}function f(h){c.debug("Calling onKeyPressHandler with "+h);a.triggerOnKeyPress(d(h))}function b(h){c.debug("Calling onKeyUpHandler with "+h);a.triggerOnKeyUp(d(h))}function d(i){if(!i){i=window.event}c.debug("Calling createKeyboardEvent with "+i);var k=i.keyCode?i.keyCode:i.which;var h=i.srcElement?i.srcElement.tagName:i.target.tagName;var j=new IWKeyboardEvent();j.keyCode=k;j.tagName=h.toUpperCase();return j}IWEventManager.addDomListener(document,"onkeydown",g);IWEventManager.addDomListener(document,"onkeypress",f);IWEventManager.addDomListener(document,"onkeyup",b)}IWKeyboardAdapter.PLUS_KEY=107;IWKeyboardAdapter.MINUS_KEY=109;IWKeyboardAdapter.ARROW_LEFT_KEY=37;IWKeyboardAdapter.ARROW_UP_KEY=38;IWKeyboardAdapter.ARROW_RIGHT_KEY=39;IWKeyboardAdapter.ARROW_DOWN_KEY=40;function IWKeyboardEvent(){this.keyCode=null;this.tagName=null;this.toString=function(){return"[IWKeyboardEvent]"}}function IWLanguageChangeEvent(){this.language=""}function IWMapCenterEvent(){this.coordinate=null;this.lastCoordinate=null;this.offset=null;this.zoom=null;this.lastZoom=null;this.toString=function(){return"[IWMapCenterEvent] coordinate: "+this.coordinate+", last coordinate: "+this.lastCoordinate+", offset: "+this.offset+", zoom: "+this.zoom+", last zoom: "+this.lastZoom}}function IWMapControlChangeEvent(){this.mouseAction="";this.controlMethod=-1;this.toString=function(){return"[IWMapControlChangeEvent] mouseAction: "+this.mouseAction+", controlMethod: "+this.controlMethod}}function IWMapInitializeEvent(){this.toString=function(){return"[IWMapInitializeEvent]"}}function IWMapTypeAvailabilityChangeEvent(){this.type=null;this.available=null;this.toString=function(){return"[IWMapTypeAvailabilityChangeEvent] type: "+this.type+", available: "+this.available}}function IWMapTypeChangeEvent(){this.newMapType=null;this.oldMapType=null;this.toString=function(){return"[IWMapTypeChangeEvent] newMapType: "+(this.newMapType!=null?this.newMapType:"null")+", oldMapType: "+(this.oldMapType!=null?this.oldMapType:"null")}}function IWMapTypesChangeEvent(){this.mapTypes=null;this.toString=function(){return"[IWMapTypesChangeEvent]"}}function IWMeasuringEvent(){this.distance=0;this.toString=function(){return"[IWMeasuringEvent] distance: "+this.distance}}function IWMouseAdapter(){var b=null;var f=null;var a=null;var d=null;var c=log4javascript.getLogger("IWMouseAdapter");this.getButton=function(g){if(!g){g=window.event}if(g.which==null){return(g.button<2)?IWButton.LEFT:((g.button==4)?IWButton.MIDDLE:IWButton.RIGHT)}else{return(g.which<2)?IWButton.LEFT:((g.which==2)?IWButton.MIDDLE:IWButton.RIGHT)}};this.toMouseEvent=function(j,i){if(!j){j=window.event}if(a&&a==j){return d}var k=new IWMouseEvent();var h=this.getPositionXY(j,i);k.position=new IWPoint(h.x,h.y);k.positionXY={x:h.x,y:h.y};k.lastPosition=b;k.lastPositionXY=f;b=k.position;f={x:k.positionXY.x,y:k.positionXY.y};var g=0,m=0;if(k.lastPositionXY!=null){g=k.positionXY.x-k.lastPositionXY.x;m=k.positionXY.y-k.lastPositionXY.y}k.offset=new IWPoint(g,m);k.offsetX=g;k.offsetY=m;k.button=this.getButton(j);d=k;a=j;return k};this.getPositionXY=function(j,h){var g=0,o=0,m=0,k=0;if(h!=null&&typeof h!="undefined"){m=(h.offsetLeft?h.offsetLeft:0);k=(h.offsetTop?h.offsetTop:0);while(h.offsetParent){h=h.offsetParent;m+=(h.offsetLeft?h.offsetLeft:0);k+=(h.offsetTop?h.offsetTop:0)}}var i=iw.getMousePositionXY(j);var n=iw.getPageOffsetXY();g=i.x-m+n.x;o=i.y-k+n.y;return{x:g,y:o}};this.getPosition=function(j,i){var h=0,o=0,m=0,k=0;if(i!=null&&typeof i!="undefined"){m=(i.offsetLeft?i.offsetLeft:0);k=(i.offsetTop?i.offsetTop:0);while(i.offsetParent){i=i.offsetParent;m+=(i.offsetLeft?i.offsetLeft:0);k+=(i.offsetTop?i.offsetTop:0)}}var g=0,n=0;if(j.clientX||j.clientY){g=j.clientX;n=j.clientY}else{if(j.pageX||j.pageY){g=j.pageX+document.body.scrollLeft+document.documentElement.scrollLeft;n=j.pageY+document.body.scrollTop+document.documentElement.scrollTop}}h=g-m;o=n-k;return new IWPoint(h,o)};this.toString=function(){return"[IWMouseAdapter] last mouse event: "+(d!=null?d.toString():"")}}function IWMouseEvent(){this.position=null;this.lastPosition=null;this.offset=null;this.scrollbarOffset=null;this.button=IWButton.NONE;this.toString=function(){return"[IWMouseEvent] position: "+(this.position==null?"":this.position.toString())+", lastPosition: "+(this.lastPosition==null?"":this.lastPosition.toString())+", offset: "+(this.offset==null?"":this.offset.toString())+", scrollbarOffset: "+(this.scrollbarOffset==null?"":this.scrollbarOffset.toString())+", button: "+this.button}}function IWMouseWheelAdapter(a){var b=this;var c=log4javascript.getLogger("IWMouseWheelAdapter");this.triggerOnMouseWheel=function(f){IWEventManager.trigger(this,"onmousewheel",f)};this.toString=function(){return"[IWMouseAdapter]"};function d(f){c.debug("Calling catchEvent");if(!f){f=window.event}f.cancel=true;f.returnValue=false;iw.noPropagation(f);if(f.preventDefault){f.preventDefault()}var h=0;if(f.wheelDelta){h=parseInt(f.wheelDelta);if(h<0){h=-1}else{h=1}}else{if(f.detail){h=parseInt(f.detail);if(h<0){h=1}else{h=-1}if(window.opera){h=-h}}}var g=new IWMouseWheelEvent();g.delta=h;g.mouseEvent=f;b.triggerOnMouseWheel(g)}IWEventManager.addDomListener(a,"onmousewheel",function(f){d(f)});IWEventManager.addDomListener(a,"DOMMouseScroll",function(f){d(f)})}function IWMouseWheelEvent(){this.delta=null;this.toString=function(){return"[IWMouseWheelEvent] delta: "+(this.delta==null?"":this.delta.toString())}}function IWMoveEvent(){this.positionX=0;this.positionY=0;this.lastPositionX=0;this.lastPositionY=0;this.offsetX=0;this.offsetY=0;this.totalOffsetX=0;this.totalOffsetY=0;this.position=null;this.lastPosition=null;this.offset=new IWPoint(0,0);this.toString=function(){return"[IWMoveEvent] position: "+(this.position==null?"null":this.position.toString())+", lastPosition: "+(this.lastPosition==null?"null":this.lastPosition.toString())+", offset: "+this.offset.toString()}}function IWResizeEvent(){this.oldSize=null;this.newSize=null;this.toString=function(){return"[IWResizeEvent] oldSize: "+(this.oldSize==null?"null":this.oldSize.toString())+", newSize: "+(this.newSize==null?"null":this.newSize.toString())}}function IWZoomEvent(){this.newZoomLevel=null;this.newCenter=null;this.toString=function(){return"[IWZoomEvent] newZoomLevel: "+this.newZoomLevel+", newCenter: "+this.newCenter}}function IWMouseControlChangeEvent(){this.mouseAction="";this.controlMethod=-1;this.toString=function(){return"[IWMouseControlChangeEvent] mouseAction: "+this.mouseAction+", controlMethod: "+this.controlMethod}}function IWAddress(){var d="";var i="";var b="";var g="";var c="";var k="";var f="";var h="";var j=null;var a=null;this.setStreet=function(m){d=m};this.getStreet=function(){return d};this.setHouseNumber=function(m){i=m};this.getHouseNumber=function(){return i};this.setZipCode=function(m){b=m};this.getZipCode=function(){return b};this.setCity=function(m){g=m};this.getCity=function(){return g};this.setPart=function(m){c=m};this.getPart=function(){return c};this.setDistrict=function(m){k=m};this.getDistrict=function(){return k};this.setCountry=function(m){f=m};this.getCountry=function(){return f};this.setCountryCode=function(m){h=m};this.getCountryCode=function(){return h};this.hasHouseNumber=function(){return(i!=null&&i!="")};this.setLCC=function(m){j=m};this.getLCC=function(){return j};this.setWGS84=function(m){a=m};this.getWGS84=function(){return a};this.toString=function(){return"[IWAddress] Street: "+(d==null?"null":d)+", HouseNumber: "+(i==null?"null":i)+", ZipCode: "+(b==null?"null":b)+", City: "+(g==null?"null":g)+", Part: "+(c==null?"null":c)+", District: "+(k==null?"null":k)+", Country: "+(f==null?"null":f)+", CountryCode: "+(h==null?"null":h)+", lcc cooordinate: "+(j==null?"null":j.toString())+", wgs84 coordinate: "+(a==null?"null":a.toString())};this.equals=function(m){return(this.getStreet()==m.getStreet()&&this.getHouseNumber()==m.getHouseNumber()&&this.getZipCode()==m.getZipCode()&&this.getCity()==m.getCity()&&this.getPart()==m.getPart()&&this.getDistrict()==m.getDistrict()&&this.getCountry()==m.getCountry()&&this.getCountryCode()==m.getCountryCode())}}function IWGeocoderClient(){var b=log4javascript.getLogger("IWGeocoderClient");this.geocodeAddressString=function(g,f,k,i){b.info("Calling geocodeAddressString with address "+g+" ("+f+"), maximumHits: "+k);var j=1;if(typeof k!="undefined"){j=parseInt(k)}var h=iwconst.LOCAL_APP_URL+"/servlet/FrontController?cmd=geocode&app=ms&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&RTVDIR=mapapi-0.70&RTVADR="+g+"&RTVLAND="+f;if(j==1){h+="&RTVMODE=1"}else{h+="&RTVMODE=0&RTVHITMAX="+j}var d=new IWXMLHttpRequest();d.open("GET",iwconst.GEOCODERSERVER_PROXY_URL+"?serverURL="+escape(h),true);d.onreadystatechange=function(){a(this,d,g+" "+f,j,i)}.iwclosure(this);d.send(null)};this.geocodeAddress=function(f,j,h){b.info("Calling geocodeAddress with address "+f+", maximumHits: "+j);var i=1;if(typeof j!="undefined"){i=parseInt(j)}var g=iwconst.LOCAL_APP_URL+"/servlet/FrontController?cmd=geocode&app=ms&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&RTVDIR=mapapi-0.70&RTVPLZ="+f.getZipCode()+"&RTVORT="+f.getCity()+"&RTVSTR="+f.getStreet()+"&RTVHNR="+f.getHouseNumber()+"&RTVLAND="+f.getCountryCode();if(i==1){g+="&RTVMODE=1"}else{g+="&RTVMODE=0&RTVHITMAX="+i}var d=new IWXMLHttpRequest();d.open("GET",iwconst.GEOCODERSERVER_PROXY_URL+"?serverURL="+escape(g),true);d.onreadystatechange=function(){a(this,d,f,i,h)}.iwclosure(this);d.send(null)};this.reverseGeocodeByRadius=function(i,d,h){b.info("Calling reverseGeocodeByRadius with coordinate: "+i+", radiusCriteria: "+d);if(i.getProjectionType()==IWCoordinate.MERCATOR){i=i.toWGS84()}var g=iwconst.LOCAL_APP_URL+"/servlet/FrontController?cmd=locate&app=ms&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&RTVDIR=mapapi-0.70&RTVLAND=EU&REVPROJ="+i.getProjectionType()+"&REVMODE=1&REVX="+i.getX()+"&REVY="+i.getY()+"&REVOPT="+d;var f=new IWXMLHttpRequest();f.open("GET",iwconst.GEOCODERSERVER_PROXY_URL+"?serverURL="+escape(g),true);f.onreadystatechange=function(){c(this,f,i,h)}.iwclosure(this);f.send(null)};this.reverseGeocodeByHits=function(i,d,h){b.info("Calling reverseGeocodeByHits with "+i+", "+d+", "+h);if(i.getProjectionType()==IWCoordinate.MERCATOR){i=i.toWGS84()}var g=iwconst.LOCAL_APP_URL+"/servlet/FrontController?cmd=locate&app=ms&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&RTVDIR=mapapi-0.70&RTVLAND=EU&REVPROJ="+i.getProjectionType()+"&REVMODE=0&REVX="+i.getX()+"&REVY="+i.getY()+"&REVOPT="+d;var f=new IWXMLHttpRequest();f.open("GET",iwconst.GEOCODERSERVER_PROXY_URL+"?serverURL="+escape(g),true);f.onreadystatechange=function(){c(this,f,i,h)}.iwclosure(this);f.send(null)};this.toString=function(){return"[IWGeocoderClient]"};this.triggerOnGeocode=function(d){IWEventManager.trigger(this,"ongeocode",d)};this.triggerOnReverseGeocode=function(d){IWEventManager.trigger(this,"onreversegeocode",d)};function a(x,r,v,n,k){var y=new Array();if(r.readyState==4){if(r.statusText=="OK"){var z=IWXMLHelper.parse(r.responseText).documentElement;if(z.getElementsByTagName("fail").length==0){var h=z.getElementsByTagName("street");var q=z.getElementsByTagName("housenumber");var d=z.getElementsByTagName("zipcode");var m=z.getElementsByTagName("city");var g=z.getElementsByTagName("country");var s=z.getElementsByTagName("country_code");var F=z.getElementsByTagName("lcc_x");var E=z.getElementsByTagName("lcc_y");var w=z.getElementsByTagName("wgs84_long");var t=z.getElementsByTagName("wgs84_lat");var f=z.getElementsByTagName("hitprobability");var D=z.getElementsByTagName("quality");for(var B=0,C=0;B<d.length&&C<n;B++,C++){var j=IWXMLHelper.getNodeValue(q[B]);var o=new IWAddress();o.setStreet(IWXMLHelper.getNodeValue(h[B]));o.setHouseNumber((j!="X"&&j!="0"?j:""));o.setZipCode(IWXMLHelper.getNodeValue(d[B]));o.setCity(IWXMLHelper.getNodeValue(m[B]));o.setCountry(IWXMLHelper.getNodeValue(g[B]));o.setCountryCode(IWXMLHelper.getNodeValue(s[B]));o.setLCC(new IWCoordinate(IWXMLHelper.getNodeValue(F[B]),IWXMLHelper.getNodeValue(E[B]),IWCoordinate.LCC));o.setWGS84(new IWCoordinate(IWXMLHelper.getNodeValue(w[B]),IWXMLHelper.getNodeValue(t[B]),IWCoordinate.WGS84));var u=new IWGeocodingResult();u.setAddress(o);u.setHitProbability(parseInt(IWXMLHelper.getNodeValue(f[B])));u.setQuality(IWXMLHelper.getNodeValue(D[B]));y.push(u)}}}else{if(r.status==401){alert("IWGeocoderClient: Access denied. ("+r.status+") "+r.statusText)}else{alert("IWGeocoderClient: ("+r.status+") "+r.statusText)}}}var A=new IWGeocodingEvent();A.inputAddress=v;A.status=r.statusText;A.results=y;A.parameterObject=k;x.triggerOnGeocode(A)}function c(v,o,z,j){var x=new Array();if(o.readyState==4){if(o.statusText=="OK"){var y=IWXMLHelper.parse(o.responseText).documentElement;if(y.getElementsByTagName("fail").length==0){var w=y.getElementsByTagName("zipcode").length;var f=y.getElementsByTagName("country");var r=y.getElementsByTagName("country_code");var d=y.getElementsByTagName("zipcode");var k=y.getElementsByTagName("city");var g=y.getElementsByTagName("street");var n=y.getElementsByTagName("housenumber");var D=y.getElementsByTagName("lcc_x");var C=y.getElementsByTagName("lcc_y");var u=y.getElementsByTagName("wgs84_long");var s=y.getElementsByTagName("wgs84_lat");var q=y.getElementsByTagName("distance");for(var B=0;B<w;B++){var t=new IWReverseGeocodingResult();var m=new IWAddress();m.setStreet(IWXMLHelper.getNodeValue(g[B]));m.setZipCode(IWXMLHelper.getNodeValue(d[B]));m.setCity(IWXMLHelper.getNodeValue(k[B]));m.setLCC(new IWCoordinate(IWXMLHelper.getNodeValue(D[B]),IWXMLHelper.getNodeValue(C[B]),IWCoordinate.LCC));m.setWGS84(new IWCoordinate(IWXMLHelper.getNodeValue(u[B]),IWXMLHelper.getNodeValue(s[B]),IWCoordinate.WGS84));var h=IWXMLHelper.getNodeValue(n[B]);m.setHouseNumber((h!="X"&&h!="0"?h:""));m.setCountry(IWXMLHelper.getNodeValue(f[B]));m.setCountryCode(IWXMLHelper.getNodeValue(r[B]));t.setAddress(m);t.setDistance(IWXMLHelper.getNodeValue(q[B]));x.push(t)}}}else{if(o.status==401){alert(o.statusText)}else{alert("Reverse-Geocoding failed: "+o.status+" "+o.statusText)}}}var A=new IWReverseGeocodingEvent();A.status=o.statusText;A.inputCoordinate=z;A.results=x;A.parameterObject=j;v.triggerOnReverseGeocode(A)}}function IWGeocodingEvent(){this.status=null;this.inputAddress=null;this.results=null;this.parameterObject=null;this.toString=function(){return"[IWGeocodingEvent] Address: "+(this.inputAddress==null?"null":this.inputAddress)+", Status: "+(this.status==null?"null":this.status)+", Results: "+(this.results==null?"null":this.results.length)}}function IWGeocodingResult(){var b=null;var a=null;var c=null;this.setAddress=function(d){b=d};this.getAddress=function(){return b};this.setHitProbability=function(d){a=d};this.getHitProbability=function(){return a};this.setQuality=function(d){c=d};this.getQuality=function(){return c};this.toString=function(){return"[IWGeocodingResult] address: "+b.toString()+", hitprobability: "+a+", quality: "+c}}function IWReverseGeocodingEvent(){this.status=null;this.coordinate=null;this.results=null;this.parameterObject=null;this.toString=function(){return"[IWReverseGeocodingEvent] Status: "+(this.status==null?"null":this.status)+", Coordinate: "+(this.coordinate==null?"null":this.coordinate)+", Results: "+(this.results==null?"null":this.results.length)}}function IWReverseGeocodingResult(){var a=null;var b=0;this.setAddress=function(c){a=c};this.getAddress=function(){return a};this.setDistance=function(c){b=c};this.getDistance=function(){return b};this.toString=function(){return"[IWReverseGeocodingResult] address: "+a.toString()+", distance: "+b}}function IWSimpleGeocoderClient(){var b="http://localhost/gc_simple/Simple.jsp";this.setUrl=function(c){b=c};this.getUrl=function(){return b};this.geocodeAddressString=function(i,g,k,h){var j=0;if(typeof k!="undefined"&&k==true){j=1}var d=b+(b.match(/\?/)!=null?"&":"?")+"VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&ADD="+i+"&LND="+g+"&MULTI="+j;var f=new IWXMLHttpRequest();var c=iwconst.GLOBAL_PROXY_URL+"?serverURL="+escape(d);f.open("GET",c,true);f.onreadystatechange=function(){a(this,f,i,g,h)}.iwclosure(this);f.send(null)};this.geocodeAddress=function(h,j,g){var i=0;if(typeof j!="undefined"&&j==true){i=1}var d=b+(b.match(/\?/)!=null?"&":"?")+"VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&PLZ="+h.getZipCode()+"&ORT="+h.getCity()+"&STR="+h.getStreet()+"&HNR="+h.getHouseNumber()+"&LND="+h.getCountryCode()+"&MULTI="+i;var f=new IWXMLHttpRequest();var c=iwconst.GLOBAL_PROXY_URL+"?serverURL="+escape(d);f.open("GET",c,true);f.onreadystatechange=function(){a(this,f,h,h.getCountryCode(),g)}.iwclosure(this);f.send(null)};this.toString=function(){return"[IWSimpleGeocoderClient]"};this.triggerOnGeocode=function(c){IWEventManager.trigger(this,"ongeocode",c)};function a(w,q,u,h,k){var x=new Array();var B=new IWSimpleGeocodingEvent();if(q.readyState==4){if(q.statusText=="OK"){var z=IWXMLHelper.parse(q.responseText).documentElement;var A=z.getElementsByTagName("error")[0];if(A!=null){var v=IWXMLHelper.getNodeValue(A);if(v!=null){B.status=v}else{B.status="OK";var d=z.getElementsByTagName("street");var o=z.getElementsByTagName("housenumber");var c=z.getElementsByTagName("zipcode");var m=z.getElementsByTagName("city");var y=z.getElementsByTagName("part");var g=z.getElementsByTagName("district");var s=z.getElementsByTagName("wgs84");var r=z.getElementsByTagName("lcc_europe");var j=z.getElementsByTagName("matchcode");for(var C=(c.length-1);C>=0;C--){var f=IWXMLHelper.getNodeValue(o[C]);var n=new IWAddress();n.setStreet(IWXMLHelper.getNodeValue(d[C]));n.setHouseNumber((f!="X"&&f!="0"?f:""));n.setZipCode(IWXMLHelper.getNodeValue(c[C]));n.setCity(IWXMLHelper.getNodeValue(m[C]));n.setPart(IWXMLHelper.getNodeValue(y[C]));n.setDistrict(IWXMLHelper.getNodeValue(g[C]));n.setCountryCode(h);n.setLCC(new IWCoordinate(IWXMLHelper.getNodeValue(r[C].childNodes[0]),IWXMLHelper.getNodeValue(r[C].childNodes[1]),IWCoordinate.LCC));n.setWGS84(new IWCoordinate(IWXMLHelper.getNodeValue(s[C].childNodes[0]),IWXMLHelper.getNodeValue(s[C].childNodes[1]),IWCoordinate.WGS84));var t=new IWSimpleGeocodingResult();t.setAddress(n);t.setMatchCode(IWXMLHelper.getNodeValue(j[C]));x.push(t)}}}}else{if(q.status==401){alert(q.statusText)}else{alert("Geocoding failed: "+q.status+"\n"+q.statusText)}}}B.inputAddress=u;B.results=x;B.parameterObject=k;w.triggerOnGeocode(B)}}function IWSimpleGeocodingEvent(){this.status=null;this.inputAddress=null;this.results=null;this.parameterObject=null;this.toString=function(){return"[IWSimpleGeocodingEvent] InputAddress: "+(this.inputAddress==null?"null":this.inputAddress)+", Status: "+(this.status==null?"null":this.status)+", Results: "+(this.results==null?"null":this.results.length)}}function IWSimpleGeocodingResult(){var b=null;var a=null;this.setAddress=function(c){b=c};this.getAddress=function(){return b};this.setMatchCode=function(c){a=c};this.getMatchCode=function(){return a};this.toString=function(){return"[IWSimpleGeocodingResult] address: "+b.toString()+", matchcode: "+a}}function IWLabel(a,c,b){this.getKey=function(){return a};this.getDomElement=function(){return c};this.getDomAttribute=function(){return b};this.toString=function(){return"[IWLabel] key: "+this.getKey()+", domElement: "+this.getDOMElement()+", domAttribute: "+this.getDOMAttribute()}}function IWLanguage(b,c){var a=new Object();this.getName=function(){return b};this.getFile=function(){return c};this.put=function(d,f){a[d]=f};this.get=function(d){if(typeof a[d]=="undefined"){alert("Language key "+d+" not found in "+this.getFile())}return a[d]};this.toString=function(){return"[IWLanguage] Name: "+this.getName()+", File: "+this.getFile()}}var IWLanguageCacheManager=new function(){var a=new Object();this.putLanguage=function(b){a[b.getFile()]=b};this.isCached=function(b){return(this.getLanguage(b)!=null)};this.getLanguage=function(b){return a[b.getFile()]};this.toString=function(){return"[IWLanguageLoadManager]"}};function IWLanguagePack(){var a=new Object();this.getLanguage=function(b){return a[b]};this.addLanguage=function(b){a[b.getName()]=b};this.toString=function(){var b="";for(l in a){b+=a[l].toString()}return"[IWLanguagePack] "+b}}function IWMultiLanguageSupport(map,languagePack){var self=this;var labels=new Array();var language=null;var onLanguageChangeListener=null;if(typeof languagePack=="undefined"||languagePack==null){languagePack=new IWLanguagePack()}this.addLabelFor=function(label){if(language){updateLabel(label)}labels.push(label)};this.getLanguagePack=function(){return languagePack};this.triggerOnLanguagePackLoad=function(event){IWEventManager.trigger(this,"onlanguagepackload",event)};this.loadLanguagePack=function(lang){language=languagePack.getLanguage(lang);if(language){if(IWLanguageCacheManager.isCached(language)==false){var url=iwconst.LOCAL_APP_URL+"/servlet/FrontController?cmd=getLanguagePack&languagePack="+language.getFile()+"&app=ms&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR();var xmlHttp=new IWXMLHttpRequest();xmlHttp.open("GET",iwconst.GLOBAL_PROXY_URL+"?serverURL="+escape(url),true);xmlHttp.onreadystatechange=function(){callbackOnLanguagePackLoad(xmlHttp,language)};xmlHttp.send(null)}else{language=IWLanguageCacheManager.getLanguage(language);notifyAll(language)}}else{alert("Missing language pack: "+lang)}};this.destroyMultiLanguageSupport=function(){IWEventManager.removeListener(onLanguageChangeListener);for(var i=labels.length;i>0;i--){iw.destroy(labels[i-1])}};this.toString=function(){return"[IWMultiLanguageSupport]"};function updateLabels(){for(var i=0;i<labels.length;i++){updateLabel(labels[i])}}function updateLabel(label){var key=label.getKey();if(!key){alert("Key is not specified.");return}var obj=label.getDomElement();if(!obj){alert("DOM Element for key "+key+" is not specified.");return}var attr=label.getDomAttribute();if(!attr){alert("The attribute of the DOM element "+obj+" is not specified.");return}obj[attr]=language.get(key)}function callbackOnLanguagePackLoad(xmlHttp,language){if(xmlHttp.readyState==4){if(xmlHttp.statusText=="OK"){var obj=eval(xmlHttp.responseText);for(key in obj.LANGUAGE_PACK){language.put(key,obj.LANGUAGE_PACK[key])}IWLanguageCacheManager.putLanguage(language);notifyAll(language)}else{if(xmlHttp.status==401){alert("IWMultiLanguageSupport: Access denied. ("+xmlHttp.status+") "+xmlHttp.statusText)}else{alert("IWMultiLanguageSupport: ("+xmlHttp.status+") "+xmlHttp.statusText)}}}}function notifyAll(language){updateLabels(language);var event=new IWMultiLanguageSupportEvent();event.language=language;self.triggerOnLanguagePackLoad(event)}onLanguageChangeListener=IWEventManager.addListener(map,"onlanguagechange",function(event){self.loadLanguagePack(event.language)})}function IWMultiLanguageSupportEvent(){this.language=null;this.toString=function(){return"[IWMultiLanguageSupportEvent] language: "+this.language}}var popupAppender=new log4javascript.PopUpAppender();popupAppender.setLayout(new log4javascript.PatternLayout("%d{HH:mm:ss} %-5p %c - %m%n"));function setupLogger(d,b,a){var c=log4javascript.getLogger(d);c.addAppender(popupAppender);c.setLevel(a)}setupLogger("IWEventManager",popupAppender,log4javascript.Level.TRACE);setupLogger("IWActionStack",popupAppender,log4javascript.Level.TRACE);setupLogger("IWAddressSearchControl",popupAppender,log4javascript.Level.TRACE);setupLogger("IWCentralProjection",popupAppender,log4javascript.Level.TRACE);setupLogger("IWCopyrightControl",popupAppender,log4javascript.Level.TRACE);setupLogger("IWCoordinate",popupAppender,log4javascript.Level.TRACE);setupLogger("IWDraggable",popupAppender,log4javascript.Level.TRACE);setupLogger("IWGeocoderClient",popupAppender,log4javascript.Level.TRACE);setupLogger("IWInfoBalloon",popupAppender,log4javascript.Level.TRACE);setupLogger("IWKeyboardAdapter",popupAppender,log4javascript.Level.TRACE);setupLogger("IWLayout",popupAppender,log4javascript.Level.TRACE);setupLogger("IWLayoutManager",popupAppender,log4javascript.Level.TRACE);setupLogger("IWLayerInfoManager",popupAppender,log4javascript.Level.TRACE);setupLogger("IWMap",popupAppender,log4javascript.Level.TRACE);setupLogger("IWMapOptions",popupAppender,log4javascript.Level.TRACE);setupLogger("IWMarker",popupAppender,log4javascript.Level.TRACE);setupLogger("IWMeasuringControl",popupAppender,log4javascript.Level.TRACE);setupLogger("IWMeasureSegment",popupAppender,log4javascript.Level.TRACE);setupLogger("IWMeasuringPoint",popupAppender,log4javascript.Level.TRACE);setupLogger("IWMeasuringInfoWindowControl",popupAppender,log4javascript.Level.TRACE);setupLogger("IWMouseAdapter",popupAppender,log4javascript.Level.TRACE);setupLogger("IWMouseWheelAdapter",popupAppender,log4javascript.Level.TRACE);setupLogger("IWNodeElement",popupAppender,log4javascript.Level.TRACE);setupLogger("IWOverlay",popupAppender,log4javascript.Level.TRACE);setupLogger("IWOverlayLayer",popupAppender,log4javascript.Level.TRACE);setupLogger("IWOverlayManager",popupAppender,log4javascript.Level.TRACE);setupLogger("IWOverlaySelectionControl",popupAppender,log4javascript.Level.TRACE);setupLogger("IWOverviewMapControl",popupAppender,log4javascript.Level.TRACE);setupLogger("IWOverviewDragBoxControl",popupAppender,log4javascript.Level.TRACE);setupLogger("IWParallelProjection",popupAppender,log4javascript.Level.TRACE);setupLogger("IWProjectionClient",popupAppender,log4javascript.Level.TRACE);setupLogger("IWRoutingClient",popupAppender,log4javascript.Level.TRACE);setupLogger("IWRoutingControl",popupAppender,log4javascript.Level.TRACE);setupLogger("IWScalarControl",popupAppender,log4javascript.Level.TRACE);setupLogger("IWSliderControl",popupAppender,log4javascript.Level.TRACE);setupLogger("IWSVGRenderer",popupAppender,log4javascript.Level.TRACE);setupLogger("IWTile",popupAppender,log4javascript.Level.TRACE);setupLogger("IWTileLoader",popupAppender,log4javascript.Level.TRACE);setupLogger("IWTreeView",popupAppender,log4javascript.Level.TRACE);setupLogger("IWTreeNode",popupAppender,log4javascript.Level.TRACE);setupLogger("IWWindowOverlay",popupAppender,log4javascript.Level.TRACE);setupLogger("IWXMLHttpRequest",popupAppender,log4javascript.Level.TRACE);setupLogger("IWZoomBoxControl",popupAppender,log4javascript.Level.TRACE);setupLogger("IWVEProjection",popupAppender,log4javascript.Level.TRACE);setupLogger("IWVEUtils",popupAppender,log4javascript.Level.TRACE);setupLogger("IWVMLRenderer",popupAppender,log4javascript.Level.TRACE);function IWActionStack(g,d){var c=(typeof d!="undefined"?d:20);var b=new Array();var f=new Array();var a=log4javascript.getLogger("IWActionStack");this.clear=function(){b=new Array();f=new Array()};this.addAction=function(h){if(h.isMapAction&&h.isMapAction()){b.push(h);if(f.length>0){f=new Array()}if(b.length>c){b.shift()}}else{}};this.undoAction=function(){var h=b.pop();if(h){h.undo(g);f.push(h)}else{}};this.redoAction=function(){var h=f.pop();if(h){h.redo(g);b.push(h)}else{}};this.toString=function(){return"[IWActionStack] max actions: "+c+", undo stack length: "+b.length+", redo stack length: "+f.length}}function IWCentralProjection(v){IWProjection.call(this);var w=log4javascript.getLogger("IWCentralProjection");var h;var u;var x;var s;var o;var k;var f=new Array(4);var r;var j;var i=new IWPoint(0,0);this.initialize=function(y){w.info("Calling initialize.");u=y.CAMERA.LONGITUDE;x=y.CAMERA.LATITUDE;h=y.CAMERA.ALTITUDE;s=y.VIEW.WIDTH;o=y.VIEW.HEIGHT;k=y.VIEW.ELEVATION;f[0]=new IWCoordinate(y.VIEW.POINTS[0].X,y.VIEW.POINTS[0].Y);f[1]=new IWCoordinate(y.VIEW.POINTS[1].X,y.VIEW.POINTS[1].Y);f[2]=new IWCoordinate(y.VIEW.POINTS[2].X,y.VIEW.POINTS[2].Y);f[3]=new IWCoordinate(y.VIEW.POINTS[3].X,y.VIEW.POINTS[3].Y);r=parseFloat(y.SECTION.FACTOR);j=new IWPoint(y.SECTION.OFFSET_X,y.SECTION.OFFSET_Y);i=new IWPoint(0,0);w.info("Calling initialize done with cameraLongitude: "+u+", cameraLatitude: "+x+", cameraAltitude: "+h+", viewWidth: "+s+", viewHeight: "+o+", viewElevation: "+k+", viewPoints: "+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+", sectionFactor: "+r+", sectionOffset: "+j+".")};this.meterToPixel=function(B){var y=c(B);var A=((y.getX()-j.getX())/r)-i.getX();var z=((j.getY()-y.getY())/r)-i.getY();return new IWPoint(A,z)};this.meterToPixelXY=function(z,y){var D=new IWCoordinate(z,y);var A=c(D);var C=((A.getX()-j.getX())/r)-i.getX();var B=((j.getY()-A.getY())/r)-i.getY();return{x:C,y:B}};this.pixelToMeter=function(y){var A=j.getX()+(y.getX()+i.getX())*r;var z=j.getY()-(y.getY()+i.getY())*r;return q(new IWPoint(A,z))};this.pixelToMeterXY=function(z,y){var C=j.getX()+(z+i.getX())*r;var A=j.getY()-(y+i.getY())*r;var B=q(new IWPoint(C,A));return{x:B.getX(),y:B.getY()}};this.needsReload=function(B,z){w.info("Calling needsReload with coord: "+B.getX()+", "+B.getY()+", size: "+z.getWidth()+", "+z.getHeight());var A=new Array(4);A[0]=c(this.pixelToMeter(new IWPoint(0,0)));A[1]=c(this.pixelToMeter(new IWPoint(z.getWidth(),0)));A[2]=c(this.pixelToMeter(new IWPoint(0,z.getHeight())));A[3]=c(this.pixelToMeter(new IWPoint(z.getWidth(),z.getHeight())));for(var y=0;y<4;y++){if(A[y].getX()<0||A[y].getX()>s){return true}if(A[y].getY()<0||A[y].getY()>o){return true}}return false};this.needsReloadXY=function(z,y,B){w.info("Calling needsReloadXY with coord: "+z+", "+y+", size: "+B.getWidth()+", "+B.getHeight());var C=new Array(4);C[0]=c(this.pixelToMeter(new IWPoint(0,0)));C[1]=c(this.pixelToMeter(new IWPoint(B.getWidth(),0)));C[2]=c(this.pixelToMeter(new IWPoint(0,B.getHeight())));C[3]=c(this.pixelToMeter(new IWPoint(B.getWidth(),B.getHeight())));for(var A=0;A<4;A++){if(C[A].getX()<0||C[A].getX()>s){return true}if(C[A].getY()<0||C[A].getY()>o){return true}}return false};this.toString=function(){return"[IWCentralProjection] camera altitude: "+h+", camera longitude: "+u+", camera latitude: "+x+", view width: "+s+", view height: "+o+", view elevation: "+k+", view points: {"+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+"}, section factor: "+r+", section offset: "+j};function d(C){var A=(C[2].getX()<C[0].getX()?C[0].getX():C[2].getX());var D=(C[3].getX()<C[1].getX()?C[3].getX():C[1].getX());var y=(C[0].getY()<C[1].getY()?C[1].getY():C[0].getY());var B=(C[2].getY()<C[3].getY()?C[2].getY():C[3].getY());var z=new Array(4);z[0]=new IWPoint(A,y);z[1]=new IWPoint(D,y);z[2]=new IWPoint(A,B);z[3]=new IWPoint(D,B);return z}function b(z,D,B,y,C,A){var G=y-z;var F=C-D;var E=A-B;return Math.sqrt(G*G+F*F+E*E)}function g(A,z,y){return Math.acos((A*A-z*z-y*y)/(-2*z*y))}function t(D,M,J,C,L,I,A,K,H){var B=b(C,L,I,A,K,H);var z=b(A,K,H,D,M,J);var y=b(C,L,I,D,M,J);var G=g(B,z,y);var F=g(z,B,y);var E=g(y,z,B);var N=[B,z,y,G,F,E];return N}function n(A,D,C,B){var z=t(C.getX(),C.getY(),0,B.getX(),B.getY(),0,u,x,h-k);var y=new Array(6);y[1]=z[1];y[3]=z[3];y[5]=z[5]/2+Math.atan((A-D/2)*(Math.tan(z[5]/2)/(D/2)));y[4]=Math.PI-y[5]-y[3];y[2]=y[1]/Math.sin(y[4])*Math.sin(y[5]);return y[2]/z[2]}function a(C,B,A){var z=C.getX()+(B.getX()-C.getX())*A;var D=C.getY()+(B.getY()-C.getY())*A;return new IWCoordinate(z,D)}function q(A){var C=a(f[0],f[1],n(A.getX(),s,f[0],f[1]));var D=a(f[2],f[3],n(A.getX(),s,f[2],f[3]));var z=a(f[0],f[2],n(A.getY(),o,f[0],f[2]));var B=a(f[1],f[3],n(A.getY(),o,f[1],f[3]));var y=new IWLine(C,D);var E=new IWLine(z,B);return y.getIntersection(E)}function m(H,G,F,D,B){var y=new Array(3);var A=new IWLine(G,F);var C=new IWLine(D,B);var z=new IWLine(G,D);var I=new IWLine(F,B);y[0]=A.getIntersection(C);var E=new IWLine(y[0],H);y[1]=E.getIntersection(z);y[2]=E.getIntersection(I);return y}function c(F){var B=h-k;var C;var A;var D=m(F,f[0],f[1],f[2],f[3]);C=t(f[0].getX(),f[0].getY(),0,f[2].getX(),f[2].getY(),0,u,x,B);A=t(f[0].getX(),f[0].getY(),0,D[1].getX(),D[1].getY(),0,u,x,B);if(Math.abs(C[3]-A[3])>=0.001){A[5]*=-1}var E=0.5-0.5*Math.tan(C[5]/2-A[5])/Math.tan(C[5]/2);D=m(F,f[0],f[2],f[1],f[3]);C=t(f[0].getX(),f[0].getY(),0,f[1].getX(),f[1].getY(),0,u,x,B);A=t(f[0].getX(),f[0].getY(),0,D[1].getX(),D[1].getY(),0,u,x,B);if(Math.abs(C[3]-A[3])>=0.001){A[5]*=-1}var z=0.5-0.5*Math.tan(C[5]/2-A[5])/Math.tan(C[5]/2);return new IWPoint(z*s,E*o)}IWEventManager.addListener(v,"onmove",function(y){i=i.add(new IWPoint(-y.offset.getX(),-y.offset.getY()))})}function IWLayout(k,q){var z=log4javascript.getLogger("IWLayout");this.setBorder=function(A,B){d=new IWSize(A,B);this.redraw()};this.getZIndex=function(){return y};this.getControlByName=function(A){var C=null;for(var B=0;B<s.length;B++){if(s[B].getName()==A){C=s[B];break}}return C};this.getControls=function(){return s};this.redraw=function(){v();for(var A=0;A<s.length;A++){r(s[A])}};this.addControl=function(G,B,A,F,E){if((typeof G.isControl=="undefined")||!G.isControl()){z.warn("Adding control failed: control has to implement IWControl!");throw ("IWLayoutManager: adding control failed: control has to implement IWControl!")}if(B!=IWAlignment.TOP&&B!=IWAlignment.RIGHT&&B!=IWAlignment.BOTTOM&&B!=IWAlignment.LEFT&&B!=IWAlignment.CENTER){z.warn("Adding control failed: first orientation not valid!");throw ("IWLayoutManager: adding control failed: first orientation not valid!")}if(A!=IWAlignment.TOP&&A!=IWAlignment.RIGHT&&A!=IWAlignment.BOTTOM&&A!=IWAlignment.LEFT&&A!=IWAlignment.CENTER){z.error("Adding control failed: second orientation not valid!");throw ("IWLayoutManager: adding control failed: second orientation not valid!")}for(var C=0;C<s.length;C++){if(G==s[C]){z.error("Adding control failed: control already added!");throw ("IWLayoutManager: adding control failed: control already added!")}}z.debug("Calling addControl with "+G.toString()+" to map.");if((typeof F!="undefined")||(typeof E!="undefined")){G.setPadding(new IWSize(parseInt(F),parseInt(E)))}G.setFirstOrientation(B);G.setSecondOrientation(A);G.onresizeListener=IWEventManager.addListener(G,"onresize",function(){this.redraw()}.iwclosure(this));s.push(G);G.getContainer().style.zIndex=y;_old_bb=new IWSize(a.getWidth(),a.getHeight());r(G);G.beforeAppend();h.appendChild(G.getContainer());G.afterAppend();if(!_old_bb.equals(a)){var D=new IWResizeEvent();D.newSize=a;IWEventManager.trigger(this,"onresize",D)}};this.removeControl=function(B){for(var A=0;A<s.length;A++){if(B==s[A]){s.splice(A,1);B.beforeRemove();iw.remove(B.getContainer());this.redraw();B.afterRemove();IWEventManager.removeListener(B.onresizeListener);break}}};function v(){m=new IWSize(0,0);u=new IWSize(0,0);w=new IWSize(0,0);b=new IWSize(0,0);o=new IWSize(0,0);n=new IWSize(0,0);g=new Array();x=new Array();j=new Array();f=new Array()}function t(){var B=h.style.width.replace(/\d/g,"");var A;if(B=="px"){A=parseInt(h.style.width)}else{A=h.offsetWidth}return A}function i(){var B=h.style.height.replace(/\d/g,"");var A;if(B=="px"){A=parseInt(h.style.height)}else{A=h.offsetHeight}return A}function r(F){z.debug("calculateControlPosition for "+F);size=IWDOMHelper.getSize(F.getContainer(),F.getParent());var L=size.getWidth();var A=size.getHeight();switch(F.getFirstOrientation()){case IWAlignment.TOP:switch(F.getSecondOrientation()){case IWAlignment.LEFT:var K=d.getHeight()+F.getPadding().getHeight();var E=d.getWidth()+m.getWidth()+F.getPadding().getWidth();c(F,K,E);if(m.equals(new IWSize(0,0))){m=new IWSize(m.getWidth()+F.getPadding().getWidth()*2+L,m.getHeight()+F.getPadding().getHeight()*2+A)}else{m=new IWSize(m.getWidth()+F.getPadding().getWidth()*2+L,m.getHeight())}if(m.getWidth()>t()){a=new IWSize(m.getWidth()+d.getWidth(),a.getHeight())}break;case IWAlignment.RIGHT:var K=d.getHeight()+F.getPadding().getHeight();var E=t()-(d.getWidth()+u.getWidth()+F.getPadding().getWidth()+L);c(F,K,E);if(u.equals(new IWSize(0,0))){u=new IWSize(u.getWidth()+F.getPadding().getWidth()*2+L,u.getHeight()+F.getPadding().getHeight()*2+A)}else{u=new IWSize(u.getWidth()+F.getPadding().getWidth()*2+L,u.getHeight())}break;case IWAlignment.CENTER:case IWAlignment.TOP:g.push(F);var D=0;for(var G=0;G<g.length;G++){D+=parseInt(g[G].getContainer().style.width);D+=2*g[G].getPadding().getWidth()}var C=Math.round((t()-D)/2);var J=C;for(var G=0;G<g.length;G++){var K=d.getHeight()+g[G].getPadding().getHeight();var E=J+g[G].getPadding().getWidth();c(g[G],K,E);J+=parseInt(g[G].getContainer().style.width);J+=2*g[G].getPadding().getWidth()}if(D>t()){a=new IWSize(t()+(D-t())/2,a.getHeight())}break;default:alert("Invalid positioning!")}break;case IWAlignment.RIGHT:switch(F.getSecondOrientation()){case IWAlignment.TOP:var K=u.getHeight()+d.getHeight()+F.getPadding().getHeight();var E=t()-(d.getWidth()+F.getPadding().getWidth()+L);c(F,K,E);if(u.equals(new IWSize(0,0))){u=new IWSize(u.getWidth()+F.getPadding().getWidth()*2+L,u.getHeight()+F.getPadding().getHeight()*2+A)}else{u=new IWSize(u.getWidth(),u.getHeight()+F.getPadding().getHeight()*2+A)}if(u.getHeight()>i()){a=new IWSize(a.getWidth(),u.getHeight()+d.getHeight())}break;case IWAlignment.BOTTOM:var K=i()-(b.getHeight()+d.getHeight()+F.getPadding().getHeight()+A);var E=t()-(d.getWidth()+F.getPadding().getWidth()+L);c(F,K,E);if(b.equals(new IWSize(0,0))){b=new IWSize(b.getWidth()+F.getPadding().getWidth()*2+L,b.getHeight()+F.getPadding().getHeight()*2+A)}else{b=new IWSize(b.getWidth(),b.getHeight()+F.getPadding().getHeight()*2+A)}break;case IWAlignment.CENTER:case IWAlignment.RIGHT:f.push(F);var H=0;for(var G=0;G<f.length;G++){var M=parseInt(f[G].getContainer().style.height);if(isNaN(M)){z.warn("The style.height attribute of "+f[G]+" must be set.")}H+=M;H+=2*f[G].getPadding().getHeight()}var C=Math.round((i()-H)/2);var J=C;for(var G=0;G<f.length;G++){var K=J+f[G].getPadding().getHeight();var E=t()-(d.getWidth()+f[G].getPadding().getWidth()+parseInt(f[G].getContainer().style.width));c(f[G],K,E);J+=parseInt(f[G].getContainer().style.height);J+=2*f[G].getPadding().getHeight()}if(H>i()){a=new IWSize(a.getWidth(),i()+(H-i())/2)}break;default:alert("Invalid positioning!");break}break;case IWAlignment.BOTTOM:switch(F.getSecondOrientation()){case IWAlignment.LEFT:var K=i()-(d.getHeight()+F.getPadding().getHeight()+A);var E=d.getWidth()+w.getWidth()+F.getPadding().getWidth();c(F,K,E);if(w.equals(new IWSize(0,0))){w=new IWSize(w.getWidth()+F.getPadding().getWidth()*2+L,w.getHeight()+F.getPadding().getHeight()*2+A)}else{w=new IWSize(w.getWidth()+F.getPadding().getWidth()*2+L,w.getHeight())}if(w.getWidth()>t()){a=new IWSize(u.getWidth()+d.getWidth(),a.getHeight())}break;case IWAlignment.RIGHT:var K=i()-(d.getHeight()+F.getPadding().getHeight()+A);var E=t()-(d.getWidth()+b.getWidth()+F.getPadding().getWidth()+L);c(F,K,E);if(b.equals(new IWSize(0,0))){b=new IWSize(b.getWidth()+F.getPadding().getWidth()*2+L,b.getHeight()+F.getPadding().getHeight()*2+A)}else{b=new IWSize(b.getWidth()+F.getPadding().getWidth()*2+L,b.getHeight())}break;case IWAlignment.CENTER:case IWAlignment.BOTTOM:x.push(F);var D=0;for(var G=0;G<x.length;G++){D+=parseInt(x[G].getContainer().style.width);D+=2*x[G].getPadding().getWidth()}var C=Math.round((t()-D)/2);var J=C;for(var G=0;G<x.length;G++){var K=i()-(d.getHeight()+x[G].getPadding().getHeight()+parseInt(x[G].getContainer().style.height));var E=J+x[G].getPadding().getWidth();c(x[G],K,E);J+=parseInt(x[G].getContainer().style.width);J+=2*x[G].getPadding().getWidth()}if(D>t()){a=new IWSize(t()+(D-t())/2,a.getHeight())}break;default:alert("Invalid positioning!")}break;case IWAlignment.LEFT:switch(F.getSecondOrientation()){case IWAlignment.TOP:var K=m.getHeight()+d.getHeight()+F.getPadding().getHeight();var E=d.getWidth()+F.getPadding().getWidth();c(F,K,E);if(m.equals(new IWSize(0,0))){m=new IWSize(m.getWidth()+F.getPadding().getWidth()*2+L,m.getHeight()+F.getPadding().getHeight()*2+A)}else{m=new IWSize(m.getWidth(),m.getHeight()+F.getPadding().getHeight()*2+A)}if(m.getHeight()>i()){a=new IWSize(a.getWidth(),m.getHeight()+d.getHeight())}break;case IWAlignment.BOTTOM:var K=i()-(w.getHeight()+d.getHeight()+F.getPadding().getHeight()+A);var E=d.getWidth()+F.getPadding().getWidth();c(F,K,E);if(w.equals(new IWSize(0,0))){w=new IWSize(w.getWidth()+F.getPadding().getWidth()*2+L,w.getHeight()+F.getPadding().getHeight()*2+A)}else{w=new IWSize(w.getWidth(),w.getHeight()+F.getPadding().getHeight()*2+A)}break;case IWAlignment.CENTER:case IWAlignment.LEFT:j.push(F);var D=0;for(var G=0;G<j.length;G++){D+=parseInt(j[G].getContainer().style.height);D+=2*j[G].getPadding().getHeight()}var C=Math.round((i()-D)/2);var J=C;for(var G=0;G<j.length;G++){var K=J+j[G].getPadding().getHeight();var E=d.getWidth()+j[G].getPadding().getWidth();c(j[G],K,E);J+=parseInt(j[G].getContainer().style.height);J+=2*j[G].getPadding().getHeight()}if(D>i()){a=new IWSize(a.getWidth(),i()+(D-i())/2)}break;default:alert("Invalid positioning!")}break;case IWAlignment.CENTER:var B=Math.round(t()/2);var I=Math.round(i()/2);if(o.equals(new IWSize(0,0))&&n.equals(new IWSize(0,0))){con_y=Math.round(A/2);con_x=Math.round(L/2);o=new IWSize(B+con_x+F.getPadding().getWidth(),B+con_x+F.getPadding().getWidth());n=new IWSize(I+con_y+F.getPadding().getHeight(),I+con_y+F.getPadding().getHeight());var K=I-con_y;var E=B-con_x;c(F,K,E)}else{switch(F.getSecondOrientation()){case IWAlignment.TOP:var K=i()-(n.getWidth()+A+F.getPadding().getHeight());var E=B-Math.round(L/2);c(F,K,E);n=new IWSize(n.getWidth()+A+F.getPadding().getHeight()*2,n.getHeight());break;case IWAlignment.RIGHT:case IWAlignment.CENTER:var K=I-Math.round(A/2);var E=o.getHeight()+F.getPadding().getWidth();c(F,K,E);o=new IWSize(o.getWidth(),o.getHeight()+L+F.getPadding().getWidth()*2);break;case IWAlignment.BOTTOM:var K=n.getHeight()+F.getPadding().getHeight();var E=B-Math.round(L/2);c(F,K,E);n=new IWSize(n.getWidth(),n.getHeight()+A+F.getPadding().getHeight()*2);break;case IWAlignment.LEFT:var K=I-Math.round(A/2);var E=t()-(o.getWidth()+L+F.getPadding().getWidth());c(F,K,E);o=new IWSize(o.getWidth()+L+F.getPadding().getWidth()*2,o.getHeight());break;default:alert("Invalid positioning!")}}if(o.getHeight()>t()){a=new IWSize(o.getHeight(),a.getHeight())}if(n.getHeight()>i()){a=new IWSize(a.getWidth(),n.getHeight())}break;default:alert("Invalid positioning!")}}function c(C,B,F){if(C.isRedrawable()||C.positionedFirstTime==null){C.getContainer().style.top=B+"px";C.getContainer().style.left=F+"px";C.positionedFirstTime=true}else{size=IWDOMHelper.getSize(C.getContainer());var H=size.getWidth();var A=size.getHeight();var I=parseInt(C.getContainer().style.top);var D=parseInt(C.getContainer().style.left);if(I+A>i()){var E=i()-A;if(E<0){E=0}C.getContainer().style.top=E+"px"}if(D+H>t()){var G=t()-H;if(G<0){G=0}C.getContainer().style.left=G+"px"}}}if((typeof q!="number")||(parseInt(q)!=q)){z.error("Layer is not an int:"+q+", type: "+typeof q)}var y=q;var d=new IWSize(4,4);var h=k;var a=new IWSize(t(),i());var s=new Array();var g=new Array();var x=new Array();var j=new Array();var f=new Array();var m;var u;var w;var b;var o;var n;v()}function IWLayoutManager(a){var g=new Array();var d=new IWSize(0,0);var b=log4javascript.getLogger("IWLayoutManager");var f=30;this.getLayer=function(m){b.info("Calling getLayer with "+m);if((typeof m!="number")||(parseInt(m)!=m)){throw ("Level is not an int: "+m+", type: "+typeof m)}m+=f;var k=false;var h=0;for(h=0;h<g.length;h++){if((typeof g[h][0]=="number")&&(g[h][0]==m)){k=true;break}}if(k==false){var j=new IWLayout(a,m);g.push(new Array(m,j));h=g.length-1;IWEventManager.addListener(j,"onresize",function(i){if(c(i.newSize)){IWEventManager.trigger(this,"onresize",i)}}.iwclosure(this))}return g[h][1]};this.getLayers=function(){return g};this.redraw=function(){b.info("Calling redraw");for(var h=0;h<g.length;h++){g[h][1].redraw()}};function c(h){b.debug("Calling hasBoundingBoxChanged with "+h);if(d.getWidth()<h.getWidth()||d.getHeight()<h.getHeight()){d=h.clone();return true}return false}}function IWMap(mapContainer){var N_MAX_REQUESTS=5;var self=this;var logger=log4javascript.getLogger("IWMap");var options=new IWMapOptions(this);var mouseAdapter=new IWMouseAdapter();var mouseWheelAdapter=new IWMouseWheelAdapter(mapContainer);var keyboardAdapter=new IWKeyboardAdapter(mapContainer);var sessionKeeper=new IWSessionKeeper();var currentCenterX=null;var currentCenterY=null;var currentZoomCenterXY=null;var oldCenterX=null;var oldCenterY=null;var currentMapType=options.getMapTypeByName(iwconst.DEFAULT_MAPTYPE);var currentZoom=currentMapType.getPreferredLevel();var currentTilesize=currentMapType.getTilesizeMeter()[currentZoom];var oldZoom=currentZoom;var windowOverlayManager=new IWWindowOverlayManager(this);var layerInfoManager=new IWLayerInfoManager(this);var copyrightControl=null;var layers=new Array();var timeoutWheel=null;var mouseStopTimeout=null;var dragOnMouseMoveListener=null;var dragOnMouseUpListener=null;var startDragPosition=null;var savedCenter=null;var savedZoom=null;var actionStack=new IWActionStack(this);var clickTimeout=null;var clickTimestamp=null;var dblClickTimestamp=null;var onMouseDownPosition=null;var isFirstLoad=true;var slideSteps=[0.1,0.25,0.3,0.25,0.1];var slideTimeout=null;var isOnClickEvent=false;var tilesAxis=null;var tiles=new Object();var layerTiles=null;var currentTileLayer=null;var requests=initRequests();var visibleSectionCounter=Number.MAX_VALUE;var oldMapTypeName=null;var oldZoomBounds=null;var queueTiles=new Array();var queueRequests=new Array();var queueSection=new Array();var currentWheelstep=0;var currentAliasCounter=0;var isVisibleSectionLoaded=false;var loadedTiles=0;var logstat=true;var isZoomEvent=false;var visibleBounds=null;var buttonPressed=0;var centerPixelX=0;var centerPixelY=0;var totalOffsetX=0;var totalOffsetY=0;var RELOAD_ON_MOVE=true;var reloadTimeout=null;var mapWidthInMeter=0;var mapHeightInMeter=0;var firstTilePixelX=0;var firstTilePixelY=0;var divCSS=iw.create("div");var divDrawing=iw.create("div");var divClipping=iw.create("div");var divZoomingAndDragging=iw.create("div");var divOverlaysAndControls=iw.create("div");var divOverlay=iw.create("div");var divControl=iw.create("div");var divWindowOverlay=iw.create("div");var divTileMap=null;var divTileMapZoom=null;var imgZoomingAndDragging=iw.create("img");var imgLabels=iw.create("img");var imgLabelsLoad=iw.create("img");var imgPrintMap=iw.create("img");var tileLoader=new Object();var isOnMoveEventTriggered=false;var overlayManager=new IWOverlayManager(this,divOverlay);var layoutManager=new IWLayoutManager(divControl);var imgLabelsX=0;var imgLabelsY=0;var divTileMapX=0;var divTileMapY=0;var divWindowOverlayX=0;var divWindowOverlayY=0;var lastMousePositionX=0;var lastMousePositionY=0;var rasterTileOffsetX=0;var rasterTileOffsetY=0;var fixme_imageCount=new Image();function countClick(){var config=currentMapType.getTilesServerConfig();var url=iwconst.GLOBAL_APP_URL+"servlet/FrontController?cmd=writeAccessStatistics&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&app=ms&mapcx="+parseInt(currentCenterX)+"&mapcy="+parseInt(currentCenterY)+"&mapdx="+parseInt(self.getMapWidthInMeter())+"&mapdy="+parseInt(self.getMapHeightInMeter())+"&width="+options.getSize().getWidth()+"&height="+options.getSize().getHeight()+"&projc="+config.getProjection()+"&overview="+(options.hasOverviewMap()?"1":"0")+"&session="+self.getSessionId()+currentMapType.getRequestParameters();fixme_imageCount.src=url}this.getCurrentTileContainer=function(){return currentTileLayer};this.zoom=function(startZoom,targetZoom,zoomCenterPixelX,zoomCenterPixelY,adjustToCenter){if(targetZoom<currentMapType.getMinLevel()||targetZoom>currentMapType.getMaxLevel()){return false}showLabels(false);abortAllRequests();if(!zoomCenterPixelX||!zoomCenterPixelY){zoomCenterPixelX=Math.ceil(options.getSize().getWidth()/2);zoomCenterPixelY=Math.ceil(options.getSize().getHeight()/2)}var moveOffset=new IWPoint(0,0);if(adjustToCenter==true&&currentZoom!=targetZoom){var zoomsteps=Math.abs(currentZoom-targetZoom);var offsetTileMapX=parseInt(divTileMap.style.left);var offsetTileMapY=parseInt(divTileMap.style.top);var size=options.getSize();var centerPixelX=Math.ceil(size.getWidth()/2);var centerPixelY=Math.ceil(size.getHeight()/2);var moveOffsetToCenterX=(centerPixelX-zoomCenterPixelX)/zoomsteps;var moveOffsetToCenterY=(centerPixelY-zoomCenterPixelY)/zoomsteps;moveOffset=new IWPoint(moveOffsetToCenterX,moveOffsetToCenterY)}zoomMap(startZoom,targetZoom,zoomCenterPixelX,zoomCenterPixelY,moveOffset,adjustToCenter);return true};function zoomMap(currentZoom,targetZoom,zoomCenterPixelX,zoomCenterPixelY,moveOffset,adjustToCenter){if(currentMapType.getType()=="IW_MAPDISPATCHER"){loadZoomMap(targetZoom,zoomCenterPixelX,zoomCenterPixelY,adjustToCenter)}else{if(currentZoom>targetZoom){self.opticalZoom(currentZoom,currentZoom-1,zoomCenterPixelX,zoomCenterPixelY,moveOffset);window.setTimeout(function(){zoomMap(currentZoom-1,targetZoom,zoomCenterPixelX,zoomCenterPixelY,moveOffset,adjustToCenter)},0)}else{if(currentZoom<targetZoom){self.opticalZoom(currentZoom,currentZoom+1,zoomCenterPixelX,zoomCenterPixelY,moveOffset);window.setTimeout(function(){zoomMap(currentZoom+1,targetZoom,zoomCenterPixelX,zoomCenterPixelY,moveOffset,adjustToCenter)},0)}else{loadZoomMap(targetZoom,zoomCenterPixelX,zoomCenterPixelY,adjustToCenter)}}}}function loadZoomMap(targetZoom,zoomCenterPixelX,zoomCenterPixelY,adjustToCenter){isZoomEvent=true;var tilesizeMeter=currentMapType.getTilesizeMeter();var zoomFactor=tilesizeMeter[currentZoom]/tilesizeMeter[targetZoom];var projection=currentMapType.getProjection();var zoomCenterCoordinateXY=projection.pixelToMeterXY(zoomCenterPixelX,zoomCenterPixelY);var oldCenterCoordinateX=currentCenterX;var oldCenterCoordinateY=currentCenterY;if(adjustToCenter==false){zoomCenterCoordinateXY.x=zoomCenterCoordinateXY.x+((oldCenterCoordinateX-zoomCenterCoordinateXY.x)/zoomFactor);zoomCenterCoordinateXY.y=zoomCenterCoordinateXY.y+((oldCenterCoordinateY-zoomCenterCoordinateXY.y)/zoomFactor)}oldZoom=currentZoom;currentZoom=targetZoom;currentCenterX=zoomCenterCoordinateXY.x;currentCenterY=zoomCenterCoordinateXY.y;loadWholeMap()}this.opticalZoom=function(startZoom,targetZoom,zoomCenterPixelX,zoomCenterPixelY,moveOffset){showLabels(false);abortAllRequests();var currentZoom=startZoom;if(divTileMapZoom==null){divTileMapZoom=currentTileLayer.cloneNode(true);divTileMapZoom.id="IWTilesZoom";divTileMapZoom.style.position="absolute";divTileMapZoom.style.left=currentTileLayer.parentNode.style.left;divTileMapZoom.style.top=currentTileLayer.parentNode.style.top;currentTileLayer.style.visibility="hidden";iw.before(currentTileLayer.parentNode.parentNode,currentTileLayer.parentNode,divTileMapZoom)}var imageTiles=divTileMapZoom.childNodes;var size=options.getSize();var mapWidthInPixel=size.getWidth();var mapHeightInPixel=size.getHeight();var offsetTileMapX=parseInt(divTileMap.style.left);var offsetTileMapY=parseInt(divTileMap.style.top);if(moveOffset==null||typeof moveOffset=="undefined"){moveOffset=new IWPoint(0,0)}if(!zoomCenterPixelX||!zoomCenterPixelY){var size=options.getSize();zoomCenterPixelX=Math.ceil(size.getWidth()/2)-offsetTileMapX;zoomCenterPixelY=Math.ceil(size.getHeight()/2)-offsetTileMapY}else{zoomCenterPixelX-=offsetTileMapX;zoomCenterPixelY-=offsetTileMapY}var zoomSteps=Math.abs(startZoom-targetZoom);for(var z=0;z<zoomSteps;z++){if(currentZoom<currentMapType.getMinLevel()||currentZoom>currentMapType.getMaxLevel()){return}var tilesizeMeters=currentMapType.getTilesizeMeter();var currentZoomMeter=tilesizeMeters[currentZoom];var targetZoomMeter=tilesizeMeters[targetZoom];var zoomFactor=currentZoomMeter/targetZoomMeter;for(var i=0;i<imageTiles.length;i++){var imageTile=imageTiles[i];var oldImageSize=(imageTile.widthVal?imageTile.widthVal:parseInt(imageTile.width));var imageWidth=oldImageSize*zoomFactor;if(imageWidth<1){continue}imageTile.widthVal=imageWidth;var newImageSize=Math.ceil(imageTile.widthVal);var x1=(imageTile.xVal?imageTile.xVal:(parseInt(imageTile.style.left)));var y1=(imageTile.yVal?imageTile.yVal:(parseInt(imageTile.style.top)));imageTile.moveOffsetX=(imageTile.moveOffsetX?+imageTile.moveOffsetX:0)+moveOffset.getX();imageTile.moveOffsetY=(imageTile.moveOffsetY?+imageTile.moveOffsetY:0)+moveOffset.getY();var x2=x1+newImageSize;var y2=y1+newImageSize;if(offsetTileMapX+x2<0||offsetTileMapY+y2<0||offsetTileMapX+x1>mapWidthInPixel||offsetTileMapY+y1>mapHeightInPixel){if(imageTile.style.display!="none"){imageTile.style.display="none"}}else{if(IWBrowser.isInternetExplorer()){imageTile.style.width=imageTile.style.height=newImageSize}else{imageTile.width=imageTile.height=newImageSize}if(imageTile.style.display=="none"){imageTile.style.block="block"}}var xCenterOffset=Math.abs(x1-zoomCenterPixelX);var yCenterOffset=Math.abs(y1-zoomCenterPixelY);var xMoveOffset=((xCenterOffset)*zoomFactor);var yMoveOffset=((yCenterOffset)*zoomFactor);if(currentZoom>targetZoom){if(x1>zoomCenterPixelX){imageTile.xVal=x1-xMoveOffset}else{imageTile.xVal=x1+xMoveOffset}if(y1>zoomCenterPixelY){imageTile.yVal=y1-yMoveOffset}else{imageTile.yVal=y1+yMoveOffset}}else{if(x1>zoomCenterPixelX){imageTile.xVal=x1+xMoveOffset/zoomFactor}else{imageTile.xVal=x1-xMoveOffset/zoomFactor}if(y1>zoomCenterPixelY){imageTile.yVal=y1+yMoveOffset/zoomFactor}else{imageTile.yVal=y1-yMoveOffset/zoomFactor}}if(imageTile.style.display!="none"){imageTile.style.left=Math.floor(imageTile.xVal)+Math.floor(imageTile.moveOffsetX)+"px";imageTile.style.top=Math.floor(imageTile.yVal)+Math.floor(imageTile.moveOffsetY)+"px"}}if(currentZoom<targetZoom){currentZoom++}else{currentZoom--}}};this.createPrintMap=function(){};this.getCopyrightControl=function(){return copyrightControl};this.addWindowOverlay=function(windowOverlay){windowOverlay.beforeAppend();windowOverlay.redraw();iw.append(windowOverlay.getParent(),windowOverlay.getContainer());windowOverlay.afterAppend()};this.removeWindowOverlay=function(windowOverlay){if(windowOverlay.getContainer){windowOverlay.beforeRemove();iw.remove(windowOverlay.getContainer());windowOverlay.afterRemove()}};this.openInfoBalloon=function(coordinate,content){windowOverlayManager.openInfoBalloon(coordinate,content)};this.removeInfoBalloon=function(){windowOverlayManager.removeInfoBalloon()};this.openTooltip=function(coordinate,text){windowOverlayManager.openTooltip(coordinate,text)};this.removeTooltip=function(){windowOverlayManager.removeTooltip()};this.getContainer=function(){return mapContainer};this.getCenter=function(){if(currentCenterX!=null&&currentCenterY!=null){return new IWCoordinate(currentCenterX,currentCenterY)}else{return null}};this.getMapWidthInMeter=function(){return mapWidthInMeter};this.getMapHeightInMeter=function(){return mapHeightInMeter};this.getMeterPerPixel=function(){if(options.getSize().getWidth()==0){return 0}return Math.round(mapWidthInMeter/options.getSize().getWidth())};this.getZoom=function(){return currentZoom};this.getZoomByMeter=function(meter){var tilesizeMeters=currentMapType.getTilesizeMeter();var meterPerTile=Math.round(meter/(options.getSize().getWidth()/IWTile.SIZE));var zoomlevel=parseInt(currentMapType.getMinLevel());for(var i=zoomlevel+1;i<=currentMapType.getMaxLevel();i++){if(Math.round(tilesizeMeters[i])>=meterPerTile){zoomlevel=i}else{break}}return zoomlevel};this.getBounds=function(){var nDiffX=this.getMapWidthInMeter()/2;var nDiffY=this.getMapHeightInMeter()/2;var coordNW=new IWCoordinate(currentCenterX-nDiffX,currentCenterY+nDiffY);var coordSE=new IWCoordinate(currentCenterX+nDiffX,currentCenterY-nDiffY);return new IWBounds(coordNW,coordSE)};this.getBoundsZoomlevel=function(bounds){var meterWidth=Math.abs(bounds.getSouthEast().getX()-bounds.getNorthWest().getX());var meterHeight=Math.abs(bounds.getNorthWest().getY()-bounds.getSouthEast().getY());var meterRatio=(meterHeight!=0)?(meterWidth/meterHeight):Number.POSITIVE_INFINITY;var pixelRatio=options.getSize().getWidth()/options.getSize().getHeight();if(meterRatio<pixelRatio){meterWidth=meterHeight*pixelRatio}else{meterHeight=meterWidth/pixelRatio}var center=bounds.getCenter();var w=meterWidth/2;var h=meterHeight/2;var northWest=new IWCoordinate(center.getX()-w,center.getY()+h);var southEast=new IWCoordinate(center.getX()+w,center.getY()-h);bounds=new IWBounds(northWest,southEast);var meterWidth=Math.abs(bounds.getSouthEast().getX()-bounds.getNorthWest().getX());return this.getZoomByMeter(meterWidth)};this.getCurrentMapType=function(){return currentMapType};this.getOptions=function(){return options};this.getLayoutManager=function(){return layoutManager};this.getOverlayManager=function(){return overlayManager};this.getLayerInfoManager=function(){return layerInfoManager};this.getTilesAxis=function(){return tilesAxis};this.panTo=function(coordinate){if(coordinate.getProjectionType()==IWCoordinate.WGS84){coordinate=coordinate.toMercator()}var projection=currentMapType.getProjection();var pointCenterXY=projection.meterToPixelXY(currentCenterX,currentCenterY);var pointCoordXY=projection.meterToPixelXY(coordinate.getX(),coordinate.getY());var offsetX=pointCenterXY.x-pointCoordXY.x;var offsetY=pointCenterXY.y-pointCoordXY.y;var size=options.getSize();var distanceToPoint=Math.sqrt(offsetX*offsetX+offsetY*offsetY);var distanceScreen=Math.sqrt(size.getWidth()*size.getWidth()+size.getHeight()*size.getHeight());if(distanceToPoint<distanceScreen){var moveEvent=new IWMoveEvent();moveEvent.offsetX=offsetX;moveEvent.offsetY=offsetY;moveEvent.offset=new IWPoint(offsetX,offsetY);this.triggerOnMoveStart(moveEvent);slide(offsetX,offsetY,coordinate)}else{this.setCenter(coordinate)}if(this.panTo.caller.caller!=actionStack.undoAction){if(this.panTo.caller.caller!=actionStack.redoAction){actionStack.addAction(new IWMapActionMove(new IWPoint(offsetX,offsetY)))}}};this.panBy=function(offset,undoable){var offsetX=offset.getX();var offsetY=offset.getY();if(Math.abs(offsetX)>3000||Math.abs(offsetY)>3000){alert("panBy "+offset+" is not allowed. The offset must not exceed a maximum of 3000 x 3000 pixel.");return}var moveEvent=new IWMoveEvent();moveEvent.offsetX=offsetX;moveEvent.offsetY=offsetY;moveEvent.offset=offset;this.triggerOnMoveStart(moveEvent);var width=options.getSize().getWidth();var height=options.getSize().getHeight();if(offsetX<=width*0.5&&offsetY<=height*0.5){slide(offsetX,offsetY)}else{move(offsetX,offsetY);showLabels(true)}if(undoable||typeof undoable=="undefined"){actionStack.addAction(new IWMapActionMove(offset))}};function move(offsetX,offsetY){if(!offsetX&&!offsetY){return}if(currentMapType.getType()!="IW_MAPDISPATCHER"){var newCurrentCenterXY=currentMapType.getProjection().pixelToMeterXY(centerPixelX-offsetX,centerPixelY-offsetY)}else{var newCurrentCenterXY=currentMapType.getProjection().pixelToMeterXY(centerPixelX-offsetX,centerPixelY-offsetY);if(newCurrentCenterXY.x<-20037508.342789274){newCurrentCenterXY.x=(newCurrentCenterXY.x+20037508.342789274)%40075016.68557855+20037508.342789274}else{if(newCurrentCenterXY.x>20037508.342789274){newCurrentCenterXY.x=(newCurrentCenterXY.x+20037508.342789274)%40075016.68557855-20037508.342789274}}if(newCurrentCenterXY.y<-20037508.342789274){newCurrentCenterXY.y=(newCurrentCenterXY.y+20037508.342789274)%40075016.68557855+20037508.342789274}else{newCurrentCenterXY.y=(newCurrentCenterXY.y+20037508.342789274)%40075016.68557855-20037508.342789274}}currentCenterX=newCurrentCenterXY.x;currentCenterY=newCurrentCenterXY.y;rasterTileOffsetX+=offsetX;rasterTileOffsetY+=offsetY;imgLabelsX+=offsetX;imgLabelsY+=offsetY;imgLabels.style.left=imgLabelsX+"px";imgLabels.style.top=imgLabelsY+"px";divTileMapX+=offsetX;divTileMapY+=offsetY;divTileMap.style.left=divTileMapX+"px";divTileMap.style.top=divTileMapY+"px";divWindowOverlayX+=offsetX;divWindowOverlayY+=offsetY;divWindowOverlay.style.left=divWindowOverlayX+"px";divWindowOverlay.style.top=divWindowOverlayY+"px";var moveEvent=new IWMoveEvent();moveEvent.position=null;moveEvent.lastPosition=null;moveEvent.offsetX=offsetX;moveEvent.offsetY=offsetY;moveEvent.offset=new IWPoint(offsetX,offsetY);self.triggerOnMove(moveEvent);if(RELOAD_ON_MOVE){if(rasterTileOffsetX>IWTile.SIZE||rasterTileOffsetX<-IWTile.SIZE||rasterTileOffsetY>IWTile.SIZE||rasterTileOffsetY<-IWTile.SIZE){var moveOffset=new IWPoint(rasterTileOffsetX,rasterTileOffsetY);rasterTileOffsetX=rasterTileOffsetX%IWTile.SIZE;rasterTileOffsetY=rasterTileOffsetY%IWTile.SIZE;if(currentMapType.getType()=="IW_MAPDISPATCHER"){reloadTilesMapDispatcher()}else{reloadTiles(moveOffset)}}else{}}}this.setCenter=function(coordinate,zoom,mapType){hide();if(coordinate.getProjectionType()==IWCoordinate.WGS84){var mercator=coordinate.toMercator();currentCenterX=mercator.getX();currentCenterY=mercator.getY()}else{currentCenterX=coordinate.getX();currentCenterY=coordinate.getY()}oldCenterX=currentCenterX;oldCenterY=currentCenterY;oldZoom=currentZoom;if(typeof zoom!="undefined"){currentZoom=zoom}var projection=currentMapType.getProjection();var meterNW=projection.pixelToMeter(new IWPoint(0,0));var meterSE=projection.pixelToMeter(new IWPoint(options.getSize().getWidth(),options.getSize().getHeight()));visibleBounds=new IWBounds(meterNW,meterSE);oldMapTypeName=currentMapType.getName();if(typeof mapType!="undefined"){currentMapType=mapType;if(oldMapTypeName!=mapType.getName()){myMapTiles=new Object();for(level in tiles){for(var i=tiles[level].length;i>0;i--){if(tiles[level][(i-1)].destroy){tiles[level][(i-1)].destroy();tiles[level][(i-1)]=null}else{iw.destroy(tiles[level][(i-1)]);tiles[level][(i-1)]=null}}}tiles=new Object();iw.empty(divTileMap);var event=new IWMapTypeChangeEvent();event.oldMapType=oldMapTypeName;event.newMapType=currentMapType.getName();this.triggerOnMapTypeChangeStart(event)}}if(currentZoom<currentMapType.getMinLevel()){currentZoom=currentMapType.getMinLevel()}else{if(currentZoom>currentMapType.getMaxLevel()){currentZoom=currentMapType.getMaxLevel()}}loadWholeMap()};this.zoomIn=function(undoable){var oldBounds=this.getBounds();if(this.zoom(currentZoom,currentZoom+1)){if(undoable||typeof undoable=="undefined"){actionStack.addAction(new IWMapActionZoom(oldBounds,this.getBounds()))}return true}return false};this.zoomOut=function(undoable){var oldBounds=this.getBounds();if(this.zoom(currentZoom,currentZoom-1)){if(undoable||typeof undoable=="undefined"){actionStack.addAction(new IWMapActionZoom(oldBounds,this.getBounds()))}return true}return false};this.savePosition=function(){savedCenter=currentCenter;savedZoom=currentZoom};this.returnToSavedPosition=function(){if(savedCenter&&savedZoom){this.setCenter(savedCenter,savedZoom)}};this.undo=function(){actionStack.undoAction()};this.redo=function(){actionStack.redoAction()};this.addLayer=function(layer){for(var i=0;i<layers.length;i++){if(layer==layers[i]){layers[i]=layer;return}}layers.push(layer)};this.removeLayerByName=function(layerName){for(var i=0;i<layers.length;i++){if(layerName==layers[i].getName()){var removeLayer=layers[i];layers.splice(i,1);removeLayer.triggerOnRemove();return removeLayer}}return null};this.removeLayer=function(layer){for(var i=0;i<layers.length;i++){if(layer==layers[i]){var removeLayer=layers[i];layers.splice(i,1);removeLayer.triggerOnRemove()}}};this.redraw=function(){showLabels(true)};this.getLayers=function(){return layers};this.getLayerByName=function(layerName){for(var i=0;i<layers.length;i++){if(layerName==layers[i].getName()){return layers[i]}}return null};this.getSessionId=function(){return iwconst.SESSION_ID};this.getClippingContainer=function(){return divClipping};this.getWindowOverlayContainer=function(){return divWindowOverlay};this.getZoomingAndDraggingContainer=function(){return divZoomingAndDragging};this.getOverlayContainer=function(){return divOverlay};this.getDrawingContainer=function(){return divDrawing};this.getControlContainer=function(){return divControl};this.getTilesContainer=function(){return divTileMap};this.toString=function(){return"[IWMap]"};this.triggerOnProjectionInvalid=function(){IWEventManager.trigger(this,"onprojectioninvalid",null)};this.triggerOnProjectionInitialize=function(){IWEventManager.trigger(this,"onprojectioninitialize",null)};this.triggerOnMouseDown=function(event){IWEventManager.trigger(this,"onmousedown",event)};this.triggerOnMouseUp=function(event){IWEventManager.trigger(this,"onmouseup",event)};this.triggerOnMouseStop=function(event){IWEventManager.trigger(this,"onmousestop",event)};this.triggerOnClick=function(event){clickTimestamp=new Date().getTime();clickTimeout=null;if(isOnClickEvent){IWEventManager.trigger(this,"onclick",event)}};this.triggerOnInitialize=function(event){IWEventManager.trigger(this,"oninitialize",event)};this.triggerOnCenter=function(event){if(!options.isOverviewMap()&&!currentMapType.hasLabels()){countClick()}IWEventManager.trigger(this,"oncenter",event)};this.triggerOnMoveStart=function(event){totalOffsetX=0;totalOffsetY=0;IWEventManager.trigger(this,"onmovestart",event)};this.triggerOnMove=function(event){totalOffsetX+=event.offsetX;totalOffsetY+=event.offsetY;event.totalOffsetX=totalOffsetX;event.totalOffsetY=totalOffsetY;IWEventManager.trigger(this,"onmove",event)};this.triggerOnMoveEnd=function(event){event.totalOffsetX=totalOffsetX;event.totalOffsetY=totalOffsetY;if(!options.isOverviewMap()&&!currentMapType.hasLabels()){countClick()}if(!options.isOverviewMap()&&(event.totalOffsetX!=0||event.totalOffsetY!=0)){requestMapTypeAvailable()}IWEventManager.trigger(this,"onmoveend",event);if(currentMapType.getProjection().needsReloadXY(currentCenterX,currentCenterY,options.getSize())){this.setCenter(new IWCoordinate(currentCenterX,currentCenterY))}else{if(!RELOAD_ON_MOVE){if(currentMapType.getType()=="IW_MAPDISPATCHER"){reloadTilesMapDispatcher()}else{reloadTiles(event.offset)}}}if(tiles[currentZoom].length>200){divTileMapX=parseInt(divTileMap.style.left);divTileMapY=parseInt(divTileMap.style.top);var size=options.getSize();for(var i=tiles[currentZoom].length,j=0;i>100;i--){var imageTile=tiles[currentZoom][j];var imageTileX=parseInt(imageTile.style.left)+divTileMapX;var imageTileY=parseInt(imageTile.style.top)+divTileMapY;if(imageTileX+IWTile.SIZE<0||imageTileX>size.getWidth()||imageTileY+IWTile.SIZE<0||imageTileY>size.getHeight()){delete (myMapTiles[currentZoom][imageTile.id]);tiles[currentZoom].splice(j,1);if(imageTile.destroy){imageTile.destroy()}else{iw.destroy(imageTile)}}else{j++}}}};this.triggerOnZoomStart=function(event){IWEventManager.trigger(this,"onzoomstart",event)};this.triggerOnZoom=function(event){IWEventManager.trigger(this,"onzoom",event)};this.triggerOnZoomEnd=function(event){iw.destroy(divTileMapZoom);divTileMapZoom=null;if(!options.isOverviewMap()&&!currentMapType.hasLabels()){countClick()}IWEventManager.trigger(this,"onzoomend",event)};this.triggerOnMapTypeChange=function(event){IWEventManager.trigger(this,"onmaptypechange",event)};this.triggerOnMapTypeChangeStart=function(event){IWEventManager.trigger(this,"onmaptypechangestart",event)};this.triggerOnMapTypesChange=function(event){IWEventManager.trigger(this,"onmaptypeschange",event)};this.triggerOnMapTypeAvailabilityChange=function(event){IWEventManager.trigger(this,"onmaptypeavailabilitychange",event)};this.triggerOnResize=function(event){var size=event.newSize;var width=parseInt(mapContainer.style.width);var height=parseInt(mapContainer.style.height);if(size.getWidth()!=width||size.getHeight()!=height){resize(size);layoutManager.redraw();IWEventManager.trigger(this,"onresize",event)}};this.triggerOnMapControlChange=function(event){IWEventManager.trigger(this,"onmapcontrolchange",event)};this.triggerOnLanguageChange=function(event){IWEventManager.trigger(this,"onlanguagechange",event)};this.triggerOnCopyrightChange=function(event){IWEventManager.trigger(this,"oncopyrightchange",event)};function callbackGetPrintMapRequest(xmlHttp){if(xmlHttp.readyState==4){if(xmlHttp.statusText=="OK"){imgPrintMap.src=xmlHttp.responseText}else{if(xmlHttp.status==401){alert(xmlHttp.statusText)}}}else{alert("GetPrintMap failed: "+xmlHttp.statusText)}}function wheelZoom(event){if(timeoutWheel==null){currentZoomCenterXY=mouseAdapter.toMouseEvent(event.mouseEvent,mapContainer).positionXY;self.triggerOnZoomStart();currentWheelstep=currentZoom}else{window.clearTimeout(timeoutWheel)}var oldZoomLevel=currentWheelstep;currentWheelstep=Math.max(Math.min(currentWheelstep+event.delta,currentMapType.getMaxLevel()),currentMapType.getMinLevel());timeoutWheel=window.setTimeout(function(){self.zoom(currentWheelstep,currentWheelstep,currentZoomCenterXY.x,currentZoomCenterXY.y,false);timeoutWheel=null},500);var zoomEvent=new IWZoomEvent();zoomEvent.newZoomLevel=currentWheelstep;self.triggerOnZoom(zoomEvent);self.opticalZoom(oldZoomLevel,currentWheelstep,currentZoomCenterXY.x,currentZoomCenterXY.y);if(event.preventDefault){event.preventDefault()}}function prepareMouseDragging(mouseEvent){iw.destroy(divTileMapZoom);IWEventManager.removeListener(dragOnMouseMoveListener);IWEventManager.removeListener(dragOnMouseUpListener);var e=new IWMoveEvent();e.positionXY=mouseEvent.positionXY;e.lastPosition=mouseEvent.lastPosition;e.offset=new IWPoint(0,0);lastMousePositionX=mouseEvent.positionXY.x;lastMousePositionY=mouseEvent.positionXY.y;startDragPosition=mouseEvent.positionXY;isOnMoveEventTriggered=false;divZoomingAndDragging.style.cursor="pointer";dragOnMouseMoveListener=IWEventManager.addDomListener(window.document,"onmousemove",function(event){if(!event){event=window.event}var mousePositionXY=mouseAdapter.getPositionXY(event,mapContainer);if(mousePositionXY.x==lastMousePositionX&&mousePositionXY.y==lastMousePositionY){return}if(buttonPressed!=0&&event.button==0){dropMap(mousePositionXY.x,mousePositionXY.y)}else{buttonPressed=event.button;if(document.attachEvent&&divZoomingAndDragging.setCapture){divZoomingAndDragging.setCapture()}var offsetX=mousePositionXY.x-lastMousePositionX;var offsetY=mousePositionXY.y-lastMousePositionY;if(isOnMoveEventTriggered==false){isOnMoveEventTriggered=true;self.triggerOnMoveStart(e)}move(offsetX,offsetY)}lastMousePositionX=mousePositionXY.x;lastMousePositionY=mousePositionXY.y});dragOnMouseUpListener=IWEventManager.addDomListener(window.document,"onmouseup",function(event){IWEventManager.removeListener(dragOnMouseMoveListener);buttonPressed=0;if(document.attachEvent&&divZoomingAndDragging.releaseCapture){divZoomingAndDragging.releaseCapture()}if(isOnMoveEventTriggered){var mousePositionXY=mouseAdapter.getPositionXY(event,mapContainer);dropMap(mousePositionXY.x,mousePositionXY.y)}})}function dropMap(mousePosX,mousePosY){window.document.onmouseout=null;IWEventManager.removeListener(dragOnMouseMoveListener);IWEventManager.removeListener(dragOnMouseUpListener);dragOnMouseMoveListener=null;dragOnMouseUpListener=null;divZoomingAndDragging.style.cursor="auto";var moveEvent=new IWMoveEvent();moveEvent.lastPosition=startDragPosition;var moveX=mousePosX-startDragPosition.x;var moveY=mousePosY-startDragPosition.y;if(moveX!=0||moveY!=0){showLabels(true)}self.triggerOnMoveEnd(moveEvent)}function buildGUI(){var size=options.getSize();centerPixelX=size.getWidth()/2;centerPixelY=size.getHeight()/2;var newWidth=size.getWidth()+"px";var newHeight=size.getHeight()+"px";mapContainer.style.height=newHeight;mapContainer.style.width=newWidth;iw.append(mapContainer,divCSS);divCSS.className="iwmapcss";divCSS.style.position="relative";divCSS.style.top="0px";divCSS.style.left="0px";iw.append(mapContainer.firstChild,divClipping);divClipping.id="IWClipping";divClipping.style.position="relative";divClipping.style.left="0px";divClipping.style.top="0px";divClipping.style.width=newWidth;divClipping.style.height=newHeight;divClipping.style.overflow="hidden";divClipping.style.clip="rect(0px "+newWidth+" "+newHeight+" 0px)";iw.append(divClipping,imgLabels);imgLabels.id="imgLabels";imgLabels.style.width=newWidth;imgLabels.style.height=newHeight;imgLabels.style.position="absolute";imgLabels.style.left="0px";imgLabels.style.top="0px";imgLabels.style.zIndex="2";imgLabels.style.display="none";imgLabels.src=iwconst.GLOBAL_APP_URL+"img/symbols/blank.gif";iw.append(divClipping,imgLabelsLoad);imgLabelsLoad.style.width="0px";imgLabelsLoad.style.height="0px";imgLabelsLoad.style.position="absolute";imgLabelsLoad.style.left="0px";imgLabelsLoad.style.top="0px";imgLabelsLoad.style.zIndex="2";imgLabelsLoad.style.display="none";iw.append(divClipping,divZoomingAndDragging);divZoomingAndDragging.id="IWZoomingAndDragging";divZoomingAndDragging.style.position="absolute";divZoomingAndDragging.style.left="0px";divZoomingAndDragging.style.top="0px";divZoomingAndDragging.style.zIndex="3";divZoomingAndDragging.style.width=newWidth;divZoomingAndDragging.style.height=newHeight;iw.append(divClipping,imgPrintMap);imgPrintMap.id="IWPrintMap";imgPrintMap.className="iwnoscreen";imgPrintMap.src=iwconst.GLOBAL_APP_URL+"img/symbols/blank.gif";iw.append(divZoomingAndDragging,imgZoomingAndDragging);imgZoomingAndDragging.id="IWImgZoomingAndDragging";imgZoomingAndDragging.src=iwconst.GLOBAL_APP_URL+"img/symbols/blank.gif";imgZoomingAndDragging.galleryimg="no";imgZoomingAndDragging.style.width=newWidth;imgZoomingAndDragging.style.height=newHeight;divZoomingAndDragging.oncontextmenu=function(){return false};divZoomingAndDragging.ondrag=function(){return false};iw.append(divZoomingAndDragging,divOverlaysAndControls);divOverlaysAndControls.id="IWOverlaysAndControls";divOverlaysAndControls.style.position="absolute";divOverlaysAndControls.style.left="0px";divOverlaysAndControls.style.top="0px";divOverlaysAndControls.style.width="0px";divOverlaysAndControls.style.height="0px";divOverlaysAndControls.oncontextmenu=function(){return false};divOverlaysAndControls.ondrag=function(){return false};iw.append(divOverlaysAndControls,divControl);divControl.id="IWControl";divControl.style.position="absolute";divControl.style.left="0px";divControl.style.top="0px";divControl.style.width=newWidth;divControl.style.height=newHeight;divControl.style.zIndex="0";divControl.oncontextmenu=function(){return false};divControl.ondrag=function(){return false};iw.append(divControl,divOverlay);divOverlay.id="IWOverlay";divOverlay.style.position="absolute";divOverlay.style.left="0px";divOverlay.style.top="0px";divOverlay.style.zIndex="0";iw.append(divOverlay,divDrawing);divDrawing.id="divDrawing";iw.append(divOverlaysAndControls,divWindowOverlay);divWindowOverlay.id="IWWindowOverlay";divWindowOverlay.style.position="absolute";divWindowOverlay.style.left="0px";divWindowOverlay.style.top="0px";divWindowOverlay.style.zIndex="1";divWindowOverlay.oncontextmenu=function(){return false};divWindowOverlay.ondrag=function(){return false};divTileMap=iw.create("div");iw.append(divClipping,divTileMap);divTileMap.id="IWTiles";divTileMap.style.zIndex="1";divTileMap.style.position="absolute";divTileMap.style.left="0px";divTileMap.style.top="0px";copyrightControl=new IWCopyrightControl(self);layoutManager.getLayer(0).addControl(copyrightControl,IWAlignment.RIGHT,IWAlignment.BOTTOM,0,0);layoutManager.getLayer(0).addControl(new IWZoomBoxControl(self),IWAlignment.RIGHT,IWAlignment.BOTTOM,0,0);IWEventManager.addDomListener(divClipping,"onmousemove",onMouseMoveHandler);IWEventManager.addDomListener(divClipping,"onmouseover",function(e){if(options.getMouseWheelAction()!=IWMapOptions.CONTROL_NONE){window.onmousewheel=document.onmousewheel=function(e){return false}}});IWEventManager.addDomListener(divClipping,"onmouseout",function(e){if(options.getMouseWheelAction()!=IWMapOptions.CONTROL_NONE){window.onmousewheel=document.onmousewheel=function(e){return true}}window.clearTimeout(mouseStopTimeout)});IWEventManager.addDomListener(divZoomingAndDragging,"onmousedown",function(event){isOnClickEvent=false;divZoomingAndDragging.style.cursor="pointer";var mouseEvent=mouseAdapter.toMouseEvent(event,mapContainer);onMouseDownPosition=mouseEvent.position;if(mouseEvent.button==IWButton.LEFT){var leftMouseAction=options.getLeftMouseAction();if(leftMouseAction==IWMapOptions.CONTROL_MOVE){prepareMouseDragging(mouseEvent)}}else{if(mouseEvent.button==IWButton.RIGHT){var rightMouseAction=options.getRightMouseAction();if(rightMouseAction==IWMapOptions.CONTROL_MOVE){prepareMouseDragging(mouseEvent)}}}self.triggerOnMouseDown(mouseEvent)});IWEventManager.addDomListener(divZoomingAndDragging,"onmouseup",function(event){divZoomingAndDragging.style.cursor="auto";var mouseEvent=mouseAdapter.toMouseEvent(event,mapContainer);if(onMouseDownPosition&&onMouseDownPosition.distanceFrom(mouseEvent.position)<2){isOnClickEvent=true}onMouseDownPosition=null;self.triggerOnMouseUp(mouseEvent)});IWEventManager.addDomListener(divZoomingAndDragging,"onclick",function(event){window.clearTimeout(mouseStopTimeout);clickTimestamp=new Date().getTime();if(clickTimeout){return}if(dblClickTimestamp){var time=clickTimestamp-dblClickTimestamp;if(time<10){return}}if(!event){event=window.event}var mouseEvent=mouseAdapter.toMouseEvent(event,mapContainer);clickTimeout=window.setTimeout(function(){self.triggerOnClick(mouseEvent)},200)});IWEventManager.addDomListener(divZoomingAndDragging,"ondblclick",function(event){dblClickTimestamp=new Date().getTime();if(clickTimeout){window.clearTimeout(clickTimeout);clickTimeout=null}if(options.getDoubleClickAction()==IWMapOptions.CONTROL_ZOOM){var mousePositionXY=mouseAdapter.getPositionXY(event,mapContainer);var pixelNW=new IWPoint(mousePositionXY.x-20,mousePositionXY.y-20);var pixelSE=new IWPoint(mousePositionXY.x+20,mousePositionXY.y+20);var projection=currentMapType.getProjection();var coordNW=projection.pixelToMeter(pixelNW);var coordSE=projection.pixelToMeter(pixelSE);var newZoomLevel=self.getBoundsZoomlevel(new IWBounds(coordNW,coordSE));if(newZoomLevel!=currentZoom){self.triggerOnZoomStart();if(newZoomLevel<currentMapType.getMaxLevel()){self.zoom(currentZoom,newZoomLevel,mousePositionXY.x,mousePositionXY.y,true)}else{self.zoom(currentZoom,currentMapType.getMaxLevel(),mousePositionXY.x,mousePositionXY.y,true)}}}})}function resize(size){var size=options.getSize();centerPixelX=size.getWidth()/2;centerPixelY=size.getHeight()/2;hide();abortAllRequests();var newWidth=size.getWidth()+"px";var newHeight=size.getHeight()+"px";var containerSize=options.getSizeInUnit();mapContainer.style.width=containerSize.size.getWidth()+containerSize.unit;mapContainer.style.height=containerSize.size.getHeight()+containerSize.unit;divClipping.style.clip="rect(0px, "+newWidth+", "+newHeight+", 0px)";divClipping.style.width=newWidth;divClipping.style.height=newHeight;divZoomingAndDragging.style.width=newWidth;divZoomingAndDragging.style.height=newHeight;divOverlaysAndControls.width=newWidth;divOverlaysAndControls.height=newHeight;imgZoomingAndDragging.style.width=newWidth;imgZoomingAndDragging.style.height=newHeight;divControl.style.width=newWidth;divControl.style.height=newHeight;if(currentCenterX&&currentCenterY){loadWholeMap()}}function slide(offsetX,offsetY){if(offsetX==0&&offsetY==0){return}window.clearTimeout(slideTimeout);slideStep(offsetX,offsetY,0,0,0)}function slideStep(offsetX,offsetY,nStep,nRestX,nRestY){if(nStep<slideSteps.length){var movePixelX=slideSteps[nStep]*offsetX;var movePixelY=slideSteps[nStep]*offsetY;movePixelX+=nRestX;nRestX=movePixelX-Math.floor(movePixelX);movePixelX=Math.floor(movePixelX);movePixelY+=nRestY;nRestY=movePixelY-Math.floor(movePixelY);movePixelY=Math.floor(movePixelY);move(movePixelX,movePixelY);slideTimeout=window.setTimeout(function(){slideStep(offsetX,offsetY,++nStep,nRestX,nRestY)},40)}else{move(Math.round(nRestX),Math.round(nRestY));showLabels(true);var moveEvent=new IWMoveEvent();moveEvent.position=null;moveEvent.lastPosition=null;moveEvent.offset=new IWPoint(offsetX,offsetY);moveEvent.offsetX=offsetX;moveEvent.offsetY=offsetY;self.triggerOnMoveEnd(moveEvent)}}function reloadTiles(offset){logstat=true;var offsetX=offset.getX();var offsetY=offset.getY();var leftX=tiles[currentZoom][findLeftCol()].getPosition().getX();var rightX=leftX+((tilesAxis.getWidth()-1)*IWTile.SIZE);var topY=tiles[currentZoom][findTopRow()*tilesAxis.getWidth()].getPosition().getY();var bottomY=topY+((tilesAxis.getHeight()-1)*IWTile.SIZE);var size=options.getSize();if(rightX>=size.getWidth()){if(offsetX>0){var projection=currentMapType.getProjection();var outOfRangePixel=rightX-size.getWidth();var discardBorders=Math.ceil(outOfRangePixel/IWTile.SIZE);if(discardBorders>0){var sectionCenterPixel=new IWPoint(leftX-discardBorders*IWTile.SIZE/2,topY+(tilesAxis.getHeight()*IWTile.SIZE/2));var sectionCenterMeter=projection.pixelToMeter(sectionCenterPixel);var x1=leftX-(discardBorders*IWTile.SIZE);var y1=topY;var x2=leftX;var y2=y1+(tilesAxis.getHeight()*IWTile.SIZE);var pointNW=new IWPoint(x1,y1);var pointSE=new IWPoint(x2,y2);var meterNW=projection.pixelToMeter(pointNW);var meterSE=projection.pixelToMeter(pointSE);discardRightBorder(discardBorders,sectionCenterMeter,new IWBounds(meterNW,meterSE));var offsetX=discardBorders*IWTile.SIZE;leftX-=offsetX;rightX-=offsetX;logstat=false}}}else{if(leftX+IWTile.SIZE<=0){if(offsetX<0){var projection=currentMapType.getProjection();var outOfRangePixel=leftX+IWTile.SIZE;var discardBorders=Math.abs(Math.floor(outOfRangePixel/IWTile.SIZE));if(discardBorders>0){var sectionCenterPixel=new IWPoint(rightX+IWTile.SIZE+discardBorders*IWTile.SIZE/2,topY+(tilesAxis.getHeight()*IWTile.SIZE/2));var sectionCenterMeter=projection.pixelToMeter(sectionCenterPixel);var x1=leftX+tilesAxis.getWidth()*IWTile.SIZE;var y1=topY;var x2=x1+(discardBorders*IWTile.SIZE);var y2=y1+(tilesAxis.getHeight()*IWTile.SIZE);var pointNW=new IWPoint(x1,y1);var pointSE=new IWPoint(x2,y2);var meterNW=projection.pixelToMeter(pointNW);var meterSE=projection.pixelToMeter(pointSE);discardLeftBorder(discardBorders,sectionCenterMeter,new IWBounds(meterNW,meterSE));var offsetX=discardBorders*IWTile.SIZE;leftX+=offsetX;rightX+=offsetX;logstat=false}}}}if(bottomY>=size.getHeight()){if(offsetY>0){var projection=currentMapType.getProjection();var outOfRangePixel=bottomY-size.getHeight();var discardBorders=Math.ceil(outOfRangePixel/IWTile.SIZE);if(discardBorders>0){var sectionCenterPixel=new IWPoint(leftX+tilesAxis.getWidth()*IWTile.SIZE/2,topY-discardBorders*IWTile.SIZE/2);var sectionCenterMeter=projection.pixelToMeter(sectionCenterPixel);var x1=leftX;var y1=topY-(discardBorders*IWTile.SIZE);var x2=x1+(tilesAxis.getWidth()*IWTile.SIZE);var y2=y1+(discardBorders*IWTile.SIZE);var pointNW=new IWPoint(x1,y1);var pointSE=new IWPoint(x2,y2);var meterNW=projection.pixelToMeter(pointNW);var meterSE=projection.pixelToMeter(pointSE);discardLowerBorder(discardBorders,sectionCenterMeter,new IWBounds(meterNW,meterSE));var offsetY=discardBorders*IWTile.SIZE;topY-=offsetY;bottomY-=offsetY;logstat=false}}}else{if(topY+IWTile.SIZE<=0){if(offsetY<0){var projection=currentMapType.getProjection();var outOfRangePixel=topY+IWTile.SIZE;var discardBorders=Math.abs(Math.floor(outOfRangePixel/IWTile.SIZE));if(discardBorders>0){var sectionCenterPixel=new IWPoint(leftX+tilesAxis.getWidth()*IWTile.SIZE/2,bottomY+IWTile.SIZE+discardBorders*IWTile.SIZE/2);var sectionCenterMeter=projection.pixelToMeter(sectionCenterPixel);var x1=leftX;var y1=topY+(tilesAxis.getHeight()*IWTile.SIZE);var x2=x1+(tilesAxis.getWidth()*IWTile.SIZE);var y2=y1+(discardBorders*IWTile.SIZE);var pointNW=new IWPoint(x1,y1);var pointSE=new IWPoint(x2,y2);var meterNW=projection.pixelToMeter(pointNW);var meterSE=projection.pixelToMeter(pointSE);discardUpperBorder(discardBorders,sectionCenterMeter,new IWBounds(meterNW,meterSE));var offsetY=discardBorders*IWTile.SIZE;topY+=offsetY;bottomY+=offsetY;logstat=false}}}}logstat=true}function getTilePosition(img){if(img){var imgX=parseInt(img.style.left);var imgY=parseInt(img.style.top);return{x:divTileMapX+imgX,y:divTileMapY+imgY}}else{return{x:0,y:0}}}var myMapTiles=new Object();function reloadTilesMapDispatcher(){var borderTiles=options.getBorderTiles();var tilesX=Math.ceil(options.getSize().getWidth()/IWTile.SIZE)+1+borderTiles;var tilesY=Math.ceil(options.getSize().getHeight()/IWTile.SIZE)+1+borderTiles;var config=currentMapType.getTilesServerConfig();divTileMapX=parseInt(divTileMap.style.left);divTileMapY=parseInt(divTileMap.style.top);var config=currentMapType.getTilesServerConfig();var numAliases=config.getAliases().length;var cornerPixelAbsoluteXY=IWVEUtils.relativePixelToAbsoluteXY(self,0,0);var rasterPixelAbsoluteXY={x:(parseInt(cornerPixelAbsoluteXY.x/IWTile.SIZE))*IWTile.SIZE,y:(parseInt(cornerPixelAbsoluteXY.y/IWTile.SIZE))*IWTile.SIZE};var relativeTilePixelX=rasterPixelAbsoluteXY.x-cornerPixelAbsoluteXY.x-parseInt(divTileMap.style.left);var relativeTilePixelY=rasterPixelAbsoluteXY.y-cornerPixelAbsoluteXY.y-parseInt(divTileMap.style.top);for(var x=0;x<tilesX;x++){var pixelX=relativeTilePixelX+(x*IWTile.SIZE);for(var y=0;y<tilesY;y++){var pixelY=relativeTilePixelY+(y*IWTile.SIZE);var absoluteTilePixelX=rasterPixelAbsoluteXY.x+(x*IWTile.SIZE);var absoluteTilePixelY=rasterPixelAbsoluteXY.y+(y*IWTile.SIZE);var tileXY=IWVEUtils.pixelToTileXY(absoluteTilePixelX,absoluteTilePixelY);var id=IWVEUtils.tileToQuadKeyXY(tileXY.x,tileXY.y,currentZoom);var tileId="IWTile_"+id+"_"+absoluteTilePixelX+"_"+absoluteTilePixelY;if(myMapTiles[currentZoom][tileId]==true){}else{var imageTile=createImageTile(id,pixelX,pixelY);imageTile.id=tileId;myMapTiles[currentZoom][tileId]=true;imageTile.pixelAbsoluteX=absoluteTilePixelX;imageTile.pixelAbsoluteY=absoluteTilePixelY;tiles[currentZoom].push(imageTile);if(typeof tileLoader[imageTile.alias]=="undefined"){tileLoader[imageTile.alias]=new Array()}else{}if(imageTile.alias.indexOf("%1")>0){imageTile.source=imageTile.alias.replace("%1",imageTile.quadkey);if(imageTile.source.indexOf("%2")){imageTile.source=imageTile.source.replace("%2",iwconst.BMX_TOKEN)}}else{if(imageTile.alias.indexOf("%z")>0){imageTile.source=imageTile.alias.replace("%z",(currentZoom+1));imageTile.source=imageTile.source.replace("%y",(tileXY.y+y));imageTile.source=imageTile.source.replace("%x",(tileXY.x+x))}else{imageTile.source=imageTile.alias+imageTile.quadkey+".png"}}tileLoader[imageTile.alias].push(imageTile)}}}for(alias in tileLoader){doLoad(alias);doLoad(alias)}}function doLoad(alias){if(tileLoader[alias]&&tileLoader[alias].length>0){var img=tileLoader[alias].shift();if(img){img.src=img.source}}}function createImageTile(quadkey,tileX,tileY){var strQuadKey=""+quadkey;var lastNumberOfQuadKey=parseInt(strQuadKey.charAt(strQuadKey.length-1));var img=iw.create("img");currentTileLayer.appendChild(img);var countOfAliases=currentMapType.getTilesServerConfig().getAliases().length;img.alias=currentMapType.getTilesServerConfig().getAliases()[currentAliasCounter++%countOfAliases];img.quadkey=quadkey;img.width=IWTile.SIZE;img.height=IWTile.SIZE;img.style.position="absolute";img.style.zIndex="1";img.style.width=IWTile.SIZE;img.style.height=IWTile.SIZE;img.style.display="none";img.firstLoad=false;if(options.hasRaster()){img.style.border="1px solid green"}if(!IWBrowser.isInternetExplorer()){img.style.visibility="hidden"}img.tileX=tileX;img.tileY=tileY;img.style.left=tileX+"px";img.style.top=tileY+"px";img.onload=function(){this.firstLoad=true;if(!IWBrowser.isInternetExplorer()){this.style.visibility="inherit"}this.style.display="";doLoad(this.alias)};img.onabort=function(){this.firstLoad=true;if(!IWBrowser.isInternetExplorer()){this.style.visibility="inherit"}this.style.display="";doLoad(this.alias)};img.onerror=function(){this.firstLoad=true;if(!IWBrowser.isInternetExplorer()){this.style.visibility="inherit"}this.style.display="";doLoad(this.alias)};return img}function createTiles(){var borderTiles=options.getBorderTiles();var size=options.getSize();var tilesX=Math.ceil(size.getWidth()/IWTile.SIZE)+1+2*borderTiles;var tilesY=Math.ceil(size.getHeight()/IWTile.SIZE)+1+2*borderTiles;tilesAxis=new IWSize(tilesX,tilesY);divTileMapX=0;divTileMapY=0;divTileMap.style.top="0px";divTileMap.style.left="0px";divTileMap.style.visibility="visible";divTileMap.style.width=size.getWidth()+"px";divTileMap.style.height=size.getHeight()+"px";if(tiles[currentZoom]!=null&&currentMapType.getType()!="IW_MAPDISPATCHER"){for(var i=tiles[currentZoom].length;i>0;i--){var tile=tiles[currentZoom][(i-1)];if(tile!=null){if(tile.destroy){tile.destroy();tile=null}else{iw.destroy(tile);tile=null}}}}var nTilesX=tilesAxis.getWidth();var nTilesY=tilesAxis.getHeight();if(!tiles[currentZoom]){tiles[currentZoom]=new Array()}for(var row=0;row<nTilesY;row++){for(var column=0;column<nTilesX;column++){if(currentMapType.getType()!="IW_MAPDISPATCHER"){var cellIndex=row*nTilesX+column;tiles[currentZoom][cellIndex]=new IWTile(self,column,row)}else{}}}}function placeTiles(){lastMoveDirection=0;isVisibleSectionLoaded=false;loadedTiles=0;if(currentMapType.getName()!="birdsview"){var cornerPixelAbsoluteXY=IWVEUtils.relativePixelToAbsoluteXY(self,0,0);var rasterPixelAbsoluteXY={x:(parseInt(cornerPixelAbsoluteXY.x/IWTile.SIZE))*IWTile.SIZE,y:(parseInt(cornerPixelAbsoluteXY.y/IWTile.SIZE))*IWTile.SIZE};rasterTileOffsetX=IWTile.SIZE+(rasterPixelAbsoluteXY.x-cornerPixelAbsoluteXY.x);rasterTileOffsetY=IWTile.SIZE+(rasterPixelAbsoluteXY.y-cornerPixelAbsoluteXY.y);var nTilesX=tilesAxis.getWidth();var nTilesY=tilesAxis.getHeight();for(var row=0;row<nTilesY;row++){var absoluteTilePixelY=rasterPixelAbsoluteXY.y+(row*IWTile.SIZE);for(var column=0;column<nTilesX;column++){var isLoaded=false;var absoluteTilePixelX=rasterPixelAbsoluteXY.x+(column*IWTile.SIZE);var tileXY=IWVEUtils.pixelToTileXY(absoluteTilePixelX,absoluteTilePixelY);var id=IWVEUtils.tileToQuadKeyXY(tileXY.x,tileXY.y,currentZoom);var tileId="IWTile_"+id+"_"+absoluteTilePixelX+"_"+absoluteTilePixelY;if(currentMapType.getType()=="IW_MAPDISPATCHER"){isLoaded=(typeof myMapTiles[currentZoom][tileId]!="undefined");myMapTiles[currentZoom][tileId]=true}var index=row*nTilesX+column;var tilePixelAbsoluteX=rasterPixelAbsoluteXY.x+(column*IWTile.SIZE);var tilePixelAbsoluteY=rasterPixelAbsoluteXY.y+(row*IWTile.SIZE);var tilePixelRelativeX=tilePixelAbsoluteX-cornerPixelAbsoluteXY.x;var tilePixelRelativeY=tilePixelAbsoluteY-cornerPixelAbsoluteXY.y;tilePixelRelativeX-=divTileMapX;tilePixelRelativeY-=divTileMapY;if(currentMapType.getType()!="IW_MAPDISPATCHER"){tiles[currentZoom][index].tileId=id;tiles[currentZoom][index].moveToXY(tilePixelRelativeX,tilePixelRelativeY)}else{if(isLoaded==false){var imageTile=createImageTile(id,tilePixelRelativeX,tilePixelRelativeY);imageTile.id=tileId;imageTile.pixelAbsoluteX=tilePixelAbsoluteX;imageTile.pixelAbsoluteY=tilePixelAbsoluteY;tiles[currentZoom].push(imageTile);if(imageTile.alias.indexOf("%1")>0){imageTile.source=imageTile.alias.replace("%1",imageTile.quadkey);if(imageTile.source.indexOf("%2")){imageTile.source=imageTile.source.replace("%2",iwconst.BMX_TOKEN)}}else{if(imageTile.alias.indexOf("%z")>0){imageTile.source=imageTile.alias.replace("%z",(currentZoom+1));imageTile.source=imageTile.source.replace("%y",tileXY.y);imageTile.source=imageTile.source.replace("%x",tileXY.x)}else{imageTile.source=imageTile.alias+imageTile.quadkey+".png"}}}}}}if(currentMapType.getType()=="IW_MAPDISPATCHER"){tiles[currentZoom].sort(sortFunc);var cornerPixelAbsoluteXY=IWVEUtils.relativePixelToAbsoluteXY(self,0,0);for(var i=tiles[currentZoom].length-1;i>=0;i--){var pixelX=tiles[currentZoom][i].pixelAbsoluteX-cornerPixelAbsoluteXY.x;var pixelY=tiles[currentZoom][i].pixelAbsoluteY-cornerPixelAbsoluteXY.y;tiles[currentZoom][i].style.left=Math.floor(pixelX)+"px";tiles[currentZoom][i].style.top=Math.floor(pixelY)+"px";if(tiles[currentZoom][i].firstLoad==false){tiles[currentZoom][i].src=tiles[currentZoom][i].source;if(options.hasRaster()){tiles[currentZoom][i].style.border="1px solid blue"}}else{if(options.hasRaster()){tiles[currentZoom][i].style.border="1px solid red"}}}}}else{var tilesize=currentMapType.getTilesizeMeter()[currentZoom];var pixelMapSize=options.getSize();var pixelMapHeight=pixelMapSize.getHeight();var pixelMapWidth=pixelMapSize.getWidth();var firstTileCoordinateX=currentCenterX-(mapWidthInMeter/2);var firstTileCoordianteY=currentCenterY+(mapHeightInMeter/2);var rasterMeterXY=findRasterCoordinate(firstTileCoordinateX,firstTileCoordianteY);var nTilesX=tilesAxis.getWidth();var nTilesY=tilesAxis.getHeight();var nMeterOffsetX=rasterMeterXY.x-(currentCenterX-nTilesX/2*tilesize);var nTilesetStartX=(pixelMapWidth/2)-(nTilesX*IWTile.SIZE/2)+nMeterOffsetX/tilesize*IWTile.SIZE;var nMeterOffsetY=rasterMeterXY.y-(currentCenterY+nTilesY/2*tilesize);var nTilesetStartY=(pixelMapHeight/2)-(nTilesY*IWTile.SIZE/2)-nMeterOffsetY/tilesize*IWTile.SIZE;rasterTileOffsetX=IWTile.SIZE+nTilesetStartX;rasterTileOffsetY=IWTile.SIZE+nTilesetStartY;for(var row=0;row<tilesAxis.getHeight();row++){for(var column=0;column<tilesAxis.getWidth();column++){var index=row*tilesAxis.getWidth()+column;var tileX=Math.floor(nTilesetStartX+column*IWTile.SIZE);var tileY=Math.floor(nTilesetStartY+row*IWTile.SIZE);tiles[currentZoom][index].moveToXY(tileX,tileY)}}}}function sortFunc(tileImageA,tileImageB){var tileImageAX=tileImageA.tileX;var tileImageAY=tileImageA.tileY;var tileImageBX=tileImageB.tileX;var tileImageBY=tileImageB.tileY;var distanceA=Math.pow(centerPixelX-(tileImageAX+IWTile.SIZE/2),2)+Math.pow(centerPixelY-(tileImageAY+IWTile.SIZE/2),2);var distanceB=Math.pow(centerPixelX-(tileImageBX+IWTile.SIZE/2),2)+Math.pow(centerPixelY-(tileImageBY+IWTile.SIZE/2),2);return distanceB-distanceA}function buildTileQueue(){queueTiles=new Array();for(var i=0;i<tiles[currentZoom].length;i++){var tile=tiles[currentZoom][i];if(tile!=null){if(tile.getState()==IWTile.STATE_QUEUED){queueTiles.push(tile)}}}var tile=tiles[currentZoom][0];if(tile!=null){queueTiles.sort(tile.compare)}}function checkVisibleSectionLoaded(){if(isVisibleSectionLoaded==false){var loadedTiles=0;for(var i=0;i<tiles[currentZoom].length;i++){if(currentMapType.getType()!="IW_MAPDISPATCHER"){if(tiles[currentZoom][i].hasFirstLoadCompleted()==true){loadedTiles++}}else{if(tiles[currentZoom][i]&&tiles[currentZoom][i].firstLoad){loadedTiles++}}}if(loadedTiles==tiles[currentZoom].length){isVisibleSectionLoaded=true;iw.destroy(divTileMapZoom);if(oldMapTypeName!=currentMapType.getName()){var event=new IWMapTypeChangeEvent();event.oldMapType=oldMapTypeName;event.newMapType=currentMapType.getName();self.triggerOnMapTypeChange(event);oldMapTypeName=currentMapType.getName()}showLabels(true);if(isZoomEvent||currentZoom!=oldZoom){var zoomEvent=new IWZoomEvent();zoomEvent.newZoomLevel=currentZoom;zoomEvent.oldZoomLevel=oldZoom;zoomEvent.newCenterX=currentCenterX;zoomEvent.newCenterY=currentCenterY;self.triggerOnZoomEnd(zoomEvent);isZoomEvent=false}if(isFirstLoad){isFirstLoad=false;var event=new IWMapInitializeEvent();self.triggerOnInitialize(event)}}}if(isVisibleSectionLoaded==false){window.setTimeout(checkVisibleSectionLoaded,500)}}function loadTilesFromQueue(){while(queueTiles.length>0){var tile=queueTiles.pop();if(tile.getState()==IWTile.STATE_QUEUED){window.setTimeout(function(){this.load()}.iwclosure(tile),0)}}if(isVisibleSectionLoaded==false){checkVisibleSectionLoaded()}}function addTilesToQueue(timestamp){var n=0;for(var i=0;i<tiles[currentZoom].length;i++){var tile=tiles[currentZoom][i];if(tile!=null){if(tile.getState()==IWTile.STATE_WAITING){if(tile.getTimestamp()==timestamp){tile.setState(IWTile.STATE_QUEUED);n++}}}}buildTileQueue();loadTilesFromQueue()}function hide(){showLabels(false)}function sendPrepareTilesRequest(nTimestamp,sectionURL){var oRequest=new Object();oRequest.sURL=sectionURL;oRequest.nTimestamp=nTimestamp;queueRequests.push(oRequest);requestNext()}function requestNext(){while(queueRequests.length>0){var request=getFreeRequest();if(request!=null){var data=queueRequests.pop();prepareTilesAsynchrone(request,data)}else{break}}}function createGetMapTypesURL(){var tilesize=currentMapType.getTilesizeMeter()[currentZoom];return iwconst.LOCAL_APP_URL+"servlet/FrontController?cmd=getMapTypes&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&tileSize="+IWTile.SIZE+"&mapcx="+currentCenterX+"&mapcy="+currentCenterY+"&mapdx="+tilesAxis.getWidth()*tilesize+"&mapdy="+tilesAxis.getHeight()*tilesize+"&width="+tilesAxis.getWidth()*IWTile.SIZE+"&height="+tilesAxis.getHeight()*IWTile.SIZE+"&visibleOffsetX="+((tilesAxis.getWidth()*IWTile.SIZE)-options.getSize().getWidth())/2+"&visibleOffsetY="+((tilesAxis.getHeight()*IWTile.SIZE)-options.getSize().getHeight())/2+"&maptype="+currentMapType.getName()+currentMapType.getRequestParameters()}function loadWholeMap(){currentTilesize=currentMapType.getTilesizeMeter()[currentZoom];mapWidthInMeter=currentTilesize*(options.getSize().getWidth()/IWTile.SIZE);mapHeightInMeter=currentTilesize*(options.getSize().getHeight()/IWTile.SIZE);if(currentTileLayer!=null){currentTileLayer.style.visibility="hidden";currentTileLayer.style.display="none"}currentTileLayer=iw.search(divTileMap,"IWTileLayer"+currentZoom);if(currentTileLayer==null){currentTileLayer=iw.create("div");iw.append(divTileMap,currentTileLayer);currentTileLayer.id="IWTileLayer"+currentZoom;currentTileLayer.style.position="absolute";currentTileLayer.style.left="0px";currentTileLayer.style.top="0px"}currentTileLayer.style.visibility="visible";currentTileLayer.style.display="block";if(typeof myMapTiles[currentZoom]=="undefined"){myMapTiles[currentZoom]=new Object()}if(currentMapType.getType()=="IW_MAPDISPATCHER"){self.triggerOnProjectionInvalid();createTiles();var projection=currentMapType.getProjection();var meterPerPixel=currentTilesize/IWTile.SIZE;projection.setMeterPerPixel(meterPerPixel);placeTiles();self.triggerOnProjectionInitialize();var event=new IWMapCenterEvent();event.coordinateX=currentCenterX;event.coordinateY=currentCenterY;if(oldCenterX&&oldCenterY){event.lastCoordinateX=oldCenterX;event.lastCoordinateY=oldCenterY}else{event.lastCoordinateX=event.coordinateX;event.lastCoordinateY=event.coordinateY}event.offsetX=event.coordinateX-event.lastCoordinateX;event.offsetY=event.coordinateY-event.lastCoordinateY;event.zoom=currentZoom;event.lastZoom=oldZoom;self.triggerOnCenter(event);checkVisibleSectionLoaded();if(!options.isOverviewMap()){requestMapTypeAvailable()}}else{self.triggerOnProjectionInvalid();abortAllRequests();createTiles();var url=createGetMapTypesURL();try{var xmlHttp=new IWXMLHttpRequest();xmlHttp.open("GET",iwconst.GLOBAL_GETMAPTYPES_URL+"?serverURL="+escape(url),true);xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){if(xmlHttp.status==200){var json=eval(xmlHttp.responseText);var projection=currentMapType.getProjection();projection.initialize(json.MAPTYPES[currentMapType.getName()].PROJECTION);checkMapTypesAvailibiltyChange(json);placeTiles();self.triggerOnProjectionInitialize();var event=new IWMapCenterEvent();event.coordinateX=currentCenterX;event.coordinateY=currentCenterY;if(oldCenterX&&oldCenterY){event.lastCoordinateX=oldCenterX;event.lastCoordinateY=oldCenterY}else{event.lastCoordinateX=event.coordinateX;event.lastCoordinateY=event.coordinateY}event.offsetX=event.coordinateX-event.lastCoordinateX;event.offsetY=event.coordinateY-event.lastCoordinateY;event.zoom=currentZoom;event.lastZoom=oldZoom;self.triggerOnCenter(event);loadWholeMap2()}else{if(xmlHttp.status==401){alert(xmlHttp.statusText)}else{alert("Unable to request projections from server.")}}}};xmlHttp.send(null)}catch(exception){alert("Exception: "+exception)}}}function loadWholeMap2(){showLabels(false);queueTiles.length=0;queueRequests.length=0;queueSection.length=0;var nTilesX=tilesAxis.getWidth();var nTilesY=tilesAxis.getHeight();var nTiles=nTilesX*nTilesY;var projection=currentMapType.getProjection();var pixelNW=findUpperLeftPixelPosition();var pixelSE=new IWPoint(pixelNW.getX()+(nTilesX*IWTile.SIZE),pixelNW.getY()+(nTilesY*IWTile.SIZE));var meterNW=projection.pixelToMeter(pixelNW);var meterSE=projection.pixelToMeter(pixelSE);var sectionBounds=new IWBounds(meterNW,meterSE);var pixelCenterX=pixelNW.getX()+((pixelSE.getX()-pixelNW.getX())/2);var pixelCenterY=pixelNW.getY()+((pixelSE.getY()-pixelNW.getY())/2);var pixelCenter=new IWPoint(pixelCenterX,pixelCenterY);var meterCenter=projection.pixelToMeter(pixelCenter);var section=new Object();section.nTimestamp=new Date().getTime()+Math.random();section.sURL=createSectionURL(meterCenter,sectionBounds,nTilesX,nTilesY,section.nTimestamp,"c");loadSection(0,0,nTilesX,nTilesY,section.sURL,section.nTimestamp)}function loadSection(nLeft,nTop,nTilesX,nTilesY,url,nTimestamp){for(var row=0;row<nTilesY;row++){for(var column=0;column<nTilesX;column++){var nTileRow=(row+nTop)%tilesAxis.getHeight();var nTileCol=(column+nLeft)%tilesAxis.getWidth();var cellIndex=nTileRow*tilesAxis.getWidth()+nTileCol;var sTilename=buildTileImageName(nTimestamp,row+1,column+1);var tile=tiles[currentZoom][cellIndex];tile.setSource(sTilename,nTimestamp)}}sendPrepareTilesRequest(nTimestamp,url)}function buildTileImageName(nTimestamp,nRow,nCol){return"Tile_"+self.getSessionId()+"_"+nTimestamp+"_"+nRow+"_"+nCol+"."+currentMapType.getTilesServerConfig().getImageType()}function findUpperLeftPixelPosition(){var pixelX=tiles[currentZoom][0].getPosition().getX();var pixelY=tiles[currentZoom][0].getPosition().getY();for(var i=1;i<tiles[currentZoom].length;i++){var tile=tiles[currentZoom][i];if(tile!=null){var tilePixel=tile.getPosition();if(tilePixel.getX()<=pixelX&&tilePixel.getY()<=pixelY){pixelX=tilePixel.getX();pixelY=tilePixel.getY()}}}return new IWPoint(pixelX,pixelY)}function findTopRow(){var minRow=0;var minRowValue=tiles[currentZoom][0].getPosition().getY();for(var row=0;row<tilesAxis.getHeight();row++){var cell=row*tilesAxis.getWidth();if(tiles[currentZoom][cell].getPosition().getY()<minRowValue){minRow=row;minRowValue=tiles[currentZoom][cell].getPosition().getY()}}return minRow}function findLeftCol(){var minCol=0;var minColValue=tiles[currentZoom][0].getPosition().getX();for(var col=0;col<tilesAxis.getWidth();col++){var cell=col;if(tiles[currentZoom][cell].getPosition().getX()<minColValue){minCol=col;minColValue=tiles[currentZoom][cell].getPosition().getX()}}return minCol}function discardUpperBorder(numBorders,sectionCenterMeter,sectionBounds){var nTimestamp=new Date().getTime()+Math.random();var sortArray=new Array();for(var nBorder=1;nBorder<=numBorders;nBorder++){var nLeftCol=findLeftCol();var nTopRow=findTopRow();var nBottomRow=(nTopRow+tilesAxis.getHeight()-1)%tilesAxis.getHeight();for(var nCol=0;nCol<tilesAxis.getWidth();nCol++){var nTile=nTopRow*tilesAxis.getWidth()+(nLeftCol+nCol)%tilesAxis.getWidth();var currentTile=tiles[currentZoom][nTile];currentTile.setVisible(false);currentTile.setSource(buildTileImageName(nTimestamp,nBorder,nCol+1),nTimestamp);currentTile.moveTo(new IWPoint(currentTile.getPosition().getX(),tiles[currentZoom][nBottomRow*tilesAxis.getWidth()].getPosition().getY()+IWTile.SIZE));if(currentMapType.getType()=="IW_MAPDISPATCHER"){sortArray.push(currentTile)}}}if(currentMapType.getType()=="IW_MAPDISPATCHER"){sortArray.sort(tiles[currentZoom][0].compare);for(var i=sortArray.length-1;i>=0;i--){sortArray[i].load()}}if(currentMapType.getType()!="IW_MAPDISPATCHER"){var url=createSectionURL(sectionCenterMeter,sectionBounds,tilesAxis.getWidth(),numBorders,nTimestamp,"b");sendPrepareTilesRequest(nTimestamp,url)}}function discardLowerBorder(numBorders,sectionCenterMeter,sectionBounds){var nTimestamp=new Date().getTime()+Math.random();var sortArray=new Array();for(var nBorder=numBorders;nBorder>0;nBorder--){var nLeftCol=findLeftCol();var nTopRow=findTopRow();var nBottomRow=(nTopRow+tilesAxis.getHeight()-1)%tilesAxis.getHeight();for(var nCol=0;nCol<tilesAxis.getWidth();nCol++){var nTile=nBottomRow*tilesAxis.getWidth()+(nLeftCol+nCol)%tilesAxis.getWidth();var currentTile=tiles[currentZoom][nTile];currentTile.setVisible(false);currentTile.setSource(buildTileImageName(nTimestamp,nBorder,nCol+1),nTimestamp);var x=currentTile.getPosition().getX();var y=tiles[currentZoom][nTopRow*tilesAxis.getWidth()].getPosition().getY()-IWTile.SIZE;currentTile.moveTo(new IWPoint(x,y));if(currentMapType.getType()=="IW_MAPDISPATCHER"){sortArray.push(currentTile)}}}if(currentMapType.getType()=="IW_MAPDISPATCHER"){sortArray.sort(tiles[currentZoom][0].compare);for(var i=sortArray.length-1;i>=0;i--){sortArray[i].load()}}if(currentMapType.getType()!="IW_MAPDISPATCHER"){var url=createSectionURL(sectionCenterMeter,sectionBounds,tilesAxis.getWidth(),numBorders,nTimestamp,"t");sendPrepareTilesRequest(nTimestamp,url)}}function discardLeftBorder(numBorders,sectionCenterMeter,sectionBounds){var nTimestamp=new Date().getTime()+Math.random();var sortArray=new Array();for(var nBorder=1;nBorder<=numBorders;nBorder++){var nLeftCol=findLeftCol();var nRightCol=(nLeftCol+tilesAxis.getWidth()-1)%tilesAxis.getWidth();var nTopRow=findTopRow();for(var nRow=0;nRow<tilesAxis.getHeight();nRow++){var nTile=(nRow+nTopRow)%tilesAxis.getHeight()*tilesAxis.getWidth()+nLeftCol;var currentTile=tiles[currentZoom][nTile];currentTile.setVisible(false);currentTile.setSource(buildTileImageName(nTimestamp,nRow+1,nBorder),nTimestamp);currentTile.moveTo(new IWPoint(tiles[currentZoom][nRightCol].getPosition().getX()+IWTile.SIZE,currentTile.getPosition().getY()));if(currentMapType.getType()=="IW_MAPDISPATCHER"){sortArray.push(currentTile)}}}if(currentMapType.getType()=="IW_MAPDISPATCHER"){sortArray.sort(tiles[currentZoom][0].compare);for(var i=sortArray.length-1;i>=0;i--){sortArray[i].load()}}if(currentMapType.getType()!="IW_MAPDISPATCHER"){var url=createSectionURL(sectionCenterMeter,sectionBounds,numBorders,tilesAxis.getHeight(),nTimestamp,"r");sendPrepareTilesRequest(nTimestamp,url)}}function discardRightBorder(numBorders,sectionCenterMeter,sectionBounds){var nTimestamp=new Date().getTime()+Math.random()+1;for(var nBorder=numBorders;nBorder>0;nBorder--){var nLeftCol=findLeftCol();var nRightCol=(nLeftCol+tilesAxis.getWidth()-1)%tilesAxis.getWidth();var nTopRow=findTopRow();var sortArray=new Array();for(var nRow=0;nRow<tilesAxis.getHeight();nRow++){var nTile=(nRow+nTopRow)%tilesAxis.getHeight()*tilesAxis.getWidth()+nRightCol;var currentTile=tiles[currentZoom][nTile];currentTile.setVisible(false);currentTile.setSource(buildTileImageName(nTimestamp,nRow+1,nBorder),nTimestamp);currentTile.moveTo(new IWPoint(tiles[currentZoom][nLeftCol].getPosition().getX()-IWTile.SIZE,currentTile.getPosition().getY()));if(currentMapType.getType()=="IW_MAPDISPATCHER"){sortArray.push(currentTile)}}if(currentMapType.getType()=="IW_MAPDISPATCHER"){sortArray.sort(tiles[currentZoom][0].compare);for(var i=sortArray.length-1;i>=0;i--){sortArray[i].load()}}}if(currentMapType.getType()!="IW_MAPDISPATCHER"){var url=createSectionURL(sectionCenterMeter,sectionBounds,numBorders,tilesAxis.getHeight(),nTimestamp,"l");sendPrepareTilesRequest(nTimestamp,url)}}function findRasterCoordinate(meterX,meterY){var rasterX=Math.floor(meterX/currentTilesize)*currentTilesize;var rasterY=Math.ceil(meterY/currentTilesize)*currentTilesize;return{x:rasterX,y:rasterY}}function createSectionURL(sectionCenterMeter,sectionBounds,nTilesX,nTilesY,nTimestamp,sectionCode){var config=currentMapType.getTilesServerConfig();var url="http://localhost:"+iwconst.WEBSERVER_PORT+"/"+config.getBaseDir()+"/servlet/FrontController?cmd=prepareTiles&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&code="+sectionCode+"&mapcx="+sectionCenterMeter.getX()+"&mapcy="+sectionCenterMeter.getY()+"&centercx="+currentCenterX+"&centercy="+currentCenterY+"&oldcx="+(oldCenterX!=null?oldCenterX:currentCenterX)+"&oldcy="+(oldCenterY!=null?oldCenterY:currentCenterY)+"&mapdx="+nTilesX*currentTilesize+"&mapdy="+nTilesY*currentTilesize+"&width="+nTilesX*IWTile.SIZE+"&height="+nTilesY*IWTile.SIZE+"&tileSize="+IWTile.SIZE+"&tilex="+IWTile.SIZE+"&tiley="+IWTile.SIZE+"&tilenx="+nTilesX+"&tileny="+nTilesY+"&tileprefix=Tile_"+self.getSessionId()+"_"+nTimestamp+"&pictureformat="+currentMapType.getTilesServerConfig().getImageType()+IWRequestFormatter.getLayerParameter(currentZoom,layers,IWLayer.DRAW_ON_TILES)+"&type="+currentMapType.getName()+currentMapType.getRequestParameters()+"&logstat="+logstat;if(currentMapType.getType()=="IW"){return config.getNextAlias()+config.getBaseDir()+"/XMLHttpRequestProxy?serverURL="+escape(url)}else{if(currentMapType.getType()=="VE"){return iwconst.GLOBAL_PROXY_URL+"?serverURL="+escape(url)}}}imgLabelsLoad.onload=function(){imgLabelsLoad.style.width=mapContainer.style.width;imgLabelsLoad.style.height=mapContainer.style.height;imgLabelsLoad.style.display="block";iw.destroy(imgLabels);imgLabels=imgLabelsLoad.cloneNode(false);imgLabelsLoad.parentNode.appendChild(imgLabels);imgLabelsLoad.style.width="0px";imgLabelsLoad.style.height="0px";imgLabelsLoad.style.display="none"};function showLabels(visible){if(visible){imgLabelsX=0;imgLabelsY=0;var mapsizePixel=options.getSize();var nMapWidthMeter=currentTilesize*mapsizePixel.getWidth()/IWTile.SIZE;var nMapHeightMeter=currentTilesize*mapsizePixel.getHeight()/IWTile.SIZE;if(currentMapType.hasLabels()){var config=currentMapType.getLabelsServerConfig();var parameter=config.getBaseDir()+"/servlet/FrontController?cmd=getLabel&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&mapcx="+currentCenterX+"&mapcy="+currentCenterY+"&mapdx="+nMapWidthMeter+"&mapdy="+nMapHeightMeter+"&width="+options.getSize().getWidth()+"&height="+options.getSize().getHeight()+"&projc="+config.getProjection()+IWRequestFormatter.getLayerParameter(currentZoom,layers,IWLayer.DRAW_ON_LABELS)+"&overview="+(options.hasOverviewMap()?"1":"0")+"&session="+self.getSessionId()+"&maptype="+currentMapType.getName()+currentMapType.getRequestParameters()+"&randomKey="+iw.random(0,1000000000);var url=config.getNextAlias()+parameter;if(url.length<2000){imgLabelsLoad.src=url}else{var xmlHttp=new IWXMLHttpRequest();xmlHttp.open("POST",config.getNextAlias()+config.getBaseDir()+"/XMLHttpRequestProxy?serverURL="+escape("http://localhost/"+parameter),true);xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){if(xmlHttp.statusText=="OK"){if(xmlHttp.responseText.length>0){imgLabelsLoad.src=xmlHttp.responseText}else{alert("GetLabel post request failed: Response text is empty.")}}else{if(xmlHttp.status==401){alert(xmlHttp.statusText)}}}else{alert("GetLabel post request failed: "+xmlHttp.statusText)}};xmlHttp.send(null)}}else{imgLabels.style.display="none"}}else{imgLabels.style.display="none"}}function onMouseMoveHandler(event){window.clearTimeout(mouseStopTimeout);if(!event){event=window.event}var theEvent=new Object();theEvent.pageX=event.pageX;theEvent.pageY=event.pageY;theEvent.clientX=event.clientX;theEvent.clientY=event.clientY;if(event.target){targ=event.target}else{if(event.srcElement){targ=event.srcElement}}if(targ.nodeType==3){targ=targ.parentNode}if(targ.id=="IWImgZoomingAndDragging"||targ.id=="IWControl"){mouseStopTimeout=window.setTimeout(function(){var mouseEvent=mouseAdapter.toMouseEvent(theEvent,mapContainer);if(mouseEvent.lastPosition==null||!mouseEvent.position.equals(mouseEvent.lastPosition)){self.triggerOnMouseStop(mouseEvent)}},350)}}function initRequests(){var requests=new Array(N_MAX_REQUESTS);for(var i=0;i<N_MAX_REQUESTS;i++){requests[i]=new IWXMLHttpRequest()}return requests}function prepareTilesAsynchrone(request,data){request.onreadystatechange=function(){checkPrepareRequest(self,request,data);requestNext()};var method="GET";if(data.sURL.length>2000){method="POST"}request.open(method,data.sURL,true);request.send(null)}function abortAllRequests(){for(var i=0;i<N_MAX_REQUESTS;i++){requests[i].abort();requests[i].isActive=false}}function getFreeRequest(){var request=null;for(var i=0;i<requests.length;i++){if(requests[i].isActive==false){request=requests[i];request.isActive=true;break}}return request}function requestMapTypeAvailable(){var url=createGetMapTypesURL();var xmlHttpRequest=new IWXMLHttpRequest();xmlHttpRequest.open("GET",iwconst.GLOBAL_GETMAPTYPES_URL+"?serverURL="+escape(url),true);xmlHttpRequest.onreadystatechange=function(){if(xmlHttpRequest.readyState==4){if(xmlHttpRequest.status==200){var json=eval(xmlHttpRequest.responseText);checkMapTypesAvailibiltyChange(json)}}};xmlHttpRequest.send(null)}function checkMapTypesAvailibiltyChange(json){var maptypes=options.getMapTypes();for(var i=0;i<maptypes.length;i++){var maptype=maptypes[i];var jsonMaptype=json.MAPTYPES[maptype.getName()];var available=jsonMaptype?jsonMaptype.AVAILABLE:false;if(maptype.isAvailable()!=available){var event=new IWMapTypeAvailabilityChangeEvent();event.type=maptype.getName();event.available=available;self.triggerOnMapTypeAvailabilityChange(event)}}}function checkPrepareRequest(self,xmlHttp,data){try{if(xmlHttp.readyState==4){if(xmlHttp.status==200){var xml=null;try{xml=IWXMLHelper.parse(xmlHttp.responseText).documentElement}catch(e){}if(xml!=null){var status=getContent(xmlHttp,"status");if(status.toLowerCase()=="ok"){addTilesToQueue(data.nTimestamp)}else{if(status.toLowerCase()=="no_data"){logger.error("Receiving no data message.")}else{alert("Map server returned an error: "+status);if(navigator.appName.indexOf("Internet Explorer")==-1){xmlHttp.send(null)}}}}}else{logger.error("xmlHttp.status "+xmlHttp.status)}}else{logger.error("xmlHttp.readyState "+xmlHttp.readyState)}}catch(e){}}function getContent(xmlHttp,sTagName){var xml=null;try{xml=IWXMLHelper.parse(xmlHttp.responseText).documentElement;return xml.getElementsByTagName(sTagName)[0].firstChild.nodeValue}catch(e){return""}}if(!mapContainer){alert("The map container is not definied.");return false}mouseWheelAdapter.onmousewheel=function(event){if(options.getMouseWheelAction()==IWMapOptions.CONTROL_ZOOM){wheelZoom(event)}IWEventManager.trigger(self,"onmousewheel",event)};var keydownTimeout=null;keyboardAdapter.onkeydown=function(event){if(event.tagName=="INPUT"||event.tagName=="SELECT"||event.tagName=="TEXTAREA"){return}if(options.getPlusMinusKeyAction()==IWMapOptions.CONTROL_ZOOM){if(event.keyCode==IWKeyboardAdapter.PLUS_KEY){self.zoomIn()}else{if(event.keyCode==IWKeyboardAdapter.MINUS_KEY){self.zoomOut()}}}if(options.getArrowKeyAction()==IWMapOptions.CONTROL_MOVE){var moveEvent=new IWMoveEvent();if(event.keyCode==IWKeyboardAdapter.ARROW_LEFT_KEY){moveEvent.offsetX=50;moveEvent.offsetY=0}else{if(event.keyCode==IWKeyboardAdapter.ARROW_UP_KEY){moveEvent.offsetX=0;moveEvent.offsetY=50}else{if(event.keyCode==IWKeyboardAdapter.ARROW_RIGHT_KEY){moveEvent.offsetX=-50;moveEvent.offsetY=0}else{if(event.keyCode==IWKeyboardAdapter.ARROW_DOWN_KEY){moveEvent.offsetX=0;moveEvent.offsetY=-50}}}}if(moveEvent.offsetX!=0||moveEvent.offsetY!=0){self.triggerOnMoveStart(moveEvent);move(moveEvent.offsetX,moveEvent.offsetY);self.triggerOnMoveEnd(moveEvent)}}};IWEventManager.addListener(self,"onzoomstart",function(e){window.clearTimeout(timeoutWheel)});if(mapContainer.style.position==""){mapContainer.style.position="relative"}iw.disableSelection(mapContainer);var width=parseInt(mapContainer.style.width);var height=parseInt(mapContainer.style.height);var unit=mapContainer.style.width.replace(/\d/g,"");if(!isNaN(width)&&!isNaN(height)&&width>0&&height>0){options.setSize(new IWSize(width,height),unit)}buildGUI()}function IWMapAction(){this.isMapAction=function(){return true};this.redo=function(){throw ("Method IWMapAction.redo is not implemented.")};this.undo=function(){throw ("Method IWMapAction.undo is not implemented.")};this.toString=function(){throw ("Method IWMapAction.toString is not implemented.")}}function IWMapActionMove(b){IWMapAction.call(this);var a=b;this.redo=function(c){c.panBy(a,false)};this.undo=function(c){c.panBy(new IWPoint(-a.getX(),-a.getY()),false)};this.toString=function(){return"IWMapActionMove "+a.toString()}}function IWMapActionTypeChange(d,b){IWMapAction.call(this);var c=d;var a=b;this.redo=function(f){f.setMapType(a,false)};this.undo=function(f){f.setMapType(c,false)};this.toString=function(){return"IWMapActionTypeChange("+c.toString()+", "+a.toString()+")"}}function IWMapActionZoom(b,d){IWMapAction.call(this);var a=b;var c=d;this.redo=function(g){var f=g.getBoundsZoomlevel(c);g.setZoom(g.getBoundsZoomlevel(c))};this.undo=function(g){var f=g.getBoundsZoomlevel(a);g.setZoom(f)};this.toString=function(){return"[IWMapActionZoom] old bounds: "+a.toString()+", new bounds: "+c.toString()}}function IWMapElement(d){var b=this;var a=null;this.isDisplayed=function(){var f=a.parentNode;while(f){if(f==d){return true}f=f.parentNode}return false};this.getParent=function(){return d};this.setParent=function(f){d=f};this.isVisible=function(){return(a.style.visibility!="hidden")};this.setVisible=function(f){if(f==true){a.style.visibility="visible";a.style.display="block"}else{if(f==false){a.style.visibility="hidden";a.style.display="none"}}};this.setPrintable=function(f){if(f==false){a.className="iwnoprint"}else{if(f==true){a.removeAttribute("class")}}};this.isPrintable=function(){return a.className!="iwnoprint"};this.getContainer=function(){return a};this.setContainer=function(f){a=f};this.setId=function(f){a.id=f};this.getId=function(){return a.id};this.onContextMenu=function(f){};this.onMouseUp=function(f){};this.onMouseDown=function(f){};this.onMouseMove=function(f){};this.onMouseOut=function(f){};this.onMouseOver=function(f){iw.noPropagation(f);if(f.preventDefault){f.preventDefault()}};this.onClick=function(f){};this.onDblClick=function(f){};this.onSelect=function(f){iw.noPropagation(f)};this.onMouseWheel=function(f){iw.noPropagation(f)};this.beforeAppend=function(){};this.afterAppend=function(){};this.beforeRemove=function(){};this.afterRemove=function(){};this.destroyMapElement=function(){iw.destroy(a);IWEventManager.clearInstanceListeners(a);a=null};function c(f,g){if(!g){g=window.event}switch(f){case"oncontextmenu":iw.noPropagation(g);b.onContextMenu(g);break;case"onmouseup":b.onMouseUp(g);break;case"onmousedown":iw.noPropagation(g);b.onMouseDown(g);break;case"onmousemove":b.onMouseMove(g);break;case"onmouseout":iw.noPropagation(g);b.onMouseOut(g);break;case"onmouseover":b.onMouseOver(g);break;case"onclick":iw.noPropagation(g);b.onClick(g);break;case"ondblclick":iw.noPropagation(g);b.onDblClick(g);break;case"onmousewheel":b.onMouseWheel(g);break}}a=iw.create("div");a.id="IWMapElement";a.style.position="absolute";IWEventManager.addDomListener(a,"oncontextmenu",function(f){c("oncontextmenu",f)});IWEventManager.addDomListener(a,"onmouseup",function(f){c("onmouseup",f)});IWEventManager.addDomListener(a,"onmousedown",function(f){c("onmousedown",f)});IWEventManager.addDomListener(a,"onmousemove",function(f){c("onmousemove",f)});IWEventManager.addDomListener(a,"onmouseout",function(f){c("onmouseout",f)});IWEventManager.addDomListener(a,"onmouseover",function(f){c("onmouseover",f)});IWEventManager.addDomListener(a,"ondblclick",function(f){c("ondblclick",f)});IWEventManager.addDomListener(a,"onclick",function(f){c("onclick",f)});IWEventManager.addDomListener(a,"onmousewheel",function(f){c("onmousewheel",f)});IWEventManager.addDomListener(a,"DOMMouseScroll",function(f){c("onmousewheel",f)})}function IWMapOptions(u){var d=new IWSize(600,400);var a="px";var q="en";var b="";var i=IWMapOptions.CONTROL_MOVE;var t=IWMapOptions.CONTROL_ZOOM;var k=IWMapOptions.CONTROL_ZOOM;var r=IWMapOptions.CONTROL_ZOOM;var g=IWMapOptions.CONTROL_ZOOM;var h=IWMapOptions.CONTROL_MOVE;var o=new Array();var c=1;var v=log4javascript.getLogger("IWMapOptions");var s=false;var n=false;var j=false;this.setBorderTiles=function(w){var x=parseInt(w);if(!isNaN(x)&&x>=0){c=x;v.info("Setting border tiles to "+c)}else{v.warn("Invalid value for border tiles: "+w)}};this.getBorderTiles=function(){return c};this.showRaster=function(w){if(w==true){s=true}else{if(w=false){s=false}}};this.hasRaster=function(){return s};this.getSize=function(){var w=null;if(d==null){w=null}else{if(a=="px"){w=d}else{w=m()}}return w};this.getSizeInUnit=function(){var w=new Object();w.size=d;w.unit=a;return w};this.getLanguage=function(){return q};this.getApplicationCopyright=function(){return b};this.setSize=function(x,A){if(typeof A=="undefined"){A="px"}var z=new IWResizeEvent();z.oldSize=this.getSize().clone();var y=x.getWidth();var w=x.getHeight();if(A=="px"){if(y%2!=0){y--}if(w%2!=0){w--}}d=new IWSize(y,w);a=A;z.newSize=this.getSize().clone();u.triggerOnResize(z)};this.setMapTypes=function(w){o=w;var x=new IWMapTypesChangeEvent(o);x.mapTypes=o;u.triggerOnMapTypesChange(x)};this.getMapTypes=function(){return o};this.getMapTypeByName=function(w){var y=null;for(var x=0;x<o.length;x++){if(o[x].getName()==w){y=o[x];break}}return y};this.setLanguage=function(w){q=w;var x=new IWLanguageChangeEvent();x.language=q;u.triggerOnLanguageChange(x)};this.setApplicationCopyright=function(w){b=w;var x=new IWCopyrightChangeEvent();x.copyright=b;u.triggerOnCopyrightChange(x)};this.getLeftMouseAction=function(){return i};this.getRightMouseAction=function(){return t};this.getMouseWheelAction=function(){return k};this.getDoubleClickAction=function(){return r};this.getPlusMinusKeyAction=function(){return g};this.getArrowKeyAction=function(){return h};this.setLeftMouseAction=function(x){if(x!=IWMapOptions.CONTROL_MOVE&&x!=IWMapOptions.CONTROL_ZOOM&&x!=IWMapOptions.CONTROL_NONE){throw ("Invalid action: "+x)}i=x;var w=new IWMapControlChangeEvent();w.mouseAction="left";w.controlMethod=x;u.triggerOnMapControlChange(w)};this.setRightMouseAction=function(x){if(x!=IWMapOptions.CONTROL_MOVE&&x!=IWMapOptions.CONTROL_ZOOM&&x!=IWMapOptions.CONTROL_NONE){throw ("Invalid action: "+x)}t=x;var w=new IWMapControlChangeEvent();w.mouseAction="right";w.controlMethod=x;u.triggerOnMapControlChange(w)};this.setMouseWheelAction=function(x){if(x!=IWMapOptions.CONTROL_ZOOM&&x!=IWMapOptions.CONTROL_NONE){throw ("Invalid action: "+x)}k=x;var w=new IWMapControlChangeEvent();w.mouseAction="wheel";w.controlMethod=x;u.triggerOnMapControlChange(w)};this.setDoubleClickAction=function(x){if(x!=IWMapOptions.CONTROL_ZOOM&&x!=IWMapOptions.CONTROL_NONE){throw ("Invalid action: "+x)}r=x;var w=new IWMapControlChangeEvent();w.mouseAction="doubleclick";w.controlMethod=x;u.triggerOnMapControlChange(w)};this.setPlusMinusKeyAction=function(x){if(x!=IWMapOptions.CONTROL_ZOOM&&x!=IWMapOptions.CONTROL_NONE){throw ("Invalid action: "+x)}g=x;var w=new IWMapControlChangeEvent();w.mouseAction="plusminuskey";w.controlMethod=x;u.triggerOnMapControlChange(w)};this.setArrowKeyAction=function(x){if(x!=IWMapOptions.CONTROL_MOVE&&x!=IWMapOptions.CONTROL_NONE){throw ("Invalid action: "+x)}h=x;var w=new IWMapControlChangeEvent();w.mouseAction="arrowkeys";w.controlMethod=x;u.triggerOnMapControlChange(w)};this.isOverviewMap=function(){return n};this.setIsOverviewMap=function(w){n=w};this.hasOverviewMap=function(){return j};this.setHasOverviewMap=function(w){j=w};function f(){v.debug("Calling parseMapTypes.");var z=new Array();var y=iwconst.MAPTYPES;for(var A=0;A<y.length;A++){var x=y[A];var C=new IWMapType(u);C.setName(x.NAME);C.setType(x.TYPE);C.setCopyright(x.COPYRIGHT);C.setMinLevel(x.MINLEVEL);C.setPreferredLevel(x.PREFERREDLEVEL);C.setMaxLevel(x.MAXLEVEL);C.setTilesizeMeter(x.TILESIZE_METER);if(x.PROJECTIONTYPE=="1"){C.setProjection(new IWParallelProjection(u))}else{if(x.PROJECTIONTYPE=="2"){C.setProjection(new IWCentralProjection(u))}else{if(x.PROJECTIONTYPE=="3"){C.setProjection(new IWVEProjection(u))}else{alert("Projection not set or unknown: "+x.PROJECTIONTYPE)}}}var w=new IWServerConfig();w.setBaseDir(x.TILESSERVER.BASE_DIR);w.setUrl(x.TILESSERVER.URL);w.setProjection(x.TILESSERVER.PROJECTION);w.setImageType(x.TILESSERVER.IMAGETYPE);w.setPortList(x.TILESSERVER.PORTLIST);w.setAliases(x.TILESSERVER.ALIAS);w.setCacheEnabled(x.TILESSERVER.CACHEENABELD);C.setTilesServerConfig(w);if(x.LABELSSERVER){var B=new IWServerConfig();B.setBaseDir(x.LABELSSERVER.BASE_DIR);B.setUrl(x.LABELSSERVER.URL);B.setProjection(x.LABELSSERVER.PROJECTION);B.setImageType(x.LABELSSERVER.IMAGETYPE);B.setPortList(x.LABELSSERVER.PORTLIST);B.setAliases(x.LABELSSERVER.ALIAS);B.setCacheEnabled(x.LABELSSERVER.CACHEENABELD);C.setLabelsServerConfig(B)}v.trace("Adding maptype with name '"+C.getName()+"'.");z.push(C)}return z}function m(){v.error("Calling calculateSizeInPixel");var x=u.getContainer().offsetWidth;var w=u.getContainer().offsetHeight;return new IWSize(x,w)}o=f()}IWMapOptions.CONTROL_NONE=0;IWMapOptions.CONTROL_MOVE=1;IWMapOptions.CONTROL_ZOOM=2;function IWMapType(b){var c="";var i="";var k="";var n=0;var j=0;var a=0;var f=false;var h=null;var d="";var o=null;var g=null;var m=null;this.setName=function(q){c=q};this.getName=function(){return c};this.setType=function(q){k=q};this.getType=function(){return k};this.setCopyright=function(q){i=q};this.getCopyright=function(){return i};this.setMaxLevel=function(q){n=q};this.getMaxLevel=function(){return n};this.setPreferredLevel=function(q){j=q};this.getPreferredLevel=function(){return j};this.setMinLevel=function(q){a=q};this.getMinLevel=function(){return a};this.setProjection=function(q){h=q};this.getProjection=function(){return h};this.hasLabels=function(){return(g!=null)};this.setRequestParameters=function(q){d=q};this.getTilesServerConfig=function(){return o};this.setTilesServerConfig=function(q){o=q};this.setLabelsServerConfig=function(q){g=q};this.getLabelsServerConfig=function(){return g};this.getRequestParameters=function(){return d};this.setTilesizeMeter=function(q){m=q};this.getTilesizeMeter=function(){return m};this.toString=function(){return"[IWMapType] name: "+this.getName()+", copyright: "+this.getCopyright()+", maxlevel: "+this.getMaxLevel()+", preferredlevel: "+this.getPreferredLevel()+", minlevel: "+this.getMinLevel()};this.isAvailable=function(){return f};IWEventManager.addListener(b,"onmaptypeavailabilitychange",function(q){if(q.type==c){f=q.available}})}function IWOverlay(f,h){IWMapElement.call(this,f.getOverlayContainer());var d=new IWPoint(0,0);var b=this;var g=false;var c=log4javascript.getLogger("IWOverlay");var a=this.getContainer();IWDraggable.call(this,a,f.getContainer());this.setDraggableContainer(a);this.setHotspot=function(i){iw.strict([IWPoint],[i]);d=i};this.getHotspot=function(){return d};this.getLayer=function(){var i=parseInt(a.style.zIndex);if(isNaN(i)){return null}else{return i}};this.setCoordinate=function(i){iw.strict([IWCoordinate],[i]);h=i;this.triggerOnPositionChange()};this.getCoordinate=function(){return h};this.beforeAppend=function(){};this.afterAppend=function(){};this.beforeRemove=function(){if(g){iw.fireMouseEvent(a,"mouseout")}};this.afterRemove=function(){};this.redraw=function(){this.triggerOnRedrawStart();var j=f.getCurrentMapType().getProjection();var i=j.meterToPixel(this.getCoordinate());var m=this.getContainer();if(m.parentNode&&m.parentNode.parentNode){var k=m.parentNode.parentNode;m.style.top=i.getY()-this.getHotspot().getY()-parseInt(k.style.top)+"px";m.style.left=i.getX()-this.getHotspot().getX()-parseInt(k.style.left)+"px";k=null}this.triggerOnRedrawEnd();m=null};this.triggerOnPositionChange=function(){IWEventManager.trigger(this,"onpositionchange",null)};this.triggerOnRedrawStart=function(){IWEventManager.trigger(this,"onredrawstart")};this.triggerOnRedrawEnd=function(){IWEventManager.trigger(this,"onredrawend")};this.destroyOverlay=function(){this.destroyMapElement()};IWEventManager.addDomListener(a,"onclick",function(i){IWEventManager.trigger(b,"onclick",i)});IWEventManager.addDomListener(a,"ondblclick",function(i){IWEventManager.trigger(b,"ondblclick",i)});IWEventManager.addDomListener(a,"onmouseover",function(i){a.style.cursor="pointer";IWEventManager.trigger(b,"onmouseover",i);g=true});IWEventManager.addDomListener(a,"onmouseout",function(i){a.style.cursor="auto";IWEventManager.trigger(b,"onmouseout",i);g=false})}function IWOverlayLayer(a,k,j){var b=iw.create("div");var i=new IWRange(0,Number.MAX_VALUE);var g=true;var m=new Object();var h=1;var d=a.getZoomingAndDraggingContainer();var o=log4javascript.getLogger("IWOverlayLayer");this.getOverlayById=function(s){var q=null;for(var r in m){if(m[r].getId()==s){q=m[r];break}}return q};this.getOverlays=function(){var r=new Array();for(var q in m){r.push(m[q])}return r};this.addOverlay=function(q){if(q.overlayId==null){q.beforeAppend();q.getContainer().style.zIndex=j;IWEventManager.addListener(q,"ondragend",function(t){var u=q.getContainer();var s=parseInt(u.style.left)+q.getHotspot().getX();var v=parseInt(u.style.top)+q.getHotspot().getY();while(u.parentNode!=null&&u.parentNode!=d){u=u.parentNode;if(u.style.left){s+=parseInt(u.style.left)}if(u.style.top){v+=parseInt(u.style.top)}}var r=a.getCurrentMapType().getProjection();q.setCoordinate(r.pixelToMeter(new IWPoint(s,v)))});iw.append(b,q.getContainer());q.redraw();f(q);q.afterAppend()}};this.removeOverlay=function(q){if(q.overlayId){c(q);q.beforeRemove();iw.remove(q.getContainer());q.afterRemove()}};this.removeAllOverlays=function(){for(var q in m){this.removeOverlay(m[q])}};this.setVisibilityRange=function(q){i=q};this.redraw=function(){for(p in m){var q=m[p];q.redraw();q=null}if(g){var r=false;if(i.getMin()<=a.getZoom()&&a.getZoom()<=i.getMax()){r=true}n(r)}};this.getVisibilityRange=function(){return i};this.setVisible=function(q){g=q;n(g)};this.isVisible=function(){return(b.style.visibility!="hidden")};function n(q){if(q==true){b.style.visibility="inherit"}else{if(q==false){b.style.visibility="hidden"}}}function f(q){q.overlayId=h;m[q.overlayId]=q;h++}function c(q){delete m[q.overlayId];q.overlayId=null}b.id="IWOverlayLayer_"+j;b.style.position="absolute";b.style.top="0px";b.style.left="0px";b.style.zIndex=j;iw.append(k,b)}function IWOverlayManager(h,b){var c=this;var g=new Object;var d=log4javascript.getLogger("IWOverlayManager");var f=0;var a=0;this.setVisible=function(i){if(i==true){b.style.visibility="inherit"}else{if(i==false){b.style.visibility="hidden"}}};this.isVisible=function(){return(b.style.visibility!="hidden")};this.getLayer=function(i){iw.strict([Number],arguments);if(g[i]==null){g[i]=new IWOverlayLayer(h,b,i)}return g[i]};this.removeLayer=function(j){iw.strict([Number],arguments);var i=g[j];if(i!=null){i.removeAllOverlays();g[j]=null;delete g[j]}};this.removeAllLayers=function(){for(layerNumber in g){this.removeLayer(parseInt(layerNumber))}};this.getAllOverlays=function(){var i=new Array();for(layerNumber in g){var j=g[layerNumber];i=j.getOverlays().concat(i)}return i};this.redraw=function(){for(layerNumber in g){g[layerNumber].redraw()}};this.toString=function(){return"[IWOverlayManager]"};IWEventManager.addListener(h,"onmove",function(i){f+=i.offsetY;a+=i.offsetX;b.style.top=f+"px";b.style.left=a+"px"});IWEventManager.addListener(h,"oncenter",function(i){b.style.display="none";c.redraw();b.style.display="block"});IWEventManager.addListener(h,"onmaptypechangestart",function(i){b.style.visibility="hidden"});IWEventManager.addListener(h,"onmaptypechange",function(i){c.redraw();b.style.visibility="inherit"});IWEventManager.addListener(h,"onzoomstart",function(){b.style.display="none"});IWEventManager.addListener(h,"onzoomend",function(){c.redraw();b.style.display="block"});IWEventManager.addListener(h,"onresize",function(){b.style.display="none";c.redraw();b.style.display="block"})}function IWParallelProjection(b){IWProjection.call(this);var c=1;var a=log4javascript.getLogger("IWParallelProjection");this.initialize=function(d){c=d.METER_PER_PIXEL};this.setMeterPerPixel=function(d){c=d};this.meterToPixel=function(m){var g=b.getCenter();if(g==null){return new IWPoint(0,0)}else{var n=b.getOptions().getSize();var k=n.getWidth()/2;var j=n.getHeight()/2;var f=m.getX()-g.getX();var d=m.getY()-g.getY();var i=f/c;var h=-1*d/c;return new IWPoint(k+i,j+h)}};this.meterToPixelXY=function(o,m){var g=b.getCenter();if(g==null){return{x:0,y:0}}else{var n=b.getOptions().getSize();var k=n.getWidth()/2;var j=n.getHeight()/2;var f=o-g.getX();var d=m-g.getY();var i=f/c;var h=-1*d/c;return{x:k+i,y:j+h}}};this.pixelToMeter=function(m){var g=b.getCenter();if(g==null){return new IWCoordinate(0,0)}else{var n=b.getOptions().getSize();var k=n.getWidth()/2;var j=n.getHeight()/2;var i=m.getX()-k;var h=m.getY()-j;var f=i*c;var d=-1*h*c;return new IWCoordinate(g.getX()+f,g.getY()+d)}};this.pixelToMeterXY=function(i,h){var g=b.getCenter();if(g==null){return{x:0,y:0}}else{var o=b.getOptions().getSize();var n=o.getWidth()/2;var m=o.getHeight()/2;var k=i-n;var j=h-m;var f=k*c;var d=-1*j*c;return{x:g.getX()+f,y:g.getY()+d}}};this.needsReload=function(f,d){return false};this.needsReloadXY=function(f,d,g){return false};this.toString=function(){return"[IWParallelProjection]Meter per pixel: "+c}}function IWProjection(){this.initialize=function(a){alert("Method not implemented")};this.meterToPixel=function(a){alert("Method not implemented");return"undefined"};this.pixelToMeter=function(a){alert("Method not implemented");return"undefined"};this.needsReload=function(b,a){alert("Method not implemented");return"undefined"};this.toString=function(){alert("Method not implemented");return"undefined"}}function IWTile(c,f,d,k){this.tileId=null;var s=this;var r="";var m=0;var q=null;var n=false;var b=IWTile.STATE_INACTIVE;var o=log4javascript.getLogger("IWTile");var g=c.getCurrentMapType().getTilesServerConfig().getAliases();var i=0;var h=0;var j=iw.create("img");j.id="imgTile_"+f+"_"+d;j.width=IWTile.SIZE;j.height=IWTile.SIZE;j.style.position="absolute";j.style.zIndex="1";j.style.left="0px";j.style.top="0px";j.style.width=IWTile.SIZE;j.style.height=IWTile.SIZE;j.style.visibility="hidden";j.style.display="none";if(c.getOptions().hasRaster()){j.style.border="1px solid green"}j.onload=function(){n=true;if(b==IWTile.STATE_LOADING){s.setVisible(true);b=IWTile.STATE_COMPLETE}};j.onabort=function(){n=true;s.setVisible(true);try{o.error("loading abort for tile "+f+", "+d+". Requesting image "+j.src)}catch(t){o.error("Catching failure onAbort: "+t)}};j.onerror=function(){n=true;s.setVisible(true);try{o.error("loading error for tile "+f+", "+d+". Requesting image "+j.src)}catch(t){o.error("Catching failure onError: "+t)}};c.getCurrentTileContainer().appendChild(j);this.getImage=function(){return j};this.hasFirstLoadCompleted=function(){return n};this.setVisible=function(t){try{if(t){if(j&&j.style.visibility!="inherit"){j.style.display="block";j.style.visibility="inherit"}}else{if(j&&j.style.visibility!="hidden"){j.style.display="none";j.style.visibility="hidden"}}}catch(u){o.error("Error on setVisible for tile "+f+", "+d+". "+u)}};this.getPosition=function(){if(j){var v=parseInt(j.style.left);var u=parseInt(j.style.top);var t=0;var y=0;if(j.parentNode&&j.parentNode.parentNode){var x=parseInt(j.parentNode.parentNode.style.left);if(!isNaN(x)){t=x}var w=parseInt(j.parentNode.parentNode.style.top);if(!isNaN(w)){y=w}}return new IWPoint(t+v,y+u)}else{return new IWPoint(0,0)}};this.getPositionXY=function(){return{x:i,y:h}};this.destroy=function(){iw.destroy(j);j=null};this.getState=function(){return b};this.setState=function(t){b=t};this.getTimestamp=function(){return m};this.setSource=function(u,t){b=IWTile.STATE_WAITING;r=u;m=t};this.moveToXY=function(u,t){if(j){i=u;h=t;j.style.left=i+"px";j.style.top=h+"px"}};this.moveTo=function(u){if(j){var v=u.getX()-parseInt(j.parentNode.parentNode.style.left);var t=u.getY()-parseInt(j.parentNode.parentNode.style.top);j.style.left=v+"px";j.style.top=t+"px"}};this.load=function(){if(j){b=IWTile.STATE_LOADING;var H=c.getCurrentMapType();var J=H.getTilesServerConfig();if(H.getType()=="IW"){var L=H.getProjection();var C=this.getPosition();var t=L.pixelToMeter(C);if(H.getTilesServerConfig().isCacheEnabled()==false){var F=H.getTilesServerConfig().isCacheEnabled()?"1":"0";var u="&left="+t.getX()+"&bottom="+t.getY()+"&tilemeter="+H.getTilesizeMeter()[c.getZoom()]+"&tile="+IWTile.SIZE+"&maptype="+H.getName()+"&cached="+F;var y=J.getNextAlias()+J.getBaseDir()+"/servlet/FrontController?cmd=getTile&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&file="+r+u;j.src=y}else{j.src=a(t)}}else{if(H.getType()=="IW_MAPDISPATCHER"){if(!this.tileId){var L=H.getProjection();var C=this.getPosition();var t=L.pixelToMeter(C);var G=new IWPoint(C.getX()+IWTile.SIZE/2,C.getY()+IWTile.SIZE/2);var t=L.pixelToMeter(G);var z=new IWCoordinate(t.getX(),t.getY(),IWCoordinate.MERCATOR).toWGS84();var x=IWVEUtils.latLongToPixelXY(z,c.getZoom());var M=IWVEUtils.pixelToTile(x);var B=IWVEUtils.tileToQuadKey(M,c.getZoom());this.tileId=B}var E=""+this.tileId;var D=parseInt(E.charAt(E.length-1));var A=J.getAliases()[D%J.getAliases().length];if(A.indexOf("%1")>0){j.src=A.replace("%1",this.tileId)}else{j.src=A+this.tileId+".png"}}else{if(H.getType()=="VE"){var L=H.getProjection();var C=this.getPosition();var t=L.pixelToMeter(C);var G=new IWPoint(C.getX()+IWTile.SIZE/2,C.getY()+IWTile.SIZE/2);var t=L.pixelToMeter(G);var K=IWVEUtils.getMapSize(c.getZoom());var I=40075016.704;var w=(K/I)*(t.getX());var v=(K/I)*(t.getY());var x=new IWPoint(w,v);var M=IWVEUtils.pixelToTile(x);var B=IWVEUtils.tileToQuadKey(M,c.getZoom());j.src=J.getAliases()[B%4]+"tiles/r"+B+".png?g=266&mkt=de-de&shading=hill"}}}}};this.compare=function(z,y){var B=c.getOptions().getSize();var w=B.getWidth()/2;var v=B.getHeight()/2;var t=z.getPosition();var A=y.getPosition();var x=Math.pow(w-(t.getX()+IWTile.SIZE/2),2)+Math.pow(v-(t.getY()+IWTile.SIZE/2),2);var u=Math.pow(w-(A.getX()+IWTile.SIZE/2),2)+Math.pow(v-(A.getY()+IWTile.SIZE/2),2);return u-x};this.toString=function(){var t=(j?j.src:"");return"[IWTile] cell: "+f+", "+d+", position: "+this.getPosition()+"src: "+t};function a(J){var w=c.getCurrentMapType().getTilesizeMeter()[c.getZoom()];var B=Math.floor(J.getX()/w)+1;var E=Math.floor(J.getY()/w)-1;var u=parseInt((B<0?(B/10000)-1:(B/10000)));var A=parseInt((B-u*10000)/1000);var C=parseInt((B-u*10000-A*1000)/100);var v=parseInt((B-u*10000-A*1000-C*100)/10);var I=parseInt((B-u*10000-A*1000-C*100-v*10));var M=u+A+C+v+I;var x=parseInt((E<0?(E/10000)-1:(E/10000)));var K=parseInt((E-x*10000)/1000);var F=parseInt((E-x*10000-K*1000)/100);var H=parseInt((E-x*10000-K*1000-F*100)/10);var y=parseInt((E-x*10000-K*1000-F*100-H*10));var z=x+K+F+H+y;var L=c.getCurrentMapType();var D=L.getName();var G=L.getTilesServerConfig();var t=G.getImageType();return g[(M+z)%G.getAliases().length]+"cache/Mobile/"+D+"/"+IWTile.SIZE+"/"+w+"/"+u+"_"+x+"/"+A+"_"+K+"/"+C+"_"+F+"/"+v+"_"+H+"/"+I+"_"+y+"."+t}}IWTile.SIZE=iwconst.TILE_SIZE;IWTile.STATE_INACTIVE="STATE_INACTIVE";IWTile.STATE_WAITING="STATE_WAITING";IWTile.STATE_QUEUED="STATE_QUEUED";IWTile.STATE_LOADING="STATE_LOADING";IWTile.STATE_COMPLETE="STATE_COMPLETE";function IWTileLoader(a,j){var f=4;var g=null;var c=new Array();var h=null;var d=0;var i=log4javascript.getLogger("IWTileLoader");this.inc=function(){d--};this.loadTile=function(k){k.load()};this.loadNext=function(){if(d<f&&c.length>0){b()}};function b(){if(c.length>0){while(d<f&&c.length>0){d++;var k=c.shift();k.load()}}}h=new Array(j);i.info("IWTileLoader instance created.")}function IWVEProjection(d){IWProjection.call(this);var g=1;var f=512;var a=40075016.704;var c=0;var b=log4javascript.getLogger("IWVEProjection");this.initialize=function(j){b.info("Calling initialize with "+j);var i=d.getZoom();f=IWVEUtils.getMapSize(i);b.error("Current size of map in pixel is "+f);var h=d.getCurrentMapType().getTilesizeMeter()[i];b.error("Tilesize meter is "+h);g=h/256;b.error("MeterPerPixel is set to "+g)};this.meterToPixel=function(o){b.info("Calling meterToPixel with "+o);var m=d.getCenter();b.trace("Current center is "+m);if(m==null){return new IWPoint(0,0)}else{var n=new IWCoordinate(o.getX()-m.getX(),o.getY()-m.getY());var k=d.getOptions().getSize();var h=new IWPoint(k.getWidth()/2,k.getHeight()/2);var j=new IWPoint(n.getX()/g,n.getY()/g);b.error("centerPixel (Zentrum in Meter) "+h);b.error("offsetPixel (Meterversatz in Pixel) "+j);var i=new IWPoint(h.getX()+j.getX(),h.getY()+j.getY());b.error("p="+i);return i}};this.pixelToMeter=function(h){b.info("Calling pixelToMeter with "+h);var m=d.getCenter();if(m==null){b.warn("Map center is not specified, method returns IWCoordinate(0, 0).");return new IWCoordinate(0,0)}else{var k=d.getOptions().getSize();var i=new IWPoint(k.getWidth()/2,k.getHeight()/2);var j=new IWPoint(h.getX()-i.getX(),h.getY()-i.getY());var o=new IWCoordinate(j.getX()*g,j.getY()*g);var n=new IWCoordinate(m.getX()+o.getX(),m.getY()+o.getY());b.error("XX pixelToMeter "+h+" "+n);return n}};this.needsReload=function(i,h){return false};this.toString=function(){return"[IWVEProjection]Meter per pixel: "+g}}function IWWindowOverlay(a,g){var i=this;var c=new IWPoint(0,0);var h=log4javascript.getLogger("IWWindowOverlay");IWMapElement.call(this,a.getWindowOverlayContainer());this.getAnchor=function(){return c};this.setAnchor=function(m){if(this.isDisplayed()){var k=this.getContainer();var o=parseInt(k.style.top);var n=parseInt(k.style.left);k.style.top=o-c.getY()+m.getY()+"px";k.style.left=n-c.getX()+m.getX()+"px"}c=m};this.setCoordinate=function(k){iw.strict([IWCoordinate],[k]);g=k};this.getCoordinate=function(){return g};this.destroyWindowOverlay=function(){IWEventManager.removeListener(b);IWEventManager.removeListener(d);IWEventManager.removeListener(j);IWEventManager.removeListener(f);this.destroyMapElement()};this.redraw=function(){var k=this.getContainer();var n=this.getParent();var m=a.getCurrentMapType().getProjection().meterToPixel(g);k.style.top=m.getY()+c.getY()-parseInt(n.style.top)+"px";k.style.left=m.getX()+c.getX()-parseInt(n.style.left)+"px"};var b=IWEventManager.addListener(a,"oncenter",function(k){i.setVisible(false);i.redraw();i.setVisible(true)});var d=IWEventManager.addListener(a,"onzoomstart",function(){i.setVisible(false)});var j=IWEventManager.addListener(a,"onzoomend",function(){i.redraw();i.setVisible(true)});var f=IWEventManager.addListener(a,"onresize",function(){i.redraw()})}function IWWindowOverlayManager(b){var c=null;var a=null;this.openInfoBalloon=function(o,i){var j=null;if(i.constructor==String){var h=iw.checkElem(i);j=iw.create("div");j.style.top="0px";j.style.left="0px";j.style.overflow="auto";iw.append(j,h)}else{j=i}j.style.position="relative";var d=IWDOMHelper.getSize(j,b.getContainer());var g=j.style.left==""?0:parseInt(j.style.left);var k=j.style.top==""?0:parseInt(j.style.top);var f=b.getOptions().getSize();var n=Math.ceil(f.getHeight()-80);var m=Math.ceil(f.getWidth()-50);if(d.getHeight()<80){d.setHeight(80)}else{if(d.getHeight()>n){d.setHeight(n)}}if(d.getWidth()<160){d.setWidth(160)}else{if(d.getWidth()>m){d.setWidth(m)}}j.style.height=d.getHeight()-15+"px";j.style.width=d.getWidth()+"px";this.removeInfoBalloon();c=new IWInfoBalloon(b,o,j);c.setSize(new IWSize(d.getWidth()+30+g,d.getHeight()+58+k));b.addWindowOverlay(c)};this.removeInfoBalloon=function(){if(c!=null){b.removeWindowOverlay(c);c.destroy();c=null}};this.openTooltip=function(f,d){this.removeTooltip();a=new IWTooltip(b,f,d);b.addWindowOverlay(a)};this.removeTooltip=function(){if(a!=null){b.removeWindowOverlay(a);a.destroy();a=null}}}function IWInfoBalloon(u,r,o){IWWindowOverlay.call(this,u,r);var m=this;var k=new IWSize(240,180);var s=5;var i=this.getContainer();var d=iw.create("div");var a=iw.create("div");var h=iw.create("div");var n=iw.create("div");var j=iw.create("div");var b=iw.create("div");var c=iw.create("div");var f=iw.create("img");var v=log4javascript.getLogger("IWInfoBalloon");var q=new IWLanguagePack();q.addLanguage(new IWLanguage("de",iwconst.LOCAL_APP_URL+"lang/IWInfoBalloon.lang.de"));q.addLanguage(new IWLanguage("en",iwconst.LOCAL_APP_URL+"lang/IWInfoBalloon.lang.en"));q.addLanguage(new IWLanguage("es",iwconst.LOCAL_APP_URL+"lang/IWInfoBalloon.lang.es"));q.addLanguage(new IWLanguage("fr",iwconst.LOCAL_APP_URL+"lang/IWInfoBalloon.lang.fr"));q.addLanguage(new IWLanguage("tr",iwconst.LOCAL_APP_URL+"lang/IWInfoBalloon.lang.tr"));q.addLanguage(new IWLanguage("it",iwconst.LOCAL_APP_URL+"lang/IWInfoBalloon.lang.it"));IWMultiLanguageSupport.call(this,u,q);this.getContent=function(){return o};this.setContent=function(w){o=w};this.afterAppend=function(){v.info("Calling afterAppend.");i.style.visibility="visible";var G=iw.absolute(i,u.getContainer());if(u.getBounds().containsCoordinate(r)){var D=G.getX()+k.getWidth()+s-u.getOptions().getSize().getWidth();var A=G.getX()-s;var w=G.getY()-s;var B=G.getY()+k.getHeight()+s-u.getOptions().getSize().getHeight();if(D>0||A<0||w<0||B>0){var K=0;var J=0;if(D>0){K=-D}else{if(A<0){K=-A}}if(w<0){J=-w}else{if(B>0){J=-B}}u.panBy(new IWPoint(K,J),true)}}else{var H=u.getCurrentMapType().getProjection();var I=H.meterToPixel(r);var z=this.getSize().getHeight()/2;var E=I.getX();var C=I.getY()-z;var F=new IWPoint(E,C);u.setCenter(H.pixelToMeter(F))}};this.setSize=function(w){v.info("Calling setSize with "+k);iw.strict([IWSize],[k]);k=w;t();this.setAnchor(new IWPoint(-(k.getWidth()/2),-(k.getHeight())))};this.getSize=function(){return k};this.destroy=function(){v.info("Calling destroy");IWEventManager.clearInstanceListeners(this);this.destroyMultiLanguageSupport();this.destroyWindowOverlay();o=null;d=null;a=null;h=null;n=null;j=null;b=null;c=null;f=null;i=null};this.toString=function(){return"[IWInfoBalloon]"};function g(){v.debug("Calling buildGUI");i.style.height=k.getHeight()+"px";i.style.width=k.getWidth()+"px";i.style.visibility="hidden";iw.append(i,d);d.style.position="absolute";d.style.top="0px";d.style.left="0px";d.style.width=k.getWidth()+"px";d.style.height=k.getHeight()-51+"px";var A=iw.create("div");iw.append(d,A);A.style.top="0px";A.style.left="0px";A.style.height="21px";A.style.width="21px";A.style.background="url("+iwconst.GLOBAL_APP_URL+"img/overlays/infoballoon/sprite-infoballoon.gif) no-repeat top left";A.style.backgroundPosition="0 -245px";var z=iw.create("div");iw.append(d,z);z.style.position="absolute";z.style.top="0px";z.style.right="0px";z.style.height="21px";z.style.width="21px";z.style.background="url("+iwconst.GLOBAL_APP_URL+"img/overlays/infoballoon/sprite-infoballoon.gif) no-repeat top left";z.style.backgroundPosition="0 -316px";var w=iw.create("div");iw.append(d,w);w.style.position="absolute";w.style.bottom="0px";w.style.left="0px";w.style.height="21px";w.style.width="21px";w.style.background="url("+iwconst.GLOBAL_APP_URL+"img/overlays/infoballoon/sprite-infoballoon.gif) no-repeat top left";w.style.backgroundPosition="0 -103px";var x=iw.create("div");iw.append(d,x);x.style.position="absolute";x.style.bottom="0px";x.style.right="0px";x.style.height="21px";x.style.width="21px";x.style.background="url("+iwconst.GLOBAL_APP_URL+"img/overlays/infoballoon/sprite-infoballoon.gif) no-repeat top left";x.style.backgroundPosition="0 -174px";iw.append(d,h);iw.backgroundImage(h,iwconst.GLOBAL_APP_URL+"/img/symbols/background_white.jpg");h.style.position="absolute";h.style.borderTop="1px solid #cfcfd1";h.style.top="0px";h.style.left="21px";h.style.height="21px";h.style.width=k.getWidth()-42+"px";iw.append(d,n);iw.backgroundImage(n,iwconst.GLOBAL_APP_URL+"/img/symbols/background_white.jpg");n.style.position="absolute";n.style.borderRight="1px solid #cfcfd1";n.style.top="21px";n.style.right="0px";n.style.width="21px";n.style.height=k.getHeight()-51-42+"px";iw.append(d,j);iw.backgroundImage(j,iwconst.GLOBAL_APP_URL+"/img/symbols/background_white.jpg");j.style.position="absolute";j.style.borderBottom="1px solid #cfcfd1";j.style.bottom="0px";j.style.left="21px";j.style.height="21px";j.style.width=k.getWidth()-42+"px";iw.append(d,b);iw.backgroundImage(b,iwconst.GLOBAL_APP_URL+"/img/symbols/background_white.jpg");b.style.borderLeft="1px solid #cfcfd1";b.style.position="absolute";b.style.top="21px";b.style.left="0px";b.style.width="21px";b.style.height=k.getHeight()-51-42+"px";a.id="divContent";iw.append(d,a);iw.backgroundImage(a,iwconst.GLOBAL_APP_URL+"/img/symbols/background_white.jpg");a.style.position="absolute";a.style.top="17px";a.style.left="15px";a.style.width=k.getWidth()-30+"px";a.style.height=k.getHeight()-53-5-15+"px";a.style.overflow="hidden";var y=iw.create("div");y.style.position="absolute";y.style.overflow="auto";iw.append(a,y);iw.append(y,o);iw.append(d,f);m.addLabelFor(new IWLabel("CLOSE",f,"title"));m.addLabelFor(new IWLabel("CLOSE",f,"alt"));f.src=iwconst.GLOBAL_APP_URL+"img/symbols/close.png";f.style.position="absolute";f.style.top="3px";f.style.right="16px";f.style.cursor="pointer";iw.append(i,c);c.style.position="absolute";c.style.bottom="0px";c.style.height="53px";c.style.width="105px";c.style.left=Math.round(k.getWidth()/2)+"px";c.style.background="url("+iwconst.GLOBAL_APP_URL+"img/overlays/infoballoon/sprite-infoballoon.gif) no-repeat top left";c.style.backgroundPosition="0 0";f.onclick=function(){u.removeWindowOverlay(m)}}function t(){v.debug("Calling resize.");var x=k.getWidth();var y=k.getHeight();i.style.height=y+"px";i.style.width=x+"px";d.style.width=x+"px";d.style.height=y-51+"px";a.style.width=x-30+"px";a.style.height=y-53-5-15+"px";h.style.width=x-42+"px";n.style.height=y-51-42+"px";j.style.width=x-42+"px";b.style.height=y-51-42+"px";c.style.left=Math.round(x/2)+"px"}g();this.setAnchor(new IWPoint(-(k.getWidth()/2),-(k.getHeight())));this.loadLanguagePack(u.getOptions().getLanguage())}function IWMarker(b,h){IWOverlay.call(this,b,h);var j=this;var f=new IWIcon(iwconst.GLOBAL_APP_URL+"img/symbols/pin/pin_red_33.gif",new IWPoint(16,22),new IWSize(33,24));var d=new Array();var c=this.getContainer();var i=log4javascript.getLogger("IWMarker");var g=iw.create("img");this.setDefaultIcon=function(k){f=k;if(this.isDisplayed()){a()}};this.getDefaultIcon=function(){return f};this.addScaleDependentIcon=function(k){d.push(k)};this.setScaleDependentIcons=function(k){d=k};this.getScaleDependentIcons=function(){return d};this.afterAppend=function(){iw.append(c,g);a()};this.beforeRemove=function(){IWEventManager.clearInstanceListeners(g);iw.remove(g)};this.toString=function(){return"[IWMarker] coordinate: "+h.toString()+", default icon: "+f.toString()};this.destroy=function(){this.destroyOverlay();IWEventManager.clearInstanceListeners(this)};function a(){var q=null;for(var n=0;n<d.length;n++){var k=d[n];if(k.getRange().getMin()<=b.getZoom()&&b.getZoom()<=k.getRange().getMax()){q=k;break}}var o=(q!=null?q:f);if(g.src!=o.getUrl()){var m=o.getUrl();if(o.getSize()!=null){g.width=o.getSize().getWidth();g.height=o.getSize().getHeight()}if(IWBrowser.isInternetExplorer()&&iw.extractFilePath(m).extension==".png"){g.onload=function(){correctPNG(g)}}else{g.onload=null}g.src=m}j.setHotspot(o.getHotspot())}g.align="top";this.setDraggable(false);this.setDragButton(IWButton.LEFT);this.setDraggableContainer(c);this.allowDraggingOutsideParent(false);IWEventManager.addListener(this,"onredrawstart",a)}function IWTooltip(map,coordinate,obj){var self=this;var _size=null;var _xAnchor=15;var _yAnchor=0;var _mapSize=map.getOptions().getSize();IWWindowOverlay.call(this,map,coordinate);this.beforeAppend=function(){this.setAnchor(new IWPoint(_xAnchor,_yAnchor))};this.afterAppend=function(){var position=iw.absolute(this.getContainer(),map.getContainer());var spaceRight=_mapSize.getWidth()-(position.getX()+_size.getWidth()+5);var spaceBottom=_mapSize.getHeight()-(position.getY()+_size.getHeight()+5);var newAnchorX=_xAnchor;var newAnchorY=_yAnchor;if(spaceRight<0){newAnchorX=-(_xAnchor+_size.getWidth())}if(spaceBottom<0){newAnchorY=-(_yAnchor+_size.getHeight())}if(newAnchorX!=_xAnchor||newAnchorY!=_yAnchor){this.setAnchor(new IWPoint(newAnchorX,newAnchorY))}this.getContainer().style.visibility="visible"};this.destroy=function(){obj=null;this.destroyWindowOverlay();IWEventManager.clearInstanceListeners(this)};function buildGUI(container){container.style.visibility="hidden";iw.backgroundImage(container,iwconst.GLOBAL_APP_URL+"img/symbols/background_white.jpg");var div=iw.create("div");if(typeof obj=="string"){obj=obj.replace(/\u0020/g,"&nbsp;")}iw.append(div,obj);iw.append(container,div);_size=IWDOMHelper.getSize(container,self.getParent());with(div.style){position="absolute";left="0px";top="0px";width=_size.getWidth()+4+"px";height=_size.getHeight()+"px";textAlign="center"}container.style.border="1px solid #dddddd";container.style.width=div.style.width;container.style.height=div.style.height}buildGUI(this.getContainer())}function IWRoutingMagnifierFactory(map){var _self=this;var _map=map;var _mapType=_map.getOptions().getMapTypeByName("roadmap");var _zoomLevel=200;this.createRoutingMagnifierContent=function(coordinate){var div=iw.create("div");with(div.style){position="relative";width="230px";height="260px"}var img=iw.create("img");iw.append(div,img);img.onload=function(){this.style.display="block"}.iwclosure(div);loadRoutingMagnifierImage(img,coordinate,_mapType);var imgZoomIn=iw.create("img");iw.append(div,imgZoomIn);imgZoomIn.src=iwconst.GLOBAL_APP_URL+"img/controls/magnifier/zoomIn.gif";with(imgZoomIn.style){position="absolute";top="5px";left="5px";cursor="pointer"}imgZoomIn.onclick=function(){if(_zoomLevel>400){_zoomLevel-=400;loadRoutingMagnifierImage(img,coordinate,_mapType)}}.iwclosure(_self);var imgZoomOut=iw.create("img");iw.append(div,imgZoomOut);imgZoomOut.src=iwconst.GLOBAL_APP_URL+"img/controls/magnifier/zoomOut.gif";with(imgZoomOut.style){position="absolute";top="23px";left="5px";cursor="pointer"}imgZoomOut.onclick=function(){_zoomLevel+=400;loadRoutingMagnifierImage(img,coordinate,_mapType)}.iwclosure(_self);var imgMap=iw.create("img");iw.append(div,imgMap);imgMap.src=iwconst.GLOBAL_APP_URL+"img/controls/magnifier/map.gif";with(imgMap.style){position="absolute";top="5px";left="30px";cursor="pointer"}imgMap.onclick=function(){_mapType=_map.getOptions().getMapTypeByName("roadmap");loadRoutingMagnifierImage(img,coordinate,_mapType)}.iwclosure(_self);var imgHybrid=iw.create("img");iw.append(div,imgHybrid);imgHybrid.src=iwconst.GLOBAL_APP_URL+"img/controls/magnifier/air.gif";with(imgHybrid.style){position="absolute";top="5px";left="77px";cursor="pointer"}imgHybrid.onclick=function(){_mapType=_map.getOptions().getMapTypeByName("hybrid");loadRoutingMagnifierImage(img,coordinate,_mapType)}.iwclosure(_self);return div};function loadRoutingMagnifierImage(img,coordinate,mapType){var config=mapType.getTilesServerConfig();img.src=config.getNextAlias()+config.getBaseDir()+"/servlet/FrontController?cmd=getPrintMap&app=ms&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&mapcx="+coordinate.getX()+"&mapcy="+coordinate.getY()+"&mapdx="+_zoomLevel+"&mapdy="+_zoomLevel+"&width=230&height=240&projc="+config.getProjection()+"&maptype="+mapType.getName()+IWRequestFormatter.getLayerParameter(_map.getZoom(),_map.getLayers(),IWLayer.DRAW_ON_LABELS)}}function IWProjectionClient(){var b=log4javascript.getLogger("IWProjectionClient");this.project=function(i,f,h,g){b.info("Calling project with "+f+" coordinate x:"+i.getX()+" y:"+i.getY()+" to "+h);var d=iwconst.LOCAL_APP_URL+"/servlet/FrontController?cmd=project&app=ms&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&FROM_X="+i.getX()+"&FROM_Y="+i.getY()+"&FROM_PROJ="+f+"&TO_PROJ="+h;var c=new IWXMLHttpRequest();c.open("GET",iwconst.PROJECTIONSERVER_PROXY_URL+"?serverURL="+escape(d),true);c.onreadystatechange=function(){a(this,c,i,f,h,g)}.iwclosure(this);c.send(null)};this.toString=function(){return"[IWProjectionClient]"};this.triggerOnProjection=function(c){IWEventManager.trigger(this,"onprojection",c)};function a(o,g,f,n,c,j){if(g.readyState==4){if(g.statusText=="OK"){if(g.responseText.length>0){var k=IWXMLHelper.parse(g.responseText).documentElement;var d=new IWProjectionEvent();d.inputCoordinate=f;d.fromProjection=n;d.toProjection=c;d.parameterObject=j;var h=null;if(k.getElementsByTagName("PROJECTION_RESULT")[0]){d.status="OK";var m=IWXMLHelper.getNodeValue(k.getElementsByTagName("PROJECTED_X")[0]);var i=IWXMLHelper.getNodeValue(k.getElementsByTagName("PROJECTED_Y")[0]);d.outputCoordinate=new IWCoordinate(m,i)}else{d.status=IWXMLHelper.getNodeValue(k.getElementsByTagName("ERROR_CODE")[0]);d.errorDescription=IWXMLHelper.getNodeValue(k.getElementsByTagName("ERROR_MSG")[0])}}else{alert("IWProjectionClient: Response text is empty.")}}else{if(g.status==401){alert("IWProjectionClient: Access denied. ("+g.status+") "+g.statusText)}else{alert("IWProjectionClient: ("+g.status+") "+g.statusText)}}o.triggerOnProjection(d)}}}function IWProjectionEvent(){this.status=null;this.errorDescription=null;this.inputCoordinate=null;this.outputCoordinate=null;this.fromProjection=null;this.toProjection=null;this.parameterObject=null;this.toString=function(){var a="[IWProjectionEvent] status: "+this.status+", ";if(this.status=="OK"){a+="inputCoordinate: "+(this.inputCoordinate?this.inputCoordinate.toString():"null")+", outputCoordinate: "+(this.outputCoordinate?this.outputCoordinate.toString():"null")+", fromProjection: "+this.fromProjection+", toProjection: "+this.toProjection}else{a+="errorDescription: "+this.errorDescription}return a}}var IWProjectionType=new function(){this.WGS84="WGS84";this.LCC_EUROPE="LCC_EUROPE"};function IWRoute(){var c=null;var b=null;var f=null;var d=new Array();var a=0;var j=0;var h=0;var g=null;var i="";this.setStartAddress=function(k){c=k};this.getStartAddress=function(){return c};this.setDestinationAddress=function(k){b=k};this.getDestinationAddress=function(){return b};this.setInterstationAddresses=function(k){f=k};this.getInterstationAddresses=function(){return f};this.setShape=function(k){i=k};this.getShape=function(){return i};this.setBounds=function(k){g=k};this.getBounds=function(){return g};this.setDrivingTime=function(k){a=k};this.getDrivingTime=function(){return a};this.setFuelConsumption=function(k){j=k};this.getFuelConsumption=function(){return j};this.setRouteLength=function(k){h=k};this.getRouteLength=function(){return h};this.getSegments=function(){return d.length};this.getEntry=function(k){return d[k]};this.addEntry=function(k){d.push(k)};this.toString=function(){return"[IWRoute]"}}function IWRouteEntry(){var g="";var o="";var b=0;var q=0;var a=0;var d=0;var j="";var i="";var k="";var n=null;var c=0;var h="";var m="";var f="";this.setType=function(r){g=r};this.getType=function(){return g};this.setStreetType=function(r){o=r};this.getStreetType=function(){return o};this.setEntryDistance=function(r){b=r};this.getEntryDistance=function(){return b};this.setTotalDistance=function(r){q=r};this.getTotalDistance=function(){return q};this.setEntryTime=function(r){a=r};this.getEntryTime=function(){return a};this.setTotalTime=function(r){d=r};this.getTotalTime=function(){return d};this.setSegment=function(r){j=r};this.getSegment=function(){return j};this.setConnector=function(r){i=r};this.getConnector=function(){return i};this.setDirection=function(s){var r=parseInt(s);k=s};this.getDirection=function(){return k};this.setCoordinate=function(r){n=r};this.getCoordinate=function(){return n};this.setOrientation=function(r){c=r};this.getOrientation=function(){return c};this.setRoundaboutType=function(r){h=r};this.getRoundaboutType=function(){return h};this.setRoundaboutNumber=function(r){m=r};this.getRoundaboutNumber=function(){return m};this.setSignPost=function(r){f=r};this.getSignPost=function(){return f};this.toString=function(){return"[IWRouteEntry] Type: "+g+", Street type: "+o+", Entry distance: "+b+", Total distance: "+q+", Entry Time: "+a+", Total Time: "+d+", Segment: "+j+", Connector: "+i+", Direction: "+k+", Coordinate: "+n+", Orientation: "+c+", Signpost: "+f}}function IWRouteFormatter(g){this.setLanguage=function(k){d=k};this.getLanguage=function(){return d};this.createSummaryAsHTML=function(){var k="";k+="<p>von\u0020<b>"+a(j.getStartAddress())+"</b>\u0020nach\u0020<b>"+a(j.getDestinationAddress())+"</b><br>";k+=h(j.getRouteLength())+"\u0020-\u0020ca.&nbsp;"+i(j.getDrivingTime())+"</p>";return k};this.createImageAsHTML=function(n){var q=0;var k=j.getEntry(n-1);var o=j.getEntry(n);var m=g.getEntry(n+1);switch(o.getDirection()){case -3:q=-646;break;case -2:q=-432;break;case -1:q=-70;break;case 0:q=-786;break;case 1:q=-140;break;case 2:q=-502;break;case 3:q=-716;break;case 10:q=0;break;case 11:q=-572;break}if(o.getConnector()!=""){if(k.getStreetType()=="highway"){if(o.getStreetType()=="highway"){q=-358}else{q=-284}}else{if(o.getStreetType()=="highway"){q=-210}}}return'<div style="background: transparent url('+iwconst.GLOBAL_APP_URL+"/img/controls/routing/sprite-routing.gif) no-repeat scroll 0 "+q+'px; vertical-align: top; width: 24px; height: 24px; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"'};this.createDistanceAsHTML=function(m){var o="";var n=j.getEntry(m);var k=j.getEntry(m+1);if(typeof k!="undefined"){o="<b>"+h(k.getEntryDistance())+"</b>&nbsp;<font size=-2>weiter</font><br>"}o+="<font size=-2>gesamt&nbsp;"+h(n.getTotalDistance())+"</font>";return o};this.createDescriptionAsHTML=function(s){var r="";var t=null;var o=j.getEntry(s-1);var u=j.getEntry(s);var t=j.getEntry(s+1);if(s==0){r="Sie\u0020starten\u0020<b>"+f(u)+"</b>\u0020auf\u0020<b>"+u.getSegment()+"</b>\u0020Richtung\u0020";if(u.getSignPost()!=""){r+="<b>"+u.getSignPost()+"</b>"}else{r+="<b>"+t.getSegment()+"</b>"}}else{switch(u.getDirection()){case -3:if(t.getStreetType()=="other"){r="Scharf\u0020links\u0020abbiegen";if(u.getSegment()!=""){r+="\u0020auf\u0020<b>"+u.getSegment()+"</b>"}}else{if(t.getStreetType()=="interstate"){r="Scharf\u0020links\u0020abbiegen";if(u.getSegment()!=""){r+="\u0020und\u0020<b>"+u.getSegment()+"</b>\u0020folgen"}}else{if(t.getStreetType()=="highway"){r="Fahren\u0020Sie\u0020scharf\u0020links\u0020auf\u0020<b>"+u.getSegment()+"</b>"}}}break;case -2:if(t.getStreetType()=="other"){r="Links\u0020abbiegen";if(u.getSegment()!=""){r+="\u0020auf\u0020<b>"+u.getSegment()+"</b>"}}else{if(t.getStreetType()=="interstate"){r="Links\u0020abbiegen";if(u.getSegment()!=""){r+="\u0020und\u0020<b>"+u.getSegment()+"</b>\u0020folgen"}}else{if(t.getStreetType()=="highway"){r="Fahren\u0020Sie\u0020links\u0020auf\u0020<b>"+u.getSegment()+"</b>"}}}break;case -1:if(t.getStreetType()=="other"){r="Links\u0020abbiegen";if(u.getSegment()!=""){r+="\u0020auf\u0020<b>"+u.getSegment()+"</b>"}}else{if(t.getStreetType()=="interstate"){r="Links\u0020einbiegen";if(u.getSegment()!=""){r+="\u0020und\u0020<b>"+u.getSegment()+"</b>\u0020folgen"}}else{if(t.getStreetType()=="highway"){r="Fahren\u0020Sie\u0020auf\u0020<b>"+u.getSegment()+"</b>"}}}break;case 0:if(u.getConnector()!=""){if(o.getStreetType()=="highway"&&u.getStreetType()=="highway"){r="Wechseln\u0020Sie\u0020bei\u0020<b>"+u.getConnector()+"</b>\u0020auf\u0020<b>"+u.getSegment()+"</b>"}else{if(o.getStreetType()!="highway"&&u.getStreetType()=="highway"){r="Nehmen\u0020Sie\u0020die\u0020Auffahrt\u0020<b>"+u.getConnector()+"</b>"}else{if(o.getStreetType()!="highway"&&u.getStreetType()!="highway"){r="Fahren\u0020Sie\u0020weiter\u0020zu\u0020<b>"+u.getConnector()+"</b>"}else{r="Nehmen\u0020Sie\u0020die\u0020Ausfahrt\u0020<b>"+u.getConnector()+"</b>"}}}}else{if(t.getStreetType()=="other"){r="Weiter\u0020auf\u0020<b>"+u.getSegment()+"</b>"}else{if(t.getStreetType()=="interstate"){r="Geradeaus\u0020und\u0020<b>"+u.getSegment()+"</b>\u0020folgen"}else{if(t.getStreetType()=="highway"){r="Geradeaus\u0020auf\u0020<b>"+u.getSegment()+"</b>"}}}}break;case 1:if(u.getConnector()!=""){if(o.getStreetType()=="highway"&&u.getStreetType()=="highway"){r="Wechseln\u0020Sie\u0020bei\u0020<b>"+u.getConnector()+"</b>\u0020auf\u0020<b>"+u.getSegment()+"</b>"}else{if(o.getStreetType()!="highway"&&u.getStreetType()=="highway"){r="Nehmen\u0020Sie\u0020die\u0020Auffahrt\u0020<b>"+u.getConnector()+"</b>"}else{if(o.getStreetType()!="highway"&&u.getStreetType()!="highway"){r="Fahren\u0020Sie\u0020weiter\u0020zu\u0020<b>"+u.getConnector()+"</b>"}else{r="Nehmen\u0020Sie\u0020die\u0020Ausfahrt\u0020<b>"+u.getConnector()+"</b>"}}}}else{if(t.getStreetType()=="other"){r="Rechts\u0020abbiegen";if(u.getSegment()!=""){r+="\u0020auf\u0020<b>"+u.getSegment()+"</b>"}}else{if(t.getStreetType()=="interstate"){r="Rechts\u0020einbiegen";if(u.getSegment()!=""){r+="\u0020und\u0020<b>"+u.getSegment()+"</b>\u0020folgen"}}else{if(t.getStreetType()=="highway"){r="Fahren\u0020Sie\u0020auf\u0020<b>"+u.getSegment()+"</b>"}}}}break;case 2:if(u.getConnector()!=""){if(o.getStreetType()=="highway"&&u.getStreetType()=="highway"){r="Wechseln\u0020Sie\u0020bei\u0020<b>"+u.getConnector()+"</b>\u0020auf\u0020<b>"+u.getSegment()+"</b>"}else{if(o.getStreetType()!="highway"&&u.getStreetType()=="highway"){r="Nehmen\u0020Sie\u0020die\u0020Auffahrt\u0020<b>"+u.getConnector()+"</b>"}else{if(o.getStreetType()!="highway"&&u.getStreetType()!="highway"){r="Fahren\u0020Sie\u0020weiter\u0020zu\u0020<b>"+u.getConnector()+"</b>"}else{r="Nehmen\u0020Sie\u0020die\u0020Ausfahrt\u0020<b>"+u.getConnector()+"</b>"}}}}else{if(t.getStreetType()=="other"){r="Rechts\u0020abbiegen";if(u.getSegment()!=""){r+="\u0020auf\u0020<b>"+u.getSegment()+"</b>"}}else{if(t.getStreetType()=="interstate"){r="Rechts\u0020abbiegen";if(u.getSegment()!=""){r+="\u0020und\u0020<b>"+u.getSegment()+"</b>\u0020folgen"}}else{if(t.getStreetType()=="highway"){r="Fahren\u0020Sie\u0020rechts\u0020auf\u0020<b>"+u.getSegment()+"</b>"}}}}break;case 3:if(u.getConnector()!=""){if(o.getStreetType()=="highway"&&u.getStreetType()=="highway"){r="Wechseln\u0020Sie\u0020bei\u0020<b>"+u.getConnector()+"</b>\u0020auf\u0020<b>"+u.getSegment()+"</b>"}else{if(o.getStreetType()!="highway"&&u.getStreetType()=="highway"){r="Nehmen\u0020Sie\u0020die\u0020Auffahrt\u0020<b>"+u.getConnector()+"</b>"}else{if(o.getStreetType()!="highway"&&u.getStreetType()!="highway"){r="Fahren\u0020Sie\u0020weiter\u0020zu\u0020<b>"+u.getConnector()+"</b>"}else{r="Nehmen\u0020Sie\u0020die\u0020Ausfahrt\u0020<b>"+u.getConnector()+"</b>"}}}}else{if(t.getStreetType()=="other"){r="Scharf\u0020rechts\u0020abbiegen";if(u.getSegment()!=""){r+="\u0020auf\u0020<b>"+u.getSegment()+"</b>"}}else{if(t.getStreetType()=="interstate"){r="Scharf\u0020rechts\u0020abbiegen";if(u.getSegment()!=""){r+="\u0020und\u0020<b>"+u.getSegment()+"</b>\u0020folgen"}}else{if(t.getStreetType()=="highway"){r="Fahren\u0020Sie\u0020scharf\u0020rechts\u0020auf\u0020<b>"+u.getSegment()+"</b>"}}}}break;case 10:var v=null;if(typeof t=="undefined"){v=g.getDestinationAddress()}else{var k=0;for(var q=s-1;q>=0;q--){if(g.getEntry(q).getDirection()==10){k++}}v=g.getInterstationAddresses()[k]}r="Nach\u0020ca.\u0020"+h(u.getEntryDistance())+"\u0020haben\u0020Sie\u0020Ihr\u0020Ziel,\u0020<b>"+a(v)+"</b>\u0020erreicht.";break;case 11:r="Im\u0020Kreisverkehr\u0020<b>"+u.getSegment()+"</b>\u0020die\u0020<b>"+b(u.getRoundaboutNumber())+"</b>\u0020Ausfahrt\u0020nehmen";break}if(u.getDirection()!=10&&u.getSignPost()!=""){r+="\u0020Richtung\u0020<b>"+u.getSignPost()+"</b>"}if(typeof t!="undefined"){var m=i(t.getEntryTime());if(m){r+="<br>Ca.&nbsp;"+m}}}return r};function a(k){var m="";if(k.getStreet()){m+=k.getStreet();if(k.hasHouseNumber()){m+="&nbsp;"+k.getHouseNumber()}m+=",\u0020"}if(k.getZipCode()){m+=k.getZipCode()+"&nbsp;"}m+=k.getCity();return m}function c(m){var k=m.getDirection();if((k>=337.5&&k<=0)||(k>=0&&k<=22.5)){return 1}else{if(k>=22.5&&k<=67.5){return 2}else{if(k>=67.5&&k<=112.5){return 3}else{if(k>=112.5&&k<=157.5){return 4}else{if(k>=157.5&&k<=202.5){return 5}else{if(k>=202.5&&k<=247.5){return 6}else{if(k>=247.5&&k<=292.5){return 7}else{if(k>=292.5&&k<=337.5){return 8}}}}}}}}}function f(m){var n="";var k=c(m);if(d.toLowerCase()=="de"){switch(k){case 1:n="n&ouml;rdlich";break;case 2:n="nord&ouml;stlich";break;case 3:n="&ouml;stlich";break;case 4:n="s&uuml;d&ouml;stlich";break;case 5:n="s&uuml;dlich";break;case 6:n="s&uuml;dwestlich";break;case 7:n="westlich";break;case 8:n="nordwestlich";break}}return n}function i(q){var o="";var n=Math.round(q/60);var k=Math.floor(n/60);var m=n-(k*60);if(k==1){o="1&nbsp;Stunde"}else{if(k>1){o=k+"&nbsp;Stunden"}}if(n==0){o=""}else{if(n==1){o="1&nbsp;Minute"}else{if(n<60){o=n+"&nbsp;Minuten"}else{o+=",&nbsp;"+m+"&nbsp;Minuten"}}}return o}function h(k){var m="";if(k<100){m=(Math.round(k/10)*10)+"&nbsp;m"}else{m=(Math.round(k/100)/10)+"&nbsp;km"}return m}function b(m){var k="";if(m==1){k="erste"}else{if(m==2){k="zweite"}else{if(m==3){k="dritte"}else{if(m==4){k="vierte"}else{k=m}}}}return k}var d="de";var j=g}function IWRouteOptions(){this.TYPE_SPEED="SPEED";this.TYPE_LENGTH="LENGTH";this.TYPE_ECONOMY="ECONOMY";var b=this.TYPE_SPEED;var d=30;var f=70;var a=130;var c=true;this.setShapeEnabled=function(g){if(g==true||g==false){c=g}};this.isShapeEnabled=function(){return c};this.setType=function(g){if(g==this.TYPE_SPEED||g==this.TYPE_LENGTH||g==this.TYPE_ECONOMY){b=g}else{throw"Unkown type: "+g+"."}};this.getType=function(){return b};this.setCitySpeed=function(h){var g=parseInt(h);if(g>0){d=g}else{throw"The average driving speed in cities must be greater than 0."}};this.getCitySpeed=function(){return d};this.setCountryRoadSpeed=function(h){var g=parseInt(h);if(g>0){f=g}else{throw"The average driving speed on country roads must be greater than 0."}};this.getCountryRoadSpeed=function(){return f};this.setHighwaySpeed=function(g){var h=parseInt(g);if(h>0){a=h}else{throw"The average driving speed on highways must be greater than 0."}};this.getHighwaySpeed=function(){return a};this.toString=function(){return"[IWRouteOptions] Routing type: "+b+", Average driving speed in cities: "+d+", Average driving speed on country roads: "+f+", Average driving speed on highways: "+a}}function IWRouteSegment(){var c=null;var f=null;var g=null;var h=null;var d=null;var a=null;var b=null;this.DC_START=0;this.DC_DESTINATION=1;this.DC_STRAIGHTAHEAD=2;this.DC_HALFRIGHT=3;this.DC_RIGHT=4;this.DC_SHARPRIGHT=5;this.DC_HALFLEFT=6;this.DC_LEFT=7;this.DC_SHARPLEFT=8;this.DC_ROUNDABOUT=9;this.setInstruction=function(i){c=i};this.getInstruction=function(){return c};this.setCoordinate=function(i){f=i};this.getCoordinate=function(){return f};this.setDirection=function(i){var j=parseInt(i);if(j>=0&&j<=12){g=i}else{throw"The direction "+i+" is out of range. The value must be between 0 and 12."}};this.getDirection=function(){return g};this.setLength=function(i){h=i};this.getLength=function(){return h};this.setRouteLength=function(i){a=i};this.getRouteLength=function(){return a};this.setTime=function(i){d=i};this.getTime=function(){return d};this.setRouteTime=function(i){b=i};this.getRouteTime=function(){return b};this.toString=function(){return"[IWRouteSegment] Instruction text: "+c+", Coordinate :"+f.toString()+", Driving direction code: "+g+", Segment Length: "+h+", Segment Driving Time: "+d+", Route Driving Time: "+b+", Route Length: "+a}}function IWRoutingClient(){var logger=log4javascript.getLogger("IWRoutingClient");var options=new IWRouteOptions();this.setRouteOptions=function(routeOptions){options=routeOptions};this.getRouteOptions=function(){return options};this.route=function(start,destination,interstations){logger.info("Calling route with "+start+", "+destination+", "+interstations);var params="";var startCoord,destCoord;if(iwconst.ROUTING_SERVER_PROJECTION=="MERCATOR"){startCoord=start.getWGS84().toMercator();destCoord=destination.getWGS84().toMercator()}else{startCoord=start.getLCC();destCoord=destination.getLCC()}params=params.concat("&X1=").concat(startCoord.getX());params=params.concat("&Y1=").concat(startCoord.getY());params=params.concat("&X2=").concat(destCoord.getX());params=params.concat("&Y2=").concat(destCoord.getY());if((interstations!=null)&&(typeof interstations!="undefined")){for(var i=0,n=1;i<interstations.length;i++,n++){var interCoord;if(iwconst.ROUTING_SERVER_PROJECTION=="MERCATOR"){interCoord=interstations[i].getWGS84().toMercator()}else{interCoord=interstations[i].getLCC()}params=params.concat("&IX").concat(n).concat("=").concat(interCoord.getX());params=params.concat("&IY").concat(n).concat("=").concat(interCoord.getY())}}if(options!=null){params=params.concat("&TYPE=").concat(options.getType());params=params.concat("&SPEED_CI=").concat(options.getCitySpeed());params=params.concat("&SPEED_CO=").concat(options.getCountryRoadSpeed());params=params.concat("&SPEED_HI=").concat(options.getHighwaySpeed());params=params.concat("&SHAPE=").concat(options.isShapeEnabled()?"1":"0")}var url=iwconst.LOCAL_APP_URL+"/servlet/FrontController?cmd=route&app=ms&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+params;var xmlHttp=new IWXMLHttpRequest();xmlHttp.open("GET",iwconst.ROUTINGSERVER_PROXY_URL+"?serverURL="+escape(url),true);xmlHttp.onreadystatechange=function(){routeCallback(this,xmlHttp,start,destination,interstations)}.iwclosure(this);xmlHttp.send(null)};this.toString=function(){return"[IWRoutingClient] "+(options!=null?options.toString():"null")};this.triggerOnRoute=function(event){IWEventManager.trigger(this,"onroute",event)};function routeCallback(self,xmlHttp,start,destination,interstations){if(xmlHttp.readyState==4){if(xmlHttp.statusText=="OK"){if(xmlHttp.responseText.length>0){var json=eval(xmlHttp.responseText);var route=new IWRoute();route.setStartAddress(start);route.setDestinationAddress(destination);route.setInterstationAddresses(interstations);route.setShape(json.route.shape);var coordNW=new IWCoordinate(json.route.boundsNW.split(";")[0],json.route.boundsNW.split(";")[1]);var coordSE=new IWCoordinate(json.route.boundsSE.split(";")[0],json.route.boundsSE.split(";")[1]);route.setBounds(new IWBounds(coordNW,coordSE));route.setDrivingTime(json.route.drivingTime);route.setFuelConsumption(json.route.fuelConsumption);route.setRouteLength(json.route.routeLength*1000);var entries=json.route.entries;for(var i=0;i<entries.length;i++){var e=entries[i];var entry=new IWRouteEntry();entry.setType(e.type);entry.setStreetType(e.streettype);entry.setEntryDistance(parseInt(e.entryDistance));entry.setTotalDistance(parseInt(e.totalDistance));entry.setEntryTime(parseInt(e.entryTime));entry.setTotalTime(parseInt(e.totalTime));entry.setSegment(e.segment);entry.setConnector(e.connector);entry.setDirection(parseInt(e.direction));entry.setCoordinate(new IWCoordinate(e.coordinateX,e.coordinateY));entry.setOrientation(parseInt(e.orientation));entry.setRoundaboutType(e.roundaboutType);entry.setRoundaboutNumber(e.roundaboutNumber);entry.setSignPost(e.signpost);route.addEntry(entry)}}else{alert("IWRoutingClient: Response text is empty.")}}else{if(xmlHttp.status==401){alert("IWRoutingClient: Access denied. ("+xmlHttp.status+") "+xmlHttp.statusText)}else{alert("IWRoutingClient: ("+xmlHttp.status+") "+xmlHttp.statusText)}}}else{throw"Error. ReadyState: "+xmlHttp.readyState+", Status: "+xmlHttp.statusText+", Content-length: "+xmlHttp.responseText.length}var event=new IWRoutingEvent();event.statusCode=xmlHttp.statusText;event.route=route;self.triggerOnRoute(event)}}function IWRoutingEvent(){this.status=null;this.bounds=null;this.shape="";this.route=null;this.parameterObject=null;this.toString=function(){return"[IWRoutingEvent]"}}var IWAccessFilter=new function(){var a=0;var b=0;this.setCNR=function(c){a=parseInt(c)};this.getCNR=function(){return a};this.setPNR=function(c){b=parseInt(c)};this.getPNR=function(){return b};this.toString=function(){return"[IWAccessFilter] CNR="+a+", PNR="+b}};function IWLayer(a,h,g,c){IWLayerInterface.call(this,h);var j=this;var b=new Array();var i=IWLayer.DRAW_ON_LABELS;this.add=function(k){throw"IWLayer is not allowed to add childnodes."};this.expand=function(k){throw"IWLayer cannot expand childnodes."};this.collapse=function(k){throw"IWLayer cannot collapse childnodes."};this.addLayer=function(k){this.add(k)};this.setLayerName=function(k){g=k};this.getLayerName=function(){return g};this.setLayerTitle=function(k){this.setName(k)};this.getLayerTitle=function(){return this.getName()};this.setUseLabelsOrTilesForDrawing=function(m){var k=parseInt(m);if(k!=IWLayer.DRAW_ON_TILES&&k!=IWLayer.DRAW_ON_LABELS){throw"Invalid parameter value: "+k}i=k};this.getUseLabelsOrTilesForDrawing=function(){return i};this.getCurrentShapeName=function(m){for(var k=0;k<b.length;k++){if(b[k].getRange().contains(m)){return b[k].getShapeName()}}return null};this.setVisibility=function(k){iw.strict([Boolean],arguments);this.setUseDefaults(false);if(this.isMarked()!=k){if(k){this.mark()}else{this.unmark()}f(this.getParent())}};this.setIdfLayerName=function(k){c=k};this.getIdfLayerName=function(){return c};this.addShape=function(k){this.removeShape(k.getShapeName());b.push(k);var m=a.getZoom();if(m!=null){d(m)}};this.removeShape=function(m){iw.strict([String],arguments);for(var k=0;k<b.length;k++){if(b[k].getShapeName()==m){b.splice(k,1);var n=a.getZoom();if(n!=null){d(n)}return true}}return false};this.getShapes=function(){return b};this.isVisible=function(){return this.isMarked()};this.toString=function(){return"[IWLayer] layertitle: "+this.getName()+", layername: "+g+", idfLayerName: "+c+", shapes: "+b};this.triggerOnRemove=function(){IWEventManager.trigger(this,"onremove",null)};function d(k){if(j.useDefaults()){if(j.getCurrentShapeName(k)==null){j.unmark()}else{j.mark()}f(j.getParent())}}function f(o){if(o==null){return}var m=o.getChildren();var n=false;for(var k=0;k<m.length;k++){if(m[k].isMarked()){n=true;break}}if(!o.isMarked()&&n){o.mark();f(o.getParent())}else{if(o.isMarked()&&!n){o.unmark();f(o.getParent())}}}if(typeof h!="string"){throw"IWLayer: layerTitle has to be specified"}if(typeof g!="string"){throw"IWLayer: layerName has to be specified"}if(typeof c=="undefined"){c=g}IWEventManager.addListener(a,"onzoom",function(k){d(k.newZoomLevel)});IWEventManager.addListener(a,"oncenter",function(){d(a.getZoom())})}IWLayer.DRAW_ON_TILES=1;IWLayer.DRAW_ON_LABELS=2;function IWLayerGroup(a){IWLayerInterface.call(this,a);this.getGroupName=function(){return this.getName()};this.setGroupName=function(b){iw.strict([String],arguments);this.setName(b)};this.isVisible=function(){return this.isMarked()};this.addLayer=function(b){this.add(b);if(!this.isMarked()&&b.isMarked()){this.mark()}};this.removeLayer=function(c){this.remove(c);c.triggerOnRemove();if(this.isMarked()&&c.isMarked()){var d=false;for(var b=0;b<this.getChildren().length;b++){if(this.getChildren()[b].isMarked()){d=true;break}}if(!d){this.unmark()}}};this.removeLayerByName=function(b){var d=null;for(var c=0;c<this.getChildren().length;c++){if(this.getChildren()[c].getName()==b){d=this.getChildren()[c];break}}if(d==null){throw"IWLayerGroup.removeLayerByName: Layer(Group) '"+b+"' not found!"}this.removeLayer(d);return d};this.triggerOnRemove=function(){for(var b=0;b<this.getChildren().length;b++){this.getChildren()[b].triggerOnRemove()}};this.toString=function(){return"[IWLayerGroup] groupName: "+this.getName()+", isVisible: "+this.isVisible()+", useDefaults: "+this.useDefaults()+", hasChildren: "+this.hasChildren()};if(typeof a!="string"){throw"IWLayerGroup: groupName has to be specified"}}function IWLayerInfoEvent(){this.requestedId=null;this.requestedEvent=null;this.json=null;this.mouseCoordinate=null;this.records=0;this.toString=function(){return"[IWLayerInfoEvent] requestedId: "+this.requestedId+", requestedEvent: "+this.requestedEvent+", json: "+this.json+", mouseCoordinate: "+this.mouseCoordinate+", records: "+this.records}}function IWLayerInfoManager(map){var self=this;var requestLayers=new Array();var eventListeners=new Object();var captureSize=new IWSize(25,25);var captureOffset=new IWPoint(0,0);var requestIdCounter=0;var maxHits=100;var logger=log4javascript.getLogger("IWLayerInfoManager");this.setMaximumHits=function(newMaxHits){logger.info("Calling setMaximumHits with "+newMaxHits);if(newMaxHits==null){maxHits=null}else{var intValue=parseInt(maxHits);if(intValue<0){throw ("Invalid value for maxHits: "+intValue)}maxHits=intValue}};this.getMaximumHits=function(){return maxHits};this.setCaptureSize=function(newCaptureSize){logger.info("Calling setCaptureSize with "+newCaptureSize);iw.strict([IWSize],arguments);captureSize=newCaptureSize};this.getCaptureSize=function(){return captureSize};this.setCaptureOffset=function(offset){captureOffset=offset};this.getCaptureOffset=function(){return captureOffset};this.addRequestLayer=function(requestLayer){logger.info("Calling addRequestLayer with "+requestLayer);iw.strict([IWRequestLayer],arguments);for(var i=0;i<requestLayers.length;i++){if(requestLayers[i]==requestLayer){return false}}requestLayers.push(requestLayer);var newEvents=requestLayer.getEvents();for(var eventName in newEvents){addEvent(eventName)}requestLayer.onRegisterListener=IWEventManager.addListener(requestLayer,"onregister",function(e){addEvent(e.eventName)});requestLayer.onUnregisterListener=IWEventManager.addListener(requestLayer,"onunregister",function(e){removeEvent(e.eventName)});return true};this.removeRequestLayer=function(requestLayer){logger.info("Calling removeRequestLayer with "+requestLayer);iw.strict([IWRequestLayer],arguments);var layerIndex=null;for(var i=0;i<requestLayers.length;i++){if(requestLayers[i]==requestLayer){layerIndex=i;break}}if(layerIndex==null){return false}IWEventManager.removeListener(requestLayer.onRegisterListener);IWEventManager.removeListener(requestLayer.onUnregisterListener);var oldEvents=requestLayer.getEvents();for(var eventName in oldEvents){removeEvent(eventName)}requestLayers.splice(layerIndex,1);return true};this.triggerOnDataReceive=function(event){IWEventManager.trigger(this,"ondatareceive",event)};this.toString=function(){return"[IWLayerInfoManager] capture size: "+captureSize.toString()};function addEvent(eventName){if(eventListeners[eventName]==null){eventListeners[eventName]=new Array();eventListeners[eventName].push(1);var listener=IWEventManager.addListener(map,eventName,function(e){sendServerRequest(e,eventName)});eventListeners[eventName].push(listener)}else{eventListeners[eventName][0]++}}function removeEvent(eventName){if(eventListeners[eventName]==null){throw"IWLayerInfoManager: Event not found: "+eventName}else{if(eventListeners[eventName][0]==1){IWEventManager.removeListener(eventListeners[eventName][1]);eventListeners[eventName]=null}else{eventListeners[eventName][0]--}}}function sendServerRequest(event,eventName){logger.debug("Calling sendServerRequest with "+event+", "+eventName);var layernames="";var idfIndex=1;for(var i=0;i<requestLayers.length;i++){if(requestLayers[i].getEvents()[eventName]&&requestLayers[i].getLayer().isVisible()){var layer=requestLayers[i].getLayer();var shapeName=layer.getCurrentShapeName(map.getZoom());var maximumHits=requestLayers[i].getMaximumHits();layernames+=idfIndex+","+layer.getIdfLayerName()+","+layer.getLayerName()+","+shapeName;if(maximumHits!=null){layernames+=","+maximumHits}layernames+=";"}else{}idfIndex++}if(layernames!=""){var captureOffsetX=captureOffset.getX();var captureOffsetY=captureOffset.getY();var mousePixelWithOffset=new IWPoint(event.position.getX()+captureOffsetX,event.position.getY()+captureOffsetY);var dxPixel=captureSize.getWidth();var dyPixel=captureSize.getHeight();var point1=new IWPoint(parseInt(mousePixelWithOffset.getX()-dxPixel/2),parseInt(mousePixelWithOffset.getY()-dyPixel/2));var maptype=map.getCurrentMapType();var projection=maptype.getProjection();var coord1=projection.pixelToMeter(point1);var coord2=projection.pixelToMeter(new IWPoint(point1.getX()+dxPixel,point1.getY()+dyPixel));var dxMeter=Math.abs(Math.ceil(coord2.getX()-coord1.getX()));var dyMeter=Math.abs(Math.ceil(coord2.getY()-coord1.getY()));var mouseCoordinate=projection.pixelToMeter(mousePixelWithOffset);var url=iwconst.LOCAL_APP_URL+"servlet/FrontController?cmd=getIdentifyInfo&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&app=ms&mapcx="+mouseCoordinate.getX()+"&mapcy="+mouseCoordinate.getY()+"&mapdx="+dxMeter+"&mapdy="+dyMeter+"&width="+dxPixel+"&captureOffsetX="+captureOffsetX+"&captureOffsetY="+captureOffsetY+"&height="+dyPixel+"&projc="+maptype.getTilesServerConfig().getProjection()+"&borderpolygon=yes&maxidentifyobjects="+maxHits+"&layers="+layernames+"&maptype="+map.getCurrentMapType().getName();var proxyURL=iwconst.GLOBAL_PROXY_URL+"?serverURL="+escape(url);var method="GET";if(proxyURL.length>2000){method="POST"}var xmlHttp=new IWXMLHttpRequest();xmlHttp.open(method,proxyURL,true);xmlHttp.onreadystatechange=function(){callbackSendServerRequest(xmlHttp,eventName,mouseCoordinate)}.iwclosure(self);xmlHttp.send(null)}}function callbackSendServerRequest(xmlHttp,eventName,mouseCoordinate){logger.debug("Calling callbackSendServerRequest.");var json=null;if(xmlHttp.readyState==4){if(xmlHttp.statusText=="OK"){if(xmlHttp.responseText.length>0){json=eval(xmlHttp.responseText)}else{alert("IWLayerInfoManager: Response text is empty.")}}else{if(xmlHttp.status==401){alert(xmlHttp.statusText)}}}else{alert("GetIdentifyInfo failed: "+xmlHttp.statusText)}requestIdCounter++;var records=0;for(var layerData in json){records+=json[layerData].meta.records}var infoManagerEvent=new IWLayerInfoEvent();infoManagerEvent.requestId=requestIdCounter;infoManagerEvent.mouseCoordinate=mouseCoordinate;infoManagerEvent.requestedEvent=eventName;infoManagerEvent.json=json;infoManagerEvent.test=xmlHttp.responseText;infoManagerEvent.records=records;self.triggerOnDataReceive(infoManagerEvent);var dataEvent=new IWLayerInfoEvent();dataEvent.requestedEvent=eventName;dataEvent.mouseCoordinate=mouseCoordinate;for(var i=0;i<requestLayers.length;i++){if(requestLayers[i].getEvents()[eventName]&&requestLayers[i].getLayer().isVisible()){var layer=requestLayers[i].getLayer();if(json[layer.getIdfLayerName()]){var jsonLayer=json[layer.getIdfLayerName()];dataEvent.json=jsonLayer.recordset;dataEvent.requestId=requestIdCounter;dataEvent.records=jsonLayer.meta.records;requestLayers[i].triggerOnDataReceive(dataEvent)}}}}}function IWLayerInterface(b){IWNodeElement.call(this,b);var a=true;this.isVisible=function(){throw"Function isVisible is not implemented!"};this.setUseDefaults=function(c){a=c};this.useDefaults=function(){return a};this.setVisible=function(g){iw.strict([Boolean],arguments);var f=this;if(g){while(f){f.setUseDefaults(false);f.mark();f=f.getParent()}}else{f.setUseDefaults(false);f.unmark();var d=false;f=f.getParent();while(f){if(!d){for(var c=0;c<f.getChildren().length;c++){if(f.getChildren()[c].isMarked()){d=true;f.setUseDefaults(false);f.mark();break}}if(!d){f.setUseDefaults(false);f.unmark()}}else{break}f=f.getParent()}}if(this.hasChildren()){for(var c=0;c<this.getChildren().length;c++){this.getChildren()[c].setVisible(g)}}}}function IWRequestLayer(b){var c=5;var a=new Object();this.setMaximumHits=function(d){if(d==null){c=null}else{var f=parseInt(d);if(f<0){throw ("Invalid value for maxHits: "+f)}c=f}};this.getMaximumHits=function(){return c};this.registerEvent=function(d){iw.strict([String],arguments);if(a[d]==null){a[d]=true;var f=new IWRequestLayerEvent();f.eventName=d;this.triggerOnRegister(f);return true}return false};this.unregisterEvent=function(d){iw.strict([String],arguments);if(a[d]!=null){a[d]=null;var f=new IWRequestLayerEvent();f.eventName=d;this.triggerOnUnregister(f);return true}return false};this.getEvents=function(){return a};this.getLayer=function(){return b};this.triggerOnRegister=function(d){iw.strict([IWRequestLayerEvent],arguments);IWEventManager.trigger(this,"onregister",d)};this.triggerOnUnregister=function(d){iw.strict([IWRequestLayerEvent],arguments);IWEventManager.trigger(this,"onunregister",d)};this.triggerOnDataReceive=function(d){IWEventManager.trigger(this,"ondatareceive",d)}}function IWRequestLayerEvent(){this.eventName=null;this.toString=function(){return"[IWRequestLayerEvent] eventName: "+this.eventName}}function IWShape(b,a){if(a==null||typeof a=="undefined"){a=new IWRange(0,100)}this.setShapeName=function(c){b=c};this.getShapeName=function(){return b};this.setRange=function(c){a=c};this.getRange=function(){return a};this.toString=function(){return"[IWShape] shapeName: "+b+", range: "+a}}function IWShapeCreateEvent(){this.statuscode="";this.errordesc="";this.shapename="";this.bounds=null;this.toString=function(){return"[IWShapeCreateEvent] Statuscode: "+(this.statuscode==null?"null":this.statuscode)+", ErrorDesc: "+(this.errordesc==null?"null":this.errordesc)+", Shapename: "+(this.shapename==null?"null":this.shapename)}}function IWShapeService(){this.createFromKml=function(b){var d=iwconst.LOCAL_APP_URL+"/servlet/FrontController?cmd=createShape&app=ms&VNR="+IWAccessFilter.getCNR()+"&PNR="+IWAccessFilter.getPNR()+"&kmlfile="+b;var c=new IWXMLHttpRequest();c.open("GET",iwconst.SHAPESERVER_PROXY_URL+"?serverURL="+escape(d),true);c.onreadystatechange=function(){a(this,c)}.iwclosure(this);c.send(null)};this.toString=function(){return"[IWShapeService]"};this.triggerOnCreate=function(b){IWEventManager.trigger(this,"oncreate",b)};function a(d,c){if(c.readyState==4){if(c.statusText=="OK"){if(c.responseText.length>0){var b=IWXMLHelper.parse(c.responseText).documentElement;var g=new IWShapeCreateEvent();g.statuscode=IWXMLHelper.getNodeValue(b.getElementsByTagName("status")[0]);if(g.statuscode=="ERROR"){g.errordesc=IWXMLHelper.getNodeValue(b.getElementsByTagName("errdesc")[0])}else{if(g.statuscode=="OK"){g.shapename=IWXMLHelper.getNodeValue(b.getElementsByTagName("shapename")[0]);var h=IWXMLHelper.getNodeValue(b.getElementsByTagName("coordNW")[0]).split(",");var f=IWXMLHelper.getNodeValue(b.getElementsByTagName("coordSE")[0]).split(",");g.bounds=new IWBounds(new IWCoordinate(h[0],h[1]),new IWCoordinate(f[0],f[1]))}else{throw ("Undefined statuscode: "+g.statuscode)}}}else{alert("IWShapeService: Response text is empty.")}}else{if(c.status==401){alert(c.statusText)}else{alert("Shape service failed: "+c.statusText)}}d.triggerOnCreate(g)}}}var IWBrowser=new function(){this.isInternetExplorer=function(){return((document.all)&&(window.offscreenBuffering))?true:false};this.isNetscape=function(){return((document.captureEvents)&&(!document.getElementById))?true:false};this.isMozilla=function(){return((document.getElementById)&&(!document.all)&&(document.documentElement))?true:false};this.isOpera=function(){return window.opera?true:false}};var IWBrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(d){for(var a=0;a<d.length;a++){var b=d[a].string;var c=d[a].prop;this.versionSearchString=d[a].versionSearch||d[a].identity;if(b){if(b.indexOf(d[a].subString)!=-1){return d[a].identity}}else{if(c){return d[a].identity}}}},searchVersion:function(b){var a=b.indexOf(this.versionSearchString);if(a==-1){return}return parseFloat(b.substring(a+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};IWBrowserDetect.init();var IWDOMHelper=new function(){this.getSize=function(g,h){var f=parseInt(g.style.width);var c=parseInt(g.style.height);if(isNaN(f)){f=g.offsetWidth}if(isNaN(c)){c=g.offsetHeight}if(isNaN(f)||f==0||isNaN(c)||c==0){var b=g.style.position;var a=g.parentNode;var d=g.style.visibility;g.style.position="absolute";g.style.visibility="hidden";if(h!=null&&typeof h!="undefined"&&h.parentNode!=null){iw.append(h,g)}else{iw.append(document.body,g)}if(isNaN(f)||f==0){f=g.offsetWidth}if(isNaN(c)||c==0){c=g.offsetHeight}iw.remove(g);g.style.position=b;g.style.visibility=d;if(a){iw.append(a,g)}}return new IWSize(f,c)}};function IWDistanceFormatter(c){var d=0;var b="m";this.getDistance=function(){return d};this.getUnit=function(){return b};this.getMeter=function(){return c};function a(f){if(f>=1000000){d=Math.round(f/1000);b="km"}else{if(f>=10000){d=Math.round(f/10)/100;b="km"}else{d=Math.round(f);b="m"}}}a(c)}var IWProjectionUtils=new function(){var a=6371007.1810824;var d=1.006739596;this.millerToWgs84=function(m){var h=m.getX();var k=m.getY();var j=h/a;var i=2*(Math.atan(Math.exp(k/(a*1.25)))-Math.PI/4)/0.8;i=Math.atan(Math.tan(i)*d);j*=180;j/=Math.PI;i*=180;i/=Math.PI;return new IWCoordinate(j,i)};this.wgs84ToMiller=function(m){var j=m.getX();var i=m.getY();j/=180;j*=Math.PI;i/=180;i*=Math.PI;i=Math.atan(Math.tan(i)/d);var h=j*a;var k=1.25*Math.log(Math.tan(Math.PI/4+0.8*i/2))*a;return new IWCoordinate(h,k)};this.wgs84ToMercator=function(h){};function g(h){var k=h.Latitude;var m=h.Longitude;if(k<=-80){if(m<0){return"A"}else{return"B"}}else{if(k>=80){if(m<0){return"Y"}else{return"Z"}}else{var i=new Array("C","D","E","F","G","H","J","K","L","M","N","P","Q","R","S","T","U","V","W","X");var j=Math.floor((k+80)/8);return i[j]}}}function f(j,M,L){var m=DegtoRad(j.Latitude);var i=DegtoRad(j.Longitude);var y=g(j);var h=31+Math.floor(j.Longitude/6);var H=6*h-183;var I=(j.Longitude-H)*3600/10000;if(M<6300000){M*=1000}if(L<6300000){L*=1000}var r=0.9996;var O=Math.sqrt(1-(L*L/M/M));var o=O*O/(1-O*O);var J=(M-L)/(M+L);var N=Math.PI/(180*3600);var G=M*(1-J+(5*J*J/4)*(1-J)+(81*Math.pow(J,4)/64)*(1-J));var F=(3*M*J/2)*(1-J-(7*J*J/8)*(1-J)+55*Math.pow(J,4)/64);var z=(15*M*J*J/16)*(1-J+(3*J*J/4)*(1-J));var x=(35*M*Math.pow(J,3)/48)*(1-J+11*J*J/16);var w=(315*M*Math.pow(J,4)/51)*(1-J);var Q=M/Math.sqrt(1-Math.pow(O*Math.sin(m),2));var k=G*m-F*Math.sin(2*m)+z*Math.sin(4*m)-x*Math.sin(6*m)+w*Math.sin(8*m);var v=k*r;var u=Q*Math.sin(m)*Math.cos(m)*N*N*r*(100000000)/2;var t=((Math.pow(N,4)*Q*Math.sin(m)*Math.pow(Math.cos(m),3))/24)*(5-Math.pow(Math.tan(m),2)+9*o*Math.pow(Math.cos(m),2)+4*o*o*Math.pow(Math.cos(m),4))*r*(10000000000000000);var s=Q*Math.cos(m)*N*r*10000;var q=Math.pow(N*Math.cos(m),3)*(Q/6)*(1-Math.pow(Math.tan(m),2)+o*Math.pow(Math.cos(m),2))*r*(1000000000000);var K=v+u*I*I+t*Math.pow(I,4);if(K<0){K+=10000000}var P=500000+(s*I+q*Math.pow(I,3));return{LongitudeZone:h,LatitudeZone:y,Easting:P,Northing:K}}function c(i){var h=new Array("C","D","E","F","G","H","J","K","L","M","N","P","Q","R","S","T","U","V","W","X");var j=h.indexOf(i);if(j<0){if(i=="A"|i=="B"){return"S"}else{return"N"}}if(j>10){return"N"}return"S"}function b(P,K,I){if(P.constructor==String){var J=P.match(/([0-9]{1,2})([a-zA-Z])\s*([0-9]{1,7})[\s]+([0-9]{1,7})/);P={LongitudeZone:J[1],LatitudeZone:J[2],Easting:J[3],Northing:J[4]}}if(K<6300000){K*=1000}if(I<6300000){I*=1000}var u=0.9996;var N=Math.sqrt(1-Math.pow((I/K),2));var r=N*N/(1-N*N);var s=(1-Math.sqrt(1-N*N))/(1+Math.sqrt(1-N*N));var M=Math.PI/(180*3600);var k=3*s/2-27*s*s*s/32;var j=21*s*s/16-55*Math.pow(s,4)/32;var i=151*Math.pow(s,3)/96;var h=1097*Math.pow(s,4)/512;var t=500000-P.Easting;var n=P.Northing/u;var G=n/(K*(1-N*N/4-3*Math.pow(N,4)/64-5*Math.pow(N,6)/256));var F=G+k*Math.sin(2*G)+j*Math.sin(4*G)+i*Math.sin(6*G)+h*Math.sin(8*G);var L=r*Math.pow(Math.cos(F),2);var E=Math.pow(Math.tan(F),2);var A=K/Math.sqrt(1-Math.pow(N*Math.sin(F),2));var O=K*(1-N*N)/Math.pow(Math.sqrt(1-Math.pow(N*Math.sin(F),2)),3);var C=t/(A*u);var B=A*Math.tan(F)/O;var z=C*C/2;var y=(5+3*E+10*L-4*L*L-9*r)*Math.pow(C,4)/24;var x=(61+90*E+298*L+45*E*E-252*r-3*L*L)*Math.pow(C,6)/720;var w=(1+2*E+L)*C*C*C/6;var v=(5-2*L+28*E-3*L^2+8*r+24*E^2)*Math.pow(C,5)/120;var H=(C-w+v)/Math.cos(F);var o=6*P.LongitudeZone-183;var q=(F-B*(z+y+x))*180/Math.PI;if(c(P.LatitudeZone)=="S"){q*=-1}var m=o-H*180/Math.PI;return new VELatLong(q,m)}};var IWRequestFormatter=new function(){this.getLayerParameter=function(f,g,c){var d="";if(typeof c=="undefined"){c=IWLayer.DRAW_ON_LABELS}for(var b=0;b<g.length;b++){var a=g[b];if(a.constructor==IWLayerGroup){d=d+this.getLayerParameter(f,a.getChildren(),c)}else{if(a.constructor==IWLayer){if(a.getUseLabelsOrTilesForDrawing()==c){if(a.getLayerName()!=null&&a.getLayerName()!=""&&a.isVisible()){d=d+"&layer"+a.getLayerName()+"=";if(a.getCurrentShapeName(f)!=null){d=d+a.getCurrentShapeName(f)}}}}}}return d}};var IWVEUtils=new function(){var d=log4javascript.getLogger("IWVEUtils");function g(k,i,j){return Math.min(Math.max(k,i),j)}this.latLongToPixelXY=function(n,j){var i=(n.getX()+180)/360;var m=Math.sin(n.getY()*Math.PI/180);var o=0.5-Math.log((1+m)/(1-m))/(4*Math.PI);var k=this.getMapSize(j);return{x:parseInt(i*k),y:parseInt(o*k)}};this.tileToQuadKey=function(j,o){var q="";for(var n=o+1;n>0;n--){var m=1<<(n-1);var k=0;if((j.getX()&m)!=0){k++}if((j.getY()&m)!=0){k+=2}q+=k}return q};this.tileToQuadKeyXY=function(j,r,o){var q="";for(var n=o+1;n>0;n--){var m=1<<(n-1);var k=0;if((j&m)!=0){k++}if((r&m)!=0){k+=2}q+=k}return q};this.getMapSize=function(i){return 256<<(1+i)};this.pixelToTile=function(i){var k=Math.floor(i.getX()/256);var j=Math.floor(i.getY()/256);return new IWPoint(k,j)};this.pixelToTileXY=function(j,i){return{x:Math.floor(j/256),y:Math.floor(i/256)}};this.relativePixelToAbsoluteXY=function(i,n,m){var r=i.getCenter().toWGS84();var k=this.latLongToPixelXY(r,i.getZoom());var v=k.x;var u=k.y;if(v<0){v=this.getMapSize(i.getZoom())+v}if(u<0){u=this.getMapSize(i.getZoom())+u}var j=i.getOptions().getSize();var t=(j.getWidth()/2);var s=(j.getHeight()/2);var q=v-t+n;var o=u-s+m;if(q<0){q=this.getMapSize(i.getZoom())+q}if(o<0){o=this.getMapSize(i.getZoom())+o}return{x:parseInt(q),y:parseInt(o)}};var f=6378137;var b=-85.05112878;var a=85.05112878;var c=-180;var h=180;this.groundResolution=function(j,i){j=g(j,b,a);return Math.cos(j*Math.PI/180)*2*Math.PI*f/this.getMapSize(i)};this.absolutePixelToLatLon=function(n,k,j){var r=this.getMapSize(n.getZoom());var i=(g(k,0,r-1)/r)-0.5;var q=0.5-(g(j,0,r-1)/r);var o=90-360*Math.atan(Math.exp(-q*2*Math.PI))/Math.PI;var m=360*i;return{x:m,y:o}};this.pixelToLatLon=function(m,k,j){var i=this.relativePixelToAbsoluteXY(m,k,j);return this.absolutePixelToLatLon(m,i.x,i.y)}};var IWXMLHelper=new function(){this.parse=function(f){var d=null;if(document.implementation&&document.implementation.createDocument){var h=new DOMParser();try{d=h.parseFromString(f,"text/xml")}catch(c){}}else{if(window.ActiveXObject){d=new ActiveXObject("Microsoft.XMLDOM");d.async="false";if(f&&f.length>0){d.loadXML(f)}}else{if(document.implementation&&document.implementation.createLSParser){var g=document.implementation.MODE_SYNCHRONOUS;var a="http://www.w3.org/TR/REC-xml";var h=document.implementation.createLSParser(g,a);var b=document.implementation.createLSInput();b.stringData=sXMLString;d=h.parse(b)}else{throw ("Your browser can't handle this script")}}}return d};this.getNodeValue=function(a){if(typeof a!="undefined"&&a!=null){if(a.childNodes&&a.childNodes[0]!=null){return a.childNodes[0].nodeValue}}return null};this.getFloatAttribute=function(c,a){var b=c.getAttribute(a);if(b){var d=parseFloat(b);if(!isNaN(d)){return d}else{throw"Attribute is not a number"}}else{throw"Attribute not found"}}};function IWGraphics(drawContainer){var svg_support=!!window.devicePixelRatio||(typeof SVGAngle=="object"||(document&&document.implementation&&document.implementation.hasFeature("org.w3c.dom.svg","1.0")));
/*@cc_on @*/
/*@if (@_jscript_version >= 5.5)
	var vml_support = true;
	@else @*/
var vml_support=false;
/*@end @*/
var renderer=null;if(svg_support){renderer=new IWSVGRenderer(drawContainer)}else{if(vml_support){renderer=new IWVMLRenderer(drawContainer)}else{alert("Sorry, your Browser cannot show vector graphics!")}}return renderer}function IWGraphicsRenderer(a){this.getContainer=function(){return a};this.removeElement=function(b){b.parentNode.removeChild(b)};this.moveToTop=function(b){b.parentNode.appendChild(b)};this.moveToBottom=function(b){b.parentNode.insertBefore(b,b.parentNode.firstChild)};this.clearContainer=function(){alert("IWGraphicsRenderer.clearContainer() not implemented!")};this.move=function(d,c,b){alert("IWGraphicsRenderer.move() not implemented!")};this.getPosition=function(b){alert("IWGraphicsRenderer.getPosition() not implemented!")};this.drawLine=function(f,c,d,b){alert("IWGraphicsRenderer.drawLine() not implemented!")};this.drawPolyline=function(c,b,d,f){alert("IWGraphicsRenderer.drawLine() not implemented!")};this.drawPolygon=function(c,b,d,f){alert("IWGraphicsRenderer.drawPolygon() not implemented!")};this.drawCircle=function(c,b,d,f,g){alert("IWGraphicsRenderer.drawCircle() not implemented!")};this.drawEllipse=function(b,c,d,f,g){alert("IWGraphicsRenderer.drawEllipse() not implemented!")};this.drawRectangle=function(b,c,d,f,g){alert("IWGraphicsRenderer.drawRectangle() not implemented!")};this.drawRoundedRectangle=function(c,b,d,f,g,h){alert("IWGraphicsRenderer.drawRoundedRectangle() not implemented!")}}function IWSVGRenderer(a){IWGraphicsRenderer.call(this,a);var d="http://www.w3.org/2000/svg";var f=document.createElementNS(d,"svg");var b=log4javascript.getLogger("IWSVGRenderer");this.clearContainer=function(){b.info("Calling clearContainer.");if(f.hasChildNodes()){while(f.childNodes.length>0){this.removeElement(f.firstChild)}}};this.drawLine=function(k,i,j,m,n){b.info("Calling drawLine with "+k+", "+i+", "+j+", "+m);var h=a.ownerDocument.createElementNS(d,"line");h.id="line";h.style.position="absolute";h.setAttributeNS(null,"x1",k.getX()+"px");h.setAttributeNS(null,"y1",k.getY()+"px");h.setAttributeNS(null,"x2",i.getX()+"px");h.setAttributeNS(null,"y2",i.getY()+"px");g(h,j,m);f.appendChild(h);return h};this.drawPolyline=function(j,i,k,m){b.info("Calling polyline with "+j.length+" points.");var h=a.ownerDocument.createElementNS(d,"polyline");h.id="polyline";h.style.position="absolute";h.setAttributeNS(null,"points",j);g(h,i,k);c(h,m);f.appendChild(h);return h};this.drawEllipse=function(h,j,k,m,n){b.info("Calling drawEllipse with "+h+", "+j+", "+k+", "+m+", "+n);var i=a.ownerDocument.createElementNS(d,"ellipse");i.id="ellipse";i.style.position="absolute";i.setAttributeNS(null,"cx",h.getX()+"px");i.setAttributeNS(null,"cy",h.getY()+"px");i.setAttributeNS(null,"rx",j.getWidth()+"px");i.setAttributeNS(null,"ry",j.getHeight()+"px");g(i,k,m);c(i,n);f.appendChild(i);return i};this.drawCircle=function(i,h,k,m,n){var j=a.ownerDocument.createElementNS(d,"circle");j.id="circle";j.style.position="absolute";j.setAttributeNS(null,"cx",i.getX()+"px");j.setAttributeNS(null,"cy",i.getY()+"px");j.setAttributeNS(null,"r",h+"px");g(j,k,m);c(j,n);f.appendChild(j)};this.drawRectangle=function(h,j,k,m,n){b.info("Calling drawRectangle with "+h+", "+j+", "+k+", "+m+", "+n);var i=a.ownerDocument.createElementNS(d,"rect");i.id="rect";i.style.position="absolute";i.setAttributeNS(null,"x",h.getX()+"px");i.setAttributeNS(null,"y",h.getY()+"px");i.setAttributeNS(null,"width",j.getWidth()+"px");i.setAttributeNS(null,"height",j.getHeight()+"px");g(i,k,m);c(i,n);f.appendChild(i);return i};this.drawRoundedRectangle=function(i,h,k,m,n,o){var j=a.ownerDocument.createElementNS(d,"rect");j.id="rect";j.style.position="absolute";j.setAttributeNS(null,"x",i.getX()+"px");j.setAttributeNS(null,"y",i.getY()+"px");j.setAttributeNS(null,"rx",h+"px");j.setAttributeNS(null,"ry",h+"px");j.setAttributeNS(null,"width",k.getWidth()+"px");j.setAttributeNS(null,"height",k.getHeight()+"px");g(j,m,n);c(j,o);f.appendChild(j);return j};this.drawPath=function(k,i,j,m){var h=a.ownerDocument.createElementNS(d,"path");h.id="path";h.style.position="absolute";h.setAttributeNS(null,"d",k);g(h,i,j);c(h,m);f.appendChild(h);return h};this.drawPolygon=function(j,i,k,m){var h=a.ownerDocument.createElementNS(d,"polygon");h.id="polygon";h.style.position="absolute";h.setAttributeNS(null,"points",j);g(h,i,k);c(h,m);f.appendChild(h);return h};this.move=function(j,i,h){if(j.tagName=="line"){if(typeof h=="undefined"){return}j.setAttributeNS(null,"x1",i.getX()+"px");j.setAttributeNS(null,"y1",i.getY()+"px");j.setAttributeNS(null,"x2",h.getX()+"px");j.setAttributeNS(null,"y2",h.getY()+"px")}else{if(j.tagName=="ellipse"){j.setAttributeNS(null,"cx",i.getX()+"px");j.setAttributeNS(null,"cy",i.getY()+"px")}else{j.setAttributeNS(null,"x",i.getX()+"px");j.setAttributeNS(null,"y",i.getY()+"px")}}};this.getPosition=function(h){if(h.tagName=="line"){return}else{if(h.tagName=="ellipse"){return new IWPoint(parseInt(h.getAttributeNS(null,"cx")),parseInt(h.getAttributeNS(null,"cy")))}else{return new IWPoint(parseInt(h.getAttributeNS(null,"x")),parseInt(h.getAttributeNS(null,"y")))}}};function g(h,i,j){if(typeof j=="undefined"){j="none"}h.setAttributeNS(null,"stroke",j);h.setAttributeNS(null,"stroke-width",i)}function c(h,i){if(typeof i=="undefined"){i="none"}h.setAttributeNS(null,"fill",i)}a.appendChild(f)}function IWVMLRenderer(b){IWGraphicsRenderer.call(this,b);var c=log4javascript.getLogger("IWVMLRenderer");function f(){var h=new IWXMLHttpRequest();try{h.open("GET","",true);h.send(null)}catch(i){}}this.clearContainer=function(){c.info("Calling clearContainer");if(b.hasChildNodes()){while(b.childNodes.length>0){this.removeElement(b.firstChild)}}};this.drawLine=function(k,i,j,m){c.info("Calling drawLine with "+k+", "+i+", "+j+", "+m);if(j>=15){j-=5}else{if(j>=10){j-=4}else{if(j>=7){j-=3}else{if(j>=4){j-=2}else{if(j==3){j-=1}}}}}var h=b.ownerDocument.createElement("v:line");h.id="line";h.style.position="absolute";h.from=parseInt(k.getX())+"px,"+parseInt(k.getY())+"px";h.to=parseInt(i.getX())+"px,"+parseInt(i.getY())+"px";g(h,j,m);b.appendChild(h);f();return h};this.drawPolyline=function(j,i,k,m){c.info("Calling drawPolyline with "+j.length+" points.");var h=b.ownerDocument.createElement("v:polyline");h.id="line";h.style.position="absolute";h.points=j;d(h,m);g(h,i,k);b.appendChild(h);c.info("Calling drawPolyline done: "+h);f();return h};this.drawCircle=function(i,h,k,m,n){c.info("Calling drawCircle with "+i+", "+h+", "+k+", "+m+", "+n);var j=b.ownerDocument.createElement("v:oval");j.id="circle";j.style.position="absolute";j.style.top=(i.getY()-h)+"px";j.style.left=(i.getX()-h)+"px";j.style.width=(2*h)+"px";j.style.height=(2*h)+"px";d(j,n);g(j,k,m);b.appendChild(j);f();return j};this.drawEllipse=function(h,j,k,m,n){c.info("Calling drawEllipse with "+h+", "+j+", "+k+", "+m+", "+n);var i=b.ownerDocument.createElement("v:oval");i.id="ellipse";i.style.position="absolute";i.style.top=(h.getY()-j.getHeight())+"px";i.style.left=(h.getX()-j.getWidth())+"px";i.style.width=(2*j.getWidth())+"px";i.style.height=(2*j.getHeight())+"px";d(i,n);g(i,k,m);b.appendChild(i);f();return i};this.drawRectangle=function(h,j,k,m,n){c.info("Calling drawRectangle with "+h+", "+j+", "+k+", "+m+", "+n);var i=b.ownerDocument.createElement("v:rect");i.id="rect";i.style.position="absolute";i.style.top=h.getY();i.style.left=h.getX();i.style.width=j.getWidth();i.style.height=j.getHeight();d(i,n);g(i,k,m);b.appendChild(i);f();return i};this.drawRoundedRectangle=function(i,h,k,m,n,o){c.info("Calling drawRoundedRectangle with "+i+", "+h+", "+k+", "+m+", "+n+", "+o);var j=b.ownerDocument.createElement("v:roundrect");j.id="roundrect";j.style.position="absolute";j.style.top=i.getY();j.style.left=i.getX();j.style.width=k.getWidth();j.style.height=k.getHeight();j.arcsize=((h/k.getHeight())*100)+"%";d(j,o);g(j,m,n);b.appendChild(j);f();return j};this.drawPolygon=function(j,i,k,m){c.info("Calling drawPolygon with "+j+" points.");var h=b.ownerDocument.createElement("v:polyline");h.id="polygon";h.style.position="absolute";h.points=j+" "+j.split(" ")[0];d(h,m);g(h,i,k);b.appendChild(h);f();return h};this.move=function(j,i,h){if(j.tagName=="line"){if(typeof h=="undefined"){return}j.from=i.getX()+"px,"+i.getY()+"px";j.to=h.getX()+"px,"+h.getY()+"px"}else{if(j.tagName=="oval"){j.style.left=i.getX()-parseInt(j.style.width)/2+"px";j.style.top=i.getY()-parseInt(j.style.height)/2+"px"}else{j.style.left=i.getX()+"px";j.style.top=i.getY()+"px"}}};this.getPosition=function(h){if(h.tagName=="line"){return}else{if(h.tagName=="oval"){return new IWPoint(parseInt(h.style.left)+parseInt(h.style.width)/2,parseInt(h.style.top)+parseInt(h.style.height)/2)}else{return new IWPoint(parseInt(h.style.left),parseInt(h.style.top))}}};function g(h,i,j){if(typeof j!="undefined"){h.stroked="true";h.strokecolor=j;h.strokeweight=i+"px"}else{h.stroked="false"}}function d(h,i){if(typeof i!="undefined"){h.filled="true";h.fillcolor=i}else{h.filled="false"}}function a(){try{if(!document.documentMode||document.documentMode<8){document.namespaces.add("v","#default#VML");var j=document.createStyleSheet();j.addRule("v\\:rect","behavior:url(#default#VML); display:inline-block; antialias:true");j.addRule("v\\:roundrect","behavior:url(#default#VML); display:inline-block; antialias:true");j.addRule("v\\:oval","behavior:url(#default#VML); display:inline-block; antialias:true");j.addRule("v\\:line","behavior:url(#default#VML); display:inline-block; antialias:true");j.addRule("v\\:polyline","behavior:url(#default#VML); display:inline-block; antialias:true")}if(document.documentMode&&document.documentMode>=8){document.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML")}}catch(i){var h="";for(e in i){h+=e+" "+i[e]+"\n"}alert("IWVMLRenderer "+i+h)}IWVMLRenderer.isInitialized=true}if(!IWVMLRenderer.isInitialized){a()}}IWVMLRenderer.isInitialized=false;var cssScreen=document.createElement("link");document.getElementsByTagName("head")[0].appendChild(cssScreen);cssScreen.title="standard";cssScreen.media="screen";cssScreen.type="text/css";cssScreen.rel="stylesheet";cssScreen.href=iwconst.GLOBAL_APP_URL+"css/screen.css";var cssPrint=document.createElement("link");document.getElementsByTagName("head")[0].appendChild(cssPrint);cssPrint.title="standard";cssPrint.media="print";cssPrint.type="text/css";cssPrint.rel="stylesheet";cssPrint.href=iwconst.GLOBAL_APP_URL+"css/print.css";function correctPNG(img){
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
	if (navigator.appVersion.indexOf("MSIE 7.0") == -1)
	{
		var imgName = img.src.toUpperCase();
		if (imgName.substring(imgName.length - 3, imgName.length) == "PNG")
		{ 
			img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + img.src + ", sizingmethod=scale)";
			img.src = iwconst.GLOBAL_APP_URL + 'img/symbols/blank.gif';
		}
	}
	@end @*/
};