function ClickListener(_1,el){
this.eMap=_1;
this.enabled=false;
this._observer=this._clickEventHandler.bind(this);
};
ClickListener.prototype._on=function(){
Event.observe($(this.eMap.sourceMap.viewport),"click",this._observer);
if(this.eMap&&this.eMap.controls&&this.eMap.controls["zoom"]){
this.eMap.controls["zoom"].disableZoomMenu();
}
this.enabled=true;
};
ClickListener.prototype._off=function(){
Event.stopObserving($(this.eMap.sourceMap.viewport),"click",this._observer);
if(this.eMap&&this.eMap.controls&&this.eMap.controls["zoom"]){
this.eMap.controls["zoom"].enableZoomMenu();
}
this.enabled=false;
};
ClickListener.prototype._clickEventHandler=function(e){
var cl=this.eMap.sourceMap.getCurrentLocationPx();
var _5=this.eMap.sourceMap.viewport;
var _6=Position.cumulativeOffset(_5);
var x=cl.x+Event.pointerX(e)-((eWidth(_5)/2)+_6[0]);
var y=cl.y-Event.pointerY(e)+((eHeight(_5)/2)+_6[1]);
var _9=new ClickedCoord(this.eMap,new PxCoord(parseInt(x),parseInt(y)));
this.onMapClicked(_9,this.eMap);
};
ClickListener.prototype.toggleListening=function(){
if(this.enabled){
this._off();
}else{
this._on();
}
};
ClickListener.prototype.startListening=function(){
this._on();
};
ClickListener.prototype.stopListening=function(){
this._off();
};
ClickListener.prototype.onMapClicked=function(_a,_b){
alert("clicked:  x = "+_a.toWgs84.x+", y = "+_a.toWgs84.y);
};
function ClickedCoord(_c,_d){
this.eMap=_c;
this.pxCoord=_d;
};
ClickedCoord.prototype.toWgs84=function(){
return this.eMap.sourceMap.getGeoCoord(this.pxCoord);
};
ClickedCoord.prototype.toRt90=function(){
var _e=new Rt90Converter();
return _e.fromWgs84(this.eMap.sourceMap.getGeoCoord(this.pxCoord));
};
function EMap(_f){
EMap._assertNotNullArgument(_f,"container");
this.showMapCalled=false;
this.controls=new Array();
this.listeners=new Array();
this.widgets=new Array();
EMap._init();
this.sourceMap=new EniMap(_f);
this.layercount=0;
};
EMap.prototype={showMap:function(_10){
this.showMapCalled=true;
if(Settings.getSetting("WIDGET.logo")){
this.sourceMap.addEventListener(new LogoWidget());
}
this.sourceMap.showMap(_10);
},changeTheme:function(_11){
this.sourceMap.containerElement.removeClassName(this.theme);
this.sourceMap.containerElement.addClassName(_11);
this.theme=_11;
},enableBullsEyeMarker:function(_12){
this._assertShowMapNotCalled("showBullsEyeMarker");
this.listeners["bullsEyeMarker"]=new BullsEyeMarkerListener(_12);
this.sourceMap.addEventListener(this.listeners["bullsEyeMarker"]);
},enableOverwiewMapWidget:function(_13){
this._assertShowMapNotCalled("enableOverwiewMapWidget");
var _14=true;
if(_13&&_13["openByDefault"]!=undefined){
_14=_13["openByDefault"];
}
Settings.setSetting("EOMWA.openedByDefault",{oblique:_14,standard:_14,aerial:_14,hybrid:_14,nautical:_14});
this.widgets["overviewMap"]=new EniOverviewMapWidgetAdapter();
this.sourceMap.addEventListener(this.widgets["overviewMap"]);
this.enableZoomWidget();
},enableZoomWidget:function(){
this._assertShowMapNotCalled("enableZoomWidget");
if(!this.widgets["zoombar"]&&!this.widgets["navigator"]){
this.widgets["zoombar"]=new EniZoomBarWidgetAdapter();
this.widgets["navigator"]=new EniMapNavigatorWidgetAdapter();
this.sourceMap.addEventListener(this.widgets["zoombar"]);
this.sourceMap.addEventListener(this.widgets["navigator"]);
}
},enableCompanySearchWidget:function(){
this._assertShowMapNotCalled("enableCompanySearchWidget");
this.sourceMap.addEventListener(new CompanySearchView("searchResults"));
var _15=new SymbolView("searchResults",true);
_15.showCalloutOnClick=true;
this.sourceMap.addEventListener(_15);
this.sourceMap.addEventListener(new SearchController("searchResults").init(Settings.getSetting("SW.searchUrl"),Settings.getSetting("JSONT.defaultTimeout")));
},enableZoomControl:function(_16){
this._assertShowMapNotCalled("enableZoomControl");
this.controls["zoom"]=new ZoomCtrlsEgo(this.sourceMap);
if(_16&&!_16["zoomOnScroll"]){
this.controls["zoom"].disableMouseWheelZoom();
}
this.sourceMap.addEventListener(this.controls["zoom"]);
},enableDWD:function(){
this._assertShowMapNotCalled("enableZoomControl");
var _17=this.controls["zoom"];
if(!_17){
throw "Zoom controller is not enabled!";
}
this.sourceMap.addEventListener(new DWDView({zoomCtrls:_17}));
},enableTileTypeWidget:function(_18){
this._assertShowMapNotCalled("enableTileTypeWidget");
if(!_18){
_18=["aerial","hybrid","standard"];
}
var ttw=new TileTypeWidget(_18);
var _1a=this.sourceMap;
this.sourceMap.addEventListener(ttw);
this.sourceMap.addEventListener(new TileTypeAreaSwitcher());
this.sourceMap.addEventListener(new DataMissingListener());
_18.each(function(_1b){
if(_1b=="oblique"){
_1a.addEventListener(new ObliqueListener(ttw));
_1a.addEventListener(new ObliqueInfoSwitcher(_1a,70));
return;
}else{
if(_1b=="nautical"){
_1a.addEventListener(new NauticalListener(ttw));
}
}
});
},enableClickListener:function(){
return new ClickListener(this);
},closeAllCallouts:function(){
this.sourceMap.fireMapEvent(Events.CLOSE_ALL_CALLOUTS_EVENT);
},addPoi:function(_1c,_1d){
if(!this.listeners["poi"]){
debug(this);
this.listeners["poi"]=new PoiListener(this);
this.sourceMap.addEventListener(this.listeners["poi"]);
}
if(this.showMapCalled){
return this.listeners["poi"].addSinglePoi(_1c,_1d);
}else{
this.listeners["poi"].add(_1c,_1d);
}
},clearPois:function(_1e){
if(!_1e){
throw "layerName is not passed";
}
this.sourceMap.fireMapEvent(Events.CLEAR_POIS_EVENT,[_1e]);
},clearPoi:function(poi){
this.sourceMap.fireMapEvent(Events.CLEAR_POI_EVENT,[poi]);
},setMapState:function(_20){
this.sourceMap.setMapState(_20);
},getMapState:function(){
return this.sourceMap.getMapState();
},addPlace:function(_21){
var _22=function(){
var _23=new Place(_21);
var _24=this.sourceMap.getDefaultPlaceLayer();
_24.clear();
_24.addPlace(_23);
};
if(this.sourceMap.getDefaultPlaceLayer()){
_22.apply(this);
}else{
function PlaceListener(){
};
PlaceListener.prototype.initEvent=_22;
this.sourceMap.addEventListener(new PlaceListener());
}
},clearPlaces:function(){
this.sourceMap.getDefaultPlaceLayer().clear();
},setLayerOptions:function(_25,_26){
if(!this.listeners["poi"]){
this.listeners["poi"]=new PoiListener(this);
this.sourceMap.addEventListener(this.listeners["poi"]);
}
this.listeners["poi"].setLayerOptions(_25,_26);
},getLayer:function(_27){
return this.listeners["poi"]?this.listeners["poi"].getLayer(_27):null;
},enableKeyNavigation:function(){
this.addEventListener(new KeyNavController());
},enableSplinx:function(_28,_29){
this.sourceMap.addEventListener(new SplinxView("splinxView"));
this.sourceMap.addEventListener(new SplinxController("splinxView",_28,_29));
},addPoiFeed:function(_2a,_2b){
this._assertShowMapNotCalled("addFeed");
this.layercount++;
var _2c=new OnSetupPOIController("emapLayer"+this.layercount).init(_2a,Settings.getSetting("JSONT.defaultTimeout"),"UTF-8");
var sv=new SymbolView("emapLayer"+this.layercount,true);
_2b=_2b||{};
sv.poiType=_2b.poiType!=undefined?_2b.poiType:"";
sv.poiLayout=_2b.poiLayout!=undefined?_2b.poiLayout:"";
sv.openFirstCallout=_2b.openFirstCallout!=undefined?_2b.openFirstCallout:true;
sv.clearPointsBeforeZoom=_2b.clearPointsBeforeZoom!=undefined?_2b.clearPointsBeforeZoom:true;
sv.useShadows=_2b.useShadows!=undefined?_2b.useShadows:true;
sv.showCalloutOnMouseOver=_2b.showCalloutOnMouseOver!=undefined?_2b.showCalloutOnMouseOver:true;
sv.showCalloutOnClick=_2b.showCalloutOnClick!=undefined?_2b.showCalloutOnClick:true;
sv.useLabel=_2b.useLabel!=undefined?_2b.useLabel:true;
if(_2b["iconHandler"]){
this._registerIconHandler(_2b["iconHandler"]);
}
if(_2b["symbolHandler"]){
sv.symbolHandler=_2b["symbolHandler"];
}
this.sourceMap.addEventListener(_2c);
this.sourceMap.addEventListener(sv);
},addEventListener:function(_2e){
this.sourceMap.addEventListener(_2e);
},autoResize:function(){
EniUtil.resizeToParent(this.sourceMap.containerElement,this.sourceMap);
Event.observe(document.onresize?document:window,"resize",function(){
EniUtil.resizeToParent(this.sourceMap.containerElement,this.sourceMap);
}.bind(this));
},adjust:function(_2f){
var _30=_2f[0];
var _31=function(){
var _32=this.sourceMap.getLayer(_30);
_32.adjustMap();
};
if(this.sourceMap.getLayer(_30)){
_31.apply(this);
}else{
function AdjustListener(){
};
AdjustListener.prototype.initEvent=_31;
this.sourceMap.addEventListener(new AdjustListener());
}
},jumpTo:function(_33,_34){
var _35=_34["zoomLevel"];
var _36=_34["tryToSlide"];
var _37=_34["boundingBox"];
this.sourceMap.panToGeoCoord(_33,_35,_36,_37);
},fillScreen:function(_38,_39){
_38=_38?_38:0;
_39=_39?_39:0;
Event.observe(document.onresize?document:window,"resize",function(){
EniUtil.partnerSize(this.sourceMap.containerElement,_38,_39);
}.bind(this));
EniUtil.partnerSize(this.sourceMap.containerElement,_38,_39);
},getCenter:function(){
return this.sourceMap.getCurrentLocation();
},_registerIconHandler:function(f){
POI.prototype.createIconDOM=function(_3b){
var _3c=EniDOMUtils.addSpan({attributes:{"class":"icon"},parent:_3b});
this.iconContainer=EniDOMUtils.addSpan({attributes:{"class":"container","style":"z-index:400"},parent:_3c});
f(this.iconContainer,this);
};
},_assertShowMapNotCalled:function(_3d){
if(this.showMapCalled){
throw "Method "+_3d+" should be called before showMap";
}
}};
EMap._init=function(){
if(Settings.getSetting("TRANSPORT.httpMethod")!="GET"){
return;
}
DWREngine.setRpcType(dwr.engine.ScriptTag);
Settings.setSetting("TilesService.path","http://maps.eniro.com/servlets/dwr-invoker");
Settings.setSetting("LW.imagePath","http://maps.eniro.com/enimap2/images/eniro_logo.gif");
};
EMap._assertNotNullArgument=function(arg,_3f){
if(!arg){
throw "Argument "+_3f+" must be defined";
}
};
function EMapOptions(){
this.center=undefined;
this.zoomLevel=undefined;
this.tileType=undefined;
};
function JumpToOptions(){
this.zoomLevel=undefined;
this.tryToSlide=undefined;
};
function Loader(){
};
Loader.prototype={host:"http://maps.eniro.com",_cssFiles:function(){
document.write("<link rel='stylesheet' href='http://kartor.eniro.se/mapapi/enimap2/style/enimap_all_c.css?ver=09_w25' type='text/css' media='all'/>");
document.write("<!--[if IE]>");
document.write("<link rel='stylesheet' href='http://kartor.eniro.se/mapapi/enimap2/style/enimap_all_c.ie.css?ver=09_w25' type='text/css' media='all'/>");
document.write("<![endif]-->");
},_jsFiles:function(){
if(typeof Prototype=="undefined"){
document.write("<script type='text/javascript' src='http://kartor.eniro.se/scripts/lib/prototype.js?ver=09_w25'></script>");
}
document.write("<script type='text/javascript' src='http://maps.eniro.com/servlets/dwr-invoker/engine.js?ver=09_w25'></script>");
document.write("<script type='text/javascript' src='http://maps.eniro.com/servlets/dwr-invoker/interface/TilesService.js?ver=09_w25'></script>");
if(typeof jsGraphics=="undefined"&&navigator.appName.indexOf("Microsoft")==-1){
document.write("<script type='text/javascript' src='http://maps.eniro.com/enimap2/js/lib/wz_jsgraphics.js?ver=09_w25'></script>");
}
document.write("<script type='text/javascript' src='http://maps.eniro.com/enimap2/js/enimap_all_c.js?ver=09_w25'></script>");
},_inlineCssBugFix:function(){
var str="<style type=\"text/css\">"+"#mapWrap h1 {"+"position:absolute;"+"top:6px;"+"left:6px;"+"background:url(http://kartor.eniro.se/mapapi/enimap2/images/white_background_with_shade.png) no-repeat 100% 100%;"+"margin:0;"+"padding:0 2px 2px 0;"+"}"+"#mapWrap h1 a,"+"#mapWrap h1 img {"+"display:block;"+"border:0;"+"}"+"#mapWrap h1 a {"+"margin:1px;"+"}"+".eye .container {"+"background:url(http://kartor.eniro.se/mapapi/enimap2/images/points/pins/bullseye.png) no-repeat 0 0;"+"}"+".shadow .container {"+"background:url(http://kartor.eniro.se/mapapi/enimap2/images/points/pins/shadow.png) no-repeat 0 0;"+"}"+"/* THE DIFFERENT TILE TYPES */"+"#tileTypeWrapper {"+"    position:absolute;"+"    top:6px;"+"    right:6px;"+"    background:url( http://kartor.eniro.se/mapapi/enimap2/images/white_background_with_shade.png ) no-repeat 100% 100%;"+"    padding:0 2px 2px 0;"+"}"+"#tileType {"+"    position:static;"+"    float:left;"+"    margin:0;"+"    padding:0;"+"}"+"#tileType li {"+"    background: #fff;"+"    border:1px solid #fff;"+"    border-width: 1px 0 1px 1px;"+"    float:left;"+"    margin:0;"+"    padding:0;"+"    display:block;"+"    list-style:none;"+"}"+"#tileType li#standard {"+"    border-right-width:1px;"+"}"+"#mapWrap #tileType a,"+"#mapWrap #tileType a:link,"+"#mapWrap #tileType a:visited {"+"    display:block;"+"    color:#0f3244;"+"    padding:3px 1em;"+"    background:#deedee;"+"    border:1px solid #deedee;"+"    border-left-color:#b1c3c7;"+"    line-height:1;"+"}"+"#mapWrap #tileType a:hover {"+"    background:#fff;"+"}"+"#mapWrap #tileType #oblique a {"+"    border-left-color:#deedee;"+"}"+"#mapWrap #tileType .active {"+"    background:#fff;"+"}"+"#mapWrap #tileType .active a,"+"#mapWrap #tileType .active a:link,"+"#mapWrap #tileType .active a:visited {"+"    color:#000;"+"    background:#fff;"+"    border-color:#deedee #fff #fff #deedee;"+"}"+"#mapWrap #tileType .active a:hover,"+"#mapWrap #tileType .active a:focus {"+"    /*font-weight:normal;*/"+"}"+"#mapWrap #tileType .no-oblique a {"+"    text-decoration:none;"+"}"+"/* Oblique images locations */"+"#oblique .tooltip {"+"    background-color:#fff;"+"    border:1px solid #939091;"+"    color:#000000;"+"    display:none;"+"    font-size:11px;"+"    left:0px;"+"    opacity:0.9;"+"    padding:2px;"+"    position:absolute;"+"    top:24px;"+"    width:120px;"+"    z-index:1010;"+"}"+"#oblique .tooltip .major {"+"    margin-bottom:11px"+"}"+"</style>"+"<!--[if gte IE 5.5]>"+"<![if lt IE 7]>"+"<style type=\"text/css\">"+"#tileTypeWrapper {"+"background:url(http://www.eniro.se/cimg/transparent_1x1.gif);"+"filter:progid:DXImageTransform.Microsoft.Shadow(color=#999999, direction=135, strength=2);"+"}"+".yp .container {"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/points/pins/yp.png\", sizingMethod=\"crop\");"+"background-image:url(http://www.eniro.se/cimg/transparent_1x1.gif);"+"}"+".eye .container {"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/points/pins/bullseye.png\", sizingMethod=\"crop\");"+"background-image:url(http://www.eniro.se/cimg/transparent_1x1.gif);"+"}"+".shadow .container {"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/points/pins/shadow.png\", sizingMethod=\"crop\");"+"background-image:url(http://www.eniro.se/cimg/transparent_1x1.gif);"+"}"+"#mapWrap #right-arrow.inactive {"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/overview-map/compass-east-off.png\", sizingMethod=\"scale\");"+"}"+"#mapWrap #top-arrow {"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/overview-map/compass-south-on.png\", sizingMethod=\"scale\");"+"}"+"#mapWrap #top-arrow.inactive {"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/overview-map/compass-south-off.png\", sizingMethod=\"scale\");"+"}"+"#mapWrap #right-arrow {"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/overview-map/compass-east-on.png\", sizingMethod=\"scale\");"+"}"+"#mapWrap #right-arrow.inactive {"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/overview-map/compass-east-off.png\", sizingMethod=\"scale\");"+"}"+"#mapWrap #bottom-arrow {"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/overview-map/compass-north-on.png\", sizingMethod=\"scale\");"+"}"+"#mapWrap #bottom-arrow.inactive {"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/overview-map/compass-north-off.png\", sizingMethod=\"scale\");"+"}"+"#mapWrap #left-arrow {"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/overview-map/compass-west-on.png\", sizingMethod=\"scale\");"+"}"+"#mapWrap #left-arrow.inactive {"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/overview-map/compass-west-off.png\", sizingMethod=\"scale\");"+"}"+".callout .ie-png-fix {"+"margin-top:-26px;"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/callout/callout-bottom.png\", sizingMethod=\"scale\");"+"background-image:url(http://maps.eniro.com/enimap2/images/transparent_1x1.gif);"+"height:51px;"+"z-index:6666;"+"}"+".yp-callout .ie-png-fix {"+"margin-top:-26px;"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/callout/callout-bottom-p09.png\", sizingMethod=\"scale\");"+"background-image:url(http://maps.eniro.com/enimap2/images/transparent_1x1.gif);"+"height:51px;"+"z-index:6666;"+"}"+".yp-callout h3 {"+"background-image:url(/mapapi/enimap2/images/transparent_1x1.gif);"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/callout/callout-top-p09.png\", sizingMethod=\"crop\");"+"}"+".callout .close {"+"background-image:url(/mapapi/enimap2/images/transparent_1x1.gif);"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"http://maps.eniro.com/enimap2/images/callout/callout-close.png\", sizingMethod=\"crop\");"+"}"+"</style>"+"<![endif]>"+"<![endif]-->";
document.write(str);
},allFiles:function(){
this._cssFiles();
this._jsFiles();
}};
new Loader().allFiles();
function PoiListener(_41){
this.sourceMap=_41.sourceMap;
this.symbolViews={};
this.layerNames=[];
};
PoiListener.prototype.initEvent=function(){
for(var i=0;i<this.layerNames.length;i++){
var ln=this.layerNames[i];
var sv=this.symbolViews[ln];
this.sourceMap.fireMapEvent(Events.POIS_LOADED_EVENT,[sv.layerName,{pois:sv["poiDefinitions"]}]);
}
};
PoiListener.prototype.addSinglePoi=function(_45,_46){
_46=_46||{};
var _47=_46.layerName||"default";
var _48=[{coords:_45,props:_46}];
var sv=this._getOrCreateSymbolView(_47);
sv.clearOldPois=false;
this.sourceMap.fireMapEvent(Events.POIS_LOADED_EVENT,[_47,{pois:_48}]);
return sv.getPoi(_46["id"]);
};
PoiListener.prototype.add=function(_4a,_4b){
_4b=_4b||{};
var _4c=_4b.layerName||"default";
var sv=this._getOrCreateSymbolView(_4c);
sv.showCalloutOnClick=true;
sv["poiDefinitions"].push({coords:_4a,props:_4b});
};
PoiListener.prototype.setLayerOptions=function(_4e,_4f){
var sv=this._getOrCreateSymbolView(_4e);
for(var p in _4f){
if(typeof _4f[p]!="function"){
this._setIfNotUndefined(_4f,p,sv);
}
}
};
PoiListener.prototype._getOrCreateSymbolView=function(_52){
var sv=this.symbolViews[_52];
if(!sv){
sv=new SymbolView(_52);
this.layerNames.push(_52);
this.symbolViews[_52]=sv;
this.sourceMap.addEventListener(sv);
sv["poiDefinitions"]=[];
this.layerNames.push(_52);
}
return sv;
};
PoiListener.prototype.getLayer=function(_54){
return this._getOrCreateSymbolView(_54).layer;
};
PoiListener.prototype._setIfNotUndefined=function(_55,key,_57){
if(_55[key]!=undefined){
_57[key]=_55[key];
}
};
function SymbolViewOptions(){
this.useShadows=true;
this.showCalloutOnMouseOver=false;
this.showCalloutOnClick=false;
this.useLabel=true;
this.clearPointsBeforeZoom=false;
this.openFirstCallout=false;
this.poiLayout="ego";
this.poiType="yp";
this.hoverPoiOnMouseOver=true;
this.iconHandler=undefined;
this.symbolHandler=undefined;
};
function Wgs84Coord(x,y){
this.x=x;
this.y=y;
this.crs="wgs84";
};

