/**
 *  Maptimize Embedded Script 2.0
 *  
 *  Copyright 2008 - 2011 Xilinus - All rights reserved
**/

/*
* LabeledMarker Class, v1.2
*
* Copyright 2007 Mike Purvis (http://uwmike.com)
* 
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* 
*       http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This class extends the Maps API's standard GMarker class with the ability
* to support markers with textual labels. Please see articles here:
*
*       http://googlemapsbook.com/2007/01/22/extending-gmarker/
*       http://googlemapsbook.com/2007/03/06/clickable-labeledmarker/
*/

/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
(function(window){var document=window.document,Array=window.Array,Object=window.Object,encodeURIComponent=window.encodeURIComponent,setTimeout=window.setTimeout,parseInt=window.parseInt,console=window.console,EMPTY_FUNCTION=function(){};var _toString=Object.prototype.toString,_hasOwnProperty=Object.prototype.hasOwnProperty,_slice=Array.prototype.slice,undefined=void (0);var Error=createClass(extend(beget(window.Error.prototype),(function(){function initialize(message){this.message=message}function toString(){return this.name+": "+this.message}return{name:"MaptimizeError",initialize:initialize,toString:toString}})()));var ArgumentError=createClass(extend(beget(Error.prototype),{name:"MaptimizeArgumentError"}));function extend(destination,source){for(var property in source){destination[property]=source[property]}if(source&&source.toString!==_toString){destination.toString=source.toString}return destination}function merge(object,other){var result=extend({},object);return extend(result,other)}function beget(object){function F(){}F.prototype=object;return new F}function removeProperty(object,property){var value=object[property];delete object[property];return value}function createClass(body,classMethods){var constructor=body.initialize;if(constructor==null){constructor=function(){}}var proto=constructor.prototype;extend(proto,body);proto.constructor=constructor;return extend(constructor,classMethods||{})}function isString(object){return _toString.call(object)==="[object String]"}function isArray(object){return _toString.call(object)==="[object Array]"}function restingArgs(args){return _slice.call(args,args.callee.length)}function each(iterable,callback){for(var i=0,l=iterable.length;i<l;i++){callback(iterable[i],i)}return iterable}function collect(iterable,callback){var results=new Array(iterable.length);for(var i=0,l=iterable.length;i<l;i++){results[i]=callback(iterable[i],i)}return results}function toArray(iterable){return _slice.call(iterable,0)}function isGoogleMapsV3(){return"google" in window&&!!google.maps.MVCObject}var COMPONENTS={};function getGoogleComponent(name){if(!(name in COMPONENTS)){COMPONENTS[name]="google" in window?google.maps[name]:window["G"+name]}return COMPONENTS[name]}function LatLng(lat,lng){if(lng==null&&isString(lat)){var coords=lat.split(/\s*,\s*/);lat=coords[0];lng=coords[1]}return new (getGoogleComponent("LatLng"))(lat,lng)}function LatLngBounds(sw,ne){return new (getGoogleComponent("LatLngBounds"))(sw,ne)}var distanceBetween=function(a,b){function distanceBetweenUsingDistanceFrom(a,b){return a.distanceFrom(b)}var R=6378137,D=Math.PI/180,cos=Math.cos,sin=Math.sin,sqrt=Math.sqrt;function distanceBetweenUsingTrigonometry(a,b){var lat1=a.lat(),lon1=a.lng(),lat2=b.lat(),lon2=b.lng(),dLat=(lat2-lat1)*D,dLon=(lon2-lon1)*D,x=sin(dLat/2)*sin(dLat/2)+cos(lat1*D)*cos(lat2*D)*sin(dLon/2)*sin(dLon/2);return R*2*Math.atan2(sqrt(x),sqrt(1-x))}distanceBetween=isGoogleMapsV3()?distanceBetweenUsingTrigonometry:distanceBetweenUsingDistanceFrom;return distanceBetween(a,b)};var getMapProjection=function(map){var DUMMY_OVERLAY;function getMapProjectionUsingDummyOverlay(){return DUMMY_OVERLAY.getProjection()}function getMapProjectionUsingMap(map){return map}if(isGoogleMapsV3()){DUMMY_OVERLAY=merge(new google.maps.OverlayView,{onAdd:EMPTY_FUNCTION,onRemove:EMPTY_FUNCTION,draw:EMPTY_FUNCTION});DUMMY_OVERLAY.setMap(map);getMapProjection=getMapProjectionUsingDummyOverlay}else{getMapProjection=getMapProjectionUsingMap}return getMapProjection(map)};var doBoundsContainOtherBounds=function(a,b){function doBoundsContainOtherBoundsUsingContainsBounds(a,b){return a.containsBounds(b)}function doBoundsContainOtherBoundsUsingUnion(a,b){var bounds=LatLngBounds(a.getSouthWest(),a.getNorthEast());return bounds.union(b).equals(a)}doBoundsContainOtherBounds=isGoogleMapsV3()?doBoundsContainOtherBoundsUsingUnion:doBoundsContainOtherBoundsUsingContainsBounds;return doBoundsContainOtherBounds(a,b)};function Point(x,y){return new (getGoogleComponent("Point"))(x,y)}function Icon(options){return new (getGoogleComponent("Icon"))(options)}function Size(width,height){return new (getGoogleComponent("Size"))(width,height)}function delegateEventMethod(name,args){return(getGoogleComponent("Event")||google.maps.event)[name].apply(null,args)}function addEventListener(){return delegateEventMethod("addListener",arguments)}function addDomEventListener(){return delegateEventMethod("addDomListener",arguments)}function bindEvent(source,eventName,object,callback){if(isGoogleMapsV3()){return google.maps.event.addListener(source,eventName,function(){callback.apply(object,arguments)})}else{return delegateEventMethod("bind",arguments)}}function triggerEvent(){delegateEventMethod("trigger",arguments)}function removeEventListener(){delegateEventMethod("removeListener",arguments)}function clearEventInstanceListeners(){delegateEventMethod("clearInstanceListeners",arguments)}function toQueryString(object){var properties=[],pairs=[];for(var property in object){if(object[property]!==undefined){properties.push(property)}}properties.sort();for(var i=0,l=properties.length;i<l;i++){pairs.push(encodeURIComponent(properties[i])+"="+encodeURIComponent(object[properties[i]]))}return pairs.join("&")}function imageURL(filename){return"http://v2.maptimize.com/images/"+filename}function swfURL(filename){return"http://v2.maptimize.com/swf/"+filename}var HEAD=document.getElementsByTagName("HEAD")[0],MAP_URL=window.MAPTIMIZE_MAP_URL;if(!MAP_URL){each(document.getElementsByTagName("SCRIPT"),function(script){if(script.src.match(/\/api\/v2-1\/.*\/embed/)){MAP_URL=script.src.replace(/embed.*$/,"")}})}function LabeledMarker(gLatLng,options){if(isGoogleMapsV3()){if(!(this instanceof google.maps.OverlayView)){LabeledMarker._a();return new LabeledMarker(gLatLng,options)}}else{if(!(this instanceof GMarker)){LabeledMarker._b();return new LabeledMarker(gLatLng,options)}}this._c=gLatLng;this._d=options;this._e=this._d.labelText;if(!isGoogleMapsV3()){this._f=this._d.labelClass;this._g=this._d.labelOffset;this._h=this._d.title||"";GMarker.apply(this,arguments)}}LabeledMarker._a=function(){LabeledMarker.prototype=extend(new google.maps.OverlayView,(function(){function onAdd(){this._i=document.createElement("DIV");this._i.className=this._d.labelClass;this._i.innerHTML=this._e;this._i.title=this._h;createCss.call(this);this._j=document.createElement("DIV");this._j.className=this._d.labelClass;this._j.style.position="absolute";var panes=this.getPanes();panes.overlayImage.appendChild(this._i);panes.overlayMouseTarget.appendChild(this._j);LabeledMarker._k(this)}function onRemove(){if(this._i&&this._i.parentNode){clearEventInstanceListeners(this._j);this._j.parentNode.removeChild(this._j);this._j=null;this._i.parentNode.removeChild(this._i);this._i=null}}function draw(){var pos=getPos.call(this);this._i.style.top=pos.y+"px";this._i.style.left=pos.x+"px";this._j.style.left=pos.x+"px";this._j.style.top=pos.y+"px"}function getPos(){var pos=this.getProjection().fromLatLngToDivPixel(this._c);pos.x-=this._d.icon.iconAnchor.x;pos.y-=this._d.icon.iconAnchor.y;return pos}function createCss(){var styles=[];styles.push("position:absolute");var image=this._d.icon.image;if(document.all){styles.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+image+'")')}else{styles.push("background:url("+image+") no-repeat center center;")}this._i.style.cssText=styles.join(";")}function element(){return this._i}return{onAdd:onAdd,onRemove:onRemove,draw:draw,element:element}})())};LabeledMarker._k=function(marker){function newEventPassthru(obj,name){return function(){triggerEvent(obj,name,obj)}}var eventPassthrus=["click","dblclick","mousedown","mouseup","mouseover","mouseout"];for(var i=0;i<eventPassthrus.length;i++){var name=eventPassthrus[i];addDomEventListener(marker._j||marker._i,name,newEventPassthru(marker,name))}};LabeledMarker._b=function(){LabeledMarker.prototype=extend(new GMarker(new GLatLng(0,0)),(function(){function initialize(map){GMarker.prototype.initialize.apply(this,arguments);this.map_=map;this._i=document.createElement("div");this._i.className=this._f;this._i.innerHTML=this._e;this._i.style.position="absolute";this._i.style.cursor="pointer";this._i.title=this._h;map.getPane(G_MAP_MARKER_PANE).appendChild(this._i);this.setLatLng(this._c);LabeledMarker._k(this)}function redraw(force){GMarker.prototype.redraw.apply(this,arguments);redrawLabel(this)}function redrawLabel(self){var p=self.map_.fromLatLngToDivPixel(self._c);var z=GOverlay.getZIndex(self._c.lat());self._i.style.left=(p.x+self._g.width)+"px";self._i.style.top=(p.y+self._g.height)+"px";self._i.style.zIndex=z}function remove(){clearEventInstanceListeners(this._i);if(this._i.outerHTML){this._i.outerHTML=""}if(this._i.parentNode){this._i.parentNode.removeChild(this._i)}this._i=null;GMarker.prototype.remove.apply(this,arguments)}function copy(){return new LabeledMarker(this._c,this._d)}function show(){GMarker.prototype.show.apply(this,arguments);this._i.style.visibility="visible"}function hide(){GMarker.prototype.hide.apply(this,arguments);this._i.style.visibility="hidden"}function setLatLng(gLatLng){this._c=gLatLng;GMarker.prototype.setLatLng.apply(this,arguments);redrawLabel(this)}return{initialize:initialize,redraw:redraw,remove:remove,copy:copy,show:show,hide:hide,setLatLng:setLatLng}})())};function Condition(condition){var SPECIAL_CHARS={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"};var self,string=parseCondition(condition);function parseCondition(condition){if(!condition){return""}return(isArray(condition)?parseArray:parseObject)(condition)}function parseObject(object){if(object instanceof Condition||isString(object)){return object.toString()}var result=Condition();for(var property in object){if(isArray(object[property])){result.appendAnd(property+" IN "+litteral(object[property]))}else{result.appendAnd(property+"="+litteral(object[property]))}}return result.toString()}function parseArray(array){return array.shift().replace(/(.)\?/g,function(_,chr){return chr==="\\"?"?":chr+litteral(array.shift())})}function litteral(object){if(isString(object)){return stringLitteral(object)}if(isArray(object)){return arrayLitteral(object)}return object===undefined?"":String(object)}function stringLitteral(string){var escapedString=string.replace(/[\x00-\x1f\\]/g,function(chr){if(chr in SPECIAL_CHARS){return SPECIAL_CHARS[chr]}return"\\u00"+chr.charCodeAt(0).toPaddedString(2,16)});return'"'+escapedString.replace(/"/g,'\\"')+'"'}function arrayLitteral(array){return"["+collect(array,litteral).join(",")+"]"}function appendAnd(condition){if(arguments.length>1){condition=toArray(arguments)}return merge("AND",condition)}function appendOr(condition){if(arguments.length>1){condition=toArray(arguments)}return merge("OR",condition)}function merge(operator,condition){condition=parseCondition(condition);if(!string){string=condition}else{string="("+string+")"+operator+"("+condition+")"}return self}function toString(){return string}return self=extend(beget(Condition.prototype),{appendAnd:appendAnd,appendOr:appendOr,toString:toString})}function MapStorage(_mapUrl){var _jSessionId;if(!/\/$/.test(_mapUrl)){_mapUrl+="/"}function clusterize(params){requires(params,"zoom","bounds");validates(params,"properties","zoom","bounds","aggregates","condition","groupingDistance","clusterMinSize","groupBy","callback","jsessionid");joinArrayParam(params,"aggregates");normalizeCondition(params);request("clusterize",params)}function select(params){validates(params,"properties","limit","offset","bounds","condition","callback","order","jsessionid");joinArrayParam(params,"properties");normalizeCondition(params);request("select",params)}function requestPoint(params){requires(params,"id");validates(params,"id","callback");select({properties:"id,html",condition:'id="'+params.id+'"',limit:1,callback:function(response){response.properties=removeProperty(response,"markers")[0];params.callback(response)}})}function request(path,params){requires(params,"callback");formatBounds(params);var url=_mapUrl+path,callback=removeProperty(params,"callback");if(_jSessionId){url+=";jsessionid="+_jSessionId}Request.send(url,params,function(response){_jSessionId=removeProperty(response,"jsessionid");callback(response)})}function requires(params){each(restingArgs(arguments),function(key){if(!(key in params)){throw new ArgumentError("Required parameter: "+key)}})}function validates(params){var validKeys=restingArgs(arguments);for(var key in params){if(!containsKey(validKeys,key)){throw new ArgumentError("Unknown parameter: "+key)}}}function containsKey(keys,key){var i=keys.length;while(i--){if(keys[i]===key){return true}}}function joinArrayParam(params,property){if(isArray(params[property])){params[property]=params[property].join(",")}}function formatBounds(params){if(params.bounds){var bounds=removeProperty(params,"bounds");params.sw=bounds.getSouthWest().toUrlValue();params.ne=bounds.getNorthEast().toUrlValue()}}function normalizeCondition(params){params.condition=Condition(params.condition)}return{clusterize:clusterize,select:select,requestPoint:requestPoint}}function ClusterizeCache(_map,_storage){var SW=LatLng(-89.965197,-180),NE=LatLng(89.965197,179.999999),WHOLE_EARTH=LatLngBounds(SW,NE),_revealedBounds,_currentZoom;function clusterize(params){if(_shouldPerformRequest(params)){params.bounds=_computeAreaBounds(params.bounds,params.zoom);params.callback=_wrapCallback(params.callback,params.bounds,params.zoom);_storage.clusterize(params);return true}return false}function clear(){_currentZoom=_revealedBounds=null}function _shouldPerformRequest(params){return params.zoom!==_currentZoom||!_revealedBounds||!doBoundsContainOtherBounds(_revealedBounds,params.bounds)}function _computeAreaBounds(bounds,zoom){var areaBounds=_expandBounds(bounds,zoom),sw=areaBounds.getSouthWest(),ne=areaBounds.getNorthEast();if(ne.lng()>sw.lng()&&bounds.getNorthEast().lng()<=bounds.getSouthWest().lng()){return WHOLE_EARTH}else{if(distanceBetween(sw,SW)<0.1&&distanceBetween(ne,NE)<0.1){return WHOLE_EARTH}else{return areaBounds}}}function _expandBounds(bounds,zoom){var projection=getMapProjection(_map),sw=projection.fromLatLngToContainerPixel(bounds.getSouthWest()),ne=projection.fromLatLngToContainerPixel(bounds.getNorthEast());sw=projection.fromContainerPixelToLatLng(_expandPoint(sw,-1));ne=projection.fromContainerPixelToLatLng(_expandPoint(ne,1));var wholeEarth=(sw.lng()>=ne.lng());if(sw.lng()>=bounds.getSouthWest().lng()||wholeEarth){sw=LatLng(sw.lat(),WHOLE_EARTH.getSouthWest().lng())}if(ne.lng()<=bounds.getNorthEast().lng()||wholeEarth){ne=LatLng(ne.lat(),WHOLE_EARTH.getNorthEast().lng())}return LatLngBounds(sw,ne)}function _expandPoint(point,factor){var x=point.x+factor*512,y=point.y-factor*512;return Point(_snap(x,256),_snap(y,256))}function _snap(number,round){return Math.floor(Math.floor(number/round)*round)}function _wrapCallback(callback,bounds,zoom){return function(response){_revealedBounds=bounds;_currentZoom=zoom;callback(response)}}return{clusterize:clusterize,clear:clear}}function MapController(map,options){var ORIGIN=LatLng(0,0),EMPTY_BOUNDS=LatLngBounds(ORIGIN,ORIGIN),WHOLE_EARTH=LatLngBounds(LatLng(-89.965197,-180),LatLng(89.965197,179.999999)),DEFAULT_OPTIONS={onClusterClicked:defaultOnClusterClicked,onMarkerClicked:defaultOnMarkerClicked,mapUrl:MAP_URL,theme:DEFAULT_THEME,popupLoadingContent:['<span class="maptimize_load_message">',"Loading, please wait...","</span>"].join("")},POPUP_ELEMENT=document.createElement("div"),EMPTY_MARKER,EMPTY_ICON,INFO_WINDOW;options=merge(DEFAULT_OPTIONS,options);var self,markers=[],clusters=[],theme=options.theme,active=true,storage,cache,condition,properties,aggregates,groupingDistance,clusterMinSize,groupBy,dragging,mouseWheelScrolling,mouseWheelScrollTimeoutId,viewDidChangeDefered;POPUP_ELEMENT.className="maptimize_popup";POPUP_ELEMENT.className+=" maptimize_info_window";setMapUrl(options.mapUrl);addEventListener(map,"moveend",viewDidChange);setTimeout(function(){if(doesUseOldEventHandling()){addListenersForOldEventHanding()}else{addEventListener(map,"markerClicked",options.onMarkerClicked);addEventListener(map,"clusterClicked",options.onClusterClicked)}if(isGoogleMapsV3()){addEventListener(map,"dragstart",dragDidStart);addEventListener(map,"dragend",dragDidEnd);addEventListener(map,"center_changed",centerDidChange);addEventListener(map,"zoom_changed",zoomDidChange)}},100);function doesUseOldEventHandling(){return"__e_" in self}function defaultOnClusterClicked(cluster){if(cluster.canExpandOnMap()){cluster.expandOnMap()}else{cluster.openPopup()}}function defaultOnMarkerClicked(marker){marker.openPopup()}function oldOnMarkerClicked(marker){triggerEvent(self,"markerClicked",marker)}function oldOnClusterClicked(cluster){if(cluster.canExpandOnMap()){cluster.expandOnMap()}else{triggerEvent(self,"clusterClicked",cluster)}}function addListenersForOldEventHanding(){addEventListener(map,"markerClicked",oldOnMarkerClicked);addEventListener(map,"clusterClicked",oldOnClusterClicked);addEventListener(map,"beforeRefresh",function(){triggerEvent(self,"beforeRefresh")});addEventListener(map,"afterRefresh",function(){triggerEvent(self,"afterRefresh")})}function setMapUrl(mapUrl){storage=MapStorage(mapUrl);cache=ClusterizeCache(map,storage)}function setCondition(newCondition){condition=Condition(newCondition);viewDidBecomeStale()}function setMarkerProperties(newProperties){properties=newProperties&&newProperties.join(",");viewDidBecomeStale()}function setClusterAggregates(newAggregates){aggregates=newAggregates&&newAggregates.join(",");viewDidBecomeStale()}function setGroupingDistance(distance){groupingDistance=parseInt(distance);viewDidBecomeStale()}function setClusterMinSize(size){clusterMinSize=size?parseInt(size):null;viewDidBecomeStale()}function setGroupBy(property){groupBy=property;viewDidBecomeStale()}function isMaxZoom(){if(isGoogleMapsV3()){return map.getZoom()>=21}else{return map.getBoundsZoomLevel(EMPTY_BOUNDS)===map.getZoom()}}function getMapSize(){if(isGoogleMapsV3()){var div=map.getDiv();return Size(div.offsetWidth,div.offsetHeight)}else{return map.getSize()}}function getMarkers(){return filterVisible(markers)}function getClusters(){return filterVisible(clusters)}function filterVisible(overlays){var result=[],visibleBounds=getVisibleBounds();if(visibleBounds.equals(WHOLE_EARTH)){return overlays}each(overlays,function(overlay){if(visibleBounds.contains(overlay.getGLatLng())){result.push(overlay)}});return result}function getVisibleBounds(){var actualBounds=map.getBounds();var d=Math.abs(getMapProjection(map).fromLatLngToContainerPixel(actualBounds.getNorthEast()).x-getMapSize().width);if(d<1){return actualBounds}else{return WHOLE_EARTH}}function getTotalPointsCount(){var count=getMarkers().length;each(getClusters(),function(cluster){count+=cluster.getPointsCount()});return count}function refresh(){if(!isMapReady()){return setTimeout(refresh,20)}cache.clear();viewDidChange()}function isMapReady(){return getMapProjection(map)}function deactivate(){if(active){each(markers,removeOverlayFromMap);each(clusters,removeOverlayFromMap);active=false}}function activate(){if(!active){active=true;refresh()}}function findObjectAtLocation(location){try{each(markers,function(marker){if(distanceBetween(marker.getGLatLng(),location)<=5){throw marker}});each(clusters,function(cluster){var bounds=cluster.getGLatLngBounds(),span=bounds.toSpan(),empty=(span.lat()<=0.00001||span.lng()<=0.00001);if(empty&&distanceBetween(bounds.getCenter(),location)<=5){throw cluster}else{if(bounds.contains(location)){throw cluster}}})}catch(object){if(object instanceof Cluster||object instanceof Marker){return object}else{throw object}}}function createEmptyMarker(){var iconURL=imageURL("maps/empty.gif");if(isGoogleMapsV3()){EMPTY_MARKER=new google.maps.Marker({position:ORIGIN,icon:iconURL});EMPTY_MARKER.setMap(map)}else{EMPTY_ICON=Icon({image:iconURL,iconSize:Size(1,1),iconAnchor:Point(1,1),infoWindowAnchor:Point(1,1)});EMPTY_MARKER=new GMarker(ORIGIN,EMPTY_ICON);map.addOverlay(EMPTY_MARKER)}}function populatePopupWithLoadingContent(){var content=options.popupLoadingContent;if(content.nodeType===1){POPUP_ELEMENT.innerHTML="";POPUP_ELEMENT.appendChild(content)}else{POPUP_ELEMENT.innerHTML=content}}function openPopup(overlay,contentCallback){if(!EMPTY_MARKER){createEmptyMarker()}populatePopupWithLoadingContent();if(isGoogleMapsV3()){EMPTY_MARKER.setPosition(overlay.getGLatLng());INFO_WINDOW=INFO_WINDOW||new google.maps.InfoWindow({content:POPUP_ELEMENT});INFO_WINDOW.close();var anchor=overlay.getGMarker()._d.icon.infoWindowAnchor;if(anchor){INFO_WINDOW.setOptions({pixelOffset:Size(anchor.x,anchor.y)})}INFO_WINDOW.open(map,EMPTY_MARKER)}else{var icon=overlay.getGMarker().getIcon();extend(EMPTY_ICON,{iconSize:icon.iconSize,iconAnchor:icon.iconAnchor,infoWindowAnchor:icon.infoWindowAnchor,infoShadowAnchor:icon.infoShadowAnchor});EMPTY_MARKER.setLatLng(overlay.getGLatLng());EMPTY_MARKER.openInfoWindowHtml(POPUP_ELEMENT)}contentCallback(POPUP_ELEMENT,INFO_WINDOW)}function openPopupForPointId(pointId){storage.requestPoint({id:pointId,callback:popupRequestDidFinish})}function popupRequestDidFinish(response){response=response.properties;var overlay=findObjectAtLocation(LatLng(response.coords));if(overlay){openPopup(overlay,function(popupElement){popupElement.innerHTML=response.html})}}function dragDidStart(){dragging=true;if(mouseWheelScrollTimeoutId){clearTimeout(mouseWheelScrollTimeoutId)}}function dragDidEnd(){dragging=false;if(mouseWheelScrolling){mouseWheelDidScroll()}else{viewDidChange()}}function centerDidChange(){if(!dragging){deferViewDidChange()}}function zoomDidChange(){if(dragging){mouseWheelScrolling=true}else{deferViewDidChange()}}function mouseWheelDidScroll(){mouseWheelScrolling=false;mouseWheelScrollTimeoutId=setTimeout(viewDidChange,100)}function deferViewDidChange(origin){if(!viewDidChangeDefered){viewDidChangeDefered=true;setTimeout(function(){viewDidChange();viewDidChangeDefered=false},0)}}function viewDidChange(){if(active&&isMapReady()){triggerEvent(map,"beforeRefresh");if(!clusterize({callback:clusterizeRequestDidFinish})){triggerEvent(map,"afterRefresh")}}}function clusterizeRequestDidFinish(response){if(!active){return}var oldMarkers=markers,oldClusters=clusters,maxZoom=isMaxZoom();markers=collect(response.markers,instantiateMarker);clusters=collect(response.clusters,function(clusterParams){return instantiateCluster(clusterParams,maxZoom)});triggerEvent(map,"beforeRedraw");replaceOverlays(oldMarkers,markers);replaceOverlays(oldClusters,clusters);triggerEvent(map,"afterRefresh")}function instantiateMarker(markerParams){var marker=Marker._l(markerParams);marker._m=theme;marker._n=storage.requestPoint;marker._o=openPopup;return marker}function instantiateCluster(clusterParams,maxZoom){var cluster=Cluster._l(clusterParams);cluster._m=theme;cluster._p=clusterizeWithoutCache;cluster._q=maxZoom;cluster._r=zoomOnBounds;cluster._o=openPopup;return cluster}function replaceOverlays(oldOverlays,newOverlays){each(oldOverlays,removeOverlayFromMap);each(newOverlays,function(o){o._s(map)})}function removeOverlayFromMap(overlay){overlay._t()}function zoomOnBounds(bounds){if(isGoogleMapsV3()){var zoom=map.getZoom();map.fitBounds(bounds);if(map.getZoom()<=zoom){map.setZoom(zoom+1)}}else{var zoom=map.getZoom(),newZoom=map.getBoundsZoomLevel(bounds);if(newZoom<=zoom){newZoom=zoom+1}map.setCenter(bounds.getCenter(),newZoom)}}function clusterize(params){return cache.clusterize(clusterizeParams(params))}function clusterizeWithoutCache(params){return storage.clusterize(clusterizeParams(params))}function clusterizeParams(params){return extend({zoom:map.getZoom(),bounds:getVisibleBounds(),condition:condition,aggregates:aggregates,properties:properties,groupingDistance:groupingDistance,clusterMinSize:clusterMinSize,groupBy:groupBy},params)}function select(params){storage.select(extend({bounds:getVisibleBounds(),condition:condition,properties:properties},params))}function requestBounds(callback){storage.clusterize({zoom:1,bounds:WHOLE_EARTH,condition:condition,groupingDistance:10000,callback:function(response){if(response.clusters.length==1){var bounds=response.clusters[0].bounds;callback(LatLngBounds(LatLng(bounds.sw),LatLng(bounds.ne)))}else{if(response.markers.length==1){var coords=response.markers[0].coords;callback(LatLngBounds(LatLng(coords),LatLng(coords)))}else{callback(WHOLE_EARTH)}}}})}function viewDidBecomeStale(){cache.clear()}return self={setMapUrl:setMapUrl,setCondition:setCondition,setClusterAggregates:setClusterAggregates,setGroupingDistance:setGroupingDistance,setClusterMinSize:setClusterMinSize,setMarkerProperties:setMarkerProperties,setGroupBy:setGroupBy,getMarkers:getMarkers,getClusters:getClusters,getTotalPointsCount:getTotalPointsCount,refresh:refresh,activate:activate,deactivate:deactivate,select:select,requestBounds:requestBounds,findObjectAtLocation:findObjectAtLocation,openPopupForPointId:openPopupForPointId}}var Overlay=createClass((function(){return{initialize:function(gLatLng){this._c=gLatLng},getGLatLng:function(){return this._c},getMap:function(){return this._u},_s:function(map){var marker=this.getGMarker();this._u=map;if(marker){if(isGoogleMapsV3()){marker.setMap(map)}else{map.addOverlay(marker)}this._v=bindEvent(marker,"click",this,this._w)}},_t:function(){var marker=this.getGMarker();if(marker){if(isGoogleMapsV3()){marker.setMap(null)}else{this._u.removeOverlay(marker)}removeEventListener(this._v)}},openPopup:function(contentCallback){var self=this;self._o(self,contentCallback||function(popupElement){self.requestContent(function(htmlContent){if(htmlContent){popupElement.innerHTML=htmlContent}})})}}})());var Marker=createClass(merge(Overlay.prototype,{initialize:function(id,gLatLng,properties){Overlay.call(this,gLatLng);this._x=id;this._y=properties},getId:function(){return this._x},setGMarker:function(gMarker){this._z=gMarker},getGMarker:function(){return this._z||(this._z=this._m.createMarker(this))},getProperties:function(){return this._y},getProperty:function(name){return this._y[name]},requestContent:function(callback){this.requestProperties(function(properties,status){callback(properties.html,status)})},requestProperties:function(callback){this._n({id:this._x,callback:function(response){callback(removeProperty(response,"properties"),response)}})},_w:function(){triggerEvent(this._u,"markerClicked",this)}}),{_l:function(marker){var latLng=LatLng(removeProperty(marker,"coords"));return new Marker(removeProperty(marker,"id"),latLng,marker)}});var Cluster=createClass(merge(Overlay.prototype,{initialize:function(id,latLng,bounds,count,aggregates){Overlay.call(this,latLng);this._x=id;this._aa=bounds;this._ab=count;this._ac=aggregates},getPointsCount:function(){return this._ab},getGLatLngBounds:function(){return this._aa},getGMarker:function(){return this._z||(this._z=this._m.createCluster(this))},setGMarker:function(gMarker){this._z=gMarker},expandOnMap:function(){if(!this.canExpandOnMap()){return}this._r(this.getGLatLngBounds())},requestIds:function(callback){this.requestAggregates("concat(id)",function(aggregates,status){callback(aggregates["concat(id)"],status)})},requestAggregates:function(aggregates,callback){this._p({bounds:this._aa,aggregates:aggregates,callback:function(response){var clusters=removeProperty(response,"clusters"),aggregates=clusters&&clusters[0];callback(aggregates,response)}})},canExpandOnMap:function(){return !(this._q||this._ad())},getAggregates:function(name){return this._ac},getAggregate:function(name){return this._ac[name]},requestContent:function(callback){this.requestAggregates("concat(html),concat(id)",function(aggregates,status){if(status.success){var result=aggregates["concat(html)"],ids=aggregates["concat(id)"];for(var i=0;i<ids.length;i++){result[i]="<div id='maptimize_marker_"+ids[i]+"'>"+result[i]+"</div>"}callback(result.join('<div class="maptimize_separator"></div>'))}else{callback(null,status)}})},_w:function(){triggerEvent(this._u,"clusterClicked",this)},_ad:function(){var bounds=this.getGLatLngBounds(),ne=bounds.getNorthEast(),sw=bounds.getSouthWest();return(ne.lat()-sw.lat())<0.000001||(ne.lat()-sw.lat())<0.000001}}),{_l:function(cluster){var latLng=LatLng(removeProperty(cluster,"coords")),bounds=removeProperty(cluster,"bounds");bounds=LatLngBounds(LatLng(bounds.sw),LatLng(bounds.ne));return new Cluster(cluster.id,latLng,bounds,removeProperty(cluster,"count"),cluster)}});var Request=createClass((function(){var REQUEST_ID=0,MAX_URL_LENGTH=2083,SWF_NAME="__maptimize_flash_proxy__";function initialize(url,params,callback){this._ae=url;this._af=callback;this._ag=params}function send(){var self=this;self._x=REQUEST_ID++;self._ah();self._ai();if(self._aj.length<MAX_URL_LENGTH){self._ak()}else{self._al()}}function _prepareCallback(){var self=this,cid=_callbackId(self._x),callback=self._af;Request._am[cid]=function(response){delete Request._am[cid];if(typeof response==="string"){response=eval("("+response+")")}callback(response,self)}}function _callbackId(requestId){return"_"+requestId}function _computeQueryStringAndFullUrl(){var self=this;self._an=toQueryString(merge(self._ag,{callback:Request._ao+"."+_callbackId(self._x)}));self._aj=self._ae+"?"+self._an}function _sendWithScriptTag(){var script=extend(document.createElement("script"),{src:this._aj,type:"text/javascript"});HEAD.appendChild(script);setTimeout(function(){HEAD.removeChild(script)},5000)}function _sendWithSWF(){var self=this;_ensureSWFInserted();if(!_getFlashObject().postToServer){setTimeout(function(){self._al()},10)}else{_getFlashObject().postToServer(self._ae+"?ts="+Math.random(new Date().getTime()),self._an)}}function _ensureSWFInserted(){if(Request._ap){return}var object=document.createElement("DIV");object.id=SWF_NAME;document.body.appendChild(object);swfobject.embedSWF(swfURL("flashproxy.swf"),SWF_NAME,"1","1","9.0.0",swfURL("expressInstall.swf"),{},{allowScriptAccess:"always"});Request._ap=true}function _getFlashObject(){return document[SWF_NAME]||window[SWF_NAME]}return{initialize:initialize,send:send,_ai:_prepareCallback,_ah:_computeQueryStringAndFullUrl,_ak:_sendWithScriptTag,_al:_sendWithSWF}})(),{send:function(url,params,callback){var request=new Request(url,params,callback);request.send();return request},_am:{},_ao:"Request._am"});var DEFAULT_THEME={createMarker:function(marker){var options=DEFAULT_THEME._aq()[0];options.labelText=1;return new LabeledMarker(marker.getGLatLng(),options)},createCluster:function(cluster){var count=cluster.getPointsCount(),index=parseInt(Math.log(count)/Math.log(10)),options;if(cluster.canExpandOnMap()){options=DEFAULT_THEME._ar()}else{options=DEFAULT_THEME._aq()}options=options[Math.min(options.length-1,index)];options.labelText=count;return new LabeledMarker(cluster.getGLatLng(),options)},_aq:function(){return this._as=this._as||[{icon:{image:imageURL("maps/marker8.png"),iconSize:Size(25,33),iconAnchor:Point(11,33),infoWindowAnchor:Point(11,2),infoShadowAnchor:Point(18,25)},labelClass:"maptimize_marker_0",labelOffset:Size(-11,-26)},{icon:{image:imageURL("maps/marker88.png"),iconSize:Size(25,33),iconAnchor:Point(11,33),infoWindowAnchor:Point(11,2),infoShadowAnchor:Point(18,25)},labelClass:"maptimize_marker_1",labelOffset:Size(-11,-26)},{icon:{image:imageURL("maps/marker88.png"),iconSize:Size(29,33),iconAnchor:Point(11,33),infoWindowAnchor:Point(11,2),infoShadowAnchor:Point(18,25)},labelClass:"maptimize_marker_2",labelOffset:Size(-11,-27)},{icon:{image:imageURL("maps/marker88.png"),iconSize:Size(33,33),iconAnchor:Point(11,33),infoWindowAnchor:Point(11,2),infoShadowAnchor:Point(18,25)},labelClass:"maptimize_marker_3",labelOffset:Size(-11,-32)}]},_ar:function(){return this._at=this._at||[{icon:{image:imageURL("maps/5.png"),iconSize:Size(50,50),iconAnchor:Point(25,25),infoWindowAnchor:Point(25,25),infoShadowAnchor:Point(25,25)},labelClass:"maptimize_cluster_0",labelOffset:Size(-25,-25)},{icon:{image:imageURL("maps/4.png"),iconSize:Size(55,55),iconAnchor:Point(28,28),infoWindowAnchor:Point(28,28),infoShadowAnchor:Point(28,28)},labelClass:"maptimize_cluster_1",labelOffset:Size(-28,-28)},{icon:{image:imageURL("maps/3.png"),iconSize:Size(62,62),iconAnchor:Point(31,31),infoWindowAnchor:Point(31,31),infoShadowAnchor:Point(31,31)},labelClass:"maptimize_cluster_2",labelOffset:Size(-31,-31)},{icon:{image:imageURL("maps/2.png"),iconSize:Size(71,71),iconAnchor:Point(35,35),infoWindowAnchor:Point(35,35),infoShadowAnchor:Point(35,35)},labelClass:"maptimize_cluster_3",labelOffset:Size(-35,-35)},{icon:{image:imageURL("maps/1.png"),iconSize:Size(85,85),iconAnchor:Point(42,42),infoWindowAnchor:Point(42,42),infoShadowAnchor:Point(42,42)},labelClass:"maptimize_cluster_4",labelOffset:Size(-42,-42)}]}};
/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",ON_READY_STATE_CHANGE="onreadystatechange",win=window,doc=document,nav=navigator,plugin=false,domLoadFnArr=[main],regObjArr=[],objIdArr=[],listenersArr=[],storedAltContent,storedAltContentId,storedCallbackFn,storedCallbackObj,isDomLoaded=false,isExpressInstallActive=false,dynamicStylesheet,dynamicStylesheetMedia,autoHideShow=true,ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=!+"\v1",playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d&&!(typeof nav.mimeTypes!=UNDEF&&nav.mimeTypes[FLASH_MIME_TYPE]&&!nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)){plugin=true;ie=false;d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/[a-zA-Z]/.test(d)?parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){try{var a=new ActiveXObject(SHOCKWAVE_FLASH_AX);if(a){d=a.GetVariable("$version");if(d){ie=true;d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}}catch(e){}}}return{w3:w3cdom,pv:playerVersion,wk:webkit,ie:ie,win:windows,mac:mac}}(),onDomLoad=function(){if(!ua.w3){return}if((typeof doc.readyState!=UNDEF&&doc.readyState=="complete")||(typeof doc.readyState==UNDEF&&(doc.getElementsByTagName("body")[0]||doc.body))){callDomLoadFunctions()}if(!isDomLoaded){if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("DOMContentLoaded",callDomLoadFunctions,false)}if(ua.ie&&ua.win){doc.attachEvent(ON_READY_STATE_CHANGE,function(){if(doc.readyState=="complete"){doc.detachEvent(ON_READY_STATE_CHANGE,arguments.callee);callDomLoadFunctions()}});if(win==top){(function(){if(isDomLoaded){return}try{doc.documentElement.doScroll("left")}catch(e){setTimeout(arguments.callee,0);return}callDomLoadFunctions()})()}}if(ua.wk){(function(){if(isDomLoaded){return}if(!/loaded|complete/.test(doc.readyState)){setTimeout(arguments.callee,0);return}callDomLoadFunctions()})()}addLoadEvent(callDomLoadFunctions)}}();function callDomLoadFunctions(){if(isDomLoaded){return}try{var t=doc.getElementsByTagName("body")[0].appendChild(createElement("span"));t.parentNode.removeChild(t)}catch(e){return}isDomLoaded=true;var dl=domLoadFnArr.length;for(var i=0;i<dl;i++){domLoadFnArr[i]()}}function addDomLoadEvent(fn){if(isDomLoaded){fn()}else{domLoadFnArr[domLoadFnArr.length]=fn}}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",fn,false)}else{if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",fn,false)}else{if(typeof win.attachEvent!=UNDEF){addListener(win,"onload",fn)}else{if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();fn()}}else{win.onload=fn}}}}}function main(){if(plugin){testPlayerVersion()}else{matchVersions()}}function testPlayerVersion(){var b=doc.getElementsByTagName("body")[0];var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);var t=b.appendChild(o);if(t){var counter=0;(function(){if(typeof t.GetVariable!=UNDEF){var d=t.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");ua.pv=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}else{if(counter<10){counter++;setTimeout(arguments.callee,10);return}}b.removeChild(o);t=null;matchVersions()})()}else{matchVersions()}}function matchVersions(){var rl=regObjArr.length;if(rl>0){for(var i=0;i<rl;i++){var id=regObjArr[i].id;var cb=regObjArr[i].callbackFn;var cbObj={success:false,id:id};if(ua.pv[0]>0){var obj=getElementById(id);if(obj){if(hasPlayerVersion(regObjArr[i].swfVersion)&&!(ua.wk&&ua.wk<312)){setVisibility(id,true);if(cb){cbObj.success=true;cbObj.ref=getObjectById(id);cb(cbObj)}}else{if(regObjArr[i].expressInstall&&canExpressInstall()){var att={};att.data=regObjArr[i].expressInstall;att.width=obj.getAttribute("width")||"0";att.height=obj.getAttribute("height")||"0";if(obj.getAttribute("class")){att.styleclass=obj.getAttribute("class")}if(obj.getAttribute("align")){att.align=obj.getAttribute("align")}var par={};var p=obj.getElementsByTagName("param");var pl=p.length;for(var j=0;j<pl;j++){if(p[j].getAttribute("name").toLowerCase()!="movie"){par[p[j].getAttribute("name")]=p[j].getAttribute("value")}}showExpressInstall(att,par,id,cb)}else{displayAltContent(obj);if(cb){cb(cbObj)}}}}}else{setVisibility(id,true);if(cb){var o=getObjectById(id);if(o&&typeof o.SetVariable!=UNDEF){cbObj.success=true;cbObj.ref=o}cb(cbObj)}}}}}function getObjectById(objectIdStr){var r=null;var o=getElementById(objectIdStr);if(o&&o.nodeName=="OBJECT"){if(typeof o.SetVariable!=UNDEF){r=o}else{var n=o.getElementsByTagName(OBJECT)[0];if(n){r=n}}}return r}function canExpressInstall(){return !isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)&&!(ua.wk&&ua.wk<312)}function showExpressInstall(att,par,replaceElemIdStr,callbackFn){isExpressInstallActive=true;storedCallbackFn=callbackFn||null;storedCallbackObj={success:false,id:replaceElemIdStr};var obj=getElementById(replaceElemIdStr);if(obj){if(obj.nodeName=="OBJECT"){storedAltContent=abstractAltContent(obj);storedAltContentId=null}else{storedAltContent=obj;storedAltContentId=replaceElemIdStr}att.id=EXPRESS_INSTALL_ID;if(typeof att.width==UNDEF||(!/%$/.test(att.width)&&parseInt(att.width,10)<310)){att.width="310"}if(typeof att.height==UNDEF||(!/%$/.test(att.height)&&parseInt(att.height,10)<137)){att.height="137"}doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",fv="MMredirectURL="+win.location.toString().replace(/&/g,"%26")+"&MMplayerType="+pt+"&MMdoctitle="+doc.title;if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+fv}else{par.flashvars=fv}if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceElemIdStr+="SWFObjectNew";newObj.setAttribute("id",replaceElemIdStr);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";(function(){if(obj.readyState==4){obj.parentNode.removeChild(obj)}else{setTimeout(arguments.callee,10)}})()}createSWF(att,par,replaceElemIdStr)}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";(function(){if(obj.readyState==4){obj.parentNode.removeChild(obj)}else{setTimeout(arguments.callee,10)}})()}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj)}}function abstractAltContent(obj){var ac=createElement("div");if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML}else{var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var c=nestedObj.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName=="PARAM")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true))}}}}}return ac}function createSWF(attObj,parObj,id){var r,el=getElementById(id);if(ua.wk&&ua.wk<312){return r}if(el){if(typeof attObj.id==UNDEF){attObj.id=id}if(ua.ie&&ua.win){var att="";for(var i in attObj){if(attObj[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){parObj.movie=attObj[i]}else{if(i.toLowerCase()=="styleclass"){att+=' class="'+attObj[i]+'"'}else{if(i.toLowerCase()!="classid"){att+=" "+i+'="'+attObj[i]+'"'}}}}}var par="";for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par+='<param name="'+j+'" value="'+parObj[j]+'" />'}}el.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+att+">"+par+"</object>";objIdArr[objIdArr.length]=attObj.id;r=getElementById(attObj.id)}else{var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);for(var m in attObj){if(attObj[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",attObj[m])}else{if(m.toLowerCase()!="classid"){o.setAttribute(m,attObj[m])}}}}for(var n in parObj){if(parObj[n]!=Object.prototype[n]&&n.toLowerCase()!="movie"){createObjParam(o,n,parObj[n])}}el.parentNode.replaceChild(o,el);r=o}}return r}function createObjParam(el,pName,pValue){var p=createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p)}function removeSWF(id){var obj=getElementById(id);if(obj&&obj.nodeName=="OBJECT"){if(ua.ie&&ua.win){obj.style.display="none";(function(){if(obj.readyState==4){removeObjectInIE(id)}else{setTimeout(arguments.callee,10)}})()}else{obj.parentNode.removeChild(obj)}}}function removeObjectInIE(id){var obj=getElementById(id);if(obj){for(var i in obj){if(typeof obj[i]=="function"){obj[i]=null}}obj.parentNode.removeChild(obj)}}function getElementById(id){var el=null;try{el=doc.getElementById(id)}catch(e){}return el}function createElement(el){return doc.createElement(el)}function addListener(target,eventType,fn){target.attachEvent(eventType,fn);listenersArr[listenersArr.length]=[target,eventType,fn]}function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10)||0;v[2]=parseInt(v[2],10)||0;return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false}function createCSS(sel,decl,media,newStyle){if(ua.ie&&ua.mac){return}var h=doc.getElementsByTagName("head")[0];if(!h){return}var m=(media&&typeof media=="string")?media:"screen";if(newStyle){dynamicStylesheet=null;dynamicStylesheetMedia=null}if(!dynamicStylesheet||dynamicStylesheetMedia!=m){var s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media",m);dynamicStylesheet=h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){dynamicStylesheet=doc.styleSheets[doc.styleSheets.length-1]}dynamicStylesheetMedia=m}if(ua.ie&&ua.win){if(dynamicStylesheet&&typeof dynamicStylesheet.addRule==OBJECT){dynamicStylesheet.addRule(sel,decl)}}else{if(dynamicStylesheet&&typeof doc.createTextNode!=UNDEF){dynamicStylesheet.appendChild(doc.createTextNode(sel+" {"+decl+"}"))}}}function setVisibility(id,isVisible){if(!autoHideShow){return}var v=isVisible?"visible":"hidden";if(isDomLoaded&&getElementById(id)){getElementById(id).style.visibility=v}else{createCSS("#"+id,"visibility:"+v)}}function urlEncodeIfNecessary(s){var regex=/[\\\"<>\.;]/;var hasBadChars=regex.exec(s)!=null;return hasBadChars&&typeof encodeURIComponent!=UNDEF?encodeURIComponent(s):s}var cleanup=function(){if(ua.ie&&ua.win){window.attachEvent("onunload",function(){var ll=listenersArr.length;for(var i=0;i<ll;i++){listenersArr[i][0].detachEvent(listenersArr[i][1],listenersArr[i][2])}var il=objIdArr.length;for(var j=0;j<il;j++){removeSWF(objIdArr[j])}for(var k in ua){ua[k]=null}ua=null;for(var l in swfobject){swfobject[l]=null}swfobject=null})}}();return{registerObject:function(objectIdStr,swfVersionStr,xiSwfUrlStr,callbackFn){if(ua.w3&&objectIdStr&&swfVersionStr){var regObj={};regObj.id=objectIdStr;regObj.swfVersion=swfVersionStr;regObj.expressInstall=xiSwfUrlStr;regObj.callbackFn=callbackFn;regObjArr[regObjArr.length]=regObj;setVisibility(objectIdStr,false)}else{if(callbackFn){callbackFn({success:false,id:objectIdStr})}}},getObjectById:function(objectIdStr){if(ua.w3){return getObjectById(objectIdStr)}},embedSWF:function(swfUrlStr,replaceElemIdStr,widthStr,heightStr,swfVersionStr,xiSwfUrlStr,flashvarsObj,parObj,attObj,callbackFn){var callbackObj={success:false,id:replaceElemIdStr};if(ua.w3&&!(ua.wk&&ua.wk<312)&&swfUrlStr&&replaceElemIdStr&&widthStr&&heightStr&&swfVersionStr){setVisibility(replaceElemIdStr,false);addDomLoadEvent(function(){widthStr+="";heightStr+="";var att={};if(attObj&&typeof attObj===OBJECT){for(var i in attObj){att[i]=attObj[i]}}att.data=swfUrlStr;att.width=widthStr;att.height=heightStr;var par={};if(parObj&&typeof parObj===OBJECT){for(var j in parObj){par[j]=parObj[j]}}if(flashvarsObj&&typeof flashvarsObj===OBJECT){for(var k in flashvarsObj){if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+k+"="+flashvarsObj[k]}else{par.flashvars=k+"="+flashvarsObj[k]}}}if(hasPlayerVersion(swfVersionStr)){var obj=createSWF(att,par,replaceElemIdStr);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true)}callbackObj.success=true;callbackObj.ref=obj}else{if(xiSwfUrlStr&&canExpressInstall()){att.data=xiSwfUrlStr;showExpressInstall(att,par,replaceElemIdStr,callbackFn);return}else{setVisibility(replaceElemIdStr,true)}}if(callbackFn){callbackFn(callbackObj)}})}else{if(callbackFn){callbackFn(callbackObj)}}},switchOffAutoHideShow:function(){autoHideShow=false},ua:ua,getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}},hasFlashPlayerVersion:hasPlayerVersion,createSWF:function(attObj,parObj,replaceElemIdStr){if(ua.w3){return createSWF(attObj,parObj,replaceElemIdStr)}else{return undefined}},showExpressInstall:function(att,par,replaceElemIdStr,callbackFn){if(ua.w3&&canExpressInstall()){showExpressInstall(att,par,replaceElemIdStr,callbackFn)}},removeSWF:function(objElemIdStr){if(ua.w3){removeSWF(objElemIdStr)}},createCSS:function(selStr,declStr,mediaStr,newStyleBoolean){if(ua.w3){createCSS(selStr,declStr,mediaStr,newStyleBoolean)}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(param){var q=doc.location.search||doc.location.hash;if(q){if(/\?/.test(q)){q=q.split("?")[1]}if(param==null){return urlEncodeIfNecessary(q)}var pairs=q.split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(isExpressInstallActive){var obj=getElementById(EXPRESS_INSTALL_ID);if(obj&&storedAltContent){obj.parentNode.replaceChild(storedAltContent,obj);if(storedAltContentId){setVisibility(storedAltContentId,true);if(ua.ie&&ua.win){storedAltContent.style.display="block"}}if(storedCallbackFn){storedCallbackFn(storedCallbackObj)}}isExpressInstallActive=false}}}}();if(typeof com!=="object"){window.com={}}if(typeof com.maptimize!=="object"){com.maptimize={}}extend(com.maptimize,{Condition:Condition,MapController:MapController,Map:MapController,LabeledMarker:LabeledMarker,Error:Error,ArgumentError:ArgumentError,callbacks:Request._am});Request._ao="com.maptimize.callbacks";window.Maptimize=com.maptimize})(this);

