function GetTileUrl_Mapnik(b,c){return"http://tile.openstreetmap.org/"+c+"/"+b.x+"/"+b.y+".png"}function GetTileUrl_Cyclemap(b,c){return"http://www.thunderflames.org/tiles/cycle/"+c+"/"+b.x+"/"+b.y+".png"}function parseHexColor(e){var d=parseHex(e.substr(0,2));var c=parseHex(e.substr(2,2));var a=parseHex(e.substr(4,2));return{r:d,g:c,b:a}}function parseHex(d){var a=0;var b=0;d=d.toLowerCase();for(var e=0;e<d.length;e++){var c=d.charAt(e);switch(c){case"a":c=10;break;case"b":c=11;break;case"c":c=12;break;case"d":c=13;break;case"e":c=14;break;case"f":c=15;break;default:c=parseInt(c);break}b+=c*Math.pow(16,d.length-(a+1));a++}return b}function MapApi(a,b){this.api=b;this.map=null;this.ge=null;this.loaded=false;this.markers=[];this.overlays={};this.shapes=[];this.lines=[];this.mapElement=document.getElementById(a);this.addApi(this.mapElement,b)}MapApi.prototype.addApi=function(a,c){switch(c){case"google":if(GMap2){if(GBrowserIsCompatible()){this.map=new GMap2(a);this.loaded=true;this.map.enableDoubleClickZoom();this.map.enableScrollWheelZoom();this.map.enableContinuousZoom();this.map.addMapType(G_PHYSICAL_MAP);var d=new GCopyright(1,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),0,'(<a rel="license" href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>)');var f=new GCopyrightCollection('Kartendaten &copy; 2009 <a href="http://www.openstreetmap.org/">OpenStreetMap</a> Contributors');f.addCopyright(d);var e=[new GTileLayer(f,1,18)];e[0].getTileUrl=GetTileUrl_Mapnik;e[0].isPng=function(){return true};e[0].getOpacity=function(){return 1};var i=new GMapType(e,G_SATELLITE_MAP.getProjection(),"OpenStreet",{urlArg:"mapnik",linkColor:"#000000"});this.map.addMapType(i);this.map.addControl(new GMenuMapTypeControl())}else{alert("browser not compatible with Google Maps")}}else{alert("Google map script not imported")}break;case"microsoft":if(VEMap){a.style.position="relative";var b=0;var h="Firefox/";var g=navigator.userAgent.indexOf(h);if(g!=-1){b=parseFloat(navigator.userAgent.substring(g+h.length))}if(b>=1.5||window.opera){Msn.Drawing.Graphic.CreateGraphic=function(k,j){return new Msn.Drawing.SVGGraphic(k,j)}}this.map=new VEMap(a.id);this.map.LoadMap();this.map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);this.map.ClearInfoBoxStyles();this.loaded=true}else{alert("Virtual Earth map script not imported")}break}};MapApi.prototype.getEarthInstanceCB=function(a){doStuffWithEarth(a)};MapApi.prototype.registerEvent=function(a,b){switch(this.api){case"google":switch(a){case"onclick":GEvent.addListener(this.map,"onclick",b);break;case"movestart":GEvent.addListener(this.map,"movestart",b);break;case"moveend":GEvent.addListener(this.map,"moveend",b);break;case"zoomend":GEvent.addListener(this.map,"zoomend",b);break;case"onchangemapstyle":GEvent.addListener(this.map,"maptypechanged",b);break;case"mouseover":GEvent.addListener(this.map,"mouseover",b);break;case"mouseout":GEvent.addListener(this.map,"mouseout",b);break;case"onbubbleclose":GEvent.addListener(this.map,"infowindowclose",b);break}break;case"microsoft":switch(a){case"onmousemove":this.map.AttachEvent("onmousemove",b);break;case"onclick":this.map.AttachEvent("onclick",b);break;case"moveend":this.map.AttachEvent("onendpan",b);break;case"movestart":this.map.AttachEvent("onstartpan",b);break;case"zoomend":this.map.AttachEvent("onendzoom",b);case"onchangemapstyle":this.map.AttachEvent("onchangemapstyle",b);break}break}};MapApi.prototype.hideControls=function(){switch(this.api){case"google":this.map.hideControls();break;case"microsoft":this.map.HideDashboard();break}};MapApi.prototype.showControls=function(){switch(this.api){case"google":this.map.showControls();break;case"microsoft":break}};MapApi.prototype.getCenter=function(){switch(this.api){case"google":var a=this.map.getCenter();return new LatLonPoint(a.lat(),a.lng());break;case"microsoft":var a=this.map.GetCenter();return new LatLonPoint(a.Latitude,a.Longitude);break}};MapApi.prototype.setCenter=function(a){switch(this.api){case"google":this.map.setCenter(a.toGoogle());break;case"microsoft":this.map.SetCenter(a.toMicrosoft());break}};MapApi.prototype.getZoom=function(){switch(this.api){case"google":return this.map.getZoom();case"microsoft":return this.map.GetZoomLevel()}};MapApi.prototype.getBounds=function(){switch(this.api){case"google":var a=this.map.getBounds();sw=a.getSouthWest();ne=a.getNorthEast();return new BoundingBox(sw.lat(),sw.lng(),ne.lat(),ne.lng());case"microsoft":var b=this.map.GetMapView();nw=b.TopLeftLatLong;se=b.BottomRightLatLong;return new BoundingBox(se.Latitude,nw.Longitude,nw.Latitude,se.Longitude)}};MapApi.prototype.zoomToBounds=function(b){switch(this.api){case"google":var e=new GLatLngBounds();for(var c=0;c<b.length;c++){if(b[c].type=="line"){b[c]=b[c].toGoogle();var a=b[c].getBounds();e.extend(a.getSouthWest());e.extend(a.getNorthEast())}if(b[c].type=="marker"){b[c]=b[c].toGoogle();e.extend(b[c].getLatLng())}}var d=16;if(this.map.getBoundsZoomLevel(e)<16){d=this.map.getBoundsZoomLevel(e)}this.map.setZoom(d);this.map.panTo(e.getCenter());break;case"microsoft":for(var c=0;c<b.length;c++){b[c]=b[c].toMicrosoft()}this.map.SetMapView(b);break}};MapApi.prototype.setCenterAndZoom=function(a,b){switch(this.api){case"google":this.map.setCenter(a.toGoogle(),b);break;case"microsoft":this.map.SetCenterAndZoom(a.toMicrosoft(),b);break}};MapApi.prototype.panToAndZoom=function(a,b){switch(this.api){case"google":this.map.panTo(a.toGoogle(),b);break;case"microsoft":this.map.SetCenterAndZoom(a.toMicrosoft(),b);break}};MapApi.prototype.searchMapType=function(b){m=this.map.getMapTypes();for(var a=0;a<m.length;a++){if(m[a].getName()==b){result=m[a]}}return result};MapApi.prototype.setMapType=function(a){switch(this.api){case"google":switch(a){case"ROAD":this.map.setMapType(G_NORMAL_MAP);break;case"SATELLITE":this.map.setMapType(G_SATELLITE_MAP);break;case"HYBRID":this.map.setMapType(G_HYBRID_MAP);break;case"PHYSICAL":this.map.setMapType(G_PHYSICAL_MAP);break;case"OSM":this.map.setMapType(this.searchMapType("OpenStreet"));break;case"EARTH":this.map.setMapType(G_SATELLITE_3D_MAP);break;case"TK50":this.map.setMapType(this.searchMapType("TK50"));break;case"DOK":this.map.setMapType(this.searchMapType("DOK"));break;case"DOP":this.map.setMapType(this.searchMapType("DOP"));break;default:this.map.setMapType(G_NORMAL_MAP);break}break;case"microsoft":switch(a){case"ROAD":this.map.SetMapStyle(VEMapStyle.Road);break;case"SATELLITE":this.map.SetMapStyle(VEMapStyle.Aerial);break;case"HYBRID":this.map.SetMapStyle(VEMapStyle.Hybrid);break;case"PHYSICAL":this.map.SetMapStyle(VEMapStyle.Shaded);break;case"BIRDSEYE":this.map.SetMapStyle(VEMapStyle.Birdseye);break;default:this.map.SetMapStyle(VEMapStyle.Road);break}break}};MapApi.prototype.getMapType=function(){switch(this.api){case"google":type=this.map.getCurrentMapType();switch(type){case G_NORMAL_MAP:return"ROAD";case G_SATELLITE_MAP:return"SATELLITE";case G_HYBRID_MAP:return"HYBRID";case G_PHYSICAL_MAP:return"PHYSICAL";case this.map.getMapTypes()[4]:return"OSM";case G_SATELLITE_3D_MAP:return"EARTH";case this.searchMapType("TK50"):return"TK50";case this.searchMapType("DOK"):return"DOK";case this.searchMapType("DOP"):return"DOP";default:return null}break;case"microsoft":type=this.map.GetMapStyle();switch(type){case VEMapStyle.Road:return"ROAD";case VEMapStyle.Aerial:return"SATELLITE";case VEMapStyle.Hybrid:return"HYBRID";case VEMapStyle.Shaded:return"PHYSICAL";case VEMapStyle.Birdseye:return"BIRDSEYE";default:return null}break}};MapApi.prototype.getMapTypes=function(){switch(this.api){case"google":return this.map.getMapTypes();break;case"microsoft":break}};MapApi.prototype.addLargeControls=function(b){switch(this.api){case"google":this.map.addControl(new GOverviewMapControl());this.map.addControl(new GLargeMapControl());var a={buttonStartingStyle:{display:"block",color:"black",background:"white",width:"7em",textAlign:"center",fontFamily:"Verdana",fontSize:"11px",border:"1px solid gray",paddingBottom:"1px",cursor:"pointer"},buttonHTML:"Zoom auf Ausschnitt",buttonZoomingHTML:"Bitte mit der Maus Karten-Ausschnitt w&auml;hlen (zum abbrechen hier klicken)",buttonZoomingStyle:{background:"yellow"},backButtonHTML:"zur&uuml;ck",backButtonStyle:{display:"none",marginTop:"3px",background:"#FFFFC8"},backButtonEnabled:true};this.map.addControl(new DragZoomControl({},a,{}),new GControlPosition(G_ANCHOR_BOTTOM_LEFT,new GSize(7,45)));this.map.addControl(new GScaleControl());this.map.addControl(new MoreControl());this.map.addControl(new GNavLabelControl());break;case"microsoft":break}};MapApi.prototype.resizeTo=function(c,b){switch(this.api){case"google":var a=this.map.getCenter();this.mapElement.style.width=c+"px";this.mapElement.style.height=b+"px";this.map.checkResize();this.map.setCenter(a);break;case"microsoft":this.map.Resize(c,b);break}};MapApi.prototype.addMarker=function(a){switch(this.api){case"google":var b=a.toGoogle();a.setChild(b);this.map.addOverlay(b);this.markers.push(a);GEvent.addListener(b,"mouseover",function(f){if(a.onmouseover){a.onmouseover(f)}});GEvent.addListener(b,"mouseout",function(f){if(a.onmouseout){a.onmouseout(f)}});GEvent.addListener(b,"click",function(f){if(a.onclick){a.onclick(f)}});break;case"microsoft":var c=a.toMicrosoft();a.setChild(c);this.map.AddShape(c);this.markers.push(a);var d=this.map;this.map.AttachEvent("onclick",function(e){if(d.GetShapeByID(e.elementID)==c){if(a.onclick){a.onclick()}}});break}};MapApi.prototype.removeMarker=function(a){var c=[];while(this.markers.length>0){var b=this.markers.pop();if(a==b){switch(this.api){case"google":this.map.removeOverlay(a.proprietary_marker);break;case"microsoft":this.map.DeleteShape(a.proprietary_marker);break}a.onmap=false;break}else{c.push(b)}}this.markers=this.markers.concat(c)};MapApi.prototype.addLine=function(a){switch(this.api){case"google":var b=a.toGoogle();a.setChild(b);this.map.addOverlay(b);this.lines.push(a);GEvent.addListener(b,"click",function(f){if(a.onclick){a.onclick(f)}});GEvent.addListener(b,"mouseover",function(f){if(a.onmouseover){a.onmouseover(f)}});GEvent.addListener(b,"mousemove",function(f){if(a.onmousemove){a.onmousemove(f)}});GEvent.addListener(b,"mouseout",function(f){if(a.onmouseout){a.onmouseout(f)}});break;case"microsoft":var c=a.toMicrosoft();a.setChild(c);this.map.AddShape(c);var d=this.map;if(a.title){this.map.AttachEvent("onmousemove",function(e){if(d.GetShapeByID(e.elementID)==c){if(a.onmousemove){a.onmousemove(e)}}});this.map.AttachEvent("onmouseout",function(e){if(d.GetShapeByID(e.elementID)==c){if(a.onmouseout){a.onmouseout(e)}}});this.map.AttachEvent("onclick",function(e){if(d.GetShapeByID(e.elementID)==c){if(a.onclick){a.onclick(e)}}})}this.lines.push(a);break}};MapApi.prototype.removeLine=function(a){var c=[];while(this.lines.length>0){var b=this.lines.pop();if(b==a){switch(this.api){case"google":this.map.removeOverlay(a.proprietary_line);break;case"microsoft":this.map.DeleteShape(a.proprietary_line);break}}else{c.push(b)}}this.lines=this.lines.concat(c)};MapApi.prototype.addOverlay=function(a){switch(this.api){case"google":this.map.addOverlay(a);break;case"microsoft":break;default:if(this.debug){alert(this.api+" not supported by Mapstraction.addOverlay")}break}};MapApi.prototype.removeOverlay=function(a){switch(this.api){case"google":this.map.removeOverlay(a);break;case"microsoft":alert("nicht implementiert");break}};MapApi.prototype.getOverlayShapes=function(a){switch(this.api){case"microsoft":return this.shapes[a];break;case"google":return this.shapes[a];break}};MapApi.prototype.getOverlay=function(a){return this.overlays[a]};MapApi.prototype.getMap=function(){return this.map};MapApi.prototype.dispose=function(){switch(this.api){case"microsoft":return this.map.Dispose();break;case"google":break}};function LatLonPoint(a,b){this.lat=a;this.lon=b;this.lng=b}LatLonPoint.prototype.toGoogle=function(){return new GLatLng(this.lat,this.lon)};LatLonPoint.prototype.toMicrosoft=function(){return new VELatLong(this.lat,this.lon)};LatLonPoint.prototype.toString=function(){return this.lat+", "+this.lon};LatLonPoint.prototype.distance=function(b){var c,a;a=0.017453292519943295;c=Math.cos(b.lon*a-this.lon*a)*Math.cos(b.lat*a-this.lat*a);return Math.acos(c)*6378.137};LatLonPoint.prototype.equals=function(a){return this.lat==a.lat&&this.lon==a.lon};function BoundingBox(a,b,c,d){this.sw=new LatLonPoint(a,b);this.ne=new LatLonPoint(c,d)}BoundingBox.prototype.getSouthWest=function(){return this.sw};BoundingBox.prototype.getNorthEast=function(){return this.ne};BoundingBox.prototype.isEmpty=function(){return this.ne==this.sw};BoundingBox.prototype.contains=function(a){return a.lat>=this.sw.lat&&a.lat<=this.ne.lat&&a.lon>=this.sw.lon&&a.lon<=this.ne.lon};BoundingBox.prototype.toSpan=function(){return new LatLonPoint(Math.abs(this.sw.lat-this.ne.lat),Math.abs(this.sw.lon-this.ne.lon))};BoundingBox.prototype.extend=function(a){if(this.sw.lat>a.lat){this.sw.lat=a.lat}if(this.sw.lon>a.lon){this.sw.lon=a.lon}if(this.ne.lat<a.lat){this.ne.lat=a.lat}if(this.ne.lon<a.lon){this.ne.lon=a.lon}return};MapApi.prototype.addLabeledMarker=function(f,b,e,d){switch(this.api){case"google":var g=new GLatLng(f,b);var c=new GIcon();c.image=e;c.iconSize=new GSize(19,24);c.iconAnchor=new GPoint(5,25);c.infoWindowAnchor=new GPoint(25,7);opts={icon:c,clickable:false,labelText:String(d),labelOffset:new GSize(14,-23),labelClass:"poiLabel"};var a=new LabeledMarker(g,opts);this.map.addOverlay(a)}};function Marker(a){this.type="marker";this.api=false;this.location=a;this.onmap=false;this.proprietary_marker=false;this.attributes=[];this.pinID="mspin-"+new Date().getTime()+"-"+(Math.floor(Math.random()*Math.pow(2,16)));this.iconUrl=false;this.onclick=false;this.onmousemove=false;this.onmouseout=false;this.onmouseover=false;this.visible=true}Marker.prototype.getLocation=function(){return this.location};Marker.prototype.setChild=function(a){this.proprietary_marker=a;this.onmap=true};Marker.prototype.setLabel=function(a){this.labelText=a};Marker.prototype.addData=function(a){for(var b in a){switch(b){case"label":this.setLabel(a.label);break;case"infoBubble":this.setInfoBubble(a.infoBubble);break;case"icon":if(a.iconSize&&a.iconAnchor){this.setIcon(a.icon,a.iconSize,a.iconAnchor)}else{if(a.iconSize){this.setIcon(a.icon,a.iconSize)}else{this.setIcon(a.icon)}}break;case"printImage":this.setPrintImage(a.printImage);break;case"iconShadow":if(a.iconShadowSize){this.setShadowIcon(a.iconShadow,new Array(a.iconShadowSize[0],a.iconShadowSize[1]))}else{this.setIcon(a.iconShadow)}break;case"infoDiv":this.setInfoDiv(a.infoDiv[0],a.infoDiv[1]);break;case"draggable":this.setDraggable(a.draggable);break;case"hover":this.setHover(a.hover);case"hoverIcon":this.setHoverIcon(a.hoverIcon);break;case"openBubble":this.openBubble();break;case"groupName":this.setGroupName(a.groupName);break;default:this.setAttribute(b,a[b]);break}}};Marker.prototype.setInfoBubble=function(a){this.infoBubble=a};Marker.prototype.setInfoDiv=function(a,b){this.infoDiv=a;this.div=b};Marker.prototype.setIcon=function(c,a,b){this.iconUrl=c;if(a){this.iconSize=a}if(b){this.iconAnchor=b}};Marker.prototype.setIconSize=function(a){if(a){this.iconSize=a}};Marker.prototype.setIconAnchor=function(a){if(a){this.iconAnchor=a}};Marker.prototype.setPrintImage=function(a){if(a){this.printImage=a}};Marker.prototype.setShadowIcon=function(b,a){this.iconShadowUrl=b;if(a){this.iconShadowSize=a}};Marker.prototype.setHoverIcon=function(a){this.hoverIconUrl=a};Marker.prototype.setDraggable=function(a){this.draggable=a};Marker.prototype.setHover=function(a){this.hover=a};Marker.prototype.setGroupName=function(a){this.groupName=a};Marker.prototype.toGoogle=function(){var d={};if(this.labelText){d.title=this.labelText}if(this.iconUrl){var e=new GIcon(G_DEFAULT_ICON,this.iconUrl);if(this.iconSize){e.iconSize=new GSize(this.iconSize[0],this.iconSize[1]);var c;if(this.iconAnchor){c=new GPoint(-(-11+this.iconAnchor[0]),-(-14+this.iconAnchor[1]))}else{c=new GPoint(this.iconSize[0]/2,this.iconSize[1]/2)}e.iconAnchor=c}if(this.iconShadowUrl){e.shadow=this.iconShadowUrl;if(this.iconShadowSize){e.shadowSize=new GSize(this.iconShadowSize[0],this.iconShadowSize[1])}}if(this.printImage){e.printImage=this.printImage;e.mozPrintImage=this.printImage}d.icon=e}if(this.draggable){d.draggable=this.draggable}var f=new GMarker(this.location.toGoogle(),d);if(this.infoBubble){var a=this.infoBubble;var b;if(this.hover){b="mouseover"}else{b="click"}GEvent.addListener(f,b,function(){f.openInfoWindowHtml(a,{maxWidth:100})})}if(this.hoverIconUrl){GEvent.addListener(f,"mouseover",function(){f.setImage(this.hoverIconUrl)});GEvent.addListener(f,"mouseout",function(){f.setImage(this.iconUrl)})}if(this.infoDiv){var a=this.infoDiv;var g=this.div;var b;if(this.hover){b="mouseover"}else{b="click"}GEvent.addListener(f,b,function(){document.getElementById(g).innerHTML=a})}this.api="google";return f};Marker.prototype.toMicrosoft=function(){var a=new VEShape(VEShapeType.Pushpin,this.location.toMicrosoft());a.SetTitle(this.labelText);a.SetDescription(this.infoBubble);if(this.iconUrl){var b=new VECustomIconSpecification();b.CustomHTML="<img style='position:relative;margin-left:"+this.iconAnchor[0]+"px;margin-top:"+this.iconAnchor[1]+"px' src='"+this.iconUrl+"'></img>";b.Image=this.iconUrl;b.ImageOffset=new VEPixel(this.iconAnchor[0],this.iconAnchor[1]);b.TextContent="  ";a.SetCustomIcon(b)}this.api="microsoft";return a};Marker.prototype.setAttribute=function(a,b){this.attributes[a]=b};Marker.prototype.getAttribute=function(a){return this.attributes[a]};Marker.prototype.openBubble=function(){if(this.api){switch(this.api){case"google":var a=this.proprietary_marker;a.openInfoWindowHtml(this.infoBubble);break;case"microsoft":var b=this.proprietary_marker;var c=$m(this.pinID+"_"+this.maps[this.api].GUID).onmouseover;setTimeout(c,1000);break}}else{alert("You need to add the marker before opening it")}};Marker.prototype.hide=function(){this.visible=false;if(this.api){switch(this.api){case"google":this.proprietary_marker.hide();break;case"microsoft":this.proprietary_marker.Hide();break;default:alert(this.api+"not supported by Marker.hide");break}}};Marker.prototype.show=function(){this.visible=true;if(this.api){switch(this.api){case"google":this.proprietary_marker.show();break;case"microsoft":this.proprietary_marker.Show();break;default:alert(this.api+"not supported by Marker.show");break}}};function Line(){this.type="line";this.api=false;this.color="0000FF";this.alpha=1;this.width=2;this.points=[];this.proprietary_line=false;this.description="";this.title="";this.uid=0;this.onclick=false;this.onmousemove=false;this.onmouseout=false;this.onmouseover=false;this.visible=true;this.levels="PMP";this.numLevels=18;this.zoomFactor=2}Line.prototype.setTitle=function(a){this.title=a};Line.prototype.setDescription=function(a){this.description=a};Line.prototype.getLocation=function(){return this.points[0]};Line.prototype.setColor=function(c,b){this.color=c;this.alpha=b};Line.prototype.setWidth=function(a){this.width=a};Line.prototype.addPoint=function(a){this.points.push(a)};Line.prototype.setChild=function(a){this.proprietary_line=a};Line.prototype.setStrokeStyle=function(a,c,b){this.proprietary_line.setStrokeStyle({color:a,weight:c,opacity:b})};Line.prototype.openBubble=function(){if(this.api){switch(this.api){case"google":var a=this.proprietary_line;a.openInfoWindowTabsHtml([new GInfoWindowTab("Info",this.infoBubble),new GInfoWindowTab("tab2","Inhalt tab2")]);break;case"microsoft":break}}else{alert("You need to add the marker before opening it")}};Line.prototype.hide=function(){this.visible=false;switch(this.api){case"microsoft":this.proprietary_line.Hide();break;case"google":this.proprietary_line.hide();break}};Line.prototype.show=function(){this.visible=true;switch(this.api){case"microsoft":this.proprietary_line.Show();break;case"google":this.proprietary_line.show();break}};Line.prototype.toMicrosoft=function(){var c=[];for(var e=0;e<this.points.length;e++){if(this.points[e].toMicrosoft){var a=this.points[e].toMicrosoft();c.push(a)}}var b=new VEShape(VEShapeType.Polyline,c);b.SetLineWidth(this.width);var d=parseHexColor(this.color);b.SetLineColor(new VEColor(d.r,d.g,d.b,this.alpha));b.SetPoints(c);b.SetDescription(this.description);b.SetTitle(this.title);b.HideIcon();this.api="microsoft";return b};Line.prototype.toGoogle=function(){var e=[];for(var d=0;d<this.points.length;d++){var a=this.points[d].toGoogle();e.push(a)}var c=new PolylineEncoder(18,2,0.000001,true);var b=c.dpEncodeToGPolyline(e,"#"+this.color,this.width,this.alpha);this.api="google";return b};function OpacityControl(a){this.overlay=a}OpacityControl.prototype=new GControl();OpacityControl.prototype.setSlider=function(b){var a=Math.round((58*b));this.slide.left=a;this.knob.style.left=a+"px";this.knob.style.top="0px"};OpacityControl.prototype.setOpacity=function(){this.overlay.getTileLayer().opacity=this.slide.left/58;this.map.removeOverlay(this.overlay);this.map.addOverlay(this.overlay)};OpacityControl.prototype.initialize=function(e){var d=this;this.map=e;var c=navigator.userAgent.toLowerCase();if((c.indexOf("msie")>-1)&&(c.indexOf("opera")<1)){this.ie=true}else{this.ie=false}var b=document.createElement("div");b.style.width="70px";b.style.height="21px";if(this.ie){var a="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://www.maptiler.org/img/opacity-slider.png', sizingMethod='crop');";b.innerHTML='<div style="height:21px; width:70px; '+a+'" ></div>'}else{b.innerHTML='<div style="height:21px; width:70px; background-image:url(http://www.maptiler.org/img/opacity-slider.png)" ></div>'}if(this.ie){var a="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://www.maptiler.org/img/opacity-slider.png', sizingMethod='crop');";this.knob=document.createElement("div");this.knob.style.height="21px";this.knob.style.width="13px";this.knob.style.overflow="hidden";this.knob_img=document.createElement("div");this.knob_img.style.height="21px";this.knob_img.style.width="83px";this.knob_img.style.filter=a;this.knob_img.style.position="relative";this.knob_img.style.left="-70px";this.knob.appendChild(this.knob_img)}else{this.knob=document.createElement("div");this.knob.style.height="21px";this.knob.style.width="13px";this.knob.style.backgroundImage="url(http://www.maptiler.org/img/opacity-slider.png)";this.knob.style.backgroundPosition="-70px 0px"}b.appendChild(this.knob);this.slide=new GDraggableObject(this.knob,{container:b});this.slide.setDraggableCursor("pointer");this.slide.setDraggingCursor("pointer");this.container=b;e.getContainer().appendChild(b);this.setSlider(this.overlay.getTileLayer().opacity);GEvent.addListener(this.slide,"dragend",function(){d.setOpacity()});return b};OpacityControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(7,47))};