/*
 * geoWidget
 * Copyright(c) 2009 Marcus Schiesser, Gelnhausen, Germany
 */
YUI().add("geowidget.I18N",function(b){YUI.namespace("geowidget.I18N");var a={de_DE:{"directionsManager.removeRoute":"Um die Route zu entfernen, klicken Sie hier.","geoUtil.multiplePlaces":"Es wurden mehrere Orte gefunden. Meinten Sie...","geoUtil.noAddress":"Leider keine Adresse gefunden. Versuchen Sie es bitte nocheinmal.","geoUtil.error":"Fehler:","geoUtil.tryAgain":"Bitte probieren Sie es später noch einmal."},en_US:{"directionsManager.removeRoute":"To remove the route, click here.","geoUtil.multiplePlaces":"More than one place found. Did you mean...","geoUtil.noAddress":"No address found. Please try again.","geoUtil.error":"Error:","geoUtil.tryAgain":"Please try again later."},en_GB:{"directionsManager.removeRoute":"To remove the route, click here.","geoUtil.multiplePlaces":"More than one place found. Did you mean...","geoUtil.noAddress":"No address found. Please try again.","geoUtil.error":"Error:","geoUtil.tryAgain":"Please try again later."}};YUI.geowidget.I18N.getText=function(e){var d=YUI.geowidget.Model.config.locale;var c=a[d];return c[e]?c[e]:e}},"0.0.1",{});YUI().add("ms.NodeHelper",function(a){YUI.namespace("ms");YUI.ms.NodeHelper=function(){var b={};b.getHTML=function(d){if(!d){throw"ms.NodeHelper.getHTML couldn't find node"}var c=a.Node.getDOMNode(d);if(c.outerHTML){return c.outerHTML}var e=document.createElement("div");e.appendChild(c.cloneNode(true));return e.innerHTML};b.isInParentView=function(e){var d=e.get("offsetParent");var f=d.get("scrollTop");var c=d.get("offsetHeight");var g=e.get("offsetTop");return g>=f&&g<=(f+c)};return b}()},"0.0.1",{requires:["node"]});YUI().add("ms.Behaviours",function(a){YUI.namespace("ms");YUI.ms.Behaviours=function(){var b={};b.setInfoText=function(e,h,c){c=c||"yui-info-text";e=a.get("#"+e);var g=e.get("value");if(g===""){e.set("value",h);e.addClass(c)}var f=function(i){g=i.target.get("value");if(g===""){i.target.set("value",h);i.target.addClass(c)}};var d=function(i){i.target.removeClass(c);if(g===""){i.target.set("value","")}};e.on("focus",d);e.on("blur",f)};return b}()},"0.0.1",{requires:["node"]});YUI().add("ms.ItemSelector",function(a){YUI.namespace("ms");YUI.ms.ItemSelector=function(){var c={};var b="Please select an item";c.setHeader=function(d){b=d};c.hide=function(){if(c.overlay!==undefined){c.overlay.hide();c.overlay.destroy();delete c.overlay}};c.selectItem=function(f,k,g){c.hide();var i=a.Node.create('<div class="item-selector-header"></div>');var e=a.Node.create('<a href="#" class="item-selector-close"></a>');e.on("click",function(l){c.hide()});i.appendChild(e);var h=a.Node.create("<span></span>");i.appendChild(h);h.setContent(b);var d=a.Node.create('<div class="item-selector"></div>');c.overlay=new a.Overlay({headerContent:i,bodyContent:d,zIndex:9999});c.overlay.set("centered",true);var j=a.Node.create("<ol></ol>");d.appendChild(j);a.Array.each(f,function(l){var m=a.Node.create('<li><a href="#">'+g(l)+"</a></li>");j.appendChild(m);m.on("click",function(n){c.hide();k(l)})});c.overlay.render()};return c}()},"0.0.1",{requires:["node","overlay"]});YUI().add("ms.TemplateLoader",function(a){YUI.namespace("ms");YUI.ms.TemplateLoader=function(d){d=d||{};var e={};var f={};var c=d.urlMapper||function(g){return g};e.getTemplate=function(g){g=c(g);if(f[g]===undefined){throw new Error("undefined template: "+g)}else{return f[g]}};e.loadTemplate=function(g,h){g=c(g);if(f[g]===undefined){a.io(g,{on:{success:function(k,j){var i=j.responseText;f[g]=i;h(i)}}})}else{h(f[g])}};e.loadTemplates=function(h,i){var g=0;if(h.length===0){i()}a.Array.each(h,function(j){e.loadTemplate(j,function(){g++;if(g===h.length){i()}})})};var b=function(g){if(g!==null){var h=g.get("innerHTML");g.remove();return h}else{return undefined}};e.applyTemplate=function(h,g){var k=e.getTemplate(h);var n=new RegExp("<script[^>]*>((.|\n|\r)*)<\/script>","i");var m=k.match(n);if(m){k=k.replace(n,"")}var j=a.Node.create(k);var l=b(j.query(".title"));var i=pure.autoRender(a.Node.getDOMNode(j),g);return{title:l,html:i,js:m?m[1]:undefined}};return e}},"0.0.1",{requires:["io","node"]});YUI.namespace("ms");YUI.ms.URLParser=function(){var a={};a.parse=function(c,g){c=c.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var b="[\\?&]"+c+"=([^&#]*)";var f=new RegExp(b);var d=f.exec(window.location.href);if(d===null){return""}else{var e=d[1];if(g){e=d[1].replace(/\+/g,"%20")}return decodeURIComponent(e)}};return a}();YUI().add("geowidget.component.LocationSelector",function(a){YUI.namespace("geowidget.component");YUI.geowidget.component.LocationSelector=function(k,l){var f=this;var d=a.Node.get("#"+k);var n=YUI.geowidget.Model.config.templates.locationSelector;var g=YUI.ms.TemplateLoader.getTemplate(n);d.appendChild(a.Node.create(g));var j=d.query(".gw-search-input input");var i=d.query(".gw-search-input .gw-search-suggestion");var b=d.query(".gw-search-submit input");var c=a.guid("myInputField");var o=a.guid("mySuggestionContainer");var e=a.guid("mySubmitButton");j.set("id",c);i.set("id",o);b.set("id",e);var h=[];YUI.ms.Behaviours.setInfoText(c,l);var m=new YAHOO.util.LocalDataSource(h);m.responseSchema={fields:["state"]};YUI.geowidget.component.LocationSelector.superclass.constructor.call(f,c,o,m,{allowBrowserAutocomplete:false,useShadow:true});f.inputFieldNode=j;f.publish("enter");j.on("keyup",function(p){if(p.keyCode==13){f.fire("enter")}});b.on("click",function(){f.fire("enter")});a.io("assets/cities.json",{on:{success:function(r,q){var p=a.JSON.parse(q.responseText);a.Array.each(p,function(s){h.push(s)})}}})};a.extend(YUI.geowidget.component.LocationSelector,YAHOO.widget.AutoComplete);a.augment(YUI.geowidget.component.LocationSelector,a.EventTarget);YUI.geowidget.component.LocationSelector.prototype.getValue=function(){return this.inputFieldNode.get("value")}},"0.0.1",{requires:["node","ms.Behaviours","event","geowidget.util.GeoNames","io","json-parse","yui2-autocomplete"]});YUI().add("geowidget.component.GWComponent",function(a){YUI.namespace("geowidget.component");YUI.geowidget.component.GWComponent=function(d,c){var b=a.Node.get(d);if(!c){if(b){b.remove()}}else{this.placeholder=b}return c}},"0.0.1",{requires:["node"]});YUI().add("geowidget.component.LocationList",function(a){YUI.namespace("geowidget.component");YUI.geowidget.component.LocationList=function(e,d,c){var b=this;if(YUI.geowidget.component.LocationList.superclass.constructor.call(b,e,d)){b.map=c;YUI.geowidget.Model.after("hiddenLocationsChange",function(){b.update()});YUI.geowidget.Model.after("selectedLocationChange",function(){b.onItemSelect(YUI.geowidget.Model.get("selectedLocation"))});b.update();b.placeholder.setStyle("display","block")}};a.extend(YUI.geowidget.component.LocationList,YUI.geowidget.component.GWComponent);YUI.geowidget.component.LocationList.prototype.update=function(){var d=this;var e=a.Node.create("<ol></ol>");if(d.placeholder.query("ol")){d.placeholder.removeChild(d.placeholder.query("ol"))}d.placeholder.appendChild(e);var c=YUI.geowidget.Model.get("visibleLocations");var b=YUI.geowidget.Model.config.locations;b=b.sort(function(g,f){return(g.city>f.city)?1:-1});a.Array.each(b,function(g){var i=(a.Array.indexOf(c,g)>=0);var h=(i)?YUI.geowidget.Model.config.templates.locationListItem:YUI.geowidget.Model.config.templates.locationListHiddenItem;var f=a.Node.create(YUI.ms.TemplateLoader.applyTemplate(h,g).html);e.appendChild(f);g.li=f;if(i){f.query("a").on("click",function(){YUI.geowidget.Model.setLocation(g)})}});d.onItemSelect(YUI.geowidget.Model.get("selectedLocation"))};YUI.geowidget.component.LocationList.prototype.deselectAll=function(){this.placeholder.queryAll("li").removeClass("selected")};YUI.geowidget.component.LocationList.prototype.onItemSelect=function(b){this.deselectAll();if(b&&b.li){b.li.addClass("selected");if(!YUI.ms.NodeHelper.isInParentView(b.li)){b.li.scrollIntoView()}}}},"0.0.2",{requires:["geowidget.component.GWComponent","node","ms.NodeHelper"]});YUI().add("geowidget.component.LocationFilter",function(a){YUI.namespace("geowidget.component");YUI.geowidget.component.LocationFilter=function(j,h,b){var g=this;if(YUI.geowidget.component.LocationFilter.superclass.constructor.call(g,j,h)){g.groups={};g.isGroupVisible={};for(var d=0;d<b.length;d++){var e=b[d].icon||undefined;if(!g.groups[e]){g.groups[e]=[]}g.groups[e].push(b[d].marker)}var c=a.Node.create("<ul></ul>");g.placeholder.appendChild(c);a.Array.each(YUI.geowidget.Model.config.icons,function(l){var m=l.id;var k=g.groups[m];if(k){var i=a.Node.create('<li><label for="'+m+'"><input type="checkbox" id="'+m+'" name="'+m+'" checked="true" /><img src="'+g.getIcon(m)+'" alt="" height="15" /> '+m+" anzeigen</label></li>");c.appendChild(i);g.isGroupVisible[m]=true;i.query("input").on("click",function(){var o=this;var n=o.get("checked");g.isGroupVisible[m]=n;l.visible=n;g.updateModel();a.Object.each(YUI.geowidget.Model.clusterers,function(p,r){for(var q=0;q<k.length;q++){if(n){p.showMarker(k[q],true)}else{p.hideMarker(k[q],true)}}p.redraw_()})})}l.visible=true});var f=0;c.all("li").each(function(i){f=Math.max(f,i.get("offsetWidth")||0)});c.all("li").each(function(i){i.setStyle("width",f+"px")});g.updateModel()}};a.extend(YUI.geowidget.component.LocationFilter,YUI.geowidget.component.GWComponent);YUI.geowidget.component.LocationFilter.prototype.getIcon=function(b){if(b=="undefined"){return"assets/logo/logo.png"}else{return YUI.geowidget.Model.root+"/"+this.lookupIcon(b).image}};YUI.geowidget.component.LocationFilter.prototype.lookupIcon=function(b){return a.Array.find(YUI.geowidget.Model.config.icons,function(c){return c.id==b})};YUI.geowidget.component.LocationFilter.prototype.updateModel=function(){var b=this;var d=[];var c=[];a.Object.each(b.groups,function(e,f){if(b.isGroupVisible[f]){a.Array.each(e,function(g){d.push(g._location)})}else{a.Array.each(e,function(g){c.push(g._location)})}});YUI.geowidget.Model.set("visibleLocations",d);YUI.geowidget.Model.set("hiddenLocations",c)}},"0.0.1",{requires:["geowidget.component.GWComponent","node"]});YUI().add("geowidget.component.ZoomOutButton",function(a){YUI.namespace("geowidget.component");YUI.geowidget.component.ZoomOutButton=function(e,g,h){var f=this;f.zoomManager=g;f.map=h;var b=a.Node.get(e);var d=a.Node.create('<div class="gw-zoom-out-button"></div>');b.appendChild(d);d.on("click",function(){f.zoomManager.zoomToLocations()});var c=function(){d.setStyle("display",f.zoomManager.isZoomedIn()?"block":"none")};c();google.maps.Event.addListener(f.map,"zoomend",function(j,i){c()})}},"0.0.1",{requires:["geowidget.manager.ZoomManager","node"]});YUI().add("geowidget.manager.DirectionsManager",function(a){YUI.namespace("geowidget.manager");YUI.geowidget.manager.DirectionsManager=function(c){var b=this;b.map=c;b.displayRoute=false;b.directions=new google.maps.Directions();b.directionsOptions={locale:YUI.geowidget.Model.config.locale,travelMode:G_TRAVEL_MODE_DRIVING,getPolyline:true,getSteps:true};YUI.geowidget.Model.after("selectedLocationChange",function(){if(YUI.geowidget.Model.get("selectedLocation")&&(YUI.geowidget.Model.get("selectedLocation")!==b.toLocation)){b.hideRoute()}})};YUI.geowidget.manager.DirectionsManager.prototype.createInfoWindow=function(m){if(this.displayRoute&&m==this.toLocation){var i=this.directions.getNumRoutes();var b=0;var l=this.directions.getRoute(b);var k=YUI.geowidget.Model.config.templates.directionsItem;var n=YUI.geowidget.Model.config.templates.directions;var e=a.merge(m,{startAddress:this.directions.getGeocode(b).address,endAddress:this.directions.getGeocode(b+1).address,routeDistance:l.getDistance().html,routeDuration:l.getDuration().html,routeSummary:l.getSummaryHtml()});var d=YUI.ms.TemplateLoader.applyTemplate(n,e);var h=a.Node.create(d.html);var f=h.query("div.routeTablePlaceholder");var j=l.getNumSteps();for(var g=0;g<j;g++){var c=l.getStep(g);var o=a.Node.create(YUI.ms.TemplateLoader.applyTemplate(k,a.merge(e,{stepNumber:g+1,stepDescription:c.getDescriptionHtml(),stepDistance:c.getDistance().html,stepDuration:c.getDuration().html})).html);f.append(o)}d.html=YUI.ms.NodeHelper.getHTML(h);return d}else{return YUI.ms.TemplateLoader.applyTemplate(YUI.geowidget.Model.config.templates.route,m)}};YUI.geowidget.manager.DirectionsManager.prototype.showStep=function(b,c){this.map.showMapBlowup(this.directions.getRoute(b).getStep(c).getLatLng())};YUI.geowidget.manager.DirectionsManager.prototype.hideRoute=function(){this.displayRoute=false;YUI.geowidget.Model.managers.clusterManager.unhighlightMarker();if(this.tooltip){this.tooltip.hide()}if(this._line!==undefined){this.map.removeOverlay(this._line)}if(this._positionOverlay!==undefined){this.map.removeOverlay(this._positionOverlay)}};YUI.geowidget.manager.DirectionsManager.prototype.showRoute=function(){YUI.geowidget.Model.managers.clusterManager.highlightMarker(this.toLocation.marker);if(this._line!==undefined){this.map.addOverlay(this._line)}this.displayRoute=true};YUI.geowidget.manager.DirectionsManager.prototype.printRoute=function(){var c=encodeURIComponent(this.fromLocation.address);var b=encodeURIComponent(this.toLocation.address);var d=window.open("http://maps.google.de/maps?pw=2&saddr="+c+"&daddr="+b,"_blank","width=769,height=832,status=yes,scrollbars=yes,resizable=yes");d.focus()};YUI.geowidget.manager.DirectionsManager.prototype.calcRoute=function(d,f){var c=function(g,h){if(!e.tooltip){e.tooltip=new Tooltip(YUI.geowidget.I18N.getText("directionsManager.removeRoute"),4);e.map.addOverlay(e.tooltip);google.maps.Event.addListener(e.tooltip,"click",function(){e.hideRoute()})}google.maps.Event.addListener(g,"mouseover",function(){e.tooltip.setLatLng(h);e.tooltip.show();setTimeout(function(){e.tooltip.hide()},3000)});google.maps.Event.addListener(g,"click",function(){e.hideRoute()})};var e=this;e.fromLocation=d;e.toLocation=f;this.directions.clear();var b=google.maps.Event.addListener(e.directions,"load",function(){e.hideRoute();e._line=e.directions.getPolyline();var i=e.directions.getRoute(0).getStartGeocode();var h=e._line.getVertex(0);var g=e._line.getVertex(e._line.getVertexCount()-1);e._positionOverlay=e.createPosition({address:i.address,latLng:h});if(e._positionOverlay!==undefined){e.map.addOverlay(e._positionOverlay)}YUI.geowidget.Model.managers.zoomManager.zoomToBounds(e._line.getBounds());e.lastDistance=e.directions.getDistance();if(YUI.geowidget.Model.config.features.showRoute===true){c(e._positionOverlay,h);c(e._line,e._line.getBounds().getCenter());e.showRoute()}YUI.geowidget.InfoWindowFactory.displayLocationInfoWindow(e.map,e.toLocation,{showRouteTab:YUI.geowidget.Model.config.features.showRoute});google.maps.Event.removeListener(b)});this.directions.loadFromWaypoints([d.latLng,f.latLng],this.directionsOptions)};YUI.geowidget.manager.DirectionsManager.prototype.createPosition=function(c){var e=YUI.geowidget.Model.config.positionIcon||{image:"assets/position.png",overImage:"assets/position.png",width:30,height:30};var d=new google.maps.Icon();d.image=e.image;d.iconSize=new google.maps.Size(e.width,e.height);d.iconAnchor=new google.maps.Point(15,15);var b=new google.maps.Marker(c.latLng,{icon:d,title:c.address});if(e.overImage!==null&&e.overImage!=e.image){google.maps.Event.addListener(b,"mouseover",function(){b.setImage(e.overImage)});google.maps.Event.addListener(b,"mouseout",function(){b.setImage(e.image)})}return b}},"0.0.1",{requires:["ms.NodeHelper"]});YUI().add("geowidget.manager.ZoomManager",function(a){YUI.namespace("geowidget.manager");YUI.geowidget.manager.ZoomManager=function(c){var b=this;this.map=c;this.GERMANY={zoom:6,latLng:new google.maps.LatLng(51.220647,10.041504)};this.EUROPE={zoom:5,latLng:new google.maps.LatLng(48.886483489234266,2.342630624771118)};google.maps.Event.addListener(this.map,"zoomend",function(f,d){if(a.Lang.isFunction(b.zoomFunction)){b.zoomFunction()}var e=function(g){if(g){a.Array.each(g,function(i){if(a.Lang.isArray(i.zoomRange)){var j=i.zoomRange[0];var h=i.zoomRange[1];if(d>=j&&d<=h){i.marker.show();if(a.Lang.isFunction(i.showEdges)){i.showEdges()}}else{i.marker.hide();if(a.Lang.isFunction(i.hideEdges)){i.hideEdges()}}}})}};e(YUI.geowidget.Model.config.locations);e(YUI.geowidget.Model.config.kmls)})};YUI.geowidget.manager.ZoomManager.prototype.zoomToBounds=function(b){var c=this.map.getBoundsZoomLevel(b);if(c>15){c=15}this.map.setCenter(b.getCenter(),c)};YUI.geowidget.manager.ZoomManager.prototype.zoomToLocations=function(){this.map.closeInfoWindow();this.zoomToBounds(YUI.geowidget.util.GeoUtil.createLocationBounds(YUI.geowidget.Model.config.locations));this.allLocationsVisibleZoom=this.map.getZoom()};YUI.geowidget.manager.ZoomManager.prototype.zoomToOverview=function(){if(YUI.geowidget.Model.config.layout.overview){var b=YUI.geowidget.Model.config.layout.overview;this.map.closeInfoWindow();this.map.setCenter(new google.maps.LatLng(b.lat,b.lng),b.zoom)}else{this.zoomToLocations()}};YUI.geowidget.manager.ZoomManager.prototype.zoomToCluster=function(){this.map.closeInfoWindow();this.zoomToBounds(YUI.geowidget.util.GeoUtil.createLocationBounds(YUI.geowidget.Model.selectedClusterLocations));this.allLocationsVisibleZoom=this.map.getZoom()};YUI.geowidget.manager.ZoomManager.prototype.isZoomedIn=function(){return this.map.getZoom()>this.allLocationsVisibleZoom};YUI.geowidget.manager.ZoomManager.prototype.zoomToCountry=function(b){this.map.closeInfoWindow();this.map.setCenter(b.latLng);this.map.setZoom(b.zoom)};YUI.geowidget.manager.ZoomManager.prototype.zoomIn=function(c){this.map.closeInfoWindow();for(var b=0;b<c;b++){this.map.zoomIn()}}},"0.0.1",{requires:["geowidget.util.GeoUtil"]});YUI().add("geowidget.manager.LayoutManager",function(a){YUI.namespace("geowidget.manager");YUI.geowidget.manager.LayoutManager=function(){var b={};b.unblock=function(){a.one("#gw-layout-block").remove()};b.arrange=function(d){var k=a.Node.get(".gw-layout-top");var e=a.Node.get(".gw-layout-left");var f=a.Node.get(".gw-layout-main");var l=a.Node.get(".gw-layout-right");var c=a.Node.get(".gw-layout-bottom");var j=(k)?(k.get("offsetHeight")):(0);var i=(c)?(c.get("offsetHeight")):(0);var h=(e)?(e.get("offsetWidth")):(0);var g=(l)?(l.get("offsetWidth")):(0);b.setStyle(k,0,0,null,0);b.setStyle(e,j,null,i,0);b.setStyle(f,j,g,i,h);b.setStyle(l,j,0,i,null);b.setStyle(c,null,0,0,0);d.checkResize()};b.setStyle=function(e,g,d,c,f){if(e){if(g!==null){e.setStyle("top",g+"px")}if(d!==null){e.setStyle("right",d+"px")}if(c!==null){e.setStyle("bottom",c+"px")}if(f!==null){e.setStyle("left",f+"px")}if(a.UA.ie>0&&g!==null&&c!==null){e.setAttribute("dh",(g+c))}if(a.UA.ie>0&&f!==null&&d!==null){e.setAttribute("dw",(f+d))}}};return b}()},"0.0.1",{requires:["node"]});YUI().add("geowidget.manager.ClusterManager",function(a){YUI.namespace("geowidget.manager");YUI.geowidget.manager.ClusterManager=function(b){this.map=b};YUI.geowidget.manager.ClusterManager.prototype.highlightMarker=function(b){a.Object.each(YUI.geowidget.Model.clusterers,function(c){c.highlightMarker(b)})};YUI.geowidget.manager.ClusterManager.prototype.unhighlightMarker=function(){if(this.map.getInfoWindow().isHidden()&&!YUI.geowidget.Model.managers.directionsManager.displayRoute){a.Object.each(YUI.geowidget.Model.clusterers,function(b){b.unhighlightMarker()})}}},"0.0.1",{requires:["geowidget.manager.DirectionsManager"]});function Tooltip(b,a){this.text_=b;this.padding_=a}Tooltip.prototype=new GOverlay();Tooltip.prototype.initialize=function(b){var c=document.createElement("div");c.appendChild(document.createTextNode(this.text_));c.className="gw-tooltip";c.style.position="absolute";c.style.visibility="hidden";b.getPane(G_MAP_MARKER_SHADOW_PANE).appendChild(c);this.map_=b;this.div_=c;var a=this;google.maps.Event.addDomListener(c,"click",function(){google.maps.Event.trigger(a,"click")})};Tooltip.prototype.remove=function(){this.div_.parentNode.removeChild(this.div_)};Tooltip.prototype.copy=function(){return new Tooltip(this.latLng_,this.text_,this.padding_)};Tooltip.prototype.setLatLng=function(a){this.latLng_=a;this.redraw(true)};Tooltip.prototype.redraw=function(c){if(!c||!this.latLng_){return}var a=this.map_.fromLatLngToDivPixel(this.latLng_);var d=Math.round(a.x-this.div_.clientWidth/2);var b=a.y-this.div_.clientHeight-this.padding_;this.div_.style.top=b+"px";this.div_.style.left=d+"px"};Tooltip.prototype.show=function(){this.div_.style.visibility="visible"};Tooltip.prototype.hide=function(){this.div_.style.visibility="hidden"};YUI().add("geowidget.util.GeoNames",function(a){YUI.namespace("geowidget.util");YUI.geowidget.util.GeoNames=function(){var b={};var c=new a.DataSource.Get({source:"http://ws.geonames.org/searchJSON?"});b.search=function(d,g){var f=[];d.style="SHORT";for(var e in d){if(d.hasOwnProperty(e)){f.push(encodeURIComponent(e)+"="+encodeURIComponent(d[e]))}}f=f.join("&");c.sendRequest(f,{success:function(h){g(h.data)},failure:function(h){alert("Could not retrieve data from geonames.org: "+h.error.message);g({})}})};return b}()},"0.0.1",{requires:["datasource-get"]});YUI().add("geowidget.util.GeoUtil",function(a){YUI.namespace("geowidget.util");YUI.geowidget.util.GeoUtil=function(){var b={};b.findNearestLocation=function(f,c){var g=Number.MAX_VALUE;var j;for(var e=0;e<c.length;e++){var d=c[e];var h=f.distanceFrom(d.latLng);if(h<g){j=d;g=h}}return j};b.getNearestLocation=function(c,d){b.retrievePlacemark(c,function(e){var f=b.findNearestLocation(e.latLng,YUI.geowidget.Model.get("visibleLocations"));d(e,f)})};b.createLocationBounds=function(c){var f=new google.maps.LatLngBounds();for(var e=0;e<c.length;e++){var d=c[e];f.extend(d.latLng)}return f};b.createCenterBorderBound=function(c,d){var f=new google.maps.LatLng(d.lat()+(c.lat()-d.lat())*2,d.lng()+(c.lng()-d.lng())*2);var e=new google.maps.LatLngBounds();e.extend(d);e.extend(f);return e};b.retrievePlacemark=function(d,f){var e=new google.maps.ClientGeocoder();var c=function(g){return{latLng:new google.maps.LatLng(g.Point.coordinates[1],g.Point.coordinates[0]),address:g.address}};e.setBaseCountryCode("de");e.getLocations(d,function(h){if(h.Status.code===G_GEO_SUCCESS){var g=h.Placemark;if(g.length==1){var i=g[0];f(c(i))}else{if(g.length>1){YUI.ms.ItemSelector.setHeader(YUI.geowidget.I18N.getText("geoUtil.multiplePlaces"));YUI.ms.ItemSelector.selectItem(g,function(j){f(c(j))},function(j){return j.address})}else{alert(YUI.geowidget.I18N.getText("geoUtil.noAddress"))}}}else{alert(YUI.geowidget.I18N.getText("geoUtil.error")+" "+h.Status.code+". "+YUI.geowidget.I18N.getText("geoUtil.tryAgain"))}})};return b}()},"0.0.1",{requires:["io","json-parse","ms.ItemSelector"]});YUI().add("geowidget.ConfigLoader",function(a){YUI.namespace("geowidget");YUI.geowidget.ConfigLoader=function(){var b={};b.loadConfig=function(d){YUI.geowidget.Model.root=YUI.geowidget.root||YUI.ms.URLParser.parse("root");if(YUI.geowidget.Model.root===""){YUI.geowidget.Model.root="."}var c=YUI.geowidget.Model.root+"/config.json";a.io(c,{on:{success:function(k,j,g){config=[];try{config=a.JSON.parse(j.responseText)}catch(i){alert("Error parsing JSON: "+i.description);return}var f=function(){config.locations.every=function(e){a.Array.each(config.locations,e)};config.locations.every(function(e){e.latLng=new google.maps.LatLng(e.lat,e.lng);if(e.address===undefined){e.address=(e.street!==undefined?e.street+", ":"")+(e.postalCode!==undefined?e.postalCode+" ":"")+e.city}e.hasInfoWindow=function(){return a.Lang.isArray(e.templates)&&e.templates.length>0}});YUI.geowidget.Model.config=config;d(config)};if(config.positionIcon){config.positionIcon.image=YUI.geowidget.Model.root+"/"+config.positionIcon.image;config.positionIcon.overImage=YUI.geowidget.Model.root+"/"+config.positionIcon.overImage}if(a.Lang.isString(config.locations)){var h=new a.DataSource.Get({source:config.locations});h.sendRequest("?a=1",{success:function(e){config.locations=e.data;f()}})}else{f()}}}})};b.preloadTemplates=function(g){var d=YUI.geowidget.Model.config.locations;YUI.geowidget.Model.config.templates=YUI.geowidget.Model.config.templates||{};var e=YUI.geowidget.Model.config.templates;YUI.geowidget.Model.config.locale=YUI.geowidget.Model.config.locale||"de_DE";var f="templates/"+YUI.geowidget.Model.config.locale+"/";e.route=e.route||f+"route.html";e.directions=e.directions||f+"directions.html";e.directionsItem=e.directionsItem||f+"directionsItem.html";e.body=e.body||f+"body.html";e.locationSelector=e.locationSelector||f+"locationSelector.html";e.locationSummaryItem=e.locationSummaryItem||f+"locationSummaryItem.html";e.locationSummary=e.locationSummary||f+"locationSummary.html";e.locationListItem=e.locationListItem||f+"locationListItem.html";e.locationListHiddenItem=e.locationListHiddenItem||f+"locationListHiddenItem.html";var c=a.Object.values(e);a.Array.each(d,function(h){c=c.concat(h.templates||[])});c=a.Array.unique(c);YUI.ms.TemplateLoader.loadTemplates(c,g)};b.getMapType=function(){switch(YUI.geowidget.Model.config.layout.mapType){case"NORMAL_MAP_TYPE":return G_NORMAL_MAP;case"SATELLITE_MAP_TYPE":return G_SATELLITE_MAP;case"HYBRID_MAP_TYPE":return G_HYBRID_MAP;case"SATELLITE_3D_MAP_TYPE":return G_SATELLITE_3D_MAP;case"OSM_MAP_TYPE":var e="<a href='http://www.openstreetmap.com' target='_blank'>License</a>";var f=new google.maps.Copyright(1,new google.maps.LatLngBounds(new google.maps.LatLng(-90,-180),new google.maps.LatLng(90,180)),0,e);var d=new google.maps.CopyrightCollection("OpenStreetsMap: ");d.addCopyright(f);var c=[new google.maps.TileLayer(d,0,15)];c[0].getTileUrl=function(h,g){return"http://tile.openstreetmap.org/"+g+"/"+h.x+"/"+h.y+".png"};return new google.maps.MapType(c,G_SATELLITE_MAP.getProjection(),"OpenStreetMap",{minResolution:0,maxResolution:15});default:return G_PHYSICAL_MAP}};return b}()},"0.0.1",{requires:["io","json-parse","collection","ms.TemplateLoader","datasource-get"]});YUI().add("geowidget.InfoWindowFactory",function(Y){YUI.namespace("geowidget");YUI.geowidget.InfoWindowFactory=function(){var that={};that.createInfoWindows=function(location){var infowindows=[];var templates=location.templates||[];Y.Array.each(templates,function(template){var content=YUI.ms.TemplateLoader.applyTemplate(template,location);infowindows.push(content)});if(YUI.geowidget.Model.config.features.showRoute===true){infowindows.push(YUI.geowidget.Model.managers.directionsManager.createInfoWindow(location))}return infowindows};that.displayLocationInfoWindow=function(map,location,config){config=config||{};var infowindows=YUI.geowidget.InfoWindowFactory.createInfoWindows(location);that.displayInfoWindow(map,location.marker.getLatLng(),infowindows,{onOpenFn:function(){YUI.geowidget.Model.managers.clusterManager.highlightMarker(location.marker)},onCloseFn:function(){if(YUI.geowidget.Model.get("selectedLocation")===location){YUI.geowidget.Model.set("selectedLocation",null)}YUI.geowidget.Model.managers.clusterManager.unhighlightMarker()},startTab:(config.showRouteTab)?(infowindows.length-1):0})};that.displayInfoWindow=function(map,latLng,infowindows,config){config=config||{};var defaultWidth;var defaultHeight;var selectTab=function(tab){if(!defaultWidth&&!defaultHeight){defaultWidth=map.getInfoWindow().getContentContainers()[0].clientWidth;defaultHeight=map.getInfoWindow().getContentContainers()[0].clientHeight}var container=Y.get(map.getInfoWindow().getContentContainers()[tab]);var contentWidth=container.query(".infowindow").getStyle("width").match(/(\d+)px/);var width;if(contentWidth){width=parseInt(contentWidth[1],10)}else{width=defaultWidth}map.getInfoWindow().reset(latLng,map.getInfoWindow().getTabs(),new GSize(width,defaultHeight),null,null);map.getInfoWindow().selectTab(tab)};var options=function(multiple){return{onOpenFn:function(){if(multiple){selectTab(config.startTab||0)}Y.Array.each(infowindows,function(infowindow){eval(infowindow.js)});if(Y.Lang.isFunction(config.onOpenFn)){config.onOpenFn()}},onCloseFn:config.onCloseFn}};if(infowindows.length===1){map.openInfoWindowHtml(latLng,infowindows[0].html,options(false))}else{var counter=0;var mappedWindows=Y.Array.map(infowindows,function(content){var infowindow=new google.maps.InfoWindowTab(content.title,content.html);var localCounter=counter;infowindow.onclick=function(){selectTab(localCounter)};counter++;return infowindow});map.openInfoWindowTabsHtml(latLng,mappedWindows,options(true))}};that.createSummaryInfoWindow=function(map,locations,callback){var itemTemplate=YUI.geowidget.Model.config.templates.locationSummaryItem;var template=YUI.geowidget.Model.config.templates.locationSummary;var infoWindow=Y.Node.create(YUI.ms.TemplateLoader.getTemplate(template));var itemList=infoWindow.query(".section.list");var mapZoom=infoWindow.query(".section.zoom");Y.Array.each(locations,function(location){var item=Y.Node.create(YUI.ms.TemplateLoader.applyTemplate(itemTemplate,location).html);item.on("click",function(node){callback(location)});item.on("mouseenter",function(e){this.addClass("over")});item.on("mouseleave",function(e){this.removeClass("over")});itemList.append(item)});var eventListener=google.maps.Event.addListener(map,"zoomend",function(oldLevel,newLevel){that.isAllowZoomIn(mapZoom,newLevel)});google.maps.Event.addListener(map,"infowindowclose",function(){google.maps.Event.removeListener(eventListener)});that.isAllowZoomIn(mapZoom,map.getZoom());return Y.Node.getDOMNode(infoWindow)};that.isAllowZoomIn=function(node,level){if(node){node.setStyle("visibility",(level<15)?"visible":"hidden")}};return that}()},"0.0.1",{requires:["node","collection","ms.TemplateLoader"]});function MarkerClusterer(q,c,b){var p=[];var t=q;var f=null;var k=this;var j=60;var a=[53,56,66,78,90];var h=[];var e=[];var o=null;var n=true;var g=false;var d=function(x){var u=0;var w=x.length;var v=w;while(v!==0){v=parseInt(v/10,10);u++}var i=this.getStyles().length;if(i<u){u=i}return{text:w,index:u}};var m=0;for(m=1;m<=5;++m){h.push({url:"http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/images/m"+m+".png",height:a[m-1],width:a[m-1]})}if(typeof b==="object"&&b!==null){if(typeof b.gridSize==="number"&&b.gridSize>0){j=b.gridSize}if(typeof b.maxZoom==="number"){f=b.maxZoom}if(typeof b.styles==="object"&&b.styles!==null&&b.styles.length!==0){h=b.styles}if(typeof b.calculator==="function"){d=b.calculator}if(typeof b.zoomOnClick==="boolean"){n=b.zoomOnClick}}this.setCalculator=function(i){d=i};this.getCalculator=function(){return GEvent.callback(this,d)};this.isZoomOnClick=function(){return n};function l(){if(e.length===0){return}var i=[];for(m=0;m<e.length;++m){if(s(e[m])){k.addMarker(e[m],true,null,null,true,null)}else{i.push(e[m])}}e=i}this.getStyles=function(){return h};this.clearMarkers=function(){for(var u=0;u<p.length;++u){if(typeof p[u]!=="undefined"&&p[u]!==null){p[u].clearMarkers()}}p=[];e=[]};function s(i){return t.getBounds().containsLatLng(i.getLatLng())}function r(x){var u=x.length;var w=[];for(var v=u-1;v>=0;--v){k.addMarker(x[v].marker,true,x[v].isAdded,w,true,x[v].isHidden)}l()}this.addMarker=function(A,x,F,y,H,G){if(H!==true){if(!s(A)){e.push(A);return}}var B=F;var v=G;var D=y;var C=t.fromLatLngToDivPixel(A.getLatLng());if(typeof B!=="boolean"){B=false}if(typeof D!=="object"||D===null){D=p}var w=D.length;var E=null;for(var z=w-1;z>=0;z--){E=D[z];var u=E.getCenter();if(u===null){continue}u=t.fromLatLngToDivPixel(u);if(C.x>=u.x-j&&C.x<=u.x+j&&C.y>=u.y-j&&C.y<=u.y+j){E.addMarker({isHidden:v,isAdded:B,marker:A});if(!x){E.redraw_()}return}}E=new Cluster(this,q);E.addMarker({isHidden:v,isAdded:B,marker:A});if(!x){E.redraw_()}D.push(E);if(D!==p){p.push(E)}};this.removeMarker=function(u){for(var v=0;v<p.length;++v){if(p[v]&&p[v].removeMarker(u)){p[v].redraw_();return}}};this.highlightMarker=function(v){k.unhighlightMarker();var u;for(var w=0;w<p.length;++w){if(p[w]&&(u=p[w].removeMarker(v))){p[w].hide();t.addOverlay(v);k.highlight_={cluster:p[w],marker:v,hidden:u.isHidden};return true}}return false};this.unhighlightMarker=function(){if(k.highlight_){t.removeOverlay(k.highlight_.marker);k.highlight_.cluster.show();k.addMarkers([k.highlight_.marker]);if(k.highlight_.hidden){k.hideMarker(k.highlight_.marker)}delete k.highlight_}};this.hideMarker=function(u,v){if(k.highlight_&&u===k.highlight_.marker){k.highlight_.hidden=true}for(var w=0;w<p.length;++w){if(p[w]&&p[w].hideMarker(u)){if(!v){p[w].redraw_()}return}}};this.showMarker=function(u,v){if(k.highlight_&&u===k.highlight_.marker){k.highlight_.hidden=false}for(var w=0;w<p.length;++w){if(p[w]&&p[w].showMarker(u)){if(!v){p[w].redraw_()}return}}};this.redraw_=function(){var v=this.getClustersInViewport_();for(var u=0;u<v.length;++u){v[u].redraw_(true)}};this.getClustersInViewport_=function(){var w=[];var v=t.getBounds();for(var u=0;u<p.length;u++){if(p[u].isInBounds(v)){w.push(p[u])}}return w};this.getMaxZoom_=function(){return f};this.getMap_=function(){return t};this.getGridSize_=function(){return j};this.getTotalMarkers=function(){var u=0;for(var v=0;v<p.length;++v){u+=p[v].getTotalMarkers()}return u};this.getTotalClusters=function(){return p.length};this.resetViewport=function(){var A=this.getClustersInViewport_();var z=[];var y=0;for(var v=0;v<A.length;++v){var B=A[v];var C=B.getCurrentZoom();if(C===null){continue}var D=t.getZoom();if(D!==C){var w=B.getMarkers();for(var u=0;u<w.length;++u){var x={isAdded:false,isHidden:w[u].isHidden,marker:w[u].marker};z.push(x)}B.clearMarkers();y++;for(u=0;u<p.length;++u){if(B===p[u]){p.splice(u,1)}}}}r(z);if(!g){this.redraw_()}};this.addMarkers=function(v){for(var u=0;u<v.length;++u){this.addMarker(v[u],true)}this.redraw_()};this.getParentCluster=function(i){return i.parentCluster_};this.show=function(){g=false;var v=p;for(var u=0;u<v.length;++u){v[u].show()}};this.hide=function(){g=true;var v=p;for(var u=0;u<v.length;++u){v[u].hide()}};this.isHidden=function(){return g};if(typeof c==="object"&&c!==null){this.addMarkers(c)}o=GEvent.addListener(t,"moveend",function(){k.resetViewport()})}function Cluster(i){var a=null;var b=[];var c=i;var h=i.getMap_();var d=null;var g=h.getZoom();var f=this;var e=false;this.getMarkers=function(){return b};this.getMarkerClusterer=function(){return c};this.isInBounds=function(n){if(a===null){return false}if(!n){n=h.getBounds()}var j=h.fromLatLngToDivPixel(n.getSouthWest());var p=h.fromLatLngToDivPixel(n.getNorthEast());var o=h.fromLatLngToDivPixel(a);var l=true;var k=i.getGridSize_();if(g!==h.getZoom()){var m=h.getZoom()-g;k=Math.pow(2,m)*k}if(p.x!==j.x&&(o.x+k<j.x||o.x-k>p.x)){l=false}if(l&&(o.y+k<p.y||o.y-k>j.y)){l=false}return l};this.getCenter=function(){return a};this.addMarker=function(j){if(a===null){a=j.marker.getLatLng()}j.marker.parentCluster_=f;b.push(j)};this.removeMarker=function(j){for(var l=0;l<b.length;++l){if(j===b[l].marker){if(b[l].isAdded){h.removeOverlay(b[l].marker)}var k=b[l];delete b[l].marker.parentCluster_;b.splice(l,1);return k}}return};this.hideMarker=function(j){for(var k=0;k<b.length;++k){if(j===b[k].marker){b[k].isHidden=true;return true}}return false};this.showMarker=function(j){for(var k=0;k<b.length;++k){if(j===b[k].marker){b[k].isHidden=false;return true}}return false};this.getCurrentZoom=function(){return g};this.redraw_=function(n){if(!n&&!this.isInBounds()){return}g=h.getZoom();var k=0;var l=i.getMaxZoom_();if(l===null){l=h.getCurrentMapType().getMaximumResolution()}var m=this.getRealMarkers();if(g>l||m.length<=1){if(!e){for(k=0;k<b.length;++k){if(b[k].isHidden){if(b[k].isAdded&&(!b[k].marker.isHidden())){b[k].marker.hide()}}else{if(b[k].isAdded){b[k].marker.show()}else{h.addOverlay(b[k].marker);b[k].isAdded=true}}}}if(d!==null){d.hide()}}else{if(m.length>1){for(k=0;k<b.length;++k){if(b[k].isAdded&&(!b[k].marker.isHidden())){b[k].marker.hide()}}if(!e){var j=c.getCalculator()(m);if(d===null){d=new ClusterMarker_(a,j,c.getStyles(),c.getGridSize_(),f);h.addOverlay(d)}else{if(d.isHidden()){d.show()}d.setSums(j);d.redraw(true)}}}}};this.clearMarkers=function(){if(d!==null){h.removeOverlay(d)}for(var j=0;j<b.length;++j){if(b[j].isAdded){h.removeOverlay(b[j].marker)}delete b[j].marker.parentCluster_}b=[]};this.getTotalMarkers=function(){return b.length};this.getRealMarkers=function(){var j=[];for(var k=0;k<b.length;++k){if(!b[k].isHidden){j.push(b[k].marker)}}return j};this.show=function(){e=false;this.redraw_()};this.hide=function(){e=true;this.redraw_()}}function ClusterMarker_(f,c,d,e,a){var b=c.index;this.useStyle(d[b-1]);this.styleDirty_=false;this.latlng_=f;this.index_=b;this.styles_=d;this.text_=c.text;this.padding_=e;this.sums_=c;this.cluster_=a}ClusterMarker_.prototype=new GOverlay();ClusterMarker_.prototype.useStyle=function(a){this.url_=a.url;this.height_=a.height;this.width_=a.width;this.textColor_=a.opt_textColor;this.anchor_=a.opt_anchor;this.textSize_=a.opt_textSize};ClusterMarker_.prototype.initialize=function(c){this.map_=c;var f=document.createElement("div");var e=this.latlng_;var d=this.getPosFromLatLng(e);f.style.cssText=this.createCss(d);f.innerHTML=this.text_;c.getPane(G_MAP_MARKER_PANE).appendChild(f);var b=this.padding_;var a=this.cluster_;GEvent.addDomListener(f,"click",function(){GEvent.trigger(a.getMarkerClusterer(),"clusterclick",a);if(a.getMarkerClusterer().isZoomOnClick()){var j=c.fromLatLngToDivPixel(e);var g=new GPoint(j.x-b,j.y+b);g=c.fromDivPixelToLatLng(g);var i=new GPoint(j.x+b,j.y-b);i=c.fromDivPixelToLatLng(i);var h=c.getBoundsZoomLevel(new GLatLngBounds(g,i),c.getSize());c.setCenter(e,h)}});this.div_=f};ClusterMarker_.prototype.getPosFromLatLng=function(b){var a=this.map_.fromLatLngToDivPixel(b);a.x-=parseInt(this.width_/2,10);a.y-=parseInt(this.height_/2,10);return a};ClusterMarker_.prototype.createCss=function(d){var c="";if(document.all){c='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+this.url_+'");'}else{c="background:url("+this.url_+");"}if(typeof this.anchor_==="object"){if(typeof this.anchor_[0]==="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_){c+="height:"+(this.height_-this.anchor_[0])+"px;padding-top:"+this.anchor_[0]+"px;"}else{c+="height:"+this.height_+"px;line-height:"+this.height_+"px;"}if(typeof this.anchor_[1]==="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_){c+="width:"+(this.width_-this.anchor_[1])+"px;padding-left:"+this.anchor_[1]+"px;"}else{c+="width:"+this.width_+"px;text-align:center;"}}else{c+="height:"+this.height_+"px;line-height:"+this.height_+"px;";c+="width:"+this.width_+"px;text-align:center;"}var a=this.textColor_?this.textColor_:"black";var b=this.textSize_?this.textSize_:11;return c+"cursor:pointer;top:"+d.y+"px;left:"+d.x+"px;color:"+a+";position:absolute;font-size:"+b+"px;font-family:Arial,sans-serif;font-weight:bold"};ClusterMarker_.prototype.remove=function(){this.div_.parentNode.removeChild(this.div_)};ClusterMarker_.prototype.copy=function(){return new ClusterMarker_(this.latlng_,this.sums_,this.text_,this.styles_,this.padding_,this.cluster_)};ClusterMarker_.prototype.redraw=function(a){if(!a){return}var b=this.getPosFromLatLng(this.latlng_);if(this.styleDirty_){this.styleDirty_=false;this.useStyle(this.styles_[this.index_-1]);this.div_.style.cssText=this.createCss(b)}else{this.div_.style.top=b.y+"px";this.div_.style.left=b.x+"px"}};ClusterMarker_.prototype.hide=function(){this.div_.style.display="none"};ClusterMarker_.prototype.show=function(){this.div_.style.display=""};ClusterMarker_.prototype.isHidden=function(){return this.div_.style.display==="none"};ClusterMarker_.prototype.setSums=function(a){if(a.index!==this.index_){this.styleDirty_=true}this.sums_=a;this.text_=a.text;this.index_=a.index;this.div_.innerHTML=a.text};YUI().add("geowidget.MarkerFactory",function(a){YUI.namespace("geowidget");YUI.geowidget.MarkerFactory=function(d,e,c){var b=this;this.map=d;this.infoWindowFactory=e;this.zoomManager=c;YUI.geowidget.Model.after("selectedLocationChange",function(){var f=YUI.geowidget.Model.get("selectedLocation");if(f){var g=f.zoomRange?f.zoomRange[1]:14;b.map.setCenter(f.marker.getLatLng(),b.map.getZoom()>g?b.map.getZoom():g);b.infoWindowFactory.displayLocationInfoWindow(b.map,f)}})};YUI.geowidget.MarkerFactory.prototype.addInfoToMarker=function(c,b){google.maps.Event.addListener(c,"click",function(){YUI.geowidget.Model.setLocation(b)})};YUI.geowidget.MarkerFactory.prototype.lookupIcon=function(b){return a.Array.find(YUI.geowidget.Model.config.icons,function(c){return c.id===b})};YUI.geowidget.MarkerFactory.prototype.lookupCluster=function(d){var c=YUI.geowidget.Model.config.clusters;if(a.Lang.isArray(c)&&c.length>0){var b=a.Array.find(c,function(e){return e.id===d});if(b===null){b=c[0]}}else{b={}}return b};YUI.geowidget.MarkerFactory.prototype.getNormalIcon=function(b){if(b===undefined){return"assets/logo/logo.png"}else{return YUI.geowidget.Model.root+"/"+this.lookupIcon(b).image}};YUI.geowidget.MarkerFactory.prototype.getOverIcon=function(b){if(b===undefined){return"assets/logo/overLogo.png"}else{return YUI.geowidget.Model.root+"/"+this.lookupIcon(b).overImage}};YUI.geowidget.MarkerFactory.prototype.getzIndex=function(d){var c=this;if(d){var b=c.lookupIcon(d);if(b.zIndex){return function(){return b.zIndex}}}return undefined};YUI.geowidget.MarkerFactory.prototype.getClusterIcon=function(c){var b=this.lookupCluster(c);return{url:b.image?YUI.geowidget.Model.root+"/"+b.image:"assets/logo/cluster.png",width:b.width||30,height:b.height||30,opt_anchor:[b.anchorY||0,b.anchorX||0],opt_textColor:b.color||"#000000",opt_textSize:b.fontSize||11}};YUI.geowidget.MarkerFactory.prototype.createIcon=function(c){var d=new google.maps.Icon();d.image=this.getNormalIcon(c.icon);if(c.icon===undefined){d.iconSize=new google.maps.Size(32,37);d.iconAnchor=new google.maps.Point(6,37)}else{var b=this.lookupIcon(c.icon);d.iconSize=new google.maps.Size(b.width,b.height);if(b.anchorX===undefined||b.anchorY===undefined){d.iconAnchor=new google.maps.Point(b.width/2,b.height/2)}else{d.iconAnchor=new google.maps.Point(b.anchorX,b.anchorY)}}return d};YUI.geowidget.MarkerFactory.prototype.createMarker=function(e){var b=YUI.geowidget.Model.config.features.showRoute||e.hasInfoWindow();var d=new google.maps.Marker(e.latLng,{icon:this.createIcon(e),title:e.city,clickable:b,zIndexProcess:this.getzIndex(e.icon)});if(b){var f=this.getNormalIcon(e.icon);var c=this.getOverIcon(e.icon);google.maps.Event.addListener(d,"mouseover",function(){d.setImage(c)});google.maps.Event.addListener(d,"mouseout",function(){d.setImage(f)});this.addInfoToMarker(d,e)}d._location=e;return d};YUI.geowidget.MarkerFactory.prototype.createMarkers=function(b){var c={};var d=this;b.every(function(f){var e=d.createMarker(f);var g=f.cluster;f.marker=e;f.iconImage=d.getNormalIcon(f.icon);if(!c[g]){c[g]=[]}c[g].push(e);if(YUI.geowidget.Model.config.features.dontCluster){d.map.addOverlay(e)}d.createEdges(f,b)});if(!YUI.geowidget.Model.config.features.dontCluster){YUI.geowidget.Model.clusterers={};a.Object.each(c,function(g,f){if(f==="undefined"){f=undefined}var e=new MarkerClusterer(d.map,g,{gridSize:d.lookupCluster(f).gridSize||50,maxZoom:15,styles:[d.getClusterIcon(f)],zoomOnClick:false});YUI.geowidget.Model.clusterers[f]=e;google.maps.Event.addListener(e,"clusterclick",function(i){var k=i.getRealMarkers();var h=a.Array.map(k,function(l){return l._location});YUI.geowidget.Model.selectedClusterLocations=h;var j=d.infoWindowFactory.createSummaryInfoWindow(d.map,h,function(l){YUI.geowidget.Model.setLocation(l)});d.map.openInfoWindow(i.getCenter(),j)})})}};YUI.geowidget.MarkerFactory.prototype.createEdges=function(c,b){var f=this;var g=YUI.geowidget.Model.config.layout.edges||{};if(a.Lang.isArray(c.edges)){var d=a.Array.indexOf(b,c);var e=[];a.Array.each(c.edges,function(i){if(i>d){var j=b[i];var h=new google.maps.Polyline([c.latLng,j.latLng],g.color||"#658DBA",g.size||4,g.opacity||0.5,{geodesic:g.geodesic||false});f.map.addOverlay(h);e.push(h)}});c.showEdges=function(){a.Array.each(e,function(h){h.show()})};c.hideEdges=function(){a.Array.each(e,function(h){h.hide()})}}};YUI.geowidget.MarkerFactory.prototype.createKMLs=function(b){var c=this;if(b){a.Array.each(b,function(d){var e=a.substitute(d.url,{root:location.protocol+"//"+location.host+"/geowidget-js/"+YUI.geowidget.Model.root});d.marker=new google.maps.GeoXml(e,function(){if(d.marker.loadedCorrectly()){}else{alert("could not load kml: "+e)}});c.map.addOverlay(d.marker)})}}},"0.0.1",{requires:["collection"]});YUI().add("geowidget.Model",function(b){YUI.namespace("geowidget");YUI.geowidget.Model=new b.Attribute();var a=YUI.geowidget.Model;a.addAttr("visibleLocations",{getter:function(c){return c||a.config.locations}});a.addAttr("hiddenLocations",{getter:function(c){return c||[]}});a.addAttr("selectedLocation",{});a.setLocation=function(c){a.set("selectedLocation",c)}},"0.0.1",{requires:["attribute"]});if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(b){var a=this.length;var c=Number(arguments[1]);if(isNaN(c)){c=a-1}else{c=(c<0)?Math.ceil(c):Math.floor(c);if(c<0){c+=a}else{if(c>=a){c=a-1}}}for(;c>-1;c--){if(c in this&&this[c]===b){return c}}return -1}}eval(function(h,b,i,d,g,f){g=function(a){return(a<b?"":g(parseInt(a/b)))+((a=a%b)>35?String.fromCharCode(a+29):a.toString(36))};if(!"".replace(/^/,String)){while(i--){f[g(i)]=d[i]||g(i)}d=[function(a){return f[a]}];g=function(){return"\\w+"};i=1}while(i--){if(d[i]){h=h.replace(new RegExp("\\b"+g(i)+"\\b","g"),d[i])}}return h}("m $p,18;$p=18={14:q(a,b){1O{o(b||U).1z(a)}1P(e){5.11('2K')}},3s:q(){m a=['m $p, 18;$p = 18 = {','$21:',5.$21.1e(),',','$c:',5.$c.1e(),',','E:',5.E.1e(),',','O:[], 11:'+5.11.1e()+'};'];K(m b 1f 5.O){8(5.O.22(b)){m c='$p.O[\\''+b+'\\']';a.u(c+'={};'+c+'.1A=');a.u(5.O[b].1A.1e()+';');K(m d 1f 5.O[b]){8(d!='1A'){a.u('$p.O[\\''+b+'\\'].'+d+'='+5.O[b][d].1e()+';')}}}}m e=U.2L('2m');8(e){e.3t=a.12('');e.2M()}x{5.11('2N')}},$f:{1Q:0},$c:q(a,b,c){8(b=='I'){o a}8(B a=='3u'){m d=b.1n(/\\./);m e=a[d[0]];K(m i=1;i<d.y;i++){8(!e){2n}e=e[d[i]]}}8(!e&&e!=0){e=c?1g:''}o e},E:q(){m a,1o,I,2o=1B[2];8(B 1B[1]==='1C'){1o=1B[1];I=1B[0]}x{1o=1B[0];I=1B[1]}8(B 1o!='1C'){m b=2o?5.1R(2o,1o):1o.1D(F);a=5.O.y||0;5.M(b,a,I,J)}x{a=1o}8(5.O[a]){o 5.O[a].1A(I)}x{5.11('2O',a)}},V:q(a,b,c){8(B a!='1C'){8(!a){5.11('2P');o J}a.1p(5.z.1E,'F')}o 5.E(a,b,c)},O:{},$21:q(a){(/\\\"/).C(a[1])&&(a[1]=a[1].D(/\\\\\\\"|\\\"/g,'&1F;'));m b=a.12('');o(/\\=\\\"\\\"/.C(b))?'':b},z:{1G:/1q\\s+(6|7)/.C(1r.1s)?'2p':'1t',1u:/1q/.C(1r.1s)?'3v':'18:',2Q:/1q/.C(1r.1s)?'3w':'18:1t',1E:/1q/.C(1r.1s)?'3x':'18:V',1h:/1q/.C(1r.1s)?'3y':'18:23',1v:/1q/.C(1r.1s)?'3z':'18:1i',1S:[],1T:[],3A:[],2R:q(a){o B a.y==='2q'&&!(a.2S('y'))&&B a.2T==='q'},2U:q(n,a,b,c){m d,k,j,G,1U,Y,v,19;8(a=='F'){v=n.13(5.1G);8(v){d=v.D(/^\\d|\\s\\d/g,'').1n(/\\s+/);K(j=0;j<d.y;j++){1U='';19=5.2r(d[j]);G=19.2s.1n(/@/);8(c.y>0){K(k=c.y-1;k>=0;k--){Y=c[k]=='I'?$p.$c(b[0],G[0],F):$p.$c(b[c[k]][0],G[0],F);8((Y||Y==0)&&G[0]!=='I'){1U=c[k];2n}}}8(!Y&&Y!=0){Y=G[0]!='I'?$p.$c(b,G[0],F):!(/I/).C(c.12(''))?b:F}8(Y||Y==0){8(B Y.y==='2q'&&!(Y.2S('y'))&&B Y.2T==='q'){c.u(G[0]);n.1p(5.1h,G[0]+'<-'+G[0])}x{8(1U!==''){G[0]=1U+'[\\''+G[0].D(/\\./g,'\\'][\\'')+'\\']'}8(!G[1]){G.u('1i')}8(19.24){G[0]=5.2t(G[0],G[1],n,19.24)}8(G[1]!='1i'){5.25(n,G[1])}8(!n.13(5.1u+G[1])){n.1p(5.1u+G[1],G[0])}}}}8(n.13(5.2Q)&&n.13(5.1G)){n.1V(5.1G)}}}m e=n.13(5.1v);8(e){5.1S.u(n)}m f=n.13(5.1h);8(f){5.1T.u(n)}},2V:q(a,b){m d=5.1E;5.1T=[];5.1S=[];m f=a.13(d);a.1V(d);m g=[];m c=a,n=1g;2W{8(c.1H==1){5.2U(c,f,b,g)}n=c.3B;8(n===1g){n=c.2u}m h=c;8(n===1g){h=c;2W{n=h.1W?h.1W:a;8(n==a){2n}h=n;n=n.2u}2v(n===1g)}c=n}2v(c!=a);m k,1I,26,1w,27=J;K(m j=5.1S.y-1;j>=0;j--){1O{n=5.1S[j];1w=n.13(5.1v);8(1w){m l=1w.15(/\\|(a|p)\\|/);8(l){8(l[1]=='a'){n.1j+=5.1v+'=\"'+1w.R(l.16+3)+'\"'}x{n.1j=5.1v+'=\"'+1w.R(l.16+3)+'\"'+n.1j}}x{n.1j=5.1v+'=\"'+1w+'\"'}n.1V(5.1v)}}1P(e){}}K(m i=5.1T.y-1;i>=0;i--){n=5.1T[i];1O{26=n.13(5.1h);8(26){k=n.1D(F);k.1V(5.1h);1I=U.2w(5.1h);1I.2X(k);1I.1p('2Y',\"\"+26);8(a==n){27=5.28(1I)}x{n.1W.3C(1I,n)}}}1P(3D){}}o(27)?27:J},2t:q(a,b,c,d){8(d){8(!b){b='1i'}m e=b=='1t'?5.1G:b;m f=c.13(e)||('1i'==b?'1i':1g);8(f){o f+'|'+d+'|'+a}}o a},2r:q(a){m b,2x;a=(b=/^\\+/.C(a))?a.2Z(1):(2x=/\\+$/.C(a))?a.2Z(0,-1):a;o{24:(2x)?'a':(b)?'p':J,2s:a}},25:q(a,b){8(b=='1t'){b=5.1G}1O{a[b]='';a.1V(b)}1P(e){}},30:q(a){o['29.u(',a,');'].12('')},1X:q(a){o['29.u(',\"'\",a,\"');\"].12('')},31:q(a,b){8(b){o a+'({I:I, 3E:'+b+',3F:'+b+'1a==\\'0\\'?0:32('+b+'1a)||'+b+'1a, 3G:'+b+'['+b+'1a==\\'0\\'?0:32('+b+'1a)||'+b+'1a]})'}x{o a+'({I:I})'}},33:q(a){o'$p.$c(I, '+a+')'},2y:q(a,b){m c=/\\[[^\\]]*\\]/.C(a);m d=a.D(/(\")|(')/g,'').1n(/\\./);o c||b[d[0]]?F:J},2z:q(a){m b=a.15(/\\w*/)[0]||'';m c=a.R(b.y).D(/\\[\\s*\\]/,'');8(/\\./.C(c)){c=c.D(/^\\./,'[\\'').D(/\\./g,'\\'][\\'')+'\\']'}o b+'['+b+'1a]'+c.D(/\\\\\\'/g,\"'\")},2A:[{1k:2a?2B 34(2a.2C.1e().R(0,2a.2C.1e().2b(2a.2C.3H)),'g'):'',1l:''},{1k:/\\>\\s+</g,1l:'> <'},{1k:/\\r|\\n/g,1l:''},{1k:/\\\\\\'|\\'/g,1l:'\\\\\\''},{1k:/\\s+[^\\s]+\\=\\\"\\\"(?=[^\\>]|\\>)/3I,1l:''},{1k:/^\\s+/,1l:''}],28:q(c){o c.28||(q(a){m b=U.2w('35');b.2X(a);o b.1j})(c)},36:q(a,b){m c=a[0]&&!a.1H?a[0].1D(F):a.1D(F);m d=5.2V(c,b);8(!d){d=5.28(c)}d=d.D(2B 34('<\\/?:?'+5.1h,'37'),5.1h);m e=5.2A;K(m i=0;i<e.y;i++){d=d.D(e[i].1k||'',e[i].1l)}o d.1n(5.1u)}},3J:q(a,b,c,d){a.1p(5.z.1E,'F');o 5.M(a,b,c,d)},M:q(a,b,c,d){m f=5.z.36(a,c);8(!b&&B b!='2q'){5.11('38',f.12(''),a);o J}m g,L,1J=J,1K,1m=[],1Q=1,2c='',1L,1x,1M,1b,S,2d,2e,2f,1Y,2D,N='',v='',1c=[],1y,P;5.O[b]={};m h=['{m 29 = [];'];8(f[0]!==\"\"){h.u(5.z.1X(f[0]))}K(m j=1;j<f.y;j++){L=f[j];8(/^23[^\\>]*\\>/i.C(L)){1J=L.15(/^23[^\\>]*>/i);1K=1J[0].15(/\"[^\"]*\"/);8(1K){1K=1K[0].D(/&3K;/,'<').D(/\"/g,'').D(/\\s/g,'');2c=1K.1n(/<-/);S=2c[0];1y=2c[1]||'';8(5.z.2y(1y,1m)){h.u('m '+S+'='+5.z.2z(1y)+';')}x{8(/I/i.C(1y)||1y.y==0){8(!(/I/i).C(S)){h.u('m '+S+'= I;')}}x{h.u('m '+S+'= $p.$c(I, \"'+1y+'\");')}}h.u('K(m '+S+'1a 1f '+S+'){8 ('+S+'.22('+S+'1a)){');h.u(5.z.1X(L.R(1J[0].y)));1m[S]=1Q++}x{h.u('}}');39 1m[S];2e=0;K(1Y 1f 1m){8(1m.22(1Y)){2f=1m[1Y];8(2f>2e){2e=2f;S=1Y}}}h.u(5.z.1X(L.R(1J[0].y,L.y)))}1J=J;3L}x{N=L.R(0,L.2b('='));v=L.15(/\\=\"\"?[^\"]*\"\"?/)[0].2g(2).D(/\"$/,'');2D=N.y+v.y+3;8(/&1F;/.C(v)){v=v.D(/&1F;/g,'\"');L=L.D(/&1F;/,'\"').D(/&1F;/,'\"')}2d=/^1i/i.C(L);P=2d?[]:['\\''+N+'=\"\\''];1x=v.15(/\\|(a|p)\\|/);1b='';1M=N!=='1t'?'':' ';8(1x){8(1x[1]=='a'){P.u('\\''+v.R(0,1x.16)+1M+'\\'')}x{1b=v.R(0,1x.16)}v=v.R(1x.16+3)}8(/\\$f\\[(f[0-9]+)\\]/.C(v)){1L=v.15(/\\[(f[0-9]+)/)[1];5.O[b]['$'+1L]=5.$f[1L];39 5.$f[1L];5.$f.1Q--;P.u(5.z.31('5.$'+1L,S));8(1b!==''){P.u('\\''+1M+1b+'\\'')}}x 8(/^\\\\\\'|&1F;/.C(v)){P.u('\\''+v.D(/^\\\\\\'|\\\\\\'$/g,'')+'\\'');8(1b!==''){P.u('\\''+1M+1b+'\\'')}}x{8(!(/1q/).C(1r.1s)){1c=v.1n(/(#\\{[^\\}]*\\})/g)}x{m i=v.15(/#\\{[^\\}]*\\}/);1c=i?[]:[v];2v(i){8(i.16>0){1c.u(v.R(0,i.16))}1c.u(i[0]);v=v.R(i.3M);i=v.15(/#\\{[^\\}]*\\}/);8(!i&&v!==''){1c.u(v)}}}K(m k=0;k<1c.y;k++){v=1c[k];8(/\\#\\{/.C(v)||1c.y==1){v=v.D(/^\\#\\{/,'').D(/\\}$/,'');8(5.z.2y(v,1m)){P.u(5.z.2z(v))}x{P.u(5.z.33(\"'\"+v+\"'\"))}}x 8(v!==''){P.u('\\''+v+'\\'')}8(1b!==''){P.u('\\''+1M+1b+'\\'')}}}8(!2d){P.u('\\'\"\\'')}}h.u(5.z.30(P.y>1?'$p.$21(['+P.12(',')+'])':P[0]));L=L.2g(2D);8(L!==''){h.u(5.z.1X(L))}}h.u('o 29.12(\"\");}');g=h.12('');8(!d){1O{5.O[b].1A=2B 3N('I',g)}1P(e){5.11('3a',[e.3O,g]);o J}}o g},1R:q(a,b,c){8(!b[0]&&b.y==0){5.11('3b');o J}m d,1N=[],Q,T,19,1d,17,N,2h,1Z,W,i,V,20=[];8(c){T=b[0]&&!b.1H?b[0]:b}x{T=b[0]&&!b.1H?b[0].1D(F):b.1D(F)}V=T.13(5.z.1E)||J;K(W 1f a){8(a.22(W)){Q=a[W];8(5.z.2R(Q)){1N=Q}x{1N=[];1N.u(Q)}K(i=0;i<1N.y;i++){Q=1N[i];19=5.z.2r(W);W=19.2s;1d=W.15(/\\[[^\\]]*\\]/);8(/^\\[|^\\.$/.C(W)){17=T}x{17=5.14(W,T);8(!17&&1d){17=5.14(W.2g(0,1d.16),T)}}8(17){8(B Q=='q'){d='f'+5.$f.1Q++;5.$f[d]=Q;Q='$f['+d+']'}N='1i';2h=-1;8(1d){N=W.R(1d.16+1,1d[0].y+1d.16-1);8(N.2b(5.z.1u)>-1){N=N.R(5.z.1u.y)}}x{2h=Q.3P(/w*<-w*/);8(2h>-1){N='23'}}Q=Q.D(/^\"|\"$|\\'|\\\\\\'/g,'\\\\\\'');Q=5.z.2t(Q,N,17,19.24);17.1p(5.z.1u+N,Q);8(1d){8(N!='1t'){5.z.25(17,N)}x 8(V!='F'){20.u(17)}}}x{1Z=[T.3Q];8(T.2i!==''){1Z.u('#'+T.2i)}8(T.2p!==''){1Z.u('#'+T.2p)}5.11('3c',[W,1Z.12('')],T)}}}}8(20.y>0){K(i=0;i<20.y;i++){5.z.25(20[i],'1t')}}o T},3d:{'2P':'2E 2Y 2j 3R 3e V 3f 2F 3g. 3S 3h W 3T.','3c':\"2G - 3U 14 2H 3i \\\"&\\\" 1f \\\"&\\\"\",'2N':'3V 3W 2H 2G 3X, 3Y a <3j 2i=\\\"2m\\\"></3j> 3Z 1f 3h U.','3b':'2E 1R q 40\\'t 41 a 42 2j 3i','38':'A 43 3k 44 45 46 2H 2j: &','2O':'2E 2j: & 3f 2F 3g 47 3k 2F 48 1A','2K':'49 4a 3e 4b 2G, 4c 4d a 4e 4f 4g 4h: 4i, 4j, X, 4k, 4l,...','3a':'4m 4n: \\\"&\\\" 1f: &'},11:q(a,b,c){m d=5.3d[a]||a;m e=/&/,i;8(d!=a&&b){8(B b=='1C'){d=d.D(e,b)}x{K(i=0;i<b.y;i++){d=d.D(e,b[i])}}}m f=U.2L('2m');8(f){f.1j=[d,'\\n',f.1j].12('')}x{4o(d)}},H:{Z:q(a,b){o $p.1R(b,a)},M:q(a,b,c,d){m e=a;8(d){e.1p($p.z.1E,'F')}8(c){e=$p.1R(c,a)}o $p.M(e,b,d||J,J)},E:q(a,b,c,d,e){m f=a;8(B d!=='10'){f=B d!=='1C'&&d[0]||d}x 8(B c!=='10'&&(c.3l||c.2I||c.1H||B c==='1C')){f=(c.3l||c.2I)?c[0]:c;c=1g}o 5.3m(a,e===F?$p.V(f,b,c):$p.E(f,b,c))},3m:q(a,b){m c=U.2w('35');m d=a;m e=d.1W;e.3n(c,d);c.1j=b;m f=c.4p;m g=[];K(m i=f.y-1;i>=0;i--){g.u(d.1W.3n(f[i],d.2u))}e.3o(d);e.3o(c);o g.y>1?g:g[0]}}};8(B X!=='10'){8(X.3p){X.3p[0]=/^(\\[) *@?([\\w:\\-]+) *([!*$\\^~=]*) *('?\"?)(.*?)\\4 *\\]/}$p.z.2A.u({1k:/\\s?X[^\\s]+\\=\\\"1g\\\"/37,1l:''});8(B U.1z==='10'){$p.14=q(a,b){m c=X.14(a,b);o c[0]||J}}X.2k.Z=q(a){o X($p.H.Z(5[0],a))};X.2k.M=q(a,b,c){$p.H.M(5[0],a,b,c);o 5};X.2k.E=q(a,b,c){o X($p.H.E(5[0],a,b,c))};X.2k.V=q(a,b,c){o X($p.H.E(5[0],a,b,c,F))}}x 8(B 3q!=='10'){8(B U.1z==='10'){$p.14=q(a,b){m c=$(b).2I(a);o c[0]||J}}3q.4q({4r:['Z','M','E','V'],Z:q(a){o $($p.H.Z(5,a))},M:q(a,b,c){$p.H.M(5,a,b,c);o 5},E:q(a,b,c){o $($p.H.E(5,a,b,c))},V:q(a,b,c){o $($p.H.E(5,a,b,c,F))}})}x 8(B 4s!=='10'){8(B U.1z==='10'){$p.14=q(a,b){m c=$(b).4t(a);o c||J}}3r.4u({Z:q(a){o $($p.H.Z(5,a))},M:q(a,b,c){$p.H.M(5,a,b,c);o 5},E:q(a,b,c){o $($p.H.E(5,a,b,c))},V:q(a,b,c){o $($p.H.E(5,a,b,c,F))}})}x 8(B 4v!=='10'){8(B U.1z==='10'){$p.14=q(a,b){m c=$(b).2M(a);8(!c||c===''){m d=a.2b('#');8(d>-1){m e=a.2g(d+1);m f=b.4w('*');K(m i=0,2l;2l=f[i];i++){8(2l.2i==e){o 2l}}}}o c[0]||J}}3r.4x({Z:q(a,b){o $($p.H.Z(a,b))},M:q(a,b,c,d){$p.H.M(a,b,c,d);o 5},E:q(a,b,c,d){o $($p.H.E(a,b,c,d))},V:q(a,b,c,d){o $($p.H.E(a,b,c,d,F))}})}x 8(B 2J!=='10'){8(B U.1z==='10'){$p.14=q(a,b){m c=2J(a,b);o c[0]||J}}$p.4y=q(d,e){d=d||U;m f=d.1H?[d]:2J(d,e);m g=f;g.Z=q(a){g[0]=$p.H.Z(g[0],a);o g};g.M=q(a,b,c){$p.H.M(g[0],a,b,c);o g};g.E=q(a,b,c){g[0]=$p.H.E(g[0],a,b,c);o g};g.V=q(a,b,c){g[0]=$p.H.E(g[0],a,b,c,F);o g};o g}}",62,283,"|||||this|||if||||||||||||||var||return||function||||push|attValue||else|length|utils||typeof|test|replace|render|true|att|libs|context|false|for|wrkStr|compile|attName|compiledFunctions|fullAtt|currentDir|substring|currentLoop|clone|document|autoRender|selector|jQuery|prop|mapDirective|undefined|msg|join|getAttribute|find|match|index|target|pure|ap|Index|suffix|attValues|isAttr|toString|in|null|REPEAT|nodeValue|innerHTML|what|by|openArrays|split|html|setAttribute|MSIE|navigator|userAgent|class|NS|NODEVALUE|nodeValueSrc|attOut|arrSrc|querySelector|compiled|arguments|string|cloneNode|AUTO|quot|CLASSNAME|nodeType|replacer|rTag|rSrc|fnId|spc|multipleDir|try|catch|cnt|map|nodeValues|repeats|repeatPrefix|removeAttribute|parentNode|strOut|key|parentName|classToDelete|outAtt|hasOwnProperty|repeat|type|removeAtt|replacedSrc|str|outerHTML|output|window|indexOf|subSrc|isNodeValue|max|curr|substr|repetition|id|HTML|fn|el|pureMsg|break|directives|className|number|ap_check|clean|ap_format|nextSibling|while|createElement|append|isArray|arrayName|domCleaningRules|new|location|offset|The|not|PURE|the|cssSelect|Sizzle|library_needed|getElementById|select|place_runtime_container|HTML_does_not_exist|wrong_html_source|PURECLASS|isTypeOfArray|propertyIsEnumerable|splice|autoMap|nodeWalk|do|appendChild|source|slice|out|outputFn|parseInt|contextOut|RegExp|div|html2str|gi|no_HTML_name_set_for_parsing|delete|parsing_error|no_HTML_selected|element_to_map_not_found|messages|to|does|exist|your|element|textarea|is|jquery|replaceWithAndReturnNew|insertBefore|removeChild|parse|DOMAssistant|Element|getRuntime|value|object|pure_|pure_class|pure_autoRender|pure_repeat|pure_nodeValue|autoRenderAtts|firstChild|replaceChild|e2|items|pos|item|pathname|ig|autoCompile|lt|continue|lastIndex|Function|message|search|nodeName|provided|Check|syntax|Cannot|To|collect|runtime|place|somewhere|didn|receive|valid|name|needed|when|parsing|or|yet|In|order|run|you|need|JS|library|such|as|dojo|domAssistant|mootools|prototype|Parsing|error|alert|childNodes|attach|publicMethods|MooTools|getElement|implement|Prototype|getElementsByTagName|addMethods|sizzle".split("|"),0,{}));YUI({modules:{"yui2-yde":{fullpath:"http://yui.yahooapis.com/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js"},"yui2-datasource":{fullpath:"http://yui.yahooapis.com/2.7.0/build/datasource/datasource-min.js"},"yui2-autocomplete":{fullpath:"http://yui.yahooapis.com/2.7.0/build/autocomplete/autocomplete-min.js",requires:["yui2-yde","yui2-fonts","yui2-autocompletecss","yui2-datasource"]},"yui2-fonts":{fullpath:"http://yui.yahooapis.com/2.7.0/build/fonts/fonts-min.css",type:"css"},"yui2-autocompletecss":{fullpath:"http://yui.yahooapis.com/2.7.0/build/autocomplete/assets/skins/sam/autocomplete.css",type:"css"}}}).use("geowidget.manager.ClusterManager","geowidget.Model","node","substitute","geowidget.ConfigLoader","geowidget.InfoWindowFactory","geowidget.component.LocationSelector","geowidget.component.LocationList","geowidget.component.LocationFilter","geowidget.MarkerFactory","geowidget.manager.ZoomManager","geowidget.manager.DirectionsManager","geowidget.manager.LayoutManager","geowidget.component.ZoomOutButton","geowidget.I18N",function(a){YUI.geowidget.ConfigLoader.loadConfig(function(c){var b=function(d){return a.substitute(d,{root:YUI.geowidget.Model.root})};YUI.ms.TemplateLoader=YUI.ms.TemplateLoader({urlMapper:b});YUI.geowidget.ConfigLoader.preloadTemplates(function(){var l=YUI.geowidget.Model.config.templates.body;a.one("#gw-layout").set("innerHTML",YUI.ms.TemplateLoader.getTemplate(l));var j=false;var e=false;var i=true;var d=new google.maps.Map2(document.getElementById("map_canvas"));d.enableContinuousZoom();d.enableScrollWheelZoom();d.setMapType(YUI.geowidget.ConfigLoader.getMapType());if(c.features.showMapTypes){d.addMapType(G_PHYSICAL_MAP);d.addControl(new google.maps.MapTypeControl())}if(c.features.showZoom){d.addControl(new google.maps.LargeMapControl3D())}if(c.features.showOverview){d.addControl(new google.maps.OverviewMapControl())}google.maps.Event.addListener(d,(a.UA.ie>0)?"load":"tilesloaded",function(){e=true;if(j&&e&&i){YUI.geowidget.manager.LayoutManager.unblock();i=false}});YUI.geowidget.Model.managers={};YUI.geowidget.Model.managers.directionsManager=new YUI.geowidget.manager.DirectionsManager(d);YUI.geowidget.Model.managers.zoomManager=new YUI.geowidget.manager.ZoomManager(d);YUI.geowidget.Model.managers.clusterManager=new YUI.geowidget.manager.ClusterManager(d);var m=YUI.geowidget.Model.managers;var g=new YUI.geowidget.MarkerFactory(d,YUI.geowidget.InfoWindowFactory,m.zoomManager);g.createMarkers(c.locations);g.createKMLs(c.kmls);if(c.features.showSearch){var k=new YUI.geowidget.component.LocationSelector("search_form",c.infoText||"Please enter your location");k.on("enter",function(){YUI.geowidget.util.GeoUtil.getNearestLocation(k.getValue(),function(n,o){YUI.geowidget.Model.selectedPosition=n;m.directionsManager.calcRoute(n,o)})})}else{a.Node.get("#search_form").remove()}var h=new YUI.geowidget.component.LocationList("#location_list",c.features.showLocationList,d);var f=new YUI.geowidget.component.LocationFilter("#location_filter",c.features.showLocationFilter,c.locations);YUI.geowidget.manager.LayoutManager.arrange(d);m.zoomManager.zoomToOverview();if(c.features.showWelcomeText){d.openInfoWindowHtml(d.getCenter(),c.features.welcomeText)}if(c.features.showWelcomeLocation){YUI.geowidget.Model.setLocation(c.locations[c.features.welcomeLocation])}j=true;if(j&&e&&i){YUI.geowidget.manager.LayoutManager.unblock();i=false}})})});
