Mapper={options:null,dot:8,default_zoom:7,map_panel:null,map_id:null,map:null,zoom:null,center:null,markers:{},labels:{},label:"name",getcnt:0,show:function(C,B){C=C||"Map";this.map_panel=new YAHOO.widget.Panel("map_panel",{close:true,visible:false,draggable:true,width:"650px",height:"520px",fixedcenter:true,constraintoviewport:true,zIndex:1000});this.map_panel.setHeader(C);var A='<img style="display: inline-block; vertical-align: middle;" src="/site/img/common/spinner_16_white.gif" width="16" height="16" border="0" alt="Updating" />';this.map_panel.setBody(A+" Loading Map...");this.map_panel.render(document.body);this.map_panel.show();var D={success:function(E){Mapper.map_panel.setBody(E.responseText)},failure:function(E){handleException(E)}};YAHOO.util.Connect.asyncRequest("GET",B.url,D)},updateMap:function(B,C){if(B=="In"){B=parseInt(this.dot)+1;B=B>11?11:B}else{if(B=="Out"){B=parseInt(this.dot)-1;B=B<0?0:B}else{C.mapImg=C.mapImg||"listingMap";if(C.mapImg&&!C.mapImg.name){C.mapImg=YAHOO.util.Dom.get(C.mapImg)}var D=YAHOO.util.Dom.get("img"+this.dot);if(D){D.src="/site/img/common/dot.gif"}var E=YAHOO.util.Dom.get("img"+B);if(E){E.src="/site/img/common/dots.gif"}this.dot=B;C.mapImg.src=C.url;return true}}var A=YAHOO.util.Dom.get("a"+B);A.onclick();return true},initMap:function(G,C,I,J){this.map_id=G||"map_canvas";I=I||markers;J=J||notify;C=C||"gmap-info-window-";var A=new GLatLngBounds();if(J){MiniNotify.info("Loading Map...")}if(GBrowserIsCompatible()){var E=glat=gmark="";var B=new GIcon(G_DEFAULT_ICON);B.iconSize=new GSize(32,32);B.shadowSize=new GSize(56,32);B.iconAnchor=new GPoint(16,32);B.infoWindowAnchor=new GPoint(16,0);this.map=new GMap2(document.getElementById(this.map_id));this.map.setCenter(new GLatLng(0,0),zoom);this.map.setUIToDefault();this.map.disableScrollWheelZoom();var D=B.shadow;var F=0;for(F in I){E=I[F];glat=new GLatLng(E.lat,E.lng);if(E.status){B.image="/images/site/map-icons/"+E.status+"-dot.png";B.printImage="/images/site/map-icons/"+E.status+"-dot.gif";B.shadow=D}else{if(E.icon){B.image=E.icon;B.shadow=E.shadow}}gmark=new GMarker(glat,{icon:B,title:E.name});this.markers[E.id]=gmark;gmark.bindInfoWindow(document.getElementById(C+E.id));this.map.addOverlay(gmark);A.extend(gmark.getPoint());var H=new BpLabel(glat,E[this.label],false,"nw");this.map.addOverlay(H);H.setClassName("map-label");this.labels[E.id]=H}if(F>0){this.bounds=A;this.map.setZoom(this.map.getBoundsZoomLevel(this.bounds));this.map.setCenter(A.getCenter())}else{this.map.setZoom(Mapper.default_zoom);this.map.setCenter(new GLatLng(40.5992274,-111.689921))}}if(J){MiniNotify.hide()}},getMap:function(){if(this.map&&typeof (this.map)!="undefined"&&this.map.isLoaded()){return this.map}return false},removeMarker:function(A){if(this.markers[A]){this.markers[A].hide();this.markers[A].closeInfoWindow();this.labels[A].hide();delete this.markers[A];delete this.labels[A]}},setLabels:function(B){for(var A in this.labels){if(B!="none"){if(markers[A]){this.labels[A].setHtml(markers[A][B])}this.labels[A].show()}else{this.labels[A].hide()}}},setMapHeight:function(F,C){C=C||this.map_id;var B=window;var E=window.document;if(C){var A=new YAHOO.util.Element(C)}var D=(B.innerHeight?B.innerHeight:(E.clientHeight?E.clientHeight:E.documentElement.clientHeight));if(A!=undefined&&!B.opera){A.setStyle("height",(D-F)+"px");this.map.checkResize();this.map.setCenter(this.bounds.getCenter());this.map.setZoom(this.map.getBoundsZoomLevel(this.bounds))}}};
