OpenLayers.Layer.TextMarker=OpenLayers.Class(OpenLayers.Layer.Text,{initialize:function(b,a){OpenLayers.Layer.Text.prototype.initialize.apply(this,arguments)},destroy:function(){OpenLayers.Layer.Text.prototype.destroy.apply(this,arguments)},parseData:function(j){var l=j.responseText;var n={};OpenLayers.Util.extend(n,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){n.externalProjection=this.projection;n.internalProjection=this.map.getProjectionObject()}var b=new OpenLayers.Format.Text(n);features=b.read(l);for(var f=0,g=features.length;f<g;f++){var e={};var m=features[f];var k;var h,c;k=new OpenLayers.LonLat(m.geometry.x,m.geometry.y);if(m.style.graphicWidth&&m.style.graphicHeight){h=new OpenLayers.Size(m.style.graphicWidth,m.style.graphicHeight)}if(m.style.graphicXOffset!==undefined&&m.style.graphicYOffset!==undefined){c=new OpenLayers.Pixel(m.style.graphicXOffset,m.style.graphicYOffset)}if(m.style.externalGraphic!=null){e.icon=new OpenLayers.Icon(m.style.externalGraphic,h,c)}else{e.icon=OpenLayers.Marker.defaultIcon();if(h!=null){e.icon.setSize(h)}}if((m.attributes.title!=null)&&(m.attributes.description!=null)){e.popupContentHTML=m.attributes.description}e.overflow=m.attributes.overflow||"auto";var a=new OpenLayers.Feature(this,k,e);this.features.push(a);var d=a.createMarker();if((m.attributes.title!=null)&&(m.attributes.description!=null)){d.events.register("click",a,this.markerClick)}this.addMarker(d)}this.events.triggerEvent("loadend")},markerClick:function(b){var d=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!d)?this:null;this.popupClass=OpenLayers.Popup.FramedCloud;this.data.popupSize=new OpenLayers.Size(250,200);for(var c=0,a=this.layer.map.popups.length;c<a;c++){this.layer.map.removePopup(this.layer.map.popups[c])}if(!d){this.layer.map.addPopup(this.createPopup())}OpenLayers.Event.stop(b)},CLASS_NAME:"OpenLayers.Layer.TextMarker"});OpenLayers.Control.PanZoomBar2=OpenLayers.Class(OpenLayers.Control.PanZoom,{zoomsHide:6,zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEvents:null,zoomBarDiv:null,divEvents:null,zoomWorldIcon:false,showPrint:true,showScroll:true,initialize:function(){OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments)},destroy:function(){this.div.removeChild(this.slider);this.slider=null;this.sliderEvents.destroy();this.sliderEvents=null;this.div.removeChild(this.zoombarDiv);this.zoomBarDiv=null;this.divEvents.destroy();this.divEvents=null;this.map.events.un({zoomend:this.moveZoomBar,changebaselayer:this.redraw,scope:this});OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Control.PanZoom.prototype.setMap.apply(this,arguments);this.map.events.register("changebaselayer",this,this.redraw)},redraw:function(){if(this.div!=null){this.div.innerHTML=""}this.draw()},draw:function(b){OpenLayers.Control.prototype.draw.apply(this,arguments);b=this.position.clone();this.buttons=[];var d=new OpenLayers.Size(18,18);var a=new OpenLayers.Pixel(b.x+d.w/2,b.y+32);if(this.showPrint){this._addButton("print","print.png",new OpenLayers.Pixel(b.x+3,b.y-3),new OpenLayers.Size(31,31))}else{a=new OpenLayers.Pixel(b.x+d.w/2,b.y)}var c=d.w;if(this.showScroll){this._addButton("panup","north-mini.png",a,d);b.y=a.y+d.h;this._addButton("panleft","west-mini.png",b,d);this._addButton("panright","east-mini.png",b.add(c,0),d);this._addButton("pandown","south-mini.png",a.add(0,d.h*2),d);this._addButton("zoomin","zoom-plus-mini.png",a.add(0,d.h*3+5),d);a=this._addZoomBar(a.add(0,d.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",a,d)}else{this._addButton("zoomin","zoom-plus-mini.png",a.add(0,d.h*0+5),d);a=this._addZoomBar(a.add(0,d.h*1+5));this._addButton("zoomout","zoom-minus-mini.png",a,d)}return this.div},_addZoomBar:function(a){var e=OpenLayers.Util.getImagesLocation();var g=this.id+"_"+this.map.id;var b=Math.max(0,this.map.getNumZoomLevels()-this.zoomsHide-1-this.map.getZoom());var c=OpenLayers.Util.createAlphaImageDiv(g,a.add(-1,b*this.zoomStopHeight),new OpenLayers.Size(20,9),e+"slider.png","absolute");this.slider=c;this.sliderEvents=new OpenLayers.Events(this,c,null,true,{includeXY:true});this.sliderEvents.on({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});var d=new OpenLayers.Size();d.h=this.zoomStopHeight*Math.max(0,(this.map.getNumZoomLevels()-this.zoomsHide));d.w=this.zoomStopWidth;var f=null;if(OpenLayers.Util.alphaHack()){var g=this.id+"_"+this.map.id;f=OpenLayers.Util.createAlphaImageDiv(g,a,new OpenLayers.Size(d.w,this.zoomStopHeight),e+"zoombar.png","absolute",null,"crop");f.style.height=d.h+"px"}else{f=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar2"+this.map.id,a,d,e+"zoombar.png","absolute","0px",0)}this.zoombarDiv=f;this.divEvents=new OpenLayers.Events(this,f,null,true,{includeXY:true});this.divEvents.on({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.div.appendChild(f);this.startTop=parseInt(f.style.top);this.div.appendChild(c);this.map.events.register("zoomend",this,this.moveZoomBar);a=a.add(0,this.zoomStopHeight*(this.map.getNumZoomLevels()-this.zoomsHide));return a},passEventToSlider:function(a){this.sliderEvents.handleBrowserEvent(a)},divClick:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}var e=a.xy.y;var d=OpenLayers.Util.pagePosition(a.object)[1];var c=(e-d)/this.zoomStopHeight;if(!this.map.fractionalZoom){c=Math.floor(c)}var b=(this.map.getNumZoomLevels()-1)-c;b=Math.min(Math.max(b,this.zoomsHide),this.map.getNumZoomLevels()-1);this.map.zoomTo(b);OpenLayers.Event.stop(a)},zoomBarDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.map.events.on({mousemove:this.passEventToSlider,mouseup:this.passEventToSlider,scope:this});this.mouseDragStart=a.xy.clone();this.zoomStart=a.xy.clone();this.div.style.cursor="move";this.zoombarDiv.offsets=null;OpenLayers.Event.stop(a)},zoomBarDrag:function(b){if(this.mouseDragStart!=null){var a=this.mouseDragStart.y-b.xy.y;var d=OpenLayers.Util.pagePosition(this.zoombarDiv);if((b.clientY-d[1])>0&&(b.clientY-d[1])<parseInt(this.zoombarDiv.style.height)-2){var c=parseInt(this.slider.style.top)-a;this.slider.style.top=c+"px"}this.mouseDragStart=b.xy.clone();OpenLayers.Event.stop(b)}},zoomBarUp:function(b){if(!OpenLayers.Event.isLeftClick(b)){return}if(this.zoomStart){this.div.style.cursor="";this.map.events.un({mouseup:this.passEventToSlider,mousemove:this.passEventToSlider,scope:this});var a=this.zoomStart.y-b.xy.y;var c=this.map.zoom;if(this.map.fractionalZoom){c+=a/this.zoomStopHeight}else{c+=Math.round(a/this.zoomStopHeight)}c=Math.min(Math.max(c,this.zoomsHide),this.map.getNumZoomLevels()-1);this.map.zoomTo(c);this.moveZoomBar();this.mouseDragStart=null;OpenLayers.Event.stop(b)}},buttonDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}switch(this.action){case"panup":this.map.pan(0,-this.slideFactor);break;case"pandown":this.map.pan(0,this.slideFactor);break;case"panleft":this.map.pan(-this.slideFactor,0);break;case"panright":this.map.pan(this.slideFactor,0);break;case"zoomin":this.map.zoomIn();break;case"zoomout":if(this.map.zoom>6){this.map.zoomOut()}break;case"zoomworld":this.map.zoomToMaxExtent();break;case"print":window.print();break}OpenLayers.Event.stop(a)},_addButton:function(f,a,e,d){var c=OpenLayers.Util.getImagesLocation()+a;var b=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+f,e,d,c,"absolute");this.div.appendChild(b);OpenLayers.Event.observe(b,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,b));OpenLayers.Event.observe(b,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,b));OpenLayers.Event.observe(b,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,b));b.action=f;b.map=this.map;b.slideFactor=this.slideFactor;this.buttons.push(b);return b},moveZoomBar:function(){var a=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;this.slider.style.top=a+"px"},CLASS_NAME:"OpenLayers.Control.PanZoomBar2"});