
var OpcoesSalvarUltimoLocal=true;var OpcoesNumeroRegistrosBusca=10;var L_invalidinvoketarget_text="Invalid invoke target specified.",L_invaliddirections_text="Invalid argument passed; both start and end must be present.",L_invalidpageindex_text="Invalid search results page index is passed.",L_invalidelement_text="Invalid element id; unable to find the element in the document body.",L_noheadelement_text="Head element is missing for the current document; cannot initialize the API framework.",L_noserviceurl_text="Either a service url or script url is required to create VENetwork instance.",L_noscripturl_text="Invalid script source url is assigned; cannot download the assigned script.",L_nostylesurl_text="Invalid style source url is assigned; cannot attach the assigned styles.",L_invalidwhatwhere_text="Invalid what/where parameters; either 'what' or 'where' must be present.",L_notinitialized_text="Map is not loaded; cannot perform this operation.",L_noroute_text="Cannot calculate route at this point; try again later.",L_invalidpushpin_text="Invalid pushpin instance.",L_invalidpushpinid_text="Invalid pushpin id; either id is empty or another pushpin already exists with that id.",L_invalidpolylineid_text="Invalid polyline id; either id is empty or another polyline already exists with that id.",L_invalidpolygonid_text="Invalid polygon id; either id is empty or another polygon already exists with that id.",L_invalidargument_text="Invalid argument; input argument '%1' is not a valid '%2' value.",L_invalidlayerid_text="Invalid layer id; either id is empty or another layer already exists with that id.",L_invalidlayertype_text="Invalid layer type.",L_invalidlayersource_text="Invalid layer source; either layer is empty or does not exist.",L_invalidsourceid_text="Invalid source id; either id is empty or another tile source already exists with that id.",L_invalidminmaxzoom_text="Min zoom is greater than max zoom.",L_invalidopacity_text="Invalid opacity value.",L_loadxml_text="Unable to load source file.",L_Help_Text="Help",L_ErrorServerBusy_Text="The server is temporarily unavailable. Try again later.",L_error_text="Error",L_close_text="close",L_what_text="What",L_where_text="Where",L_find_text="Find",L_selectlocation_text="Select a location",L_Start_Text="Start",L_End_Text="End",L_DirectionsGetDirections_Text="Get directions",L_loading_text="Carregando...",L_arriveat_text="Arrive at",L_startat_text="Start at",L_step_text="Step %1 of %2",L_DirectionsStep_Text="Step",L_invalidroute_Text="Virtual Earth cannot find a route for the locations you entered. Ensure that your start and end locations are correct, and try again.",L_invalidlocation_Text="The location you entered cannot be found.",L_CollectionManagerViewerDefaultTitle_Text="Shared Collection",L_CollectionManagerUnsavedCollectionTitle_Text="Unsaved Collection",L_AnnotationConfDefaultTitle_Text="Untitled item",L_TrafficPopupSeverity_Text="Severity",L_TrafficPopupLocation_Text="Location",L_TrafficPopupDescription_Text="Description",L_TrafficPopupStartTime_Text="Start time",L_TrafficPopupEstEndTime_Text="Est. end time",L_TrafficManagerSerious_Text="Serious",L_TrafficManagerModerate_Text="Moderate",L_TrafficManagerMinor_Text="Minor",L_TrafficManager_Zoomout_Text="Zoom out to view Traffic information",L_TrafficManager_Zoomin_Text="Zoom in to view Traffic information",L_ClientTokenInvalid_Text="Invalid client token.",L_ClientTokenExpired_Text="Expired client token.",L_Shp_IncorrectPoints_Text="The number of points does not match the specified VEShape type.",L_Shp_IncorrectLineWidth_Text="The line width must be a positive integer.",L_Shp_IncorrectZoomLevel_Text="The specified  zoom level is invalid.  The valid range is 1 to 21,inclusive.",L_Shp_IncorrectZoomLevel2_Text="Max zoom is less than min zoom.",L_shp_Notinitialized_text="Shape is not initialized.",L_ShpExist_text="This shape has already been added to layer.",L_invalidzindex_text="Invalid z-Index parameters; either 'icon' or 'polyshape' must be present.",L_altitudemodemismatch_Text="All altitudes must have the same altitudeMode in a VEShape.",L_invalidwhere_text="Invalid argument; input argument 'where' is not a valid 'string, VELatLong, VELatLongRectangle, or VEPlace ' value.",L_invalidnonnegativeint_text="Invalid argument; input argument '%1' must be a non-negative int value.",L_invalidbetweenint_text="Invalid argument; input argument '%1' must be between %2 and %3, inclusive.",L_invalidsearchlocation_Text="%1 could not find a match for the location. Please check your spelling, enter the complete address including country name and commas, and try again.",L_DashboardBirdsEye_Text="Bird's eye",L_DashboardBirdsEyeText_Text="Veja este local em bird's eye",L_Dashboard3DText_Text="See this location in Virtual Earth 3D",L_Dashboard3DInstalled_Text="Virtual Earth 3D has finished updating",L_ObliqueCompassSelectDirection_Text="Mudar direção da visualização",L_ObliqueModeImageNotAvailable_Text="Desculpe, as imagens do bird's eye não estão disponíveis aqui.",L_MinimapHybrid_Text="H",L_MinimapRoad_Text="M",L_MinimapHideToolTip_Text="Hide the mini map",L_MinimapShowToolTip_Text="Show the mini map",L_MinimapLargerToolTip_Text="Larger mini map",L_MinimapSmallerToolTip_Text="Smaller mini map",L_MinimapRoadToolTip_Text="Mudar para visualização por mapa",L_MinimapHybridToolTip_Text="Mudar para visualização híbrida",L_MinimapDragToolTip_Text="Clique e arraste para mover o mapa",L_MinimapReticuleDragToolTip_Text="Arraste para centralizar o mapa",L_ScaleBarMiles_Text="milhas",L_ScaleBarKilometers_Text="km",L_ScaleBarMeters_Text="m",L_ScaleBarYards_Text="yds",L_NavActionFlatland_Text="2D",L_NavActionView3D_Text="3D",L_NavActionRoad_Text="Mapas",L_NavActionAerial_Text="Aérea",L_NavActionHybrid_Text="Híbrido",L_NavActionLabels_Text="Ruas",L_NavActionTraffic_Text="Trânsito",L_NavActionLocalizeme_Text="Localize-me",L_NavActionHideToolTip_Text="Esconder este controle",L_NavActionShowToolTip_Text="Mostrar o controle de visualização",L_NavActionFlatlandToolTip_Text="Visualizar o mapa em modo 2D",L_NavActionView3DToolTip_Text="Visualizar o mapa em modo 3D com o Virtual Earth 3D (Beta)",L_NavActionOrthoToolTip_Text="Mudar para visualização de mapas",L_NavActionObliqueToolTip_Text="Mudar para visão de bird's eye",L_NavActionStreetSideToolTip_Text="Street-level view",L_NavAction3DOrthoToolTip_Text="Look down",L_NavAction3DObliqueToolTip_Text="Look down at an angle",L_NavAction3DStreetSideToolTip_Text="Look toward horizon",L_NavActionShowTrafficToolTip_Text="Mostrar trânsito no mapa",L_NavActionLocalizeMeToolTip_Text="Localize-me",L_NavActionHideTrafficToolTip_Text="Esconder trânsito no mapa",L_NavActionRoadToolTip_Text="Mudar para mapa",L_NavActionAerialToolTip_Text="Mudar para visão aérea",L_NavActionHybridToolTip_Text="Mudar para visão híbrida",L_NavActionObliqueRotationToolTip_CW_Text="Rotacionar a câmera no sentido anti-horário",L_NavActionObliqueRotationToolTip_CCW_Text="Rotacionar a câmera no sentido horário",L_NavActionShowObliqueToolTip_Text="Mudar para bird's eye",L_NavActionHideObliqueToolTip_Text="Esconder imagens bird's eye no mapa",L_NavActionShowLabels_Text="Mostrar legendas",L_NavActionHideLabels_Text="Esconder legendas",L_North_Text="north",L_East_Text="east",L_South_Text="south",L_West_Text="west",L_ObliqueSkippingOneDirection_Text="A bird's eye image facing %2 isn't available for this location. Facing %1 instead.",L_ObliqueSkippingTwoDirections_Text="Bird's eye images facing %2 or %3 aren't available for this location. Facing %1 instead.",L_ObliqueSpinNoOtherImagery_Text="No other bird's eye images are available for this location. Continuing to face %1.",L_ObliqueNoImageryInRequestedDirection_Text="Bird's eye images facing %2 aren't available for this location. Continuing to face %1.",L_NavActionCompassPan="Arraste para qualquer direção",L_ZoomBarMinusToolTip_Text="Afastar. Para afastar continuamente, clique e mantenha pressionado o botão do mouse.",L_NavActionCompassPan_Text="Arraste para qualquer direção",L_ZoomBarPlusToolTip_Text="Aproximar. Para aproximar continuamente, clique e mantenha pressionado o botão do mouse.",L_ZoomBarSliderToolTip_Text="Move slider to zoom in or zoom out",L_BrowserNotSupported_Text="To use this feature, open MSN Mapas in Windows Internet Explorer version 6 or 7. For more information, and to download the latest version, visit the Microsoft Internet Explorer website (%1%3%2).",L_BrowserNotSupported3D_Text="Virtual Earth 3D is currently not supported for your browser. For a list of supported browsers, see Help.",L_NoHardwareAcceleration_Text="Virtual Earth 3D has detected that hardware acceleration is turned off.",L_3DLoading_Text="Inicializando Virtual Earth 3D (Beta).",L_MapLegendTrafficSlow_Text="Lento",L_MapLegendTrafficFast_Text="Rápido",L_GeoRssInvalidFormatError_Text="The GeoRSS file you have tried to import is improperly formatted.",L_MapControlNavteq_Text="&copy; 2008 NAVTEQ",L_MapControlImageCourtesyOfInterAtlas_Text="&copy; 2007 InterAtlas",L_MapControlImageCourtesyOfEurosense_Text="&copy; 2008 Eurosense",L_MapControlImageCourtesyOfIGP_Text="&copy; 2008 IGP",L_MapControlImageCourtesyOfIGN_Text="&copy; 2008 IGN",L_MapControlMapLink_Text="&copy; 2008 MapLink",L_MapControlImageCourtesyOfNASA_Text="Image courtesy of NASA",L_MapControlHarrisCorp_Text="&copy; Harris Corp, Earthstar Geographics LLC",L_MapControlImageCourtesyOfUSGS_Text="Image courtesy of USGS",L_MapControlImageCourtesyOfPictometry_Text="&copy; 2008 Pictometry International Corp.",L_MapControlImageCourtesyOfEarthData_Text="&copy; EarthData",L_MapControlImageCourtesyOfGetmapping_Text="&copy; Getmapping plc",L_MapControlImageCourtesyOfAND_Text="&copy; AND",L_MapControlImageCourtesyOfBlom_Text="&copy; 2008 Blom",L_MapCopyrightMicrosoft="&copy; 2008 Microsoft Corporation",L_MapCopyrightTraffic="Traffic.com",L_MapControlPlatformName_Text="Virtual Earth",L_MapControlImageCourtesyOfGeoEye_Text="&copy; 2008 GeoEye",L_MapControlImageCourtesyOfMapDataSciences_Text="&copy; 2007 MapData Sciences Pty Ltd",L_MapControlImageCourtesyOfZenrin_Text="&copy; 2007 Zenrin",L_MapControlImageCourtesyOfPasco_Text="&copy; 2005 Pasco",L_MapControlImageCourtesyOfIntergraph_Text="&copy; GeoContent / (p) Intergraph",L_MapControlImageCourtesyOfTerraItaly_Text="&copy; 2007 TerraItaly",L_MapControlImageCourtesyOfIntermap_Text="&copy; 2007 Intermap",L_MapControlImageCourtesyOfIndianaMap_Text="Image courtesy of the IndianaMap",L_MapControlImageCourtesyOfStateOfNevada_Text="Image courtesy of the Nevada State Mapping Advisory Committee",L_MapControlImageCourtesyOfInterAtlas_Text="&copy; 2007 InterAtlas",L_MapControlImageCourtesyOfEurosense_Text="&copy; 2008 Eurosense",L_MapControlImageCourtesyOfIGP_Text="&copy; 2008 IGP",L_MapControlImageCourtesyOfIGN_Text="&copy; 2008 IGN",L_MapControlImageCourtesyOfBEV_Text="&copy; 2008 BEV / (p) Intergraph",L_SupportedBrowserDownloadUrl_Text="http://www.microsoft.com/windows/ie/downloads/default.mspx",L_BuscaTitulo="Busca",L_BuscaMascaraAtividade="Busca por atividade, empresa...",L_BuscaMascaraLocal="Digite a cidade, endereço ou CEP...",L_BuscaMascaraLocalRota="Digite a cidade ou endereço",L_BuscaMostrarTodos="Mostrar Todos",L_BuscaMapaDe="Mapa de",L_BuscaNenhumResultado="Nenhum resultado foi encontrado para a sua busca.",L_BuscaEstabelecimentosEncontrados="Estabelecimentos encontrados",L_BuscaMaisResultados="Foi encontrado mais de um resultado para o local informado.",L_BuscaSugestoesLocal="Sugestões de Local",L_ComoChegarTitulo="Como chegar",L_ComoChegarMascaraInicio="ex.: Av. Paulista, 235, São Paulo, SP",L_ComoChegarMascaraFim="ex.: Al. Santos, 1, São Paulo, SP",L_ComoChegarNova="Nova Rota",L_ComoChegarNenhumResultado="Nenhum local foi encontrado para o local especificado.",L_ComoChegarTempoDia="dia(s)",L_ComoChegarTempoHora="hora(s)",L_ComoChegarTempoMinuto="minuto(s)",L_ComoChegarTempoSegundo="segundo(s)",L_ComoChegarProblemas="Problemas ao gerar rota. Tente novamente mais tarde.",L_ComoChegarInicial="Inicial",L_ComoChegarFinal="Final",L_ComoChegarSalvarLocal="Salvar este local",L_ComoChegarTrajeto="Trajeto",L_ComoChegarPasso="Passo",L_ComoChegarNa="na",L_ComoChegarDirigirDe="Dirigir de",L_ComoChegarDirigirAte="Dirigir até",L_DesenhoDistancia="Distância",L_DesenhoPerimetro="Perímetro",L_DesenhoSemTitulo="Sem título",L_ListaAdicionar="Adicionar à lista",L_ListaNaoSalva="Lista não salva",L_ListaSuas="Suas listas",L_BemVindoTitulo="Bem-vindo",L_CinemaTitulo="Cinemas",L_AdvertisementTitulo="Anúncios",L_TransitoTitulo="Trânsito",L_TransitoSentido="Sentido",L_TransitoErro="Não foi possível obter esta informação. Tente novamente mais tarde.",L_Acoes="Ações",L_Atualizar="Atualizar",L_EnviarPorEmail="Enviar por e-mail",L_PinZoomPara="Zoom para",L_Ruas="Ruas",L_Cidade="Cidade",L_Regiao="Região",L_Mover="Mover",L_Editar="Editar",L_Excluir="Excluir",L_EsteItem="este item",L_Ou="ou",L_Cancelar="Cancelar",L_Alterar="Alterar",L_Anterior="Anterior",L_Proxima="Próxima",L_TituloSite="MSN Mapas Brasil",L_DesejaApagarItensLista="Deseja realmente apagar todos os itens da lista",L_DesejaApagarLista="Deseja realmente apagar a lista",L_CliqueEmQualquer="Clique em qualquer local do mapa em que deseja colocar este ponto.",L_DesejaExcluir="Deseja realmente excluir",L_URL="http://www.livemaps.com.br",L_AntesDescricao="na",L_AntesTituloEmail="no",L_Idioma="br",L_Origem="Origem",L_Destino="Destino",L_TituloEmail="Minhas Buscas no MSN Mapas Brasil",L_MeEncontre1="O MSN Mapas Brasil está determinando sua posição utilizando o IP de seu computador...",L_MeEncontre2="Não foi possível obter a sua posição neste momento. Tente novamente mais tarde.",L_SemTitulo="Sem título",L_BuscarComercios="Locais próximos",L_ExceptionTimeOut="O serviço está demorando para responder! Tente novamente em alguns instantes.",L_MeEncontre3="O MSN Mapas Brasil determinou sua posição utilizando o IP de seu computador.";
var Prototype={Version:'1.6.0',Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf('AppleWebKit/')>-1,Gecko:navigator.userAgent.indexOf('Gecko')>-1&&navigator.userAgent.indexOf('KHTML')==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement('div').__proto__&&document.createElement('div').__proto__!==document.createElement('form').__proto__},ScriptFragment:'<script[^>]*>([\\S\\s]*?)<\/script>',JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(x){return x}};if(Prototype.Browser.MobileSafari)
Prototype.BrowserFeatures.SpecificElementExtensions=false;if(Prototype.Browser.WebKit)
Prototype.BrowserFeatures.XPath=false;var Class={create:function(){var parent=null,properties=$A(arguments);if(Object.isFunction(properties[0]))
parent=properties.shift();function klass(){this.initialize.apply(this,arguments);}
Object.extend(klass,Class.Methods);klass.superclass=parent;klass.subclasses=[];if(parent){var subclass=function(){};subclass.prototype=parent.prototype;klass.prototype=new subclass;parent.subclasses.push(klass);}
for(var i=0;i<properties.length;i++)
klass.addMethods(properties[i]);if(!klass.prototype.initialize)
klass.prototype.initialize=Prototype.emptyFunction;klass.prototype.constructor=klass;return klass;}};Class.Methods={addMethods:function(source){var ancestor=this.superclass&&this.superclass.prototype;var properties=Object.keys(source);if(!Object.keys({toString:true}).length)
properties.push("toString","valueOf");for(var i=0,length=properties.length;i<length;i++){var property=properties[i],value=source[property];if(ancestor&&Object.isFunction(value)&&value.argumentNames().first()=="$super"){var method=value,value=Object.extend((function(m){return function(){return ancestor[m].apply(this,arguments)};})(property).wrap(method),{valueOf:function(){return method},toString:function(){return method.toString()}});}
this.prototype[property]=value;}
return this;}};var Abstract={};Object.extend=function(destination,source){for(var property in source)
destination[property]=source[property];return destination;};Object.extend(Object,{inspect:function(object){try{if(object===undefined)return'undefined';if(object===null)return'null';return object.inspect?object.inspect():object.toString();}catch(e){if(e instanceof RangeError)return'...';throw e;}},toJSON:function(object){var type=typeof object;switch(type){case'undefined':case'function':case'unknown':return;case'boolean':return object.toString();}
if(object===null)return'null';if(object.toJSON)return object.toJSON();if(Object.isElement(object))return;var results=[];for(var property in object){var value=Object.toJSON(object[property]);if(value!==undefined)
results.push(property.toJSON()+': '+value);}
return'{'+results.join(', ')+'}';},toQueryString:function(object){return $H(object).toQueryString();},toHTML:function(object){return object&&object.toHTML?object.toHTML():String.interpret(object);},keys:function(object){var keys=[];for(var property in object)
keys.push(property);return keys;},values:function(object){var values=[];for(var property in object)
values.push(object[property]);return values;},clone:function(object){return Object.extend({},object);},isElement:function(object){return object&&object.nodeType==1;},isArray:function(object){return object&&object.constructor===Array;},isHash:function(object){return object instanceof Hash;},isFunction:function(object){return typeof object=="function";},isString:function(object){return typeof object=="string";},isNumber:function(object){return typeof object=="number";},isUndefined:function(object){return typeof object=="undefined";}});Object.extend(Function.prototype,{argumentNames:function(){var names=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");return names.length==1&&!names[0]?[]:names;},bind:function(){if(arguments.length<2&&arguments[0]===undefined)return this;var __method=this,args=$A(arguments),object=args.shift();return function(){return __method.apply(object,args.concat($A(arguments)));}},bindAsEventListener:function(){var __method=this,args=$A(arguments),object=args.shift();return function(event){return __method.apply(object,[event||window.event].concat(args));}},curry:function(){if(!arguments.length)return this;var __method=this,args=$A(arguments);return function(){return __method.apply(this,args.concat($A(arguments)));}},delay:function(){var __method=this,args=$A(arguments),timeout=args.shift()*1000;return window.setTimeout(function(){return __method.apply(__method,args);},timeout);},wrap:function(wrapper){var __method=this;return function(){return wrapper.apply(this,[__method.bind(this)].concat($A(arguments)));}},methodize:function(){if(this._methodized)return this._methodized;var __method=this;return this._methodized=function(){return __method.apply(null,[this].concat($A(arguments)));};}});Function.prototype.defer=Function.prototype.delay.curry(0.01);Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+'-'+
(this.getUTCMonth()+1).toPaddedString(2)+'-'+
this.getUTCDate().toPaddedString(2)+'T'+
this.getUTCHours().toPaddedString(2)+':'+
this.getUTCMinutes().toPaddedString(2)+':'+
this.getUTCSeconds().toPaddedString(2)+'Z"';};var Try={these:function(){var returnValue;for(var i=0,length=arguments.length;i<length;i++){var lambda=arguments[i];try{returnValue=lambda();break;}catch(e){}}
return returnValue;}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(str){return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g,'\\$1');};var PeriodicalExecuter=Class.create({initialize:function(callback,frequency){this.callback=callback;this.frequency=frequency;this.currentlyExecuting=false;this.registerCallback();},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},execute:function(){this.callback(this);},stop:function(){if(!this.timer)return;clearInterval(this.timer);this.timer=null;},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();}finally{this.currentlyExecuting=false;}}}});Object.extend(String,{interpret:function(value){return value==null?'':String(value);},specialChar:{'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','\\':'\\\\'}});Object.extend(String.prototype,{gsub:function(pattern,replacement){var result='',source=this,match;replacement=arguments.callee.prepareReplacement(replacement);while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length);}else{result+=source,source='';}}
return result;},sub:function(pattern,replacement,count){replacement=this.gsub.prepareReplacement(replacement);count=count===undefined?1:count;return this.gsub(pattern,function(match){if(--count<0)return match[0];return replacement(match);});},scan:function(pattern,iterator){this.gsub(pattern,iterator);return String(this);},truncate:function(length,truncation){length=length||30;truncation=truncation===undefined?'...':truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this);},strip:function(){return this.replace(/^\s+/,'').replace(/\s+$/,'');},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,'');},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,'img'),'');},extractScripts:function(){var matchAll=new RegExp(Prototype.ScriptFragment,'img');var matchOne=new RegExp(Prototype.ScriptFragment,'im');return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||['',''])[1];});},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)});},escapeHTML:function(){var self=arguments.callee;self.text.data=this;return self.div.innerHTML;},unescapeHTML:function(){var div=new Element('div');div.innerHTML=this.stripTags();return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject('',function(memo,node){return memo+node.nodeValue}):div.childNodes[0].nodeValue):'';},toQueryParams:function(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match)return{};return match[1].split(separator||'&').inject({},function(hash,pair){if((pair=pair.split('='))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join('='):pair[0];if(value!=undefined)value=decodeURIComponent(value);if(key in hash){if(!Object.isArray(hash[key]))hash[key]=[hash[key]];hash[key].push(value);}
else hash[key]=value;}
return hash;});},toArray:function(){return this.split('');},succ:function(){return this.slice(0,this.length-1)+
String.fromCharCode(this.charCodeAt(this.length-1)+1);},times:function(count){return count<1?'':new Array(count+1).join(this);},camelize:function(){var parts=this.split('-'),len=parts.length;if(len==1)return parts[0];var camelized=this.charAt(0)=='-'?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++)
camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1);return camelized;},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();},underscore:function(){return this.gsub(/::/,'/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();},dasherize:function(){return this.gsub(/_/,'-');},inspect:function(useDoubleQuotes){var escapedString=this.gsub(/[\x00-\x1f\\]/,function(match){var character=String.specialChar[match[0]];return character?character:'\\u00'+match[0].charCodeAt().toPaddedString(2,16);});if(useDoubleQuotes)return'"'+escapedString.replace(/"/g,'\\"')+'"';return"'"+escapedString.replace(/'/g,'\\\'')+"'";},toJSON:function(){return this.inspect(true);},unfilterJSON:function(filter){return this.sub(filter||Prototype.JSONFilter,'#{1}');},isJSON:function(){var str=this.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"/g,'');return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON())return eval('('+json+')');}catch(e){}
throw new SyntaxError('Badly formed JSON string: '+this.inspect());},include:function(pattern){return this.indexOf(pattern)>-1;},startsWith:function(pattern){return this.indexOf(pattern)===0;},endsWith:function(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d;},empty:function(){return this=='';},blank:function(){return/^\s*$/.test(this);},interpolate:function(object,pattern){return new Template(this,pattern).evaluate(object);}});if(Prototype.Browser.WebKit||Prototype.Browser.IE)Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');},unescapeHTML:function(){return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');}});String.prototype.gsub.prepareReplacement=function(replacement){if(Object.isFunction(replacement))return replacement;var template=new Template(replacement);return function(match){return template.evaluate(match)};};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement('div'),text:document.createTextNode('')});with(String.prototype.escapeHTML)div.appendChild(text);var Template=Class.create({initialize:function(template,pattern){this.template=template.toString();this.pattern=pattern||Template.Pattern;},evaluate:function(object){if(Object.isFunction(object.toTemplateReplacements))
object=object.toTemplateReplacements();return this.template.gsub(this.pattern,function(match){if(object==null)return'';var before=match[1]||'';if(before=='\\')return match[2];var ctx=object,expr=match[3];var pattern=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/,match=pattern.exec(expr);if(match==null)return before;while(match!=null){var comp=match[1].startsWith('[')?match[2].gsub('\\\\]',']'):match[1];ctx=ctx[comp];if(null==ctx||''==match[3])break;expr=expr.substring('['==match[3]?match[1].length:match[0].length);match=pattern.exec(expr);}
return before+String.interpret(ctx);}.bind(this));}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(iterator,context){var index=0;iterator=iterator.bind(context);try{this._each(function(value){iterator(value,index++);});}catch(e){if(e!=$break)throw e;}
return this;},eachSlice:function(number,iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var index=-number,slices=[],array=this.toArray();while((index+=number)<array.length)
slices.push(array.slice(index,index+number));return slices.collect(iterator,context);},all:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result=true;this.each(function(value,index){result=result&&!!iterator(value,index);if(!result)throw $break;});return result;},any:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result=false;this.each(function(value,index){if(result=!!iterator(value,index))
throw $break;});return result;},collect:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var results=[];this.each(function(value,index){results.push(iterator(value,index));});return results;},detect:function(iterator,context){iterator=iterator.bind(context);var result;this.each(function(value,index){if(iterator(value,index)){result=value;throw $break;}});return result;},findAll:function(iterator,context){iterator=iterator.bind(context);var results=[];this.each(function(value,index){if(iterator(value,index))
results.push(value);});return results;},grep:function(filter,iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var results=[];if(Object.isString(filter))
filter=new RegExp(filter);this.each(function(value,index){if(filter.match(value))
results.push(iterator(value,index));});return results;},include:function(object){if(Object.isFunction(this.indexOf))
if(this.indexOf(object)!=-1)return true;var found=false;this.each(function(value){if(value==object){found=true;throw $break;}});return found;},inGroupsOf:function(number,fillWith){fillWith=fillWith===undefined?null:fillWith;return this.eachSlice(number,function(slice){while(slice.length<number)slice.push(fillWith);return slice;});},inject:function(memo,iterator,context){iterator=iterator.bind(context);this.each(function(value,index){memo=iterator(memo,value,index);});return memo;},invoke:function(method){var args=$A(arguments).slice(1);return this.map(function(value){return value[method].apply(value,args);});},max:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result;this.each(function(value,index){value=iterator(value,index);if(result==undefined||value>=result)
result=value;});return result;},min:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result;this.each(function(value,index){value=iterator(value,index);if(result==undefined||value<result)
result=value;});return result;},partition:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var trues=[],falses=[];this.each(function(value,index){(iterator(value,index)?trues:falses).push(value);});return[trues,falses];},pluck:function(property){var results=[];this.each(function(value){results.push(value[property]);});return results;},reject:function(iterator,context){iterator=iterator.bind(context);var results=[];this.each(function(value,index){if(!iterator(value,index))
results.push(value);});return results;},sortBy:function(iterator,context){iterator=iterator.bind(context);return this.map(function(value,index){return{value:value,criteria:iterator(value,index)};}).sort(function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0;}).pluck('value');},toArray:function(){return this.map();},zip:function(){var iterator=Prototype.K,args=$A(arguments);if(Object.isFunction(args.last()))
iterator=args.pop();var collections=[this].concat(args).map($A);return this.map(function(value,index){return iterator(collections.pluck(index));});},size:function(){return this.toArray().length;},inspect:function(){return'#<Enumerable:'+this.toArray().inspect()+'>';}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(iterable){if(!iterable)return[];if(iterable.toArray)return iterable.toArray();var length=iterable.length,results=new Array(length);while(length--)results[length]=iterable[length];return results;}
if(Prototype.Browser.WebKit){function $A(iterable){if(!iterable)return[];if(!(Object.isFunction(iterable)&&iterable=='[object NodeList]')&&iterable.toArray)return iterable.toArray();var length=iterable.length,results=new Array(length);while(length--)results[length]=iterable[length];return results;}}
Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse)Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(iterator){for(var i=0,length=this.length;i<length;i++)
iterator(this[i]);},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];},compact:function(){return this.select(function(value){return value!=null;});},flatten:function(){return this.inject([],function(array,value){return array.concat(Object.isArray(value)?value.flatten():[value]);});},without:function(){var values=$A(arguments);return this.select(function(value){return!values.include(value);});},reverse:function(inline){return(inline!==false?this:this.toArray())._reverse();},reduce:function(){return this.length>1?this:this[0];},uniq:function(sorted){return this.inject([],function(array,value,index){if(0==index||(sorted?array.last()!=value:!array.include(value)))
array.push(value);return array;});},intersect:function(array){return this.uniq().findAll(function(item){return array.detect(function(value){return item===value});});},clone:function(){return[].concat(this);},size:function(){return this.length;},inspect:function(){return'['+this.map(Object.inspect).join(', ')+']';},toJSON:function(){var results=[];this.each(function(object){var value=Object.toJSON(object);if(value!==undefined)results.push(value);});return'['+results.join(', ')+']';}});if(Object.isFunction(Array.prototype.forEach))
Array.prototype._each=Array.prototype.forEach;if(!Array.prototype.indexOf)Array.prototype.indexOf=function(item,i){i||(i=0);var length=this.length;if(i<0)i=length+i;for(;i<length;i++)
if(this[i]===item)return i;return-1;};if(!Array.prototype.lastIndexOf)Array.prototype.lastIndexOf=function(item,i){i=isNaN(i)?this.length:(i<0?this.length+i:i)+1;var n=this.slice(0,i).reverse().indexOf(item);return(n<0)?n:i-n-1;};Array.prototype.toArray=Array.prototype.clone;function $w(string){if(!Object.isString(string))return[];string=string.strip();return string?string.split(/\s+/):[];}
if(Prototype.Browser.Opera){Array.prototype.concat=function(){var array=[];for(var i=0,length=this.length;i<length;i++)array.push(this[i]);for(var i=0,length=arguments.length;i<length;i++){if(Object.isArray(arguments[i])){for(var j=0,arrayLength=arguments[i].length;j<arrayLength;j++)
array.push(arguments[i][j]);}else{array.push(arguments[i]);}}
return array;};}
Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16);},succ:function(){return this+1;},times:function(iterator){$R(0,this,true).each(iterator);return this;},toPaddedString:function(length,radix){var string=this.toString(radix||10);return'0'.times(length-string.length)+string;},toJSON:function(){return isFinite(this)?this.toString():'null';}});$w('abs round ceil floor').each(function(method){Number.prototype[method]=Math[method].methodize();});function $H(object){return new Hash(object);};var Hash=Class.create(Enumerable,(function(){if(function(){var i=0,Test=function(value){this.key=value};Test.prototype.key='foo';for(var property in new Test('bar'))i++;return i>1;}()){function each(iterator){var cache=[];for(var key in this._object){var value=this._object[key];if(cache.include(key))continue;cache.push(key);var pair=[key,value];pair.key=key;pair.value=value;iterator(pair);}}}else{function each(iterator){for(var key in this._object){var value=this._object[key],pair=[key,value];pair.key=key;pair.value=value;iterator(pair);}}}
function toQueryPair(key,value){if(Object.isUndefined(value))return key;return key+'='+encodeURIComponent(String.interpret(value));}
return{initialize:function(object){this._object=Object.isHash(object)?object.toObject():Object.clone(object);},_each:each,set:function(key,value){return this._object[key]=value;},get:function(key){return this._object[key];},unset:function(key){var value=this._object[key];delete this._object[key];return value;},toObject:function(){return Object.clone(this._object);},keys:function(){return this.pluck('key');},values:function(){return this.pluck('value');},index:function(value){var match=this.detect(function(pair){return pair.value===value;});return match&&match.key;},merge:function(object){return this.clone().update(object);},update:function(object){return new Hash(object).inject(this,function(result,pair){result.set(pair.key,pair.value);return result;});},toQueryString:function(){return this.map(function(pair){var key=encodeURIComponent(pair.key),values=pair.value;if(values&&typeof values=='object'){if(Object.isArray(values))
return values.map(toQueryPair.curry(key)).join('&');}
return toQueryPair(key,values);}).join('&');},inspect:function(){return'#<Hash:{'+this.map(function(pair){return pair.map(Object.inspect).join(': ');}).join(', ')+'}>';},toJSON:function(){return Object.toJSON(this.toObject());},clone:function(){return new Hash(this);}}})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(start,end,exclusive){this.start=start;this.end=end;this.exclusive=exclusive;},_each:function(iterator){var value=this.start;while(this.include(value)){iterator(value);value=value.succ();}},include:function(value){if(value<this.start)
return false;if(this.exclusive)
return value<this.end;return value<=this.end;}});var $R=function(start,end,exclusive){return new ObjectRange(start,end,exclusive);};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')})||false;},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(iterator){this.responders._each(iterator);},register:function(responder){if(!this.include(responder))
this.responders.push(responder);},unregister:function(responder){this.responders=this.responders.without(responder);},dispatch:function(callback,request,transport,json){this.each(function(responder){if(Object.isFunction(responder[callback])){try{responder[callback].apply(responder,[request,transport,json]);}catch(e){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(options){this.options={method:'post',asynchronous:true,contentType:'application/x-www-form-urlencoded',encoding:'UTF-8',parameters:'',evalJSON:true,evalJS:true};Object.extend(this.options,options||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters))
this.options.parameters=this.options.parameters.toQueryParams();}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,url,options){$super(options);this.transport=Ajax.getTransport();this.request(url);},request:function(url){this.url=url;this.method=this.options.method;var params=Object.clone(this.options.parameters);if(!['get','post'].include(this.method)){params['_method']=this.method;this.method='post';}
this.parameters=params;if(params=Object.toQueryString(params)){if(this.method=='get')
this.url+=(this.url.include('?')?'&':'?')+params;else if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))
params+='&_=';}
try{var response=new Ajax.Response(this);if(this.options.onCreate)this.options.onCreate(response);Ajax.Responders.dispatch('onCreate',this,response);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous)this.respondToReadyState.bind(this).defer(1);this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=='post'?(this.options.postBody||params):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType)
this.onStateChange();}
catch(e){this.dispatchException(e);}},onStateChange:function(){var readyState=this.transport.readyState;if(readyState>1&&!((readyState==4)&&this._complete))
this.respondToReadyState(this.transport.readyState);},setRequestHeaders:function(){var headers={'X-Requested-With':'XMLHttpRequest','X-Prototype-Version':Prototype.Version,'Accept':'text/javascript, text/html, application/xml, text/xml, */*'};if(this.method=='post'){headers['Content-type']=this.options.contentType+
(this.options.encoding?'; charset='+this.options.encoding:'');if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005)
headers['Connection']='close';}
if(typeof this.options.requestHeaders=='object'){var extras=this.options.requestHeaders;if(Object.isFunction(extras.push))
for(var i=0,length=extras.length;i<length;i+=2)
headers[extras[i]]=extras[i+1];else
$H(extras).each(function(pair){headers[pair.key]=pair.value});}
for(var name in headers)
this.transport.setRequestHeader(name,headers[name]);},success:function(){var status=this.getStatus();return!status||(status>=200&&status<300);},getStatus:function(){try{return this.transport.status||0;}catch(e){return 0}},respondToReadyState:function(readyState){var state=Ajax.Request.Events[readyState],response=new Ajax.Response(this);if(state=='Complete'){try{this._complete=true;(this.options['on'+response.status]||this.options['on'+(this.success()?'Success':'Failure')]||Prototype.emptyFunction)(response,response.headerJSON);}catch(e){this.dispatchException(e);}
var contentType=response.getHeader('Content-type');if(this.options.evalJS=='force'||(this.options.evalJS&&contentType&&contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
this.evalResponse();}
try{(this.options['on'+state]||Prototype.emptyFunction)(response,response.headerJSON);Ajax.Responders.dispatch('on'+state,this,response,response.headerJSON);}catch(e){this.dispatchException(e);}
if(state=='Complete'){this.transport.onreadystatechange=Prototype.emptyFunction;}},getHeader:function(name){try{return this.transport.getResponseHeader(name);}catch(e){return null}},evalResponse:function(){try{return eval((this.transport.responseText||'').unfilterJSON());}catch(e){this.dispatchException(e);}},dispatchException:function(exception){(this.options.onException||Prototype.emptyFunction)(this,exception);Ajax.Responders.dispatch('onException',this,exception);}});Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Response=Class.create({initialize:function(request){this.request=request;var transport=this.transport=request.transport,readyState=this.readyState=transport.readyState;if((readyState>2&&!Prototype.Browser.IE)||readyState==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(transport.responseText);this.headerJSON=this._getHeaderJSON();}
if(readyState==4){var xml=transport.responseXML;this.responseXML=xml===undefined?null:xml;this.responseJSON=this._getResponseJSON();}},status:0,statusText:'',getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||'';}catch(e){return''}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders();}catch(e){return null}},getResponseHeader:function(name){return this.transport.getResponseHeader(name);},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders();},_getHeaderJSON:function(){var json=this.getHeader('X-JSON');if(!json)return null;json=decodeURIComponent(escape(json));try{return json.evalJSON(this.request.options.sanitizeJSON);}catch(e){this.request.dispatchException(e);}},_getResponseJSON:function(){var options=this.request.options;if(!options.evalJSON||(options.evalJSON!='force'&&!(this.getHeader('Content-type')||'').include('application/json')))
return null;try{return this.transport.responseText.evalJSON(options.sanitizeJSON);}catch(e){this.request.dispatchException(e);}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,container,url,options){this.container={success:(container.success||container),failure:(container.failure||(container.success?null:container))};options=options||{};var onComplete=options.onComplete;options.onComplete=(function(response,param){this.updateContent(response.responseText);if(Object.isFunction(onComplete))onComplete(response,param);}).bind(this);$super(url,options);},updateContent:function(responseText){var receiver=this.container[this.success()?'success':'failure'],options=this.options;if(!options.evalScripts)responseText=responseText.stripScripts();if(receiver=$(receiver)){if(options.insertion){if(Object.isString(options.insertion)){var insertion={};insertion[options.insertion]=responseText;receiver.insert(insertion);}
else options.insertion(receiver,responseText);}
else receiver.update(responseText);}
if(this.success()){if(this.onComplete)this.onComplete.bind(this).defer();}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,container,url,options){$super(options);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=container;this.url=url;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent();},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments);},updateComplete:function(response){if(this.options.decay){this.decay=(response.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=response.responseText;}
this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency);},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});function $(element){if(arguments.length>1){for(var i=0,elements=[],length=arguments.length;i<length;i++)
elements.push($(arguments[i]));return elements;}
if(Object.isString(element))
element=document.getElementById(element);return Element.extend(element);}
if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(expression,parentElement){var results=[];var query=document.evaluate(expression,$(parentElement)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var i=0,length=query.snapshotLength;i<length;i++)
results.push(Element.extend(query.snapshotItem(i)));return results;};}
if(!window.Node)var Node={};if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12});}
(function(){var element=this.Element;this.Element=function(tagName,attributes){attributes=attributes||{};tagName=tagName.toLowerCase();var cache=Element.cache;if(Prototype.Browser.IE&&attributes.name){tagName='<'+tagName+' name="'+attributes.name+'">';delete attributes.name;return Element.writeAttribute(document.createElement(tagName),attributes);}
if(!cache[tagName])cache[tagName]=Element.extend(document.createElement(tagName));return Element.writeAttribute(cache[tagName].cloneNode(false),attributes);};Object.extend(this.Element,element||{});}).call(window);Element.cache={};Element.Methods={visible:function(element){return $(element).style.display!='none';},toggle:function(element){element=$(element);Element[Element.visible(element)?'hide':'show'](element);return element;},hide:function(element){$(element).style.display='none';return element;},show:function(element){$(element).style.display='';return element;},mostrar:function(element)
{$(element).removeClassName("hidden");return element;},esconder:function(element)
{$(element).addClassName("hidden");return element;},remove:function(element){element=$(element);element.parentNode.removeChild(element);return element;},update:function(element,content){element=$(element);if(content&&content.toElement)content=content.toElement();if(Object.isElement(content))return element.update().insert(content);content=Object.toHTML(content);element.innerHTML=content.stripScripts();content.evalScripts.bind(content).defer();return element;},replace:function(element,content){element=$(element);if(content&&content.toElement)content=content.toElement();else if(!Object.isElement(content)){content=Object.toHTML(content);var range=element.ownerDocument.createRange();range.selectNode(element);content.evalScripts.bind(content).defer();content=range.createContextualFragment(content.stripScripts());}
element.parentNode.replaceChild(content,element);return element;},insert:function(element,insertions){element=$(element);if(Object.isString(insertions)||Object.isNumber(insertions)||Object.isElement(insertions)||(insertions&&(insertions.toElement||insertions.toHTML)))
insertions={bottom:insertions};var content,t,range;for(position in insertions){content=insertions[position];position=position.toLowerCase();t=Element._insertionTranslations[position];if(content&&content.toElement)content=content.toElement();if(Object.isElement(content)){t.insert(element,content);continue;}
content=Object.toHTML(content);range=element.ownerDocument.createRange();t.initializeRange(element,range);t.insert(element,range.createContextualFragment(content.stripScripts()));content.evalScripts.bind(content).defer();}
return element;},wrap:function(element,wrapper,attributes){element=$(element);if(Object.isElement(wrapper))
$(wrapper).writeAttribute(attributes||{});else if(Object.isString(wrapper))wrapper=new Element(wrapper,attributes);else wrapper=new Element('div',wrapper);if(element.parentNode)
element.parentNode.replaceChild(wrapper,element);wrapper.appendChild(element);return wrapper;},inspect:function(element){element=$(element);var result='<'+element.tagName.toLowerCase();$H({'id':'id','className':'class'}).each(function(pair){var property=pair.first(),attribute=pair.last();var value=(element[property]||'').toString();if(value)result+=' '+attribute+'='+value.inspect(true);});return result+'>';},recursivelyCollect:function(element,property){element=$(element);var elements=[];while(element=element[property])
if(element.nodeType==1)
elements.push(Element.extend(element));return elements;},ancestors:function(element){return $(element).recursivelyCollect('parentNode');},descendants:function(element){return $A($(element).getElementsByTagName('*')).each(Element.extend);},firstDescendant:function(element){element=$(element).firstChild;while(element&&element.nodeType!=1)element=element.nextSibling;return $(element);},immediateDescendants:function(element){if(!(element=$(element).firstChild))return[];while(element&&element.nodeType!=1)element=element.nextSibling;if(element)return[element].concat($(element).nextSiblings());return[];},previousSiblings:function(element){return $(element).recursivelyCollect('previousSibling');},nextSiblings:function(element){return $(element).recursivelyCollect('nextSibling');},siblings:function(element){element=$(element);return element.previousSiblings().reverse().concat(element.nextSiblings());},match:function(element,selector){if(Object.isString(selector))
selector=new Selector(selector);return selector.match($(element));},up:function(element,expression,index){element=$(element);if(arguments.length==1)return $(element.parentNode);var ancestors=element.ancestors();return expression?Selector.findElement(ancestors,expression,index):ancestors[index||0];},down:function(element,expression,index){element=$(element);if(arguments.length==1)return element.firstDescendant();var descendants=element.descendants();return expression?Selector.findElement(descendants,expression,index):descendants[index||0];},previous:function(element,expression,index){element=$(element);if(arguments.length==1)return $(Selector.handlers.previousElementSibling(element));var previousSiblings=element.previousSiblings();return expression?Selector.findElement(previousSiblings,expression,index):previousSiblings[index||0];},next:function(element,expression,index){element=$(element);if(arguments.length==1)return $(Selector.handlers.nextElementSibling(element));var nextSiblings=element.nextSiblings();return expression?Selector.findElement(nextSiblings,expression,index):nextSiblings[index||0];},select:function(){var args=$A(arguments),element=$(args.shift());return Selector.findChildElements(element,args);},adjacent:function(){var args=$A(arguments),element=$(args.shift());return Selector.findChildElements(element.parentNode,args).without(element);},identify:function(element){element=$(element);var id=element.readAttribute('id'),self=arguments.callee;if(id)return id;do{id='anonymous_element_'+self.counter++}while($(id));element.writeAttribute('id',id);return id;},readAttribute:function(element,name){element=$(element);if(Prototype.Browser.IE){var t=Element._attributeTranslations.read;if(t.values[name])return t.values[name](element,name);if(t.names[name])name=t.names[name];if(name.include(':')){return(!element.attributes||!element.attributes[name])?null:element.attributes[name].value;}}
return element.getAttribute(name);},writeAttribute:function(element,name,value){element=$(element);var attributes={},t=Element._attributeTranslations.write;if(typeof name=='object')attributes=name;else attributes[name]=value===undefined?true:value;for(var attr in attributes){var name=t.names[attr]||attr,value=attributes[attr];if(t.values[attr])name=t.values[attr](element,value);if(value===false||value===null)
element.removeAttribute(name);else if(value===true)
element.setAttribute(name,name);else element.setAttribute(name,value);}
return element;},getHeight:function(element){return $(element).getDimensions().height;},getWidth:function(element){return $(element).getDimensions().width;},classNames:function(element){return new Element.ClassNames(element);},hasClassName:function(element,className){if(!(element=$(element)))return;var elementClassName=element.className;return(elementClassName.length>0&&(elementClassName==className||new RegExp("(^|\\s)"+className+"(\\s|$)").test(elementClassName)));},addClassName:function(element,className){if(!(element=$(element)))return;if(!element.hasClassName(className))
element.className+=(element.className?' ':'')+className;return element;},removeClassName:function(element,className){if(!(element=$(element)))return;element.className=element.className.replace(new RegExp("(^|\\s+)"+className+"(\\s+|$)"),' ').strip();return element;},toggleClassName:function(element,className){if(!(element=$(element)))return;return element[element.hasClassName(className)?'removeClassName':'addClassName'](className);},cleanWhitespace:function(element){element=$(element);var node=element.firstChild;while(node){var nextNode=node.nextSibling;if(node.nodeType==3&&!/\S/.test(node.nodeValue))
element.removeChild(node);node=nextNode;}
return element;},empty:function(element){return $(element).innerHTML.blank();},descendantOf:function(element,ancestor){element=$(element),ancestor=$(ancestor);if(element.compareDocumentPosition)
return(element.compareDocumentPosition(ancestor)&8)===8;if(element.sourceIndex&&!Prototype.Browser.Opera){var e=element.sourceIndex,a=ancestor.sourceIndex,nextAncestor=ancestor.nextSibling;if(!nextAncestor){do{ancestor=ancestor.parentNode;}
while(!(nextAncestor=ancestor.nextSibling)&&ancestor.parentNode);}
if(nextAncestor)return(e>a&&e<nextAncestor.sourceIndex);}
while(element=element.parentNode)
if(element==ancestor)return true;return false;},scrollTo:function(element){element=$(element);var pos=element.cumulativeOffset();window.scrollTo(pos[0],pos[1]);return element;},getStyle:function(element,style){element=$(element);style=style=='float'?'cssFloat':style.camelize();var value=element.style[style];if(!value){var css=document.defaultView.getComputedStyle(element,null);value=css?css[style]:null;}
if(style=='opacity')return value?parseFloat(value):1.0;return value=='auto'?null:value;},getOpacity:function(element){return $(element).getStyle('opacity');},setStyle:function(element,styles){element=$(element);var elementStyle=element.style,match;if(Object.isString(styles)){element.style.cssText+=';'+styles;return styles.include('opacity')?element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]):element;}
for(var property in styles)
if(property=='opacity')element.setOpacity(styles[property]);else
elementStyle[(property=='float'||property=='cssFloat')?(elementStyle.styleFloat===undefined?'cssFloat':'styleFloat'):property]=styles[property];return element;},setOpacity:function(element,value){element=$(element);element.style.opacity=(value==1||value==='')?'':(value<0.00001)?0:value;return element;},getDimensions:function(element){element=$(element);var display=$(element).getStyle('display');if(display!='none'&&display!=null)
return{width:element.offsetWidth,height:element.offsetHeight};var els=element.style;var originalVisibility=els.visibility;var originalPosition=els.position;var originalDisplay=els.display;els.visibility='hidden';els.position='absolute';els.display='block';var originalWidth=element.clientWidth;var originalHeight=element.clientHeight;els.display=originalDisplay;els.position=originalPosition;els.visibility=originalVisibility;return{width:originalWidth,height:originalHeight};},makePositioned:function(element){element=$(element);var pos=Element.getStyle(element,'position');if(pos=='static'||!pos){element._madePositioned=true;element.style.position='relative';if(window.opera){element.style.top=0;element.style.left=0;}}
return element;},undoPositioned:function(element){element=$(element);if(element._madePositioned){element._madePositioned=undefined;element.style.position=element.style.top=element.style.left=element.style.bottom=element.style.right='';}
return element;},makeClipping:function(element){element=$(element);if(element._overflow)return element;element._overflow=Element.getStyle(element,'overflow')||'auto';if(element._overflow!=='hidden')
element.style.overflow='hidden';return element;},undoClipping:function(element){element=$(element);if(!element._overflow)return element;element.style.overflow=element._overflow=='auto'?'':element._overflow;element._overflow=null;return element;},cumulativeOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;}while(element);return Element._returnOffset(valueL,valueT);},positionedOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;if(element){if(element.tagName=='BODY')break;var p=Element.getStyle(element,'position');if(p=='relative'||p=='absolute')break;}}while(element);return Element._returnOffset(valueL,valueT);},absolutize:function(element){element=$(element);if(element.getStyle('position')=='absolute')return;var offsets=element.positionedOffset();var top=offsets[1];var left=offsets[0];var width=element.clientWidth;var height=element.clientHeight;element._originalLeft=left-parseFloat(element.style.left||0);element._originalTop=top-parseFloat(element.style.top||0);element._originalWidth=element.style.width;element._originalHeight=element.style.height;element.style.position='absolute';element.style.top=top+'px';element.style.left=left+'px';element.style.width=width+'px';element.style.height=height+'px';return element;},relativize:function(element){element=$(element);if(element.getStyle('position')=='relative')return;element.style.position='relative';var top=parseFloat(element.style.top||0)-(element._originalTop||0);var left=parseFloat(element.style.left||0)-(element._originalLeft||0);element.style.top=top+'px';element.style.left=left+'px';element.style.height=element._originalHeight;element.style.width=element._originalWidth;return element;},cumulativeScrollOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.scrollTop||0;valueL+=element.scrollLeft||0;element=element.parentNode;}while(element);return Element._returnOffset(valueL,valueT);},getOffsetParent:function(element){if(element.offsetParent)return $(element.offsetParent);if(element==document.body)return $(element);while((element=element.parentNode)&&element!=document.body)
if(Element.getStyle(element,'position')!='static')
return $(element);return $(document.body);},viewportOffset:function(forElement){var valueT=0,valueL=0;var element=forElement;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body&&Element.getStyle(element,'position')=='absolute')break;}while(element=element.offsetParent);element=forElement;do{if(!Prototype.Browser.Opera||element.tagName=='BODY'){valueT-=element.scrollTop||0;valueL-=element.scrollLeft||0;}}while(element=element.parentNode);return Element._returnOffset(valueL,valueT);},clonePosition:function(element,source){var options=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});source=$(source);var p=source.viewportOffset();element=$(element);var delta=[0,0];var parent=null;if(Element.getStyle(element,'position')=='absolute'){parent=element.getOffsetParent();delta=parent.viewportOffset();}
if(parent==document.body){delta[0]-=document.body.offsetLeft;delta[1]-=document.body.offsetTop;}
if(options.setLeft)element.style.left=(p[0]-delta[0]+options.offsetLeft)+'px';if(options.setTop)element.style.top=(p[1]-delta[1]+options.offsetTop)+'px';if(options.setWidth)element.style.width=source.offsetWidth+'px';if(options.setHeight)element.style.height=source.offsetHeight+'px';return element;}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:'class',htmlFor:'for'},values:{}}};if(!document.createRange||Prototype.Browser.Opera){Element.Methods.insert=function(element,insertions){element=$(element);if(Object.isString(insertions)||Object.isNumber(insertions)||Object.isElement(insertions)||(insertions&&(insertions.toElement||insertions.toHTML)))
insertions={bottom:insertions};var t=Element._insertionTranslations,content,position,pos,tagName;for(position in insertions){content=insertions[position];position=position.toLowerCase();pos=t[position];if(content&&content.toElement)content=content.toElement();if(Object.isElement(content)){pos.insert(element,content);continue;}
content=Object.toHTML(content);tagName=((position=='before'||position=='after')?element.parentNode:element).tagName.toUpperCase();if(t.tags[tagName]){var fragments=Element._getContentFromAnonymousElement(tagName,content.stripScripts());if(position=='top'||position=='after')fragments.reverse();fragments.each(pos.insert.curry(element));}
else element.insertAdjacentHTML(pos.adjacency,content.stripScripts());content.evalScripts.bind(content).defer();}
return element;};}
if(Prototype.Browser.Opera){Element.Methods._getStyle=Element.Methods.getStyle;Element.Methods.getStyle=function(element,style){switch(style){case'left':case'top':case'right':case'bottom':if(Element._getStyle(element,'position')=='static')return null;default:return Element._getStyle(element,style);}};Element.Methods._readAttribute=Element.Methods.readAttribute;Element.Methods.readAttribute=function(element,attribute){if(attribute=='title')return element.title;return Element._readAttribute(element,attribute);};}
else if(Prototype.Browser.IE){$w('positionedOffset getOffsetParent viewportOffset').each(function(method){Element.Methods[method]=Element.Methods[method].wrap(function(proceed,element){element=$(element);var position=element.getStyle('position');if(position!='static')return proceed(element);element.setStyle({position:'relative'});var value=proceed(element);element.setStyle({position:position});return value;});});Element.Methods.getStyle=function(element,style){element=$(element);style=(style=='float'||style=='cssFloat')?'styleFloat':style.camelize();var value=element.style[style];if(!value&&element.currentStyle)value=element.currentStyle[style];if(style=='opacity'){if(value=(element.getStyle('filter')||'').match(/alpha\(opacity=(.*)\)/))
if(value[1])return parseFloat(value[1])/100;return 1.0;}
if(value=='auto'){if((style=='width'||style=='height')&&(element.getStyle('display')!='none'))
return element['offset'+style.capitalize()]+'px';return null;}
return value;};Element.Methods.setOpacity=function(element,value){function stripAlpha(filter){return filter.replace(/alpha\([^\)]*\)/gi,'');}
element=$(element);var currentStyle=element.currentStyle;if((currentStyle&&!currentStyle.hasLayout)||(!currentStyle&&element.style.zoom=='normal'))
element.style.zoom=1;var filter=element.getStyle('filter'),style=element.style;if(value==1||value===''){(filter=stripAlpha(filter))?style.filter=filter:style.removeAttribute('filter');return element;}else if(value<0.00001)value=0;style.filter=stripAlpha(filter)+'alpha(opacity='+(value*100)+')';return element;};Element._attributeTranslations={read:{names:{'class':'className','for':'htmlFor'},values:{_getAttr:function(element,attribute){return element.getAttribute(attribute,2);},_getAttrNode:function(element,attribute){var node=element.getAttributeNode(attribute);return node?node.value:"";},_getEv:function(element,attribute){var attribute=element.getAttribute(attribute);return attribute?attribute.toString().slice(23,-2):null;},_flag:function(element,attribute){return $(element).hasAttribute(attribute)?attribute:null;},style:function(element){return element.style.cssText.toLowerCase();},title:function(element){return element.title;}}}};Element._attributeTranslations.write={names:Object.clone(Element._attributeTranslations.read.names),values:{checked:function(element,value){element.checked=!!value;},style:function(element,value){element.style.cssText=value?value:'';}}};Element._attributeTranslations.has={};$w('colSpan rowSpan vAlign dateTime accessKey tabIndex '+'encType maxLength readOnly longDesc').each(function(attr){Element._attributeTranslations.write.names[attr.toLowerCase()]=attr;Element._attributeTranslations.has[attr.toLowerCase()]=attr;});(function(v){Object.extend(v,{href:v._getAttr,src:v._getAttr,type:v._getAttr,action:v._getAttrNode,disabled:v._flag,checked:v._flag,readonly:v._flag,multiple:v._flag,onload:v._getEv,onunload:v._getEv,onclick:v._getEv,ondblclick:v._getEv,onmousedown:v._getEv,onmouseup:v._getEv,onmouseover:v._getEv,onmousemove:v._getEv,onmouseout:v._getEv,onfocus:v._getEv,onblur:v._getEv,onkeypress:v._getEv,onkeydown:v._getEv,onkeyup:v._getEv,onsubmit:v._getEv,onreset:v._getEv,onselect:v._getEv,onchange:v._getEv});})(Element._attributeTranslations.read.values);}
else if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(element,value){element=$(element);element.style.opacity=(value==1)?0.999999:(value==='')?'':(value<0.00001)?0:value;return element;};}
else if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(element,value){element=$(element);element.style.opacity=(value==1||value==='')?'':(value<0.00001)?0:value;if(value==1)
if(element.tagName=='IMG'&&element.width){element.width++;element.width--;}else try{var n=document.createTextNode(' ');element.appendChild(n);element.removeChild(n);}catch(e){}
return element;};Element.Methods.cumulativeOffset=function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body)
if(Element.getStyle(element,'position')=='absolute')break;element=element.offsetParent;}while(element);return Element._returnOffset(valueL,valueT);};}
if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(element,content){element=$(element);if(content&&content.toElement)content=content.toElement();if(Object.isElement(content))return element.update().insert(content);content=Object.toHTML(content);var tagName=element.tagName.toUpperCase();if(tagName in Element._insertionTranslations.tags){$A(element.childNodes).each(function(node){element.removeChild(node)});Element._getContentFromAnonymousElement(tagName,content.stripScripts()).each(function(node){element.appendChild(node)});}
else element.innerHTML=content.stripScripts();content.evalScripts.bind(content).defer();return element;};}
if(document.createElement('div').outerHTML){Element.Methods.replace=function(element,content){element=$(element);if(content&&content.toElement)content=content.toElement();if(Object.isElement(content)){element.parentNode.replaceChild(content,element);return element;}
content=Object.toHTML(content);var parent=element.parentNode,tagName=parent.tagName.toUpperCase();if(Element._insertionTranslations.tags[tagName]){var nextSibling=element.next();var fragments=Element._getContentFromAnonymousElement(tagName,content.stripScripts());parent.removeChild(element);if(nextSibling)
fragments.each(function(node){parent.insertBefore(node,nextSibling)});else
fragments.each(function(node){parent.appendChild(node)});}
else element.outerHTML=content.stripScripts();content.evalScripts.bind(content).defer();return element;};}
Element._returnOffset=function(l,t){var result=[l,t];result.left=l;result.top=t;return result;};Element._getContentFromAnonymousElement=function(tagName,html){var div=new Element('div'),t=Element._insertionTranslations.tags[tagName];div.innerHTML=t[0]+html+t[1];t[2].times(function(){div=div.firstChild});return $A(div.childNodes);};Element._insertionTranslations={before:{adjacency:'beforeBegin',insert:function(element,node){element.parentNode.insertBefore(node,element);},initializeRange:function(element,range){range.setStartBefore(element);}},top:{adjacency:'afterBegin',insert:function(element,node){element.insertBefore(node,element.firstChild);},initializeRange:function(element,range){range.selectNodeContents(element);range.collapse(true);}},bottom:{adjacency:'beforeEnd',insert:function(element,node){element.appendChild(node);}},after:{adjacency:'afterEnd',insert:function(element,node){element.parentNode.insertBefore(node,element.nextSibling);},initializeRange:function(element,range){range.setStartAfter(element);}},tags:{TABLE:['<table>','</table>',1],TBODY:['<table><tbody>','</tbody></table>',2],TR:['<table><tbody><tr>','</tr></tbody></table>',3],TD:['<table><tbody><tr><td>','</td></tr></tbody></table>',4],SELECT:['<select>','</select>',1]}};(function(){this.bottom.initializeRange=this.top.initializeRange;Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD});}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(element,attribute){attribute=Element._attributeTranslations.has[attribute]||attribute;var node=$(element).getAttributeNode(attribute);return node&&node.specified;}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement('div').__proto__){window.HTMLElement={};window.HTMLElement.prototype=document.createElement('div').__proto__;Prototype.BrowserFeatures.ElementExtensions=true;}
Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions)
return Prototype.K;var Methods={},ByTag=Element.Methods.ByTag;var extend=Object.extend(function(element){if(!element||element._extendedByPrototype||element.nodeType!=1||element==window)return element;var methods=Object.clone(Methods),tagName=element.tagName,property,value;if(ByTag[tagName])Object.extend(methods,ByTag[tagName]);for(property in methods){value=methods[property];if(Object.isFunction(value)&&!(property in element))
element[property]=value.methodize();}
element._extendedByPrototype=Prototype.emptyFunction;return element;},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(Methods,Element.Methods);Object.extend(Methods,Element.Methods.Simulated);}}});extend.refresh();return extend;})();Element.hasAttribute=function(element,attribute){if(element.hasAttribute)return element.hasAttribute(attribute);return Element.Methods.Simulated.hasAttribute(element,attribute);};Element.addMethods=function(methods){var F=Prototype.BrowserFeatures,T=Element.Methods.ByTag;if(!methods){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{"FORM":Object.clone(Form.Methods),"INPUT":Object.clone(Form.Element.Methods),"SELECT":Object.clone(Form.Element.Methods),"TEXTAREA":Object.clone(Form.Element.Methods)});}
if(arguments.length==2){var tagName=methods;methods=arguments[1];}
if(!tagName)Object.extend(Element.Methods,methods||{});else{if(Object.isArray(tagName))tagName.each(extend);else extend(tagName);}
function extend(tagName){tagName=tagName.toUpperCase();if(!Element.Methods.ByTag[tagName])
Element.Methods.ByTag[tagName]={};Object.extend(Element.Methods.ByTag[tagName],methods);}
function copy(methods,destination,onlyIfAbsent){onlyIfAbsent=onlyIfAbsent||false;for(var property in methods){var value=methods[property];if(!Object.isFunction(value))continue;if(!onlyIfAbsent||!(property in destination))
destination[property]=value.methodize();}}
function findDOMClass(tagName){var klass;var trans={"OPTGROUP":"OptGroup","TEXTAREA":"TextArea","P":"Paragraph","FIELDSET":"FieldSet","UL":"UList","OL":"OList","DL":"DList","DIR":"Directory","H1":"Heading","H2":"Heading","H3":"Heading","H4":"Heading","H5":"Heading","H6":"Heading","Q":"Quote","INS":"Mod","DEL":"Mod","A":"Anchor","IMG":"Image","CAPTION":"TableCaption","COL":"TableCol","COLGROUP":"TableCol","THEAD":"TableSection","TFOOT":"TableSection","TBODY":"TableSection","TR":"TableRow","TH":"TableCell","TD":"TableCell","FRAMESET":"FrameSet","IFRAME":"IFrame"};if(trans[tagName])klass='HTML'+trans[tagName]+'Element';if(window[klass])return window[klass];klass='HTML'+tagName+'Element';if(window[klass])return window[klass];klass='HTML'+tagName.capitalize()+'Element';if(window[klass])return window[klass];window[klass]={};window[klass].prototype=document.createElement(tagName).__proto__;return window[klass];}
if(F.ElementExtensions){copy(Element.Methods,HTMLElement.prototype);copy(Element.Methods.Simulated,HTMLElement.prototype,true);}
if(F.SpecificElementExtensions){for(var tag in Element.Methods.ByTag){var klass=findDOMClass(tag);if(Object.isUndefined(klass))continue;copy(T[tag],klass.prototype);}}
Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh)Element.extend.refresh();Element.cache={};};document.viewport={getDimensions:function(){var dimensions={};$w('width height').each(function(d){var D=d.capitalize();dimensions[d]=self['inner'+D]||(document.documentElement['client'+D]||document.body['client'+D]);});return dimensions;},getWidth:function(){return this.getDimensions().width;},getHeight:function(){return this.getDimensions().height;},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop);}};var Selector=Class.create({initialize:function(expression){this.expression=expression.strip();this.compileMatcher();},compileMatcher:function(){if(Prototype.BrowserFeatures.XPath&&!(/(\[[\w-]*?:|:checked)/).test(this.expression))
return this.compileXPathMatcher();var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return;}
this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],'');break;}}}
this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join('\n'));Selector._cache[this.expression]=this.matcher;},compileXPathMatcher:function(){var e=this.expression,ps=Selector.patterns,x=Selector.xpath,le,m;if(Selector._cache[e]){this.xpath=Selector._cache[e];return;}
this.matcher=['.//*'];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){if(m=e.match(ps[i])){this.matcher.push(Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m));e=e.replace(m[0],'');break;}}}
this.xpath=this.matcher.join('');Selector._cache[this.expression]=this.xpath;},findElements:function(root){root=root||document;if(this.xpath)return document._getElementsByXPath(this.xpath,root);return this.matcher(root);},match:function(element){this.tokens=[];var e=this.expression,ps=Selector.patterns,as=Selector.assertions;var le,p,m;while(e&&le!==e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){if(as[i]){this.tokens.push([i,Object.clone(m)]);e=e.replace(m[0],'');}else{return this.findElements(document).include(element);}}}}
var match=true,name,matches;for(var i=0,token;token=this.tokens[i];i++){name=token[0],matches=token[1];if(!Selector.assertions[name](element,matches)){match=false;break;}}
return match;},toString:function(){return this.expression;},inspect:function(){return"#<Selector:"+this.expression.inspect()+">";}});Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:'/following-sibling::*',tagName:function(m){if(m[1]=='*')return'';return"[local-name()='"+m[1].toLowerCase()+"' or local-name()='"+m[1].toUpperCase()+"']";},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:"[@#{1}]",attr:function(m){m[3]=m[5]||m[6];return new Template(Selector.xpath.operators[m[2]]).evaluate(m);},pseudo:function(m){var h=Selector.xpath.pseudos[m[1]];if(!h)return'';if(Object.isFunction(h))return h(m);return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);},operators:{'=':"[@#{1}='#{3}']",'!=':"[@#{1}!='#{3}']",'^=':"[starts-with(@#{1}, '#{3}')]",'$=':"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",'*=':"[contains(@#{1}, '#{3}')]",'~=':"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",'|=':"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{'first-child':'[not(preceding-sibling::*)]','last-child':'[not(following-sibling::*)]','only-child':'[not(preceding-sibling::* or following-sibling::*)]','empty':"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",'checked':"[@checked]",'disabled':"[@disabled]",'enabled':"[not(@disabled)]",'not':function(m){var e=m[6],p=Selector.patterns,x=Selector.xpath,le,m,v;var exclusion=[];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in p){if(m=e.match(p[i])){v=Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m);exclusion.push("("+v.substring(1,v.length-1)+")");e=e.replace(m[0],'');break;}}}
return"[not("+exclusion.join(" and ")+")]";},'nth-child':function(m){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",m);},'nth-last-child':function(m){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",m);},'nth-of-type':function(m){return Selector.xpath.pseudos.nth("position() ",m);},'nth-last-of-type':function(m){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",m);},'first-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-of-type'](m);},'last-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-last-of-type'](m);},'only-of-type':function(m){var p=Selector.xpath.pseudos;return p['first-of-type'](m)+p['last-of-type'](m);},nth:function(fragment,m){var mm,formula=m[6],predicate;if(formula=='even')formula='2n+0';if(formula=='odd')formula='2n+1';if(mm=formula.match(/^(\d+)$/))
return'['+fragment+"= "+mm[1]+']';if(mm=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(mm[1]=="-")mm[1]=-1;var a=mm[1]?Number(mm[1]):1;var b=mm[2]?Number(mm[2]):0;predicate="[((#{fragment} - #{b}) mod #{a} = 0) and "+"((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(predicate).evaluate({fragment:fragment,a:a,b:b});}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);   c = false;',className:'n = h.className(n, r, "#{1}", c); c = false;',id:'n = h.id(n, r, "#{1}", c);        c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}"); c = false;',attr:function(m){m[3]=(m[5]||m[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m);},pseudo:function(m){if(m[6])m[6]=m[6].replace(/"/g,'\\"');return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s)|(?=:))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(element,matches){return matches[1].toUpperCase()==element.tagName.toUpperCase();},className:function(element,matches){return Element.hasClassName(element,matches[1]);},id:function(element,matches){return element.id===matches[1];},attrPresence:function(element,matches){return Element.hasAttribute(element,matches[1]);},attr:function(element,matches){var nodeValue=Element.readAttribute(element,matches[1]);return Selector.operators[matches[2]](nodeValue,matches[3]);}},handlers:{concat:function(a,b){for(var i=0,node;node=b[i];i++)
a.push(node);return a;},mark:function(nodes){for(var i=0,node;node=nodes[i];i++)
node._counted=true;return nodes;},unmark:function(nodes){for(var i=0,node;node=nodes[i];i++)
node._counted=undefined;return nodes;},index:function(parentNode,reverse,ofType){parentNode._counted=true;if(reverse){for(var nodes=parentNode.childNodes,i=nodes.length-1,j=1;i>=0;i--){var node=nodes[i];if(node.nodeType==1&&(!ofType||node._counted))node.nodeIndex=j++;}}else{for(var i=0,j=1,nodes=parentNode.childNodes;node=nodes[i];i++)
if(node.nodeType==1&&(!ofType||node._counted))node.nodeIndex=j++;}},unique:function(nodes){if(nodes.length==0)return nodes;var results=[],n;for(var i=0,l=nodes.length;i<l;i++)
if(!(n=nodes[i])._counted){n._counted=true;results.push(Element.extend(n));}
return Selector.handlers.unmark(results);},descendant:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
h.concat(results,node.getElementsByTagName('*'));return results;},child:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++){for(var j=0,children=[],child;child=node.childNodes[j];j++)
if(child.nodeType==1&&child.tagName!='!')results.push(child);}
return results;},adjacent:function(nodes){for(var i=0,results=[],node;node=nodes[i];i++){var next=this.nextElementSibling(node);if(next)results.push(next);}
return results;},laterSibling:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
h.concat(results,Element.nextSiblings(node));return results;},nextElementSibling:function(node){while(node=node.nextSibling)
if(node.nodeType==1)return node;return null;},previousElementSibling:function(node){while(node=node.previousSibling)
if(node.nodeType==1)return node;return null;},tagName:function(nodes,root,tagName,combinator){tagName=tagName.toUpperCase();var results=[],h=Selector.handlers;if(nodes){if(combinator){if(combinator=="descendant"){for(var i=0,node;node=nodes[i];i++)
h.concat(results,node.getElementsByTagName(tagName));return results;}else nodes=this[combinator](nodes);if(tagName=="*")return nodes;}
for(var i=0,node;node=nodes[i];i++)
if(node.tagName.toUpperCase()==tagName)results.push(node);return results;}else return root.getElementsByTagName(tagName);},id:function(nodes,root,id,combinator){var targetNode=$(id),h=Selector.handlers;if(!targetNode)return[];if(!nodes&&root==document)return[targetNode];if(nodes){if(combinator){if(combinator=='child'){for(var i=0,node;node=nodes[i];i++)
if(targetNode.parentNode==node)return[targetNode];}else if(combinator=='descendant'){for(var i=0,node;node=nodes[i];i++)
if(Element.descendantOf(targetNode,node))return[targetNode];}else if(combinator=='adjacent'){for(var i=0,node;node=nodes[i];i++)
if(Selector.handlers.previousElementSibling(targetNode)==node)
return[targetNode];}else nodes=h[combinator](nodes);}
for(var i=0,node;node=nodes[i];i++)
if(node==targetNode)return[targetNode];return[];}
return(targetNode&&Element.descendantOf(targetNode,root))?[targetNode]:[];},className:function(nodes,root,className,combinator){if(nodes&&combinator)nodes=this[combinator](nodes);return Selector.handlers.byClassName(nodes,root,className);},byClassName:function(nodes,root,className){if(!nodes)nodes=Selector.handlers.descendant([root]);var needle=' '+className+' ';for(var i=0,results=[],node,nodeClassName;node=nodes[i];i++){nodeClassName=node.className;if(nodeClassName.length==0)continue;if(nodeClassName==className||(' '+nodeClassName+' ').include(needle))
results.push(node);}
return results;},attrPresence:function(nodes,root,attr){if(!nodes)nodes=root.getElementsByTagName("*");var results=[];for(var i=0,node;node=nodes[i];i++)
if(Element.hasAttribute(node,attr))results.push(node);return results;},attr:function(nodes,root,attr,value,operator){if(!nodes)nodes=root.getElementsByTagName("*");var handler=Selector.operators[operator],results=[];for(var i=0,node;node=nodes[i];i++){var nodeValue=Element.readAttribute(node,attr);if(nodeValue===null)continue;if(handler(nodeValue,value))results.push(node);}
return results;},pseudo:function(nodes,name,value,root,combinator){if(nodes&&combinator)nodes=this[combinator](nodes);if(!nodes)nodes=root.getElementsByTagName("*");return Selector.pseudos[name](nodes,value,root);}},pseudos:{'first-child':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.previousElementSibling(node))continue;results.push(node);}
return results;},'last-child':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.nextElementSibling(node))continue;results.push(node);}
return results;},'only-child':function(nodes,value,root){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
if(!h.previousElementSibling(node)&&!h.nextElementSibling(node))
results.push(node);return results;},'nth-child':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root);},'nth-last-child':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true);},'nth-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,false,true);},'nth-last-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true,true);},'first-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,false,true);},'last-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,true,true);},'only-of-type':function(nodes,formula,root){var p=Selector.pseudos;return p['last-of-type'](p['first-of-type'](nodes,formula,root),formula,root);},getIndices:function(a,b,total){if(a==0)return b>0?[b]:[];return $R(1,total).inject([],function(memo,i){if(0==(i-b)%a&&(i-b)/a>=0)memo.push(i);return memo;});},nth:function(nodes,formula,root,reverse,ofType){if(nodes.length==0)return[];if(formula=='even')formula='2n+0';if(formula=='odd')formula='2n+1';var h=Selector.handlers,results=[],indexed=[],m;h.mark(nodes);for(var i=0,node;node=nodes[i];i++){if(!node.parentNode._counted){h.index(node.parentNode,reverse,ofType);indexed.push(node.parentNode);}}
if(formula.match(/^\d+$/)){formula=Number(formula);for(var i=0,node;node=nodes[i];i++)
if(node.nodeIndex==formula)results.push(node);}else if(m=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(m[1]=="-")m[1]=-1;var a=m[1]?Number(m[1]):1;var b=m[2]?Number(m[2]):0;var indices=Selector.pseudos.getIndices(a,b,nodes.length);for(var i=0,node,l=indices.length;node=nodes[i];i++){for(var j=0;j<l;j++)
if(node.nodeIndex==indices[j])results.push(node);}}
h.unmark(nodes);h.unmark(indexed);return results;},'empty':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(node.tagName=='!'||(node.firstChild&&!node.innerHTML.match(/^\s*$/)))continue;results.push(node);}
return results;},'not':function(nodes,selector,root){var h=Selector.handlers,selectorType,m;var exclusions=new Selector(selector).findElements(root);h.mark(exclusions);for(var i=0,results=[],node;node=nodes[i];i++)
if(!node._counted)results.push(node);h.unmark(exclusions);return results;},'enabled':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(!node.disabled)results.push(node);return results;},'disabled':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(node.disabled)results.push(node);return results;},'checked':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(node.checked)results.push(node);return results;}},operators:{'=':function(nv,v){return nv==v;},'!=':function(nv,v){return nv!=v;},'^=':function(nv,v){return nv.startsWith(v);},'$=':function(nv,v){return nv.endsWith(v);},'*=':function(nv,v){return nv.include(v);},'~=':function(nv,v){return(' '+nv+' ').include(' '+v+' ');},'|=':function(nv,v){return('-'+nv.toUpperCase()+'-').include('-'+v.toUpperCase()+'-');}},matchElements:function(elements,expression){var matches=new Selector(expression).findElements(),h=Selector.handlers;h.mark(matches);for(var i=0,results=[],element;element=elements[i];i++)
if(element._counted)results.push(element);h.unmark(matches);return results;},findElement:function(elements,expression,index){if(Object.isNumber(expression)){index=expression;expression=false;}
return Selector.matchElements(elements,expression||'*')[index||0];},findChildElements:function(element,expressions){var exprs=expressions.join(','),expressions=[];exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(m){expressions.push(m[1].strip());});var results=[],h=Selector.handlers;for(var i=0,l=expressions.length,selector;i<l;i++){selector=new Selector(expressions[i].strip());h.concat(results,selector.findElements(element));}
return(l>1)?h.unique(results):results;}});function $$(){return Selector.findChildElements(document,$A(arguments));}
var Form={reset:function(form){$(form).reset();return form;},serializeElements:function(elements,options){if(typeof options!='object')options={hash:!!options};else if(options.hash===undefined)options.hash=true;var key,value,submitted=false,submit=options.submit;var data=elements.inject({},function(result,element){if(!element.disabled&&element.name){key=element.name;value=$(element).getValue();if(value!=null&&(element.type!='submit'||(!submitted&&submit!==false&&(!submit||key==submit)&&(submitted=true)))){if(key in result){if(!Object.isArray(result[key]))result[key]=[result[key]];result[key].push(value);}
else result[key]=value;}}
return result;});return options.hash?data:Object.toQueryString(data);}};Form.Methods={serialize:function(form,options){return Form.serializeElements(Form.getElements(form),options);},getElements:function(form){return $A($(form).getElementsByTagName('*')).inject([],function(elements,child){if(Form.Element.Serializers[child.tagName.toLowerCase()])
elements.push(Element.extend(child));return elements;});},getInputs:function(form,typeName,name){form=$(form);var inputs=form.getElementsByTagName('input');if(!typeName&&!name)return $A(inputs).map(Element.extend);for(var i=0,matchingInputs=[],length=inputs.length;i<length;i++){var input=inputs[i];if((typeName&&input.type!=typeName)||(name&&input.name!=name))
continue;matchingInputs.push(Element.extend(input));}
return matchingInputs;},disable:function(form){form=$(form);Form.getElements(form).invoke('disable');return form;},enable:function(form){form=$(form);Form.getElements(form).invoke('enable');return form;},findFirstElement:function(form){var elements=$(form).getElements().findAll(function(element){return'hidden'!=element.type&&!element.disabled;});var firstByIndex=elements.findAll(function(element){return element.hasAttribute('tabIndex')&&element.tabIndex>=0;}).sortBy(function(element){return element.tabIndex}).first();return firstByIndex?firstByIndex:elements.find(function(element){return['input','select','textarea'].include(element.tagName.toLowerCase());});},focusFirstElement:function(form){form=$(form);form.findFirstElement().activate();return form;},request:function(form,options){form=$(form),options=Object.clone(options||{});var params=options.parameters,action=form.readAttribute('action')||'';if(action.blank())action=window.location.href;options.parameters=form.serialize(true);if(params){if(Object.isString(params))params=params.toQueryParams();Object.extend(options.parameters,params);}
if(form.hasAttribute('method')&&!options.method)
options.method=form.method;return new Ajax.Request(action,options);}};Form.Element={focus:function(element){$(element).focus();return element;},select:function(element){$(element).select();return element;}};Form.Element.Methods={serialize:function(element){element=$(element);if(!element.disabled&&element.name){var value=element.getValue();if(value!=undefined){var pair={};pair[element.name]=value;return Object.toQueryString(pair);}}
return'';},getValue:function(element){element=$(element);var method=element.tagName.toLowerCase();return Form.Element.Serializers[method](element);},setValue:function(element,value){element=$(element);var method=element.tagName.toLowerCase();Form.Element.Serializers[method](element,value);return element;},clear:function(element){$(element).value='';return element;},present:function(element){return $(element).value!='';},activate:function(element){element=$(element);try{element.focus();if(element.select&&(element.tagName.toLowerCase()!='input'||!['button','reset','submit'].include(element.type)))
element.select();}catch(e){}
return element;},disable:function(element){element=$(element);element.blur();element.disabled=true;return element;},enable:function(element){element=$(element);element.disabled=false;return element;},mascara:function(element,mensagem)
{element.value=mensagem;element.addClassName("Watermark");addEvent(element,'focus',function(){element.removeClassName("Watermark");if(element.value==mensagem)element.value='';});addEvent(element,'blur',function(){if(element.value==''){element.value=mensagem;element.addClassName("Watermark");}else{element.removeClassName("Watermark");}});}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(element,value){switch(element.type.toLowerCase()){case'checkbox':case'radio':return Form.Element.Serializers.inputSelector(element,value);default:return Form.Element.Serializers.textarea(element,value);}},inputSelector:function(element,value){if(value===undefined)return element.checked?element.value:null;else element.checked=!!value;},textarea:function(element,value){if(value===undefined)return element.value;else element.value=value;},select:function(element,index){if(index===undefined)
return this[element.type=='select-one'?'selectOne':'selectMany'](element);else{var opt,value,single=!Object.isArray(index);for(var i=0,length=element.length;i<length;i++){opt=element.options[i];value=this.optionValue(opt);if(single){if(value==index){opt.selected=true;return;}}
else opt.selected=index.include(value);}}},selectOne:function(element){var index=element.selectedIndex;return index>=0?this.optionValue(element.options[index]):null;},selectMany:function(element){var values,length=element.length;if(!length)return null;for(var i=0,values=[];i<length;i++){var opt=element.options[i];if(opt.selected)values.push(this.optionValue(opt));}
return values;},optionValue:function(opt){return Element.extend(opt).hasAttribute('value')?opt.value:opt.text;}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,element,frequency,callback){$super(callback,frequency);this.element=$(element);this.lastValue=this.getValue();},execute:function(){var value=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(value)?this.lastValue!=value:String(this.lastValue)!=String(value)){this.callback(this.element,value);this.lastValue=value;}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=Class.create({initialize:function(element,callback){this.element=$(element);this.callback=callback;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=='form')
this.registerFormCallbacks();else
this.registerCallback(this.element);},onElementEvent:function(){var value=this.getValue();if(this.lastValue!=value){this.callback(this.element,value);this.lastValue=value;}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this);},registerCallback:function(element){if(element.type){switch(element.type.toLowerCase()){case'checkbox':case'radio':Event.observe(element,'click',this.onElementEvent.bind(this));break;default:Event.observe(element,'change',this.onElementEvent.bind(this));break;}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element);}});if(!window.Event)var Event={};Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(event){var element;switch(event.type){case'mouseover':element=event.fromElement;break;case'mouseout':element=event.toElement;break;default:return null;}
return Element.extend(element);}});Event.Methods=(function(){var isButton;if(Prototype.Browser.IE){var buttonMap={0:1,1:4,2:2};isButton=function(event,code){return event.button==buttonMap[code];};}else if(Prototype.Browser.WebKit){isButton=function(event,code){switch(code){case 0:return event.which==1&&!event.metaKey;case 1:return event.which==1&&event.metaKey;default:return false;}};}else{isButton=function(event,code){return event.which?(event.which===code+1):(event.button===code);};}
return{isLeftClick:function(event){return isButton(event,0)},isMiddleClick:function(event){return isButton(event,1)},isRightClick:function(event){return isButton(event,2)},element:function(event){var node=Event.extend(event).target;return Element.extend(node.nodeType==Node.TEXT_NODE?node.parentNode:node);},findElement:function(event,expression){var element=Event.element(event);return element.match(expression)?element:element.up(expression);},pointer:function(event){return{x:event.pageX||(event.clientX+
(document.documentElement.scrollLeft||document.body.scrollLeft)),y:event.pageY||(event.clientY+
(document.documentElement.scrollTop||document.body.scrollTop))};},pointerX:function(event){return Event.pointer(event).x},pointerY:function(event){return Event.pointer(event).y},stop:function(event){Event.extend(event);event.preventDefault();event.stopPropagation();event.stopped=true;}};})();Event.extend=(function(){var methods=Object.keys(Event.Methods).inject({},function(m,name){m[name]=Event.Methods[name].methodize();return m;});if(Prototype.Browser.IE){Object.extend(methods,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(event){if(!event)return false;if(event._extendedByPrototype)return event;event._extendedByPrototype=Prototype.emptyFunction;var pointer=Event.pointer(event);Object.extend(event,{target:event.srcElement,relatedTarget:Event.relatedTarget(event),pageX:pointer.x,pageY:pointer.y});return Object.extend(event,methods);};}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Event.prototype,methods);return Prototype.K;}})();Object.extend(Event,(function(){var cache=Event.cache;function getEventID(element){if(element._eventID)return element._eventID;arguments.callee.id=arguments.callee.id||1;return element._eventID=++arguments.callee.id;}
function getDOMEventName(eventName){if(eventName&&eventName.include(':'))return"dataavailable";return eventName;}
function getCacheForID(id){return cache[id]=cache[id]||{};}
function getWrappersForEventName(id,eventName){var c=getCacheForID(id);return c[eventName]=c[eventName]||[];}
function createWrapper(element,eventName,handler){var id=getEventID(element);var c=getWrappersForEventName(id,eventName);if(c.pluck("handler").include(handler))return false;var wrapper=function(event){if(!Event||!Event.extend||(event.eventName&&event.eventName!=eventName))
return false;Event.extend(event);if(handler!=null)
handler.call(element,event)};wrapper.handler=handler;c.push(wrapper);return wrapper;}
function findWrapper(id,eventName,handler){var c=getWrappersForEventName(id,eventName);return c.find(function(wrapper){return wrapper.handler==handler});}
function destroyWrapper(id,eventName,handler){var c=getCacheForID(id);if(!c[eventName])return false;c[eventName]=c[eventName].without(findWrapper(id,eventName,handler));}
function destroyCache(){for(var id in cache)
for(var eventName in cache[id])
cache[id][eventName]=null;}
if(window.attachEvent){window.attachEvent("onunload",destroyCache);}
return{observe:function(element,eventName,handler){element=$(element);var name=getDOMEventName(eventName);var wrapper=createWrapper(element,eventName,handler);if(!wrapper)return element;if(element.addEventListener){element.addEventListener(name,wrapper,false);}else{element.attachEvent("on"+name,wrapper);}
return element;},stopObserving:function(element,eventName,handler){element=$(element);var id=getEventID(element),name=getDOMEventName(eventName);if(!handler&&eventName){getWrappersForEventName(id,eventName).each(function(wrapper){element.stopObserving(eventName,wrapper.handler);});return element;}else if(!eventName){Object.keys(getCacheForID(id)).each(function(eventName){element.stopObserving(eventName);});return element;}
var wrapper=findWrapper(id,eventName,handler);if(!wrapper)return element;if(element.removeEventListener){element.removeEventListener(name,wrapper,false);}else{element.detachEvent("on"+name,wrapper);}
destroyWrapper(id,eventName,handler);return element;},fire:function(element,eventName,memo){element=$(element);if(element==document&&document.createEvent&&!element.dispatchEvent)
element=document.documentElement;if(document.createEvent){var event=document.createEvent("HTMLEvents");event.initEvent("dataavailable",true,true);}else{var event=document.createEventObject();event.eventType="ondataavailable";}
event.eventName=eventName;event.memo=memo||{};if(document.createEvent){element.dispatchEvent(event);}else{element.fireEvent(event.eventType,event);}
return event;}};})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize()});(function(){var timer,fired=false;function fireContentLoadedEvent(){if(fired)return;if(timer)window.clearInterval(timer);document.fire("dom:loaded");fired=true;}
if(document.addEventListener){if(Prototype.Browser.WebKit){timer=window.setInterval(function(){if(/loaded|complete/.test(document.readyState))
fireContentLoadedEvent();},0);Event.observe(window,"load",fireContentLoadedEvent);}else{document.addEventListener("DOMContentLoaded",fireContentLoadedEvent,false);}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;fireContentLoadedEvent();}};}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(element,content){return Element.insert(element,{before:content});},Top:function(element,content){return Element.insert(element,{top:content});},Bottom:function(element,content){return Element.insert(element,{bottom:content});},After:function(element,content){return Element.insert(element,{after:content});}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},within:function(element,x,y){if(this.includeScrollOffsets)
return this.withinIncludingScrolloffsets(element,x,y);this.xcomp=x;this.ycomp=y;this.offset=Element.cumulativeOffset(element);return(y>=this.offset[1]&&y<this.offset[1]+element.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+element.offsetWidth);},withinIncludingScrolloffsets:function(element,x,y){var offsetcache=Element.cumulativeScrollOffset(element);this.xcomp=x+offsetcache[0]-this.deltaX;this.ycomp=y+offsetcache[1]-this.deltaY;this.offset=Element.cumulativeOffset(element);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+element.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+element.offsetWidth);},overlap:function(mode,element){if(!mode)return 0;if(mode=='vertical')
return((this.offset[1]+element.offsetHeight)-this.ycomp)/element.offsetHeight;if(mode=='horizontal')
return((this.offset[0]+element.offsetWidth)-this.xcomp)/element.offsetWidth;},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(element){Position.prepare();return Element.absolutize(element);},relativize:function(element){Position.prepare();return Element.relativize(element);},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(source,target,options){options=options||{};return Element.clonePosition(target,source,options);}};if(!document.getElementsByClassName)document.getElementsByClassName=function(instanceMethods){function iter(name){return name.blank()?null:"[contains(concat(' ', @class, ' '), ' "+name+" ')]";}
instanceMethods.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(element,className){className=className.toString().strip();var cond=/\s/.test(className)?$w(className).map(iter).join(''):iter(className);return cond?document._getElementsByXPath('.//*'+cond,element):[];}:function(element,className){className=className.toString().strip();var elements=[],classNames=(/\s/.test(className)?$w(className):null);if(!classNames&&!className)return elements;var nodes=$(element).getElementsByTagName('*');className=' '+className+' ';for(var i=0,child,cn;child=nodes[i];i++){if(child.className&&(cn=' '+child.className+' ')&&(cn.include(className)||(classNames&&classNames.all(function(name){return!name.toString().blank()&&cn.include(' '+name+' ');}))))
elements.push(Element.extend(child));}
return elements;};return function(className,parentElement){return $(parentElement||document.body).getElementsByClassName(className);};}(Element.Methods);Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(element){this.element=$(element);},_each:function(iterator){this.element.className.split(/\s+/).select(function(name){return name.length>0;})._each(iterator);},set:function(className){this.element.className=className;},add:function(classNameToAdd){if(this.include(classNameToAdd))return;this.set($A(this).concat(classNameToAdd).join(' '));},remove:function(classNameToRemove){if(!this.include(classNameToRemove))return;this.set($A(this).without(classNameToRemove).join(' '));},toString:function(){return $A(this).join(' ');}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();
_VERegisterNamespaces("MapControl");MapControl.Features={PlatformName:L_MapControlPlatformName_Text,Copyright:{Navteq:L_MapControlNavteq_Text,ImageCourtesyOfNASA:L_MapControlImageCourtesyOfNASA_Text,HarrisCorp:L_MapControlHarrisCorp_Text,ImageCourtesyOfUSGS:L_MapControlImageCourtesyOfUSGS_Text,ImageCourtesyOfPictometry:L_MapControlImageCourtesyOfPictometry_Text,MapLink:L_MapControlMapLink_Text},Image:{PoweredLogo:"logo_powered_by.png"},MapStyle:{Road:true,Shaded:true,Aerial:true,Hybrid:true,BirdsEye:true,View3D:true},BirdsEyeAtZoomLevel:10,ScaleBarKilometers:false,Traffic:{Flow:{Slow:"0-25 mph",Moderate:"25-45 mph",Fast:"45+ mph"}},Minimap:{ShowByDefault:false}};function _VERegisterNamespaces(){for(var d=0;d<arguments.length;d++){var b=arguments[d].split("."),c=window;for(var a=0;a<b.length;a++){if(!c[b[a]])c[b[a]]={};c=c[b[a]]}}}_VERegisterNamespaces("Msn.MVC");Msn.MVC.AbstractView=function(){this._contextPin=null};Msn.MVC.AbstractView.prototype.OnBeforeSwitchAway=function(){};Msn.MVC.AbstractView.prototype.ShowShimIfSupported=function(){};Msn.MVC.AbstractView.prototype.UpdateShimIfSupported=function(){};_VERegisterNamespaces("Msn.MVC");Msn.MVC.FlatlandView=function(){this._superObj=Msn.MVC.FlatlandView.prototype;this._mapDrawingView=null};Msn.MVC.FlatlandView.prototype=new Msn.MVC.AbstractView;Msn.MVC.FlatlandView.prototype.OnBeforeSwitchAway=function(){if(window.__drawingLoaded){this._ClearAllCollectionLayers();VE_MapDispatch.Clear()}};_VERegisterNamespaces("Msn.MVC");Msn.MVC.View3D=function(){this._superObj=Msn.MVC.View3D.prototype;this._hackUniqueLayerId="UniqueLayer_Hack";this._entityIdShapePostfix="_Shape";this._spacecontrol=null};Msn.MVC.View3D.prototype=new Msn.MVC.AbstractView;Msn.MVC.View3D.prototype.OnBeforeSwitchAway=function(){this._SetView3DControl(null)};Msn.MVC.View3D.prototype._SetView3DControl=function(a){this._spacecontrol=a};Msn.MVC.View3D.prototype.ShowShimIfSupported=function(b,a){ShowShim(b,a)};Msn.MVC.View3D.prototype.UpdateShimIfSupported=function(b,a){UpdateIFrameShim(b,a)};_VERegisterNamespaces("Msn.MVC");Msn.MVC.ViewFacade=function(){this._mvcFlatlandView=null;this._mvcView3D=null;this._curMvcView=null};Msn.MVC.ViewFacade.prototype.OnSwitchToFlatlandView=function(){if(this._mvcFlatlandView==null)this._mvcFlatlandView=new Msn.MVC.FlatlandView;if(this._curMvcView==this._mvcFlatlandView)return;if(this._curMvcView!=null)this._curMvcView.OnBeforeSwitchAway();this._curMvcView=this._mvcFlatlandView;if(window.__drawingLoaded)this._curMvcView.OnAllCollectionLayersRepaint()};Msn.MVC.ViewFacade.prototype.OnSwitchToView3D=function(a){if(this._mvcView3D==null)this._mvcView3D=new Msn.MVC.View3D;this._mvcView3D._SetView3DControl(a);if(this._curMvcView==this._mvcView3D)return;if(this._curMvcView!=null)this._curMvcView.OnBeforeSwitchAway();this._curMvcView=this._mvcView3D;if(window.__drawingLoaded)this._curMvcView.OnAllCollectionLayersRepaint()};Msn.MVC.ViewFacade.prototype.ShowShimIfSupported=function(b,a){if(this._curMvcView==null)return;return this._curMvcView.ShowShimIfSupported(b,a)};Msn.MVC.ViewFacade.prototype.UpdateShimIfSupported=function(b,a){if(this._curMvcView==null)return;return this._curMvcView.UpdateShimIfSupported(b,a)};var mvcViewFacade=new Msn.MVC.ViewFacade,windowWidth=0,windowHeight=0,scrollbarWidth=null;function $ID(a){var b=document;return b.getElementById(a)}function $CE(a){var b=document;return b.createElement(a)}function $CENS(a){var b=document;return b.createElementNS(a)}function GetWindowWidth(){var a=0;if(typeof window.innerWidth=="number")a=window.innerWidth;else if(document.documentElement&&document.documentElement.clientWidth)a=document.documentElement.clientWidth;else if(document.body&&document.body.clientWidth)a=document.body.clientWidth;if(!a||a<100)a=100;return a}function GetWindowHeight(){var a=0;if(typeof window.innerHeight=="number")a=window.innerHeight;else if(document.documentElement&&document.documentElement.clientHeight)a=document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)a=document.body.clientHeight;if(!a||a<100)a=100;return a}function GetScrollbarWidth(){if(scrollbarWidth)return scrollbarWidth;if(navigator.userAgent.indexOf("IE")>=0){var a=document.createElement("div"),b=null;a.style.visible="hidden";a.style.overflowY="scroll";a.style.position="absolute";a.style.width=0;document.body.insertAdjacentElement("afterBegin",a);b=a.offsetWidth;a.parentNode.removeChild(a);if(!b)b=16;scrollbarWidth=b;return b}else return 0}function GetUrlPrefix(){var a=window.location.pathname.lastIndexOf("/"),b=window.location.protocol+"//"+window.location.hostname+window.location.pathname.substring(0,a+1);return b}function GetUrlParameterString(){var a=window.location.search;if(a.length==0||a.indexOf("?")==-1)return"";return a.substr(a.indexOf("?")+1)}function CheckWipExistence(){var a=GetUrlParameterString();if(a!=""&&a.indexOf("wip=")>-1)return true;return false}function GetUrlParameters(){var b=[],d=GetUrlParameterString();if(!d)return b;var e=d.split("&");for(var c=0;c<e.length;c++){var a=e[c].split("=");if(a.length==2&&a[0]&&a[1]){b.push(unescape(a[0]));b.push(unescape(a[1]))}}return b}function ParseShiftKeyForLinks(a){if(a.shiftKey)return false;return true}function GetEvent(a){return a?a:window.event}function CancelEvent(a){a.cancelBubble=true;a.returnValue=false}function IgnoreEvent(a){a=GetEvent(a);CancelEvent(a);return false}function GetMouseScrollDelta(a){if(a.wheelDelta)return a.wheelDelta;else if(a.detail)return-a.detail;return 0}function IsLeftMouseButton(a){var b=Msn.VE.Environment.BrowserInfo;if(b.Type==Msn.VE.BrowserType.MSIE)return a.button==1||a.button==3||a.type=="click";else if(b.Type==Msn.VE.BrowserType.Firefox)return a.which==1;else return false}function IsRightMouseButton(a){var b=Msn.VE.Environment.BrowserInfo;if(b.Type==Msn.VE.BrowserType.MSIE)return a.button==2||a.button==3||a.type=="contextmenu";else if(b.Type==Msn.VE.BrowserType.Firefox)return a.which==3;else return false}function IsMiddleMouseButton(b){var a=Msn.VE.Environment.BrowserInfo;if(a.Type==Msn.VE.BrowserType.MSIE)return b.button==4;else if(a.Type==Msn.VE.BrowserType.Firefox)return b.which==2;else return false}_VERegisterNamespaces("Msn.VE");Msn.VE.DistanceUnit={Kilometers:"km",Miles:"mi"};Msn.VE.DistanceUnit.IsValidType=function(a){if(typeof a=="string")if(a==Msn.VE.DistanceUnit.Miles||a==Msn.VE.DistanceUnit.Kilometers)return true;return false};function VEException(b,c,a){this.source=b;this.name=c;this.message=a}VEException.prototype.Name=this.name;VEException.prototype.Source=this.source;VEException.prototype.Message=this.message;function MathFloor(a){return Math.floor(a)}function MathCeil(a){return Math.ceil(a)}function MathMax(a,b){return Math.max(a,b)}function MathMin(a,b){return Math.min(a,b)}function MathAbs(a){return Math.abs(a)}function MathRound(a){return Math.round(a)}function DegToRad(a){return a*Math.PI/180}function RadToDeg(a){return a*180/Math.PI}function MatrixMultiply(e,b){if(!e||!b||e[0].length!=b.length)return;var g=e.length,h=b[0].length,d=new Array(g),i=b.length;for(var a=0;a<g;a++){d[a]=new Array(h);for(var c=0;c<h;c++){d[a][c]=0;for(var f=0;f<i;f++)d[a][c]+=e[a][f]*b[f][c]}}return d}function VEParameter(b,a){this.Name=b;this.Value=a}VEParameter.prototype.Name=this.name;VEParameter.prototype.Value=this.value;function VENetwork(c,a,b){if(c!=null&&c!="undefined")this.ServiceUrl=c;this.UseCloseDep=false;if(a!=null&&a!="undefined")Msn.VE.API.Globals.veonbegininvokeevent=a;if(b!=null&&b!="undefined")Msn.VE.API.Globals.veonendinvokeevent=b}function BeginInvoke(f,d,h,g,j){if(this.ServiceUrl==null||this.ServiceUrl=="undefined"||this.ServiceUrl.length==0)throw new VEException("VENetwork:BeginInvoke","err_noserviceurl",L_noserviceurl_text);if(Msn.VE.API&&Msn.VE.API.Globals.veonbegininvokeevent)Msn.VE.API.Globals.veonbegininvokeevent();var c=j;if(!c)c=VENetwork.GetExecutionID();if(d){var b=this.ServiceUrl+"?";for(var e=0;e<d.length;e++){b=b+d[e].Name;b=b+"=";b=b+d[e].Value;b=b+"&"}}else var b=this.ServiceUrl;var a=document.createElement("script");a.type="text/javascript";a.language="javascript";a.id=c;a.src=b;if(this.UseCloseDep==true){var i=openDependency("BEGIN_INVOKE::"+c,function(){EndInvoke(g,h,f,a,c)},c);if(i)VENetwork.GetAttachTarget().appendChild(a)}else{if(navigator.userAgent.indexOf("IE")>=0)a.onreadystatechange=function(){if(a&&("loaded"==a.readyState||"complete"==a.readyState)){a.onreadystatechange=null;EndInvoke(g,h,f,a,c)}};else a.onload=function(){a.onload=null;EndInvoke(g,h,f,a,c)};VENetwork.GetAttachTarget().appendChild(a)}}function EndInvoke(endInvokeTarget,fnCallback,endInvokeMethod,elScript,executionId){var objects=null;if(endInvokeMethod)eval("if(typeof "+endInvokeMethod+" == 'function') {objects = "+endInvokeMethod+"();}");setTimeout(function(){if(elScript.parentNode)elScript.parentNode.removeChild(elScript);elScript=null},100);if(fnCallback!=null&&fnCallback!="undefined")fnCallback(objects,endInvokeTarget);if(Msn.VE.API&&Msn.VE.API.Globals.veonendinvokeevent)Msn.VE.API.Globals.veonendinvokeevent()}VENetwork.GetExecutionID=function(){var a=new Date,b=Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds());b+=Math.round(Math.random()*1000000);return b};function GetXmlHttp(){var a=null;if(window.XMLHttpRequest)a=new XMLHttpRequest;else if(window.ActiveXObject)try{a=new ActiveXObject("Msxml2.XmlHttp.6.0")}catch(b){try{a=new ActiveXObject("Msxml2.XmlHttp.3.0")}catch(c){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}}}else throw"XMLHTTP Required: Browser not supported";return a}VENetwork.AttachStyleSheetCallback=function(a){if(a)a()};VENetwork.AttachStyleSheet=function(a,b,d,c){if(a==null||a=="undefined"||a.length==0)throw new VEException("VENetwork:AttachStylesheet","err_nostylesurl","");elStyle=document.createElement("link");if(d==true)elStyle.rel="alternate stylesheet";else elStyle.rel="stylesheet";if(c)elStyle.media=c;elStyle.type="text/css";elStyle.rev="stylesheet";elStyle.id=VENetwork.GetExecutionID();elStyle.href=a;VENetwork.GetAttachTarget().appendChild(elStyle);if(navigator.userAgent.indexOf("IE")>=0)elStyle.onreadystatechange=function(){if(elStyle&&("loaded"==elStyle.readyState||"complete"==elStyle.readyState)){elStyle.onreadystatechange=null;VENetwork.AttachStyleSheetCallback(b)}};else VENetwork.AttachStyleSheetCallback(b);return};VENetwork.DownloadScriptCallback=function(a,b){if(a)a(b)};VENetwork.DownloadScript=function(b,c,d){if(b==null||b=="undefined"||b.length==0)throw new VEException("VENetwork:DownloadScript","err_noscripturl",L_noscripturl_text);var a=document.createElement("script");a.type="text/javascript";a.language="javascript";a.id=VENetwork.GetExecutionID();a.src=b;if(navigator.userAgent.indexOf("IE")>=0)a.onreadystatechange=function(){if(a&&("loaded"==a.readyState||"complete"==a.readyState)){a.onreadystatechange=null;VENetwork.DownloadScriptCallback(c,d)}};else a.onload=function(){a.onload=null;VENetwork.DownloadScriptCallback(c,d)};VENetwork.GetAttachTarget().appendChild(a);return a.id};VENetwork.DownloadXml=function(e,c,b,d){var a=GetXmlHttp();a.open(c,e,true);a.onreadystatechange=function(){if(a.readyState==4){if(b)b(a.responseXML,d);a=null}};a.send(null)};VENetwork.GetAttachTarget=function(){if(document.getElementsByTagName("head")[0]!=null)return document.getElementsByTagName("head")[0];else throw new VEException("VENetwork:cstr","err_noheadelement",L_noheadelement_text)};VENetwork.prototype.BeginInvoke=BeginInvoke;VENetwork.prototype.EndInvoke=EndInvoke;function JSONConstant(){}JSONConstant.culture="culture";JSONConstant.format="format";JSONConstant.json="json";JSONConstant.requestid="rid";function JSONRequestInvoke(f,a,e){var c=new VENetwork,b=VENetwork.GetExecutionID();c.UseCloseDep=true;c.ServiceUrl=f;if(!a)a=[];var d=Msn.VE.API?Msn.VE.API.Globals.locale:window.serviceLocale;a.push(new VEParameter(JSONConstant.culture,'"'+d+'"'));a.push(new VEParameter(JSONConstant.format,JSONConstant.json));a.push(new VEParameter(JSONConstant.requestid,b));c.BeginInvoke("_f"+b,a,e,null,b)}_VERegisterNamespaces("Msn.Drawing");var MC_PointID=10000,MC_PolylineID=30000,MC_PolygonID=50000,MC_SYMBOL_IID=70000,MC_TEXT_IID=90000,MC_ENTITY_IID=200000,MC_COL_IID=1000,MC_GEO_TYPE_SYMBOL="Symbol",MC_GEO_TYPE_POINT="Point",MC_GEO_TYPE_POLYLINE="Polyline",MC_GEO_TYPE_POLYGON="Polygon",MC_GEO_TYPE_TEXT="Text",MC_GEO_TYPE_COL="Collection",MC_GEO_TYPE_ENTITY="Entity",VEShapeType={Pushpin:"Point",Polyline:"Polyline",Polygon:"Polygon"},VEMapserviceType={None:"None",MapCruncher:"MapCruncher",KML:"KML",WMS:"WMS"},VEMapserviceTypeList=[VEMapserviceType.None,VEMapserviceType.MapCruncher,VEMapserviceType.KML,VEMapserviceType.WMS];VEMapserviceTypeIndex=function(c){var b=-1;if(VEMapserviceTypeList!=null)for(var a=0;a<VEMapserviceTypeList.length;a++)if(c==VEMapserviceTypeList[a]){b=a;break}return b};IsValidMapserviceType=function(a){return a!=null&&typeof a!="undefined"&&a!=""&&VEMapserviceTypeIndex(a)!=-1};IsValidMapserviceSource=function(a){return a!=null&&typeof a!="undefined"&&a!=""};IsValidMapserviceMetadata=function(a){return a!=null&&typeof a!="undefined"&&a!=""};IsValidMapserviceOpacity=function(a){return a!=null&&typeof a!="undefined"&&a>=0&&a<=1};Msn.Drawing.GetGeoUID=function(b){var a="";switch(b){case VEShapeType.Polygon:a=MC_PolygonID++;break;case VEShapeType.Pushpin:a=MC_PointID++;break;case VEShapeType.Polyline:a=MC_PolylineID++;break;case MC_GEO_TYPE_SYMBOL:a=MC_SYMBOL_IID++;break;case MC_GEO_TYPE_TEXT:a=MC_TEXT_IID++;break;case MC_GEO_TYPE_COL:a=MC_COL_IID++;break;case MC_GEO_TYPE_ENTITY:a=MC_ENTITY_IID++}return a.toString()};Msn.Drawing.Exception=function(a){this.message=a;this.name="Msn.Drawing.Exception"};Msn.Drawing.Exception.prototype.toString=function(){return this.name+": "+this.message};Msn.Drawing.Point=function(a,b){this.id=0;this.points=[];this.points.push(a);this.points.push(b);this.iid=Msn.Drawing.GetGeoUID(VEShapeType.Pushpin)};Msn.Drawing.Point.prototype.altitudes=null;Msn.Drawing.Point.prototype.altitudeMode="Ground";Msn.Drawing.Point.prototype.type=VEShapeType.Pushpin;Msn.Drawing.Point.prototype.name=null;Msn.Drawing.Point.prototype.symbol=null;Msn.Drawing.Point.prototype.isLabel=true;Msn.Drawing.Point.prototype.isOnLegend=false;Msn.Drawing.Point.prototype.Destroy=function(){this.symbol=null;this.points=null;this.altitudes=null;this.altitudeMode=null};Msn.Drawing.Point.prototype.toString=function(){return this.points[0]+","+this.points[1]};Msn.Drawing.PolyLine=function(a){this.id=0;this.iid=Msn.Drawing.GetGeoUID(VEShapeType.Polyline);this.points=a?a:[];this.minX=null;this.minY=null;this.maxX=null;this.maxY=null;this.length=-1};Msn.Drawing.PolyLine.prototype.toString=function(){if(this.points!=null)return this.points.join(" ");else return""};Msn.Drawing.PolyLine.prototype.altitudes=null;Msn.Drawing.PolyLine.prototype.altitudeMode="Ground";Msn.Drawing.PolyLine.prototype.extruded=false;Msn.Drawing.PolyLine.prototype.minZ=null;Msn.Drawing.PolyLine.prototype.maxZ=null;Msn.Drawing.PolyLine.prototype.minX=null;Msn.Drawing.PolyLine.prototype.minY=null;Msn.Drawing.PolyLine.prototype.maxX=null;Msn.Drawing.PolyLine.prototype.maxY=null;Msn.Drawing.PolyLine.prototype.iid=Msn.Drawing.GetGeoUID(VEShapeType.Polyline);Msn.Drawing.PolyLine.prototype.labelPosX=null;Msn.Drawing.PolyLine.prototype.labelPosY=null;Msn.Drawing.PolyLine.prototype.labelPosZ=null;Msn.Drawing.PolyLine.prototype.name=null;Msn.Drawing.PolyLine.prototype.type=VEShapeType.Polyline;Msn.Drawing.PolyLine.prototype.symbol=null;Msn.Drawing.PolyLine.prototype.isLabel=true;Msn.Drawing.PolyLine.prototype.isOnLegend=false;Msn.Drawing.PolyLine.prototype.Destroy=function(){this.symbol=null;this.points=null;this.altitudes=null;this.altitudeMode=null;this.extruded=null;this.minX=null;this.minY=null;this.maxX=null;this.maxY=null;this.minZ=null;this.maxZ=null};Msn.Drawing.PolyLine.prototype.GetLength=function(){if(this.length<0)this.length=CalculateShapeLengthP(this.points);return this.length};Msn.Drawing.PolyLine.prototype.SetLength=function(a){this.length=a};Msn.Drawing.Polygon=function(a){this.id=0;this.iid=Msn.Drawing.GetGeoUID(VEShapeType.Polygon);this.points=a;this.length=-1;this.area=-1;this.minX=null;this.minY=null;this.maxX=null;this.maxY=null};Msn.Drawing.Polygon.prototype.altitudes=null;Msn.Drawing.Polygon.prototype.altitudeMode="Ground";Msn.Drawing.Polygon.prototype.extruded=false;Msn.Drawing.Polygon.prototype.minZ=null;Msn.Drawing.Polygon.prototype.maxZ=null;Msn.Drawing.Polygon.prototype.labelPosX=null;Msn.Drawing.Polygon.prototype.labelPosY=null;Msn.Drawing.Polygon.prototype.labelPosZ=null;Msn.Drawing.Polygon.prototype.symbol=null;Msn.Drawing.Polygon.prototype.isLabel=true;Msn.Drawing.Polygon.prototype.isOnLegend=false;Msn.Drawing.Polygon.prototype.type=VEShapeType.Polygon;Msn.Drawing.Polygon.prototype.name=null;Msn.Drawing.Polygon.prototype.Destroy=function(){this.symbol=null;this.points=null;this.altitudes=null;this.altitudeMode=null;this.extruded=null;this.minX=null;this.minY=null;this.maxX=null;this.maxY=null;this.minZ=null;this.maxZ=null};Msn.Drawing.Polygon.prototype.GetLength=function(){if(this.length<0)this.length=CalculateShapeLength(this);return this.length};Msn.Drawing.Polygon.prototype.SetLength=function(a){this.length=a};Msn.Drawing.Polygon.prototype.GetArea=function(){if(this.area<0)this.area=CalculateAreaP(this.points);if(this.area<0)this.area=CalculateAreaP(this.points,false);return this.area};Msn.Drawing.Polygon.prototype.SetArea=function(a){this.area=a};Msn.Drawing.Stroke=function(){this.width=1;this.linecap="round";this.opacity=1;this.linejoin="miter";this.color=new Msn.Drawing.Color(255,255,255,1);this.fillcolor=new Msn.Drawing.Color(0,255,0,1)};Msn.Drawing.Color=function(d,c,b,a){this.R=d?d:0;this.G=c?c:0;this.B=b?b:0;this.A=a?a:0;this.ToHexString=function(){return"#"+Number(this.R).toString(16)+(this.R<16?"0":"")+Number(this.G).toString(16)+(this.G<16?"0":"")+Number(this.B).toString(16)+(this.B<16?"0":"")}};VEShapeStyle=function(){this.iid=Msn.Drawing.GetGeoUID(MC_GEO_TYPE_SYMBOL);this.id=this.iid};VEShapeStyle.prototype.point_type="v:rect";VEShapeStyle.prototype.name="symbol";VEShapeStyle.prototype.highlight_stroke_color="#336666";VEShapeStyle.prototype.highlight_fill_color="#FFCC33";VEShapeStyle.prototype.shape_drawtype="v:shape";VEShapeStyle.prototype.shape_fill="false";VEShapeStyle.prototype.shape_filled="false";VEShapeStyle.prototype.shape_unselectable="off";VEShapeStyle.prototype.style_zIndex=60;VEShapeStyle.prototype.style_zIndex_polyshape=50;VEShapeStyle.prototype.style_position="absolute";VEShapeStyle.prototype.style_filter="alpha(opacity=30)";VEShapeStyle.prototype.style_width="10";VEShapeStyle.prototype.style_height="10";VEShapeStyle.prototype.style_visibility="visible";VEShapeStyle.prototype.style_display="block";VEShapeStyle.prototype.stroke_drawtype="v:stroke";VEShapeStyle.prototype.stroke_on="true";VEShapeStyle.prototype.stroke_joinstyle="miter";VEShapeStyle.prototype.stroke_endcap="round";VEShapeStyle.prototype.stroke_opacity="1";VEShapeStyle.prototype.stroke_color="#0000FF";VEShapeStyle.prototype.stroke_weight="2pt";VEShapeStyle.prototype.stroke_style="Single";VEShapeStyle.prototype.stroke_filltype="solid";VEShapeStyle.prototype.stroke_color2="#FF0000";VEShapeStyle.prototype.stroke_dashstyle="Solid";VEShapeStyle.prototype.stroke_startarrow="none";VEShapeStyle.prototype.stroke_startarrowwidth="medium";VEShapeStyle.prototype.stroke_startarrowlength="medium";VEShapeStyle.prototype.stroke_endarrow="none";VEShapeStyle.prototype.stroke_endarrowwidth="medium";VEShapeStyle.prototype.stroke_endarrowlength="medium";VEShapeStyle.prototype.fill_drawtype="v:fill";VEShapeStyle.prototype.fill_color="#008000";VEShapeStyle.prototype.fill_colors="30% yellow";VEShapeStyle.prototype.fill_color2="#0000FF";VEShapeStyle.prototype.fill_type="solid";VEShapeStyle.prototype.fill_opacity="0.3";VEShapeStyle.prototype.fill_on="false";VEShapeStyle.prototype.textbox_drawtype="v:textbox";VEShapeStyle.prototype.textbox_text="name";VEShapeStyle.prototype.textbox_color="#FFFFFF";VEShapeStyle.prototype.textbox_bold=false;VEShapeStyle.prototype.textbox_italic=false;VEShapeStyle.prototype.textbox_underscore=false;VEShapeStyle.prototype.textbox_font="Arial";VEShapeStyle.prototype.textbox_size=7;VEShapeStyle.prototype.imagedata_on=false;VEShapeStyle.prototype.imagedata_src=null;VEShapeStyle.prototype.isOn=false;VEShapeStyle.prototype.textbox_OffsetX=0;VEShapeStyle.prototype.textbox_OffsetY=0;VEShapeStyle.prototype.textbox_backcolor="#0000FF";VEShapeStyle.textbox_color_opacity="1";VEShapeStyle.textbox_backcolor_opacity="1";VEShapeStyle.prototype.img_offsetX=0;VEShapeStyle.prototype.img_offsetY=0;VEShapeStyle.prototype.img_width=22;VEShapeStyle.prototype.img_height=22;VEShapeStyle.prototype.Clone=function(){var a=new VEShapeStyle;a.point_type=this.point_type;a.name=this.name;a.line_color=this.line_color;a.line_width=this.line_width;a.line_dasharray=this.line_dasharray;a.highlight_stroke_color=this.highlight_stroke_color;a.highlight_fill_color=this.highlight_fill_color;a.shape_drawtype=this.shape_drawtype;a.shape_fill=this.shape_fill;a.shape_filled=this.shape_filled;a.shape_unselectable=this.shape_unselectable;a.style_zIndex=this.style_zIndex;a.style_zIndex_polyshape=this.style_zIndex_polyshape;a.style_position=this.style_position;a.style_filter=this.style_filter;a.style_width=this.style_width;a.style_height=this.style_height;a.style_visibility=this.style_visibility;a.style_display=this.style_display;a.stroke_drawtype=this.stroke_drawtype;a.stroke_on=this.stroke_on;a.stroke_joinstyle=this.stroke_joinstyle;a.stroke_endcap=this.stroke_endcap;a.stroke_opacity=this.stroke_opacity;a.stroke_color=this.stroke_color;a.stroke_weight=this.stroke_weight;a.stroke_style=this.stroke_style;a.stroke_filltype=this.stroke_filltype;a.stroke_color2=this.stroke_color2;a.stroke_dashstyle=this.stroke_dashstyle;a.stroke_startarrow=this.stroke_startarrow;a.stroke_startarrowwidth=this.stroke_startarrowwidth;a.stroke_startarrowlength=this.stroke_startarrowlength;a.stroke_endarrow=this.stroke_endarrow;a.stroke_endarrowwidth=this.stroke_endarrowwidth;a.stroke_endarrowlength=this.stroke_endarrowlength;a.fill_drawtype=this.fill_drawtype;a.fill_color=this.fill_color;a.fill_colors=this.fill_colors;a.fill_color2=this.fill_color2;a.fill_type=this.fill_type;a.fill_opacity=this.fill_opacity;a.fill_on=this.fill_on;a.textbox_drawtype=this.textbox_drawtype;a.textbox_text=this.textbox_text;a.textbox_color=this.textbox_color;a.textbox_bold=this.textbox_bold;a.textbox_italic=this.textbox_italic;a.textbox_underscore=this.textbox_underscore;a.textbox_backcolor=this.textbox_backcolor;a.imagedata_on=this.imagedata_on;a.imagedata_src=this.imagedata_src;a.isOn=this.isOn;a.textbox_OffsetX=this.textbox_OffsetX;a.textbox_OffsetY=this.textbox_OffsetY;a.img_offsetX=this.img_offsetX;a.img_offsetY=this.img_offsetY;a.img_width=this.img_width;a.img_height=this.img_height;return a};function VE_MapLineClip(){var b=-360,c=360,d=-180,e=180,a={LEFT:1,RIGHT:2,BOTTOM:4,TOP:8};function h(i,s,u,t,v){b=s;c=t;d=u;e=v;if(typeof i=="undefined"||i==null||i.length<4)return null;var m=false,o=i.length;if(i[o-2]==i[0]&&i[o-1]==i[1])m=true;var f=[];for(var l=0;l<i.length;l++)f.push(i[l]);var k=a.LEFT;while(k<=8){var q=f[f.length-2],r=f[f.length-1];f.push(q);f.push(r);var h=[],p=f.length;for(var j=0;j<p-2;j=j+2)g(h,k,f[j],f[j+1],f[j+2],f[j+3]);if(m){var n=h.length;if(h[n-2]!=h[0]||h[n-1]!=h[1]){h.push(h[0]);h.push(h[1])}}f=null;k=k*2;f=h}return f}function g(g,j,h,i,k,l){var n=f(h,i),o=f(k,l);if((j&n)==0&&(j&o)==0){g.push(h);g.push(i)}else if((j&n)==0||(j&o)==0){var m=(j&n)==0?true:false;if(j==a.LEFT){var q=i+(l-i)*(b-h)/(k-h);if(m){g.push(h);g.push(i)}g.push(b);g.push(q)}else if(j==a.RIGHT){var q=i+(l-i)*(c-h)/(k-h);if(m){g.push(h);g.push(i)}g.push(c);g.push(q)}else if(j==a.TOP){var p=h+(k-h)*(e-i)/(l-i);if(m){g.push(h);g.push(i)}g.push(p);g.push(e)}else if(j==a.BOTTOM){var p=h+(k-h)*(d-i)/(l-i);if(m){g.push(h);g.push(i)}g.push(p);g.push(d)}};}function f(g,h){var f=0;if(g<b)f=f|a.LEFT;else if(g>c)f=f|a.RIGHT;if(h<d)f=f|a.BOTTOM;else if(h>e)f=f|a.TOP;return f}this.Clip=h}VE_LineClip=new VE_MapLineClip;var L_GraphicsInitError_Text="Your Web browser does not support SVG or VML. Some graphics features may not function properly.";_VERegisterNamespaces("Msn.Drawing");Msn.Drawing.Graphic=function(){};Msn.Drawing.Graphic.CreateGraphic=function(e,b){if(document.all)return new Msn.Drawing.VMLGraphic(e,b);else{if(navigator.userAgent.indexOf("KHTML")!==-1)return new Msn.Drawing.SVGGraphic(e,b);var c=0,f=0,g=new RegExp("Firefox/(.*)"),d=g.exec(navigator.userAgent);if(d&&d.length>=2){var a=d[1].split(".");if(a){c=a[0];f=a[1];if(parseInt(c)>0&&parseInt(f)>=5||parseInt(c)>=2)return new Msn.Drawing.SVGGraphic(e,b)}}throw new Msn.Drawing.Exception(L_GraphicsInitError_Text)}};Msn.Drawing.BaseGraphic=function(){this._stroke=new Msn.Drawing.Stroke};Msn.Drawing.BaseGraphic.prototype.CreatePrimitive=function(){};Msn.Drawing.BaseGraphic.prototype.DrawPrimitive=function(d,c,a){var b=new VEShapeStyle;if(a._stroke){b.stroke_weight=a._stroke.width;b.stroke_joinstyle=a._stroke.linejoin;b.stroke_color=a._stroke.color.ToHexString();b.stroke_dashstyle=a._stroke.linecap;b.stroke_opacity=a._stroke.color.A.toString();b.fill_color=a._stroke.fillcolor.ToHexString();b.fill_opacity=a._stroke.fillcolor.A.toString()}c.symbol=b;var e=a.CreatePrimitive(d,c,"");return e};Msn.Drawing.BaseGraphic.prototype.SetStroke=function(a){this._stroke=a};Msn.Drawing.VMLGraphic=function(c,d){Msn.Drawing.BaseGraphic.call();var g=new Msn.Drawing.Color(255,0,0,1),f=new Msn.Drawing.Color(255,0,0,1),e=1,a=c;c.unselectable="on";var b=[];this.DrawPrimitive=function(f,e){var c=Msn.Drawing.VMLGraphic.prototype.DrawPrimitive(d,f,this);if(a&&c){if(e)a.appendChild(wrapVmlElementInDiv(c));else a.appendChild(c);b.push(c)}};this.resetOffset=function(){};this.SetZIndex=function(a){e=a};this.Clear=function(){var a=null,c=null;while(a=b.pop()){c=a.parentElement;if(c)c.removeChild(a);a=null}};this.Destroy=function(){this.Clear();a=null}};Msn.Drawing.VMLGraphic.prototype=new Msn.Drawing.BaseGraphic;Msn.Drawing.VMLGraphic.prototype.CreatePrimitive=function(d,a){var b=null;if(a.type==VEShapeType.Pushpin){if(a.symbol.shape_drawtype=="v:oval"||a.symbol.shape_drawtype=="v:rect"||a.symbol.shape_drawtype=="v:roundrect")b=document.createElement(a.symbol.shape_drawtype);else b=document.createElement("v:roundrect");var f=LatLongtoRoundedPixel(d,a.points[1],a.points[0]);b.style.width=a.symbol.style_width;b.style.height=a.symbol.style_height;b.style.left=-5+f.x+d.GetOffsetX()+"px";b.style.top=-5+f.y+d.GetOffsetY()+"px";b.style.position=a.symbol.style_position}else{b=document.createElement("v:shape");b.className="MSVE_Shape";var g=null;g=GetVmlPath(d,a);var h=d.GetMapWidth(),i=d.GetMapHeight();b.style.top="0px";b.style.left="0px";b.style.width=h+"px";b.style.height=i+"px";b.coordsize=h+" "+i;b.style.position=a.symbol.style_position;b.path=g}b.id=a.id!=0?a.id:a.iid;b.style.zIndex=a.symbol.style_zIndex_polyshape;b.unselectable=a.symbol.shape_unselectable;var c=document.createElement("v:stroke");c.joinstyle=a.symbol.stroke_joinstyle;c.endcap=a.symbol.stroke_endcap;c.opacity=a.symbol.stroke_opacity;c.dashstyle=a.symbol.stroke_dashstyle;c.filltype=a.symbol.stroke_filltype;c.color2=a.symbol.stroke_color2;c.color=a.symbol.stroke_color;c.weight=a.symbol.stroke_weight;c.linestyle=a.symbol.stroke_style;if(a.type==VEShapeType.Polygon){var e=document.createElement("v:fill");e.color=a.symbol.fill_color;e.colors=a.symbol.fill_colors;e.color2=a.symbol.fill_color2;e.type=a.symbol.fill_type;e.opacity=a.symbol.fill_opacity;b.appendChild(e)}else if(a.type==VEShapeType.Polyline){b.fill=false;b.filled=false}else if(a.type==VEShapeType.Pushpin){b.style.filter=a.symbol.style_filter;b.style.zIndex=a.symbol.style_zIndex;b.style.display=a.symbol.style_display;b.unselectable=a.symbol.shape_unselectable;b.fill=true;b.filled=true;b.fillcolor=a.symbol.fill_color}b.appendChild(c);return b};Msn.Drawing.VMLGraphic.prototype.UpdatePoints=function(d,a,b,c){if(c&&(a.type==VEShapeType.Polyline||a.type==VEShapeType.Polygon)){var e=GetVmlPath(d,a);b.path=e}return b};Msn.Drawing.VMLGraphic.prototype.UpdateStyle=function(f,a,e){e.style.zIndex=a.symbol.style_zIndex_polyshape;e.unselectable=a.symbol.shape_unselectable;var c=e.firstChild,b=null,d=null;while(c!=null){if(c.tagName=="stroke")b=c;else if(c.tagName=="fill")d=c;c=c.nextSibling}if(b){b.joinstyle=a.symbol.stroke_joinstyle;b.endcap=a.symbol.stroke_endcap;b.opacity=a.symbol.stroke_opacity;b.dashstyle=a.symbol.stroke_dashstyle;b.filltype=a.symbol.stroke_filltype;b.color2=a.symbol.stroke_color2;b.color=a.symbol.stroke_color;b.weight=a.symbol.stroke_weight;b.linestyle=a.symbol.stroke_style}if(a.type==VEShapeType.Polygon&&d){d.color=a.symbol.fill_color;d.color2=a.symbol.fill_color2;d.type=a.symbol.fill_type;d.opacity=a.symbol.fill_opacity}return e};Msn.Drawing.VMLGraphic.prototype._printable=false;Msn.Drawing.VMLGraphic.prototype._printTilesLayer=null;Msn.Drawing.VMLGraphic.prototype._printTopLayer=null;Msn.Drawing.VMLGraphic.prototype.CreatePrintLayer=function(a,d,c,b){if(!this._printable){this._printTilesLayer=document.createElement("div");this._printTilesLayer.className="MSVE_Print_TileLayer";this._printTilesLayer.innerHTML="<xml:namespace ns='urn:schemas-microsoft-com:vml' prefix='v'/>";a.appendChild(this._printTilesLayer);this._printTopLayer=document.createElement("div");this._printTopLayer.className="MSVE_Print_TopLayer";this._printTopLayer.innerHTML="<xml:namespace ns='urn:schemas-microsoft-com:vml' prefix='v'/>";this._printTopLayer.style.width=c;this._printTopLayer.style.height=b;this._printTopLayer.zIndex=100;a.parentNode.appendChild(this._printTopLayer);this._printable=true}};Msn.Drawing.VMLGraphic.prototype.RemovePrintLayer=function(){if(this._printable){this._printable=false;this._printTilesLayer.parentNode.removeChild(this._printTilesLayer);this._printTopLayer.parentNode.removeChild(this._printTopLayer);this._printTilesLayer=null;this._printTopLayer=null}};Msn.Drawing.VMLGraphic.prototype.AddPrintTile=function(f,g,e,d,b,h,c){var a=null;if(this._printable){a=document.createElement("div");a.style.position="absolute";a.style.top=g;a.style.left=e;a.style.width=d+1;a.style.height=b+1;a.style.zIndex=c;a.innerHTML="<v:image src='"+f+"' style='width:100%;height:100%;left:0px;top:0px;behavior:url(#default#VML);display:inline-block;'></v:image>";this._printTilesLayer.appendChild(a)}return a};Msn.Drawing.VMLGraphic.prototype.RemovePrintTile=function(a){if(a.parentNode)a.parentNode.removeChild(a)};Msn.Drawing.VMLGraphic.prototype.AddLogo=function(b){if(this._printable){var a=document.createElement("v:image");a.src=b;a.className="MSVE_PoweredByLogo_print";this._printTopLayer.appendChild(a)}};Msn.Drawing.SVGGraphic=function(c,b){Msn.Drawing.BaseGraphic.call();var g=new Msn.Drawing.Color(255,0,0,1),f=new Msn.Drawing.Color(0,255,0,1);_curmap=b;this._svgLayer=null;var d=60,e=c,a=[];this.DrawPrimitive=function(d){var c=Msn.Drawing.SVGGraphic.prototype.DrawPrimitive(b,d,this);if(c)a.push(c)};this.resetOffset=function(){_curmap.resetSvgLayer()};this.SetZIndex=function(a){d=a;if(this._svgLayer!=null)this._svgLayer.SetZIndex(a)};this.Destroy=function(){this.Clear()};this.Clear=function(){if(this._svgLayer==null)return;var b=null,c=null;while(b=a.pop()){c=b.parentNode;if(c)c.removeChild(b);b=null}}};Msn.Drawing.SVGGraphic.prototype=new Msn.Drawing.BaseGraphic;Msn.Drawing.SVGGraphic.prototype.CreatePrimitive=function(a,b,c){this._svgLayer=a.getSvgLayer();return this._svgLayer.addShape(b,c)};Msn.Drawing.SVGGraphic.prototype.UpdatePoints=function(a,b,c){this._svgLayer=a.getSvgLayer();return this._svgLayer.UpdatePoints(b,c)};Msn.Drawing.SVGGraphic.prototype.UpdateStyle=function(a,b,c){this._svgLayer=a.getSvgLayer();return this._svgLayer.UpdateStyle(b,c)};Msn.Drawing.SVGGraphic.prototype._printable=false;Msn.Drawing.SVGGraphic.prototype._printTilesLayer=null;Msn.Drawing.SVGGraphic.prototype._printTopLayer=null;Msn.Drawing.SVGGraphic.prototype._printLogo=null;Msn.Drawing.SVGGraphic.prototype._offsetX=null;Msn.Drawing.SVGGraphic.prototype._offsetY=null;Msn.Drawing.SVGGraphic.prototype.CreatePrintLayer=function(d,a,c,b){if(!this._printable){this._svgLayer=a.getSvgLayer();this._printTopLayer=this._svgLayer.CreatePrintLayer("MSVE_Print_TopLayer");this._printTopLayer.setAttributeNS(null,"width",parseInt(c));this._printTopLayer.setAttributeNS(null,"height",parseInt(b));this._printTilesLayer=this._svgLayer.CreatePrintLayer("MSVE_Print_TileLayer");this._printable=true}};Msn.Drawing.SVGGraphic.prototype.RemovePrintLayer=function(){if(this._printable){this._printTilesLayer.parentNode.removeChild(this._printTilesLayer);this._printTopLayer.parentNode.removeChild(this._printTopLayer);this._printTilesLayer=null;this._printTopLayer=null;this._printLogo=null;this._printable=false}};Msn.Drawing.SVGGraphic.prototype.AddPrintTile=function(g,h,f,e,c,b,d){var a=null;if(this._printable){a=document.createElementNS("http://www.w3.org/2000/svg","image");a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",g);a.setAttributeNS(null,"preserveAspectRatio","none");a.setAttributeNS(null,"x",f-this._offsetX);a.setAttributeNS(null,"y",h-this._offsetY);a.setAttributeNS(null,"width",e);a.setAttributeNS(null,"height",c);a.setAttributeNS(null,"opacity",b);this.AddPrintTileToLayer(a,d)}return a};Msn.Drawing.SVGGraphic.prototype.AddPrintTileToLayer=function(d,b){var a=this._printTilesLayer.firstChild;while(a&&a.style.zIndex<b)a=a.nextSibling;if(!a||a.style.zIndex!=b){var c=document.createElementNS("http://www.w3.org/2000/svg","g");c.style.zIndex=b;this._printTilesLayer.insertBefore(c,a);a=c}a.appendChild(d)};Msn.Drawing.SVGGraphic.prototype.RemovePrintTile=function(a){if(this._printable)a.parentElement.removeChild(a)};Msn.Drawing.SVGGraphic.prototype.RePositionPrintTile=function(a,c,b){a.setAttributeNS(null,"x",b-this._offsetX);a.setAttributeNS(null,"y",c-this._offsetY)};Msn.Drawing.SVGGraphic.prototype.SetOffset=function(a,b){this._offsetX=a;this._offsetY=b};Msn.Drawing.SVGGraphic.prototype.AddLogo=function(b){if(this._printable){var a=document.createElementNS("http://www.w3.org/2000/svg","image");a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",b);a.setAttributeNS(null,"class","MSVE_PoweredByLogo_print");a.setAttributeNS(null,"x",6);a.setAttributeNS(null,"y",parseInt(this._printTopLayer.getAttribute("height"))-79);this._printLogo=a;this._printTopLayer.appendChild(a)}};Msn.Drawing.SVGGraphic.prototype.RepositionLogo=function(b,a){if(this._printable&&this._printLogo)this._printLogo.setAttributeNS(null,"y",parseInt(a)-79)};Msn.Drawing.SvgLayer=function(f,g){var c=g,b=null,e=false,h=false;if(e==false){e=true;b=document.createElementNS("http://www.w3.org/2000/svg","svg");b.setAttribute("height","100%");b.setAttribute("width","100%");f.appendChild(b);this.lineDashStyles=[];var a=this.lineDashStyles;a[0]=["Solid","none"];a[1]=["ShortDash","6,2"];a[2]=["ShortDot","2,2"];a[3]=["ShortDashDot","6,2,2,2"];a[4]=["ShortDashDotDot","6,2,2,2,2,2"];a[5]=["Dot","2,6"];a[6]=["Dash","10,6"];a[7]=["LongDash","20,6"];a[8]=["DashDot","10,6,2,6"];a[9]=["LongDashDot","20,6,2,6"];a[10]=["LongDashDotDot","20,6,2,6,2,6"]}this.addShape=function(e){if(b==null)return;var a=null;if(e.type==VEShapeType.Pushpin){a=document.createElementNS("http://www.w3.org/2000/svg","rect");var i=LatLongtoRoundedPixel(c,e.points[1],e.points[0]);a.setAttribute("x",i.x-4);a.setAttribute("y",i.y-4);a.setAttribute("width","8pt");a.setAttribute("height","8pt");a.setAttribute("stroke-width",e.symbol.stroke_weight);a.setAttribute("stroke",e.symbol.stroke_color);a.setAttribute("fill",e.symbol.fill_color);b.appendChild(a)}else if(e.type==VEShapeType.Polyline||e.type==VEShapeType.Polygon){var h=e.type==VEShapeType.Polygon?true:false;a=document.createElementNS("http://www.w3.org/2000/svg",h?"polygon":"polyline");a.setAttributeNS(null,"class","MSVE_Shape");a.setAttribute("points",GetSvgPath(c,e.points));a.setAttribute("stroke",e.symbol.stroke_color);a.setAttribute("stroke-width",e.symbol.stroke_weight);a.setAttribute("stroke-linejoin",e.symbol.stroke_joinstyle);a.setAttribute("stroke-opacity",d(e.symbol.stroke_opacity));var g=this.lineDashStyles;for(var f=0;f<g.length;f++)if(e.symbol.stroke_dashstyle==g[f][0])a.setAttribute("stroke-dasharray",g[f][1]);if(!h)a.setAttribute("fill","none");else{a.setAttribute("fill-rule","evenodd");a.setAttribute("fill",e.symbol.fill_color);a.setAttribute("fill-opacity",d(e.symbol.fill_opacity))}}if(a){a.setAttribute("id",e.id!=0?e.id:e.iid);b.appendChild(a)}return a};function d(b){var a=parseFloat(b);if(a==NaN)a=.3;else if(a>1)a/=100;else if(a<0)a=0;return a}this.SetZIndex=function(a){if(!c.bShowSVG)return;c.GetsvgDiv().style.zIndex=a};this.UpdatePoints=function(a,b){if(a.type==VEShapeType.Polyline||a.type==VEShapeType.Polygon)b.setAttribute("points",GetSvgPath(c,a.points))};this.UpdateStyle=function(a,c){if(b==null)return;if(a.type!=VEShapeType.Pushpin){c.setAttribute("stroke",a.symbol.stroke_color);c.setAttribute("stroke-width",a.symbol.stroke_weight);c.setAttribute("stroke-linejoin",a.symbol.stroke_joinstyle);c.setAttribute("stroke-opacity",d(a.symbol.stroke_opacity));var f=this.lineDashStyles;for(var e=0;e<f.length;e++)if(a.symbol.stroke_dashstyle==f[e][0])c.setAttribute("stroke-dasharray",f[e][1]);if(a.type==VEShapeType.Polyline)c.setAttribute("fill","none");else{c.setAttribute("fill",a.symbol.fill_color);c.setAttribute("fill-opacity",d(a.symbol.fill_opacity))}}return a};this.CreatePrintLayer=function(c){var a=null;if(b){a=document.createElementNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"class",c);b.insertBefore(a,b.firstChild)}return a}};function GetSvgPath(j,e){if(!e)return null;var a=0,k=e.length,f=k/2,i=0,c=new Array(Math.max(128,Math.round(k/8))),b=null,l=0,m=0,g=0,h=0;while(a<f){g=e[a*2];h=e[a*2+1];if(a==f-1||a==0||VE_IsDisplayLatLon(j,l,m,g,h,f)){b=LatLongtoRoundedPixel(j,h,g);if(!b)return;var d="";if(a<f-1)d=d.concat(b.x,",",b.y,",");else d=d.concat(b.x,",",b.y);if(i>=c.length)c.length+=Math.round(c.length/4);c[i++]=d;l=g;m=h}a++}if(i>0)c.length=i;return c.join("")}function LatLongtoRoundedPixel(b,d,e){var c;if(typeof VEMap!="undefined"&&b instanceof VEMap)c=new VELatLong(d,e);else c=new Msn.VE.LatLong(d,e);var a=b.LatLongToPixel(c,b.GetZoomLevel());if(!a)return null;a.x=MathRound(a.x);a.y=MathRound(a.y);return a}VE_LatLongThreshold={PixelDiff:8,DistDiff:.5,OriginLat:0,OriginLon:0,LatDiff:0,LonDiff:0,UseThreshold:true,IsNotInit:true};function VE_SetLatLonThreshold(c,e,d){VE_LatLongThreshold.IsNotInit=false;if(e!=null&&d!=null){VE_LatLongThreshold.OriginLat=d;VE_LatLongThreshold.OriginLon=e}var a,b=LatLongtoRoundedPixel(c,VE_LatLongThreshold.OriginLat,VE_LatLongThreshold.OriginLon);if(b){a=c.PixelToLatLong(new VEPixel(b.x+VE_LatLongThreshold.PixelDiff,b.y+VE_LatLongThreshold.PixelDiff));VE_LatLongThreshold.LatDiff=Math.abs(a.latitude-VE_LatLongThreshold.OriginLat);VE_LatLongThreshold.LonDiff=Math.abs(a.longitude-VE_LatLongThreshold.OriginLon)}}function VE_IsDisplayLatLon(e,i,h,b,a){if(!VE_LatLongThreshold.UseThreshold)return true;var c=Math.abs(VE_LatLongThreshold.OriginLat-a),d=Math.abs(VE_LatLongThreshold.OriginLon-b);if(Math.max(c,d)>VE_LatLongThreshold.DistDiff||VE_LatLongThreshold.IsNotInit)VE_SetLatLonThreshold(e,b,a);var f=Math.abs(a-h),g=Math.abs(b-i);if(f>VE_LatLongThreshold.LatDiff||g>VE_LatLongThreshold.LonDiff)return true;return false}function GetVmlPath(j,a){var h=a.points;if(!h)return null;var g=0,l=h.length,m=l/2,e=0,b=new Array(Math.max(128,Math.round(l/8)));b[e++]="m ";var q=MathRound(j.GetOffsetY()),p=MathRound(j.GetOffsetX()),f=null,n=0,o=0,c=0,d=0;if(l>=4){c=h[g*2];d=h[g*2+1];f=LatLongtoRoundedPixel(j,d,c);if(!f)return null;var i="";i=i.concat(f.x+p,",",f.y+q," l ");if(e>=b.length)b.length+=Math.round(b.length/4);b[e++]=i;n=c;o=d;++g}var k=false;if(a.type!=VEShapeType.Pushpin)if(a.minX==null||a.minY==null||a.maxX==null||a.maxY==null){k=false;a.minX=360;a.minY=360;a.maxX=-360;a.maxY=-360}else k=true;while(g<m){c=h[g*2];d=h[g*2+1];if(!k){a.minX=Math.min(a.minX,c);a.minY=Math.min(a.minY,d);a.maxX=Math.max(a.maxX,c);a.maxY=Math.max(a.maxY,d)}if(VE_IsDisplayLatLon(j,n,o,c,d,m)||g==m-1){f=LatLongtoRoundedPixel(j,d,c);if(!f)return null;var i="";i=i.concat(f.x+p,",",f.y+q," ");if(e>=b.length)b.length+=Math.round(b.length/4);b[e++]=i;n=c;o=d}++g}if(e>=b.length)b.length+=1;b[e++]=" e";if(e>0)b.length=e;return b.join("")}function GetCurrentMapViewBounds(b){var o=b.GetCenterLongitude(),p=b.GetCenterLatitude(),a=b.LatLongToPixel(new Msn.VE.LatLong(p,o)),h=b.GetMapWidth(),g=b.GetMapHeight();if(!a||isNaN(a.x)||isNaN(a.y))return new Msn.VE.Bounds(0,0,-Infinity,-Infinity,Infinity,Infinity);var l,n,k,m,j=false,q=b.GetMapStyle(),c=b.PixelToLatLong(new VEPixel(a.x-h/2,a.y+g/2)),d=b.PixelToLatLong(new VEPixel(a.x+h/2,a.y-g/2));if(q=="o"){var e=b.PixelToLatLong(new VEPixel(a.x-h/2,a.y-g/2)),f=b.PixelToLatLong(new VEPixel(a.x+h/2,a.y+g/2));if(c!=null&&d!=null&&e!=null&&f!=null){l=Math.min(c.longitude,d.longitude,e.longitude,f.longitude);n=Math.min(c.latitude,d.latitude,e.latitude,f.latitude);k=Math.max(c.longitude,d.longitude,e.longitude,f.longitude);m=Math.max(c.latitude,d.latitude,e.latitude,f.latitude)}else j=true}else if(c!=null&&d!=null){l=Math.min(c.longitude,d.longitude);n=Math.min(c.latitude,d.latitude);k=Math.max(c.longitude,d.longitude);m=Math.max(c.latitude,d.latitude)}else j=true;var i=null;if(j)i=new Msn.VE.Bounds(0,0,-Infinity,-Infinity,Infinity,Infinity);else i=new Msn.VE.Bounds(0,0,l,n,k,m);return i}function GetBufferedMapViewBounds(b,a){var c=null,e=Math.abs(a.x2-a.x1),d=Math.abs(a.y2-a.y1);c=new Msn.VE.Bounds(0,0,a.x1-b*e,a.y1-b*d,a.x2+b*e,a.y2+b*d);return c}function IsContainedInView(a,b){var c=false;if(b.x1>a.x1&&b.y1>a.y1&&b.x2<a.x2&&b.y2<a.y2)c=true;return c}Msn.Drawing.ComputeBoundingBox=function(a){if(typeof a=="undefined"||a==null||a.length==0)return null;var c=[],f=Infinity,g=Infinity,d=-Infinity,e=-Infinity;for(var b=0;b<a.length;b=b+2){f=Math.min(f,a[b]);g=Math.min(g,a[b+1]);d=Math.max(d,a[b]);e=Math.max(e,a[b+1])}c[0]=f;c[1]=g;c[2]=d;c[3]=e;return c};function IsBoundsIntersect(a,b){if(a==null)return true;if(b==null)return true;if(a.x2<b.x1||a.x1>b.x2||a.y2<b.y1||a.y1>b.y2)return false;return true}function IsDisplayShape(d,c,e,g,f,h){if(c==0)return true;if(e==f&&g==h)return true;var a=null,b=null;a=d.LatLongToPixel(new Msn.VE.LatLong(g,e));b=d.LatLongToPixel(new Msn.VE.LatLong(h,f));if(a==null||b==null)return true;if(Math.abs(b.y-a.y)>c||Math.abs(b.x-a.x)>c)return true;else return false}function IsRecIntersect(c,d,a,b,g,h,e,f){if(a<g||c>e||b<h||d>f)return false;return true}function wrapVmlElementInDiv(a){var c=Msn.VE.Css.Functions.getComputedStyle,b=document.createElement("div");b.className="VmlContainer";b.style.left=c(a,"left");b.style.top=c(a,"top");b.style.width=c(a,"width");b.style.height=c(a,"height");a.style.position="relative";a.style.left="0px";a.style.top="0px";a.style.width="100%";a.style.height="100%";b.appendChild(a);return b}function VEColorToHexString(c,b,a){return"#"+Number(c).toString(16)+(c<16?"0":"")+Number(b).toString(16)+(b<16?"0":"")+Number(a).toString(16)+(a<16?"0":"")}function VEHexStringToColor(){this.Convert=function(a){a=a.toUpperCase();var b=hTov(a.substring(0,1)),c=hTov(a.substring(1,2)),d=hTov(a.substring(2,3)),e=hTov(a.substring(3,4)),f=hTov(a.substring(4,5)),g=hTov(a.substring(5,6)),h=b*16+c,i=d*16+e,j=f*16+g;return new VEColor(h,i,j,1)};function hTov(h){var v=0;if(h=="A")v=10;else if(h=="B")v=11;else if(h=="C")v=12;else if(h=="D")v=13;else if(h=="E")v=14;else if(h=="F")v=15;else v=eval(h);return v}}_VERegisterNamespaces("Msn.VE");$MVEM=new function(){this.IsEnabled=function(a){if(a==undefined)throw new VEException("$MVEM.IsEnabled","err_invalidfeature","Specified feature is invalid.");return a}};function VEException(b,c,a){this.source=b;this.name=c;this.message=a}VEException.prototype.Name=this.name;VEException.prototype.Source=this.source;VEException.prototype.Message=this.message;function pseudoHover(a){if(!document.all)return;var d=function(){a.className+=" ms_pseudoHover"},c=function(){a.className=a.className.replace(/\s*ms_pseudoHover/g,"")};a.attachEvent("onmouseenter",d);a.attachEvent("onmouseleave",c);window.attachEvent("onunload",b);function b(){a.detachEvent("onmouseenter",d);a.detachEvent("onmouseleave",c);window.detachEvent("onunload",b)}}function pseudoHoverForChildren(d,a){if(!document.all)return;if(!a)a="LI";var c=d.getElementsByTagName(a);for(var b=0;b<c.length;b++)this.pseudoHover(c[b])}function pseudoHoverRemove(a){if(!document.all)return;a.className=a.className.replace(/\s*ms_pseudoHover/g,"")}_VERegisterNamespaces("Msn.VE.Css");Msn.VE.CurrentDomain=typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null?Msn.VE.API.Globals.vecurrentdomain:".";Msn.VE.Css={Cursors:{Auto:"auto",Default:"default",Crosshair:"crosshair",Pointer:"pointer",Move:"move",Wait:"wait",Text:"text",Help:"help",NResize:"n-resize",NEResize:"ne-resize",NWResize:"nw-resize",SResize:"s-resize",SEResize:"se-resize",SWResize:"sw-resize",EResize:"e-resize",WResize:"w-resize",CustomCursors:null,defineCustomCursors:function(c){Msn.VE.Css.Cursors.CustomCursors=c;var b,d=c.length;for(b=0;b<d;b++){var a=c[b];if(navigator.userAgent.indexOf(" Safari/")>-1)Msn.VE.Css.Cursors[a.name]=a.fallback;else Msn.VE.Css.Cursors[a.name]='url("'+a.domain+a.path+'"), '+a.fallback}}},RegEx:{RectClip:/rect\((auto|\d+px|\d*\.*\d+em|\d*\.*\d+pt)\s*,*\s*(auto|\d+px|\d*\.*\d+em|\d*\.*\d+pt)\s*,*\s*(auto|\d+px|\d*\.*\d+em|\d*\.*\d+pt)\s*,*\s*(auto|\d+px|\d*\.*\d+em|\d*\.*\d+pt)\)/},Functions:{addClass:function(a){this.alterClass(a,arguments,true)},removeClass:function(a){this.alterClass(a,arguments,false)},alterClass:function(a,e,g){var c,h=e.length;for(c=1;c<h;c++){var d=e[c],d=e[c].replace(/^\s*/,"").replace(/\s*$/,"");if(d.indexOf(" ")!=-1)continue;var f=new RegExp("(^| )"+d+"( |$)","i");if(g){if(!f.test(a.className))if(a.className=="")a.className=d;else a.className+=" "+d}else{var b=a.className;b=b.replace(f,"$1");b=b.replace(/ $/,"");a.className=b}}},getComputedStyle:function(b,c){var a=null;if(document.defaultView&&document.defaultView.getComputedStyle&&typeof document.defaultView.getComputedStyle!="undefined")a=document.defaultView.getComputedStyle(b,null);else a=b.currentStyle;return a[c]},setClip:function(c,d,e){var b=Msn.VE.Css.Functions.getClip(c,0),f=Msn.VE.Css.RegEx.RectClip,a=f.exec(b);a[d]=e;if(d==0)c.style.clip=a[0];else{a[d]=e;a.shift();b="rect("+a.join(" ")+")";c.style.clip=b}},getClip:function(d,e){var b=d.style.clip;if(b==""){var b=(window.opera?"auto":Msn.VE.Css.Functions.getComputedStyle(d,"clip"))||"auto";if(b=="auto")b="rect(auto auto auto auto)";else if(typeof b=="undefined"||b==null){var c=d.currentStyle;if(typeof c!="undefined"&&c!=null)b="rect("+c.clipTop+" "+c.clipRight+" "+c.clipBottom+" "+c.clipLeft+")"}}var f=Msn.VE.Css.RegEx.RectClip,a=f.exec(b);if(e==0)return a[0];a[1]=a[1]=="auto"?0:a[1];a[4]=a[4]=="auto"?0:a[4];a[2]=a[2]=="auto"?d.offsetWidth:a[2];a[3]=a[3]=="auto"?d.offsetHeight:a[3];if(e==5)return a;else return a[e]}}};_VERegisterNamespaces("Msn.VE");Msn.VE.OSType={Windows:1,Windows95:2,Windows98:3,WindowsMillenium:4,WindowsNT:5,WindowsNT4:6,Windows2000:7,Windows2000SP1:8,WindowsXP:9,WindowsXPSP2:10,WindowsServer2003:11,WindowsServer2003SP1:12,WindowsVista:13,MacOS:30,MacOS9:31,MacOSX:32,Linux:40,Unknown:100};Msn.VE.CLRType={CLR10:1,CLR11:2,CLR20:4,CLR30:8};Msn.VE.BrowserType={Firefox:1,MSIE:2,Opera:3,Unknown:10};Msn.VE.BrowserCaps={VML:1,SVG:2,WindowlessSelectElement:4,RightMouseButton:8,AddFavourite:16,VectorCapable:3};Msn.VE.BrowserInfo=function(){var a=this;this.Type=null;this.BrowserCaps=0;this.CLRType=0;this.MajorVersion=null;this.MinorVersion=null;this.versionString=null;this.UserAgent=null;this.OSType=null;this.Locale=null;if(arguments.length==0){this.UserAgent=window.navigator.userAgent;this.currentBrowser=true}else{this.UserAgent=arguments[0];this.currentBrowser=false;if(arguments.length>=2)this.Locale=arguments[1]}this.IsCompatibleWith=function(c){for(var b=0;b<c.length;b++){var a=c[b];if(a.Type==this.Type&&(this.MajorVersion>a.MajorVersion||a.MajorVersion==this.MajorVersion&&a.MinorVersion>=this.MinorVersion))return true}return false};function b(){if(a.UserAgent.indexOf("Mac")==-1&&(a.UserAgent.indexOf("Gecko")!=-1||a.UserAgent.indexOf("MSIE")!=-1))a.BrowserCaps|=Msn.VE.BrowserCaps.RightMouseButton}function c(){if(a.UserAgent.indexOf("MSIE 7")!=-1||a.UserAgent.indexOf("Gecko")!=-1)a.BrowserCaps|=Msn.VE.BrowserCaps.WindowlessSelectElement}function j(){if(a.UserAgent.indexOf("Mac")==-1&&(a.UserAgent.indexOf("MSIE 5")!=-1||a.UserAgent.indexOf("MSIE 6")!=-1||a.UserAgent.indexOf("MSIE 7")!=-1))a.BrowserCaps|=Msn.VE.BrowserCaps.VML}function i(){if(a.UserAgent.indexOf("MSIE")==-1){var d=0,e=0,f=new RegExp("Firefox/(.*)"),c=f.exec(a.UserAgent);if(c&&c.length>=2){var b=c[1].split(".");if(b){d=b[0];e=b[1];if(parseInt(d)>0&&parseInt(e)>=5)a.BrowserCaps|=Msn.VE.BrowserCaps.SVG}}}}function h(){try{if(a.UserAgent.indexOf("MSIE")!=-1)a.BrowserCaps|=Msn.VE.BrowserCaps.AddFavourite}catch(b){}}this.GetVersionString=function(){if(this.versionString==null)if(a.UserAgent.indexOf("Win")!=-1&&a.UserAgent.indexOf("MSIE")!=-1){var b=null,c;try{b=document.createElement("<DIV STYLE='behavior:url(#default#clientCaps); display: none' ID='__clientCaps'>");document.body.appendChild(b);c=b.getComponentVersion("{89820200-ECBD-11CF-8B85-00AA005B4383}","componentid")}catch(d){c=a.MajorVersion+"."+a.MinorVersion}finally{if($ID("__clientCaps")!=null)$ID("__clientCaps").parentNode.removeChild(b)}this.versionString=c}else if(a.MajorVersion!=null&&a.MajorVersion!=null)this.versionString=a.MajorVersion+"."+a.MinorVersion;else this.versionString="";return this.versionString};function e(){if(a.UserAgent.indexOf("MSIE")!=-1){var c=new RegExp("MSIE ([0-9]).([0-9])"),b=c.exec(a.UserAgent);if(b!=null){a.MajorVersion=parseInt(b[1]);a.MinorVersion=parseInt(b[2]);return}}else if(a.UserAgent.indexOf("Firefox")!=-1){var c=new RegExp("Firefox/([0-9]).([0-9])(.*)"),b=c.exec(a.UserAgent);if(b!=null){a.MajorVersion=parseInt(b[1]);a.MinorVersion=parseInt(b[2]);return}}else if(a.UserAgent.indexOf("Opera")!=-1){var c=new RegExp("Opera/([0-9]).([0-9])"),b=c.exec(a.UserAgent);if(b!=null){a.MajorVersion=parseInt(b[1]);a.MinorVersion=parseInt(b[2]);return}}a.MajorVersion=null;a.MinorVersion=null}function g(){if(a.UserAgent.indexOf("Mac OS X")!=-1)a.OSType=Msn.VE.OSType.MacOSX;else if(a.UserAgent.indexOf("Mac")!=-1)a.OSType=Msn.VE.OSType.MacOS;else if(a.UserAgent.indexOf("Linux")!=-1)a.OSType=Msn.VE.OSType.Linux;else if(a.UserAgent.indexOf("Win95")!=-1||a.UserAgent.indexOf("Windows 95")!=-1)a.OSType=Msn.VE.OSType.Windows95;else if(a.UserAgent.indexOf("Win98")!=-1||a.UserAgent.indexOf("Windows 98")!=-1)a.OSType=Msn.VE.OSType.Windows98;else if(a.UserAgent.indexOf("Win 9x 4.90")!=-1)a.OSType=Msn.VE.OSType.WindowsMillenium;else if(a.UserAgent.indexOf("Windows NT 4.0")!=-1)a.OSType=Msn.VE.OSType.WindowsNT4;else if(a.UserAgent.indexOf("Windows NT 5.01")!=-1)a.OSType=Msn.VE.OSType.Windows2000SP1;else if(a.UserAgent.indexOf("Windows NT 5.0")!=-1)a.OSType=Msn.VE.OSType.Windows2000;else if(a.UserAgent.indexOf("Windows NT 5.1")!=-1&&a.UserAgent.indexOf("SV1")!=-1)a.OSType=Msn.VE.OSType.WindowsXPSP2;else if(a.UserAgent.indexOf("Windows NT 5.1")!=-1)a.OSType=Msn.VE.OSType.WindowsXP;else if(a.UserAgent.indexOf("Windows NT 5.2")!=-1&&a.UserAgent.indexOf("SV1")!=-1)a.OSType=Msn.VE.OSType.WindowsServer2003SP1;else if(a.UserAgent.indexOf("Windows NT 5.2")!=-1)a.OSType=Msn.VE.OSType.WindowsServer2003;else if(a.UserAgent.indexOf("Windows NT 6.0")!=-1)a.OSType=Msn.VE.OSType.WindowsVista;else if(a.UserAgent.indexOf("Windows NT")!=-1)a.OSType=Msn.VE.OSType.WindowsNT;else if(a.UserAgent.indexOf("Win")!=-1)a.OSType=Msn.VE.OSType.Windows;else a.OSType=Msn.VE.OSType.Unknown}function d(){if(a.UserAgent.indexOf(".NET CLR 1.0")!=-1)a.CLRType|=Msn.VE.CLRType.CLR10;if(a.UserAgent.indexOf(".NET CLR 1.1")!=-1)a.CLRType|=Msn.VE.CLRType.CLR11;if(a.UserAgent.indexOf(".NET CLR 2.0")!=-1)a.CLRType|=Msn.VE.CLRType.CLR20;if(a.UserAgent.indexOf(".NET CLR 3.0")!=-1)a.CLRType|=Msn.VE.CLRType.CLR30}function f(){if(a.Locale!=null)return;a.Locale="en-US";if(a.UserAgent.indexOf("MSIE")!=-1){if(navigator.browserLanguage)a.Locale=navigator.browserLanguage;if(navigator.userLanguage)a.Locale=navigator.userLanguage;if(navigator.systemLanguage)a.Locale=navigator.systemLanguage}else if(a.UserAgent.indexOf("Gecko")!=-1){var c=new RegExp("; (.*); rv:"),b=c.exec(a.UserAgent);if(b&&b.length>=2)a.Locale=b[1].substring(b[1].lastIndexOf(" "),b[1].length+1)}else if(a.UserAgent.indexOf("Opera")!=-1){var c=new RegExp(" (.*)\\)"),b=c.exec(a.UserAgent);if(b&&b.length>=2)a.Locale=b[1].substring(b[1].lastIndexOf(" "),b[1].length+1)}}function k(){if(a.UserAgent.indexOf("Gecko")!=-1)a.Type=Msn.VE.BrowserType.Firefox;else if(a.UserAgent.indexOf("MSIE")!=-1)a.Type=Msn.VE.BrowserType.MSIE;else if(a.UserAgent.indexOf("Opera")!=-1)a.Type=Msn.VE.BrowserType.Opera;else a.Type=Msn.VE.BrowserType.Unknown;e();g();d();f();h();i();j();c();b()}k()};Msn.VE.Environment=function(){};Msn.VE.Environment.Redirect=function(a){window.location.href=a};Msn.VE.Environment.BrowserInfo=new Msn.VE.BrowserInfo;Msn.VE.Environment.IsFF20=function(){var a=Msn.VE.Environment.BrowserInfo;if(a.Type==Msn.VE.BrowserType.Firefox){var b=a.MajorVersion;if(b>=2)return true}return false};Msn.VE.Environment.IsIE50=function(){var a=Msn.VE.Environment.BrowserInfo;if(a.Type==Msn.VE.BrowserType.MSIE){var b=a.MajorVersion;if(b>=5)return true}return false};_VERegisterNamespaces("Msn.VE");Msn.VE.PushPinTypes={Default:0,SearchResultPrecise:1,Annotation:2,Direction:3,DirectionTemp:4,TrafficLight:5,TrafficOthers:6,YouAreHere:7,AdStandard:8,AdWide:9,AdCategory:10,AdRoofStandard:11,AdRoofWide:12,AdSponsor:13,DirectionStep:14,Context:15,SearchResultNonprecise:16,Collection:17,Overlay:18};Msn.VE.MapActionMode={ModeUnknown:0,Mode2D:1,Mode3D:2,ModeOblique:3};Msn.VE.BirdsEyeSearchSpinDirection={ClockwiseSpin:-1,NoSpin:0,CounterclockwiseSpin:1};Msn.VE.LineJoinMode={Straight:"miter",Round:"round"};Msn.VE.Css.Cursors.defineCustomCursors([{name:"Grab",domain:".",path:"/cursors/grab.cur",fallback:"move"},{name:"Grabbing",domain:".",path:"/cursors/grabbing.cur",fallback:"move"},{name:"Target",domain:".",path:"/cursors/target.cur",fallback:"crosshair"}]);Msn.VE.MapControl=function(p_elSource,p_htParams,p_parentAPIControl){var offsetMeters=20971520,baseMetersPerPixel=163840,buffer=0,maxTilePixelBuffer=768,animatedMovementEnabled=true,zoomTotalSteps=6,keyboardPanSpeed=15,panToLatLongSpeed=15,earthRadius=6378137,earthCircumference=earthRadius*2*Math.PI,projectionOffset=earthCircumference*.5,minZoom=1,maxZoom=19,emptyTile="http://virtualearth.msn.com/i/spacer.gif",minLatitude=-85,maxLatitude=85,minLongitude=-180,maxLongitude=180,tileSize=256,generations={},zoomLevelToAdjustObliqueToOrthro=18,kbInputZIndex=0,containerZIndex=0,mapZIndex=1,swapZIndex=1,baseZIndex=2,debugZIndex=3,baseZIndex=11,topZIndex=20,p_this=this,m_clientToken=null,cssCursors=Msn.VE.Css.Cursors,cssFn=Msn.VE.Css.Functions,roadStyle=Msn.VE.MapStyle.Road,shadedStyle=Msn.VE.MapStyle.Shaded,hybridStyle=Msn.VE.MapStyle.Hybrid,aerialStyle=Msn.VE.MapStyle.Aerial,obliqueStyle=Msn.VE.MapStyle.Oblique,obliqueHybridStyle=Msn.VE.MapStyle.ObliqueHybrid;generations[roadStyle]=174;generations[aerialStyle]=174;generations[hybridStyle]=174;generations[obliqueStyle]=174;generations[obliqueHybridStyle]=174;var mapTiles="Road",trafficTiles="Traffic",marketMaxZoom=1,currentScaleBarUnit=null,currentView=new Msn.VE.MapView(p_this),preferredView=new Msn.VE.MapView(p_this),previousZoomLevel=1,previousCenter=null,lastViewChangeType=null,previousMapStyle=null,lastOrthoZoomLevel=15,lastOrthoMapStyle=roadStyle,x=0,y=0,width=0,height=0,trafficAvailable=false,tileLayerManager=new VETileLayerManager,originX=0,originY=0,offsetX=0,offsetY=0,tileViewportX1=0,tileViewportY1=0,tileViewportX2=0,tileViewportY2=0,tileViewportWidth=0,tileViewportHeight=0,dragging=false,keyboardPan=false,lastMouseX=0,lastMouseY=0,zooming=false,zoomCounter=0,panning=false,panCounter=0,panningX=0,panningY=0,panLatitude=null,panLongitude=null,pushpins=[],lines=[],map=document.createElement("div"),keyboard=document.createElement("input");keyboard.id="wl_ve_mapInput";var logo=null,scaleBar=null,mapLegend=null,copyright=null;this.UpdateCopyright=function(){if(copyright)copyright.Update()};var dashboardContainer=null,dashboard=null,minimapControl=null,minimapContainer=null,mouseZoomDisabled=false,mousewheelZoomToCenter=true,isMinimap=false,boxTool=null,panTool=null,targetTool=null,currentTool=null,orthoMode=null,obliqueMode=null,threeDMode=null,currentMode=null,previousMode=null,Initialized2D=false,currentBounds=null,defaultEventTable=[],customEventTable=[],debug=false,graphicCanvas=null,svgLayer=null,svgDiv=null,bShowSVG=true;this.GetsvgDiv=function(){return svgDiv};var mapCenterOffset=new VEPixel(0,0),resizeInProgress=false,view3DCreated=false,spacecontrol=false,spacediv=null,spaceCameraIsFlying=false,init3dparam=null,resizeTimer=null,traffic3dAdded=false,initial3dView=null,cameraUpdateCount=0,photoplugin3dActive=false;this.Is3DPhotoPluginActive=function(){return photoplugin3dActive};this.Set3DPhotoPluginActive=function(a){photoplugin3dActive=a};function SetChildDiv(a){map.appendChild(a)}function EnableGeoCommunity(a){hijackMouseMove=a}function IsGeoCommunityEnabled(){return hijackMouseMove}function HijackMouseCursor(a){hijackMouseCursor=a}function IsHijackMouseCursor(){return hijackMouseCursor}function GetOffsetX(){return offsetX}function GetOffsetY(){return offsetY}function GetOriginY(){return originY}function GetOriginX(){return originX}this.Init=function(){orthoMode=new OrthoMode;orthoMode.Init();if(p_htParams.obliqueEnabled){obliqueMode=new ObliqueMode;obliqueMode.SetGUID(p_htParams.mapGUID);obliqueMode.Init(p_htParams.obliqueUrl?p_htParams.obliqueUrl:"%0dev.virtualearth.net/services/v1/ImageryMetadataService/ImageryMetadataService.asmx")}if(p_htParams.clientToken)this.SetClientToken(p_htParams.clientToken);threeDMode=new ThreeDMode;threeDMode.Init();UpdateFromParent();map.className="MSVE_Map";map.style.zIndex=mapZIndex;p_elSource.appendChild(map);cssFn.addClass(p_elSource,"MSVE_MapContainer");keyboard.className="MSVE_KeyboardInput";if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null&&Web.Browser.isSafari()){keyboard.style.top=0;keyboard.style.left=0;keyboard.style.border=0;if(Web.Browser.isSafari2()){keyboard.style.height=0;keyboard.style.width=0}else if(Web.Browser.isSafari3()){keyboard.style.outlineWidth=0;keyboard.style.color="transparent";keyboard.style.backgroundColor="transparent"}}p_elSource.appendChild(keyboard);if(!p_htParams.fixedView){p_elSource.attachEvent("onmousedown",MouseDown);p_elSource.attachEvent("onmouseup",MouseUp);p_elSource.attachEvent("onmousemove",MouseMove);p_elSource.attachEvent("ondblclick",MouseDoubleClick);p_elSource.attachEvent("oncontextmenu",ContextMenu);p_elSource.attachEvent("onclick",MouseClick);p_elSource.attachEvent("onmouseout",MouseOut);p_elSource.attachEvent("onmouseover",MouseOver);p_elSource.attachEvent("onmouseenter",MouseEnter);p_elSource.attachEvent("onmouseleave",MouseLeave)}if(p_htParams.buffer!=undefined&&p_htParams.buffer!=null)SetTilePixelBuffer(p_htParams.buffer);var startIn3DMode=false;if(p_htParams.mapMode!="undefined"&&p_htParams.mapMode!=null&&p_htParams.mapMode==Msn.VE.MapActionMode.Mode3D||p_htParams.altitude&&p_htParams.altitude>-1000||p_htParams.tilt&&p_htParams.tilt!=-90||p_htParams.direction&&p_htParams.direction!=0){SetBaseTileSource();startIn3DMode=true;currentMode=threeDMode}init3dparam=p_htParams.mapGUID;if((p_htParams.latitude!=null&&typeof p_htParams.latitude!="undefined"&&p_htParams.longitude!=null&&typeof p_htParams.longitude!="undefined"&&p_htParams.zoomlevel!=null&&typeof p_htParams.zoomlevel!="undefined"||p_htParams.boundingBox!=null&&typeof p_htParams.boundingBox!="undefined")&&p_htParams.mapstyle!=null&&typeof p_htParams.mapstyle!="undefined")try{var initialView=new Msn.VE.MapView(p_this);initialView.SetMapStyle(ValidateMapStyle(p_htParams.mapstyle),p_htParams.obliqueSceneId);if(startIn3DMode){initialView.sceneId=p_htParams.obliqueSceneId;initialView.photoX=p_htParams.photoX;initialView.photoY=p_htParams.photoY;initialView.photoScale=p_htParams.photoScale}if(p_htParams.boundingBox){var bb=p_htParams.boundingBox;if(bb.northwest){bb.northwest.latitude=ClipLatitude(bb.northwest.latitude);bb.northwest.longitude=ClipLongitude(bb.northwest.longitude)}if(bb.southeast){bb.southeast.latitude=ClipLatitude(bb.southeast.latitude);bb.southeast.longitude=ClipLongitude(bb.southeast.longitude)}initialView.SetLatLongRectangle(bb);if(startIn3DMode)initialView.Resolve(orthoMode,width,height)}else{initialView.SetZoomLevel(eval(p_htParams.zoomlevel));initialView.SetCenterLatLong(new Msn.VE.LatLong(eval(p_htParams.latitude),eval(p_htParams.longitude)))}if(p_htParams.altitude)initialView.SetAltitude(p_htParams.altitude);if(p_htParams.tilt)initialView.SetTilt(p_htParams.tilt);if(p_htParams.direction)initialView.SetDirection(p_htParams.direction);if(p_htParams.cameraPos){initialView.cameraLatlong=new Msn.VE.LatLong(eval(p_htParams.cameraPos[0]),eval(p_htParams.cameraPos[1]));initialView._needsPivotOperation=false}if(!startIn3DMode)SetBaseTileSource();currentView=initialView}catch(a){if(!startIn3DMode)SetDefaultView();else currentView=initialView}else if(!startIn3DMode)SetDefaultView();else currentView=initialView;if(startIn3DMode)this.Init3DOnly();else this.Init2DOnly();if(typeof p_htParams.hideCopyright=="undefined"||!p_htParams.hideCopyright){copyright=new Copyright(p_elSource);copyright.Init();copyright.Update();if(scaleBar)copyright.PinTo(scaleBar);if(mapLegend)mapLegend.PinTo(copyright)}if(typeof p_htParams.showMinimap!="undefined"&&p_htParams.showMinimap){var loadMinimapNow=false;if(obliqueMode!=null&&Msn.VE.MapStyle.IsViewOblique(p_htParams.mapstyle))loadMinimapNow=true;CreateMinimap(null,null,null,loadMinimapNow,null,p_htParams.minimapVersion,p_htParams.clientToken)}if(p_htParams.showDashboard){if(p_htParams.showMapModeSwitch!=false)p_htParams.showMapModeSwitch=true;CreateDashboard(p_htParams.dashboardX,p_htParams.dashboardY,p_htParams.dashboardSize,p_htParams.dashboardId,p_htParams.showMapModeSwitch,p_htParams.obliqueEnabled,p_htParams.labelsDefault,p_htParams.dashboardVersion)}if(p_htParams.showMapLegend)this.CreateLegend();if(startIn3DMode)copyright.Hide()};AttachEvent("onstartmapstyleoblique",function(){if(targetTool)targetTool.trackMovement()});AttachEvent("onendmapstyleoblique",function(){if(targetTool)targetTool.ignoreMovement()});AttachEvent("onchangeview",OnChangeView);this.Init2DOnly=function(a){mvcViewFacade.OnSwitchToFlatlandView();currentView.doRoadShading=typeof p_htParams.doRoadShading!="undefined"&&p_htParams.doRoadShading==true;if(!p_htParams.fixedView){boxTool=new BoxTool;boxTool.Init();panTool=new PanTool;panTool.Init();currentTool=panTool;keyboard.attachEvent("onkeydown",KeyDown);keyboard.attachEvent("onkeyup",KeyUp);keyboard.attachEvent("onblur",StopKeyboardPan);p_elSource.attachEvent("onmousewheel",MouseWheel)}targetTool=new TargetTool;targetTool.init();if(!p_htParams.disableLogo){logo=new Logo(p_elSource);logo.Init()}if(typeof copyright!="undefined"&&copyright!=null)copyright.Show();if(obliqueMode&&currentMode!=obliqueMode)obliqueMode.UpdateAvailability();graphicCanvas=GetGraphic(this);tileLayerManager.Active=true;if(currentView==null)SetDefaultView();else{if(a==true||!Initialized2D){SetView(currentView);Initialized2D=true}SetView(null)}if(p_htParams.showScaleBar){scaleBar=new ScaleBar(p_elSource);scaleBar.Init();if(currentScaleBarUnit)this.SetScaleBarDistanceUnit(currentScaleBarUnit);if(copyright)copyright.PinTo(scaleBar);AttachEvent("onendzoom",scaleBar.Update);AttachEvent("onendpan",scaleBar.Update);AttachEvent("onobliquechange",scaleBar.Update);AttachEvent("onchangemapstyle",scaleBar.Update);AttachEvent("onresize",scaleBar.Reposition)}Fire("oninitmode",Msn.VE.MapActionMode.Mode2D)};this.Init3DOnly=function(){if(typeof LoadMapDrawing=="function")LoadMapDrawing(null);if(dashboard)if(window.navigator.userAgent.indexOf("Firefox")<0){var d=dashboard.GetShimmedElements(),c;for(c=0;c<d.length;c++)UpdateIFrameShim(d[c])}if(mapLegend)mapLegend.UpdateShim();var b;try{if(currentView==null)b=SetDefaultView();else{var a=currentView.MakeCopy();if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)){a.SetMapStyle(lastOrthoMapStyle);a.SetZoomLevel(a.GetZoomLevel()+zoomLevelToAdjustObliqueToOrthro)}a.SetCenterLatLong(new Msn.VE.LatLong(currentView.latlong.latitude,currentView.latlong.longitude));a.cameraLatlong=currentView.cameraLatlong;b=SetView(a)}}catch(e){b=false}if(!b){this._Disable3DMode(true);return}if(!view3DCreated)return;mvcViewFacade.OnSwitchToView3D(spacecontrol);if(p_htParams.showDashboard)spacecontrol.ShowNavigationControl=true;if(typeof p_htParams.hideCopyright=="undefined"||!p_htParams.hideCopyright)spacecontrol.ShowCopyright=true;if(typeof copyright!="undefined"&&copyright!=null)copyright.Hide();if(p_htParams.showScaleBar)spacecontrol.ShowScale=true;this.SetScaleBarDistanceUnit(currentScaleBarUnit);spacecontrol.AttachEvent("OnHardwareCapabilitiesUpdate","OnHardwareCapabilitiesUpdate");if(spacecontrol.HardwareClassificationLevel>0)this.Setup3DManifests();tileLayerManager.AddAllTileSourcesTo3D(spacecontrol);AttachEvent("onchangetraffic",OnView3DScaleBarPositionUpdate);AttachEvent("onchangemapstyle",OnChangeMapStyle3D);spacecontrol.AttachEvent("OnCameraChanged","OnView3DUpdateViewpoint");spacecontrol.AttachEvent("OnBeginCameraChange","OnBeginFlyTo");if(!p_htParams.fixedView){spacecontrol.AttachEvent("OnHover","OnView3DPushpinHover");spacecontrol.AttachEvent("OnHoverEnd","OnView3DHoverEnd");spacecontrol.AttachEvent("OnDropGeometry","OnView3DDropGeometry");spacecontrol.AttachEvent("OnLatLonAltClicked","OnView3DLatLonAltClicked");spacecontrol.AttachEvent("OnMouseDown","OnMouseDown3D");spacecontrol.AttachEvent("OnMouseUp","OnMouseUp3D");spacecontrol.AttachEvent("OnClick","OnClick3D");spacecontrol.AttachEvent("OnMouseOver","OnMouseOver3D");spacecontrol.AttachEvent("OnMouseOut","OnMouseOut3D");spacecontrol.AttachEvent("OnDoubleClick","OnDoubleClick3D");spacecontrol.AttachEvent("OnModelViewSuccess","UniqueModelViewSuccess");spacecontrol.AttachEvent("OnModelViewFailure","UniqueModelViewFailure");spacecontrol.AttachEvent("OnModelFullyDownloaded","UniqueModelFullyDownloaded")}else spacecontrol.FixedView=true;traffic3dAdded=false;if(typeof VE_TrafficManager!="undefined"&&VE_TrafficManager!=null)VE_TrafficManager.GetTrafficInfo(false);if(typeof VE_BrandExplorationManager!="undefined"&&VE_BrandExplorationManager!=null)VE_BrandExplorationManager.Clear();LoadStreetLevelGeometry(spacecontrol);if(!init3dparam)Relay3DPushpins();Fire("oninitmode",Msn.VE.MapActionMode.Mode3D)};this.Setup3DManifests=function(){var c=currentView.mapStyle,a="http://go.microsoft.com/fwlink/?LinkID=98770",b="http://go.microsoft.com/fwlink/?LinkID=98775",d="http://go.microsoft.com/fwlink/?LinkID=98774";if(c=="a"){a="http://go.microsoft.com/fwlink/?LinkID=98771";spacecontrol.ShowAtmosphere=true}if(c=="h"){a="http://go.microsoft.com/fwlink/?LinkID=98772";spacecontrol.ShowAtmosphere=true}if(c=="r"){spacecontrol.TexturesVisible=false;if(spacecontrol.HardwareClassificationLevel<3)a="http://go.microsoft.com/fwlink/?LinkID=98769";spacecontrol.ShowAtmosphere=false}else spacecontrol.TexturesVisible=true;if(2==spacecontrol.HardwareClassificationLevel){d="http://go.microsoft.com/fwlink/?LinkID=98773";b="http://go.microsoft.com/fwlink/?LinkID=98776"}else if(1==spacecontrol.HardwareClassificationLevel){d="http://go.microsoft.com/fwlink/?LinkID=98773";b=""}spacecontrol.AddImageSource("Terrain","Texture",GetManifestUrl(a),0,1);spacecontrol.AddElevationSource("Terrain","DEM",GetManifestUrl(d),0);if(b!="")spacecontrol.AddModelSource("Model","Model",GetManifestUrl(b));else spacecontrol.RemoveModelSource("Model","Model")};this.ShowSVG=function(a){bShowSVG=a};this.getSvgLayer=function(){if(svgLayer==null){svgDiv=document.createElement("div");svgDiv.style.position="absolute";if(bShowSVG)svgDiv.style.zIndex=60;else svgDiv.style.zIndex=-1;svgDiv.align="left";this.resizeSVG();map.appendChild(svgDiv);svgLayer=new Msn.Drawing.SvgLayer(svgDiv,this)}return svgLayer};this.resetSvgLayer=function(){this.getSvgLayer();svgDiv.style.top=-parseInt(map.style.top)+"px";svgDiv.style.left=-parseInt(map.style.left)+"px";if(currentMode!=threeDMode&&graphicCanvas){graphicCanvas.SetOffset(offsetX,offsetY);tileLayerManager.RePositionPrintTiles()}};this.resizeSVG=function(){if(svgDiv!=null){var b=GetWindowWidth(),a=GetWindowHeight();svgDiv.style.top="0px";svgDiv.style.left="0px";svgDiv.style.width=b+"px";svgDiv.style.height=a+"px";if(currentMode!=threeDMode&&graphicCanvas){graphicCanvas.SetOffset(offsetX,offsetY);graphicCanvas.RepositionLogo(g(p_elSource).getStyle("width"),g(p_elSource).getStyle("height"));tileLayerManager.RePositionPrintTiles()}}};function GetGraphic(a){if(!graphicCanvas)try{graphicCanvas=Msn.Drawing.Graphic.CreateGraphic(map,a);graphicCanvas.SetZIndex(17)}catch(b){}return graphicCanvas}this.GetDashboard=function(){return dashboard};this.GetMinimap=function(){return minimapControl};this.DisableZoomEvents=function(a){mouseZoomDisabled=a};this.GetMouseWheelZoomToCenter=function(){return mousewheelZoomToCenter};this.SetMouseWheelZoomToCenter=function(a){mousewheelZoomToCenter=a};this.SetMinimapMode=function(){mouseZoomDisabled=true;isMinimap=true};this.SetCursor=function(a){var b=p_elSource.style;if(b.cursor!=a)b.cursor=a};this.Destroy=function(){if(currentView){currentView.Destroy();currentView=null}if(preferredView){preferredView.Destroy();preferredView=null}if(copyright){copyright.Destroy();copyright=null}if(currentMode==threeDMode&&currentMode!=null)this.Destroy3DOnly();else{this.Destroy2DOnly();while(pushpins.length)pushpins.pop().Destroy();ClearLines()}if(!p_htParams.fixedView){p_elSource.detachEvent("onmousedown",MouseDown);p_elSource.detachEvent("onmouseup",MouseUp);p_elSource.detachEvent("onmousemove",MouseMove);p_elSource.detachEvent("ondblclick",MouseDoubleClick);p_elSource.detachEvent("oncontextmenu",ContextMenu);p_elSource.detachEvent("onmousewheel",MouseWheel);p_elSource.detachEvent("onclick",MouseClick);p_elSource.detachEvent("onmouseout",MouseOut);p_elSource.detachEvent("onmouseover",MouseOver);p_elSource.detachEvent("onmouseenter",MouseEnter);p_elSource.detachEvent("onmouseleave",MouseLeave)}if(dashboard){if(typeof dashboard.Destroy!="undefined")dashboard.Destroy();dashboard=null}if(mapLegend){DetachEvent("onendzoom",mapLegend.Update);DetachEvent("onendpan",mapLegend.Update);DetachEvent("onobliquechange",mapLegend.Update);if(typeof VE_TrafficManager!="undefined"&&VE_TrafficManager!=null)VE_TrafficManager.CloseTrafficLegend();mapLegend.Destroy();mapLegend=null}if(dashboardContainer){dashboardContainer.detachEvent("onmousedown",IgnoreEvent);dashboardContainer.detachEvent("onmouseup",IgnoreEvent);dashboardContainer.detachEvent("onmousemove",DashboardContainerMouseMoveEvent);dashboardContainer.detachEvent("onmousewheel",IgnoreEvent);dashboardContainer.detachEvent("ondblclick",IgnoreEvent);dashboardContainer.detachEvent("oncontextmenu",IgnoreEvent);dashboardContainer.detachEvent("onkeydown",IgnoreEvent);dashboardContainer.detachEvent("onkeyup",IgnoreEvent);dashboardContainer=null}if(minimapControl){minimapControl.Destroy();minimapControl=null}if(minimapContainer){minimapContainer.detachEvent("onmousedown",IgnoreEvent);minimapContainer.detachEvent("onmouseup",IgnoreEvent);minimapContainer.detachEvent("onmousemove",DashboardContainerMouseMoveEvent);minimapContainer.detachEvent("onmousewheel",IgnoreEvent);minimapContainer.detachEvent("ondblclick",IgnoreEvent);minimapContainer.detachEvent("oncontextmenu",IgnoreEvent);minimapContainer.detachEvent("onkeydown",IgnoreEvent);minimapContainer.detachEvent("onkeyup",IgnoreEvent);minimapContainer=null}if(orthoMode){orthoMode.Destroy();orthoMode=null}if(obliqueMode){obliqueMode.Destroy();obliqueMode=null}if(threeDMode){threeDMode.Destroy();threeDMode=null}DestroyEventTable();m_clientToken=null;p_elSource.style.backgroundColor="transparent";p_elSource.style.filter="";keyboard=p_elSource=p_this=map=null;tileLayerManager.ClearTileLayers();cssCursors=null;cssFn=null};this.Destroy2DOnly=function(){if(!p_htParams.fixedView){keyboard.detachEvent("onkeydown",KeyDown);keyboard.detachEvent("onkeyup",KeyUp);keyboard.detachEvent("onblur",StopKeyboardPan);p_elSource.detachEvent("onmousewheel",MouseWheel)}tileLayerManager.Active=false;if(scaleBar){DetachEvent("onendzoom",scaleBar.Update);DetachEvent("onendpan",scaleBar.Update);DetachEvent("onobliquechange",scaleBar.Update);DetachEvent("onchangemapstyle",scaleBar.Update);DetachEvent("onresize",scaleBar.Reposition);scaleBar.Destroy();scaleBar=null}if(copyright)copyright.PinTo(null);if(logo){logo.Destroy();logo=null}if(boxTool){boxTool.Destroy();boxTool=null}if(panTool){panTool.Destroy();panTool=null}if(targetTool){targetTool.destroy();targetTool=null}if(graphicCanvas){graphicCanvas.Destroy();graphicCanvas=null}Fire("ondestroymode",Msn.VE.MapActionMode.Mode2D)};this.Destroy3DOnly=function(){DetachEvent("onchangetraffic",OnView3DScaleBarPositionUpdate);DetachEvent("onchangemapstyle",OnChangeMapStyle3D);view3DCreated=false;try{spacecontrol.Close()}catch(c){}spacecontrol=false;window.status="";if(spacediv!=null){spacediv.removeNode(true);spacediv=null}if(dashboard&&dashboard.GetShimmedElements){var b=dashboard.GetShimmedElements(),a;for(a=0;a<b.length;a++)destroyIFrameShim(b[a].id)}if(mapLegend)mapLegend.RemoveShim();Fire("ondestroymode",Msn.VE.MapActionMode.Mode3D)};function OnView3DScaleBarPositionUpdate(){var a=VE_TrafficManager.turnedOn?25:0;if(spacecontrol!=null)spacecontrol.RaiseEvent("CB24F613-FE72-442e-857A-BB2FD6BFBAA5","OnScaleBarPositionChange",a)}function UpdateFromParent(){var a=g(p_elSource).getPagePosition();x=a.x;y=a.y;width=p_elSource.offsetWidth;height=p_elSource.offsetHeight}function CreateDashboard(c,d,b,h,e,g,f,a){if(currentMode==threeDMode&&currentMode!=null)b=Msn.VE.DashboardSize.Normal;dashboard=Msn.VE.NavControlFactory(p_elSource,p_this,b,h,e,g,f,a);dashboard.Init();dashboardContainer=dashboard.GetElement();if(a==5){if(isFinite(parseInt(c)))dashboardContainer.style.left=c+"px";if(isFinite(parseInt(d)))dashboardContainer.style.top=d+"px"}}function CreateMinimap(c,d,a,f,g,h,e){minimapContainer=document.createElement("div");if(typeof a!="undefined"&&a!=null)minimapContainer.id=a;else minimapContainer.id="MSVE_minimap";p_elSource.appendChild(minimapContainer);minimapContainer.attachEvent("onmousedown",IgnoreEvent);minimapContainer.attachEvent("onmouseup",IgnoreEvent);minimapContainer.attachEvent("onmousemove",DashboardContainerMouseMoveEvent);minimapContainer.attachEvent("onmousewheel",IgnoreEvent);minimapContainer.attachEvent("ondblclick",IgnoreEvent);minimapContainer.attachEvent("oncontextmenu",IgnoreEvent);minimapContainer.attachEvent("onkeydown",IgnoreEvent);minimapContainer.attachEvent("onkeyup",IgnoreEvent);minimapControl=new Msn.VE.Minimap(minimapContainer,p_this,g,h);if(e)minimapControl.SetClientToken(e);var b=f||IsMapViewOblique()||$MVEM.IsEnabled(MapControl.Features.Minimap.ShowByDefault);b=b&&IsModeEnabled(Msn.VE.MapActionMode.Mode2D);if(b)minimapControl.Init();if(typeof c!="undefined"&&c!=null&&typeof d!="undefined"&&d!=null)minimapControl.SetPosition(c,d);return minimapControl}function OnChangeView(){if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)){var b=GetObliqueScene();if(b!=null&&targetTool){var a=Msn.VE.Geometry,e=g(p_elSource).getPagePosition(),c=new a.Point(e.x+(map.offsetLeft-originX),e.y+(map.offsetTop-originY)),d=2/currentView.zoomLevel,h=new a.Point(c.x+b.GetWidth()/d,c.y+b.GetHeight()/d),f=new a.Rectangle(c,h);f.scale(-256);targetTool.setBoundingArea(f);a=null}b=null}if(obliqueMode)obliqueMode.UpdateAvailability()}function SetDefaultView(){var a=new Msn.VE.MapView(p_this);a.SetCenterLatLong(new Msn.VE.LatLong(0,0));a.SetZoomLevel(1);a.SetMapStyle(roadStyle);SetBaseTileSource(a);SetView(a);Initialized2D=true}function SetAltitude(b){Sync3dView();var a=currentView.MakeCopy();a.SetAltitude(b);SetView(a)}function SetTilt(b){Sync3dView();var a=currentView.MakeCopy();a.SetTilt(b);SetView(a)}function SetDirection(b){Sync3dView();var a=currentView.MakeCopy();a.SetDirection(b);SetView(a)}function GetCurrentMode(){return currentMode}function GetObliqueMode(){return obliqueMode}function GetMapWidth(){return width}function GetMapHeight(){return height}function SetMapHeight(a){height=a;p_this.h=a;p_elSource.style.height=a}function GetCurrentMapView(){return preferredView.MakeCopy()}function SetCenter(c,b){Sync3dView();var a=preferredView.MakeCopy();a.SetCenterLatLong(new Msn.VE.LatLong(c,b));SetView(a)}function SetCenterAccurate(c,b){Sync3dView();var a=preferredView.MakeCopy();a.SetCenterLatLongAccurate(new Msn.VE.LatLong(c,b));SetView(a)}function SetMapStyle(b,f,c,e,d){Sync3dView();var a=currentView.MakeCopy();a.SetMapStyle(ValidateMapStyle(b),f,c,e,d);if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)!=Msn.VE.MapStyle.IsViewOblique(b))if(Msn.VE.MapStyle.IsViewOblique(b)){Fire("onstartmapstyleoblique");a.SetZoomLevel(1);lastOrthoZoomLevel=currentView.zoomLevel;lastOrthoMapStyle=currentView.mapStyle}else if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)){Fire("onendmapstyleoblique");a.SetZoomLevel(lastOrthoZoomLevel)}a.latlong.latitude=GetCenterLatitude();a.latlong.longitude=GetCenterLongitude();if(currentMode==threeDMode)a._supressFlyToCall=true;SetView(a)}function SetScaleBarDistanceUnit(a){currentScaleBarUnit=a;if(scaleBar!=null){scaleBar.SetDistanceUnit(a);scaleBar.Update()}if(currentMode==threeDMode&&spacecontrol!=null){if(a==null)bUseKilometers=$MVEM.IsEnabled(MapControl.Features.ScaleBarKilometers);else bUseKilometers=a==Msn.VE.DistanceUnit.Kilometers;spacecontrol.DisplayMetricUnits=bUseKilometers}}function ValidateMapStyle(a){if(Msn.VE.MapStyle.IsViewOrtho(a)||Msn.VE.MapStyle.IsViewOblique(a))return a;else return roadStyle}function GetCenterLatitude(){if(currentMode==threeDMode){if(view3DCreated){var a=spacecontrol.GetCenterLatitude();return isNaN(a)?null:a}return null}else if(currentView!=null&&currentView!="undefined"&&currentView.latlong!=null&&currentView.latlong!="undefined"&&currentView.latlong.latitude!=null&&currentView.latlong.latitude!="undefined")return currentView.GetCenterLatLong().latitude;return null}function GetCenterLongitude(){if(currentMode==threeDMode){if(view3DCreated){var a=spacecontrol.GetCenterLongitude();return isNaN(a)?null:a}return null}else if(currentView!=null&&currentView!="undefined"&&currentView.latlong!=null&&currentView.latlong!="undefined"&&currentView.latlong.longitude!=null&&currentView.latlong.longitude!="undefined")return currentView.GetCenterLatLong().longitude;return null}function ComputeCenterPoint(a){currentView.latlong=currentMode.PixelToLatLong(currentView.center,currentView.zoomLevel);if(a)preferredView.Copy(currentView)}function GetLatitude(c){var b=new VEPixel(originX+offsetX+width/2,originY+offsetY+c),a=currentMode.PixelToLatLong(b,currentView.zoomLevel);if(!a)return null;return a.latitude}function GetLongitude(c){var b=new VEPixel(originX+offsetX+c,originY+offsetY+height/2),a=currentMode.PixelToLatLong(b,currentView.zoomLevel);if(!a)return null;return a.longitude}function GetY(b){var c=new Msn.VE.LatLong(b,currentView.center.longitude),a=LatLongToPixel(c);if(!a)return null;return MathRound(a.y)}function GetX(b){var c=new Msn.VE.LatLong(currentView.center.latitude,b),a=LatLongToPixel(c);if(!a)return null;return MathRound(a.x)}function LatLongToPixel(c,a){if(a==null||typeof a=="undefined")a=currentView.zoomLevel;var b=currentMode.LatLongToPixel(c,a);if(b!=null)if(currentMode!=threeDMode){b.x-=originX+offsetX;b.y-=originY+offsetY}return b}function LatLongToPixelAsync(c,a,d){if(a==null||typeof a=="undefined")a=currentView.zoomLevel;var b=function(a){if(a!=null&&typeof a!="undefined"&&currentMode!=threeDMode)for(var b=0;b<a.length;++b)if(a[b]!=null){a[b].x-=originX+offsetX;a[b].y-=originY+offsetY}d(a)};currentMode.LatLongToPixelAsync(c,a,b)}function PixelToLatLong(b,a){if(a==null||typeof a=="undefined")a=currentView.zoomLevel;var c=new VEPixel(b.x+originX+offsetX,b.y+originY+offsetY);return currentMode.PixelToLatLong(c,a)}function PixelToLatLongAsync(c,b,e){if(b==null||typeof b=="undefined")b=currentView.zoomLevel;var d=[];for(var a=0;a<c.length;++a)d[a]=new VEPixel(c[a].x+originX+offsetX,c[a].y+originY+offsetY);currentMode.PixelToLatLongAsync(d,b,e)}function GetZoomLevel(){return currentView.zoomLevel}function GetMapStyle(){return currentView.mapStyle}function GetMapMode(){var a=Msn.VE.MapActionMode.ModeUnknown;if(currentMode!=null)if(currentMode==threeDMode)a=Msn.VE.MapActionMode.Mode3D;else if(currentMode==orthoMode)a=Msn.VE.MapActionMode.Mode2D;else if(currentMode==obliqueMode)a=Msn.VE.MapActionMode.ModeOblique;return a}function GetMode(){var a=Msn.VE.MapActionMode.ModeUnknown;if(currentMode!=null)if(currentMode==threeDMode)a=Msn.VE.MapActionMode.Mode3D;else if(currentMode==orthoMode)a=Msn.VE.MapActionMode.Mode2D;else if(currentMode==obliqueMode)if(this.GetDashboard().GetMode()==1)a=Msn.VE.MapActionMode.Mode2D;else a=Msn.VE.MapActionMode.Mode3D;return a}function GetAltitude(){return currentView.GetAltitude()}function GetTilt(){return currentView.GetTilt()}function GetDirection(){return currentView.GetDirection()}function EnableMode(b,a){switch(b){case Msn.VE.MapActionMode.Mode3D:this._Enable3DMode(a);break;case Msn.VE.MapActionMode.Mode2D:default:this._Disable3DMode(a);UnHidePins()}}function _Enable3DMode(a){if(currentMode!=threeDMode&&currentMode!=null){VE_3DPhotoPluginObj=0;VE_3DGeoCommunityPluginObj=0;VE_3DStreetLevelGeometryObj=0;PluginEventRegistered=0;PhotoPluginEventRegistered=0;GeoCommunityPluginEventRegistered=0;StreetLevelGeometryEventRegistered=0;previousMode=currentMode;currentMode=threeDMode;this.Destroy2DOnly();if(typeof a!="undefined")init3dparam=a;this.Init3DOnly()}}function _Disable3DMode(a){if(currentMode==threeDMode&&currentMode!=null){previousMode=currentMode;currentMode=orthoMode;this.Destroy3DOnly();this.Init2DOnly(a)}}function ControlReady(){return IsModeEnabled(Msn.VE.MapActionMode.Mode2D)||IsModeEnabled(Msn.VE.MapActionMode.Mode3D)&&Get3DControl()!=null}function Get3DControl(){if(view3DCreated)return spacecontrol;return null}function IsModeEnabled(b){var a=currentMode!=null&&currentMode==threeDMode;switch(b){case Msn.VE.MapActionMode.Mode2D:return!a;break;case Msn.VE.MapActionMode.Mode3D:return a}return false}function Get3DVisibleArea(acceptRegionAroundCenter){if(!view3DCreated)return null;var lat1,lon1,lat2,lon2,lat3,lon3,lat4,lon4,aroundcenter,ret=spacecontrol.QueryRegion();eval(ret);if((acceptRegionAroundCenter=="undefined"||acceptRegionAroundCenter==false)&&aroundcenter==1)return null;var points=[];points.push(new Msn.VE.LatLong(lat1,lon1));points.push(new Msn.VE.LatLong(lat2,lon2));points.push(new Msn.VE.LatLong(lat3,lon3));points.push(new Msn.VE.LatLong(lat4,lon4));return points}function Show3DTraffic(a){if(view3DCreated)if(!traffic3dAdded||a){spacecontrol.AddImageSource("Terrain","Traffic",GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=98777"),1,.6);traffic3dAdded=true}}function Remove3DTraffic(){if(view3DCreated&&traffic3dAdded){spacecontrol.RemoveImageSource("Terrain","Traffic");traffic3dAdded=false}}function Show3DBirdseye(a,b){if(currentMode==threeDMode&&spacecontrol){ProcessPhotoPluginActionIn3D("PhotosEnabled","enabled="+(a?"1":"0")+";labels="+(b?"1":"0"),spacecontrol);p_this.Set3DPhotoPluginActive(a);p_this.UpdateCopyright()}}function Sync3dView(){if(spacecontrol&&spaceCameraIsFlying)spacecontrol.RaiseCameraChangedEvent()}function OnBeginCameraUpdate(){cameraUpdateCount++;spaceCameraIsFlying=true}function OnEndCameraUpdate(){spaceCameraIsFlying=false}function IsCameraFlying(){return spaceCameraIsFlying}function GetMetersPerPixel(b,a){if(!b)b=currentView.latlong.latitude;if(!a)a=currentView.zoomLevel;return Math.cos(DegToRad(b))*currentMode.MetersPerPixel(a)}function Fill(){var b=g(p_elSource).getStyle("width"),a=g(p_elSource).getStyle("height"),f=parseInt(b)-width,h=parseInt(a)-height;if(!/px$/.test(b))width=p_elSource.clientWidth||p_elSource.offsetWidth;else width=parseInt(b);if(!/px$/.test(a))height=p_elSource.clientHeight||p_elSource.offsetHeight;else height=parseInt(a);if(!panning)if(currentMode!=threeDMode){panning=true;var e=g(map).getComputedPosition(),c={x:e.x+f/2,y:e.y+h/2};offsetX=-c.x;offsetY=-c.y;var d=new VEPixel(width/2+originX+offsetX,height/2+originY+offsetY);currentView.SetCenter(d);preferredView.SetCenter(new VEPixel(d.x,d.y));window.setTimeout(tileLayerManager.PanView,1);g(map).slideToPoint(c,"quickly","MAP_SLIDE",function(){panning=false},Gimme.Animation.AccelerationLines.quickStartDecelerate)}else PanToView(currentView)}function Resize(b,a){if(resizeTimer!=null&&typeof resizeTimer=="number")window.clearTimeout(resizeTimer);p_this.w=b;p_this.h=a;resizeTimer=window.setTimeout(p_this.FireResize,250)}this.FireResize=function(){if(resizeInProgress)return;else resizeInProgress=true;var b=p_this.w,a=p_this.h;if(!b||b<=0||!a||a<=0)Fill();else{p_elSource.style.width=b+"px";p_elSource.style.height=a+"px";UpdateFromParent();if(currentMode==null||currentMode!=threeDMode){if(b&&b>=0)width=b;if(a&&a>=0)height=a}PanToView(currentView)}if(copyright)copyright.Reposition();if(scaleBar)scaleBar.Reposition();if(!document.all)p_this.resizeSVG();Fire("onresize")};function IsObliqueAvailable(){return obliqueMode?obliqueMode.IsAvailable():false}function GetObliqueScene(){return obliqueMode?obliqueMode.GetScene():null}function SetAnimationEnabled(a){animatedMovementEnabled=a}function IsAnimationEnabled(){return animatedMovementEnabled&&currentMode!=threeDMode}function SetObliqueScene(a){if(obliqueMode)SetMapStyle(obliqueStyle,a,null)}function SetObliqueLocation(e,b,c,d){if(obliqueMode){Sync3dView();var a=currentView.MakeCopy();a.SetMapStyle(obliqueStyle,null,b);a.SetZoomLevel(c);if(!Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)){Fire("onstartmapstyleoblique");lastOrthoZoomLevel=currentView.zoomLevel;lastOrthoMapStyle=currentView.mapStyle}a.SetCenterLatLong(e);a.callback=d;SetView(a)}}function SetObliqueOrientation(d,c,b){if(obliqueMode){var a;if(IsMapViewOblique())a=GetMapStyle();else a=p_htParams.labelsDefault?obliqueHybridStyle:obliqueStyle;SetMapStyle(a,null,d,c,b)}}function Debug(a){debug=a}function GetMapLegend(){return mapLegend}function SetFocus(){if(currentMode==threeDMode)spacecontrol.Focus();else keyboard.focus()}function StopKeyboardPan(){if(panning&&keyboardPan)StopContinuousPan()}function UpdatePreferredView(){preferredView.Copy(currentView)}function GetCenterOffset(){if(currentMode!=null&&currentMode==threeDMode)return new VEPixel(0,0);return mapCenterOffset}function SetCenterOffset(a){if(typeof a!="undefined"&&a!=null)mapCenterOffset=a}function GetLastViewChangeType(){var a=lastViewChangeType;lastViewChangeType=null;return a}function ShowNonIENotSupportedDialog(){Fire("onerror",CreateEvent(currentView.latlong,currentView.zoomLevel,L_BrowserNotSupported_Text.replace(/%1/g,'<a href="'+L_SupportedBrowserDownloadUrl_Text+'" target="_blank">').replace(/%3/g,L_SupportedBrowserDownloadUrl_Text).replace(/%2/g,"</a>")))}function DelayedHWDialog(){ShowMessage(L_NoHardwareAcceleration_Text)}function SetShowMapModeSwitch(a){if(dashboard&&dashboard.constructor==Msn.VE.NavAction)dashboard.SetShowMapModeSwitch(a)}function SetTilePixelBuffer(a){buffer=a<maxTilePixelBuffer?a:maxTilePixelBuffer}function SetClientToken(a){m_clientToken=a;if(tileLayerManager){tileLayerManager.SetClientToken(mapTiles,m_clientToken);tileLayerManager.SetClientToken(trafficTiles,m_clientToken)}if(minimapControl)minimapControl.SetClientToken(m_clientToken);if(obliqueMode)obliqueMode.SetClientToken(m_clientToken)}function GetTopPx(){if(typeof p_elSource!="undefined"&&p_elSource!=null)return g(p_elSource).getPagePosition().y;else return 0}function GetLeftPx(){if(typeof p_elSource!="undefined"&&p_elSource!=null)return g(p_elSource).getPagePosition().x;else return 0}function GetObliqueAvailability(b,a){if(obliqueMode)obliqueMode.GetObliqueAvailability(b,a);else if(typeof a=="function")a(false)}function GetMapSurface(){return map}this.CreateLegend=function(){if(!mapLegend){mapLegend=new MapLegend(p_elSource);mapLegend.Init();if(copyright)mapLegend.PinTo(copyright)}return mapLegend};function CalculateTileViewPort(a,b,d,c,e){return tileLayerManager.CalculateTileViewPort(a,b,d,c,e)}function GetCurrentTileViewPort(){return tileLayerManager.GetViewPort()}function SetPrintable(a){if(a){graphicCanvas.CreatePrintLayer(map,this,g(p_elSource).getStyle("width"),g(p_elSource).getStyle("height"));tileLayerManager.SetPrintable(true);graphicCanvas.AddLogo(logo.GetURL());g(p_elSource).addClass("MSVE_Printable_Map")}else{tileLayerManager.SetPrintable(false);graphicCanvas.RemovePrintLayer(this);g(p_elSource).removeClass("MSVE_Printable_Map")}}function IsMapViewOblique(){return Msn.VE.MapStyle.IsViewOblique(GetMapStyle())}function IsMapViewOrtho(){return Msn.VE.MapStyle.IsViewOrtho(GetMapStyle())}function ClipView(b,c){var a=ShiftView(b,c,0,0);if(typeof a!="undefined"&&a!=null)b.SetCenter(new VEPixel(b.center.x+a.x,b.center.y+a.y))}function ShiftView(b,a,c,d){if(b!=null&&b.center!=null&&a!=null&&a!="undefined"){c=ClipDelta(c,width,b.center.x-width/2,b.zoomLevel,a.z1,a.x1,a.x2,b.mapStyle);d=ClipDelta(d,height,b.center.y-height/2,b.zoomLevel,a.z1,a.y1,a.y2,b.mapStyle);return new VEPixel(c,d)}}function ClipDelta(a,b,d,g,f,i,h){var c=tileSize*i*Math.pow(2,g-f),e=tileSize*h*Math.pow(2,g-f);if(IsMapViewOblique()){c-=Math.ceil(b/2);e+=Math.ceil(b/2)}if(b>e-c)a=(e-c-b)/2-d+c;else if(d+a<c)a=c-d;else if(d+b+a>e)a=e-d-b;return a}function VECopyrightTableEntry(b,a,e,f,c,d){this.MinZoomLevel=b;this.MaxZoomLevel=a;this.MinLatitude=e;this.MinLongitude=f;this.MaxLatitude=c;this.MaxLongitude=d}VECopyrightTableEntry.prototype.IsMatch=function(b,c,a){var d=false;if(b>=this.MinZoomLevel&&b<=this.MaxZoomLevel&&(c>=this.MinLatitude&&c<=this.MaxLatitude)&&(a>=this.MinLongitude&&a<=this.MaxLongitude))d=true;return d};function VECopyrightTable(){var b=[];b[Msn.VE.MapStyle.Oblique]=[L_MapControlImageCourtesyOfPictometry_Text,L_MapControlImageCourtesyOfBlom_Text];b[Msn.VE.MapStyle.Road]=[L_MapControlNavteq_Text,L_MapControlMapLink_Text,L_MapControlImageCourtesyOfAND_Text,L_MapControlImageCourtesyOfMapDataSciences_Text,L_MapControlImageCourtesyOfZenrin_Text,L_MapControlImageCourtesyOfIntermap_Text];b[Msn.VE.MapStyle.Aerial]=[L_MapControlImageCourtesyOfNASA_Text,L_MapControlHarrisCorp_Text,L_MapControlImageCourtesyOfUSGS_Text,L_MapControlImageCourtesyOfGetmapping_Text,L_MapControlImageCourtesyOfGeoEye_Text,L_MapControlImageCourtesyOfPasco_Text,L_MapControlImageCourtesyOfIntergraph_Text,L_MapControlImageCourtesyOfTerraItaly_Text,L_MapControlImageCourtesyOfIntermap_Text,L_MapControlImageCourtesyOfIndianaMap_Text,L_MapControlImageCourtesyOfStateOfNevada_Text,L_MapControlImageCourtesyOfInterAtlas_Text,L_MapControlImageCourtesyOfEurosense_Text,L_MapControlImageCourtesyOfIGP_Text,L_MapControlImageCourtesyOfIGN_Text,L_MapControlImageCourtesyOfBEV_Text];var a=[];a[Msn.VE.MapStyle.Oblique]=[];a[Msn.VE.MapStyle.Oblique][L_MapControlImageCourtesyOfPictometry_Text]=[];a[Msn.VE.MapStyle.Oblique][L_MapControlImageCourtesyOfBlom_Text]=[];a[Msn.VE.MapStyle.Road]=[];a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text]=[];a[Msn.VE.MapStyle.Road][L_MapControlMapLink_Text]=[];a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfAND_Text]=[];a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfMapDataSciences_Text]=[];a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfZenrin_Text]=[];a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfIntermap_Text]=[];a[Msn.VE.MapStyle.Aerial]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfNASA_Text]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlHarrisCorp_Text]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfUSGS_Text]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGetmapping_Text]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfPasco_Text]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIntergraph_Text]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfTerraItaly_Text]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIntermap_Text]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIndianaMap_Text]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfStateOfNevada_Text]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfInterAtlas_Text]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfEurosense_Text]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGP_Text]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text]=[];a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfBEV_Text]=[];a[Msn.VE.MapStyle.Oblique][L_MapControlImageCourtesyOfPictometry_Text].push(new VECopyrightTableEntry(1,20,24,-125,49,-66));a[Msn.VE.MapStyle.Oblique][L_MapControlImageCourtesyOfBlom_Text].push(new VECopyrightTableEntry(1,20,34,-13,72,35));a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(1,9,-90,-180,90,180));a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,19,16,-180,90,-50));a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,19,27,-32,40,-13));a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,19,35,-11,72,20));a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,19,21,20,72,32));a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,17,21.92,113.14,22.79,114.52));a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,17,21.73,119.7,25.65,122.39));a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,17,0,98.7,8,120.17));a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,17,.86,103.2,1.92,104.45));a[Msn.VE.MapStyle.Road][L_MapControlMapLink_Text].push(new VECopyrightTableEntry(11,19,-33.7513135626824,-73.9914824793718,5.27192072796288,-32.3781865095084));a[Msn.VE.MapStyle.Road][L_MapControlMapLink_Text].push(new VECopyrightTableEntry(11,19,-53.569335938,-73.740234375,-21.820707854,-55.042188076));a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfAND_Text].push(new VECopyrightTableEntry(10,19,-90,-180,90,180));a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfMapDataSciences_Text].push(new VECopyrightTableEntry(5,17,-45,111,-9,156));a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfMapDataSciences_Text].push(new VECopyrightTableEntry(5,17,-49.7,164.42,-30.82,180));a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfZenrin_Text].push(new VECopyrightTableEntry(4,18,23.5,122.5,46.65,151.66));a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfIntermap_Text].push(new VECopyrightTableEntry(1,21,49,-11,60,2));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfNASA_Text].push(new VECopyrightTableEntry(1,8,-90,-180,90,180));a[Msn.VE.MapStyle.Aerial][L_MapControlHarrisCorp_Text].push(new VECopyrightTableEntry(9,13,-90,-180,90,180));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfUSGS_Text].push(new VECopyrightTableEntry(14,19,17.99,-150.11,61.39,-65.57));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGetmapping_Text].push(new VECopyrightTableEntry(14,19,49.94,-6.35,58.71,1.78));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,44.43,-63.75,45.06,-63.45));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,45.39,-73.78,45.66,-73.4));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,45.2,-75.92,45.59,-75.55));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,42.95,-79.81,44.06,-79.42));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,50.35,-114.26,51.25,-113.82));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,48.96,-123.33,49.54,-122.97));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,-35.42,138.32,-34.47,139.07));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,-32.64,115.58,-32.38,115.85));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,-34.44,150.17,-33.27,151.49));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,-28.3,152.62,-26.94,153.64));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfPasco_Text].push(new VECopyrightTableEntry(14,17,23.5,122.5,46.65,151.66));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIntergraph_Text].push(new VECopyrightTableEntry(14,19,47,5,55.5,16));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfTerraItaly_Text].push(new VECopyrightTableEntry(14,21,43.15,6.5,47.15,14));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfTerraItaly_Text].push(new VECopyrightTableEntry(14,21,41.3,9.9,43.15,16.4));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfTerraItaly_Text].push(new VECopyrightTableEntry(14,21,36.5,7.9,41.3,18.7));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIntermap_Text].push(new VECopyrightTableEntry(1,21,49,-11,60,2));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIndianaMap_Text].push(new VECopyrightTableEntry(14,19,37.7,-88.2,41.9,-84.7));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfStateOfNevada_Text].push(new VECopyrightTableEntry(14,17,34.85,-120.2,42.12,-113.91));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfInterAtlas_Text].push(new VECopyrightTableEntry(14,21,48.37,1.4,49.28,3.37));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfInterAtlas_Text].push(new VECopyrightTableEntry(14,19,47.72,1.67,48.05,2.18));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfInterAtlas_Text].push(new VECopyrightTableEntry(14,19,45.55,4.57,45.95,5.33));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfInterAtlas_Text].push(new VECopyrightTableEntry(14,19,43.18,4.92,43.77,5.82));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfEurosense_Text].push(new VECopyrightTableEntry(14,19,51,3,53.63,7.67));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfEurosense_Text].push(new VECopyrightTableEntry(14,19,50.58,5.42,51,5.47));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGP_Text].push(new VECopyrightTableEntry(14,17,36.88,-9.6,42.27,-6));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push(new VECopyrightTableEntry(14,19,42,-5,51.25,8.5));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push(new VECopyrightTableEntry(14,19,41.25,8.3,43.1,9.65));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push(new VECopyrightTableEntry(14,19,17.85,-63.17,18.15,-62.77));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push(new VECopyrightTableEntry(14,19,15.75,-61.9,16.55,-60.9));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push(new VECopyrightTableEntry(14,19,14.35,-61.25,14.95,-60.75));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push(new VECopyrightTableEntry(14,19,2.25,-54.65,6,-51.4));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push(new VECopyrightTableEntry(14,19,-21.5,55,-20.75,56));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push(new VECopyrightTableEntry(14,17,46.7,-56.5,47.2,-56.1));a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfBEV_Text].push(new VECopyrightTableEntry(14,19,46.25,9.4,49.2,17.3));this.CreditsFor=function(c,k,l,j){var g=[];if(c!="undefined"&&c!=null&&typeof b[c]!="undefined"&&b[c]!=null){var m=b[c].length;for(var e=0;e<m;++e){var h=b[c][e],f=a[c][h],i=f.length;for(var d=0;d<i;++d)if(f[d].IsMatch(k,l,j)){g.push(h);break}}}return g};this.CreditsForView=function(a)
{var b=[];b.push(L_MapCopyrightMicrosoft);if(a.mapStyle==Msn.VE.MapStyle.Hybrid)
{b=b.concat(this.CreditsFor(Msn.VE.MapStyle.Road,a.zoomLevel,a.latlong.latitude,a.latlong.longitude));b=b.concat(this.CreditsFor(Msn.VE.MapStyle.Aerial,a.zoomLevel,a.latlong.latitude,a.latlong.longitude))}
else if(a.mapStyle==Msn.VE.MapStyle.ObliqueHybrid)
{b=b.concat(this.CreditsFor(Msn.VE.MapStyle.Road,a.zoomLevel,a.latlong.latitude,a.latlong.longitude));b=b.concat(this.CreditsFor(Msn.VE.MapStyle.Oblique,a.zoomLevel,a.latlong.latitude,a.latlong.longitude))}
else
b=b.concat(this.CreditsFor(a.mapStyle,a.zoomLevel,a.latlong.latitude,a.latlong.longitude));if(view3DCreated&&a.mapStyle!=Msn.VE.MapStyle.Oblique&&photoplugin3dActive)
b=b.concat(this.CreditsFor(Msn.VE.MapStyle.Oblique,a.zoomLevel,a.latlong.latitude,a.latlong.longitude));if(typeof VE_TrafficManager!=="undefined")
if(VE_TrafficManager.turnedOn){var d=false;for(var c=0;c<b.length;c++)if(b[c]==L_MapControlNavteq_Text){d=true;b.splice(c+1,0,L_MapCopyrightTraffic);break}if(!d)b.push(L_MapCopyrightTraffic)}return b}}var g_sVECopyrightTable=new VECopyrightTable;function Copyright(f){var d=document.createElement("div"),a=document.createElement("div"),c=null,b=null;this.Show=function(){f.appendChild(d);f.appendChild(a)};this.Hide=function(){try{f.removeChild(d);f.removeChild(a)}catch(b){}};this.Init=function(){d.className="MSVE_Copyright MSVE_CopyrightBackground";a.className="MSVE_Copyright MSVE_CopyrightForeground";e();this.Show()};this.Destroy=function(){this.Hide();c=null;b=null;d=a=null};function e(){var e=0;if(c&&c.style.display!=="none"){var h=parseInt(g(c).getStyle("height")),f=parseInt(c.style.bottom);e+=(isNaN(h)?0:h)+(isNaN(f)?0:f)}d.style.bottom=e+"px";a.style.bottom=e+1+"px";if(b)window.setTimeout(b.Reposition,1)}function j(){var g=g_sVECopyrightTable.CreditsForView(currentView),c="",f="";for(var b=0;b<g.length;++b){if(b>0)if(b==2)c+="\n";else c+="  ";f+="<span>"+g[b]+"</span> ";c+=g[b]}if(view3DCreated)spacecontrol.SetCopyrightString(c);d.innerHTML=f;a.innerHTML=f;e()}function i(){e()}function k(c){b=c;if(b)b.SetPinElement(a)}function h(a){c=a;e()}this.Reposition=e;this.Update=j;this.SetOffset=i;this.PinTo=k;this.SetPinElement=h}function MapEvent(f,d,e,a,c,b,g){this.view=f;this.oblique=d;this.error=e;this.requestedView=a;this.elementID=c;this.mouseButton=b;this.e=g}function CreateEvent(b,f,c,d,e,n,g,h){var a=currentView.MakeCopy();if(b!=null&&b instanceof Msn.VE.LatLong){if(Msn.VE.API!=null){var m=new VELatLongFactory(new VELatLongFactorySpecFromMapView(a));a.LatLong=m.CreateVELatLong(b.latitude,b.longitude);a.latlong=b}else a.latlong=b;if(typeof g!="undefined"&&g!=null)a.altitude=parseFloat(g);else a.altitude=0}if(f!=null&&typeof f=="number")a.zoomLevel=f;if(c==null||typeof c=="undefined")c="";var j=null;if(obliqueMode)j=obliqueMode.GetEventInfo();var i=null;if(d!=null&&d instanceof Msn.VE.MapView)i=d.MakeCopy();var k=null;if(typeof e!="undefined"&&e!=null)k=e;var l=null;if(typeof h!="undefined"&&h!=null)l=h;return new MapEvent(a,j,c,i,k,n,l)}function CreateCustomEvent(h,b,d){var a=new MapEvent;if(d)a.error=d.error;a.eventName=h;a.zoomLevel=currentView.zoomLevel;a.mapStyle=currentView.mapStyle;if(currentMode!=threeDMode){a.birdseyeSceneID=currentView.sceneId;a.birdseyeSceneOrientation=currentView.sceneOrientation;if(b){a.leftMouseButton=IsLeftMouseButton(b);a.rightMouseButton=IsRightMouseButton(b);a.middleMouseButton=IsMiddleMouseButton(b);a.mouseWheelChange=GetMouseScrollDelta(b);a.screenX=b.screenX;a.screenY=b.screenY;var e=Gimme.Screen.getMousePosition(b);a.clientX=e.x;a.clientY=e.y;var f=g(p_elSource).getPagePosition();a.mapX=a.clientX-f.x;a.mapY=a.clientY-f.y;a.keyCode=b.keyCode;a.altKey=b.altKey;a.ctrlKey=b.ctrlKey;a.shiftKey=b.shiftKey;a.elementID=null;var c=GetTarget(b);while(typeof c!="undefined"&&c!=null)if(typeof c.id!="undefined"&&c.id!=null&&c.id.indexOf(MC_IID_NAMESPACE)==0&&c.tagName!="CANVAS"){a.elementID=c.id;break}else if(typeof c.className!="undefined"&&c.className!=null&&c.className=="MSVE_MapContainer")break;else c=c.parentElement}}else if(d){if(d.view)a.latLong=d.view.LatLong;else a.latLong=null;a.elementID=d.elementID;a.leftMouseButton=d.mouseButton=="Left";a.rightMouseButton=d.mouseButton=="Right";a.middleMouseButton=d.mouseButton=="Middle";a.mouseWheelChange=0;a.keyCode=0;a.altKey=false;a.ctrlKey=false;a.shiftKey=false}return a}function AttachEvent(d,c){var a=defaultEventTable[d];if(!a){a=[];defaultEventTable[d]=a}for(var b=0;b<a.length;b++)if(a[b]==c)return true;a.push(c)}function DetachEvent(d,c){var a=defaultEventTable[d];if(!a)return;for(var b=0;b<a.length;b++)if(a[b]==c)a.splice(b,1)}function AttachCustomEvent(d,c){var a=customEventTable[d];if(!a){a=[];customEventTable[d]=a}for(var b=0;b<a.length;b++)if(a[b]==c)return true;a.push(c)}function DetachCustomEvent(d,c){var a=customEventTable[d];if(a)for(var b=0;b<a.length;b++)if(a[b]==c)a.splice(b,1)}function IsEventAttached(a){var b=customEventTable[a],c=defaultEventTable[a];return c!=null||b!=null}function Fire(b,a){FireCustomEvent(b,a);FireDefaultEvent(b,a)}function FireDefaultEvent(d,b){var a=defaultEventTable[d];if(!b)b=CreateEvent();if(a)for(var c=0;c<a.length;c++)a[c](b)}var currentShapeID=null;function FireCustomEvent(d,a){var b=false,c=customEventTable[d];if(c){if(a&&a instanceof MapEvent){var f=window.event;a=CreateCustomEvent(d,f,a)}else a=CreateCustomEvent(d,a,null);for(var e=0;e<c.length;e++)b=b|c[e](a)}return b}function DisposeAllCustomEvent(){while(customEventTable.length){var a=customEventTable.pop();while(a.length)a.pop();a=null}}function DestroyEventTable(){while(defaultEventTable.length){var a=defaultEventTable.pop();while(a.length)a.pop();a=null}defaultEventTable=null;DisposeAllCustomEvent();customEventTable=null}function KeyDown(c){if(isMinimap)return false;c=GetEvent(c);if(FireCustomEvent("onkeydown",c))return false;var e=c.ctrlKey?5:1,d=keyboardPanSpeed*e,a=panningX,b=panningY;switch(c.keyCode){case 9:case 17:case 18:if(panning&&keyboardPan)StopContinuousPan();return true;case 37:a=-d;break;case 38:b=-d;break;case 39:a=d;break;case 40:b=d;break;case 107:case 187:case 61:case 43:a=0;b=0;ZoomIn();$VE_A.Log($VE_A.PgName.Map,"Zoom in","Keyboard");break;case 109:case 189:a=0;b=0;ZoomOut();$VE_A.Log($VE_A.PgName.Map,"Zoom out","Keyboard");break;case 65:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Aerial)){a=0;b=0;SetMapStyle(aerialStyle);$VE_A.Log($VE_A.PgName.Map,"MapStyleAerial","Keyboard")}break;case 72:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid)){a=0;b=0;SetMapStyle(hybridStyle);$VE_A.Log($VE_A.PgName.Map,"MapStyleHybrid","Keyboard")}break;case 82:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Road)){a=0;b=0;SetMapStyle(roadStyle);$VE_A.Log($VE_A.PgName.Map,"MapStyleRoad","Keyboard")}break;case 66:if($MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye))if(obliqueMode&&obliqueMode.IsAvailable()){a=0;b=0;SetMapStyle(obliqueHybridStyle);$VE_A.Log($VE_A.PgName.Map,"MapStyleObliqueHybrid","Keyboard")}break;case 79:if($MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye))if(obliqueMode&&obliqueMode.IsAvailable()){a=0;b=0;SetMapStyle(obliqueStyle);$VE_A.Log($VE_A.PgName.Map,"MapStyleOblique","Keyboard")}break;case 51:case 99:if($MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)){p_this.EnableMode(Msn.VE.MapActionMode.Mode3D);$VE_A.Log($VE_A.PgName.Map,"Mode3D","Keyboard")}}if(a||b)ContinuousPan(a,b,null,true);FireDefaultEvent("onkeydown");return false}function KeyUp(a){a=GetEvent(a);if(FireCustomEvent("onkeyup",a))return false;var b=panningX,c=panningY,d=true;switch(a.keyCode){case 37:b=0;break;case 38:c=0;break;case 39:b=0;break;case 40:c=0;break;default:d=false}if(d){ContinuousPan(b,c,null,true);$VE_A.Log($VE_A.PgName.Map,"Pan","Keyboard")}if(FireCustomEvent("onkeypress",a))return false}var northLatitude=0,southLatitude=0,westLongitude=0,eastLongitude=0;function AddLine(h,f,g,l,n,m,a,d,i,k,j){if(h==null||f==null||g==null||a==null||d==null)return null;var e=[];for(var b=0;b<a.length;b++)e.push(BuildRegionHeap(a[b],0,a[b].length-1));var c=new Line;c.Init(h,f,g,l,n,m,e,d,i,k,j);lines.push(c);return c}function RemoveLine(c){for(var a=0;a<lines.length;a++){var b=lines[a];if(b.id==c){lines.splice(a,1);b.Destroy();return}}}function ClearLines(){while(lines.length>0)lines.pop().Destroy()}function ShowLines(){graphicCanvas.Clear();for(var a=0;a<lines.length;a++){lines[a].StartLine();lines[a].Show()}}function HideLines(){for(var a=0;a<lines.length;a++){lines[a].Hide();lines[a].RemoveFromMap()}}function UpdateLines(){if(typeof graphicCanvas==="object"&&graphicCanvas!==null)graphicCanvas.Clear();if(!document.all)currentView.GetMap().resetSvgLayer();for(var a=0;a<lines.length;a++)lines[a].UpdateLine()}function BuildRegionHeap(f,e,g){var h=g-e+1;if(h<1)return null;else if(h==1)return f[e];var d=null,c=null;if(h==2){d=f[e];c=f[g]}else{var i=Math.round((e+g)/2);d=BuildRegionHeap(f,e,i);c=BuildRegionHeap(f,i+1,g)}if(d!=null&&c!=null){var b=d.boundingRectangle,a=c.boundingRectangle,l=b[0].latitude>a[0].latitude?b[0].latitude:a[0].latitude,k=b[0].longitude>a[0].longitude?b[0].longitude:a[0].longitude,m=b[1].latitude<a[1].latitude?b[1].latitude:a[1].latitude,n=b[1].longitude<a[1].longitude?b[1].longitude:a[1].longitude,j=[new Msn.VE.LatLong(l,k),new Msn.VE.LatLong(m,n)];return new Msn.VE.LineRegion(j,null,[d,c])}else if(d!=null)return d;else if(c!=null)return c;return null}var IsDrivingEventAttached=false;function Line(){var t=5,v=new Msn.Drawing.Color(0,169,235,.7),w="Solid",d=new Msn.Drawing.Stroke,H=4,c=null,e="",f=true,A="",i="",r=0,y=0,x=0,B=0,z=0,a=null,b=null,h=null,g=null,I=0,J=0,n=false;function F(m,u,C,c,j,k,p,s,l,f,o){if(!c)c=t;if(!j)j=v;if(!k)k=defaultZIndex;if(!f)f=w;n=o;this.id=m;e=m;if(l)d.linejoin=l;A=c+"pt";i=j;r=k;a=u;b=C;g=s;h=p;y=a[0];x=b[0];B=a[a.length-1];z=b[b.length-1];d.color=i;d.width=c;d.linecap=f;q();if(!IsDrivingEventAttached){AttachEvent("onstartzoom",HideLines);AttachEvent("onchangeview",UpdateLines);IsDrivingEventAttached=true}this._Draw3D();AttachEvent("oninitmode",this._Draw3D)}function E(){if(view3DCreated)spacecontrol.DeleteGeometry(0,e);DetachEvent("oninitmode",this._Draw3D);m();a=b=h=c=null}this._Draw3D=function(){if(view3DCreated){var c=[];for(var f=0;f<a.length;f++){c.push(b[f]);c.push(",");c.push(a[f]);if(f!=a.length-1)c.push(" ")}var g=c.join("");spacecontrol.AddPolyline("0",e,g,i.ToHexString(),.75,d.width)}};function m(){if(graphicCanvas)graphicCanvas.Clear()}function G(){if(!f){j();return}if(c)c.style.display="block"}function j(){if(c)c.style.display="none"}function u(a){f=a;if(!f)j()}function q(){l();o()}function D(){l();o()}function l(){var a=height<900?900:height,b=width<900?900:width;northLatitude=GetLatitude(-0.5*a);southLatitude=GetLatitude(1.5*a);westLongitude=GetLongitude(-0.5*b);eastLongitude=GetLongitude(1.5*b)}function o(){if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)){graphicCanvas.Clear();return}if(view3DCreated)return;var b=[],a=g.length-1;while(g[a]<currentView.zoomLevel&&a>=0)a--;k(h[a],b);C(b)}function k(f,c){if(s(f.boundingRectangle[0],f.boundingRectangle[1]))return;if(f.childRegions!=null)for(var j=0;j<f.childRegions.length;j++)k(f.childRegions[j],c);else{var h=f.indices,e=new Msn.VE.LatLong(a[h[0]],b[h[0]]),d,g=false;if(p(e.latitude,e.longitude)){c.push(e.longitude);c.push(e.latitude);g=true}for(var i=1;i<h.length;i++){d=new Msn.VE.LatLong(a[h[i]],b[h[i]]);if(p(d.latitude,d.longitude)){if(!g){c.push(e.longitude);c.push(e.latitude)}g=true;c.push(d.longitude);c.push(d.latitude)}else if(g){g=false;c.push(d.longitude);c.push(d.latitude)}e=d}}}function C(g){if(!graphicCanvas)return;var a=new Msn.Drawing.PolyLine(g);a.id=e;var b=VE_LatLongThreshold.UseThreshold;VE_LatLongThreshold.UseThreshold=false;graphicCanvas.SetZIndex(r);graphicCanvas.SetStroke(d);graphicCanvas.DrawPrimitive(a,n);VE_LatLongThreshold.UseThreshold=b;c=$ID(e);if(f)c.style.display="block";else c.style.display="none"}function p(a,b){return a>=southLatitude&&a<=northLatitude&&b>=westLongitude&&b<=eastLongitude}function s(a,b){return a.latitude>northLatitude&&b.latitude>northLatitude||a.latitude<southLatitude&&b.latitude<southLatitude||a.longitude>eastLongitude&&b.longitude>eastLongitude||a.longitude<westLongitude&&b.longitude<westLongitude}this.Init=F;this.Destroy=E;this.RemoveFromMap=m;this.Show=G;this.Hide=j;this.ChangeVisibility=u;this.StartLine=q;this.UpdateLine=D}function Logo(b){var a=null;this.Init=function(){if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1){a=document.createElement("div");a.className="MSVE_PoweredByLogo MSVE_PoweredByLogo_ie";if(Msn.VE.API!=null)a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+"/"+MapControl.Features.Image.PoweredLogo+"', sizingMethod='scale')"}else{a=document.createElement("img");a.src=this.GetURL();a.className="MSVE_PoweredByLogo"}b.appendChild(a)};this.GetURL=function(){var b="http://"+location.host+location.pathname,a="";if(Msn.VE.API!=null){b=Msn.VE.API.Globals.vecurrentdomain+"/";a=Msn.VE.API.Globals.vecurrentversion}else a=window.buildVersion;return b+"i/bin/"+a+"/"+MapControl.Features.Image.PoweredLogo};this.Destroy=function(){b.removeChild(a);a=null}}var hijackMouseMove=false,hijackMouseCursor=false,isLastButtonMiddle=false;function MouseDown(a){a=GetEvent(a);CancelEvent(a);if(currentMode!=threeDMode&&FireCustomEvent("onmousedown",a))return false;if(zooming)return false;if(panning)StopContinuousPan();if(obliqueMode)obliqueMode.CancelRequest();if(!mouseZoomDisabled)if(a.which&&a.which==2)currentTool=boxTool;else if(!a.which&&a.button&&a.button==4)currentTool=boxTool;else if(a.ctrlKey|a.altKey)currentTool=boxTool;if(!document.all&&!isEnablingDefaultDblClick)isEnablingDefaultDblClick=true;dragging=true;var b=typeof a.which!="undefined"?a.which:a.button;if(!hijackMouseMove&&!hijackMouseCursor&&b==1)p_this.SetCursor(cssCursors.Grabbing);if(currentTool)currentTool.OnMouseDown(a);return false}var lastmouseX=0,lastmouseY=0;function MouseMove(a){a=GetEvent(a);var b=Gimme.Screen.getMousePosition(a);lastmouseX=b.x;lastmouseY=b.y;if(currentMode!=threeDMode&&FireCustomEvent("onmousemove",a))return false;if(hijackMouseMove){a=GetEvent(a);CancelEvent(a);var c=g(p_elSource).getPagePosition();x=c.x;y=c.y;var e=originX+offsetX+lastmouseX-x,f=originY+offsetY+lastmouseY-y,d=CreateEvent(currentMode.PixelToLatLong(new VEPixel(e,f),currentView.zoomLevel));FireDefaultEvent("onmousemove",d);return}if(currentTool&&dragging)currentTool.OnMouseMove(a);return false}function MouseUp(a){a=GetEvent(a);CancelEvent(a);if(a)isLastButtonMiddle=IsMiddleMouseButton(a);if(currentMode!=threeDMode&&FireCustomEvent("onmouseup",a))return false;dragging=false;if(!hijackMouseMove&&!hijackMouseCursor)p_this.SetCursor(cssCursors.Grab);var b;if(currentTool)b=currentTool.OnMouseUp(a);if(targetTool&&targetTool.isOutOfBounds())targetTool.OnMouseUp(a);var c=true;if(typeof b!="undefined"&&b.view!=null){isEnablingDefaultDblClick=b.view.disableDbClick!=true;c=b.view.disableMapFocus!=true}else isEnablingDefaultDblClick=true;currentTool=panTool;try{if(c)keyboard.focus()}catch(d){}return false}function IsOnscreen(c,d){var b=tileSize*Math.pow(2,currentView.zoomLevel),a=originX+offsetX+c-x;if(a<0||a>b)return false;a=originY+offsetY+d-y;if(a<0||a>b)return false;return true}var isEnablingDefaultDblClick=true;function MouseDoubleClick(a){a=GetEvent(a);CancelEvent(a);var b=Gimme.Screen.getMousePosition(a);if(currentMode!=threeDMode&&FireCustomEvent("ondoubleclick",a))return false;if(hijackMouseMove)return false;if(isEnablingDefaultDblClick){UpdateFromParent();if(panning||zooming||mouseZoomDisabled)return false;if(!IsMapViewOblique()&&!IsOnscreen(b.x,b.y))return false;var c=preferredView.MakeCopy();c.SetCenter(new VEPixel(originX+offsetX+b.x-x-mapCenterOffset.x,originY+offsetY+b.y-y-mapCenterOffset.y));if(a.ctrlKey|a.altKey){c.SetZoomLevel(currentView.zoomLevel-1);$VE_A.Log($VE_A.PgName.Map,"Zoom out","Mouse")}else{c.SetZoomLevel(currentView.zoomLevel+1);$VE_A.Log($VE_A.PgName.Map,"Zoom in","Mouse")}SetView(c);return false}else isEnablingDefausltDblClick=true}function MouseWheel(a){a=GetEvent(a);CancelEvent(a);if(currentMode!=threeDMode&&FireCustomEvent("onmousewheel",a))return false;if(currentMode!=null&&currentMode==threeDMode)return false;if(panning||zooming||mouseZoomDisabled)return false;var g=GetMouseScrollDelta(a);if(g===0)return false;var c=g>0;if(mousewheelZoomToCenter||IsMapViewOblique()||!IsOnscreen(lastmouseX,lastmouseY))if(c){ZoomIn();$VE_A.Log($VE_A.PgName.Map,"Zoom in","Mouse")}else{ZoomOut();$VE_A.Log($VE_A.PgName.Map,"Zoom out","Mouse")}else{var b=c?currentView.zoomLevel+1:currentView.zoomLevel-1;if(b<=GetCurrentViewMaxZoomLevel(currentView)){UpdateFromParent();var h=lastmouseX-x,i=lastmouseY-y,e=originX+offsetX+h,f=originY+offsetY+i,d=preferredView.MakeCopy();e=currentView.ScaleCoord(e,b);f=currentView.ScaleCoord(f,b);d.SetZoomLevel(b);if(c)$VE_A.Log($VE_A.PgName.Map,"Zoom in","Mouse");else $VE_A.Log($VE_A.PgName.Map,"Zoom out","Mouse");d.SetCenter(new VEPixel(e-h+width/2,f-i+height/2));SetView(d)}}return false}
function ContextMenu(a){if(mouseZoomDisabled)return false;a=GetEvent(a);CancelEvent(a);if(currentMode!=threeDMode&&FireCustomEvent("onclick",a))return false;var e=g(p_elSource).getPagePosition();x=e.x;y=e.y;var c,d,b=Gimme.Screen.getMousePosition(a);if(currentMode==threeDMode){c=b.x-x;d=b.y-y}else{c=originX+offsetX+b.x-x;d=originY+offsetY+b.y-y}var f=currentMode.PixelToLatLong(new VEPixel(c,d),currentView.zoomLevel);if(f!=null){if(currentMode==threeDMode&&Get3DControl().UIHasFocus())return false;var h=CreateEvent(f);MostrarMenuContexto(h);}return false}function MouseClick(a){a=GetEvent(a);CancelEvent(a);if(!isLastButtonMiddle)if(currentMode!=threeDMode&&FireCustomEvent("onclick",a))return false}function MouseOut(a){a=GetEvent(a);if(currentMode!=threeDMode&&g(GetTarget(a)).hasClass("MSVE_Shape")&&FireCustomEvent("onmouseout",a)){CancelEvent(a);return false}}function MouseOver(a){a=GetEvent(a);if(currentMode!=threeDMode&&g(GetTarget(a)).hasClass("MSVE_Shape")&&FireCustomEvent("onmouseover",a)){CancelEvent(a);return false}}function MouseEnter(a){a=GetEvent(a);var b=a.relatedTarget||a.fromElement;if(currentMode!=threeDMode&&b!=null&&FireCustomEvent("onmouseover",a)){CancelEvent(a);return false}if(!hijackMouseMove&&!hijackMouseCursor)p_this.SetCursor(cssCursors.Grab)}function MouseLeave(a){a=GetEvent(a);if(currentMode!=threeDMode&&FireCustomEvent("onmouseout",a)){CancelEvent(a);return false}}var obliqueLoop=0;function PanMap(c,d){if(c==0&&d==0||isNaN(c)||isNaN(d))return false;if(currentMode!=threeDMode){var a=ShiftView(currentView,currentBounds,c,d);if(typeof a!="undefined"&&a!=null){var f=g(map).getComputedPosition(),e=f.x-a.x,h=f.y-a.y;map.style.left=e+"px";map.style.top=h+"px";offsetX=-e;offsetY=-h;var b=new VEPixel(width/2+originX+offsetX,height/2+originY+offsetY);if(keyboardPan&&(c!=0&&a.x==0||d!=0&&a.y==0)){if(typeof currentMode.RequestPending!="undefined"&&!currentMode.RequestPending()){b.x+=c;b.y+=d;var i=PixelToLatLong(b);targetTool.centeringTrigger=true;SetCenter(i.latitude,i.longitude)}}else{currentView.SetCenter(b);preferredView.SetCenter(new VEPixel(b.x,b.y));tileLayerManager.PanView()}Fire("onpan")}}else return false;if(copyright)copyright.Update();return true}function ContinuousPan(a,b,c,d){if(zooming)return;if(!c)c=-1;panningX=a;panningY=b;panCounter=c;if(!a&&!b){StopContinuousPan();return}keyboardPan=d;if(view3DCreated){spacecontrol.ContinuousPan(a,b);Fire("onstartpan")}else if(!panning){panning=true;StepPan();Fire("onstartpan")}}function StepPan(){if(panning){PanMap(panningX,panningY);if(panCounter>0)panCounter--;if(panCounter!=0)window.setTimeout(StepPan,10);else StopContinuousPan()}}function StopContinuousPan(){panningX=0;panningY=0;panning=false;keyboardPan=false;if(currentMode!=threeDMode)if(panLatitude!=null&&panLongitude!=null){var b=new Msn.VE.LatLong(panLatitude,panLongitude),a=LatLongToPixel(b),c=a.x-width/2,d=a.y-height/2;PanMap(c,d);currentView.latlong.latitude=panLatitude;currentView.latlong.longitude=panLongitude;preferredView.Copy(currentView);panLatitude=null;panLongitude=null;if(obliqueMode)obliqueMode.UpdateAvailability()}else ComputeCenterPoint(true);else if(view3DCreated)spacecontrol.ContinuousPan(0,0);Fire("onendpan");Fire("onchangeview");if(resizeInProgress)resizeInProgress=false}function PanToLatLong(b,a,c){if(currentMode==threeDMode)SetCenter(b,a);else{panLatitude=b;panLongitude=a;if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)&&PanInOblique(new Msn.VE.LatLong(b,a),null,c));else PanToPixel(LatLongToPixel(new Msn.VE.LatLong(b,a)),c)}}function PanByPixel(a,b){a.x=width/2+a.x;a.y=height/2+a.y;PanToPixel(a,b)}function PanToView(a){var b=a.center.x-(originX+offsetX),c=a.center.y-(originY+offsetY);PanToPixel(new VEPixel(b,c))}function PanToPixel(c,e){if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)&&PanInOblique(null,c,e))return;var a=c.x-width/2,b=c.y-height/2,d=Math.sqrt(a*a+b*b);if(!e&&(!IsAnimationEnabled()||MathAbs(a)>2*width||MathAbs(b)>2*height||d>1.5*Math.sqrt(width*width+height*height))){var i=preferredView.MakeCopy(),j=c.x+(originX+offsetX),k=c.y+(originY+offsetY);i.SetCenter(new VEPixel(j,k));SetView(i);if(resizeInProgress)resizeInProgress=false;return}var f=Math.atan2(b,a),g=MathCeil(d/panToLatLongSpeed),h=MathRound(d/g);a=MathRound(Math.cos(f)*h);b=MathRound(Math.sin(f)*h);ContinuousPan(a,b,g)}function PanInOblique(a,d){obliqueLoop++;if(obliqueLoop>30){obliqueLoop=0;return false}var c=obliqueMode.GetScene();if(!a)a=PixelToLatLong(d);if(!c||!c.ContainsLatLong(a,currentView.zoomLevel)){var b=preferredView.MakeCopy();b.sceneId=null;b.SetCenterLatLong(a);SetView(b);if(resizeInProgress)resizeInProgress=false;return true}else return false}function PushPinOffset(a,b){this.x=a;this.y=b}function getPushPinOffset(c){var a=Msn.VE.PushPinTypes,b;switch(c){case a.Annotation:b=new PushPinOffset(-2,-29/2-5);break;case a.Overlay:case a.SearchResultPrecise:case a.SearchResultNonprecise:case a.AdSponsor:b=new PushPinOffset(0,-29/2+3);break;case a.Direction:b=new PushPinOffset(-3,-26/2-3);break;case a.DirectionTemp:b=new PushPinOffset(2,-26/2+3);break;case a.TrafficLight:b=new PushPinOffset(0,-26/2);break;case a.TrafficOthers:b=new PushPinOffset(0,-29/2);break;case a.YouAreHere:b=new PushPinOffset(0,-26/2);break;case a.AdStandard:b=new PushPinOffset(0,-42/2+2);break;case a.AdWide:b=new PushPinOffset(0,-27/2);break;case a.AdCategory:b=new PushPinOffset(0,-16/2);break;case a.Default:default:b=new PushPinOffset(0,0)}return b}function GetPushpins(){return pushpins}function AddPushpin(m,k,l,j,h,e,f,i,g,b,c,d){var a=new Pushpin;a.Init(m,k,l,j,h,e,f,i,g,d);if(typeof b=="undefined"||b==false||b==null){if(IsModeEnabled(Msn.VE.MapActionMode.Mode3D)){if(!(typeof c!="undefined"&&c==false))View3DAddPushpin(a);map.appendChild(a.pin);a.Hide()}else map.appendChild(a.pin);pushpins.push(a)}return a.pin}function GetPushpinIndex(b){for(var a=0;a<pushpins.length;a++)if(pushpins[a].id==b)return a;return-1}function RemovePushpin(b){var a=GetPushpinIndex(b);if(a>=0){var c=pushpins[a];pushpins.splice(a,1);if(IsModeEnabled(Msn.VE.MapActionMode.Mode3D))View3DRemovePushpin(b);c.Destroy()}}function ClearPushpins(){while(pushpins.length>0){var a=pushpins.pop();if(IsModeEnabled(Msn.VE.MapActionMode.Mode3D))View3DRemovePushpin(a.id);a.Destroy()}}function Relay3DPushpins(){for(var b=0;b<pushpins.length;b++){var a=pushpins[b];if(a.id&&a.id.constructor==String&&a.id.indexOf("Layer")==-1)View3DAddPushpin(a)}}function NeedToPlaceAccurately(a){switch(a.pinType){case Msn.VE.PushPinTypes.SearchResultPrecise:case Msn.VE.PushPinTypes.AdStandard:case Msn.VE.PushPinTypes.AdCategory:case Msn.VE.PushPinTypes.AdWide:case Msn.VE.PushPinTypes.AdSponsor:return true;default:return false}}function _RepositionPushpins(){for(var a=0;a<pushpins.length;a++){pushpins[a].pin.style.display="";pushpins[a].Reposition()}}function RepositionPushpins(){var d=[],h,i=function(b){if(currentMode!=obliqueMode||null==currentMode.GetScene()||h!=currentMode.GetScene().GetID())return;if(b)for(var a=0;a<d.length;a++){var c=GetPushpinIndex(d[a]);if(c>=0)if(b[a])pushpins[c].SetAccuratePixel(b[a])}_RepositionPushpins()};if(pushpins&&pushpins.length>0){if(null==Msn.VE.API&&currentMode==obliqueMode){var c=currentMode.GetScene(),f=[],a=0;if(c){h=c.GetID();for(var e=0;e<pushpins.length;e++){var b=pushpins[e],g=new Msn.VE.LatLong(b.GetLatitude(),b.GetLongitude());if(NeedToPlaceAccurately(b)&&c.ContainsLatLong(g)){f[a]=g;d[a]=b.id;a++}}if(a>0){currentMode.LatLongToPixelAsync(f,currentView.GetZoomLevel(),i);return}}}_RepositionPushpins()}}function HidePins(){for(var a=0;a<pushpins.length;a++)pushpins[a].Hide()}function UnHidePins(){for(var a=0;a<pushpins.length;a++)pushpins[a].UnHide()}function GetPushpinPixel(b,c,d,e){var a=currentMode.LatLongToPixel(b,c);if(a){a.x=MathRound(a.x-d);a.y=MathRound(a.y-e)}return a}function GetPushpinMapPixel(a,b){return GetPushpinPixel(a,b,originX,originY)}function Pushpin(){var a=this;this.visible=true;this.pin=document.createElement("a");this.img=document.createElement("img");this.img.className="VE_PushpinImage";this.pin.href="javascript://pushin hover";this.pin.onclick=function(){return ParseShiftKeyForLinks(event)};this.pin.vePushpin=this;this.x1=0;this.y1=0;this.x2=0;this.y2=0;this.center=null;this.w=0;this.h=0;this.n=zoomTotalSteps+1;this.xs=new Array(this.n);this.ys=new Array(this.n);this.Offset=0;this.beLatLongOffset=null;this.Destroy=function(){a.RemoveFromMap();a.pin.onclick=null;a.pin.vePushpin=null;a.pin=null;while(a.xs.length>0)a.xs.pop();while(a.ys.length>0)a.ys.pop();a=null}}Pushpin.prototype.Init=function(i,g,h,f,e,c,d,j,a,b){this.id=i;this.lat=g;this.lon=h;this.width=f;this.height=e;this.className=c;this.innerHtml=d;this.zIndex=j;this.pinType=a;this.pin.id=i;this.pin.className=c;this.pin.style.position="absolute";this.pin.innerHTML=d;this.pin.pinType=a||Msn.VE.PushPinTypes.Default;this.Offset=getPushPinOffset(this.pin.pinType);if(a==Msn.VE.PushPinTypes.SearchResultPrecise){this.img.src=GetUrlPrefix()+"i/bin/"+window.buildVersion+"/pins/poi_search.gif";this.pin.appendChild(this.img)}else if(a==Msn.VE.PushPinTypes.SearchResultNonprecise){this.img.src=GetUrlPrefix()+"i/bin/"+window.buildVersion+"/pins/poi_search_nonprecise.gif";this.pin.appendChild(this.img)}else if(a==Msn.VE.PushPinTypes.AdSponsor){this.img.src=GetUrlPrefix()+"i/bin/"+window.buildVersion+"/pins/poi_search.gif";this.pin.appendChild(this.img)}this.pin.unselectable="on";this.center=new Msn.VE.LatLong(g,h);this.w=f;this.h=e;if(b)this.SetAccuratePixel(b);var k=this.LatLongToPixelWithAccuracyOffset(currentView.zoomLevel,originX,originY);this.SetPixelLocation(k)};Pushpin.prototype.SetAccuratePixel=function(b){var a=currentMode.PixelToLatLong(b,currentView.zoomLevel);this.beLatLongOffset=new Msn.VE.LatLong(a.latitude-this.center.latitude,a.longitude-this.center.longitude)};Pushpin.prototype.LatLongToPixelWithAccuracyOffset=function(b,c,d){var a=this.center;if(this.beLatLongOffset&&IsMapViewOblique())a=new Msn.VE.LatLong(this.center.latitude+this.beLatLongOffset.latitude,this.center.longitude+this.beLatLongOffset.longitude);return GetPushpinPixel(a,b,c,d)};Pushpin.prototype.GetLatitude=function(){return this.center.latitude};Pushpin.prototype.GetLongitude=function(){return this.center.longitude};Pushpin.prototype.ClearSteps=function(){var b=zoomTotalSteps;for(var a=0;a<=b;a++){this.xs[a]=this.x1-this.w/2+this.Offset.x+"px";this.ys[a]=this.y1-this.h/2+this.Offset.y+"px"}};Pushpin.prototype.PrecomputeSteps=function(){var d=zoomTotalSteps;for(var a=0;a<=d;a++){var b=a/d,c=1-b;this.xs[a]=MathFloor(c*this.x1+b*this.x2-this.w/2+this.Offset.x)+"px";this.ys[a]=MathFloor(c*this.y1+b*this.y2-this.h/2+this.Offset.y)+"px"}};Pushpin.prototype.SetFactor=function(a){this.pin.style.left=this.xs[a];this.pin.style.top=this.ys[a]};Pushpin.prototype.SetPixelLocation=function(a){if(a&&this.visible){this.x1=a.x;this.y1=a.y;this.x2=this.x1;this.y2=this.y1;this.PrecomputeSteps();this.SetFactor(0);this.pin.style.display="block"}else this.pin.style.display="none"};Pushpin.prototype.SwapStates=function(){var a=0;a=this.x1;this.x1=this.x2;this.x2=a;a=this.y1;this.y1=this.y2;this.y2=a};Pushpin.prototype.Reposition=function(){var a=this.LatLongToPixelWithAccuracyOffset(currentView.zoomLevel,originX,originY);if(a){this.x1=a.x;this.y1=a.y;this.ClearSteps();this.SetFactor(0);if(this.pin.style.display!="none"&&this.visible)this.pin.style.display="block"}else this.pin.style.display="none"};Pushpin.prototype.UnHide=function(){if(!this.visible){this.pin.style.display="block";this.visible=true}};Pushpin.prototype.Hide=function(){if(this.visible){this.pin.style.display="none";this.visible=false}};Pushpin.prototype.UnHide3D=function(){if(IsModeEnabled(Msn.VE.MapActionMode.Mode3D))View3DAddPushpin(this)};Pushpin.prototype.Hide3D=function(){if(IsModeEnabled(Msn.VE.MapActionMode.Mode3D))View3DRemovePushpin(this.id)};Pushpin.prototype.PrepareForZoom=function(b,c,d){this.x1-=offsetX;this.y1-=offsetY;var a=this.LatLongToPixelWithAccuracyOffset(d,b,c);if(a){this.x2=a.x;this.y2=a.y;this.PrecomputeSteps();if(this.pin.style.display!="none"&&this.visible)this.pin.style.display="block"}else this.pin.style.display="none"};Pushpin.prototype.RemoveFromMap=function(){if(this.pin.parentNode==map)map.removeChild(this.pin)};Pushpin.prototype.Move=function(a){this.MoveToLatLon(PixelToLatLong(a))};Pushpin.prototype.MoveToLatLon=function(a){this.center=a;this.Reposition()};function ScaleBar(c){var e=null,j=null,a=g(document.createElement("div")),b=g(document.createElement("div")),m=false,d=document.createElement("div"),f=document.createElement("div"),i=150;this.Init=function(){a.addClass("MSVE_ScaleBarLabel MSVE_ScaleBarLabelBg");b.addClass("MSVE_ScaleBarLabel MSVE_ScaleBarLabelFg");d.className="MSVE_ScaleBar MSVE_ScaleBarBg";f.className="MSVE_ScaleBar MSVE_ScaleBarFg";n();k();c.appendChild(a.element());c.appendChild(b.element());c.appendChild(d);c.appendChild(f)};this.Destroy=function(){c.removeChild(a.element());c.removeChild(b.element());c.removeChild(d);c.removeChild(f);e=null;a=b=d=BarFg=null};function k(){var c=0;if(e&&e.style.display!=="none"){var i=parseInt(g(e).getStyle("height")),h=parseInt(e.style.bottom);c+=(isNaN(i)?0:i)+(isNaN(h)?0:h)}if(a){a.setStyle("bottom",c+"px");b.setStyle("bottom",1+c+"px")}if(d){d.style.bottom=c+"px";f.style.bottom=1+c+"px"}}function o(a){return a*.001}function q(a){return a*.000621371192}function r(a){return a*1.0936133}function t(a){i=a}function p(a){j=a}function n(){try{var f=GetMetersPerPixel(),c=f*i,e;if(j==null)e=$MVEM.IsEnabled(MapControl.Features.ScaleBarKilometers);else e=j==Msn.VE.DistanceUnit.Kilometers;if(e){var d=L_ScaleBarKilometers_Text,b=o(c),a=h(b);if(a<.5){d=L_ScaleBarMeters_Text;b=c;a=h(b)}l("metric",d,a,Math.round(a/b*i))}else{var d=L_ScaleBarMiles_Text,b=q(c),a=h(b);if(a<.5){d=L_ScaleBarYards_Text;b=r(c);a=h(b)}l("us",d,a,Math.round(a/b*i))}}catch(g){}}function h(d){var g=Math.log(d)/Math.log(10),e=Math.floor(g),a=Math.pow(10,e),c=d/a,b=Math.floor(c);if(b>=3)return b*a;var f=Math.floor(c*2)*.5;return f*a}function l(j,i,c,g){if(c<1)c=c.toFixed(1);var e=GetMapStyle()!=roadStyle;if(e!=m){if(e){a.swapClass("MSVE_ScaleBarLabelBg","MSVE_ScaleBarLabelBgInv");b.swapClass("MSVE_ScaleBarLabelFg","MSVE_ScaleBarLabelFgInv")}else{a.swapClass("MSVE_ScaleBarLabelBgInv","MSVE_ScaleBarLabelBg");b.swapClass("MSVE_ScaleBarLabelFgInv","MSVE_ScaleBarLabelFg")}m=e}var h=c+" "+i;a.setHTML(h);b.setHTML(h);d.style.width=4+g+"px";f.style.width=g+"px"}function s(a){e=a;k()}this.SetBarWidth=t;this.SetDistanceUnit=p;this.Update=n;this.Reposition=k;this.SetPinElement=s}function MapLegend(h){var q=this,f=h,a=null,e=null,b=null,d=null,c=null;h=null;this.Init=function(){a=document.createElement("div");a.id="MSVE_MapLegend";a.style.display="none";f.appendChild(a);e=document.createElement("div");e.className="MSVE_LegendGroup";a.appendChild(e);a.attachEvent("onmousedown",IgnoreEvent);a.attachEvent("onmouseup",IgnoreEvent);a.attachEvent("onmousemove",IgnoreEvent);a.attachEvent("onmousewheel",IgnoreEvent);a.attachEvent("ondblclick",IgnoreEvent);a.attachEvent("oncontextmenu",IgnoreEvent);a.attachEvent("onkeydown",IgnoreEvent);a.attachEvent("onkeyup",IgnoreEvent)};this.Destroy=function(){if(a){a.detachEvent("onmousedown",IgnoreEvent);a.detachEvent("onmouseup",IgnoreEvent);a.detachEvent("onmousemove",IgnoreEvent);a.detachEvent("onmousewheel",IgnoreEvent);a.detachEvent("ondblclick",IgnoreEvent);a.detachEvent("oncontextmenu",IgnoreEvent);a.detachEvent("onkeydown",IgnoreEvent);a.detachEvent("onkeyup",IgnoreEvent);f.removeChild(a);a=null}f=null;e=null;d=null;c=null};function k(d){if(d&&!b)i();a.style.display=d?"":"none";if(c)window.setTimeout(c.Reposition,1);g()}function i(){if(e&&!b){b=document.createElement("div");b.className="MSVE_LegendGroup";b.id="MSVE_TrafficLegend";e.appendChild(b);var a=document.createElement("span");a.id="MSVE_TL_Slow";a.appendChild(document.createTextNode(L_MapLegendTrafficSlow_Text));b.appendChild(a);a=document.createElement("span");a.id="MSVE_TL_Fast";a.appendChild(document.createTextNode(L_MapLegendTrafficFast_Text));b.appendChild(a);a=document.createElement("img");a.id="MSVE_TL_Key";var c=GetUrlPrefix(),f=window.buildVersion;if(Msn.VE.API!=null){c=Msn.VE.API.Globals.vecurrentdomain+"/";f=Msn.VE.API.Globals.vecurrentversion}a.src=c+"i/bin/"+f+"/traffic/tf_legend.gif";a.alt="";b.appendChild(a);d=document.createElement("div");d.className="MSVE_LegendGroup";d.id="MSVE_TrafficMsg";e.appendChild(d)}}function l(a){while(a.hasChildNodes())a.removeChild(a.childNodes[0])}function j(a){if(d){l(d);d.appendChild(document.createTextNode(a));g()}}function o(b){c=b;if(c)c.SetPinElement(a)}function p(){if(c){c.SetPinElement(null);c=null}}function n(b,c){if(a){a.style.left=b+"px";a.style.top=c+"px";a.style.bottom="auto";a.style.right="auto"}}function g(){if(a)mvcViewFacade.UpdateShimIfSupported(a)}function m(){if(a)destroyIFrameShim(a.id)}this.ShowTrafficLegend=k;this.SetTrafficLegendMsg=j;this.UnPin=p;this.PinTo=o;this.MoveTo=n;this.UpdateShim=g;this.RemoveShim=m}var totalRequestTime=0,totalRequestCount=0,totalFailureCount=0,responseRangeCeilings=[];responseRangeCeilings[roadStyle]=[325,975];responseRangeCeilings[shadedStyle]=responseRangeCeilings[roadStyle];responseRangeCeilings[aerialStyle]=[350,1050];responseRangeCeilings[hybridStyle]=[425,1275];responseRangeCeilings[obliqueStyle]=[450,1350];responseRangeCeilings[obliqueHybridStyle]=responseRangeCeilings[obliqueStyle];var responseRangeCounts=[0,0,0];function RequestTile(b,c,i,h,d,g,e,f){var a=new Tile;a.Init(b,c,i,h,b*tileSize-originX,c*tileSize-originY,d,g,e,f);return a}function ClearTiles(a){while(a.length>0){var b=a.pop();b.Destroy();b=null}}function GetResponseRangeCounts(){var b=0;for(var a=0;a<responseRangeCounts.length;a++)b+=responseRangeCounts[a];if(b==0)return responseRangeCounts;var c=new Array(responseRangeCounts.length);for(var a=0;a<responseRangeCounts.length;a++)c[a]=responseRangeCounts[a]/b;return c}function ResetResponseRangeCounts(){for(var a=0;a<responseRangeCounts.length;a++)responseRangeCounts[a]=0}function GetFailureRate(){return totalFailureCount/totalRequestCount}function Tile(){var a=null,b=null,c=null,i=null,D=null,e=null,p=0,q=0,v=0,B=0,f=0,d=1,x=zoomTotalSteps+1,m=new Array(x),o=new Array(x),u=new Array(x),s=new Array(x),A=false,g=0,h=0,k=0,j=0,l=0,n=0,t=0,r=0,z=null,C=0;this.Init=function(k,l,m,j,c,e,g,a,h,i){p=k;q=l;v=m;B=j;f=i;d=h;if(!currentMode.IsValidTile(p,q,v))return;y(c,e,tileSize,tileSize);I(c,e,tileSize,tileSize);w();if(a==mapTiles||a==trafficTiles)C=0;else C=1;b=document.createElement("img");b.className="MSVE_ImageTile";b.onload=T;b.onerror=S;z=new Date;D=currentMode.GetFilename(p,q,v,g,a);b.src=D};function H(){if(!e&&a!=null)e=graphicCanvas.AddPrintTile(D,q*tileSize-originY,p*tileSize-originX,tileSize,tileSize,d,f)}this.AddPrintTile=H;function O(){if(e){graphicCanvas.RemovePrintTile(e);e=null}}this.RemovePrintTile=O;function L(){if(e)graphicCanvas.RePositionPrintTile(e,q*tileSize-originY,p*tileSize-originX)}this.RePositionPrintTile=L;this.Destroy=function(){if(a)a.onmousedown=null;G();while(m.length>0)m.pop();while(o.length>0)o.pop();while(u.length>0)u.pop();while(s.length>0)s.pop();m=o=u=s=null};function y(c,d,b,a){g=c;h=d;k=b;j=a}this.SetCurrentState=y;function I(c,d,b,a){l=c;n=d;t=b;r=a}this.SetNextState=I;function Q(){for(var a=0;a<=zoomTotalSteps;a++){m[a]=g+"px";o[a]=h+"px";u[a]=k+"px";s[a]=j+"px"}}this.ClearSteps=Q;function w(){for(var a=0;a<=zoomTotalSteps;a++){var b=a/zoomTotalSteps,c=1-b;m[a]=MathFloor(c*g+b*l)+"px";o[a]=MathFloor(c*h+b*n)+"px";u[a]=MathCeil(c*k+b*t)+"px";s[a]=MathCeil(c*j+b*r)+"px"}}this.PrecomputeSteps=w;function K(e){if(a==null||zooming&&!A)return;var b=a.style;b.left=m[e];b.top=o[e];b.width=u[e];b.height=s[e];if(debug&&e==0){if(!c)F();var g=c.style;b.border="1px dashed red";g.left=m[e];g.top=o[e]}if(a.parentNode!=map){b.position="absolute";b.zIndex=f;if(C>0)if(b&&typeof b.filter!="undefined")if(Msn.VE.Environment.BrowserInfo.MajorVersion<=6){if(!i){i=document.createElement("div");i.className="MSVE_ImageTile";var b=i.style;b.left=m[e];b.top=o[e];b.width=u[e];b.height=s[e];b.position="absolute";b.zIndex=f;if(d!=1)b.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a.src+"',sizingMethod='scale'), alpha(opacity="+d*100+")";else b.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a.src+"',sizingMethod='scale')";map.appendChild(i)}}else{b.zIndex=f;if(d<1)b.filter="alpha(opacity="+d*100+");opacity:"+d+";";map.appendChild(a)}else{b.zIndex=f;b.opacity=d;map.appendChild(a)}else{if(b&&typeof b.filter!="undefined"){if(d<1)b.filter="alpha(opacity="+d*100+");opacity:"+d}else b.opacity=d;map.appendChild(a)}if(debug&&c&&c.parentNode!=map){var h=a.src;c.innerHTML=h.substring(h.lastIndexOf("/")+1,h.lastIndexOf("."));g.position="absolute";g.zIndex=f+1;map.appendChild(c)}}}this.SetFactor=K;function J(){var a=0;a=g;g=l;l=a;a=h;h=n;n=a;a=k;k=t;t=a;a=j;j=r;r=a}this.SwapStates=J;function G(){if(b){b.onload=null;b.onerror=null;b=null}if(a){if(a.parentNode==map)map.removeChild(a);a=null}if(c){if(c.parentNode==map)map.removeChild(c);c=null}if(i){if(i.parentNode==map)map.removeChild(i);i=null}if(e){graphicCanvas.RemovePrintTile(e);e=null}}this.RemoveFromMap=G;function T(){if(currentView&&v!=currentView.zoomLevel||b==null)return;var d=new Date,c=d.getTime()-z.getTime();E(c);totalRequestTime+=c;totalRequestCount++;if(debug)window.status="last="+c+", average="+totalRequestTime/totalRequestCount;b.onload=null;b.onerror=null;a=b;a.onmousedown=function(){return false};b=null;if(!zooming)K(zoomCounter);if(graphicCanvas&&graphicCanvas._printable)H()}function S(){if(v!=currentView.zoomLevel||b==null)return;var c=new Date,a=c.getTime()-z.getTime();E(a);totalRequestTime+=a;totalRequestCount++;totalFailureCount++;b.onload=null;b.onerror=null;b=null}function E(b){for(var a=0;a<responseRangeCeilings[B].length;a++)if(b<responseRangeCeilings[B][a]){responseRangeCounts[a]++;return}responseRangeCounts[responseRangeCounts.length-1]++}function M(e,i,p,c,d,o){y(g-offsetX,h-offsetY,k,j);var m=o-p,b=Math.pow(2,m);l=MathFloor((e+g)*b-c);n=MathFloor((i+h)*b-d);t=MathCeil((e+g+k)*b-c)-l;r=MathCeil((i+h+j)*b-d)-n;A=true;w();f=baseZIndex;if(a!=null)a.style.zIndex=f}this.PrepareBaseTile=M;function N(i,m,s,d,e,o){var u=s-o,a=Math.pow(2,u);l=MathFloor((d+g)*a-i);n=MathFloor((e+h)*a-m);t=MathCeil((d+g+k)*a-i)-l;r=MathCeil((e+h+j)*a-m)-n;var c=MathCeil(tileViewportWidth*.25),b=MathCeil(tileViewportHeight*.25);A=o<s&&(p<tileViewportX1+c||p>tileViewportX2-c||q<tileViewportY1+b||q>tileViewportY2-b);J();w();f=swapZIndex}this.PrepareSwapTile=N;function R(b){if(!c)F();if(a!=null)a.style.border=b?"1px dashed red":"0px";c.style.display=b?"block":"none"}this.Debug=R;function P(){t=k;r=j}this.ClearStates=P;function F(){c=document.createElement("div");c.style.font="7pt Verdana, sans-serif";c.style.color="Red";c.style.backgroundColor="White"}}var orthoTileSpec=new VETileSourceSpecification;orthoTileSpec.ID=mapTiles;orthoTileSpec.SourceName=Msn.VE.API?Msn.VE.API.Constants.orthotileserver:"%0t%2.tiles.virtualearth.net/tiles/%3%4.%5?g=%6";orthoTileSpec.NumServers=4;var shadedTileSpec=new VETileSourceSpecification;shadedTileSpec.ID=mapTiles;shadedTileSpec.SourceName=Msn.VE.API?Msn.VE.API.Constants.shadedtileserver:"%0t%2.tiles.virtualearth.net/tiles/%3%4.%5?g=%6&shading=hill";shadedTileSpec.SourceName=shadedTileSpec.SourceName.replace(/%1/g,"r").replace(/%3/g,"r").replace(/%5/g,"png").replace(/%6/g,generations["r"]);shadedTileSpec.NumServers=4;function SetBaseTileSource(a){if(!a)a=currentView;var c=a&&shadedTileSpec&&shadedTileSpec.SourceName&&(a.mapStyle==Msn.VE.MapStyle.Road&&$MVEM.IsEnabled(MapControl.Features.MapStyle.Shaded)&&currentView.doRoadShading)||a.mapStyle==Msn.VE.MapStyle.Shaded,b=c?shadedTileSpec:orthoTileSpec;tileLayerManager.AddTileSource(b)}function SetView(a){if(currentMode!=null&&currentMode==threeDMode)return SetView3DSpecialized(a);if(a==null)return CreateNewView();if(zooming||dragging)return true;if(panning)StopContinuousPan();var b=a.latlong;if(a.GetViewType()==Msn.VE.MapViewType.LatLongRect)b=a.latlongRect.Center();if(Msn.VE.MapStyle.IsViewOblique(a.mapStyle))return SetViewOblique(a,b);else return SetViewOrtho(a,b)}function SetView3DSpecialized(a){var b=false;if(a==null){a=new Msn.VE.MapView;a.Copy(currentView);b=true}if(!view3DCreated)b=true;return SetView3D(a,b)}function SetViewOblique(a,c){if(obliqueMode==null)return true;preferredView.Copy(a);currentMode=obliqueMode;if(Msn.VE.API)p_elSource.style.background='#000 url("'+Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+'/oblique/oblique_bg.gif") repeat';else p_elSource.style.background='#000 url("./i/bin/'+window.buildVersion+'/oblique/oblique_bg.gif") repeat';function b(){var b=HandleSetViewObliqueResolve(a,c,preferredView);if(!b&&typeof a.callback=="function")a.callback(obliqueMode.GetScene())}a.Resolve(currentMode,width,height,b)}function HandleSetViewObliqueResolve(a,c,i){if(targetTool.centeringTrigger){targetTool.centeringTrigger=false;obliqueMode.RequestSceneAtLatLong(c,a.sceneOrientation,true,null,null,null,null,a.mapStyle);return true}var b=obliqueMode.GetScene(),e=b&&b.ContainsLatLong(c,a.zoomLevel);if(a.bySceneId){if(!b||b.GetID()!=a.sceneId){obliqueMode.RequestScene(a.sceneId);return true}else if(!e){var l=b.GetBounds();a.SetCenterLatLong(b.PixelToLatLong(new VEPixel(b.GetWidth()/4,b.GetHeight()/4),1));a.Resolve(currentMode,width,height);e=true}}else if(!b||!e||b.GetOrientation()!=a.sceneOrientation||b.GetMapStyle()!=a.mapStyle){obliqueMode.RequestSceneAtLatLong(c,a.sceneOrientation,true,null,a.callback,a.spinDirection,a.preserveScene,a.mapStyle);return true}c=a.latlong;i.Copy(a);SetBaseTileSource(a);currentMode.ValidateZoomLevel(a);currentBounds=currentMode.GetBounds(a);ClipView(a,currentBounds);if(a.Equals(currentView)&&!resizeInProgress)return false;var g=a.GetX(currentView.zoomLevel)-currentView.center.x,h=a.GetY(currentView.zoomLevel)-currentView.center.y,d=Math.sqrt(g*g+h*h);previousCenter=currentView.latlong;var f=0;if(!previousCenter.Equals(a.latlong))f+=Msn.VE.ViewChangeType.Pan;if(currentView.zoomLevel!=a.zoomLevel)f+=Msn.VE.ViewChangeType.Zoom;SetLastViewChangeType(f);var k=d<width&&d<height&&a.zoomLevel==currentView.zoomLevel&&IsAnimationEnabled()&&a.mapStyle==currentView.mapStyle&&(a.sceneId==null||a.sceneId==currentView.sceneId);if(k){PanToPixel(new VEPixel(a.center.x-originX-offsetX,a.center.y-originY-offsetY),true);return false}previousZoomLevel=currentView.zoomLevel;if(currentView.zoomLevel!=a.zoomLevel){Fire("onstartzoom",CreateEvent(null,null,null,a));zooming=true}var j=d<width&&d<height&&(a.zoomLevel==currentView.zoomLevel-1||a.zoomLevel==currentView.zoomLevel+1)&&IsAnimationEnabled()&&a.mapStyle==currentView.mapStyle&&(a.sceneId==null||a.sceneId==currentView.sceneId);if(j){tileLayerManager.zoomView(a);return false}UpdateTiles(a);return false}function SetViewOrtho(a,f){currentMode=orthoMode;if(a.mapStyle==Msn.VE.MapStyle.Road||a.mapStyle==Msn.VE.MapStyle.Shaded){p_elSource.style.backgroundColor="#e9e7d4";p_elSource.style.backgroundImage="none"}else p_elSource.style.backgroundColor="black";a.Resolve(currentMode,width,height);f=a.latlong;preferredView.Copy(a);SetBaseTileSource(a);currentMode.ValidateZoomLevel(a);currentBounds=currentMode.GetBounds(a);ClipView(a,currentBounds);a.Resolve(currentMode,width,height);if(a.Equals(currentView)&&!resizeInProgress)return false;if(!currentView.center)currentView.center=a.center;var d=a.GetX(currentView.zoomLevel)-currentView.center.x,e=a.GetY(currentView.zoomLevel)-currentView.center.y,b=Math.sqrt(d*d+e*e);previousCenter=currentView.GetCenterLatLong();var c=0;if(!previousCenter.Equals(a.GetCenterLatLong()))c+=Msn.VE.ViewChangeType.Pan;if(currentView.zoomLevel!=a.zoomLevel)c+=Msn.VE.ViewChangeType.Zoom;SetLastViewChangeType(c);var h=b<width&&b<height&&a.zoomLevel==currentView.zoomLevel&&IsAnimationEnabled()&&a.mapStyle==currentView.mapStyle&&(a.sceneId==null||a.sceneId==currentView.sceneId);if(h){PanToLatLong(a.latlong.latitude,a.latlong.longitude,true);return true}previousZoomLevel=currentView.zoomLevel;if(currentView.zoomLevel!=a.zoomLevel){Fire("onstartzoom",CreateEvent(null,null,null,a));zooming=true}var g=b<width&&b<height&&(a.zoomLevel==currentView.zoomLevel-1||a.zoomLevel==currentView.zoomLevel+1)&&IsAnimationEnabled()&&a.mapStyle==currentView.mapStyle&&(a.sceneId==null||a.sceneId==currentView.sceneId);if(g){tileLayerManager.zoomView(a);return true}UpdateTiles(a);return true}function CreateNewView(){var a=new Msn.VE.MapView;a.Copy(currentView);a.SetAltitude(-1000);a.SetTilt(-90);a.SetDirection(0);var b=a.latlong,c=ClipLatitude(b.latitude);if(b.latitude!=c){a.SetCenterLatLong(new Msn.VE.LatLong(c,b.longitude));a.Resolve(currentMode,width,height)}if(Msn.VE.MapStyle.IsViewOblique(a.mapStyle))currentMode=obliqueMode;else currentMode=orthoMode;SetBaseTileSource(a);currentMode.ValidateZoomLevel(a);UpdateTiles(a);return true}function UpdateTiles(a){currentView.Destroy();currentView=a;tileLayerManager.SetViewPort();tileLayerManager.LoadBaseLayer("Road",mapTiles,1,1);tileLayerManager.RefreshTileLayers();tileLayerManager.FinalizeView();RepositionPushpins()}function SetLastViewChangeType(a){if(Msn.VE.ViewChangeType.IsValid(a))lastViewChangeType=a}_VERegisterNamespaces("Msn.VE.Geometry");Msn.VE.Geometry.Point=function(c,d){var a=this,b=Msn.VE.Geometry;this.x=c;this.y=d;this.add=function(c,d){var e=new b.Point(a.x+c,a.y+d);return e};this.getDistanceFrom=function(b){var c=Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2),d=Math.sqrt(c);return d}};Msn.VE.Geometry.Overlap={Range:{GreaterThanX:1,LessThanX:2,GreaterThanY:4,LessThanY:8,InXRange:16,InYRange:32,InRange:48},getInstance:function(f,g){var d=Msn.VE.Geometry.Overlap,a=f,b=g,c=0;e();function e(){if(b.getP2().x>a.getP2().x)c+=d.Range.GreaterThanX;if(b.getP1().x<a.getP1().x)c+=d.Range.LessThanX;if(b.getP2().y>a.getP2().y)c+=d.Range.GreaterThanY;if(b.getP1().y<a.getP1().y)c+=d.Range.LessThanY;if(a.getP1().x<=b.getP1().x&&b.getP2().x<=a.getP2().x)c+=d.Range.InXRange;if(a.getP1().y<=b.getP1().y&&b.getP2().y<=a.getP2().y)c+=d.Range.InYRange}this.getRange=function(){return c};this.getLeftXBleed=function(){if(c&d.Range.LessThanX)return Math.abs(a.getP1().x-b.getP1().x);else return 0};this.getRightXBleed=function(){if(c&d.Range.GreaterThanX)return b.getP2().x-a.getP2().x;else return 0};this.getTopYBleed=function(){if(c&d.Range.LessThanY)return Math.abs(a.getP1().y-b.getP1().y);else return 0};this.getBottomYBleed=function(){if(c&d.Range.GreaterThanY)return b.getP2().y-a.getP2().y;else return 0}}};Msn.VE.Geometry.Rectangle=function(h,i){var g=this,a=h,b=i,d,e;f();function f(){c()}this.move=function(c){a.x=c.x;a.y=c.y;b.x=c.x+e;b.y=c.y+d};this.getP1=function(){return a};this.getP2=function(){return b};this.setP1=function(b){a=b;c()};this.setP2=function(a){b=a;c()};this.getWidth=function(){return e};this.getHeight=function(){return d};this.containsPoint=function(c){return c.x>=a.x&&c.x<=b.x&&c.y>=a.y&&c.y<=b.y};this.scale=function(d){a.x-=d;a.y-=d;b.x+=d;b.y+=d;c()};this.getOverlap=function(a){var b=Msn.VE.Geometry;return new b.Overlap.getInstance(g,a)};function c(){d=b.y-a.y;e=b.x-a.x}};Msn.VE.Geometry.Functions={getSlope:function(a,b){return(b.y-a.y)/(b.x-a.x)},getYIntercept:function(b,a){return a.y-b*a.x},getBestBoundingPoint:function(f,b,c){var a=Msn.VE.Geometry;if(!b)b=g(f).getScreenPosition();var e=new a.Rectangle(b,new a.Point(b.x+f.offsetWidth,b.y+f.offsetHeight)),j=c.getOverlap(e),d=j.getRange();if((d&a.Overlap.Range.InRange)==a.Overlap.Range.InRange)return b;var h=b.x,i=b.y;if(d&a.Overlap.Range.GreaterThanX)h=c.getP2().x-e.getWidth();if(d&a.Overlap.Range.LessThanX)h=c.getP1().x;if(d&a.Overlap.Range.GreaterThanY)i=c.getP2().y-e.getHeight();if(d&a.Overlap.Range.LessThanY)i=c.getP1().y;return new a.Point(h,i)}};view3DMode=false;var sentinel3D,setStyle;function View3DAddPushpin(a){if(g(a.pin).hasClass("inactiveAbbreviationPin"))return;var d=parseInt(a.pinType),h=TranslatePushpinURL(a.className,a.innerHtml,d),c=Msn.VE.PushPinTypes,e=parseFloat(a.lat),f=parseFloat(a.lon),b='zindex="'+a.zIndex+'"';switch(d){case c.DirectionStep:case c.SearchResultNonprecise:b+=' textoffset="50%, 50%"';case c.SearchResultPrecise:case c.AdSponsor:b+=' text="'+extractText(a.innerHtml)+'"';break;case c.Collection:if(a.className.indexOf("point")==-1)b+=' textoffset="50%, 60%"';b+=' text="'+extractText(a.innerHtml)+'"';break;case c.Overlay:b+=' textoffset="50%, 50%"';b+=' text="'+extractText(a.innerHtml)+'"'}spacecontrol.AddPointWithProperties(0,a.id,e,f,h,b)}function extractText(b){var a=document.createElement("div");a.innerHTML=b;var c=a.textContent||a.innerText;a=null;return c}function View3DRemovePushpin(a){spacecontrol.DeleteGeometry(0,a)}function AddView3DParameter(d,c,b){var a=document.createElement("param");a.name=c;a.value=b;d.appendChild(a)}function CreateView3DControl(a){initial3dView=new Msn.VE.MapView;initial3dView.Copy(a);if(sentinel3D==null)sentinel3D=GetSentinel();if(null==sentinel3D){View3DUnavailable();return false}if(sentinel3D!=null&&sentinel3D.CurrentVersion<2.05080304000){var c=sentinel3D.CurrentVersion;sentinel3D=null;if(c>0)View3DUpgrade(c);return false}try{sentinel3D.InitializeRuntime()}catch(g){}spacediv=document.createElement("div");spacediv.id="MSVE_spacediv";spacediv.className="MSVE_SLMap";spacediv.style.position="relative";spacediv.style.height="100%";spacediv.style.overflow="hidden";spacecontrol=document.createElement("object");var b=a.cameraLatlong==null?a.latlong:a.cameraLatlong;AddView3DParameter(spacecontrol,"StartLongitude",b.longitude);AddView3DParameter(spacecontrol,"StartLatitude",b.latitude);AddView3DParameter(spacecontrol,"StartPitch",a.GetTilt());AddView3DParameter(spacecontrol,"StartHeading",-a.GetDirection());var e=Get3dMarket();if(e)AddView3DParameter(spacecontrol,"CurrentLocale",e);var d=a.GetAltitude();if(d>-1000)AddView3DParameter(spacecontrol,"StartAltitude",d);else AddView3DParameter(spacecontrol,"StartZoomLevel",a.zoomLevel);spacediv.appendChild(spacecontrol);try{if(window.navigator.userAgent.indexOf("MSIE")!=-1)spacecontrol.classid="clsid:68BFC611-B963-4e8c-B0FE-0DD4FB832796";else spacecontrol.type="application/x-virtual-earth-3d"}catch(g){View3DUnavailable();spacecontrol=false;return false}spacecontrol.ControlId=init3dparam;AttachEvent("onresize",ResizeControl);p_elSource.appendChild(spacediv);ResizeControl();setStyle=false;var f=ValidateControl();if(f)IterativeCameraRefinement();if(typeof state!="undefined"&&state!=null)state.Set3DViewInstallInProgress("");return f}function View3DUnavailable(){if(IsEventAttached("onmodenotavailable"))Fire("onmodenotavailable",Msn.VE.MapActionMode.Mode3D);else if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null)if(sentinel3D!=null)window.open(Get3dHelpUrl("View3DUnavailable.htm"),"_blank","width=600,height=550,menubar=0,resizeable=0,status=0,titlebar=0,toolbar=0,scrollbars=0");else if(window.navigator.userAgent.indexOf("MSIE")!=-1)window.open(Get3dInstallUrl("Default.aspx?action=install&mkt="+Get3dMarket()),"_blank","width=650,height=520,menubar=0,resizeable=0,status=0,titlebar=0,toolbar=0,scrollbars=0");else if(window.navigator.userAgent.indexOf("Windows")!=-1)window.open(Get3dInstallUrl("Default.aspx?action=install&mkt="+Get3dMarket()),"_blank","width=760,height=580,menubar=0,resizeable=0,status=0,titlebar=0,toolbar=0,scrollbars=0")}function CallIterativeCameraRefinement(){var a=GetMapControlInstance(null);if(a)a.IterativeCameraRefinement()}function IterativeCameraRefinement(){if(cameraUpdateCount>0)return;if(IsModeEnabled(Msn.VE.MapActionMode.Mode3D)&&spacecontrol)if(!spacecontrol.AllTilesLoaded)setTimeout(CallIterativeCameraRefinement,1000);else{var a=false,c=currentView.GetAltitude(),d=initial3dView.GetAltitude();if(d>-1000&&c>-1000)a=Math.abs(c-d)>1;else a=currentView.GetZoomLevel()!=initial3dView.GetZoomLevel();if(a){var b=initial3dView.MakeCopy();b.SetMapStyle(currentView.mapStyle);SetView3D(b,true)}}}function ValidateControl(){if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null)if(0==spacecontrol.HardwareClassificationLevel)setStyle=true;var a=false,b=300;if(spacecontrol.Created){while(!spacecontrol.FirstFrameRendered&&!spacecontrol.LoadFailed&&!spacecontrol.AlreadyLoaded&&b>0){b--;spacecontrol.ProcessEvents()}a=spacecontrol.FirstFrameRendered}if(spacecontrol.Created&&!spacecontrol.HardwareAccelerationEnabled&&spacecontrol.LoadFailed){if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null){window.setTimeout(DelayedHWDialog,2759);window.setTimeout(OnHardwareAccelHelpFired,4000)}else if(IsEventAttached("onmodenotavailable"))Fire("onmodenotavailable",Msn.VE.MapActionMode.Mode3D);if(mode==Msn.VE.MapActionMode.Mode3D)EnableMode(Msn.VE.MapActionMode.Mode2D);return false}else if(!spacecontrol.Created||!spacecontrol.Enabled||!spacecontrol.IsHandleCreated||!a&&!spacecontrol.AlreadyLoaded){View3DUnavailable();spacecontrol=false;return false}else{spacecontrol.focus();view3DCreated=true;return true}}function ResizeControl(){if(spacecontrol){spacecontrol.style.height=spacediv.offsetHeight+"px";spacecontrol.style.width=spacediv.offsetWidth+"px"}RepositionShims()}function SetView3D(a,g){currentMode.ValidateZoomLevel(a);a.Resolve(orthoMode,width,height);preferredView.Copy(a);if(!view3DCreated&&!spacecontrol){var l=CreateView3DControl(a);if(setStyle){a.mapStyle="h";previousMapStyle="h"}if(!l)return false;if(a.GetTilt()!=-90&&a.cameraLatlong==null){a.Resolve(orthoMode,width,height);cameraUpdateCount=-1}else{cameraUpdateCount=0;a._supressFlyToCall=true}p_elSource.style.backgroundColor="#e9e7d4";originX=0;originY=0;offsetX=0;offsetY=0;UpdateFromParent()}if(!g&&a.Equals(currentView)){if(!spaceCameraIsFlying)ProcessQueuedRequest(null,null);return false}var c=false;if(a.GetAltitude()>-1000)c=Math.abs(a.GetAltitude()-currentView.GetAltitude())>1e-4;else c=currentView.zoomLevel!=a.zoomLevel;currentView.Destroy();currentView=a;if(view3DCreated){if(previousMapStyle){if(currentView.mapStyle!=null&&previousMapStyle!=currentView.mapStyle){var b="http://go.microsoft.com/fwlink/?LinkID=98770";if(currentView.mapStyle=="a"){b="http://go.microsoft.com/fwlink/?LinkID=98771";spacecontrol.ShowAtmosphere=true}if(currentView.mapStyle=="h"){b="http://go.microsoft.com/fwlink/?LinkID=98772";spacecontrol.ShowAtmosphere=true}if(currentView.mapStyle=="r"){spacecontrol.TexturesVisible=false;if(spacecontrol.HardwareClassificationLevel<3)b="http://go.microsoft.com/fwlink/?LinkID=98769";spacecontrol.ShowAtmosphere=false}else spacecontrol.TexturesVisible=true;spacecontrol.AddImageSource("Terrain","Texture",GetManifestUrl(b),0,1);Fire("onchangemapstyle");previousMapStyle=currentView.mapStyle}}else previousMapStyle=currentView.mapStyle;var d=a.cameraLatlong,i=a.zoomLevel,j=a.GetAltitude(),k=a.GetTilt(),h=a.GetDirection(),e=a._needsPivotOperation;if(c)Fire("onstartzoom");if(a._supressFlyToCall)a._supressFlyToCall=false;else{var f=spacecontrol.FlyTo(d.latitude,d.longitude,i,j,k,h,e?1:0);if(!f&&!spaceCameraIsFlying)ProcessQueuedRequest(null,null)}if(a.sceneId&&a.sceneId!=-1){ProcessPhotoPluginActionIn3D("PhotosEnabled","enabled=1"+";labels="+(a.mapStyle==Msn.VE.MapStyle.Road||a.mapStyle==Msn.VE.MapStyle.Hybrid||a.mapStyle==Msn.VE.MapStyle.ObliqueHybrid?"1":"0"),spacecontrol);ProcessPhotoPluginActionIn3D("SelectSceneId","SceneId="+a.sceneId+";X="+a.photoX+";Y="+a.photoY+";Scale="+a.photoScale,spacecontrol,null)}if(c)Fire("onendzoom");if(copyright)copyright.Update();return true}return false}var on3DAnimationInterruptedCallback=null;function SetOn3DAnimationInterruptedCallback(a){on3DAnimationInterruptedCallback=a}function GetOn3DAnimationInterruptedCallback(){return on3DAnimationInterruptedCallback}function SetViewport(b,d,c,e){Sync3dView();var a=preferredView.MakeCopy();a.sceneId=null;a.SetLatLongRectangle(new Msn.VE.LatLongRectangle(new Msn.VE.LatLong(ClipLatitude(b),ClipLongitude(d)),new Msn.VE.LatLong(ClipLatitude(c),ClipLongitude(e))));a.SetTilt(-90);a.SetDirection(0);return SetView(a)}function SetBestMapView(b){var a=GetBestMapViewBounds(b);if(!a||a.constructor!=Array)return false;if(a.length==4)return SetViewport(a[0],a[1],a[2],a[3])}function GetBestMapViewBounds(a){var b=[];if(!a||a.constructor!=Array)return null;var c=a[0].latitude,d=a[0].longitude,f=c,g=d;for(var e=1;e<a.length;e++){c=MathMin(c,a[e].latitude);d=MathMin(d,a[e].longitude);f=MathMax(f,a[e].latitude);g=MathMax(g,a[e].longitude)}var h=(f-c)*.1,i=(g-d)*.1;c-=h;d-=i;f+=h;g+=i;if(!b||b.constructor!=Array)return null;else{b.push(ClipLatitude(c));b.push(ClipLongitude(d));b.push(ClipLatitude(f));b.push(ClipLongitude(g));return b}}function IncludePointInViewport(d,c){var a=new Msn.VE.LatLong(d,c);if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)){var b=obliqueMode.GetScene();if(!b||!b.ContainsLatLong(a))SetMapStyle(lastOrthoMapStyle)}SetBestMapView([currentView.latlong,a])}function ClipLatitude(a){return Clip(a,minLatitude,maxLatitude)}function ClipLongitude(a){return Clip(a,minLongitude,maxLongitude)}function Clip(a,c,b){if(a<c)return c;if(a>b)return b;return a}function SetZoom(b){Sync3dView();var a=preferredView.MakeCopy();a.SetZoomLevel(b);SetView(a)}function ZoomIn(){Sync3dView();var a=preferredView.MakeCopy();a.SetZoomLevel(currentView.zoomLevel+1);SetView(a)}function ZoomOut(){Sync3dView();var a=preferredView.MakeCopy();a.SetZoomLevel(currentView.zoomLevel-1);SetView(a)}function SetCenterAndZoom(d,b,c){Sync3dView();var a=preferredView.MakeCopy();a.sceneId=null;a.SetCenterLatLong(new Msn.VE.LatLong(d,b));a.SetZoomLevel(c);SetView(a)}function GetCurrentViewMaxZoomLevel(b){var a=b;if(typeof a=="undefined"||a==null)a=preferredView;if(!currentMode)return tileLayerManager.GetMaxTileZoom();return currentMode.GetCurrentMaxZoomLevel(a)}function ObliqueMode(){var q=false,a=null,s=null,b=false,h=false,x=null,y=null,l=false,n=false,k=null,c=null,g=-1,e=null,m=null,r=null,f=['02121131200','02121131201','02121131202','02121131203','02121131210','02121131211','02121131212','02121131213','02121131220','02121131221','02121131222','02121131223','02121131230','02121131231','02121131232','02121131233','02121131300','02121131302','02121222032','02121222033','02121222122','02121222210','02121222211','02121222212','02121222213','02121222230','02121222231','02121222233','02121222300','02121222301','02121222302','02121222303','02121222310','02121222311','02121222312','02121222313','02121222320','02121222321','02121222322','02121222323','02121222330','02121222331','02121222332','02121222333','02121223200','02121223202','02121223203','02121223210','02121223212','02121223213','02121223220','02121223221','02121223222','02121223223','02121223230','02121223231','02121223232','02121312131','02121312132','02121312133','02121312301','02121312303','02121312310','02121312311','02121312312','02121312313','02121312330','02121312331','02121312333','02121313022','02121313200','02121313202','02121313220','02121313222','02121330111','02122313101','02122313103','02122313110','02122313112','02123000003','02123000012','02123000021','02123000022','02123000023','02123000030','02123000032','02123000101','02123000103','02123000110','02123000111','02123000112','02123000113','02123000123','02123000130','02123000131','02123000132','02123000133','02123000200','02123000201','02123000210','02123000301','02123000303','02123000310','02123000311','02123000312','02123000313','02123000321','02123000330','02123000331','02123000332','02123000333','02123001000','02123001001','02123001002','02123001003','02123001010','02123001012','02123001013','02123001020','02123001021','02123001022','02123001023','02123001030','02123001031','02123001032','02123001033','02123001103','02123001112','02123001120','02123001121','02123001122','02123001123','02123001130','02123001132','02123001200','02123001201','02123001202','02123001203','02123001210','02123001211','02123001212','02123001220','02123001221','02123001222','02123001223','02123001232','02123001300','02123001301','02123001302','02123002103','02123002110','02123002111','02123002112','02123002113','02123002121','02123002123','02123002130','02123002131','02123002132','02123002133','02123002233','02123002301','02123002303','02123002310','02123002311','02123002312','02123002313','02123002320','02123002321','02123002322','02123002323','02123002330','02123002331','02123002332','02123002333','02123003000','02123003001','02123003002','02123003003','02123003010','02123003011','02123003012','02123003020','02123003021','02123003022','02123003023','02123003030','02123003032','02123003200','02123003201','02123003202','02123003203','02123003210','02123003220','02123003221','02123003222','02123003223','02123003232','02123020011','02123020013','02123020031','02123020100','02123020101','02123020102','02123020103','02123020110','02123020111','02123020112','02123020113','02123020120','02123021000','02123021001','02123021002','02123022103','02123022112','02123022113','02123022121','02123022122','02123022123','02123022130','02123022131','02123022132','02123022133','02123022211','02123022233','02123022300','02123022301','02123022302','02123022303','02123022310','02123022311','02123022312','02123022313','02123022320','02123022321','02123022322','02123022323','02123022330','02123022331','02123023200','02123023202','02123023220','02123030020','02123030021','02123030022','02123030023','02123030030','02123030032','02123030033','02123030200','02123030201','02123030210','02123030211','02123030212','02123030213','02123030231','02123030300','02123030302','02123030303','02123030312','02123030320','02123030321','02123030323','02123030330','02123030331','02123030332','02123030333','02123031031','02123031033','02123031120','02123031122','02123031202','02123031203','02123031212','02123031220','02123031221','02123031223','02123031230','02123031231','02123031232','02123031233','02123031332','02123031333','02123033010','02123033011','02123033101','02123033110','02123033111','02123100233','02123100322','02123102011','02123102012','02123102013','02123102030','02123102031','02123102032','02123102033','02123102100','02123102102','02123102103','02123102111','02123102112','02123102113','02123102120','02123102121','02123102122','02123102123','02123102130','02123102131','02123102132','02123102133','02123102210','02123102211','02123102301','02123102310','02123102311','02123102312','02123102313','02123102330','02123102331','02123102332','02123102333','02123103002','02123103020','02123103022','02123103030','02123103031','02123103032','02123103033','02123103120','02123103122','02123103200','02123103201','02123103202','02123103203','02123103212','02123103213','02123103220','02123103221','02123103222','02123103230','02123103231','02123120111','02123200011','02123200013','02123200031','02123200033','02123200100','02123200101','02123200102','02123200103','02123200120','02123200121','02123200122','02123200223','02123200230','02123200231','02123200232','02123200233','02123200322','02123200323','02123202001','02123202010','02123202011','02123202013','02123202031','02123202100','02123202101','02123202102','02123202120','02123202130','02123202131','02123223233','02123223322','02123302112','02123302113','02123302130','02123302131','02123302132','02123302133','02123302310','02123302311','02123302313','02123303002','02123303003','02123303020','02123303021','02123303022','02123303023','02123303030','02123303032','02123303033','02123303200','02123303201','02123303202','02123303203','02123303210','02123303211','02123303220','02123303221','02132032103','02132032112','02132032113','02132032120','02132032121','02132032122','02132032123','02132032130','02132032131','02132032132','02132222202','02132222203','02132222210','02132222211','02132222212','02132222213','02132222220','02132222221','02132222222','02132222223','02132222230','02132222231','02132222232','02132222233','02132222300','02132222301','02132222302','02132222303','02132222310','02132222312','02132222320','02132222321','02132222330','02132310233','02132310322','02132310323','02132310332','02132312011','02132312013','02132312031','02132312100','02132312101','02132312102','02132312103','02133031332','02133031333','02133033110','02133033111','02133033112','02133033113','02133033130','02133033131','02133033133','02133103133','02133103311','02133103313','02133112022','02133112023','02133112032','02133112033','02133112200','02133112201','02133112210','02133112211','02133120222','02133120223','02133120232','02133120233','02133122000','02133122001','02133122002','02133122003','02133122010','02133122011','02133122012','02133122013','02133122020','02133122021','02133122022','02133122023','02133122030','02133122031','02133122032','02133122113','02133122131','02133122133','02133122212','02133122213','02133122230','02133122231','02133122232','02133122233','02133122302','02133122303','02133122311','02133122312','02133122313','02133122320','02133122321','02133122322','02133122323','02133122330','02133122331','02133122332','02133122333','02133123002','02133123003','02133123012','02133123020','02133123021','02133123022','02133123023','02133123030','02133123032','02133123200','02133123201','02133123202','02133123210','02133123213','02133123231','02133123232','02133123233','02133123301','02133123302','02133123303','02133123310','02133123312','02133123313','02133123320','02133123321','02133123322','02133123323','02133123330','02133123331','02133123332','02133123333','02133130013','02133130021','02133130023','02133130030','02133130031','02133130032','02133130033','02133130102','02133130120','02133130122','02133132220','02133132222','02133211123','02133211132','02133211133','02133211231','02133211233','02133211301','02133211303','02133211310','02133211311','02133211312','02133211313','02133211320','02133211321','02133211322','02133211323','02133211330','02133211331','02133211332','02133211333','02133212113','02133212131','02133212133','02133212311','02133213002','02133213003','02133213010','02133213011','02133213012','02133213013','02133213020','02133213021','02133213022','02133213023','02133213030','02133213031','02133213032','02133213033','02133213100','02133213101','02133213102','02133213103','02133213200','02133213201','02133213210','02133213211','02133231032','02133231033','02133231122','02133231123','02133231132','02133231133','02133231210','02133231211','02133231213','02133231231','02133231300','02133231301','02133231302','02133231303','02133231310','02133231311','02133231312','02133231313','02133231320','02133231321','02133231330','02133231331','02133233123','02133233132','02133233133','02133233211','02133233213','02133233222','02133233223','02133233231','02133233232','02133233233','02133233300','02133233301','02133233302','02133233303','02133233310','02133233311','02133233312','02133233313','02133233320','02133233321','02133233322','02133233323','02133233330','02133233331','02133233332','02133300010','02133300011','02133300012','02133300013','02133300022','02133300100','02133300101','02133300102','02133300103','02133300110','02133300111','02133300112','02133300113','02133300200','02133300202','02133300220','02133300221','02133300222','02133300223','02133300230','02133300231','02133300232','02133300233','02133300322','02133301010','02133301011','02133301012','02133301013','02133301023','02133301030','02133301031','02133301032','02133301033','02133301100','02133301101','02133301102','02133301103','02133301110','02133301111','02133301112','02133301113','02133301120','02133301121','02133301122','02133301123','02133301130','02133301131','02133301132','02133301133','02133301201','02133301210','02133301211','02133301213','02133301231','02133301233','02133301300','02133301301','02133301302','02133301303','02133301310','02133301311','02133301312','02133301320','02133301321','02133301322','02133301323','02133301330','02133301331','02133301332','02133301333','02133302000','02133302001','02133302002','02133302003','02133302010','02133302011','02133302012','02133302013','02133302020','02133302021','02133302030','02133302031','02133302100','02133302102','02133302120','02133303110','02133303111','02133303112','02133303113','02133303130','02133303131','02133310000','02133310002','02133310020','02133310022','02133310112','02133310113','02133310130','02133310131','02133310132','02133310133','02133310200','02133310220','02133310221','02133310222','02133310223','02133310230','02133310232','02133310233','02133310310','02133310311','02133310322','02133311002','02133311003','02133311012','02133311020','02133311021','02133311022','02133311023','02133311030','02133311032','02133311200','02133311201','02133311210','02133311222','02133311223','02133311232','02133312000','02133312001','02133312002','02133312003','02133312010','02133312011','02133312012','02133312013','02133312020','02133312021','02133312030','02133312031','02133312100','02133312102','02133312111','02133312113','02133312120','02133313000','02133313001','02133313002','02133313003','02133313010','02133313012','02133313020','02133313021','02133313022','02133313023','02133313030','02133313032','02133320011','02133320013','02133320031','02133320033','02133320100','02133320101','02133320102','02133320103','02133320110','02133320112','02133320120','02133320121','02133320122','02133320123','02133320130','02133320132','02133320211','02133320300','02133320301','02133320310','02133322022','02133322023','02133322032','02133322200','02133322201','02133322202','02133322203','02133322210','02133322212','02133322220','02133322221','02133322223','02133322230','02133322232','02133323003','02133323010','02133323011','02133323012','02133323013','02133323021','02133323030','02133323031','02133323032','02133323033','02133323100','02133323101','02133323102','02133323103','02133323120','02133323121','02133323122','02133323123','02133323210','02133323211','02133323300','02133323301','02133330023','02133330032','02133330033','02133330122','02133330201','02133330203','02133330210','02133330211','02133330212','02133330213','02133330221','02133330230','02133330231','02133330300','02133330302','02133330320','02133330323','02133330332','02133330333','02133332101','02133332103','02133332110','02133332111','02133332112','02133332113','02133332121','02133332123','02133332130','02133332131','02133332132','02133332133','02133332301','02133332310','02133332311','02133333000','02133333002','02133333012','02133333013','02133333020','02133333022','02133333030','02133333031','02133333032','02133333033','02133333102','02133333103','02133333112','02133333120','02133333121','02133333122','02133333123','02133333130','02133333131','02133333132','02133333133','02133333200','02133333201','02133333203','02133333210','02133333211','02133333212','02133333213','02133333300','02133333301','02133333302','02133333303','02133333310','02301000113','02301000131','02301000133','02301000311','02301001002','02301001011','02301001013','02301001020','02301001022','02301001100','02301001200','02301002223','02301002232','02301002233','02301002322','02301002323','02301003323','02301003332','02301003333','02301012103','02301012112','02301012113','02301012121','02301012123','02301012130','02301012131','02301012132','02301012133','02301012310','02301012311','02301012312','02301012313','02301012330','02301012331','02301020001','02301020003','02301020010','02301020011','02301020012','02301020013','02301020030','02301020031','02301020033','02301020100','02301020101','02301020102','02301020103','02301020110','02301020112','02301020120','02301020121','02301020122','02301020123','02301020130','02301020131','02301020132','02301020133','02301020211','02301020300','02301020301','02301020302','02301020303','02301020310','02301020311','02301020312','02301020313','02301020321','02301020330','02301020331','02301020332','02301020333','02301021011','02301021013','02301021021','02301021022','02301021023','02301021030','02301021031','02301021032','02301021033','02301021100','02301021101','02301021102','02301021103','02301021110','02301021111','02301021112','02301021113','02301021120','02301021121','02301021122','02301021123','02301021130','02301021131','02301021132','02301021133','02301021200','02301021201','02301021202','02301021203','02301021210','02301021211','02301021212','02301021213','02301021220','02301021221','02301021222','02301021223','02301021230','02301021231','02301021232','02301021233','02301021300','02301021301','02301021302','02301021303','02301021310','02301021311','02301021312','02301021313','02301021320','02301021321','02301021322','02301021323','02301021330','02301021331','02301021332','02301021333','02301022110','02301022111','02301022112','02301022113','02301022131','02301023000','02301023001','02301023002','02301023003','02301023010','02301023011','02301023012','02301023013','02301023020','02301023021','02301023022','02301023023','02301023030','02301023031','02301023032','02301023033','02301023100','02301023101','02301023102','02301023103','02301023110','02301023111','02301023112','02301023113','02301023120','02301023122','02301023130','02301023131','02301023133','02301023200','02301023201','02301023202','02301023203','02301023210','02301023211','02301023212','02301023213','02301023223','02301023230','02301023231','02301023232','02301023233','02301023300','02301023302','02301023320','02301023322','02301030222','02301030223','02301031102','02301031103','02301031120','02301031121','02301031131','02301031133','02301032000','02301032001','02301032002','02301032003','02301032212','02301032230','02301032231','02301032232','02301032233','02301032303','02301032312','02301032313','02301032320','02301032321','02301032322','02301032323','02301032330','02301032331','02301032332','02301032333','02301033220','02301033222','02301033223','02301120020','02301120022','02301132111','02301132113','02301132131','02301132133','02301132311','02301132313','02301133000','02301133001','02301133002','02301133003','02301133010','02301133012','02301133013','02301133020','02301133021','02301133022','02301133023','02301133030','02301133031','02301133032','02301133033','02301133102','02301133103','02301133120','02301133121','02301133122','02301133123','02301133200','02301133201','02301133202','02301133203','02301133210','02301133211','02301133212','02301133213','02301133300','02301133301','02301133302','02301133303','02301201001','02301201010','02301201011','02301201013','02301201100','02301201101','02301201103','02301201110','02301201112','02301201121','02301201130','02301201131','02301201132','02301201133','02301210011','02301210030','02301210031','02301210032','02301210033','02301210100','02301210101','02301210103','02301210110','02301210111','02301210112','02301210113','02301210120','02301210121','02301210122','02301210123','02301211000','02301211001','02301211202','02301211203','02301211212','02301211220','02301211221','02301211222','02301211223','02301211230','02301211232','02301211233','02301212003','02301212012','02301212021','02301212023','02301212030','02301212032','02301212033','02301212210','02301212211','02301212213','02301212302','02301212303','02301212320','02301212321','02301212323','02301212330','02301212331','02301212332','02301212333','02301213000','02301213001','02301213002','02301213010','02301213011','02301213012','02301213013','02301213020','02301213021','02301213022','02301213031','02301213100','02301213102','02301213120','02301213211','02301213213','02301213221','02301213222','02301213223','02301213232','02301213233','02301213300','02301213301','02301213302','02301213303','02301213310','02301213311','02301213312','02301213313','02301213320','02301213321','02301213322','02301213323','02301213330','02301213331','02301213332','02301213333','02301231001','02301231003','02301231010','02301231011','02301231012','02301231013','02301231031','02301231100','02301231101','02301231102','02301231103','02301231110','02301231111','02301231112','02301231113','02301231120','02301231121','02301231130','02301231131','02301231132','02301231133','02301231303','02301231310','02301231311','02301231312','02301231321','02301231330','02301231331','02301300230','02301300231','02301300232','02301300233','02301300302','02301300320','02301301113','02301301131','02301301133','02301301311','02301301332','02301301333','02301302123','02301302132','02301302133','02301302200','02301302201','02301302202','02301302203','02301302210','02301302211','02301302212','02301302213','02301302220','02301302221','02301302222','02301302223','02301302230','02301302231','02301302232','02301302233','02301302300','02301302301','02301302302','02301302303','02301302310','02301302311','02301302312','02301302313','02301302320','02301302321','02301302322','02301302323','02301302330','02301302331','02301302332','02301302333','02301303021','02301303022','02301303110','02301303111','02301303200','02301303201','02301310002','02301310020','02301310021','02301310022','02301310023','02301310030','02301310032','02301310033','02301310200','02301310201','02301310210','02301310211','02301310212','02301310213','02301312033','02301312211','02301312300','02301312302','02301312320','02301312321','02301312332','02301320000','02301320001','02301320002','02301320003','02301320010','02301320011','02301320012','02301320013','02301320020','02301320021','02301320022','02301320023','02301320030','02301320031','02301320032','02301320033','02301320100','02301320101','02301320102','02301320103','02301320110','02301320111','02301320112','02301320113','02301320120','02301320121','02301320122','02301320123','02301320130','02301320131','02301320132','02301320133','02301320200','02301320201','02301320203','02301320210','02301320211','02301320212','02301320213','02301320230','02301320231','02301320300','02301320301','02301320302','02301320303','02301320310','02301320311','02301320312','02301320320','02301320321','02301320322','02301320323','02301320330','02301320332','02301321001','02301321002','02301321003','02301321010','02301321011','02301321012','02301321013','02301321020','02301321021','02301321022','02301321023','02301321030','02301321032','02301321033','02301321100','02301321101','02301321102','02301321103','02301321201','02301321210','02301321211','02301321212','02301321213','02301322100','02301322101','02301322102','02301322103','02301322110','02301322111','02301322112','02301322113','02301322120','02301322121','02301322122','02301322123','02301322130','02301322131','02301322132','02301322133','02301322301','02301322310','02301323000','02301323002','02301323020','02301330011','02301330100','02301330101','02301330102','02301330103','02301330110','02301331312','02301331313','02301331330','02301331331','02301332031','02301332033','02301332120','02301332121','02301332122','02301332123','02301332210','02301332211','02310000003','02310000010','02310000011','02310000012','02310000013','02310000021','02310000023','02310000030','02310000031','02310000032','02310000033','02310000100','02310000102','02310000103','02310000120','02310000121','02310000122','02310000210','02310000211','02310000300','02310012303','02310012312','02310012313','02310012321','02310012330','02310012331','02310032321','02310032330','02310032331','02310032332','02310032333','02310033202','02310033203','02310033212','02310033220','02310033221','02310033222','02310033223','02310033230','02310033231','02310033232','02310033233','02310101012','02310101021','02310101023','02310101030','02310101032','02310101033','02310101122','02310101201','02310101202','02310101203','02310101210','02310101211','02310101212','02310101220','02310101221','02310101222','02310101223','02310101230','02310101231','02310101232','02310101233','02310101300','02310101301','02310101322','02310101323','02310101332','02310101333','02310103000','02310103001','02310103002','02310103003','02310103010','02310103011','02310103012','02310103013','02310103020','02310103021','02310103022','02310103023','02310103030','02310103031','02310103032','02310103033','02310103100','02310103101','02310103102','02310103103','02310103110','02310103111','02310103112','02310103113','02310103120','02310103121','02310103122','02310103130','02310103131','02310103203','02310103210','02310103211','02310103212','02310103213','02310103231','02310103233','02310103300','02310103302','02310103320','02310103322','02310110222','02310110223','02310110232','02310112000','02310112001','02310112002','02310112003','02310112010','02310112012','02310112020','02310112021','02310112030','02310121011','02310121033','02310121100','02310121102','02310121122','02310121123','02310121211','02310121300','02310121301','02310210231','02310210233','02310210320','02310210321','02310210322','02310210323','02310210332','02310210333','02310211202','02310211203','02310211212','02310211213','02310211220','02310211221','02310211222','02310211223','02310211230','02310211231','02310211232','02310211233','02310211302','02310211303','02310211320','02310211321','02310211322','02310212011','02310212013','02310212100','02310212101','02310212103','02310212110','02310212111','02310212112','02310212113','02310212130','02310212131','02310212132','02310213000','02310213001','02310213002','02310213003','02310213010','02310213011','02310213012','02310213100','02310213112','02310213113','02310213130','02310213131','02310213132','02310213133','02310213310','02310213311','02310220021','02310220023','02310220030','02310220031','02310220032','02310220033','02310220122','02310220200','02310220201','02310220202','02310220203','02310220210','02310220211','02310220212','02310220213','02310220220','02310220221','02310220223','02310220230','02310220231','02310220232','02310220233','02310220300','02310220302','02310220303','02310220320','02310220321','02310220322','02310220323','02310220330','02310222310','02310222311','02310222312','02310222313','02310222331','02310222333','02310223200','02310223201','02310223202','02310223203','02310223212','02310223220','02310223221','02310223222','02310223223','02310223230','02310223232','02310300110','02310300111','02310300112','02310300113','02310300122','02310300123','02310300130','02310300131','02310300300','02310300301','02310300302','02310300303','02310300320','02310300321','02310300322','02310300323','02310302002','02310302003','02310302012','02310302013','02310302020','02310302021','02310302022','02310302023','02310302030','02310302031','02310302032','02310302033','02310302101','02310302120','02310302121','02310302122','02310302123','02310302200','02310302201','02310302210','02310302211','02310302212','02310302213','02310302230','02310302231','02310302232','02310302233','02310302300','02310302301','02310302302','02310302320','02310311230','02310311231','02310311232','02310311233','02310311320','02310311321','02310311322','02310311323','02310311330','02310311332','02310313010','02310313011','02310313012','02310313013','02310313030','02310313031','02310313032','02310313033','02310313100','02310313101','02310313102','02310313103','02310313110','02310313112','02310313120','02310313121','02310313122','02310313123','02310313130','02310313132','02310313210','02310313211','02310313212','02310313213','02310313300','02310313301','02310313302','02310313303','02310313310','02310313312','02310322223','02310322232','02310322233','02310331033','02310331211','02310331213','02310331231','02310331300','02310331301','02310331302','02310331303','02310331320','02310331321','02311011000','02311011001','02311011002','02311011003','02311011010','02311011011','02311011012','02311011013','02311011020','02311011021','02311011022','02311011023','02311011030','02311011031','02311011032','02311011033','02311011100','02311011101','02311013303','02311013312','02311013313','02311013321','02311013323','02311013330','02311013331','02311013332','02311013333','02311030103','02311030112','02311030113','02311030121','02311030123','02311030130','02311030131','02311030132','02311030133','02311030231','02311030233','02311030310','02311030311','02311030313','02311030320','02311030321','02311030322','02311030323','02311030330','02311030331','02311030332','02311030333','02311031002','02311031003','02311031020','02311031021','02311031022','02311031023','02311031200','02311031201','02311031202','02311031203','02311032011','02311032013','02311032031','02311032100','02311032101','02311032102','02311032103','02311032110','02311032111','02311032112','02311032113','02311032120','02311032121','02311032130','02311032131','02311033303','02311033312','02311033313','02311033321','02311033323','02311033330','02311033331','02311033332','02311033333','02311102011','02311102013','02311102030','02311102031','02311102032','02311102033','02311102100','02311102101','02311102102','02311102103','02311102120','02311102121','02311102122','02311102123','02311102130','02311102131','02311102132','02311102133','02311102202','02311102210','02311102211','02311102212','02311102213','02311102220','02311102221','02311102222','02311102223','02311102230','02311102231','02311102232','02311102233','02311102300','02311102301','02311102302','02311102303','02311102310','02311102311','02311102312','02311102313','02311102320','02311102321','02311102322','02311102323','02311102330','02311102331','02311102332','02311102333','02311103020','02311103022','02311103200','02311103202','02311103220','02311103222','02311103233','02311103320','02311103321','02311103322','02311103323','02311103330','02311103332','02311111113','02311112211','02311112213','02311112221','02311112223','02311112230','02311112231','02311112232','02311112233','02311112302','02311113232','02311113233','02311113322','02311113323','02311113330','02311113331','02311113332','02311113333','02311120010','02311120011','02311120100','02311120101','02311120103','02311120110','02311120111','02311120112','02311120113','02311120121','02311120130','02311120131','02311121000','02311121002','02311121011','02311121013','02311121020','02311121031','02311121100','02311121101','02311121102','02311121103','02311121110','02311121112','02311121120','02311121121','02311121130','02311123013','02311123031','02311123033','02311123102','02311123103','02311123112','02311123120','02311123121','02311123122','02311123123','02311123130','02311123132','02311123211','02311123300','02311123301','02311123310','02311130010','02311130011','02311131010','02311131011','02311131012','02311131013','02311131031','02311131033','02311131100','02311131101','02311131102','02311131103','02311131110','02311131111','02311131112','02311131113','02311131120','02311131121','02311131122','02311131123','02311131130','02311131131','02311131132','02311131133','02311131300','02311131301','02311131302','02311131303','02311131310','02311131312','02311203313','02311203331','02311210121','02311210123','02311210130','02311210131','02311210132','02311210133','02311210231','02311210232','02311210233','02311210301','02311210302','02311210303','02311210310','02311210311','02311210312','02311210313','02311210320','02311210321','02311210322','02311210323','02311210330','02311210331','02311210332','02311210333','02311211020','02311211021','02311211022','02311211023','02311211030','02311211031','02311211032','02311211033','02311211101','02311211103','02311211110','02311211111','02311211112','02311211113','02311211120','02311211121','02311211122','02311211123','02311211130','02311211131','02311211132','02311211133','02311211200','02311211201','02311211202','02311211203','02311211210','02311211212','02311211300','02311211301','02311211303','02311211310','02311211311','02311211312','02311211313','02311212011','02311212013','02311212100','02311212101','02311212102','02311212103','02311212110','02311212111','02311212112','02311212113','02311212120','02311212121','02311212122','02311212123','02311212130','02311212131','02311212132','02311212133','02311212200','02311212201','02311212202','02311212203','02311212212','02311212213','02311212220','02311212221','02311212223','02311212230','02311212231','02311212232','02311212233','02311212301','02311212302','02311212303','02311212310','02311212311','02311212320','02311212321','02311212322','02311212323','02311212331','02311213201','02311213203','02311213210','02311213211','02311213212','02311213213','02311213220','02311213222','02311221100','02311221101','02311221102','02311221103','02311221110','02311221111','02311221112','02311221113','02311221120','02311221121','02311221122','02311221123','02311221130','02311221131','02311221132','02311221133','02311222102','02311222120','02311222121','02311222122','02311222123','02311222132','02311222133','02311222300','02311222301','02311222310','02311222311','02311222312','02311222313','02311222330','02311222331','02311222332','02311222333','02311223022','02311223023','02311223113','02311223131','02311223133','02311223200','02311223201','02311223202','02311223203','02311223220','02311223221','02311223222','02311223223','02311223311','02311223313','02311223330','02311223331','02311223333','02311230001','02311230002','02311230010','02311230011','02311230020','02311230022','02311230100','02311230101','02311230121','02311230123','02311230130','02311230131','02311230132','02311230133','02311230212','02311230213','02311230230','02311230231','02311230232','02311230233','02311230301','02311230302','02311230303','02311230310','02311230311','02311230312','02311230313','02311230320','02311230321','02311230322','02311230323','02311230330','02311230331','02311230332','02311230333','02311231001','02311231003','02311231010','02311231012','02311231020','02311231021','02311231022','02311231023','02311231030','02311231032','02311231033','02311231200','02311231201','02311231202','02311231203','02311231210','02311231211','02311231212','02311231213','02311231220','02311231221','02311231222','02311231223','02311231230','02311231231','02311231232','02311231233','02311231300','02311231302','02311231320','02311231322','02311232000','02311232001','02311232002','02311232003','02311232010','02311232011','02311232012','02311232013','02311232020','02311232021','02311232022','02311232023','02311232030','02311232031','02311232032','02311232033','02311232100','02311232101','02311232102','02311232103','02311232110','02311232111','02311232112','02311232113','02311232120','02311232121','02311232122','02311232123','02311232130','02311232131','02311232132','02311232133','02311232200','02311232201','02311232202','02311232203','02311232210','02311232211','02311232212','02311232213','02311232220','02311232221','02311232222','02311232223','02311232230','02311232231','02311232232','02311232233','02311232300','02311232301','02311232302','02311232303','02311232310','02311232311','02311232312','02311232313','02311232320','02311232321','02311232330','02311232331','02311232333','02311233000','02311233001','02311233002','02311233003','02311233010','02311233011','02311233012','02311233013','02311233020','02311233021','02311233022','02311233023','02311233030','02311233031','02311233032','02311233033','02311233100','02311233101','02311233102','02311233103','02311233110','02311233111','02311233112','02311233113','02311233120','02311233130','02311233131','02311233133','02311233200','02311233201','02311233202','02311233203','02311233210','02311233211','02311233212','02311233213','02311233220','02311233221','02311233222','02311233223','02311233230','02311233231','02311233302','02311300101','02311300103','02311300110','02311300111','02311300112','02311300113','02311300121','02311300123','02311300130','02311300131','02311300132','02311300133','02311300310','02311300311','02311300312','02311300313','02311300330','02311300331','02311300332','02311300333','02311301000','02311301001','02311301002','02311301003','02311301010','02311301012','02311301020','02311301021','02311301022','02311301023','02311301030','02311301200','02311301201','02311301202','02311301203','02311301220','02311301221','02311301222','02311301223','02311302110','02311302111','02311302112','02311302113','02311302130','02311302131','02311302132','02311302133','02311302310','02311302311','02311303000','02311303001','02311303002','02311303003','02311303020','02311303021','02311303022','02311303133','02311303311','02311312022','02311312023','02311312030','02311312031','02311312032','02311312033','02311312120','02311312122','02311312200','02311312201','02311312202','02311312203','02311312210','02311312211','02311312212','02311312213','02311312230','02311312231','02311312233','02311312300','02311312302','02311312320','02311312322','02311313110','02311313111','02311313112','02311313113','02311313130','02311313131','02311313132','02311313133','02311313233','02311313301','02311313303','02311313310','02311313311','02311313312','02311313313','02311313320','02311313321','02311313322','02311313323','02311313330','02311313331','02311313332','02311313333','02311320230','02311320231','02311320232','02311320233','02311320320','02311320322','02311322000','02311322002','02311322010','02311322011','02311322020','02311322022','02311322023','02311322100','02311322102','02311322200','02311322201','02311322203','02311322210','02311322212','02311322220','02311322221','02311322230','02311323001','02311323003','02311323010','02311323011','02311323012','02311323013','02311323030','02311323031','02311323032','02311323033','02311323100','02311323102','02311323120','02311323122','02311323131','02311323133','02311323210','02311323211','02311323212','02311323213','02311323231','02311323300','02311323302','02311323311','02311323320','02311331011','02311331013','02311331031','02311331033','02311331100','02311331101','02311331102','02311331103','02311331110','02311331111','02311331112','02311331113','02311331120','02311331121','02311331122','02311331123','02311331130','02311331131','02311331132','02311331133','02311331201','02311331203','02311331210','02311331211','02311331212','02311331213','02311331221','02311331230','02311331231','02311331232','02311331233','02311331300','02311331301','02311331302','02311331303','02311331310','02311331311','02311331312','02311331313','02311331320','02311331321','02311331322','02311331323','02311331330','02311331331','02311331332','02311331333','02311332020','02311332021','02311332022','02311332023','02311332031','02311332032','02311332033','02311332120','02311332121','02311332122','02311332123','02311332200','02311332201','02311332210','02311332211','02311332212','02311332213','02311332230','02311332231','02311332300','02311332301','02311332302','02311332320','02311333001','02311333003','02311333010','02311333011','02311333012','02311333013','02311333021','02311333023','02311333030','02311333031','02311333032','02311333033','02311333100','02311333101','02311333102','02311333103','02311333110','02311333111','02311333112','02311333113','02311333120','02311333121','02311333122','02311333123','02311333130','02311333131','02311333132','02311333133','02311333210','02311333211','02311333212','02311333213','02311333222','02311333223','02311333230','02311333231','02311333232','02311333233','02311333300','02311333301','02311333302','02311333303','02311333310','02311333311','02311333312','02311333313','02311333320','02311333321','02311333322','02311333323','02311333330','02311333331','02311333332','02311333333','02312001000','02312001001','02312001002','02312100001','02312100003','02312100010','02312100011','02312100012','02312100013','02312100031','02312100033','02312100100','02312100102','02312100120','02312100122','02313000033','02313000120','02313000121','02313000122','02313000123','02313000300','02313003321','02313003323','02313003330','02313003331','02313003332','02313003333','02313010000','02313010001','02313010010','02313010013','02313010021','02313010023','02313010030','02313010031','02313010033','02313010102','02313010111','02313010112','02313010113','02313010120','02313010121','02313010122','02313010123','02313010130','02313010131','02313010132','02313010133','02313010201','02313010212','02313010213','02313010230','02313010231','02313010233','02313010302','02313010303','02313010310','02313010311','02313010312','02313010320','02313010321','02313010322','02313010323','02313010330','02313010332','02313011002','02313011020','02313012001','02313012003','02313012010','02313012011','02313012012','02313012013','02313012021','02313012023','02313012030','02313012031','02313012032','02313012033','02313012100','02313012101','02313012102','02313012103','02313012110','02313012112','02313012120','02313012121','02313012122','02313012123','02313012130','02313012210','02313012211','02313012220','02313012222','02313012223','02313012300','02313012301','02313013110','02313013111','02313013112','02313013113','02313013123','02313013130','02313013131','02313013132','02313013133','02313013301','02313013310','02313013311','02313013312','02313013313','02313013321','02313013323','02313013330','02313013331','02313013332','02313013333','02313021101','02313021103','02313021110','02313021111','02313021112','02313021113','02313021121','02313021130','02313021131','02313023021','02313023022','02313023023','02313023030','02313023032','02313023033','02313023122','02313023200','02313023201','02313023203','02313023210','02313023211','02313023212','02313023213','02313023221','02313023230','02313023300','02313023302','02313023303','02313023312','02313030000','02313030001','02313030002','02313030003','02313030010','02313030020','02313030333','02313031101','02313031103','02313031110','02313031111','02313031112','02313031113','02313031130','02313031131','02313031133','02313031222','02313031223','02313032013','02313032030','02313032031','02313032032','02313032033','02313032111','02313032112','02313032113','02313032120','02313032121','02313032122','02313032123','02313032130','02313032131','02313032132','02313032133','02313032210','02313032211','02313032213','02313032300','02313032301','02313032302','02313032303','02313032310','02313032311','02313032312','02313032313','02313033000','02313033001','02313033002','02313033003','02313033020','02313033021','02313033022','02313100221','02313100223','02313100230','02313100232','02313100233','02313100312','02313100313','02313100330','02313100331','02313100333','02313101131','02313101132','02313101133','02313101201','02313101202','02313101203','02313101212','02313101220','02313101221','02313101222','02313101223','02313101230','02313101232','02313101310','02313101311','02313101313','02313101331','02313101333','02313102001','02313102002','02313102003','02313102010','02313102011','02313102012','02313102013','02313102020','02313102021','02313102022','02313102023','02313102030','02313102031','02313102032','02313102033','02313102102','02313102120','02313102133','02313102200','02313102201','02313102202','02313102203','02313102210','02313102211','02313102212','02313102213','02313102220','02313102221','02313102222','02313102223','02313102230','02313102231','02313102232','02313102233','02313102302','02313102311','02313102320','02313102322','02313102332','02313102333','02313103000','02313103001','02313103002','02313103003','02313103010','02313103012','02313103020','02313103021','02313103022','02313103023','02313103032','02313103033','02313103200','02313103201','02313103202','02313103203','02313103210','02313103211','02313103212','02313103221','02313110020','02313110022','02313110023','02313110030','02313110031','02313110032','02313110033','02313110113','02313110122','02313110131','02313110133','02313110200','02313110201','02313110202','02313110203','02313110210','02313110211','02313110212','02313110213','02313110220','02313110221','02313110222','02313110223','02313110230','02313110231','02313110232','02313110300','02313110311','02313111000','02313111001','02313111002','02313111003','02313111010','02313111011','02313111012','02313111020','02313111021','02313111022','02313111023','02313111030','02313111031','02313111032','02313111033','02313111101','02313111102','02313111103','02313111110','02313111111','02313111112','02313111113','02313111120','02313111121','02313111122','02313111123','02313111130','02313111131','02313111132','02313111133','02313111200','02313111201','02313111202','02313111203','02313111210','02313111211','02313111212','02313111213','02313111220','02313111221','02313111223','02313111230','02313111231','02313111232','02313111233','02313111300','02313111301','02313111302','02313111303','02313111310','02313111311','02313111312','02313111313','02313111320','02313111321','02313111330','02313111331','02313111332','02313111333','02313112031','02313112032','02313112033','02313112120','02313112121','02313112122','02313112123','02313112210','02313112211','02313112300','02313112301','02313113000','02313113001','02313113002','02313113003','02313113010','02313113011','02313113012','02313113020','02313113021','02313113023','02313113030','02313113031','02313113032','02313113033','02313113110','02313113111','02313113112','02313113113','02313113121','02313113122','02313113123','02313113130','02313113131','02313113132','02313113133','02313113210','02313113211','02313113212','02313113213','02313113230','02313113231','02313113232','02313113233','02313113300','02313113301','02313113302','02313113303','02313113310','02313113311','02313113312','02313113313','02313113320','02313113321','02313113322','02313113323','02313113330','02313113331','02313113332','02313113333','02313120000','02313120001','02313120002','02313120003','02313120010','02313120011','02313120012','02313120013','02313120020','02313120021','02313120022','02313120023','02313120030','02313120031','02313120032','02313120100','02313120101','02313120102','02313120103','02313120110','02313120111','02313120120','02313120201','02313131100','02313131101','02313131103','02313131110','02313131111','02313131112','02313131113','02313131121','02313131130','02313131131','02313131132','02313131133','02313201310','02313201311','02313201312','02313201313','02313210023','02313210032','02313210123','02313210132','02313210200','02313210201','02313210202','02313210203','02313210210','02313210211','02313210212','02313210213','02313210220','02313210221','02313210230','02313210231','02313210300','02313210301','02313210302','02313210303','02313210310','02313210311','02313210312','02313210313','02313210320','02313210321','02313210322','02313210323','02313210330','02313210331','02313210332','02313210333','02313212101','02313212110','03022023330','03022023331','03022023332','03022023333','03022032201','03022032202','03022032203','03022032210','03022032212','03022032220','03022032221','03022032222','03022032223','03022032230','03022200132','03022200133','03022200310','03022200311','03022200312','03022200313','03022200330','03022200331','03022200332','03022200333','03022201022','03022201023','03022201032','03022201033','03022201103','03022201110','03022201111','03022201112','03022201113','03022201120','03022201121','03022201122','03022201123','03022201130','03022201131','03022201132','03022201133','03022201200','03022201201','03022201202','03022201203','03022201210','03022201211','03022201212','03022201213','03022201220','03022201221','03022201222','03022201223','03022201230','03022201231','03022201232','03022201233','03022201300','03022201301','03022201302','03022201303','03022201320','03022201321','03022201322','03022202203','03022202212','03022202213','03022202220','03022202221','03022202222','03022202223','03022202230','03022202231','03022202232','03022202233','03022202302','03022202303','03022202320','03022202321','03022202322','03022202323','03022202330','03022202332','03022203201','03022203202','03022203203','03022203210','03022203211','03022203212','03022203213','03022203220','03022203221','03022203222','03022203223','03022203230','03022203231','03022203232','03022203233','03022203300','03022203302','03022203320','03022203322','03022210000','03022210002','03022210020','03022212211','03022212213','03022212300','03022212301','03022212302','03022212303','03022212310','03022212312','03022212313','03022212320','03022212321','03022212322','03022212323','03022212330','03022212331','03022212332','03022212333','03022213202','03022213203','03022213212','03022213220','03022213221','03022213222','03022213223','03022213230','03022213232','03022213311','03022213313','03022213331','03022213333','03022220000','03022220001','03022220002','03022220003','03022220010','03022220011','03022220012','03022220013','03022220020','03022220021','03022220030','03022220031','03022220033','03022220100','03022220101','03022220102','03022220103','03022220110','03022220112','03022220113','03022220120','03022220121','03022220122','03022220123','03022220130','03022220131','03022220132','03022220133','03022220211','03022220213','03022220231','03022220300','03022220301','03022220302','03022220303','03022220310','03022220311','03022220312','03022220313','03022220320','03022220321','03022220322','03022220323','03022220330','03022220331','03022220332','03022220333','03022221000','03022221001','03022221003','03022221010','03022221011','03022221012','03022221013','03022221021','03022221023','03022221030','03022221031','03022221032','03022221033','03022221100','03022221102','03022221120','03022221121','03022221122','03022221200','03022221201','03022221202','03022221203','03022221210','03022221211','03022221212','03022221213','03022221220','03022221221','03022221222','03022221223','03022221230','03022221231','03022221232','03022221233','03022221300','03022221302','03022221320','03022221322','03022221323','03022222111','03022222113','03022222131','03022223000','03022223001','03022223002','03022223003','03022223010','03022223011','03022223012','03022223013','03022223020','03022223021','03022223023','03022223030','03022223031','03022223032','03022223033','03022223100','03022223101','03022223102','03022223103','03022223120','03022223121','03022223122','03022223123','03022223130','03022223131','03022223132','03022223133','03022223201','03022223203','03022223210','03022223211','03022223212','03022223213','03022223221','03022223230','03022223231','03022223300','03022223301','03022223302','03022223303','03022223310','03022223311','03022223312','03022223313','03022223330','03022223331','03022230101','03022230103','03022230110','03022230111','03022230112','03022230113','03022230121','03022230130','03022230131','03022230233','03022230300','03022230301','03022230302','03022230303','03022230310','03022230311','03022230312','03022230313','03022230320','03022230321','03022230322','03022230323','03022230330','03022230331','03022230332','03022230333','03022231000','03022231001','03022231002','03022231003','03022231010','03022231012','03022231020','03022231021','03022231030','03022231113','03022231130','03022231131','03022231132','03022231133','03022231200','03022231202','03022231203','03022231220','03022231221','03022231222','03022231223','03022231301','03022231303','03022231310','03022231311','03022231312','03022231313','03022231321','03022231323','03022231330','03022231331','03022231332','03022231333','03022232003','03022232010','03022232011','03022232012','03022232013','03022232021','03022232030','03022232031','03022232033','03022232100','03022232101','03022232102','03022232103','03022232110','03022232111','03022232112','03022232113','03022232120','03022232121','03022232122','03022232123','03022232130','03022232131','03022232132','03022232133','03022232211','03022232300','03022232301','03022232310','03022232311','03022233000','03022233002','03022233020','03022233022','03022233200','03022233212','03022233213','03022233230','03022233231','03022233232','03022233233','03022233302','03022233303','03022233320','03022233321','03022233322','03022233323','03022302022','03022302023','03022302032','03022302200','03022302201','03022302202','03022302203','03022302210','03022302211','03022302212','03022302213','03022302220','03022302221','03022302222','03022302223','03022302230','03022302231','03022302232','03022302233','03022302302','03022302320','03022302321','03022302322','03022302323','03022302332','03022313011','03022313012','03022313013','03022313021','03022313023','03022313030','03022313031','03022313032','03022313033','03022313100','03022313102','03022313103','03022313112','03022313113','03022313120','03022313121','03022313122','03022313123','03022313130','03022313131','03022313201','03022313210','03022313211','03022313300','03022313312','03022313313','03022313321','03022313323','03022313330','03022313331','03022313332','03022313333','03022320002','03022320003','03022320010','03022320011','03022320012','03022320013','03022320020','03022320021','03022320022','03022320023','03022320030','03022320031','03022320033','03022320100','03022320101','03022320102','03022320103','03022320112','03022320113','03022320120','03022320121','03022320122','03022320123','03022320130','03022320131','03022320132','03022320133','03022320200','03022320201','03022320202','03022320203','03022320210','03022320211','03022320212','03022320213','03022320220','03022320221','03022320222','03022320223','03022320230','03022320231','03022320232','03022320233','03022320300','03022320301','03022320302','03022320303','03022320310','03022320311','03022320312','03022320313','03022320320','03022320321','03022320322','03022320323','03022320330','03022320331','03022320332','03022320333','03022321002','03022321003','03022321020','03022321021','03022321022','03022321023','03022321200','03022321201','03022321202','03022322030','03022322031','03022322032','03022322033','03022322103','03022322110','03022322120','03022322121','03022322122','03022322123','03022322130','03022322131','03022322132','03022322133','03022322210','03022322211','03022322212','03022322213','03022322230','03022322231','03022322300','03022322301','03022322302','03022322303','03022322320','03022322321','03022323021','03022323022','03022323023','03022323122','03022323123','03022323132','03022323133','03022323200','03022323201','03022323202','03022323203','03022323210','03022323211','03022323212','03022323213','03022323231','03022323232','03022323233','03022323300','03022323301','03022323302','03022323303','03022323310','03022323311','03022323312','03022323313','03022323320','03022323321','03022323322','03022323323','03022323330','03022323331','03022323332','03022323333','03022330332','03022330333','03022331110','03022331111','03022331112','03022331113','03022331121','03022331123','03022331130','03022331131','03022331132','03022331133','03022331211','03022331212','03022331213','03022331220','03022331221','03022331222','03022331223','03022331230','03022331231','03022331232','03022331233','03022331300','03022331301','03022331302','03022331303','03022331310','03022331311','03022331312','03022331313','03022331320','03022331321','03022331322','03022331323','03022331330','03022331332','03022332002','03022332003','03022332010','03022332011','03022332012','03022332013','03022332020','03022332021','03022332022','03022332023','03022332030','03022332031','03022332032','03022332033','03022332101','03022332103','03022332110','03022332111','03022332112','03022332113','03022332122','03022332123','03022332132','03022332200','03022332201','03022332202','03022332203','03022332210','03022332211','03022332212','03022332213','03022332220','03022332221','03022332222','03022332223','03022332230','03022332231','03022332232','03022332233','03022332300','03022332301','03022332302','03022332303','03022332310','03022332312','03022332320','03022332321','03022332322','03022332323','03022332330','03022332331','03022332332','03022332333','03022333000','03022333001','03022333002','03022333003','03022333010','03022333011','03022333012','03022333013','03022333100','03022333101','03022333110','03022333220','03022333221','03022333222','03022333223','03022333230','03022333232','03023033033','03023033120','03023033121','03023033122','03023033123','03023033130','03023033132','03023033210','03023033211','03023033212','03023033213','03023033230','03023033231','03023033300','03023033301','03023033302','03023033303','03023033310','03023033312','03023033320','03023033321','03023033330','03023202202','03023202203','03023202212','03023202213','03023202220','03023202221','03023202222','03023202223','03023202230','03023202231','03023202232','03023202233','03023202302','03023202303','03023202320','03023202321','03023202322','03023202323','03023202330','03023202331','03023202332','03023202333','03023203130','03023203131','03023203132','03023203133','03023203202','03023203203','03023203212','03023203213','03023203220','03023203221','03023203222','03023203223','03023203230','03023203231','03023203232','03023203233','03023203300','03023203301','03023203302','03023203303','03023203310','03023203311','03023203312','03023203313','03023203320','03023203321','03023203322','03023203323','03023203330','03023203331','03023203332','03023203333','03023210110','03023210111','03023210112','03023210113','03023210131','03023210133','03023210230','03023210231','03023210232','03023210233','03023210311','03023210313','03023210322','03023210331','03023210333','03023211000','03023211001','03023211002','03023211003','03023211010','03023211011','03023211012','03023211013','03023211020','03023211021','03023211022','03023211023','03023211030','03023211031','03023211032','03023211033','03023211131','03023211132','03023211133','03023211200','03023211201','03023211202','03023211203','03023211210','03023211211','03023211212','03023211213','03023211220','03023211221','03023211222','03023211223','03023211230','03023211232','03023211310','03023211311','03023211312','03023211313','03023211330','03023211331','03023212001','03023212002','03023212003','03023212010','03023212011','03023212012','03023212013','03023212020','03023212021','03023212022','03023212023','03023212030','03023212031','03023212032','03023212033','03023212100','03023212102','03023212111','03023212120','03023212122','03023212200','03023212201','03023212202','03023212203','03023212210','03023212211','03023212212','03023212213','03023212220','03023212222','03023212223','03023212232','03023212233','03023212300','03023212312','03023212313','03023212330','03023212331','03023212332','03023212333','03023213000','03023213001','03023213112','03023213121','03023213123','03023213130','03023213132','03023213133','03023213220','03023213221','03023213222','03023213223','03023213230','03023213232','03023213300','03023213301','03023213303','03023213310','03023213311','03023213312','03023213313','03023213321','03023213323','03023213330','03023213331','03023213332','03023213333','03023220000','03023220001','03023220002','03023220003','03023220010','03023220011','03023220012','03023220013','03023220020','03023220021','03023220022','03023220023','03023220030','03023220031','03023220032','03023220033','03023220100','03023220101','03023220102','03023220103','03023220110','03023220111','03023220112','03023220113','03023220120','03023220122','03023220123','03023220130','03023220131','03023220132','03023220133','03023220200','03023220201','03023220202','03023220210','03023220211','03023220212','03023220213','03023220230','03023220231','03023220232','03023220233','03023220300','03023220301','03023220302','03023220303','03023220310','03023220311','03023220312','03023220313','03023220320','03023220321','03023220322','03023220323','03023220330','03023220331','03023220332','03023220333','03023221000','03023221001','03023221002','03023221003','03023221010','03023221011','03023221012','03023221013','03023221020','03023221021','03023221022','03023221023','03023221030','03023221031','03023221032','03023221033','03023221100','03023221101','03023221102','03023221103','03023221110','03023221111','03023221112','03023221113','03023221120','03023221121','03023221122','03023221123','03023221130','03023221131','03023221132','03023221200','03023221201','03023221202','03023221203','03023221210','03023221211','03023221212','03023221213','03023221220','03023221221','03023221222','03023221223','03023221230','03023221231','03023221232','03023221233','03023221300','03023221301','03023221302','03023221303','03023221310','03023221311','03023221312','03023221313','03023221320','03023221321','03023221322','03023221323','03023221330','03023221331','03023221332','03023221333','03023222010','03023222011','03023222100','03023222101','03023222110','03023222111','03023223000','03023223001','03023223010','03023223011','03023223100','03023223101','03023223110','03023223111','03023223301','03023223303','03023223310','03023223311','03023223312','03023223313','03023223321','03023223323','03023223330','03023223331','03023223332','03023223333','03023230000','03023230001','03023230002','03023230003','03023230010','03023230012','03023230013','03023230020','03023230021','03023230030','03023230031','03023230102','03023230110','03023230111','03023230113','03023230120','03023230132','03023230133','03023230200','03023230202','03023230203','03023230212','03023230213','03023230220','03023230221','03023230222','03023230223','03023230230','03023230231','03023230232','03023230233','03023230300','03023230301','03023230302','03023230303','03023230310','03023230311','03023230312','03023230313','03023230320','03023230321','03023230322','03023230323','03023230330','03023230331','03023230332','03023230333','03023231000','03023231001','03023231002','03023231003','03023231010','03023231011','03023231012','03023231013','03023231021','03023231023','03023231030','03023231031','03023231032','03023231033','03023231100','03023231101','03023231102','03023231103','03023231110','03023231111','03023231112','03023231113','03023231120','03023231121','03023231122','03023231123','03023231130','03023231131','03023231132','03023231133','03023231200','03023231201','03023231202','03023231203','03023231210','03023231211','03023231212','03023231213','03023231220','03023231221','03023231222','03023231223','03023231230','03023231231','03023231232','03023231233','03023231300','03023231301','03023231302','03023231303','03023231310','03023231311','03023231312','03023231313','03023231320','03023231321','03023231322','03023231323','03023231330','03023231331','03023231332','03023231333','03023232000','03023232001','03023232010','03023232011','03023232013','03023232100','03023232101','03023232102','03023232103','03023232110','03023232111','03023232112','03023232113','03023232120','03023232121','03023232122','03023232123','03023232130','03023232131','03023232132','03023232133','03023232200','03023232201','03023232202','03023232203','03023232220','03023232221','03023232222','03023232223','03023232230','03023232232','03023232301','03023232310','03023232311','03023232312','03023232313','03023232321','03023232322','03023232323','03023232331','03023232332','03023232333','03023233000','03023233002','03023233010','03023233011','03023233012','03023233013','03023233020','03023233021','03023233022','03023233023','03023233030','03023233031','03023233032','03023233033','03023233100','03023233101','03023233102','03023233103','03023233110','03023233111','03023233112','03023233113','03023233120','03023233121','03023233122','03023233123','03023233130','03023233131','03023233132','03023233133','03023233200','03023233201','03023233202','03023233203','03023233210','03023233211','03023233212','03023233213','03023233220','03023233221','03023233222','03023233223','03023233230','03023233231','03023233232','03023233233','03023233300','03023233301','03023233302','03023233303','03023233310','03023233311','03023233312','03023233313','03023233320','03023233321','03023233322','03023233323','03023233330','03023233331','03023233332','03023233333','03023300020','03023300022','03023300023','03023300200','03023300201','03023300202','03023300203','03023300210','03023300212','03023300220','03023300221','03023300222','03023300223','03023301313','03023301322','03023301323','03023301330','03023301331','03023301332','03023301333','03023302310','03023302311','03023302312','03023302313','03023302323','03023302330','03023302331','03023302332','03023302333','03023303100','03023303101','03023303102','03023303103','03023303110','03023303111','03023303112','03023303113','03023303120','03023303121','03023303122','03023303123','03023303130','03023303131','03023303132','03023303133','03023303200','03023303201','03023303202','03023303203','03023303213','03023303220','03023303221','03023303222','03023303223','03023303230','03023303231','03023303232','03023303233','03023303300','03023303301','03023303302','03023303303','03023303310','03023303311','03023303312','03023303313','03023303320','03023303321','03023303322','03023303323','03023303330','03023303331','03023303332','03023310200','03023310201','03023310202','03023310203','03023310220','03023310221','03023310222','03023310223','03023312000','03023312001','03023312002','03023312003','03023312010','03023312011','03023312012','03023312013','03023312020','03023312021','03023312022','03023312200','03023312202','03023320020','03023320021','03023320022','03023320023','03023320030','03023320031','03023320032','03023320033','03023320101','03023320103','03023320110','03023320111','03023320112','03023320113','03023320120','03023320121','03023320122','03023320123','03023320130','03023320131','03023320132','03023320133','03023320200','03023320201','03023320202','03023320203','03023320210','03023320211','03023320212','03023320213','03023320220','03023320221','03023320222','03023320223','03023320230','03023320231','03023320232','03023320233','03023320300','03023320301','03023320302','03023320303','03023320310','03023320311','03023320312','03023320313','03023320320','03023320321','03023320322','03023320323','03023320330','03023320331','03023320332','03023320333','03023321000','03023321001','03023321002','03023321003','03023321010','03023321011','03023321012','03023321013','03023321020','03023321021','03023321022','03023321023','03023321030','03023321031','03023321032','03023321033','03023321100','03023321101','03023321102','03023321103','03023321110','03023321120','03023321121','03023321122','03023321123','03023321130','03023321132','03023321200','03023321201','03023321202','03023321203','03023321210','03023321211','03023321212','03023321213','03023321220','03023321221','03023321222','03023321223','03023321230','03023321231','03023321232','03023321233','03023321300','03023321301','03023321302','03023321320','03023321321','03023321322','03023321323','03023321332','03023322000','03023322001','03023322002','03023322003','03023322010','03023322011','03023322012','03023322013','03023322020','03023322021','03023322022','03023322023','03023322030','03023322031','03023322032','03023322033','03023322100','03023322101','03023322102','03023322103','03023322110','03023322111','03023322112','03023322113','03023322120','03023322121','03023322122','03023322123','03023322130','03023322131','03023322132','03023322133','03023322200','03023322201','03023322202','03023322203','03023322210','03023322211','03023322212','03023322213','03023322220','03023322221','03023322222','03023322223','03023322230','03023322231','03023322232','03023322233','03023322300','03023322301','03023322302','03023322303','03023322310','03023322311','03023322312','03023322313','03023322320','03023322321','03023322322','03023322323','03023322330','03023322332','03023322333','03023323000','03023323001','03023323002','03023323003','03023323010','03023323011','03023323012','03023323013','03023323020','03023323021','03023323023','03023323030','03023323031','03023323032','03023323033','03023323100','03023323101','03023323102','03023323103','03023323110','03023323112','03023323113','03023323120','03023323121','03023323122','03023323123','03023323130','03023323131','03023323132','03023323133','03023323201','03023323210','03023323211','03023323300','03023323301','03023323302','03023323303','03023323310','03023323311','03023323312','03023323313','03023330222','03023330223','03023332000','03023332001','03023332002','03023332003','03023332010','03023332012','03023332020','03023332021','03023332022','03023332023','03023332030','03023332032','03023332201','03023332202','03023332203','03023332212','03023332220','03023332221','03113321330','03113321331','03113321332','03113321333','03113322302','03113322303','03113322320','03113322321','03113322323','03113322330','03113322331','03113322332','03113322333','03113323110','03113323111','03113323112','03113323113','03113323203','03113323212','03113323213','03113323220','03113323221','03113323222','03113323223','03113323231','03113323232','03113323233','03113323300','03113323302','03113323303','03113323312','03113323320','03113323321','03113323322','03113323323','03113323330','03113323331','03113323332','03113330011','03113330013','03113330031','03113330102','03113330120','03113330202','03113330203','03113330212','03113330220','03113330221','03113330222','03113330223','03113330230','03113332000','03113332001','03113332002','03131010323','03131010332','03131012110','03131013121','03131013123','03131013130','03131013131','03131013132','03131013133','03131013211','03131013213','03131013300','03131013301','03131013302','03131013310','03131013311','03131023011','03131023100','03131023312','03131023313','03131023330','03131023331','03131031201','03131031203','03131031210','03131031212','03131031231','03131031232','03131031233','03131031320','03131031321','03131031322','03131031323','03131031332','03131033010','03131033011','03131033100','03131033101','03131033102','03131033103','03131033200','03131100111','03131100121','03131100123','03131100130','03131100132','03131101000','03131101001','03131101010','03131102020','03131102022','03131103110','03131103111','03131103112','03131103113','03131110332','03131110333','03131111222','03131112110','03131112111','03131112112','03131112113','03131112310','03131112311','03131113000','03131113002','03131113020','03131113021','03131113022','03131113023','03131113200','03131113201','03131113321','03131113323','03131121111','03131121113','03131121130','03131121131','03131121132','03131121133','03131121310','03131121311','03131121312','03131121313','03131121321','03131121322','03131121323','03131121330','03131121331','03131121332','03131121333','03131123011','03131123100','03131123101','03131123110','03131123111','03131123112','03131123113','03131123313','03131123331','03131130000','03131130002','03131130022','03131130023','03131130031','03131130032','03131130033','03131130112','03131130113','03131130121','03131130122','03131130123','03131130130','03131130131','03131130132','03131130133','03131130200','03131130201','03131130202','03131130203','03131130210','03131130211','03131130212','03131130213','03131130220','03131130221','03131130222','03131130223','03131130230','03131130232','03131130300','03131130301','03131130302','03131130303','03131130310','03131130311','03131130312','03131130313','03131130331','03131130333','03131131003','03131131012','03131131020','03131131021','03131131022','03131131030','03131131123','03131131132','03131131200','03131131202','03131131203','03131131211','03131131212','03131131213','03131131220','03131131221','03131131222','03131131230','03131131231','03131131300','03131131301','03131131302','03131131310','03131131313','03131131320','03131131331','03131132000','03131132001','03131132002','03131132003','03131132010','03131132011','03131132012','03131132021','03131132030','03131132031','03131132032','03131132033','03131132100','03131132111','03131132113','03131132120','03131132122','03131132132','03131132133','03131132202','03131132203','03131132211','03131132212','03131132213','03131132220','03131132221','03131132230','03131132231','03131132233','03131132300','03131132302','03131132310','03131132311','03131132320','03131132321','03131132322','03131132323','03131132330','03131132332','03131132333','03131133000','03131133002','03131133003','03131133020','03131133021','03131133022','03131133023','03131133030','03131133032','03131133100','03131133101','03131133102','03131133103','03131133200','03131133201','03131133203','03131133210','03131133212','03131133220','03131133221','03131133222','03131133223','03131133230','03131133232','03131133323','03131133330','03131133332','03131201311','03131201313','03131201331','03131210202','03131211012','03131211013','03131301222','03131301223','03131301232','03131301323','03131301332','03131301333','03131303000','03131303001','03131303010','03131303101','03131303102','03131303103','03131303110','03131303111','03131303112','03131303120','03131303121','03131303130','03131303131','03131303133','03131303233','03131303312','03131303322','03131310010','03131310011','03131310012','03131310013','03131310022','03131310031','03131310033','03131310100','03131310101','03131310102','03131310103','03131310110','03131310111','03131310112','03131310113','03131310120','03131310121','03131310130','03131310131','03131310200','03131310212','03131310213','03131310230','03131310231','03131310302','03131310323','03131310332','03131311000','03131311001','03131311002','03131311003','03131311011','03131311012','03131311013','03131311030','03131311031','03131311032','03131311033','03131311100','03131311102','03131311113','03131311120','03131311121','03131311122','03131311123','03131311131','03131311210','03131311211','03131311213','03131311220','03131311221','03131311222','03131311223','03131311231','03131311232','03131311233','03131311300','03131311301','03131311302','03131311303','03131311310','03131311312','03131311320','03131311321','03131311322','03131311323','03131311330','03131311331','03131311332','03131311333','03131312000','03131312001','03131312002','03131312003','03131312010','03131312012','03131312013','03131312020','03131312021','03131312022','03131312030','03131312031','03131312101','03131312103','03131312110','03131312112','03131312312','03131312313','03131312322','03131312323','03131312330','03131312331','03131312332','03131312333','03131313001','03131313002','03131313003','03131313010','03131313011','03131313012','03131313013','03131313020','03131313021','03131313023','03131313030','03131313031','03131313032','03131313033','03131313100','03131313101','03131313102','03131313103','03131313110','03131313111','03131313112','03131313113','03131313120','03131313121','03131313122','03131313123','03131313130','03131313131','03131313132','03131313133','03131313202','03131313203','03131313210','03131313211','03131313212','03131313220','03131313221','03131313222','03131313223','03131313230','03131313232','03131313233','03131313300','03131313301','03131313310','03131313311','03131313312','03131313313','03131313321','03131313322','03131313323','03131313330','03131313331','03131313332','03131313333','03131320131','03131320133','03131321011','03131321013','03131321020','03131321021','03131321022','03131321023','03131321031','03131321033','03131321100','03131321102','03131321120','03131330001','03131330003','03131330010','03131330012','03131330100','03131330101','03131330110','03133111233','03133113232','03133113233','03133131010','03133131011','03133131222','03133131223','03133131303','03133131321','03133213132','03133213133','03133213310','03133213311','03133213312','03133213313','03133213330','03133213331','03133221113','03133221310','03133221311','03133221312','03133221313','03133221321','03133221330','03133221331','03133221332','03133223133','03133223311','03133223312','03133223313','03133223330','03133223331','03133223332','03133223333','03133230002','03133230100','03133230101','03133230212','03133230213','03133230231','03133231032','03133231133','03133231210','03133232022','03133232200','03133232201','03133233133','03133233311','03133233333','03133302200','03133303201','03133303202','03133303203','03133303210','03133303212','03133303220','03133303221','03133311102','03133311103','03133311120','03133311121','03133312221','03133312223','03133312230','03133312231','03133312232','03133312233','03133312303','03133312312','03133312320','03133312321','03133312322','03133320022','03133320332','03133321212','03133321213','03133322110','03133322120','03133322121','03133322122','03133322123','03133322222','03133323222','03133330001','03133330002','03133330003','03133330010','03133330011','03133330012','03133330021','03133330100','03133330112','03133330130','03133331321','03133331323','03133331332','03133332003','03133332012','03133332021','03133332030','03133333021','03133333023','03133333030','03133333031','03133333032','03133333033','03200000001','03200000002','03200000003','03200000010','03200000011','03200000012','03200000013','03200000020','03200000021','03200000022','03200000023','03200000030','03200000032','03200000033','03200000103','03200000112','03200000113','03200000120','03200000121','03200000122','03200000123','03200000130','03200000131','03200000132','03200000133','03200000300','03200000301','03200000302','03200000303','03200000310','03200000311','03200000312','03200000313','03200000320','03200000321','03200000322','03200000323','03200000330','03200000331','03200000332','03200000333','03200001002','03200001020','03200001022','03200001200','03200001202','03200001203','03200001210','03200001212','03200001220','03200001221','03200001223','03200001230','03200001231','03200001232','03200002100','03200002101','03200002102','03200002103','03200002110','03200002111','03200002112','03200002113','03200002120','03200002121','03200002130','03200002131','03200002220','03200002222','03200003002','03200003003','03200003012','03200003013','03200003020','03200003021','03200003022','03200003023','03200003030','03200003031','03200003032','03200003033','03200003200','03200003201','03200003210','03200003211','03200010232','03200010233','03200010302','03200010303','03200010312','03200010313','03200010320','03200010321','03200010322','03200010323','03200010330','03200010331','03200010332','03200010333','03200011010','03200011011','03200011100','03200011101','03200011201','03200011203','03200011210','03200011211','03200011212','03200011213','03200011220','03200011221','03200011223','03200011230','03200011231','03200011232','03200011233','03200011322','03200011323','03200011333','03200012010','03200012011','03200012012','03200012013','03200012030','03200012031','03200012032','03200012033','03200012100','03200012101','03200012102','03200012103','03200012110','03200012111','03200012112','03200012113','03200012120','03200012121','03200012122','03200012123','03200012130','03200012131','03200012132','03200012133','03200012210','03200012211','03200012212','03200012213','03200012230','03200012231','03200012232','03200012233','03200012300','03200012301','03200012302','03200012303','03200012310','03200012311','03200012320','03200012321','03200012322','03200012323','03200013011','03200013013','03200013100','03200013101','03200013102','03200013103','03200013111','03200013113','03200013121','03200013123','03200013130','03200013131','03200013132','03200013133','03200013301','03200013303','03200013310','03200013311','03200013312','03200013313','03200013321','03200013330','03200013331','03200013332','03200013333','03200020000','03200020001','03200020002','03200020003','03200020010','03200020012','03200020020','03200020021','03200020022','03200020023','03200020200','03200021301','03200021303','03200021310','03200021312','03200021321','03200021323','03200021330','03200023113','03200023130','03200023131','03200023132','03200023133','03200023311','03200023313','03200030113','03200030130','03200030131','03200030132','03200030133','03200030310','03200030311','03200030312','03200030313','03200030331','03200031002','03200031003','03200031012','03200031020','03200031021','03200031022','03200031023','03200031030','03200031032','03200031110','03200031111','03200031200','03200031201','03200031202','03200031203','03200031210','03200031212','03200031220','03200031310','03200031311','03200031312','03200031313','03200031321','03200031323','03200031330','03200031331','03200031332','03200031333','03200032002','03200032020','03200032021','03200032022','03200032023','03200032200','03200032201','03200032202','03200032203','03200033110','03200033111','03200100132','03200100133','03200100221','03200100222','03200100223','03200100230','03200100231','03200100232','03200100233','03200100310','03200100311','03200100312','03200100313','03200100320','03200100321','03200100322','03200100323','03200100330','03200100331','03200100332','03200100333','03200101010','03200101011','03200101012','03200101013','03200101022','03200101031','03200101033','03200101100','03200101101','03200101102','03200101103','03200101110','03200101111','03200101112','03200101113','03200101120','03200101121','03200101122','03200101130','03200101131','03200101133','03200101200','03200101201','03200101202','03200101203','03200101220','03200101221','03200101222','03200101223','03200102000','03200102001','03200102002','03200102003','03200102010','03200102011','03200102012','03200102013','03200102020','03200102021','03200102022','03200102023','03200102030','03200102031','03200102032','03200102100','03200102101','03200102102','03200102103','03200102110','03200102111','03200102112','03200102113','03200102120','03200102121','03200102122','03200102123','03200102130','03200102131','03200102132','03200102133','03200102200','03200102201','03200102202','03200102203','03200102210','03200102212','03200102220','03200102221','03200102222','03200102223','03200102230','03200102232','03200102300','03200102301','03200102303','03200102310','03200102311','03200102312','03200102313','03200103000','03200103001','03200103002','03200103003','03200103020','03200103021','03200103022','03200103023','03200103200','03200103201','03200103202','03200103203','03200110000','03200110001','03200110002','03200110003','03200110010','03200110011','03200110012','03200110020','03200110021','03200110030','03200110100','03200110101','03200110103','03200110110','03200110111','03200110112','03200110113','03200110121','03200110130','03200110131','03200110132','03200110133','03200110310','03200110311','03200110312','03200110313','03200110323','03200110330','03200110331','03200110332','03200110333','03200111000','03200111001','03200111002','03200111003','03200111010','03200111012','03200111020','03200111021','03200111022','03200111023','03200111030','03200111031','03200111032','03200111033','03200111122','03200111123','03200111132','03200111200','03200111201','03200111202','03200111203','03200111210','03200111211','03200111212','03200111213','03200111220','03200111221','03200111222','03200111223','03200111230','03200111231','03200111300','03200111301','03200111302','03200111303','03200111310','03200111312','03200111320','03200111321','03200111322','03200111323','03200111330','03200112101','03200112103','03200112110','03200112111','03200112112','03200112113','03200113000','03200113001','03200113002','03200113003','03200120000','03200120001','03200120010','03200120120','03200120121','03200120122','03200120123','03200120132','03200120200','03200120202','03200120211','03200120213','03200120220','03200120222','03200120300','03200120301','03200120302','03200120303','03200120310','03200120311','03200120312','03200120320','03200120321','03200121113','03200121121','03200121123','03200121130','03200121131','03200121132','03200121133','03200121310','03200121311','03200121312','03200121313','03200130020','03200130022','03200130123','03200130200','03200130201','03200130202','03200130203','03200130301','03200130310','03200133020','03200133021','03200133022','03200133023','03200200010','03200200011','03200200012','03200200013','03200200021','03200200023','03200200030','03200200031','03200200032','03200200033','03200200100','03200200101','03200200102','03200200103','03200200110','03200200111','03200200112','03200200113','03200200120','03200200121','03200200122','03200200123','03200200130','03200200131','03200200132','03200200133','03200200201','03200200210','03200200211','03200200213','03200200300','03200200301','03200200302','03200200303','03200200310','03200200311','03200200312','03200200313','03200200320','03200200321','03200200330','03200201000','03200201001','03200201002','03200201003','03200201010','03200201011','03200201012','03200201013','03200201020','03200201021','03200201022','03200201023','03200201030','03200201031','03200201032','03200201033','03200201200','03200201201','03200201202','03200201203','03200201210','03200201211','03200201212','03200201213','03200201223','03200201232','03200201233','03200202000','03200202001','03200202002','03200202003','03200202010','03200202012','03200202020','03200202021','03200202022','03200202023','03200202030','03200202031','03200202032','03200202033','03200202120','03200202121','03200202122','03200202123','03200202130','03200202131','03200202132','03200202133','03200202200','03200202201','03200202202','03200202203','03200202210','03200202211','03200202212','03200202213','03200202220','03200202221','03200202222','03200202223','03200202230','03200202231','03200202232','03200202233','03200202300','03200202301','03200202302','03200202303','03200202310','03200202311','03200202312','03200202313','03200202320','03200202321','03200202322','03200202323','03200202330','03200202331','03200202332','03200202333','03200203001','03200203003','03200203010','03200203011','03200203012','03200203013','03200203020','03200203021','03200203022','03200203023','03200203030','03200203031','03200203032','03200203033','03200203200','03200203201','03200203202','03200203203','03200203210','03200203212','03200203213','03200203220','03200203221','03200203222','03200203223','03200203230','03200203231','03200203232','03200203233','03200203302','03200203303','03200203312','03200203320','03200203321','03200203322','03200203323','03200203330','03200203332','03200203333','03200210002','03200210003','03200210012','03200210013','03200210020','03200210021','03200210022','03200210023','03200210030','03200210031','03200210032','03200210033','03200210120','03200210122','03200210200','03200210201','03200210210','03200210211','03200210212','03200210213','03200210230','03200210231','03200210232','03200210233','03200210300','03200210301','03200210302','03200210303','03200210310','03200210320','03200210321','03200210322','03200210323','03200211131','03200211133','03200211233','03200211301','03200211303','03200211310','03200211311','03200211312','03200211313','03200211321','03200211322','03200211330','03200211331','03200211332','03200212010','03200212011','03200212013','03200212030','03200212031','03200212032','03200212033','03200212100','03200212101','03200212102','03200212120','03200212121','03200212122','03200212123','03200212202','03200212203','03200212210','03200212211','03200212212','03200212213','03200212220','03200212221','03200212222','03200212223','03200212230','03200212231','03200212232','03200212233','03200212300','03200212301','03200212302','03200212303','03200212312','03200212313','03200212320','03200212321','03200212322','03200212323','03200212330','03200212331','03200212332','03200212333','03200213003','03200213010','03200213011','03200213012','03200213013','03200213021','03200213022','03200213023','03200213030','03200213031','03200213032','03200213033','03200213100','03200213101','03200213102','03200213103','03200213110','03200213112','03200213113','03200213120','03200213121','03200213122','03200213123','03200213130','03200213131','03200213132','03200213133','03200213200','03200213201','03200213202','03200213203','03200213210','03200213211','03200213220','03200213221','03200213222','03200213223','03200213300','03200213330','03200213332','03200213333','03200220000','03200220001','03200220002','03200220003','03200220010','03200220011','03200220012','03200220013','03200220020','03200220021','03200220022','03200220023','03200220030','03200220031','03200220032','03200220033','03200220100','03200220101','03200220102','03200220103','03200220110','03200220111','03200220112','03200220113','03200220120','03200220121','03200220122','03200220123','03200220130','03200220131','03200220132','03200220133','03200220200','03200220201','03200220202','03200220203','03200220210','03200220211','03200220212','03200220213','03200220220','03200220221','03200220222','03200220223','03200220230','03200220231','03200220232','03200220233','03200220300','03200220301','03200220302','03200220303','03200220310','03200220311','03200220312','03200220313','03200220320','03200220321','03200220322','03200220323','03200220330','03200220331','03200220332','03200220333','03200221000','03200221001','03200221002','03200221003','03200221010','03200221011','03200221012','03200221013','03200221020','03200221021','03200221022','03200221023','03200221030','03200221031','03200221032','03200221033','03200221100','03200221101','03200221102','03200221103','03200221110','03200221111','03200221112','03200221113','03200221120','03200221121','03200221122','03200221123','03200221130','03200221131','03200221132','03200221133','03200221200','03200221201','03200221202','03200221203','03200221210','03200221211','03200221212','03200221213','03200221220','03200221221','03200221222','03200221223','03200221230','03200221231','03200221232','03200221233','03200221300','03200221301','03200221302','03200221303','03200221310','03200221311','03200221312','03200221313','03200221320','03200221322','03200221331','03200222000','03200222001','03200222002','03200222003','03200222010','03200222011','03200222012','03200222013','03200222020','03200222021','03200222022','03200222023','03200222030','03200222031','03200222032','03200222033','03200222100','03200222101','03200222102','03200222103','03200222110','03200222111','03200222112','03200222113','03200222120','03200222121','03200222122','03200222123','03200222130','03200222131','03200222132','03200222133','03200222200','03200222201','03200222202','03200222203','03200222210','03200222211','03200222212','03200222213','03200222220','03200222221','03200222222','03200222223','03200222230','03200222231','03200222232','03200222233','03200222300','03200222301','03200222302','03200222303','03200222310','03200222311','03200222312','03200222313','03200222320','03200222321','03200222322','03200222323','03200222330','03200222331','03200222332','03200222333','03200223000','03200223001','03200223002','03200223003','03200223010','03200223011','03200223012','03200223013','03200223020','03200223021','03200223022','03200223023','03200223100','03200223200','03200223201','03200223202','03200223203','03200223220','03200223221','03200230000','03200230001','03200230002','03200230003','03200230010','03200230011','03200230012','03200230013','03200230020','03200230021','03200230022','03200230023','03200230030','03200230031','03200230032','03200230033','03200230100','03200230101','03200230102','03200230103','03200230110','03200230111','03200230112','03200230113','03200230120','03200230121','03200230122','03200230123','03200230130','03200230131','03200230132','03200230133','03200230200','03200230201','03200230202','03200230203','03200230210','03200230211','03200230212','03200230213','03200230220','03200230221','03200230222','03200230223','03200230230','03200230231','03200230232','03200230300','03200230302','03200231000','03200231002','03200231020','03200231101','03200231103','03200231110','03200231111','03200231112','03200231113','03200231120','03200231121','03200231122','03200231123','03200231130','03200231131','03200231132','03200231133','03200231300','03200231301','03200231302','03200231303','03200231310','03200231311','03200231312','03200231313','03200231321','03200231323','03200231330','03200231331','03200231332','03200231333','03200232120','03200232121','03200232122','03200232123','03200232130','03200232131','03200232132','03200232133','03200232211','03200232213','03200232300','03200232301','03200232302','03200232303','03200232310','03200232311','03200232312','03200232313','03200233033','03200233111','03200233122','03200233123','03200233132','03200233211','03200233300','03200233301','03200233302','03200233303','03200233310','03200300003','03200300012','03200300020','03200300021','03200300022','03200300023','03200300030','03200300031','03200300032','03200300033','03200300120','03200300122','03200300200','03200300201','03200300202','03200300203','03200300210','03200300211','03200300212','03200300213','03200300220','03200300221','03200300222','03200300223','03200300230','03200300231','03200300232','03200300233','03200300300','03200300302','03200300320','03200300322','03200301203','03200301212','03200301221','03200301222','03200301223','03200301230','03200301231','03200301232','03200301233','03200301320','03200301322','03200302001','03200302002','03200302003','03200302010','03200302011','03200302012','03200302013','03200302020','03200302021','03200302022','03200302023','03200302030','03200302031','03200302032','03200302100','03200302102','03200302222','03200302223','03200302232','03200302233','03200303001','03200303010','03200303011','03200303023','03200303032','03200303033','03200303102','03200303103','03200303112','03200303120','03200303121','03200303122','03200303123','03200303130','03200303132','03200303133','03200303201','03200303202','03200303203','03200303210','03200303211','03200303212','03200303213','03200303220','03200303221','03200303223','03200303230','03200303231','03200303232','03200303300','03200303301','03200303302','03200303303','03200303310','03200303311','03200303312','03200303321','03200303330','03200310123','03200310130','03200310131','03200310132','03200310133','03200310233','03200310301','03200310310','03200310311','03200310322','03200310323','03200310332','03200310333','03200311020','03200311021','03200311022','03200311023','03200311030','03200311031','03200311032','03200311033','03200311120','03200311121','03200311122','03200311123','03200311130','03200311131','03200311132','03200311133','03200311200','03200311201','03200311203','03200311210','03200311211','03200311212','03200311213','03200311300','03200311301','03200311302','03200311303','03200311310','03200311311','03200311312','03200311313','03200311330','03200311331','03200311332','03200311333','03200312000','03200312001','03200312002','03200312003','03200312010','03200312011','03200312012','03200312013','03200312021','03200312023','03200312030','03200312031','03200312032','03200312033','03200312100','03200312101','03200312102','03200312103','03200312110','03200312111','03200312112','03200312113','03200312120','03200312121','03200312122','03200312123','03200312130','03200312131','03200312132','03200312133','03200312210','03200312211','03200312300','03200312301','03200312310','03200312311','03200313112','03200313113','03200313123','03200313130','03200313131','03200313132','03200313133','03200313310','03200313311','03200320000','03200320001','03200320002','03200320003','03200320010','03200320011','03200320012','03200320013','03200320020','03200320021','03200320022','03200320023','03200320030','03200320031','03200320032','03200320033','03200320102','03200320103','03200320112','03200320120','03200320121','03200320122','03200320123','03200320130','03200320132','03200320200','03200320201','03200320202','03200320203','03200320210','03200320211','03200320212','03200320213','03200320220','03200320221','03200320222','03200320223','03200320230','03200320231','03200320232','03200320300','03200320302','03200320320','03200321131','03200321133','03200321301','03200321302','03200321303','03200321310','03200321311','03200321312','03200321313','03200321320','03200321321','03200321322','03200321323','03200321330','03200321331','03200321332','03200322000','03200322001','03200322012','03200322013','03200322030','03200322031','03200322033','03200322102','03200322103','03200322120','03200322121','03200322122','03200322211','03200322300','03200322301','03200330000','03200330001','03200330002','03200330003','03200330010','03200330011','03200330012','03200330013','03200330020','03200330021','03200330022','03200330023','03200330030','03200330031','03200330032','03200330033','03200330100','03200330102','03200330103','03200330120','03200330121','03200330122','03200330123','03200330200','03200330201','03200330210','03200330211','03200331132','03200331133','03200331222','03200331223','03200331310','03200331311','03200331312','03200332031','03200332033','03200332110','03200332111','03200332112','03200332113','03200332120','03200332121','03200332122','03200332123','03200332131','03200332132','03200332133','03200332203','03200332211','03200332212','03200332213','03200332220','03200332221','03200332222','03200332223','03200332230','03200332231','03200332232','03200332233','03200332300','03200332301','03200332302','03200332303','03200332310','03200332312','03200332320','03200332321','03200332322','03200332330','03200333000','03200333001','03200333002','03200333003','03200333012','03200333020','03200333021','03200333022','03200333023','03200333030','03201000333','03201001021','03201001023','03201001030','03201001031','03201001032','03201001033','03201001110','03201001111','03201001113','03201001120','03201001122','03201001123','03201001130','03201001131','03201001132','03201001133','03201001201','03201001203','03201001210','03201001211','03201001212','03201001213','03201001220','03201001221','03201001222','03201001223','03201001230','03201001231','03201001232','03201001233','03201001300','03201001301','03201001302','03201001303','03201001310','03201001311','03201001312','03201001313','03201001320','03201001321','03201001322','03201001323','03201001330','03201001331','03201001332','03201001333','03201002111','03201002113','03201002303','03201002311','03201002312','03201002313','03201002321','03201002330','03201002331','03201002332','03201002333','03201003000','03201003001','03201003002','03201003003','03201003010','03201003011','03201003012','03201003013','03201003022','03201003023','03201003030','03201003031','03201003032','03201003033','03201003100','03201003101','03201003102','03201003103','03201003110','03201003111','03201003112','03201003113','03201003120','03201003121','03201003122','03201003123','03201003130','03201003131','03201003132','03201003133','03201003200','03201003201','03201003202','03201003203','03201003210','03201003211','03201003212','03201003213','03201003220','03201003221','03201003222','03201003223','03201003230','03201003231','03201003232','03201003233','03201003300','03201003301','03201003302','03201003303','03201003310','03201003311','03201003312','03201003320','03201003321','03201003322','03201003323','03201010000','03201010001','03201010002','03201010003','03201010010','03201010011','03201010012','03201010013','03201010020','03201010021','03201010022','03201010023','03201010030','03201010031','03201010032','03201010033','03201010100','03201010101','03201010102','03201010103','03201010110','03201010111','03201010112','03201010113','03201010120','03201010121','03201010122','03201010123','03201010130','03201010131','03201010132','03201010133','03201010200','03201010201','03201010202','03201010203','03201010210','03201010211','03201010212','03201010213','03201010220','03201010221','03201010222','03201010223','03201010230','03201010231','03201010232','03201010233','03201010300','03201010301','03201010302','03201010303','03201010310','03201010311','03201010312','03201010313','03201010320','03201010321','03201010322','03201010323','03201010330','03201010331','03201010332','03201010333','03201011000','03201011001','03201011002','03201011003','03201011010','03201011011','03201011012','03201011013','03201011020','03201011021','03201011022','03201011023','03201011030','03201011031','03201011032','03201011033','03201011100','03201011101','03201011102','03201011103','03201011110','03201011111','03201011112','03201011113','03201011120','03201011121','03201011122','03201011123','03201011130','03201011131','03201011132','03201011200','03201011201','03201011202','03201011203','03201011210','03201011211','03201011212','03201011213','03201011220','03201011221','03201011222','03201011223','03201011230','03201011231','03201011232','03201012000','03201012001','03201012002','03201012003','03201012010','03201012011','03201012012','03201012013','03201012020','03201012021','03201012022','03201012023','03201012030','03201012031','03201012032','03201012033','03201012100','03201012101','03201012102','03201012103','03201012110','03201012111','03201012112','03201012113','03201012120','03201012121','03201012122','03201012123','03201012130','03201012131','03201012132','03201012133','03201012200','03201012201','03201012210','03201012211','03201012213','03201012300','03201012301','03201012302','03201012303','03201012310','03201012311','03201012312','03201012313','03201012321','03201012323','03201012330','03201012331','03201012332','03201013000','03201013001','03201013002','03201013003','03201013010','03201013012','03201013020','03201013021','03201013022','03201013023','03201013030','03201013200','03201013201','03201020110','03201020111','03201020112','03201020113','03201020132','03201020133','03201020203','03201020221','03201020310','03201020311','03201020332','03201020333','03201021000','03201021001','03201021002','03201021003','03201021010','03201021011','03201021012','03201021013','03201021031','03201021100','03201021101','03201021102','03201022101','03201022102','03201022103','03201022110','03201022111','03201022112','03201022113','03201022120','03201022121','03201022123','03201022130','03201022131','03201022132','03201022133','03201022310','03201022311','03201023000','03201023002','03201023003','03201023020','03201023021','03201023022','03201023033','03201023122','03201023123','03201023132','03201023200','03201023211','03201023230','03201023231','03201023232','03201023233','03201023300','03201023301','03201023302','03201023303','03201023310','03201023312','03201023313','03201023320','03201023321','03201023322','03201023323','03201023330','03201023331','03201023332','03201023333','03201030031','03201030033','03201030100','03201030101','03201030102','03201030103','03201030120','03201030121','03201030122','03201030123','03201032202','03201032220','03201032222','03201100000','03201100001','03201100002','03201100003','03201100010','03201100011','03201100012','03201100013','03201100020','03201100021','03201100100','03201100101','03201100102','03201100110','03201200020','03201200022','03201200023','03201200200','03201200201','03201200202','03201200203','03201200210','03201200211','03201200212','03201200213','03201200220','03201200221','03201200222','03201200223','03201200230','03201200231','03201200233','03201200300','03201200301','03201200302','03201200303','03201200312','03201200313','03201200320','03201200321','03201200322','03201200323','03201200330','03201200331','03201200332','03201200333','03201201010','03201201011','03201201100','03201201101','03201201110','03201201111','03201201202','03201201220','03201201222','03201202002','03201202020','03201202022','03201202023','03201202111','03201202200','03201202201','03201202233','03201202322','03201202323','03201202332','03201203000','03201210000','03201210002','03201210020','03201210021','03201210022','03201210023','03201210201','03201210203','03201210210','03201210212','03201210230','03201210232','03201212002','03201212003','03201212010','03201212012','03201220011','03201220022','03201220100','03201220101','03201220102','03201220103','03201220110','03201220120','03201220121','03201220200','03202000000','03202000001','03202000002','03202000003','03202000010','03202000011','03202000012','03202000013','03202000020','03202000021','03202000022','03202000023','03202000030','03202000031','03202000032','03202000033','03202000100','03202000101','03202000102','03202000103','03202000110','03202000111','03202000112','03202000113','03202000120','03202000121','03202000122','03202000123','03202000130','03202000131','03202000132','03202000200','03202000201','03202000202','03202000203','03202000210','03202000211','03202000212','03202000213','03202000220','03202000221','03202000222','03202000223','03202000230','03202000231','03202000232','03202000233','03202000300','03202000301','03202000302','03202000303','03202000310','03202000311','03202000312','03202000313','03202000320','03202000321','03202000322','03202000323','03202000330','03202000331','03202000332','03202000333','03202001000','03202001002','03202001020','03202001022','03202001200','03202001201','03202001202','03202001203','03202001212','03202001213','03202001220','03202001221','03202001222','03202001223','03202001230','03202001231','03202001232','03202001233','03202001302','03202001320','03202001321','03202001322','03202001323','03202001330','03202001331','03202001332','03202001333','03202002000','03202002001','03202002002','03202002003','03202002010','03202002011','03202002012','03202002013','03202002020','03202002021','03202002022','03202002023','03202002030','03202002031','03202002032','03202002033','03202002100','03202002101','03202002102','03202002103','03202002110','03202002111','03202002112','03202002113','03202002120','03202002121','03202002122','03202002123','03202002130','03202002131','03202002200','03202002201','03202002202','03202002210','03202002211','03202002220','03202002222','03202003000','03202003001','03202003002','03202003003','03202003010','03202003011','03202003012','03202003013','03202003020','03202003021','03202003023','03202003030','03202003032','03202003033','03202003101','03202003110','03202003111','03202003112','03202003113','03202003121','03202003123','03202003130','03202003131','03202003132','03202003133','03202010220','03202010221','03202010222','03202010223','03202010230','03202010232','03202010333','03202011222','03202011223','03202011232','03202012000','03202012001','03202012002','03202012003','03202012010','03202012012','03202012020','03202012021','03202012022','03202012030','03202012111','03202012113','03202012130','03202012131','03202012132','03202012133','03202012311','03202013000','03202013001','03202013002','03202013003','03202013010','03202013012','03202013020','03202013021','03202013022','03202013023','03202013030','03202013032','03202013111','03202013112','03202013113','03202013121','03202013123','03202013130','03202013131','03202013132','03202013133','03202013200','03202013201','03202013203','03202013210','03202013212','03202020000','03202100002','03202100003','03202100020','03202100021','03202100022','03202100023','03202100030','03202101311','03202101313','03202101323','03202101332','03202101333','03202102000','03202102001','03202102002','03202102003','03202102010','03202102012','03202102020','03202102021','03202102022','03202102023','03202102030','03202102032','03202102331','03202102333','03202103101','03202103103','03202103110','03202103111','03202103112','03202103113','03202103121','03202103122','03202103123','03202103130','03202103131','03202103132','03202103133','03202103202','03202103203','03202103212','03202103213','03202103220','03202103221','03202103222','03202103223','03202103230','03202103231','03202103232','03202103233','03202103301','03202103302','03202103310','03202103311','03202103312','03202103313','03202103320','03202103321','03202103322','03202103323','03202110001','03202110003','03202110010','03202110011','03202110012','03202110013','03202110100','03202110200','03202110201','03202110202','03202110203','03202110220','03202112000','03202112002','03202112003','03202112020','03202112021','03202112022','03202112023','03202112200','03202112201','03202121001','03202121010','03202121011','03202121023','03202121032','03202121033','03202121100','03202121101','03202121102','03202121111','03202121113','03202121201','03202121203','03202121210','03202121211','03202121212','03202121213','03202121221','03202121223','03202121230','03202121231','03202121232','03202121233','03202121300','03202121302','03202121311','03202121313','03202121320','03202121321','03202121322','03202121323','03202121331','03202121332','03202121333','03202123000','03202123001','03202123002','03202123003','03202123010','03202123011','03202123012','03202123013','03202123020','03202123021','03202123022','03202123023','03202123030','03202123031','03202123032','03202123033','03202123100','03202123101','03202123102','03202123103','03202123110','03202123111','03202123112','03202123113','03202123120','03202123121','03202123122','03202123123','03202123130','03202123131','03202123132','03202123133','03202123201','03202123210','03202123211','03202123212','03202123213','03202123300','03202123301','03202123310','03202123311','03202123322','03202123323','03202130000','03202130002','03202130003','03202130010','03202130012','03202130013','03202130020','03202130021','03202130022','03202130023','03202130030','03202130031','03202130032','03202130033','03202130122','03202130200','03202130201','03202130202','03202130203','03202130210','03202130211','03202130212','03202130213','03202130220','03202130221','03202130222','03202130223','03202130230','03202130231','03202130232','03202130233','03202130300','03202130302','03202130320','03202130321','03202130322','03202130323','03202132000','03202132001','03202132002','03202132003','03202132010','03202132011','03202132012','03202132013','03202132020','03202132021','03202132022','03202132023','03202132030','03202132031','03202132032','03202132033','03202132100','03202132101','03202132102','03202132103','03202132112','03202132120','03202132121','03202132122','03202132123','03202132130','03202132132','03202132133','03202132200','03202132201','03202132210','03202132211','03202132300','03202132301','03202132302','03202132303','03202132310','03202132311','03202132312','03202132313','03202301011','03202301013','03202301031','03202301033','03202301100','03202301101','03202301102','03202301103','03202301112','03202301113','03202301120','03202301121','03202301122','03202301123','03202301130','03202301131','03202301132','03202301133','03202301300','03202301301','03202301310','03202301311','03202301312','03202301313','03202310002','03202310003','03202310012','03202310013','03202310020','03202310021','03202310022','03202310023','03202310030','03202310031','03202310032','03202310033','03202310101','03202310102','03202310103','03202310110','03202310111','03202310112','03202310113','03202310120','03202310121','03202310122','03202310123','03202310130','03202310131','03202310132','03202310133','03202310200','03202310201','03202310203','03202310210','03202310211','03202310212','03202310213','03202310300','03202310301','03202310310','03202310311','03202310312','03202310313','03202310321','03202310323','03202310330','03202310331','03202310332','03202310333','03202311000','03202311002','03202311020','03202311022','03202311200','03202311202','03202311220','03202311222','03202312100','03202312101','03202312102','03202312103','03202312110','03202312111','03202312112','03202312113','03202312121','03202312123','03202312130','03202312131','03202312132','03202312133','03202313000','03202313002','03311001130','03311001131','03311001132','03311001133','03311001313','03311001331','03311003101','03311003103','03311003110','03311003112','03311003232','03311003233','03311003322','03311003323','03311010202','03311010220','03311011111','03311013033','03311013233','03311013322','03311021001','03311021003','03311021010','03311021011','03311021012','03311021013','03311021031','03311021100','03311021101','03311021102','03311021103','03311021120','03311021121','03311032210','03311032211','03311032212','03311032213','03311033103','03311033112','03311033121','03311033123','03311033130','03311033131','03311033132','03311100000','03311100121','03311100322','03311101000','03311101020','03311101021','03311101022','03311101023','03311101030','03311101031','03311101032','03311101033','03311101120','03311101121','03311101122','03311101123','03311101130','03311101201','03311101203','03311101210','03311101211','03311101212','03311101213','03311101230','03311101231','03311101233','03311101300','03311101301','03311103000','03311103001','03311103221','03311103223','03311110231','03311110233','03311110320','03311110322','03311111201','03311111203','03311111210','03311111333','03311113103','03311113112','03311113113','03311113120','03311113121','03311113122','03311113123','03311113130','03311113132','03311113300','03311113301','03311113310','03311113330','03311113331','03311113332','03311113333','03311120231','03311120233','03311120320','03311120321','03311120322','03311120323','03311121213','03311121232','03311122112','03311122113','03311122123','03311122130','03311122131','03311122132','03311122133','03311122213','03311122223','03311122230','03311122231','03311122232','03311122233','03311122300','03311122301','03311122302','03311122303','03311122310','03311122311','03311122312','03311122313','03311122320','03311122321','03311122322','03311122323','03311122330','03311122331','03311122332','03311122333','03311123002','03311123020','03311123032','03311123033','03311123202','03311123210','03311123211','03311123220','03311123221','03311123222','03311123223','03311123230','03311123231','03311123232','03311123233','03311123320','03311123322','03311123331','03311131031','03311131033','03311131101','03311131103','03311131112','03311131113','03311131120','03311131121','03311131122','03311131123','03311131130','03311131131','03311131132','03311131202','03311131203','03311131211','03311131212','03311131213','03311131220','03311131221','03311131230','03311131231','03311131300','03311131301','03311131302','03311131320','03311132110','03311132203','03311132212','03311132220','03311132221','03311132222','03311132223','03311132230','03311133001','03311133003','03311133010','03311133012','03311211011','03311211100','03311211102','03311300001','03311300003','03311300010','03311300011','03311300012','03311300013','03311300020','03311300021','03311300022','03311300023','03311300100','03311300101','03311300110','03312120230','03312120231','03312120233','03312122002','03312122003','03312122113','03312122131','03312122133','03312123000','03312123002','03312123020','03312123022','03312130032','03312130033','03312130210','12000313012','12000313013','12000313030','12000313031','12000313102','12001113301','12001113303','12001113310','12001113312','12001130332','12001130333','12001132110','12001132111','12001212211','12001212213','12001303030','12001303032','12001303033','12001310032','12001310033','12001310210','12001310211','12001310213','12001313201','12001313203','12001313210','12001313211','12001313212','12001313213','12001313230','12001313231','12001320203','12001320212','12001320213','12001320221','12001320230','12001320231','12002013303','12002013312','12002013321','12002013330','12002013332','12002122202','12002122220','12002122222','12002131010','12002131012','12002131031','12002131033','12002131120','12002131121','12002131122','12002131123','12002131130','12002131131','12002131132','12002131133','12002131202','12002131203','12002131211','12002131212','12002131221','12002131230','12002131300','12002131301','12002131303','12002132132','12002132133','12002132310','12002132311','12002132312','12002132313','12002133123','12002133130','12002133131','12002133132','12002133133','12002133310','12002300000','12002301321','12002301322','12002301323','12002301330','12002301332','12002330131','12002330133','12002331020','12002331021','12002331022','12002331023','12002332032','12002332033','12002332123','12002332132','12002332210','12002332211','12002332301','12002332310','12002332331','12002332333','12002333023','12002333032','12002333201','12002333210','12002333220','12002333222','12003013022','12003013023','12003013032','12003013200','12003013201','12003013210','12003023102','12003023103','12003031321','12003031323','12003031330','12003031332','12003032130','12003032132','12003033103','12003033112','12003033121','12003033130','12003102021','12003102023','12003102030','12003102032','12003111013','12003111102','12003111120','12003113301','12003113303','12003113310','12003113311','12003113312','12003113313','12003120033','12003120122','12003120211','12003120213','12003120300','12003120302','12003122033','12003122101','12003122103','12003122110','12003122111','12003122112','12003122113','12003122121','12003122122','12003122123','12003122130','12003122131','12003122132','12003122133','12003122211','12003122300','12003122310','12003122311','12003123002','12003123020','12003123022','12003200211','12003200213','12003200300','12003200302','12003200303','12003200312','12003200321','12003200330','12003201132','12003201133','12003201310','12003201311','12003202032','12003202033','12003202122','12003202123','12003202210','12003202211','12003202300','12003202301','12003203022','12003203023','12003203032','12003203133','12003203200','12003203201','12003203210','12003203311','12003211013','12003211031','12003211033','12003211102','12003211120','12003211122','12003211200','12003211201','12003212020','12003212021','12003212022','12003212023','12003212200','12003220103','12003220112','12003220121','12003220130','12003221220','12003221221','12003221222','12003221223','12003222311','12003222312','12003222313','12003222321','12003222323','12003222330','12003222331','12003222332','12003222333','12003223200','12003223202','12003223220','12003223222','12003230033','12003230122','12003230211','12003230300','12003230302','12003231302','12003231320','12003231321','12003231322','12003231323','12003232202','12003233022','12003233023','12003233200','12003233201','12010030022','12010030023','12010030200','12010030201','12010030202','12010030203','12010213322','12010213323','12010230223','12010230232','12010230233','12010231100','12010231101','12010232001','12010232010','12010232011','12010232012','12010321022','12010321023','12010321032','12010321200','12010321201','12010321210','12012000101','12012000103','12012000110','12012000111','12012000112','12012000113','12012000130','12012000131','12012001000','12012001002','12012001020','12012001230','12012001231','12012001232','12012001233','12012003233','12012003303','12012003312','12012003313','12012003320','12012003321','12012003322','12012003323','12012003330','12012003331','12012003332','12012003333','12012010221','12012010222','12012010223','12012010230','12012010232','12012011331','12012013200','12012013201','12012013202','12012013203','12012013220','12012013221','12012021011','12012021013','12012021100','12012021101','12012021102','12012021103','12012021110','12012021111','12012021112','12012021113','12012100202','12012100203','12012100220','12012100221','12012100222','12020020202','12020020220','12020022312','12020022313','12020022330','12020022331','12020022332','12020022333','12020023202','12020023220','12020023221','12020023222','12020023223','12020023230','12020023232','12020033032','12020033033','12020033213','12020033223','12020033230','12020033231','12020033232','12020033233','12020033320','12020033321','12020033322','12020033332','12020033333','12020101131','12020101133','12020110020','12020110022','12020110101','12020110103','12020110110','12020110112','12020110113','12020110121','12020110123','12020110130','12020110131','12020110132','12020111030','12020111031','12020111032','12020111033','12020111210','12020111211','12020112103','12020112112','12020112121','12020112130','12020113203','12020113212','12020113221','12020113223','12020113230','12020113232','12020121222','12020121223','12020121303','12020121312','12020121321','12020121330','12020122000','12020122001','12020122002','12020122003','12020122012','12020122013','12020122030','12020122031','12020122100','12020122101','12020122102','12020122103','12020122121','12020122123','12020122232','12020122233','12020122302','12020122303','12020122311','12020122312','12020122313','12020122321','12020122323','12020123000','12020123001','12020123112','12020123113','12020123130','12020123131','12020123223','12020130020','12020130021','12020130023','12020130202','12020130203','12020130220','12020130221','12020131000','12020131001','12020131002','12020131003','12020131120','12020131121','12020131122','12020131123','12020132003','12020132012','12020132020','12020132021','12020132022','12020132023','12020132030','12020132031','12020132032','12020132033','12020133220','12020133221','12020133222','12020133223','12020200002','12020200003','12020200020','12020200021','12020200022','12020200023','12020200132','12020200133','12020200202','12020200203','12020200220','12020200221','12020200222','12020200223','12020200230','12020200231','12020200232','12020200233','12020200302','12020200303','12020200310','12020200311','12020200322','12020200330','12020201001','12020201010','12020202000','12020202001','12020202002','12020202003','12020202010','12020202011','12020202012','12020202013','12020202020','12020202021','12020202022','12020202023','12020202030','12020202031','12020202032','12020202033','12020202100','12020202101','12020202102','12020202113','12020202120','12020202121','12020202122','12020202123','12020202130','12020202131','12020202201','12020202223','12020202230','12020202231','12020202232','12020202233','12020202300','12020202301','12020202303','12020202310','12020202311','12020202312','12020202320','12020203002','12020203020','12020210133','12020210313','12020211001','12020211003','12020211010','12020211011','12020211012','12020211013','12020211022','12020211023','12020211030','12020211031','12020211032','12020211033','12020211100','12020211101','12020211102','12020211103','12020211110','12020211111','12020211112','12020211120','12020211121','12020211122','12020211123','12020211130','12020211131','12020211132','12020211133','12020211200','12020211201','12020211202','12020211203','12020211210','12020211211','12020211212','12020211213','12020211220','12020211221','12020211230','12020211231','12020211232','12020211233','12020211300','12020211301','12020211311','12020211322','12020211323','12020211331','12020212022','12020212023','12020212032','12020212121','12020212123','12020212130','12020212132','12020212133','12020212210','12020212223','12020212230','12020212231','12020212232','12020212233','12020212300','12020212301','12020212302','12020212303','12020212311','12020212312','12020212313','12020212330','12020212331','12020212333','12020213000','12020213001','12020213002','12020213003','12020213010','12020213011','12020213022','12020213023','12020213100','12020213101','12020213110','12020213111','12020213112','12020213113','12020213130','12020213131','12020213200','12020213201','12020213202','12020213203','12020213212','12020213213','12020213220','12020213221','12020213222','12020213223','12020213230','12020213231','12020213232','12020213233','12020213312','12020213313','12020213330','12020213331','12020213333','12020220001','12020221322','12020221323','12020222121','12020222123','12020222130','12020222132','12020222301','12020222310','12020230000','12020230001','12020230002','12020230003','12020230010','12020230011','12020230012','12020230013','12020230111','12020230113','12020230130','12020230131','12020231000','12020231001','12020231002','12020231020','12020231021','12020231022','12020231023','12020231030','12020231032','12020231110','12020231111','12020231112','12020231113','12020232310','12020232311','12020232312','12020232313','12020233010','12020233011','12020233012','12020233013','12020300010','12020300011','12020300012','12020300013','12020300021','12020300022','12020300023','12020300030','12020300031','12020300032','12020300101','12020300103','12020300110','12020300111','12020300112','12020300113','12020300130','12020300131','12020300200','12020300201','12020300202','12020300203','12020300210','12020300220','12020300221','12020300303','12020300312','12020300321','12020300323','12020300330','12020300331','12020300332','12020300333','12020301000','12020301003','12020301012','12020301013','12020301021','12020301030','12020301031','12020301102','12020301103','12020301112','12020301120','12020301121','12020301130','12020301210','12020301211','12020301212','12020301213','12020301220','12020301222','12020301300','12020301302','12020301312','12020301313','12020301320','12020301321','12020301322','12020301323','12020301333','12020302000','12020302002','12020302012','12020302013','12020302030','12020302031','12020302100','12020302101','12020302102','12020302103','12020302110','12020302111','12020302112','12020302113','12020302120','12020302121','12020302122','12020302123','12020302130','12020302131','12020302132','12020302133','12020302202','12020302203','12020302212','12020302220','12020302221','12020302222','12020302230','12020302231','12020302232','12020302233','12020302300','12020302301','12020302310','12020302311','12020302312','12020302313','12020302320','12020302321','12020302322','12020302323','12020302330','12020302331','12020302332','12020302333','12020303000','12020303001','12020303002','12020303003','12020303012','12020303013','12020303020','12020303021','12020303022','12020303023','12020303030','12020303031','12020303032','12020303033','12020303100','12020303102','12020303103','12020303112','12020303121','12020303130','12020303200','12020303201','12020303202','12020303203','12020303210','12020303211','12020303212','12020303213','12020303220','12020303222','12020303223','12020303303','12020303320','12020303321','12020303322','12020303323','12020303330','12020310012','12020310013','12020310022','12020310023','12020310030','12020310110','12020310111','12020310112','12020310113','12020310123','12020310201','12020310210','12020310212','12020310221','12020310223','12020310230','12020310232','12020311000','12020311002','12020311032','12020311033','12020311100','12020311101','12020311210','12020311211','12020312121','12020312123','12020312130','12020312132','12020312221','12020312223','12020312230','12020312232','12020313000','12020313002','12020313310','12020313312','12020313313','12020313330','12020313331','12020320000','12020320002','12020320003','12020320010','12020320011','12020320100','12020320101','12020320111','12020321000','12020321001','12020321021','12020321030','12020321031','12020321032','12020321033','12020321113','12020321211','12020321311','12020321312','12020321313','12020321330','12020321331','12020321332','12020321333','12020322101','12020322103','12020322110','12020322212','12020322213','12020322230','12020322231','12020322311','12020322313','12020323022','12020323023','12020323033','12020323113','12020323122','12020323131','12020323132','12020323133','12020323200','12020323201','12020323202','12020323310','12020323311','12020323331','12020323333','12020330001','12020330002','12020330003','12020330112','12020330113','12020330130','12020330131','12020330200','12020330201','12020330202','12020330203','12020330210','12020330212','12020330213','12020330220','12020330221','12020330222','12020330223','12020330230','12020330231','12020330320','12020331222','12020331323','12020331332','12020332020','12020332022','12020332023','12020332200','12020332201','12020332220','12020332222','12020332223','12020332233','12020332302','12020332320','12020332322','12020333000','12020333112','12020333121','12020333123','12020333130','12020333131','12020333132','12020333133','12020333310','12020333311','12021000100','12021000101','12021000102','12021000103','12021000110','12021000111','12021000112','12021000113','12021000120','12021000121','12021000122','12021000123','12021000130','12021000131','12021000300','12021000301','12021001000','12021001002','12021001003','12021001010','12021001011','12021001012','12021001013','12021001020','12021001021','12021001030','12021002322','12021002323','12021003203','12021003212','12021003221','12021003223','12021003230','12021003232','12021003301','12021003303','12021003310','12021003321','12021020100','12021020101','12021021011','12021021100','12021021213','12021021231','12021023213','12021023221','12021023223','12021023230','12021023231','12021023232','12021023233','12021023302','12021023320','12021023321','12021023322','12021023323','12021023330','12021023332','12021200021','12021200023','12021200030','12021200032','12021200110','12021200111','12021200112','12021200113','12021200210','12021200302','12021200303','12021200312','12021200320','12021200321','12021200330','12021201001','12021201003','12021201010','12021201011','12021201012','12021201013','12021201100','12021201101','12021201102','12021201103','12021201110','12021202011','12021202013','12021202100','12021202102','12021202103','12021202112','12021202113','12021202120','12021202121','12021202123','12021202130','12021202131','12021202132','12021202202','12021202203','12021202212','12021202220','12021202221','12021202230','12021202320','12021202321','12021202322','12021202323','12021203221','12021203222','12021203223','12021203301','12021203303','12021203310','12021203312','12021210010','12021210012','12021210221','12021210223','12021210230','12021212123','12021212300','12021212301','12021220102','12021220103','12021220120','12021220121','12021220221','12021220223','12021220230','12021220232','12021222320','12021222321','12021222322','12021222323','12022000222','12022000223','12022002000','12022002001','12022002211','12022002213','12022002300','12022002302','12022003010','12022003011','12022003012','12022003013','12022003323','12022010312','12022010313','12022013302','12022013303','12022013320','12022013321','12022020023','12022020032','12022020201','12022020210','12022021003','12022021021','12022022112','12022022113','12022022130','12022022131','12022031013','12022031031','12022032003','12022032012','12022032021','12022032030','12022033013','12022033030','12022033031','12022033033','12022033102','12022033120','12022033122','12022033200','12022033201','12022033202','12022033203','12022100012','12022100013','12022100030','12022100031','12022101031','12022101033','12022101110','12022101112','12022101113','12022101120','12022101122','12022101123','12022101221','12022101223','12022101230','12022101232','12022101300','12022101301','12022101322','12022101333','12022102130','12022102131','12022102132','12022102133','12022102212','12022102221','12022102230','12022103003','12022103012','12022103021','12022103030','12022103031','12022103032','12022103033','12022103100','12022103210','12022103211','12022103311','12022103313','12022103332','12022103333','12022110001','12022110011','12022110012','12022110013','12022110030','12022110031','12022110033','12022110100','12022110101','12022110102','12022110103','12022110111','12022110112','12022110113','12022110120','12022110121','12022110122','12022110130','12022110131','12022110222','12022111000','12022111001','12022111002','12022111200','12022111201','12022111301','12022111303','12022111310','12022111312','12022112023','12022112031','12022112032','12022112033','12022112120','12022112121','12022112122','12022112130','12022112200','12022112201','12022112202','12022112203','12022112210','12022112220','12022112221','12022112300','12022112301','12022112302','12022112303','12022113012','12022113030','12022113331','12022120123','12022120230','12022120231','12022120232','12022120233','12022120300','12022120301','12022120310','12022121001','12022121003','12022121010','12022121012','12022121110','12022121111','12022122023','12022122201','12022122210','12022122220','12022122222','12022122223','12022123123','12022123132','12022123232','12022123233','12022123301','12022123310','12022123313','12022123322','12022123331','12022131333','12022132000','12022132001','12022132002','12022132003','12022132012','12022132013','12022132021','12022132030','12022132031','12022132032','12022132102','12022132120','12022132122','12022132123','12022132130','12022132131','12022132132','12022132133','12022132200','12022132201','12022132202','12022132203','12022132210','12022132211','12022132212','12022132213','12022132220','12022132230','12022132231','12022132233','12022132300','12022132301','12022132302','12022132320','12022132321','12022132322','12022132330','12022133023','12022133032','12022133111','12022133201','12022133210','12022133222','12022133223','12022133301','12022133303','12022133310','12022133311','12022133312','12022133313','12022133323','12022133332','12022202133','12022202311','12022203022','12022203200','12022211011','12022211013','12022211100','12022211102','12022212123','12022212132','12022212212','12022212230','12022212301','12022212310','12022213002','12022213003','12022213010','12022213011','12022213012','12022213013','12022213020','12022213021','12022213030','12022213032','12022213310','12022213311','12022213312','12022213313','12022213330','12022213331','12022222031','12022222033','12022222330','12022222331','12022222332','12022222333','12022223030','12022223033','12022223111','12022223122','12022223123','12022223132','12022223211','12022223212','12022223213','12022223220','12022223230','12022223300','12022223301','12022223302','12022230020','12022230022','12022232000','12022301010','12022301011','12022301013','12022301100','12022301102','12022301112','12022301113','12022301212','12022301213','12022301331','12022302133','12022302311','12022303021','12022303022','12022303023','12022303030','12022303031','12022303102','12022303120','12022303200','12022310000','12022310001','12022310002','12022310003','12022310110','12022310111','12022310203','12022310210','12022310211','12022310212','12022310213','12022310220','12022310333','12022311012','12022311013','12022311030','12022311031','12022311032','12022311033','12022311120','12022311121','12022311122','12022311123','12022311130','12022311132','12022311222','12022311301','12022311310','12022311311','12022312111','12022313000','12022313001','12022313003','12022313010','12022313012','12022313013','12022313030','12022313031','12022313032','12022313033','12022313101','12022313102','12022313103','12022313110','12022313112','12022313113','12022313120','12022313121','12022313123','12022313130','12022313131','12022313132','12022313133','12022313210','12022331112','12022331113','12022331130','12022331131','12022332332','12023000002','12023000003','12023000120','12023000121','12023000122','12023000123','12023000203','12023000212','12023000220','12023000221','12023000222','12023000223','12023000230','12023000232','12023001331','12023002100','12023002101','12023002102','12023002103','12023002202','12023002203','12023002220','12023002221','12023003003','12023003012','12023010201','12023010202','12023010203','12023010212','12023010220','12023010221','12023011202','12023011203','12023011213','12023011220','12023011221','12023011231','12023011300','12023011301','12023011302','12023011303','12023011312','12023011320','12023011321','12023011322','12023011323','12023011330','12023011332','12023012331','12023012333','12023013222','12023020200','12023021132','12023021133','12023021232','12023021233','12023021310','12023022023','12023022032','12023022111','12023022113','12023022121','12023022123','12023022130','12023022132','12023022201','12023022210','12023022211','12023022213','12023022232','12023022233','12023022301','12023022302','12023022303','12023022310','12023022311','12023022312','12023022321','12023022323','12023022330','12023022332','12023023000','12023023002','12023023010','12023023011','12023023101','12023023103','12023023121','12023023123','12023023130','12023023132','12023023133','12023030023','12023030032','12023030111','12023031000','12023200003','12023200010','12023200011','12023200012','12023200021','12023200030','12023200200','12023200201','12023200202','12023200212','12023200213','12023200230','12023200231','12023200301','12023200303','12023200310','12023200312','12023200320','12023200322','12023200323','12023200333','12023202002','12023202020','12023202022','12023202110','12023202111','12023202112','12023202113','12023202131','12023202133','12023202202','12023202211','12023202213','12023202220','12023202323','12023202332','12023203000','12023203002','12023203003','12023203012','12023203020','12023203021','12023203022','12023203030','12023203122','12023203123','12023203300','12023203301','12023220101','12023220110','12023220133','12023220230','12023220231','12023220232','12023220233','12023220300','12023220301','12023220302','12023220303','12023220311','12023220323','12023220332','12023220333','12023221000','12023221002','12023221022','12023221102','12023221103','12023221112','12023221121','12023221123','12023221130','12023221132','12023221200','12023221201','12023221202','12023221203','12023221222','12023222101','12023222103','12023222110','12023222111','12023222112','12023222113','12023222121','12023222130','12023222131','12023223000','12023223001','12023223002','12023223003','12023223022','12023223023','12023223031','12023223033','12023223120','12023223122','12023223200','12023223201','12023230200','12023230201','12023230202','12023230203','12023232022','12023232023','12023232033','12023232131','12023232221','12023232222','12023232223','12023232231','12023232233','12023232320','12023232322','12023233030','12023233032','12023233200','12023233212','12023233230','12023233302','12023233303','12023233320','12023233321','12023233330','12023233331','12023233332','12023233333','12023322220','12023322222','12032222323','12032222332','12032223220','12032223221','12032223223','12200003130','12200003131','12200003133','12200101131','12200101133','12200110002','12200110003','12200110020','12200110021','12200110101','12200110110','12200110222','12200110223','12200110300','12200110301','12200110302','12200110303','12200112000','12200112001','12200112211','12200112213','12200112300','12200112302','12201001111','12201001113','12201010000','12201010001','12201010002','12201010003','12201010010','12201010011','12201010012','12201010013','12201010030','12201010031','12201010100','12201010102','12201010120','12201011021','12201011030','12201011101','12201011103','12201011110','12201011112','12201011130','12201013300','12201013323','12201013330','12201013332','12201013333','12201020313','12201020331','12201020332','12201020333','12201021211','12201021213','12201021300','12201021302','12201023113','12201023120','12201023121','12201023122','12201023123','12201023131','12201030313','12201031011','12201031013','12201031022','12201031023','12201031110','12201031200','12201031201','12201031202','12201031203','12201031220','12201031221','12201032001','12201032002','12201032003','12201032103','12201032112','12201032132','12201032203','12201032212','12201032213','12201032230','12201032231','12201032302','12201032310','12201032311','12201032312','12201032313','12201032320','12201100023','12201100032','12201100121','12201100130','12201100201','12201100210','12201100311','12201102203','12201102221','12201111313','12201112112','12201112130','12201113031','12201113113','12201113120','12201113131','12201113333','12201131003','12201131033','12201131122','12201131211','12201131300','12201133301','12201133303','12210000021','12210000030','12210000031','12210000032','12210000033','12210000202','12210001010','12210001011','12210002002','12210002020','12210002032','12210002210','12210020130','12210020311','12210020312','12210020313','12210020321','12210020330','12210020331','12210020332','12210020333','12210021200','12210021202','12210021220','12210021222','12210201222','12210203110','12210203111','12210203112','12210203113','31121301200','31121301201','31121301202','31121301203','31121301220','31121301221','31121301222','31121301223','31123013300','31123013302','31123031001','31123031003','31123031010','31123031012','31301002303','31301002312','31301002321','31301002323','31301002330','31301002331','31301002332'],i=false,d=[];this.Init=function(a){x=a+"/GetBirdsEyeSceneByLocation";y=a+"/GetBirdsEyeSceneById";q=true};this.SetClientToken=function(b){e=b;if(a)a.SetClientToken(e)};this.SetGUID=function(b){m=b;if(a)a.SetGUID(m);if(typeof VEMap!="undefined")r=VEMap._GetMapFromGUID(m)};this.Destroy=function(){e=null;q=false};this.RequestPending=function(){return i};function P(c,d,b){return a.IsValidTile(c,d,b)}function N(b,c,d){return a.GetTileFilename(b,c,d,currentView.mapStyle)}this.GetMiddleTileFilename=function(){return a.GetMiddleTileFilename()};function I(e){if(!a)return 0;var b=new VEPixel(MathRound(originX+offsetX+width/2),MathRound(originY+offsetY+height/2)),f=a.PixelToLatLong(b,e);b.x++;var g=a.PixelToLatLong(b,e),h=Math.sin(DegToRad(f.latitude)),i=Math.sin(DegToRad(g.latitude)),c=earthRadius/2*MathAbs(Math.log((1+h)/(1-h))-Math.log((1+i)/(1-i))),d=earthRadius*MathAbs(DegToRad(f.longitude)-DegToRad(g.longitude));return Math.sqrt(d*d+c*c)}function J(c,b){return a?a.PixelToLatLong(c,b):null}function D(c,d,b){if(a)a.PixelToLatLongAsync(c,d,b);else b(null)}function H(c,b){return a?a.LatLongToPixel(c,b):null}function C(c,d,b){if(a)a.LatLongToPixelAsync(c,d,b);else b(null)}function A(){return 2}function F(a){if(a.zoomLevel>=2)tileLayerManager.SetMarketMaxZoom(2);if(a.zoomLevel<1)a.SetZoomLevel(1);else if(a.zoomLevel>2)a.SetZoomLevel(2)}function R(){return a}function Q(){return a.GetBounds()}function O(){return b}function K(){if(!b)return null;var a={};return a}function E(){if(currentView!=null&&!Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)&&currentView.zoomLevel>0)if(currentView.zoomLevel<MapControl.Features.BirdsEyeAtZoomLevel){a=null;h=b;b=false;p()}else u(currentView.latlong,"North",false,500)}var w=false;function u(e,i,u,o,m,f,r,s,q){j();l=u;w=r;n=q;if(!S(e)){a=null;h=b;b=false;p(m);return}k=x;c=[];c.push(new VEParameter("latitude",e.latitude));c.push(new VEParameter("longitude",e.longitude));c.push(new VEParameter("level",20));var d="NoSpin";if(f==Msn.VE.BirdsEyeSearchSpinDirection.ClockwiseSpin)d="CounterclockwiseSpin";else if(f==Msn.VE.BirdsEyeSearchSpinDirection.CounterclockwiseSpin)d="ClockwiseSpin";c.push(new VEParameter("spinDirection",'"'+d+'"'));if(i)c.push(new VEParameter("orientation",'"'+i+'"'));else c.push(new VEParameter("orientation",'"'+Msn.VE.Orientation.North+'"'));if(o)g=window.setTimeout(t,o);else{t(m,s);g=-1}}function L(b){if(a&&a.GetID()==b)return;j();l=true;k=y;c=[];c.push(new VEParameter("sceneId",b));t()}function j(){try{if(g!=-1)window.clearTimeout(g)}catch(a){}g=-1}function t(b,d){j();if(!k)return;i=true;if(e)c.push(new VEParameter(Msn.VE.API.Constants.clienttoken,e));function a(a){if(typeof v=="function"&&q)v(a,b,d)}JSONRequestInvoke(k,c,a)}function v(c,f,d){if(r)r.__HandleAuthentication(c);h=b;s=a;a=null;b=false;if(c!=null)if(c.Scene){a=M(c.Scene,d);if(Msn.VE.API&&e)a.SetClientToken(e);a.SetGUID(m);b=true}p(f,d)}function M(a,b){switch(a.O){case 0:a.O=Msn.VE.Orientation.North;break;case 2:a.O=Msn.VE.Orientation.East;break;case 4:a.O=Msn.VE.Orientation.South;break;case 6:a.O=Msn.VE.Orientation.West}return new Msn.VE.ObliqueScene(a.S,a.Q,a.RI,a.O,a.L,null,a.Fcx,a.Fcy,[[a.QA,a.QB,a.QC],[a.QD,a.QE,a.QF],[a.QG,a.QH,a.QI]],[[a.XA,a.XB,a.XC],[a.XD,a.XE,a.XF],[a.XG,a.XH,a.XI]],b)}function p(e){i=false;if(typeof e=="function")if(b)e(a);else e(null);if(l){l=false;if(b){var c=preferredView.MakeCopy();if(!Msn.VE.MapStyle.IsViewOblique(c.mapStyle)){c.SetZoomLevel(1);c.SetCenterLatLong((new Msn.VE.LatLong).Copy(preferredView.latlong))}var f=Msn.VE.MapStyle.IsViewOblique(c.mapStyle)?c.mapStyle:obliqueStyle;c.SetMapStyle(f,a.GetID(),a.GetOrientation());SetView(c);Fire("onobliquechange")}else if(w&&s){a=s;b=true;Fire("obliquerequestunavailable")}else{var c=preferredView.MakeCopy();c.SetMapStyle(lastOrthoMapStyle);if(c.GetViewType()!="latlongRect")c.SetZoomLevel(lastOrthoZoomLevel);SetView(c);Fire("onendmapstyleoblique");Fire("onerror",CreateEvent(currentView.latlong,currentView.zoomLevel,L_ObliqueModeImageNotAvailable_Text))}}if(!n){if(h!=b)if(b)Fire("onobliqueenter");else Fire("onobliqueleave");if(d.length>0)z(b)}n=false}function S(a){if(!a||!f||f.length==0)return false;var b=G(a,f[0].length);return o(b,0,f.length-1)}function G(g,c){var e=orthoMode.LatLongToPixel(g,c),h=MathFloor(e.x/tileSize),i=MathFloor(e.y/tileSize),d="";for(var b=c;b>0;b--){var a=0,f=1<<b-1;if((h&f)!=0)a++;if((i&f)!=0)a+=2;d+=a+""}return d}function o(a,d,c){if(c<d)return false;var b=MathFloor((d+c)/2);if(f[b]==a)return true;if(a<f[b])return o(a,d,b-1);return o(a,b+1,c)}function B(a,c){if(i){if(d[a]!=true){var e=d.push({callbackName:a,callback:c});d[a]=true}}else if(typeof c=="function")c(b)}function z(c){var e=d.length;for(var b=0;b<e;b++){var a=d.shift();delete d[a.callbackName];if(typeof a.callback=="function")a.callback(c)}}this.IsValidTile=P;this.GetFilename=N;this.MetersPerPixel=I;this.PixelToLatLong=J;this.PixelToLatLongAsync=D;this.LatLongToPixel=H;this.LatLongToPixelAsync=C;this.GetBounds=Q;this.ValidateZoomLevel=F;this.IsAvailable=O;this.UpdateAvailability=E;this.CancelRequest=j;this.GetEventInfo=K;this.GetScene=R;this.RequestSceneAtLatLong=u;this.RequestScene=L;this.GetCurrentMaxZoomLevel=A;this.GetObliqueAvailability=B}function OrthoMode(){var a=[new Msn.VE.Bounds(1,17,0,0,2,2),new Msn.VE.Bounds(18,19,35680,82915,83740,113061),new Msn.VE.Bounds(18,19,122880,53248,155649,103425),new Msn.VE.Bounds(18,19,12379,112260,20388,119266),new Msn.VE.Bounds(18,19,80099,115425,85051,119645),new Msn.VE.Bounds(18,19,220032,93184,240640,113792)];this.Init=function(){};this.Destroy=function(){};function j(a,b,d){var c=1<<d;return a>=0&&b>=0&&a<c&&b<c}function i(c,d,f,b){var a=new VETileContext;a.XPos=c;a.YPos=d;a.ZoomLevel=f;a.MapStyle=currentView.mapStyle;var e=b.GetTilePath(a);return e}function b(a){return earthCircumference/((1<<a)*tileSize)}function h(d,e){var c=b(e),f=d.x*c-projectionOffset,g=projectionOffset-d.y*c,a=new Msn.VE.LatLong;a.latitude=RadToDeg(Math.PI/2-2*Math.atan(Math.exp(-g/earthRadius)));a.longitude=RadToDeg(f/earthRadius);return a}function e(d,g,e){var b=[];for(var a=0;a<d.length;++a){var c=this.PixelToLatLong(d[a],g);if(Msn.VE.API!=null){var f=new VELatLong(c.latitude,c.longitude);b[a]=f}else b[a]=c}if(e)e(b)}function g(d,f){var e=Math.sin(DegToRad(d.latitude)),g=earthRadius*DegToRad(d.longitude),h=earthRadius/2*Math.log((1+e)/(1-e)),c=b(f),a=new VEPixel;a.x=(projectionOffset+g)/c;a.y=(projectionOffset-h)/c;return a}function d(b,e,d){var c=[];for(var a=0;a<b.length;++a)c[a]=this.LatLongToPixel(b[a],e);if(d)d(c)}function k(c){if(c==undefined)c=currentView;var d=c.zoomLevel,f=c.center.x+mapCenterOffset.x,g=c.center.y+mapCenterOffset.y;for(var b=0;b<a.length;b++){var h=d-a[b].z1,e=tileSize*Math.pow(2,h),k=a[b].x1*e,i=a[b].x2*e,l=a[b].y1*e,j=a[b].y2*e;if(f>=k&&f<=i&&g>=l&&g<=j)if(d>=a[b].z1&&d<=a[b].z2||d<=tileLayerManager.GetMaxTileZoom())return a[b]}return a[0]}function c(e){var f=e.center.x+mapCenterOffset.x,g=e.center.y+mapCenterOffset.y,c=0;for(var b=0;b<a.length;b++){var d=tileSize*Math.pow(2,e.zoomLevel-a[b].z1),j=a[b].x1*d,h=a[b].x2*d,k=a[b].y1*d,i=a[b].y2*d;if(f>=j&&f<=h&&g>=k&&g<=i)c=Math.max(c,a[b].z2)}c=Math.max(c,tileLayerManager.GetMaxTileZoom());return c}function f(d){var f=d.center.x+mapCenterOffset.x,g=d.center.y+mapCenterOffset.y,c=0;for(var b=0;b<a.length;b++){var e=tileSize*Math.pow(2,d.zoomLevel-a[b].z1),j=a[b].x1*e,h=a[b].x2*e,k=a[b].y1*e,i=a[b].y2*e;if(f>=j&&f<=h&&g>=k&&g<=i){c=0;if(a[b].z2>=d.zoomLevel){tileLayerManager.SetMarketMaxZoom(a[b].z2);return}else if(a[b].z2>c){tileLayerManager.SetMarketMaxZoom(a[b].z2);c=a[b].z2;if(c<tileLayerManager.GetMaxTileZoom())if(d.zoomLevel<=tileLayerManager.GetMaxTileZoom())c=d.zoomLevel;else c=tileLayerManager.GetMaxTileZoom()}}}d.SetZoomLevel(c)}this.IsValidTile=j;this.GetFilename=i;this.MetersPerPixel=b;this.PixelToLatLong=h;this.PixelToLatLongAsync=e;this.LatLongToPixel=g;this.LatLongToPixelAsync=d;this.GetBounds=k;this.ValidateZoomLevel=f;this.GetCurrentMaxZoomLevel=c}function ThreeDMode(){var internalOrthoMode=new OrthoMode,bounds=[new Msn.VE.Bounds(1,17,0,0,2,2),new Msn.VE.Bounds(18,19,35680,82915,83740,113061),new Msn.VE.Bounds(18,19,122880,53248,155649,103425),new Msn.VE.Bounds(18,19,12379,112260,20388,119266),new Msn.VE.Bounds(18,19,80099,115425,85051,119645),new Msn.VE.Bounds(18,19,220032,93184,240640,113792)];this.Init=function(){};this.Destroy=function(){};function IsValidTile(b,c,a){return internalOrthoMode.IsValidTile(b,c,a)}function GetFilename(a,b,d,c){return internalOrthoMode.GetFilename(a,b,d,c)}function MetersPerPixel(a){return internalOrthoMode.MetersPerPixel(a)}function PixelToLatLong(pixel){if(!view3DCreated)return null;var lat,lon,latlonvalid,result=spacecontrol.PixelToLatLong(pixel.x,pixel.y);eval(result);if(latlonvalid!=0){var latlong=new Msn.VE.LatLong;latlong.latitude=RadToDeg(lat);latlong.longitude=RadToDeg(lon);return latlong}return null}function PixelToLatLongAsync(d,g,e){var b=[];for(var a=0;a<d.length;++a){var c=this.PixelToLatLong(d[a],g);if(Msn.VE.API!=null){var f=new VELatLong(c.latitude,c.longitude);b[a]=f}else b[a]=c}if(e)e(b)}function LatLongToPixel(latlong){if(!view3DCreated)return null;var x,y,xyvalid=0,result=spacecontrol.LatLongToPixel(parseFloat(latlong.latitude),parseFloat(latlong.longitude));eval(result);if(xyvalid!=0){var pixel=new VEPixel(x,y);return pixel}return null}function LatLongToPixelAsync(b,e,d){var c=[];for(var a=0;a<b.length;++a)c[a]=this.LatLongToPixel(b[a],e);if(d)d(c)}function GetBounds(){return null}function GetCurrentMaxZoomLevel(){return 19}function ValidateZoomLevel(a){if(a.zoomLevel<1)a.SetZoomLevel(1);if(a.zoomLevel>19)a.SetZoomLevel(19)}function _InternalOrthoMode(){return internalOrthoMode}this._InternalOrthoMode=_InternalOrthoMode;this.IsValidTile=IsValidTile;this.GetFilename=GetFilename;this.MetersPerPixel=MetersPerPixel;this.PixelToLatLong=PixelToLatLong;this.PixelToLatLongAsync=PixelToLatLongAsync;this.LatLongToPixel=LatLongToPixel;this.LatLongToPixelAsync=LatLongToPixelAsync;this.GetBounds=GetBounds;this.ValidateZoomLevel=ValidateZoomLevel;this.GetCurrentMaxZoomLevel=GetCurrentMaxZoomLevel}function BoxTool(){var b=document.createElement("div"),a=document.createElement("div"),h,c=0,d=0,e=0,f=0;this.Init=function(){b.className="MSVE_ZoomBox_bg";a.className="MSVE_ZoomBox_fg";b.attachEvent("onmouseup",MouseUp);a.attachEvent("onmouseup",MouseUp);if(map!=null){map.appendChild(b);map.appendChild(a)}};this.Destroy=function(){b.detachEvent("onmouseup",MouseUp);a.detachEvent("onmouseup",MouseUp);if(map!=null){map.removeChild(b);map.removeChild(a)}};function k(i){if(typeof VE_ContextMenu!="undefined"&&VE_ContextMenu!=null){VE_ContextMenu.RemoveContextPin();VE_ContextMenu.CloseMenu()}var b=Gimme.Screen.getMousePosition(i);h=g(p_elSource).getPagePosition();c=e=b.x-h.x+offsetX;d=f=b.y-h.y+offsetY;j(c,d,1,1);o();if(a.setCapture)a.setCapture()}function l(i){var a=Gimme.Screen.getMousePosition(i);e=a.x-h.x+offsetX;f=a.y-h.y+offsetY;var g=e-c,b=f-d;j(Math.min(c,c+g),Math.min(d,d+b),Math.abs(g),Math.abs(b))}function m(j){if(MathAbs(c-e)>1&&MathAbs(d-f)>1){var b=preferredView.MakeCopy();b.SetZoomLevel(currentView.zoomLevel);if(!j.shiftKey)b.SetPixelRectangle(new Msn.VE.PixelRectangle(new VEPixel(originX+c,originY+d),new VEPixel(originX+e,originY+f)));else{var h=width/MathAbs(e-c),i=height/MathAbs(f-d),g=h<i?h:i;b.SetPixelRectangle(new Msn.VE.PixelRectangle(new VEPixel(originX-Math.floor(width*(g-1)/2),originY-Math.floor(height*(g-1)/2)),new VEPixel(originX+Math.floor(width*(g+1)/2),originY+Math.floor(height*(g+1)/2))))}SetView(b)}setTimeout(n,250);if(a.releaseCapture)a.releaseCapture()}function j(e,f,d,c){i(b,e+1,f+1,d,c);i(a,e,f,d,c)}function i(a,d,e,c,b){a.style.left=d+"px";a.style.top=e+"px";a.style.width=c+"px";a.style.height=b+"px"}function o(){b.style.display="block";a.style.display="block"}function n(){b.style.display="none";a.style.display="none"}this.OnMouseDown=k;this.OnMouseMove=l;this.OnMouseUp=m}function PanTool(){var b=false,a=null,c=500;this.Init=function(){};this.Destroy=function(){};function e(a){b=false;var d=Gimme.Screen.getMousePosition(a);lastMouseX=d.x;lastMouseY=d.y;if(p_elSource.setCapture)p_elSource.setCapture();var e=g(p_elSource).getPagePosition();x=e.x;y=e.y;var f=originX+offsetX+lastMouseX-x,h=originY+offsetY+lastMouseY-y,c=CreateEvent(currentMode.PixelToLatLong(new VEPixel(f,h),currentView.zoomLevel),currentView.zoomLevel,null,null,null,a.button,0,a);Fire("onstartpan",c);FireDefaultEvent("onmousedown",c)}function f(e){var d=Gimme.Screen.getMousePosition(e),a=d.x,c=d.y;PanMap(lastMouseX-a,lastMouseY-c);if(lastMouseX!=a||lastMouseY!=c)b=true;lastMouseX=a;lastMouseY=c}function h(c){ComputeCenterPoint(true);if(p_elSource.releaseCapture)p_elSource.releaseCapture();if(b){Fire("onendpan");Fire("onchangeview");b=false;d()}var e=Gimme.Screen.getMousePosition(c),f=originX+offsetX+e.x-x,g=originY+offsetY+e.y-y,a=CreateEvent(currentMode.PixelToLatLong(new VEPixel(f,g),currentView.zoomLevel),currentView.zoomLevel,null,null,null,c.button,0,c);FireDefaultEvent("onmouseup",a);FireDefaultEvent("onclick",a);return a}function d(){if(a!=null)window.clearTimeout(a);a=window.setTimeout(i,c)}function i(){a=null;$VE_A.Log($VE_A.PgName.Map,"Pan","Mouse")}this.OnMouseDown=e;this.OnMouseMove=f;this.OnMouseUp=h}function TargetTool(){var b=this,f=Msn.VE.Geometry,d,a,e,c;this.centeringTrigger=false;g();function g(){d=false;a=false;e=null;c=false;m_dragging=false}this.init=function(){if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle))b.trackMovement()};this.destroy=function(){b.ignoreMovement();f=null};this.isOutOfBounds=function(){return a};this.trackMovement=function(){if(!d){p_elSource.attachEvent("onmousemove",b.OnMouseMove);d=true}};this.ignoreMovement=function(){p_elSource.detachEvent("onmousemove",b.OnMouseMove);d=a=b.centeringTrigger=false;p_this.SetCursor(cssCursors.Grab)};this.setBoundingArea=function(a){if(a instanceof f.Rectangle)e=a};this.OnMouseDown=function(){};this.OnMouseMove=function(b){if(e==null)return;if(!dragging){var d=Gimme.Screen.getMousePosition(b);if(!e.containsPoint(d)){if(!hijackMouseMove&&(!c||p_elSource.style.cursor!=cssCursors.Target)){a=c=true;p_this.SetCursor(cssCursors.Target)}}else if(c){a=c=false;p_this.SetCursor(cssCursors.Grab)}}};this.OnMouseUp=function(c){if(typeof VE_ContextMenu!="undefined"&&VE_ContextMenu!=null){VE_ContextMenu.RemoveContextPin();VE_ContextMenu.CloseMenu()}var g=c.which||c.button;if(a&&g==1){c.cancelBubble=true;b.centeringTrigger=true;var e=originX+offsetX+Math.round(GetMapWidth()/2),f=originY+offsetY+Math.round(GetMapHeight()/2),d=currentMode.PixelToLatLong(new VEPixel(e,f),currentView.zoomLevel);SetCenter(d.latitude,d.longitude)}}}function GetTrafficAvailability(){return trafficAvailable}function GetSlidingExpirationForAutoRefresh(){return 1800000}function GetAutoRefreshRate(){return 300000}function GetMarketsFile(){return"http://t1.traffic.virtualearth.net/incidents/markets.js"}function GetIncidentsFile(){return"http://t1.traffic.virtualearth.net/incidents/market"}var setTrafficViewflag=true;function SetTrafficView(){var a=new VETileSourceSpecification;a.ID=trafficTiles;a.SourceName=Msn.VE.API?Msn.VE.API.Constants.traffictileserver:"%0t%2.tiles.virtualearth.net/tiles/t%4";var b="?";if(a.SourceName.match(/\?/))b="&";a.SourceName=a.SourceName+b+"tc="+Math.floor((new Date).getTime()/(GetAutoRefreshRate()*.8));a.NumServers=2;tileLayerManager.AddTileSource(a);var c=typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null;tileLayerManager.LoadTileLayer("Traffic",a.ID,.6,c?2:3)}function VETileLayerManager(){var d=[],b=[],a=[],c={},e={},f={},k=null,h=true,g=17;this.AddTileSource=function(a){d[a.ID]=a;if(f[a.ID])this.SetClientToken(a.ID,f[a.ID])};this.Add3DTileSource=function(f,c,h){if(trafficTiles==f)return;if(1==b[f].zIndex)return;var g=c.MaxZoom==1?21:c.MaxZoom,a='ID="'+c.ID+'" TILESOURCE="'+c.SourceName+'" MINZOOM="'+c.MinZoom+'" MAXZOOM="'+g+'"',d=c.Bounds;if(typeof d!="undefined"&&d!=null){a=a+' Bounds="';for(var e=0;e<d.length;e++){if(e>0)a=a+",";a=a+d[e].TopLeftLatLong.Longitude+","+d[e].BottomRightLatLong.Latitude+","+d[e].BottomRightLatLong.Longitude+","+d[e].TopLeftLatLong.Latitude}a=a+'"'}h.AddImageSource(f,c.ID,a,b[f].zIndex,b[f].opacity)};this.AddAllTileSourcesTo3D=function(d){if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null)for(var c=0;c<a.length;c++)this.Add3DTileSource(a[c],b[a[c]],d)};this.AddMapServiceLayersTo3D=function(f){for(var d=0;d<a.length;d++){var e=a[d],c=b[e];if(c!=null&&c.ID.indexOf("VE_MapServiceLayer")==1)tileLayerManager.Add3DTileSource(e,c,f)}};this.DeleteMapServiceLayersFrom3D=function(f,e){for(var c=0;c<e.length;c++){var d=e[c],a=b[d];if(a!=null&&a.ID.indexOf("VE_MapServiceLayer")==1)f.RemoveImageSource(d,a.ID)}};this.LoadBaseLayer=function(c,e,f,g){if(b[c]==null||typeof b[c]=="undefined")a.push(c);b[c]=d[e];b[c].opacity=f;b[c].zIndex=g};this.HideBaseTileLayer=function(){this.SetTileLayerVisibility(mapTiles,false);this.RefreshTileLayer(mapTiles)};this.ShowBaseTileLayer=function(){this.SetTileLayerVisibility(mapTiles,true);this.RefreshTileLayer(mapTiles)};this.SetTileLayerVisibility=function(c,a){if(b[c]!=null&&typeof a!="undefined")b[c].IsVisible=a};this.LoadTileLayer=function(f,g,l,n){if(!h)return;if(b[f]==null||typeof b[f]=="undefined")a.push(f);b[f]=d[g];if(c[f])ClearTiles(c[f]);if(typeof b[f].IsVisible!="undefined"&&b[f].IsVisible==false)return;c[f]=[];e[f]=[];if(l!=null&&l!="undefined")b[f].opacity=l;else b[f].opacity=1;if(n!=null&&n!="undefined")b[f].zIndex=n;else b[f].zIndex=1;var j=false;if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null){var m=i();if(typeof m!="undefined"&&m!=null)tileLayerManager.Add3DTileSource(f,d[g],m)}var k=d[g].MaxZoom;if(k==1)k=d[mapTiles].MaxZoom;if(currentView.zoomLevel>=d[g].MinZoom&&currentView.zoomLevel<=k)if(d[g].Bounds!="undefined"&&d[g].Bounds!=null)j=tileLayerManager.CheckTilesAvailability(g,f);else j=true;if(j){b[f].isActive=true;for(var p=tileViewportY1;p<=tileViewportY2;p++)for(var o=tileViewportX1;o<=tileViewportX2;o++){var q=RequestTile(o,p,currentView.zoomLevel,currentView.mapStyle,b[f],g,b[f].opacity,b[f].zIndex);c[f].push(q)}}};this.SetViewPort=function(){map.style.top="0px";map.style.left="0px";originX=MathRound(currentView.center.x-width/2);originY=MathRound(currentView.center.y-height/2);offsetX=0;offsetY=0;var a=this.CalculateTileViewPort(true,originX,originY,originX+width,originY+height);tileViewportX1=a[0];tileViewportY1=a[1];tileViewportX2=a[2];tileViewportY2=a[3];tileViewportWidth=a[4];tileViewportHeight=a[5];Fire("onmapoffsetreset")};this.CalculateTileViewPort=function(f,b,d,c,e){var a=[];b=(b-buffer)/tileSize;d=(d-buffer)/tileSize;c=(c+buffer)/tileSize;e=(e+buffer)/tileSize;if(f){b=MathFloor(b);d=MathFloor(d);c=MathFloor(c);e=MathFloor(e)}a[0]=b;a[1]=d;a[2]=c;a[3]=e;a[4]=a[2]-a[0]+1;a[5]=a[3]-a[1]+1;return a};this.GetViewPort=function(){var a=[];a[0]=tileViewportX1;a[1]=tileViewportY1;a[2]=tileViewportX2;a[3]=tileViewportY2;a[4]=tileViewportWidth;a[5]=tileViewportHeight;return a};this.FinalizeView=function(){zooming=false;for(var b=0;b<a.length;b++){if(e[a[b]]){ClearTiles(e[a[b]]);e[a[b]]=null}for(var d=0;d<c[a[b]].length;d++){var f=c[a[b]];f[d].SwapStates();f[d].ClearSteps();f[d].SetFactor(0);f[d].ClearStates()}}for(var b=0;b<pushpins.length;b++){pushpins[b].SwapStates();pushpins[b].ClearSteps();pushpins[b].SetFactor(0)}if(copyright)copyright.Update();if(previousMapStyle!=currentView.mapStyle){Fire("onchangemapstyle");previousMapStyle=currentView.mapStyle}if(previousZoomLevel!=currentView.zoomLevel)Fire("onendzoom");Fire("onchangeview");try{CollectGarbage()}catch(g){}};this.CheckLayerUpdatability=function(d){var e=false;if(b[a[d]].isActive==false)this.RefreshTileLayer(b[a[d]].ID);if(d>=0)e=b[a[d]].ID==mapTiles||c[a[d]].length>0;return e};this.PanView=function(){if(!h)return;if(zooming)return;var i=originX+offsetX,j=originY+offsetY,k=MathFloor((i-buffer)/tileSize),m=MathFloor((j-buffer)/tileSize),l=MathFloor((i+width+buffer)/tileSize),n=MathFloor((j+height+buffer)/tileSize);while(tileViewportX1<k){for(var e=tileViewportHeight-1;e>=0;e--)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=c[a[d]].splice(e*tileViewportWidth,1)[0];try{g.RemoveFromMap()}catch(o){}}tileViewportX1++;tileViewportWidth--}while(tileViewportX1>k){tileViewportX1--;tileViewportWidth++;for(var e=0;e<tileViewportHeight;e++)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=RequestTile(tileViewportX1,tileViewportY1+e,currentView.zoomLevel,currentView.mapStyle,b[a[d]],a[d],b[a[d]].opacity,b[a[d]].zIndex);c[a[d]].splice(e*tileViewportWidth,0,g)}}while(tileViewportY1<m){for(var f=0;f<tileViewportWidth;f++)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=c[a[d]].shift();try{g.RemoveFromMap()}catch(o){}}tileViewportY1++;tileViewportHeight--}while(tileViewportY1>m){tileViewportY1--;tileViewportHeight++;for(var f=tileViewportWidth-1;f>=0;f--)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=RequestTile(tileViewportX1+f,tileViewportY1,currentView.zoomLevel,currentView.mapStyle,b[a[d]],a[d],b[a[d]].opacity,b[a[d]].zIndex);c[a[d]].unshift(g)}}while(tileViewportX2>l){for(var e=tileViewportHeight-1;e>=0;e--)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=c[a[d]].splice(e*tileViewportWidth+tileViewportWidth-1,1)[0];try{g.RemoveFromMap()}catch(o){}}tileViewportX2--;tileViewportWidth--}while(tileViewportX2<l){tileViewportX2++;tileViewportWidth++;for(var e=0;e<tileViewportHeight;e++)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=RequestTile(tileViewportX2,tileViewportY1+e,currentView.zoomLevel,currentView.mapStyle,b[a[d]],a[d],b[a[d]].opacity,b[a[d]].zIndex);c[a[d]].splice(e*tileViewportWidth+tileViewportWidth-1,0,g)}}while(tileViewportY2>n){for(var f=0;f<tileViewportWidth;f++)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=c[a[d]].pop();try{g.RemoveFromMap()}catch(o){}}tileViewportY2--;tileViewportHeight--}while(tileViewportY2<n){tileViewportY2++;tileViewportHeight++;for(var f=0;f<tileViewportWidth;f++)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=RequestTile(tileViewportX1+f,tileViewportY2,currentView.zoomLevel,currentView.mapStyle,b[a[d]],a[d],b[a[d]].opacity,b[a[d]].zIndex);c[a[d]].push(g)}}};this.StepAnimation=j;this.zoomView=function(g){if(!h)return;var l=originX+offsetX,m=originY+offsetY,o=currentView.zoomLevel,k=g.zoomLevel,i=MathRound(g.center.x-width/2),j=MathRound(g.center.y-height/2);e[mapTiles]=c[mapTiles];for(var d=0;d<a.length;d++)if(b[a[d]].ID==mapTiles)c[a[d]]=[];else ClearTiles(c[a[d]]);for(var f=0;f<e[mapTiles].length;f++)e[mapTiles][f].PrepareBaseTile(l,m,o,i,j,k);for(var d=0;d<pushpins.length;d++)pushpins[d].PrepareForZoom(i,j,k);currentView.Destroy();currentView=g;var n=[];n=e[mapTiles];this.SetViewPort();this.RefreshTileLayers();e[mapTiles]=n;for(var f=0;f<c[mapTiles].length;f++)c[mapTiles][f].PrepareSwapTile(l,m,o,i,j,k);zoomCounter=1;this.StepAnimation()};function j(){if(!zooming)return;for(var a=0;a<e[mapTiles].length;a++)e[mapTiles][a].SetFactor(zoomCounter);for(var a=0;a<c[mapTiles].length;a++)c[mapTiles][a].SetFactor(zoomCounter);for(var b=0;b<pushpins.length;b++)pushpins[b].SetFactor(zoomCounter);if(zoomCounter<zoomTotalSteps){zoomCounter++;window.setTimeout(j,1)}else{zoomCounter=0;tileLayerManager.FinalizeView()}}this.ClearTileLayers=function(){for(var d=0;d<a.length;d++){ClearTiles(c[a[d]]);b[a[d]]=null;delete b[a[d]];a[d]=null}a.length=0};function i(){if(typeof Msn.VE.API.Globals.vemapinstances=="undefined"||Msn.VE.API.Globals.vemapinstances==null)return null;var b=0;for(var a in Msn.VE.API.Globals.vemapinstances)if(Msn.VE.API.Globals.vemapinstances[a]instanceof VEMap&&Msn.VE.API.Globals.vemapinstances[a].vemapcontrol&&Msn.VE.API.Globals.vemapinstances[a].GetMapMode()==VEMapMode.Mode3D)return Msn.VE.API.Globals.vemapinstances[a].vemapcontrol.Get3DControl();return null}this.ClearTileLayer=function(d){if(b[d]!=null&&b[d]!="undefined"){if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null){var f=i();if(typeof f!="undefined"&&f!=null)f.RemoveImageSource(d,b[d].ID)}ClearTiles(c[d]);b[d]=null;delete b[d]}for(var e=0;e<a.length;e++)if(a[e]==d){a[e]=null;a.splice(e,1)}};this.RefreshTileLayers=function(){if(a!=null)for(var c=0;c<a.length;c++)this.LoadTileLayer(a[c],b[a[c]].ID,b[a[c]].opacity,b[a[c]].zIndex)};this.RefreshTileLayer=function(a){this.LoadTileLayer(a,b[a].ID,b[a].opacity,b[a].zIndex)};this.SetTileSource=function(a){var b=new VETileSourceSpecification;b.ID=a.ID;b.SourceName=a.TileSource;b.NumServers=a.NumServers;b.Bounds=a.Bounds;if(typeof a.MinZoomLevel!="undefined"&&a.MinZoomLevel!=null)b.MinZoom=a.MinZoomLevel;if(typeof a.MaxZoomLevel!="undefined"&&a.MaxZoomLevel!=null){b.MaxZoom=a.MaxZoomLevel;if(b.MaxZoom>g)g=b.MaxZoom}if(a.GetTilePath!="undefined"&&a.GetTilePath!=null)b.GetTilePath=a.GetTilePath;tileLayerManager.AddTileSource(b)};this.DeleteTileSource=function(f){if(d[f]!=null&&d[f]!="undefined"){d[f]=null;delete d[f]}if(a!=null)for(var e=0;e<a.length;e++)if(b[a[e]]!=null&&b[a[e]]!="undefined"&&b[a[e]].ID==f){ClearTiles(c[a[e]]);b[a[e]]=null;delete b[a[e]];a[e]=null;a.splice(e,1)}};this.CheckTilesAvailability=function(h,n){var k=PixelToLatLong(new VEPixel(0,0)),j=PixelToLatLong(new VEPixel(width,height));if(k==null||j==null)return;var a=k.latitude,c=j.longitude,e=j.latitude,f=k.longitude;if(a<e){var i=a;a=e;e=i}if(c<f){var i=c;c=f;f=i}var l=new Msn.VE.LatLongRectangle(new Msn.VE.LatLong(a,f),new Msn.VE.LatLong(e,c)),o=d[h].Bounds.length;for(var g=0;g<o;g++){a=d[h].Bounds[g].TopLeftLatLong.Latitude;c=d[h].Bounds[g].BottomRightLatLong.Longitude;e=d[h].Bounds[g].BottomRightLatLong.Latitude;f=d[h].Bounds[g].TopLeftLatLong.Longitude;if(a<e){var i=a;a=e;e=i}if(c<f){var i=c;c=f;f=i}var m=new Msn.VE.LatLongRectangle(new Msn.VE.LatLong(a,f),new Msn.VE.LatLong(e,c));if(tileLayerManager.BBOverlap(l,m))return true}b[n].isActive=false;return false};this.BBOverlap=function(a,b){return this.RectInBoundingBox(b,a)};this.RectInBoundingBox=function(a,b){return!(a.southeast.latitude>b.northwest.latitude||a.southeast.longitude<b.northwest.longitude||a.northwest.latitude<b.southeast.latitude||a.northwest.longitude>b.southeast.longitude)};this.ShowTrafficLegend=function(a){k=a;Fire("onapitrafficdisplay")};this.HideTrafficLegend=function(){Fire("onapitraffichide")};this.GetTimeStamp=function(){return k};this.GetMaxTileZoom=function(){return g};this.SetMarketMaxZoom=function(a){marketMaxZoom=a;d[mapTiles].MaxZoom=a};this.SetClientToken=function(a,b){f[a]=b;if(d[a])d[a].SetClientToken(b)};this.SetPrintable=function(f){if(f)for(var b=0;b<a.length;b++){var e=c[a[b]].length;for(var d=0;d<e;d++)c[a[b]][d].AddPrintTile()}else for(var b=0;b<a.length;b++){var e=c[a[b]].length;for(var d=0;d<e;d++)c[a[b]][d].RemovePrintTile()}};this.RePositionPrintTiles=function(){for(var b=0;b<a.length;b++){var e=c[a[b]].length;for(var d=0;d<e;d++)c[a[b]][d].RePositionPrintTile()}}}
function VETileSourceSpecification()
{this.ID="";this.SourceName="";this.OriginalName=null;this.NumServers=0;this.Bounds=null;this.MinZoom=minZoom;this.MaxZoom=1;this.IsVisible=true;this.GetTilePath=function(a)
{try
{if(a!=null&&a!="undefined")
{var e="",b=0;for(var c=a.ZoomLevel;c>0;c--)
{b=0;var d=1<<c-1;if((a.XPos&d)!=0)
b++;if((a.YPos&d)!=0)
b+=2;e+=b+""}
var serv=0;if(oMapa.EstaNoPaisBase()&&a.ZoomLevel>10&&a.MapStyle=='r')
{serv=1;this.SourceName="http://imakm%2.maplink3.com.br/maps.ashx?v="+e+"|t&call="+G_CallTiles;}
else
{serv=0;if(a.MapStyle!='r')
this.SourceName="http://a%2.ortho.tiles.virtualearth.net/tiles/a%4.%5?g=%6";else
this.SourceName="http://%3%2.ortho.tiles.virtualearth.net/tiles/%3%4.%5?g=%6";}
var c=(b%this.NumServers)+serv;return this.SourceName.replace(/%1/g,a.MapStyle).replace(/%2/g,c).replace(/%3/g,a.MapStyle).replace(/%4/g,e).replace(/%5/g,a.MapStyle==roadStyle?"png":"jpeg").replace(/%6/g,generations[a.MapStyle])}
else
return""}
catch(f){}};this.SetClientToken=function(b){if(this.OriginalName)this.SourceName=this.OriginalName;else this.OriginalName=this.SourceName;if(b){var a;if(this.SourceName.indexOf("?")>=0)a="&";else a="?";this.SourceName=this.SourceName.concat(a,Msn.VE.API.Constants.clienttoken,"=",b)}else this.OriginalName=null}}function VETileLayerSpecification(){this.ID="";this.ZIndex=0;this.Opacity=1}function VETileContext(){this.XPos=0;this.YPos=0;this.ZoomLevel=0;this.MapStyle=""}VEAuthenticationCode=function(){};VEAuthenticationCode.None=0;VEAuthenticationCode.NoToken=1;VEAuthenticationCode.TokenValid=2;VEAuthenticationCode.TokenInvalid=3;VEAuthenticationCode.TokenExpired=4;VEAuthenticationCode.TokenIPInvalid=5;VEAuthenticationCode.TokenExpiredAndIPInvalid=6;VEAuthenticationCode.TokenValidButNotAuthorized=7;this.__HandleAuthentication=function(a){if(a&&a.ResponseSummary&&a.ResponseSummary.AuthResultCode){var b=a.ResponseSummary.AuthResultCode;switch(b){case VEAuthenticationCode.TokenExpired:case VEAuthenticationCode.TokenExpiredAndIPInvalid:this.Fire("ontokenexpire");break;case VEAuthenticationCode.TokenInvalid:case VEAuthenticationCode.TokenIPInvalid:case VEAuthenticationCode.TokenValidButNotAuthorized:this.Fire("ontokenerror")}}};this.SetCenter=SetCenter;this.SetCenterAccurate=SetCenterAccurate;this.SetMapStyle=SetMapStyle;this.SetScaleBarDistanceUnit=SetScaleBarDistanceUnit;this.GetCenterLatitude=GetCenterLatitude;this.GetCenterLongitude=GetCenterLongitude;this.GetLatitude=GetLatitude;this.GetLongitude=GetLongitude;this.GetY=GetY;this.GetX=GetX;this.LatLongToPixel=LatLongToPixel;this.LatLongToPixelAsync=LatLongToPixelAsync;this.PixelToLatLong=PixelToLatLong;this.PixelToLatLongAsync=PixelToLatLongAsync;this.GetZoomLevel=GetZoomLevel;this.GetMapStyle=GetMapStyle;this.GetMapMode=GetMapMode;this.GetMode=GetMode;this.GetAltitude=GetAltitude;this.GetDirection=GetDirection;this.GetTilt=GetTilt;this.GetMetersPerPixel=GetMetersPerPixel;this.Fill=Fill;this.Resize=Resize;this.PanMap=PanMap;this.ContinuousPan=ContinuousPan;this.StopContinuousPan=StopContinuousPan;this.StopKeyboardPan=StopKeyboardPan;this.PanToLatLong=PanToLatLong;this.PanByPixel=PanByPixel;this.GetPushpins=GetPushpins;this.AddPushpin=AddPushpin;this.RemovePushpin=RemovePushpin;this.ClearPushpins=ClearPushpins;this.GetPushpinMapPixel=GetPushpinMapPixel;this.SetViewport=SetViewport;this.SetBestMapView=SetBestMapView;this.ClipLatitude=ClipLatitude;this.ClipLongitude=ClipLongitude;this.GetBestMapViewBounds=GetBestMapViewBounds;this.IncludePointInViewport=IncludePointInViewport;this.SetZoom=SetZoom;this.SetTilt=SetTilt;this.SetDirection=SetDirection;this.SetAltitude=SetAltitude;this.ZoomIn=ZoomIn;this.ZoomOut=ZoomOut;this.SetCenterAndZoom=SetCenterAndZoom;this.AddLine=AddLine;this.RemoveLine=RemoveLine;this.ClearLines=ClearLines;this.AttachEvent=AttachEvent;this.DetachEvent=DetachEvent;this.AttachCustomEvent=AttachCustomEvent;this.DetachCustomEvent=DetachCustomEvent;this.FireCustomEvent=FireCustomEvent;this.DisposeAllCustomEvent=DisposeAllCustomEvent();this.CreateEvent=CreateEvent;this.Fire=Fire;this.IsObliqueAvailable=IsObliqueAvailable;this.GetObliqueScene=GetObliqueScene;this.SetAnimationEnabled=SetAnimationEnabled;this.IsAnimationEnabled=IsAnimationEnabled;this.SetObliqueScene=SetObliqueScene;this.SetObliqueLocation=SetObliqueLocation;this.SetObliqueOrientation=SetObliqueOrientation;this.SetView=SetView;this.Debug=Debug;this.GetResponseRangeCounts=GetResponseRangeCounts;this.ResetResponseRangeCounts=ResetResponseRangeCounts;this.GetFailureRate=GetFailureRate;this.SetTrafficView=SetTrafficView;this.GetTrafficAvailability=GetTrafficAvailability;this.GetMarketsFile=GetMarketsFile;this.GetIncidentsFile=GetIncidentsFile;this.GetSlidingExpirationForAutoRefresh=GetSlidingExpirationForAutoRefresh;this.GetAutoRefreshRate=GetAutoRefreshRate;this.GetMapLegend=GetMapLegend;this.SetFocus=SetFocus;this.GetCurrentMode=GetCurrentMode;this.GetObliqueMode=GetObliqueMode;this.GetMapWidth=GetMapWidth;this.GetMapHeight=GetMapHeight;this.GetCurrentMapView=GetCurrentMapView;this.SetBaseTileSource=SetBaseTileSource;this.SetTileSource=tileLayerManager.SetTileSource;this.SetTileLayerVisibility=tileLayerManager.SetTileLayerVisibility;this.AddMapServiceLayersTo3D=tileLayerManager.AddMapServiceLayersTo3D;this.DeleteMapServiceLayersFrom3D=tileLayerManager.DeleteMapServiceLayersFrom3D;this.LoadTileLayer=tileLayerManager.LoadTileLayer;this.ClearTileLayer=tileLayerManager.ClearTileLayer;this.ClearTileLayers=tileLayerManager.ClearTileLayers;this.DeleteTileSource=tileLayerManager.DeleteTileSource;this.HideBaseTileLayer=tileLayerManager.HideBaseTileLayer;this.ShowBaseTileLayer=tileLayerManager.ShowBaseTileLayer;this.RefreshTileLayer=tileLayerManager.RefreshTileLayer;this.RefreshTileLayers=tileLayerManager.RefreshTileLayers;this.ShowTrafficLegend=tileLayerManager.ShowTrafficLegend;this.HideTrafficLegend=tileLayerManager.HideTrafficLegend;this.GetTimeStamp=tileLayerManager.GetTimeStamp;this.GetMaxTileZoom=tileLayerManager.GetMaxTileZoom;this.PanView=tileLayerManager.PanView;this.LoadBaseLayer=tileLayerManager.LoadBaseLayer;this.GetCurrentViewMaxZoomLevel=GetCurrentViewMaxZoomLevel;this.SetTilePixelBuffer=SetTilePixelBuffer;this.SetClientToken=SetClientToken;this.SetMapHeight=SetMapHeight;this.GetMapSurface=GetMapSurface;this.EnableMode=EnableMode;this._Enable3DMode=_Enable3DMode;this._Disable3DMode=_Disable3DMode;this.ControlReady=ControlReady;this.Get3DVisibleArea=Get3DVisibleArea;this.Get3DControl=Get3DControl;this.IsModeEnabled=IsModeEnabled;this.Sync3dView=Sync3dView;this.OnBeginCameraUpdate=OnBeginCameraUpdate;this.OnEndCameraUpdate=OnEndCameraUpdate;this.IsCameraFlying=IsCameraFlying;this.Show3DTraffic=Show3DTraffic;this.Remove3DTraffic=Remove3DTraffic;this.Show3DBirdseye=Show3DBirdseye;this.IterativeCameraRefinement=IterativeCameraRefinement;this.SetChildDiv=SetChildDiv;this.EnableGeoCommunity=EnableGeoCommunity;this.IsGeoCommunityEnabled=IsGeoCommunityEnabled;this.HijackMouseCursor=HijackMouseCursor;this.IsHijackMouseCursor=IsHijackMouseCursor;this.GetOffsetX=GetOffsetX;this.GetOriginY=GetOriginY;this.GetOriginX=GetOriginX;this.GetOffsetY=GetOffsetY;this.GetCenterOffset=GetCenterOffset;this.SetCenterOffset=SetCenterOffset;this.UpdatePreferredView=UpdatePreferredView;this.GetGraphic=GetGraphic;this.GetCurrentTileViewPort=GetCurrentTileViewPort;this.CalculateTileViewPort=CalculateTileViewPort;this.CreateDashboard=CreateDashboard;this.GetLastViewChangeType=GetLastViewChangeType;this.SetOn3DAnimationInterruptedCallback=SetOn3DAnimationInterruptedCallback;this.GetOn3DAnimationInterruptedCallback=GetOn3DAnimationInterruptedCallback;this.SetShowMapModeSwitch=SetShowMapModeSwitch;this.GetObliqueAvailability=GetObliqueAvailability;this.GetTopPx=GetTopPx;this.GetLeftPx=GetLeftPx;this.SetPrintable=SetPrintable;this.CreateMinimap=CreateMinimap;this.IsMapViewOblique=IsMapViewOblique;this.IsMapViewOrtho=IsMapViewOrtho};Msn.VE.Bounds=function(e,f,a,c,b,d){this.z1=e;this.z2=f;this.x1=a;this.y1=c;this.x2=b;this.y2=d};Msn.VE.DashboardStates=new function(){this.MapMode=new function(){this.Flatland=1;this.View3D=2};this.MapView=new function(){this.Ortho=4;this.Oblique=8;this.StreetSide=16};this.MapStyle=new function(){this.Road=32;this.Shaded=64;this.Aerial=128;this.Hybrid=256}};VEMiniMapSize=function(){};VEMiniMapSize.Small="small";VEMiniMapSize.Large="large";VEMiniMapExpandState=function(){};VEMiniMapExpandState.Collapsed="collapsed";VEMiniMapExpandState.Expanded="expanded";VEMiniMapVersion=function(){};VEMiniMapVersion[5]="MSVE_Minimap_V5";VEMiniMapVersion[6]="MSVE_Minimap_V6";Msn.VE.Minimap=function(bb,m,cb,h){var n=this,db=Msn.VE.Css,U=Msn.VE.Css.Functions,t=Msn.VE.DashboardStates.MapMode.Flatland,e=Msn.VE.DashboardStates.MapView.Ortho,N=false,O=null,A=false,u=false,B=false,k=true,o=null,c=bb,b=null,a=m,i=[];i[VEMiniMapSize.Small]="MSVE_smallMinimap";i[VEMiniMapSize.Large]="MSVE_normalMinimap";var w=[];w[VEMiniMapSize.Small]=L_MinimapLargerToolTip_Text;w[VEMiniMapSize.Large]=L_MinimapSmallerToolTip_Text;var r=[];r[VEMiniMapSize.Small]=138.5;r[VEMiniMapSize.Large]=180.5;if(h!=5&&h!=6)h=5;c.className=VEMiniMapExpandState.Expanded+" "+i[VEMiniMapSize.Small]+" "+VEMiniMapVersion[h];var p=document.createElement("div");p.id="MSVE_minimap_transparency";c.appendChild(p);var f=document.createElement("div");f.id="MSVE_minimap_content";f.title=L_MinimapDragToolTip_Text;p.appendChild(f);var j=document.createElement("span");j.id="MSVE_minimap_glyph";j.title=L_MinimapHideToolTip_Text;if(cb!=false&&Msn.VE.Animation){this.rollInDirection=null;this.rollOutDirection=null;c.appendChild(j);H(this,h)}var d=null,q=false;a.AttachEvent("onchangemapstyle",W);var D=document.createElement("div"),C=document.createElement("div"),l=document.createElement("div");l.id="MSVE_minimap_style_wrapper";f.appendChild(l);switch(h){case 5:var g=document.createElement("div");g.id="MSVE_minimap_resize";g.attachEvent("onclick",L);g.title=L_MinimapLargerToolTip_Text;pseudoHover(g);c.appendChild(g);break;case 6:if($MVEM.IsEnabled(MapControl.Features.Minimap.ShowByDefault))j.title=L_MinimapHideToolTip_Text;else j.title=L_MinimapShowToolTip_Text}function V(){var g={};g.latitude=a.GetCenterLatitude();g.longitude=a.GetCenterLongitude();var h=a.GetZoomLevel()-4;if(h<1)h=1;if(g.latitude==null||g.longitude==null){g.latitude=0;g.longitude=0;h=1}g.zoomlevel=h;g.mapstyle=Msn.VE.MapStyle.Road;g.showScaleBar=false;g.showMapLegend=false;g.showDashboard=false;g.showMinimap=false;g.hideCopyright=true;g.disableLogo=true;g.clientToken=O;b=new Msn.VE.MapControl(f,g);b.Init();b.SetMinimapMode();G(D,"MSVE_minimap_r_style_button","MSVE_minimap_style",L_MinimapRoad_Text,L_MinimapRoadToolTip_Text,J,$MVEM.IsEnabled(MapControl.Features.MapStyle.Road));G(C,"MSVE_minimap_h_style_button","MSVE_minimap_style",L_MinimapHybrid_Text,L_MinimapHybridToolTip_Text,F,$MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid));K();b.AttachEvent("onendpan",S);b.AttachEvent("onclick",x);a.AttachEvent("onendpan",R);a.AttachEvent("onobliquechange",M);a.AttachEvent("onendzoom",P);a.AttachEvent("onchangeview",I);var i=a.IsModeEnabled(Msn.VE.MapActionMode.Mode3D)?Msn.VE.DashboardStates.MapMode.View3D:Msn.VE.DashboardStates.MapMode.Flatland;e=Msn.VE.DashboardStates.MapView.Ortho;if(a.IsMapViewOblique()){b.SetZoom(14);e=Msn.VE.DashboardStates.MapView.Oblique}d=new Msn.VE.CameraRotator(c,this,f);q=true;T(i);y();s()}this.Init=V;this.Destroy=function(){E(D,J);E(C,F);D=C=null;if(d){d.Destroy();d=null}a.DetachEvent("onendpan",R);a.DetachEvent("onobliquechange",M);a.DetachEvent("onendzoom",P);a.DetachEvent("onchangeview",I);if(b){b.DetachEvent("onendpan",S);b.DetachEvent("onclick",x);b.Destroy();b=null}switch(h){case 5:g.detachEvent("onclick",L)}l=null;p=null;f=null;j=null;g=null;n=null};this.IsInitialized=function(){return q};this.SetClientToken=function(a){O=a;if(b)b.SetClientToken(a)};function T(a){t=a}this.SetMapMode=T;function y(){if(!N&&typeof minimapRoller!="undefined"&&minimapRoller!=null&&t==Msn.VE.DashboardStates.MapMode.Flatland)if(e==Msn.VE.DashboardStates.MapView.Oblique){if(!minimapRoller.isExpanded())minimapRoller.rollOut(n.rollOutDirection)}else if(e==Msn.VE.DashboardStates.MapView.Ortho)if(minimapRoller.isExpanded()&&!$MVEM.IsEnabled(MapControl.Features.Minimap.ShowByDefault))minimapRoller.rollIn(n.rollInDirection)}this.SetRollerState=y;this.ChangeOrientation=function(b){if(t==Msn.VE.DashboardStates.MapMode.Flatland)if(e==Msn.VE.DashboardStates.MapView.Oblique)switch(b){case 0:case 360:a.SetObliqueOrientation("East");break;case 270:a.SetObliqueOrientation("South");break;case 90:a.SetObliqueOrientation("North");break;case 180:a.SetObliqueOrientation("West")}};this.SetKeepRollState=function(){N=true};function s(){if(t==Msn.VE.DashboardStates.MapMode.Flatland)if(e==Msn.VE.DashboardStates.MapView.Oblique){var b=a.GetObliqueScene();if(!b)return;var c=b.GetOrientation();d.SetStyle("oblique");switch(c){case"North":d.SetOrientation(90);break;case"South":d.SetOrientation(270);break;case"East":d.SetOrientation(0);break;case"West":d.SetOrientation(180)}d.Show()}else if(e==Msn.VE.DashboardStates.MapView.Ortho){d.SetStyle("ortho");d.Show()}else d.Hide();else d.Hide()}function Z(){u=true;a.PanToLatLong(b.GetCenterLatitude(),b.GetCenterLongitude())}function z(){var c=a.GetCenterLatitude(),d=a.GetCenterLongitude();A=true;b.PanToLatLong(c,d)}this.Hide=function(){c.style.display="none"};this.Show=function(){c.style.display="block"};this.SetPosition=function(a,b){c.style.left=a+"px";c.style.top=b+"px"};this.SetSize=function(a){var d=this.GetSize();if(a!=d){U.removeClass(c,i[d]);U.addClass(c,i[a]);g.title=w[a];if(c.className.indexOf(VEMiniMapExpandState.Expanded)>=0){B=true;b.Resize(r[a],r[a])}}};this.GetSize=function(){return c.className.indexOf(i[VEMiniMapSize.Large])>-1?VEMiniMapSize.Large:VEMiniMapSize.Small};this.SetDoUpdates=function(a){k=a;if(k)Q()};this.GetContainer=function(){return c};function W(){var b=e;e=Msn.VE.DashboardStates.MapView.Ortho;if(a.IsMapViewOblique()){e=Msn.VE.DashboardStates.MapView.Oblique;if(!q)V()}if(q&&e!=b){y();s()}}function S(){if(B){B=false;return}if(!A)Z();else A=false}function L(){var a=n.GetSize()==VEMiniMapSize.Small?VEMiniMapSize.Large:VEMiniMapSize.Small;n.SetSize(a)}function R(){if(!k)return;if(!u){o=v();z()}else u=false}function I(){if(!k)return;var c=v();if(!a.IsMapViewOblique()&&!c.Equals(o)){b.SetView(c);o=null}}function M(){if(!k)return;z();s()}function P(){if(!k)return;o=v();Q()}function v(){var d=b.GetCurrentMapView().MakeCopy(),e=a.GetCurrentMapView();d.SetCenterLatLong(new Msn.VE.LatLong(e.latlong.latitude,e.latlong.longitude));var c=1;if(Msn.VE.MapStyle.IsViewOblique(e.style))c=14;else c=e.GetZoomLevel()-4;if(c<1)c=1;d.SetZoomLevel(c);d.Resolve(b.GetCurrentMode(),b.GetMapWidth(),b.GetMapHeight());return d}function Q(){var c=0;if(a.IsMapViewOblique())c=14;else c=a.GetZoomLevel()-4;if(c<1)c=1;if(b.GetZoomLevel()==c){z();return}b.SetCenterAndZoom(a.GetCenterLatitude(),a.GetCenterLongitude(),c)}
function G(a,g,d,f,e,c,b)
{a.innerText=f;a.id=g;a.title=e;if(typeof b=="undefined"||b==true)
{a.className=d;a.attachEvent("onclick",c);a.attachEvent("onmousedown",IgnoreEvent)};pseudoHover(a);l.appendChild(a)}
function E(a,b){a.detachEvent("onclick",b);a.detachEvent("onmousedown",IgnoreEvent)}function x(){f.title="";b.DetachEvent("onclick",x)}function J(){K();$VE_A.Log($VE_A.PgName.Map,"MiniMapRoad")}function F(){X();$VE_A.Log($VE_A.PgName.Map,"MiniMapHybrid")}function X(){l.className="MSVE_minimap_hybrid_style";b.SetMapStyle("h")}function K(){l.className="MSVE_minimap_road_style";b.SetMapStyle("r")}function ab(){return h}this.GetVersion=ab;function H(b,g){var f=m.IsMapViewOblique()||$MVEM.IsEnabled(MapControl.Features.Minimap.ShowByDefault),d,e,c=$ID("MSVE_minimap"),a=$ID("MSVE_minimap_glyph");if(!a||!c)return;switch(g){case 5:b.rollInDirection=Msn.VE.Animation.RollDirection.RightLeft;b.rollOutDirection=Msn.VE.Animation.RollDirection.LeftRight;d=8;e=0;break;case 6:b.rollInDirection=Msn.VE.Animation.RollDirection.LeftRight|Msn.VE.Animation.RollDirection.BottomUp;b.rollOutDirection=Msn.VE.Animation.RollDirection.RightLeft|Msn.VE.Animation.RollDirection.TopDown;d=a.offsetWidth+1;e=a.offsetHeight;break;default:return}window.minimapRoller=new Msn.VE.Animation.Roller(c);minimapRoller.setAccelerationFunction(AccelerationFunctions.CrazyElevator);minimapRoller.setXLeave(d);minimapRoller.setYLeave(e);pseudoHover(a);Y(c,minimapRoller,"MSVE_minimap_glyph");if(!f)minimapRoller.collapse(b.rollInDirection);a.onclick=function(){var a=m.GetMinimap();a.SetKeepRollState();if(minimapRoller.isExpanded()){$VE_A.Log($VE_A.PgName.Map,"MiniMapCollapse");minimapRoller.rollIn(a.rollInDirection)}else{$VE_A.Log($VE_A.PgName.Map,"MiniMapExpand");minimapRoller.rollOut(a.rollOutDirection)}};window.attachEvent("onunload",function(){a=c=null;window.detachEvent("onunload",arguments.callee)})}function Y(a,b,c){b.hookEvent("afterrollin",function(){var d=Msn.VE.Css.Functions,b=m.GetMinimap();d.removeClass(a,"expanded");d.addClass(a,"collapsed");if(b&&b.IsInitialized())b.SetDoUpdates(false);$ID(c).title=L_MinimapShowToolTip_Text});b.hookEvent("afterrollout",function(){var d=Msn.VE.Css.Functions,b=m.GetMinimap();d.removeClass(a,"collapsed");d.addClass(a,"expanded");if(b&&b.IsInitialized()){b.SetDoUpdates(true);s()}$ID(c).title=L_MinimapHideToolTip_Text});b.hookEvent("beforerollout",function(){var a=m.GetMinimap();if(a&&!a.IsInitialized())a.Init()})}this.creatMinimapRoller=H;Msn.VE.CameraRotator=function(g,j,d){var n=Msn.VE.Css,m=j,g=g,d=d,e=0,c="ortho",a=document.createElement("div");a.id="MSVE_cameraPosition";d.appendChild(a);b(90);function i(){a=null}function k(){a.style.display="none"}function l(){a.style.display="block"}function f(a){b(a)}function h(a){switch(a){case"oblique":c="MSVE_direction";b(90);break;case"ortho":c="MSVE_ortho";b(90);break;default:c="MSVE_ortho";b(90)}}function b(b){e=MathFloor((b+45+720)/90)%4;a.className=c+e}this.Hide=k;this.Show=l;this.Destroy=i;this.SetStyle=h;this.SetOrientation=f}};Msn.VE.DashboardSize=new function(){this.Normal="normal";this.Small="small";this.Tiny="tiny"};Msn.VE.NavControlFactory=function(g,i,c,b,e,h,f,d){if(typeof c=="undefined"||c==null)c=Msn.VE.DashboardSize.Normal;if(typeof b=="undefined"||b==null)b="MSVE_dashboardId";if(!isFinite(parseInt(d)))d=6;var a;switch(d){case 5:a=new Msn.VE.V5Control(g,i,c,b,e,h,f);break;case 6:default:a=new Msn.VE.V6Control(g,i,c,b,e,h,f)}a.version=d;a.GetVersion=function(){return a.version};return a};Msn.VE.V5Control=function(A,a,j,D,y,B){Msn.VE.DashboardStates=new function(){this.MapMode=new function(){this.Flatland=1;this.View3D=2};this.MapView=new function(){this.Ortho=4;this.Oblique=8;this.StreetSide=16};this.MapStyle=new function(){this.Road=32;this.Shaded=64;this.Aerial=128;this.Hybrid=256}};var t={Style:"MSVE_navAction_mapStyleCell",Road:"MSVE_navAction_RoadMapStyle",Aerial:"MSVE_navAction_AerialMapStyle",Hybrid:"MSVE_navAction_HybridMapStyle",Mode:"MSVE_navAction_modeCell",Mode2D:"MSVE_navAction_FlatlandMapMode",Mode3D:"MSVE_navAction_View3DMapMode",View:"MSVE_navAction_mapViewCellInner",Ortho:"MSVE_navAction_OrthoMapView",Oblique:"MSVE_navAction_ObliqueMapView",StreetSide:"MSVE_navAction_StreetSideMapView",ShowLabels:"MSVE_navAction_showLabels",Pan:"MSVE_navAction_panContainer",PanUp:"MSVE_navAction_panUp",PanDown:"MSVE_navAction_panDown",PanLeft:"MSVE_navAction_panLeft",PanRight:"MSVE_navAction_panRight",TinyZoom:"MSVE_TinyZoomBar",OrthoZoom:"MSVE_OrthoZoomBar",ObliqueZoom:"MSVE_ObliqueZoomBar",ObliqueCompass:"MSVE_compassDiv",ObliqueNotification:"MSVE_obliqueNotification",ThreeDUpdatedNotification:"MSVE_threeDUpdatedNotification",Traffic:"MSVE_navAction_traffic",LocalizeMe:"MSVE_nacAction_localizeme"},f="Nav Bar";Msn.VE.CommonControls=function(c,w){function xb(b){var f=document.createElement("div"),e=document.createElement("div"),a=document.createElement("div"),d=document.createElement("div"),w=0,s=0,j=false;this.Init=function(){d.className="MSVE_ZoomBar_minus";d.id="MSVE_navAction_obliqueZoomBar_minus";d.unselectable="on";d.title=L_ZoomBarMinusToolTip_Text;d.attachEvent("onclick",l);pseudoHover(d);a.className="MSVE_ZoomBar_slider";a.id="MSVE_navAction_obliqueZoomBar_slider";a.unselectable="on";a.attachEvent("onmousedown",o);a.attachEvent("onmousemove",p);a.attachEvent("onmouseup",q);a.attachEvent("onclick",IgnoreEvent);pseudoHover(a);e.className="MSVE_ObliqueZoomBar_bar";e.unselectable="on";e.appendChild(a);e.attachEvent("onclick",r);f.className="MSVE_ZoomBar_plus";f.id="MSVE_navAction_obliqueZoomBar_plus";f.title=L_ZoomBarPlusToolTip_Text;f.unselectable="on";f.attachEvent("onclick",m);pseudoHover(f);b.className="MSVE_ZoomBar";b.id="MSVE_ObliqueZoomBar";b.appendChild(d);b.appendChild(e);b.appendChild(f);b.attachEvent("onmousedown",IgnoreEvent);b.attachEvent("onmouseup",IgnoreEvent);b.attachEvent("onclick",IgnoreEvent);b.attachEvent("ondblclick",IgnoreEvent);i()};function v(){b.style.display="block"}function u(){b.style.display="none"}function r(a){a=GetEvent(a);CancelEvent(a);k();n(h(Gimme.Screen.getMousePosition(a).y));return false}function h(b){b-=s+d.offsetHeight+a.offsetHeight;var c=e.offsetHeight-a.offsetHeight;if(b<0)b=0;else if(b>c)b=c;return b}function l(){c.ZoomOut();$VE_A.Log($VE_A.PgName.Map,"Zoom out","Nav Bar")}function m(){c.ZoomIn();$VE_A.Log($VE_A.PgName.Map,"Zoom in","Nav Bar")}function t(){d.detachEvent("onclick",l);a.detachEvent("onmousedown",o);a.detachEvent("onmousemove",p);a.detachEvent("onmouseup",q);a.detachEvent("onclick",IgnoreEvent);e.detachEvent("onclick",r);f.detachEvent("onclick",m);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onclick",IgnoreEvent);b.detachEvent("ondblclick",IgnoreEvent);d=a=e=f=null}function o(b){b=GetEvent(b);CancelEvent(b);k();if(a.setCapture)a.setCapture();j=true;return false}function p(b){b=GetEvent(b);CancelEvent(b);if(j)a.style.top=h(Gimme.Screen.getMousePosition(b).y)+"px";return false}function q(b){b=GetEvent(b);CancelEvent(b);if(a.releaseCapture)a.releaseCapture();j=false;n(h(Gimme.Screen.getMousePosition(b).y));i();return false}function k(){var a=g(b).getScreenPosition();w=a.x;s=a.y}function n(f){var b=e.offsetHeight-a.offsetHeight,d=1+MathRound((b-f)/b*1);c.SetZoom(d);$VE_A.Log($VE_A.PgName.Map,"Zoom")}function i(){if(c.GetZoomLevel()==1)a.style.top=e.offsetHeight-a.offsetHeight+"px";else a.style.top="0px"}this.Destroy=t;this.Show=v;this.Hide=u;this.UpdateFromMap=i}function C(z,x,y){var a=document.createElement("div");a.setAttribute("id",z);a.innerHTML=x;var c="MSVE_obliqueCompassPointOff",g=y;a.attachEvent("onmouseover",f);a.attachEvent("onmouseout",h);a.attachEvent("onclick",i);this.onclick=null;this.onmouseover=null;this.onmouseout=null;var e=25,b=this,d=false,j=new v(a,17,17);function f(e){if(d)return;c=a.className;a.className="MSVE_obliqueCompassPointHover";if(b.onmouseover)b.onmouseover(e)}function i(a){if(d)return;f(a);c="MSVE_obliqueCompassPointOn";if(b.onclick)b.onclick(a)}function h(e){if(d)return;a.className=c;if(b.onmouseout)b.onmouseout(e)}function m(){c="MSVE_obliqueCompassPointOn";a.className="MSVE_obliqueCompassPointOn"}function l(){c="MSVE_obliqueCompassPointOff";a.className="MSVE_obliqueCompassPointOff"}function u(){d=true;l()}function k(){d=false;m()}function q(){return a}function n(){return g}function o(a){g=a}function w(){j.Reset();k()}function p(b){a.style.left=b.left;a.style.top=b.top}function v(r,n,o){var g=r,a=0,b=.3,c=0,l=40,k=Math.PI/2,h=true,p=b+.1;function m(a,b,c){if(b>=c-a&&b<=c+a)return true;return false}function i(){a+=b;if(a>Math.PI*2)a-=Math.PI*2;else if(a<0)a+=Math.PI*2;if(m(p,a,c)){b=.3;a=c;d(a);return}d(a);window.setTimeout(i,l)}function d(a){var b=n+e*Math.sin(a),c=o+e*Math.cos(a);g.style.left=b+"px";g.style.top=c+"px"}function f(a){c=a;i()}function j(a,c){h=c;if(!h)b*=-1;f(k*a)}function q(){a=0}this.RotateTo=f;this.RotateToIndex=j;this.Reset=q}function t(){a.detachEvent("onmouseover",f);a.detachEvent("onmouseout",h);a.detachEvent("onclick",i);a=null}function s(a){e=a}function r(){return e}this.SetRadius=s;this.GetRadius=r;this.GetElement=q;this.GetCurrentPositionIndex=n;this.SetCurrentPositionIndex=o;this.SetCurrentPosition=p;this.On=m;this.Off=l;this.RotateToIndex=j.RotateToIndex;this.Reset=w;this.Disable=u;this.Enable=k;this.Destroy=t}function wb(E){var p=[];p.push({"top":"-8px","left":"17px"});p.push({"top":"17px","left":"42px"});p.push({"top":"42px","left":"17px"});p.push({"top":"17px","left":"-8px"});var g=document.createElement("div");g.setAttribute("id","MSVE_obliqueCompassContainer");g.title=L_ObliqueCompassSelectDirection_Text;var a=new C("MSVE_obliqueCompassPointN","N",0),j=a.GetElement();j.attachEvent("onclick",s);j.attachEvent("onmouseover",v);j.attachEvent("onmouseout",i);var d=new C("MSVE_obliqueCompassPointE","E",1),l=d.GetElement();l.attachEvent("onclick",u);l.attachEvent("onmouseover",y);l.attachEvent("onmouseout",i);var b=new C("MSVE_obliqueCompassPointS","S",2),k=b.GetElement();k.attachEvent("onclick",t);k.attachEvent("onmouseover",w);k.attachEvent("onmouseout",i);var e=new C("MSVE_obliqueCompassPointW","W",3),m=e.GetElement();m.attachEvent("onclick",x);m.attachEvent("onmouseover",z);m.attachEvent("onmouseout",i);var n=document.createElement("div");n.id="MSVE_navAction_obliqueCompassArrow";g.appendChild(j);g.appendChild(l);g.appendChild(k);g.appendChild(m);g.appendChild(n);E.appendChild(g);r();function q(a){if(a<0)a=4-Math.abs(a);return a}function o(l,i,k){var c=l.GetCurrentPositionIndex(),h,f=[];f[a.GetCurrentPositionIndex()]=L_North_Text;f[b.GetCurrentPositionIndex()]=L_South_Text;f[d.GetCurrentPositionIndex()]=L_East_Text;f[e.GetCurrentPositionIndex()]=L_West_Text;if(i){h=i==Msn.VE.BirdsEyeSearchSpinDirection.CounterclockwiseSpin;if(c+i!=2){var g;switch(i){case-1:switch(c){case 0:case 2:g=[3];break;case 1:g=[3,2]}break;case 1:switch(c){case 0:case 2:g=[1];break;case 3:g=[1,2]}}if(g){var j=L_ObliqueSkippingOneDirection_Text;if(c==0)j=L_ObliqueNoImageryInRequestedDirection_Text;if(g.length==2)j=L_ObliqueSkippingTwoDirections_Text;if(typeof ShowMessage!="undefined")ShowMessage(j.replace("%1",f[c]).replace("%2",f[g[0]]).replace("%3",f[g[1]]))}}}else{h=c!=3;if(k)if(c==0){if(typeof ShowMessage!="undefined")ShowMessage(L_ObliqueModeImageNotAvailable_Text)}else if(typeof ShowMessage!="undefined")ShowMessage(L_ObliqueNoImageryInRequestedDirection_Text.replace("%1",f[c]).replace("%2",f[0]))}d.SetCurrentPositionIndex(q(d.GetCurrentPositionIndex()-c));e.SetCurrentPositionIndex(q(e.GetCurrentPositionIndex()-c));a.SetCurrentPositionIndex(q(a.GetCurrentPositionIndex()-c));b.SetCurrentPositionIndex(q(b.GetCurrentPositionIndex()-c));a.RotateToIndex(2-a.GetCurrentPositionIndex()<0?a.GetCurrentPositionIndex():2-a.GetCurrentPositionIndex(),h);d.RotateToIndex(2-d.GetCurrentPositionIndex()<0?d.GetCurrentPositionIndex():2-d.GetCurrentPositionIndex(),h);b.RotateToIndex(2-b.GetCurrentPositionIndex()<0?b.GetCurrentPositionIndex():2-b.GetCurrentPositionIndex(),h);e.RotateToIndex(2-e.GetCurrentPositionIndex()<0?e.GetCurrentPositionIndex():2-e.GetCurrentPositionIndex(),h)}function h(a){switch(a){case 0:i();break;case 1:A();break;case 2:B();break;case 3:D()}}function i(){n.className="MSVE_obliqueCompassArrowU"}function B(){n.className="MSVE_obliqueCompassArrowD"}function A(){n.className="MSVE_obliqueCompassArrowR"}function D(){n.className="MSVE_obliqueCompassArrowL"}function t(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(b);h(0);var a=c.GetObliqueScene();if(a)if(a.GetOrientation()!=Msn.VE.Orientation.South)c.SetObliqueOrientation("South",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - South",f)}function s(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(a);h(0);var b=c.GetObliqueScene();if(b)if(b.GetOrientation()!=Msn.VE.Orientation.North)c.SetObliqueOrientation("North",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - North",f)}function u(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(d);h(0);var a=c.GetObliqueScene();if(a)if(a.GetOrientation()!=Msn.VE.Orientation.East)c.SetObliqueOrientation("East",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - East",f)}function x(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(e);h(0);var a=c.GetObliqueScene();if(a)if(a.GetOrientation()!=Msn.VE.Orientation.West)c.SetObliqueOrientation("West",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - West",f)}function w(){h(b.GetCurrentPositionIndex())}function y(){h(d.GetCurrentPositionIndex())}function z(){h(e.GetCurrentPositionIndex())}function v(){h(a.GetCurrentPositionIndex())}function I(){g.style.display="none"}function J(){g.style.display="block"}function r(k,j){var i=c.GetObliqueScene();if(!i)return;var f=i.GetOrientation(),g;switch(f){case"North":g=a;break;case"South":g=b;break;case"East":g=d;break;case"West":g=e}o(g,k,j);h(0);if(f!=Msn.VE.Orientation.North)a.Enable();else a.Disable();if(f!=Msn.VE.Orientation.South)b.Enable();else b.Disable();if(f!=Msn.VE.Orientation.East)d.Enable();else d.Disable();if(f!=Msn.VE.Orientation.West)e.Enable();else e.Disable()}function H(){a.Destroy();d.Destroy();b.Destroy();e.Destroy();j.detachEvent("onclick",s);j.detachEvent("onmouseover",v);j.detachEvent("onmouseout",i);l.detachEvent("onclick",u);l.detachEvent("onmouseover",y);l.detachEvent("onmouseout",i);k.detachEvent("onclick",t);k.detachEvent("onmouseover",w);k.detachEvent("onmouseout",i);m.detachEvent("onclick",x);m.detachEvent("onmouseover",z);m.detachEvent("onmouseout",i);g=null}function G(c){a.SetRadius(c);b.SetRadius(c);d.SetRadius(c);e.SetRadius(c)}function F(){return a.GetRadius()}this.Hide=I;this.Show=J;this.UpdateFromMap=r;this.SetRadius=G;this.GetRadius=F;this.Destroy=H}function Ab(b){var f=document.createElement("div"),e=document.createElement("div"),a=document.createElement("div"),d=document.createElement("div"),v=0,s=0,j=false;this.Init=function(){d.className="MSVE_ZoomBar_minus";d.id="MSVE_navAction_orthoZoomBar_minus";d.title=L_ZoomBarMinusToolTip_Text;d.unselectable="on";d.attachEvent("onclick",l);pseudoHover(d);a.className="MSVE_ZoomBar_slider";a.id="MSVE_navAction_orthoZoomBar_slider";a.title=L_ZoomBarSliderToolTip_Text;a.unselectable="on";a.attachEvent("onmousedown",o);a.attachEvent("onmousemove",p);a.attachEvent("onmouseup",q);a.attachEvent("onclick",IgnoreEvent);pseudoHover(a);e.className="MSVE_OrthoZoomBar_bar";e.unselectable="on";e.appendChild(a);e.attachEvent("onclick",r);f.className="MSVE_ZoomBar_plus";f.id="MSVE_navAction_orthoZoomBar_plus";f.title=L_ZoomBarPlusToolTip_Text;f.unselectable="on";f.attachEvent("onclick",m);pseudoHover(f);b.className="MSVE_ZoomBar";b.id="MSVE_OrthoZoomBar";b.appendChild(d);b.appendChild(e);b.appendChild(f);b.attachEvent("onmousedown",IgnoreEvent);b.attachEvent("onmouseup",IgnoreEvent);b.attachEvent("onclick",IgnoreEvent);b.attachEvent("ondblclick",IgnoreEvent);i()};this.Destroy=function(){d.detachEvent("onclick",l);a.detachEvent("onmousedown",o);a.detachEvent("onmousemove",p);a.detachEvent("onmouseup",q);a.detachEvent("onclick",IgnoreEvent);e.detachEvent("onclick",r);f.detachEvent("onclick",m);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onclick",IgnoreEvent);b.detachEvent("ondblclick",IgnoreEvent);d=a=e=f=null};function u(){b.style.display="block"}function t(){b.style.display="none"}function k(){var a=g(b).getScreenPosition();v=a.x;s=a.y}function o(b){b=GetEvent(b);CancelEvent(b);k();if(a.setCapture)a.setCapture();j=true;return false}function p(b){b=GetEvent(b);CancelEvent(b);if(j)a.style.top=h(Gimme.Screen.getMousePosition(b).y)+"px";return false}function q(b){b=GetEvent(b);CancelEvent(b);if(a.releaseCapture)a.releaseCapture();j=false;n(h(Gimme.Screen.getMousePosition(b).y));i();return false}function m(){c.ZoomIn();$VE_A.Log($VE_A.PgName.Map,"Zoom in","Nav Bar")}function l(){c.ZoomOut();$VE_A.Log($VE_A.PgName.Map,"Zoom out","Nav Bar")}function r(a){a=GetEvent(a);CancelEvent(a);k();n(h(Gimme.Screen.getMousePosition(a).y));return false}function h(b){b-=s+d.offsetHeight+a.offsetHeight;var c=e.offsetHeight-a.offsetHeight;if(b<0)b=0;else if(b>c)b=c;return b}function n(f){var b=e.offsetHeight-a.offsetHeight,d=1+MathRound((b-f)/b*18);c.SetZoom(d);$VE_A.Log($VE_A.PgName.Map,"Zoom")}function i(){var b=e.offsetHeight-a.offsetHeight,d=b-(c.GetZoomLevel()-1)/18*b;a.style.top=d+"px"}this.UpdateFromMap=i;this.Show=u;this.Hide=t}function Db(){var h=document.createElement("div"),g=document.createElement("div"),f=document.createElement("div"),a=false,d=g,b=f;this.Init=function(){g.className="MSVE_ZoomBar_plus";g.id="MSVE_navAction_tinyZoomBar_plus";g.title=L_ZoomBarPlusToolTip_Text;g.unselectable="on";f.className="MSVE_ZoomBar_minus";f.id="MSVE_navAction_tinyZoomBar_minus";f.title=L_ZoomBarMinusToolTip_Text;f.unselectable="on";c.AttachEvent("onendzoom",i);h.className="MSVE_ZoomBar";h.id="MSVE_TinyZoomBar";h.appendChild(g);h.appendChild(f);return h};this.HookupPlusMinusEvents=function(b,a){m(b);j(a)};function m(a){if(a)d=a;d.attachEvent("onmousedown",o);d.attachEvent("onmouseup",e);d.attachEvent("onmouseout",e)}this.HookupPlusEvents=m;function j(a){if(a)b=a;b.attachEvent("onmousedown",l);b.attachEvent("onmouseup",e);b.attachEvent("onmouseout",e)}this.HookupMinusEvents=j;function n(){if(d!=null){d.detachEvent("onmousedown",o);d.detachEvent("onmouseup",e);d.detachEvent("onmouseout",e)}if(a=="in")a=false}this.UnhookPlusEvents=n;function k(){if(b!=null){b.detachEvent("onmousedown",l);b.detachEvent("onmouseup",e);b.detachEvent("onmouseout",e)}if(a=="out")a=false}this.UnhookMinusEvents=k;this.Destroy=function(){n();k();c.DetachEvent("onendzoom",i);g=f=d=b=null};function q(){if(c.GetMapMode()==Msn.VE.MapActionMode.Mode3D)return true;else return c.IsAnimationEnabled()}function o(b){a="in";c.ZoomIn();if(b!==false)$VE_A.Log($VE_A.PgName.Map,"Zoom in","Nav Bar")}function i(){window.setTimeout(p,q()?1:500)}function p(){if(a=="in"&&c.GetZoomLevel()<21)c.ZoomIn(false);else if(a=="out"&&c.GetZoomLevel()>1)c.ZoomOut(false)}function l(b){a="out";c.ZoomOut();if(b!==false)$VE_A.Log($VE_A.PgName.Map,"Zoom out","Nav Bar")}function e(){a=false}this.GetPlus=function(){return g};this.GetMinus=function(){return f}}var a=t,l=[];l[a.Style]={Id:a.Style,InitialClass:null,OnClickFunction:null,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:null,Children:[a.Road,a.Aerial,a.Hybrid],Text:null};l[a.Road]={Id:a.Road,InitialClass:"MSVE_MapStyle",OnClickFunction:sb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:u,Enabled:MapControl.Features.MapStyle.Road,Title:L_NavActionRoadToolTip_Text,Children:null,Text:L_NavActionRoad_Text};l[a.Aerial]={Id:a.Aerial,InitialClass:"MSVE_MapStyle",OnClickFunction:mb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:u,Enabled:MapControl.Features.MapStyle.Aerial,Title:L_NavActionAerialToolTip_Text,Children:null,Text:L_NavActionAerial_Text};l[a.Hybrid]={Id:a.Hybrid,InitialClass:"MSVE_MapStyle",OnClickFunction:nb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:u,Enabled:MapControl.Features.MapStyle.Hybrid,Title:L_NavActionHybridToolTip_Text,Children:null,Text:L_NavActionHybrid_Text};l[a.Mode]={Id:a.Mode,InitialClass:"MSVE_modeCell",OnClickFunction:null,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:null,Children:[a.Mode2D,a.Mode3D],Text:null};l[a.Mode2D]={Id:a.Mode2D,InitialClass:"MSVE_MapMode",OnClickFunction:kb,StyleUpdateEvent:"oninitmode",StyleUpdateFunction:Z,Enabled:true,Title:L_NavActionFlatlandToolTip_Text,Children:null,Text:L_NavActionFlatland_Text};l[a.Mode3D]={Id:a.Mode3D,InitialClass:"MSVE_MapMode",OnClickFunction:qb,StyleUpdateEvent:"oninitmode",StyleUpdateFunction:Z,Enabled:MapControl.Features.MapStyle.View3D,Title:L_NavActionView3DToolTip_Text,Children:null,Text:L_NavActionView3D_Text};l[a.View]={Id:a.View,InitialClass:null,OnClickFunction:null,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:null,Children:[a.Ortho,a.Oblique,a.StreetSide],Text:null};l[a.Ortho]={Id:a.Ortho,InitialClass:"MSVE_MapStyle",OnClickFunction:v,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:u,Enabled:true,Title:L_NavActionOrthoToolTip_Text,Children:null,Text:null};l[a.Oblique]={Id:a.Oblique,InitialClass:"MSVE_MapStyle",OnClickFunction:G,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:u,Enabled:false,Title:L_NavActionObliqueToolTip_Text,Children:null,Text:null};l[a.StreetSide]={Id:a.StreetSide,InitialClass:"MSVE_MapStyle",OnClickFunction:hb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:u,Enabled:false,Title:L_NavActionStreetSideToolTip_Text,Children:null,Text:null};l[a.ShowLabels]={Id:a.ShowLabels,InitialClass:"MSVE_MapStyle",OnClickFunction:ub,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:u,Enabled:true,Title:L_NavActionShowLabels_Text,Children:null,Text:L_NavActionLabels_Text};l[a.Traffic]={Id:a.Traffic,InitialClass:"MSVE_MapStyle",OnClickFunction:zb,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:L_NavActionShowTrafficToolTip_Text,Children:null,Text:L_NavActionTraffic_Text};l[a.LocalizeMe]={Id:a.LocalizeMe,InitialClass:"MSVE_MapStyle",OnClickFunction:BuscaLocalIP,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:L_NavActionShowLocalizeMeToolTip_Text,Children:null,Text:L_NavActionLocalizeMe_Text};this.ObliqueFunctions=[];this.ObliqueFunctions.ObliqueImageryIn3D={ObliqueClickFunction:fb,Title:L_NavActionShowObliqueToolTip_Text,DependsOnObliqueAvailability:true};this.ObliqueFunctions.ObliqueTiltIn3D={ObliqueClickFunction:lb,Title:L_NavAction3DObliqueToolTip_Text,DependsOnObliqueAvailability:false};var e=this,b=[],j=Msn.VE.DashboardStates.MapMode.Flatland,d=Msn.VE.DashboardStates.MapView.Ortho,h=Msn.VE.DashboardStates.MapStyle.Road;this.orthoZoom=null;var m;this.obliqueCompass=null;this.obliqueZoom=null;this.displaying3DNotification=false;var A=null;this.Oblique3DFunctionality=this.ObliqueFunctions.ObliqueImageryIn3D;var r=document.createElement("div");r.id="MSVE_navAction_palette";document.body.appendChild(r);var I=false,ab=false,k=true,Q=false,s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin,N;for(N in w)if(w.hasOwnProperty(N))M(w[N]);function Hb(){var d=$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)&&(c.IsObliqueAvailable()||c.IsMapViewOblique());if(d){i(a.Oblique,true);if(b[a.ObliqueNotification]&&!c.IsMapViewOblique()&&!g(b[a.Oblique]).hasClass("MSVE_selected"))y()}else{i(a.Oblique,false);if(b[a.ObliqueNotification])q()}W();if(c.IsModeEnabled(Msn.VE.MapActionMode.Mode3D))T();else S()}function Gb(){var a;for(a in w)if(w.hasOwnProperty(a))J(w[a]);document.body.removeChild(r);r=null}function M(f){switch(f){case a.OrthoZoom:b[f]=document.createElement("div");e.orthoZoom=new Ab(b[f]);e.orthoZoom.Init();c.AttachEvent("onendzoom",x);r.appendChild(b[f]);x();return;case a.ObliqueZoom:b[f]=document.createElement("div");ab=true;b[f].id=f;r.appendChild(b[f]);return;case a.TinyZoom:m=new Db;b[f]=m.Init();c.AttachEvent("onendzoom",x);x();return;case a.ObliqueCompass:b[f]=document.createElement("div");b[f].id=f;I=true;return;case a.ObliqueNotification:db();return;case a.ThreeDUpdatedNotification:cb();return;case a.Oblique:c.AttachEvent("onve3dphotostatechanged",rb)}var d=l[f],g=document.createElement("div");b[d.Id]=g;g.id=d.Id;g.enabled=d.Enabled;g.classRecipients=[g];if(d.Text!=null)
{g.innerText=d.Text;g.innerHTML=d.Text;}
if(d.OnClickFunction!=null&&d.Enabled==true)g.attachEvent("onclick",d.OnClickFunction);if(d.StyleUpdateEvent!=null&&d.StyleUpdateFunction!=null)c.AttachEvent(d.StyleUpdateEvent,d.StyleUpdateFunction);if(d.InitialClass){g.className=d.InitialClass;if(!g.enabled)g.className+="_disabled"}if(d.Children!=null){var h;for(h in d.Children)if(d.Children.hasOwnProperty(h))g.appendChild(M(d.Children[h]))}else pseudoHover(g);switch(f){case a.Oblique:case a.ObliqueCompass:c.AttachEvent("onobliqueenter",yb);c.AttachEvent("onobliqueleave",K);c.AttachEvent("onendmapstyleoblique",pb);c.AttachEvent("onobliquechange",vb);c.AttachEvent("obliquerequestunavailable",eb);break;case a.Traffic:c.AttachEvent("onchangetraffic",D);D()}return g}function J(f){switch(f){case a.OrthoZoom:e.orthoZoom.Destroy();b[f]=null;c.DetachEvent("onendzoom",x);try{r.removeChild(b[f])}catch(j){}return;case a.ObliqueZoom:try{r.removeChild(b[f])}catch(j){}if(e.obliqueZoom){e.obliqueZoom.Destroy();e.obliqueZoom=null}case a.TinyZoom:m.Destroy();b[f]=null;return;case a.ObliqueCompass:if(I&&e.obliqueCompass){e.obliqueCompass.onclick=null;e.obliqueCompass.Destroy();e.obliqueCompass=null}return;case a.ObliqueNotification:b[a.ObliqueNotification].detachEvent("onclick",P);return;case a.ThreeDUpdatedNotification:b[a.ThreeDUpdatedNotification]=null;return;case a.Traffic:c.DetachEvent("onchangetraffic",D)}var i=b[f];if(i==null)return;var d=l[f];if(d.Children!=null){var g,h;for(h in d.Children)if(d.Children.hasOwnProperty(h)){g=d.Children[h];try{i.removeChild(b[g])}catch(j){}J(g)}}if(d.OnClickFunction!=null)i.detachEvent("onclick",d.OnClickFunction);try{if(c&&d.StyleUpdateEvent!=null&&d.StyleUpdateFunction!=null)c.DetachEvent(d.StyleUpdateEvent,d.StyleUpdateFunction)}catch(j){}b[d.Id]=null}function db(){b[a.ObliqueNotification]=document.createElement("div");b[a.ObliqueNotification].id=a.ObliqueNotification;b[a.ObliqueNotification].attachEvent("onclick",P);b[a.ObliqueNotification].innerHTML+='<div id="MSVE_obliqueNotifyBeak" ></div> '+'<div id="MSVE_obliqueNotifyContent"> '+'<div id="MSVE_obliqueNotifyText" >'+L_DashboardBirdsEyeText_Text+"</div>"+'<img id="MSVE_obliqueNotifyImg" />'+"</div>"}function cb(){b[a.ThreeDUpdatedNotification]=document.createElement("div");b[a.ThreeDUpdatedNotification].id=a.ThreeDUpdatedNotification;b[a.ThreeDUpdatedNotification].innerHTML+='<div id="MSVE_threeDNotifyIcon">&nbsp;</div> <div id="MSVE_threeDNotifyText">'+L_Dashboard3DInstalled_Text+"</div>"}function sb(){B();$VE_A.Log($VE_A.PgName.Map,"MapStyleRoad",f)}function B(){if(h==Msn.VE.DashboardStates.MapStyle.Road&&d==Msn.VE.DashboardStates.MapView.Ortho)return;h=Msn.VE.DashboardStates.MapStyle.Road;d=Msn.VE.DashboardStates.MapView.Ortho;n(j+d+h)}
function mb()
{if(b[a.ShowLabels])
{i(a.ShowLabels,true);if(k)
Y();else
X();var c=k?"LabelsOn":"LabelsOff";$VE_A.Log($VE_A.PgName.Map,"MapStyleAerial-"+c,f)}
else
{X();$VE_A.Log($VE_A.PgName.Map,"MapStyleAerial",f)}}
function X(){if(h==Msn.VE.DashboardStates.MapStyle.Aerial&&d==Msn.VE.DashboardStates.MapView.Ortho)return;h=Msn.VE.DashboardStates.MapStyle.Aerial;d=Msn.VE.DashboardStates.MapView.Ortho;n(j+d+h)}function nb(){Y();$VE_A.Log($VE_A.PgName.Map,"MapStyleHybrid",f)}function Y(){if(h==Msn.VE.DashboardStates.MapStyle.Hybrid&&d==Msn.VE.DashboardStates.MapView.Ortho)return;h=Msn.VE.DashboardStates.MapStyle.Hybrid;d=Msn.VE.DashboardStates.MapView.Ortho;n(j+d+h)}function v(){if(d==Msn.VE.DashboardStates.MapView.Ortho&&j==Msn.VE.DashboardStates.MapMode.Flatland)return;d=Msn.VE.DashboardStates.MapView.Ortho;if(j==Msn.VE.DashboardStates.MapMode.Flatland)switch(h){case Msn.VE.DashboardStates.MapStyle.Aerial:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Aerial))n(j+d+h);else B();break;case Msn.VE.DashboardStates.MapStyle.Hybrid:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid))n(j+d+h);else B();break;default:n(j+d+h)}else n(j+d);o()}function P(c){if(j==Msn.VE.DashboardStates.MapMode.View3D&&g(b[a.Oblique]).hasClass("MSVE_selected")){q();c.cancelBubble=true;return}G()}function G(){if(typeof b[a.ObliqueNotification]!="undefined"&&b[a.ObliqueNotification])q();if(j==Msn.VE.DashboardStates.MapMode.View3D)e.Oblique3DFunctionality.ObliqueClickFunction();else{if(Msn.VE.MapStyle.IsViewOblique(d))return;tb()}}var L=null;function fb(){var e=new Date;if(L!=null)if(e.getTime()-L.getTime()<1000)return;L=e;var d=!g(b[a.Oblique]).hasClass("MSVE_selected");c.Show3DBirdseye(d,h==Msn.VE.DashboardStates.MapStyle.Road||k);var i=d?"RequestLayerBirdsEyeOn":"RequestLayerBirdsEyeOff";$VE_A.Log($VE_A.PgName.Map,i,f)}var p;function tb(){d=Msn.VE.DashboardStates.MapView.Oblique;z();if(k)h=Msn.VE.DashboardStates.MapStyle.Hybrid;else h=Msn.VE.DashboardStates.MapStyle.Aerial;if(typeof Msn.VE.API=="undefined")ob();else R()}function ob(){if(!p){var a=$ID("msve_mapContainer");p=document.createElement("div");p.id="animator";a.appendChild(p)}p.style.display="block";p.className="zoom_animation";window.setTimeout(R,2000)}function R(){if(p){p.className="";p.style.display="none"}n(j+d+h);var a=k?"LabelsOn":"LabelsOff";$VE_A.Log($VE_A.PgName.Map,"MapStyleOblique-"+a,f)}function lb(){Fb(Msn.VE.DashboardStates.MapMode.View3D+Msn.VE.DashboardStates.MapView.Oblique)}function hb(){if(d==Msn.VE.DashboardStates.MapView.StreetSide&&j==Msn.VE.DashboardStates.MapMode.Flatland)return;d=Msn.VE.DashboardStates.MapView.StreetSide;n(j+d);jb()}function ub(){if(h==Msn.VE.DashboardStates.MapStyle.Aerial){k=true;h=Msn.VE.DashboardStates.MapStyle.Hybrid}else if(h==Msn.VE.DashboardStates.MapStyle.Hybrid){k=false;h=Msn.VE.DashboardStates.MapStyle.Aerial}n(j+d+h);var a=k?"LabelsOn":"LabelsOff",b=d==Msn.VE.DashboardStates.MapView.Oblique?"MapStyleOblique":"MapStyleAerial";$VE_A.Log($VE_A.PgName.Map,a+"-"+b,f)}function kb(){c.EnableMode(Msn.VE.MapActionMode.Mode2D);$VE_A.Log($VE_A.PgName.Map,"Mode2D",f)}function qb(){if(typeof b[a.ThreeDUpdatedNotification]!="undefined"&&b[a.ThreeDUpdatedNotification])F();if(!c.IsModeEnabled(Msn.VE.MapActionMode.Mode3D)){if(typeof ShowMessage!="undefined"){ShowMessage(L_3DLoading_Text);window.setTimeout(View3DSwitch,200)}else c.EnableMode(Msn.VE.MapActionMode.Mode3D);$VE_A.Log($VE_A.PgName.Map,"Mode3D",f)}}function D(){if(VE_TrafficManager.turnedOn){g(b[a.Traffic]).addClass("MSVE_selected");b[a.Traffic].title=L_NavActionHideTrafficToolTip_Text}else{g(b[a.Traffic]).removeClass("MSVE_selected");b[a.Traffic].title=L_NavActionShowTrafficToolTip_Text}}function zb(){if(VE_TrafficManager.turnedOn)VE_TrafficManager.ClearTraffic();else{$VE_A.LogTrafficActivation($VE_A.PgName.Map);VE_TrafficManager.GetTrafficInfo(true)}}function rb(c){if(c.enabled=="1"){g(b[a.Oblique]).addClass("MSVE_selected");b[a.Oblique].title=L_NavActionHideObliqueToolTip_Text}else{g(b[a.Oblique]).removeClass("MSVE_selected");b[a.Oblique].title=L_NavActionShowObliqueToolTip_Text}var e=c.enabled=="1"?"LayerBirdsEyeOn":"LayerBirdsEyeOff",d=h==Msn.VE.DashboardStates.MapStyle.Road||k?"LabelsOn":"LabelsOff";$VE_A.Log($VE_A.PgName.Map,e+"-"+d,f)}function u(a){W(a.view.mapStyle)}function Z(a){if(a==Msn.VE.MapActionMode.Mode3D)T();else S()}function T(){if(j==Msn.VE.DashboardStates.MapMode.View3D)return;j=Msn.VE.DashboardStates.MapMode.View3D;if(typeof b[a.Mode]!="undefined"&&b[a.Mode]!=null)g(b[a.Mode].classRecipients).swapClass("MSVE_FlatlandMapMode","MSVE_View3DMapMode");i(a.StreetSide,true);i(a.Road,true);i(a.Aerial,true);i(a.Hybrid,true);if(!e.Oblique3DFunctionality.DependsOnObliqueAvailability)i(a.Oblique,true);else{if(b[a.ObliqueNotification]!=null&&b[a.ObliqueNotification].enabled&&!g(b[a.Oblique]).hasClass("MSVE_selected"))y();o()}if(typeof b[a.Ortho]!="undefined"&&b[a.Ortho]!=null)b[a.Ortho].title=L_NavAction3DOrthoToolTip_Text;if(typeof b[a.Oblique]!="undefined"&&b[a.Oblique]!=null){b[a.Oblique].title=e.Oblique3DFunctionality.Title;if(b[a.Oblique].enabled&&!g(b[a.Oblique]).hasClass("MSVE_selected"))y()}if(typeof b[a.StreetSide]!="undefined"&&b[a.StreetSide]!=null)b[a.StreetSide].title=L_NavAction3DStreetSideToolTip_Text;var f=c.GetDashboard().GetShimmedElements(),d;for(d=0;d<f.length;d++)mvcViewFacade.UpdateShimIfSupported(f[d])}function S(){j=Msn.VE.DashboardStates.MapMode.Flatland;if(typeof b[a.Mode]!="undefined"&&b[a.Mode]!=null)g(b[a.Mode].classRecipients).swapClass("MSVE_View3DMapMode","MSVE_FlatlandMapMode");if(typeof b[a.Ortho]!="undefined"&&b[a.Ortho]!=null)b[a.Ortho].title=L_NavActionOrthoToolTip_Text;if(typeof b[a.Oblique]!="undefined"&&b[a.Oblique]!=null)b[a.Oblique].title=L_NavActionObliqueToolTip_Text;g(b[a.Oblique]).removeClass("MSVE_selected");photoState=0;if($MVEM.IsEnabled(MapControl.Features.MapStyle.Road))i(a.Road,true);else i(a.Road,false);if($MVEM.IsEnabled(MapControl.Features.MapStyle.Aerial))i(a.Aerial,true);else i(a.Aerial,false);if($MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid))i(a.Hybrid,true);else i(a.Hybrid,false);if($MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)){c.GetObliqueAvailability("OnFlatlandModeUpdateUIObliqueReturned",O);return}else O(false)}function O(b){if(b){i(a.Oblique,true);if(e.obliqueZoom!=null)e.obliqueZoom.UpdateFromMap()}else{i(a.Oblique,false);d=Msn.VE.DashboardStates.MapView.Ortho;o()}switch(d){case Msn.VE.DashboardStates.MapView.Oblique:if(b&&$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye))n(j+d);else v();break;case Msn.VE.DashboardStates.MapView.StreetSide:v();break;case Msn.VE.DashboardStates.MapView.Ortho:switch(h){case Msn.VE.DashboardStates.MapStyle.Aerial:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Aerial))n(j+d+h);else B();break;case Msn.VE.DashboardStates.MapStyle.Hybrid:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid))n(j+d+h);else B();break;default:n(j+d+h)}break;default:v()}}function x(){if(e.orthoZoom)e.orthoZoom.UpdateFromMap();if(e.obliqueZoom)e.obliqueZoom.UpdateFromMap();var b=null,a=null;if(m){var f=m.GetPlus();if(f)b=g([f]);var d=m.GetMinus();if(d)a=g([d])}if(c.IsMapViewOrtho()&&c.GetZoomLevel()==19||c.IsMapViewOblique()&&c.GetZoomLevel()==2){if(b)b.addClass("MSVE_ZoomBar_plus_disabled");if(m)m.UnhookPlusEvents()}else if(c.GetZoomLevel()==1){if(a)a.addClass("MSVE_ZoomBar_minus_disabled");if(m)m.UnhookMinusEvents()}if(c.IsMapViewOrtho()&&c.GetZoomLevel()!=19||c.IsMapViewOblique()&&c.GetZoomLevel()!=2)if(b&&b.hasClass("MSVE_ZoomBar_plus_disabled")){b.removeClass("MSVE_ZoomBar_plus_disabled");if(m)m.HookupPlusEvents()}if(c.GetZoomLevel()!=1)if(a&&a.hasClass("MSVE_ZoomBar_minus_disabled")){a.removeClass("MSVE_ZoomBar_minus_disabled");if(m)m.HookupMinusEvents()}}function yb(){if(c.IsMapViewOblique())d=Msn.VE.DashboardStates.MapView.Oblique;if(j==Msn.VE.DashboardStates.MapMode.Flatland||j==Msn.VE.DashboardStates.MapMode.View3D&&e.Oblique3DFunctionality.DependsOnObliqueAvailability){i(a.Oblique,true);if(b[a.ObliqueNotification]&&!c.IsMapViewOblique()&&!g(b[a.Oblique]).hasClass("MSVE_selected"))y()}}function K(){d=Msn.VE.DashboardStates.MapView.Ortho;o();if(j==Msn.VE.DashboardStates.MapMode.Flatland||j==Msn.VE.DashboardStates.MapMode.View3D&&e.Oblique3DFunctionality.DependsOnObliqueAvailability){i(a.Oblique,false);q()}}function eb(){if(c.IsObliqueAvailable())e.obliqueCompass.UpdateFromMap(s,true);else K()}function pb(){if(c.IsObliqueAvailable()){d=Msn.VE.DashboardStates.MapView.Ortho;o()}else K()}function vb(){if($MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)){if(d!=Msn.VE.DashboardStates.MapView.Oblique){d=Msn.VE.DashboardStates.MapView.Oblique;i(a.Oblique,true);z()}}else{d=Msn.VE.DashboardStates.MapView.Oblique;v()}if(b[a.ObliqueNotification])q();if(typeof e.obliqueCompass!="undefined"&&e.obliqueCompass!=null){e.obliqueCompass.UpdateFromMap(s);s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin}}function W(e){if(!e)e=c.GetMapStyle();switch(e){case Msn.VE.MapStyle.Shaded:d=Msn.VE.DashboardStates.MapView.Ortho;o();h=Msn.VE.DashboardStates.MapStyle.Shaded;V();if(b[a.ShowLabels]){i(a.ShowLabels,false);g(b[a.ShowLabels]).addClass("MSVE_selected")}break;case Msn.VE.MapStyle.Road:d=Msn.VE.DashboardStates.MapView.Ortho;o();h=Msn.VE.DashboardStates.MapStyle.Road;V();if(b[a.ShowLabels]){i(a.ShowLabels,false);g(b[a.ShowLabels]).addClass("MSVE_selected")}break;case Msn.VE.MapStyle.Aerial:d=Msn.VE.DashboardStates.MapView.Ortho;o();h=Msn.VE.DashboardStates.MapStyle.Aerial;H();k=false;if(b[a.ShowLabels]){i(a.ShowLabels,true);g(b[a.ShowLabels]).removeClass("MSVE_selected")}break;case Msn.VE.MapStyle.Hybrid:d=Msn.VE.DashboardStates.MapView.Ortho;o();h=Msn.VE.DashboardStates.MapStyle.Hybrid;if(b[a.ShowLabels]){k=true;H();i(a.ShowLabels,true);g(b[a.ShowLabels]).addClass("MSVE_selected")}else U();break;case Msn.VE.MapStyle.Oblique:d=Msn.VE.DashboardStates.MapView.Oblique;z();h=Msn.VE.DashboardStates.MapStyle.Aerial;if(b[a.ShowLabels]){H();k=false;i(a.ShowLabels,true);g(b[a.ShowLabels]).removeClass("MSVE_selected")}i(a.Oblique,true);break;case Msn.VE.MapStyle.ObliqueHybrid:d=Msn.VE.DashboardStates.MapView.Oblique;z();h=Msn.VE.DashboardStates.MapStyle.Hybrid;if(b[a.ShowLabels]){U();k=true;i(a.ShowLabels,true);g(b[a.ShowLabels]).addClass("MSVE_selected")}i(a.Oblique,true)}if(j==Msn.VE.DashboardStates.MapMode.View3D&&g(b[a.Oblique]).hasClass("MSVE_selected"))if(h==Msn.VE.DashboardStates.MapStyle.Road)c.Show3DBirdseye(true,true);else c.Show3DBirdseye(true,k);if(b[a.ShowLabels])if(k||h==Msn.VE.DashboardStates.MapStyle.Road)b[a.ShowLabels].title=L_NavActionHideLabels_Text;else b[a.ShowLabels].title=L_NavActionShowLabels_Text}function V(){if(typeof b[a.Style]!="undefined"&&b[a.Style]!=null){var c;for(c=0;c<b[a.Style].classRecipients.length;c++)b[a.Style].classRecipients[c].className="MSVE_RoadMapStyle"}}function H(){if(typeof b[a.Style]!="undefined"&&b[a.Style]!=null){var c;for(c=0;c<b[a.Style].classRecipients.length;c++)b[a.Style].classRecipients[c].className="MSVE_AerialMapStyle"}}function U(){if(typeof b[a.Style]!="undefined"&&b[a.Style]!=null){var c;for(c=0;c<b[a.Style].classRecipients.length;c++)b[a.Style].classRecipients[c].className="MSVE_HybridMapStyle"}}
function o()
{if(typeof b[a.View]!="undefined"&&b[a.View]!=null)
{var c=g(b[a.View].classRecipients);c.removeClass("MSVE_StreetSideView");c.removeClass("MSVE_ObliqueView");c.addClass("MSVE_OrthoView")}
if(b[a.Traffic]!=null){i(a.Traffic,true);D()}s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin}function z(){if(typeof b[a.View]!="undefined"&&b[a.View]!=null){var c=g(b[a.View].classRecipients);c.removeClass("MSVE_StreetSideView");c.removeClass("MSVE_OrthoView");c.addClass("MSVE_ObliqueView")}if(I){if(e.obliqueCompass==null){e.obliqueCompass=new wb(b[a.ObliqueCompass]);if(b[a.ObliqueCompass].radius)e.obliqueCompass.SetRadius(b[a.ObliqueCompass].radius);e.obliqueCompass.onclick=function(){s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin}}e.obliqueCompass.UpdateFromMap()}if(ab){if(e.obliqueZoom==null){e.obliqueZoom=new xb(b[a.ObliqueZoom]);e.obliqueZoom.Init()}e.obliqueZoom.UpdateFromMap()}if(b[a.Traffic]!=null&&j==Msn.VE.DashboardStates.MapMode.Flatland)i(a.Traffic,false)}function jb(){if(typeof b[a.View]!="undefined"&&b[a.View]!=null){var c=g(b[a.View].classRecipients);c.removeClass("MSVE_OrthoView");c.removeClass("MSVE_ObliqueView");c.addClass("MSVE_StreetSideView")}}function y(){if(!b[a.ObliqueNotification])return;if(Q)return;Q=true;if(!e.displaying3DNotification)if(d!=Msn.VE.DashboardStates.MapView.Oblique){if(!A){var o=g(b[a.ObliqueNotification]),k=o.select("img");for(var i=0;i<k.length&&!A;i++){var j=k.element(i);if(j.id=="MSVE_obliqueNotifyImg")A=j}}if(A)A.src=c.GetObliqueMode().GetMiddleTileFilename();var f=b[a.Oblique];b[a.ObliqueNotification].style.display="block";var m=f.offsetLeft+f.offsetWidth/2-b[a.ObliqueNotification].offsetWidth/2,n=f.offsetTop+f.offsetHeight+4;g(b[a.ObliqueNotification]).setStyle("top",n+"px").setStyle("left",m+"px");var l=E(),h;for(h=0;h<l.length;++h)mvcViewFacade.UpdateShimIfSupported(l[h]);m=n=f=null;window.setTimeout(q,6000)}}function bb(){if(!b[a.ThreeDUpdatedNotification])return;q();if(!e.displaying3DNotification){e.displaying3DNotification=true;var c=b[a.Mode3D];b[a.ThreeDUpdatedNotification].style.display="block";var d=c.offsetLeft-6,f=c.offsetTop+c.offsetHeight+4;g(b[a.ThreeDUpdatedNotification]).setStyle("top",f+"px").setStyle("left",d+"px");mvcViewFacade.UpdateShimIfSupported(b[a.ThreeDUpdatedNotification]);c=null;window.setTimeout(F,6000)}}function q(){b[a.ObliqueNotification].style.display="none";var d=E(),c;for(c=0;c<d.length;++c)mvcViewFacade.UpdateShimIfSupported(d[c])}function F(){e.displaying3DNotification=false;b[a.ThreeDUpdatedNotification].style.display="none";mvcViewFacade.UpdateShimIfSupported(b[a.ThreeDUpdatedNotification])}function i(c,d){if(b[c]==null)return;if(b[c].enabled==d)return;b[c].enabled=d;var a=l[c];if(a.InitialClass)if(d)g(b[c]).swapClass(a.InitialClass+"_disabled",a.InitialClass);else g(b[c]).swapClass(a.InitialClass,a.InitialClass+"_disabled");if(a.Title)b[c].title=a.Title;if(a.OnClickFunction)if(d)b[c].attachEvent("onclick",a.OnClickFunction);else b[c].detachEvent("onclick",a.OnClickFunction)}function n(d){if(d&Msn.VE.DashboardStates.MapView.Ortho||d&Msn.VE.DashboardStates.MapMode.View3D)if(d&Msn.VE.DashboardStates.MapStyle.Road)c.SetMapStyle("r");else if(d&Msn.VE.DashboardStates.MapStyle.Aerial)c.SetMapStyle("a");else if(d&Msn.VE.DashboardStates.MapStyle.Hybrid)c.SetMapStyle("h");if(d&Msn.VE.DashboardStates.MapMode.Flatland&&d&Msn.VE.DashboardStates.MapView.Oblique)if(d&Msn.VE.DashboardStates.MapStyle.Aerial&&c.GetMapStyle()!=Msn.VE.MapStyle.Oblique){k=false;if(b[a.ShowLabels]){i(a.ShowLabels,true);g(b[a.ShowLabels]).removeClass("MSVE_selected")}c.SetMapStyle(Msn.VE.MapStyle.Oblique)}else if(d&Msn.VE.DashboardStates.MapStyle.Hybrid&&c.GetMapStyle()!=Msn.VE.MapStyle.ObliqueHybrid){k=true;if(b[a.ShowLabels]){i(a.ShowLabels,true);g(b[a.ShowLabels]).addClass("MSVE_selected")}c.SetMapStyle(Msn.VE.MapStyle.ObliqueHybrid)}}function Fb(a){if(a&Msn.VE.DashboardStates.MapMode.View3D)if(a&Msn.VE.DashboardStates.MapView.Ortho)c.SetTilt(-90);else if(a&Msn.VE.DashboardStates.MapView.Oblique)c.SetTilt(-45);else if(a&Msn.VE.DashboardStates.MapView.StreetSide)c.SetTilt(-25)}function E(){return[b[a.ObliqueNotification]]}function Eb(a){return b[a]}function Bb(){return b}function Cb(){return m}function gb(){return s}function ib(a){s=a}this.SetMapViewState=function(a){d=a};this.GetMapViewState=function(){return d};this.SetMapModeState=function(a){j=a};this.GetMapModeState=function(){return j};this.SetLabelsState=function(a){k=a};this.GetLabelsState=function(){return k};this.GetLastRotationDirection=gb;this.SetLastRotationDirection=ib;this.GetObliqueNotifierShimmedElements=E;this.Init=Hb;this.Create=M;this.Destroy=Gb;this.DestroyControl=J;this.GetControl=Eb;this.GetControls=Bb;this.GetTinyZoom=Cb;this.OnOrthoMapViewClick=v;this.OnObliqueMapViewClick=G;this.UpdateZoom=x;this.SelectObliqueMapView=z;this.SelectOrthoMapView=o;this.DisplayObliqueNotification=y;this.HideObliqueNotification=q;this.DisplayThreeDUpdatedNotification=bb;this.HideThreeDUpdatedNotification=F};var c=document.createElement("div");c.id=D;A.appendChild(c);c.attachEvent("onmousedown",IgnoreEvent);c.attachEvent("onmouseup",IgnoreEvent);c.attachEvent("onmousemove",DashboardContainerMouseMoveEvent);c.attachEvent("onmousewheel",IgnoreEvent);c.attachEvent("ondblclick",IgnoreEvent);c.attachEvent("oncontextmenu",IgnoreEvent);c.attachEvent("onkeydown",IgnoreEvent);c.attachEvent("onkeyup",IgnoreEvent);c.className="MSVE_Dashboard MSVE_Dashboard_V5 MSVE_FlatlandMapMode";if(j==Msn.VE.DashboardSize.Normal)c.className+=" MSVE_Dashboard_Normal";else if(j==Msn.VE.DashboardSize.Small)c.className+=" MSVE_Dashboard_Small";else if(j==Msn.VE.DashboardSize.Tiny)c.className+=" MSVE_Dashboard_Tiny";var i=null,h=document.createElement("div");h.className="MSVE_header";h.id="MSVE_navAction_header";var e,d,b=t,p=document.createElement("div");p.id="MSVE_dashboardContainer";var r=document.createElement("div");r.id="MSVE_mapViewRow";p.appendChild(r);var n=document.createElement("div");n.id="MSVE_zoomDiv";var q=document.createElement("div");q.id="MSVE_navAction_mapViewCell";q.className="MSVE_dashboardMapModeContainer";r.appendChild(n);r.appendChild(q);var m=document.createElement("div");m.id="MSVE_mapStyleRow";p.appendChild(m);var k=document.createElement("div");k.id="MSVE_threeDNotification";var o=document.createElement("div");o.id="MSVE_lowerContainer";o.appendChild(p);c.className+=" expanded";c.appendChild(h);c.appendChild(o);var l=false;function F(){if(j==Msn.VE.DashboardSize.Normal){controlsNeeded=[b.Mode,b.View,b.Style,b.OrthoZoom,b.ObliqueCompass,b.ObliqueZoom];e=new Msn.VE.CommonControls(a,controlsNeeded);d=e.GetControls();e.displaying3DNotification=false;d[b.View].classRecipients=[p];d[b.Mode].classRecipients=[c];e.Oblique3DFunctionality=e.ObliqueFunctions.ObliqueTiltIn3D;e.Init();C(y);this.HideToggleGlyph();q.appendChild(d[b.View]);m.appendChild(d[b.Style]);m.appendChild(d[b.ObliqueCompass]);n.appendChild(d[b.OrthoZoom]);n.appendChild(d[b.ObliqueZoom]);if(B&&$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye))
{e.Create(b.ObliqueNotification);o.appendChild(d[b.ObliqueNotification])}
if(Msn.VE.Animation)u()}
if(j==Msn.VE.DashboardSize.Small)
{controlsNeeded=[b.Style];e=new Msn.VE.CommonControls(a,controlsNeeded);d=e.GetControls();m.appendChild(d[b.Style]);e.Init()}
if(j==Msn.VE.DashboardSize.Small||j==Msn.VE.DashboardSize.Tiny)
{controlsNeeded=[b.TinyZoom];e=new Msn.VE.CommonControls(a,controlsNeeded);d=e.GetControls();n.appendChild(d[b.TinyZoom]);var f=e.GetTinyZoom(),h=f.GetPlus(),g=f.GetMinus();if(h&&g)f.HookupPlusMinusEvents(h,g)}}
function E(){if(j==Msn.VE.DashboardSize.Normal){e.DestroyControl(d[b.OrthoZoom]);e.DestroyControl(d[b.ObliqueZoom]);e.DestroyControl(d[b.ObliqueCompass]);z();if(a){try{a.DetachEvent("onobliquechange",OnObliqueChange);if($MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)){a.DetachEvent("onobliqueenter",OnObliqueEnter);a.DetachEvent("onobliqueleave",OnObliqueLeave)}}catch(c){}a=null}}if(j==Msn.VE.DashboardSize.Normal||j==Msn.VE.DashboardSize.Small){e.DestroyControl(d[b.Style]);m.removeChild(d[b.Style])}if(j==Msn.VE.DashboardSize.Small||j==Msn.VE.DashboardSize.Tiny){e.DestroyControl(d[b.TinyZoom]);n.removeChild(d[b.TinyZoom])}m=e.obliqueCompass=null;q=r=null;o=null;k=null;d[b.ObliqueNotification]=n=d[b.ObliqueCompass]=null}function w(){if(!a.IsModeEnabled(Msn.VE.MapActionMode.Mode3D)&&!a.IsMapViewOblique()){o.appendChild(k);k.style.top=-(h.offsetHeight/2+6)+"px";k.innerHTML+='<div id="MSVE_threeDNotifyIcon">&nbsp;</div> <div id="MSVE_threeDNotifyText">'+L_Dashboard3DText_Text+"</div>";k.attachEvent("onclick",v);window.setTimeout(x,6000);e.displaying3DNotification=true}else k.style.display="none"}function C(a){s(a);i=document.createElement("a");i.className="MSVE_toggleGlyph";i.title=L_NavActionHideToolTip_Text;h.appendChild(i)}function s(a){if($MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)&&a!=false){if(!l){e.Create(b.Mode);h.appendChild(d[b.Mode]);w();l=true}h.className="MSVE_header MSVE_with3D"}else{h.className="MSVE_header MSVE_no3D";l=false}}function z(){if(l){e.DestroyControl(b.Mode);if(d[b.Mode]!=null)h.removeChild(d[b.Mode]);l=false}h.removeChild(i);c.removeChild(h);i=h=null}function v(){k.style.display="none";e.displaying3DNotification=false;if(!a.IsModeEnabled(Msn.VE.MapActionMode.Mode3D))if(typeof ShowMessage!="undefined"){ShowMessage(L_3DLoading_Text);window.setTimeout(View3DSwitch,200)}else a.EnableMode(Msn.VE.MapActionMode.Mode3D)}function x(){if(k){k.style.display="none";e.displaying3DNotification=false}if(a!=null&&!a.IsModeEnabled(Msn.VE.MapActionMode.Mode3D))if(a.IsObliqueAvailable()&&$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye))e.DisplayObliqueNotification()}this.SetX=function(a){c.style.left=a+"px"};this.GetElement=function(){return c};this.GetShimmedElements=function(){return[c]};this.GetHeader=function(){return h};this.GetY=function(){return g(c).getScreenPosition().y};this.GetHeight=function(){return c.offsetHeight};this.ShowToggleGlyph=function(){if(i!=null&&i!="undefined")i.style.display="block"};this.HideToggleGlyph=function(){if(i!=null&&i!="undefined")i.style.display="none"};this.SetShowMapModeSwitch=function(a){if(a!=l){if(!a){e.DestroyControl(b.Mode);h.removeChild(d[b.Mode]);l=false}s(a)}};function u(){var b=a.GetDashboard().GetHeader().lastChild;a.GetDashboard().ShowToggleGlyph();window.dbRoller=new Msn.VE.Animation.Roller(a.GetDashboard().GetElement());dbRoller.setAccelerationFunction(AccelerationFunctions.CrazyElevator);dbRoller.setYLeave(32);dbRoller.hookEvent("beforerollin",function(){dbRoller.setYLeave(a.GetDashboard().GetHeader().offsetHeight);if(a.GetMinimap()){a.GetMinimap().Hide();if(a.GetMinimap().IsInitialized())a.GetMinimap().SetDoUpdates(false)}});dbRoller.hookEvent("afterrollin",function(){a.GetDashboard().GetElement().className=a.GetDashboard().GetElement().className.replace(/\s*expanded/g,"");a.GetDashboard().GetElement().className+=" collapsed";a.GetDashboard().GetHeader().lastChild.title=L_NavActionShowToolTip_Text});dbRoller.hookEvent("beforerollout",function(){a.GetDashboard().GetElement().className=a.GetDashboard().GetElement().className.replace(/\s*collapsed/g,"");a.GetDashboard().GetElement().className+=" expanded"});dbRoller.hookEvent("afterrollout",function(){if(a.GetMinimap()){a.GetMinimap().Show();if(minimapRoller&&minimapRoller.isExpanded()&&a.GetMinimap().IsInitialized())a.GetMinimap().SetDoUpdates(true)}a.GetDashboard().GetHeader().lastChild.title=L_NavActionHideToolTip_Text});dbRoller.hookEvent("roll",RollShim);b.onclick=function(){if(dbRoller.isExpanded())dbRoller.rollIn(Msn.VE.Animation.RollDirection.BottomUp);else dbRoller.rollOut(Msn.VE.Animation.RollDirection.TopDown);return false};b=null}this.Hide=function(){if(c)c.style.display="none"};this.Show=function(){if(c)c.style.display="block"};this.Init=F;this.Destroy=E;this.createRoller=u};function DashboardContainerMouseMoveEvent(a){a=GetEvent(a);return false}Msn.VE.V6Control=function(K,e,kb,ib,D,L,W){Msn.VE.DashboardStates=new function(){this.MapMode=new function(){this.Flatland=1;this.View3D=2};this.MapView=new function(){this.Ortho=4;this.Oblique=8;this.StreetSide=16};this.MapStyle=new function(){this.Road=32;this.Shaded=64;this.Aerial=128;this.Hybrid=256}};var G={Style:"MSVE_navAction_mapStyleCell",Road:"MSVE_navAction_RoadMapStyle",Aerial:"MSVE_navAction_AerialMapStyle",Hybrid:"MSVE_navAction_HybridMapStyle",Mode:"MSVE_navAction_modeCell",Mode2D:"MSVE_navAction_FlatlandMapMode",Mode3D:"MSVE_navAction_View3DMapMode",LocalizeMe:"MSVE_navAction_LocalizeMeMode",View:"MSVE_navAction_mapViewCellInner",Ortho:"MSVE_navAction_OrthoMapView",Oblique:"MSVE_navAction_ObliqueMapView",StreetSide:"MSVE_navAction_StreetSideMapView",ShowLabels:"MSVE_navAction_showLabels",Pan:"MSVE_navAction_panContainer",PanUp:"MSVE_navAction_panUp",PanDown:"MSVE_navAction_panDown",PanLeft:"MSVE_navAction_panLeft",PanRight:"MSVE_navAction_panRight",TinyZoom:"MSVE_TinyZoomBar",OrthoZoom:"MSVE_OrthoZoomBar",ObliqueZoom:"MSVE_ObliqueZoomBar",ObliqueCompass:"MSVE_compassDiv",ObliqueNotification:"MSVE_obliqueNotification",ThreeDUpdatedNotification:"MSVE_threeDUpdatedNotification",Traffic:"MSVE_navAction_traffic",LocalizeMe:"MSVE_nacAction_localizeme"},f="Nav Bar";Msn.VE.CommonControls=function(c,v){function xb(b){var f=document.createElement("div"),e=document.createElement("div"),a=document.createElement("div"),d=document.createElement("div"),w=0,s=0,j=false;this.Init=function(){d.className="MSVE_ZoomBar_minus";d.id="MSVE_navAction_obliqueZoomBar_minus";d.unselectable="on";d.title=L_ZoomBarMinusToolTip_Text;d.attachEvent("onclick",l);pseudoHover(d);a.className="MSVE_ZoomBar_slider";a.id="MSVE_navAction_obliqueZoomBar_slider";a.unselectable="on";a.attachEvent("onmousedown",o);a.attachEvent("onmousemove",p);a.attachEvent("onmouseup",q);a.attachEvent("onclick",IgnoreEvent);pseudoHover(a);e.className="MSVE_ObliqueZoomBar_bar";e.unselectable="on";e.appendChild(a);e.attachEvent("onclick",r);f.className="MSVE_ZoomBar_plus";f.id="MSVE_navAction_obliqueZoomBar_plus";f.title=L_ZoomBarPlusToolTip_Text;f.unselectable="on";f.attachEvent("onclick",m);pseudoHover(f);b.className="MSVE_ZoomBar";b.id="MSVE_ObliqueZoomBar";b.appendChild(d);b.appendChild(e);b.appendChild(f);b.attachEvent("onmousedown",IgnoreEvent);b.attachEvent("onmouseup",IgnoreEvent);b.attachEvent("onclick",IgnoreEvent);b.attachEvent("ondblclick",IgnoreEvent);i()};function v(){b.style.display="block"}function u(){b.style.display="none"}function r(a){a=GetEvent(a);CancelEvent(a);k();n(h(Gimme.Screen.getMousePosition(a).y));return false}function h(b){b-=s+d.offsetHeight+a.offsetHeight;var c=e.offsetHeight-a.offsetHeight;if(b<0)b=0;else if(b>c)b=c;return b}function l(){c.ZoomOut();$VE_A.Log($VE_A.PgName.Map,"Zoom out","Nav Bar")}function m(){c.ZoomIn();$VE_A.Log($VE_A.PgName.Map,"Zoom in","Nav Bar")}function t(){d.detachEvent("onclick",l);a.detachEvent("onmousedown",o);a.detachEvent("onmousemove",p);a.detachEvent("onmouseup",q);a.detachEvent("onclick",IgnoreEvent);e.detachEvent("onclick",r);f.detachEvent("onclick",m);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onclick",IgnoreEvent);b.detachEvent("ondblclick",IgnoreEvent);d=a=e=f=null}function o(b){b=GetEvent(b);CancelEvent(b);k();if(a.setCapture)a.setCapture();j=true;return false}function p(b){b=GetEvent(b);CancelEvent(b);if(j)a.style.top=h(Gimme.Screen.getMousePosition(b).y)+"px";return false}function q(b){b=GetEvent(b);CancelEvent(b);if(a.releaseCapture)a.releaseCapture();j=false;n(h(Gimme.Screen.getMousePosition(b).y));i();return false}function k(){var a=g(b).getScreenPosition();w=a.x;s=a.y}function n(f){var b=e.offsetHeight-a.offsetHeight,d=1+MathRound((b-f)/b*1);c.SetZoom(d);$VE_A.Log($VE_A.PgName.Map,"Zoom")}function i(){if(c.GetZoomLevel()==1)a.style.top=e.offsetHeight-a.offsetHeight+"px";else a.style.top="0px"}this.Destroy=t;this.Show=v;this.Hide=u;this.UpdateFromMap=i}function B(z,x,y){var a=document.createElement("div");a.setAttribute("id",z);a.innerHTML=x;var c="MSVE_obliqueCompassPointOff",g=y;a.attachEvent("onmouseover",f);a.attachEvent("onmouseout",h);a.attachEvent("onclick",i);this.onclick=null;this.onmouseover=null;this.onmouseout=null;var e=25,b=this,d=false,j=new v(a,17,17);function f(e){if(d)return;c=a.className;a.className="MSVE_obliqueCompassPointHover";if(b.onmouseover)b.onmouseover(e)}function i(a){if(d)return;f(a);c="MSVE_obliqueCompassPointOn";if(b.onclick)b.onclick(a)}function h(e){if(d)return;a.className=c;if(b.onmouseout)b.onmouseout(e)}function m(){c="MSVE_obliqueCompassPointOn";a.className="MSVE_obliqueCompassPointOn"}function l(){c="MSVE_obliqueCompassPointOff";a.className="MSVE_obliqueCompassPointOff"}function u(){d=true;l()}function k(){d=false;m()}function q(){return a}function n(){return g}function o(a){g=a}function w(){j.Reset();k()}function p(b){a.style.left=b.left;a.style.top=b.top}function v(r,n,o){var g=r,a=0,b=.3,c=0,l=40,k=Math.PI/2,h=true,p=b+.1;function m(a,b,c){if(b>=c-a&&b<=c+a)return true;return false}function i(){a+=b;if(a>Math.PI*2)a-=Math.PI*2;else if(a<0)a+=Math.PI*2;if(m(p,a,c)){b=.3;a=c;d(a);return}d(a);window.setTimeout(i,l)}function d(a){var b=n+e*Math.sin(a),c=o+e*Math.cos(a);g.style.left=b+"px";g.style.top=c+"px"}function f(a){c=a;i()}function j(a,c){h=c;if(!h)b*=-1;f(k*a)}function q(){a=0}this.RotateTo=f;this.RotateToIndex=j;this.Reset=q}function t(){a.detachEvent("onmouseover",f);a.detachEvent("onmouseout",h);a.detachEvent("onclick",i);a=null}function s(a){e=a}function r(){return e}this.SetRadius=s;this.GetRadius=r;this.GetElement=q;this.GetCurrentPositionIndex=n;this.SetCurrentPositionIndex=o;this.SetCurrentPosition=p;this.On=m;this.Off=l;this.RotateToIndex=j.RotateToIndex;this.Reset=w;this.Disable=u;this.Enable=k;this.Destroy=t}function wb(E){var p=[];p.push({"top":"-8px","left":"17px"});p.push({"top":"17px","left":"42px"});p.push({"top":"42px","left":"17px"});p.push({"top":"17px","left":"-8px"});var g=document.createElement("div");g.setAttribute("id","MSVE_obliqueCompassContainer");g.title=L_ObliqueCompassSelectDirection_Text;var a=new B("MSVE_obliqueCompassPointN","N",0),j=a.GetElement();j.attachEvent("onclick",s);j.attachEvent("onmouseover",v);j.attachEvent("onmouseout",i);var d=new B("MSVE_obliqueCompassPointE","E",1),l=d.GetElement();l.attachEvent("onclick",u);l.attachEvent("onmouseover",y);l.attachEvent("onmouseout",i);var b=new B("MSVE_obliqueCompassPointS","S",2),k=b.GetElement();k.attachEvent("onclick",t);k.attachEvent("onmouseover",w);k.attachEvent("onmouseout",i);var e=new B("MSVE_obliqueCompassPointW","W",3),m=e.GetElement();m.attachEvent("onclick",x);m.attachEvent("onmouseover",z);m.attachEvent("onmouseout",i);var n=document.createElement("div");n.id="MSVE_navAction_obliqueCompassArrow";g.appendChild(j);g.appendChild(l);g.appendChild(k);g.appendChild(m);g.appendChild(n);E.appendChild(g);r();function q(a){if(a<0)a=4-Math.abs(a);return a}function o(l,i,k){var c=l.GetCurrentPositionIndex(),h,f=[];f[a.GetCurrentPositionIndex()]=L_North_Text;f[b.GetCurrentPositionIndex()]=L_South_Text;f[d.GetCurrentPositionIndex()]=L_East_Text;f[e.GetCurrentPositionIndex()]=L_West_Text;if(i){h=i==Msn.VE.BirdsEyeSearchSpinDirection.CounterclockwiseSpin;if(c+i!=2){var g;switch(i){case-1:switch(c){case 0:case 2:g=[3];break;case 1:g=[3,2]}break;case 1:switch(c){case 0:case 2:g=[1];break;case 3:g=[1,2]}}if(g){var j=L_ObliqueSkippingOneDirection_Text;if(c==0)j=L_ObliqueNoImageryInRequestedDirection_Text;if(g.length==2)j=L_ObliqueSkippingTwoDirections_Text;if(typeof ShowMessage!="undefined")ShowMessage(j.replace("%1",f[c]).replace("%2",f[g[0]]).replace("%3",f[g[1]]))}}}else{h=c!=3;if(k)if(c==0){if(typeof ShowMessage!="undefined")ShowMessage(L_ObliqueModeImageNotAvailable_Text)}else if(typeof ShowMessage!="undefined")ShowMessage(L_ObliqueNoImageryInRequestedDirection_Text.replace("%1",f[c]).replace("%2",f[0]))}d.SetCurrentPositionIndex(q(d.GetCurrentPositionIndex()-c));e.SetCurrentPositionIndex(q(e.GetCurrentPositionIndex()-c));a.SetCurrentPositionIndex(q(a.GetCurrentPositionIndex()-c));b.SetCurrentPositionIndex(q(b.GetCurrentPositionIndex()-c));a.RotateToIndex(2-a.GetCurrentPositionIndex()<0?a.GetCurrentPositionIndex():2-a.GetCurrentPositionIndex(),h);d.RotateToIndex(2-d.GetCurrentPositionIndex()<0?d.GetCurrentPositionIndex():2-d.GetCurrentPositionIndex(),h);b.RotateToIndex(2-b.GetCurrentPositionIndex()<0?b.GetCurrentPositionIndex():2-b.GetCurrentPositionIndex(),h);e.RotateToIndex(2-e.GetCurrentPositionIndex()<0?e.GetCurrentPositionIndex():2-e.GetCurrentPositionIndex(),h)}function h(a){switch(a){case 0:i();break;case 1:A();break;case 2:C();break;case 3:D()}}function i(){n.className="MSVE_obliqueCompassArrowU"}function C(){n.className="MSVE_obliqueCompassArrowD"}function A(){n.className="MSVE_obliqueCompassArrowR"}function D(){n.className="MSVE_obliqueCompassArrowL"}function t(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(b);h(0);var a=c.GetObliqueScene();if(a)if(a.GetOrientation()!=Msn.VE.Orientation.South)c.SetObliqueOrientation("South",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - South",f)}function s(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(a);h(0);var b=c.GetObliqueScene();if(b)if(b.GetOrientation()!=Msn.VE.Orientation.North)c.SetObliqueOrientation("North",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - North",f)}function u(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(d);h(0);var a=c.GetObliqueScene();if(a)if(a.GetOrientation()!=Msn.VE.Orientation.East)c.SetObliqueOrientation("East",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - East",f)}function x(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(e);h(0);var a=c.GetObliqueScene();if(a)if(a.GetOrientation()!=Msn.VE.Orientation.West)c.SetObliqueOrientation("West",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - West",f)}function w(){h(b.GetCurrentPositionIndex())}function y(){h(d.GetCurrentPositionIndex())}function z(){h(e.GetCurrentPositionIndex())}function v(){h(a.GetCurrentPositionIndex())}function I(){g.style.display="none"}function J(){g.style.display="block"}function r(k,j){var i=c.GetObliqueScene();if(!i)return;var f=i.GetOrientation(),g;switch(f){case"North":g=a;break;case"South":g=b;break;case"East":g=d;break;case"West":g=e}o(g,k,j);h(0);if(f!=Msn.VE.Orientation.North)a.Enable();else a.Disable();if(f!=Msn.VE.Orientation.South)b.Enable();else b.Disable();if(f!=Msn.VE.Orientation.East)d.Enable();else d.Disable();if(f!=Msn.VE.Orientation.West)e.Enable();else e.Disable()}function H(){a.Destroy();d.Destroy();b.Destroy();e.Destroy();j.detachEvent("onclick",s);j.detachEvent("onmouseover",v);j.detachEvent("onmouseout",i);l.detachEvent("onclick",u);l.detachEvent("onmouseover",y);l.detachEvent("onmouseout",i);k.detachEvent("onclick",t);k.detachEvent("onmouseover",w);k.detachEvent("onmouseout",i);m.detachEvent("onclick",x);m.detachEvent("onmouseover",z);m.detachEvent("onmouseout",i);g=null}function G(c){a.SetRadius(c);b.SetRadius(c);d.SetRadius(c);e.SetRadius(c)}function F(){return a.GetRadius()}this.Hide=I;this.Show=J;this.UpdateFromMap=r;this.SetRadius=G;this.GetRadius=F;this.Destroy=H}function Ab(b){var f=document.createElement("div"),e=document.createElement("div"),a=document.createElement("div"),d=document.createElement("div"),v=0,s=0,j=false;this.Init=function(){d.className="MSVE_ZoomBar_minus";d.id="MSVE_navAction_orthoZoomBar_minus";d.title=L_ZoomBarMinusToolTip_Text;d.unselectable="on";d.attachEvent("onclick",l);pseudoHover(d);a.className="MSVE_ZoomBar_slider";a.id="MSVE_navAction_orthoZoomBar_slider";a.title=L_ZoomBarSliderToolTip_Text;a.unselectable="on";a.attachEvent("onmousedown",o);a.attachEvent("onmousemove",p);a.attachEvent("onmouseup",q);a.attachEvent("onclick",IgnoreEvent);pseudoHover(a);e.className="MSVE_OrthoZoomBar_bar";e.unselectable="on";e.appendChild(a);e.attachEvent("onclick",r);f.className="MSVE_ZoomBar_plus";f.id="MSVE_navAction_orthoZoomBar_plus";f.title=L_ZoomBarPlusToolTip_Text;f.unselectable="on";f.attachEvent("onclick",m);pseudoHover(f);b.className="MSVE_ZoomBar";b.id="MSVE_OrthoZoomBar";b.appendChild(d);b.appendChild(e);b.appendChild(f);b.attachEvent("onmousedown",IgnoreEvent);b.attachEvent("onmouseup",IgnoreEvent);b.attachEvent("onclick",IgnoreEvent);b.attachEvent("ondblclick",IgnoreEvent);i()};this.Destroy=function(){d.detachEvent("onclick",l);a.detachEvent("onmousedown",o);a.detachEvent("onmousemove",p);a.detachEvent("onmouseup",q);a.detachEvent("onclick",IgnoreEvent);e.detachEvent("onclick",r);f.detachEvent("onclick",m);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onclick",IgnoreEvent);b.detachEvent("ondblclick",IgnoreEvent);d=a=e=f=null};function u(){b.style.display="block"}function t(){b.style.display="none"}function k(){var a=g(b).getScreenPosition();v=a.x;s=a.y}function o(b){b=GetEvent(b);CancelEvent(b);k();if(a.setCapture)a.setCapture();j=true;return false}function p(b){b=GetEvent(b);CancelEvent(b);if(j)a.style.top=h(Gimme.Screen.getMousePosition(b).y)+"px";return false}function q(b){b=GetEvent(b);CancelEvent(b);if(a.releaseCapture)a.releaseCapture();j=false;n(h(Gimme.Screen.getMousePosition(b).y));i();return false}function m(){c.ZoomIn();$VE_A.Log($VE_A.PgName.Map,"Zoom in","Nav Bar")}function l(){c.ZoomOut();$VE_A.Log($VE_A.PgName.Map,"Zoom out","Nav Bar")}function r(a){a=GetEvent(a);CancelEvent(a);k();n(h(Gimme.Screen.getMousePosition(a).y));return false}function h(b){b-=s+d.offsetHeight+a.offsetHeight;var c=e.offsetHeight-a.offsetHeight;if(b<0)b=0;else if(b>c)b=c;return b}function n(f){var b=e.offsetHeight-a.offsetHeight,d=1+MathRound((b-f)/b*18);c.SetZoom(d);$VE_A.Log($VE_A.PgName.Map,"Zoom")}function i(){var b=e.offsetHeight-a.offsetHeight,d=b-(c.GetZoomLevel()-1)/18*b;a.style.top=d+"px"}this.UpdateFromMap=i;this.Show=u;this.Hide=t}function Db(){var h=document.createElement("div"),g=document.createElement("div"),f=document.createElement("div"),a=false,d=g,b=f;this.Init=function(){g.className="MSVE_ZoomBar_plus";g.id="MSVE_navAction_tinyZoomBar_plus";g.title=L_ZoomBarPlusToolTip_Text;g.unselectable="on";f.className="MSVE_ZoomBar_minus";f.id="MSVE_navAction_tinyZoomBar_minus";f.title=L_ZoomBarMinusToolTip_Text;f.unselectable="on";c.AttachEvent("onendzoom",i);h.className="MSVE_ZoomBar";h.id="MSVE_TinyZoomBar";h.appendChild(g);h.appendChild(f);return h};this.HookupPlusMinusEvents=function(b,a){m(b);j(a)};function m(a){if(a)d=a;d.attachEvent("onmousedown",o);d.attachEvent("onmouseup",e);d.attachEvent("onmouseout",e)}this.HookupPlusEvents=m;function j(a){if(a)b=a;b.attachEvent("onmousedown",l);b.attachEvent("onmouseup",e);b.attachEvent("onmouseout",e)}this.HookupMinusEvents=j;function n(){if(d!=null){d.detachEvent("onmousedown",o);d.detachEvent("onmouseup",e);d.detachEvent("onmouseout",e)}if(a=="in")a=false}this.UnhookPlusEvents=n;function k(){if(b!=null){b.detachEvent("onmousedown",l);b.detachEvent("onmouseup",e);b.detachEvent("onmouseout",e)}if(a=="out")a=false}this.UnhookMinusEvents=k;this.Destroy=function(){n();k();c.DetachEvent("onendzoom",i);g=f=d=b=null};function q(){if(c.GetMapMode()==Msn.VE.MapActionMode.Mode3D)return true;else return c.IsAnimationEnabled()}function o(b){a="in";c.ZoomIn();if(b!==false)$VE_A.Log($VE_A.PgName.Map,"Zoom in","Nav Bar")}function i(){window.setTimeout(p,q()?1:500)}function p(){if(a=="in"&&c.GetZoomLevel()<21)c.ZoomIn(false);else if(a=="out"&&c.GetZoomLevel()>1)c.ZoomOut(false)}function l(b){a="out";c.ZoomOut();if(b!==false)$VE_A.Log($VE_A.PgName.Map,"Zoom out","Nav Bar")}function e(){a=false}this.GetPlus=function(){return g};this.GetMinus=function(){return f}}var a=G,l=[];l[a.Style]={Id:a.Style,InitialClass:null,OnClickFunction:null,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:null,Children:[a.Road,a.Aerial,a.Hybrid],Text:null};l[a.Road]={Id:a.Road,InitialClass:"MSVE_MapStyle",OnClickFunction:sb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:t,Enabled:MapControl.Features.MapStyle.Road,Title:L_NavActionRoadToolTip_Text,Children:null,Text:L_NavActionRoad_Text};l[a.Aerial]={Id:a.Aerial,InitialClass:"MSVE_MapStyle",OnClickFunction:mb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:t,Enabled:MapControl.Features.MapStyle.Aerial,Title:L_NavActionAerialToolTip_Text,Children:null,Text:L_NavActionAerial_Text};l[a.Hybrid]={Id:a.Hybrid,InitialClass:"MSVE_MapStyle",OnClickFunction:nb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:t,Enabled:MapControl.Features.MapStyle.Hybrid,Title:L_NavActionHybridToolTip_Text,Children:null,Text:L_NavActionHybrid_Text};l[a.Mode]={Id:a.Mode,InitialClass:"MSVE_modeCell",OnClickFunction:null,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:null,Children:[a.Mode2D,a.Mode3D],Text:null};l[a.Mode2D]={Id:a.Mode2D,InitialClass:"MSVE_MapMode",OnClickFunction:kb,StyleUpdateEvent:"oninitmode",StyleUpdateFunction:Z,Enabled:true,Title:L_NavActionFlatlandToolTip_Text,Children:null,Text:L_NavActionFlatland_Text};l[a.Mode3D]={Id:a.Mode3D,InitialClass:"MSVE_MapMode",OnClickFunction:qb,StyleUpdateEvent:"oninitmode",StyleUpdateFunction:Z,Enabled:MapControl.Features.MapStyle.View3D,Title:L_NavActionView3DToolTip_Text,Children:null,Text:L_NavActionView3D_Text};l[a.View]={Id:a.View,InitialClass:null,OnClickFunction:null,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:null,Children:[a.Ortho,a.Oblique,a.StreetSide],Text:null};l[a.Ortho]={Id:a.Ortho,InitialClass:"MSVE_MapStyle",OnClickFunction:u,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:t,Enabled:true,Title:L_NavActionOrthoToolTip_Text,Children:null,Text:null};l[a.Oblique]={Id:a.Oblique,InitialClass:"MSVE_MapStyle",OnClickFunction:F,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:t,Enabled:false,Title:L_NavActionObliqueToolTip_Text,Children:null,Text:null};l[a.StreetSide]={Id:a.StreetSide,InitialClass:"MSVE_MapStyle",OnClickFunction:hb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:t,Enabled:false,Title:L_NavActionStreetSideToolTip_Text,Children:null,Text:null};l[a.ShowLabels]={Id:a.ShowLabels,InitialClass:"MSVE_MapStyle",OnClickFunction:ub,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:t,Enabled:true,Title:L_NavActionShowLabels_Text,Children:null,Text:L_NavActionLabels_Text};l[a.Traffic]={Id:a.Traffic,InitialClass:"MSVE_MapStyle",OnClickFunction:zb,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:L_NavActionShowTrafficToolTip_Text,Children:null,Text:L_NavActionTraffic_Text};l[a.LocalizeMe]={Id:a.LocalizeMe,InitialClass:"MSVE_MapStyle",OnClickFunction:BuscaLocalIP,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:L_NavActionLocalizeMeToolTip_Text,Children:null,Text:L_NavActionLocalizeme_Text};this.ObliqueFunctions=[];this.ObliqueFunctions.ObliqueImageryIn3D={ObliqueClickFunction:fb,Title:L_NavActionShowObliqueToolTip_Text,DependsOnObliqueAvailability:true};this.ObliqueFunctions.ObliqueTiltIn3D={ObliqueClickFunction:lb,Title:L_NavAction3DObliqueToolTip_Text,DependsOnObliqueAvailability:false};var e=this,b=[],j=Msn.VE.DashboardStates.MapMode.Flatland,d=Msn.VE.DashboardStates.MapView.Ortho,h=Msn.VE.DashboardStates.MapStyle.Road;this.orthoZoom=null;var m;this.obliqueCompass=null;this.obliqueZoom=null;this.displaying3DNotification=false;var z=null;this.Oblique3DFunctionality=this.ObliqueFunctions.ObliqueImageryIn3D;var r=document.createElement("div");r.id="MSVE_navAction_palette";document.body.appendChild(r);var I=false,ab=false,k=true,Q=false,s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin,N;for(N in v)if(v.hasOwnProperty(N))M(v[N]);function Hb(){var d=$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)&&(c.IsObliqueAvailable()||c.IsMapViewOblique());if(d){i(a.Oblique,true);if(b[a.ObliqueNotification]&&!c.IsMapViewOblique()&&!g(b[a.Oblique]).hasClass("MSVE_selected"))x()}else{i(a.Oblique,false);if(b[a.ObliqueNotification])q()}W();if(c.IsModeEnabled(Msn.VE.MapActionMode.Mode3D))T();else S()}function Gb(){var a;for(a in v)if(v.hasOwnProperty(a))J(v[a]);document.body.removeChild(r);r=null}function M(f){switch(f){case a.OrthoZoom:b[f]=document.createElement("div");e.orthoZoom=new Ab(b[f]);e.orthoZoom.Init();c.AttachEvent("onendzoom",w);r.appendChild(b[f]);w();return;case a.ObliqueZoom:b[f]=document.createElement("div");ab=true;b[f].id=f;r.appendChild(b[f]);return;case a.TinyZoom:m=new Db;b[f]=m.Init();c.AttachEvent("onendzoom",w);w();return;case a.ObliqueCompass:b[f]=document.createElement("div");b[f].id=f;I=true;return;case a.ObliqueNotification:db();return;case a.ThreeDUpdatedNotification:cb();return;case a.Oblique:c.AttachEvent("onve3dphotostatechanged",rb)}var d=l[f],g=document.createElement("div");b[d.Id]=g;g.id=d.Id;g.enabled=d.Enabled;g.classRecipients=[g];if(d.Text!=null)
{g.innerText=d.Text;g.innerHTML=d.Text;}
if(d.OnClickFunction!=null&&d.Enabled==true)g.attachEvent("onclick",d.OnClickFunction);if(d.StyleUpdateEvent!=null&&d.StyleUpdateFunction!=null)c.AttachEvent(d.StyleUpdateEvent,d.StyleUpdateFunction);if(d.InitialClass){g.className=d.InitialClass;if(!g.enabled)g.className+="_disabled"}if(d.Children!=null){var h;for(h in d.Children)if(d.Children.hasOwnProperty(h))g.appendChild(M(d.Children[h]))}else pseudoHover(g);switch(f){case a.Oblique:case a.ObliqueCompass:c.AttachEvent("onobliqueenter",yb);c.AttachEvent("onobliqueleave",K);c.AttachEvent("onendmapstyleoblique",pb);c.AttachEvent("onobliquechange",vb);c.AttachEvent("obliquerequestunavailable",eb);break;case a.Traffic:c.AttachEvent("onchangetraffic",C);C()}return g}function J(f){switch(f){case a.OrthoZoom:e.orthoZoom.Destroy();b[f]=null;c.DetachEvent("onendzoom",w);try{r.removeChild(b[f])}catch(j){}return;case a.ObliqueZoom:try{r.removeChild(b[f])}catch(j){}if(e.obliqueZoom){e.obliqueZoom.Destroy();e.obliqueZoom=null}case a.TinyZoom:m.Destroy();b[f]=null;return;case a.ObliqueCompass:if(I&&e.obliqueCompass){e.obliqueCompass.onclick=null;e.obliqueCompass.Destroy();e.obliqueCompass=null}return;case a.ObliqueNotification:b[a.ObliqueNotification].detachEvent("onclick",P);return;case a.ThreeDUpdatedNotification:b[a.ThreeDUpdatedNotification]=null;return;case a.Traffic:c.DetachEvent("onchangetraffic",C)}var i=b[f];if(i==null)return;var d=l[f];if(d.Children!=null){var g,h;for(h in d.Children)if(d.Children.hasOwnProperty(h)){g=d.Children[h];try{i.removeChild(b[g])}catch(j){}J(g)}}if(d.OnClickFunction!=null)i.detachEvent("onclick",d.OnClickFunction);try{if(c&&d.StyleUpdateEvent!=null&&d.StyleUpdateFunction!=null)c.DetachEvent(d.StyleUpdateEvent,d.StyleUpdateFunction)}catch(j){}b[d.Id]=null}function db(){b[a.ObliqueNotification]=document.createElement("div");b[a.ObliqueNotification].id=a.ObliqueNotification;b[a.ObliqueNotification].attachEvent("onclick",P);b[a.ObliqueNotification].innerHTML+='<div id="MSVE_obliqueNotifyBeak" ></div> '+'<div id="MSVE_obliqueNotifyContent"> '+'<div id="MSVE_obliqueNotifyText" >'+L_DashboardBirdsEyeText_Text+"</div>"+'<img id="MSVE_obliqueNotifyImg" />'+"</div>"}function cb(){b[a.ThreeDUpdatedNotification]=document.createElement("div");b[a.ThreeDUpdatedNotification].id=a.ThreeDUpdatedNotification;b[a.ThreeDUpdatedNotification].innerHTML+='<div id="MSVE_threeDNotifyIcon">&nbsp;</div> <div id="MSVE_threeDNotifyText">'+L_Dashboard3DInstalled_Text+"</div>"}function sb(){A();$VE_A.Log($VE_A.PgName.Map,"MapStyleRoad",f)}function A(){if(h==Msn.VE.DashboardStates.MapStyle.Road&&d==Msn.VE.DashboardStates.MapView.Ortho)return;h=Msn.VE.DashboardStates.MapStyle.Road;d=Msn.VE.DashboardStates.MapView.Ortho;n(j+d+h)}function mb(){if(b[a.ShowLabels]){i(a.ShowLabels,true);if(k)Y();else X();var c=k?"LabelsOn":"LabelsOff";$VE_A.Log($VE_A.PgName.Map,"MapStyleAerial-"+c,f)}else{X();$VE_A.Log($VE_A.PgName.Map,"MapStyleAerial",f)}}function X(){if(h==Msn.VE.DashboardStates.MapStyle.Aerial&&d==Msn.VE.DashboardStates.MapView.Ortho)return;h=Msn.VE.DashboardStates.MapStyle.Aerial;d=Msn.VE.DashboardStates.MapView.Ortho;n(j+d+h)}function nb(){Y();$VE_A.Log($VE_A.PgName.Map,"MapStyleHybrid",f)}function Y(){if(h==Msn.VE.DashboardStates.MapStyle.Hybrid&&d==Msn.VE.DashboardStates.MapView.Ortho)return;h=Msn.VE.DashboardStates.MapStyle.Hybrid;d=Msn.VE.DashboardStates.MapView.Ortho;n(j+d+h)}function u(){if(d==Msn.VE.DashboardStates.MapView.Ortho&&j==Msn.VE.DashboardStates.MapMode.Flatland)return;d=Msn.VE.DashboardStates.MapView.Ortho;if(j==Msn.VE.DashboardStates.MapMode.Flatland)switch(h){case Msn.VE.DashboardStates.MapStyle.Aerial:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Aerial))n(j+d+h);else A();break;case Msn.VE.DashboardStates.MapStyle.Hybrid:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid))n(j+d+h);else A();break;default:n(j+d+h)}else n(j+d);o()}function P(c){if(j==Msn.VE.DashboardStates.MapMode.View3D&&g(b[a.Oblique]).hasClass("MSVE_selected")){q();c.cancelBubble=true;return}F()}function F(){if(typeof b[a.ObliqueNotification]!="undefined"&&b[a.ObliqueNotification])q();if(j==Msn.VE.DashboardStates.MapMode.View3D)e.Oblique3DFunctionality.ObliqueClickFunction();else{if(Msn.VE.MapStyle.IsViewOblique(d))return;tb()}}var L=null;function fb(){var e=new Date;if(L!=null)if(e.getTime()-L.getTime()<1000)return;L=e;var d=!g(b[a.Oblique]).hasClass("MSVE_selected");c.Show3DBirdseye(d,h==Msn.VE.DashboardStates.MapStyle.Road||k);var i=d?"RequestLayerBirdsEyeOn":"RequestLayerBirdsEyeOff";$VE_A.Log($VE_A.PgName.Map,i,f)}var p;function tb(){d=Msn.VE.DashboardStates.MapView.Oblique;y();if(k)h=Msn.VE.DashboardStates.MapStyle.Hybrid;else h=Msn.VE.DashboardStates.MapStyle.Aerial;if(typeof Msn.VE.API=="undefined")ob();else R()}function ob(){if(!p){var a=$ID("msve_mapContainer");p=document.createElement("div");p.id="animator";a.appendChild(p)}p.style.display="block";p.className="zoom_animation";window.setTimeout(R,2000)}function R(){if(p){p.className="";p.style.display="none"}n(j+d+h);var a=k?"LabelsOn":"LabelsOff";$VE_A.Log($VE_A.PgName.Map,"MapStyleOblique-"+a,f)}function lb(){Fb(Msn.VE.DashboardStates.MapMode.View3D+Msn.VE.DashboardStates.MapView.Oblique)}function hb(){if(d==Msn.VE.DashboardStates.MapView.StreetSide&&j==Msn.VE.DashboardStates.MapMode.Flatland)return;d=Msn.VE.DashboardStates.MapView.StreetSide;n(j+d);jb()}function ub(){if(h==Msn.VE.DashboardStates.MapStyle.Aerial){k=true;h=Msn.VE.DashboardStates.MapStyle.Hybrid}else if(h==Msn.VE.DashboardStates.MapStyle.Hybrid){k=false;h=Msn.VE.DashboardStates.MapStyle.Aerial}n(j+d+h);var a=k?"LabelsOn":"LabelsOff",b=d==Msn.VE.DashboardStates.MapView.Oblique?"MapStyleOblique":"MapStyleAerial";$VE_A.Log($VE_A.PgName.Map,a+"-"+b,f)}function kb(){c.EnableMode(Msn.VE.MapActionMode.Mode2D);$VE_A.Log($VE_A.PgName.Map,"Mode2D",f)}function qb(){if(typeof b[a.ThreeDUpdatedNotification]!="undefined"&&b[a.ThreeDUpdatedNotification])E();if(!c.IsModeEnabled(Msn.VE.MapActionMode.Mode3D)){if(typeof ShowMessage!="undefined"){ShowMessage(L_3DLoading_Text);window.setTimeout(View3DSwitch,200)}else c.EnableMode(Msn.VE.MapActionMode.Mode3D);$VE_A.Log($VE_A.PgName.Map,"Mode3D",f)}}function C(){if(VE_TrafficManager.turnedOn){g(b[a.Traffic]).addClass("MSVE_selected");b[a.Traffic].title=L_NavActionHideTrafficToolTip_Text}else{g(b[a.Traffic]).removeClass("MSVE_selected");b[a.Traffic].title=L_NavActionShowTrafficToolTip_Text}}function zb(){if(VE_TrafficManager.turnedOn)VE_TrafficManager.ClearTraffic();else{$VE_A.LogTrafficActivation($VE_A.PgName.Map);VE_TrafficManager.GetTrafficInfo(true)}}function rb(c){if(c.enabled=="1"){g(b[a.Oblique]).addClass("MSVE_selected");b[a.Oblique].title=L_NavActionHideObliqueToolTip_Text}else{g(b[a.Oblique]).removeClass("MSVE_selected");b[a.Oblique].title=L_NavActionShowObliqueToolTip_Text}var e=c.enabled=="1"?"LayerBirdsEyeOn":"LayerBirdsEyeOff",d=h==Msn.VE.DashboardStates.MapStyle.Road||k?"LabelsOn":"LabelsOff";$VE_A.Log($VE_A.PgName.Map,e+"-"+d,f)}function t(a){W(a.view.mapStyle)}function Z(a){if(a==Msn.VE.MapActionMode.Mode3D)T();else S()}function T(){if(j==Msn.VE.DashboardStates.MapMode.View3D)return;j=Msn.VE.DashboardStates.MapMode.View3D;if(typeof b[a.Mode]!="undefined"&&b[a.Mode]!=null)g(b[a.Mode].classRecipients).swapClass("MSVE_FlatlandMapMode","MSVE_View3DMapMode");i(a.StreetSide,true);i(a.Road,true);i(a.Aerial,true);i(a.Hybrid,true);if(!e.Oblique3DFunctionality.DependsOnObliqueAvailability)i(a.Oblique,true);else{if(b[a.ObliqueNotification]!=null&&b[a.ObliqueNotification].enabled&&!g(b[a.Oblique]).hasClass("MSVE_selected"))x();o()}if(typeof b[a.Ortho]!="undefined"&&b[a.Ortho]!=null)b[a.Ortho].title=L_NavAction3DOrthoToolTip_Text;if(typeof b[a.Oblique]!="undefined"&&b[a.Oblique]!=null){b[a.Oblique].title=e.Oblique3DFunctionality.Title;if(b[a.Oblique].enabled&&!g(b[a.Oblique]).hasClass("MSVE_selected"))x()}if(typeof b[a.StreetSide]!="undefined"&&b[a.StreetSide]!=null)b[a.StreetSide].title=L_NavAction3DStreetSideToolTip_Text;var f=c.GetDashboard().GetShimmedElements(),d;for(d=0;d<f.length;d++)mvcViewFacade.UpdateShimIfSupported(f[d])}function S(){j=Msn.VE.DashboardStates.MapMode.Flatland;if(typeof b[a.Mode]!="undefined"&&b[a.Mode]!=null)g(b[a.Mode].classRecipients).swapClass("MSVE_View3DMapMode","MSVE_FlatlandMapMode");if(typeof b[a.Ortho]!="undefined"&&b[a.Ortho]!=null)b[a.Ortho].title=L_NavActionOrthoToolTip_Text;if(typeof b[a.Oblique]!="undefined"&&b[a.Oblique]!=null)b[a.Oblique].title=L_NavActionObliqueToolTip_Text;g(b[a.Oblique]).removeClass("MSVE_selected");photoState=0;if($MVEM.IsEnabled(MapControl.Features.MapStyle.Road))i(a.Road,true);else i(a.Road,false);if($MVEM.IsEnabled(MapControl.Features.MapStyle.Aerial))i(a.Aerial,true);else i(a.Aerial,false);if($MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid))i(a.Hybrid,true);else i(a.Hybrid,false);if($MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)){c.GetObliqueAvailability("OnFlatlandModeUpdateUIObliqueReturned",O);return}else O(false)}function O(b){if(b){i(a.Oblique,true);if(e.obliqueZoom!=null)e.obliqueZoom.UpdateFromMap()}else{i(a.Oblique,false);d=Msn.VE.DashboardStates.MapView.Ortho;o()}switch(d){case Msn.VE.DashboardStates.MapView.Oblique:if(b&&$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye))n(j+d);else u();break;case Msn.VE.DashboardStates.MapView.StreetSide:u();break;case Msn.VE.DashboardStates.MapView.Ortho:switch(h){case Msn.VE.DashboardStates.MapStyle.Aerial:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Aerial))n(j+d+h);else A();break;case Msn.VE.DashboardStates.MapStyle.Hybrid:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid))n(j+d+h);else A();break;default:n(j+d+h)}break;default:u()}}function w(){if(e.orthoZoom)e.orthoZoom.UpdateFromMap();if(e.obliqueZoom)e.obliqueZoom.UpdateFromMap();var b=null,a=null;if(m){var f=m.GetPlus();if(f)b=g([f]);var d=m.GetMinus();if(d)a=g([d])}if(c.IsMapViewOrtho()&&c.GetZoomLevel()==19||c.IsMapViewOblique()&&c.GetZoomLevel()==2){if(b)b.addClass("MSVE_ZoomBar_plus_disabled");if(m)m.UnhookPlusEvents()}else if(c.GetZoomLevel()==1){if(a)a.addClass("MSVE_ZoomBar_minus_disabled");if(m)m.UnhookMinusEvents()}if(c.IsMapViewOrtho()&&c.GetZoomLevel()!=19||c.IsMapViewOblique()&&c.GetZoomLevel()!=2)if(b&&b.hasClass("MSVE_ZoomBar_plus_disabled")){b.removeClass("MSVE_ZoomBar_plus_disabled");if(m)m.HookupPlusEvents()}if(c.GetZoomLevel()!=1)if(a&&a.hasClass("MSVE_ZoomBar_minus_disabled")){a.removeClass("MSVE_ZoomBar_minus_disabled");if(m)m.HookupMinusEvents()}}function yb(){if(c.IsMapViewOblique())d=Msn.VE.DashboardStates.MapView.Oblique;if(j==Msn.VE.DashboardStates.MapMode.Flatland||j==Msn.VE.DashboardStates.MapMode.View3D&&e.Oblique3DFunctionality.DependsOnObliqueAvailability){i(a.Oblique,true);if(b[a.ObliqueNotification]&&!c.IsMapViewOblique()&&!g(b[a.Oblique]).hasClass("MSVE_selected"))x()}}function K(){d=Msn.VE.DashboardStates.MapView.Ortho;o();if(j==Msn.VE.DashboardStates.MapMode.Flatland||j==Msn.VE.DashboardStates.MapMode.View3D&&e.Oblique3DFunctionality.DependsOnObliqueAvailability){i(a.Oblique,false);q()}}function eb(){if(c.IsObliqueAvailable())e.obliqueCompass.UpdateFromMap(s,true);else K()}function pb(){if(c.IsObliqueAvailable()){d=Msn.VE.DashboardStates.MapView.Ortho;o()}else K()}function vb(){if($MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)){if(d!=Msn.VE.DashboardStates.MapView.Oblique){d=Msn.VE.DashboardStates.MapView.Oblique;i(a.Oblique,true);y()}}else{d=Msn.VE.DashboardStates.MapView.Oblique;u()}if(b[a.ObliqueNotification])q();if(typeof e.obliqueCompass!="undefined"&&e.obliqueCompass!=null){e.obliqueCompass.UpdateFromMap(s);s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin}}function W(e){if(!e)e=c.GetMapStyle();switch(e){case Msn.VE.MapStyle.Shaded:d=Msn.VE.DashboardStates.MapView.Ortho;o();h=Msn.VE.DashboardStates.MapStyle.Shaded;V();if(b[a.ShowLabels]){i(a.ShowLabels,false);g(b[a.ShowLabels]).addClass("MSVE_selected")}break;case Msn.VE.MapStyle.Road:d=Msn.VE.DashboardStates.MapView.Ortho;o();h=Msn.VE.DashboardStates.MapStyle.Road;V();if(b[a.ShowLabels]){i(a.ShowLabels,false);g(b[a.ShowLabels]).addClass("MSVE_selected")}break;case Msn.VE.MapStyle.Aerial:d=Msn.VE.DashboardStates.MapView.Ortho;o();h=Msn.VE.DashboardStates.MapStyle.Aerial;H();k=false;if(b[a.ShowLabels]){i(a.ShowLabels,true);g(b[a.ShowLabels]).removeClass("MSVE_selected")}break;case Msn.VE.MapStyle.Hybrid:d=Msn.VE.DashboardStates.MapView.Ortho;o();h=Msn.VE.DashboardStates.MapStyle.Hybrid;if(b[a.ShowLabels]){k=true;H();i(a.ShowLabels,true);g(b[a.ShowLabels]).addClass("MSVE_selected")}else U();break;case Msn.VE.MapStyle.Oblique:d=Msn.VE.DashboardStates.MapView.Oblique;y();h=Msn.VE.DashboardStates.MapStyle.Aerial;if(b[a.ShowLabels]){H();k=false;i(a.ShowLabels,true);g(b[a.ShowLabels]).removeClass("MSVE_selected")}i(a.Oblique,true);break;case Msn.VE.MapStyle.ObliqueHybrid:d=Msn.VE.DashboardStates.MapView.Oblique;y();h=Msn.VE.DashboardStates.MapStyle.Hybrid;if(b[a.ShowLabels]){U();k=true;i(a.ShowLabels,true);g(b[a.ShowLabels]).addClass("MSVE_selected")}i(a.Oblique,true)}if(j==Msn.VE.DashboardStates.MapMode.View3D&&g(b[a.Oblique]).hasClass("MSVE_selected"))if(h==Msn.VE.DashboardStates.MapStyle.Road)c.Show3DBirdseye(true,true);else c.Show3DBirdseye(true,k);if(b[a.ShowLabels])if(k||h==Msn.VE.DashboardStates.MapStyle.Road)b[a.ShowLabels].title=L_NavActionHideLabels_Text;else b[a.ShowLabels].title=L_NavActionShowLabels_Text}function V(){if(typeof b[a.Style]!="undefined"&&b[a.Style]!=null){var c;for(c=0;c<b[a.Style].classRecipients.length;c++)b[a.Style].classRecipients[c].className="MSVE_RoadMapStyle"}}function H(){if(typeof b[a.Style]!="undefined"&&b[a.Style]!=null){var c;for(c=0;c<b[a.Style].classRecipients.length;c++)b[a.Style].classRecipients[c].className="MSVE_AerialMapStyle"}}function U(){if(typeof b[a.Style]!="undefined"&&b[a.Style]!=null){var c;for(c=0;c<b[a.Style].classRecipients.length;c++)b[a.Style].classRecipients[c].className="MSVE_HybridMapStyle"}}function o(){if(typeof b[a.View]!="undefined"&&b[a.View]!=null){var c=g(b[a.View].classRecipients);c.removeClass("MSVE_StreetSideView");c.removeClass("MSVE_ObliqueView");c.addClass("MSVE_OrthoView")}if(b[a.Traffic]!=null){i(a.Traffic,true);C()}s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin}function y(){if(typeof b[a.View]!="undefined"&&b[a.View]!=null){var c=g(b[a.View].classRecipients);c.removeClass("MSVE_StreetSideView");c.removeClass("MSVE_OrthoView");c.addClass("MSVE_ObliqueView")}if(I){if(e.obliqueCompass==null){e.obliqueCompass=new wb(b[a.ObliqueCompass]);if(b[a.ObliqueCompass].radius)e.obliqueCompass.SetRadius(b[a.ObliqueCompass].radius);e.obliqueCompass.onclick=function(){s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin}}e.obliqueCompass.UpdateFromMap()}if(ab){if(e.obliqueZoom==null){e.obliqueZoom=new xb(b[a.ObliqueZoom]);e.obliqueZoom.Init()}e.obliqueZoom.UpdateFromMap()}if(b[a.Traffic]!=null&&j==Msn.VE.DashboardStates.MapMode.Flatland)i(a.Traffic,false)}function jb(){if(typeof b[a.View]!="undefined"&&b[a.View]!=null){var c=g(b[a.View].classRecipients);c.removeClass("MSVE_OrthoView");c.removeClass("MSVE_ObliqueView");c.addClass("MSVE_StreetSideView")}}function x(){if(!b[a.ObliqueNotification])return;if(Q)return;Q=true;if(!e.displaying3DNotification)if(d!=Msn.VE.DashboardStates.MapView.Oblique){if(!z){var o=g(b[a.ObliqueNotification]),k=o.select("img");for(var i=0;i<k.length&&!z;i++){var j=k.element(i);if(j.id=="MSVE_obliqueNotifyImg")z=j}}if(z)z.src=c.GetObliqueMode().GetMiddleTileFilename();var f=b[a.Oblique];b[a.ObliqueNotification].style.display="block";var m=f.offsetLeft+f.offsetWidth/2-b[a.ObliqueNotification].offsetWidth/2,n=f.offsetTop+f.offsetHeight+4;g(b[a.ObliqueNotification]).setStyle("top",n+"px").setStyle("left",m+"px");var l=D(),h;for(h=0;h<l.length;++h)mvcViewFacade.UpdateShimIfSupported(l[h]);m=n=f=null;window.setTimeout(q,6000)}}function bb(){if(!b[a.ThreeDUpdatedNotification])return;q();if(!e.displaying3DNotification){e.displaying3DNotification=true;var c=b[a.Mode3D];b[a.ThreeDUpdatedNotification].style.display="block";var d=c.offsetLeft-6,f=c.offsetTop+c.offsetHeight+4;g(b[a.ThreeDUpdatedNotification]).setStyle("top",f+"px").setStyle("left",d+"px");mvcViewFacade.UpdateShimIfSupported(b[a.ThreeDUpdatedNotification]);c=null;window.setTimeout(E,6000)}}function q(){b[a.ObliqueNotification].style.display="none";var d=D(),c;for(c=0;c<d.length;++c)mvcViewFacade.UpdateShimIfSupported(d[c])}function E(){e.displaying3DNotification=false;b[a.ThreeDUpdatedNotification].style.display="none";mvcViewFacade.UpdateShimIfSupported(b[a.ThreeDUpdatedNotification])}function i(c,d){if(b[c]==null)return;if(b[c].enabled==d)return;b[c].enabled=d;var a=l[c];if(a.InitialClass)if(d)g(b[c]).swapClass(a.InitialClass+"_disabled",a.InitialClass);else g(b[c]).swapClass(a.InitialClass,a.InitialClass+"_disabled");if(a.Title)b[c].title=a.Title;if(a.OnClickFunction)if(d)b[c].attachEvent("onclick",a.OnClickFunction);else b[c].detachEvent("onclick",a.OnClickFunction)}function n(d){if(d&Msn.VE.DashboardStates.MapView.Ortho||d&Msn.VE.DashboardStates.MapMode.View3D)if(d&Msn.VE.DashboardStates.MapStyle.Road)c.SetMapStyle("r");else if(d&Msn.VE.DashboardStates.MapStyle.Aerial)c.SetMapStyle("a");else if(d&Msn.VE.DashboardStates.MapStyle.Hybrid)c.SetMapStyle("h");if(d&Msn.VE.DashboardStates.MapMode.Flatland&&d&Msn.VE.DashboardStates.MapView.Oblique)if(d&Msn.VE.DashboardStates.MapStyle.Aerial&&c.GetMapStyle()!=Msn.VE.MapStyle.Oblique){k=false;if(b[a.ShowLabels]){i(a.ShowLabels,true);g(b[a.ShowLabels]).removeClass("MSVE_selected")}c.SetMapStyle(Msn.VE.MapStyle.Oblique)}else if(d&Msn.VE.DashboardStates.MapStyle.Hybrid&&c.GetMapStyle()!=Msn.VE.MapStyle.ObliqueHybrid){k=true;if(b[a.ShowLabels]){i(a.ShowLabels,true);g(b[a.ShowLabels]).addClass("MSVE_selected")}c.SetMapStyle(Msn.VE.MapStyle.ObliqueHybrid)}}function Fb(a){if(a&Msn.VE.DashboardStates.MapMode.View3D)if(a&Msn.VE.DashboardStates.MapView.Ortho)c.SetTilt(-90);else if(a&Msn.VE.DashboardStates.MapView.Oblique)c.SetTilt(-45);else if(a&Msn.VE.DashboardStates.MapView.StreetSide)c.SetTilt(-25)}function D(){return[b[a.ObliqueNotification]]}function Eb(a){return b[a]}function Bb(){return b}function Cb(){return m}function gb(){return s}function ib(a){s=a}this.SetMapViewState=function(a){d=a};this.GetMapViewState=function(){return d};this.SetMapModeState=function(a){j=a};this.GetMapModeState=function(){return j};this.SetLabelsState=function(a){k=a};this.GetLabelsState=function(){return k};this.GetLastRotationDirection=gb;this.SetLastRotationDirection=ib;this.GetObliqueNotifierShimmedElements=D;this.Init=Hb;this.Create=M;this.Destroy=Gb;this.DestroyControl=J;this.GetControl=Eb;this.GetControls=Bb;this.GetTinyZoom=Cb;this.OnOrthoMapViewClick=u;this.OnObliqueMapViewClick=F;this.UpdateZoom=w;this.SelectObliqueMapView=y;this.SelectOrthoMapView=o;this.DisplayObliqueNotification=x;this.HideObliqueNotification=q;this.DisplayThreeDUpdatedNotification=bb;this.HideThreeDUpdatedNotification=E};function ab(o,c,d,b){var a=document.createElement("div"),i=0,j=0,h=false,f=15;this.Init=function(){a.id="Compass";a.attachEvent("onmousedown",k);a.attachEvent("onmouseup",m);a.attachEvent("onmousemove",l);a.attachEvent("ondblclick",IgnoreEvent);a.title=L_NavActionCompassPan_Text;o.appendChild(a);if(isNaN(parseInt(c)))c=a.offsetWidth/2;if(isNaN(parseInt(d)))d=a.offsetHeight/2;if(isNaN(parseInt(b)))b=Math.min(c,d)};this.Destroy=function(){a.detachEvent("onmousedown",k);a.detachEvent("onmouseup",m);a.detachEvent("onmousemove",l);a.detachEvent("ondblclick",IgnoreEvent);a=null};function k(m){m=GetEvent(m);CancelEvent(m);var n=g(a).getPagePosition();i=n.x;j=n.y;if(a.setCapture)a.setCapture();var k=Gimme.Screen.getMousePosition(m).x-i-c,l=Gimme.Screen.getMousePosition(m).y-j-d,o=Math.sqrt(k*k+l*l);if(o<b){k=Math.floor(k/b*f);l=Math.floor(l/b*f);$VE_A.Log($VE_A.PgName.Map,"Pan","Nav Bar");e.ContinuousPan(k,l,0,true);h=true}return false}function l(k){k=GetEvent(k);CancelEvent(k);if(h){var a=Gimme.Screen.getMousePosition(k).x-i-c,g=Gimme.Screen.getMousePosition(k).y-j-d,l=Math.sqrt(a*a+g*g);if(l<b){a=Math.floor(a/b*f);g=Math.floor(g/b*f);e.ContinuousPan(a,g,0,true)}}return false}function m(b){b=GetEvent(b);CancelEvent(b);if(a.releaseCapture)a.releaseCapture();e.StopContinuousPan();h=false;return false}function p(){a.style.display="none"}function q(){a.style.display="block"}function n(){return a}this.Hide=p;this.Show=q;this.GetElement=n}var a=G,b=null,h=null,A=null,c=null,t=null,w=null,x=null,d=null,n=null,q=null,r=null,i=null,j=null,jb=null,k=null,o=null,p=null,l=null,m=null,v=null,u=null,U=["North","East","South","West"],R={"North":0,"East":1,"South":2,"West":3},z,y,s,J=150,F=.7,X=.9,M=1;function eb(){e.AttachEvent("oninitmode",Y);A=[a.Mode,a.View,a.Style,a.ShowLabels,a.TinyZoom,a.ObliqueNotification,a.ObliqueCompass,a.ThreeDUpdatedNotification];if(typeof $MVEF!="undefined"&&$MVEM.IsEnabled($MVEF.MapAction.Traffic))
if(typeof VE_TrafficManager!="undefined")
A.push(a.Traffic);A.push(a.LocalizeMe);h=new Msn.VE.CommonControls(e,A);b=h.GetControls();b[a.Oblique].innerText=L_DashboardBirdsEye_Text;b[a.Oblique].innerHTML=L_DashboardBirdsEye_Text;c=document.createElement("div");c.id="MSVE_navAction_container";c.className="MSVE_Dashboard_V6";j=document.createElement("div");j.id="MSVE_navAction_styleGroup";d=document.createElement("div");d.id="MSVE_navAction_topBar";b[a.View].classRecipients=[j,c,d];b[a.Style].classRecipients=[j];b[a.Mode].classRecipients=[d];h.Oblique3DFunctionality=h.ObliqueFunctions.ObliqueImageryIn3D;K.appendChild(c);t=document.createElement("div");t.id="MSVE_navAction_topBackground";t.className="MSVE_navAction_background";w=document.createElement("div");w.id="MSVE_navAction_compassBackground";w.className="MSVE_navAction_background";x=document.createElement("div");x.id="MSVE_navAction_leftBackground";x.className="MSVE_navAction_background";d.className="MSVE_Dashboard MSVE_Dashboard_V6 MSVE_FlatlandMapMode";n=document.createElement("div");n.id="MSVE_navAction_leftBar";n.className="MSVE_Dashboard MSVE_Dashboard_V6";q=document.createElement("div");q.id="MSVE_navAction_compassContainer";q.className="MSVE_Dashboard MSVE_Dashboard_V6";k=document.createElement("div");k.id="MSVE_navAction_toggleGlyphWrapper";k.title=L_NavActionHideToolTip_Text;pseudoHover(k);c.appendChild(x);c.appendChild(w);c.appendChild(t);c.appendChild(q);c.appendChild(n);c.appendChild(d);c.appendChild(k);if(!e.IsModeEnabled(Msn.VE.MapActionMode.Mode3D))
P();var C=g(c),f=C.select("> div");f.addEvent("mousedown",IgnoreEvent);f.addEvent("mouseup",IgnoreEvent);f.addEvent("mousemove",DashboardContainerMouseMoveEvent);f.addEvent("mousewheel",IgnoreEvent);f.addEvent("dblclick",IgnoreEvent);f.addEvent("contextmenu",IgnoreEvent);f.addEvent("keydown",IgnoreEvent);f.addEvent("keyup",IgnoreEvent);f.addEvent("click",IgnoreEvent);i=[];for(s=0;s<5;s++)
{i[s]=document.createElement("div");i[s].className="MSVE_navAction_separator";i[s].id="MSVE_navAction_separator"+s}
y=document.createElement("div");y.id="MSVE_navAction_toggleGlyphInner";y.className="MSVE_navAction_toggleGlyph";k.appendChild(y);b[a.Road].title=L_NavActionRoadToolTip_Text;b[a.Aerial].title=L_NavActionAerialToolTip_Text;b[a.Hybrid].title=L_NavActionHybridToolTip_Text;b[a.Mode2D].title=L_NavActionFlatlandToolTip_Text;b[a.Mode3D].title=L_NavActionView3DToolTip_Text;b[a.LocalizeMe].title=L_NavActionLocalizeMeToolTip_Text;j.appendChild(b[a.Road]);j.appendChild(b[a.Aerial]);j.appendChild(i[1]);if(L)j.appendChild(b[a.Oblique]);if(D){d.appendChild(b[a.Mode]);d.appendChild(i[0])}
d.appendChild(b[a.LocalizeMe]);d.appendChild(j);d.appendChild(i[2]);h.SetLabelsState(W!=false);d.appendChild(b[a.ShowLabels]);d.appendChild(i[3]);if(b[a.Traffic]!=null)
{b[a.Traffic].title=L_NavActionShowTrafficToolTip_Text;d.appendChild(b[a.Traffic]);d.appendChild(i[4])}
else
C.addClass("notraffic");r=document.createElement("div");r.id="MSVE_navAction_compassWrapper";q.appendChild(r);z=new ab(r);z.Init();pseudoHover(z.GetElement());b[a.ObliqueCompass].radius=31;r.appendChild(b[a.ObliqueCompass]);var B=h.GetTinyZoom();n.appendChild(b[a.TinyZoom]);p=document.createElement("div");p.id="MSVE_navAction_zoomPlusWrapper";pseudoHover(p);p.appendChild(B.GetPlus());b[a.TinyZoom].appendChild(p);o=document.createElement("div");o.id="MSVE_navAction_zoomMinusWrapper";pseudoHover(o);o.appendChild(B.GetMinus());b[a.TinyZoom].appendChild(o);B.HookupPlusMinusEvents(p,o);rotatorContainer=document.createElement("div");rotatorContainer.id="MSVE_navAction_rotatorContainer";u=document.createElement("div");u.id="MSVE_navAction_ccw";u.title=L_NavActionObliqueRotationToolTip_CCW_Text;u.className="MSVE_navAction_rotator";v=document.createElement("div");v.id="MSVE_navAction_cw";v.title=L_NavActionObliqueRotationToolTip_CW_Text;v.className="MSVE_navAction_rotator";l=document.createElement("div");l.id="MSVE_navAction_ccwWrapper";pseudoHover(l);l.appendChild(u);m=document.createElement("div");m.id="MSVE_navAction_cwWrapper";pseudoHover(m);m.appendChild(v);g(l).addEvent("click",O);g(m).addEvent("click",Q);rotatorContainer.appendChild(l);rotatorContainer.appendChild(m);n.appendChild(rotatorContainer);d.appendChild(b[a.ObliqueNotification]);d.appendChild(b[a.ThreeDUpdatedNotification]);h.Init();if(Msn.VE.Animation)I()}
function bb()
{d.removeChild(b[a.ObliqueNotification]);d.removeChild(b[a.ThreeDUpdatedNotification]);g(l).removeEvent("click",O);g(m).removeEvent("click",Q);l.removeChild(u);m.removeChild(v);rotatorContainer.removeChild(l);rotatorContainer.removeChild(m);n.removeChild(rotatorContainer);var f=h.GetTinyZoom();if(f)
{var s=f.GetMinus();if(s)o.removeChild(s);var A=f.GetPlus();if(A)
p.removeChild(A);b[a.TinyZoom].removeChild(o);b[a.TinyZoom].removeChild(p);n.removeChild(b[a.TinyZoom])}
z.Destroy();q.removeChild(r);r.removeChild(b[a.ObliqueCompass]);if(b[a.Traffic]!=null)
{d.removeChild(b[a.Traffic]);d.removeChild(i[4])}
d.removeChild(b[a.ShowLabels]);d.removeChild(i[3]);j.removeChild(b[a.Road]);j.removeChild(b[a.Aerial]);j.removeChild(i[1]);if(L)
j.removeChild(b[a.Oblique]);if(D)
{d.removeChild(b[a.Mode]);d.removeChild(i[0])}
d.removeChild(j);d.removeChild(i[2]);k.removeChild(y);var F=g(c),e=F.select("> div");e.removeEvent("mouseleave",B);e.removeEvent("mouseenter",C);e.removeEvent("mousedown",IgnoreEvent);e.removeEvent("mouseup",IgnoreEvent);e.removeEvent("mousemove",DashboardContainerMouseMoveEvent);e.removeEvent("mousewheel",IgnoreEvent);e.removeEvent("dblclick",IgnoreEvent);e.removeEvent("contextmenu",IgnoreEvent);e.removeEvent("keydown",IgnoreEvent);e.removeEvent("keyup",IgnoreEvent);e.removeEvent("click",IgnoreEvent);c.removeChild(x);c.removeChild(w);c.removeChild(t);c.removeChild(q);c.removeChild(n);c.removeChild(d);c.removeChild(k);K.removeChild(c);h.Destroy();if(Msn.VE.Animation)
E().onclick=null}
function B(){Gimme.Animation.end("MSVE_NAVACTION_FADEIN");g(c).select("div.MSVE_navAction_background").fadeTo(null,F,J,"MSVE_NAVACTION_FADEOUT")}function C(){Gimme.Animation.end("MSVE_NAVACTION_FADEOUT");g(c).select("div.MSVE_navAction_background").fadeTo(null,X,J,"MSVE_NAVACTION_FADEIN")}function Y(a){if(a==Msn.VE.MapActionMode.Mode3D){Z();if(e.Get3DControl())if(g(N()).hasClass("collapsed"))e.Get3DControl().ShowNavigationControl=false;else e.Get3DControl().ShowNavigationControl=true}else P()}function P(){var a=g(c),b=a.select("> div");a.select("div.MSVE_navAction_background").setStyle("opacity",F);b.addEvent("mouseleave",B);b.addEvent("mouseenter",C)}function Z(){var a=g(c),b=a.select("> div");b.removeEvent("mouseleave",B);b.removeEvent("mouseenter",C);a.select("div.MSVE_navAction_background").setStyle("opacity",M)}function O(){H(Msn.VE.BirdsEyeSearchSpinDirection.CounterclockwiseSpin);$VE_A.Log($VE_A.PgName.Map,"Rotate - Counterclockwise",f)}function Q(){H(Msn.VE.BirdsEyeSearchSpinDirection.ClockwiseSpin);$VE_A.Log($VE_A.PgName.Map,"Rotate - Clockwise",f)}function H(a){h.SetLastRotationDirection(a);var b=e.GetObliqueScene();if(b){var d=R[b.GetOrientation()],c=U[(d+a+4)%4];e.SetObliqueOrientation(c,a,true);h.obliqueCompass.UpdateFromMap()}}function N(){return c}function T(){return h.GetObliqueNotifierShimmedElements().concat([t])}function E(){return k}function cb(){return h.GetMapModeState()}function fb(){if(c)c.style.display="block"}function db(){if(c)c.style.display="none"}function I(){if(!e.GetDashboard().GetToggleGlyph())return;e.GetDashboard().GetToggleGlyph().onclick=function(){var a=e.GetDashboard();if(g(a.GetElement()).hasClass("collapsed")){g(a.GetElement()).removeClass("collapsed");a.GetToggleGlyph().title=L_NavActionHideToolTip_Text;if(e.Get3DControl())e.Get3DControl().ShowNavigationControl=true;$VE_A.Log($VE_A.PgName.Map,"Maximize nav bar",f)}else{g(a.GetElement()).addClass("collapsed");a.GetToggleGlyph().title=L_NavActionShowToolTip_Text;if(e.Get3DControl())e.Get3DControl().ShowNavigationControl=false;$VE_A.Log($VE_A.PgName.Map,"Minimize nav bar",f)}var c=e.GetDashboard().GetShimmedElements(),b;for(b=0;b<c.length;b++)mvcViewFacade.UpdateShimIfSupported(c[b]);g("#MSVE_navAction_topBackground").setStyle("opacity",M)}}function V(){h.ObliqueFunctions.ObliqueImageryIn3D.ObliqueClickFunction()}this.DisplayThreeDUpdatedNotification=function gb(){h.DisplayThreeDUpdatedNotification()};function S(a){h.SetLastRotationDirection(a)}this.Init=eb;this.Destroy=bb;this.GetElement=N;this.GetToggleGlyph=E;this.GetShimmedElements=T;this.createRoller=I;this.GetMode=cb;this.Show=fb;this.Hide=db;this.Oblique3DToggle=V;this.SetLastRotationDirection=S};Msn.VE.LatLong=function(b,a){this.latitude=b;this.longitude=a};Msn.VE.LatLong.prototype.ToString=function(){return"("+this.latitude+", "+this.longitude+")"};Msn.VE.LatLong.prototype.Copy=function(a){if(!a)return;this.latitude=a.latitude;this.longitude=a.longitude};Msn.VE.LatLong.prototype.Equals=function(a){if(a instanceof Msn.VE.LatLong)return this.latitude==a.latitude&&this.longitude==a.longitude;else return false};Msn.VE.LatLongRectangle=function(a,b){this.northwest=a;this.southeast=b;this.ToString=function(){return"("+(this.northwest?this.northwest.ToString():"null")+", "+(this.southeast?this.southeast.ToString():"null")+")"};this.Copy=function(a){if(!a)return;if(!this.northwest)this.northwest=new Msn.VE.LatLong;if(!this.southeast)this.southeast=new Msn.VE.LatLong;this.northwest.Copy(a.northwest);this.southeast.Copy(a.southeast)};this.Center=function(){var b=Math.sin(this.northwest.latitude*Math.PI/180),c=Math.sin(this.southeast.latitude*Math.PI/180),d=.25*(Math.log((1+b)/(1-b))+Math.log((1+c)/(1-c))),a=new Msn.VE.LatLong;a.latitude=Math.atan(Math.exp(d))*360/Math.PI-90;a.longitude=.5*(parseFloat(this.northwest.longitude)+parseFloat(this.southeast.longitude));return a};this.Contains=function(c){return c.latitude<=a.latitude&&c.longitude>=a.longitude&&c.latitude>=b.latitude&&c.longitude<=b.longitude};this.ContainsRectangle=function(a){return a.southeast.latitude>=this.southeast.latitude&&a.southeast.longitude<=this.southeast.longitude&&a.northwest.latitude<=this.northwest.latitude&&a.northwest.longitude>=this.northwest.longitude}};Msn.VE.MapStyle=new function(){this.Road="r";this.Shaded="s";this.Aerial="a";this.Hybrid="h";this.Oblique="o";this.ObliqueHybrid="b"};Msn.VE.MapStyle.IsViewOblique=function(a){return a==Msn.VE.MapStyle.ObliqueHybrid||a==Msn.VE.MapStyle.Oblique};Msn.VE.MapStyle.IsViewOrtho=function(a){return a==Msn.VE.MapStyle.Road||a==Msn.VE.MapStyle.Shaded||a==Msn.VE.MapStyle.Hybrid||a==Msn.VE.MapStyle.Aerial};Msn.VE.MapViewType=function(){};Msn.VE.MapViewType.Pixel="pixel";Msn.VE.MapViewType.PixelRect="pixelRect";Msn.VE.MapViewType.LatLong="latlong";Msn.VE.MapViewType.LatLongAccurate="latlongaccurate";Msn.VE.MapViewType.LatLongRect="latlongRect";Msn.VE.MapView=function(map){this.zoomLevel=0;this.mapStyle=null;this.doRoadShading=false;this.tilt=-90;this.direction=0;this.altitude=-1000;this.center=new VEPixel;this.latlong=new Msn.VE.LatLong;this.cameraLatlong=null;this.pixelRect=new Msn.VE.PixelRectangle;this.latlongRect=new Msn.VE.LatLongRectangle;this.sceneId=null;this.sceneOrientation=null;this.bySceneId=false;this.callback=null;this.photoX=null;this.photoY=null;this.photoScale=null;this._supressFlyToCall=false;this._needsPivotOperation=true;var mapInstance=map,p_this=this,viewType=Msn.VE.MapViewType.Pixel;this.Destroy=function(){this.center=this.latlong=p_this=mapInstance=null};this.GetViewType=function(){return viewType};this.GetMap=function(){return mapInstance};this.SetMap=function(a){mapInstance=a};function MakeCopy(){var a=new Msn.VE.MapView;a.Copy(p_this);return a}function Copy(a){p_this.zoomLevel=a.zoomLevel;p_this.mapStyle=a.mapStyle;p_this.doRoadShading=a.doRoadShading;p_this.tilt=a.tilt;p_this.direction=a.direction;p_this.altitude=a.altitude;p_this.center.Copy(a.center);if(a.cameraLatlong!=null){p_this.cameraLatlong=new Msn.VE.LatLong;p_this.cameraLatlong.Copy(a.cameraLatlong)}p_this.latlong.Copy(a.latlong);p_this.pixelRect.Copy(a.pixelRect);p_this.latlongRect.Copy(a.latlongRect);p_this.sceneId=a.sceneId;p_this.sceneOrientation=a.sceneOrientation;p_this.photoX=a.photoX;p_this.photoY=a.photoY;p_this.photoScale=a.photoScale;p_this.SetMap(a.GetMap());viewType=a.GetViewType()}function Equals(a){return a!=null&&p_this.zoomLevel==a.zoomLevel&&p_this.mapStyle==a.mapStyle&&MathAbs(p_this.tilt-a.tilt)<1e-6&&MathAbs(p_this.direction-a.direction)<1e-6&&MathAbs(p_this.altitude-a.altitude)<1e-6&&MathAbs(p_this.center.x-a.center.x)<1e-6&&MathAbs(p_this.center.y-a.center.y)<1e-6&&p_this.sceneId==a.sceneId&&p_this.GetMap()==a.GetMap()&&p_this.sceneOrientation==a.sceneOrientation}function ToString(){return"("+p_this.latlong.ToString()+", "+p_this.zoomLevel+", "+p_this.mapStyle+")"}function SetCenter(a){if(!a)return;p_this.center=a;viewType=Msn.VE.MapViewType.Pixel}function SetCenterLatLong(a){if(!a)return;p_this.latlong=a;p_this.cameraLatlong=null;viewType=Msn.VE.MapViewType.LatLong}function SetCenterLatLongAccurate(a){if(a){p_this.latlong=a;p_this.cameraLatlong=null;if(Msn.VE.MapStyle.IsViewOblique(p_this.mapStyle))viewType=Msn.VE.MapViewType.LatLongAccurate;else viewType=Msn.VE.MapViewType.LatLong}}function SetPixelRectangle(a){p_this.pixelRect=a;p_this.cameraLatlong=null;p_this.tilt=-90;p_this.direction=0;viewType=Msn.VE.MapViewType.PixelRect}function SetLatLongRectangle(a){p_this.latlongRect=a;p_this.cameraLatlong=null;p_this.tilt=-90;p_this.direction=0;viewType=Msn.VE.MapViewType.LatLongRect}function SetZoomLevel(a){if(a<=0)a=1;var c=mapInstance.GetCenterOffset().x,d=mapInstance.GetCenterOffset().y;switch(viewType){case Msn.VE.MapViewType.Pixel:var b=Math.pow(2,a-p_this.zoomLevel);p_this.center.x=(p_this.center.x+c)*b-c;p_this.center.y=(p_this.center.y+d)*b-d;break;case Msn.VE.MapViewType.PixelRect:var b=Math.pow(2,a-p_this.zoomLevel);p_this.pixelRect.topLeft.x=p_this.pixelRect.topLeft.x*b;p_this.pixelRect.topLeft.y=p_this.pixelRect.topLeft.y*b;p_this.pixelRect.bottomRight.x=p_this.pixelRect.bottomRight.x*b;p_this.pixelRect.bottomRight.y=p_this.pixelRect.bottomRight.y*b}if(p_this.zoomLevel!=a){p_this.altitude=-1000;if(p_this.zoomLevel!=0)p_this.cameraLatlong=null}p_this.zoomLevel=a}function SetMapStyle(a,c,b,e,d){var f=p_this.mapStyle;p_this.mapStyle=a;if(viewType==Msn.VE.MapViewType.Pixel)viewType=Msn.VE.MapViewType.LatLong;if(!Msn.VE.MapStyle.IsViewOblique(a)){p_this.sceneId=null;p_this.sceneOrientation=null;p_this.bySceneId=false}else{p_this.sceneId=c;if(b)p_this.sceneOrientation=b;p_this.spinDirection=f==a?e:null;p_this.preserveScene=d;if(c)p_this.bySceneId=true;else p_this.bySceneId=false}}function SetTilt(a){if(a>=269.99999)a=a-360;if(a<-90)a=-90;if(a>90)a=90;p_this.tilt=a;p_this._needsPivotOperation=true}function SetDirection(a){if(a<0||a>=360)a=0;p_this.direction=a;p_this._needsPivotOperation=true}function SetAltitude(a){if(a<-1000||a>15000000)a=-1000;p_this.altitude=a}function GetTilt(){return p_this.tilt}function GetDirection(){return p_this.direction}function GetAltitude(){return p_this.altitude}function ScaleCoord(a,b){if(b)a=a*Math.pow(2,b-p_this.zoomLevel);return a}function GetX(a){return ScaleCoord(p_this.center.x,a)}function GetY(a){return ScaleCoord(p_this.center.y,a)}function GetCenter(a){var b=ScaleCoord(p_this.center.x+mapInstance.GetCenterOffset().x,a),c=ScaleCoord(p_this.center.y+mapInstance.GetCenterOffset().y,a);return new VEPixel(b,c)}function GetZoomLevel(){return p_this.zoomLevel}function GetLatLongRectangle(){return p_this.latlongRect}function GetPixelRectangle(){return p_this.pixelRect}function GetCenterLatLong(){var b=p_this.center.x+mapInstance.GetCenterOffset().x,c=p_this.center.y+mapInstance.GetCenterOffset().y,a=mapInstance.GetCurrentMode().PixelToLatLong(new VEPixel(b,c),p_this.zoomLevel);return a==null?p_this.latlong:a}function Resolve(b,d,c,a){if(viewType==Msn.VE.MapViewType.LatLongAccurate)ResolveAsync(b,d,c,a);else ResolveSync(b,d,c,a)}function ResolveAsync(b,e,d,a){function c(c){if(c!=null&&typeof c!="undefined"&&c.length==1)p_this.center=c[0];if(p_this.cameraLatlong==null)if(!p_this._UpdateCamera(b)){p_this.tilt=-90;p_this.cameraLatlong=p_this.latlong}viewType=Msn.VE.MapViewType.Pixel;if(a!=null&&typeof a=="function")a()}b.LatLongToPixelAsync([p_this.latlong],p_this.zoomLevel,c)}function ResolveSync(a,e,c,b){switch(viewType){case Msn.VE.MapViewType.Pixel:p_this.latlong=a.PixelToLatLong(p_this.center,p_this.zoomLevel);break;case Msn.VE.MapViewType.LatLong:p_this.center=a.LatLongToPixel(p_this.latlong,p_this.zoomLevel);if(p_this.center!=null){p_this.center.x-=mapInstance.GetCenterOffset().x;p_this.center.y-=mapInstance.GetCenterOffset().y}break;case Msn.VE.MapViewType.PixelRect:ResolveRectangle(a,e,c);break;case Msn.VE.MapViewType.LatLongRect:if(Msn.VE.MapStyle.IsViewOblique(p_this.mapStyle)){p_this.zoomLevel=1;var d=a.GetScene();if(!d||!d.ContainsLatLong(p_this.latlongRect.northwest)||!d.ContainsLatLong(p_this.latlongRect.southeast)){p_this.latlong=p_this.latlongRect.Center();p_this.center=a.LatLongToPixel(p_this.latlong,p_this.zoomLevel)}else{p_this.pixelRect.topLeft=a.LatLongToPixel(p_this.latlongRect.northwest,p_this.zoomLevel);p_this.pixelRect.bottomRight=a.LatLongToPixel(p_this.latlongRect.southeast,p_this.zoomLevel);ResolveRectangle(a,e,c)}}else{p_this.zoomLevel=12;p_this.altitude=-1000;p_this.pixelRect.topLeft=a.LatLongToPixel(p_this.latlongRect.northwest,p_this.zoomLevel);p_this.pixelRect.bottomRight=a.LatLongToPixel(p_this.latlongRect.southeast,p_this.zoomLevel);ResolveRectangle(a,e,c)}}if(p_this.cameraLatlong==null)if(!p_this._UpdateCamera(a)){p_this.tilt=-90;p_this.cameraLatlong=p_this.latlong}viewType=Msn.VE.MapViewType.Pixel;if(b!=null&&typeof b=="function")b()}function ResolveRectangle(i,k,j){var c=19,a=Math.pow(2,c-p_this.zoomLevel),g=MathMax(1,MathAbs(p_this.pixelRect.topLeft.x-p_this.pixelRect.bottomRight.x)*a),f=MathMax(1,MathAbs(p_this.pixelRect.topLeft.y-p_this.pixelRect.bottomRight.y)*a),d=Math.log(2),e=c-Math.ceil(Math.log(g/k)/d),h=c-Math.ceil(Math.log(f/j)/d),b=MathMin(e,h);if(b<=0)b=1;a=Math.pow(2,b-p_this.zoomLevel);p_this.center.x=.5*(p_this.pixelRect.topLeft.x+p_this.pixelRect.bottomRight.x)*a-mapInstance.GetCenterOffset().x;p_this.center.y=.5*(p_this.pixelRect.topLeft.y+p_this.pixelRect.bottomRight.y)*a-mapInstance.GetCenterOffset().y;p_this.zoomLevel=b;p_this.altitude=-1000;p_this.latlong=i.PixelToLatLong(p_this.center,p_this.zoomLevel)}function _UpdateCamera(viewMode){if(p_this.latlong==null)if(p_this.center!=null&&p_this.zoomLevel!=null&&typeof viewMode._InternalOrthoMode=="function"){var orthoMode=viewMode._InternalOrthoMode();p_this.latlong=orthoMode.PixelToLatLong(p_this.center,p_this.zoomLevel);if(p_this.latlong!=null){p_this.tilt=-90;p_this.direction=0}}if(p_this.latlong==null)return false;p_this._needsPivotOperation=false;if(mapInstance.IsModeEnabled(Msn.VE.MapActionMode.Mode3D)){var control=mapInstance.Get3DControl();if(control!=null){var cam=control.CameraPositionGivenTarget(p_this.latlong.latitude,p_this.latlong.longitude,p_this.altitude,p_this.zoomLevel,p_this.tilt,p_this.direction);if(cam!=null){var lat,lon,alt;eval(cam);p_this.cameraLatlong=new Msn.VE.LatLong;p_this.cameraLatlong.latitude=lat;p_this.cameraLatlong.longitude=lon;p_this.altitude=alt}else return false}}return true}this.MakeCopy=MakeCopy;this.Copy=Copy;this.Equals=Equals;this.ToString=ToString;this.SetCenter=SetCenter;this.SetCenterLatLong=SetCenterLatLong;this.SetCenterLatLongAccurate=SetCenterLatLongAccurate;this.SetPixelRectangle=SetPixelRectangle;this.SetLatLongRectangle=SetLatLongRectangle;this.SetZoomLevel=SetZoomLevel;this.SetMapStyle=SetMapStyle;this.SetTilt=SetTilt;this.SetDirection=SetDirection;this.SetAltitude=SetAltitude;this.GetTilt=GetTilt;this.GetDirection=GetDirection;this.GetAltitude=GetAltitude;this.ScaleCoord=ScaleCoord;this.GetX=GetX;this.GetY=GetY;this.GetCenter=GetCenter;this.Resolve=Resolve;this.SetZoomLevel=SetZoomLevel;this.GetZoomLevel=GetZoomLevel;this.GetLatLongRectangle=GetLatLongRectangle;this.GetPixelRectangle=GetPixelRectangle;this.GetCenterLatLong=GetCenterLatLong;this._UpdateCamera=_UpdateCamera};Msn.VE.ViewChangeType=function(){};Msn.VE.ViewChangeType.Zoom=1;Msn.VE.ViewChangeType.Pan=2;Msn.VE.ViewChangeType.Hybrid=3;Msn.VE.ViewChangeType.IsValid=function(a){return typeof a=="number"&&a>0&&a<4};Msn.VE.ObliqueScene=function(e,K,D,G,I,O,c,f,w,v,J){var b=null,g="",d=null,i=null,h={};h[Msn.VE.MapStyle.Oblique]="174";h[Msn.VE.MapStyle.ObliqueHybrid]="174";var j={};j[Msn.VE.MapStyle.Oblique]="%0t%3.tiles.virtualearth.net/tiles/o%4-%5-%6-%7.jpeg?g=%8";j[Msn.VE.MapStyle.ObliqueHybrid]="%0t%3.tiles.virtualearth.net/tiles/cmd/ObliqueHybrid?a=%4-%5-%6-%7&g=%8";var x=Msn.VE.MapStyle.Oblique,a=null,N=null,o=null;if(Msn.VE.API==null)a="%0dev.virtualearth.net/legacyService/ElevatedLoc.ashx";else{o=Msn.VE.API.Constants.imageryurl+"/ConvertLatLongToPixelInBirdsEye";a="%0dev.virtualearth.net/legacyService/ElevatedLoc.ashx"}var r=new _xz1,q=256,s=this,L=new Msn.VE.Bounds(1,2,0,0,c/2,f/2);function C(d,e){var c=Math.pow(2,e-2),f=[[d.x/c],[d.y/c],[1]],a=MatrixMultiply(w,f),b=new Msn.VE.LatLong;b.longitude=a[0][0]/a[2][0];b.latitude=a[1][0]/a[2][0];return b}function z(g,l,m){if(a!=null&&typeof a!="undefined"&&a.length>0){var i=Math.pow(2,l-2),h=[];for(var f=0;f<g.length;++f)h[f]=parseInt(g[f].x/i)+","+parseInt(g[f].y/i);var j=new VENetwork;j.ServiceUrl=a;var c=[];if(b)c.push(new VEParameter(Msn.VE.API.Constants.clienttoken,b));if(d)c.push(new VEParameter("mapguid",d));c.push(new VEParameter("a","P2L"));c.push(new VEParameter("b",h.join(";")));c.push(new VEParameter("s",e));c.push(new VEParameter("f","__PixelToLatLongAsyncResponse"));var k=function(b){var c=null;if(b!=null&&(b.err==null||typeof b.err=="undefined")){c=[];for(var a=0;a<b.length;++a)if(b[a]!=null)if(Msn.VE.API!=null){var e=new VELatLong;e._reserved=b[a];c[a]=e}else{var d=r.Decode(b[a]);c[a]=new Msn.VE.LatLong(d[0],d[1])}else c[a]=null}m(c)};j.BeginInvoke("__PixelToLatLongAsyncResponse",c,k,s)}}function l(d,e){var c=Math.pow(2,e-2),f=[[d.longitude],[d.latitude],[1]],a=MatrixMultiply(v,f),b=new VEPixel;b.x=a[0][0]/a[2][0]*c;b.y=a[1][0]/a[2][0]*c;return b}function y(h,k,l){var g=[];for(var f=0;f<h.length;++f)g[f]=r.Encode(h[f].latitude,h[f].longitude);var c=[];if(Msn.VE.API==null){c.push(new VEParameter("a","L2P"));c.push(new VEParameter("b",g.join("")));c.push(new VEParameter("s",e));c.push(new VEParameter("f","__LatLongToPixelAsyncResponse"))}else{if(b)c.push(new VEParameter(Msn.VE.API.Constants.clienttoken,b));if(d)c.push(new VEParameter("mapguid",d));c.push(new VEParameter("locations",'"'+g.join("")+'"'));c.push(new VEParameter("sceneId",e));c.push(new VEParameter("encodingLength",6))}if(Msn.VE.API!=null){var j=function(d){if(i)i.__HandleAuthentication(d);var c=null;if(d!=null&&d.Pixels!=null){var e=Math.pow(2,k-2);c=[];var b=d.Pixels;for(var a=0;a<b.length;++a)if(b[a]!=null&&b[a].X!=null&&typeof b[a].X!="undefined"&&b[a].Y!=null&&typeof b[a].Y!="undefined")c[a]=new VEPixel(b[a].X*e,b[a].Y*e);else c[a]=null}l(c)};VEAPIRequestInvoke(o,c,j)}else{var j=function(a){var c=null;if(a!=null&&(a.err==null||typeof a.err=="undefined")){var d=Math.pow(2,k-2);c=[];for(var b=0;b<a.length;++b)if(a[b]!=null&&a[b].x!=null&&typeof a[b].x!="undefined"&&a[b].y!=null&&typeof a[b].y!="undefined")c[b]=new VEPixel(a[b].x*d,a[b].y*d);else c[b]=null}l(c)},m=new VENetwork;m.ServiceUrl=a;m.BeginInvoke("__LatLongToPixelAsyncResponse",c,j,s)}}function F(a,b,d){if(a<0||b<0)return false;if(d==1)return a<c/2&&b<f/2;return a<c&&b<f}function M(){return e}function k(f,i,d,b){if(!Msn.VE.MapStyle.IsViewOblique(b))b=x;var e=i*(d==1?c/2:c)+f,a=j[b];if(Msn.VE.API){if(b==Msn.VE.MapStyle.ObliqueHybrid)a=Msn.VE.API.Constants.obliquehybridtileserver;else a=Msn.VE.API.Constants.obliquetileserver;a=a+g}return a.replace(/%3/g,e%4).replace(/%4/g,K).replace(/%5/g,D).replace(/%6/g,I+d-2).replace(/%7/g,e).replace(/%8/g,h[b])}function t(){return k(c/4,f/4,1)}this.GetMiddleTileFilename=t;function u(){var a=Msn.VE.API?Msn.VE.API.Constants.obliquethumbnailtileserver+g:"%0t%1.tiles.virtualearth.net/tiles/ot%2.jpeg?g=%3";return a.replace(/%1/g,e%4).replace(/%2/g,e).replace(/%3/g,h)}function B(){return G}function H(){return L}function p(){return c*q}function n(){return f*q}function A(a){if(!a)return false;var b=l(a,2);return m(b,2)}function m(b,e){var a=Math.pow(2,2-e),c=b.x*a,d=b.y*a;return c>=0&&d>=0&&c<p()&&d<n()}this.SetClientToken=function(a){b=a;if(b)g="&"+Msn.VE.API.Constants.clienttoken+"="+b;else g=""};this.SetGUID=function(a){d=a;if(typeof VEMap!="undefined")i=VEMap._GetMapFromGUID(d)};function E(){return J}this.PixelToLatLong=C;this.PixelToLatLongAsync=z;this.LatLongToPixel=l;this.LatLongToPixelAsync=y;this.IsValidTile=F;this.GetID=M;this.GetTileFilename=k;this.GetThumbnailFilename=u;this.GetOrientation=B;this.GetBounds=H;this.GetWidth=p;this.GetHeight=n;this.ContainsLatLong=A;this.ContainsPixel=m;this.GetMapStyle=E};Msn.VE.Orientation=new function(){this.North="North";this.East="East";this.West="West";this.South="South"};VEPixel=function(a,b){this.x=parseFloat(a);this.y=parseFloat(b)};VEPixel.prototype.ToString=function(){return"("+this.x+", "+this.y+")"};VEPixel.prototype.Copy=function(a){if(!a)return;this.x=a.x;this.y=a.y};Msn.VE.PixelRectangle=function(b,a){this.topLeft=b;this.bottomRight=a;this.ToString=function(){return"("+(this.topLeft?this.topLeft.ToString():"null")+", "+(this.bottomRight?this.bottomRight.ToString():"null")+")"};this.Copy=function(a){if(!a)return;if(!this.topLeft)this.topLeft=new VEPixel;if(!this.bottomRight)this.bottomRight=new VEPixel;this.topLeft.Copy(a.topLeft);this.bottomRight.Copy(a.bottomRight)};this.Contains=function(a){if(a instanceof VEPixel)return a.x>this.topLeft.x&&a.y>this.topLeft.y&&a.x<this.bottomRight.x&&a.y<this.bottomRight.y}};Msn.VE.LineRegion=function(b,a,c){this.boundingRectangle=b;this.indices=a;this.childRegions=c;function d(){return"Bounding Rectangle: "+this.boundingRectangle[0].ToString()+" to "+this.boundingRectangle[1].ToString()+" | Indices: ["+a+"]"}this.ToString=d};var L_integerencodingoutofrange_text="VEIntegerEncoding: The number encoded is out of supported range",L_floatintegermapencodingoutofrange_text="VEFloatIntegerMap: The number encoded is out of supported range",L_integerencodinginvalidstringlength_text="VEIntegerEncoding: Invalid string length",L_integerencodingunknowndigit_text="VEIntegerEncoding: The encoded string has an unknown digit";function VEIntegerEncoding(g,j){var e=g,d=g.length,a=j,h=1;for(var i=0;i<a;++i)h*=d;var f=h-1,c=[];for(var b=0;b<e.length;++b)c[e.substr(b,1)]=b;this.MaxValue=function(){return f};this.ValueLength=function(){return a};this.Encode=function(c){if(c<=f){var h="",g=[];for(var b=0;b<a;++b)g[b]=0;var i=a-1;while(c>0){g[i]=Math.floor(c%d);c=Math.floor(c/d);--i}for(var b=0;b<g.length;++b)h+=e.substr(g[b],1);return h}else throw L_integerencodingoutofrange_text};this.Decode=function(c){if(c.length==a){var b=0;for(var e=0;e<c.length;++e){b*=d;b+=this.DigitValue(c.substr(e,1))}return b}else throw L_integerencodinginvalidstringlength_text};this.DigitValue=function(a){if(c[a]!=null&&c[a]!="undefined")return c[a];else throw L_integerencodingunknowndigit_text}}function VEFloatIntegerMap(e,d,f){var a=e,c=d,b=f;this.MinFloat=function(){return a};this.MaxFloat=function(){return c};this.MaxInt=function(){return b};this.FloatToInt=function(d){if(d>=a&&d<=c){var e=(d-a)/(c-a),f=e*b+.5;return Math.min(Math.floor(f),b)}else throw L_floatintegermapencodingoutofrange_text};this.IntToFloat=function(d){if(d<=b){var f=d/b,e=a+f*(c-a);return e}else throw L_floatintegermapencodingoutofrange_text}}var L_velatlongencodinginvalidstringlength_text="_xz1: Invalid string length";function _xz1(b){var i=-90,h=90,g=-180,f=180,j="0123456789bcdfghjkmnpqrstvwxyz",e=6;if(b!=null&&typeof b!="undefined")e=b;var a=new VEIntegerEncoding(j,e),d=new VEFloatIntegerMap(i,h,a.MaxValue()),c=new VEFloatIntegerMap(g,f,a.MaxValue());this.Encode=function(e,b){var f=a.Encode(d.FloatToInt(e))+a.Encode(c.FloatToInt(b));return f};this.Decode=function(f){if(f.length==2*a.ValueLength()){var e=a.ValueLength(),j=f.substr(0,e),h=f.substr(e,e),i=a.Decode(j),g=a.Decode(h),b=[];b[0]=d.IntToFloat(i);b[1]=c.IntToFloat(g);return b}else throw L_velatlongencodinginvalidstringlength_text}}function _xz1ForMobile(){_xz1.call(this,5)}var Shims=["help","msve_ScratchPad","VE_MessageControl","contextMenu","MSVE_dashboardId"],vedomain="http://dev.virtualearth.net/mapcontrol/v6.2",sceneParam="Yes",_entityIdShapePostfix="_Shape",_hackUniqueLayerId="UniqueLayer_Hack";function GetManifestUrl(a){return a.indexOf("http")==0?a:vedomain+a}function Get3dMarket(){if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null)return window.locale;else return Msn.VE.API.Globals.locale}function Get3dInstallUrl(c,a){var b="http://maps.live.com/Help/VE3DInstall/"+c;if(typeof a=="undefined"||a==null)a=Get3dMarket();b=b.replace("{0}",a);return b}function Get3dHelpUrl(c,a){var b="http://maps.live.com/Help/{0}/"+c;if(typeof a=="undefined"||a==null)a=Get3dMarket();b=b.replace("{0}",a);return b}function initShimElements(){for(var a=0;a<Shims.length;a++)UpdateIFrameShim(Shims[a])}function hookResizeEvent(a){if(a.onresize==null)a.onresize=function(){var b=event.srcElement,a=b.shimElement;if(a)SetShimPosition(a,b)}}function destroyShimElements(){for(var a=0;a<Shims.length;a++)destroyIFrameShim(Shims[a]);var b=$ID("msve_ScratchPad");if(b)b.onresize=null}function ConvertClipToSize(d,e){var a=e.style.clip.split(",");if(a.length==4){var c=parseInt(a[1]),b=parseInt(a[2]);if(!isNaN(b))d.height=b;if(!isNaN(c))d.width=c}}var UseClipToSize=window.navigator.userAgent.indexOf("Firefox")>=0;function SetShimPosition(a,b){var c=g(b).getRelativePosition(a.parentNode);a.style.top=c.y+"px";a.style.left=c.x+"px";a.width=b.offsetWidth;a.height=b.offsetHeight;if(UseClipToSize)ConvertClipToSize(a,b);else a.style.clip=b.style.clip}function UpdateIFrameShim(c,e,d){var a=typeof c=="object"?c:$ID(c);if(!a)return;if(!a.shimElement)addIFrameShim(a,e,d);var b=a.shimElement;SetShimPosition(b,a);if(Msn.VE.Css.Functions.getComputedStyle(a,"display")=="none"||Msn.VE.Css.Functions.getComputedStyle(a,"visibility")=="hidden")b.style.display="none";else b.style.display="block"}function RepositionShims(){if(!view3DMode)return;for(var b=0;b<Shims.length;b++){var a=$ID(Shims[b]);if(a&&a.shimElement&&a.shimElement.style.display!="none")SetShimPosition(a.shimElement,a)}}function addIFrameShim(b,f,e){var a=document.createElement("iframe");a.frameBorder="0";a.scrolling="no";a.style.position="absolute";if(e>=0)a.style.zIndex=e;else a.style.zIndex="1";a.style.backgroundColor="white";b.shimElement=a;HideShim(b);var c=f;if(c==null)c=b;var d=c.parentNode;if(d==null)d=document.body;d.insertBefore(a,c);if(b.id=="msve_ScratchPad"||b.id&&b.id.indexOf("_vefindcontrolinput")>0)hookResizeEvent(b);return a}function destroyIFrameShim(b){var a=$ID(b);DestroyShim(a)}function ShowShim(a,b){UpdateIFrameShim(a,b);if(a!=null&&a.shimElement)a.shimElement.style.display="block"}function HideShim(a){if(a!=null&&a.shimElement)a.shimElement.style.display="none"}function DestroyShim(a){if(a!=null&&a.shimElement){a.shimElement.parentNode.removeChild(a.shimElement);a.shimElement=null}}function RollShim(b){var a=b.Recipient;if(a.shimElement)if(UseClipToSize)ConvertClipToSize(a.shimElement,a);else a.shimElement.style.clip=a.style.clip}function OnView3DKeyDown(d,c){var b=parseInt(d);CloseContextMenu(b);ero.hide();var a=GetMapControlInstance(c);if(a==null)return;switch(b){case 65:a.SetMapStyle("a");break;case 72:a.SetMapStyle("h");break;case 82:case 86:a.SetMapStyle("r");break;case 50:case 98:window.setTimeout(function(){a.EnableMode(Msn.VE.MapActionMode.Mode2D)},10);break;case 66:case 79:a.GetDashboard().Oblique3DToggle()}}function OnNavigationHelpFired(){VE_Help.OpenLiveHelp("wl_local","topic","WL_LOCAL_PROC_3D_NavigateMap.htm")}function OnHardwareAccelHelpFired(){VE_Help.OpenLiveHelp("wl_local","topic","WL_LOCAL_TROU_3D_VideoAcceleration.htm")}var __shapeIdBeingDragged=null;function OnView3DMouseDown(pinPosition){var button=null,layerId,shapeId,lat,lon,alt;eval(pinPosition);if(button=="Left"){__shapeIdBeingDragged=shapeId;window.setTimeout(BeginDragPin3D,300)}CloseContextMenu();ero.hide()}function BeginDragPin3D(){if(__shapeIdBeingDragged!=null){var d=true,b=VE_MapManager.GetCollectionByAnId(__shapeIdBeingDragged);if(b!=null){var c=VE_MapManager.GetSelectedCollection();if(c!=null&&c.GetId()!=b.GetId())return}else return;var a=VE_MapManager.GetAnnotationInCollectionById(b,__shapeIdBeingDragged);if(typeof a!="undefined"&&a!=null&&a.GetType()==MC_GEO_TYPE_POINT){VE_Annotations.EnterMovePushpinMode(__shapeIdBeingDragged,true);View3DMovePin(__shapeIdBeingDragged)}}}function OnView3DDropGeometry(pinPosition){var layerId,pushpinId,lat,lon,alt;eval(pinPosition);if(!pushpinId)return;var result=VE_MapManager.GetAnnotationById(pushpinId);if(result)VE_Annotations.MovePushpin(null,new Msn.VE.LatLong(lat,lon))}function OnView3DLatLonAltClicked(position){var lat,lon,alt;eval(position);VE_MapUpdateView_AutoSaveEntity();if(VE_EditControl.GetMode()==MC_DRAW_MODEL)VE_MapDispatch.OnCreateModel(lat,lon,alt);else VE_EditControl.AddPoint(null,lat,lon,alt)}function OnBeginFlyTo(c,b){ero.hide();var a=GetMapControlInstance(b);if(a!=null)a.OnBeginCameraUpdate()}function OnView3DUpdateViewpoint(viewpoint,mapGuid){var lat,lon,zoom,alt,heading,pitch,targetLat,targetLon;eval(viewpoint);var mapcontrolinstance=GetMapControlInstance(mapGuid);if(mapcontrolinstance==null)return;mapcontrolinstance.OnEndCameraUpdate();var ePosition=1e-6,eOrientation=.1,eAltitude=.01,view=mapcontrolinstance.GetCurrentMapView(),orientationEqual=Math.abs(heading-view.GetDirection())<eOrientation&&Math.abs(pitch-view.GetTilt())<eOrientation,latlongEqual=view.cameraLatlong!=null&&Math.abs(lat-view.cameraLatlong.latitude)<ePosition&&Math.abs(lon-view.cameraLatlong.longitude)<ePosition,altEqual=Math.abs(alt-view.GetAltitude())<eAltitude&&view.GetZoomLevel()==zoom,animationFinished=latlongEqual&&orientationEqual&&(view.GetAltitude()<=-1000&&view.GetZoomLevel()==zoom);if(!animationFinished){var onAnimationInterruptedCallback=mapcontrolinstance.GetOn3DAnimationInterruptedCallback();if(onAnimationInterruptedCallback)onAnimationInterruptedCallback()}view=new Msn.VE.MapView(mapcontrolinstance);view.latlong=new Msn.VE.LatLong(targetLat,targetLon);view.cameraLatlong=new Msn.VE.LatLong(lat,lon);view.SetZoomLevel(zoom);view.SetMapStyle(mapcontrolinstance.GetMapStyle());view.SetAltitude(alt);view.SetDirection(heading);view.SetTilt(pitch);view._supressFlyToCall=true;mapcontrolinstance.SetView(view);mapcontrolinstance.Fire("onendpan");mapcontrolinstance.Fire("onchangeview")}function ProcessQueuedRequest(c,b){var a=GetVEMapInstance(b);if(a!=null)a._ProcessQueuedRequest()}function OnView3DHoverEnd(){ero.hide()}function CloseContextMenu(a){if(a!=16){VE_MapUpdateView_AutoSaveEntity();VE_MapUpdateView_AutoSaveEntity()}if(VE_ContextMenu.MenuOpen){VE_ContextMenu.RemoveContextPin();VE_ContextMenu.CloseMenu()}}function DoShowNotification(arguments){var message,milliseconds;eval(arguments);VE_MessageControl._AddMessage(message,milliseconds)}function OnSetupVE3DVIA(){VE_Help.OpenSized("Virtual Earth - 3DVIA (Beta) installation","Help/en-us/VE3DVIAInstall.htm",700,520)}function Refresh3DPassportCookie(a){if(document.all)return;if(!a)a=map.Get3DControl();a.RefreshCookiesFromMozilla()}function OnRefreshModel(a){if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null)if(typeof a!="undefined"&&a!=null){var b=a.split(",");VE_MapViewPreUpdate.RefreshCollectionList(b)}}function OnSelectPhoto(arguments){var SceneId,InImage,Cause,X,Y,Scale;eval(arguments);if(typeof state!="undefined"&&state!=null)state.SetScene(SceneId);if(Cause=="Rotation")$VE_A.Log3DOblique("Rotate View","Yes","In-Image Mode",X,Y,Scale);else if(Cause=="Selection"){$VE_A.Log3DOblique("Select BE Scene",sceneParam);sceneParam="Yes"}else if(Cause=="Transition")$VE_A.Log3DOblique("Pan BE Scene","Yes","In-Image Mode",X,Y,Scale);else if(Cause=="NotApplicable")sceneParam="No"}function OnPhotoCameraZoom(a){OnPhotoCameraPanOrZoom(a,"Zoom while In-Image")}function OnPhotoCameraPan(a){OnPhotoCameraPanOrZoom(a,"Pan BE Scene")}function OnPhotoCameraPanOrZoom(arguments,NavAction){ero.hide();var X,Y,Scale;eval(arguments);if(typeof state!="undefined"&&state!=null)state.SetXYScale(X,Y,Scale);$VE_A.Log3DOblique(NavAction,"Yes","In-Image Mode",X,Y,Scale)}function OnActivate(arguments){var Activate,ImageFound;eval(arguments);if(Activate==1)$VE_A.Log3DOblique("Activate BE","No","Image Found")}function IsModelVisibleInSpaceland(c){var a=false,b=map.Get3DControl();if(b)if(b.InvokePlugInMethod(VE_3DPlugin.GeoCommunityGuid,"QueryModel",'msnid="'+c+'"')=="1")a=true;return a}VE_ModelActionType={CreateModel:"CreateModel",AddModel:"AssociateModel",DeleteModel:"DissociateModel",MoveModel:"MoveModel",RotateModel:"RotateModel",ElevateModel:"ElevateModel",EditModel:"EditModel"};VE_ModelWhereType={Scratchpad:"scratchpad",Taskbar:"taskbar",ContextMenu:"contextmenu",CV:"cv"};function UniqueModelViewSuccess(){$VE_A.Log($VE_A.PgName.Model3D,"UniqueModelViewSuccess",$VE_A.PgName.Model3D)}function UniqueModelViewFailure(){$VE_A.Log($VE_A.PgName.Model3D,"UniqueModelViewFailure",$VE_A.PgName.Model3D)}function UniqueModelFullyDownloaded(){$VE_A.Log($VE_A.PgName.Model3D,"UniqueModelFullyDownloaded",$VE_A.PgName.Model3D)}function OnView3DPushpinHover(pushPinEval,mapGuid){if(typeof VE_Annotations!="undefined")if(VE_Annotations.PanelOpen)return;var layerId,pushpinId,rX1,rY1,rX2,rY2;eval(pushPinEval);Process3DPushpinHover(layerId,pushpinId,rX1,rY1,rX2,rY2,mapGuid)}function Process3DPushpinHover(layerId,pushpinId,rX1,rY1,rX2,rY2,mapGuid){var result=null,isInvalid=rX1==null||rY1==null||rX2==null||rY2==null?true:false,isEqual=rX1===rX2&&rY1===rY2?true:false,vmap,mapcontrol,mapid;try{var isAPI=typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null;if(!isAPI){vmap=null;mapcontrol=map;mapid="msve_mapContainer"}else{vmap=GetVEMapInstance(mapGuid);if(vmap==null)return;mapcontrol=vmap.vemapcontrol;mapid=vmap.ID}}catch(a){return}var mapdiv=$ID(mapid);if(mapdiv==null)return;var mapPos=g(mapdiv).getScreenPosition(),rect=null;if(!isInvalid)rect=new Msn.VE.Geometry.Rectangle(new Msn.VE.Geometry.Point(rX1+mapPos.x,rY1+mapPos.y),new Msn.VE.Geometry.Point(rX2+mapPos.x,rY2+mapPos.y));if(vmap!=null){if(isInvalid||isEqual)return;if(pushpinId.indexOf("msftve")==0){VEShowVEShapeERO(pushpinId,mapGuid,rect);return}else{var pushpins=vmap.pushpins;if(pushpins!=null){var len=pushpins.length;for(var i=0;i<len;i++){var p=pushpins[i];if(p!=null&&p.ID==pushpinId){ero.hide();VEPushpin.Show3D(rect,p.Title,p.Details,p.TitleStyle,p.DetailsStyle);return}}}}return}else{result=VE_MapManager.GetAnnotationById(pushpinId);if(result){var entity=result;try{if(entity!="undefined"&&entity!=""&&entity){var content=null,col=null;col=VE_MapManager.GetCollectionByAnId(pushpinId);var isCV=col.GetType()==MC_COL_TYPE_COLLECTION?false:true,primitive=entity.GetPrimitive(0);if(primitive.type!=VEShapeType.Pushpin&&pushpinId.indexOf(_entityIdShapePostfix)>0){VE_MapManager.SetHighlightEntity(entity,isCV);return}if(!isCV)VE_MapViewPreUpdate.ShowEro(pushpinId,VE_Directions.EntryPoint.Scratchpad,rect);else VE_MapViewPreUpdate.Viewer.ShowEroToItem(null,pushpinId,rect,null)}}catch(a){}return}}var ddERO=$find(pushpinId+"_ero");if(ddERO){CloseContextMenu();var content=ddERO.get_Content();ero.clearActions();var ddActionNames=eval(ddERO.get_ActionNames()),ddActionValues=eval(ddERO.get_ActionValues());g(ddActionNames).forEach(function(a,b){ero.addAction('<a href = "#" onclick = "'+ddActionValues[b]+'; return false;">'+a+"</a>")});ero.setContent(content);ero.dockToRect(rect,null,-1);return}result=pushpinId.match(/pin_traffic_market_(.*)/);if(result!=null&&result.length>=2){var entity=VE_TrafficManager.GetEntity(pushpinId);if(entity!=null){var content=VE_TrafficManager.CreateZoomPopupContent(entity);if(content!=null&&content!=""&&content!="undefined"){CloseContextMenu();ero.setContent(content);ero.dockToRect(rect,null,-1);return}}}result=pushpinId.match(/pin_traffic_incident_(.*)/);if(result!=null&&result.length>=2){var entity=VE_TrafficManager.GetEntity(pushpinId);if(entity!=null){var content=VE_TrafficManager.CreatePopupContent(entity,true);if(content!=null&&content!=""&&content!="undefined"){CloseContextMenu();ero.setContent(content);ero.dockToRect(rect,null,-1);return}}}if(pushpinId=="autolocate"){var pushpins=mapcontrol.GetPushpins();if(pushpins)for(var i=0;i<pushpins.length;++i)if(pushpins[i].pin.id=="autolocate"){var pinDOM=pushpins[i].pin;pinDOM.onmouseover(rect);return}}result=pushpinId.match(/pin_(.*)/);if(result==null)result=pushpinId=="place_pin"?[null,"place_ero"]:null;if(result!=null&&result.length>=2){var entityID=result[1],r=VE_SearchManager.GetEntity(entityID);if(r===null){var correspondingItem=Gimme.id(entityID+"_number");entityID=correspondingItem&&correspondingItem.parentNode.id.replace(/_pin$/,"");r=VE_SearchManager.GetEntity(entityID)}if(r!==null){CloseContextMenu();VE_SearchManager.SetLatLong(r.latitude,r.longitude);if(r.type!=VE_SearchType.Collection){var content=VE_SearchManager.CreatePopupContent(r,true);ero.setContent(content);ero.dockToRect(rect,null,-1)}else ShowCollectionPopup(new VE_CollectionSearchEroData(r),rect,null)}return}}function OnHardwareCapabilitiesUpdate(){if(typeof view3DMode!="undefined"&&view3DMode){map.Setup3DManifests();var a="3D performance option � ",b=map.Get3DControl().HardwareClassificationLevel;if(typeof b!="undefined"&&b!=null){switch(b){case 3:a+="Quality";break;case 2:a+="Balanced";break;case 1:a+="Performance"}$VE_A.Log($VE_A.PgName.Quality3D,a);UpdateStreetLevelGeometryState(map.Get3DControl())}}}function View3DMovePin(a){map.Get3DControl().PickupGeometry("UniqueLayer_Hack",a)}Msn.VE.FFSentinel=function(a){this.CurrentVersion=a};function GetSentinel(){if(window.navigator.userAgent.indexOf("MSIE")!=-1){var b;try{b=new ActiveXObject("Microsoft.SentinelVirtualEarth3DProxy.SentinelVE3DProxy")}catch(f){try{b=new ActiveXObject("Microsoft.SentinelVirtualEarth3D.SentinelVE3D")}catch(g){b=null}}return b}else if(typeof navigator.plugins!=undefined)for(var a=0;a<navigator.plugins.length;a++){var c=navigator.plugins[a].name.indexOf("Virtual Earth 3D");if(c>=0){var e=navigator.plugins[a].name.indexOf("plugin"),d=parseFloat(navigator.plugins[a].name.substring(c+17,e-1));return new Msn.VE.FFSentinel(d)}}return null}function HandleModeNotInstalled(b){if(b==Msn.VE.MapActionMode.Mode3D){map.EnableMode(Msn.VE.MapActionMode.Mode2D);var a=GetSentinel();if(a!=null)View3DDamaged();else if(window.navigator.userAgent.indexOf("Windows")!=-1)View3DInstall();else if(typeof ShowMessage!="undefined")ShowMessage(L_BrowserNotSupported3D_Text)}}function View3DInstall(){try{if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null)state.Set3DViewInstallInProgress("true");if(window.navigator.userAgent.indexOf("MSIE")!=-1)VE_Help.OpenSized(L_View3DHelpWindowTitle_Text,Get3dInstallUrl("Default.aspx?action=install&mkt="+Get3dMarket()),650,520);else VE_Help.OpenSized(L_View3DHelpWindowTitle_Text,Get3dInstallUrl("Default.aspx?action=install&mkt="+Get3dMarket()),680,540);var a=VE_Help.helpPanel.onCloseClick;VE_Help.helpPanel.onCloseClick=function(){$VE_A.Log($VE_A.PgName.Inst3D,"Install 3D > Return");a();VE_Help.helpPanel.onCloseClick=a}}catch(b){}}function View3DUpgrade(b){try{if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null)state.Set3DViewInstallInProgress("true");if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null)window.open(Get3dInstallUrl("Default.aspx?v="+b+"&mkt="+Get3dMarket()),"_blank","width=600,height=320,menubar=0,resizeable=0,status=0,titlebar=0,toolbar=0,scrollbars=0");else{VE_Help.OpenSized(L_View3DHelpWindowTitle_Text,Get3dInstallUrl("Default.aspx?v="+b+"&mkt="+Get3dMarket()),600,320);var a=VE_Help.helpPanel.onCloseClick;VE_Help.helpPanel.onCloseClick=function(){$VE_A.Log($VE_A.PgName.Inst3D,"Upgrade 3D > Cancel");a();VE_Help.helpPanel.onCloseClick=a}}}catch(c){}}function View3DDamaged(){try{VE_Help.Open("",Get3dHelpUrl("View3DUnavailable.htm"))}catch(a){}}function View3DSwitch(){if(map)map.EnableMode(Msn.VE.MapActionMode.Mode3D)}function Start3DView(){if(map){if(typeof ShowMessage!="undefined")ShowMessage(L_3DLoading_Text);window.setTimeout(View3DSwitch,200)}}function Start3DViewWhenUpgradeComplete(){if(map){var a=GetSentinel();if(a.CurrentVersion>=2.05080304000){if(typeof ShowMessage!="undefined")ShowMessage(L_3DLoading_Text);window.setTimeout(View3DSwitch,200)}else setTimeout(Start3DViewWhenUpgradeComplete,1500);a=null}}function NotifyWhen3DUpgraded(){if(map){var a=GetSentinel();if(a.CurrentVersion>=2.05080304000)if(map.GetDashboard()&&map.GetDashboard().DisplayThreeDUpdatedNotification)map.GetDashboard().DisplayThreeDUpdatedNotification();else{if(typeof ShowMessage!="undefined")ShowMessage(L_3DLoading_Text);window.setTimeout(View3DSwitch,200)}else setTimeout(NotifyWhen3DUpgraded,1500);a=null}}function PushpinURL(d,c){var a=vedomain+"/i/bin/"+window.buildVersion+"/";if(typeof d=="undefined"||d==null||!d)return a+"pins/red_circ7px.gif";var b=Msn.VE.PushPinTypes;switch(d){case b.Annotation:if(c=="shared")return a+"pins/poi_viewer.gif";else return a+"pins/poi_usergenerated.gif";case b.Overlay:if(c=="shared")return a+"pins/poi_cruncher_viewer.gif";else return a+"pins/poi_cruncher.gif";case b.SearchResultPrecise:if(c=="model"||c=="sharemodel")return a+"pins/modelpoi.gif";else if(c=="shared")return a+"pins/poi_title_viewer.gif";return a+"pins/poi_"+c+".gif";case b.SearchResultNonprecise:if(c=="model"||c=="sharemodel")return a+"pins/modelpoi.gif";else if(c=="shared")return a+"pins/poi_title_viewer.gif";return a+"pins/poi_search_nonprecise.gif";case b.Collection:return a+"pins/poi_"+c+".gif";case b.AdSponsor:return a+"pins/poi_search.gif";case b.DirectionStep:return a+"pins/poi_direction_step.png";case b.Direction:case b.DirectionTemp:return a+"pins/mapicon_"+c+".gif";case b.TrafficOthers:return a+"Traffic/Traffic"+c+".gif";case b.YouAreHere:return a+"pins/poi_youarehere.gif";case b.Default:return a+"pins/"+c;case b.Context:return a+"pins/red_circ7px.gif";case b.AdRoofStandard:case b.AdRoofWide:case b.AdStandard:case b.AdWide:case b.AdCategory:return c}return a+"pins/poi_usergenerated.gif"}function _VEExtractImgUrlFromHtml(d){var b=null,a=document.createElement("div");a.innerHTML=d;var c=a.getElementsByTagName("img");if(c.length>=1)b=c[0].getAttribute("src");a=null;return b}var _VEHtmlToImgUrlHash=[];function TranslatePushpinURL(d,f,g){var a=Msn.VE.PushPinTypes,h,c=null;switch(g){case a.Direction:case a.DirectionTemp:var e=/mapicon_(start|end).gif/g,b=e.exec(f);if(b!=null&&b.length>=2){c=b[1];break}else return vedomain+_VEExtractImgUrlFromHtml(f);case a.SearchResultPrecise:case a.SearchResultNonprecise:case a.Collection:var e=/VE_Pushpin VE_Pushpin_(.*)/g,b=e.exec(d);if(b!=null&&b.length>=2)c=b[1];break;case a.TrafficOthers:if(typeof _VEHtmlToImgUrlHash[d]=="string")c=_VEHtmlToImgUrlHash[d];else{var e=new RegExp(/VE_Pushpin VE_Traffic_(.*)/g),b=e.exec(d);if(b!=null&&b.length>=2){c=b[1];_VEHtmlToImgUrlHash[d]=c}e=null}break;case a.AdRoofStandard:case a.AdRoofWide:case a.AdStandard:case a.AdWide:case a.AdCategory:c=_VEExtractImgUrlFromHtml(f)}var h=PushpinURL(g,c);return h}var _VE_previousShapeId=null;function RaiseMouseEvent3D(info,mapGuid,eventName){try{var alt=null,rX1=null,rY1=null,rX2=null,rY2=null,lat=null,lon=null,layerId=null,shapeId=null,button="None";eval(info);if(shapeId!=null){var isAPI=typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null;if(eventName=="onclick"||!isAPI&&eventName=="onmouseover"&&shapeId.indexOf(_entityIdShapePostfix)>0&&_VE_previousShapeId!=shapeId){if(typeof VE_Annotations!="undefined")if(VE_Annotations.PanelOpen)return;_VE_previousShapeId=shapeId;Process3DPushpinHover(layerId,shapeId,rX1,rY1,rX2,rY2,mapGuid)}else if(!isAPI&&eventName=="onmouseout"&&shapeId.indexOf(_entityIdShapePostfix)>0){VE_MapManager.HighlightEntity(false);_VE_previousShapeId=null}}var mapcontrolinstance=GetMapControlInstance(mapGuid);if(mapcontrolinstance==null)return;var clickEvent=mapcontrolinstance.CreateEvent(lat==null||lon==null?null:new Msn.VE.LatLong(lat,lon),null,null,null,shapeId,button,alt);mapcontrolinstance.Fire(eventName,clickEvent)}catch(a){}}function OnMouseDown3D(b,a){RaiseMouseEvent3D(b,a,"onmousedown")}function OnMouseUp3D(b,a){__shapeIdBeingDragged=null;RaiseMouseEvent3D(b,a,"onmouseup")}function OnClick3D(b,a){RaiseMouseEvent3D(b,a,"onclick")}function OnMouseOver3D(b,a){RaiseMouseEvent3D(b,a,"onmouseover")}function OnMouseOut3D(b,a){ero.hide();RaiseMouseEvent3D(b,a,"onmouseout")}function OnDoubleClick3D(b,a){RaiseMouseEvent3D(b,a,"ondoubleclick")}function OnChangeMapStyle3D(){var a=GetMapControlInstance();if(a){var b=a.Get3DControl();UpdateStreetLevelGeometryState(b)}}function GetMapControlInstance(b){if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null)return map;var a=GetVEMapInstance(b);if(a==null)return null;return a.vemapcontrol}function GetVEMapInstance(a){if(typeof a=="undefined"||a==null){if(Msn.VE.API==null||Msn.VE.API=="undefined"||Msn.VE.API.Globals.vemapinstances==null||Msn.VE.API.Globals.vemapinstances=="undefined")return null;var c=0;for(var b in Msn.VE.API.Globals.vemapinstances)if(Msn.VE.API.Globals.vemapinstances[b]instanceof VEMap&&Msn.VE.API.Globals.vemapinstances[b].GetMapMode()==VEMapMode.Mode3D){c++;a=b}if(c!=1)return null}return VEMap._GetMapFromGUID(a)}VE_3DPlugin={MovieRecorderGuid:"791BC97B-7526-4C74-85DB-8CC220E3A65E",PhotoGuid:"B1FC67C1-F8CE-4CA5-A957-B5FF2215037B",PhotoManifest:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=99342"),PhotoUrl:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=98905"),GeoCommunityGuid:"49D0BC0C-67A7-44CD-93BA-C7CF6F20EAB9",GeoCommunityManifest:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=99343"),GeoCommunityUrl:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=98904"),StreetLevelGeometryGuid:"C9F0B259-0B78-464A-BEC4-B4E90CF0BC8D",StreetLevelGeometryManifest:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=111353"),StreetLevelGeometryUrl:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=109495")};var VE_3DPhotoPluginObj=0,VE_3DGeoCommunityPluginObj=0,VE_3DStreetLevelGeometryObj=0,PluginEventRegistered=0,PhotoPluginEventRegistered=0,GeoCommunityPluginEventRegistered=0,StreetLevelGeometryEventRegistered=0,VE3DVIASavedAction=0;function GetVE3DVIAInstallState(a){if(!a){a=map.Get3DControl();if(!a)return 0}return a.GetComponentInstallState("EE3B731B-969E-4cb6-8949-ADFDC763A547")}function OnVE3DVIAInstallEnd(){if(VE3DVIASavedAction!=0){ProcessModelIn3DEx(VE3DVIASavedAction.actionType,VE3DVIASavedAction.properties,VE3DVIASavedAction.control,"Feature is currently not available. Please try again later.");VE3DVIASavedAction=0}}function ProcessModelRequire3DVIA(b,c,a){if(typeof b=="undefined"||b==null)return;if(!a){a=map.Get3DControl();if(!a)return}if(GetVE3DVIAInstallState()==2)ProcessModelIn3DEx(b,c,a,"Feature is currently not available. Please try again later.");else{if(!VE3DVIASavedAction)VE3DVIASavedAction={};VE3DVIASavedAction.actionType=b;VE3DVIASavedAction.properties=c;VE3DVIASavedAction.control=a;OnSetupVE3DVIA()}}function ProcessModelIn3D(b,c,d){var a="Unable to display 3D models in collections at this time. Please try again later.";if(VE_ModelActionType.DeleteModel==b)a="";ProcessModelIn3DEx(b,c,d,a)}function ProcessModelIn3DEx(b,d,a,c){if(typeof b=="undefined"||b==null)return;if(!a){a=map.Get3DControl();if(!a)return}if(!VE_3DGeoCommunityPluginObj)VE_3DGeoCommunityPluginObj=CreatePluginObj(a,VE_3DPlugin.GeoCommunityGuid,VE_3DPlugin.GeoCommunityManifest,VE_3DPlugin.GeoCommunityUrl);if(!GeoCommunityPluginEventRegistered){a.AttachPlugInEvent(VE_3DPlugin.GeoCommunityGuid,"OnRefreshModel","OnRefreshModel");a.AttachPlugInEvent(VE_3DPlugin.GeoCommunityGuid,"OnLaunchVE3DVIA","OnLaunchVE3DVIA");GeoCommunityPluginEventRegistered=1}FirePluginEventIn3D(VE_3DGeoCommunityPluginObj,b,d,a,c)}function ProcessPhotoPluginActionIn3D(b,c,a){if(typeof b=="undefined"||b==null)return;if(!a){a=map.Get3DControl();if(!a)return}if(!VE_3DPhotoPluginObj)VE_3DPhotoPluginObj=CreatePluginObj(a,VE_3DPlugin.PhotoGuid,VE_3DPlugin.PhotoManifest,VE_3DPlugin.PhotoUrl);if(!PhotoPluginEventRegistered){a.AttachPlugInEvent(VE_3DPlugin.PhotoGuid,"OnSelectPhoto","OnSelectPhoto");a.AttachPlugInEvent(VE_3DPlugin.PhotoGuid,"OnActivate","OnActivate");a.AttachPlugInEvent(VE_3DPlugin.PhotoGuid,"OnCameraPan","OnPhotoCameraPan");a.AttachPlugInEvent(VE_3DPlugin.PhotoGuid,"OnCameraZoom","OnPhotoCameraZoom");a.AttachPlugInEvent(VE_3DPlugin.PhotoGuid,"OnPhotoStateChanged","OnPhotoStateChanged");PhotoPluginEventRegistered=1}FirePluginEventIn3D(VE_3DPhotoPluginObj,b,c,a,null)}function AllowStreetLevelGeometry(a){if(!a)return false;var c=GetMapControlInstance(null),d=a.HardwareClassificationLevel,b=c.GetMapStyle();return d==3&&(b=="a"||b=="h")}function LoadStreetLevelGeometry(a){if(!VE_3DStreetLevelGeometryObj)if(a&&AllowStreetLevelGeometry(a)){VE_3DStreetLevelGeometryObj=CreatePluginObj(a,VE_3DPlugin.StreetLevelGeometryGuid,VE_3DPlugin.StreetLevelGeometryManifest,VE_3DPlugin.StreetLevelGeometryUrl);if(VE_3DStreetLevelGeometryObj){VE_3DStreetLevelGeometryObj.Loading=1;a.LoadPlugInDll(VE_3DStreetLevelGeometryObj.Url)}}}function ActivateStreetLevelGeometry(a){if(AllowStreetLevelGeometry(a))if(!VE_3DStreetLevelGeometryObj)LoadStreetLevelGeometry(a);else if(VE_3DStreetLevelGeometryObj.Loaded&&!VE_3DStreetLevelGeometryObj.Activated)if(a)a.ActivatePlugIn(VE_3DStreetLevelGeometryObj.Guid,VE_3DStreetLevelGeometryObj.Manifest)}function DeactivateStreetLevelGeometry(a){if(VE_3DStreetLevelGeometryObj)if(VE_3DStreetLevelGeometryObj.Loaded&&VE_3DStreetLevelGeometryObj.Activated&&!AllowStreetLevelGeometry(a))if(a)a.DeactivatePlugIn(VE_3DStreetLevelGeometryObj.Guid)}function UpdateStreetLevelGeometryState(a){var b=AllowStreetLevelGeometry(a);if(b){if(!VE_3DStreetLevelGeometryObj.Activated)ActivateStreetLevelGeometry(a)}else if(VE_3DStreetLevelGeometryObj.Activated)DeactivateStreetLevelGeometry(a)}function CreatePluginObj(b,d,c,e){if(!PluginEventRegistered){b.AttachEvent("OnPlugInLoaded","On3DPlugInLoaded");b.AttachEvent("OnPlugInActivated","On3DPlugInActivated");b.AttachEvent("OnPlugInDeactivated","On3DPlugInDeactivated");PluginEventRegistered=1}var a={};a.Loaded=0;a.Loading=0;a.Activated=0;a.actionCounter=0;a.actionType=[];a.properties=[];a.control=[];a.errorMessage=[];a.Guid=d.toUpperCase();a.Manifest=c;a.Url=e;return a}function FirePluginEventIn3D(a,c,d,b,e){if(a.Activated)b.RaiseEvent(a.Guid,c,d);else{if(!a.Loaded&&!a.Loading){a.Loading=1;b.LoadPlugInDll(a.Url)}QueuePluginEvent(a,c,d,b,e)}}function QueuePluginEvent(a,c,d,e,b){a.actionType[a.actionCounter]=c;a.properties[a.actionCounter]=d;a.control[a.actionCounter]=e;a.errorMessage[a.actionCounter]=b;a.actionCounter=a.actionCounter+1}function FireErrorMessage(b){var a,c;for(a=0;a<b.actionCounter;a=a+1){if(b.errorMessage[a]==null||b.errorMessage[a].length==0)continue;var d=false;for(c=0;c<a;c=c+1)if(b.errorMessage[a]==b.errorMessage[c]){d=true;break}if(!d)VE_MessageControl._AddMessage(b.errorMessage[a])}}function PostLoadPlugin(b,a,c){a.Loading=0;if(!a.Loaded)if(c){a.Loaded=1;b.ActivatePlugIn(a.Guid,a.Manifest)}else{if(a.Guid==VE_3DPlugin.GeoCommunityGuid)FireErrorMessage(a);else VE_MessageControl._AddMessage("Feature is currently not available. Please try again later.",3000);a.actionCounter=0}}function PostActivatePlugin(c,a,d){if(d){a.Activated=1;var b;for(b=0;b<a.actionCounter;b=b+1)if(c==a.control[b])c.RaiseEvent(a.Guid,a.actionType[b],a.properties[b])}else if(a.Guid==VE_3DPlugin.GeoCommunityGuid)FireErrorMessage(a);else VE_MessageControl._AddMessage("Feature is currently not available. Please try again later.",3000);a.actionCounter=0}function On3DPlugInLoaded(info,mapGuid){var guid,success;eval(info);if(typeof guid!="undefined"&&guid!=null)guid=guid.toUpperCase();var mapcontrolinstance=GetMapControlInstance(mapGuid);if(mapcontrolinstance){var spacecontrol=mapcontrolinstance.Get3DControl();if(guid==VE_3DPlugin.PhotoGuid)PostLoadPlugin(spacecontrol,VE_3DPhotoPluginObj,success);else if(guid==VE_3DPlugin.GeoCommunityGuid)PostLoadPlugin(spacecontrol,VE_3DGeoCommunityPluginObj,success);else if(guid==VE_3DPlugin.StreetLevelGeometryGuid)if(success&&!VE_3DStreetLevelGeometryObj.Loaded){VE_3DStreetLevelGeometryObj.Loaded=1;ActivateStreetLevelGeometry(spacecontrol)}}}function On3DPlugInActivated(info,mapGuid){var guid,success;eval(info);if(typeof guid!="undefined"&&guid!=null)guid=guid.toUpperCase();var mapcontrolinstance=GetMapControlInstance(mapGuid);if(mapcontrolinstance){var spacecontrol=mapcontrolinstance.Get3DControl();if(guid==VE_3DPlugin.PhotoGuid)PostActivatePlugin(spacecontrol,VE_3DPhotoPluginObj,success);else if(guid==VE_3DPlugin.GeoCommunityGuid)PostActivatePlugin(spacecontrol,VE_3DGeoCommunityPluginObj,success);else if(guid==VE_3DPlugin.StreetLevelGeometryGuid)PostActivatePlugin(spacecontrol,VE_3DStreetLevelGeometryObj,success)}}function On3DPlugInDeactivated(info,mapGuid){var guid,success;eval(info);guid=guid.toUpperCase();if(guid==VE_3DPlugin.PhotoGuid&&success)VE_3DPhotoPluginObj.Activated=0;else if(guid==VE_3DPlugin.GeoCommunityGuid&&success)VE_3DGeoCommunityPluginObj.Activated=0;else if(guid==VE_3DPlugin.StreetLevelGeometryGuid&&success)VE_3DStreetLevelGeometryObj.Activated=0}function OnPhotoStateChanged(info,mapGuid){var map=GetMapControlInstance(mapGuid);if(map==null)return;var ev=map.CreateEvent(),enabled;eval(info);ev.enabled=enabled;map.Fire("onve3dphotostatechanged",ev)}function OnLaunchVE3DVIA(){VE_MessageControl._AddMessage("Launching Virtual Earth - 3DVIA (Beta)",5000)}var __vemapcontrolisReady=true;if(!window.__DEP_COL_HASH)window.__DEP_COL_HASH=[];function openDependency(c,g){var d=false,a=__DEP_COL_HASH[c];if(!a){a=new f(c,g);var b=__DEP_COL_HASH.push(a);__DEP_COL_HASH[c]=__DEP_COL_HASH[b-1]}if(a.isClosed)a.reset();var b,i=arguments.length;for(b=2;b<i;b++){var e=arguments[b];if(!a.dependencyExists(e))a.addDependency(new h(e));else d=true}return!d;function h(a){this.id=a;this.isReady=false}function f(c,d){var a=[],b=d,e=false;this.key=c;this.isClosed=false;this.addDependency=function(b){var c=a.push(b);a[b.id]=a[c-1]};this.dependencyExists=function(b){return a[b]!=null};this.getDependencies=function(){return a};this.executeCallback=function(){if(typeof b=="function")b.call()};this.reset=function(){this.isClosed=false;a=[]}}}function closeDependency(f){var b,h=__DEP_COL_HASH.length;a:for(b=0;b<h;b++){var a=__DEP_COL_HASH[b],d=a.getDependencies(),e=d[f];if(typeof e!="undefined"&&e!=null){e.isReady=true;if(!a.isClosed){var c,g=d.length;for(c=0;c<g;c++)if(!d[c].isReady)continue a;a.isClosed=true;a.executeCallback()}}}}var CompatVersion="";if(typeof VEAPI_DisableAtlasCompat=="undefined"||!VEAPI_DisableAtlasCompat)VEAPI_DisableAtlasCompat=navigator.userAgent.indexOf("KHTML")!==-1;function disable_text_selection(a){if(typeof a==="undefined")return;a.onselectstart=function(){return false};a.onmousedown=function(){return false};a.unselectable="on";a.style.MozUserSelect="none";a.style.cursor="default"}_VERegisterNamespaces("Web.Browser","Web.Debug.Performance");if(!Web.Debug.Enabled){Web.Debug.Enabled=false;Web.Debug.Assert=Web.Debug.Trace=function(){};Web.Debug.Performance.Start=function(){this.End=function(){};return this}}Web.Browser.isSafari=function(){return navigator.userAgent.indexOf("KHTML")!==-1};Web.Browser.GetWebKitVersion=function(){var b=NaN,a=/ AppleWebKit\/([^ ]+)/.exec(navigator.userAgent);if(a&&a.length==2)b=parseInt(a[1]);Web.Browser.GetWebKitVersion=function(){return b};return b};Web.Browser.isSafari2=function(){return Web.Browser.GetWebKitVersion()<500};Web.Browser.isSafari3=function(){return Web.Browser.GetWebKitVersion()>=500};Web.Browser.AttachSafariCompatibility=function(a){if(Web.Browser.isSafari2())try{document.getElementsByTagName("HTML")[0]}catch(s){}a.CollectGarbage=function(){};Web.Browser.Button={LEFT:0,RIGHT:2,MIDDLE:1};function i(a){window.event=a}function q(b,c,d){var a=c.slice(2);if(a!=="mouseenter"&&a!=="mouseleave")b.addEventListener(a,i,true);else{b.addEventListener("mouseover",i,true);b.addEventListener("mouseout",i,true)}b.addEventListener(a,d,false)}function p(d,b,c){var a=b.slice(2);if(b==="mousewheel")a="DOMMouseScroll";d.removeEventListener(a,c,false)}function j(a,b){if(a==="onclick")a="onmouseup";q(this,a,b)}function k(a,b){if(a==="onclick")a="onmouseup";p(this,a,b)}if(Web.Browser.isSafari2())if(typeof a["[[DOMDocument.prototype]]"]==="undefined"||typeof a["[[DOMElement.prototype]]"]==="undefined"){Object.prototype.attachEvent=j;Object.prototype.detachEvent=k}else{a.attachEvent=a["[[DOMDocument.prototype]]"].attachEvent=a["[[DOMElement.prototype]]"].attachEvent=j;a.detachEvent=a["[[DOMDocument.prototype]]"].detachEvent=a["[[DOMElement.prototype]]"].detachEvent=k}else if(Web.Browser.isSafari3()){a.attachEvent=a.HTMLDocument.prototype.attachEvent=a.HTMLElement.prototype.attachEvent=j;a.detachEvent=a.HTMLDocument.prototype.detachEvent=a.HTMLElement.prototype.detachEvent=k}var g=false;function c(a){if(g){a.preventDefault();a.returnValue=false;document.removeEventListener(a.type,c,true);a.capturedTarget=a.target;g.dispatchEvent(a);delete a.captureTarget;if(g)document.addEventListener(a.type,c,true);a.stopPropagation()}}function b(a){a.stopPropagation();a.preventDefault()}function o(){g=this;document.addEventListener("mousemove",c,true);document.addEventListener("mouseover",b,true);document.addEventListener("mouseout",b,true);document.addEventListener("mouseenter",b,true);document.addEventListener("mouseleave",b,true);document.addEventListener("mouseup",c,true)}function m(){g=null;document.removeEventListener("mousemove",c,true);document.removeEventListener("mouseover",b,true);document.removeEventListener("mouseout",b,true);document.removeEventListener("mouseenter",b,true);document.removeEventListener("mouseleave",b,true);document.removeEventListener("mouseup",c,true)}if(Web.Browser.isSafari2()){var n=0;function l(){if(typeof a["[[DOMElement.prototype]]"]==="undefined"){if(n<100){n++;setTimeout(l,100)}}else{a["[[DOMElement.prototype]]"].setCapture=o;a["[[DOMElement.prototype]]"].releaseCapture=m}}l()}else if(Web.Browser.isSafari3()){a.HTMLElement.prototype.setCapture=o;a.HTMLElement.prototype.releaseCapture=m}function h(){}function d(){}var f=null,e=null;if(Web.Browser.isSafari2()){h=function(e,c,b){var a=d(e,c,b);if(a.length>0)return a[0];else return null};d=function(g,e,d){var c=d.getElementsByTagName(e),b=[],a,f=c.length;for(a=0;a<f;a++)b.push(c[a]);return b};f=typeof a["[[DOMDocument.prototype]]"]!=="undefined"?a["[[DOMDocument.prototype]]"]:Object.prototype;e=typeof a["[[DOMElement.prototype]]"]!=="undefined"?a["[[DOMElement.prototype]]"]:Object.prototype}else if(Web.Browser.isSafari3()){h=function(e,a,c){a+="[1]";var b=d(e,a,c);if(b.length>0)return b[0];else return null};d=function(b,f,e){var d=b.evaluate(f,e,b.createNSResolver(b.documentElement),XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),c=[],a,g=d.snapshotLength;for(a=0;a<g;a++)c.push(d.snapshotItem(a));return c};if(typeof document.implementation!=="undefined"&&typeof document.implementation.createDocument!=="undefined")f=document.implementation.createDocument("ns","root",null).constructor.prototype;if(typeof Element!=="undefined")e=Element.prototype}if(f){f.selectNodes=function(a){return d(this,a,this)};f.selectSingleNode=function(a){return h(this,a,this)}}if(e){e.selectNodes=function(b){var a=this.ownerDocument;if(a.selectNodes)return d(a,b,this);else return null};e.selectSingleNode=function(b){var a=this.ownerDocument;if(a.selectSingleNode)return h(a,b,this);else return null}}};if(Web.Browser.isSafari()){Web.Browser.AttachSafariCompatibility(window);var divs=document.getElementsByTagName("div"),i,len=divs.length;for(i=0;i<len;i++)divs[i].onselectstart=function(){return false};if(Web.Browser.isSafari2())Msn.Drawing.SvgLayer=function(i,d){function g(b){var c="http://www.w3.org/1999/xhtml",a=document.createElementNS(c,"canvas");a.setAttribute("id",b);disable_text_selection(a);a.setAttribute("width",d.GetMapWidth());a.setAttribute("height",d.GetMapHeight());a.style.position="absolute";a.style.top="0px";a.style.left="0px";return a}var c=d,b=null,h=false,k=false,j=true;if(h===false){h=true;b=document.createElement("div");b.setAttribute("height","100%");b.setAttribute("width","100%");i.appendChild(b);this.lineDashStyles=[];var a=this.lineDashStyles;a[0]=["Solid","none"];a[1]=["ShortDash","6,2"];a[2]=["ShortDot","2,2"];a[3]=["ShortDashDot","6,2,2,2"];a[4]=["ShortDashDotDot","6,2,2,2,2,2"];a[5]=["Dot","2,6"];a[6]=["Dash","10,6"];a[7]=["LongDash","20,6"];a[8]=["DashDot","10,6,2,6"];a[9]=["LongDashDot","20,6,2,6"];a[10]=["LongDashDotDot","20,6,2,6,2,6"]}this.addShape=function(d){if(b===null)return;var j=null;if(d.type===MC_GEO_TYPE_POINT){j=g(d.id!==0?d.id:d.iid);b.appendChild(j);var a=j.getContext("2d"),n=k.x-6,o=k.y-6,m=12,k=12;a.fillStyle=d.symbol.fill_color;a.strokeStyle=d.symbol.stroke_color;a.lineWidth=d.symbol.stroke_weight;a.beginPath();a.rect(n,o,m,k);a.closePath();a.fill();a.stroke()}else if(d.type===MC_GEO_TYPE_POLYLINE||d.type===MC_GEO_TYPE_POLYGON){j=g(d.id!==0?d.id:d.iid);b.appendChild(j);var a=j.getContext("2d");if(d.type===MC_GEO_TYPE_POLYGON)a.fillStyle=f(d.symbol.fill_color,e(d.symbol.fill_opacity));else a.fillStyle="";a.strokeStyle=f(d.symbol.stroke_color,e(d.symbol.stroke_opacity));a.lineWidth=parseInt(d.symbol.stroke_weight);var i=GetSvgPath(c,d.points).split(/[\s,]+/),h,l=i.length;if(d.type===MC_GEO_TYPE_POLYGON){a.beginPath();a.moveTo(Number(i[0]),Number(i[1]));for(h=2;h<l;h+=2)a.lineTo(Number(i[h]),Number(i[h+1]));a.closePath();a.fill()}a.beginPath();a.moveTo(Number(i[0]),Number(i[1]));for(h=2;h<l;h+=2)a.lineTo(Number(i[h]),Number(i[h+1]));a.stroke()}return j};this.SetZIndex=function(a){if(!c.bShowSVG)return;c.GetsvgDiv().style.zIndex=a};this.UpdatePoints=function(a){if(a.type==VEShapeType.Polyline||a.type==VEShapeType.Polygon){var b=$ID(a.id!==0?a.id:a.iid);if(b.parentNode)b.parentNode.removeChild(b);this.addShape(a)}return a};this.UpdateStyle=this.UpdatePoints;function f(b,c){if(b.length==7&&c){var a=[];a.push("rgba(");a.push(parseInt(b.substring(1,3),16));a.push(",");a.push(parseInt(b.substring(3,5),16));a.push(",");a.push(parseInt(b.substring(5,7),16));a.push(",");a.push(c);a.push(")");return a.join("")}else return b}function e(a){a+="";if(a.indexOf("%")>1){a=parseInt(a);if(a===NaN)a=.3;else a/=100}return a}}}var windowWidth=0,windowHeight=0,scrollbarWidth=null;function $ID(a){var b=document;return b.getElementById(a)}function $CE(a){var b=document;return b.createElement(a)}function $CENS(a){var b=document;return b.createElementNS(a)}function GetWindowWidth(){var a=0;if(typeof window.innerWidth=="number")a=window.innerWidth;else if(document.documentElement&&document.documentElement.clientWidth)a=document.documentElement.clientWidth;else if(document.body&&document.body.clientWidth)a=document.body.clientWidth;if(!a||a<100)a=100;return a}function GetWindowHeight(){var a=0;if(typeof window.innerHeight=="number")a=window.innerHeight;else if(document.documentElement&&document.documentElement.clientHeight)a=document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)a=document.body.clientHeight;if(!a||a<100)a=100;return a}function GetScrollbarWidth(){if(scrollbarWidth)return scrollbarWidth;if(navigator.userAgent.indexOf("IE")>=0){var a=document.createElement("div"),b=null;a.style.visible="hidden";a.style.overflowY="scroll";a.style.position="absolute";a.style.width=0;document.body.insertAdjacentElement("afterBegin",a);b=a.offsetWidth;a.parentNode.removeChild(a);if(!b)b=16;scrollbarWidth=b;return b}else return 0}function GetUrlPrefix(){var a=window.location.pathname.lastIndexOf("/"),b=window.location.protocol+"//"+window.location.hostname+window.location.pathname.substring(0,a+1);return b}function GetUrlParameterString(){var a=window.location.search;if(a.length==0||a.indexOf("?")==-1)return"";return a.substr(a.indexOf("?")+1)}function CheckWipExistence(){var a=GetUrlParameterString();if(a!=""&&a.indexOf("wip=")>-1)return true;return false}function GetUrlParameters(){var b=[],d=GetUrlParameterString();if(!d)return b;var e=d.split("&");for(var c=0;c<e.length;c++){var a=e[c].split("=");if(a.length==2&&a[0]&&a[1]){b.push(unescape(a[0]));b.push(unescape(a[1]))}}return b}function ParseShiftKeyForLinks(a){if(a.shiftKey)return false;return true}_VERegisterNamespaces("Msn.VE.API.Globals");_VERegisterNamespaces("Msn.VE.API.Constants");Msn.VE.API.Globals.vemapinstances=null;Msn.VE.API.Globals.veonbegininvokeevent=null;Msn.VE.API.Globals.veonendinvokeevent=null;Msn.VE.API.Globals.vefindresultsnpanel=null;Msn.VE.API.Globals.language=CultureInfo["Language"];Msn.VE.API.Globals.locale=CultureInfo["Name"];Msn.VE.API.Globals.vecurrentversion="6.1.20080306152009.13";Msn.VE.API.Globals.ishttpsenabled=false;Msn.VE.API.Globals.protocol=Msn.VE.API.Globals.ishttpsenabled?"https://":"http://";Msn.VE.API.Globals.vecurrentdomain="http://dev.virtualearth.net/mapcontrol/v6.2";Msn.VE.API.Globals.veanalyticsenabled="__analyticsenabled__";Msn.VE.API.Globals.veomnitureaccount="__omnitureaccount__";Msn.VE.API.Globals.vedebug=false;Msn.VE.API.Globals.analyticsInitialized=false;var VE_MapDispatch_SymbolLib=null;Msn.VE.API.Constants.orthotileserver="http://imakm%2.maplink3.com.br/MapaVE.aspx?v=%1|%2|%3|%4|%5|%6";Msn.VE.API.Constants.obliquetileserver="%0t%3.tiles.virtualearth.net/tiles/o%4-%5-%6-%7.jpeg?g=%8".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.obliquehybridtileserver="%0t%3.tiles.virtualearth.net/tiles/cmd/ObliqueHybrid?a=%4-%5-%6-%7&g=%8".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.obliquethumbnailtileserver="%0t%1.tiles.virtualearth.net/tiles/ot%2.jpeg?g=%3".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.shadedtileserver="%0t%2.tiles.virtualearth.net/tiles/%3%4.%5?g=%6&shading=hill".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.traffictileserver="%0t%2.tiles.virtualearth.net/tiles/t%4".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.imageryurl="%0dev.virtualearth.net/services/v1/ImageryMetadataService/ImageryMetadataService.asmx".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.collectionservice="%0maps.live.com/GeoCommunity.aspx".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.searchservice="%0dev.virtualearth.net/legacyService/search.ashx".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.legacyrouteservice="%0dev.virtualearth.net/legacyService/directions.ashx".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.routeservice="%0dev.virtualearth.net/services/v1/RouteService/RouteService.asmx".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.obliquecalcservice="%0dev.virtualearth.net/legacyService/ElevatedLoc.ashx".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.geocodingservice="%0dev.virtualearth.net/services/v1/geocodeservice/geocodeservice.asmx".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.iconurl=Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+"/pins/poi_usergenerated.gif";Msn.VE.API.Constants.atlascompatjs=Msn.VE.API.Globals.vecurrentdomain+"/js/atlascompat.js";Msn.VE.API.Constants.stylesheet=Msn.VE.API.Globals.vecurrentdomain+"/css/bin/"+Msn.VE.API.Globals.vecurrentversion+"/"+Msn.VE.API.Globals.language+"/mapcontrol.css";Msn.VE.API.Constants.stylesheetiev6=Msn.VE.API.Globals.vecurrentdomain+"/css/bin/"+Msn.VE.API.Globals.vecurrentversion+"/"+Msn.VE.API.Globals.language+"/mapcontroliev6.css";Msn.VE.API.Constants.vedirectionsstarticon=Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+"/pins/mapicon_start.gif";Msn.VE.API.Constants.vedirectionsendicon=Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+"/pins/mapicon_end.gif";Msn.VE.API.Constants.vedirectionsstepicon=Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+"/pins/RedCircle%1.gif";Msn.VE.API.Constants.trafficiconurl=Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+"/Traffic/Traffic%1.gif";Msn.VE.API.Constants.spacerurl=Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+"/spacer.gif";Msn.VE.API.Constants.mapguid="mapguid";Msn.VE.API.Constants.rim="rim";Msn.VE.API.Constants.rimargs="rimargs";Msn.VE.API.Constants.contextid="contextid";Msn.VE.API.Constants.clienttoken="token";Msn.VE.API.Constants.market="mkt";Msn.VE.API.Constants.culture="culture";Msn.VE.API.Constants.format="format";Msn.VE.API.Constants.json="json";Msn.VE.API.Constants.requestid="rid";Msn.VE.API.Globals.vemapmode=Msn.VE.MapActionMode.Mode2D;Msn.VE.API.Globals.vemapheight=400;Msn.VE.API.Globals.vemapwidth=600;Msn.VE.API.Globals.vemapzoom=4;Msn.VE.API.Globals.vemaplatitude=43.75;Msn.VE.API.Globals.vemaplongitude=-99.71;Msn.VE.API.Globals.vemapstyle="r";Msn.VE.API.Globals.vemaxzoom=26;Msn.VE.API.Globals.vetilesize=256;Msn.VE.API.Globals.vepushpinpanelzIndex=999;Msn.VE.API.Globals.veshapeiconzindex=1000;Msn.VE.API.Globals.veshapepolyshapezindex=50;Msn.VE.API.Globals.vetilelayerdefaultzindex=2;Msn.VE.API.Globals.vemessagepanelheight=75;Msn.VE.API.Globals.vemessagepanelzIndex=99;Msn.VE.API.Globals.veplacelistpanelheight=200;Msn.VE.API.Globals.veplacelistpanelwidth=350;Msn.VE.API.Globals.veplacelistpanelzIndex=300;Msn.VE.API.Globals.vefindresultsnpanelwidth=200;Msn.VE.API.Globals.vefindresultsnpanelzIndex=99;Msn.VE.API.Globals.vefindresultsnpanelcolor="blue";Msn.VE.API.Globals.veiscommercialcontrol=false;Msn.VE.API.Globals.veobliqueMode=null;Msn.VE.API.Constants.maxasynlatlongs=50;Msn.VE.API.Globals.vefindnumresultsdefault=10;Msn.VE.API.Globals.vefindnumresultsmin=1;Msn.VE.API.Globals.vefindnumresultsmax=20;Msn.VE.API.Globals.Dispose=function(){Msn.VE.API.Globals.veonbegininvokeevent=null;Msn.VE.API.Globals.veonendinvokeevent=null;Msn.VE.API.Globals.vefindresultsnpanel=null};Msn.VE.API.Globals.PosX=function(a){var b=0;if(!a)var a=window.event;if(a.pageX)b=a.pageX;else if(a.clientX)b=a.clientX+document.body.scrollLeft;return b};Msn.VE.API.Globals.PosY=function(a){var b=0;if(!a)var a=window.event;if(a.pageY)b=a.pageY;else if(a.clientY)b=a.clientY+document.body.scrollTop;return b};function VE_Help(){}_VERegisterNamespaces("Msn.VE.Constants.Css");var MSVE_header=document.getElementsByTagName("body")[0],VE_ContextMenu=null;s_account=Msn.VE.API.Globals.veomnitureaccount;var Gimme={};(function(){var e=navigator.userAgent.toLowerCase();Gimme.Browser={isIE:typeof ActiveXObject!=="undefined",isOpera:typeof window.opera!=="undefined",isKHTML:e.indexOf("khtml")!==-1,isGecko:e.indexOf("khtml")===-1&&e.indexOf("gecko")!==-1,isInIFrame:function(){try{return window.frameElement&&window.frameElement.tagName==="IFRAME"}catch(a){return true}}(),isInFrameset:window!=top,isInQuirksMode:document.compatMode==="BackCompat"};Gimme.id=function(a){return $ID(a)};Gimme.query=function(e,z,w){if(!e)return[];if(e instanceof Array)return e;if(typeof e!=="string")return[e];var B=[];e=k(e).replace(/\s*(\+|>|~|,)\s*/g,"$1");var h=p(e),v=h.length,m=q(h[v-1],z);passed=true;var C,u,s,c,l,r,j,d,o=0,f=0,t=0,x=m.length;while(o<x){t=0;u=true;d=c=s=m[o];a:for(f=v-3;f>=0;f-=2){var y=h[f+1],b=h[f];switch(y){case" ":d=d.parentNode;while(d&&d!==document){if(a(d,b.id,b.tag,b.classes,b.attributes,b.pseudos)){c=d;continue a}d=d.parentNode}passed=false;break a;case">":while(j!==document){j=c.parentNode;if(a(j,b.id,b.tag,b.classes,b.attributes,b.pseudos)){c=j;continue a}else if(h[f+3]!==" ")break;c=j}passed=false;break a;case"+":l=i(c,-1);if(l)if(a(l,b.id,b.tag,b.classes,b.attributes,b.pseudos)){c=l;continue a}passed=false;break a;case"~":r=c.parentNode.childNodes;var A=r.length;while(t<A){var n=r[t++];if(n.nodeType===3)continue;if(n===s){u=false;break}if(a(n,b.id,b.tag,b.classes,b.attributes,b.pseudos)){c=n;continue a}}passed=false;break a}}if(!passed){m.splice(o,1);x--}else{if(typeof w==="function")w(g(s));o++}passed=true}_gimmeCallback=null;return m};function c(){this.id=null;this.tag=null;this.classes=[];this.attributes=[];this.pseudos=[];this.isEmpty=true}c.prototype.addPart=function(a,b){this.isEmpty=false;switch(b){case 0:this.tag=a.toUpperCase();break;case 1:this.id=a;break;case 2:this.classes.push(a);break;case 3:this.attributes.push(o(a));break;case 4:this.pseudos.push(a)}return this};function p(j){var a=0,e=[".#[:",".[:",".#[:","]",".#[:"],k=" >~+",b="",d=e[a],h=[],f=new c,g,i,l=j.length;for(i=0;i<l;i++){g=j.charAt(i);if(d.indexOf(g)!==-1){if(b!==""){f.addPart(b,a);b=""}switch(g){case"#":d=e[a=1];continue;case".":d=e[a=2];continue;case"[":d=e[a=3];continue;case"]":d=e[a=0];continue;case":":d=e[a=4];continue}}else if(a!==3&&k.indexOf(g)!==-1){h.push(f.addPart(b,a));h.push(g);b="";f=new c;d=e[a=0]}else b+=g}if(b!=="")f.addPart(b,a);if(!f.isEmpty)h.push(f);return h}function q(c,m){var o=m||document,l=c.id,b=c.tag,i=c.classes,h=c.attributes,j=c.pseudos,f,e=[],g,d,k;if(l){f=$ID(l);return a(f,null,b,i,h,j)?[f]:[]}else{b=b||"*";g=o.getElementsByTagName(b);k=g.length;for(d=0;d<k;d++)e[d]=g[d];n(e,b==="*"?null:b,i,h,j);return e}}function n(c,i,f,e,g){var a,b=0,k=c.length;while(b<k){a=c[b];if(e.length>0&&!h(a,e)||i&a.tagName!==i||f.length>0&&!d(a,f)||g.length>0&&!j(a,g)){c.splice(b,1);k--}else b++}}function a(a,g,f,c,b,e){if(!a)return false;if(f&&f!==a.tagName)return false;if(g&&a.id!==g)return false;if(b.length>0&&!h(a,b))return false;if(c.length>0&&!d(a,c))return false;if(e.length>0&&!j(a,e))return false;return true}function d(d,c){var a=d.className;if(typeof a!=="string")a=d.getAttribute("class");if(!a)return false;var e=a.split(" "),b,f=c.length;for(b=0;b<f;b++)if(!l(e,c[b]))return false;return true}function h(k,h){var c=false,e,l=h.length,d,j,b,i,a,g;for(e=0;e<l;e++){d=h[e];j=d.name;b=d.val;i=d.delim;a=f(k,j);if(!a)continue;switch(i){case"=":c=a===b;break;case"^=":c=a.indexOf(b)===0;break;case"$=":g=a.lastIndexOf(b);c=g!==-1&&g+b.length===a.length;break;case"*=":c=a.indexOf(b)!==-1;break;case"|=":c=a===b||a.indexOf(b+"-")===0;break;case"!=":c=a!==b;break;case null:default:c=a!==null}if(!c)break}return c}function f(a,b){if(typeof a.getAttribute==="unknown")return a.attributes&&a.attributes[b]?a.attributes[b].nodeValue:"";return a.getAttribute(b,2)||(a.attributes&&a.attributes[b]?a.attributes[b].nodeValue:a.getAttribute(b))}function o(d){var e=/\=|\^=|\$=|\*=|\|=|!=/,a=d.match(e);a=a&&a[0];var c=d.split(a),f=c[0]&&b(c[0].replace(/[\[\]"]/g,"")),g=c[1]&&b(c[1].replace(/[\[\]"]/g,""));return{name:f,delim:a,val:g}}function j(h,i){var j,e,g,c,d,b=false,f,a,k=i.length;for(f=0;f<k;f++){j=h.parentNode;e=j.childNodes;g=e.length;switch(i[f]){case"first-child":for(a=0;a<g;a++){c=e[a];if(c.nodeType===1)break}if(c.nodeType!==1)b=false;else b=c===h;break;case"last-child":for(a=g-1;a>=0;a--){d=e[a];if(d.nodeType===1)break}if(d.nodeType!==1)b=false;else b=d===h;break;default:b=false}if(!b)break}return b}function i(c,b){if(b===0)return c;var e=b>0?"nextSibling":"previousSibling",a=c,f=Math.abs(b),d=0;while(d<f){a=a[e];if(!a)break;if(a.nodeType===1)d++}return a}var m=function(){return typeof Array.prototype.indexOf!=="undefined"?b:a;function b(b,a){return b.indexOf(a)}function a(b,c){var a,d=b.length;for(a=0;a<d;a++)if(b[a]===c)return a;return-1}}(),l=function(){return typeof Array.prototype.contains!=="undefined"?b:a;function b(b,a){return b.contains(a)}function a(b,a){return m(b,a)!==-1}}();function b(a){return a.replace(/^\s+|\s+$/g,"")}function k(a){return b(a).replace(/\s{2,}/g," ")}Gimme.helper={indexOf:m,contains:l,trim:b,normalize:k,hasClass:d,readAttribute:f,getSibling:i}})();function g(a){return new Gimme.object(Gimme.query(a))}Gimme.object=function(a){this.entities=a;this.length=this.entities.length};Gimme.ext=Gimme.object.prototype;(function(){var b=Gimme.helper,o=b.contains,q=b.indexOf,n=b.normalize,f=b.hasClass,p=b.readAttribute,l=b.getSibling;Gimme.ext.element=function(a){return this.entities[a||0]};Gimme.ext.parent=function(a){return this.entities[a||0].parentNode};Gimme.ext.addClass=function(b){var a=b.split(/\s+/);this.forEach(function(b){g(a).forEach(function(a){if(!f(b,[a]))if(b.className==="")b.className=a;else b.className+=" "+a})});return this};Gimme.ext.removeClass=function(a){return this.swapClass(a,"$1")};Gimme.ext.swapClass=function(b,a){if(a!=="$1")a=" "+a+" ";var c=b.split(/\s+/);this.forEach(function(d){var b=d.className;g(c).forEach(function(c){var d=new RegExp("(^| )"+c+"( |$)");b=b.replace(d,a)});d.className=n(b)});return this};Gimme.ext.hasClass=function(a,b){return f(this.entities[b||0],[a])};Gimme.ext.getAncestor=function(b,d){var a=this.entities[d||0],c=b;while(c-->0)if(a)a=a.parentNode;else break;return a};Gimme.ext.getSibling=function(a,b){return l(this.entities[b||0],a)};Gimme.ext.select=function(a){return new Gimme.object(Gimme.query(a,this.entities[0]))};Gimme.ext.setHTML=function(a){this.forEach(function(b){b.innerHTML=a});return this};Gimme.ext.getHTML=function(a){return this.entities[a||0].innerHTML};Gimme.ext.setValue=function(a){this.forEach(function(b){if(typeof b.value!=="undefined")b.value=a});return this};Gimme.ext.getValue=function(a){return this.entities[a||0].value||""};Gimme.ext.readAttribute=function(a,b){return p(this.entities[b||0],a)};Gimme.ext.writeAttribute=function(a,b){this.forEach(function(c){c.setAttribute(a,b)});return this};Gimme.ext.filter=function(d){var b=this.entities,a=0,c=b.length;while(a<c)if(!d(b[a])){b.splice(a,1);c--}else a++;return this};Gimme.ext.iterate=function(b){var c=this.entities,a,e=c.length;for(a=0;a<e;a++){var d=g(c[a]);b.call(d,a)}b=null;return this};Gimme.ext.getStyle=function(a,n,e){var b=this.entities[n||0];if(a==="opacity"){var d=k(b);if(isNaN(d))a=d;else return d}if(e!==false)e=true;var c="";if(typeof document.defaultView!=="undefined"&&typeof document.defaultView.getComputedStyle!=="undefined")c=document.defaultView.getComputedStyle(b,null);else if(typeof b.currentStyle!=="undefined"){c=b.currentStyle;var g=c[a];if(g==="auto"){if(a==="height")return(b.clientHeight||b.offsetHeight)+"px";if(a==="width")return(b.clientWidth||b.offsetWidth)+"px";if(a==="top")return b.offsetTop+"px";else if(a==="left")return b.offsetLeft+"px";else if(e&&(a==="right"||a==="bottom")){var f={bottom:["top","Height"],right:["left","Width"]},l=parseInt(this.getComputedStyle(b,f[a][0],false),10);return b.parentNode["client"+f[a][1]]-b["offset"+f[a][1]]-l+"px"}else return"0px"}var m=/(em|ex|%|in|cm|mm|pt|pc|small|medium|large|thin|thick)$/,j=/border(.*)Width/i,i=j.test(a)?a.replace(j,"border$1Style"):null;if(m.test(g))if(i!==null&&c[i]==="none")return"0px";else return h(g,b)}return c[a]};Gimme.ext.setStyle=function(a,b){this.forEach(function(c){if(a==="opacity")m(c,b);else c.style[a]=b});return this};Gimme.ext.addEvent=function(b,f,g){this.forEach(function(h){if(typeof h.addEventListener!=="undefined")if(b==="mouseenter")h.addEventListener("mouseover",c(f),g);else if(b==="mouseleave")h.addEventListener("mouseout",c(f),g);else h.addEventListener(b,f,g);else if(typeof h.attachEvent!=="undefined"){var j="{"+e(h)+"/"+b+"/"+d(f)+"}",i=a[j];if(typeof i!=="undefined")return;i=function(a){a.target=a.srcElement;if(b=="mouseover")a.relatedTarget=a.fromElement;else if(b=="mouseout")a.relatedTarget=a.toElement;a.preventDefault=function(){a.returnValue=false};a.stopPropagation=function(){a.cancelBubble=true};f.call(h,a);a.target=null;a.relatedTarget=null;a.preventDefault=null;a.stopPropagation=null;a=null};a[j]=i;h.attachEvent("on"+b,i);j=null;i=null}});return this};Gimme.ext.removeEvent=function(b,f,g){this.forEach(function(h){if(typeof h.removeEventListener!=="undefined")if(b==="mouseenter")h.removeEventListener("mouseover",c(f),g);else if(b==="mouseleave")h.removeEventListener("mouseout",c(f),g);else h.removeEventListener(b,f,g);else if(typeof h.detachEvent!=="undefined"){var i="{"+e(h)+"/"+b+"/"+d(f)+"}",j=a[i];if(typeof j!=="undefined"){h.detachEvent("on"+b,j);delete a[i]}i=null;j=null}});return this};Gimme.ext.forEach=function(){return typeof Array.prototype.forEach!=="undefined"?b:a;function b(b,a){this.entities.forEach(b,a);return this}function a(e,d){var b=this.entities,a,c,f=b.length;for(a=0;a<f;a++){c=b[a];e.call(d,c,a,b)}return this}}();Gimme.ext.map=function(){return typeof Array.prototype.map!=="undefined"?b:a;function b(b,a){return this.entities.map(b,a)}function a(c,b){var a=[];this.forEach(function(d){a.push(c.call(b,d))});return a}}();Gimme.ext.contains=function(a){return o(this.entities,a)};Gimme.ext.indexOf=function(a){return q(this.entities,a)};var j=0,a={},m=function(){function c(a,b){a.style.opacity=b}function d(a,b){a.style.filter="alpha(opacity="+b*100+")"}var a,b=document.createElement("div");if(typeof b.style.opacity!=="undefined")a=c;else if(typeof b.style.filter!=="undefined")a=d;else a=function(){};b=null;return a}(),k=function(){function c(a){return parseFloat(a.style.opacity)||"opacity"}function d(c){var b=c.currentStyle.filter,a=b.match(/pacity\s*=\s*(\d{1,3}.?\d*)\)/);if(!a)return 1;else return parseFloat(a[1])/100}var a,b=document.createElement("div");if(typeof b.style.opacity!=="undefined")a=c;else if(typeof b.style.filter!=="undefined")a=d;else a=function(){};b=null;return a}();function d(a){if(typeof a.guid==="undefined")a.guid=j++;return a.guid}function e(a){return a===window?"theWindow":a===document?"theDocument":a.uniqueID}function i(c,a,b){if(c===a)return false;var d=0;while(a&&a!=c){d++;a=a.parentNode}b=b||d;return a===c&&b===d}function c(c){var e=d(c),b=a[e];if(typeof b==="undefined")b=a[e]=function(b){var a=b.relatedTarget;if(this===a||i(this,a))return;c.call(this,b)};return b}function h(c,b){if(/px$/.test(c))return parseInt(c,10);if(!b)b=document.body;var a=document.createElement("div");a.style.visbility="hidden";a.style.position="absolute";a.style.lineHeight="0";if(/%$/.test(c)||b.tagName==="IMG"){b=b.parentNode||b;a.style.height=c}else{a.style.borderStyle="solid";a.style.borderBottomWidth="0";a.style.borderTopWidth=c}b.appendChild(a);var d=a.offsetHeight;b.removeChild(a);return d||0}})();Gimme.Screen=new function(){this.getViewportSize=function(){var a={width:0,height:0};if(typeof window.innerWidth!=="undefined")a={width:window.innerWidth,height:window.innerHeight};else if(typeof document.documentElement!=="undefined"&&typeof document.documentElement.clientWidth!=="undefined"&&document.documentElement.clientWidth!==0)a={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight};else a={width:document.getElementsByTagName("body")[0].clientWidth,height:document.getElementsByTagName("body")[0].clientHeight};return a};this.getMousePosition=function(a){if(!a)a=window.event;var b={x:0,y:0};if(typeof a.pageX!=="undefined"&&typeof a.x!=="undefined"){b.x=a.pageX;b.y=a.pageY}else{var c=this.getScrollPosition();b.x=a.clientX+c.x;b.y=a.clientY+c.y}return b};this.getScrollPosition=function(){var a={x:0,y:0};if(typeof window.pageYOffset!=="undefined"){a.x=window.pageXOffset;a.y=window.pageYOffset}else if(typeof document.documentElement.scrollTop!=="undefined"){a.x=document.documentElement.scrollLeft;a.y=document.documentElement.scrollTop}else if(typeof document.body.scrollTop!=="undefined"){a.x=document.body.scrollLeft;a.y=document.body.scrollTop}return a}};Gimme.ext.getPosition=function(e,i){var a=this.entities[i||0],f,b,h,g,c=0,d=0;if(typeof a.getBoundingClientRect!=="undefined"){g=!Gimme.Browser.isInIFrame&&Gimme.Browser.isInFrameset?0:2;h=a.getBoundingClientRect();c=h.left-g;d=h.top-g;if(!e){b=Gimme.Screen.getScrollPosition();c+=b.x;d+=b.y}else e=false}else while(a!==null){f=typeof a.scrollTop!=="undefined"&&a!==document.body&&a!==document.documentElement&&a.tagName!=="TEXTAREA"&&a.tagName!=="INPUT"?1:0;c+=a.offsetLeft-f*a.scrollLeft;d+=a.offsetTop-f*a.scrollTop;a=a.offsetParent}if(e){b=Gimme.Screen.getScrollPosition();c-=b.x;d-=b.y}return{x:c,y:d}};Gimme.ext.getScreenPosition=function(a){return this.getPosition(true,a)};Gimme.ext.getPagePosition=function(a){return this.getPosition(false,a)};Gimme.ext.getComputedPosition=function(b){var a=this.entities[b||0];return{x:parseInt(g(a).getStyle("left"),10),y:parseInt(g(a).getStyle("top"),10)}};Gimme.Util=new function(){this.setTimeout=function(){return a(arguments,false)};this.setInterval=function(){return a(arguments,true)};function a(a,c){var e=a[0],b=a[1];function d(){e.apply(this,Array.prototype.slice.call(a,2));if(!c)e=null}if(c===true)return window.setInterval(d,b);else return window.setTimeout(d,b)}};Gimme.Animation=new function(){var a={},b=false;this.Speeds={snail:2000,turtle:1250,slowly:1250,rabbit:1000,greyhound:750,quickly:750,cheetah:500,lightning:250};this.Directions={vertically:1,horizontally:2,both:3};this.start=function(b,f,e){var c=setInterval(f,e),d=a[b];if(typeof d==="undefined")a[b]={iids:[c],callback:null};else d.iids.push(c)};this.end=function(){var c,e=arguments.length;for(c=0;c<e;c++){var d=arguments[c],b=a[d];if(typeof b!=="undefined"){g(b.iids).forEach(function(a){clearTimeout(a)});if(typeof b.callback==="function"){b.callback.call();b.callback=null}delete a[d]}}};this.isRunning=function(b){return typeof a[b]!=="undefined"};this.whenDone=function(c,b){var d=a[c];if(typeof d==="undefined")a[c]={iids:[],callback:b};else d.callback=b};this.startGroup=function(){b=true};this.endGroup=function(){b=false};this.isGrouping=function(){return b===true}};Gimme.Animation.BezierCurve=function(){this.points=[];this.args=arguments};Gimme.Animation.BezierCurve.prototype.initialize=function(){var d=this.args,h=d.length,g=d[h-1]||100,k=h-1,e,f,b,c,a;for(e=0;e<k;e++){a=d[e];c=i(a.length);b=a.length-1;for(f=0;f<=g;f++)this.points.push(j(f/g))}this.args=d=null;return g;function j(j){var d,h=0,i=0;for(d=0;d<=b;d++){var f=c[b]/(c[d]*c[b-d]),e=Math.pow(1-j,b-d),g=Math.pow(j,d);h+=f*a[d].x*e*g;i+=f*a[d].y*e*g}return{x:h,y:i}}function i(d){var a,c=1,b=[1];for(a=1;a<=d;a++){c*=a;b.push(c)}return b}};Gimme.Animation.BezierCurve.prototype.getPoint=function(c){var a=this.points.length;if(a===0)a=this.initialize();var b=Math.floor(c*a);if(b>a-1)b=a-1;return this.points[b]};Gimme.Animation.AccelerationLine=function(a,c){var d=a[a.length-1],b=g(a).map(function(a){return{x:a/d,y:0}});this.bezier=new Gimme.Animation.BezierCurve(b,c);this.points=this.bezier.points};Gimme.Animation.AccelerationLine.prototype.getValue=function(a){return this.bezier.getPoint(a).x};Gimme.Animation.AccelerationLines={zoom:new Gimme.Animation.AccelerationLine([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520],75),slowStartAccelerate:new Gimme.Animation.AccelerationLine([0,1,2,3,8,50],100),quickStartDecelerate:new Gimme.Animation.AccelerationLine([0,50,55,56,57,58],100),linear:new Gimme.Animation.AccelerationLine([0,10],100)};Gimme.Animation.AccelerationLines.defaultLine=Gimme.Animation.AccelerationLines.zoom;Gimme.ext.fadeIn=function(b,c,a){g(this.entities).fadeTo(null,.99999,b,c,a);a=null;return this};Gimme.ext.fadeOut=function(b,c,a){g(this.entities).fadeTo(null,0,b,c,a);a=null;return this};Gimme.ext.fadeTo=function(b,c,e,h,d,a){a=a||Gimme.Animation.AccelerationLines.linear;g(this.entities).animate(a,e,h,d,f,i);function i(e){var a=b===0?0:b||Number(g(e).getStyle("opacity")),d=c-a;return{startOpacity:a,deltaO:d}}function f(e,b,c,a){var f=c.getValue(b),d=a.startOpacity+f*a.deltaO;g(e).setStyle("opacity",d)}return this};Gimme.ext.veil=function(b,d,h,c,e){var a=Gimme.Animation.Directions;b=Math.floor(b)||a[b]||a.vertically;g(this.entities).animate(e,d,h,c,f,i);function i(c){var d=parseInt(g(c).getStyle("height"),10),e=parseInt(g(c).getStyle("width"),10);c.style.overflow="hidden";if((b&a.horizontally)===a.horizontally)c.style.height=d+"px";return{deltaH:d,deltaW:e}}function f(c,f,i,d){var e,g,h;if(f>=1){c.style.display="none";c.style.height=c.style.width="auto"}else{e=i.getValue(f);if((b&a.vertically)===a.vertically){g=d.deltaH-e*d.deltaH;c.style.height=g+"px"}if((b&a.horizontally)===a.horizontally){h=d.deltaW-e*d.deltaW;c.style.width=h+"px"}}}return this};Gimme.ext.unveil=function(b,d,h,c,e){var a=Gimme.Animation.Directions;b=Math.floor(b)||a[b]||a.vertically;g(this.entities).animate(e,d,h,c,f,i);function i(d){var h=d.style.width,g=d.style.height,f=d.style.overflow,c=d.cloneNode(true);c.style.visibility="hidden";c.style.margin="0";c.style.padding="0";c.style.border="0";c.style.position="absolute";c.style.display="block";d.parentNode.appendChild(c);var e=c.offsetHeight,i=c.offsetWidth;c.parentNode.removeChild(c);d.style.visibility="visible";d.style.display="block";d.style.overflow="hidden";if((b&a.horizontally)===a.horizontally)d.style.height=e+"px";return{deltaH:e,deltaW:i,styleH:g,styleW:h,styleOverflow:f}}function f(d,f,i,c){var e,g,h;if(f>=1){d.style.overflow=c.styleOverflow;d.style.width=c.styleW;d.style.height=c.styleH}else{e=i.getValue(f);if((b&a.vertically)===a.vertically){g=e*c.deltaH;d.style.height=g+"px"}if((b&a.horizontally)===a.horizontally){h=e*c.deltaW;d.style.width=h+"px"}}}return this};Gimme.ext.scrollTo=function(b,e,a,c){g(this.entities[0]).animate(c,b,e,a,d,f);function f(c){var a=Gimme.Screen.getScrollPosition(),b=g(c).getPagePosition().y-a.y;return{scrollPos:a,deltaY:b}}function d(f,b,c,a){var d=c.getValue(b),e=a.scrollPos.y+d*a.deltaY;window.scrollTo(0,Math.floor(e))}return this};Gimme.ext.slideToPoint=function(a,c,f,b,d){g(this.entities).animate(d,c,f,b,e,h);function h(e){var b=g(e).getComputedPosition();if(a.x===null)a.x=b.x;if(a.y===null)a.y=b.y;var d=a.y-b.y,c=a.x-b.x;return{startPt:b,deltaX:c,deltaY:d}}function e(c,e,f,a){var b=a.startPt,g=a.deltaX,h=a.deltaY,d=f.getValue(e),i=b.x+d*g,j=b.y+d*h;c.style.top=Math.floor(Math.round(j))+"px";c.style.left=Math.floor(Math.round(i))+"px"}return this};Gimme.ext.followPath=function(f,a,d,e,c){a=a||1;g(this.entities).animate(f,d,e,c,b,h);function h(b){var a=g(b).getComputedPosition();return{startPt:a}}function b(c,e,g,f){var b=f.startPt,d=g.getPoint(e),h=b.x+d.x*a,i=b.y+d.y*a;c.style.top=Math.floor(Math.round(i))+"px";c.style.left=Math.floor(Math.round(h))+"px"}return this};Gimme.ext.animate=function(b,c,a,h,d,e){var f=this.entities.length;if(f<1)return;b=b||Gimme.Animation.AccelerationLines.defaultLine;c=Math.floor(c)||Gimme.Animation.Speeds[c]||Gimme.Animation.Speeds.quickly;a=a||"AUTOGUID_"+Math.random((new Date).getTime());if(!Gimme.Animation.isGrouping()&&Gimme.Animation.isRunning(a))return;Gimme.Animation.whenDone(a,h);var g=0,k=b.points.length,j=(new Date).getTime();this.forEach(function(c,b){Gimme.Animation.start(a,i(c,b),10)});function i(h){var i=e(h);return function(){var l=(new Date).getTime(),k=(l-j)/c;if(k>=1){if(typeof d==="function")d(h,1,b,i);if(++g===f){Gimme.Animation.end(a);e=null;d=null}}else d(h,k,b,i)}}};Gimme.ext.getRelativePosition=function(d,e){var a=this.entities[e||0],b=0,c=0;while(a!==null&&a!==d){b+=a.offsetLeft;c+=a.offsetTop;a=a.offsetParent}return{x:b,y:c}};Gimme.ext.addShim=function(d,e){var b=this.entities[0];if(b.shim){b.shim.parentNode.removeChild(b.shim);b.shim=null}var a=document.createElement("iframe");a.frameBorder="0";a.scrolling="no";a.className="iframeShim";a.style.position="absolute";a.style.zIndex=e||"1";a.style.background="#fff";a.style.height=b.offsetHeight+"px";a.style.width=b.offsetWidth+"px";var c=g(b);a.style.top=c.getStyle("top");a.style.left=c.getStyle("left");a.style.marginTop=c.getStyle("marginTop");a.style.marginLeft=c.getStyle("marginLeft");a.style.marginRight=c.getStyle("marginRight");a.style.marginBottom=c.getStyle("marginBottom");this.entities.push(a);d=d||b;(d.parentNode||document.body).insertBefore(a,d);b.shim=a;return this};Gimme.ext.removeShim=function(){var b=this.entities[0],a=b.shim;if(a){a.parentNode.removeChild(a);b.shim=null}return this};Gimme.ext.toggle=function(a){if(a!==true)a=false;this.forEach(function(c){var b=g(c);if(a)b.setStyle("visibility",b.getStyle("visibility")==="visible"?"hidden":"visible");else b.setStyle("display",b.getStyle("display")!=="none"?"none":"block")});return this};function MVC_Init_AbstractView_Shared(){Msn.MVC.AbstractView.prototype.GetMoveMenuOptionAsHtml=function(a){return a}}function MVC_Init_View3D_Shared(){Msn.MVC.View3D.prototype.GetMoveMenuOptionAsHtml=function(d,c){var e=c.GetPrimitiveCount();for(var a=0;a<e;a++){var b=c.GetPrimitive(a).type;if(b==VEShapeType.Polyline||b==VEShapeType.Polygon)return""}return d}}function MVC_Init_ViewFacade_Shared(){Msn.MVC.ViewFacade.prototype.GetMoveMenuOptionAsHtml=function(a,b){if(this._curMvcView==null)return"";return this._curMvcView.GetMoveMenuOptionAsHtml(a,b)}}function VE_SelectItem(b,a){this.data=b;this.description=a}VE_SelectItem.prototype.toString=function(){return this.description};function VE_Select(h,l,k,j){this.isVisible=false;var b=[],a=document.createElement("div");a.setAttribute("id",h);this.id=h;var v=h,d=this,c=-1,r=k?k:"",m=l?l:"",p=j?j:"",e="";function y(d){if(!(d instanceof VE_SelectItem))d=new VE_SelectItem(d,d.toString());b.push(d);var c=document.createElement("div");c.setAttribute("id",v+"_"+(b.length-1));c.onclick=w;c.onmouseover=q;c.onmouseout=s;c.innerHTML=d.description;a.appendChild(c)}function x(){return b.length}function u(){return a}function w(e){var c=GetTarget(e),a=f(c);i(a);if(d.OnClick)d.OnClick(a,b[a]);if(d.OnSelect)d.OnSelect(a,b[a])}function q(g){var a=GetTarget(g),c=f(a);e=a.className;a.className=p;if(d.OnMouseOver)d.OnMouseOver(c,b[c])}function s(g){var a=GetTarget(g),c=f(a);a.className=e;if(d.OnMouseOut)d.OnMouseOut(c,b[c])}function i(d){if(d>=0&&d<b.length){var f=g();if(f>=0)a.childNodes[f].className=m;c=d;a.childNodes[d].className=r;e=a.childNodes[d].className}else{var f=g();if(f>=0)a.childNodes[f].className=m;c=-1}}function g(){return c}function o(){if(c>=0&&c<b.length)return b[c];return null}function n(d){if(d<0||d>=b.length)return;if(d<c)c-=1;else if(d==c)c=-1;b.splice(d,1);a.removeChild(a.childNodes[d])}function f(c){for(var b=0;b<a.childNodes.length;++b)if(c==a.childNodes[b])return b;return-1}function t(){while(b.length>0)b.pop();while(a.childNodes.length>0)a.removeChild(a.lastChild);c=-1}function A(){a.style.display="block";this.isVisible=true}function z(){a.style.display="none";this.isVisible=false}this.OnClick=null;this.GetCount=x;this.GetElement=u;this.GetSelectedIndex=g;this.GetSelectedItem=o;this.SelectItemAtIndex=i;this.OnSelect=null;this.AddItem=y;this.OnMouseOver=null;this.OnSelect=null;this.OnMouseOut=null;this.ClearItems=t;this.RemoveItemAtIndex=n;this.Show=A;this.Hide=z}function DecodeHtml(a){var c="";if(typeof a=="string"&&a.length>0){var b=document.createElement("span");b.innerHTML=a;c=b.firstChild.nodeValue;b=null}return c}function OutputEncoder_URLEncodeUTF8(e){if(e==null)return"";var d=["%00","%01","%02","%03","%04","%05","%06","%07","%08","%09","%0a","%0b","%0c","%0d","%0e","%0f","%10","%11","%12","%13","%14","%15","%16","%17","%18","%19","%1a","%1b","%1c","%1d","%1e","%1f","%20","%21","%22","%23","%24","%25","%26","%27","%28","%29","%2a","%2b","%2c","%2d","%2e","%2f","%30","%31","%32","%33","%34","%35","%36","%37","%38","%39","%3a","%3b","%3c","%3d","%3e","%3f","%40","%41","%42","%43","%44","%45","%46","%47","%48","%49","%4a","%4b","%4c","%4d","%4e","%4f","%50","%51","%52","%53","%54","%55","%56","%57","%58","%59","%5a","%5b","%5c","%5d","%5e","%5f","%60","%61","%62","%63","%64","%65","%66","%67","%68","%69","%6a","%6b","%6c","%6d","%6e","%6f","%70","%71","%72","%73","%74","%75","%76","%77","%78","%79","%7a","%7b","%7c","%7d","%7e","%7f","%80","%81","%82","%83","%84","%85","%86","%87","%88","%89","%8a","%8b","%8c","%8d","%8e","%8f","%90","%91","%92","%93","%94","%95","%96","%97","%98","%99","%9a","%9b","%9c","%9d","%9e","%9f","%a0","%a1","%a2","%a3","%a4","%a5","%a6","%a7","%a8","%a9","%aa","%ab","%ac","%ad","%ae","%af","%b0","%b1","%b2","%b3","%b4","%b5","%b6","%b7","%b8","%b9","%ba","%bb","%bc","%bd","%be","%bf","%c0","%c1","%c2","%c3","%c4","%c5","%c6","%c7","%c8","%c9","%ca","%cb","%cc","%cd","%ce","%cf","%d0","%d1","%d2","%d3","%d4","%d5","%d6","%d7","%d8","%d9","%da","%db","%dc","%dd","%de","%df","%e0","%e1","%e2","%e3","%e4","%e5","%e6","%e7","%e8","%e9","%ea","%eb","%ec","%ed","%ee","%ef","%f0","%f1","%f2","%f3","%f4","%f5","%f6","%f7","%f8","%f9","%fa","%fb","%fc","%fd","%fe","%ff"],b,a=[],g=e.length;for(var f=0;f<g;f++){var c=e.charCodeAt(f),b=e.charAt(f);if("A"<=b&&b<="Z")a=a+b;else if("a"<=b&&b<="z")a=a+b;else if("0"<=b&&b<="9")a=a+b;else if(b==" ")a=a+"+";else if(b=="-"||b=="_"||b=="."||b=="!"||b=="~"||b=="*"||b=="'"||b=="("||b==")")a=a+String.fromCharCode(c);else if(c<=127)a=a+d[c];else if(c<=2047){a=a+d[192|c>>6];a=a+d[128|c&63]}else{a=a+d[224|c>>12];a=a+d[128|c>>6&63];a=a+d[128|c&63]}}return a}function OutputEncoder_URLEncodeEscapeUTF8(e){if(e==null)return"";var d=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],b,a=[],g=e.length;for(var f=0;f<g;f++){var c=e.charCodeAt(f),b=e.charAt(f);if("A"<=b&&b<="Z")a=a+b;else if("a"<=b&&b<="z")a=a+b;else if("0"<=b&&b<="9")a=a+b;else if(b==" ")a=a+"+";else if(b=="-"||b=="_"||b=="."||b=="!"||b=="~"||b=="*"||b=="'"||b=="("||b==")")a=a+String.fromCharCode(c);else if(c<=127)a=a+"%"+d[c];else if(c<=2047){a=a+"%25"+d[192|c>>6];a=a+"%25"+d[128|c&63]}else{a=a+"%25"+d[224|c>>12];a=a+"%25"+d[128|c>>6&63];a=a+"%25"+d[128|c&63]}}return a}function OutputEncoder_EncodeHtml(c){var a,b="";if(c==null)return"";for(var d=0;d<c.length;d++){a=c.charCodeAt(d);if(a>96&&a<123||a>64&&a<91||a==32||a>47&&a<58||a==46||a==44||a==45||a==95)b=b+String.fromCharCode(a);else b=b+"&#"+a+";"}return b}function OutputEncoder_EncodeHtmlAttribute(c){var a,b="";if(c==null)return"";for(var d=0;d<c.length;d++){a=c.charCodeAt(d);if(a>96&&a<123||a>64&&a<91||a>47&&a<58||a==46||a==44||a==45||a==95)b=b+String.fromCharCode(a);else b=b+"&#"+a+";"}return b}function OutputEncoder_EncodeXml(a){return OutputEncoder_EncodeHtml(a)}function OutputEncoder_EncodeXmlAttribute(a){return OutputEncoder_EncodeHtmlAttribute(a)}function OutputEncoder_EncodeJs(c){var a,b="";if(c==null)return"";for(var d=0;d<c.length;d++){a=c.charCodeAt(d);if(a>96&&a<123||a>64&&a<91||a==32||a>47&&a<58||a==46||a==44||a==45||a==95)b=b+String.fromCharCode(a);else if(a>127)b=b+"\\u"+OutputEncoder_TwoByteHex(a);else b=b+"\\x"+OutputEncoder_SingleByteHex(a)}return"'"+b+"'"}function OutputEncoder_EncodeVbs(d){var b,a="",c=false;if(d==null)return"";for(var e=0;e<d.length;e++){b=d.charCodeAt(e);if(b>96&&b<123||b>64&&b<91||b==32||b>47&&b<58||b==46||b==44||b==45||b==95){if(!c){a=a+'&"';c=true}a=a+String.fromCharCode(b)}else{if(c){a=a+'"';c=false}a=a+"&chrw("+b+")"}}if(a.charAt(0)=="&")a=a.substring(1);if(a.length==0)a='""';if(c)a=a+'"';return a}function OutputEncoder_AsUrl(a){if(a==null)return"";if(a.search(/^(?:http|https|ftp):\/\/[a-zA-Z0-9\.\-]+(?:\:\d{1,5})?(?:[A-Za-z0-9\.\;\:\@\&\=\+\$\,\?\/]|%u[0-9A-Fa-f]{4}|%[0-9A-Fa-f]{2})*$/i))throw"Unsanitized value passed to AsUrl";return a}function OutputEncoder_QualifyUrl(a){if(a==null)return"";if(a.search(/^(?:http|https|ftp):\/\//i))if(document.location.protocol=="HTTPS")return"https://"+document.location.hostname+OutputEncoder_QualifyUrl_MakePath(a);else return"http://"+document.location.hostname+OutputEncoder_QualifyUrl_MakePath(a);else return a}function OutputEncoder_QualifyUrl_MakePath(a){if(a==null)return"";if(!a.search(/^[\/\\]/))return a;var b=/^(\/(?:.*\/|))(?:[^\/\\]*\.\w+|\w*)$/;if(!document.location.pathname.search(b)){var c=b.exec(document.location.pathname);return c[1]+a}return"/"+a}function OutputEncoder_AsNumeric(a){if(a==null)return"";if(isNaN(parseFloat(a)))throw"IOSec.AsNumeric(): Error input ["+a+"] not a valid number.";return a}function OutputEncode_TruncateUrlSafe(a,b,e){if(a.length<=b)return a;var d="";if(e&&e.length>0){d=OutputEncoder_EncodeUrl(e);b-=d.length}var a=a.substring(0,b);for(var c=1;c<6;c++)if(a.charAt(b-c)=="%"){a=a.substring(0,b-c);break}return a+d}function OutputEncode_EncodeUrlDelims(f,c){if(!f)return c;var a,h,b="";for(var d=0;d<c.length;d++){a=c.charCodeAt(d);if(37==a){b=b+"%"+OutputEncoder_SingleByteHex(a);continue}var e=c.charAt(d);for(var g=0;g<f.length;g++){h=f.charCodeAt(g);if(h==a){if(a>127)e="%u"+OutputEncoder_TwoByteHex(a);else e="%"+OutputEncoder_SingleByteHex(a);break}}b+=e}return b}function OutputEncoder_EncodeUrl(c){if(c==null)return"";var a,e=c.length,b=new Array(e);for(var d=0;d<e;++d){a=c.charCodeAt(d);if(a>96&&a<123||a>64&&a<91||a>47&&a<58||a==46||a==45||a==95)b.push(String.fromCharCode(a));else if(a>127){b.push("%u");b.push(OutputEncoder_TwoByteHex(a))}else{b.push("%");b.push(OutputEncoder_SingleByteHex(a))}}return b.join("")}function OutputEncoder_SingleByteHex(b){if(b==null)return"";var a=b.toString(16);for(var c=a.length;c<2;c++)a="0"+a;return a}function OutputEncoder_TwoByteHex(b){if(b==null)return"";var a=b.toString(16);for(var c=a.length;c<4;c++)a="0"+a;return a}function GetValidatedUrl(a){if(a==null||a=="undefined"||a.length<=0)return"";try{a=unescape(a);a=a.replace(/\|/g," ").replace(/\^/g," ").replace(/^\s+/g,"").replace(/\s+$/g,"");var b=new RegExp(/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/);if(a.match(b))return a;else return""}catch(c){return""}}function OutputEncoder(){this.GetValidatedUrl=GetValidatedUrl;this.EncodeHtml=OutputEncoder_EncodeHtml;this.EncodeHtmlAttribute=OutputEncoder_EncodeHtmlAttribute;this.EncodeXml=OutputEncoder_EncodeXml;this.EncodeXmlAttribute=OutputEncoder_EncodeXmlAttribute;this.EncodeJs=OutputEncoder_EncodeJs;this.EncodeVbs=OutputEncoder_EncodeVbs;this.AsNumeric=OutputEncoder_AsNumeric;this.EncodeUrl=OutputEncoder_EncodeUrl;this.EncodeUrlDelims=OutputEncode_EncodeUrlDelims;this.TruncateUrlSafe=OutputEncode_TruncateUrlSafe;this.SingleByteHex=OutputEncoder_SingleByteHex;this.TwoByteHex=OutputEncoder_TwoByteHex;this.AsUrl=OutputEncoder_AsUrl;this.QualifyUrl=OutputEncoder_QualifyUrl;this.EncodeUrlUTF8=OutputEncoder_URLEncodeUTF8;this.EncodeUrlEscapeUTF8=OutputEncoder_URLEncodeEscapeUTF8;this.DecodeHtml=DecodeHtml}var IOSec=new OutputEncoder;function VE_Panel(c,q,r,o,m,f,d,n,p,l,s,t,e,h,i,j){var b=this;this.index=0;this.x=q;this.y=r;this.width=o;this.height=m;this.dynamicHeightMax=600;this.color=f;this.sPanel=null;this.toolbarHeight=20;this.footerHeight=20;this.min=false;this.visible=true;this.onTitleClick=null;this.onCloseClick=null;this.onMaximize=null;this.onMinimize=null;this.isLegacyPanel=h==true;this.usesShimIn3D=!this.isLegacyPanel;if(!e)e=document.body;var a=null;if(!this.isLegacyPanel){a=VE_Panel._CreateElement("div",c,"VE_Panel_el",d);this.el=a;this.titleDisabled=false;this.title=document.createElement("a");this.title.id=c+"_title";this.title.className="VE_Panel_title";this.title.appendChild(document.createElement("span"));this.title.onclick=function(a){VE_Panel._OnTitleClick(a);return false};this.title.href="#";a.appendChild(this.title);this.SetTitle(n);this.closeboxDisabled=false;this.cb=VE_Panel._CreateElement("a",c+"_cb","VE_Panel_cb VE_Panel_cb_"+f,d+1);this.cb.onclick=function(a){VE_Panel._OnCloseClick(a);return false};this.cb.onmouseover=function(){if(typeof Msn.VE.Css!="undefined")Msn.VE.Css.Functions.addClass(b.title,"VE_Panel_title_hover")};this.cb.onmouseout=function(){if(typeof Msn.VE.Css!="undefined")Msn.VE.Css.Functions.removeClass(b.title,"VE_Panel_title_hover")};this.cb.href="#";this.cb.unselectable="on";a.appendChild(this.cb);this.tb=VE_Panel._CreateElement("div",c+"_tb","toolbar",d+1);this.tb.unselectable="on";a.appendChild(this.tb)}else{var k=$ID(c+"_tb");this.tb=VE_Panel._CreateElement("div","","",d+1);k.appendChild(this.tb)}this.body=VE_Panel._CreateElement("div",c+"_body","VE_Panel_body",d+1);this.body.innerHTML=p;if(!this.isLegacyPanel){a.appendChild(this.body);this.foot=VE_Panel._CreateElement("div",c+"_foot","VE_Panel_foot VE_Panel_foot_"+f,d+1);this.foot.innerHTML=l;this.foot.unselectable="on";a.appendChild(this.foot)}else{a=this.body;this.el=a}VE_Panel.panels.push(this);if(i){a.style.top="0";a.style.left="0";if(j)a.style.position="absolute";else{a.style.display="none";a.style.visibility="hidden"}}e.appendChild(a);var g=Gimme.id("TaskHost_CollectionsViewer_state");if(g!==null)e.appendChild(g);this.Destroy=function(){if(a.parentNode)a.parentNode.removeChild(a);if(b.sPanel!=null)b.sPanel.Destroy();if(a.shimElement&&a.shimElement.parentNode)a.shimElement.parentNode.removeChild(a.shimElement);a.shimElement=null;var d=VE_Panel.panels;for(var c=0;c<d.length;c++)if(d[c]==b){d.splice(c,1);break}if(!this.isLegacyPanel){b.cb.onclick=b.cb.onmouseover=b.cb.onmouseout=null;b.title.onclick=null;b.cb=null;b.title=null;b.foot=null;b.onTitleClick=null;b.onCloseClick=null}else{var f=b.tb.parentNode;if(f)f.removeChild(b.tb)}b.tb=null;b.sPanel=null;b.body=null;b.onMaximize=null;a=b.el=null;b=null;e=null}}VE_Panel.panels=[];VE_Panel.shadowThickness=3;VE_Panel._CreateElement=function(d,e,b,c){var a=document.createElement(d);a.id=e;a.className=b;a.style.zIndex=c;return a};VE_Panel._PositionElement=function(a,d,e,c,b){a.style.top=e+"px";a.style.left=d+"px";a.style.width=c+"px";a.style.height=b+"px"};VE_Panel.prototype.SetPosition=function(c,d,b,a){this.x=c;this.y=d;this.width=b;this.height=a;if(map.IsModeEnabled(Msn.VE.MapActionMode.Mode3D)&&this.usesShimIn3D)UpdateIFrameShim(this.el)};VE_Panel.prototype.SetToolbarSize=function(toolbarHeight){this.toolbarHeight=toolbarHeight;var d=eval(toolbarHeight)>0?"block":"none";this.tb.style.display=d;this.Resize()};VE_Panel.prototype.SetFooterSize=function(footerHeight){if(!this.isLegacyPanel){this.footerHeight=footerHeight;var d=eval(footerHeight)>0?"block":"none";this.foot.style.display=d;this.Resize()}};VE_Panel.prototype.Resize=function(){if(typeof globals!="undefined"){var geoFn=Msn.VE.Geometry.Functions,taskAreaHeight=Gimme.Screen.getViewportSize().y-g(globals["taskArea"]).getScreenPosition().y-globals["footer"].offsetHeight;if(taskAreaHeight>=0&&typeof taskAreaHeight=="number")globals["taskArea"].style.height=taskAreaHeight-2+"px";if(this.el.id=="contextMenu"||this.el.id=="scratchpad"||this.el.id=="annotationPanel"||this.el.id=="annotationPopup"||this.el.id=="searchPopup"||this.el.id=="help"){if(this.height!="auto"&&typeof this.height=="number")this.el.style.height=eval(this.height)+"px";if(this.width!="auto"&&typeof this.width=="number")this.el.style.width=eval(this.width)+"px";if(this.x!="auto"&&typeof this.x=="number")this.el.style.left=eval(this.x)+"px";if(this.y!="auto"&&typeof this.y=="number")this.el.style.top=eval(this.y)+"px"}if(this.el.shimElement)ShowShim(this.el)}};VE_Panel.prototype.SetHeightToFit=function(){var contentid=this.id+"_body_table",content=$ID(contentid);if(!content)return false;this.height=0;var width=Math.max(eval(this.width),100);if(content.offsetWidth>width-14)this.height+=scrollbarWidth;this.height+=this.titleDisabled?14:21+14;this.height+=this.toolbarHeight;this.height+=content.offsetHeight;this.height+=this.footerHeight;this.height=Math.min(this.dynamicHeightMax,this.height)};VE_Panel.prototype.DisableClosebox=function(){if(!this.isLegacyPanel){if(this.closeboxDisabled)return;this.closeboxDisabled=true;this.el.removeChild(this.cb)}};VE_Panel.prototype.EnableClosebox=function(){if(!this.isLegacyPanel){if(!this.closeboxDisabled)return;this.closeboxDisabled=false;this.el.appendChild(this.cb)}};VE_Panel.prototype.DisableTitle=function(){if(!this.isLegacyPanel){if(this.titleDisabled)return;this.titleDisabled=true;this.el.removeChild(this.cb);this.el.removeChild(this.title)}};VE_Panel.prototype.EnableTitle=function(){if(!this.isLegacyPanel){if(!this.titleDisabled)return;this.titleDisabled=false;this.el.insertBefore(this.cb,this.tb);this.el.insertBefore(this.title,this.cb)}};VE_Panel.prototype.SetTitle=function(c){if(!this.isLegacyPanel){var b=document.createTextNode(c),a=this.title.firstChild;if(a)if(a.firstChild)a.replaceChild(b,a.firstChild);else a.appendChild(b)}};VE_Panel.prototype.SetToolbar=function(a){this.tb.innerHTML=a};VE_Panel.prototype.SetBody=function(a){this.body.innerHTML=a};VE_Panel.prototype.SetDynamicBody=function(a){this.body.innerHTML='<table id="'+this.id+'_body_table"><tr><td>'+a+"</td></tr></table>"};VE_Panel.prototype.SetFooter=function(a){if(!this.isLegacyPanel)this.foot.innerHTML=a};VE_Panel.prototype.SetOpacity=function(o){if(o>=100)o=99.99;with(this.el.style){filter="alpha(opacity:"+o+")";o*=.01;KHTMLOpacity=o;MozOpacity=o;opacity=o}};VE_Panel.prototype.SetColor=function(a){if(!this.isLegacyPanel){this.color=a;this.title.className="VE_Panel_title VE_Panel_title_"+a;this.foot.className="VE_Panel_foot VE_Panel_foot_"+a;this.cb.className="VE_Panel_cb VE_Panel_cb_"+a}};VE_Panel.prototype.Minimize=function(){this.el.className=" VE_Panel_el_minimized";if(this.onMinimize)this.onMinimize(this._CreateEvent())};VE_Panel.prototype.Maximize=function(){this.el.className="VE_Panel_el";if(this.onMaximize)this.onMaximize(this._CreateEvent());this.Resize()};VE_Panel.prototype.isMaximized=function(){return this.el.className=="VE_Panel_el"};VE_Panel.prototype.Show=function(){this.el.style.display="block";this.visible=true;if(this.usesShimIn3D)mvcViewFacade.ShowShimIfSupported(this.el)};VE_Panel.prototype.Hide=function(){this.el.style.display="none";this.visible=false;HideShim(this.el)};VE_Panel.prototype.IsVisible=function(){return this.el.style.display!="none"};function VE_PanelEvent(a){this.srcPanel=a}VE_Panel.prototype._CreateEvent=function(){return new VE_PanelEvent(this)};VE_Panel._OnTitleClick=function(c){if(!c)c=window.event;var d=GetTarget(c),b=VE_Panel.panels;for(var a=0;a<b.length;a++)if(b[a].title==d||b[a].title==d.parentNode){if(b[a].onTitleClick)b[a].onTitleClick(b[a]._CreateEvent());return}};VE_Panel._OnCloseClick=function(c){if(!c)c=window.event;var d=GetTarget(c),b=VE_Panel.panels;for(var a=0;a<b.length;a++)if(b[a].cb==d){if(b[a].onCloseClick)b[a].onCloseClick(b[a]._CreateEvent());return}};function Ad(h,j,a,e,b,c,d,i,g,f,k){this.title=h;this.url=j;this.description=a;this.latitude=e;this.longitude=b;this.address1=c;this.address2=d;this.city=i;this.state=g;this.country=f;this.zip=k}Ad.prototype.ToHtml=function(){var a="<li>"+'<a href = "'+this.url+'" target = "_blank">'+IOSec.EncodeHtml(this.title)+"</a>"+"$AdDescription$"+"</li>";if(this.description&&this.description.length>0)a=a.replace("$AdDescription$","<p>"+IOSec.EncodeHtml(this.description)+"</p>");return a};Ad.prototype.HasAddress=function(){return this.address1.length>0&&this.city.length>0&&this.state.length>0&&this.zip.length>0};Ad.prototype.GetAdDescription=function(){var a=this.description;if(this.HasAddress())a=this.address1+", "+this.city+", "+this.state+" "+this.zip;return a};Msn.VE.DirectionsDecoder=function(){var a=4,b=1000000;function e(a,c,m,l){if(!a||a.length<c)return[];var k=a.length-a.length%c,i=[],f=false,b=0,j=c-1;for(var d=0;d<k;d++){var e=a.charCodeAt(d),h=d%c;if(l&&h==0){f=e&128;e&=127}b|=e;if(h==j){var g=b/m;i.push(f?-g:g);b=0;f=false}else b<<=8}return i}function d(c){return e(c,a,b,true)}function c(c){var l=true;if(!c||c.length<a)return[];var j=[],g=false,d=0,k=a-1,m=c.length;for(var e=0;e<m;++e){var f=c[e],i=e%a;if(l&&i==0){g=f&128;f&=127}d|=f;if(i==k){var h=d/b;j.push(g?-h:h);d=0;g=false}else d<<=8}return j}this.DecodeCoordinatesString=d;this.DecodeCoordinatesByteArray=c};var HelpHistory=[];function VE_Help(){}VE_Help.helpZIndex=31;VE_Help.introZIndex=31;VE_Help.introPanel=null;VE_Help.helpPanel=null;VE_Help.margins=110;VE_Help.LiveHelp=new function(){this.Keyword="keyword";this.Search="search";this.Topic="topic"};VE_Help.CreateHelpPanel=function(){VE_Help.CreateSizedHelpPanel(220,160,windowWidth<=430?300:windowWidth-430,windowHeight<=220?200:windowHeight-220)};VE_Help.CreateSizedHelpPanel=function(e,f,c,b){if(typeof VE_Help.helpPanel!="undefined"&&VE_Help.helpPanel!=null){VE_Help.helpPanel.SetBody("");VE_Help.helpPanel.Destroy();VE_Help.helpPanel=null}var d='<iframe id="helpFrame" src="about:blank" width="100%" height="100%" allowtransparency="true" frameborder="0"></iframe>',a=new VE_Panel("help",e,f,c<=300?300:c,b<=200?200:b,"blue",VE_Help.helpZIndex,L_Help_Text,d,"",null,null,null,null,true,null);a.body.className="VE_Panel_body_help";a.Hide();a.el.style.visibility="";a.SetToolbarSize(0);a.SetFooterSize(0);a.onCloseClick=function(){VE_Help.DisablePreventLayer();VE_Help.ClosePanel()};VE_Help.helpPanel=a};VE_Help.EnablePreventLayer=function(){var a=$ID("__preventLayer__");if(!a)a=document.createElement("div");a.id="__preventLayer__";a.className="preventLayer";document.body.appendChild(a)};VE_Help.DisablePreventLayer=function(){var a=$ID("__preventLayer__");if(a)document.body.removeChild(a)};VE_Help.EnableDrawingPreventLayer=function(){var c=$ID("msve_header");if(c){var b=$ID("__preventLayerHeader__");if(!b)b=document.createElement("div");b.id="__preventLayerHeader__";b.className="preventLayer";b.style.left=c.clientLeft;b.style.top=c.clientTop;b.style.width=c.clientWidth;b.style.height=c.clientHeight;document.body.appendChild(b)}var d=$ID("sb_foot");if(d){var a=$ID("__preventLayerFooter__");if(!a)a=document.createElement("div");a.id="__preventLayerFooter__";a.className="preventLayer";a.style.left=0;a.style.top=GetWindowHeight()-d.clientHeight;a.style.width=d.clientWidth;a.style.height=d.clientHeight;document.body.appendChild(a)}};VE_Help.DisableDrawingPreventLayer=function(){var d=$ID("__preventLayerHeader__");if(d)document.body.removeChild(d);var b=$ID("__preventLayerTaskArea__");if(b)document.body.removeChild(b);var a=$ID("__preventLayerActionBar__");if(a)document.body.removeChild(a);var c=$ID("__preventLayerFooter__");if(c)document.body.removeChild(c)};function findPosX(a){var b=0;if(a.offsetParent)while(a.offsetParent){b+=a.offsetLeft;a=a.offsetParent}else if(a.x)b+=a.x;return b}function findPosY(a){var b=0;if(a.offsetParent)while(a.offsetParent){b+=a.offsetTop;a=a.offsetParent}else if(a.y)b+=a.y;return b}VE_Help.Open=function(b,c){VE_Help.EnablePreventLayer();VE_Help.helpPanel.Show();VE_Help.helpPanel.SetTitle(b);VE_Help.helpPanel.SetBody('<iframe id = "helpFrame" src = "about:blank" width = "100%" allowtransparency = "true" scrolling = "auto" frameborder = "0"></iframe>');var a=$ID("helpFrame");a.src=c;VE_Help.Redraw()};VE_Help.OpenSized=function(f,g,a,b){var d=GetWindowWidth(),c=GetWindowHeight();if(a>d-10)a=d-10;if(b>c-10)b=c-10;VE_Help.CreateSizedHelpPanel((d-a)/2,(c-b)/2,a,b);VE_Help.EnablePreventLayer();VE_Help.helpPanel.Show();VE_Help.helpPanel.SetTitle(f);VE_Help.helpPanel.SetBody('<iframe id = "helpFrame" src = "about:blank" width = "100%" allowtransparency = "true" scrolling = "no" frameborder = "0"></iframe>');var e=$ID("helpFrame");e.src=g};VE_Help.OpenLiveHelp=function(b,a,c){var g="_live_help",f=550,e=575,i=(screen.availWidth-f)*.5,j=(screen.availHeight-e)*.5,h="resizable=yes,top="+j+",width="+f+",height="+e+",left="+i;if(typeof b=="undefined"||b==null||b=="")b=liveLocalHelpProjectCode;if(typeof a=="undefined"||a==null||a=="")a=VE_Help.LiveHelp.Keyword;if(typeof c=="undefined"||c==null||c=="")c="qaf";var k=liveHelpUrl+"&project="+b+"&querytype="+a+"&query="+c,d=window.open(k,g,h);if(d!=null&&typeof d=="object")d.focus()};VE_Help.Redraw=function(){var b=VE_Help.helpPanel;if(!b)return;var c=Gimme.Screen.getViewportSize(),a=g(b.el);a.setStyle("top",(c.height-a.element().offsetHeight)/2+"px");a.setStyle("left",(c.width-a.element().offsetWidth)/2+"px");ShowShim(b.el)};VE_Help.CloseIntro=function(){if(VE_Help.introPanel)VE_Help.introPanel.Hide()};VE_Help.ClosePanel=function(){if(VE_Help.helpPanel){VE_Help.helpPanel.Hide();VE_Help.DisablePreventLayer()}};VE_Help.Destroy=function(){if(VE_Help.introPanel){VE_Help.introPanel.Destroy();VE_Help.introPanel=null}if(VE_Help.helpPanel){VE_Help.helpPanel.Destroy();VE_Help.helpPanel=null}};function SanitizeHtmlString(a){if(!a||typeof a!="string")return a;return IOSec.EncodeHtml(a)}function GetTarget(b){if(!b)b=window.event;var a=null;if(b.srcElement)a=b.srcElement;else if(b.target)a=b.target;if(a&&a.nodeType){if(b.capturedTarget)a=b.capturedTarget;if(a.nodeType==3)a=a.parentNode}return a}function SelectText(a,c,d){if(!a)return;if(a.createTextRange){var b=a.createTextRange();b.moveStart("character",c);b.moveEnd("character",d);b.select()}else if(a.setSelectionRange)a.setSelectionRange(c,d)}function SelectedTextLength(a){if(!a)return 0;if(a.document){var b=a.document.selection.createRange();return b.text.length}else{var c=a.selectionStart,d=a.selectionEnd;return d-c}}function GetXMLText(a){if(a.text)return a.text;else if(a.textContent)return a.textContent;else if(a.firstChild&&a.firstChild.data)return a.firstChild.data;return""}function VEValidator(){}VEValidator.ValidateFloat=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateFloat";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","float"));try{if(isNaN(parseFloat(b)))throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","float"));return true}catch(d){throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","float"))}};VEValidator.ValidateInt=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateInt";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","int"));try{if(isNaN(parseInt(b))||parseFloat(b)!=parseInt(b))throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","int"));return true}catch(d){throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","int"))}};VEValidator.ValidateNonNegativeInt=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateNonNegativeInt";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidnonnegativeint_text.replace("%1",c));try{if(isNaN(parseInt(a))||parseFloat(a)!=parseInt(a)||parseInt(a)<0)throw new VEException(b,"err_invalidargument",L_invalidnonnegativeint_text.replace("%1",c));return true}catch(d){throw new VEException(b,"err_invalidargument",L_invalidnonnegativeint_text.replace("%1",c))}};VEValidator.ValidateFunction=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateFunction";if(b==null||typeof b!="function")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","function"))};VEValidator.ValidateNonNull=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateNonNull";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","non null"))};VEValidator.ValidateBetween=function(b,e,d,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateBetween";if(b<d||b>c)throw new VEException(a,"err_invalidargument",L_invalidbetweenint_text.replace("%1",e).replace("%2",d).replace("%3",c))};VEValidator.ValidateBoolean=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateBoolean";if(b!=true&&b!=false)throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","bool"))};VEValidator.ValidateMapStyle=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateMapStyle";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","MapStyle"));if(a=="r"||a=="R"||a=="s"||a=="S"||a=="a"||a=="A"||a=="o"||a=="O"||a=="b"||a=="B"||a=="h"||a=="H")return true;throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","MapStyle"))};VEValidator.ValidateMapMode=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a="")a="VEValidator.ValidateMapMode";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","MapMode"));if(b==VEMapMode.Mode2D||b==VEMapMode.Mode3D)return true;throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","MapMode"))};VEValidator.ValidateDistanceUnit=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateDistanceUnit";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDistanceUnit"));if(b==VEDistanceUnit.Miles||b==VEDistanceUnit.Kilometers)return true;throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDistanceUnit"))};VEValidator.ValidateMaxZoom=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateMaxZoom";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","ValidateMaxZoom"));if(b<=Msn.VE.API.Globals.vemaxzoom)return true;throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","ValidateMaxZoom"))};VEValidator.ValidateLayerType=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateLayerType";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDataType"));if(a==VEDataType.GeoRSS||a==VEDataType.VECollection||a==VEDataType.VETileSource)return true;throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDataType"))};VEValidator.ValidateDashboardSize=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateDashboardSize";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDashboardSize"));if(a==VEDashboardSize.Normal||a==VEDashboardSize.Small||a==VEDashboardSize.Tiny)return true;throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDashboardSize"))};VEValidator.ValidateMiniMapSize=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateMiniMapSize";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEMiniMapSize"));if(b==VEMiniMapSize.Small||b==VEMiniMapSize.Large)return true;throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEMiniMapSize"))};VEValidator.ValidateAltitudeMode=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateAltitudeMode";if(b==null)throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEAltitudeMode"));if(b!=VEAltitudeMode.Absolute&&b!=VEAltitudeMode.RelativeToGround)throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEAltitudeMode"));return true};VEValidator.ValidateObject=function(b,c,e,d){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateObject";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","non null"));if(!(b instanceof e))throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2",d))};VEValidator.ValidateObjectArray=function(a,d,f,e){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateObject";if(a==null||typeof a=="undefined"||a.length==null||typeof a.length=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",d).replace("%2","array"));for(var c=0;c<a.length;++c)if(a[c]==null||typeof a[c]=="undefined"||!(a[c]instanceof f))throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",d).replace("%2",e))};VEValidator.ValidateOrientation=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateOrientation";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEOrientation"));if(a!=VEOrientation.North&&a!=VEOrientation.East&&a!=VEOrientation.West&&a!=VEOrientation.South)throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEOrientation"))};VEValidator.ValidateBounds=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateBounds";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VELatLongRectangle"));if(a.TopLeftLatLong==null||a.BottomRightLatLong==null||a.TopLeftLatLong.Latitude<=a.BottomRightLatLong.Latitude||a.TopLeftLatLong.Longitude>=a.BottomRightLatLong.Longitude)throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VELatLongRectangle"))};VEValidator.GetCaller=function(b){if(b!=null||b!=""){try{var a=b.toString().match(/function (\w*)/)[1]}catch(c){a=""}if(a==null||a.length==0)return"";else return a}else return""};function VEPushpin(f,e,d,h,g,c,b,a){VEValidator.ValidateNonNull(f,"pinId");VEValidator.ValidateNonNull(e,"veLatLong");var i=this;this.IsInLayer=false;this.ID=f;this.LatLong=e;this.Title=h;if(d==null||d=="undefined"||d.length==0)this.Iconurl=Msn.VE.API.Constants.iconurl;else this.Iconurl=d;this.Details=g;if(c==null||c=="undefined"||c.length==0)this.IconStyle="";else this.IconStyle=c;if(b==null||b=="undefined"||b.length==0)this.TitleStyle="VE_Pushpin_Popup_Title";else this.TitleStyle=b;if(a==null||a=="undefined"||a.length==0)this.DetailsStyle="VE_Pushpin_Popup_Body";else this.DetailsStyle=a;if(window.ero==null||window.ero=="undefined")window.ero=ERO.getInstance()}VEPushpin.ShowDetailOnMouseOver=true;VEPushpin.OnMouseOverCallback=null;VEPushpin.prototype.Dispose=function(){this.DetailsStyle==null;this.TitleStyle=null;this.IconStyle=null;this.Details=null;this.IconUrl=null;this.Title=null;this.LatLong=null;this.ID=null;this.m_vemapcontrol=null;this.m_vemap=null};VEPushpin.Hide=function(a){if(window.ero!=null){if(a=="undefined"||a==null)a=false;window.ero.hide(a)}};VEPushpin.GetEroContent=function(c,b,e,d){var a="<p>";if(c!=null&&c!="undefined"&&c.length>0)a+='<div class="'+e+'">'+unescape(c)+"</div>";if(b!=null&&b!="undefined"&&b.length>0)a+='<div class="'+d+'">'+unescape(b)+"</div>";if(!document.all&&(c.length==0||b.length==0))a+="<br/><br/>";a+="</p>";return a};VEPushpin.Show=function(l,m,k,h,d,c,g,e){var a=VEMap._GetMapFromGUID(l);if(a==null||a=="undefined")return;var i=a.vemapcontrol.GetX(h)+a.GetLeft(),j=a.vemapcontrol.GetY(k)+a.GetTop();if(VEPushpin.ShowDetailOnMouseOver){var b=$ID(m+"_"+a.GUID);if(b!=null&&b!="undefined"){var f=VEPushpin.GetEroContent(d,c,g,e);window.ero.setContent(f);window.ero.setBoundingArea(null);window.ero.getBoundingArea().move(Gimme.Screen.getScrollPosition());window.ero.dockToElement(b)}}if(VEPushpin.OnMouseOverCallback!=null)VEPushpin.OnMouseOverCallback(i,j,d,unescape(c))};VEPushpin.Show3D=function(a,c,b,f,d){if(VEPushpin.ShowDetailOnMouseOver){var e=VEPushpin.GetEroContent(c,b,f,d);window.ero.setContent(e);ero.setGlitz(false,false,false,true);window.ero.dockToRect(a,null,-1)}if(VEPushpin.OnMouseOverCallback!=null)VEPushpin.OnMouseOverCallback(a.getP1().x,a.getP1().y,c,unescape(b))};function GetContent(){var g=this.ID+"_"+this.m_vemap.GUID,a="<img class='"+this.IconStyle+"' src='"+this.Iconurl+"' id='"+g+"' ",f=Msn.VE.Environment.BrowserInfo;if(f.Type==Msn.VE.BrowserType.MSIE&&parseFloat(f.MajorVersion)<7&&this.Iconurl!=null&&this.Iconurl.search(/.gif$/)<0)a+='onload=\'this.onload="";if(this.fileSize!=-1){this.style.width=this.width;this.style.height=this.height;this.src="'+Msn.VE.API.Constants.spacerurl+'";this.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\\"'+this.Iconurl+'\\", sizingMethod=\\"scale\\")";}\' ';var e=this.Title!=null&&this.Title!="undefined"&&this.Title.length>0,d=this.Details!=null&&this.Details!="undefined"&&this.Details.length>0;if(e||d){var b="if (VEMap._GetMapFromGUID("+this.m_vemap.GUID+").FireEvent(",c="))return;";a+=" onmouseout='"+b+'"onmouseout"'+c+"VEPushpin.Hide();' ";a+=" onmousedown='"+b+'"onmousedown"'+c+"VEPushpin.Hide(true);' ";a+=" onmouseover='"+b+'"onmouseover"'+c+'VEPushpin.Show("'+this.m_vemap.GUID+'","'+this.ID+'",'+this.LatLong.Latitude+","+this.LatLong.Longitude;if(e)a+=', "'+escape(this.Title)+'"';else a+=',""';if(d)a+=', "'+escape(this.Details)+'"';else a+=',""';a+=',"'+this.TitleStyle+'"';a+=',"'+this.DetailsStyle+'"';a+=");' "}a+="/>";return a}VEPushpin.DisposeERO=function(){if(window.ero!=null&&window.ero!="undefined"){window.ero.destroy();window.ero=null}};VEPushpin.prototype._SetMapInstance=function(a){this.m_vemap=a;this.m_vemapcontrol=a.vemapcontrol};VEPushpin.prototype.GetContent=GetContent;function GetImageFullUrl(a){var b="";if(a&&a.constructor==String&&a.length>0){var c=new Image;c.src=a;b=c.src}return b}function VE_ScratchpadManager(){}VE_ScratchpadManager.AddGeoLocation=function(){return};VE_ScratchpadManager.AddLocation=VE_ScratchpadManager.AddGeoLocation;VE_Scratchpad=VE_ScratchpadManager;function VEMessage(b){VEValidator.ValidateObject(b,"vemap",VEMap,"VEMap");this.m_vemap=b;var a=this;this.Show=function(g){if(g==null||g=="undefined"||g.length<=0)return;g=c(g);if(this.vemessagepanel==null||this.vemessagepanel=="undefined"){var d=document.createElement("div");d.id=this.m_vemap.ID+"_vemessagepanel";d.className="VE_Message";d.style.zIndex=Msn.VE.API.Globals.vemessagepanelzIndex;var i=this.m_vemap.GetHeight()/2-Msn.VE.API.Globals.vemessagepanelheight/2;if(i<0)i=0;d.style.top=i+"px";d.style.left=30+"px";var h=this.m_vemap.GetWidth()-60;if(h<30)h=30;d.style.width=h+"px";d.style.height=Msn.VE.API.Globals.vemessagepanelheight+"px";d.style.position="absolute";this.vemessagepanel=d;var e=document.createElement("a");e.className="VE_Message_Title";e.style.zIndex=parseInt(Msn.VE.API.Globals.vemessagepanelzIndex)+1;e.style.top="1px";e.style.left="1px";e.style.width=parseInt(this.vemessagepanel.style.width)-5+"px";e.innerHTML=IOSec.EncodeHtml(L_error_text);e.unselectable="on";this.vemessagepanel.appendChild(e);var f=document.createElement("a");f.className="VE_Message_Close";f.style.zIndex=parseInt(Msn.VE.API.Globals.vemessagepanelzIndex)+2;f.style.top="1px";f.style.right="1px";f.onclick=a.Hide;f.unselectable="on";f.innerHTML=L_close_text;this.vemessagepanel.appendChild(f);var b=document.createElement("div");b.id=this.m_vemap.ID+"_vemessagepanel_body";b.className="VE_Message_Body";b.style.zIndex=parseInt(Msn.VE.API.Globals.vemessagepanelzIndex)+3;b.style.top=22+"px";b.style.left=0+"px";b.style.width=parseInt(this.vemessagepanel.style.width)-8+"px";b.onclick=a.Hide;b.unselectable="on";b.innerHTML=g;this.vemessagepanel.appendChild(b);this.m_vemap.AddControl(this.vemessagepanel,Msn.VE.API.Globals.vemessagepanelzIndex)}else{var b=$ID(this.m_vemap.ID+"_vemessagepanel_body");b.innerHTML=g}this.vemessagepanel.style.display="block";mvcViewFacade.ShowShimIfSupported(this.vemessagepanel);this.timeoutIntervalID=window.setInterval(this.Hide,10000)};this.Hide=function(){if(a.vemessagepanel!=null&&a.vemessagepanel!="undefined"){a.vemessagepanel.style.display="none";HideShim(a.vemessagepanel);if(a.timeoutIntervalID!=null){window.clearInterval(a.timeoutIntervalID);a.timeoutIntervalID=null}}};this.Dispose=function(){if(this.vemessagepanel!=null&&this.vemessagepanel!="undefined")this.vemessagepanel=null};function c(a){var b=/<a[^>]*>/gi;a=a.replace(b,"");b=/<\/a>/gi;a=a.replace(b,"");return a}}function VEAmbiguouslist(vemap){VEValidator.ValidateNonNull(vemap,"vemap");this.m_vemap=vemap;var self=this;this.ID=this.m_vemap.ID+"_veplacelistpanel";this.Show=function(a,onSelectCallback,callbackOnClose){var body=null,veambiglistHide="VEMap._GetMapFromGUID('"+this.m_vemap.GUID+"').m_veambiguouslist.Hide();",veambiglistSetViewport="VEMap._GetMapFromGUID('"+this.m_vemap.GUID+"').vemapcontrol.SetViewport";if(this.veplacelistpanel==null||this.veplacelistpanel=="undefined"){var e=document.createElement("div");e.id=this.ID;e.className="VE_PlaceList";e.style.top=this.m_vemap.GetHeight()/2-Msn.VE.API.Globals.veplacelistpanelheight/2+"px";e.style.left=this.m_vemap.GetWidth()/2-Msn.VE.API.Globals.veplacelistpanelwidth/2+"px";e.style.width=Msn.VE.API.Globals.veplacelistpanelwidth+"px";e.style.height=Msn.VE.API.Globals.veplacelistpanelheight+"px";e.style.position="absolute";this.veplacelistpanel=e;var title=document.createElement("a");title.className="VE_PlaceList_Title";title.style.zIndex=parseInt(Msn.VE.API.Globals.veplacelistpanelzIndex)+1;title.style.width=parseInt(Msn.VE.API.Globals.veplacelistpanelwidth)-5+"px";title.style.top="1px";title.style.left="1px";title.style.height="20px";title.innerHTML=IOSec.EncodeHtml(L_selectlocation_text);title.unselectable="on";this.veplacelistpanel.appendChild(title);var cb=document.createElement("a");cb.className="VE_PlaceList_Close";cb.id=this.m_vemap.ID+"_veplaceListclose";cb.style.zIndex=parseInt(Msn.VE.API.Globals.veplacelistpanelzIndex)+2;cb.style.top="1px";cb.style.right="1px";cb.unselectable="on";cb.innerHTML=L_close_text;this.veplacelistpanel.appendChild(cb);body=document.createElement("div");body.id=this.m_vemap.ID+"_veplacelistbody";body.style.zIndex=300;body.style.height=Msn.VE.API.Globals.veplacelistpanelheight-38+"px";body.style.width=Msn.VE.API.Globals.veplacelistpanelwidth-8+"px";body.className="VE_PlaceList_Body";this.veplacelistpanel.appendChild(body);this.m_vemap.AddControl(this.veplacelistpanel,Msn.VE.API.Globals.veplacelistpanelzIndex)}else body=$ID(this.m_vemap.ID+"_veplacelistbody");var cb=$ID(this.m_vemap.ID+"_veplaceListclose");if(callbackOnClose==true)cb.onclick=function(){eval(veambiglistHide+onSelectCallback+"();")};else cb.onclick=self.Hide;body.innerHTML="";for(var i=0;i<a.length;i++){if(a[i]==null||a[i]=="undefined")continue;var loc=document.createElement("div");loc.id="veplacelistpanel_body_loc"+i;loc.className="VE_PlaceList_Location";loc.style.position="relative";loc.style.zIndex=parseInt(Msn.VE.API.Globals.veplacelistpanelzIndex)+4;loc.unselectable="on";if(a[i].name)if(onSelectCallback!=null&&onSelectCallback!="undefined")loc.innerHTML='<a onclick="javascript:'+veambiglistHide+onSelectCallback+"('"+a[i].name+"', "+a[i].latitude+", "+a[i].longitude+');">'+a[i].name+"</a>";else loc.innerHTML='<a onclick="javascript:'+veambiglistHide+'">'+a[i].name+"</a>";else if(onSelectCallback!=null&&onSelectCallback!="undefined")loc.innerHTML='<a onclick="javascript:'+veambiglistHide+onSelectCallback+"('"+a[i][0].replace("'","\\'")+"', "+a[i][1]+", "+a[i][2]+", "+a[i][3]+", "+a[i][4]+');">'+a[i][0]+"</a>";else loc.innerHTML='<a onclick="javascript:'+veambiglistHide+veambiglistSetViewport+"("+a[i][1]+", "+a[i][2]+", "+a[i][3]+", "+a[i][4]+');">'+a[i][0]+"</a>";body.appendChild(loc)}this.veplacelistpanel.style.display="block";mvcViewFacade.ShowShimIfSupported(this.veplacelistpanel)};this.Hide=function(){if(self.veplacelistpanel!=null&&self.veplacelistpanel!="undefined"){HideShim(self.veplacelistpanel);self.veplacelistpanel.style.display="none"}};this.IsVisible=function(){var a=false;if(this.veplacelistpanel!=null&&this.veplacelistpanel!="undefined"&&this.veplacelistpanel.style.display!="none")a=true;return a};this.Dispose=function(){DestroyShim(self.veplacelistpanel);if(this.veplacelistpanel!=null&&this.veplacelistpanel!="undefined")this.veplacelistpanel=null}}function VEGraphicsManager(G){VEValidator.ValidateObject(G,"vemap",VEMap,"VEMap");var a=this;this._spacecontrol=null;this._hackUniqueLayerId="UniqueLayer_Hack";var V=null;this._entityIdShapePostfix="_Shape";this.m_vemap=G;this.m_vemapcontrol=this.m_vemap.vemapcontrol;var c=null,n=false,w=1,e=null;this._useOffset=VEShapeAccuracy.None;this._drawOverMaxShapes=VEFailedShapeRequest.DrawInaccurately;this._failRequest=VEFailedShapeRequest.DrawInaccurately;var U=null,x=null,g=[],b=[],i={},f=false,d=null;this.m_spec=null;var r=null,j=null,k=true,T=Msn.VE.API.Constants.iconurl,s=0,l=new _xy1;this.SetDisplayThreshold=function(a){s=a};this.Initialize=function(){if(this.m_vegraphiccanvas==null||this.m_vegraphiccanvas=="undefined"){this.m_vegraphicspolylines=[];this.m_vegraphicspolygons=[];var b=document.createElement("div");b.id="rootgraphicshape";this.m_vemapcontrol.SetChildDiv(b);this.m_vegraphiccanvas=Msn.Drawing.Graphic.CreateGraphic(b,this.m_vemapcontrol);this.m_vegraphiccanvas.SetZIndex(17);this.m_vemapcontrol.AttachEvent("onstartzoom",a.OnStartZoom);this.m_vemapcontrol.AttachEvent("onchangeview",a.Update);this.m_vemapcontrol.AttachEvent("onmapoffsetreset",a.OnMapOffsetReset);this.m_vemapcontrol.AttachEvent("oninitmode",a.UpdateViewMode);if(window.ero==null||window.ero=="undefined")window.ero=ERO.getInstance()}};this.UpdateViewMode=function(){if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D){a.DrawAll3DPushpins();a.Draw()}else{_spacecontrol=null;a.ClearAll();a.Update()}};this.Update=function(){if(a.m_vemap.GetMapMode()!=Msn.VE.MapActionMode.Mode3D){a.Clear();a.Draw()}n=false};this.OnStartZoom=function(){a.Clear();if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode2D){if(!d)return;var h=d.GetCollectionCount();for(var c=0;c<h;c++){var f=d.GetCollectionByIndex(c),g=f.GetShapeCount();for(var e=0;e<g;e++){var b=f.Annotations[e];if(b._isDrawn){a.HideShape(b);a.HideIcon(b)}b._isHiddenForZoom=true}}}};this.OnMapOffsetReset=function(){if(a.m_vemap.GetMapMode()!=Msn.VE.MapActionMode.Mode3D)n=true};this.Clear=function(){if(a.m_vegraphiccanvas!=null&&a.m_vegraphiccanvas!="undefined")a.m_vegraphiccanvas.Clear()};function C(a){var b=false;if(a.minX>e.x1&&a.minY>e.y1&&a.maxX<e.x2&&a.maxY<e.y2)b=true;return b}function K(a){if(typeof a=="undefined"||a.type==VEShapeType.Pushpin)return false;if(a.minX==null||a.minY==null||a.maxX==null||a.maxY==null){var b=null;b=Msn.Drawing.ComputeBoundingBox(a.points);if(b){a.minX=b[0];a.minY=b[1];a.maxX=b[2];a.maxY=b[3]}else return false}var d=true;d=IsRecIntersect(c.x1,c.y1,c.x2,c.y2,a.minX,a.minY,a.maxX,a.maxY);return d}function E(c){if(!C(c)){var a=e;if(a==null)return false;var b=null;b=VE_LineClip.Clip(c.points,a.x1,a.y1,a.x2,a.y2);if(b){c.points=b;return true}}return false}function J(b){if(K(b)){var f=b.points;if(!C(b)){var c=e;if(c==null)return;var d=null;d=VE_LineClip.Clip(f,c.x1,c.y1,c.x2,c.y2);if(d)b.points=d}a.m_vegraphiccanvas.DrawPrimitive(b);b.points=f}}function L(b){a.m_vemap.m_velayermanager=b;d=b.VE_LayerManager;j=d.GetCollectionListDiv();a.m_vemapcontrol.SetChildDiv(j);a.m_spec=new VELatLongFactorySpecFromMap(a.m_vemap);r=new VELatLongFactory(b.m_spec)}function t(d){if(c==null||d){c=GetCurrentMapViewBounds(a.m_vemapcontrol);e=GetBufferedMapViewBounds(w,c)}currentOffetScene=null;if(a.m_vemapcontrol.IsMapViewOblique()){var b=a.m_vemapcontrol.GetObliqueScene();if(b!=null)currentOffetScene=b.GetID()}}function v(){f=false;g=[];b=[];for(var a in i)i[a]=null}function o(a){i[a.GetId()]=null}function m(b){var c=a.m_vemapcontrol.GetObliqueScene();if(a.m_vemapcontrol.IsMapViewOblique()&&c!=null){if(i[b.GetId()]==null){i[b.GetId()]=b;g.push(b)}}else v()}function I(e){try{var p=a.m_vemapcontrol.GetObliqueScene();if(a.m_vemapcontrol.IsMapViewOblique()&&p!=null){var n=p.GetID();if(x!=n){for(var c=0;c<b.length;c++)g.push(b[c]);f=true}else if(e!=null)for(var c=0,d=0;c<b.length&&d<e.length;c++){var k=true,l=[];if(e[d]!=null){var j=a.m_vemapcontrol.PixelToLatLong(e[d],a.m_vemapcontrol.GetZoomLevel());b[c]._OffsetScene=n;b[c]._OffsetLatLong=r.CreateVELatLong(j.latitude,j.longitude);l.push(e[d])}else k=false;if(b[c].GetPrimitive(0).type!=VEShapeType.Pushpin){b[c]._OffsetPoints=[];var i=b[c].GetPrimitive(0).points.length/2,q=[];while(i>0){d++;if(e[d]==null){k=false;d=d+i-1;i=0}else{var j=a.m_vemapcontrol.PixelToLatLong(e[d],a.m_vemapcontrol.GetZoomLevel());b[c]._OffsetPoints.push(r.CreateVELatLong(j.latitude,j.longitude));i--;l.push(e[d])}}}o(b[c]);if(k){h(b[c]);if(b[c]._OffsetCallBack)b[c]._OffsetCallBack(l)}else{b[c]._OffsetScene=null;b[c]._OffsetLatLong=null;b[c]._OffsetPoints=null;if(a._failRequest==VEFailedShapeRequest.DoNotDraw){if(b[c]._OffsetCallBack)b[c]._OffsetCallBack(null)}else if(a._failRequest==VEFailedShapeRequest.DrawInaccurately){b[c]._OffsetScene=-1;h(b[c]);b[c]._OffsetScene=null;if(b[c]._OffsetCallBack)b[c]._OffsetCallBack(null)}else if(a._failRequest==VEFailedShapeRequest.QueueRequest){f=true;m(b[c])};}d++}else for(var c=0;c<b.length;c++){o(b[c]);if(a._failRequest==VEFailedShapeRequest.DoNotDraw){if(b[c]._OffsetCallBack)b[c]._OffsetCallBack(null)}else if(a._failRequest==VEFailedShapeRequest.DrawInaccurately){b[c]._OffsetScene=-1;h(b[c]);b[c]._OffsetScene=null;if(b[c]._OffsetCallBack)b[c]._OffsetCallBack(null)}else if(a._failRequest==VEFailedShapeRequest.QueueRequest){f=true;m(b[c])};}}else v()}catch(s){throw s}finally{b=[];if(f){f=false;a.PushOffsetRequest()}}}this.PushOffsetRequest=function(){var k=a.m_vemapcontrol.GetObliqueScene();if(f||b.length!=0)f=true;else if(!a.m_vemapcontrol.IsMapViewOblique()||k==null)v();else if(g.length>0){var e=Msn.VE.API.Constants.maxasynlatlongs,d=[];while(g.length>0&&e>0){var c=g.shift();if(c.GetPrimitive(0).type!=VEShapeType.Pushpin&&c.GetPrimitive(0).points.length/2>e-1){var j=c.GetPrimitive(0).points;if(j.length/2>Msn.VE.API.Constants.maxasynlatlongs-1){o(c);if(a._drawOverMaxShapes==VEFailedShapeRequest.DoNotDraw){if(c._OffsetCallBack)c._OffsetCallBack(null)}else if(a._drawOverMaxShapes==VEFailedShapeRequest.DrawInaccurately){c._OffsetScene=-1;h(c);if(c._OffsetCallBack)c._OffsetCallBack(null)};}else{g.unshift(c);e=0}}else if(c._OffsetScene!=k.GetID()){b.push(c);d.push(new Msn.VE.LatLong(c.Latitude,c.Longitude));e--;if(c.GetPrimitive(0).type!=VEShapeType.Pushpin){var j=c.GetPrimitive(0).points;for(var i=0;i<j.length;i=i+2){d.push(new Msn.VE.LatLong(j[i+1],j[i]));e--}}}else o(c)}if(g.length>0)f=true;if(d!=null&&d.length>0){x=k.GetID();a.m_vemapcontrol.LatLongToPixelAsync(d,a.m_vemapcontrol.GetZoomLevel(),I)}}};function S(){if(!d)return;MC_MAX_COL_SIZE=200;var e=d.GetCollectionCount();if(e<1)return;t();for(var c=0;c<e;c++){var b=d.GetCollectionByIndex(c);b._index=c;MC_MAX_COL_SIZE=Math.max(MC_MAX_COL_SIZE,b.GetShapeCount());if(!F(b))q(b)}a.PushOffsetRequest()}function F(b){if(!d)return false;if(b.GetType()==MC_COL_TYPE_TILEIMAGE)return false;b._mapGuid=a.m_vemap.GUID;if(!b.GetVisibility())return false;var o=b.GetShapeCount();if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D){if(VE_CheckModuleStatus(VE_ModuleName.API3D)=="loaded")mvcViewFacade._curMvcView._DrawCollectionLayer(b);return true}var n=a.m_vemapcontrol.GetZoomLevel();if(n>b.MaxScale||n<b.MinScale)return false;t();var f=b.GetBoundingBox();if(o>0&&!IsBoundsIntersect(c,f))return false;if(b.Spec!=null&&b.Spec.IconUrl!=null&&b.Spec.IconUrl!="undefined")T=b.Spec.IconUrl;var g=$ID(b.GetId());if(g==null){g=document.createElement("div");g.setAttribute("id",b.GetId());j.appendChild(g)}if(a.m_vemapcontrol.IsMapViewOblique())q(b);var m=true;k=true;if(IsContainedInView(e,f)){k=false;m=IsDisplayShape(a.m_vemap.vemapcontrol,s,f.x1,f.y1,f.x2,f.y2)}for(var l=0;l<o;l++){var i=b.Annotations[l];i._shplayer=b;i.SetIndex(l);if(!h(i,g))p(i);if(!m)break}k=true;return true}function h(b,g){if(b.GetVisibility()){if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D){if(VE_CheckModuleStatus(VE_ModuleName.API3D)=="loaded")mvcViewFacade._curMvcView._DrawEntity(b,null,false,false,b._shplayer);return}var o=a.m_vemapcontrol.GetZoomLevel();if(o>b.maxZoomLevel||o<b.minZoomLevel)return false;t();var i=D(b),j;if(i&&b.GetPrimitive(0).type==VEShapeType.Pushpin&&b._OffsetScene==currentOffetScene){var q=l.Decode(b._OffsetLatLong);j=new VELatLongRectangle(q,q)}else j=b.GetBoundingBox();if(!IsBoundsIntersect(c,j))return false;if(typeof g=="undefined"||g==null)g=H(b.iid);var e=b.GetPrimitive(0),f=null,d=null;if(i)p(b);var h=b._isDrawn;if(e.type!=VEShapeType.Pushpin){var d=null;if(b._isDrawn)if(b._isHiddenForZoom||n){d=u(b,true);a.ShowShape(b)}else d=u(b,false);else{var k=true;k=IsDisplayShape(a.m_vemap.vemapcontrol,s,e.minX,e.minY,e.maxX,e.maxY);if(k){if(i)if(b._OffsetScene==currentOffetScene)try{b.SetUseOffset(true);d=y(a.m_vemapcontrol,e,b.GetIndex(),b.GetTitle())}catch(r){throw r}finally{b.SetUseOffset(false)}else m(b);else d=y(a.m_vemapcontrol,e,b.GetIndex(),b.GetTitle());if(document.all&&d){d.style.zIndex=b.GetZIndexPolyShape();g.appendChild(d)}if(d)h=true;e._shapeElement=d}}}if(b.GetIconVisibility())if(b._isDrawn){if(b._isHiddenForZoom||n){d=B(b);if(d&&e.isLabel)a.ShowIcon(b)}}else{if(b.IconUrl==null)b.IconUrl=Msn.VE.API.Constants.iconurl;f=N(b);if(f){f.style.zIndex=b.GetZIndex();g.appendChild(f);f.innerHTML=VECreateVEShapeERO(b,a.m_vemap.GUID);e._iconElement=f;h=true}}b._isDrawn=h;b._isHiddenForZoom=false;return h}}function u(f,d){var c=f.GetShapeElement();if(c){var b=f.GetPrimitive(0),g=b.points,e=false;if(k)e=E(b);d=d||e||b._isClipped;c=a.m_vemapcontrol.GetGraphic().UpdatePoints(a.m_vemapcontrol,b,c,d);b.points=g;b._isClipped=e}return c}function B(d){var b=d.GetIconElement();if(b){var c=A(d);if(c){var e=a.m_vemapcontrol.GetPushpinMapPixel(new Msn.VE.LatLong(c.Latitude,c.Longitude),a.m_vemapcontrol.GetZoomLevel());b.style.left=MathRound(e.x)-25/2+"px";b.style.top=MathRound(e.y)-25/2+"px"}else b=null}return b}function O(c){var b=c.GetShapeElement();if(b)b=a.m_vemapcontrol.GetGraphic().UpdateStyle(a.m_vemapcontrol,c.GetPrimitive(0),b);return b}function M(b){var c=b.GetIconElement();if(c){if(b.IconUrl==null)b.IconUrl=Msn.VE.API.Constants.iconurl;c.style.zIndex=b.GetZIndex();c.innerHTML=VECreateVEShapeERO(b,a.m_vemap.GUID)}return c}this.ShowShape=function(b){var a=null;if(b.GetPrimitive(0).type!=VEShapeType.Pushpin){a=b.GetShapeElement();if(a)a.style.display="block"}return a};this.HideShape=function(b){var a=null;if(b.GetPrimitive(0).type!=VEShapeType.Pushpin){a=b.GetShapeElement();if(a)a.style.display="none"}return a};this.ShowIcon=function(b){var a=b.GetIconElement();if(a)a.style.display="block";return a};this.HideIcon=function(b){var a=b.GetIconElement();if(a)a.style.display="none";return a};function N(d){if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D)return null;var b=d.GetPrimitive(0),f=null,e=b.iid;if(b.type!=VEShapeType.Pushpin)e=Msn.Drawing.GetLabelUID(b.iid);var c=A(d);if(c!=null)return a.m_vemap.vemapcontrol.AddPushpin(e,c.Latitude,c.Longitude,25,25,"VEAPI_Pushpin",null,Msn.VE.API.Globals.vepushpinpanelzIndex-1,null,true);else return null}function A(a){var b=null;if(D(a))if(a._OffsetScene==currentOffetScene)b=l.Decode(a._OffsetLatLong);else m(a);else b=new VELatLong(a.Latitude,a.Longitude);return b}function D(b){if(a._useOffset==VEShapeAccuracy.None||currentOffetScene==null||b._OffsetScene==-1)return false;else if(a._useOffset==VEShapeAccuracy.Pushpin)return b.GetPrimitive(0).type==VEShapeType.Pushpin;else if(a._useOffset==VEShapeAccuracy.All)return true;else return false}function y(c,a,g,f){if(!a||!a.points||a.points.length<1||typeof a.points[0]=="undefined")return;if(a.type==VEShapeType.Pushpin&&(a.symbol==null||a.symbol!=null&&a.symbol.id==MC_PROPERTY_PUSHPIN))a.symbol=VE_MapDispatch_SymbolLib.GetMapSymbolByID(MC_PROPERTY_PUSHPIN);else if(a.symbol==null){var b=VE_MapDispatch_SymbolLib.GetCurrentDefaultSymbol();if(b)a.symbol=b.Clone()}var e=a.points,d=null;if(k)a._isClipped=E(a);d=c.GetGraphic().CreatePrimitive(c,a,f);a.points=e;return d}function R(){if(!d)return;var b=d.GetCollectionCount();if(b<1)return;for(var a=0;a<b;a++){var c=d.GetCollectionByIndex(a);q(c)}}function q(c){if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D)if(VE_CheckModuleStatus(VE_ModuleName.API3D)=="loaded")mvcViewFacade._curMvcView._ClearCollectionLayer(c);if(c.GetType()==MC_COL_TYPE_TILEIMAGE)return;var b=null;b=$ID(c.GetId());if(b==null)return null;if(!document.all||b&&b.hasChildNodes()){var e=c.GetShapeCount();for(var d=0;d<e;d++)p(c.Annotations[d]);b.innerHTML=""}return b}function p(b){if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D)if(VE_CheckModuleStatus(VE_ModuleName.API3D)=="loaded")mvcViewFacade._curMvcView._ClearEntity(b);z(b.GetPrimitive(0));b._isDrawn=false;b._isHiddenForZoom=false}function z(d){var a=null,b=null,e=d.iid;if(d.type!=VEShapeType.Pushpin){e=Msn.Drawing.GetLabelUID(d.iid);b=$ID(d.iid);if(b&&b.parentNode)b.parentNode.removeChild(b)}a=$ID(e);if(!a)return null;a.detachEvent("onmouseover",VEShowVEShapeERO);a.detachEvent("onmouseout",VEHideVEShapeERO);a.detachEvent("onclick",VEShowVEShapeERO);a.parentNode.removeChild(a);var c=a.vePushpin;if(typeof c!="undefined"&&c!=null){c.Destroy();c.innerHtml="";c=null}}function H(b){var a=d.ParseInternalID(b);if(a&&a[1])return parentElement=P(a[1],false,j);else return j}function P(b,d,c){var a=null;a=$ID(b);if(a&&d)a.innerHTML="";if(!a){a=document.createElement("div");a.setAttribute("id",b);c.appendChild(a)}return a}this.InitLayerManager=L;this.DrawAll=S;this.DrawLayer=F;this.DrawEntity=h;this.ClearAll=R;this.ClearLayerDom=q;this.ClearPrimitiveDom=z;this.ClearEntityDom=p;this.UpdatePoints=u;this.UpdateIconPoints=B;this.UpdateStyle=O;this.UpdateIconStyle=M;this.Draw=function(){c=GetCurrentMapViewBounds(a.m_vemapcontrol);e=GetBufferedMapViewBounds(w,c);if(!document.all)a.m_vemapcontrol.resetSvgLayer();VE_LatLongThreshold.IsNotInit=true;a.DrawAll();if(a.m_vegraphicspolylines!=null&&a.m_vegraphicspolylines.length>0){var d=a.m_vegraphicspolylines.length;for(var b=0;b<d;b++){var f=a.m_vegraphicspolylines[b];a.DrawOne(f,true,e)}}if(a.m_vegraphicspolygons!=null&&a.m_vegraphicspolygons.length>0){var h=a.m_vegraphicspolygons.length;for(var b=0;b<h;b++){var g=a.m_vegraphicspolygons[b];a.DrawOne(g,false,e)}}};this.DrawOne=function(b,i,k){if(typeof b=="undefined"||b==null)return;if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D){Q(b,i,k);return}else a._spacecontrol=null;if(k==null){c=GetCurrentMapViewBounds(a.m_vemapcontrol);e=GetBufferedMapViewBounds(w,c)}a.m_vegraphiccanvas.resetOffset();var j=b.GetLatLongs(),d=[];for(var g=0;g<j.length;g++){var h=l.Decode(j[g]);d.push(parseFloat(h.Longitude));d.push(parseFloat(h.Latitude))}var f;if(i)f=new Msn.Drawing.PolyLine(d);else f=new Msn.Drawing.Polygon(d);a.m_vegraphiccanvas.SetZIndex(17);a.m_vegraphiccanvas.SetStroke(b.Stroke);J(f)};function Q(d,g){if(typeof d=="undefined"||d==null)return;if(!a._spacecontrol)a._spacecontrol=a.m_vemapcontrol.Get3DControl();var m=d.GetLatLongs(),e=[];for(var h=0;h<m.length;h++){var i=l.Decode(m[h]);e.push(i.Longitude);e.push(i.Latitude)}var f;if(g)f=new Msn.Drawing.PolyLine(e);else f=new Msn.Drawing.Polygon(e);a.m_vegraphiccanvas.SetZIndex(17);a.m_vegraphiccanvas.SetStroke(d.Stroke);var o=d.ID,n=a._hackUniqueLayerId,k=ConvertPointArrayToView3DParameter(f.points),c=GetPrimitiveSymbolOrDefault(f,d.Stroke),p=ConvertStrokeWeightToView3DParameter(c.stroke_weight),b="Linecolor='"+c.stroke_color+"'"+" Lineweight='"+p+"'"+" Dashstyle='"+c.stroke_dashstyle+"'"+" Lineopacity='"+c.stroke_opacity+"'",j=o+a._entityIdShapePostfix;if(g)a._spacecontrol.AddPolylineWithProperties(n,j,k,b);else if(!g){b=b.concat(" Fillcolor='",c.fill_color,"'");b=b.concat(" Fillopacity='",c.fill_opacity,"'");b=b.concat(" Lineopacity='",c.stroke_opacity,"'");a._spacecontrol.AddPolygonWithProperties(n,j,k,b)}}}VEGraphicsManager.prototype.RemoveLine=function(a){this.RemoveLinebyId(a.ID)};VEGraphicsManager.prototype.RemoveLinebyId=function(b){if(this.m_vegraphiccanvas==null||this.m_vegraphiccanvas=="undefined"){throw new VEException("VEMap:RemoveLinebyId","err_GraphicsInitError",L_GraphicsInitError_Text);return}var c=this.m_vegraphicspolylines.length,a=0;while(a<c&&b!=this.m_vegraphicspolylines[a].ID)a++;if(a<c)this.m_vegraphicspolylines.splice(a,1);else{throw new VEException("VEMap:RemoveLinebyId","err_GraphicsInitError",L_invalidpolylineid_text);return}if(this.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D)this.Clear3DShape(b);else{this.Clear();this.Draw()}};VEGraphicsManager.prototype.RemoveAllLines=function(){if(this.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D)this.ClearAll3DShape();this.m_vegraphicspolylines=[];this.Clear();this.Draw()};VEGraphicsManager.prototype.DrawLine=function(a){if(this.m_vegraphiccanvas==null||this.m_vegraphiccanvas=="undefined"){throw new VEException("VEMap:DrawLine","err_GraphicsInitError",L_GraphicsInitError_Text);return}VEValidator.ValidateObject(a,"vePolyline",VEPolyline,"VEPolyline");var c=this.m_vegraphicspolylines.length;for(var b=0;b<c;b++)if(a.ID==this.m_vegraphicspolylines[b].ID)throw new VEException("VEMap:DrawLine","err_invalidpolylineid",L_invalidpolylineid_text);this.m_vegraphicspolylines.push(a);this.DrawOne(a,true)};VEGraphicsManager.prototype.RemovePolygon=function(a){this.RemovePolygonbyId(a.ID)};VEGraphicsManager.prototype.RemovePolygonbyId=function(b){if(this.m_vegraphiccanvas==null||this.m_vegraphiccanvas=="undefined"){throw new VEException("VEMap:RemovePolygonbyId","err_GraphicsInitError",L_GraphicsInitError_Text);return}var c=this.m_vegraphicspolygons.length,a=0;while(a<c&&b!=this.m_vegraphicspolygons[a].ID)a++;if(a<c)this.m_vegraphicspolygons.splice(a,1);else{throw new VEException("VEMap:RemovePolygonbyId","err_GraphicsInitError",L_invalidpolygonid_text);return}if(this.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D)this.Clear3DShape(b);else{this.Clear();this.Draw()}};VEGraphicsManager.prototype.RemoveAllPolygons=function(){if(this.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D)this.ClearAll3DShape();this.m_vegraphicspolygons=[];this.Clear();this.Draw()};VEGraphicsManager.prototype.DrawPolygon=function(a){if(this.m_vegraphiccanvas==null||this.m_vegraphiccanvas=="undefined"){throw new VEException("VEMap:DrawPolygon","err_GraphicsInitError",L_GraphicsInitError_Text);return}VEValidator.ValidateObject(a,"vePolygon",VEPolygon,"VEPolygon");var c=this.m_vegraphicspolygons.length;for(var b=0;b<c;b++)if(a.ID==this.m_vegraphicspolygons[b].ID)throw new VEException("VEMap:DrawPolygon","err_invalidpolygonid",L_invalidpolygonid_text);this.m_vegraphicspolygons.push(a);this.DrawOne(a,false)};VEGraphicsManager.prototype.Dispose=function(){if(this.m_vegraphiccanvas!=null){this.m_vegraphiccanvas.Clear();this.m_vegraphiccanvas.Destroy();this.m_vegraphiccanvas=null}if(this.m_vegraphicspolylines!=null&&this.m_vegraphicspolylines!="undefined"){var b=this.m_vegraphicspolylines.length;for(var a=0;a<b;a++)this.m_vegraphicspolylines.pop().Dispose()}if(this.m_vegraphicspolygons!=null&&this.m_vegraphicspolygons!="undefined"){var c=this.m_vegraphicspolygons.length;for(var a=0;a<c;a++)this.m_vegraphicspolygons.pop().Dispose()}if(this.m_vemap!=null){this.m_vemapcontrol.DetachEvent("onchangeview",this.Update);this.m_vemapcontrol.DetachEvent("onobliquechange",this.Update);this.m_vemapcontrol.DetachEvent("onstartzoom",this.Clear)}};VEGraphicsManager.prototype.DrawAll3DPushpins=function(){if(this.m_vemap.GetMapMode()!=Msn.VE.MapActionMode.Mode3D)return;if(!this.m_vemap.pushpins)return;if(typeof this._spacecontrol=="undefined"||this._spacecontrol==null)this._spacecontrol=this.m_vemapcontrol.Get3DControl();if(!this._spacecontrol)return;var c=this.m_vemap.pushpins,e=c.length;for(var a=0;a<e;a++){var b=c[a],d=b.LatLong;this.Add3DPushpin(b.ID,d.Latitude,d.Longitude,25,25,"VEAPI_Pushpin",b,Msn.VE.API.Globals.vepushpinpanelzIndex-1)}};VEGraphicsManager.prototype.Add3DPushpin=function(b,e,f,n,l,g,d,m){var h=f,j=e,k=this._hackUniqueLayerId,o='text=""',c;c=GetImageFullUrl(d.Iconurl);var i=b;this.m_vemapcontrol.Get3DControl().AddPointWithProperties(k,i,j,h,c,o);var a=null;if(!$ID(b)){a=this.m_vemapcontrol.AddPushpin(b,e,f,n,l,g,d.GetContent(),m,"VEAPI_Pushpin",false,false);if(a)a.style.display="none"}};VEGraphicsManager.prototype.Remove3DPushpin=function(a){if(typeof this._spacecontrol=="undefined"||this._spacecontrol==null)this._spacecontrol=this.m_vemapcontrol.Get3DControl();this.Clear3DShape(a);this.m_vemapcontrol.RemovePushpin(a)};VEGraphicsManager.prototype.ClearAllPushpins=function(b){if(typeof this._spacecontrol=="undefined"||this._spacecontrol==null)this._spacecontrol=this.m_vemapcontrol.Get3DControl();var d=b.length;for(var c=0;c<d;c++){var a=b.pop();if(!a.IsInLayer){this.Clear3DShape(a.ID);a.Dispose()}}this.m_vemapcontrol.ClearPushpins()};VEGraphicsManager.prototype.ClearAll3DShape=function(){var c=null,b=0;if(this.m_vegraphicspolylines!=null&&this.m_vegraphicspolylines!="undefined"){b=this.m_vegraphicspolylines.length;for(var a=0;a<b;a++){c=this.m_vegraphicspolylines[a];this.Clear3DShape(c.ID)}}if(this.m_vegraphicspolygons!=null&&this.m_vegraphicspolygons!="undefined"){b=this.m_vegraphicspolygons.length;for(var a=0;a<b;a++){c=this.m_vegraphicspolygons[a];this.Clear3DShape(c.ID)}}};VEGraphicsManager.prototype.Clear3DShape=function(c){var a=c;this._spacecontrol.DeleteGeometry(this._hackUniqueLayerId,a);var b=a+this._entityIdShapePostfix;this._spacecontrol.DeleteGeometry(this._hackUniqueLayerId,b)};function ConvertPointArrayToView3DParameter(a){var b="",c=a.length;for(i=0;i<c;i+=2){var d=a[i],e=a[i+1];b+=d+","+e+" "}return b}function ConvertStrokeWeightToView3DParameter(a){if(a==null)return"";var c=a.length,b=a.substring(0,c-2);return b+"px"}function GetPrimitiveSymbolOrDefault(c,b){var a=c.symbol;if(a==null){if(typeof b!="undefined"){c.symbol=new VEShapeStyle;a=c.symbol;a.stroke_weight=b.width+"pt";a.joinstyle=b.linejoin;a.stroke_color=b.color.ToHexString();a.stroke_dashstyle=b.linecap;a.stroke_opacity=b.color.A.toString();a.fill_color=b.fillcolor.ToHexString();a.fill_opacity=b.fillcolor.A.toString();return a}else if(_defaultSymbol==null){_defaultSymbol=new VEShapeStyle;_defaultSymbol.id=MC_PROPERTY_DEFAULT;c.symbol=_defaultSymbol}return _defaultSymbol}return a}function VELatLong(b,a,c,d){this.Latitude=null;this.Longitude=null;this.Altitude=null;this.AltitudeMode=null;this._reserved=null;if(b!=null){VEValidator.ValidateFloat(b,"latitude");this.Latitude=b}if(a!=null){VEValidator.ValidateFloat(a,"longitude");this.Longitude=a}if(c!=null)this.SetAltitude(c,d)}VELatLong.prototype.SetAltitude=function(b,a){VEValidator.ValidateFloat(b,"altitude");this.Altitude=b;if(a!=null){VEValidator.ValidateAltitudeMode(a,"altitudeMode");this.AltitudeMode=a}else this.AltitudeMode=VEAltitudeMode.Default};VELatLong.prototype.HasAltitude=function(){return this.Altitude!=null};function Clone(){var a=new VELatLong;a.Latitude=this.Latitude;a.Longitude=this.Longitude;a._reserved=this._reserved;a.Altitude=this.Altitude;a.AltitudeMode=this.AltitudeMode;return a}function toString(){var a="";if(this.Latitude!=null&&this.Longitude!=null)a=this.Latitude+", "+this.Longitude;if(this.Altitude!=null)a+=", "+this.Altitude;return a}VELatLong.prototype.toString=toString;VELatLong.prototype.Clone=Clone;function VELatLongRectangle(d,c,b,a){VEValidator.ValidateObject(d,"topLeftLatLong",VELatLong,"VELatLong");VEValidator.ValidateObject(c,"bottomRightLatLong",VELatLong,"VELatLong");this.TopLeftLatLong=d;this.BottomRightLatLong=c;if(b!=null&&b!="undefined"){VEValidator.ValidateObject(b,"topRightLatLong",VELatLong,"VELatLong");this.TopRightLatLong=b}if(a!=null&&a!="undefined"){VEValidator.ValidateObject(a,"bottomLeftLatLong",VELatLong,"VELatLong");this.BottomLeftLatLong=a}}VEAltitudeMode=new function(){this.Default="Ground";this.Absolute="Datum";this.RelativeToGround="Ground"};function _xy1(){var a=new _xz1;this.Decode=function(c){VEValidator.ValidateObject(c,"veLatLong",VELatLong,"VELatLong");var b=c.Clone();if(b.Latitude==null||b.Longitude==null&&b._reserved!=null){var d=a.Decode(b._reserved);b.Latitude=d[0];b.Longitude=d[1];b._reserved=null}return b}}function VELatLongFactoryAlwaysEncodeSpec(){this.IsEncode=function(){return true}}function VELatLongFactorySpecFromMap(a){VEValidator.ValidateObject(a,"vemap",VEMap,"VEMap");var b=a;this.IsEncode=function(){var a=b.GetMapStyle();return a==VEMapStyle.Birdseye||a==VEMapStyle.BirdseyeHybrid}}function VELatLongFactorySpecFromMapView(a){VEValidator.ValidateNonNull(a,"mapView");var b=a;this.IsEncode=function(){return Msn.VE.MapStyle.IsViewOblique(b.mapStyle)}}function VELatLongFactory(a){VEValidator.ValidateNonNull(a,"veLatLongFactorySpec");var c=a,b=new _xz1;this.CreateVELatLong=function(e,d){var a=null;if(c.IsEncode()){a=new VELatLong;a._reserved=b.Encode(e,d)}else a=new VELatLong(e,d);return a}}function VEPolyline(d,c,a,b){VEValidator.ValidateNonNull(d,"id");VEValidator.ValidateNonNull(c,"arrVELatLong");this.ID=d;this.LatLongs=c;this.Stroke=new Msn.Drawing.Stroke;if(a==null||a=="undefined")a=new VEColor(17,221,17,.7);this.SetColor(a);if(b==null||b=="undefined")b=6;this.SetWidth(b)}function SetColor(a){VEValidator.ValidateNonNull(a);this.Stroke.color=new Msn.Drawing.Color(a.R,a.G,a.B,a.A)}function SetWidth(a){VEValidator.ValidateInt(a,"width");this.Stroke.width=a}function GetLatLongs(){return this.LatLongs}function Dispose(){this.ID=null;this.LatLongs=null;this.Stroke=null}VEPolyline.prototype.SetColor=SetColor;VEPolyline.prototype.SetWidth=SetWidth;VEPolyline.prototype.GetLatLongs=GetLatLongs;VEPolyline.prototype.Dispose=Dispose;function VEPolygon(e,d,c,a,b){VEValidator.ValidateNonNull(e,"id");VEValidator.ValidateNonNull(d,"arrVELatLong");this.ID=e;this.LatLongs=d;this.Stroke=new Msn.Drawing.Stroke;if(c==null||c=="undefined")c=new VEColor(17,221,17,.7);this.SetFillColor(c);if(a==null||a=="undefined")a=new VEColor(17,221,17,.7);this.SetOutlineColor(a);if(b==null||b=="undefined")b=6;this.SetOutlineWidth(b)}function SetFillColor(a){VEValidator.ValidateNonNull(a);this.Stroke.fillcolor=new Msn.Drawing.Color(a.R,a.G,a.B,a.A)}function SetOutlineColor(a){VEValidator.ValidateNonNull(a);this.Stroke.color=new Msn.Drawing.Color(a.R,a.G,a.B,a.A)}function SetOutlineWidth(a){VEValidator.ValidateInt(a,"width");this.Stroke.width=a}function GetLatLongs(){return this.LatLongs}function Dispose(){this.ID=null;this.LatLongs=null;this.Stroke=null}VEPolygon.prototype.SetFillColor=SetFillColor;VEPolygon.prototype.SetOutlineColor=SetOutlineColor;VEPolygon.prototype.SetOutlineWidth=SetOutlineWidth;VEPolygon.prototype.GetLatLongs=GetLatLongs;VEPolygon.prototype.Dispose=Dispose;function VEColor(d,c,b,a){VEValidator.ValidateInt(d,"r");VEValidator.ValidateBetween(d,"r",0,255);VEValidator.ValidateInt(c,"g");VEValidator.ValidateBetween(c,"g",0,255);VEValidator.ValidateInt(b,"b");VEValidator.ValidateBetween(b,"b",0,255);VEValidator.ValidateFloat(a,"a");VEValidator.ValidateBetween(a,"a",0,1);Msn.Drawing.Color.call(this,d,c,b,a)}var L_integerencodingoutofrange_text="VEIntegerEncoding: The number encoded is out of supported range",L_floatintegermapencodingoutofrange_text="VEFloatIntegerMap: The number encoded is out of supported range",L_integerencodinginvalidstringlength_text="VEIntegerEncoding: Invalid string length",L_integerencodingunknowndigit_text="VEIntegerEncoding: The encoded string has an unknown digit";function VEIntegerEncoding(g,j){var e=g,d=g.length,a=j,h=1;for(var i=0;i<a;++i)h*=d;var f=h-1,c=[];for(var b=0;b<e.length;++b)c[e.substr(b,1)]=b;this.MaxValue=function(){return f};this.ValueLength=function(){return a};this.Encode=function(c){if(c<=f){var h="",g=[];for(var b=0;b<a;++b)g[b]=0;var i=a-1;while(c>0){g[i]=Math.floor(c%d);c=Math.floor(c/d);--i}for(var b=0;b<g.length;++b)h+=e.substr(g[b],1);return h}else throw L_integerencodingoutofrange_text};this.Decode=function(c){if(c.length==a){var b=0;for(var e=0;e<c.length;++e){b*=d;b+=this.DigitValue(c.substr(e,1))}return b}else throw L_integerencodinginvalidstringlength_text};this.DigitValue=function(a){if(c[a]!=null&&c[a]!="undefined")return c[a];else throw L_integerencodingunknowndigit_text}}function VEFloatIntegerMap(e,d,f){var a=e,c=d,b=f;this.MinFloat=function(){return a};this.MaxFloat=function(){return c};this.MaxInt=function(){return b};this.FloatToInt=function(d){if(d>=a&&d<=c){var e=(d-a)/(c-a),f=e*b+.5;return Math.min(Math.floor(f),b)}else throw L_floatintegermapencodingoutofrange_text};this.IntToFloat=function(d){if(d<=b){var f=d/b,e=a+f*(c-a);return e}else throw L_floatintegermapencodingoutofrange_text}}var L_velatlongencodinginvalidstringlength_text="_xz1: Invalid string length";function _xz1(b){var i=-90,h=90,g=-180,f=180,j="0123456789bcdfghjkmnpqrstvwxyz",e=6;if(b!=null&&typeof b!="undefined")e=b;var a=new VEIntegerEncoding(j,e),d=new VEFloatIntegerMap(i,h,a.MaxValue()),c=new VEFloatIntegerMap(g,f,a.MaxValue());this.Encode=function(e,b){var f=a.Encode(d.FloatToInt(e))+a.Encode(c.FloatToInt(b));return f};this.Decode=function(f){if(f.length==2*a.ValueLength()){var e=a.ValueLength(),j=f.substr(0,e),h=f.substr(e,e),i=a.Decode(j),g=a.Decode(h),b=[];b[0]=d.IntToFloat(i);b[1]=c.IntToFloat(g);return b}else throw L_velatlongencodinginvalidstringlength_text}}function _xz1ForMobile(){_xz1.call(this,5)}VEMapMode=new function(){this.Mode2D=1;this.Mode3D=2};function VEMapViewSpecification(c,d,e,g,f){this.LatLong=null;this.ZoomLevel=null;this.Altitude=null;this.Pitch=null;this.Heading=null;if(c!=null&&c!="undefined"){VEValidator.ValidateObject(c,"veLatLong",VELatLong,"VELatLong");this.LatLong=c}if(d!=null&&d!="undefined"){VEValidator.ValidateNonNegativeInt(d,"zoomLevel");this.ZoomLevel=d}if(e!=null&&e!="undefined"){VEValidator.ValidateFloat(e,"altitude");this.Altitude=parseFloat(e)}if(g!=null&&g!="undefined"){VEValidator.ValidateFloat(g,"pitch");var a=parseFloat(g);a=a%360;if(a<-90)a=-90;if(a>90)a=90;this.Pitch=a}if(f!=null&&f!="undefined"){VEValidator.ValidateFloat(f,"heading");var b=parseFloat(f);b=b%360;if(b<0)b+=360;this.Heading=b}}function MapViewSpecClone(){var a=new VEMapViewSpecification;a.LatLong=this.LatLong.Clone();a.Altitude=this.Altitude;a.Pitch=this.Pitch;a.Heading=this.Heading;return veLatLong}VEMapViewSpecification.prototype.Clone=MapViewSpecClone;VEMapStyle=new function(){this.Road=Msn.VE.MapStyle.Road;this.Shaded=Msn.VE.MapStyle.Shaded;this.Aerial=Msn.VE.MapStyle.Aerial;this.Hybrid=Msn.VE.MapStyle.Hybrid;this.Oblique=Msn.VE.MapStyle.Oblique;this.Birdseye=Msn.VE.MapStyle.Oblique;this.BirdseyeHybrid=Msn.VE.MapStyle.ObliqueHybrid};VEOrientation=new function(){this.North=Msn.VE.Orientation.North;this.East=Msn.VE.Orientation.East;this.West=Msn.VE.Orientation.West;this.South=Msn.VE.Orientation.South};function VEBirdseyeScene(d){VEValidator.ValidateNonNull(d,"obliqueScene");var a=d,f=null,c=null,e=new VELatLongFactory(new VELatLongFactoryAlwaysEncodeSpec),b=new _xy1;this.PixelToLatLong=function(d,b,f){if(b!=null){VEValidator.ValidateNonNegativeInt(b,"zoomLevel");b=parseInt(b)}else b=VEMap._GetMapFromGUID(c).GetZoomLevel();if(f){VEValidator.ValidateObjectArray(d,"pixelArray",VEPixel,"VEPixel array");VEValidator.ValidateFunction(f,"callback");this.PixelToLatLongAsync(d,b,f)}else{VEValidator.ValidateObject(d,"pixel",VEPixel,"VEPixel");var g=a.PixelToLatLong(d,b);return e.CreateVELatLong(g.latitude,g.longitude)}};this.PixelToLatLongAsync=function(b,c,d){a.PixelToLatLongAsync(b,c,d)};this.LatLongToPixel=function(e,d,f){if(d!=null){VEValidator.ValidateNonNegativeInt(d,"zoomLevel");d=parseInt(d)}else d=VEMap._GetMapFromGUID(c).GetZoomLevel();if(f){VEValidator.ValidateObjectArray(e,"veLatLongArray",VELatLong,"VELatLong array");VEValidator.ValidateFunction(f,"callback");this.LatLongToPixelAsync(e,d,f)}else{VEValidator.ValidateObject(e,"veLatLong",VELatLong,"VELatLong");var g=b.Decode(e),h=new Msn.VE.LatLong(g.Latitude,g.Longitude);return a.LatLongToPixel(h,d)}};this.LatLongToPixelAsync=function(e,g,h){var f=[];for(var c=0;c<e.length;++c){var d=b.Decode(e[c]);f[c]=new Msn.VE.LatLong(d.Latitude,d.Longitude)}a.LatLongToPixelAsync(f,g,h)};this.IsValidTile=function(c,d,b){return a.IsValidTile(c,d,b)};this.GetID=function(){return a.GetID()};this.GetTileFilename=function(){return a.GetTileFilename()};this.GetThumbnailFilename=function(){return a.GetThumbnailFilename()};this.GetOrientation=function(){return a.GetOrientation()};this.GetBounds=function(){return a.GetBounds()};this.GetWidth=function(){return a.GetWidth()};this.GetHeight=function(){return a.GetHeight()};this.ContainsLatLong=function(d){VEValidator.ValidateObject(d,"veLatLong",VELatLong,"VELatLong");var c=b.Decode(d),e=new Msn.VE.LatLong(c.Latitude,c.Longitude);return a.ContainsLatLong(e)};this.ContainsPixel=function(d,e,b){var c=new VEPixel(d,e);return a.ContainsPixel(c,b)};this.SetClientToken=function(b){f=b;a.SetClientToken(b)};this.SetGUID=function(b){c=b;a.SetGUID(b)};this.GetBoundingRectangle=function(){var g=a.PixelToLatLong(new VEPixel(0,0),2),h=a.PixelToLatLong(new VEPixel(a.GetWidth(),a.GetHeight()),2),i=null;if(g&&h){var b=100,c=g.latitude,d=h.latitude,e=g.longitude,f=h.longitude;if(c<d){c=Math.floor(c*b)/b;d=Math.ceil(d*b)/b}else{c=Math.ceil(c*b)/b;d=Math.floor(d*b)/b}if(e<f){e=Math.floor(e*b)/b;f=Math.ceil(f*b)/b}else{e=Math.ceil(e*b)/b;f=Math.floor(f*b)/b}i=new VELatLongRectangle(new VELatLong(c,e),new VELatLong(d,f))}return i};this.GetBoundingRectangleNorthFacing=function(){var b=this.GetBoundingRectangle(),c=null;switch(a.GetOrientation()){case Msn.VE.Orientation.East:c=new VELatLongRectangle(new VELatLong(b.TopLeftLatLong.Latitude,b.BottomRightLatLong.Longitude),new VELatLong(b.BottomRightLatLong.Latitude,b.TopLeftLatLong.Longitude));break;case Msn.VE.Orientation.South:c=new VELatLongRectangle(new VELatLong(b.BottomRightLatLong.Latitude,b.BottomRightLatLong.Longitude),new VELatLong(b.TopLeftLatLong.Latitude,b.TopLeftLatLong.Longitude));break;case Msn.VE.Orientation.West:c=new VELatLongRectangle(new VELatLong(b.BottomRightLatLong.Latitude,b.TopLeftLatLong.Longitude),new VELatLong(b.TopLeftLatLong.Latitude,b.BottomRightLatLong.Longitude));break;default:c=b}return c}}VEMap.prototype.__HandleAuthentication=function(a){if(this.vemapcontrol)this.vemapcontrol.__HandleAuthentication(a)};function $VE_A(){}$VE_A.PgName={Ads:"Ads Response",AdsListing:"Ads",Business:"Business Listing",BusinessWebsite:"Business Website",Call:"Click to Call",CategoryBrowser:"Category Browser",Collection:"Collections",ColBrowser:"Collection Browser",DD:"Driving Directions",Default:"Default",Details:"Details",Email:"Email",ERO:"ERO",Fav:"Favorites",Help:"Help",Home:"Home Page",LLC:"Local Listing Center",MAB:"Map Action Bar",Map:"Map Control",Mobile:"Send to Mobile",Car:"Send To Car",PartyMap:"Party Map",PersonalLocations:"Personal Locations",PLink:"Permalink",Print:"Print",SP:"Scratchpad",SReq:"Search Request",SRes:"Search Response",Traffic:"Traffic",LocalizeMe:"Localize-me",WIP:"Welcome Panel",Inst3D:"Install 3D",Model3D:"3D Models",Quality3D:"3D Performance Options",Movie3D:"Movie Tour",TD:"Transit Directions",YP:"YellowPages"};$VE_A.MapMode=["ModeUnknown","Mode2D","Mode3D","ModeOblique"];$VE_A.analyticsEnabled=Msn.VE.API?false:true;$VE_A.logDelay=500;$VE_A.LogHelp=function(){$VE_A.Log($VE_A.PgName.Help,"Help")};function TrimLocationName(a){if(typeof a!="undefined"&&a!=null){var b=a.toString();if(b.indexOf("Location")>0)return b.replace("Location","");else return"MRU"}return""}$VE_A.FireLog3DPan=function(){$VE_A.Log($VE_A.PgName.Map,"3D PAN")};$VE_A.LogCategoryBrowser=function(a){if(a==null||typeof a=="undefined")return;if(a.EntryPoint!=null)s.prop17=a.EntryPoint;if(a.CategoryMode!=null)s.eVar13=a.CategoryMode;if(a.SearchId!=null)s.eVar15=a.SearchId;var b;if(a.IsSearchRequest){s.events="Event8";b=$VE_A.PgName.SReq;s.eVar24="Category"}else b=$VE_A.PgName.CategoryBrowser;if(a.CategoryId!=null)s.eVar14=a.CategoryId;$VE_A.Log(b,a.NavAction)};$VE_A.LogSearchResponse=function(a){if(a==null||typeof a=="undefined")return;s.events="Event10";if(a.CenterPoint!=null)$VE_A.SetProperties(null,map.GetMapMode()==Msn.VE.MapActionMode.ModeOblique?1:map.GetZoomLevel(),a.CenterPoint.Latitude,a.CenterPoint.Longitude);if(a.BoundingBox!=null){var b=a.BoundingBox.NorthEastCorner,c=a.BoundingBox.SouthWestCorner;s.prop30="("+b.Latitude+","+b.Longitude+"),("+c.Latitude+","+c.Longitude+")"}if(a.WhatString!=null&&a.WhatString!="")s.eVar22=a.WhatString;if(a.WhereString!=null&&a.WhereString!="")s.eVar23=a.WhereString;if(a.Classification!=null&&a.Classification!="")s.eVar25=a.Classification;if(a.SearchId!=null&&a.SearchId!="")s.eVar15=a.SearchId;if(a.PageNumber!=null&&a.PageNumber!=-1)s.prop7=a.PageNumber;if(a.LocalSearchResultCount!=null&&a.LocalSearchResultCount!=-1)s.prop27=a.LocalSearchResultCount;if(a.SortOrder!=null&&a.SortOrder!="")s.prop28=a.SortOrder;if(a.SuggestedSearchTerm!=null&&a.SuggestedSearchTerm!="")s.eVar19=a.SuggestedSearchTerm;if(a.DisambiguationCase!=null&&a.DisambiguationCase!="")s.prop41=a.DisambiguationCase;$VE_A.Log($VE_A.PgName.SRes,a.NavAction)};$VE_A.LogSearchNavAction=function(f,e,a,b,c,d){if(a!=null&&typeof a!="undefined")s.prop17=a;if(VE_SearchManager.searchId!=null)s.eVar15=VE_SearchManager.searchId;if(b!=null&&typeof b!="undefined")s.prop12=b;if(c!=null&&typeof c!="undefined")s.prop38=c;if(d!=null&&typeof d!="undefined")s.prop21=d;$VE_A.Log(f,e)};$VE_A.LogAdsResponse=function(k,j,m,l,o,p,i,f,h,d,c,b,g,a,e){if(i||b||a){s.events=i;var q=$VE_A.PgName.Ads,n="Ads Results";$VE_A.SetProperties(p,o,m,l);if(k!=null)s.eVar22=k;if(j!=null)s.eVar9=j;if(f!=null)s.eVar8=f;if(isFinite(parseInt(d)))s.eVar10=d;if(isFinite(parseInt(c)))s.eVar16=c;if(h!=null)s.eVar12=h;if(b!=null)s.prop18=b;if(g!=null)s.prop25=g;if(a!=null)s.prop19=a;if(e!=null)s.prop26=e;$VE_A.Log(q,n)}};$VE_A.LogUIPrint=function(a){s.events="Event11";s.eVar34=a;$VE_A.Log($VE_A.PgName.Print,"Print page invoked.")};$VE_A.LogAdClick=function(i,h,d,g,e,c,f){var a="Ad Click",b;switch(d){case 1:a+=" - click on title";b=$VE_A.PgName.BusinessWebsite;break;case 2:a+=" - click on Directions link";b=$VE_A.PgName.DD;break;case 3:a+=" - click on Website link";b=$VE_A.PgName.BusinessWebsite;break;case 8:a+=" - click on Phone link";b=$VE_A.PgName.AdsListing;break;case 10:a+=" - click on pushpin";b=$VE_A.PgName.ERO;break;case 64:a+=" - click on Audio link";b=$VE_A.PgName.BusinessWebsite;break;case 65:a+=" - click on Print Ad link";b=$VE_A.PgName.BusinessWebsite;break;case 66:a+=" - click on Coupon link";b=$VE_A.PgName.BusinessWebsite}$VE_A.SetAdClickProperties(i,h,g,e,c,f);$VE_A.Log(b,a,$VE_A.PgName.AdsListing)};$VE_A.LogAdEROClick=function(f,e,c,i,h,g,b,a,d){$VE_A.SetAdClickProperties(i,h,g,b,a,d);$VE_A.Log(f,e,c)};$VE_A.SetAdClickProperties=function(f,a,e,c,b,d){s.events="Event6";s.eVar12=c;s.eVar11=e;s.eVar30=b;s.eVar29=d;s.eVar8=f;if(a!=null)s.eVar9=a};$VE_A.SetProperties=function(d,c,b,a){if(d!=null)s.prop3=d;if(c!=null)s.prop4=c;if(b!=null&&a!=null)s.prop5=$VE_A.FormatLatLong(b,a)};$VE_A.LogSearch=function(){var a="",b="",c=$get("taskBar_Scopes_cs").value;s.eVar13="Single Box";if(Search_oneBox==="true")if(isFrontDoor)a=$get("sb_form_q").value;else a=$get("taskBar_qparam").value;else{s.eVar13="Double Box";if(isFrontDoor){a=$get("sb_form_q").value;b=$get("sb_form_q2").value}else{a=$get("taskBar_what").value;b=$get("taskBar_where").value}}var d=$get("taskBar_searchid");s.eVar15=d.value;s.events="Event8";s.eVar24=c;s.prop8=a?a:"";s.prop9=b?b:"";$VE_A.Log($VE_A.PgName.SReq,"Search Request - "+c)};$VE_A.LogSearchFromPermaLink=function(a){var c=a.WhatString,b;s.eVar13="Single Box";if(a.WhereString){b=a.WhereString;if(c)s.eVar13="Double Box"}s.eVar15=a.SearchId;s.events="Event8";s.eVar24=a.Classification;s.prop3=a.MapStyle;s.prop4=a.ZoomLevel;if(a.CenterPoint)s.prop5=$VE_A.FormatLatLong(a.CenterPoint.Latitude,a.CenterPoint.Longitude);s.prop8=c;s.prop9=b;$VE_A.Log($VE_A.PgName.SReq,"Search Request - "+a.Classification)};$VE_A.LogCollectionId=function(c,b,a){if(a)s.prop39=a;$VE_A.Log(c,b)};$VE_A.LogClick2Call=function(){if(VE_SearchManager.searchId!=null)s.eVar15=VE_SearchManager.searchId;if(VE_SearchManager.activeEntityId!=null)s.prop38=VE_SearchManager.activeEntityId;if(VE_SearchManager.activeIndex!=-1)s.prop12=VE_SearchManager.activeIndex;if(VE_SearchManager.activeBrandId!=null)s.prop21=VE_SearchManager.activeBrandId;if(ero.isInUse()){s.prop17=$VE_A.PgName.ERO;var a=VE_SearchManager.activeBrandId==null?"Search":VE_SearchManager.activeIsExploration?"Branded Exploration":"Branded Search";$VE_A.Log($VE_A.PgName.Call,a+" Result ERO - click on C2C")}else{s.prop17=$VE_A.PgName.SRes;$VE_A.Log($VE_A.PgName.Call,"Result item: click on C2C")}};$VE_A.LogSearchSend2Phone=function(){if(VE_SearchManager.searchId!=null)s.eVar15=VE_SearchManager.searchId;if(VE_SearchManager.activeEntityId!=null)s.prop38=VE_SearchManager.activeEntityId;if(VE_SearchManager.activeIndex!=-1)s.prop12=VE_SearchManager.activeIndex;if(VE_SearchManager.activeBrandId!=null)s.prop21=VE_SearchManager.activeBrandId;if(ero.isInUse()){s.prop17=$VE_A.PgName.ERO;var a=VE_SearchManager.activeBrandId==null?"Search":VE_SearchManager.activeIsExploration?"Branded Exploration":"Branded Search";$VE_A.Log($VE_A.PgName.Mobile,a+" Result ERO - click on S2M")}else{s.prop17=$VE_A.PgName.SRes;$VE_A.Log($VE_A.PgName.Mobile,"Result item: click on S2M")}};$VE_A.LogSendToCar=function(c,b){var d=$VE_A.PgName,e=d.Car,a="";switch(c){case SendToEntryPoints.Directions:a=VE_Directions.NavigationAction.SendToCar;break;case SendToEntryPoints.CollectionEditor:a="SP-Send to Car";break;case SendToEntryPoints.LocalSearchResult:a=b?"Search Result ERO - Send to car":"Search Result Panel - Send to car";break;case SendToEntryPoints.CollectionSearchResult:a=b?"Collection ERO - Send to car":"Collection Search Result Panel - Send to car";break;case SendToEntryPoints.LocationResult:a=b?"Place Result ERO - Send to car":"Place Result Panel - Send to car";break;case SendToEntryPoints.CollectionItem:a="Pushpin-Send to Car"}$VE_A.Log(e,a)};$VE_A.FormatLatLong=function(b,a){if(!b||!a){if(state&&state.GetLatitude()&&state.GetLongitude())return state.GetLatitude().toFixed(3)+","+state.GetLongitude().toFixed(3);return"0.0,0.0"}return b.toFixed(3)+","+a.toFixed(3)};$VE_A.LogTrafficActivation=function(a){if(s.events=="undefined"||s.events==null||s.events=="")s.events="Event12";else s.events+=",Event12";s.eVar1=a;if(window["map"])s.eVar3=map.GetCenterLatitude()+","+map.GetCenterLongitude();$VE_A.Log($VE_A.PgName.Traffic,"Traffic activated",a)};$VE_A.LogDirections=function(d,h,f,g,c,e,a,b,i){s.events="Event3";s.eVar1=d;s.eVar2=h;s.eVar3=f;s.eVar4=g;s.eVar5=c;s.eVar6=e;s.eVar31=a;s.eVar32=b;s.eVar33=i;$VE_A.Log($VE_A.PgName.DD,VE_Directions.NavigationAction.GetDirections)};$VE_A.LogTDEntryPoint=function(a){s.prop17=a;$VE_A.Log($VE_A.PgName.TD,"Open Transit Panel",a)};$VE_A.LogTDNavigationAction=function(b,a){if(a!=null)s.eVar36=a+1;$VE_A.Log($VE_A.PgName.TD,b)};$VE_A.LogTDirections=function(g,h,i,d,e,f,b,a,c){s.events="Event15";s.eVar2=g;s.eVar3=d+"/"+e;s.eVar4=f;s.eVar5=b;s.eVar6=c;s.eVar7=a;s.eVar26=h+"/"+i;$VE_A.Log($VE_A.PgName.TD,VE_Transit.NavigationAction.GetDirections)};$VE_A.LogPartyMap=function(b,d,c,a){s.events="Event16";s.eVar1=b;s.eVar2=d;s.eVar3=c;s.eVar6=a;$VE_A.Log($VE_A.PgName.PartyMap,"Party Map Invoked")};$VE_A.Log3DTour=function(c,b,a){if(typeof b=="string")s.prop17=b;if(typeof a=="string")s.prop44=a;$VE_A.Log($VE_A.PgName.Collection,"3DTour "+c)};$VE_A.Log3DTourVideo=function(b,a){if(typeof a=="string")s.prop37=a;$VE_A.Log($VE_A.PgName.Movie3D,b)};$VE_A.Log3DOblique=function(f,a,b,d,e,c){if($VE_A.analyticsEnabled&&typeof s!="undefined"&&s!=null){if(a!=null)s.prop46=a;if(b!=null)s.prop47=b;if(d!=null&&e!=null&&c!=null)s.prop49=d+","+e+","+c;$VE_A.Log($VE_A.PgName.Map,f)}};$VE_A.LogPersonalLocation=function(a,b,c){var d=a+" - "+TrimLocationName(b)+" "+c+" (Personal Location)";$VE_A.Log($VE_A.PgName.PersonalLocations,d)};$VE_A.LogDisambiguation=function(g,f,e,h,c,d,i,a,b){if(i)s.events="Event14";if(a&&a!=""){s.eVar13="Disambiguation";s.eVar25=a}s.eVar15=h;s.prop8=f;s.prop9=e;s.prop41=c;s.prop42=d;if(b)s.prop12=b;$VE_A.Log($VE_A.PgName.SRes,"Search Results: Disambiguation - "+g,"Disambiguation")};$VE_A.Log=function(f,d,c){if(window.s=="undefined"||window.s==null)return;if(!$VE_A.analyticsEnabled)return;s.pageName=f;if(s.events=="undefined"||s.events==null||s.events=="")s.events="Event9";else s.events+=",Event9";s.prop1="VirtualEarth";s.prop2=window.locale.toLowerCase();if(s.prop3=="")s.prop3=window["map"]?map.GetMapStyle():"";if(s.prop4=="")s.prop4=window["map"]?map.GetZoomLevel():"";if(s.prop5=="")s.prop5=window["map"]?$VE_A.FormatLatLong(map.GetCenterLatitude(),map.GetCenterLongitude()):"";s.prop6=d?d:"";if(s.prop8=="")s.prop8=$ID("what")?$ID("what").value==L_MainWhatHelp_Text?"":$ID("what").value:"";if(s.prop9=="")s.prop9=$ID("where")?$ID("where").value==L_SearchUseCurrentViewText_Text?state.GetStartWhere():$ID("where").value:"";s.prop13=window["map"]?$VE_A.MapMode[map.GetMode()]:"";s.prop36=window.usertype==undefined?1:usertype;s.charSet="UTF-8";s.prop50=g_omniFlightSuite;if(s.prop13==Msn.VE.MapActionMode.Mode3D){var a=map.GetCurrentMapView(),b=null;if(a.cameraLatlong!=null&&a.cameraLatlong!="undefined")b=a.cameraLatlong.latitude.toFixed(3)+","+a.cameraLatlong.longitude.toFixed(3);else b=a.latlong.latitude.toFixed(3)+","+a.latlong.longitude.toFixed(3);s.prop14=b+","+a.GetAltitude().toFixed(0)+","+a.GetTilt().toFixed(1)+","+a.GetDirection().toFixed(1)}else s.prop14="";if(!s.prop17&&c!=null)s.prop17=c;var e=$ID("logging");if(e)e.innerHTML=s.t();$VE_A.ResetLogProps()};$VE_A.ResetLogProps=function(){s.prop3="";s.prop4="";s.prop5="";s.prop6="";s.prop7="";s.prop8="";s.prop9="";s.prop10="";s.prop11="";s.prop12="";s.prop13="";s.prop14="";s.prop17="";s.prop18="";s.prop19="";s.prop21="";s.prop25="";s.prop26="";s.prop27="";s.prop28="";s.prop29="";s.prop30="";s.prop32="";s.prop33="";s.prop34="";s.prop35="";s.prop36="";s.prop37="";s.prop38="";s.prop39="";s.prop41="";s.prop42="";s.prop44="";s.prop45="";s.prop46="";s.prop47="";s.prop48="";s.prop49="";s.prop50="";s.prop51="";s.events="";s.eVar1="";s.eVar2="";s.eVar3="";s.eVar4="";s.eVar5="";s.eVar6="";s.eVar7="";s.eVar8="";s.eVar9="";s.eVar10="";s.eVar11="";s.eVar12="";s.eVar13="";s.eVar14="";s.eVar15="";s.eVar16="";s.eVar19="";s.eVar20="";s.eVar22="";s.eVar23="";s.eVar24="";s.eVar25="";s.eVar26="";s.eVar29="";s.eVar30="";s.eVar31="";s.eVar32="";s.eVar33="";s.eVar34="";s.eVar36="";s.campaign=""};var VE_ModuleName={APICORE:"__core__",APICONTROLS:"__controls__",APIBIRDSEYE:"__birdseye__",APILAYERS:"__layers__",APIFIND:"__find__",APIROUTING:"__routing__",APITRAFFIC:"__traffic__",API3D:"__3d__",APITILES:"__tiles__"},_VE_ModuleStatus={"__core__":"loaded","__layers__":null,"__controls__":null,"__find__":null,"__routing__":null,"__traffic__":null,"___3d__":null,"__birdseye__":null,"__tiles__":null};function _VE_InitAllModules(a){if(Msn.VE.API.Globals.vemapinstances||a==null){var b=Msn.VE.API.Globals.vemapinstances;for(var c in b)if(b[c]instanceof VEMap)b[c]._InitializeModules(a.split(","))}if(_VEDownloadQueue)_VEDownloadQueue.Fire(a)}function VE_GetLoadedAPIModules(){var b=[VE_ModuleName.APICORE,VE_ModuleName.APICONTROLS,VE_ModuleName.APIBIRDSEYE,VE_ModuleName.APILAYERS,VE_ModuleName.APIFIND,VE_ModuleName.APIROUTING,VE_ModuleName.APITRAFFIC,VE_ModuleName.API3D,VE_ModuleName.APITILES],c=[],d=b.length;for(var a=0;a<d;a++)if(VE_CheckModuleStatus(b[a])=="loaded")c.push(b[a]);return c}function VE_CheckModuleStatus(a){if(a==VE_ModuleName.API3D)a="_"+a;return _VE_ModuleStatus[a]}function VE_SetModuleStatus(a,b){if(a==null&&typeof _VE_ModuleStatus[a]=="undefined")return;if(a==VE_ModuleName.API3D)a="_"+a;_VE_ModuleStatus[a]=b}VE_RequestUrl=Msn.VE.API.Globals.vecurrentdomain+"/veapi.ashx?VEAPI_DisableAtlasCompat=true&v="+Msn.VE.API.Globals.vecurrentversion+"&__load__";function VEOndemandJsDownloads(l,a,d,g){var e=null;if(a==null||typeof a!="string"||typeof d!="object")throw new VEException("VEJsDownloadQueue:Fire","err_invalidmoduleurl",L_noscripturl_text);if(typeof g!="object")g=null;var j=false,h=false,b=null;b=a.split(",");var m=b.length,i=true,f=null;for(var c=0;c<m;c++){f=VE_CheckModuleStatus(b[c]);if(typeof f=="undefined")throw new VEException("VEJsDownloadQueue:Fire","err_invalidmoduleurl",L_noscripturl_text);else if(f==null){if(i){a=b[0];i=false}else a+=","+b[c];j=true;VE_SetModuleStatus(b[c],"loading")}else if(f=="loading")h=true}if(j){if(_VEDownloadQueue==null)_VEDownloadQueue=new VEJsDownloadQueue;var k=VE_RequestUrl+"="+a;_VEDownloadQueue.Push(a,d.GUID,g);if(l)VENetwork.DownloadScript(k);else VENetwork.DownloadScript(k,_VEDownloadQueue.Fire,a);e=null}else if(h){_VEDownloadQueue.Push(a,d.GUID,g);e=null}else e=d;return e}function VEJsDownloadQueue(){var a=[],c=[],b=[];this.Dispose=function(){a=[];c=[];b=[]};this.Push=function(d,f,e){if(typeof mapContext=="undefined")mapContext=null;a.push(e);c.push(d);b.push(f)};this.Fire=function(f){if(a.length==0)return;for(var d=0;d<a.length;d++)if(c[d]==f){if(b[d]){var e=null;e=Msn.VE.API.Globals.vemapinstances[b[d]];if(e&&typeof a[d][0]=="function")a[d][0].call(e,a[d][1],a[d][2],a[d][3],a[d][4]);else throw new VEException("VEJsDownloadQueue:Fire","err_invalidinvoketarget",L_invalidinvoketarget_text)}else a[d][0](a[d][1],a[d][2],a[d][3],a[d][4]);a.splice(d,1);c.splice(d,1);b.splice(d,1);d--}}}var _VEDownloadQueue=null;_VERegisterNamespaces("Msn.VE");Msn.VE.Animation={Animation:function(h,f){var b=false;this.Running=b;var e=h,d=f,a=null;function c(){if(b){e();a=setTimeout(c,d)}else a=null}function g(){if(!b){b=true;c();a=window.setTimeout(c,d)}}this.Start=g;function i(){if(a!=null){window.clearTimeout(a);a=null}b=false}this.Stop=i},AccelerationFunction:function(e){var b=null,a=200,d=e;this.setSteps=function(d){a=d;b=null;c()};this.getSteps=function(){return a};this.getValue=function(e){if(!b)c();var d=parseInt(Math.round(e*a));if(d<0)d=0;if(d>a)d=a;return b[d]};this.getTotal=function(){return this.getValue(1)};function c(){b=[];b[0]=0;for(var c=1;c<=a;c++)b[c]=b[c-1]+d(c/a)}},Movie:function(b,g){var a=this;this.Repeat=true;this.AppendContent=true;var e=[],c=-1,d=null;this.addFrame=function(b,a){if(a==null)a=true;var c={data:b,append:a};e.push(c)};this.start=function(){a.stop();a.show();a.clear();c=-1;d=setInterval(h,g)};this.stop=function(){if(d)clearInterval(d)};this.end=function(){a.stop();f(e.length-1)};this.show=function(){b.style.visibility="visible"};this.hide=function(){b.style.visibility="hidden"};this.clear=function(){b.innerHTML=""};function h(){c++;if(c>e.length-1){c=0;if(!a.Repeat){clearInterval(d);return}else a.clear()}f(c)}function f(c){var a=e[c];if(a.append)b.innerHTML+=a.data;else b.innerHTML=a.data}},RollDirection:{TopDown:1,RightLeft:2,BottomUp:4,LeftRight:8},RollStyle:{In:0,Out:1},Roller:function(q){var c=this;this.superclass=Msn.VE.OO.Eventable.EventableObject;this.superclass();var l=Msn.VE.Css,a=Msn.VE.Animation,h=Msn.VE.OO.Eventable,b=q,d=null,f=true,g=false,e=AccelerationFunctions.CrazyElevator,i=10,j=10,m=5,p={top:1,right:2,bottom:3,left:4},o={top:3,right:4,bottom:1,left:2};this.setAccelerationFunction=function(a){if(a instanceof Msn.VE.Animation.AccelerationFunction)e=a};this.setXLeave=function(a){if(typeof a=="number"&&a>=0)i=Math.floor(a,10)};this.setYLeave=function(a){if(typeof a=="number"&&a>=0)j=Math.floor(a,10)};this.getLeave=function(){return{x:i,y:j}};this.setDelay=function(a){if(typeof a=="number"&&a>0)m=Math.floor(a,10)};this.isExpanded=function(){return f};this.isRolling=function(){return g};this.isAssociated=function(){if(d!=null&&d.length>0)return true;return false};this.associate=function(a){if(a instanceof Array)d=a};this.rollIn=function(d){if(g)return;c.executeEvent("beforerollin",c,new h.EventArgs("beforerollin",b));k(a.RollStyle.In,d);f=false};this.rollOut=function(d){if(g)return;c.executeEvent("beforerollout",c,new h.EventArgs("beforerollout",b));k(a.RollStyle.Out,d);f=true};this.expand=function(b){k(a.RollStyle.Out,b,false);f=true};this.collapse=function(b){k(a.RollStyle.In,b,false);f=false};function k(u,k,t){g=true;if(t!==false)t=true;n();var f=p,q=0,r=0;if(u==a.RollStyle.Out){f=o;q=i;r=j}var y=b.offsetWidth,w=b.offsetHeight,A=y-i,B=w-j,C=A/e.getTotal(),D=B/e.getTotal(),x=e.getSteps();if(!t){v(1)();return}for(var s=0;s<=x;s++){var z=s/x;setTimeout(v(z),s*m)}function v(i){return function(){var m=parseInt(Math.round(e.getValue(i)*C))+q,n=parseInt(Math.round(e.getValue(i)*D))+r,j={top:0,right:0,bottom:0,left:0};if((k&a.RollDirection.TopDown)==a.RollDirection.TopDown){l.Functions.setClip(b,f.top,n+"px");j.top=n-r}if((k&a.RollDirection.RightLeft)==a.RollDirection.RightLeft){l.Functions.setClip(b,f.right,y-m+"px");j.right=-m+q}if((k&a.RollDirection.BottomUp)==a.RollDirection.BottomUp){l.Functions.setClip(b,f.bottom,w-n+"px");j.bottom=-n+r}if((k&a.RollDirection.LeftRight)==a.RollDirection.LeftRight){l.Functions.setClip(b,f.left,m+"px");j.left=m-q}if(d!=null){var p;for(p=0;p<d.length;p++){var o=d[p],t=j.top+j.bottom,x=o.origPos.y+t,s=j.left+j.right,v=o.origPos.x+s;if(s!=0)o.style.left=v+"px";if(t!=0)o.style.top=x+"px"}}if(i==1){g=false;if(u==a.RollStyle.In)c.executeEvent("afterrollin",c,new h.EventArgs("afterrollin",b));else{b.style.clip="rect(auto auto auto auto)";c.executeEvent("afterrollout",c,new h.EventArgs("afterrollout",b))}}c.executeEvent("roll",c,new h.EventArgs("roll",b))}}}function n(){var b=Msn.VE.Css;if(d==null)return;var c,i=d.length;for(c=0;c<i;c++){var a=d[c];a.origPos={x:parseInt(b.Functions.getComputedStyle(a,"left")),y:parseInt(b.Functions.getComputedStyle(a,"top"))};if(isNaN(a.origPos.x)){var f=parseInt(b.Functions.getComputedStyle(a,"marginLeft"),10),e=parseInt(b.Functions.getCoputedStyle(a,"paddingLeft"),10);a.origPos.x=a.offsetLeft-(isNaN(f)?0:f)-(isNaN(e)?0:e)}if(isNaN(a.origPos.y)){var h=parseInt(b.Functions.getComputedStyle(a,"marginTop"),10),g=parseInt(b.Functions.getComputedStyle(a,"paddingTop"),10);a.origPos.y=a.offsetTop-(isNaN(h)?0:h)-(isNaN(g)?0:g)}}b=null}},Slider:function(){var d=this,c=Msn.VE.Geometry,a=AccelerationFunctions.Linear,b=5;this.setAccelerationFunction=function(b){if(b instanceof Msn.VE.Animation.AccelerationFunction)a=b};this.setDelay=function(a){if(typeof a=="number"&&a>0)b=a};this.slideToPoint=function(e,i){var d=new c.Point(e.offsetLeft,e.offsetTop),n=d.getDistanceFrom(i);a.setSteps(Math.floor(n/10));var p=n/a.getTotal(),o=i.y-d.y,l=i.x-d.x,f=Math.atan(o/l),m=a.getSteps();for(var h=0;h<=m;h++){sum=a.getValue(h/m);var g=sum*p,k,j;if(l<0){k=d.y-Math.sin(f)*g;j=d.x-Math.cos(f)*g}else{k=d.y+Math.sin(f)*g;j=d.x+Math.cos(f)*g}setTimeout(q(j,k),h*b)}function q(a,b){return function(){e.style.top=parseInt(Math.round(b))+"px";e.style.left=parseInt(Math.round(a))+"px"}}}}};var AccelerationFunctions={Linear:new Msn.VE.Animation.AccelerationFunction(function(){return 1}),ExponentialAcc:new Msn.VE.Animation.AccelerationFunction(function(b){var a=0,d=1,c=d-a,f=a+b*c,e=Math.pow(f,2);return e}),ExponentialDec:new Msn.VE.Animation.AccelerationFunction(function(b){var a=-1,d=0,c=d-a,f=a+b*c,e=Math.pow(f,2);return e}),CosineWave:new Msn.VE.Animation.AccelerationFunction(function(b){var a=-Math.PI,d=Math.PI,c=d-a,f=a+b*c,e=Math.cos(f)+1;return e}),CrazyElevator:new Msn.VE.Animation.AccelerationFunction(function(b){var a=-5,d=5,c=d-a,f=a+b*c,e=2/(Math.pow(Math.abs(f),3)+1);return e})};_VERegisterNamespaces("Msn.VE.Geometry");Msn.VE.Geometry.Point=function(c,d){var a=this,b=Msn.VE.Geometry;this.x=c;this.y=d;this.add=function(c,d){var e=new b.Point(a.x+c,a.y+d);return e};this.getDistanceFrom=function(b){var c=Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2),d=Math.sqrt(c);return d}};Msn.VE.Geometry.Overlap={Range:{GreaterThanX:1,LessThanX:2,GreaterThanY:4,LessThanY:8,InXRange:16,InYRange:32,InRange:48},getInstance:function(f,g){var d=Msn.VE.Geometry.Overlap,a=f,b=g,c=0;e();function e(){if(b.getP2().x>a.getP2().x)c+=d.Range.GreaterThanX;if(b.getP1().x<a.getP1().x)c+=d.Range.LessThanX;if(b.getP2().y>a.getP2().y)c+=d.Range.GreaterThanY;if(b.getP1().y<a.getP1().y)c+=d.Range.LessThanY;if(a.getP1().x<=b.getP1().x&&b.getP2().x<=a.getP2().x)c+=d.Range.InXRange;if(a.getP1().y<=b.getP1().y&&b.getP2().y<=a.getP2().y)c+=d.Range.InYRange}this.getRange=function(){return c};this.getLeftXBleed=function(){if(c&d.Range.LessThanX)return Math.abs(a.getP1().x-b.getP1().x);else return 0};this.getRightXBleed=function(){if(c&d.Range.GreaterThanX)return b.getP2().x-a.getP2().x;else return 0};this.getTopYBleed=function(){if(c&d.Range.LessThanY)return Math.abs(a.getP1().y-b.getP1().y);else return 0};this.getBottomYBleed=function(){if(c&d.Range.GreaterThanY)return b.getP2().y-a.getP2().y;else return 0}}};Msn.VE.Geometry.Rectangle=function(h,i){var g=this,a=h,b=i,d,e;f();function f(){c()}this.move=function(c){a.x=c.x;a.y=c.y;b.x=c.x+e;b.y=c.y+d};this.getP1=function(){return a};this.getP2=function(){return b};this.setP1=function(b){a=b;c()};this.setP2=function(a){b=a;c()};this.getWidth=function(){return e};this.getHeight=function(){return d};this.containsPoint=function(c){return c.x>=a.x&&c.x<=b.x&&c.y>=a.y&&c.y<=b.y};this.scale=function(d){a.x-=d;a.y-=d;b.x+=d;b.y+=d;c()};this.getOverlap=function(a){var b=Msn.VE.Geometry;return new b.Overlap.getInstance(g,a)};function c(){d=b.y-a.y;e=b.x-a.x}};Msn.VE.Geometry.Functions={getSlope:function(a,b){return(b.y-a.y)/(b.x-a.x)},getYIntercept:function(b,a){return a.y-b*a.x},getBestBoundingPoint:function(f,b,c){var a=Msn.VE.Geometry;if(!b)b=g(f).getScreenPosition();var e=new a.Rectangle(b,new a.Point(b.x+f.offsetWidth,b.y+f.offsetHeight)),j=c.getOverlap(e),d=j.getRange();if((d&a.Overlap.Range.InRange)==a.Overlap.Range.InRange)return b;var h=b.x,i=b.y;if(d&a.Overlap.Range.GreaterThanX)h=c.getP2().x-e.getWidth();if(d&a.Overlap.Range.LessThanX)h=c.getP1().x;if(d&a.Overlap.Range.GreaterThanY)i=c.getP2().y-e.getHeight();if(d&a.Overlap.Range.LessThanY)i=c.getP1().y;return new a.Point(h,i)}};_VERegisterNamespaces("Msn.VE.OO.Eventable");Msn.VE.OO.Eventable.EventArgs=function(b,a){this.EventName=b;this.Recipient=a};Msn.VE.OO.Eventable.EventableObject=function(){if(typeof window.attachEvent!="undefined")window.attachEvent("onunload",c);var a=[];this.getEventHash=function(){return a};this.hookEvent=function(d,e){var c=a[d];if(typeof c=="undefined"||c==null){c=new b(d);a[d]=c}c.addEvent(e)};this.unhookEvent=function(d,e){var c=a[d];if(c instanceof b)c.removeEvent(e)};this.executeEvent=function(g,h,f){var d=a[g];if(!(d instanceof b))return;var e=d.getEvents(),c;for(c=0;c<e.length;c++)e[c].call(h,f)};function b(b){var c=b,a=[];this.addEvent=function(c){if(typeof c=="function"){var b;for(b=0;b<a.length;b++)if(a[b]==c)return;a.push(c)}};this.removeEvent=function(c){if(typeof c!="function")return;var b;for(b=0;b<a.length;b++)if(a[b]==c){a[b]=null;delete a[b];a.splice(b,1)}};this.destroy=function(){var b;for(b=0;b<a.length;b++){a[b]=null;delete a[b]}};this.getEvents=function(){return a}}function c(){var d;for(d in a)if(a[d]instanceof b){a[d].destroy();a[d]=null}a=null;window.detachEvent("onunload",c)}};var ERO={Classes:{ContainerNoBeak:"ero ero-noBeak",ContainerRightBeak:"ero ero-rightBeak",ContainerLeftBeak:"ero ero-leftBeak",Beak:"ero-beak",Shadow:"ero-shadow",Body:"ero-body",Actions:"ero-actions",ActionsBackground:"ero-actionsBackground",PreviewArea:"ero-previewArea",PaddingHack:"ero-paddingHack",ProgressAnimation:"ero-progressAnimation"},DefaultClasses:null,BeakDirection:{Right:0,Left:1},DockPosition:{Top:0,Center:1},m_theEro:null,BeakHeight:34,Glitz:function(d,e,b,c){var a=this;this.useBeak=d;this.useFade=e;this.useProgressTimer=b;this.isTemporary=c;this.copy=function(){return new ERO.Glitz(a.useBeak,a.useFade,a.useProgressTimer,a.isTemporary)}},EROEventArgs:function(c,a,b){this.superclass=Msn.VE.OO.Eventable.EventArgs;this.superclass(c,a);this.Entity=b},getInstance:function(){var a=Msn.VE.Geometry;if(!ERO.m_theEro){ERO.m_theEro=new b;ERO.m_theEro.setBoundingArea(null)}ERO.m_theEro.addToPage();return ERO.m_theEro;function b(){this.superclass=Msn.VE.OO.Eventable.EventableObject;this.superclass();var c=this,r=null,f=null,k=null,h=false,o=500,n=0,B=true,i=new ERO.Glitz(true,true,true,false),C=i.copy(),w=0,z=false,b=document.createElement("div");b.className=ERO.Classes.ContainerLeftBeak;if(typeof b.addEventListener!="undefined"){b.addEventListener("mouseover",x,false);b.addEventListener("mouseout",y,false)}else{b.attachEvent("onmouseover",x);b.attachEvent("onmouseout",y)}var s=document.createElement("div");s.className=ERO.Classes.Shadow;var j=document.createElement("div");j.className=ERO.Classes.Body;var q=document.createElement("div");q.className=ERO.Classes.Actions;var p=document.createElement("ul"),m=document.createElement("div");m.className=ERO.Classes.ActionsBackground;var l=document.createElement("div");l.className=ERO.Classes.PreviewArea;var t=document.createElement("div");t.className=ERO.Classes.Beak;var v=document.createElement("div");v.className=ERO.Classes.PaddingHack;b.appendChild(s);b.appendChild(t);s.appendChild(j);j.appendChild(m);m.appendChild(l);m.appendChild(q);q.appendChild(p);m.appendChild(v);var d=document.createElement("div");d.className=ERO.Classes.ProgressAnimation;var e=new Msn.VE.Animation.Movie(d,75);e.addFrame('<div class = "frame1"></div>');e.addFrame('<div class = "frame2"></div>');e.addFrame('<div class = "frame3"></div>');e.addFrame("");e.addFrame("");e.addFrame('<div class = "frame2"></div><div class = "frame3"></div>',false);e.addFrame('<div class = "frame3"></div>',false);e.Repeat=false;this.destroy=function(){if(b){if(typeof b.removeEventListener!="undefined"){b.removeEventListener("mouseover",x,false);b.removeEventListener("mouseout",y,false)}else{b.detachEvent("onmouseover",x);b.detachEvent("onmouseout",y)}if(j.shimElement){j.shimElement.removeNode(true);j.shimElement=null}b.parentNode.removeChild(b);d.parentNode.removeChild(d);b=null;s=null;j=null;q=null;p=null;m=null;l=null;t=null;v=null}ERO.m_theEro=null;k=null};this.getElement=function(){return b};this.getBody=function(){return j};this.getAnimation=function(){return e};this.getDelay=function(){return o+n};this.setDelay=function(a){o=a||o};this.getDelayDelta=function(){return n};this.setDelayDelta=function(a,b){B=b==false?false:true;if(typeof a=="number"){n=a;if(!h&&r!=-1)c.hide()}};this.setClasses=function(b,d){var a;if(ERO.DefaultClasses===null){ERO.DefaultClasses={};for(a in ERO.Classes)ERO.DefaultClasses[a]=ERO.Classes[a]}if(d!==false)c.setClasses(ERO.DefaultClasses,false);for(a in b)if(typeof ERO.Classes[a]!="undefined")ERO.Classes[a]=b[a];D()};this.setBeak=function(a){if(a==ERO.BeakDirection.Left)g(b).removeClass(ERO.Classes.ContainerRightBeak).addClass(ERO.Classes.ContainerLeftBeak);else g(b).removeClass(ERO.Classes.ContainerLeftBeak).addClass(ERO.Classes.ContainerRightBeak)};this.setContent=function(c){var a=document.createElement("div");a.className="firstChild";a.innerHTML=c;var b=l.firstChild;if(b)l.replaceChild(a,b);else l.appendChild(a);a=null;b=null};this.addAction=function(b){var a=document.createElement("li");if(!b)return;a.innerHTML=b;p.appendChild(a);a=null};this.clearActions=function(){var a=p.getElementsByTagName("li"),c=a.length;for(var b=0;b<c;b++)p.removeChild(a[0])};this.dockToText=function(e,b,i){b=typeof b!="undefined"?b:typeof window.event!="undefined"?window.event:null;var k=g(e).getPagePosition(),h=Gimme.Screen.getMousePosition(b).x,j=new a.Point(h,k.y),f=new a.Point(0,parseInt(d.offsetHeight/2,10));c.dockToPoint(j,f,e,i)};this.dockToElement=function(b,e){var d=g(b).getPagePosition(),f=new a.Rectangle(d,new a.Point(d.x+b.offsetWidth,d.y+b.offsetHeight));c.dockToRect(f,null,b,e)};this.dockToPoint=function(b,d,f,e){c.dockToRect(new a.Rectangle(b,b),d,f,e)};this.dockToRect=function(m,q,I,C){if(k===I){clearTimeout(r);if(h)return}else if(k!==null){clearTimeout(r);A()}var v="px";h=true;k=I;b.style.visibility="hidden";c.setBeak(ERO.BeakDirection.Left);if(typeof q=="undefined"||q==null)q={x:0,y:0};C=C||"";j.style.width=C;var g=l.offsetHeight-ERO.BeakHeight;d.style.top=m.getP1().y-d.offsetHeight+q.y+v;d.style.left=m.getP2().x-d.offsetWidth+q.x+v;var s=m.getP2().x,E=m.getP2().y-g-ERO.BeakHeight/2-m.getHeight()/2,y=c.getSize(),G=y.getP2().y-y.getP1().y,B=y.getP2().x-y.getP1().x,J=new a.Rectangle(new a.Point(s,E),new a.Point(s+B,E+G)),D=f.getOverlap(J),p=D.getRange(),x,w;if(p&a.Overlap.Range.InXRange)w=s;if(p&a.Overlap.Range.InYRange)x=E;if(p&a.Overlap.Range.GreaterThanX){c.setBeak(ERO.BeakDirection.Right);w=s>f.getP2().x?f.getP1().x+f.getWidth()-B:s-B-m.getWidth()}if(p&a.Overlap.Range.LessThanX){c.setBeak(ERO.BeakDirection.Left);w=f.getP1().x}if(p&a.Overlap.Range.GreaterThanY){x=f.getP1().y+f.getHeight()-G;var H=D.getBottomYBleed();g+=H;if(g>b.offsetHeight-ERO.BeakHeight)g=b.offsetHeight-ERO.BeakHeight-4}if(p&a.Overlap.Range.LessThanY){x=f.getP1().y;var H=D.getTopYBleed();g-=H;if(g<0)g=0}b.style.top=x+v;b.style.left=w+v;t.style.top=g+"px";c.executeEvent("beforeshow",c,new ERO.EROEventArgs("beforeshow",b,k));if(!i.useBeak)b.className=ERO.Classes.ContainerNoBeak;z=false;if(i.useProgressTimer){e.start();if(!i.useFade){setTimeout(u,o+n);return}}if(i.useFade)setTimeout(F,o+n);else u()};this.showImmediate=function(){z=h=true;e.end();u()};this.hide=function(a){h=false;if(a===true)A();else{clearTimeout(r);r=setTimeout(A,o+n)}};this.setGlitz=function(c,d,a,b){if(c!=null)i.useBeak=c;if(d!=null)i.useFade=d;if(a!=null)i.useProgressTimer=a;if(b===true)i.isTemporary=b;else C=i.copy()};this.setBoundingArea=function(e,g){if(e===null){var b=Gimme.Screen.getScrollPosition(),c=Gimme.Screen.getViewportSize(),d=new a.Rectangle(new a.Point(0,0),new a.Point(c.width,c.height));d.move(new a.Point(b.x,b.y));f=d}else f=new a.Rectangle(e,g)};this.getBoundingArea=function(){return f};this.isInUse=function(){return h};this.isVisible=function(){return b.style.visibility=="visible"};this.addToPage=function(){b.style.visibility="hidden";d.style.visibility="hidden";document.body.appendChild(b);document.body.appendChild(d)};this.getSize=function(){var c=b.offsetLeft,d=b.offsetTop,f=c+b.offsetWidth,g=d+b.offsetHeight,e=new a.Rectangle(new a.Point(c,d),new a.Point(f,g));return e};function E(b,a){if(b==a)return false;while(a&&a!=b)a=a.parentNode;return a==b}function x(){h=true}function y(a){var d=a.relatedTarget||a.toElement||a.srcElement;if(!E(b,d))c.hide()}function u(){if(b&&h){if(b.style.visibility!="visible")b.style.visibility="visible";if(typeof b.style.opacity!="undefined")b.style.opacity=1;c.executeEvent("aftershow",c,new ERO.EROEventArgs("aftershow",b,k));i=C.copy()}}function A(){if(!h&&b){c.executeEvent("beforehide",c,new ERO.EROEventArgs("beforehide",b,k));b.style.visibility="hidden";e.hide();if(!Msn.VE.API){d.style.left=b.style.left="0";d.style.top=b.style.top="0"}k=null;c.executeEvent("afterhide",c,new ERO.EROEventArgs("afterhide",b,k))}if(B)n=0}function F(){if(z||!h||!b)return;if(b.style&&typeof b.style.filter!="undefined"){b.style.filter="progid:DXImageTransform.Microsoft.Fade(duration=.5)";b.filters[0].Apply();b.style.visibility="visible";b.style.display="block";b.filters[0].Play();var c=setInterval(function(){if(b.filters[0].status==0){clearInterval(c);u()}},10)}else{b.style.visibility="visible";if(w===0)a()}function a(){if(h&&++w<=10){var c=w*.09999999;b.style.opacity=c;setTimeout(a,50)}else{u();w=0}}}function D(){b.className=ERO.Classes.Container;s.className=ERO.Classes.Shadow;j.className=ERO.Classes.Body;t.className=ERO.Classes.Beak;q.className=ERO.Classes.Actions;m.className=ERO.Classes.ActionsBackground;l.className=ERO.Classes.PreviewArea;v.className=ERO.Classes.PaddingHack;d.className=ERO.Classes.ProgressAnimation}}}};function LogEROBehavior(eroEvent,fromPanel){var bERO=$find(eroEvent.Entity.id+"_ero");if(bERO!=null){var eroSource=eval(fromPanel?bERO.get_EROPanel():bERO.get_EROMap()),pageName=eval(bERO.get_PageName());if(eroSource)$VE_A.Log(pageName,eroSource)}}function LogEROBehaviorFromPanel(a){ero.unhookEvent("aftershow",LogEROBehaviorFromPanel);LogEROBehavior(a,true)}function LogEROBehaviorFromMap(a){ero.unhookEvent("aftershow",LogEROBehaviorFromMap);LogEROBehavior(a,false)}function VETime(){}VETime.FormatTime=function(a){if(a==null||a==""||a=="undefined")return"";var c=false,d=a.substr(0,10),e=a.substr(11,5),b="";if(a.indexOf("AM")>-1){b="AM";c=true}else b="PM";return d+" "+VETime.ConvertTo12HourFormat(e,c)+" "+b};VETime.ConvertTo12HourFormat=function(d,c){var a=d;try{var b=parseFloat(a.replace(":","."));if(b>12)if(b<13&&c!=true);else b=b-12;a=b.toFixed(2);a=a.replace(".",":")}catch(e){a=""}return a};VETime.FormatPanelTime=function(a,g){if(a==null||a==""||a=="undefined")return"";try{var b=0,d=false,i=a.substr(4,8),h=a.indexOf(":"),f=a.substr(h-2,5),c="";if(a.indexOf("AM")>-1){c="AM";d=true;b=a.indexOf("AM")}else{c="PM";b=a.indexOf("PM")}var e="";if(b>0)e=a.substr(b+3,3);if(g)return i+" "+VETime.ConvertTo12HourFormat(f,d)+" "+c+" "+e;else return VETime.ConvertTo12HourFormat(f,d)+" "+c+" "+e}catch(j){}};VETime.getMonth=function(a){switch(a){case"01":return" Jan";case"02":return" Feb";case"03":return" Mar";case"04":return" Apr";case"05":return" May";case"06":return" Jun";case"07":return" Jul";case"08":return" Aug";case"09":return" Sep";case"10":return" Oct";case"11":return" Nov";case"12":return" Dec"}};var customCursors=Msn.VE.Css.Cursors.CustomCursors;if(customCursors!=null){var i,len=customCursors.length;for(i=0;i<len;i++)customCursors[i].domain=Msn.VE.API.Globals.vecurrentdomain;Msn.VE.Css.Cursors.defineCustomCursors(customCursors)}if(!(navigator.userAgent.indexOf("IE")>=0)&&(typeof VEAPI_DisableAtlasCompat=="undefined"||VEAPI_DisableAtlasCompat!=true))VENetwork.DownloadScript(Msn.VE.API.Constants.atlascompatjs);if(navigator.userAgent.indexOf("MSIE")>=0&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6)VENetwork.AttachStyleSheet(Msn.VE.API.Constants.stylesheetiev6);try{document.namespaces.add("v","urn:schemas-microsoft-com:vml")}catch(a){}function RequestQueueItem(a,b,c,d){this.Call=a;this.Param1=b;this.Param2=c;this.Param3=d}function VECustomEvent(b,a){this.Name=b;this.Callback=a}function VEMapOptions(){this.EnableBirdseye=true;this.EnableDashboardLabels=true}function VEMap(e){var a=this;this.ID=e;this.GUID=VENetwork.GetExecutionID();this.ClientToken=null;if(Msn.VE.API.Globals.vemapinstances==null||Msn.VE.API.Globals.vemapinstances=="undefined")Msn.VE.API.Globals.vemapinstances=[];Msn.VE.API.Globals.vemapinstances[this.GUID]=a;this.requestQueue=[];this.preInitCustomEvents=[];this.network=new VENetwork;this.mapelement=$ID(e);this.pushpins=[];this.DisambiguationCallback=null;this.ShowMessageBox=true;if(this.mapelement==null)throw new VEException("VEMap:cstr","err_invalidelement",L_invalidelement_text);this.m_vedirectionsmanager=null;this._dm=this.m_vedirectionsmanager;this.m_routemanager=null;this.m_vesearchmanager=null;this._sm=this.m_vesearchmanager;this.m_vemessage=new VEMessage(this);this.m_veambiguouslist=new VEAmbiguouslist(this);var c=new VELatLongFactory(new VELatLongFactorySpecFromMap(this)),b=new _xy1;this.queueEventInitialized=false;this.RequestQueueEnabled=true;this.queueEventInitialized=false;windowWidth=GetWindowWidth();windowHeight=GetWindowHeight();scrollbarWidth=GetScrollbarWidth();this.dashboardSize=Msn.VE.DashboardSize.Normal;this.dashboardVersion=6;this._showDashboard=true;this._mapPrintOptions=null;this.LoadMap=function(c,i,k,j,d,h,e,g){if(!a)throw new VEException("VEMap:LoadMap","err_notinitializedmap",L_notinitialized_text);if(typeof d!="undefined"&&d!=null){VEValidator.ValidateMapMode(d,"mapMode");this.mapMode=d}if(c!=null&&c!="undefined"){VEValidator.ValidateObject(c,"veLatLong",VELatLong,"VELatLong");var f=b.Decode(c);this.initialLatitude=f.Latitude;this.initialLongitude=f.Longitude}this.fixedMap=j;this.initialZoomLevel=i;this.initialMapStyle=k;this.showMapModeSwitch=h;if(e!=null&&typeof e!="undefined")this.tileBuffer=e;this._mapOptions=g?g:new VEMapOptions;this.veonmaploadevent=this.onLoadMap;this.mapelement.innerHTML="";this.mapelement.innerHTML="<table width=100% height=100%><tr valign=middle><td align=center valign=middle><h3>"+L_loading_text+"</h3></td></tr></table>";this.InitializeMap();this.vemapcontrol.AttachEvent("onstartpan",function(){if(window.ero)window.ero.hide(true)})};this._ReArrangeControls=function(){if(a.controlzIndexes!=null&&a.controls!=null&&a.controlzIndexes.length==a.controls.length){var d=a.controls.length;for(var b=0;b<d;b++){document.body.removeChild(a.controls[b]);var c=a.controls[b];c.style.top=a.controltops[b];c.style.left=a.controllefts[b];a._AddControlInner(c,a.controlzIndexes[b])}}};this._ClearView=function(){VEPushpin.Hide();a.m_vemessage.Hide();if(typeof VE_TrafficManager!="undefined"&&VE_TrafficManager.turnedOn==true)VE_TrafficManager._ViewChangeNotification()};this._RefreshLayers=function(){if(a.vemapcontrol.GetMapMode()!=2)a.vemapcontrol.PanView();if(typeof VE_TrafficManager!="undefined"&&VE_TrafficManager.turnedOn==true)VE_TrafficManager._ViewChangeNotification()};this.SetViewport=function(a,c,b,d){return this.vemapcontrol.SetViewport(a,c,b,d)};this.GetCenter=function(){var b=this.vemapcontrol.GetCenterLatitude(),d=this.vemapcontrol.GetCenterLongitude(),a=c.CreateVELatLong(b,d);return a};this.GetMapView=function(){var e;if(this.vemapcontrol.IsModeEnabled(Msn.VE.MapActionMode.Mode3D)){var d=this.vemapcontrol.Get3DVisibleArea(true);if(d==null)return null;var b=d[0],g=d[1],a=d[2],f=d[3];e=new VELatLongRectangle(c.CreateVELatLong(b.latitude,b.longitude),c.CreateVELatLong(a.latitude,a.longitude),c.CreateVELatLong(g.latitude,g.longitude),c.CreateVELatLong(f.latitude,f.longitude))}else{var b=this.vemapcontrol.PixelToLatLong(new VEPixel(0,0)),a=this.vemapcontrol.PixelToLatLong(new VEPixel(this.GetWidth(),this.GetHeight()));if(b==null||a==null)return null;e=new VELatLongRectangle(c.CreateVELatLong(this.vemapcontrol.ClipLatitude(b.latitude),this.vemapcontrol.ClipLongitude(b.longitude)),c.CreateVELatLong(this.vemapcontrol.ClipLatitude(a.latitude),this.vemapcontrol.ClipLongitude(a.longitude)))}return e};this.PixelToLatLong=function(b,a,d){if(a!=null){VEValidator.ValidateNonNegativeInt(a,"zoomLevel");a=parseInt(a)}if(d){VEValidator.ValidateObjectArray(b,"pixelArray",VEPixel,"VEPixel array");VEValidator.ValidateFunction(d,"callback");if(typeof b.length!="undefined"&&b.length>0)this.PixelToLatLongAsync(b,a,d)}else{VEValidator.ValidateObject(b,"pixel",VEPixel,"VEPixel");var e=this.vemapcontrol.PixelToLatLong(b,a),f=c.CreateVELatLong(e.latitude,e.longitude);return f}};this.PixelToLatLongAsync=function(a,b,c){this.vemapcontrol.PixelToLatLongAsync(a,b,c)};this.SetCenter=function(c){VEValidator.ValidateObject(c,"veLatLong",VELatLong,"VELatLong");var a=b.Decode(c),d="%0dev.virtualearth.net/legacyService/ElevatedLoc.ashx";if(d.length>0)this._QueueRequest(this.vemapcontrol.SetCenterAccurate,a.Latitude,a.Longitude);else this._QueueRequest(this.vemapcontrol.SetCenter,a.Latitude,a.Longitude)};this.SetCenterClassic=function(c){VEValidator.ValidateObject(c,"veLatLong",VELatLong,"VELatLong");var a=b.Decode(c);this._QueueRequest(this.vemapcontrol.SetCenter,a.Latitude,a.Longitude)};this.SetCenterAndZoom=function(c,d){VEValidator.ValidateObject(c,"veLatLong",VELatLong,"VELatLong");VEValidator.ValidateNonNegativeInt(d,"zoomLevel");var a=b.Decode(c);this._QueueRequest(this.vemapcontrol.SetCenterAndZoom,a.Latitude,a.Longitude,d);return true};this.GetMouseWheelZoomToCenter=function(){return a.vemapcontrol.GetMouseWheelZoomToCenter()};this.SetMouseWheelZoomToCenter=function(b){return a.vemapcontrol.SetMouseWheelZoomToCenter(b)};this.IncludePointInView=function(c){VEValidator.ValidateObject(c,"veLatLong",VELatLong,"VELatLong");var a=b.Decode(c);return this.vemapcontrol.IncludePointInViewport(a.Latitude,a.Longitude)};this.GetOffsetX=function(){return a.vemapcontrol.GetOffsetX()};this.GetOffsetY=function(){return a.vemapcontrol.GetOffsetY()};this.getSvgLayer=function(){return a.vemapcontrol.getSvgLayer()};this.resizeSVG=function(){return a.vemapcontrol.resizeSVG()};this.GetsvgDiv=function(){return a.vemapcontrol.GetsvgDiv()};this.LatLongToPixel=function(c,a,d){if(a!=null){VEValidator.ValidateNonNegativeInt(a,"zoomLevel");a=parseInt(a)}if(d){VEValidator.ValidateObjectArray(c,"veLatLongArray",VELatLong,"VELatLong array");VEValidator.ValidateFunction(d,"callback");this.LatLongToPixelAsync(c,a,d)}else{VEValidator.ValidateObject(c,"veLatLong",VELatLong,"VELatLong");var e=b.Decode(c),f=new Msn.VE.LatLong(e.Latitude,e.Longitude);return this.vemapcontrol.LatLongToPixel(f,a)}};this.LatLongToPixelAsync=function(d,f,g){var e=[];for(var a=0;a<d.length;++a){var c=b.Decode(d[a]);e[a]=new Msn.VE.LatLong(c.Latitude,c.Longitude)}this.vemapcontrol.LatLongToPixelAsync(e,f,g)};this.PanToLatLong=function(c){VEValidator.ValidateObject(c,"veLatLong",VELatLong,"VELatLong");var a=b.Decode(c);if(this.GetMapMode()==Msn.VE.MapActionMode.Mode2D){a.Latitude=this.vemapcontrol.ClipLatitude(a.Latitude);a.Longitude=this.vemapcontrol.ClipLongitude(a.Longitude)}this._QueueRequest(this.vemapcontrol.PanToLatLong,a.Latitude,a.Longitude);return true};this.SetMapView=function(a){VEValidator.ValidateNonNull(a,"arrObject");if(a instanceof VEMapViewSpecification){var h=b.Decode(a.LatLong);view=new Msn.VE.MapView(this.vemapcontrol);view.SetCenterLatLong(new Msn.VE.LatLong(h.Latitude,h.Longitude));view.SetMapStyle(this.vemapcontrol.GetMapStyle());if(a.ZoomLevel!=null)view.SetZoomLevel(a.ZoomLevel);else view.SetZoomLevel(this.vemapcontrol.GetZoomLevel());if(a.Altitude!=null)view.SetAltitude(a.Altitude);if(a.Heading!=null)view.SetDirection(a.Heading);if(a.Pitch!=null)view.SetTilt(a.Pitch);this._QueueRequest(this.vemapcontrol.SetView,view)}else if(a instanceof VELatLongRectangle){var f=b.Decode(a.TopLeftLatLong),g=b.Decode(a.BottomRightLatLong);this.vemapcontrol.SetViewport(f.Latitude,f.Longitude,g.Latitude,g.Longitude)}else{var e=[];for(var c=0;c<a.length;c++){VEValidator.ValidateNonNull(a[c],"arrObject["+c+"]");if(a[c]instanceof VELatLong)d([a[c]],e);else if(a[c]instanceof VEShape)d(a[c].GetPoints(),e);else if(a[c]instanceof VEPolyline)d(a[c].GetLatLongs(),e);else if(a[c]instanceof VEPolygon)d(a[c].GetLatLongs(),e);else if(a[c]instanceof VELatLongRectangle)d([a[c].TopLeftLatLong,a[c].BottomRightLatLong],e);else throw new VEException("VEMap:SetMapView","err_invalidargument",L_invalidargument_text.replace("%1","arrObject").replace("%2","object"))}this._QueueRequest(this.vemapcontrol.SetBestMapView,e)}return true};function d(d,e){for(var a=0;a<d.length;a++){var c=b.Decode(d[a]),f=new Msn.VE.LatLong(c.Latitude,c.Longitude);e.push(f)}}this.AddPushpin=function(a){if(typeof a=="object"&&!(a instanceof VEPushpin)){var e=new VEShape(VEShapeType.Pushpin,a);this.AddShape(e);return e}VEValidator.ValidateObject(a,"vePushpin",VEPushpin,"VEPushpin");var f=this.pushpins.length;for(var d=0;d<f;d++){var g=this.pushpins[d];if(g.ID==a.ID)throw new VEException("VEMap:AddPushpin","err_invalidpushpinid",L_invalidpushpinid_text)}this.pushpins.push(a);a._SetMapInstance(this);var c=b.Decode(a.LatLong);if(this.GetMapMode()==Msn.VE.MapActionMode.Mode3D)this.m_vegraphicsmanager.Add3DPushpin(a.ID,c.Latitude,c.Longitude,25,25,"VEAPI_Pushpin",a,Msn.VE.API.Globals.vepushpinpanelzIndex-1);else this.vemapcontrol.AddPushpin(a.ID,c.Latitude,c.Longitude,25,25,"VEAPI_Pushpin",a.GetContent(),Msn.VE.API.Globals.vepushpinpanelzIndex-1)};this._DisambiguateCallback="VEMap._GetMapFromGUID("+this.GUID+")._sm.FindAmbiguousListCallBack";this._Disambiguate=function(f,b,d,c,e){var a=$ID(this.ID+"_vewhereinput");if(a)a.value=unescape(f);this.vemapcontrol.SetViewport(b,d,c,e);if(this.m_vesearchmanager!=null&&this.lastwhatsearch!=null&&this.lastwhatsearch.length>0)this.Find(this.lastwhatsearch,null,1,this.m_vesearchmanager.vesearchcallback)};this._DoFind=function(){try{this.lastwhatsearch=$ID(this.ID+"_vewhatinput").value;this.lastwheresearch=$ID(this.ID+"_vewhereinput").value;this.Find(this.lastwhatsearch,this.lastwheresearch)}catch(a){this.ShowMessage(a.message)}};this.UpdateAmbiguousList=function(a){if(this.m_vesearchmanager)this.m_vesearchmanager.UpdateAmbiguousList(a)};this.Dispose=function(){try{if(a.vemapcontrol!=null){a.vemapcontrol.DetachEvent("onchangeview",a._ClearView);a.vemapcontrol.DetachEvent("onresize",a._ReArrangeControls);a.vemapcontrol.DetachEvent("onendpan",a._RefreshLayers);a.vemapcontrol.DetachEvent("oninitmode",a._EROHouseKeeping)}a.vemapcontrol.DetachEvent("onclick",VEPushpin.Hide);var c=a.controlzIndexes.length;for(var b=0;b<c;b++)a.controlzIndexes.pop();var c=a.controls.length;for(var b=0;b<c;b++){try{document.body.removeChild(a.controls[b])}catch(g){}a.controls[b]=null;a.controltops[b]=null;a.controllefts[b]=null}a.controls=null;a.controlzIndexes=null;if(a.m_velayermanager)a.m_velayermanager.Dispose();if(a.m_vesearchmanager){a.m_vesearchmanager.Dispose();a.m_vesearchmanager=null;a._sm=null}if(a.m_routemanager){a.m_routemanager.Dispose();a.m_routemanager=null}for(var b=0;b<a.pushpins.length;++b)if(a.pushpins[b]!=null&&a.pushpins[b]!="undefined"){if(a.GetMapMode()==Msn.VE.MapActionMode.Mode3D)a.m_vegraphicsmanager.Remove3DPushpin(a.pushpins[b].ID);a.pushpins[b].Dispose();a.pushpins[b]=null}a.pushpins=null;if(a.m_vegraphicsmanager)a.m_vegraphicsmanager.Dispose();if(a.m_vetilesourcemanager)a.m_vetilesourcemanager.Dispose();a.m_vemessage.Dispose();a.m_veambiguouslist.Dispose();try{if(typeof VE_TrafficManager!="undefined")VE_TrafficManager.Destroy()}catch(g){}Msn.VE.API.Globals.vemapinstances[a.GUID]=null;a.veonmaploadevent=null;a.veloadingdiv=null;a.vemapcontrol.Destroy();try{var f=$ID(a.ID);f.innerHTML=""}catch(g){}a.ClientToken=null;a.ID=null;a.vemapcontrol=null;var e=0;for(var d in Msn.VE.API.Globals.vemapinstances)if(typeof Msn.VE.API.Globals.vemapinstances[d]!="function"&&Msn.VE.API.Globals.vemapinstances[d]!=null)++e;if(e==0){VE_Help.Destroy();VEPushpin.DisposeERO();Msn.VE.API.Globals.Dispose()}Msn.VE.API.Globals.vemapinstances[this.GUID]=null;var c=a.preInitCustomEvents.length;for(var b=0;b<c;++b)a.preInitCustomEvents.pop();a.preInitCustomEvents=null;a.requestQueue=null;a.network=null;a.mapelement=null;a.pushpins=null;if(a._mapOptions)a._mapOptions=null;a=null}catch(g){}};this.GetDashboardSize=function(){return this.dashboardSize}}VEMap._GetMapFromGUID=function(a){if(Msn.VE.API.Globals.vemapinstances!=null&&Msn.VE.API.Globals.vemapinstances[a]==null||Msn.VE.API.Globals.vemapinstances[a]=="undefined"){throw new VEException("VEMap:_GetMapFromGUID","err_notinitialized",L_notinitialized_text);return}return Msn.VE.API.Globals.vemapinstances[a]};VEMap.prototype.InitializeMap=function(){_VERegisterNamespaces("Msn.VE");this.mapelement.innerHTML="";this.mapelement.style.overflow="hidden";if(this.mapelement.className==null||this.mapelement.className=="undefined"||this.mapelement.className==""){if(this.mapelement.style==null||this.mapelement.style.height==null||this.mapelement.style.height=="undefined"||this.mapelement.style.height=="")this.mapelement.style.height=Msn.VE.API.Globals.vemapheight+"px";if(this.mapelement.style==null||this.mapelement.style.width==null||this.mapelement.style.width=="undefined"||this.mapelement.style.width=="")this.mapelement.style.width=Msn.VE.API.Globals.vemapwidth+"px"}var a={};if(this.mapMode!=null&&this.mapMode!="undefined")a.mapMode=this.mapMode;else a.mapMode=Msn.VE.API.Globals.vemapmode;a.mapGUID=this.GUID;a.clientToken=this.ClientToken;if(this.initialLatitude!=null&&this.initialLatitude!="undefined")a.latitude=this.initialLatitude;else a.latitude=Msn.VE.API.Globals.vemaplatitude;if(this.initialLongitude!=null&&this.initialLongitude!="undefined")a.longitude=this.initialLongitude;else a.longitude=Msn.VE.API.Globals.vemaplongitude;if(this.initialZoomLevel!=null&&this.initialZoomLevel!="undefined")a.zoomlevel=this.initialZoomLevel;else a.zoomlevel=Msn.VE.API.Globals.vemapzoom;if(this.initialMapStyle!=null&&this.initialMapStyle!="undefined")a.mapstyle=this.initialMapStyle;else a.mapstyle=Msn.VE.API.Globals.vemapstyle;this.m_dashboardId=this.ID+"_dashboard";if(this.fixedMap!=true){a.showDashboard=VE_CheckModuleStatus(VE_ModuleName.APICONTROLS)=="loaded"&&this._showDashboard;a.dashboardSize=this.dashboardSize;a.dashboardVersion=this.dashboardVersion;a.dashboardX=5;a.dashboardY=5;a.dashboardId=this.m_dashboardId;a.showScaleBar=true}a.obliqueEnabled=this._mapOptions.EnableBirdseye;a.labelsDefault=this._mapOptions.EnableDashboardLabels;a.obliqueUrl=Msn.VE.API.Constants.imageryurl;if(this.fixedMap==true)a.fixedView=true;a.disableLogo=false;if(this.showMapModeSwitch==false)a.showMapModeSwitch=false;else a.showMapModeSwitch=true;if(this.tileBuffer!=null&&typeof this.tileBuffer!="undefined")a.buffer=this.tileBuffer*Msn.VE.API.Globals.vetilesize;this.vemapcontrol=new Msn.VE.MapControl(this.mapelement,a,this);var d=this.preInitCustomEvents.length;for(var c=0;c<d;++c){var b=this.preInitCustomEvents.pop();this.vemapcontrol.AttachCustomEvent(b.Name,b.Callback)}this.vemapcontrol.Init();if(!this.fixedMap==true)this.vemapcontrol.AttachEvent("onchangeview",this._ClearView);this.vemapcontrol.AttachEvent("onendpan",this._RefreshLayers);this.vemapcontrol.AttachEvent("oninitmode",this._ResetQueueEvent);this.vemapcontrol.AttachEvent("oninitmode",this._EROHouseKeeping);_VERegisterNamespaces("Msn.Drawing");this.m_vegraphicsmanager=new VEGraphicsManager(this);this.m_vegraphicsmanager.Initialize();this.m_velayermanager=null;this._lm=this.m_velayermanager;this.m_vetilesourcemanager=null;this.m_vetrafficmanager=null;_VERegisterNamespaces("Msn.VE.UI");Msn.VE.UI.Color={Red:"red",Orange:"orange",Yellow:"yellow"};if(($ID("help")==null||$ID("help")=="undefined")&&!Msn.VE.API.Globals.ishttpsenabled)VE_Help.CreateHelpPanel();this._InitializeModules(VE_GetLoadedAPIModules());if(this.veonmaploadevent)this.veonmaploadevent(this);this.controlzIndexes=[];this.controls=[];this.controltops=[];this.controllefts=[];this.vemapcontrol.AttachEvent("onresize",this._ReArrangeControls);if(window.ero==null||typeof window.ero=="undefined")window.ero=ERO.getInstance();this._EROHouseKeeping(this.GetMapMode());window.attachEvent("onunload",DisposeAllMaps);if(this._mapPrintOptions)this.SetPrintOptions(this._mapPrintOptions)};function DisposeAllMaps(){for(var a in Msn.VE.API.Globals.vemapinstances)if(Msn.VE.API.Globals.vemapinstances[a]instanceof VEMap)Msn.VE.API.Globals.vemapinstances[a].Dispose();if(_VEDownloadQueue){_VEDownloadQueue.Dispose();_VEDownloadQueue=null}if(VE_Help&&VE_Help.Destroy)VE_Help.Destroy()}VEMap.prototype.DeleteAllPushpins=function(){VEPushpin.Hide();if(this.pushpins!=null&&this.pushpins!="undefined")if(this.GetMapMode()==Msn.VE.MapActionMode.Mode3D){this.m_vegraphicsmanager.ClearAllPushpins(this.pushpins);return}else{var c=this.pushpins.length;for(var a=0;a<c;a++){var b=this.pushpins.pop();if(!b.IsInLayer)b.Dispose()}}return this.vemapcontrol.ClearPushpins()};VEMap.prototype.GetMapStyle=function(){return this.vemapcontrol.GetMapStyle()};VEMap.prototype.GetZoomLevel=function(){return this.vemapcontrol.GetZoomLevel()};VEMap.prototype.StartContinuousPan=function(a,b){VEValidator.ValidateInt(a,"deltaX");VEValidator.ValidateInt(b,"deltaY");return this.vemapcontrol.ContinuousPan(parseInt(a),parseInt(b))};VEMap.prototype.EndContinuousPan=function(){return this.vemapcontrol.StopContinuousPan()};VEMap.prototype.Pan=function(a,b){VEValidator.ValidateInt(a,"deltaX");VEValidator.ValidateInt(b,"deltaY");if(this.GetMapMode()!=Msn.VE.MapActionMode.Mode3D)return this.vemapcontrol.PanByPixel(new VEPixel(parseInt(a),parseInt(b)),false);else return false};VEMap.prototype.DeletePushpin=function(c){var d=0;if(typeof this.pushpins=="object"&&this.pushpins&&this.pushpins.constructor==Array)d=this.pushpins.length;for(var a=0;a<d;a++){var b=this.pushpins[a];if(b!=null&&b.ID==c){if(!b.IsInLayer)b.Dispose();this.pushpins.splice(a,1);if(this.GetMapMode()==Msn.VE.MapActionMode.Mode3D)return this.m_vegraphicsmanager.Remove3DPushpin(c);else return this.vemapcontrol.RemovePushpin(c)}}throw new VEException("VEMap:DeletePushpin","err_invalidpushpinid",L_invalidpushpinid_text)};VEMap.prototype.Resize=function(a,b){if(a!=null&&typeof a!="undefined"){VEValidator.ValidateNonNegativeInt(a,"width");VEValidator.ValidateNonNegativeInt(b,"height")}return this.vemapcontrol.Resize(a,b)};VEMap.prototype.SetMapMode=function(a){VEValidator.ValidateMapMode(a,"mapMode");this.vemapcontrol.EnableMode(a,this.GUID)};VEMap.prototype.GetMapMode=function(){if(this.vemapcontrol.IsModeEnabled(Msn.VE.MapActionMode.Mode3D))return VEMapMode.Mode3D;return VEMapMode.Mode2D};VEMap.prototype.SetMapStyle=function(a){VEValidator.ValidateMapStyle(a,"mapStyle");if(this.GetMapMode()==Msn.VE.MapActionMode.Mode3D&&(a==VEMapStyle.Birdseye||a==VEMapStyle.BirdseyeHybrid))return false;this.vemapcontrol.SetMapStyle(a)};VEMap.prototype.SetScaleBarDistanceUnit=function(a){VEValidator.ValidateDistanceUnit(a,"distanceUnit");this.vemapcontrol.SetScaleBarDistanceUnit(a==VEDistanceUnit.Miles?Msn.VE.DistanceUnit.Miles:Msn.VE.DistanceUnit.Kilometers)};VEMap.prototype.SetZoomLevel=function(a){VEValidator.ValidateNonNegativeInt(a,"zoomLevel");this._QueueRequest(this.vemapcontrol.SetZoom,parseInt(a));return true};VEMap.prototype.ZoomIn=function(){this.vemapcontrol.ZoomIn()};VEMap.prototype.ZoomOut=function(){this._QueueRequest(this.vemapcontrol.ZoomOut)};VEMap.prototype.AttachEvent=function(b,a){VEValidator.ValidateNonNull(b,"eventname");VEValidator.ValidateNonNull(a,"eventhandler");if(this.vemapcontrol)this.vemapcontrol.AttachCustomEvent(b,a);else this.preInitCustomEvents.push(new VECustomEvent(b,a))};VEMap.prototype.DetachEvent=function(b,a){VEValidator.ValidateNonNull(b,"eventname");VEValidator.ValidateNonNull(a,"eventhandler");this.vemapcontrol.DetachCustomEvent(b,a)};VEMap.prototype.FireEvent=function(a){try{var b=window.event;return this.vemapcontrol.FireCustomEvent(a,b)}catch(c){return false}};VEMap.prototype.ShowMessage=function(a){if(this.ShowMessageBox)this.m_vemessage.Show(a)};VEMap.prototype.GetHeight=function(){var a=0;if(this.mapelement.style.height.search(/px/)>0)a=parseInt(this.mapelement.style.height.replace("px",""));if(isNaN(a)||a==0)a=this.mapelement.offsetHeight;return a};VEMap.prototype.GetWidth=function(){var a=0;if(this.mapelement.style.width.search(/px/)>0)a=parseInt(this.mapelement.style.width.replace("px",""));if(isNaN(a)||a==0)a=this.mapelement.offsetWidth;return a};VEMap.prototype.GetLeft=function(){return this.vemapcontrol.GetLeftPx()};VEMap.prototype.GetTop=function(){return this.vemapcontrol.GetTopPx()};VEMap.prototype.SetFindResultsPanel=function(a){if(a==null||a=="undefined")throw new VEException("VEMap:SetFindResultsPanel","err_invalidelement",L_invalidelement_text);var b=$ID(a);if(b==null||b=="undefined")throw new VEException("VEMap:SetFindResultsPanel","err_invalidelement",L_invalidelement_text);this.searchelement=a};VEMap.prototype._AddControlInner=function(a){a.style.position="absolute";a.style.zIndex=201;var e=this.GetTop(),d=this.GetLeft();if(!a.style.top)a.style.top="0px";if(!a.style.left)a.style.left="0px";var c=a.style.top,b=a.style.left;if(isNaN(c))c=c.toString().toLowerCase();if(isNaN(b))b=b.toString().toLowerCase();e+=parseInt(c.replace("px"));d+=parseInt(b.replace("px"));a.style.top=e+"px";a.style.left=d+"px";document.body.appendChild(a)};VEMap.prototype.AddControl=function(a,b){if(a==null||a=="undefined")throw new VEException("VEMap:AddControl","err_invalidelement",L_invalidelement_text);if(this.controls==null||this.controls=="undefined")throw new VEException("VEMap:AddControl","err_notinitialized",L_notinitialized_text);this.controlzIndexes.push(b);this.controls.push(a);this.controltops.push(a.style.top);this.controllefts.push(a.style.left);this._AddControlInner(a,b)};VEMap.prototype.DeleteControl=function(b){if(b==null||b=="undefined")throw new VEException("VEMap:DeleteControl","err_invalidelement",L_invalidelement_text);if(this.controls==null||this.controls=="undefined")throw new VEException("VEMap:DeleteControl","err_notinitialized",L_notinitialized_text);if(b.shimElement){b.shimElement.removeNode(true);b.shimElement=null}document.body.removeChild(b);var c=-1;for(var a=0;a<this.controls.length;a++)if(this.controls[a]==b){c=a;break}if(c>=0){for(var a=c;a<this.controls.length-1;a++){this.controls[a]=this.controls[a+1];this.controlzIndexes[a]=this.controlzIndexes[a+1];this.controltops[a]=this.controltops[a+1];this.controllefts[a]=this.controllefts[a+1]}this.controls.pop();this.controlzIndexes.pop();this.controltops.pop();this.controllefts.pop()}};VEMap.prototype.ShowControl=function(a){if(a!=null&&a!="undefined"){if(a.shimElement)a.shimElement.style.display="block";a.style.visibility="visible";mvcViewFacade.ShowShimIfSupported(a)}};VEMap.prototype.HideControl=function(a){if(a!=null&&a!="undefined"){HideShim(a);a.style.visibility="hidden"}};VEMap.prototype.Clear=function(){this._ClearView();if(typeof VE_TrafficManager!="undefined")VE_TrafficManager.Destroy();this.DeleteAllPushpins();this.DeleteAllShapeLayers();if(this.m_vedirectionsmanager)this.m_vedirectionsmanager.RemoveRouteHighLight();this.m_vegraphicsmanager.Clear();this.m_veambiguouslist.Hide();this.m_vemessage.Hide()};VEMap.prototype._ShowLoading=function(){if(!this.veloadingdiv){this.veloadingdiv=document.createElement("div");this.veloadingdiv.className="VE_Network_Loading";this.veloadingdiv.style.top="75px";this.veloadingdiv.style.left="80px";this.veloadingdiv.innerHTML=L_loading_text;this.AddControl(this.veloadingdiv,202)}if(this.veloadingdiv.style.display!="block")this.veloadingdiv.style.display="block";else this.veloadingdiv.style.display="none"};VEMap.prototype.AddPolyline=function(a){if(typeof a=="object"&&!(a instanceof VEPolyline)){var b=new VEShape(VEShapeType.Polyline,a);this.AddShape(b);return b}this.m_vegraphicsmanager.DrawLine(a)};VEMap.prototype.DeletePolyline=function(a){this.m_vegraphicsmanager.RemoveLinebyId(a)};VEMap.prototype.DeleteAllPolylines=function(){this.m_vegraphicsmanager.RemoveAllLines()};VEMap.prototype.AddPolygon=function(a){if(typeof a=="object"&&!(a instanceof VEPolygon)){var b=new VEShape(VEShapeType.Polygon,a);this.AddShape(b);return b}this.m_vegraphicsmanager.DrawPolygon(a)};VEMap.prototype.DeletePolygon=function(a){this.m_vegraphicsmanager.RemovePolygonbyId(a)};VEMap.prototype.DeleteAllPolygons=function(){this.m_vegraphicsmanager.RemoveAllPolygons()};VEMap.prototype.LoadModules=function(c,a,d){var b=null;b=VEOndemandJsDownloads(true,c,this,[this.LoadModules,c,a,d]);if(b)if(typeof a=="function"&&a!=null)a(d)};VEMap.prototype._InitializeModules=function(b){var c=b.length;for(var a=0;a<c;a++)switch(b[a]){case VE_ModuleName.APILAYERS:this.InitMapDrawing();break;case VE_ModuleName.APIFIND:this.InitSearch();break;case VE_ModuleName.APIROUTING:this.InitRouting();break;case VE_ModuleName.APITRAFFIC:this.InitTraffic();break;case VE_ModuleName.API3D:this.Init3D();break;case VE_ModuleName.APICONTROLS:this.InitNavControl();break;case VE_ModuleName.APIBIRDSEYE:this.InitBirdseye();break;case VE_ModuleName.APITILES:this.InitTiles()}};VEMap.prototype._ResetQueueEvent=function(a){if(a==Msn.VE.MapActionMode.Mode2D)this.queueEventInitialized=false};VEMap.prototype._QueueRequest=function(a,b,c,d){if(this.vemapcontrol.IsModeEnabled(Msn.VE.MapActionMode.Mode3D)&&this.RequestQueueEnabled){if(!this.queueEventInitialized){this.vemapcontrol.Get3DControl().AttachEvent("OnCameraChanged","ProcessQueuedRequest");this.queueEventInitialized=true}if(this.vemapcontrol.IsCameraFlying()||this.requestQueue.length>0){this.requestQueue.push(new RequestQueueItem(a,b,c,d));return}}a(b,c,d)};VEMap.prototype._ProcessQueuedRequest=function(){if(this.requestQueue.length>0){var a=this.requestQueue.shift();a.Call(a.Param1,a.Param2,a.Param3)}};VEMap.prototype.ShowMapModeSwitch=function(a){if(this.fixedMap!=true){this.vemapcontrol.SetShowMapModeSwitch(a);this.showMapModeSwitch=a}};VEMap.prototype.SetTileBuffer=function(a){this.tileBuffer=a;if(this.vemapcontrol!=null&&this.vemapcontrol!="undefined")this.vemapcontrol.SetTilePixelBuffer(a*Msn.VE.API.Globals.vetilesize)};VEMap.prototype._EROHouseKeeping=function(d){if(d==Msn.VE.MapActionMode.Mode2D){ero.setGlitz(true,false,true,false);ero.unhookEvent("aftershow",c);ero.unhookEvent("afterhide",b);ero.unhookEvent("beforeshow",a)}else{ero.setGlitz(true,false,true,false);ero.hookEvent("aftershow",c);ero.hookEvent("afterhide",b);ero.hookEvent("beforeshow",a)}function c(){ShowShim(ero.getBody(),ero.getElement())}function b(){HideShim(ero.getBody())}function a(a){if(a.Entity==-1)ero.setGlitz(false,null,false,true)}};VEMap.prototype.AllTilesLoaded=function(){if(this.vemapcontrol.IsModeEnabled(Msn.VE.MapActionMode.Mode3D)){var a=this.vemapcontrol.Get3DControl();return a?a.AllTilesLoaded:false}return true};VEMap.prototype.SetClientToken=function(a){this.ClientToken=a;if(this.vemapcontrol)this.vemapcontrol.SetClientToken(a)};VEMap.prototype.HasClientToken=function(){return this.ClientToken!=null&&typeof this.ClientToken!="undefined"&&this.ClientToken.length>0};VEMap.GetVersion=function(){return Msn.VE.API.Globals.vecurrentversion};VEMap.prototype.ShowDisambiguationDialog=function(a){VEValidator.ValidateBoolean(a,"value");this.m_vedirectionsmanager.m_showDisambigousDialog=a};VEMap.prototype.SetAnimationEnabled=function(a){VEValidator.ValidateBoolean(a,"value");if(this.vemapcontrol)this.vemapcontrol.SetAnimationEnabled(a)};function VEPrintOptions(a){VEValidator.ValidateBoolean(a,"enablePrinting");this.EnablePrinting=a}VEMap.prototype.SetPrintOptions=function(a){VEValidator.ValidateBoolean(a.EnablePrinting,"VEPrintOptions.EnablePrinting");if(!Web.Browser.isSafari()){this._mapPrintOptions=a;if(this.vemapcontrol)this.vemapcontrol.SetPrintable(a.EnablePrinting)}};function VEAPIRequestInvoke(e,a,d){var c=new VENetwork,b=VENetwork.GetExecutionID();c.UseCloseDep=true;c.ServiceUrl=e;a.push(new VEParameter(Msn.VE.API.Constants.culture,'"'+Msn.VE.API.Globals.locale+'"'));a.push(new VEParameter(Msn.VE.API.Constants.format,Msn.VE.API.Constants.json));a.push(new VEParameter(Msn.VE.API.Constants.requestid,b));c.BeginInvoke("_f"+b,a,d,null,b)}VEMap.prototype.InitNavControl=function(){};VEDashboardSize=Msn.VE.DashboardSize;VEMap.prototype.SetDashboardSize=function(a){if(typeof a!="undefined"&&a!=null){VEValidator.ValidateDashboardSize(a,"VEDashboardSize");this.dashboardSize=a;this.dashboardVersion=6;if(this.dashboardSize==VEDashboardSize.Small||this.dashboardSize==VEDashboardSize.Tiny)this.dashboardVersion=5}};VEMap.prototype.SetDashboardVersion=function(a){this.dashboardVersion=a};VEMap.prototype.ShowDashboard=function(){if(this.vemapcontrol){var a=this.vemapcontrol.GetDashboard();if(!a)this.vemapcontrol.CreateDashboard(5,5,this.dashboardSize,this.m_dashboardId,this.showMapModeSwitch,this._mapOptions.EnableBirdseye,this._mapOptions.EnableDashboardLabels,this.dashboardVersion);else a.Show();this.Show3DNavigationControl()}this._showDashboard=true};VEMap.prototype.HideDashboard=function(){if(this.vemapcontrol){var a=this.vemapcontrol.GetDashboard();if(a)a.Hide();this.Hide3DNavigationControl()}this._showDashboard=false};VEMap.prototype.ShowMiniMap=function(a,b,d){if(a!=null&&typeof a!="undefined"&&b!=null&&typeof b!="undefined"){VEValidator.ValidateInt(a,"x");VEValidator.ValidateInt(b,"y")}if(d)VEValidator.ValidateMiniMapSize(d,"size");var c=this.vemapcontrol.GetMinimap();if(c){if(a!=null&&typeof a!="undefined"&&b!=null&&typeof b!="undefined")c.SetPosition(parseInt(a),parseInt(b));c.Show()}else c=this.vemapcontrol.CreateMinimap(a,b,null,true,false,null,this.ClientToken);if(d)c.SetSize(d)};VEMap.prototype.HideMiniMap=function(){var a=this.vemapcontrol.GetMinimap();if(a)a.Hide()};VE_SetModuleStatus(VE_ModuleName.APICONTROLS,"loaded");VEMap.prototype.InitBirdseye=function(){};VEMap.prototype.GetBirdseyeScene=function(){if(this.GetMapMode()==Msn.VE.MapActionMode.Mode3D)return null;var a=null,b=this.vemapcontrol.GetObliqueScene();if(b!=null&&b!="undefined"){a=new VEBirdseyeScene(b);a.SetClientToken(this.ClientToken);a.SetGUID(this.GUID)}return a};VEMap.prototype.IsBirdseyeAvailable=function(){if(this.GetMapMode()==Msn.VE.MapActionMode.Mode3D)return false;return this.vemapcontrol.IsObliqueAvailable()};VEMap.prototype.SetBirdseyeOrientation=function(a){if(this.GetMapMode()==Msn.VE.MapActionMode.Mode3D)return false;VEValidator.ValidateOrientation(a,"orientation");return this.vemapcontrol.SetObliqueOrientation(a)};VEMap.prototype.SetBirdseyeScene=function(a,b,c,d){if(this.GetMapMode()==Msn.VE.MapActionMode.Mode3D)return false;if(a==null||a instanceof VELatLong)return this.SetBirdseye(a,b,c,d);else return this.vemapcontrol.SetObliqueScene(a)};VEMap.prototype.SetBirdseye=function(b,a,c,d){if(this.GetMapMode()==Msn.VE.MapActionMode.Mode3D)return false;if(b)VEValidator.ValidateObject(b,"veLatLong",VELatLong,"VELatLong");else b=this.GetCenter();if(a)VEValidator.ValidateOrientation(a,"orientation");else a=VEOrientation.North;if(c)VEValidator.ValidateNonNegativeInt(c,"zoomLevel");else c=1;if(d)VEValidator.ValidateFunction(d,"callback");else d=null;var e=(new _xy1).Decode(b);return this.vemapcontrol.SetObliqueLocation(new Msn.VE.LatLong(e.Latitude,e.Longitude),a,c,d)};VEMap.prototype.SetShapesAccuracy=function(a){if(a!=VEShapeAccuracy.None&&a!=VEShapeAccuracy.Pushpin&&a!=VEShapeAccuracy.All)throw new VEException("VEMap:SetShapesAccuracy","err_invalidargument",L_invalidargument_text.replace("%1","value").replace("%2","VEShapeAccuracy"));this.m_vegraphicsmanager._useOffset=a};VEMap.prototype.SetOverMaxPointsShapeRequest=function(a){if(a!=VEFailedShapeRequest.DoNotDraw&&a!=VEFailedShapeRequest.DrawInaccurately)throw new VEException("VEMap:SetOverMaxPointsShapeRequest","err_invalidargument",L_invalidargument_text.replace("%1","value").replace("%2","VEFailedShapeRequest"));this.m_vegraphicsmanager._drawOverMaxShapes=a};VEMap.prototype.SetFailedShapeRequest=function(a){if(a!=VEFailedShapeRequest.DoNotDraw&&a!=VEFailedShapeRequest.DrawInaccurately&&a!=VEFailedShapeRequest.QueueRequest)throw new VEException("VEMap:SetFailedShapeRequest","err_invalidargument",L_invalidargument_text.replace("%1","value").replace("%2","VEFailedShapeRequest"));this.m_vegraphicsmanager._failRequest=a};VEMap.prototype.SetShapesAccuracyRequestLimit=function(a){VEValidator.ValidateNonNegativeInt(a,"value");Msn.VE.API.Constants.maxasynlatlongs=a};VEShapeAccuracy=new function(){this.None=0;this.Pushpin=1;this.All=2};VEFailedShapeRequest=new function(){this.DoNotDraw=0;this.DrawInaccurately=1;this.QueueRequest=2};VE_SetModuleStatus(VE_ModuleName.APIBIRDSEYE,"loaded");VEMap.prototype.SetDisplayThreshold=function(a){var a=parseInt(a);if(isNaN(a))this.m_vegraphicsmanager.SetDisplayThreshold(a)};VEMap.prototype.EnableShapeDisplayThreshold=function(a){VEValidator.ValidateBoolean(a,"value");VE_LatLongThreshold.UseThreshold=a};VEMap.prototype.ImportShapeLayerData=function(a,c,b){VEValidator.ValidateObject(a,"_spec",VEShapeSourceSpecification,"VEShapeSourceSpecification");if(typeof a.LayerSource!="string"||typeof a.Type!="string")throw new VEException("VEMap:AddLayer","err_invalidlayertype",L_invalidlayertype_text);this.m_velayermanager.ImportLayer(a,c,b)};VEMap.prototype.SetInfoBoxStyles=function(a){window.ero.setClasses(a)};VEMap.prototype.ClearInfoBoxStyles=function(){window.ero.setClasses(_VECustomInfoBox)};VEMap.prototype.SetInfoBoxNokia=function(){window.ero.setClasses(_VECustomInfoBoxNokia)};VEMap.prototype.SetInfoBoxGM=function(){window.ero.setClasses(_VECustomInfoBoxGM)};VEMap.prototype.SetInfoBoxMissingChildren=function(){window.ero.setClasses(_VECustomInfoBoxMissingChildren)};VEMap.prototype.SetDefaultInfoBoxStyles=function(){window.ero.setClasses(ERO.DefaultClasses)};VEMap.prototype.ShowInfoBox=function(c,b,d){var k=typeof c=="object"&&c instanceof VEShape;if(!k)return;var j=c._shplayer==null||c._shplayer._mapGuid==null;if(j)return;var h=null,e=null,g=null;if(typeof b=="object")if(b instanceof VELatLong){e=b.Latitude;g=b.Longitude}else if(b instanceof VEPixel)if(!isNaN(b.x)&&!isNaN(b.y))h=b;if(e==null&&h==null){var f=c.Primitives[0];if(f.type==VEShapeType.Pushpin){e=f.points[1];g=f.points[0]}else{e=f.labelPosY;g=f.labelPosX}}var l=Msn.Drawing.GetLabelUID(c.Primitives[0].iid),a=null;if(e!=null){a=this.vemapcontrol.LatLongToPixel(new Msn.VE.LatLong(e,g),this.vemapcontrol.GetZoomLevel());if(a==null)a=new VEPixel(0,0)}else a=h;var i=typeof d=="object"&&d instanceof VEPixel;if(i)if(!isNaN(d.x)&&!isNaN(d.y)){a.x+=d.x;a.y+=d.y}if(a.x<0||a.x>this.GetWidth()||a.y<0||a.y>this.GetHeight())if(b instanceof VELatLong)throw new VEException("VEMap:ShowInfoBox","L_invalidargument_text",L_invalidargument_text.replace("%1","veAnchor").replace("%2","VELatLong"));else if(b instanceof VEPixel)throw new VEException("VEMap:ShowInfoBox","L_invalidargument_text",L_invalidargument_text.replace("%1","veAnchor").replace("%2","VEPixel"));else return;a.x+=this.GetLeft();a.y+=this.GetTop();VEShowVEShapeERO(l,this.GUID,null,c,a.x,a.y)};VEMap.prototype.HideInfoBox=function(){VEHideVEShapeERO(true)};VEMap.prototype.CloneShape=function(a){VEValidator.ValidateObject(a,"_veshape",VEShape,"VEShape");var c=this.m_velayermanager.VE_LayerManager,b=c.CloneAnnotation(a);return b};VEMap.prototype.AddShape=function(b){var a=this.m_velayermanager.VE_LayerManager.GetCollectionByIndex(0);a._mapGuid=this.GUID;a.AddShape(b)};VEMap.prototype.DeleteShape=function(a){VEValidator.ValidateObject(a,"_veshape",VEShape,"VEShape");if(a._shplayer)a._shplayer.DeleteShape(a)};VEMap.prototype.GetShapeByID=function(a){if(typeof a=="undefined"||a==null||a=="")return null;var b=this.m_velayermanager.VE_LayerManager,c=b.GetAnnotationById(a);return c};VEMap.prototype.AddShapeLayer=function(a,c)
{try
{VEValidator.ValidateObject(a,"shpLyr",VEShapeLayer,"VEShapeLayer");if(a._mapGuid!=null)
throw new VEException("VEMap:AddLayer","err_invalidlayertype",L_invalidlayertype_text);a._mapGuid=this.GUID;var d=this.m_velayermanager.VE_LayerManager;d.AddCollection(null,a);if(!a.GetVisibility())
return;if(typeof c!="undefined"&&c==true)
{var b=a.GetBoundingBox(),e=[new Msn.VE.LatLong(b.y1,b.x1),new Msn.VE.LatLong(b.y2,b.x2)];this.vemapcontrol.SetBestMapView(e)}
this.m_vegraphicsmanager.DrawLayer(a);}
catch(exptt){};};VEMap.prototype.DeleteShapeLayer=function(a){VEValidator.ValidateObject(a,"shpLyr",VEShapeLayer,"VEShapeLayer");try{a.DeleteAllShapes();this.m_velayermanager.VE_LayerManager.RemoveCollection(a)}catch(b){}};VEMap.prototype.DeleteAllShapeLayers=function(){try{this.DeleteAllShapes();this.m_velayermanager.VE_LayerManager.DeleteAll()}catch(a){}};VEMap.prototype.DeleteAllShapes=function(){try{this.m_vegraphicsmanager.ClearAll();var b=this.m_velayermanager.VE_LayerManager,c=b.GetCollectionCount();for(var a=0;a<c;a++)b.GetCollectionByIndex(a).DeleteAllShapes()}catch(d){}};VEMap.prototype.ShowAllShapeLayers=function(){this.m_velayermanager.ShowAllLayers()};VEMap.prototype.HideAllShapeLayers=function(){this.m_vegraphicsmanager.ClearAll();this.m_velayermanager.VE_LayerManager.SetVisibility(false)};VEMap.prototype.GetShapeLayerByIndex=function(b){if(typeof b=="undefined"||this.m_velayermanager==null)return null;var a=null;a=this.m_velayermanager.VE_LayerManager.GetCollectionByIndex(b);if(a)a._mapGuid=this.GUID;return a};VEMap.prototype.GetShapeLayerCount=function(){if(this.m_velayermanager==null)return 0;return this.m_velayermanager.VE_LayerManager.GetCollectionCount()};VEDataType=new function(){this.VECollection="c";this.GeoRSS="g";this.VETileSource="t";this.ImportXML="i"};function VEShapeSourceSpecification(a,c,b){this.Type=null;this.Layer=null;this.LayerSource=null;this.Method="Get";this.FnCallback=null;this.SetsBestMapView=true;this.Success=false;if(typeof a=="string"&&(a=="c"||a=="g"||a==VEDataType.ImportXML))this.Type=a;else throw new VEException("VEShapeSourceSpecification","err_invalidargument",L_invalidargument_text.replace("%1","type").replace("%2","VEDataType"));if(typeof b=="object"&&b instanceof VEShapeLayer)this.Layer=b;if(typeof c=="string")this.LayerSource=c;else throw new VEException("VEShapeSourceSpecification","err_invalidargument",L_invalidargument_text.replace("%1","layerSource").replace("%2","String"))}function VELayerManager(c){var a=this;VEValidator.ValidateNonNull(c,"vemap");this.m_vemap=c;this.m_vemapcontrol=this.m_vemap.vemapcontrol;this.m_veLatLongDecoder=new _xy1;this.m_spec=new VELatLongFactorySpecFromMap(this.m_vemap);var e=new VELatLongFactory(this.m_spec);this.VE_LayerManager=new Msn.VE.Core.LayerManager;var b=null;if(a.m_vemap.m_vegraphicsmanager)a.m_vemap.m_vegraphicsmanager.InitLayerManager(this);this.ImportLayer=function(a,d,c){a.Method="Get";if(typeof d=="function")a.FnCallback=d;if(typeof c!="undefined"&&c!=null)a.SetsBestMapView=c;if(typeof a.Layer!="object"||!(a.Layer instanceof VEShapeLayer))a.Layer=this.VE_LayerManager.GetCollectionByIndex(0);else if(a.Layer._mapGuid==null){a.Layer._mapGuid=this.m_vemap.GUID;this.VE_LayerManager.AddCollection(null,a.Layer)}else if(a.Layer._mapGuid!=this.m_vemap.GUID)throw new VEException("VEMap:AddLayer","err_invalidlayertype",L_invalidlayertype_text);a.Layer.Spec=a;if(a.Type==VEDataType.GeoRSS){if(b==null)b=new Msn.Drawing.MapGeoRssReader;this.AddGeoRSSLayer(a.Layer)}else if(a.Type==VEDataType.VECollection)this.AddVECollectionLayer(a.Layer);else if(a.Type==VEDataType.ImportXML)this.AddVEImportedLayer(a.Layer);else throw new VEException("VEMap:ImportShapeLayerData","err_invalidlayertype",L_invalidlayertype_text)};this.AddGeoRSSLayer=function(b){try{VENetwork.DownloadXml(b.Spec.LayerSource,b.Spec.Method,a.RetrieveGeoRSSCallback,b.GetId())}catch(c){throw c}};this.AddVECollectionLayer=function(d){try{var b=d;b.SetMsnId(d.Spec.LayerSource);var a=[];if(this.m_vemap.HasClientToken())a.push(new VEParameter(Msn.VE.API.Constants.clienttoken,this.m_vemap.ClientToken));a.push(new VEParameter("mapguid",this.m_vemap.GUID));a.push(new VEParameter("action","retrieveCollection"));a.push(new VEParameter(VE_CollectionsManagerConstants.C_Id,b.Spec.LayerSource));var e="VEMap._GetMapFromGUID('"+this.m_vemap.GUID+"')._lm.RetrieveCollectionCallback";a.push(new VEParameter(Msn.VE.API.Constants.rim,e));a.push(new VEParameter(Msn.VE.API.Constants.rimargs,"'"+b.GetId()+"'"));a.push(new VEParameter(Msn.VE.API.Constants.market,Msn.VE.API.Globals.locale));var c=new VENetwork;c.ServiceUrl=Msn.VE.API.Constants.collectionservice;c.BeginInvoke(null,a,_VEAPIOnImportLayerDataCallback,this.m_vemap.GUID+"_"+b.GetId())}catch(f){throw f}};this.AddVEImportedLayer=function(b){try{var a=[];b.SetMsnId(b.GetId());if(this.m_vemap.HasClientToken())a.push(new VEParameter(Msn.VE.API.Constants.clienttoken,this.m_vemap.ClientToken));a.push(new VEParameter("mapguid",this.m_vemap.GUID));a.push(new VEParameter("action","importcol"));a.push(new VEParameter("saveimport","v"));a.push(new VEParameter(VE_CollectionsManagerConstants.C_Id,b.GetId()));a.push(new VEParameter("mapurl",IOSec.EncodeUrl(b.Spec.LayerSource)));var d="VEMap._GetMapFromGUID('"+this.m_vemap.GUID+"')._lm.RetrieveImportedCallback";a.push(new VEParameter(Msn.VE.API.Constants.rim,d));a.push(new VEParameter(Msn.VE.API.Constants.rimargs,"'"+b.GetId()+"'"));a.push(new VEParameter(Msn.VE.API.Constants.market,Msn.VE.API.Globals.locale));var c=new VENetwork;c.ServiceUrl=Msn.VE.API.Constants.collectionservice;c.BeginInvoke(null,a,_VEAPIOnImportLayerDataCallback,this.m_vemap.GUID+"_"+b.GetId())}catch(e){throw e}};function d(a){if(!document.all){var c=new DOMParser;return c.parseFromString(a,"text/xml")}else{var b=new ActiveXObject("Msxml2.DOMDocument");b.loadXML(a);return b}}this.RetrieveGeoRSSCallback=function(f,g){var c=a.VE_LayerManager.RetrieveCollectionById(g),e=false;try{e=b.ReadGeoRSS(f,c)}catch(i){a.m_vemap.ShowMessage(i.message||L_loadxml_text);return}if(!e){a.m_vemap.ShowMessage(L_loadxml_text);return}if(c.GetVisibility()){if(c.Spec.SetsBestMapView&&c.GetShapeCount()>0){var d=c.GetBoundingBox(),h=[new Msn.VE.LatLong(d.y1,d.x1),new Msn.VE.LatLong(d.y2,d.x2)];a.m_vemapcontrol.SetBestMapView(h)}a.m_vemap.m_vegraphicsmanager.DrawLayer(c)}if(typeof c.Spec.FnCallback=="function")c.Spec.FnCallback(c)};this.RetrieveImportedCallback=function(a,b){var c=parseInt(a);if(isNaN(c))this.RetrieveCollectionCallback(a,b)};this.RetrieveCollectionCallback=function(f,g){var h=d(f),b=a.VE_LayerManager.RetrieveCollectionById(g);if(!b)return;b.Spec.Success=true;var e=new VE_MapRequestBean(MC_ACTION_RETRIEVE_COLLECTION);VE_MapCmlReader.ExtractCollections(e,h,this.VE_LayerManager);if(b.GetVisibility()){if(b.Spec.SetsBestMapView&&b.GetShapeCount()>0){var c=b.GetBoundingBox(),i=[new Msn.VE.LatLong(c.y1,c.x1),new Msn.VE.LatLong(c.y2,c.x2)];a.m_vemapcontrol.SetBestMapView(i)}a.m_vemap.m_vegraphicsmanager.DrawLayer(b)}if(b.Spec.FnCallback!=null&&b.Spec.FnCallback!="undefined")b.Spec.FnCallback(b)};this.RetrieveAllAnnotationsCallback=function(){}}VELayerManager.prototype.Dispose=function(){this.m_vemap.m_vegraphicsmanager.ClearAll();this.VE_LayerManager.DeleteAll();this.m_vemapcontrol=null;this.m_vemap=null;this.m_veLatLongDecoder=null;this.m_spec=null;this.VE_LayerManager.Dispose();this.VE_LayerManager=null};VELayerManager.prototype.ShowAllLayers=function(){this.VE_LayerManager.SetVisibility(true);var b=[],e=this.VE_LayerManager.GetCollectionCount();for(var c=0;c<e;++c){var d=this.VE_LayerManager.GetCollectionByIndex(c);if(d.GetShapeCount()>0){var a=d.GetBoundingBox();if(a!=null){b.push(new Msn.VE.LatLong(a.y1,a.x1));b.push(new Msn.VE.LatLong(a.y2,a.x2))}}}if(b.length>=2)this.m_vemapcontrol.SetBestMapView(b);this.m_vemap.m_vegraphicsmanager.DrawAll()};function _VEAPIOnImportLayerDataCallback(h,a){try{if(typeof a=="string"&&a.length>2){var g=a.length,c=a.indexOf("_");if(c<0||c>g-2)return;var f=a.substring(0,c),e=a.substring(c+1),d=VEMap._GetMapFromGUID(f)._lm,b=d.VE_LayerManager.RetrieveCollectionById(e);if(!b.Spec.Success)if(typeof b.Spec.FnCallback=="function")b.Spec.FnCallback(b,L_loadxml_text);else d.m_vemap.ShowMessage(L_loadxml_text)}}catch(i){throw i;return}}function VECreateVEShapeERO(b,d){if(b._IconContent==null){var a=[],f=b.GetPrimitive(0),e=f.iid;if(f.type!=VEShapeType.Pushpin)e=Msn.Drawing.GetLabelUID(e);var c=b._customIcon;if(c==null)c=b.IconUrl;if(c.indexOf("<")<0)c='<img src="'+c+'" />';a.push("<div onmouseout='if (VEMap._GetMapFromGUID(");a.push(d);a.push(").FireEvent(\"onmouseout\"))return;VEHideVEShapeERO(false);' onmouseover='if (VEMap._GetMapFromGUID(");a.push(d);a.push(').FireEvent("onmouseover"))return;VEShowVEShapeERO("');a.push(e);a.push('",');a.push(d);a.push(");'> ");a.push(c);a.push("</div>");b._IconContent=a.join("")}return b._IconContent}
function VEShowVEShapeERO(m,q,h,p,f,g,dShow)
{var j=GetVEMapInstance(q);if(j==null)
return;var a=null,s=null,r=null;if(typeof p=="object")
a=p;else
{if(j.m_velayermanager==null)
return;var k=null;k=j.m_velayermanager.VE_LayerManager;if(!k)
return;a=k.GetAnnotationById(m);if(!a)
return}
if(!a._eroContent){var l=false,act=a.Actions,e=a.Title,d=a.Notes,n=IOSec.GetValidatedUrl(a.Url),i=IOSec.GetValidatedUrl(a.PhotoUrl);r=a.Latitude;s=a.Longitude;var c="";try
{if(j!=null){j.SetDefaultInfoBoxStyles();if(e!=null){if(e=="NOKIA"){j.SetInfoBoxNokia();if(document.images){var imgNok=new Image();imgNok.src="http://view.atdmt.com/912/view/msnbrnob0020000449912/direct/01/";}}
else if(e=="GM"){j.SetInfoBoxGM();}
else if(e=="MC"){j.SetInfoBoxMissingChildren();}}}}
catch(e){}
if(typeof i=="string"&&i.length>1)
{c=c.concat('<a href="" onclick="window.open(\'',i,"', '_blank' , 'menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,width=800,height=600,screenX=200,left=200,screenY=200,top=200');return false;\">");c=c.concat('<img class="ero-previewArea-image" id=eroImg_',m,' src="',IOSec.EncodeHtml(i),'"/></a>')}
e=c.concat(e);if(typeof n=="string"&&n.length>0)
d=d.concat("<p><a href='",n,'\' class="VE_Pushpin_Popup_Link" target=_blank>. . .</a></p>');var b=[];b.push("<p>");if(e.length>0)
{b.push('<div class="VE_Pushpin_Popup_Title">');b.push(unescape(e));b.push("</div>");l=true}
if(d.length>0)
{b.push('<div class="VE_Pushpin_Popup_Body">');b.push(unescape(d));b.push("</div>");l=true}
if(!document.all&&(e.length==0||d.length==0))
b.push("<br/><br/>");b.push("</p>");if(l)
a._eroContent=b.join("");else
a._eroContent=""}
var act=null;if(a)
act=a.Actions;window.ero.clearActions();if(act)
{var sp=act.split('|');for(var icount=0;icount<sp.length;icount++)
window.ero.addAction(unescape(sp[icount]));}
eroContent=a._eroContent;if(eroContent)
{window.ero.setContent(eroContent);if(j.GetMapMode()==Msn.VE.MapActionMode.Mode2D)
if(typeof f=="number"&&typeof g=="number")
{var h=new Msn.VE.Geometry.Rectangle(new Msn.VE.Geometry.Point(f,g),new Msn.VE.Geometry.Point(f,g));window.ero.dockToRect(h,null,-1)}
else
{var o=$ID(m);if(dShow)
o=$ID(dShow);else
o=$ID(m);if(o!=null&&o!="undefined")
{window.ero.setBoundingArea(null);window.ero.getBoundingArea().move(Gimme.Screen.getScrollPosition());window.ero.dockToElement(o)}}
else
{if(typeof h=="undefined"||h==null)
h=new Msn.VE.Geometry.Rectangle(new Msn.VE.Geometry.Point(f,g),new Msn.VE.Geometry.Point(f,g));ero.setGlitz(false,false,false,true);window.ero.dockToRect(h,null,-1)}}}
function VEHideVEShapeERO(a){if(window.ero!=null){if(a=="undefined"||a==null)a=false;window.ero.hide(a)}}
var _VECustomInfoBox={ContainerNoBeak:"customInfoBox-noBeak",ContainerRightBeak:"customInfoBox-with-rightBeak",ContainerLeftBeak:"customInfoBox-with-leftBeak",Beak:"customInfoBox-beak",Shadow:"customInfoBox-shadow",Body:"customInfoBox-body",Actions:"customInfoBox-actions",ActionsBackground:"customInfoBox-actionsBackground",PreviewArea:"customInfoBox-previewArea",PaddingHack:"customInfoBox-paddingHack",ProgressAnimation:"customInfoBox-progressAnimation"};var _VECustomInfoBoxNokia={ContainerNoBeak:"ero noBeakNokia",ContainerRightBeak:"ero rightBeakNokia",ContainerLeftBeak:"ero leftBeakNokia",Beak:"beakNokia",Shadow:"shadowNokia",Body:"bodyNokia",Actions:"actionsNokia",ActionsBackground:"actionsBackgroundNokia",PreviewArea:"previewAreaNokia",PaddingHack:"paddingHackNokia",ProgressAnimation:"progressAnimationNokia"};var _VECustomInfoBoxGM={ContainerNoBeak:"ero noBeakGM",ContainerRightBeak:"ero rightBeakGM",ContainerLeftBeak:"ero leftBeakGM",Beak:"beakGM",Shadow:"shadowGM",Body:"bodyGM",Actions:"actionsGM",ActionsBackground:"actionsBackgroundGM",PreviewArea:"previewAreaGM",PaddingHack:"paddingHackGM",ProgressAnimation:"progressAnimationGM"};var _VECustomInfoBoxMissingChildren={ContainerNoBeak:"ero noBeakMissingChildren",ContainerRightBeak:"ero rightBeakMissingChildren",ContainerLeftBeak:"ero leftBeakMissingChildren",Beak:"beakMissingChildren",Shadow:"shadowMissingChildren",Body:"bodyMissingChildren",Actions:"actionsMissingChildren",ActionsBackground:"actionsBackgroundMissingChildren",PreviewArea:"previewAreaMissingChildren",PaddingHack:"paddingHackMissingChildren",ProgressAnimation:"progressAnimationMissingChildren"};function VE_GetGeoCommunityUrl(a){if(a)return MC_GEOCOMMUNITY_SERVICEURL;else return"GeoCommunity.asjx"}function VE_IsLargeData(a){if(a.length>MC_GEOCOMMUNITY_SIZELIMIT-2048)return true;return false}var MC_GEOCOMMUNITY_SIZELIMIT=204800,MC_GEOCOMMUNITY_SERVICEURL="GeoCommunity.asjx",MC_VESHAPE_EMPTY=-1777,MC_VIEW_BUFFER=1,MC_STYLE_PINZIndex=300,MC_IID_NAMESPACE="msftve",MC_IID_CON_TOKEN="_",MC_GEO_TYPE_MULTIGEOMETRY="Multigeometry",MC_GEO_TYPE_FREEHAND="Freehand",MC_STYLE_FILL_COLOR="fillcolor",MC_STYLE_STROKE_COLOR="strokecolor",MC_STYLE_STROKE_WEIGHT="strokeweight",MC_STYLE_STROKE_STYLE="stroke-style",MC_STYLE_STROKE_DASH="stroke-dashstyle",MC_STYLE_FONT_COLOR="font_color",MC_STYLE_STROKE_ARROW="stroke_arrow",MC_STYLE_FONT_ITALIC="font_italic",MC_STYLE_FONT_UNDERSCORE="font_underscore",MC_STYLE_FONT_BOLD="font_bold",STATE_DEFAULT=0,STATE_DRAWING=1,STATE_EDITING=2,MC_DRAW_DEFAULT=100,MC_DRAW_POINT=101,MC_DRAW_POLYLINE=102,MC_DRAW_POLYGON=103,MC_DRAW_RECT=104,MC_DRAW_CIRCLE=105,MC_DRAW_TEXT=1065,MC_DRAW_MODEL=1066,MC_EDIT_ADDNODE=107,MC_EDIT_DELNODE=108,MC_EDIT_MOVENODE=108,MC_EDIT_SELNODE=109,MC_EDIT_SELEDGE=110,MC_EDIT_CONTINUELINE=111,MC_LABEL_VIEWER="viewer",MC_PROPERTY_DEFAULT=0,MC_PROPERTY_HIGHWAY=1,MC_PROPERTY_ROAD=2,MC_PROPERTY_LAKE=3,MC_PROPERTY_PARK=4,MC_PROPERTY_PARKINGLOT=5,MC_PROPERTY_PUSHPIN=6,MC_PROPERTY_TEMPDRAW=7,MC_PROPERTY_TEMPEDIT=8,MC_PROPERTY_EDITNODE=10,MC_PROPERTY_EDITSELNODE=11,MC_PROPERTY_GHOSTNODE=12,MC_NUMBERFORMAT_NUMBEROFDIGITSAFTERDOT=2,MC_NUMBERFORMAT_ZEROSTRING="0",MC_DECIMALROUNDOFF_THRESHOLD=100,MC_CML_ENTITY_NAME="Entity",MC_CML_ENTITY_PRIMITIVES="Primitives",MC_CML_ENTITY_PRIMITIVE="Primitive",MC_CML_ENTITY_COORDINATES="coordinates",MC_CML_DESCRIPTION="Description",MC_CML_TAGS="Tags",MC_CML_VIEWPORT="ViewPort",MC_CML_TOUR="Tour",MC_CML_PITCH="pitch",MC_CML_HEADING="heading",MC_CML_MAPSTYLE="mapstyle",MC_CML_SCENEID="sceneId",MC_CML_ACTIONS="Actions",MC_CML_ACTION="Action",MC_CML_MODELREP="ModelRep",MC_CML_TRANSFORM="transform",MC_CML_MODELREFID="modelRefId",MC_CML_ENTITY_TYPE_PUSHPIN="pushpin",MC_CML_PROPERTYS="Properties",MC_CML_PROPERTY="Property",MC_CML_MINBOUNDS="minbounds",MC_CML_MAXBOUNDS="maxbounds",MC_CML_R2EOFFSET="r2eoffset",MC_CML_PHOTOS="Photos",MC_CML_PHOTO="Photo",MC_CML_PREAUTHURL="PreAuthUrl",MC_CML_PUBLISHER="publisher",MC_CML_PROPERTY_ICONURL="iconurl",MC_CML_PROPERTY_KEYWORDS="keywords",MC_CML_PROPERTY_URL="url",MC_CML_PROPERTY_PHOTOURL="photourl",MC_CML_PROPERTY_USERDATE="userdate",MC_CML_PROPERTY_DISPLAYORDER="displayorder",MC_CML_PROPERTY_BUSINESSLISTINGID="businesslistingid",MC_CML_PROPERTY_MAPSERVICETYPE="mapserviceType",MC_CML_PROPERTY_MAPSERVICESOURCE="mapserviceSource",MC_CML_PROPERTY_MAPSERVICEOPACITY="mapserviceOpacity",MC_CML_PROPERTY_MAPSERVICEMETADATA="mapserviceMetadata",MC_CML_PROPERTY_SOURCEURL="sourceurl",MC_CML_PROPERTY_SOURCETYPE="sourcetype",MC_CML_TILEID="tileId",MC_CML_PROPERTY_TYPE="type",MC_CML_LASTMODIFIED="DateModified",MC_CML_DATECREATED="DateCreated",MC_CML_ROOT="CML",MC_CML_SEPERT="/",MC_CML_TOKEN=",",MC_CML_VERSION="0.1",MC_CML_ID="id",MC_CML_IID="clientid",MC_CML_NAME="name",MC_CML_CULTURE="culture",MC_CML_SHARELEVEL="Sharelevel",MC_CML_STATE="State",MC_CML_STATE_PUBLIC_CAN_VIEW=1,MC_CML_STATE_OWNER_CAN_VIEW=2,MC_CML_STATE_OWNER_CAN_UPDATE=4,MC_CML_STATE_OWNER_IS_VIEWING=8,MC_CML_TYPE="Type",MC_CML_Add="Add",MC_CML_EXTRUSION="Extrusion",MC_CML_VISIBILITY="visibility",MC_CML_DISPLAYORDER="displayorder",MC_CML_DEFAULTSTYLE="DefaultStyle",MC_CML_LABELSTYLE="LabelStyle",MC_CML_POSITION="Position",MC_CML_STYLE="Style",MC_CML_FILLSYMBOL="Fill",MC_CML_SHAPESYMBOL="Shape",MC_CML_STYLESYMBOL="Style",MC_CML_STROKESYMBOL="Stroke",MC_CML_SHADOWSYMBOL="Shadow",MC_CML_IMAGEDATASYMBOL="Imagedata",MC_CML_ZOOMLEVEL="zoomlevel",MC_CML_ONSCRATCHPAD="onScratchpad",MC_CML_TOKEN1=",",MC_CML_TOKEN2=":",MC_CML_TOKEN3=";",MC_CML_CONTENTS="Contents",MC_CML_CONTENT="Content",MC_CML_SIMPLEHTML="SimpleHTML",MC_CML_GLINK="glink",MC_CML_COLLECTIONS="Collections",MC_CML_COLLECTION="Collection",MC_CML_ENTITY="Entity",MC_CML_MULTIGEOMETRY="MultiGeometry",MC_CML_POLYGON="Polygon",MC_CML_OUTLS="outerBoundaryIs",MC_CML_ITLS="interBoundaryIs",MC_CML_LINEARSTRING="LinearRing",MC_CML_POLYLINE="LineString",MC_CML_LENGTH="length",MC_CML_AREA="area",MC_CML_HREF="href",MC_CML_POINT="Point",MC_CML_COORDS="coordinates",MC_CML_ALTITUDE="altitudes",MC_CML_ALTITUDEMODE="altitudemode",MC_CML_ALTGROUND="Ground",MC_CML_ALTDATUM="Datum",MC_CML_EXTRUDE="extruded",MC_CML_KEY="key",MC_CML_VALUE="value",MC_CML_CLIENTDATA="ClientData",MC_CML_EXCOL_PREFIX="E*",MC_CML_IMPORT_DATAURL="mapurl",MC_CML_IMPORT_SAVESTATUS="saveimport",MC_CML_IMPORT_COLNAME="colname",MC_CML_IMPORT_REPORT="importreport",MC_CML_IMPORT_FILEUPLOAD="fileupload",MC_CML_CID_LIST="cids",MC_ACTION_IMPORT_COLLECTION="ImportCol",MC_ACTION_IMPORT_ENTITY="ImportEntity",MC_ACTION_CLONE_ENTITY="CloneEntity",MC_ACTION_CREATE_COLLECTION="CreateCollection",MC_ACTION_UPDATE_COLLECTION="UpdateCollection",MC_ACTION_DELETE_COLLECTION="DeleteCollection",MC_ACTION_CLEAR_COLLECTION="ClearCollection",MC_ACTION_RETRIEVE_ALLCOLLECTIONS="RetrieveAllCollections",MC_ACTION_RETRIEVE_ALLCOLLECTIONS_METADATA="RetrieveAllCollectionsMetadata",MC_ACTION_RETRIEVE_COLLECTION="RetrieveCollection",MC_ACTION_RETRIEVE_SHAREDCOLLECTION="RetrieveSharedCollection",MC_ACTION_DELETE_ENTITY="DeleteEntity",MC_ACTION_ADD_ENTITY="AddEntity",MC_FCCALLBACK="fncallback",MC_ACTION_REPAINT="Repaint",MC_ACTION_CREATE_PHOTO="CreatePhoto",MC_ACTION_DELETE_PHOTO="DeletePhoto",MC_CHANGE_STATE_UPDATE=1,MC_CHANGE_STATE_DELETE=2,MC_CHANGE_STATE_CREATE=3,MC_CHANGE_STATE_CLONE=4,MC_CHANGE_STATE_MOVE=5,MC_CHANGE_STATE_DEFAULT=0,MC_CHANGE_TYPE_METADATA=1,MC_CHANGE_TYPE_CHILDREN=2,MC_CHANGE_TYPE_ALL=3,MC_COLLECTION_SIGNIN_SIZE=2048,MC_MAXSHAPEPOINTS_IN_EMAIL=200,MC_MAX_EMAIL_LINK_LEN=1800,MC_MIN_EMAIL_NOTES_LEN=100,MC_MAX_DRILL_SIZE=200,MC_TIMER_KEEPTRYING="keeptrying",MC_TIMER_MINDELAY=0,MC_TIMER_DELAY=3000,MC_TIMER_REPEAT_DELAY=3000,MC_TIMER_NOW=10,MC_TIMER_EXTENDDELAY=30000,MC_REQUEST_QUEUE_MAXSIZE=20,MC_TIMER_VALUE="DELAYVALUE",MC_UPLOAD_TIMEOUT=90000,MC_KVP_COLLIST="COLLIST",MC_KVP_COL_MSNID="COL_MSNID",MC_KVP_COL_MSNID2="COL_MSNID2",MC_KVP_COL="COL",MC_KVP_COL_CLIENTDATA="COL_CLIENTDATA",MC_KVP_ENTITY_MSNID="ENTITY_MSNID",MC_KVP_ENTITYLIST="ENTITYLIST",MC_KVP_ENTITY="ENTITY",MC_KVP_SERVER_STATUS="req_status",MC_KVP_SETBESTMAPVIEW="set_best_view",MC_KVP_VIEWTOUR="view_tour",MC_KVP_CML="CML",MC_COLLECTIONLIST_UL_ID="sp_collection_list",MC_SCRATCHPADITEM_LI_SUFFIX="_li",MC_SCRATCHPADITEM_MEASURE_SUFFIX="_m",MC_SIGNIN="Signin",MC_SCRATCHPAD_DRAGCURSOR="move",MC_SCRATCHPAD_DRAGGEDSTYLE="DraggedLI",MC_SCRATCHPAD_COLLECTIONLISTDIV_ID="scratchPadCollectionListWrapper",MC_SCRATCHPAD_WRAPLEN_TITLE=22,MC_SCRATCHPAD_WRAPLEN_DESC=26,MC_CV_WRAPLEN_COLLECTIONDESC=28,MC_CV_WRAPLEN_TITLE=22,MC_CV_WRAPLEN_DESC=22,MC_ERO_WRAPLEN_TITLE=22,MC_ERO_WRAPLEN_DESC=28,MC_SERVER_STATUS_NO_ACCESS="not authorized",MC_SERVER_STATUS_BUSY="server busy",MC_SERVER_STATUS_OK="200",MC_SERVER_STATUS_STORE_ERROR="570",MC_SERVER_STATUS_NAMEEXIST_ERROR="571",MC_SERVER_STATUS_QUOTA_ERROR="572",MC_SERVER_STATUS_UNEXPECTED_ERROR="500",MC_SERVER_STATUS_ACCESSDENIED_ERROR="403",MC_SERVER_STATUS_CONTAINSSENSITIVEWORDS_ERROR="581",MC_COL_TYPE_FAVORITE=1,MC_COL_TYPE_COLLECTION=0,MC_COL_TYPE_RESULT=2,MC_COL_TYPE_TRAFFIC=3,MC_COL_TYPE_DRIVING=4,MC_COL_TYPE_RSSFEED=5,MC_COL_TYPE_TILEIMAGE=6,MC_DS_MSN_CML=0,MC_DS_FILE_CML=1,MC_DS_MSN_VEML=2,MC_MAX_LOADED_COLS=2,MC_MAX_COL_SIZE=200,cssCursors,MC_SA_NEWCOL="newcol",MC_SA_IMPORT="import",MC_SA_UPLOADPHOTO="uploadphoto",MC_SA_REFRESH="forcedrefresh";function VE_MapStruct(){}VE_MapStruct.PushpinType={ViewerClass:"VE_Community_searchResult",PushpinClass:"VE_Pushpin",Token:" ",PushpinAn:"VE_Pushpin VE_Pushpin_aN",Polyline:"VE_Pushpin VE_Pushpin_Polyline",Polygon:"VE_Pushpin VE_Pushpin_Polygon",Model:"VE_Pushpin VE_Pushpin_Model_viewer",Overlay:"VE_Pushpin VE_Pushpin_Overlay",PushpinViewer:"VE_Pushpin_viewer",PolylineViewer:"VE_Pushpin_Polyline_viewer",PolygonViewer:"VE_Pushpin_Polygon_viewer",ModelViewer:"VE_Pushpin_Model_viewer",OverlayViewer:"VE_Pushpin_Overlay_viewer",PushpinViewerTopMost:"VE_Pushpin_viewer topMost",PolylineViewerTopMost:"VE_Pushpin_Polyline_viewer polytopMost",PolygonViewerTopMost:"VE_Pushpin_Polyline_viewer polytopMost",ModelViewerTopMost:"VE_Pushpin_Model_viewer polytopMost",OverlayViewerTopMost:"VE_Pushpin_Overlay_viewer polytopMost",SearchResults:"searchResults"};VE_MapStruct.PushpinSize={WidthaN:22,HeightaN:17,WidthShp:22,HeightShp:-17,WidthLbl:-29,HeightLbl:-17,WidthView:25,HeightView:29,WidthShpView:25,HeightShpView:-29};_VERegisterNamespaces("Msn.VE.Core");Msn.VE.Core.Layer=function(){this.iid=null;this.MsnId=null;this.Name="unsaved collection";this.Type=0;this.Visibility=true;this.Boundingbox=null;this.MaxScale=21;this.MinScale=1;this.Spec=null};Msn.VE.Core.Layer.prototype.SetMsnId=function(a){this.MsnId=a};Msn.VE.Core.Layer.prototype.GetMsnId=function(){return this.MsnId};Msn.VE.Core.Layer.prototype.SetId=function(a){this.iid=a};Msn.VE.Core.Layer.prototype.GetId=function(){return this.iid};Msn.VE.Core.Layer.prototype.SetName=function(a){this.Name=a};Msn.VE.Core.Layer.prototype.GetName=function(){return this.Name};Msn.VE.Core.Layer.prototype.SetType=function(a){this.Type=a};Msn.VE.Core.Layer.prototype.GetType=function(){return this.Type};Msn.VE.Core.Layer.prototype.SetVisibility=function(a){this.Visibility=a};Msn.VE.Core.Layer.prototype.GetVisibility=function(){return this.Visibility};Msn.VE.Core.Layer.prototype.SetMaxZoomLevel=function(a){this.MaxScale=a};Msn.VE.Core.Layer.prototype.GetMaxZoomLevel=function(){return this.MaxScale};Msn.VE.Core.Layer.prototype.SetMinZoomLevel=function(a){this.MinScale=a};Msn.VE.Core.Layer.prototype.GetMinZoomLevel=function(){return this.MinScale};Msn.VE.Core.Layer.prototype.SetBoundingBox=function(f,e,c,d,a,b){if(!this.Boundingbox){if(c==null||d==null||a==null||b==null)return null;this.Boundingbox=new Msn.VE.Bounds(f,e,c,d,a,b)}else{this.Boundingbox.x1=c;this.Boundingbox.y1=d;this.Boundingbox.z1=f;this.Boundingbox.x2=a;this.Boundingbox.y2=b;this.Boundingbox.z2=e}return this.Boundingbox};Msn.VE.Core.Layer.prototype.GetBoundingBox=function(){if(typeof this.Boundingbox=="undefined"||!this.Boundingbox)this.Boundingbox=new Msn.VE.Bounds(0,0,Infinity,Infinity,-Infinity,-Infinity);return this.Boundingbox};Msn.VE.Core.VectorLayer=function(){};Msn.VE.Core.VectorLayer.prototype=new Msn.VE.Core.Layer;Msn.VE.Core.RasterLayer=function(){};Msn.VE.Core.RasterLayer.prototype=new Msn.VE.Core.Layer;function VELatLong(b,a,c,d){this.Latitude=null;this.Longitude=null;this.Altitude=null;this.AltitudeMode=null;this._reserved=null;if(b!=null){VEValidator.ValidateFloat(b,"latitude");this.Latitude=b}if(a!=null){VEValidator.ValidateFloat(a,"longitude");this.Longitude=a}if(c!=null)this.SetAltitude(c,d)}VELatLong.prototype.SetAltitude=function(b,a){VEValidator.ValidateFloat(b,"altitude");this.Altitude=b;if(a!=null){VEValidator.ValidateAltitudeMode(a,"altitudeMode");this.AltitudeMode=a}else this.AltitudeMode=VEAltitudeMode.Default};VELatLong.prototype.HasAltitude=function(){return this.Altitude!=null};function Clone(){var a=new VELatLong;a.Latitude=this.Latitude;a.Longitude=this.Longitude;a._reserved=this._reserved;a.Altitude=this.Altitude;a.AltitudeMode=this.AltitudeMode;return a}function toString(){var a="";if(this.Latitude!=null&&this.Longitude!=null)a=this.Latitude+", "+this.Longitude;if(this.Altitude!=null)a+=", "+this.Altitude;return a}VELatLong.prototype.toString=toString;VELatLong.prototype.Clone=Clone;function VELatLongRectangle(d,c,b,a){VEValidator.ValidateObject(d,"topLeftLatLong",VELatLong,"VELatLong");VEValidator.ValidateObject(c,"bottomRightLatLong",VELatLong,"VELatLong");this.TopLeftLatLong=d;this.BottomRightLatLong=c;if(b!=null&&b!="undefined"){VEValidator.ValidateObject(b,"topRightLatLong",VELatLong,"VELatLong");this.TopRightLatLong=b}if(a!=null&&a!="undefined"){VEValidator.ValidateObject(a,"bottomLeftLatLong",VELatLong,"VELatLong");this.BottomLeftLatLong=a}}VEAltitudeMode=new function(){this.Default="Ground";this.Absolute="Datum";this.RelativeToGround="Ground"};function VEValidator(){}VEValidator.ValidateFloat=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateFloat";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","float"));try{if(isNaN(parseFloat(b)))throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","float"));return true}catch(d){throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","float"))}};VEValidator.ValidateInt=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateInt";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","int"));try{if(isNaN(parseInt(b))||parseFloat(b)!=parseInt(b))throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","int"));return true}catch(d){throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","int"))}};VEValidator.ValidateNonNegativeInt=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateNonNegativeInt";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidnonnegativeint_text.replace("%1",c));try{if(isNaN(parseInt(a))||parseFloat(a)!=parseInt(a)||parseInt(a)<0)throw new VEException(b,"err_invalidargument",L_invalidnonnegativeint_text.replace("%1",c));return true}catch(d){throw new VEException(b,"err_invalidargument",L_invalidnonnegativeint_text.replace("%1",c))}};VEValidator.ValidateFunction=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateFunction";if(b==null||typeof b!="function")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","function"))};VEValidator.ValidateNonNull=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateNonNull";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","non null"))};VEValidator.ValidateBetween=function(b,e,d,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateBetween";if(b<d||b>c)throw new VEException(a,"err_invalidargument",L_invalidbetweenint_text.replace("%1",e).replace("%2",d).replace("%3",c))};VEValidator.ValidateBoolean=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateBoolean";if(b!=true&&b!=false)throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","bool"))};VEValidator.ValidateMapStyle=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateMapStyle";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","MapStyle"));if(a=="r"||a=="R"||a=="s"||a=="S"||a=="a"||a=="A"||a=="o"||a=="O"||a=="b"||a=="B"||a=="h"||a=="H")return true;throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","MapStyle"))};VEValidator.ValidateMapMode=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a="")a="VEValidator.ValidateMapMode";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","MapMode"));if(b==VEMapMode.Mode2D||b==VEMapMode.Mode3D)return true;throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","MapMode"))};VEValidator.ValidateDistanceUnit=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateDistanceUnit";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDistanceUnit"));if(b==VEDistanceUnit.Miles||b==VEDistanceUnit.Kilometers)return true;throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDistanceUnit"))};VEValidator.ValidateMaxZoom=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateMaxZoom";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","ValidateMaxZoom"));if(b<=Msn.VE.API.Globals.vemaxzoom)return true;throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","ValidateMaxZoom"))};VEValidator.ValidateLayerType=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateLayerType";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDataType"));if(a==VEDataType.GeoRSS||a==VEDataType.VECollection||a==VEDataType.VETileSource)return true;throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDataType"))};VEValidator.ValidateDashboardSize=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateDashboardSize";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDashboardSize"));if(a==VEDashboardSize.Normal||a==VEDashboardSize.Small||a==VEDashboardSize.Tiny)return true;throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDashboardSize"))};VEValidator.ValidateMiniMapSize=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateMiniMapSize";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEMiniMapSize"));if(b==VEMiniMapSize.Small||b==VEMiniMapSize.Large)return true;throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEMiniMapSize"))};VEValidator.ValidateAltitudeMode=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateAltitudeMode";if(b==null)throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEAltitudeMode"));if(b!=VEAltitudeMode.Absolute&&b!=VEAltitudeMode.RelativeToGround)throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEAltitudeMode"));return true};VEValidator.ValidateObject=function(b,c,e,d){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateObject";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","non null"));if(!(b instanceof e))throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2",d))};VEValidator.ValidateObjectArray=function(a,d,f,e){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateObject";if(a==null||typeof a=="undefined"||a.length==null||typeof a.length=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",d).replace("%2","array"));for(var c=0;c<a.length;++c)if(a[c]==null||typeof a[c]=="undefined"||!(a[c]instanceof f))throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",d).replace("%2",e))};VEValidator.ValidateOrientation=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateOrientation";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEOrientation"));if(a!=VEOrientation.North&&a!=VEOrientation.East&&a!=VEOrientation.West&&a!=VEOrientation.South)throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEOrientation"))};VEValidator.ValidateBounds=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateBounds";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VELatLongRectangle"));if(a.TopLeftLatLong==null||a.BottomRightLatLong==null||a.TopLeftLatLong.Latitude<=a.BottomRightLatLong.Latitude||a.TopLeftLatLong.Longitude>=a.BottomRightLatLong.Longitude)throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VELatLongRectangle"))};VEValidator.GetCaller=function(b){if(b!=null||b!=""){try{var a=b.toString().match(/function (\w*)/)[1]}catch(c){a=""}if(a==null||a.length==0)return"";else return a}else return""};Msn.VE.Core.MapServiceLayerManager=function(){var a=[],o=200,q=1;MapOverlayNode=function(b,a){this.item=b;this.layers=a};function b(a){return a!=null&&IsValidMapserviceType(a.MapserviceType)&&a.MapserviceType!=VEMapserviceType.None}function g(a){return a!=null&&b(a)&&IsValidMapserviceMetadata(a.MapserviceMetadata)}function c(e){if(!b(e))return-1;for(var d=0;d<a.length;d++){var c=a[d];if(c!=null&&c.item!=null&&(c.item==e||c.item.iid==e.iid))return d}return-1}function j(d){var b=c(d);return b!=-1?a[b]:null}function p(a){return c(a)!=-1}function m(a){if(a==null||a.Annotations==null)return;for(var b=0;b<a.Annotations.length;b++)h(a.Annotations[b])}function l(a){if(a==null||a.Annotations==null)return;for(var b=0;b<a.Annotations.length;b++)d(a.Annotations[b])}function h(c){if(!b(c))return null;d(c);var e=i(c);if(e!=null)a.push(e);return e}function d(h){var e=c(h);if(e==-1)return;var f=a[e];if(f==null)return;var d=[];for(var b=f.layers.length-1;b>=0;b--){var g=f.layers[b];if(g==null)continue;d.push(g.ID)}if(map.IsModeEnabled(Msn.VE.MapActionMode.Mode3D))n(d);for(var b=0;b<d.length;b++){map.ClearTileLayer(d[b]);map.DeleteTileSource(d[b],true)}a.splice(e,1)}function k(a,c){if(!b(a))return;var d=j(a);return f(d,c)}function f(a,i){if(a==null||a.layers==null||a.layers.length==0)return;var b=[];for(var g=0;g<a.layers.length;g++){var e=a.layers[g];if(e==null||e.Bounds==null)continue;for(var f=0;f<e.Bounds.length;f++){var c=e.Bounds[f];if(c==null)continue;b.push(new Msn.VE.LatLong(c.TopLeftLatLong.Latitude,c.TopLeftLatLong.Longitude));b.push(new Msn.VE.LatLong(c.BottomRightLatLong.Latitude,c.BottomRightLatLong.Longitude));b.push(new Msn.VE.LatLong(c.TopRightLatLong.Latitude,c.TopRightLatLong.Longitude));b.push(new Msn.VE.LatLong(c.BottomLeftLatLong.Latitude,c.BottomLeftLatLong.Longitude));break}break}if(b.length>=4){map.SetBestMapView(b);if(!i)return;a.item.Latitude=(b[0].latitude+b[3].latitude)/2;a.item.Longitude=(b[0].longitude+b[2].longitude)/2;var d=a.item.GetPrimitive(0);if(d&&d.points&&d.points.length>=2){d.points[0]=a.item.Longitude;d.points[1]=a.item.Latitude}mvcViewFacade.OnEntityRepaint(a.item);var h=$ID(d.iid);if(h){var j=new Msn.VE.LatLong(a.item.Latitude,a.item.Longitude);h.vePushpin.MoveToLatLon(j)}}}function s(){return o}function r(){return a.length}function i(j){if(!g(j))return null;NextOverlay=function(){return q++};var B=map.IsModeEnabled(Msn.VE.MapActionMode.Mode3D),l=B?17:19,w=j.MapserviceMetadata.split("]");if(!w||w.length<=1)return null;var k=[],u=[],t=[];for(var o=0;o<w.length;o++){var m=w[o];if(!m||m.length<=1||m.charAt(0)!="[")continue;m=m.substring(1,m.length);var z=m.split("&");if(!z)continue;for(var x=0;x<z.length;x++){var F=z[x];if(!F)continue;var s=F.split("=",2);if(!s||s.length!=2)continue;var E=s[0].trim().toLowerCase(),D=s[1];if(o==0)k[E]=D;else{if(x==0)u.push([]);var N=u[o-1];N[E]=D}}}var M=k["type"];if(M!="VE")return null;var O=k["referencename"],P=k["displayname"],p=k["tilesource"];if(p==null||p==""||typeof p=="undefined")return null;var c=k["minzoom"];c=c==null||typeof c=="undefined"||c==""?1:parseInt(c);if(c<1||c>l)c=1;var a=k["maxzoom"];a=a==null||typeof a=="undefined"||a==""?l:parseInt(a);if(a<1||a>l||a<b)a=l;var i=parseFloat(j.MapserviceOpacity);if(isNaN(i)||i<=0||i>100)i=.6;if(i>1&&i<=100)i/=100;var G="{VE_MapServiceLayer:"+j.MapserviceType+":"+NextOverlay().toString()+":"+j.iid+"}";for(var y=0;y<u.length;y++){var v=u[y],r=v["bbox"];if(r==null||typeof r=="undefined")continue;var h=r.split(",",4);if(h==null||typeof r=="undefined"||h.length!=4)continue;var K=new VELatLong(parseFloat(h[3]),parseFloat(h[0])),J=new VELatLong(parseFloat(h[1]),parseFloat(h[2])),L=new VELatLong(parseFloat(h[3]),parseFloat(h[2])),I=new VELatLong(parseFloat(h[1]),parseFloat(h[0])),H=new VELatLongRectangle(K,J,L,I),C=[];C.push(H);var b=v["minzoom"];b=b==null||typeof b=="undefined"||b==""?c:parseInt(b);if(b<1||b>l)b=c;if(b<c)c=b;var f=v["maxzoom"];f=f==null||typeof f=="undefined"||f==""?a:parseInt(f);if(f<1||f>l||f<b)f=a;if(f>a)a=f;var n=v["displayname"];if(n==null||typeof n=="undefined"||n=="")n="{"+j.MapserviceType+":"+NextOverlay().toString()+":"+j.iid+":"+y.toString()+"}";var d=new VETileSourceSpecification;d.ID=G+":"+n;d.NumServers=1;d.TileSource=p;d.Opacity=i;d.MinZoomLevel=b;d.MaxZoomLevel=Math.min(f,l);d.Bounds=C;t.push(d)}for(var A=0;A<t.length;A++){var d=t[A];map.SetTileSource(d);map.LoadTileLayer(d.ID,d.ID,d.Opacity,2)}if(B)e();return new MapOverlayNode(j,t)}function e(){var a=map.Get3DControl();if(typeof a!="undefined"&&a!=null)map.AddMapServiceLayersTo3D(a)}function n(b){if(!b||b.length==0)return;var a=map.Get3DControl();if(typeof a!="undefined"&&a!=null)map.DeleteMapServiceLayersFrom3D(a,b)}this.IsActiveOverlayItem=p;this.CanActivateMapserviceType=b;this.CanActivateOverlayLayer=g;this.ActivateEntityOverlays=h;this.DeactivateEntityOverlays=d;this.ActivateCollectionOverlays=m;this.ActivateCollectionOverlays3D=e;this.DeactivateCollectionOverlays=l;this.ActivateEntityOverlayViewport=k;this.ActivateOverlayNodeViewport=f;this.ActivateTileSource=i;this.ActiveOverlayNode=j;this.ActiveOverlayIndex=c;this.ActiveOverlayLimit=s;this.ActiveOverlayCount=r};var VE_MapOverlays=new Msn.VE.Core.MapServiceLayerManager;_VERegisterNamespaces("Msn.VE.Core");Msn.VE.Core.EventRegistry=function(){var a=new VE_MapHashtable;this.AddListener=function(c,b){a.put(c,b)};this.RemoveListener=function(e,d){var b=a.get(e);if(b=="undefined"||b==null||b.length<1)return null;for(var c=0;c<b.length;c++)if(b[c]==d)b.splice(c,1)};this.Fire=function(e,d){if(e=="undefined"||e==null)return;var b=a.get(e);if(b=="undefined"||b==null||b.length<1)return null;for(var c=0;c<b.length;c++){if(b[c]=="undefined"||b[c]==null)continue;if(d=="undefined"||d==null)b[c]();else b[c](d)}d=null}};function VE_MapHashtable(){this.hash=[];this.keys=[]}VE_MapHashtable.prototype.hash=null;VE_MapHashtable.prototype.keys=null;VE_MapHashtable.prototype.get=function(a){return this.hash[a]};VE_MapHashtable.prototype.put=function(b,c){if(c==null)return null;var a=null;a=this.hash[b];if(a==null||a=="undefined"){this.keys[this.keys.length]=b;a=[]}a.push(c);this.hash[b]=a};_VERegisterNamespaces("Msn.Drawing");Msn.Drawing.MapGeoRssReader=function(){};Msn.Drawing.MapGeoRssReader.prototype.ReadGeoRSS=function(z,q){var C=false,r=null,p=null,u=null,m=null,g=null,f=null,c=null,l=z.getElementsByTagName("item");if(l.length<1)l=z.getElementsByTagName("entry");var k=VEShapeType.Pushpin;if(l.length>0){var j,o,A,F=l.length;for(j=0;j<F;j++){g=null;f=null;c=null;k=VEShapeType.Pushpin;r="";p="";u="";m="";A=l[j].childNodes.length;for(o=0;o<A;o++){if(l[j].childNodes[o].nodeType!=1)continue;var a=l[j].childNodes[o].nodeName,b=l[j].childNodes[o];if(a=="title")if(b.firstChild)r=b.firstChild.nodeValue;else r="";else if(a=="description"||a=="summary"||a=="content")if(b.firstChild)p=b.firstChild.nodeValue;else p="";else if(a=="link")if(b.firstChild)u=b.firstChild.nodeValue;else u=b.getAttribute("href");else if(a=="icon")m=b.firstChild.nodeValue;else if(a=="virtualearth:icon")m=b.firstChild.nodeValue;else if(a=="geo:lat")g=b.firstChild.nodeValue;else if(a=="geo:lon")f=b.firstChild.nodeValue;else if(a=="geo:long")f=b.firstChild.nodeValue;else if(a=="geo:Point"||a=="geo:point")for(d=0;d<b.childNodes.length;d++){var e=b.childNodes[d];if(e.nodeName=="geo:lat")g=e.firstChild.nodeValue;else if(e.nodeName=="geo:lon"||e.nodeName=="geo:long")f=e.firstChild.nodeValue}else if(a=="georss:point"||a=="georss:line"||a=="georss:polygon"){if(b.firstChild){var n=b.firstChild.nodeValue;if(n.length==4096&&typeof b.textContent!="undefined"&&b.textContent!=null)n=b.textContent;c=this.ExtractLatLonPairFromXMLList(n);if(c&&c.length>1){g=c[1];f=c[0];if(a=="georss:line")k=VEShapeType.Polyline;else if(a=="georss:polygon")k=VEShapeType.Polygon}}}else if(a=="gml:name")if(b.firstChild)r=b.firstChild.nodeValue;else r="";else if(a=="gml:description")if(b.firstChild)p=b.firstChild.nodeValue;else p="";else if(a=="gml:Point"||a=="gml:point"||a=="georss:where"&&b.firstChild.nodeName=="gml:Point"){var i=null;if(a=="gml:Point"||a=="gml:point")i=b.childNodes;else i=b.firstChild.childNodes;for(d=0;d<i.length;d++){var e=i[d];if(e.nodeName=="gml:pos")if(e.firstChild){var n=e.firstChild.nodeValue;c=this.ExtractLatLonPairFromXMLList(n);if(c&&c.length>1){g=c[1];f=c[0]}}}}else if(a=="gml:pos"||a=="gml:posList"){if(l[j].childNodes[o].firstChild){var n=l[j].childNodes[o].firstChild.nodeValue;c=this.ExtractLatLonPairFromXMLList(n);if(c&&c.length>1){g=c[1];f=c[0];if(a=="gml:posList")k=VEShapeType.Polyline}}}else if(a=="gml:LineString"||a=="georss:where"&&b.firstChild.nodeName=="gml:LineString"){var i=null;if(a=="gml:LineString")i=b.childNodes;else i=b.firstChild.childNodes;k=VEShapeType.Polyline;var x=i.length;for(d=0;d<x;d++){var e=i[d];if(e.nodeName=="gml:posList")if(e.firstChild){var n=e.firstChild.nodeValue;c=this.ExtractLatLonPairFromXMLList(n);if(c&&c.length>1){g=c[1];f=c[0]}}}}else if(a=="gml:Polygon"||a=="georss:where"&&b.firstChild.nodeName=="gml:Polygon"){var i=null;if(a=="gml:Polygon")i=b.childNodes;else i=b.firstChild.childNodes;k=VEShapeType.Polygon;var x=i.length;for(d=0;d<x;d++){var v=i[d];if(v.nodeName=="gml:exterior"||v.nodeName=="gml:interior"){var e=null;e=v.childNodes;var E=e.length;for(var t=0;t<E;t++)if(e[t].nodeName=="gml:LinearRing"&&e[t].firstChild){var n=null,y=e[t].firstChild;if(y.nodeName=="gml:posList"&&y.firstChild){n=y.firstChild.nodeValue;c=this.ExtractLatLonPairFromXMLList(n);if(c&&c.length>1){g=c[1];f=c[0]}}}}}}}if(g==null||g=="undefined"||g.length<=0||f==null||f=="undefined"||f.length<=0)continue;if(q.Spec.IconUrl!=null&&q.Spec.IconUrl!="undefined")m=q.Spec.IconUrl;if(m==null||m=="undefined"||m.length<=0)m=Msn.VE.API.Constants.iconurl;var D=p;try{var s=null;if(k==VEShapeType.Pushpin)if(g!=null&&f!=null)s=new Msn.Drawing.Point(f,g);else continue;else if(k==VEShapeType.Polyline){if(c.length<4)continue;s=new Msn.Drawing.PolyLine(c)}else if(k==VEShapeType.Polygon){if(c.length<8)continue;s=new Msn.Drawing.Polygon(c)}var h;if(Msn.VE.API!=null){var w=s.points,x=w.length,B=[];for(var d=0;d<x-1;d=d+2)B.push(new VELatLong(w[d+1],w[d]));h=new VEShape(k,B)}else{h=new VEShape(MC_VESHAPE_EMPTY);h.AddPrimitive(s)}h.Latitude=g;h.Longitude=f;h.Url=u;h.IconId=m;h.Notes=D;h.SetDisplayOrder(j);h.SetIndex(j);h.Title=r;if(Msn.VE.API!=null)q.AddShape(h);else q.AddEntityAnnotation(h)}catch(H){throw new VEException("VEMap:AddGeoRSSLayerPushpins","err_invalidLatLong",H.message)}}}if(q.GetShapeCount()>0)C=true;return C};Msn.Drawing.MapGeoRssReader.prototype.ExtractLatLonPairFromXMLList=function(a){a=a.replace(/^\s+/g,"");a=a.replace(/\s+$/g,"");var b=[];if(a.indexOf(",")>0)b=a.split(",");else{a=a.replace(/\s+/g," ");b=a.split(" ")}var d=b.length;if(d/2!=Math.round(d/2))return null;for(var c=0;c<d-1;c=c+2){var e=parseFloat(b[c]),f=parseFloat(b[c+1]);if(isNaN(e)||isNaN(f))throw new VEException("VEMap:ExtractLatLonPairFromXMLList","err_invalidLatLong",L_GeoRssInvalidFormatError_Text);b[c]=f;b[c+1]=e}return b};_VERegisterNamespaces("VE_MapCmlReader");VE_MapCmlReader=function(){};VE_MapCmlReader.ReadCMLDom=function(c,b,a){return VE_MapCmlReader.ExtractCollections(c,b,a)};VE_MapCmlReader.ExtractCollections=function(h,r,k){var u=null,b=r.getElementsByTagName(MC_CML_COLLECTION);if(!b)return null;var m=b.length;if(m<1)return null;var p=[],o=h.action;for(var c=0;c<m;c++){var t=b[c].getAttribute(MC_CML_ID),s=b[c].getAttribute(MC_CML_IID),j=unescape(b[c].getAttribute(MC_CML_NAME)),l=b[c].getAttribute(MC_CML_CULTURE),q=b[c].getAttribute(MC_CML_VISIBILITY),i=b[c].getAttribute(MC_CML_TYPE),a=k.GetCollectionByMsnId(h,t,s);if(!a)continue;if(o==MC_ACTION_IMPORT_ENTITY||o==MC_ACTION_CLONE_ENTITY){var n=b[c].childNodes.length;for(var g=0;g<n;g++){var e=b[c].childNodes.item(g);if(e.nodeName==MC_CML_ENTITY)VE_MapCmlReader.ExtractEntity(h,e,a,k)}}else{if(q!=null&&q=="false")a.SetVisibility(false);if(i&&i!=""&&i!="undefined")a.SetType(i);if(j&&j!=""&&j!="undefined")a.SetName(j);if(l&&l!="")a.Culture=l;var n=b[c].childNodes.length;for(var g=0;g<n;g++){var e=b[c].childNodes.item(g),d=GetXMLText(e);switch(e.nodeName){case MC_CML_SHARELEVEL:if(d=="public"){a.IsPublic=true;a.IsIndexed=false}else if(d=="indexed"){a.IsPublic=true;a.IsIndexed=true}else{a.IsPublic=false;a.IsIndexed=false}break;case MC_CML_PROPERTYS:a._properties=VE_MapCmlReader.ExtractProperties(e);break;case MC_CML_DESCRIPTION:a.Notes=unescape(d);break;case MC_CML_TAGS:a.Tags=unescape(d);break;case MC_CML_LASTMODIFIED:var f=new Date(d);if(isNaN(f))a.DateModified=Date();else a.DateModified=d;break;case MC_CML_DATECREATED:var f=new Date(d);if(isNaN(f))a.DateCreated=Date();else a.DateCreated=d;break;case MC_CML_ENTITY:VE_MapCmlReader.ExtractEntity(h,e,a,k);break;case MC_CML_STATE:var f=parseInt(d);if((f&MC_CML_STATE_OWNER_CAN_VIEW)==MC_CML_STATE_OWNER_CAN_VIEW&&(f&MC_CML_STATE_PUBLIC_CAN_VIEW)!=MC_CML_STATE_PUBLIC_CAN_VIEW)a.ViewableByOwnerOnly=true;else a.ViewableByOwnerOnly=false;if((f&MC_CML_STATE_OWNER_CAN_UPDATE)==MC_CML_STATE_OWNER_CAN_UPDATE)a.EditableByOwner=true;else a.EditableByOwner=false;if((f&MC_CML_STATE_OWNER_IS_VIEWING)==MC_CML_STATE_OWNER_IS_VIEWING)a.OwnerIsViewing=true;else a.OwnerIsViewing=false}}}p.push(a)}return p};VE_MapCmlReader.ExtractEntity=function(p,t,e,o){var d=t,m=d.getAttribute(MC_CML_ID),r=d.getAttribute(MC_CML_IID),l=d.getAttribute(MC_CML_TYPE),k=unescape(d.getAttribute(MC_CML_NAME)),s=d.getAttribute(MC_CML_VISIBILITY),f=p.action,c=false;if(f==MC_ACTION_ADD_ENTITY){var g=p.GetParameters(MC_KVP_ENTITYLIST);if(typeof g=="undefined"||g==null)return;for(var j=0;j<g.length;j++){var h=g[j];if(typeof h=="undefined"||h==null)continue;if(h.GetId()==r){c=VE_MapOverlays.CanActivateMapserviceType(h);h.SetMsnId(m);g.splice(j,1);break}}if(!c)return}var i;if(f==MC_ACTION_CREATE_COLLECTION||f==MC_ACTION_IMPORT_ENTITY||f==MC_ACTION_IMPORT_COLLECTION||f==MC_ACTION_ADD_ENTITY)i=o.GetAnnotationByMsnId(e,m,r);else i=o.GetAnnotationByMsnId(e,m);var a=i[1];c=c||VE_MapOverlays.CanActivateMapserviceType(a);if(i[0]&&!c)return;if(l&&l!="")a.SetType(l);if(k&&k!="")a.Title=k;if(s&&s!="")a.SetVisibility(false);var b=null,w=null,v=d.childNodes.length;for(var n=0;n<v;n++){b=d.childNodes[n];if(b.nodeType==1){var u=b.nodeName;switch(u){case MC_CML_PROPERTYS:VE_MapCmlReader.ExtractEntityProperties(b,a);break;case MC_CML_DESCRIPTION:a.Notes=unescape(GetXMLText(b));a.Notes=a.Notes.replace(/<BR\/?>/gi,"\n");break;case MC_CML_ENTITY_PRIMITIVES:var q=VE_MapCmlReader.ExtractPrimitives(b);if(q){a.ClearAllPrimitives();a.SetPrimitives(q)}break;case MC_CML_VIEWPORT:a.ViewPort=VE_MapCmlReader.ExtractViewPort(b);break;case MC_CML_TOUR:a.Tour=VE_MapCmlReader.ExtractTour(b);break;case MC_CML_MODELREP:a.ModelRep=VE_MapCmlReader.ExtractModelRep(b);break;case MC_CML_PHOTOS:a.Photos=VE_MapCmlReader.ExtractPhotos(b)}}}if(a.GetPrimitiveCount()==0)VE_MapManager.GetLayerManager().DeleteAnnotationFromCollection(e,a);else if(!i[0])if(Msn.VE.API!=null)e.AddShape(a);else e.AddEntityAnnotation(a);else e.UpdateEntityAnnotation(a);c=c||VE_MapOverlays.CanActivateMapserviceType(a);if(c){VE_MapOverlays.ActivateEntityOverlays(a);if(f==MC_ACTION_ADD_ENTITY)VE_MapOverlays.ActivateEntityOverlayViewport(a,true)}return e};VE_MapCmlReader.ExtractViewPort=function(g){var a=new VE_3DViewPort,f=true,h=g.childNodes.length;for(var e=0;e<h;e++){var d=g.childNodes[e],b=GetXMLText(d);switch(d.nodeName){case MC_CML_ENTITY_COORDINATES:var c=b.split(MC_CML_TOKEN1);if(c.length==2){a.Longitude=parseFloat(c[0]);a.Latitude=parseFloat(c[1])}else f=false;break;case MC_CML_ALTITUDE:a.Altitude=parseFloat(b);break;case MC_CML_ALTITUDEMODE:a.Altitudemode=b;break;case MC_CML_PITCH:a.Pitch=parseFloat(b);break;case MC_CML_HEADING:a.Heading=parseFloat(b);break;case MC_CML_MAPSTYLE:a.Mapstyle=b;break;case MC_CML_SCENEID:a.SceneId=parseInt(b);break;case MC_CML_PROPERTYS:a.Properties=VE_MapCmlReader.ExtractProperties(d)}}if(!f||isNaN(a.Longitude)||isNaN(a.Latitude)||isNaN(a.Latitude)||isNaN(a.Pitch)||isNaN(a.Heading))a=null;return a};VE_MapCmlReader.ExtractTour=function(el){var Tour=new VE_3DTour;Tour.Actions=[];var actionKey=null,actionValue=null,actions=el.selectSingleNode(MC_CML_ACTIONS),childNodesLen=actions.childNodes.length;for(var i=0;i<childNodesLen;i++){var actionNode=null;actionNode=actions.childNodes[i].selectSingleNode(MC_CML_PROPERTYS);var action=null,actionStr="{",actionLen=actionNode.childNodes.length;if(actionLen>0){for(var j=0;j<actionLen;j++){var node=actionNode.childNodes[j];if(node.nodeName==MC_CML_PROPERTY){actionKey=node.getAttribute(MC_CML_KEY);actionValue=node.getAttribute(MC_CML_VALUE);if(typeof actionKey!="undefined"&&actionKey!=null&&typeof actionValue!="undefined"&&actionValue!=null)actionStr=actionStr.concat("'",actionKey,"':'",actionValue,"',")}}actionStr=actionStr.substring(0,actionStr.length-1);actionStr=actionStr.concat("}");action=eval("("+actionStr+")")}if(typeof action!="undefined"&&action!=null)Tour.Actions.push(action)}if(Tour.Actions.length<1)Tour=null;return Tour};VE_MapCmlReader.ExtractModelRep=function(e){var a=new VE_3DModelRep,f=e.childNodes.length;for(var d=0;d<f;d++){var c=e.childNodes[d],b=GetXMLText(c);switch(c.nodeName){case MC_CML_TRANSFORM:a.Transform=b.split(MC_CML_TOKEN1);break;case MC_CML_MODELREFID:a.ModelRefId=b;break;case MC_CML_PROPERTYS:a.Properties=VE_MapCmlReader.ExtractProperties(c);break;case MC_CML_MINBOUNDS:a.MinBounds=b;break;case MC_CML_MAXBOUNDS:a.MaxBounds=b;break;case MC_CML_R2EOFFSET:a.R2eoffset=b}}if(typeof a.Transform!="object"||a.Transform.length!=16)a=null;return a};VE_MapCmlReader.ExtractEntityProperties=function(h,a){var i=h.childNodes.length;for(var g=0;g<i;g++){var e=h.childNodes.item(g);if(e.nodeName==MC_CML_PROPERTY){var b=e.getAttribute(MC_CML_VALUE);switch(e.getAttribute(MC_CML_KEY)){case MC_CML_PROPERTY_URL:var d=null;d=unescape(b);if(d!="undefined"&&d)a.Url=d;break;case MC_CML_PROPERTY_ICONURL:var c=null;c=unescape(b);if(c)if(!(c.indexOf("://")>0&&c.indexOf("http")<0))a.SetIconUrl(c);break;case MC_CML_PROPERTY_KEYWORDS:a.Keywords=unescape(b);break;case MC_CML_PROPERTY_PHOTOURL:var f=null;f=unescape(b);if(f)a.PhotoUrl=f;break;case MC_CML_PROPERTY_USERDATE:a.UserDate=b;break;case MC_CML_PROPERTY_DISPLAYORDER:a.DisplayOrder=b;break;case MC_CML_PROPERTY_BUSINESSLISTINGID:a.SetBusinessListingId(b);break;case MC_CML_LASTMODIFIED:a.LastModified=b;break;case MC_CML_DISPLAYORDER:a.SetDisplayOrder(b);break;case MC_CML_ZOOMLEVEL:a.SetZoomLevel(b);break;case MC_CML_ONSCRATCHPAD:a.SetOnScratchpad(b);break;case MC_CML_PROPERTY_SOURCEURL:a.SourceUrl=unescape(b);break;case MC_CML_PROPERTY_SOURCETYPE:a.SourceType=b;break;case MC_CML_TILEID:a.TileId=b;case MC_CML_PROPERTY_MAPSERVICETYPE:a.MapserviceType=b;break;case MC_CML_PROPERTY_MAPSERVICESOURCE:a.MapserviceSource=unescape(b);break;case MC_CML_PROPERTY_MAPSERVICEOPACITY:a.MapserviceOpacity=b;break;case MC_CML_PROPERTY_MAPSERVICEMETADATA:a.MapserviceMetadata=unescape(b)}}}return a};VE_MapCmlReader.ExtractPhotos=function(l){var n=[],j=l.childNodes.length;if(j==0)return null;for(var g=0;g<j;g++){var a=l.childNodes.item(g);if(a.nodeName==MC_CML_PHOTO){var c=new VE_Photo;c.Id=a.getAttribute(MC_CML_ID);var k={},m=true,o=a.childNodes.length;for(var h=0;h<o;h++){var e=a.childNodes.item(h);if(e.nodeName==MC_CML_PROPERTYS){var p=e.childNodes.length;for(var i=0;i<p;i++){var f=e.childNodes.item(i);if(f.nodeName==MC_CML_PROPERTY){var b=f.getAttribute(MC_CML_VALUE),d=f.getAttribute(MC_CML_KEY);if(d!="undefined"&&d!=null&&b!="undefined"&&b!=null)if(d==MC_CML_PROPERTY_URL){var q=unescape(b);c.Url=q}else{k[d]=b;m=false}}}}}if(!m)c.Properties=k;n.push(c)}}return n};VE_MapCmlReader.ExtractProperties=function(a){if(typeof a=="undefined"||a==null||a.childNodes.length<1)return null;var h=a.childNodes.length,d={},e=true;for(var c=0;c<h;c++){var b=a.childNodes.item(c);if(b.nodeName==MC_CML_PROPERTY){var f=b.getAttribute(MC_CML_VALUE),g=b.getAttribute(MC_CML_KEY);if(g!=null&&f!=null){d[g]=f;e=false}}}if(e)return null;else return d};VE_MapCmlReader.ExtractPrimitives=function(l){var g=[],o=l.childNodes.length;for(var k=0;k<o;k++){var f=l.childNodes.item(k);if(f.nodeName==MC_CML_ENTITY_PRIMITIVE){var d=true,a=null,c=null,n=null,p=f.childNodes.length;for(var j=0;j<p;j++){var b=f.childNodes[j];if(d){var e=b.getAttribute(MC_CML_LENGTH),m=b.getAttribute(MC_CML_AREA);switch(b.nodeName){case MC_CML_POLYGON:d=false;a=VE_MapCmlReader.ExtractPolygon(b);if(e)a.SetLength(e*1);if(m)a.SetArea(m*1);break;case MC_CML_POLYLINE:d=false;a=VE_MapCmlReader.ExtractPolyLine(b);if(e)a.SetLength(e*1);break;case MC_CML_POINT:n=VEShapeType.Pushpin;d=false;a=VE_MapCmlReader.ExtractPoint(b)}}else if(b.nodeName==MC_CML_DEFAULTSTYLE){var i=VE_MapCmlReader.ExtractStyle(b,n);c=i[0];if(i.length>1){var h=i[1];if(h){a.labelPosX=h.longitude;a.labelPosY=h.latitude}}}}if(a!=null){if(Msn.VE.API){if(!c)c=VE_GetDefaultAPISymbol(a.type);a.symbol=c}else if(a.type!=VEShapeType.Pushpin)a.symbol=c;g.push(a)}}}if(g.length<1)return null;return g};VE_MapCmlReader.ExtractPolygon=function(c){var a=c.selectSingleNode(MC_CML_OUTLS).selectSingleNode(MC_CML_LINEARSTRING),b=a.selectSingleNode(MC_CML_COORDS);return VE_MapCmlReader.BuildShape(VEShapeType.Polygon,GetXMLText(b),a)};VE_MapCmlReader.ExtractPolyLine=function(a){var b=a.selectSingleNode(MC_CML_COORDS);return VE_MapCmlReader.BuildShape(VEShapeType.Polyline,GetXMLText(b),a)};VE_MapCmlReader.BuildShape=function(c,i,d){var h=null,g=d.selectSingleNode(MC_CML_ALTITUDE);if(g!=null)h=GetXMLText(g);var b=VE_GetLatLongPairsFromString(i,h);if(b==null||b.LonLats==null)return null;var a=null;if(VEShapeType.Polyline==c){a=new Msn.Drawing.PolyLine(b.LonLats);a.iid=Msn.Drawing.GetGeoUID(VEShapeType.Polyline)}else if(VEShapeType.Polygon==c){a=new Msn.Drawing.Polygon(b.LonLats);a.iid=Msn.Drawing.GetGeoUID(VEShapeType.Polygon)}else if(VEShapeType.Pushpin==c){a=new Msn.Drawing.Point(b.LonLats[0],b.LonLats[1]);a.iid=Msn.Drawing.GetGeoUID(VEShapeType.Pushpin)}if(b.Altitudes){var e=d.selectSingleNode(MC_CML_ALTITUDEMODE);if(e!=null)a.altitudeMode=GetXMLText(e);if(VEShapeType.Pushpin==c){a.altitudes=b.Altitudes;return a}else{a.altitudes=b.Altitudes;var f=d.selectSingleNode(MC_CML_EXTRUDE);if(f!=null)if(GetXMLText(f).toLowerCase()=="true")a.extruded=true;a.minZ=b.minZ;a.maxZ=b.maxZ;a.labelPosZ=a.maxZ}}if(VEShapeType.Pushpin!=c){a.minX=b.minX;a.minY=b.minY;a.maxX=b.maxX;a.maxY=b.maxY}return a};VE_MapCmlReader.ExtractPoint=function(a){var b=a.selectSingleNode(MC_CML_COORDS);return VE_MapCmlReader.BuildShape(VEShapeType.Pushpin,GetXMLText(b),a)};VE_MapCmlReader.ExtractStyle=function(i,n){var e=[],a;if(Msn.VE.API)a=VE_GetDefaultAPISymbol(n);else a=VE_MapDispatch_SymbolLib.GetCurrentDefaultSymbol();a=a.Clone();var k=i.childNodes.length,d=null;for(var f=0;f<k;f++){var c=i.childNodes.item(f);if(c.nodeName==MC_CML_STYLE){var l=GetXMLText(c),j=l.split(MC_CML_TOKEN3),b=null,m=j.length;for(var g=0;g<m;g++){b=j[g].split(MC_CML_TOKEN2);if(b!=null||b.length==2)switch(b[0]){case MC_STYLE_STROKE_COLOR:a.stroke_color=b[1];break;case MC_STYLE_FILL_COLOR:a.fill_color=b[1];break;case MC_STYLE_STROKE_WEIGHT:a.stroke_weight=b[1];break;case MC_STYLE_STROKE_STYLE:a.stroke_style=b[1];break;case MC_STYLE_STROKE_DASH:a.stroke_dashstyle=b[1]}b=null}}else if(c.nodeName==MC_CML_LABELSTYLE){var h=c.selectSingleNode(MC_CML_POSITION);if(h!=null)d=VE_GetLatLongFromString(GetXMLText(h))}}e.push(a);if(d)e.push(d);return e};function VE_GetDefaultAPISymbol(b){var a=null;if(typeof VE_MapDispatch_SymbolLib!="undefined"){if(b==VEShapeType.Pushpin)a=VE_MapDispatch_SymbolLib.GetMapSymbolByID(MC_PROPERTY_PUSHPIN);else a=VE_MapDispatch_SymbolLib.GetCurrentDefaultSymbol();a.imagedata_src=Msn.VE.API.Constants.iconurl;a.style_zIndex=Msn.VE.API.Globals.veshapeiconzindex;a.style_zIndex_polyshape=Msn.VE.API.Globals.veshapepolyshapezindex}return a}function VE_GetLatLongFromString(c){var a=c.split(MC_CML_TOKEN1);if(typeof a=="undefined"||a==null||a.length!=2)return null;var b=new Msn.VE.LatLong;b.longitude=parseFloat(a[0]);b.latitude=parseFloat(a[1]);return b}function VE_GetLatLongPairsFromString(p,o){var l=null,m=null,j=null,k=null,b=[],f=p.split(MC_CML_TOKEN1),c=null,i=null,h=null,g=null,d=true;if(o==null)d=false;if(d){i=o.split(MC_CML_TOKEN1);d=f.length/2!=i.length?false:true;c=[]}for(var a=0;a<2;a++){b[a]=parseFloat(f[a]);if(isNaN(b[a]))return null}if(d){c[0]=parseFloat(i[0]);if(isNaN(c[0]))d=false}if(f.length>3){l=b[0];m=b[1];j=b[0];k=b[1];if(d)h=g=c[0]}var n=true;for(var a=2;a<f.length;a++){b[a]=parseFloat(f[a]);if(isNaN(b[a]))return null;if(n){if(d){c[a/2]=parseFloat(i[a/2]);if(isNaN(c[a/2]))d=false;else if(c[a/2]<h)h=c[a/2];else if(c[a/2]>g)g=c[a/2]}if(b[a]<l)l=b[a];else if(b[a]>j)j=b[a];n=false}else{if(b[a]<m)m=b[a];else if(b[a]>k)k=b[a];n=true}}if(!d){h=null;g=null;c=null}var e=new VE_LocationResult;e.minX=l;e.minY=m;e.maxX=j;e.maxY=k;e.minZ=h;e.maxZ=g;e.LonLats=b;e.Altitudes=c;return e}function VE_LocationResult(){this.minX=null;this.minY=null;this.maxX=null;this.maxY=null;this.LonLats=null;this.minZ=null;this.maxZ=null;this.Altitudes=null}VEShapeStyleLibrary=function(){var a=[];this.AddMapSymbol=function(b){if(b.stroke_color2==null||b.stroke_color2=="")if(b.stroke_color=="red")b.stroke_color2="blue";else b.stroke_color2="red";if(b.fill_color2==null||b.fill_color2=="")if(b.fill_color=="blue")b.fill_color2="red";else b.fill_color2="blue";a.push(b)};var b=null;this.GetCurrentDefaultSymbol=function(){if(b==null)b=this.GetMapSymbolByID(MC_PROPERTY_PARK);return b};this.GetMapSymbolByID=function(c){if(a.length>0){for(var d=0;d<a.length;d++)if(a[d].id==c)return a[d]}else{var e=new VEShapeStyle;e.id=MC_PROPERTY_DEFAULT;this.AddMapSymbol(e)}var b=null;if(typeof c=="undefined"||c==0)return a[0];b=new VEShapeStyle;switch(c){case MC_PROPERTY_HIGHWAY:b.id=c;break;case MC_PROPERTY_ROAD:b.id=c;b.stroke_color="yellow";b.stroke_style="thickbetweenthin";b.stroke_weight=6;break;case MC_PROPERTY_LAKE:b.id=c;break;case MC_PROPERTY_PARK:b.id=c;b.stroke_opacity="50%";b.stroke_endcap="square";b.stroke_joinstyle="bevel";break;case MC_PROPERTY_PARKINGLOT:b.id=c;break;case MC_PROPERTY_PUSHPIN:b.id=c;break;case MC_PROPERTY_TEMPDRAW:b.id=c;b.stroke_weight=1;b.stroke_dashstyle="dashdot";break;case MC_PROPERTY_TEMPEDIT:b.id=c;b.stroke_weight=1;b.stroke_color="#0F0F0F";b.stroke_dashstyle="longdashdot";break;case MC_PROPERTY_EDITNODE:b.id=c;b.shape_drawtype="v:rect";b.style_filter="100%";b.stroke_color="#000000";b.fill_color="yellow";break;case MC_PROPERTY_EDITSELNODE:b.id=c;b.shape_drawtype="v:rect";b.style_filter="100%";b.stroke_color="red";b.fill_color="yellow";break;case MC_PROPERTY_GHOSTNODE:b.id=c;b.shape_drawtype="v:rect";b.style_filter="100%";b.stroke_opacity="100%";b.fill_opacity="100%";b.stroke_color="#666666";b.fill_color="#dddd88";break;default:return a[0]}this.AddMapSymbol(b);return b};this.GetLocalMapSymbol=function(b){var a=VE_MapManager.GetEntityPrimitiveByElmt(b);if(a==null)return null;geometry=a[2];if(typeof geometry=="undefined"||geometry==null)return null;return geometry.symbol}};function VE_MapRequestBean(c){this.action=c=="undefined"?null:c;var a=null,b="action="+this.action;this.SetParameters=function(d,c){if(a==null)a=[];a[d]=c;b=b.concat("&",d,"=",c)};this.GetParameters=function(){return a};this.ToString=function(){return b}}_VERegisterNamespaces("Msn.Drawing");Msn.Drawing.GetTextUID=function(a){return a+MC_IID_CON_TOKEN+"t"};Msn.Drawing.GetLabelUID=function(a){return a+MC_IID_CON_TOKEN+"l"};Msn.Drawing.IsLabel=function(a){return a.indexOf(MC_IID_CON_TOKEN+"l")>0?true:false};Msn.Drawing.GetShpElementUIDByLabelUID=function(c){var b="",a=c.split(MC_IID_CON_TOKEN);if(!a||a[0]!=MC_IID_NAMESPACE)return null;b=b.concat(a[0],MC_IID_CON_TOKEN,a[1],MC_IID_CON_TOKEN,a[2],MC_IID_CON_TOKEN,a[3]);return b};Msn.Drawing.GetEntityUIDByPrimitiveUID=function(c){var b="",a=c.split(MC_IID_CON_TOKEN);if(!a||a[0]!=MC_IID_NAMESPACE)return null;b=b.concat(a[0],MC_IID_CON_TOKEN,a[1],MC_IID_CON_TOKEN,a[2]);return b};Msn.Drawing.CreatePointPushpin=function(p,a,r,y,g,m,l,x,h){var d=null,i=r;Msn.Drawing.CalculateLabelPosition(a,false);var u=a.labelPosX?a.labelPosX:a.points[0],t=a.labelPosY?a.labelPosY:a.points[1],s=m?m:22,q=l?l:17,f=a.iid,b=g,n=g&&g.indexOf("VE_Pushpin_Overlay")!=-1;if(a.type==VEShapeType.Pushpin){if(typeof b=="undefined"||!b)b=n?VE_MapStruct.PushpinType.Overlay:VE_MapStruct.PushpinType.PushpinAn}else{f=Msn.Drawing.GetLabelUID(a.iid);if(typeof b=="undefined"||!b)b=VE_MapStruct.PushpinType.Polyline}var o=n?Msn.VE.PushPinTypes.Overlay:Msn.VE.PushPinTypes.Annotation,k=i+"";if(h){b="VEAPI_Pushpin";k=_VE_GetCustomIcon(f+"_img",h,i,false)}d=p.AddPushpin(f,t,u,s,q,b,k,MC_STYLE_PINZIndex,o,true);if(h){var c=$ID(f+"_img");if(c!=null){var w=c.style.height,v=c.style.width;if(isNaN(parseInt(w))||isNaN(parseInt(v))){c.style.height="25px";c.style.width="30px"}if(d!=null){var e=parseInt(d.style.top),j=parseInt(c.style.height);if(isNaN(e))e=j;else e+=j;d.style.top=e+"px"}}}return d};function _VE_GetCustomIcon(i,h,e,f){var g="<img ",a='" class="msve_customIcon" src="',d="",c=25,b=30;if(f){c=250;b=300}d='onload="_VE_ResizeImage(this,'+c+","+b+')" style="visibility:hidden;" onerror="_VE_OnCustonIconError(this,'+e+')"';a='" class="msve_customIcononmap" src="';return g.concat(' alt="',e,'" id="',i,a,h,'" '+d+"/>")}function _VE_OnCustonIconError(a,e){var f=typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null;if(!f&&typeof a!="undefined"){var b=VE_MapManager.GetAnnotationById(a.id);if(b){b.IconUrl=null;var d=VE_MapStruct.PushpinType,c=d.PushpinViewer;if(b.IsOverlay())c=d.OverlayViewer;else if(b.GetType()!=VEShapeType.Pushpin)c=d.PolylineViewer;if(a.parentElement){a.parentElement.className="bullet "+c;a.parentElement.innerText=e;a.parentElement.removeChild(a)}}}}function _VE_ResizeImage(a,c,b){var e=c,d=b;if(a.width>c)d=parseInt(a.height*c/a.width);else if(a.height>b)e=parseInt(a.width*b/a.height);else{e=a.width;d=a.height}a.style.height=d+"px";a.style.width=e+"px";if(a.style.visibility=="hidden")a.style.visibility="visible";return a}function IsPointInPolygon(a,b,e,f,c,d){if(a>c||a<e||b>d||b<f)return false;return true}function GetAgentName(){var c=["msie","firefox"],d="";for(var a=0;a<c.length;a++){var e=navigator.userAgent.toLowerCase(),b=c[a];if(e.indexOf(b)!=-1)d=b}return d}function VE_DisableSelection(a){if(typeof a.onselectstart!="undefined")a.attachEvent("onselectstart",donothingsayno);else if(typeof a.style.MozUserSelect!="undefined")a.style.MozUserSelect="none"}function VE_EnableSelection(a){if(typeof a.onselectstart!="undefined")a.detachEvent("onselectstart",donothingsayno);else if(typeof a.style.MozUserSelect!="undefined")a.style.removeProperty("-moz-user-select")}function VE_FindFirstAncestor(c,d,b){var a=d;while(a!=null&&a.nodeName.toUpperCase()!=c.toUpperCase()&&b>0){a=a.parentElement;--b}return a}function VE_ChangeOpacity(b,a){if(typeof Web!="undefined"&&typeof Web.Browser!="undefined"&&typeof Web.Browser.isMozilla=="function"&&Web.Browser.isMozilla())b.style.opacity=a/100;else b.style.filter="alpha(opacity="+a+")"}function VE_SanitizeHTML(b){if(typeof b=="undefined"||!b)return b;var a=document.createElement("div");a.innerHTML=b;VE_WalkNode(a,VE_RemoveHarmfulHTML);var c=a.innerHTML;a=null;return c}function VE_RemoveHarmfulHTML(c){if(c==null)return;var e="",a=null,f=[];for(var d=0;c.hasChildNodes()&&d<c.childNodes.length;++d){e=null;a=c.childNodes[d];switch(a.nodeName){case"A":e=a.getAttribute("HREF");case"B":case"BR":var g=[];for(var b=0;b<a.attributes.length;++b)g.push(a.attributes[b].nodeName);for(var b=0;b<g.length;++b)a.removeAttribute(g[b]);if(a.nodeName=="A")if(e!=null&&e.match(/^https?:\/\//gi)!=null){a.setAttribute("TARGET","_blank");a.setAttribute("HREF",e)}break;case"#text":break;default:f.push(a);c.insertBefore(document.createTextNode(" "),a.nextSibling);for(var b=0;a.hasChildNodes()&&b<a.childNodes.length;++b)c.insertBefore(a.childNodes[b],a.nextSibling)}}for(var d=0;d<f.length;++d)c.removeChild(f[d])}function VE_WalkNode(a,b){if(b==null||a==null)return;b(a);for(var c=0;a.hasChildNodes()&&c<a.childNodes.length;++c)VE_WalkNode(a.childNodes[c],b)}function VE_AbortTimeoutCallback(a){if(a!=-1)try{window.clearTimeout(a)}catch(b){}a=-1}_VERegisterNamespaces("Msn.Drawing");Msn.Drawing.CalculateLabelPosition=function(a,g){if(a.type==VEShapeType.Pushpin)return null;if(typeof g!="undefined"&&g==true){a.labelPosX=null;a.labelPosY=null;a.labelPosZ=null}if(a.labelPosX==null&&a.labelPosY==null)if(a.type==VEShapeType.Polyline){var b=Math.round((a.points.length/2-1)/2-1);b=b>-1?b:0;a.labelPosX=(a.points[2*b]+a.points[2*b+2])/2;a.labelPosY=(a.points[2*b+1]+a.points[2*b+3])/2;if(a.altitudes)a.labelPosZ=Math.max(a.altitudes[b],a.altitudes[b+1])}else if(a.type==VEShapeType.Polygon){var c=a.points.length,d=0,e=0,f=null;if(a.altitudes)f=a.altitudes[0];if(c>=4&&a.points[0]==a.points[c-2]&&a.points[1]==a.points[c-1])c-=2;for(var b=0;b<c;b=b+2){d=d+a.points[b];e=e+a.points[b+1];if(a.altitudes)f=Math.max(f,a.altitudes[b/2])}d=d*2/c;e=e*2/c;a.labelPosX=d;a.labelPosY=e;a.labelPosZ=f}};_VERegisterNamespaces("Msn.VE.Core");Msn.VE.Core.LayerManager=function(){var register=new Msn.VE.Core.EventRegistry,self=this,cols=[],loadedColIds=[],layerListDiv=null,unsavedName=L_CollectionManagerUnsavedCollectionTitle_Text,CopyPasteBoard=null,CountPastes=0,UndoPrimitives=null,_HighlightEntity=null,_isHighlighted=false;function GetCollectionListDiv(){if(layerListDiv==null){layerListDiv=document.createElement("div");layerListDiv.id="VELayerListDiv";Init()}return layerListDiv}function Init(){CreateCollection(0,0,unsavedName)}var visibleBounds=null;this.SetBoundingBox=function(e,f,a,c,b,d){if(visibleBounds)visibleBounds=new Msn.VE.Bounds(0,0,a,c,b,d);else{visibleBounds.z1=e;visibleBounds.z2=f;visibleBounds.x1=a;visibleBounds.x2=b;visibleBounds.y1=c;visibleBounds.y2=d}};this.GetBoundingBox=function(){if(visibleBounds==null){var a=GetSelectedCollection();if(a)return a.GetBoundingBox()}return visibleBounds};var selecteColMsnId=0;this.GetSelectedCollectionMsnId=function(){return selecteColMsnId};var selectedAnnotation=null;this.SetSelectedAnnotation=function(a){selectedAnnotation=a};this.ClearSelectedAnnotation=function(){selectedAnnotation=null};this.GetSelectedAnnotation=function(){return selectedAnnotation};this.IsSelectedCollectionUnsaved=function(){if(selecteColMsnId==0)return true;else return false};this.SetSelectedCollectionMsnId=function(a){selecteColMsnId=a;if(a!=0){for(var d=0;d<loadedColIds.length;d++)if(loadedColIds[d]==a)return a;loadedColIds.push(a);if(loadedColIds.length>MC_MAX_LOADED_COLS){var c=loadedColIds.shift();c=GetCollectionIndexByMsnId(c);if(c>0){var b=GetCollectionByIndex(c);if(b&&b.GetType()==MC_COL_TYPE_COLLECTION){mvcViewFacade.OnCollectionLayerClear(b);EmptyCollection(b)}}}}};this.AddListener=function(b,a){register.AddListener(b,a)};this.RemoveListener=function(b,a){register.RemoveListener(b,a)};this.Fire=function(b,a){register.Fire(b,a)};function AddCollection(b,a){if(b==0)cols.unshift(a);else cols.push(a);return a}function IsCollectionExist(c){if(cols.length>0)for(var a=0;a<cols.length;a++){var b=cols[a];if(b.GetMsnId()&&b.GetMsnId()==c)return true}return false}function SaveCollection(b){var a=cols[0];if(a.GetMsnId()==0){a=cols.shift();cols.push(a);CreateCollection(0,0,unsavedName);a.SetMsnId(b);return a}}function GetCollectionIndexByMsnId(c){if(cols.length>0)for(var a=0;a<cols.length;a++){var d=cols[a],b=d.GetMsnId();if(b&&b==c)return a}return 0}function GetCollectionByMsnId(b,a){if(!b)return null;switch(b.action){case MC_ACTION_RETRIEVE_ALLCOLLECTIONS_METADATA:return this.RetrieveCollection(a);break;case MC_ACTION_IMPORT_COLLECTION:return CreateCollection(cols.length-1,a,unsavedName);case MC_ACTION_CREATE_COLLECTION:return this.SaveCollection(a);break;case MC_ACTION_CLONE_ENTITY:case MC_ACTION_UPDATE_COLLECTION:return this.RetrieveCollection(a);break;case MC_ACTION_IMPORT_ENTITY:case MC_ACTION_ADD_ENTITY:return this.RetrieveCollection(a);break;case MC_ACTION_RETRIEVE_SHAREDCOLLECTION:case MC_ACTION_RETRIEVE_COLLECTION:return this.RetrieveCollection(a)}}function RetrieveCollection(c){var d=false;if(cols.length>0)for(var b=0;b<cols.length;b++){var a=cols[b];if(a.GetMsnId()&&a.GetMsnId()==c){d=true;return a}}if(!d)return CreateCollection(-1,c,unsavedName)}function SetVisibility(b){for(var a=0;a<cols.length;a++){cols[a].SetVisibility(b);if(b)VE_MapOverlays.ActivateCollectionOverlays(cols[a]);else VE_MapOverlays.DeactivateCollectionOverlays(cols[a])}}function RetrieveCollectionById(c){if(cols.length>0)for(var a=0;a<cols.length;a++){var b=cols[a];if(b.GetId()==c)return b}return null}function CreateCollection(b,c,d){var a=new VEShapeLayer;a.SetMsnId(c);a.SetName(d);a=AddCollection(b,a);return a}function CreateNewCollection(b){var a=null;if(b==MC_COL_TYPE_TILEIMAGE)a=new Msn.VE.Core.RasterLayer;else a=new VEShapeLayer;a.SetType(b);a.SetMsnId(0);a=AddCollection(cols.length,a);return a}function GetSelectedCollection(){if(cols.length>0)for(var a=0;a<cols.length;a++){var b=cols[a];if(self.GetSelectedCollectionMsnId()==cols[a].GetMsnId())return cols[a]}return CreateCollection(0,0,unsavedName)}function GetCollection(c){var a=[];a[0]=false;a[1]=false;if(cols.length>0)for(var b=0;b<cols.length;b++)if(cols[b].GetMsnId()==c){a[0]=true;var e=cols[b].Annotations.length;if(!cols[b].Annotations||e<1)a[1]=false;else a[1]=true;a[2]=cols[b];return a}var d=CreateCollection(0,c,unsavedName);a[2]=d;return a}function GetCollectionCount(){if(!cols)return 0;return cols.length}function GetCollectionByIndex(a){if(cols==null||cols.length<a||a<0)return null;return cols[a]}function Dispose(){DeleteAll();cols=[];loadedColIds=[]}function DeleteAll(){var a=null;while(cols.length>1){a=cols.pop();EmptyCollection(a)}if(cols.length==1)EmptyCollection(cols[0])}function RemoveCollection(a){EmptyCollection(a);DeleteCollection(a)}function EmptyCollection(a){VE_MapOverlays.DeactivateCollectionOverlays(a);var c=null;if(a.Annotations.length>0)for(var b=0;b<a.Annotations.length;b++){c=a.Annotations[b];ClearEntity(c)}a.Annotations=[];a.SetBoundingBox(0,0,Infinity,Infinity,-Infinity,-Infinity)}function DeleteCollection(b){VE_MapOverlays.DeactivateCollectionOverlays(b);var c=0;if(cols.length==1){cols.pop();c=0;CreateCollection(0,0,unsavedName)}else for(var a=0;a<cols.length;a++)if(cols[a].iid==b.iid){c=a;cols.splice(a,1);break}b=null;selecteColMsnId=0}function GetSelectedCollectionAnnotationCount(){var a=self.GetSelectedCollection();return a.GetShapeCount()}function GetAnnotationByMsnId(a,d,f){var b=[];if(a&&a.Annotations&&a.GetShapeCount()>0)for(var c=0;c<a.Annotations.length;c++)if(d&&a.Annotations[c].GetMsnId()==d||f&&a.Annotations[c].GetId()==f){b[0]=true;a.Annotations[c].SetMsnId(d);b[1]=a.Annotations[c];return b}var e=new VEShape(MC_VESHAPE_EMPTY);e.SetMsnId(d);b[0]=false;b[1]=e;return b}function GetAnnotationById(e){if(cols.length<1)return null;var d=e,a=d.split(MC_IID_CON_TOKEN);if(a[0]!=MC_IID_NAMESPACE)return null;a[1]=a[0]+MC_IID_CON_TOKEN+a[1];a[2]=a[1]+MC_IID_CON_TOKEN+a[2];for(var b=0;b<cols.length;b++)if(cols[b].iid==a[1]){var f=cols[b].Annotations.length;for(var c=0;c<f;c++)if(cols[b].Annotations[c].GetId()==a[2]){return cols[b].Annotations[c];break}break}return null}function GetCollectionByAnId(d){if(cols.length<1)return null;var c=d,a=c.split(MC_IID_CON_TOKEN);if(a[0]!=MC_IID_NAMESPACE)return null;a[1]=a[0]+MC_IID_CON_TOKEN+a[1];a[2]=a[1]+MC_IID_CON_TOKEN+a[2];for(var b=0;b<cols.length;b++)if(cols[b].iid==a[1]){cols[b]._index=b;return cols[b]}return null}function DeleteAnnotationById(c){if(cols.length<1)return null;for(var a=0;a<cols.length;a++)if(cols[a].GetMsnId()==selecteColMsnId){var d=cols[a].Annotations.length;for(var b=0;b<d;b++)if(cols[a].Annotations[b].GetId()==c){ClearEntity(cols[a].Annotations[b]);cols[a].Annotations.splice(b,1);cols[a].UpdateBoundingBox();break}break}}function MoveAnnotations(h,i){var c=null,e=null,b=null;if(cols.length<1)return null;for(var a=0;a<cols.length;a++)if(cols[a].GetMsnId()==selecteColMsnId){c=a;var k=cols[a].Annotations.length;for(var f=0;f<k;f++){var g=cols[a].Annotations[f].GetId();if(e==null&&g==h)e=f;else if(b==null&&g==i)b=f;if(e!=null&&b!=null)break}break}if(c==null||e==null||b==null)return null;var j=cols[c].Annotations[e],d=null;if(e<b)for(var a=e;a<b;++a){cols[c].Annotations[a]=cols[c].Annotations[a+1];d=cols[c].Annotations[a];d.SetDisplayOrder(a+1);d.SetIndex(a);d.SetChangeState(MC_CHANGE_STATE_UPDATE)}else for(var a=e;a>b;--a){cols[c].Annotations[a]=cols[c].Annotations[a-1];d=cols[c].Annotations[a];d.SetDisplayOrder(a+1);d.SetIndex(a);d.SetChangeState(MC_CHANGE_STATE_UPDATE)}cols[c].Annotations[b]=j;d=cols[c].Annotations[b];d.SetDisplayOrder(b+1);d.SetIndex(b);d.SetChangeState(MC_CHANGE_STATE_UPDATE);if(e<b)for(var a=e;a<=b;++a)mvcViewFacade.OnEntityRepaint(cols[c].Annotations[a]);else for(var a=b;a<=e;++a)mvcViewFacade.OnEntityRepaint(cols[c].Annotations[a])}function SwapAnnotations(j,k){var a=null,b=null,c=null;if(cols.length<1)return null;for(var d=0;d<cols.length;d++)if(cols[d].GetMsnId()==selecteColMsnId){a=d;var m=cols[d].Annotations.length;for(var e=0;e<m;e++){if(b==null&&cols[d].Annotations[e].GetId()==j)b=e;else if(c==null&&cols[d].Annotations[e].GetId()==k)c=e;if(b!=null&&c!=null)break}break}if(a==null||b==null||c==null)return null;var l=cols[a].Annotations[b];cols[a].Annotations[b]=cols[a].Annotations[c];cols[a].Annotations[c]=l;var f=cols[a].Annotations[b].GetDisplayOrder(),g=cols[a].Annotations[c].GetDisplayOrder();cols[a].Annotations[b].SetDisplayOrder(g);cols[a].Annotations[c].SetDisplayOrder(f);var h=cols[a].Annotations[b].GetIndex(),i=cols[a].Annotations[c].GetIndex();cols[a].Annotations[b].SetIndex(i);cols[a].Annotations[c].SetIndex(h);cols[a].Annotations[b].SetChangeState(MC_CHANGE_STATE_UPDATE);cols[a].Annotations[c].SetChangeState(MC_CHANGE_STATE_UPDATE);mvcViewFacade.OnEntityRepaint(cols[a].Annotations[b]);mvcViewFacade.OnEntityRepaint(cols[a].Annotations[c]);return null}function DeleteAnnotation(a){if(!a)return null;if(cols.length<1)return null;var e=a.GetId(),b=e.split(MC_IID_CON_TOKEN);if(b[0]!=MC_IID_NAMESPACE)return null;b[1]=b[0]+MC_IID_CON_TOKEN+b[1];var d=null;for(var c=0;c<cols.length;c++)if(cols[c].iid==b[1]){d=cols[c];break}if(d==null)return null;if(VE_MapOverlays.IsActiveOverlayItem(a))VE_MapOverlays.DeactivateEntityOverlays(a);DeleteAnnotationFromCollection(d,a)}function UpdateBoundingBox(c){if(c==null||c.Annotations.length<1)return null;var b=null,a=null,e=null;for(var d=0;d<c.Annotations.length;d++){e=c.Annotations[d];b=e.GetBoundingBox();if(b==null)return null;if(a!=null){a.x1=Math.min(a.x1,b.x1);a.y1=Math.min(a.y1,b.y1);a.x2=Math.max(a.x2,b.x2);a.y2=Math.max(a.y2,b.y2)}else a=new Msn.VE.Bounds(0,0,b.x1,b.y1,b.x2,b.y2);b=null}if(a)c.SetBoundingBox(0,0,a.x1,a.y1,a.x2,a.y2)}function DeleteAnnotationFromCollection(a,b){ClearEntity(b);if(a.Annotations.length==1&&a.Annotations[0].GetId()==b.GetId())a.Annotations.pop();else for(var c=0;c<a.Annotations.length;c++)if(a.Annotations[c].GetId()==b.GetId()){a.Annotations.splice(c,1);break}b=null;a.UpdateBoundingBox();if(a==GetSelectedCollection())if(typeof mvcViewFacade!="undefined"&&typeof mvcViewFacade.OnCollectionLayerRepaint=="function")mvcViewFacade.OnCollectionLayerRepaint(a)}function CloneCollection(a){if(typeof a=="undefined"||a==null)return null;var g=a.Annotations.length,b=new VEShapeLayer;b.SetName(name);b.SetName(a.GetName());b.SetType(a.GetType());b.SetVisibility(a.GetVisibility());b.SetMaxZoomLevel(a.GetMaxZoomLevel());b.SetMinZoomLevel(a.GetMinZoomLevel());var c=a.GetBoundingBox();if(c)b.SetBoundingBox(c.z1,c.z2,c.x1,c.y1,c.x2,c.y2);b.Tags=a.Tags;b.SetChangeType(a.GetChangeType());b.SetChangeState(a.GetChangeState());b.Notes=a.Notes;b.IsPublic=a.IsPublic;b.IsIndexed=a.IsIndexed;b.DateCreated=a.DateCreated;b.DateModified=a.DateModified;b._properties=CloneProperties(a._properties);if(g>0){var e=null,f=null;for(var d=0;d<g;d++){e=a.Annotations[d];f=CloneAnnotationById(e.GetId());b.AddEntityAnnotation(f)}}return b}function CloneAnnotationById(b){var a=self.GetAnnotationById(b);return CloneAnnotation(a)}function CloneAnnotation(an){var annotation=an;if(typeof annotation=="undefined"||annotation==null)return;var primitive=annotation.GetPrimitive(0);if(primitive.points==null||primitive.points.length<1)return null;var copypoints=new Array(primitive.points.length),copyprimitive=null;for(var j=0;j<primitive.points.length;j=j+2){copypoints[j]=primitive.points[j];copypoints[j+1]=primitive.points[j+1]}switch(primitive.type){case VEShapeType.Polygon:case VEShapeType.Polyline:if(primitive.type==VEShapeType.Polyline){copyprimitive=new Msn.Drawing.PolyLine(copypoints);copyprimitive.iid=Msn.Drawing.GetGeoUID(VEShapeType.Polyline)}else copyprimitive=new Msn.Drawing.Polygon(copypoints);copyprimitive.minX=primitive.minX;copyprimitive.minY=primitive.minY;copyprimitive.maxX=primitive.maxX;copyprimitive.maxY=primitive.maxY;copyprimitive.minZ=primitive.minZ;copyprimitive.maxZ=primitive.maxZ;copyprimitive.labelPosX=primitive.labelPosX;copyprimitive.labelPosY=primitive.labelPosY;copyprimitive.labelPosZ=primitive.labelPosZ;copyprimitive.extruded=primitive.extruded;copyprimitive.isLabel=primitive.isLabel;if(primitive.altitudes){var altitudeLen=primitive.altitudes.length;copyprimitive.altitudes=[];for(var j=0;j<altitudeLen;j++)copyprimitive.altitudes[j]=primitive.altitudes[j]}break;case VEShapeType.Pushpin:copyprimitive=new Msn.Drawing.Point(copypoints[0],copypoints[1]);copyprimitive.altitudes=[];if(primitive.altitudes)copyprimitive.altitudes[0]=primitive.altitudes[0]}copyprimitive.altitudeMode=primitive.altitudeMode;copyprimitive.symbol=primitive.symbol;var copyannotation=new VEShape(MC_VESHAPE_EMPTY);copyannotation.AddPrimitive(copyprimitive);copyannotation.IconUrl=annotation.IconUrl;copyannotation.SetProperties(null,annotation.Title,annotation.Url,annotation.PhotoUrl,annotation.UserDate,annotation.Notes,annotation.Latitude,annotation.Longitude,annotation.BusinessListingId,annotation.IconId,annotation.LastModified,annotation.Keywords,annotation.MapserviceType,annotation.MapserviceSource,annotation.MapserviceOpacity);copyannotation.SetDisplayOrder(annotation.GetDisplayOrder());copyannotation.SetZoomLevel(annotation.GetZoomLevel());var bbox=annotation.GetBoundingBox();if(bbox)copyannotation.SetBoundingBox(bbox.z1,bbox.z2,bbox.x1,bbox.y1,bbox.x2,bbox.y2);if(annotation.ViewPort){copyannotation.ViewPort=new VE_3DViewPort;copyannotation.ViewPort.Latitude=annotation.ViewPort.Latitude;copyannotation.ViewPort.Longitude=annotation.ViewPort.Longitude;copyannotation.ViewPort.Altitude=annotation.ViewPort.Altitude;copyannotation.ViewPort.Altitudemode=annotation.ViewPort.Altitudemode;copyannotation.ViewPort.Pitch=annotation.ViewPort.Pitch;copyannotation.ViewPort.Heading=annotation.ViewPort.Heading;copyannotation.ViewPort.Mapstyle=annotation.ViewPort.Mapstyle;copyannotation.ViewPort.SceneId=annotation.ViewPort.SceneId;copyannotation.ViewPort.Properties=CloneProperties(annotation.ViewPort.Properties)}copyannotation.SourceUrl=annotation.SourceUrl;copyannotation.SourceType=annotation.SourceType;if(annotation.ModelRep){copyannotation.ModelRep=new VE_3DModelRep;copyannotation.ModelRep.Transform=annotation.ModelRep.Transform;copyannotation.ModelRep.ModelRefId=annotation.ModelRep.ModelRefId;copyannotation.ModelRep.MinBounds=annotation.ModelRep.MinBounds;copyannotation.ModelRep.MaxBounds=annotation.ModelRep.MaxBounds;copyannotation.ModelRep.R2eoffset=annotation.ModelRep.R2eoffset;copyannotation.ModelRep.Properties=CloneProperties(annotation.ModelRep.Properties)}if(annotation.Photos){var length=annotation.Photos.length;copyannotation.Photos=[];var copyphoto=null,photo=null;for(var i=0;i<length;i++){photo=annotation.Photos[i];copyphoto=new VE_Photo;copyphoto.Id=photo.Id;copyphoto.Url=photo.Url;copyphoto.Properties=CloneProperties(photo.Properties);copyannotation.Photos.push(copyphoto)}}if(annotation.Tour&&typeof annotation.Tour.Actions=="object"){copyannotation.Tour=new VE_3DTour;copyannotation.Tour.Actions=[];var tourLen=annotation.Tour.Actions.length;for(var i=0;i<tourLen;i++){var actionStr="{",touraction=annotation.Tour.Actions[i];for(var tourkey in touraction)actionStr=actionStr.concat("'",tourkey,"':'",touraction[tourkey],"',");actionStr=actionStr.substring(0,actionStr.length-1);actionStr=actionStr.concat("}");var targetAction=eval("("+actionStr+")");if(typeof targetAction!="undefined"&&targetAction!=null)copyannotation.Tour.Actions.push(targetAction)}}return copyannotation}function CloneProperties(a){if(typeof a!="object"||a==null)return null;var c={};for(var b in a)c[b]=a[b];return c}function AddAnnotationToCollection(a,b){if(typeof b=="undefined"||b==null){var c=self.GetSelectedCollection();c.AddEntityAnnotation(a)}else b.AddEntityAnnotation(a);if(typeof mvcViewFacade!="undefined"&&typeof mvcViewFacade.OnEntityRepaint=="function")mvcViewFacade.OnEntityRepaint(a)}function DeleteAllPrimitivesFromAnnotation(a){if(typeof a!="undefined"&&a.GetPrimitiveCount()>0){var c=a.GetPrimitiveCount();if(c<1)return null;for(var b=0;b<c;b++)DeletePrimitiveFromAnnotation(a.GetPrimitive(b),a)}return a}function DeletePrimitiveFromAnnotation(b,a){a.DeletePrimitive(b.iid);if(a.GetPrimitiveCount()==0){DeleteAnnotation(a);a=null}return a}function ClearEntity(a){if(typeof a=="undefined"&&a==null)return null;if(VE_MapOverlays.IsActiveOverlayItem(a))VE_MapOverlays.DeactivateEntityOverlays(a);a.ClearAllPrimitives()}function ParseInternalID(b){var a=b.split(MC_IID_CON_TOKEN);if(!a||a[0]!=MC_IID_NAMESPACE)return null;a[1]=a[0]+MC_IID_CON_TOKEN+a[1];a[2]=a[1]+MC_IID_CON_TOKEN+a[2];a[3]=a[2]+MC_IID_CON_TOKEN+a[3];return a}function GetEntityPrimitiveById(i){if(cols.length<1)return null;var a=i.split(MC_IID_CON_TOKEN);if(a[0]!=MC_IID_NAMESPACE)return null;a[1]=a[0]+MC_IID_CON_TOKEN+a[1];a[2]=a[1]+MC_IID_CON_TOKEN+a[2];a[3]=a[2]+MC_IID_CON_TOKEN+a[3];var b=null,e=null,d=null;for(var g=0;g<cols.length;g++){b=cols[g];if(b.iid==a[1]){var j=null;for(var c=0;c<b.Annotations.length;c++)if(b.Annotations[c].GetId()==a[2]){e=b.Annotations[c];for(var h=0;h<b.Annotations[c].GetPrimitiveCount();h++){d=b.Annotations[c].GetPrimitive(h);if(d.iid==a[3]){var f=[];f[0]=b;f[1]=e;f[2]=d;return f}d=null}e=null}}}if(b==null||e==null||d==null)return null}function SavedLayerCount(){var c=0,d=cols.length;if(cols.length>0)for(var b=0;b<d;b++){var a=cols[b],e=a.GetMsnId();if(e!=0&&a.GetType()==MC_COL_TYPE_COLLECTION&&!a.IsExSource())c++}return c}function IsHighlightEntity(a){if(_HighlightEntity!=null&&_HighlightEntity.iid==a)return true;else return false}function IsHighlightPrimitive(b){if(_HighlightEntity!=null){var a=_HighlightEntity.GetPrimitive(0);if(a&&a.iid==b)return true}return false}function GetHighlightEntity(){return _HighlightEntity}function SetHighlightEntity(a){_HighlightEntity=a}function CheckHighlightStatus(a){return _isHighlighted==a?true:false}function SetHighlightStatus(a){_isHighlighted=a}this.SetHighlightEntity=SetHighlightEntity;this.SetHighlightStatus=SetHighlightStatus;this.CheckHighlightStatus=CheckHighlightStatus;this.IsHighlightEntity=IsHighlightEntity;this.IsHighlightPrimitive=IsHighlightPrimitive;this.GetHighlightEntity=GetHighlightEntity;this.GetCollectionListDiv=GetCollectionListDiv;this.Init=Init;this.IsCollectionExist=IsCollectionExist;this.GetCollectionIndexByMsnId=GetCollectionIndexByMsnId;this.GetAnnotationByMsnId=GetAnnotationByMsnId;this.GetSelectedCollection=GetSelectedCollection;this.GetCollection=GetCollection;this.RetrieveCollection=RetrieveCollection;this.RetrieveCollectionById=RetrieveCollectionById;this.CreateNewCollection=CreateNewCollection;this.SaveCollection=SaveCollection;this.GetCollectionCount=GetCollectionCount;this.GetSelectedCollectionAnnotationCount=GetSelectedCollectionAnnotationCount;this.GetCollectionByIndex=GetCollectionByIndex;this.GetCollectionByMsnId=GetCollectionByMsnId;this.RemoveCollection=RemoveCollection;this.EmptyCollection=EmptyCollection;this.GetAnnotationById=GetAnnotationById;this.GetCollectionByAnId=GetCollectionByAnId;this.DeleteAnnotationById=DeleteAnnotationById;this.SwapAnnotations=SwapAnnotations;this.MoveAnnotations=MoveAnnotations;this.DeleteAnnotation=DeleteAnnotation;this.DeleteAnnotationFromCollection=DeleteAnnotationFromCollection;this.CloneAnnotationById=CloneAnnotationById;this.CloneAnnotation=CloneAnnotation;this.AddAnnotationToCollection=AddAnnotationToCollection;this.DeleteAllPrimitivesFromAnnotation=DeleteAllPrimitivesFromAnnotation;this.ParseInternalID=ParseInternalID;this.GetEntityPrimitiveById=GetEntityPrimitiveById;this.CloneCollection=CloneCollection;this.AddCollection=AddCollection;this.DeleteAll=DeleteAll;this.SetVisibility=SetVisibility;this.SavedLayerCount=SavedLayerCount;this.Dispose=Dispose};VE_CollectionActions=function(){};VE_CollectionActions.Create="CreateCollection";VE_CollectionActions.Update="UpdateCollection";VE_CollectionActions.RetrieveAll="RetrieveAllCollections";VE_CollectionActions.RetrieveDetails="RetrieveCollectionDetails";VE_CollectionActions.Delete="DeleteCollection";VE_CollectionActions.DeleteAll="DeleteAllCollections";VE_CollectionActions.DeleteAllAnnotations="DeleteAllAnnotations";VE_AnnotationActions=function(){};VE_AnnotationActions.Create="CreateAnnotation";VE_AnnotationActions.Delete="DeleteAnnotation";VE_AnnotationActions.Update="UpdateAnnotation";VE_AnnotationActions.RetrieveAll="RetrieveAllAnnotations";VE_AnnotationState=function(){};VE_AnnotationState.None="None";VE_AnnotationState.Added="Added";VE_AnnotationState.Updated="Updated";VE_AnnotationState.Deleted="Deleted";VE_CollectionsManagerConstants=function(){};VE_CollectionsManagerConstants.Handler="UserCollections.aspx?action=";VE_CollectionsManagerConstants.Market="mkt=";VE_CollectionsManagerConstants.Random="rand=";VE_CollectionsManagerConstants.A_Id="aid";VE_CollectionsManagerConstants.A_Title="atitle";VE_CollectionsManagerConstants.A_Latitude="alatitude";VE_CollectionsManagerConstants.A_Longitude="alongitude";VE_CollectionsManagerConstants.A_Notes="anotes";VE_CollectionsManagerConstants.A_Keywords="akeywords";VE_CollectionsManagerConstants.A_IconId="aiconid";VE_CollectionsManagerConstants.A_InfoUrl="aurl";VE_CollectionsManagerConstants.A_PhotoUrl="aphotourl";VE_CollectionsManagerConstants.A_UserDate="auserdate";VE_CollectionsManagerConstants.A_DisplayOrder="adisplayorder";VE_CollectionsManagerConstants.A_BusinessId="abusinesslistingid";VE_CollectionsManagerConstants.A_CreationId="acreationid";VE_CollectionsManagerConstants.A_State="astate";VE_CollectionsManagerConstants.A_MapserviceType="amapservicetype";VE_CollectionsManagerConstants.A_MapserviceSource="amapservicesource";VE_CollectionsManagerConstants.A_MapserviceOpacity="amapserviceopacity";VE_CollectionsManagerConstants.C_Id="cid";VE_CollectionsManagerConstants.C_Name="cname";VE_CollectionsManagerConstants.C_IsPublic="cispublic";VE_CollectionsManagerConstants.C_Length="cannotationcount";VE_CollectionsManagerConstants.C_Keywords="ckeywords";VE_CollectionsManagerConstants.ViewerDefaultTitle=L_CollectionManagerViewerDefaultTitle_Text;VE_CollectionsManagerConstants.MinimizedTimerDelay=1;VE_CollectionsManagerConstants.TimerDelay=2000;VE_CollectionsManagerConstants.ExtendedTimerDelay=5000;VE_CollectionsManagerConstants.MAX_COLLECTION_SIZE=200;VE_CollectionsManagerConstants.HELP_FILE_PATH="/cPublicPrivate.htm";VE_CollectionsManagerConstants.TourMode="tour";VELayerProperties={CopyAllowed:"copyallowed"};VEShapeLayer=function(){this._mapGuid=null;this.Name="";this.MsnId="";this.IsPublic=false;this.Culture="en-us";this.IsIndexed=false;this.SourceUrl=null;this.DateCreated=Date();this.DateModified=Date();this.Tags="";this.Notes="";this.Annotations=[];this.Dirty=false;this.IsClearDom=true;this.ViewableByOwnerOnly=false;this.EditableByOwner=true;this.OwnerIsViewing=false;this._properties=null;this.iid=MC_IID_NAMESPACE+MC_IID_CON_TOKEN+Msn.Drawing.GetGeoUID(MC_GEO_TYPE_COL);this._index=0;this.GetShapeCount=function(){if(this.Annotations)return this.Annotations.length;else return 0};this.ClearAnnotations=function(){while(this.Annotations.length){var a=this.Annotations.pop();a=null}};this.AddAnnotation=function(a,b){if(a&&this.Annotations){this.IsClearDom=true;a.IsClearDom=true;if(typeof b=="number"&&b>=0&&b<this.Annotations.length){this.Annotations.splice(b,0,a);return this.Annotations.length}else{a.SetIndex(this.Annotations.length);a.SetDisplayOrder(this.Annotations.length);return this.Annotations.push(a)}}};this.RetrieveAnnotationById=function(b){if(this.Annotations.length>0&&b){var a=0;while(a<this.Annotations.length){if(b==this.Annotations[a].Id)return a;a++}}return null};this.ResetOrder=function(){if(this.Annotations&&this.Annotations!=""&&this.Annotations!="undefined"&&this.Annotations.length>0){for(var a=0;a<this.Annotations.length;a++)if(this.Annotations[a]instanceof VEShape){this.Annotations[a].DisplayOrder=a;this.Annotations[a].Delta=0}this.Dirty=false}};this.ReOrder=function(){this.Annotations.sort(this.sortByIndex);this.Dirty=false};this.sortByIndex=function(a,b){if(a instanceof VEShape&&b instanceof VEShape){a.DisplayOrder=a.DisplayOrder+a.Delta;b.DisplayOrder=b.DisplayOrder+b.Delta;a.Delta=0;b.Delta=0;return a.DisplayOrder-b.DisplayOrder}}};VEShapeLayer.prototype=new Msn.VE.Core.VectorLayer;VEShapeLayer.prototype.isEmptyOnServerSide=false;VEShapeLayer.prototype.IsUpdateCollection=true;VEShapeLayer.prototype.AddEntityAnnotation=function(a){this.UpdateEntityAnnotation(a);this.AddAnnotation(a)};VEShapeLayer.prototype.SetChangeState=function(a){this.ChangeState=a};VEShapeLayer.prototype.GetChangeState=function(){if(typeof this.ChangeState=="undefined")this.ChangeState=MC_CHANGE_STATE_DEFAULT;return this.ChangeState};VEShapeLayer.prototype.SetChangeType=function(a){this.ChangeType=a};VEShapeLayer.prototype.GetChangeType=function(){if(typeof this.ChangeType=="undefined")this.ChangeType=MC_CHANGE_TYPE_ALL;return this.ChangeType};VEShapeLayer.prototype.UpdateEntityAnnotation=function(c){this.IsClearDom=true;c.IsClearDom=true;if(this.Annotations.length<1)this.SetBoundingBox(0,0,Infinity,Infinity,-Infinity,-Infinity);var d=true,a=this.GetBoundingBox(),b=null;b=c.GetBoundingBox();var e=a.x1<=a.x2&&a.y1<=a.y2,f=b.x1<=b.x2&&b.y1<=b.y2;if(e&&f)d=a.x1<b.x1&&a.y1<b.y1&&a.x2>b.x2&&a.y2>b.y2;c.Update(true,this.iid);if(a)if(d){a.x1=Math.min(b.x1,a.x1);a.y1=Math.min(b.y1,a.y1);a.x2=Math.max(b.x2,a.x2);a.y2=Math.max(b.y2,a.y2)}else a=this.UpdateBoundingBox();else a=new Msn.VE.Bounds(0,0,b.x1,b.y1,b.x2,b.y2);this.SetBoundingBox(0,0,a.x1,a.y1,a.x2,a.y2);this._SetTileId();a=null;return c};VEShapeLayer.prototype.UpdateBoundingBox=function(){var h=this.Annotations.length,g=null,a=null,b=Infinity,d=Infinity,c=-Infinity,e=-Infinity;for(var f=0;f<h;f++){g=this.Annotations[f];a=g.GetBoundingBox();b=Math.min(a.x1,b);d=Math.min(a.y1,d);c=Math.max(a.x2,c);e=Math.max(a.y2,e)}this.SetBoundingBox(0,0,b,d,c,e);this._SetTileId();return this.GetBoundingBox()};VEShapeLayer.prototype.IsExSource=function(){if(this.MsnId!=0&&this.MsnId.indexOf(MC_CML_EXCOL_PREFIX)==0)return true;else return false};VEShapeLayer.prototype.IsFromMsnStorage=function(){if(this.MsnId==0||this.IsExSource())return false;else return true};VEShapeLayer.prototype.GetProperty=function(b){if(this._properties==null)return null;var a=this._properties[b];if(b==VELayerProperties.CopyAllowed)if(!this.IsPublic){a=0;this._properties[VELayerProperties.CopyAllowed]=a}else if(a==null){a=1;this._properties[VELayerProperties.CopyAllowed]=a}return typeof a=="undefined"?null:a};VEShapeLayer.prototype.SetProperty=function(b,a){if(typeof b!="string"&&typeof b!="number"||typeof a!="string"&&typeof a!="number"&&typeof a!="boolean")return null;if(this._properties==null)this._properties={};this._properties[b]=a};VEShapeLayer.prototype._SetTileId=function(){if(typeof VE_ShapeIndexManager!="undefined"){var a=VE_ShapeIndexManager.GetTileId(this.Boundingbox);if(a!=null)this.SetProperty(MC_CML_TILEID,a)}};VEShapeLayer.prototype.IsDuplicate=function(b){var i=this.Annotations.length,e=b.GetPrimitive(0);if(i<1||e==null)return false;var n=e.type,a=null,d=0,c=0,l=b.ToString(),m=b.GetId(),h=b.GetMsnId(),g=b.GetBusinessListingId();for(var f=0;f<i;f++){a=this.Annotations[f];primitive2=a.GetPrimitive(0);if(primitive2==null||e.type!=primitive2.type)continue;d=a.GetMsnId();c=a.GetBusinessListingId();if(m!=a.GetId()){var k=h!=0&&d!=0&&h==d;if(k)return true;var j=g!=0&&c!=0&&g==c;if(j)return true;if(l==a.ToString())return true}d=0;c=0}return false};VEShapeLayer.prototype.GetBoundingRectangle=function(){var a=this.GetBoundingBox();return new VELatLongRectangle(new VELatLong(a.y2,a.x1),new VELatLong(a.y1,a.x2))};VEShapeLayer.prototype.GetShapeByIndex=function(a){var b=this.Annotations.length;if(typeof a!="number"&&a>0&&a<b-1)return null;return this.Annotations[a]};VEShapeLayer.prototype.GetShapeByID=function(b){var c=this.Annotations.length;for(var a=0;a<c;a++)if(this.Annotations[a].GetId()==b)return this.Annotations[a];return null};VEShapeLayer.prototype.DeleteAllShapes=function(){if(this._mapGuid!=null){var b=GetVEMapInstance(this._mapGuid);if(b!=null)b.m_vegraphicsmanager.ClearLayerDom(this)}var c=this.Annotations.length;for(var a=0;a<c;a++)this.Annotations[a].DisposeEx();this.Annotations=[];this.Boundingbox=new Msn.VE.Bounds(0,0,Infinity,Infinity,-Infinity,-Infinity)};VEShapeLayer.prototype.SwapShapes=function(a,b){var a=parseInt(a),b=parseInt(b);VEValidator.ValidateInt(a,"idx1");VEValidator.ValidateInt(b,"idx2");if(a==b)return false;var c=this.Annotations.length;VEValidator.ValidateBetween(a,"idx1",0,c-1);VEValidator.ValidateBetween(b,"idx2",0,c-1);var h=this.Annotations[a];this.Annotations[a]=this.Annotations[b];this.Annotations[b]=h;var d=this.Annotations[a].GetDisplayOrder(),e=this.Annotations[b].GetDisplayOrder();this.Annotations[a].SetDisplayOrder(e);this.Annotations[b].SetDisplayOrder(d);var f=this.Annotations[a].GetIndex(),g=this.Annotations[b].GetIndex();this.Annotations[a].SetIndex(g);this.Annotations[b].SetIndex(f);if(this.Annotations[a].GetVisibility())this.Annotations[a].Show();if(this.Annotations[b].GetVisibility())this.Annotations[b].Show();return true};VEShapeLayer.prototype.AddShape=function(a,b){if(a&&typeof a.length!="undefined")this.AddShapes(a,b);else{VEValidator.ValidateObject(a,"_veshape",VEShape,"VEShape");if(a._shplayer!=null||a.Primitives[0]==null)throw new VEException("AddShape","err_invalidargument",L_ShpExist_text);a._shplayer=this;this.UpdateEntityAnnotation(a);this.AddAnnotation(a,b);if(a.GetVisibility())a.Show()}};VEShapeLayer.prototype.AddShapes=function(c){VEValidator.ValidateObjectArray(c,"_veshapeArray",VEShape,"VEShape Array");var h=c.length,g=GetVEMapInstance(this._mapGuid);if(g&&g.GetMapMode()==Msn.VE.MapActionMode.Mode3D)for(var a=0;a<h;++a)this.AddShape(c[a]);else{if(this._index==0&&this.GetShapeCount()==0)this.Show();var d=[],f=this.Annotations.length;for(var a=0;a<f;a++)this.Annotations[a].ClearDomElements();if(!Msn.VE.Environment.IsIE50())for(var a=0;a<f;a++){var b=this.Annotations[a];if(b._isDrawn){if(b.IconUrl==null)b.IconUrl=Msn.VE.API.Constants.iconurl;d.push(b.ToHtml())}}for(var a=0;a<h;++a){var b=c[a];b._shplayer=this;this.UpdateEntityAnnotation(b);this.AddAnnotation(b);if(b.IconUrl==null)b.IconUrl=Msn.VE.API.Constants.iconurl;d.push(b.ToHtml());b._isDrawn=true}var e=$ID(this.GetId());if(e)if(Msn.VE.Environment.IsIE50())e.innerHTML+=d.join("");else e.innerHTML=d.join("")}};VEShapeLayer.prototype.DeleteShape=function(b){VEValidator.ValidateObject(b,"_veshape",VEShape,"VEShape");var d=this.Annotations.length;for(var a=0;a<d;a++)if(this.Annotations[a].GetId()==b.GetId()){if(this._mapGuid!=null){var c=GetVEMapInstance(this._mapGuid);if(c!=null)c.m_vegraphicsmanager.ClearEntityDom(this.Annotations[a])}this.Annotations[a].DisposeEx();this.Annotations.splice(a,1);this.UpdateBoundingBox();break}};VEShapeLayer.prototype.Show=function(){this.SetVisibility(true);if(this._mapGuid==null)return null;vmap=GetVEMapInstance(this._mapGuid);if(vmap==null)return null;vmap.m_vegraphicsmanager.DrawLayer(this)};VEShapeLayer.prototype.Hide=function(){this.SetVisibility(false);if(this._mapGuid==null)return null;vmap=GetVEMapInstance(this._mapGuid);if(vmap==null)return null;vmap.m_vegraphicsmanager.ClearLayerDom(this)};VEShapeLayer.prototype.SetTitle=function(a){if(typeof a!="undefined"&&a!=null)this.Name=a.replace(/%0D%0A/g,"\r\n").replace(/%0A/g,"\n")};VEShapeLayer.prototype.GetTitle=function(){if(typeof this.Name=="undefined")this.Name="my collection";return this.Name};VEShapeLayer.prototype.SetDescription=function(a){if(typeof a!="undefined"&&a!=null)this.Notes=a.replace(/%0D%0A/g,"\r\n").replace(/%0A/g,"\n")};VEShapeLayer.prototype.GetDescription=function(){if(typeof this.Notes=="undefined")this.Notes="";return this.Notes};VEShapeLayer.prototype.SetMaxZoomLevel=function(a){a=parseInt(a);if(isNaN(a)||a>21||a<1)throw new VEException("VEShapeLayer.SetMaxZoomLevel","err_incorrectzoomlevel",L_Shp_IncorrectZoomLevel_Text);else if(a<this.MinScale)throw new VEException("VEShapeLayer.SetMaxZoomLevel","err_incorrectzoomlevel",L_Shp_IncorrectZoomLevel2_Text);this.MaxScale=a;if(this.GetVisibility())this.Show()};VEShapeLayer.prototype.GetMaxZoomLevel=function(){return this.MaxScale};VEShapeLayer.prototype.SetMinZoomLevel=function(a){a=parseInt(a);if(isNaN(a)||a<1||a>21)throw new VEException("VEShapeLayer.SetMinZoomLevel","err_incorrectzoomlevel",L_Shp_IncorrectZoomLevel_Text);else if(a>this.MaxScale)throw new VEException("VEShapeLayer.SetMinZoomLevel","err_incorrectzoomlevel",L_Shp_IncorrectZoomLevel2_Text);this.MinScale=a;if(this.GetVisibility())this.Show()};VEShapeLayer.prototype.GetMinZoomLevel=function(){return this.MinScale};VEShapeLayer.prototype.IsVisible=function(){return this.GetVisibility()};function VEShape(c,b)
{this.Actions="";this.Id=0;this.Title=Msn.VE.API?"":L_AnnotationConfDefaultTitle_Text;this.Latitude=0;this.Longitude=0;this.Notes="";this.Keywords="";this.LocalID="";this.Url="";this.PhotoUrl="";this.UserDate=new Date;this.DisplayOrder=0;this.BusinessListingId=0;this.IconId=0;this.LastModified=new Date;this._cacheOfSerializationLength=0;this.TileId=null;this.IsClearDom=true;this.MapserviceType="None";this.MapserviceSource="";this.MapserviceOpacity=.6;this.MapserviceMetadata="";this.ViewPort=null;this.Tour=null;this.ModelRep=null;this.IsModelVisible=false;this.Photos=null;this.SourceUrl=null;this.SourceType=null;this.ShowDetailOnMouseOver=true;this.OnMouseOverCallback=null;this._customIcon=null;this._IconContent=null;this._eroContent=null;this._shplayer=null;this.IconUrl=null;this.maxZoomLevel=21;this.minZoomLevel=1;var a=false;this.IsEncrypted=function(){return a};this.SetEncrypted=function(){a=true};if(typeof this._Construct=="function")this._Construct(true,c,b)}VEShape.prototype.GetCacheOfSerializationLength=function(){if(this._cacheOfSerializationLength<=0){var a=VE_CookieSerializer.SerializeAnnotation(this);if(a!=null)this._cacheOfSerializationLength=a.length}return this._cacheOfSerializationLength};VEShape.prototype.InvalidateCacheOfSerializationLength=function(){this._cacheOfSerializationLength=0};VEShape.prototype.index=0;VEShape.prototype.SetIndex=function(a){this.index=a};VEShape.prototype.GetIndex=function(){return this.index};VEShape.prototype.SetDisplayOrder=function(a){this.DisplayOrder=a};VEShape.prototype.GetDisplayOrder=function(){return this.DisplayOrder};VEShape.prototype.SetProperties=function(b,l,m,h,i,k,o,n,c,j,g,a,f,e,d)
{if(b)
this.Id=b;this.Title=l.replace(/%0D%0A/g,"\r\n").replace(/%0A/g,"\n");this.Notes=k.replace(/%0D%0A/g,"\r\n").replace(/%0A/g,"\n");if(a!=null&&a.length>0&&a[0]!=null)
{this.Keywords=a;this.Keywords[0]=this.Keywords[0].replace(/%0D%0A/g,"\r\n").replace(/%0A/g,"\n")}
else
this.Keywords=a;this.Url=m;this.PhotoUrl=h;this.UserDate=i;this.BusinessListingId=c;this.IconId=j;this.LastModified=g;this.MapserviceType=f;this.MapserviceSource=e;this.MapserviceOpacity=d};VEShape.prototype.symbolUrl="samplesymbol";VEShape.prototype.GetMsnId=function(){return this.Id};VEShape.prototype.SetMsnId=function(a){this.Id=a};VEShape.prototype.SetBoundingBox=function(f,e,c,d,a,b){if(typeof this.Boundingbox=="undefined"||this.Boundingbox==null){if(c==null||d==null||a==null||b==null)return null;this.Boundingbox=new Msn.VE.Bounds(f,e,c,d,a,b)}else{this.Boundingbox.x1=c;this.Boundingbox.y1=d;this.Boundingbox.z1=f;this.Boundingbox.x2=a;this.Boundingbox.y2=b;this.Boundingbox.z2=e}if(typeof VE_ShapeIndexManager!="undefined")this.TileId=VE_ShapeIndexManager.GetTileId(this.Boundingbox);return this.Boundingbox};VEShape.prototype.GetBoundingBox=function(){if(typeof this.Boundingbox=="undefined"||!this.Boundingbox)this.Boundingbox=new Msn.VE.Bounds(0,0,Infinity,Infinity,-Infinity,-Infinity);return this.Boundingbox};VEShape.prototype.GetCenterPoint=function(){if(!this.GetBoundingBox())return;var a=new Array(2);a[0]=(this.GetBoundingBox().x1+this.GetBoundingBox().x2)/2;a[1]=(this.GetBoundingBox().y1+this.GetBoundingBox().y2)/2;return a};VEShape.prototype.SetId=function(a){this.iid=a};VEShape.prototype.GetId=function(){if(typeof this.iid=="undefined"||this.iid==0||this.iid==null)this.iid=Msn.Drawing.GetGeoUID(MC_GEO_TYPE_ENTITY);return this.iid};VEShape.prototype.SetVisibility=function(a){this.Visibility=a};VEShape.prototype.GetVisibility=function(){if(typeof this.Visibility=="undefined"||typeof this.Visibility=="null")this.Visibility=true;return this.Visibility};VEShape.prototype.SetBusinessListingId=function(a){if(typeof a=="undefined"||a=="null")this.BusinessListingId=0;else this.BusinessListingId=a};VEShape.prototype.GetBusinessListingId=function(){if(typeof this.BusinessListingId=="undefined"||this.BusinessListingId==null||this.BusinessListingId=="null")this.BusinessListingId=0;return this.BusinessListingId};VEShape.prototype.SetType=function(a){this.Type=a};VEShape.prototype.GetType=function(){if(typeof this.Type=="undefined")this.Type="aN";return this.Type};VEShape.prototype.SetSaveStatus=function(a){this.SaveStatus=a};VEShape.prototype.IsSaved=function(){if(typeof this.SaveStatus=="undefined")this.SaveStatus=true;return this.SaveStatus};VEShape.prototype.SetOnScratchpad=function(a){this.OnScratchpad=a};VEShape.prototype.IsOnScratchpad=function(){if(typeof this.OnScratchpad=="undefined")this.OnScratchpad=true;return this.OnScratchpad};VEShape.prototype.SetZoomLevel=function(a){this.ZoomLevel=a};VEShape.prototype.GetZoomLevel=function(){if(typeof this.ZoomLevel=="undefined")this.ZoomLevel=12;return this.ZoomLevel};VEShape.prototype.SetChangeState=function(a){this.ChangeState=a};VEShape.prototype.GetChangeState=function(){if(typeof this.ChangeState=="undefined")this.ChangeState=MC_CHANGE_STATE_DEFAULT;return this.ChangeState};VEShape.prototype.SetChangeType=function(a){this.ChangeType=a};VEShape.prototype.GetChangeType=function(){if(typeof this.ChangeType=="undefined")this.ChangeType=MC_CHANGE_TYPE_ALL;return this.ChangeType};VEShape.prototype.HasAltitude=function(){var a=this.Primitives;if(typeof a=="undefined"||a==null)return false;if(a[0].altitudes==null)return false;else return true};VEShape.prototype.GetPrimitiveCount=function(){if(typeof this.Primitives=="undefined"||this.Primitives==null){this.Primitives=[];return 0}return this.Primitives.length};VEShape.prototype.SetPrimitives=function(a){this.Primitives=a;this.SetType(a[0].type)};VEShape.prototype.GetPrimitives=function(){if(typeof this.Primitives=="undefined"||this.Primitives==null)this.Primitives=[];return this.Primitives};VEShape.prototype.GetPrimitive=function(a){if(typeof this.Primitives=="undefined"||this.Primitives==null||this.Primitives.length==0){this.Primitives=[];return null}if(a<this.Primitives.length)return this.Primitives[a];else return this.Primitives[0]};VEShape.prototype.AddPrimitive=function(a){if(typeof this.Primitives=="undefined"||this.Primitives==null)this.Primitives=[];this.Primitives.push(a);this.SetType(a.type)};VEShape.prototype.UpdateUI=function(){};VEShape.prototype.DeletePrimitive=function(c){if(typeof this.Primitives=="undefined"||this.Primitives==null){this.Primitives=[];return null}if(this.Primitives.length==1){this.Primitives[0].Destroy();this.Primitives.pop();this.Primitives=[];return null}var b=null;for(var a=0;a<this.Primitives.length;a++){b=this.Primitives[a];if(b.iid==c){this.Primitives[a].splice(a,1);break}}if(b)b.Destroy()};VEShape.prototype.ClearAllPrimitives=function(){if(typeof this.Primitives=="undefined"||this.Primitives==null){this.Primitives=[];return}for(var a=0;a<this.Primitives.length;a++)this.Primitives[a].Destroy();this.Primitives=[]};VEShape.prototype.Update=function(j,h){var b=false,l=this.GetId().split(MC_IID_CON_TOKEN);if(l[0]==MC_IID_NAMESPACE)b=true;else{b=false;if(!h)return false;var k=h.split(MC_IID_CON_TOKEN);if(k[0]!=MC_IID_NAMESPACE)return false}var m=this.Primitives.length,a=null,d=Infinity,f=Infinity,e=-Infinity,g=-Infinity;for(var i=0;i<m;i++){a=this.Primitives[i];if(a.type!=VEShapeType.Pushpin){if(!b||j||(a.minX==null||a.minY==null||a.maxX==null||a.maxY==null)){var c=Msn.Drawing.ComputeBoundingBox(a.points);if(c){a.minX=c[0];a.minY=c[1];a.maxX=c[2];a.maxY=c[3]}}d=Math.min(a.minX,d);f=Math.min(a.minY,f);e=Math.max(a.maxX,e);g=Math.max(a.maxY,g);Msn.Drawing.CalculateLabelPosition(a);this.Longitude=a.labelPosX;this.Latitude=a.labelPosY;this.Altitude=a.labelPosZ}else{d=Math.min(a.points[0],d);f=Math.min(a.points[1],f);e=Math.max(a.points[0],e);g=Math.max(a.points[1],g);this.Longitude=a.points[0];this.Latitude=a.points[1]}if(!b)a.iid=h+MC_IID_CON_TOKEN+this.GetId()+MC_IID_CON_TOKEN+a.iid;a.title=this.Title;if(a.shape!=null)a.shape.id=a.iid}this.SetBoundingBox(0,0,d,f,e,g);if(!b)this.SetId(h+MC_IID_CON_TOKEN+this.GetId());this.guid=this.GetId();return this.GetBoundingBox()};VEShape.prototype.SetIconUrl=function(a){this.IconUrl=a};VEShape.prototype.GetIconUrl=function(){return this.IconUrl};VEShape.prototype.IsModel=function(){return this.ModelRep==null?false:true};VEShape.prototype.IsOverlay=function(){return IsValidMapserviceType(this.MapserviceType)&&this.MapserviceType!=VEMapserviceType.None};VEShape.prototype.MovePrimitive=function(d,c){var d=parseFloat(d),c=parseFloat(c);if(isNaN(d)||isNaN(c))return;var f=null;for(var e=0;e<this.Primitives.length;e++){f=this.Primitives[e];var b=f.points,g=b.length;for(var a=0;a<g-1;a=a+2){b[a]=b[a]+d;b[a+1]=b[a+1]+c}}};VEShape.prototype.Dispose=function(){this.ClearAllPrimitives();this.Boundingbox=null;this._customIcon=null;this._IconContent=null;this._eroContent=null;this._shplayer=null;this.IconUrl=null;this.Id=null;this.Title=null;this.Latitude=null;this.Longitude=null;this.Notes=null;this.Keywords=null;this.Url=null;this.LocalID=null;this.PhotoUrl=null;this.UserDate=null;this.DisplayOrder=null;this.BusinessListingId=null;this.IconId=null;this.LastModified=null;this.ViewPort=null;this.Tour=null;this.ModelRep=null;this.SourceUrl=null;this.SourceType=null;this.Photos=null};VEShape.prototype.ToString=function(){var a="<e>",f=this.Primitives.length,d=null;for(var e=0;e<f;e++){d=this.Primitives[e];if(d.type==VEShapeType.Pushpin)a=a.concat("<coords>",d.points.join(","),"</coords>")}var b="<a>",c="</a>";a=a.concat("<as>");a=a.concat(b,this.GetBusinessListingId(),c,b,this.Url,c,b,this.PhotoUrl,c,b,this.Title,c,b,this.Type,c);a=a.concat("</as>");a=a.concat("</e>");return a};function VE_3DViewPort(){this.Latitude=0;this.Longitude=0;this.Altitude=0;this.Altitudemode="Datum";this.Pitch=0;this.Heading=0;this.Mapstyle="r";this.SceneId=0;this.Properties=null}function VE_3DModelRep(){this.Transform=null;this.ModelRefId=null;this.MinBounds=null;this.MaxBounds=null;this.Properties=null;this.R2eoffset=null}function VE_3DTour(){this.Actions=null}function VE_Photo(){this.Id=null;this.Url=null;this.Properties=null}VEShape.prototype.SetPhotos=function(a){this.Photos=a};function _VE_EntityDrawingState(){this.zIndexIcon=null;this.zIndexPolyShape=null;this.minZoomLevel=null;this.maxZoomLevel=null;this.isShared=null;this.parentEl=null;this.text=null}function _VE_CreateServiceInstance(a){switch(a){case _VE_ServiceType.MapCruncher:return new VETileSourceSpecification;default:return null}return null}_VE_ServiceType={MapCruncher:"t",NetworkLink:"n"};VEShape.Decoder=new _xy1;VEShape.LatLongFactory=new VELatLongFactory(new VELatLongFactoryAlwaysEncodeSpec);VEShape.prototype._Construct=function(j,g,e){var a=[],d=[],k=false,f=null;if(typeof g!="undefined"){if(g==MC_VESHAPE_EMPTY&&j){this.maxZoomLevel=21;this.minZoomLevel=1;this._eroContent=null;this._shplayer=null;return}}else throw new VEException("VEShape","err_invalidargument",L_invalidargument_text.replace("%1","type").replace("%2","VEShapeType"));if(typeof e=="object")if(typeof e.length=="number"){var l=e.length;for(var h=0;h<l;h++)if(e[h]instanceof VELatLong){var c=VEShape.Decoder.Decode(e[h]);if(e[h]._reserved)this.SetEncrypted();a.push(c.Longitude);a.push(c.Latitude);if(c.Altitude!=null){if(c.AltitudeMode!=null)if(f!=null&&f!=c.AltitudeMode)throw new VEException("VEShape","err_altitudemodemismatch",L_altitudemodemismatch_Text);else f=c.AltitudeMode;k=true;d.push(c.Altitude)}else d.push(0)}else throw new VEException("VEShape","err_invalidargument",L_invalidargument_text.replace("%1","points["+h+"]").replace("%2","VELatLong"))}else if(e instanceof VELatLong){var c=VEShape.Decoder.Decode(e);if(e._reserved)this.SetEncrypted();a.push(c.Longitude);a.push(c.Latitude);if(c.Altitude!=null){k=true;f=c.AltitudeMode;d.push(c.Altitude)}}else throw new VEException("VEShape","err_invalidargument",L_invalidargument_text.replace("%1","points").replace("%2","VELatLong"));else throw new VEException("VEShape","err_invalidargument",L_invalidargument_text.replace("%1","points").replace("%2","VELatLong[]"));var b=null,i=a.length;if(g==VEShapeType.Pushpin){if(i<2)throw new VEException("VEShape","err_incorrectpoints",L_Shp_IncorrectPoints_Text);if(j)b=new Msn.Drawing.Point(a[0],a[1])}else if(g==VEShapeType.Polyline){if(i<3)throw new VEException("VEShape","err_incorrectpoints",L_Shp_IncorrectPoints_Text);if(j)b=new Msn.Drawing.PolyLine(a)}else if(g==VEShapeType.Polygon){if(i<5)throw new VEException("VEShape","err_incorrectpoints",L_Shp_IncorrectPoints_Text);if(a[0]!=a[i-2]||a[1]!=a[i-1]||k&&d[0]!=d[i/2-1]){a.push(a[0]);a.push(a[1]);d.push(d[0])}if(j)b=new Msn.Drawing.Polygon(a)}else throw new VEException("VEShape","err_invalidargument",L_invalidargument_text.replace("%1","type").replace("%2","VEShapeType"));if(j){this.maxZoomLevel=21;this.minZoomLevel=1;this._eroContent=null;this._shplayer=null;this._shapeElement=null;this._iconElement=null;this._isClipped=false;if(k){b.altitudes=d;if(f)b.altitudeMode=f;else b.altitudeMode=VEAltitudeMode.Default}else{b.altitudes=null;b.altitudeMode=VEAltitudeMode.Default}if(typeof VE_MapDispatch_SymbolLib!="undefined"){if(g==VEShapeType.Pushpin)b.symbol=VE_MapDispatch_SymbolLib.GetMapSymbolByID(MC_PROPERTY_PUSHPIN);else b.symbol=VE_MapDispatch_SymbolLib.GetCurrentDefaultSymbol();b.symbol.imagedata_src=Msn.VE.API.Constants.iconurl;b.symbol.style_zIndex=Msn.VE.API.Globals.veshapeiconzindex;b.symbol.style_zIndex_polyshape=Msn.VE.API.Globals.veshapepolyshapezindex;this.AddPrimitive(b)}else throw new VEException("VEShape:new VEShape","err_notinitialized",L_shp_Notinitialized_text)}else{this.Primitives[0].points=a;if(k){this.Primitives[0].altitudes=d;if(f)this.Primitives[0].altitudeMode=f;else this.Primitives[0].altitudeMode=VEAltitudeMode.Default}else{this.Primitives[0].altitudes=null;this.Primitives[0].altitudeMode=VEAltitudeMode.Default}}};VEShape.prototype.GetShapeType=function(){return this.Primitives[0].type};VEShape.prototype.GetShapeLayer=function(){return this._shplayer};VEShape.prototype.GetID=function(){if(this._shplayer==null)return null;return this.GetId()};VEShape.prototype.Show=function(){this.SetVisibility(true);if(this._shplayer==null||this._shplayer._mapGuid==null)return;vmap=GetVEMapInstance(this._shplayer._mapGuid);if(vmap==null)return;if(this._shplayer.GetVisibility()){vmap.m_vegraphicsmanager.ClearEntityDom(this);vmap.m_vegraphicsmanager.DrawEntity(this);vmap.m_vegraphicsmanager.PushOffsetRequest()}};VEShape.prototype.Redraw=function(c,d,e,f,b){if(this.GetVisibility()&&this._shplayer&&this._shplayer._mapGuid&&this._shplayer.GetVisibility()){var a=GetVEMapInstance(this._shplayer._mapGuid);if(a==null)return;if(a.GetMapMode()==Msn.VE.MapActionMode.Mode3D||!this._isDrawn)this.Show();else{if(c)a.m_vegraphicsmanager.UpdatePoints(this,true);if(d)a.m_vegraphicsmanager.UpdateIconPoints(this);if(e)a.m_vegraphicsmanager.UpdateStyle(this);if(f)a.m_vegraphicsmanager.UpdateIconStyle(this);if(b)if(this.GetIconVisibility())a.m_vegraphicsmanager.ShowIcon(this);else a.m_vegraphicsmanager.HideIcon(this)}}};VEShape.prototype.Hide=function(){this.SetVisibility(false);if(this._shplayer==null||this._shplayer._mapGuid==null)return;vmap=GetVEMapInstance(this._shplayer._mapGuid);if(vmap==null)return;vmap.m_vegraphicsmanager.ClearEntityDom(this)};VEShape.prototype.SetIconVisibility=function(a){if(this.Primitives[0].type!=VEShapeType.Pushpin)this.Primitives[0].isLabel=a};VEShape.prototype.HideIcon=function(){if(this.Primitives[0].type!=VEShapeType.Pushpin)this.Primitives[0].isLabel=false;if(this._shplayer==null||this._shplayer._mapGuid==null)return;this.Redraw(false,false,false,false,true)};VEShape.prototype.ShowIcon=function(){if(this.Primitives[0].type!=VEShapeType.Pushpin)this.Primitives[0].isLabel=true;if(this._shplayer==null||this._shplayer._mapGuid==null)return;this.Redraw(false,false,false,false,true)};VEShape.prototype.GetIconVisibility=function(){if(this.Primitives[0].type!=VEShapeType.Pushpin)return this.Primitives[0].isLabel;else return true};VEShape.prototype.GetPoints=function(){var d=[],b=this.Primitives[0].points,e=this.Primitives[0].altitudes,f=b.length;for(var a=0;a<f-1;a=a+2){var c=null;if(this.IsEncrypted())c=VEShape.LatLongFactory.CreateVELatLong(b[a+1],b[a]);else c=new VELatLong(b[a+1],b[a]);if(e)c.SetAltitude(e[a/2],this.Primitives[0].altitudeMode);d.push(c)}return d};VEShape.prototype.SetPoints=function(b){if(this.IsModel())return false;this._Construct(false,this.Primitives[0].type,b);if(this._shplayer!=null)this._shplayer.UpdateEntityAnnotation(this);var a=this.Primitives[0];Msn.Drawing.CalculateLabelPosition(a,true);if(this.Primitives[0].type!=VEShapeType.Pushpin){this.Latitude=a.labelPosY;this.Longitude=a.labelPosX;this.Altitude=a.labelPosZ}this.Redraw(true,true)};VEShape.prototype.SetTitle=function(a){if(typeof a!="undefined"&&a!=null){this._eroContent=null;this.Title=a.replace(/%0D%0A/g,"\r\n").replace(/%0A/g,"\n")}};VEShape.prototype.GetTitle=function(){if(typeof this.Title=="undefined")this.Title=L_AnnotationConfDefaultTitle_Text;return this.Title};VEShape.prototype.SetDescription=function(a){if(typeof a!="undefined"&&a!=null){this._eroContent=null;this.Notes=a.replace(/%0D%0A/g,"\r\n").replace(/%0A/g,"\n")}};VEShape.prototype.GetDescription=function(){if(typeof this.Notes=="undefined")this.Notes="";return this.Notes};VEShape.prototype.SetMaxZoomLevel=function(a){a=parseInt(a);if(isNaN(a)||a>21)throw new VEException("VEShape.SetMaxZoomLevel","err_incorrectzoomlevel",L_Shp_IncorrectZoomLevel_Text);else if(a<this.minZoomLevel)throw new VEException("VEShape.SetMaxZoomLevel","err_incorrectzoomlevel",L_Shp_IncorrectZoomLevel2_Text);this.maxZoomLevel=a;if(this.GetVisibility())this.Show()};VEShape.prototype.GetMaxZoomLevel=function(){return this.maxZoomLevel};VEShape.prototype.SetMinZoomLevel=function(a){a=parseInt(a);if(isNaN(a)||a<1)throw new VEException("VEShape.SetMinZoomLevel","err_incorrectzoomlevel",L_Shp_IncorrectZoomLevel_Text);else if(a>this.maxZoomLevel)throw new VEException("VEShape.SetMinZoomLevel","err_incorrectzoomlevel",L_invalidminmaxzoom_text);this.minZoomLevel=a;if(this.GetVisibility())this.Show()};VEShape.prototype.GetMinZoomLevel=function(){return this.minZoomLevel};VEShape.prototype.GetCustomIcon=function(){var a=null,b=this.Primitives[0].symbol;if(typeof b=="object"&&b.isOn==true){a=new VECustomIconSpecification;a.Image=b.imagedata_src;a.TextBold=b.textbox_bold;a.TextItalics=b.textbox_italic;a.TextUnderline=b.textbox_underscore;a.TextFont=b.textbox_font;a.TextSize=b.textbox_size;a.TextOffset=new VEPixel(b.textbox_OffsetX,b.textbox_OffsetY);a.ImageOffset=new VEPixel(b.img_offsetX,b.img_offsetY);a.CustomHTML=this._customIcon;a.TextContent=this.Primitives[0].name;a.ImageWidth=b.img_width;a.ImageHeight=b.img_height;var e=new VEHexStringToColor,d=b.textbox_color;if(d.indexOf("#")==0)d=d.substring(1);a.ForeColor=e.Convert(d);a.ForeColor.A=b.textbox_color_opacity;var c=b.textbox_backcolor;if(c.indexOf("#")==0)c=c.substring(1);a.BackColor=e.Convert(c);a.BackColor.A=b.textbox_backcolor_opacity}else a=this._customIcon;return a};VEShape.prototype.SetCustomIcon=function(b){if(typeof b=="undefined"||b==null)return null;if(typeof b=="object"){VEValidator.ValidateObject(b,"_content_",VECustomIconSpecification,"VECustomIconSpecification");if(typeof b.TextContent=="string"&&b.TextContent!=null)this.Primitives[0].name=b.TextContent;var a=this.Primitives[0].symbol;if(a.id==MC_PROPERTY_PARK||a.id==MC_PROPERTY_PUSHPIN)a=a.Clone();if(typeof b.Image=="string"&&b.Image!=null)a.imagedata_src=GetImageFullUrl(b.Image);else a.imagedata_src=Msn.VE.API.Constants.iconurl;var e=b.ForeColor;if(typeof e=="object"&&e!=null){VEValidator.ValidateObject(e,"fC",VEColor,"VEColor");a.textbox_color=VEColorToHexString(e.R,e.G,e.B,e.A);a.textbox_color_opacity=e.A}var d=b.BackColor;if(typeof d=="object"&&d!=null){VEValidator.ValidateObject(d,"bC",VEColor,"VEColor");a.textbox_backcolor=VEColorToHexString(d.R,d.G,d.B,d.A);a.textbox_backcolor_opacity=d.A}var g=b.TextOffset;if(typeof g=="object"&&g!=null){VEValidator.ValidateObject(g,"tO",VEPixel,"VEPixel");a.textbox_OffsetX=b.TextOffset.x;a.textbox_OffsetY=b.TextOffset.y}var f=b.ImageOffset;if(typeof f=="object"&&f!=null){VEValidator.ValidateObject(f,"iO",VEPixel,"VEPixel");a.img_offsetX=f.x;a.img_offsetY=f.y}if(b.TextBold)a.textbox_bold=true;if(b.TextItalics)a.textbox_italic=true;if(b.TextUnderline)a.textbox_underscore=true;var k=parseInt(b.ImageWidth);if(!isNaN(k))a.img_width=k;var j=parseInt(b.ImageHeight);if(!isNaN(j))a.img_height=j;a.textbox_font=b.TextFont;a.imagedata_on=true;var h=parseInt(b.TextSize);if(!isNaN(h))a.textbox_size=h;a.isOn=true;this.Primitives[0].symbol=a;if(b.CustomHTML!=null)this._customIcon=b.CustomHTML;else if(this.Primitives[0].name){var c=[];c.push("<div style='position:relative'>");c.push(" <div style='position:absolute;left:"+a.textbox_OffsetX+"px;top:"+a.textbox_OffsetY+"px;");c.push("font-size:"+a.textbox_size+"pt;font-family:"+a.textbox_font+";");c.push("color:"+a.textbox_color+";");if(a.textbox_italic)c.push("font-style:italic;");if(a.textbox_bold)c.push("font-weight:bold;");if(a.textbox_underscore)c.push("text-decoration:underline;");c.push("'>");if(this.Primitives[0].name)c.push(this.Primitives[0].name);c.push("</div>");c.push(" <img style='position:relative;top:"+a.img_offsetY+";left:"+a.img_offsetX+"' src='"+a.imagedata_src+"'' ");var i=Msn.VE.Environment.BrowserInfo;if(i.Type==Msn.VE.BrowserType.MSIE&&parseFloat(i.MajorVersion)<7&&a.imagedata_src!=null&&a.imagedata_src.search(/.gif$/)<0)c.push(' onload=\'this.onload="";if(this.fileSize!=-1){this.style.width=this.width;this.style.height=this.height;this.src="'+Msn.VE.API.Constants.spacerurl+'";this.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\\"'+a.imagedata_src+'\\", sizingMethod=\\"scale\\")";}\' />');else c.push("/>");c.push("</div>");this._customIcon=c.join("")}else this._customIcon=a.imagedata_src}else if(typeof b=="string"){this._customIcon=b;if(b.indexOf("<")<0){var a=this.Primitives[0].symbol;if(a.id==MC_PROPERTY_PARK||a.id==MC_PROPERTY_PUSHPIN)a=a.Clone();a.imagedata_src=GetImageFullUrl(b);a.isOn=true;this.Primitives[0].symbol=a}}this._IconContent=null;this.Redraw(false,false,false,true)};VEShape.prototype.GetIconAnchor=function(){if(this.Altitude)return new VELatLong(this.Latitude,this.Longitude,this.Altitude,this.Primitives[0].altitudeMode);else return new VELatLong(this.Latitude,this.Longitude)};VEShape.prototype.SetIconAnchor=function(a){if(this.IsModel())return false;if(a!=null&&a!="undefined"){VEValidator.ValidateObject(a,"veLatlong",VELatLong,"VELatLong");if(a.HasAltitude()&&a.AltitudeMode!=this.Primitives[0].altitudeMode)throw new VEException("VEShape","err_altitudemodemismatch",L_altitudemodemismatch_Text);var b=this.Primitives[0];if(b.type!=VEShapeType.Pushpin){this.Latitude=a.Latitude;this.Longitude=a.Longitude;b.labelPosX=this.Longitude;b.labelPosY=this.Latitude;if(a.HasAltitude()){this.Altitude=a.Altitude;b.labelPosZ=a.Altitude}else{this.Altitude=null;b.labelPosZ=null}}}this.Redraw(false,true)};VEShape.prototype.GetCustomInfoBox=function(){return this._eroContent};VEShape.prototype.SetCustomInfoBox=function(a){if(typeof a!="undefined"&&a!=null)this._eroContent=a.replace(/%0D%0A/g,"\r\n").replace(/%0A/g,"\n")};VEShape.prototype.SetZIndex=function(c,b){if(c!=null)VEValidator.ValidateInt(c,"icon");if(b!=null)VEValidator.ValidateInt(b,"polyshape");if(c==null&&b==null)throw new VEException("VEShape.SetZIndex","L_invalidzindex_text",L_invalidzindex_text);var a=this.Primitives[0].symbol;if(a.id==MC_PROPERTY_PARK||a.id==MC_PROPERTY_PUSHPIN)a=a.Clone();if(c!=null)a.style_zIndex=parseInt(c);if(b!=null)a.style_zIndex_polyshape=parseInt(b);this.Primitives[0].symbol=a;this.Redraw(false,false,true,true)};VEShape.prototype.GetZIndex=function(){if(this.Primitives[0].symbol!=null&&this.Primitives[0].symbol.style_zIndex!=null)return this.Primitives[0].symbol.style_zIndex;else return Msn.VE.API.Globals.veshapeiconzindex};VEShape.prototype.GetZIndexPolyShape=function(){if(this.Primitives[0].symbol!=null&&this.Primitives[0].symbol.style_zIndex_polyshape!=null)return this.Primitives[0].symbol.style_zIndex_polyshape;else return Msn.VE.API.Globals.veshapepolyshapezindex};VEShape.prototype.SetLineColor=function(a){if(this.Primitives[0].type==VEShapeType.Pushpin)return false;if(typeof a=="object"&&a!=null){VEValidator.ValidateObject(a,"_color",VEColor,"VEColor");var b=this.Primitives[0].symbol;if(b.id==MC_PROPERTY_PARK||b.id==MC_PROPERTY_PUSHPIN)b=b.Clone();b.stroke_color=VEColorToHexString(a.R,a.G,a.B,a.A);b.stroke_opacity=a.A;this.Primitives[0].symbol=b;this.Redraw(false,false,true,false)}else if(typeof a!="undefined")throw new VEException("SetLineColor","err_invalidargument",L_invalidargument_text.replace("%1","color").replace("%2","VEColor"))};VEShape.prototype.GetLineColor=function(){if(this.Primitives[0].type==VEShapeType.Pushpin)return null;var c=this.Primitives[0].symbol,e=new VEHexStringToColor,a=c.stroke_color;if(a.indexOf("#")==0)a=a.substring(1);var b=e.Convert(a),d=c.stroke_opacity.toString();if(d.indexOf("%")>0)b.A=parseInt(d)/100;else b.A=c.stroke_opacity;return b};VEShape.prototype.SetFillColor=function(a){if(this.Primitives[0].type==VEShapeType.Pushpin)return false;if(typeof a=="object"&&a!=null){VEValidator.ValidateObject(a,"_color",VEColor,"VEColor");var b=this.Primitives[0].symbol;if(b.id==MC_PROPERTY_PARK||b.id==MC_PROPERTY_PUSHPIN)b=b.Clone();b.fill_color=VEColorToHexString(a.R,a.G,a.B,a.A);b.fill_opacity=a.A;this.Primitives[0].symbol=b;this.Redraw(false,false,true,false)}else if(typeof a!="undefined")throw new VEException("SetFillColor","err_invalidargument",L_invalidargument_text.replace("%1","color").replace("%2","VEColor"))};VEShape.prototype.GetFillColor=function(){if(this.Primitives[0].type==VEShapeType.Pushpin)return null;var c=this.Primitives[0].symbol,e=new VEHexStringToColor,a=c.fill_color;if(a.indexOf("#")==0)a=a.substring(1);var b=e.Convert(a),d=c.fill_opacity.toString();if(d.indexOf("%")>0)b.A=parseInt(d)/100;else b.A=c.fill_opacity;return b};VEShape.prototype.SetLineWidth=function(c){if(this.Primitives[0].type==VEShapeType.Pushpin)throw new VEException("VEShape.SetLineWidth","err_invalidlinewidth",L_Shp_IncorrectLineWidth_Text);var b=parseInt(c);if(isNaN(b)||b<1)throw new VEException("VEShape.SetLineWidth","err_invalidlinewidth",L_Shp_IncorrectLineWidth_Text);var a=this.Primitives[0].symbol;if(a.id==MC_PROPERTY_PARK||a.id==MC_PROPERTY_PUSHPIN)a=a.Clone();a.stroke_weight=b;this.Primitives[0].symbol=a;this.Redraw(false,false,true,false)};VEShape.prototype.GetDashStyle=function()
{if(this.Primitives[0].type==VEShapeType.Pushpin)return null;return this.Primitives[0].symbol.stroke_dashstyle;};VEShape.prototype.SetDashStyle=function(d)
{if(this.Primitives[0].type==VEShapeType.Pushpin)throw new VEException("VEShape.SetLineWidth","err_invalidlinewidth",L_Shp_IncorrectLineWidth);var b=d;var a=this.Primitives[0].symbol;if(a.id==MC_PROPERTY_PARK||a.id==MC_PROPERTY_PUSHPIN)a=a.Clone();a.stroke_dashstyle=b;this.Primitives[0].symbol=a;this.Redraw(false,false,true,false)};VEShape.prototype.GetLineWidth=function(){if(this.Primitives[0].type==VEShapeType.Pushpin)return null;var a=parseInt(this.Primitives[0].symbol.stroke_weight);if(isNaN(a))return 0;else return a};VEShape.prototype.SetPhotoURL=function(a){this._eroContent=null;this.PhotoUrl=a};VEShape.prototype.GetPhotoURL=function(){return this.PhotoUrl};VEShape.prototype.SetLocalID=function(a){this.LocalID=a};VEShape.prototype.GetLocalID=function(){return this.LocalID};VEShape.prototype.SetMoreInfoURL=function(a){this._eroContent=null;this.Url=a};VEShape.prototype.GetMoreInfoURL=function(){return this.Url};VEShapeLayer.prototype.GetBoundingRectangle=function(){var a=this.GetBoundingBox();return new VELatLongRectangle(new VELatLong(a.y2,a.x1),new VELatLong(a.y1,a.x2))};VEShape.prototype._OffsetScene=null;VEShape.prototype._OffsetLatLong=null;VEShape.prototype._OffsetPoints=null;VEShape.prototype._OriginalPoints=null;VEShape.prototype._UsingOffset=false;VEShape.prototype.SetUseOffset=function(b){if(this._UsingOffset!=b){this._UsingOffset=b;if(b){if(this._OffsetPoints!=null){var a=[];for(var c=0;c<this._OffsetPoints.length;c++){var d=VEShape.Decoder.Decode(this._OffsetPoints[c]);a.push(d.Longitude);a.push(d.Latitude)}this._OriginalPoints=this.Primitives[0].points;this.Primitives[0].points=a}}else if(this._OriginalPoints!=null){this.Primitives[0].points=this._OriginalPoints;this._OriginalPoints=null}}};VEShape.prototype.GetUseOffset=function(){return this._UsingOffset};VEAltitudeMode=new function(){this.Default="Ground";this.Absolute="Datum";this.RelativeToGround="Ground"};VEShape.prototype.SetAltitude=function(a,f){if(this.IsModel())return false;var b=this.Primitives[0],d=b.points.length/2,e=[];if(typeof a=="number"){VEValidator.ValidateFloat(a,"altitude");a=parseFloat(a);for(var c=0;c<d;c++)e.push(a)}else if(a instanceof Array)if(a.length==d&&(a[0]==a[d-1]||this.Primitives[0].type!=VEShapeType.Polygon)||a.length==d-1&&this.Primitives[0].type==VEShapeType.Polygon){for(var c=0;c<a.length;c++){VEValidator.ValidateFloat(a[c],"altitude["+c+"]");e.push(parseFloat(a[c]))}if(a.length==d-1)e.push(parseFloat(a[0]))}else throw new VEException("VEShape","err_incorrectpoints",L_Shp_IncorrectPoints_Text);else throw new VEException("VEShape:SetAltitude","err_invalidargument",L_invalidargument_text.replace("%1","altitude").replace("%2","float"));if(f!=null){VEValidator.ValidateAltitudeMode(f,"altitudeMode");b.altitudeMode=f}b.altitudes=e;Msn.Drawing.CalculateLabelPosition(b,true);if(b.type!=VEShapeType.Pushpin){this.Latitude=b.labelPosY;this.Longitude=b.labelPosX;this.Altitude=b.labelPosZ}this.Redraw(false,true)};VEShape.prototype.GetAltitude=function(){return this.Primitives[0].altitudes};VEShape.prototype.SetAltitudeMode=function(b){if(this.IsModel())return false;VEValidator.ValidateAltitudeMode(b,"value");var a=this.Primitives[0];a.altitudeMode=b;if(!a.altitudes)this.SetAltitude(0);this.Redraw(true,true)};VEShape.prototype.GetAltitudeMode=function(){return this.Primitives[0].altitudeMode};VEShape.prototype.SetLineToGround=function(a){if(this.IsModel())return false;VEValidator.ValidateBoolean(a,"value");if(this.Primitives[0].type!=VEShapeType.Pushpin){this.Primitives[0].extruded=a;this.Redraw(true,true)}};VEShape.prototype.GetLineToGround=function(){if(this.Primitives[0].extruded!=null)return this.Primitives[0].extruded;else return null};VEShape.prototype.ToHtml=function(){var a=[],b=GetVEMapInstance(this._shplayer._mapGuid);if(b&&b.vemapcontrol){var c=b.vemapcontrol.GetPushpinMapPixel(new Msn.VE.LatLong(this.Latitude,this.Longitude),b.vemapcontrol.GetZoomLevel());a.push("<a href='javascript://pushpin hover' class=VEAPI_Pushpin id=");a.push(this.Primitives[0].type==VEShapeType.Pushpin?this.Primitives[0].iid:Msn.Drawing.GetLabelUID(this.Primitives[0].iid));a.push(' style="z-index=');a.push(this.GetZIndex());a.push(";position:absolute;left:");a.push(c.x-25/2);a.push("px;top:");a.push(c.y-25/2);a.push('px;">');a.push(VECreateVEShapeERO(this,this._shplayer._mapGuid));a.push("</a>")}return a.join("")};VEShape.prototype._isDrawn=false;VEShape.prototype._isHiddenForZoom=false;VEShape.prototype.GetShapeElement=function(){var a=this.Primitives[0];if(this._isDrawn&&a&&a.type!=VEShapeType.Pushpin){if(a._shapeElement==null)a._shapeElement=$ID(a.iid);return a._shapeElement}return null};VEShape.prototype.GetIconElement=function(){var a=this.Primitives[0];if(this._isDrawn&&a){if(a._iconElement==null)if(a.type==VEShapeType.Pushpin)a._iconElement=$ID(a.iid);else a._iconElement=$ID(Msn.Drawing.GetLabelUID(a.iid));return a._iconElement}return null};VEShape.prototype.ClearDomElements=function(){var a=this.Primitives[0];if(a){a._shapeElement=null;a._iconElement=null}};VEShape.prototype.DisposeEx=function(){this.ClearDomElements();this.Dispose()};VEShape.prototype.SetActions=function(a)
{if(typeof a!="undefined"&&a!=null)
this.Actions=a.replace(/%0D%0A/g,"\r\n").replace(/%0A/g,"\n")};function VECustomIconSpecification(){this.Image=null;this.TextContent=null;this.CustomHTML=null;this.textFont="Arial";this.TextBold=false;this.TextItalics=false;this.TextUnderline=false;this.TextSize=7;this.ImageOffset=null;this.TextOffset=null;this.ForeColor=null;this.BackColor=null;this.ImageWidth=-1;this.ImageHeight=-1}VE_SetModuleStatus(VE_ModuleName.APILAYERS,"loaded");VEMap.prototype.InitMapDrawing=function(){cssCursors=Msn.VE.Css.Cursors;if(VE_MapDispatch_SymbolLib==null){VE_MapDispatch_SymbolLib=new VEShapeStyleLibrary;VEShapeStyle.prototype.imagedata_src=Msn.VE.API.Constants.iconurl}if(this.m_velayermanager==null){this.m_velayermanager=new VELayerManager(this);this._lm=this.m_velayermanager}};VEMap.prototype.InitTiles=function(){if(!this.m_vetilesourcemanager)this.m_vetilesourcemanager=new VETileSourceManager(this)};VEMap.prototype.AddTileLayer=function(a,b,c){VEValidator.ValidateObject(a,"tileSourceSpec",VETileSourceSpecification,"VETileSourceSpecification");this.m_vetilesourcemanager.AddTileSource(a,c,b)};VEMap.prototype.ShowTileLayer=function(a){this.m_vetilesourcemanager.ShowTileLayer(a)};VEMap.prototype.ShowAllTileLayers=function(){this.m_vetilesourcemanager.ShowAllTileLayers()};VEMap.prototype.HideTileLayer=function(a){this.m_vetilesourcemanager.HideTileLayer(a)};VEMap.prototype.ShowBaseTileLayer=function(){this.m_vetilesourcemanager.ShowBaseTileLayer()};VEMap.prototype.HideBaseTileLayer=function(){this.m_vetilesourcemanager.HideBaseTileLayer()};VEMap.prototype.HideAllTileLayers=function(){this.m_vetilesourcemanager.HideAllTileLayers()};VEMap.prototype.DeleteTileLayer=function(a){this.m_vetilesourcemanager.DeleteSourceById(a)};VEMap.prototype.DeleteAllTileLayers=function(){this.m_vetilesourcemanager.DeleteAllSources()};VEMap.prototype.GetTileLayerCount=function(){return this.m_vetilesourcemanager.GetSourceCount()};VEMap.prototype.GetTileLayerByID=function(a){return this.m_vetilesourcemanager.GetSourceById(a)};VEMap.prototype.GetTileLayerByIndex=function(a){return this.m_vetilesourcemanager.GetSourceByIndex(a)};function VETileSourceSpecification(h,i,d,g,f,e,c,a,b){this.ID=null;this.TileSource=null;this.NumServers=1;this.Bounds=null;this.MinZoomLevel=0;this.MaxZoomLevel=1;this.GetTilePath=null;this.Opacity=null;this.ZIndex=null;this.SetsBestMapView=true;this.FnCallback=null;this.IsVisible=true;if(typeof h=="string")this.ID=h;else throw new VEException("VETileSourceSpecification","err_invalidargument",L_invalidargument_text.replace("%1","ID").replace("%2","string"));if(typeof i=="string")this.TileSource=i.replace(/%20/g," ");else throw new VEException("VETileSourceSpecification","err_invalidargument",L_invalidargument_text.replace("%1","tileSource").replace("%2","string"));if(d!="undefined"&&d!=null)this.NumServers=d;if(g!="undefined"&&g!=null)this.Bounds=g;if(f!="undefined"&&f!=null)this.MinZoomLevel=f;if(e!="undefined"&&e!=null)this.MaxZoomLevel=e;if(c!="undefined"&&c!=null)this.GetTilePath=c;if(a!="undefined"&&a!=null){VEValidator.ValidateFloat(a,"Opacity");if(a<0||a>1)throw new VEException("VEMap:AddTileLayer","err_invalidOpacity",L_invalidopacity_text);this.Opacity=a}if(b!="undefined"&&b!=null){VEValidator.ValidateInt(b,"ZIndex");this.ZIndex=b}else this.ZIndex=Msn.VE.API.Globals.vetilelayerdefaultzindex}function VETileSourceManager(a){var b=this;VEValidator.ValidateNonNull(a,"vemap");this.m_vemap=a;this.m_vemapcontrol=this.m_vemap.vemapcontrol;this.m_vetilesources=[];this.AddTileSource=function(a,d,c){VEValidator.ValidateObject(a,"tileSourceSpec",VETileSourceSpecification,"VETileSourceSpecification");VEValidator.ValidateNonNull(a.ID,"tileSourceSpec.ID");if(a.MinZoomLevel!=null)VEValidator.ValidateNonNegativeInt(a.MinZoomLevel,"tileSourceSpec.MinZoomLevel");if(a.MaxZoomLevel!=null){VEValidator.ValidateNonNegativeInt(a.MaxZoomLevel,"tileSourceSpec.MaxZoomLevel");VEValidator.ValidateMaxZoom(a.MaxZoomLevel,"tileSourceSpec.MaxZoomLevel")}if(a.MinZoomLevel!=null&&a.MaxZoomLevel!=null)if(a.MinZoomLevel>a.MaxZoomLevel)throw new VEException("VETileSourceManager:AddVETileSource","err_invalidsourceid",L_invalidminmaxzoom_text);if(a.Bounds){var e=a.Bounds.length;for(var b=0;b<e;b++)VEValidator.ValidateBounds(a.Bounds[b],"VETileSourceManager.Bounds["+b+"]")}if(typeof d=="function")a.FnCallback=d;if(typeof c!="undefined"&&(c=="false"||!c))a.IsVisible=false;this.AddVETileSourceSpec(a)};this.AddVETileSourceSpec=function(b){var c=this.GetSourceById(b.ID);if(c!=null&&c!="undefined")throw new VEException("VETileSourceManager:AddVETileSource","err_invalidsourceid",L_invalidsourceid_text);this.m_vetilesources.push(b);a.vemapcontrol.SetTileSource(b);if(b.IsVisible)a.vemapcontrol.LoadTileLayer(b.ID,b.ID,b.Opacity,b.ZIndex);if(b.FnCallback)b.FnCallback(b)};this.GetSourceById=function(c){var b=this.m_vetilesources.length;for(var a=0;a<b;++a)if(this.m_vetilesources[a].ID==c)return this.m_vetilesources[a];return null};this.GetSourceCount=function(){return this.m_vetilesources.length};this.GetSourceByIndex=function(b){var a=null;if(this.m_vetilesources&&this.m_vetilesources[b])a=this.m_vetilesources[b];return a};this.ShowTileLayer=function(c){if(this.m_vetilesources==null||this.m_vetilesources=="undefined"){throw new VEException("VEMap:RemoveSourcebyId","err_GraphicsInitError",L_GraphicsInitError_Text);return}var b=this.GetSourceById(c);if(b){b.IsVisible=true;a.vemapcontrol.SetTileLayerVisibility(b.ID,true);a.vemapcontrol.LoadTileLayer(b.ID,b.ID,b.Opacity,b.ZIndex)}else{throw new VEException("VEMap:HideSourcebyId","err_invalidsourceid",L_invalidsourceid_text);return}};this.ShowAllTileLayers=function(){if(this.m_vetilesources==null||this.m_vetilesources=="undefined"){throw new VEException("VEMap:HideAllTileLayersbyId","err_GraphicsInitError",L_GraphicsInitError_Text);return}var b=this.m_vetilesources.length;for(var a=0;a<b;++a)this.ShowTileLayer(this.m_vetilesources[a].ID)};this.HideAllTileLayers=function(){if(this.m_vetilesources==null||this.m_vetilesources=="undefined"){throw new VEException("VEMap:HideAllTileLayersbyId","err_GraphicsInitError",L_GraphicsInitError_Text);return}var b=this.m_vetilesources.length;for(var a=0;a<b;++a)this.HideTileLayer(this.m_vetilesources[a].ID)};this.HideTileLayer=function(c){if(this.m_vetilesources==null||this.m_vetilesources=="undefined"){throw new VEException("VEMap:RemoveSourcebyId","err_GraphicsInitError",L_GraphicsInitError_Text);return}var b=this.GetSourceById(c);if(b){b.IsVisible=false;a.vemapcontrol.SetTileLayerVisibility(b.ID,false);a.vemapcontrol.LoadTileLayer(b.ID,b.ID,b.Opacity,b.ZIndex)}else{throw new VEException("VEMap:HideSourcebyId","err_invalidsourceid",L_invalidsourceid_text);return}};this.HideBaseTileLayer=function(){a.vemapcontrol.HideBaseTileLayer()};this.ShowBaseTileLayer=function(){a.vemapcontrol.ShowBaseTileLayer()};this.DeleteSourceById=function(b){if(this.m_vetilesources==null||this.m_vetilesources=="undefined"){throw new VEException("VEMap:RemoveSourcebyId","err_GraphicsInitError",L_GraphicsInitError_Text);return}var c=this.m_vetilesources.length,a=0;while(a<c&&b!=this.m_vetilesources[a].ID)a++;if(a<c){this.m_vemapcontrol.ClearTileLayer(b);this.m_vemapcontrol.DeleteTileSource(b);this.m_vetilesources[a]=null;this.m_vetilesources.splice(a,1)}else{throw new VEException("VEMap:RemoveSourcebyId","err_invalidsourceid",L_invalidsourceid_text);return}};this.Dispose=function(){this.DeleteAllSources();this.m_vetilesources=null;this.m_vemapcontrol=null;this.m_vemap=null};this.DeleteAllSources=function(){if(this.m_vetilesources==null||this.m_vetilesources=="undefined"){throw new VEException("VEMap:RemoveSourcebyId","err_GraphicsInitError",L_GraphicsInitError_Text);return}var b=this.m_vetilesources.length;for(var a=0;a<b;++a)if(this.m_vetilesources[a]){this.m_vemapcontrol.ClearTileLayer(this.m_vetilesources[a].ID);this.m_vemapcontrol.DeleteTileSource(this.m_vetilesources[a].ID);this.m_vetilesources[a]=null}this.m_vetilesources=[]}}VE_SetModuleStatus(VE_ModuleName.APITILES,"loaded");VEMap.prototype.InitSearch=function(){if(!this.m_vesearchmanager){this.m_vesearchmanager=new VE_SearchManager(this);this.m_vesearchmanager.Initialize();this._sm=this.m_vesearchmanager}};VEMap.prototype.Find=function(l,j,i,f,g,b,e,d,a,c,h){this.InitSearch();var k=new VEFindSpec(l,j,i,f,g,b,e,d,a,c,h);this.m_vesearchmanager.Find(k)};VEMap.prototype.FindLocations=function(a,b){VEValidator.ValidateObject(a,"veLatLong",VELatLong,"VELatLong");this.InitSearch();this.m_vesearchmanager.ReverseGeocode(a,b)};VEMap.prototype.CreateFindControl=function(b){VEValidator.ValidateNonNull(b,"findControlId");el=document.createElement("div");el.className="VE_FindControl";el.id=b;el.style.zIndex=199;el.style.position="absolute";el.style.padding="5px";function a(a){a.cancelBubble=true}el.attachEvent("onmousedown",a);el.attachEvent("onmouseup",a);el.attachEvent("onmousemove",a);el.attachEvent("onmousewheel",a);el.attachEvent("ondblclick",a);el.attachEvent("oncontextmenu",a);el.attachEvent("onclick",a);var c=this.ID+"_vewhatinputcontainer",e=this.ID+"_vewhatinput",d=this.ID+"_vewhereinput";el.innerHTML="<div class=VE_WhatControl id='"+c+"'>"+L_what_text+" "+'<input id="'+e+'" type="text" name="vewhatinput" size="25" onfocus="this.select()" onblur="this.value = this.value" />'+"</div>"+"<div class=VE_WhereControl>"+L_where_text+" "+'<input id="'+d+'" type="text" name="vewhereinput" size="25" style="color: #333333"'+"ondrop=\"this.value='';this.style.color='black';SelectText(this,0,0);\" />"+"</div>"+"<div class=VE_FindButton>"+'<button id="searchbttn" onclick="VEMap._GetMapFromGUID('+this.GUID+')._DoFind();" type="submit" name="submit" value="Local Search">'+L_find_text+"</button>"+"</div>";this.mapelement.appendChild(el);addIFrameShim(el);if(el.shimElement)el.shimElement.className="VE_FindControl_Iframe";return el};VEMap.prototype.ShowFindControl=function(c,b){if(typeof c!="undefined"||typeof b!="undefined"){VEValidator.ValidateInt(c,"top");VEValidator.ValidateInt(b,"left")}var d=this.ID+"_vefindcontrolinput",a=$ID(d);if(typeof a=="undefined"||a==null)a=this.CreateFindControl(d);if(isNaN(c))a.style.top="35px";else a.style.top=c+"px";if(isNaN(b))a.style.left="195px";else a.style.left=b+"px";a.style.display="block";ShowShim(a)};VEMap.prototype.HideFindControl=function(){var a=$ID(this.ID+"_vefindcontrolinput");if(a!=null&&a!="undefined"){a.style.display="none";HideShim(a)}};VEMap.prototype.SetFindResultsPanel=function(a){if(a==null||a=="undefined")throw new VEException("VEMap:SetFindResultsPanel","err_invalidelement",L_invalidelement_text);var b=$ID(a);if(b==null||b=="undefined")throw new VEException("VEMap:SetFindResultsPanel","err_invalidelement",L_invalidelement_text);this.searchelement=a};function VEMatchCode(){}VEMatchCode.None=0;VEMatchCode.Good=1;VEMatchCode.Ambiguous=2;VEMatchCode.UpHierarchy=4;VEMatchCode.Modified=8;function VEMatchConfidence(){}VEMatchConfidence.High=0;VEMatchConfidence.Medium=1;VEMatchConfidence.Low=2;function VELocationPrecision(){}VELocationPrecision.Interpolated=0;VELocationPrecision.Rooftop=1;function VEGeocodeLocation(b,a){this.LatLong=b;this.Precision=a}function VEPlace(e,d,b,a,c,g,f){VEValidator.ValidateNonNull(e,"name");VEValidator.ValidateNonNull(d,"velatLong");this.Name=e;this.LatLong=d;if(typeof b!="undefined"&&b!=null)this.LatLongRect=b;else this.LatLongRect=null;this.Score=a;this.MatchConfidence=typeof a!="undefined"?a:null;this.MatchCode=typeof c!="undefined"?c:null;this.Precision=g;this.Locations=f}function VEFindSpec(k,a,j,g,h,b,f,e,c,d,i){this.What="";if(k!=null){if(typeof k!="string")throw new VEException("VEMap.Find","err_invalidargument",L_invalidargument_text.replace("%1","what").replace("%2","string"));this.What=IOSec.EncodeUrl(k)}this.Where="";this.WhereRect=null;this.WherePlace=null;this.WhereLatLong=null;if(a!=null){if(a instanceof VELatLongRectangle)this.WhereRect=a;else if(a instanceof VEPlace){this.WhereLatLong=a.LatLong;this.WhereRect=a.LatLongRect;this.WherePlace=a}else if(a instanceof VELatLong)this.WhereLatLong=a;else if(typeof a=="string")this.Where=IOSec.EncodeUrl(a);else throw new VEException("VEMap.Find","err_invalidargument",L_invalidwhere_text);if(this.WhereLatLong&&!this.WhereRect)this.WhereRect=new VELatLongRectangle(new VELatLong(this.WhereLatLong.Latitude+1,this.WhereLatLong.Longitude-1),new VELatLong(this.WhereLatLong.Latitude-1,this.WhereLatLong.Longitude+1));else this.WhereLatLong=null}if(this.What==""&&this.Where=="")throw new VEException("VEMap.Find","err_invalidwhatwhere",L_invalidwhatwhere_text);this.FindType=VEFindType.Businesses;if(j!=null)if(j==VEFindType.Businesses)this.FindType=j;else throw new VEException("VEMap.Find","err_invalidargument",L_invalidargument_text.replace("%1","findType").replace("%2","VEFindType"));this.ShapeLayer=null;if(g!=null){VEValidator.ValidateObject(g,"shapeLayer",VEShapeLayer,"VEShapeLayer");this.ShapeLayer=g}this.StartIndex=0;if(h!=null){VEValidator.ValidateNonNegativeInt(h,"startIndex");this.StartIndex=parseInt(h)}this.NumberOfResults=Msn.VE.API.Globals.vefindnumresultsdefault;if(b!=null){VEValidator.ValidateInt(b);b=parseInt(b);VEValidator.ValidateBetween(b,"numberOfResults",Msn.VE.API.Globals.vefindnumresultsmin,Msn.VE.API.Globals.vefindnumresultsmax);this.NumberOfResults=b}this.ShowResults=true;if(f!=null){VEValidator.ValidateBoolean(f,"showResults");this.ShowResults=f}this.CreateResults=true;if(e!=null){VEValidator.ValidateBoolean(e,"createResults");this.CreateResults=e}this.UseDefaultDisambiguation=true;if(c!=null){VEValidator.ValidateBoolean(c,"useDefaultDisambiguation");this.UseDefaultDisambiguation=c}this.SetBestMapView=true;if(d!=null){VEValidator.ValidateBoolean(d,"setBestMapView");this.SetBestMapView=d}this.Callback=null;if(i!=null)if(typeof i=="function")this.Callback=i;else throw new VEException("VEMap.Find","err_invalidargument",L_invalidargument_text.replace("%1","callback").replace("%2","function"))}function VEFindResults(a,c,b){this.ShapeLayer=a;this.Results=c;this.HasMore=b}function VEFindResult(a,d,e,b,f,c,g){VEValidator.ValidateNonNull(a,"findType");VEValidator.ValidateNonNull(e,"name");VEValidator.ValidateNonNull(b,"description");VEValidator.ValidateNonNull(c,"isSponsored");this.findType=a;this.FindType=a;this.shape=d;this.Shape=d;this.Name=e;this.Description=b;this.LatLong=f;this.IsSponsored=c;this.Phone=g}VEFindType=new function(){this.Businesses="YellowPageSearch"};function VE_SearchManager(i){VEValidator.ValidateObject(i,"vemap",VEMap,"VEMap");this.m_vemap=i;var d=this,b=new VELatLongFactory(new VELatLongFactorySpecFromMap(this.m_vemap));this.m_showDisambigousDialog=true;this._DisambiguateCallback="VEMap._GetMapFromGUID("+i.GUID+")._sm.FindAmbiguousListCallBack";var h=new _xy1,k=1,a=null,e=true,g=null,j=null,f=null,c=null;this.Initialize=function(){};this.Find=function(l){var b=[];if(this.m_vemap.HasClientToken())b.push(new VEParameter(Msn.VE.API.Constants.clienttoken,this.m_vemap.ClientToken));a=l;e=true;c=null;g=null;j=null;f=null;if(l.What.length>0){b.push(new VEParameter(Msn.VE.API.Constants.market,Msn.VE.API.Globals.locale));b.push(new VEParameter(Msn.VE.API.Constants.mapguid,this.m_vemap.GUID));var u=l.What;if(u.length>0)u+=" -location:jp";b.push(new VEParameter("a",u));b.push(new VEParameter("b",l.Where));b.push(new VEParameter("t",l.FindType));if(!l.SetBestMapView)b.push(new VEParameter("smv",l.SetBestMapView));var n=0,o=0,p=0,q=0;if(l.WhereRect){var t=h.Decode(l.WhereRect.TopLeftLatLong),s=h.Decode(l.WhereRect.BottomRightLatLong);n=t.Latitude;o=s.Longitude;p=s.Latitude;q=t.Longitude}else{var r=this.m_vemap.GetMapView();if(r&&r.TopLeftLatLong&&r.BottomRightLatLong){var t=h.Decode(r.TopLeftLatLong),s=h.Decode(r.BottomRightLatLong);n=t.Latitude;o=s.Longitude;p=s.Latitude;q=t.Longitude}else return}if(n<p){var z=n;n=p;p=z}if(o<q){var z=o;o=q;q=z}b.push(new VEParameter("c",n));b.push(new VEParameter("d",o));b.push(new VEParameter("e",p));b.push(new VEParameter("ff",q));if(l.What.length>0){b.push(new VEParameter("g",l.StartIndex));b.push(new VEParameter("dc",l.NumberOfResults));var A=k++;b.push(new VEParameter("i",A));var B=2;b.push(new VEParameter("r",B))}if(l.ShapeLayer==null)l.ShapeLayer=i.GetShapeLayerByIndex(0);if(l.What==""&&l.WhereLatLong!=null){var v=[];v.push(l.WhereLatLong);this.m_vemap.SetMapView(v);this.FireFindCallback()}else{var w=new VENetwork;w.ServiceUrl=Msn.VE.API.Constants.searchservice;this.m_vemap.vemapcontrol.Fire("onstartrequest");w.BeginInvoke(null,b,null)}}else{var x="",m=null;if(this.m_vemap.vemapcontrol.IsMapViewOblique()){var y=this.m_vemap.GetBirdseyeScene();if(y)m=y.GetBoundingRectangleNorthFacing()}else m=this.m_vemap.GetMapView();if(m&&m.TopLeftLatLong&&m.BottomRightLatLong)x=m.TopLeftLatLong.Latitude+", "+m.BottomRightLatLong.Longitude+", "+m.BottomRightLatLong.Latitude+", "+m.TopLeftLatLong.Longitude;b.push(new VEParameter("count",""));b.push(new VEParameter("query",'"'+l.Where+'"'));b.push(new VEParameter("landmark",""));b.push(new VEParameter("addressLine",""));b.push(new VEParameter("locality",""));b.push(new VEParameter("postalTown",""));b.push(new VEParameter("adminDistrict",""));b.push(new VEParameter("district",""));b.push(new VEParameter("postalCode",""));b.push(new VEParameter("countryRegion",""));b.push(new VEParameter("mapBounds",'"'+x+'"'));b.push(new VEParameter("currentLocation",""));b.push(new VEParameter("curLocAccuracy",""));b.push(new VEParameter("entityTypes",""));b.push(new VEParameter("rankBy",""));this.m_vemap.vemapcontrol.Fire("onstartrequest");VEAPIRequestInvoke(Msn.VE.API.Constants.geocodingservice+"/Geocode",b,d.GeocodeResponseHandler)}};this.GeocodeResponseHandler=function(c){d.m_vemap.vemapcontrol.Fire("onendrequest");d.m_vemap.__HandleAuthentication(c);if(c&&c.Results&&c.Results.length>0){if(a.SetBestMapView){var e=c.Results[0].BestView;d.m_vemap.SetViewport(e.NorthEastCorner.Latitude,e.NorthEastCorner.Longitude,e.SouthWestCorner.Latitude,e.SouthWestCorner.Longitude)}var l=c.Results[0].MatchConfidence,m=c.Results.length,f=[],k=[];for(var i=0;i<m;++i){var b=c.Results[i],g=[];if(b.Locations&&b.Locations.length)for(var j=0;j<b.Locations.length;++j){var h=b.Locations[j];g.push(new VEGeocodeLocation(new VELatLong(h.Coordinates.Latitude,h.Coordinates.Longitude),h.Precision))}if(b.MatchConfidence==l)f.push([b.Name,b.BestView.NorthEastCorner.Latitude,b.BestView.NorthEastCorner.Longitude,b.BestView.SouthWestCorner.Latitude,b.BestView.SouthWestCorner.Longitude,b.BestLocation.Coordinates.Latitude,b.BestLocation.Coordinates.Longitude,b.MatchConfidence,b.MatchCode,b.BestLocation.Precision,g]);k.push([b.Name,b.BestLocation.Coordinates.Latitude,b.BestLocation.Coordinates.Longitude,b.MatchConfidence,b.BestView.NorthEastCorner.Latitude,b.BestView.NorthEastCorner.Longitude,b.BestView.SouthWestCorner.Latitude,b.BestView.SouthWestCorner.Longitude,b.MatchCode,b.BestLocation.Precision,g])}if(f.length>1)d.UpdateAmbiguousList(f);d.SearchCallback(k)}else d._HandleFailedWhereSearch(L_invalidsearchlocation_Text)};this._HandleFailedWhereSearch=function(a){this.m_vemap.vemapcontrol.Fire("onendrequest");if(a!=null){c=a.replace(/%1/g,MapControl.Features.PlatformName);this.FireFindCallback()}};this._ApplyResults=function(t,h,f,s,n){this.m_vemap.vemapcontrol.Fire("onendrequest");if(Msn.VE.API.Globals.veiscommercialcontrol);else{var k=[],m=[],r=a.ShapeLayer;if(h!=null)for(var d=0;d<h.length;d++){var e=null,p=b.CreateVELatLong(h[d].latitude,h[d].longitude);if(a.CreateResults){e=new VEShape(VEShapeType.Pushpin,p);e.SetTitle(h[d].name);var q=h[d].description;if(h[d].phone)q+="<br/>"+h[d].phone;e.SetDescription(q);if(!a.ShowResults)e.SetVisibility(false);r.AddShape(e);m.push(e)}var o=new VEFindResult(a.FindType,e,h[d].name,h[d].description,p,false,h[d].phone);k.push(o)}if(f!=null)for(var d=0;d<f.length;d++){var i=null;if(f[d].latitude!=null&&typeof f[d].latitude!="undefined"&&f[d].longitude!=null&&typeof f[d].longitude!="undefined"&&f[d].latitude>=-85&&f[d].latitude<=85&&f[d].longitude>=-180&&f[d].longitude<=180)i=b.CreateVELatLong(f[d].latitude,f[d].longitude);var e=null;if(i!=null&&a.CreateResults){e=new VEShape(VEShapeType.Pushpin,i);e.SetTitle(h[d].name);e.SetDescription(h[d].description);if(!a.ShowResults)e.SetVisibility(false);r.AddShape(e);m.push(e)}var o=new VEFindResult(a.FindType,e,f[d].title,f[d].description,i,true);k.push(o)}g=new VEFindResults(a.ShapeLayer,k,s);j=m;if(typeof n!="undefined"&&!c&&n!=null)c=n;if(a.SetBestMapView&&a.WhereLatLong){var l=[];for(var d=0;d<g.Results.length;d++)if(g.Results[d].LatLong)l.push(g.Results[d].LatLong);if(l.length>0)this.m_vemap.SetMapView(l)}this.FireFindCallback()}};this.ApplySuggestion=function(c,a){var b=$ID("vewhatinput");if(b)b.value=a;this.Find(a,this.m_vemap.lastwheresearch,null,"VEMap._GetMapFromGUID("+this.m_vemap.GUID+")._Disambiguate",1)};this.CreateAdElement=function(a){if(a==null)return null;var b=document.createElement("div");b.id="veadresults_"+a.id;b.className="VE_AdResult";var c=document.createElement("a");c.className="VE_AdResult_Title";c.innerHTML=a.title;c.href=a.url;b.appendChild(c);var d=document.createElement("div");d.className="VE_AdResult_Description";d.innerHTML=a.description;b.appendChild(d);return b};this.UpdateAmbiguousList=function(c){if(c!=null&&c.length>0){var g=[];for(var d=0;d<c.length;d++){var h=new VEPlace(c[d][0],b.CreateVELatLong(c[d][5],c[d][6]),new VELatLongRectangle(b.CreateVELatLong(c[d][1],c[d][2]),b.CreateVELatLong(c[d][3],c[d][4])),c[d][7],c[d][8],c[d][9],c[d][10]);g.push(h)}f=g;if(a.UseDefaultDisambiguation){e=false;this.m_vemap.m_veambiguouslist.Show(c,this._DisambiguateCallback,true)}else if(typeof this.m_vemap.DisambiguationCallback!="undefined"&&this.m_vemap.DisambiguationCallback!=null&&typeof this.m_vemap.DisambiguationCallback=="function"){e=false;this.m_vemap.DisambiguationCallback(g)}}};this.FindAmbiguousListCallBack=function(o,h,k,i,l){if(o==null){e=true;this.FireFindCallback()}else{var n=$ID(this.m_vemap.ID+"_vewhereinput");if(n)n.value=unescape(o);if(a.SetBestMapView)this.m_vemap.SetViewport(h,k,i,l);var c=f,m=-1;if(c)for(var b=0;b<c.length;b++)if(c[b].LatLongRect.TopLeftLatLong.Latitude==h&&c[b].LatLongRect.TopLeftLatLong.Longitude==k&&c[b].LatLongRect.BottomRightLatLong.Latitude==i&&c[b].LatLongRect.BottomRightLatLong.Longitude==l){m=b;if(a!=null)a.WherePlace=c[b];break}if(a.What.length>0){var c=f;if(m==0){e=true;this.FireFindCallback()}else{var p=a.ShapeLayer,d=j;if(d!=null)for(var b=0;b<d.length;b++)p.DeleteShape(d[b]);var g=a;g.Where="";g.WhereRect=new VELatLongRectangle(new VELatLong(h,k),new VELatLong(i,l));this.Find(g)}}else{e=true;this.FireFindCallback()}}};this.FireFindCallback=function(){if(e)if(typeof a.Callback!="undefined"&&a.Callback!=null){var d=g,b=f;if(a.WherePlace!=null){b=[];b.push(a.WherePlace)}if(a.WhereLatLong){b=[];b.push(new VEPlace("",a.WhereLatLong))}if(d){var i=d.ShapeLayer,h=d.Results;if(!a.CreateResults)i=null;if(h.length==0){i=null;h=null}a.Callback(i,h,b,d.HasMore,c)}else if(b&&a.What.length==0)a.Callback(null,null,b,null,c);else if(a.What.length==0)a.Callback(null,null,null,null,c)}else if(typeof c!="undefined"&&c!=null&&c.length!=0)this.m_vemap.ShowMessage(c)};this.SearchCallback=function(c){if(f==null){var d=[];for(var a=0;a<c.length;a++){var e=new VEPlace(c[a][0],b.CreateVELatLong(c[a][1],c[a][2]),new VELatLongRectangle(b.CreateVELatLong(c[a][4],c[a][5]),b.CreateVELatLong(c[a][6],c[a][7])),c[a][3],c[a][8],c[a][9],c[a][10]);d.push(e)}f=d}this.FireFindCallback()};this.ReverseGeocode=function(b,e){var a=[];if(this.m_vemap.HasClientToken())a.push(new VEParameter(Msn.VE.API.Constants.clienttoken,this.m_vemap.ClientToken));var f=h.Decode(b);a.push(new VEParameter("latitude",b.Latitude));a.push(new VEParameter("longitude",b.Longitude));this.m_vemap.vemapcontrol.Fire("onstartrequest");function c(a){d.ReverseGeocodeResponseHandler(a,e)}VEAPIRequestInvoke(Msn.VE.API.Constants.geocodingservice+"/ReverseGeocode",a,c)};this.ReverseGeocodeResponseHandler=function(c,j){d.m_vemap.vemapcontrol.Fire("onendrequest");d.m_vemap.__HandleAuthentication(c);var e=null;if(c&&c.Results&&c.Results.length>0){e=[];var l=c.Results.length;for(var g=0;g<l;++g){var a=c.Results[g],i=[];if(a.Locations&&a.Locations.length)for(var h=0;h<a.Locations.length;++h){var f=a.Locations[h];i.push(new VEGeocodeLocation(b.CreateVELatLong(f.Coordinates.Latitude,f.Coordinates.Longitude),f.Precision))}var k=new VEPlace(a.Name,b.CreateVELatLong(a.BestLocation.Coordinates.Latitude,a.BestLocation.Coordinates.Longitude),new VELatLongRectangle(b.CreateVELatLong(a.BestView.NorthEastCorner.Latitude,a.BestView.SouthWestCorner.Longitude),b.CreateVELatLong(a.BestView.SouthWestCorner.Latitude,a.BestView.NorthEastCorner.Longitude)),a.MatchConfidence,a.MatchCode,a.BestLocation.Precision,i);e.push(k)}}if(typeof j=="function")j(e)};this.Dispose=function(){this.m_vemap=null;this.m_veLatLongFactory=null;d=null}}function VE_SearchResultCategory(b,a){this.id=b;this.name=a;this.IsValid=function(){return typeof parseInt(b)=="number"&&typeof a=="string"&&a.length>0};this.Destroy=function(){this.id=null;this.name=null}}Msn.VE.Search={};Msn.VE.Search.strLastWhere="";function VE_SearchResult(w,u,l,t,s,v,p,n,r,d,o,k,h,g,q,f,a,j,i,c,b,m){this.id=w;this.name=u;this.description=l;this.phone=t;this.rating=s;this.type=v;this.latitude=p;this.longitude=n;this.pushPin=null;this.pinId=null;this.keywords=o;this.infoUrl=r;this.photoUrl=typeof d!="undefined"?d:"";this.mapserviceType=k;this.mapserviceSource=h;this.mapserviceOpacity=g;this.website=b!=null&&typeof b!="undefined"&&b.constructor==String?b:"";this.country=q;var e=null;this.SetGeoRef=function(a){e=a};this.GetGeoRef=function(){return e};this.insideBoundingBox=f;var a=a;this.GetDistanceFromCenter=function(b,c){if(typeof a=="number"&&Msn.VE.DistanceUnit.IsValidType(b))if(b=="mi"){if(a.toFixed)return c?a.toFixed(2)+L_DirectionsMi_Text:a.toFixed(2)}else if(b=="km")if(a.toFixed)return c?(a*1.60934).toFixed(2)+L_DirectionsKm_Text:(a*1.60934).toFixed(2)};this.roofTopLatitude=j;this.roofTopLongitude=i;if(typeof c==="boolean")this.isLocationPrecise=c;else this.isLocationPrecise=true;this.brandInfo=m;this.adInfo=null;this.whitePageInfo=null}function VE_WebSearchResult(h,g,i,j,k){var c=a(h),d=a(g),e=a(i),b=a(j),f=a(k);this.GetCaptionUrl=function(){return c};this.SetCaptionUrl=function(b){c=a(b)};this.GetDescription=function(){return d};this.SetDescription=function(b){d=a(b)};this.GetDisplayUrl=function(){return e};this.SetDisplayUrl=function(b){e=a(b)};this.GetTitle=function(){return b};this.SetTitle=function(c){b=a(c)};this.GetUrl=function(){return f};this.SetUrl=function(b){f=a(b)};function a(a){if(typeof a=="string"&&a.length>=0)return a;return null}}VE_SearchResult.prototype.Equals=function(a){if(a==null||a=="undefined")return false;try{var b=this.name==a.name&&this.description==a.description&&this.phone==a.phone&&this.rating==a.rating&&this.type==a.type&&this.latitude==a.latitude&&this.longitude==a.longitude;return b}catch(c){return false}};VE_WebSearchResult.prototype.Equals=function(a){if(a instanceof VE_WebSearchResult){var b=this.GetCaptionUrl()==a.GetCaptionUrl()&&this.GetDescription()==a.GetDescription()&&this.GetTitle()==a.GetTitle()&&this.GetDisplayUrl()==a.GetDisplayUrl()&&this.GetUrl()==a.GetUrl();return b}return false};function VE_ColInfo(e,d,b,a,c){this.id=e;this.name=d;this.businessId=b;this.entityCount=a;this.colType=c}VE_SetModuleStatus(VE_ModuleName.APIFIND,"loaded");VEMap.prototype.InitRouting=function(){if(!this.m_vedirectionsmanager){this.m_vedirectionsmanager=new VEDirectionsManager(this);this.m_vedirectionsmanager.Initialize();this._dm=this.m_vedirectionsmanager}if(!this.m_routemanager)this.m_routemanager=new VERouteManager(this)};VEMap.prototype.GetRoute=function(d,e,b,c,a){this.InitRouting();this.m_vedirectionsmanager.GetDrivingDirections(d,e,b,c,a)};VEMap.prototype.DeleteRoute=function(){this.InitRouting();this.m_vedirectionsmanager.ClearRoute();this.m_routemanager.ClearRoute()};function VERouteDistanceUnit(){}VERouteDistanceUnit.Mile="Mile";VERouteDistanceUnit.Kilometer="Kilometer";VERouteDistanceUnit.Default=VERouteDistanceUnit.Mile;function VERouteOptimize(){}VERouteOptimize.MinimizeTime="MinimizeTime";VERouteOptimize.MinimizeDistance="MinimizeDistance";VERouteOptimize.Default="Default";function VERouteMode(){}VERouteMode.Driving="Driving";VERouteMode.Walking="Walking";VERouteMode.Default=VERouteMode.Driving;function VERouteWarningSeverity(){}VERouteWarningSeverity.None=0;VERouteWarningSeverity.LowImpact=1;VERouteWarningSeverity.Minor=2;VERouteWarningSeverity.Moderate=3;VERouteWarningSeverity.Serious=4;function VEServiceRequest(d,b,c,a){this.ID=d;this.Service=b;this.Params=c;this.Callback=a}function VERouteOptions(){this.DistanceUnit=VERouteDistanceUnit.Default;this.RouteOptimize=VERouteOptimize.Default;this.RouteMode=VERouteMode.Default;this.RouteCallback=null;this.DrawRoute=true;this.RouteWeight=6;this.RouteColor=new VEColor(0,169,235,.7);this.RouteZIndex=4;this.SetBestMapView=true;this.ShowDisambiguation=true;this.ShowErrorMessages=true;this.UseTraffic=false;this.UseMWS=false}function VERoute(){this.RouteLegs=[];this.Distance=0;this.Time=0;this.ShapePoints=null}function VERouteItinerary(){this.Items=[]}function VERouteItineraryItem(e,c,a,d,f,b){this.Text=e;this.LatLong=c;this.Distance=a;this.Shape=d;this.Time=f;this.Warnings=b}function VERouteLeg(a,b,d,c,e){this.StartLocation=a;this.EndLocation=b;this.Distance=d;this.Itinerary=c;this.Time=e}function VERouteWarning(b,a){this.Text=b;this.Severity=a}VEMap.prototype.GetDirections=function(b,a){this.m_routemanager.GetRoute(b,a)};function VERouteManager(vemap){var self=this,m_vemap=vemap,m_routeShapeLayer=null,m_routeHighlight=null,m_encoder=new _xz1,m_veLatLongDecoder=new _xy1,m_veLatLongFactory=new VELatLongFactory(new VELatLongFactorySpecFromMap(m_vemap)),m_routeDecoder=new Msn.VE.DirectionsDecoder,m_routeOptions=null,m_locations=[],m_currentLocationIndex=0,m_requestQueue=[],m_route=null,m_requestID=null;this.GetRoute=function(e,a){m_requestID=VENetwork.GetExecutionID();m_vemap.DeleteRoute();if(!e||!e.length||e.length<2)throw new VEException("","err_invalidargument",L_invaliddirections_text);if(a){VEValidator.ValidateObject(a,"routeOptions",VERouteOptions,"VERouteOptions");if(a.DistanceUnit!=VERouteDistanceUnit.Mile&&a.DistanceUnit!=VERouteDistanceUnit.Kilometer)throw new VEException("","err_invalidargument",L_invalidargument_text.replace("%1","routeOptions.DistanceUnit").replace("%2","VERouteDistanceUnit"));if(a.RouteOptimize!=VERouteOptimize.Default&&a.RouteOptimize!=VERouteOptimize.MinimizeTime&&a.RouteOptimize!=VERouteOptimize.MinimizeDistance)throw new VEException("","err_invalidargument",L_invalidargument_text.replace("%1","routeOptions.RouteOptimize").replace("%2","VERouteOptimize"));if(a.RouteMode!=VERouteMode.Driving&&a.RouteMode!=VERouteMode.Walking)throw new VEException("","err_invalidargument",L_invalidargument_text.replace("%1","routeOptions.RouteMode").replace("%2","VERouteMode"));VEValidator.ValidateBoolean(a.DrawRoute,"routeOptions.DrawRoute");if(a.RouteCallback)VEValidator.ValidateFunction(a.RouteCallback,"routeOptions.RouteCallback");VEValidator.ValidateFloat(a.RouteWeight,"routeOptions.RouteWeight");VEValidator.ValidateObject(a.RouteColor,"routeOptions.RouteColor",VEColor,"VEColor");VEValidator.ValidateInt(a.RouteZIndex,"routeOptions.RouteZIndex");VEValidator.ValidateBoolean(a.SetBestMapView,"routeOptions.SetBestMapView");VEValidator.ValidateBoolean(a.ShowDisambiguation,"routeOptions.ShowDisambiguation");VEValidator.ValidateBoolean(a.ShowErrorMessages,"routeOptions.ShowErrorMessages");VEValidator.ValidateBoolean(a.UseMWS,"routeOptions.UseMWS");VEValidator.ValidateBoolean(a.UseTraffic,"routeOptions.UseTraffic");m_routeOptions=a}else m_routeOptions=new VERouteOptions;m_locations=[];m_currentLocationIndex=0;m_requestQueue=[];var i=e.length;for(var d=0;d<i;++d){var f=e[d];if(f instanceof VELatLong)m_locations[d]=m_veLatLongDecoder.Decode(f);else{var b=[];if(m_vemap.HasClientToken())b.push(new VEParameter(Msn.VE.API.Constants.clienttoken,m_vemap.ClientToken));var g="",c=null;if(m_vemap.vemapcontrol.IsMapViewOblique()){var h=m_vemap.GetBirdseyeScene();if(h)c=h.GetBoundingRectangleNorthFacing()}else c=m_vemap.GetMapView();if(c&&c.TopLeftLatLong&&c.BottomRightLatLong)g=c.TopLeftLatLong.Latitude+", "+c.BottomRightLatLong.Longitude+", "+c.BottomRightLatLong.Latitude+", "+c.TopLeftLatLong.Longitude;b.push(new VEParameter("count",""));b.push(new VEParameter("query",'"'+f+'"'));b.push(new VEParameter("landmark",""));b.push(new VEParameter("addressLine",""));b.push(new VEParameter("locality",""));b.push(new VEParameter("postalTown",""));b.push(new VEParameter("adminDistrict",""));b.push(new VEParameter("district",""));b.push(new VEParameter("postalCode",""));b.push(new VEParameter("countryRegion",""));b.push(new VEParameter("mapBounds",'"'+g+'"'));b.push(new VEParameter("currentLocation",""));b.push(new VEParameter("curLocAccuracy",""));b.push(new VEParameter("entityTypes",""));b.push(new VEParameter("rankBy",""));m_requestQueue.push(new VEServiceRequest(d,Msn.VE.API.Constants.geocodingservice+"/Geocode",b,self.GeocodeResponseHandler))}}self.ExecuteNextRequest()};this.ClearRoute=function(){if(m_route){if(m_routeShapeLayer){m_vemap.DeleteShapeLayer(m_routeShapeLayer);m_routeShapeLayer=null}for(var a=0;a<m_route.RouteLegs.length;++a){var c=m_route.RouteLegs[a];for(var b=0;b<c.Itinerary.Items.length;++b){var d=c.Itinerary.Items[b];if(d.Shape)d.Shape=null}}m_route=null}this.RemoveRouteHighLight()};this.ExecuteNextRequest=function(){if(m_requestQueue.length>0){var b=m_requestID;function c(c){if(m_requestID==b)a.Callback(c,a.ID)}var a=m_requestQueue.shift();m_vemap.vemapcontrol.Fire("onstartrequest");VEAPIRequestInvoke(a.Service,a.Params,c)}else self.ExecuteRouteRequest()};this.ExecuteRouteRequest=function(){var d=m_requestID;function e(a){if(m_requestID==d)self.RouteResponseHandler(a)}var a=[];if(m_vemap.HasClientToken())a.push(new VEParameter(Msn.VE.API.Constants.clienttoken,m_vemap.ClientToken));var c="",f=m_locations.length;for(var b=0;b<f;++b)c+=m_encoder.Encode(m_locations[b].Latitude,m_locations[b].Longitude);a.push(new VEParameter("encodedWaypoints",'"'+c+'"'));a.push(new VEParameter("encodingLength","6"));a.push(new VEParameter("unit",'"'+m_routeOptions.DistanceUnit+'"'));a.push(new VEParameter("routeOptimize",'"'+m_routeOptions.RouteOptimize+'"'));a.push(new VEParameter("mode",'"'+m_routeOptions.RouteMode+'"'));a.push(new VEParameter("useMws",m_routeOptions.UseMWS?"true":"false"));a.push(new VEParameter("useTraffic",m_routeOptions.UseTraffic?"true":"false"));m_vemap.vemapcontrol.Fire("onstartrequest");VEAPIRequestInvoke(Msn.VE.API.Constants.routeservice+"/CalculateRoute2",a,e)};this.GeocodeResponseHandler=function(a,e){m_vemap.vemapcontrol.Fire("onendrequest");m_vemap.__HandleAuthentication(a);if(a&&a.Results&&a.Results.length>0)if(a.Results.length==1||!m_routeOptions.ShowDisambiguation||a.Results[0].MatchConfidence!=a.Results[1].MatchConfidence){var b=GetRouteLocation(a.Results[0]);if(b!=null)m_locations[e]=new VELatLong(b.Coordinates.Latitude,b.Coordinates.Longitude);self.ExecuteNextRequest()}else{var g=a.Results[0].MatchConfidence,f=[];for(var d=0;d<a.Results.length;++d){var c=a.Results[d];if(c.MatchConfidence==g){var b=GetRouteLocation(c);if(b!=null)f.push(new VE_Location(c.Name,b.Coordinates.Latitude,b.Coordinates.Longitude))}}m_currentLocationIndex=e;m_vemap.m_veambiguouslist.Show(f,"VEMap._GetMapFromGUID("+m_vemap.GUID+").m_routemanager.DisambiguateLocation")}else{if(m_routeOptions.ShowErrorMessages)m_vemap.ShowMessage(L_invalidlocation_Text);if(m_routeOptions.RouteCallback)m_routeOptions.RouteCallback(null)}};function GetRouteLocation(a){var b=null;if(a.Locations&&a.Locations.length)for(var c=0;c<a.Locations.length;++c)if(a.Locations[c].Precision==VELocationPrecision.Interpolated){b=a.Locations[c];break}if(b==null)b=a.BestLocation;return b}this.DisambiguateLocation=function(c,a,b){if(a&&b){m_locations[m_currentLocationIndex]=new VELatLong(a,b);self.ExecuteNextRequest()}};this.RouteResponseHandler=function(object){m_vemap.vemapcontrol.Fire("onendrequest");m_vemap.__HandleAuthentication(object);m_route=new VERoute;if(object&&object.ResponseSummary&&object.ResponseSummary.StatusCode==0)if(object.RouteResult){if(object.RouteResult.RouteSummary){if(object.RouteResult.RouteSummary.Distance)m_route.Distance=object.RouteResult.RouteSummary.Distance;if(object.RouteResult.RouteSummary.TimeInSeconds)m_route.Time=object.RouteResult.RouteSummary.TimeInSeconds}if(object.RouteResult.RouteLegs){var len=object.RouteResult.RouteLegs.length;for(var i=0;i<len;++i){var leg=object.RouteResult.RouteLegs[i],itinerary=new VERouteItinerary,itineraryItemsLen=leg.Itinerary.Items.length;for(var j=0;j<itineraryItemsLen;++j){var item=leg.Itinerary.Items[j],warnings=null;if(item.ItemWarnings){warnings=[];for(var k=0;k<item.ItemWarnings.length;++k)warnings.push(new VERouteWarning(item.ItemWarnings[k].WarningText.Text,item.ItemWarnings[k].WarningCriticality))}itinerary.Items.push(new VERouteItineraryItem(item.Text.Text,m_veLatLongFactory.CreateVELatLong(item.ItemDetails[0].Coordinate.Latitude,item.ItemDetails[0].Coordinate.Longitude),item.ItemSummary.Distance,null,item.ItemSummary.TimeInSeconds,warnings))}m_route.RouteLegs.push(new VERouteLeg(m_veLatLongFactory.CreateVELatLong(leg.ActualStart.Latitude,leg.ActualStart.Longitude),m_veLatLongFactory.CreateVELatLong(leg.ActualEnd.Latitude,leg.ActualEnd.Longitude),leg.LegSummary.Distance,itinerary,leg.LegSummary.TimeInSeconds))}}}if(m_route&&m_route.RouteLegs&&m_route.RouteLegs.length>0){if(m_routeOptions.DrawRoute){var shapes=[],stepIndex=0;for(var routeLegIndex=0;routeLegIndex<m_route.RouteLegs.length;++routeLegIndex){var routeLeg=m_route.RouteLegs[routeLegIndex];for(var itemIndex=0;itemIndex<routeLeg.Itinerary.Items.length;++itemIndex){var item=routeLeg.Itinerary.Items[itemIndex],shape=new VEShape(VEShapeType.Pushpin,item.LatLong);if(routeLegIndex==0&&itemIndex==0){shape.SetTitle(L_Start_Text);shape.SetCustomIcon(Msn.VE.API.Constants.vedirectionsstarticon)}else if(routeLegIndex==m_route.RouteLegs.length-1&&itemIndex==routeLeg.Itinerary.Items.length-1){shape.SetTitle(L_End_Text);shape.SetCustomIcon(Msn.VE.API.Constants.vedirectionsendicon)}else{shape.SetTitle(L_DirectionsStep_Text+" "+stepIndex);shape.SetCustomIcon(Msn.VE.API.Constants.vedirectionsstepicon.replace("%1",stepIndex))}shape.SetDescription(item.Text);item.Shape=shape;shapes.push(shape);++stepIndex}}m_routeShapeLayer=new VEShapeLayer;m_vemap.AddShapeLayer(m_routeShapeLayer);m_routeShapeLayer.AddShape(shapes)}if(object.RouteResult&&object.RouteResult.RoutePath){var rp=object.RouteResult.RoutePath,shapePointLatitudes=m_routeDecoder.DecodeCoordinatesString(rp.ShapePointsLatitudes),shapePointLongitudes=m_routeDecoder.DecodeCoordinatesString(rp.ShapePointsLongitudes);if(m_vemap.HasClientToken()){m_route.ShapePoints=[];if(shapePointLatitudes.length==shapePointLongitudes.length){var len=shapePointLatitudes.length;for(var i=0;i<len;++i)m_route.ShapePoints[i]=m_veLatLongFactory.CreateVELatLong(shapePointLatitudes[i],shapePointLongitudes[i])}}if(m_routeOptions.DrawRoute){if(m_routeOptions.SetBestMapView&&rp.JavascriptBestView){var bestView=eval(rp.JavascriptBestView),latlongs=[];for(var i=0;i<bestView.length;++i)latlongs.push(new VELatLong(bestView[i].latitude,bestView[i].longitude));m_vemap.SetMapView(latlongs)}self.CreateRouteHighLight("veDDHighlight",shapePointLatitudes,shapePointLongitudes,eval(rp.JavascriptRouteRegions),eval(rp.JavascriptZoomLevelsForGeneralizedLines))}}}else if(m_routeOptions.ShowErrorMessages)m_vemap.ShowMessage(L_invalidroute_Text);if(m_routeOptions.RouteCallback)m_routeOptions.RouteCallback(m_route)};this.CreateRouteHighLight=function(e,c,d,b,a){if(m_routeHighlight)this.RemoveRouteHighLight();m_routeHighlight=m_vemap.vemapcontrol.AddLine(e,c,d,m_routeOptions.RouteWeight,m_routeOptions.RouteColor,m_routeOptions.RouteZIndex,b,a)};this.RemoveRouteHighLight=function(){if(m_routeHighlight){m_vemap.vemapcontrol.RemoveLine(m_routeHighlight.id);m_routeHighlight=null}};this.Dispose=function(){self=null}}var L_cannotrenderroute_text="The route could not be drawn because this web browser does not support SVG and VML.";VEDistanceUnit=new function(){this.Miles="m";this.Kilometers="k"};VERouteType=new function(){this.Shortest="s";this.Quickest="q"};function VERouteDeprecated(b,c,a){VEValidator.ValidateObject(b,"startLocation",VERouteLocation,"VERouteLocation");VEValidator.ValidateObject(c,"endLocation",VERouteLocation,"VERouteLocation");VEValidator.ValidateObject(a,"veRouteItinerary",VERouteItineraryDeprecated,"VERouteItineraryDeprecated");this.StartLocation=b;this.EndLocation=c;this.Itinerary=a}function VERouteLocation(b,a){VEValidator.ValidateNonNull(b,"address");VEValidator.ValidateObject(a,"veLatLong",VELatLong,"VELatLong");this.Address=b;this.LatLong=a}function VERouteItineraryDeprecated(c,a,d,b){this.Distance=c;this.DistanceUnit=a;this.Time=d;this.RouteType=b;this.Segments=[];this.AddSegment=function(a){VEValidator.ValidateObject(a,"segment",VERouteSegment,"VERouteSegment");this.Segments.push(a)}}function VERouteSegment(b,c,a){VEValidator.ValidateObject(a,"veLatLong",VELatLong,"VELatLong");this.Instruction=b;this.Distance=c;this.LatLong=a}function VEDirectionsManager(vemap){VEValidator.ValidateObject(vemap,"vemap",VEMap,"VEMap");this.m_vemap=vemap;var self=this;this.lastStartString="";this.lastEndString="";this.laststart="";this.lastend="";this.lastcallback=null;this.disambigwhat="";this.veroutecache=[];var m_veLatLongFactory=new VELatLongFactory(new VELatLongFactorySpecFromMap(this.m_vemap)),m_veLatLongDecoder=new _xy1;this.m_showDisambigousDialog=true;this.Initialize=function(){if(this.veroutecache==null||this.veroutecache=="undefined")this.veroutecache=[];else this.RemoveRoutePins()};this.GetDrivingDirections=function(b,c,e,f,l){this.m_vemap.DeleteRoute();var h="",i="",j="m",k="q";if(b==null||b=="undefined"||b.length<=0)throw new VEException("VEDirectionsManager:GetDrivingDirections","err_invaliddirections",L_invaliddirections_text);if(c==null||c=="undefined"||c.length<=0)throw new VEException("VEDirectionsManager:GetDrivingDirections","err_invaliddirections",L_invaliddirections_text);if(e!=null&&e!="undefined"){this.lastdist=e;if(e==VEDistanceUnit.Kilometers)j="k"}else this.lastdist=VEDistanceUnit.Miles;if(f!=null&&f!="undefined"){this.lasttype=f;if(f==VERouteType.Shortest)k="s"}else this.lastdist=VERouteType.Quickest;var a=[];if(this.m_vemap.HasClientToken())a.push(new VEParameter(Msn.VE.API.Constants.clienttoken,this.m_vemap.ClientToken));a.push(new VEParameter(Msn.VE.API.Constants.market,Msn.VE.API.Globals.locale));this.laststart=b;if(typeof b=="object"){var d=m_veLatLongDecoder.Decode(b);a.push(new VEParameter("startlat",d.Latitude));a.push(new VEParameter("startlon",d.Longitude))}else{h=b.replace(/#/g,"%23");a.push(new VEParameter("start",h))}this.lastend=c;if(typeof c=="object"){var d=m_veLatLongDecoder.Decode(c);a.push(new VEParameter("endlat",d.Latitude));a.push(new VEParameter("endlon",d.Longitude))}else{i=c.replace(/#/g,"%23");a.push(new VEParameter("end",i))}a.push(new VEParameter("units",j));a.push(new VEParameter("type",k));a.push(new VEParameter(Msn.VE.API.Constants.mapguid,this.m_vemap.GUID));this.vedirectionscallback=l;this.vedddisambiguatecallback="VEMap._GetMapFromGUID("+this.m_vemap.GUID+")._dm.DisambiguateDirections";this.disambiguateDone=false;var g=new VENetwork;g.ServiceUrl=Msn.VE.API.Constants.legacyrouteservice;this.m_vemap.vemapcontrol.Fire("onstartrequest");g.BeginInvoke(null,a,null)};this.Populate=function(f,d,e,b,j,k,l,q,i,z,s,u,n,m){this.m_vemap.vemapcontrol.Fire("onendrequest");if(d==null||b==null||j==null||k==null||l==null||q==null||i==null||s==null||u==null||n==null||m==null)throw new VEException("VEDirectionsManager:GetDrivingDirections","err_noroute",L_noroute_text);if(f==null||f=="undefined"||f.length==0)f=this.lastStartString;if(e==null||e=="undefined"||e.length==0)e=this.lastEndString;var v=new VERouteLocation(f,m_veLatLongFactory.CreateVELatLong(d[0],d[1])),x=new VERouteLocation(e,m_veLatLongFactory.CreateVELatLong(b[0],b[1])),p=new Msn.VE.DirectionsDecoder;k=p.DecodeCoordinatesString(k);l=p.DecodeCoordinatesString(l);var o=i;if(i==null||i.length==0)o="mi";var h=new VERouteItineraryDeprecated(q,o,s,z),w=new VERouteSegment(L_startat_text+" "+f,0,m_veLatLongFactory.CreateVELatLong(d[0],d[1]));h.AddSegment(w);var r=true,c=null;if(j!=null){var t=j.length;for(var g=0;g<t;g++){var a=j[g],A=new VERouteSegment(a.name,a.distance,m_veLatLongFactory.CreateVELatLong(a.latitude,a.longitude));h.AddSegment(A);if(r){c=new VEPushpin(VENetwork.GetExecutionID(),m_veLatLongFactory.CreateVELatLong(a.latitude,a.longitude),Msn.VE.API.Constants.vedirectionsstarticon,L_Start_Text,a.name);this.m_vemap.AddPushpin(c);this.veroutecache.push(c);r=false}else{c=new VEPushpin(VENetwork.GetExecutionID(),m_veLatLongFactory.CreateVELatLong(a.latitude,a.longitude),Msn.VE.API.Constants.vedirectionsstepicon.replace("%1",g).replace("%2",t),L_DirectionsStep_Text+" "+g,a.name);this.m_vemap.AddPushpin(c);this.veroutecache.push(c)}}var y=new VERouteSegment(L_arriveat_text+" "+e,0,m_veLatLongFactory.CreateVELatLong(b[0],b[1]));h.AddSegment(y);c=new VEPushpin(VENetwork.GetExecutionID(),m_veLatLongFactory.CreateVELatLong(b[0],b[1]),Msn.VE.API.Constants.vedirectionsendicon,L_End_Text,L_arriveat_text+" "+e);this.m_vemap.AddPushpin(c);this.veroutecache.push(c);this.m_vemap.vemapcontrol.SetViewport(d[0],d[1],b[0],b[1]);var B=new VERouteDeprecated(v,x,h)}this.CreateRouteHighLight("veDDHighlight",k,l,n,m);if(this.vedirectionscallback!=null&&this.vedirectionscallback!="undefined")this.vedirectionscallback(B)};this.CreateRouteHighLight=function(h,f,g,e,a){if(this.verenderingdisabled){this.ShowMessage(L_cannotrenderroute_text);return}var b=6,d=new Msn.Drawing.Color(0,169,235,.7),c=4;if(this.verouteHighlight!=null)this.RemoveRouteHighLight();this.verouteHighlight=this.m_vemap.vemapcontrol.AddLine(h,f,g,b,d,c,e,a)};this.ClearRoute=function(){this.RemoveRoutePins();this.RemoveRouteHighLight();VEPushpin.Hide();this.m_vemap.m_veambiguouslist.Hide()};this.RemoveRoutePins=function(){try{var b=null;if(this.veroutecache!=null){var c=this.veroutecache.length;for(var a=0;a<c;a++){b=this.veroutecache[a];if(b==null||b=="undefined")continue;this.m_vemap.DeletePushpin(b.ID)}for(var a=0;a<c;a++)this.veroutecache.pop()}}catch(d){}};this.RemoveRouteHighLight=function(){if(this.verouteHighlight==null)return;this.m_vemap.vemapcontrol.RemoveLine(this.verouteHighlight.id)};this.ShowMessage=function(b,a){this.m_vemap.ShowMessage(a)};this.ShowNotFoundMessage=function(){};this.HandleFailedGetDirections=function(a){this.m_vemap.vemapcontrol.Fire("onendrequest");if(a!=null&&a!="undefined"){window.setTimeout("VEMap._GetMapFromGUID('"+this.m_vemap.GUID+"').DeleteRoute()",10);if(this.vedirectionscallback!=null&&this.vedirectionscallback!="undefined"){if(typeof this.vedirectionscallback=="function"){this.vedirectionscallback(null,a.replace(/%1/g,MapControl.Features.PlatformName));this.vedirectionscallback=""}}else this.m_vemap.ShowMessage(a.replace(/%1/g,MapControl.Features.PlatformName))}else if(this.vedirectionscallback!=null&&this.vedirectionscallback!="undefined"&&typeof this.vedirectionscallback=="function"){this.vedirectionscallback();this.vedirectionscallback=""}};this.Disambiguate=function(a,b){this.m_vemap.vemapcontrol.Fire("onendrequest");if(this.m_showDisambigousDialog){if(!this.m_vemap.m_veambiguouslist.IsVisible()){this.disambigwhat=a;this.m_vemap.m_veambiguouslist.Show(b,this.vedddisambiguatecallback)}}else if(!this.disambiguateDone){this.disambiguateDone=true;try{this.disambigwhat=a;eval(this.vedddisambiguatecallback+"('"+b[0].name+"', "+b[0].latitude+", "+b[0].longitude+");")}catch(a){}}};this.DisambiguateDirections=function(e,a,b){var c="",d="";if(this.disambigwhat=="end"){c=this.laststart;this.lastEndString=e;if(a!=null&&a!="undefined"&&b!=null&&b!="undefined")d=m_veLatLongFactory.CreateVELatLong(a,b);else d=e}else{d=this.lastend;this.lastStartString=e;if(a!=null&&a!="undefined"&&b!=null&&b!="undefined")c=new VELatLong(a,b);else c=e}this.GetDrivingDirections(c,d,this.lastdist,this.lasttype,this.vedirectionscallback)}}function VE_Directions(){}function VE_RouteInstruction(d,c,a,b){this.name=d;this.distance=b;this.latitude=c;this.longitude=a;this.permanentPin=false}function VE_Location(c,b,a){this.name=c;this.latitude=b;this.longitude=a}VE_SetModuleStatus(VE_ModuleName.APIROUTING,"loaded");VEMap.prototype.InitTraffic=function(){if(!this.m_vetrafficmanager)this.m_vetrafficmanager=new VE_TrafficManager(this)};VEMap.prototype.LoadTraffic=function(c,b,a){this.InitTraffic();VE_TrafficManager.m_vemap=this;VE_TrafficManager.turnedOn=true;VE_TrafficManager.showTrafficFlow=c;VE_TrafficManager.showIncidents=b;VE_TrafficManager.showConstructionIncidents=a;VE_TrafficManager.markets=[];VE_TrafficManager.incidents=[];if(this.vemapcontrol)this.vemapcontrol.UpdateCopyright();window.setTimeout(VE_TrafficManager.GetMarkets,100)};VEMap.prototype.ClearTraffic=function(){if(VE_TrafficManager.markets[0]!=null)VE_TrafficManager.ClearTraffic();if(this.vemapcontrol)this.vemapcontrol.UpdateCopyright()};VEMap.prototype.ShowTrafficLegend=function(a,b){if(VE_TrafficManager&&VE_TrafficManager.turnedOn)VE_TrafficManager.ShowTrafficLegend(a,b)};VEMap.prototype.HideTrafficLegend=function(){if(VE_TrafficManager)VE_TrafficManager.HideTrafficLegend()};VEMap.prototype.SetTrafficLegendText=function(a){if(VE_TrafficManager)VE_TrafficManager.SetTrafficLegendText(a)};function VE_TrafficManager(a){VEValidator.ValidateObject(a,"vemap",VEMap,"VEMap")}VE_TrafficManager.m_vemap=null;VE_TrafficManager.markets=[];VE_TrafficManager.incidents=[];VE_TrafficManager.incidentJSFiles=[];VE_TrafficManager.showingMarkets=[];VE_TrafficManager.showConstructionIncidents=false;VE_TrafficManager.incidentsAvailable=false;VE_TrafficManager.flowAvailable=false;VE_TrafficManager.turnedOn=false;VE_TrafficManager.showIncidents=false;VE_TrafficManager.showTrafficFlow=false;VE_TrafficManager.prevZoomLevel=0;VE_TrafficManager.prevMapStyle="";VE_TrafficManager.isViewDirty=false;VE_TrafficManager.masterTimer=null;VE_TrafficManager.slaveTimer=null;VE_TrafficManager.Severity={Serious:L_TrafficManagerSerious_Text,Moderate:L_TrafficManagerModerate_Text,Minor:L_TrafficManagerMinor_Text};VE_TrafficManager.GetMarkets=function(){try{VENetwork.DownloadScript(VE_TrafficManager.m_vemap.vemapcontrol.GetMarketsFile(),VE_TrafficManager.GetTrafficInfo)}catch(a){}};VE_TrafficManager._ProcessMarkets=function(a){if(VE_TrafficManager.markets[0]==null)VE_TrafficManager.markets[0]=[];if(a!=null&&a.length>0){var c=a.length;for(var b=0;b<c;b++)if(a[b]!=null)VE_TrafficManager.markets[0].push(a[b])}};VE_TrafficManager._GetIncidents=function(b){VE_TrafficManager.showingMarkets=VE_TrafficManager._GetIncidentMarkets();if(b)if(VE_TrafficManager.showingMarkets.length>0){VE_TrafficManager.incidentsAvailable=true;for(var a=0;a<VE_TrafficManager.showingMarkets.length;a++)try{var c=VENetwork.DownloadScript(VE_TrafficManager.m_vemap.vemapcontrol.GetIncidentsFile()+"-"+VE_TrafficManager.showingMarkets[a]+".js",null);VE_TrafficManager.incidentJSFiles.push(c)}catch(d){}}};VE_TrafficManager._ProcessIncidents=function(a){if(a==null||a.length<=0)return;var b=a[0].MarketId;if(VE_TrafficManager.incidents[b]==null)VE_TrafficManager.incidents[b]=[];else{VE_TrafficManager._ClearPins(b);var d=VE_TrafficManager.incidents[b].length;for(var c=0;c<d;c++)VE_TrafficManager.incidents[b].pop()}if(a!=null&&a.length>0){var d=a.length;for(var c=0;c<d;c++)if(a[c]!=null)VE_TrafficManager.incidents[b].push(a[c])}VE_TrafficManager._DisplayIncidents()};VE_TrafficManager._GetIncidentMarkets=function(){var b=[],h=VE_TrafficManager.m_vemap.vemapcontrol.PixelToLatLong(new VEPixel(0,0)),g=VE_TrafficManager.m_vemap.vemapcontrol.PixelToLatLong(new VEPixel(VE_TrafficManager.m_vemap.GetWidth(),VE_TrafficManager.m_vemap.GetHeight()));if(h==null||g==null)return b;var c=h.latitude,d=g.longitude,e=g.latitude,f=h.longitude;if(c<e){var i=c;c=e;e=i}if(d<f){var i=d;d=f;f=i}if(VE_TrafficManager.markets.length==0)return b;var k=new VELatLongRectangle(new VELatLong(c,f),new VELatLong(e,d)),l=VE_TrafficManager.markets[0].length;for(var a=0;a<l;a++){var j=new VELatLongRectangle(new VELatLong(VE_TrafficManager.markets[0][a].NELatitude,VE_TrafficManager.markets[0][a].SWLongitude),new VELatLong(VE_TrafficManager.markets[0][a].SWLatitude,VE_TrafficManager.markets[0][a].NELongitude));if(VE_TrafficManager._isBBOverlap(k,j)){if(VE_TrafficManager.markets[0][a].Incident=="Incidents")b.push(VE_TrafficManager.markets[0][a].Id);if(VE_TrafficManager.markets[0][a].Flow=="Flow")VE_TrafficManager.flowAvailable=true}}return b};VE_TrafficManager._isBBOverlap=function(b,a){return VE_TrafficManager._IsRectInBoundingBox(b,a)||VE_TrafficManager._IsRectInBoundingBox(a,b)};VE_TrafficManager._IsRectInBoundingBox=function(a,b){return!(a.BottomRightLatLong.Latitude>b.TopLeftLatLong.Latitude||a.BottomRightLatLong.Longitude<b.TopLeftLatLong.Longitude||a.TopLeftLatLong.Latitude<b.BottomRightLatLong.Latitude||a.TopLeftLatLong.Longitude>b.BottomRightLatLong.Longitude)};VE_TrafficManager.GetTrafficInfo=function(){if(!VE_TrafficManager.turnedOn)return;try{if(VE_TrafficManager.m_vemap.vemapcontrol.IsModeEnabled(Msn.VE.MapActionMode.Mode3D))if(VE_TrafficManager.showTrafficFlow)VE_TrafficManager.m_vemap.vemapcontrol.Show3DTraffic(false);else VE_TrafficManager.m_vemap.vemapcontrol.Remove3DTraffic();var a=VE_TrafficManager.m_vemap.GetZoomLevel();if(VE_TrafficManager.m_vemap.vemapcontrol.IsMapViewOblique())return;VE_TrafficManager.prevZoomLevel=a;VE_TrafficManager.prevMapStyle=VE_TrafficManager.m_vemap.GetMapStyle();VE_TrafficManager.incidentsAvailable=false;VE_TrafficManager.flowAvailable=false;VE_TrafficManager._ClearPins();if(a>=9){VE_TrafficManager._GetIncidents(VE_TrafficManager.showIncidents);if(VE_TrafficManager.showTrafficFlow&&VE_TrafficManager.flowAvailable&&a<=15){VE_TrafficManager.m_vemap.vemapcontrol.ClearTileLayer("Traffic");VE_TrafficManager.m_vemap.vemapcontrol.SetTrafficView()}}VE_TrafficManager.RenewAutoRefresh()}catch(b){}finally{}};VE_TrafficManager._DisplayIncidents=function(){if(VE_TrafficManager.showingMarkets!=null&&VE_TrafficManager.showingMarkets.length>0){var e=VE_TrafficManager.showingMarkets.length;for(var b=0;b<e;b++){var a=VE_TrafficManager.showingMarkets[b];if(VE_TrafficManager.incidents[a]!=null&&VE_TrafficManager.incidents[a].length>0){VE_TrafficManager._RemoveDuplicates(a);VE_TrafficManager._RenderTrafficInfo(a)}}var d="",a=VE_TrafficManager.showingMarkets[0];if(VE_TrafficManager.incidents[a]!=null&&VE_TrafficManager.incidents[a].length>0)d=VETime.FormatPanelTime(VE_TrafficManager.incidents[a][0].Timestamp,false);VE_TrafficManager.ShowTrafficLegend();if(VE_TrafficManager.m_vemap){var c=VE_TrafficManager.m_vemap.GetDashboardSize();if(c==VEDashboardSize.Small||c==VEDashboardSize.Tiny)VE_TrafficManager.ShowTrafficLegend(41,37)}VE_TrafficManager.SetTrafficLegendText(d)}};VE_TrafficManager._RenderTrafficInfo=function(c){if(c)VE_TrafficManager._ClearPins(c);else VE_TrafficManager._ClearPins();var e=VE_TrafficManager.m_vemap.GetZoomLevel();if(e>8){if(c==null)return;if(VE_TrafficManager.incidents[c]!=null){var b=VE_TrafficManager.incidents[c],f=VE_TrafficManager.incidents[c].length;for(var a=0;a<f;a++)if(b[a].Type!=VE_TrafficIncidentType.Weather&&b[a].Type!=VE_TrafficIncidentType.MassTransit){if(!VE_TrafficManager.showConstructionIncidents)if(b[a].Type==VE_TrafficIncidentType.UnscheduledConstruction||b[a].Type==VE_TrafficIncidentType.ScheduledConstruction)continue;if(VE_TrafficManager.flowAvailable&&b[a].Type==VE_TrafficIncidentType.Congestion)continue;var d=new VEPushpin("pin_traffic_incident_"+c+"_"+b[a].Id,new VELatLong(b[a].Latitude,b[a].Longitude),Msn.VE.API.Constants.trafficiconurl.replace("%1",VE_TrafficManager.GetColor(b[a].Criticality)),"",VE_TrafficManager.CreatePopupContent(b[a]));b[a].pushPin=d;VE_TrafficManager.m_vemap.AddPushpin(d)}}}};VE_TrafficManager.GetColor=function(a){switch(a){case 0:return Msn.VE.UI.Color.Red;break;case 1:return Msn.VE.UI.Color.Orange;break;case 2:return Msn.VE.UI.Color.Yellow;break;default:return Msn.VE.UI.Color.Yellow}};VE_TrafficManager.CreatePopupContent=function(a){var b='<div class = "traffictitle">'+(a.Type?IOSec.EncodeHtml(a.Type.replace(/&amp;/gi,"&")):"")+"</div>"+'<div class = "trafficheader">'+L_TrafficPopupSeverity_Text+":</div> "+'<div class = "trafficdata">'+VE_TrafficManager._GetSeverity(a.Criticality)+"</div>"+'<div class = "trafficheader">'+L_TrafficPopupLocation_Text+":</div> "+'<div class = "trafficdata">'+(a.Location?IOSec.EncodeHtml(a.Location.replace(/&amp;/gi,"&")):"")+"</div>"+'<div class = "trafficheader">'+L_TrafficPopupDescription_Text+":</div> "+'<div class = "trafficdata">'+(a.Description?IOSec.EncodeHtml(a.Description.replace(/&amp;/gi,"&")):"")+"</div>"+"<BR><div>"+'<div class = "trafficlabel">'+L_TrafficPopupStartTime_Text+":</div>"+'<div class = "trafficdata">'+(a.Starttime?IOSec.EncodeHtml(VETime.FormatTime(a.Starttime,true)):"")+"</div>"+"</div>"+"<div>"+'<div class = "trafficlabel">'+L_TrafficPopupEstEndTime_Text+":</div>"+'<div class = "trafficdata">'+(a.Endtime?IOSec.EncodeHtml(VETime.FormatTime(a.Endtime,true)):"")+"</div>"+"</div>";return b};VE_TrafficManager._GetSeverity=function(a){switch(a){case 0:return VE_TrafficManager.Severity.Serious;break;case 1:return VE_TrafficManager.Severity.Moderate;break;case 2:return VE_TrafficManager.Severity.Minor;break;default:return VE_TrafficManager.Severity.Minor}};VE_TrafficManager._RemoveDuplicates=function(c){if(c==null||c=="undefined")return;var a=VE_TrafficManager.incidents[c];if(a==null)return;for(var b=0;b<a.length;b++)for(var d=b+1;d<a.length;d++)if(a[b].Id==a[d].Id)a.splice(b,1)};VE_TrafficManager.ClearTraffic=function(){VE_TrafficManager._ClearPins();if(VE_TrafficManager.m_vemap!=null&&VE_TrafficManager.m_vemap.vemapcontrol!=null){VE_TrafficManager.m_vemap.vemapcontrol.ClearTileLayer("Traffic");VE_TrafficManager.HideTrafficLegend();if(VE_TrafficManager.m_vemap.vemapcontrol.IsModeEnabled(Msn.VE.MapActionMode.Mode3D))VE_TrafficManager.m_vemap.vemapcontrol.Remove3DTraffic()}VE_TrafficManager.turnedOn=false;VE_TrafficManager.ExpireAutoRefresh()};VE_TrafficManager.Destroy=function(){VE_TrafficManager.ClearTraffic();VE_TrafficManager.incidentsAvailable=false;VE_TrafficManager.flowAvailable=false;if(VE_TrafficManager.incidents!=null){if(VE_TrafficManager.markets[0]!=null)for(var c=0;c<VE_TrafficManager.markets[0].length;c++){var b=VE_TrafficManager.markets[0][c].Id,i=VE_TrafficManager.incidents[b];if(i==null)continue;var a=VE_TrafficManager.incidents[b].pop();if(a==null)continue;for(var e=0;e<a.length;e++){var f=a.pop();f=null}a=null}VE_TrafficManager.incidents[b]=null}if(VE_TrafficManager.markets!=null&&VE_TrafficManager.markets[0]!=null&&VE_TrafficManager.markets[0].length>0){var h=VE_TrafficManager.markets[0].length;for(var d=0;d<h;d++){var g=VE_TrafficManager.markets[0].pop();g=null}VE_TrafficManager.markets[0]=null}};VE_TrafficManager._ClearPins=function(e){if(VE_TrafficManager.markets==null||VE_TrafficManager.markets.length<=0)return;var c=VE_TrafficManager.markets[0];if(c!=null&&c.length>0)for(var a=0;a<c.length;a++)if(c[a].pushPin){VE_TrafficManager.m_vemap.DeletePushpin(c[a].pushPin.ID);c[a].pushPin=null}if(VE_TrafficManager.incidents==null||VE_TrafficManager.incidents.length<=0)return;if(e){var b=VE_TrafficManager.incidents[e];if(b==null)return;for(var a=0;a<b.length;a++)if(b[a].pushPin){VE_TrafficManager.m_vemap.DeletePushpin(b[a].pushPin.ID);b[a].pushPin=null}}else if(c!=null&&c.length>0)for(var d=0;d<VE_TrafficManager.markets[0].length;d++){var f=VE_TrafficManager.markets[0][d].Id,b=VE_TrafficManager.incidents[f];if(b==null)continue;for(var a=0;a<b.length;a++)if(b[a].pushPin){VE_TrafficManager.m_vemap.DeletePushpin(b[a].pushPin.ID);b[a].pushPin=null}b=null}};VE_TrafficManager._ViewChangeNotification=function(){if(VE_TrafficManager.m_vemap.vemapcontrol.IsMapViewOblique())return;if(!VE_TrafficManager.turnedOn)return;var a=VE_TrafficManager.m_vemap.GetZoomLevel();if(VE_TrafficManager.prevZoomLevel<=8&&a>8)VE_TrafficManager.isViewDirty=true;else if(VE_TrafficManager.prevZoomLevel>8&&a<=8)VE_TrafficManager.isViewDirty=true;else if(VE_TrafficManager.prevZoomLevel<=15&&a>15)VE_TrafficManager.isViewDirty=true;else if(VE_TrafficManager.prevZoomLevel>15&&a<=15)VE_TrafficManager.isViewDirty=true;else if(Msn.VE.MapStyle.IsViewOblique(VE_TrafficManager.prevMapStyle))VE_TrafficManager.isViewDirty=true;else{var b=VE_TrafficManager._GetIncidentMarkets();if(b!=null&&b.length>0)for(var c=0;c<b.length;c++){var e=false;for(var d=0;d<VE_TrafficManager.showingMarkets.length;d++)if(b[c]==VE_TrafficManager.showingMarkets[d]){e=true;break}if(!e){VE_TrafficManager.isViewDirty=true;break}else VE_TrafficManager.isViewDirty=false}else VE_TrafficManager.isViewDirty=true}VE_TrafficManager.prevZoomLevel=a;VE_TrafficManager.prevMapStyle=VE_TrafficManager.m_vemap.GetMapStyle();if(VE_TrafficManager.isViewDirty)window.setTimeout("VE_TrafficManager.GetTrafficInfo()",1);VE_TrafficManager.RenewAutoRefresh()};VE_TrafficManager.ExpireAutoRefresh=function(){if(VE_TrafficManager.masterTimer!=null)window.clearInterval(VE_TrafficManager.masterTimer);if(VE_TrafficManager.slaveTimer!=null)window.clearInterval(VE_TrafficManager.slaveTimer)};VE_TrafficManager.RenewAutoRefresh=function(){if(!VE_TrafficManager.turnedOn)return;VE_TrafficManager.ExpireAutoRefresh();VE_TrafficManager.masterTimer=window.setInterval("VE_TrafficManager.ExpireAutoRefresh()",VE_TrafficManager.m_vemap.vemapcontrol.GetSlidingExpirationForAutoRefresh());VE_TrafficManager.slaveTimer=window.setInterval(VE_TrafficManager.AutoRefresh,VE_TrafficManager.m_vemap.vemapcontrol.GetAutoRefreshRate())};VE_TrafficManager.AutoRefresh=function(){try{var a=VE_TrafficManager.m_vemap.GetZoomLevel();if(a>=9)VE_TrafficManager.GetTrafficInfo()}catch(b){}};VE_TrafficIncidentType=new function(){this.ScheduledConstruction="SCHEDULED CONSTRUCTION";this.OtherNews="OTHER NEWS";this.Congestion="CONGESTION";this.Accident="ACCIDENT";this.DisabledVehicle="DISABLED VEHICILE";this.RoadHazard="ROAD HAZARD";this.UnscheduledConstruction="UNSCHEDULED CONSTRUCTION";this.PlannedEvent="PLANNED EVENT";this.MassTransit="MASS TRANSIT";this.Weather="WEATHER";this.Miscellaneous="MISCELLANEOUS"};function VE_Market(h,g,f,e,c,d,b,a){this.Id=h;this.Name=g;this.GMTOffset=f;this.SWLatitude=e;this.SWLongitude=c;this.NELatitude=d;this.NELongitude=b;if(a.indexOf("Flow")==0)this.Flow="Flow";if(a.indexOf("Incidents")!=-1)this.Incident="Incidents"}function VE_Incident(e,h,k,b,g,j,f,c,a,d,i){this.Timestamp=e;this.MarketId=h;this.Id=k;this.Description=b;this.Location=g;this.Type=j;this.Latitude=f;this.Longitude=c;this.Criticality=a;this.Starttime=d;this.Endtime=i}VE_TrafficManager.ShowTrafficLegend=function(a,b){if(VE_TrafficManager.turnedOn){if(VE_TrafficManager.legend==null){VE_TrafficManager.legend=VE_TrafficManager.m_vemap.vemapcontrol.CreateLegend();if(VE_TrafficManager.legend!=null)VE_TrafficManager.legend.ShowTrafficLegend(true)}if(VE_TrafficManager.legend&&typeof a!="undefined"&&a!=null&&typeof b!="undefined"&&b!=null){VE_TrafficManager.legend.UnPin();VE_TrafficManager.legend.MoveTo(a,b)}}};VE_TrafficManager.HideTrafficLegend=function(){if(VE_TrafficManager.legend!=null){VE_TrafficManager.legend.ShowTrafficLegend(false);VE_TrafficManager.legend=null}};VE_TrafficManager.SetTrafficLegendText=function(a){if(VE_TrafficManager.legend!=null){if(typeof a=="undefined"||a==null)a="";VE_TrafficManager.legend.SetTrafficLegendMsg(a)}};function VETime(){}VETime.FormatTime=function(a){if(a==null||a==""||a=="undefined")return"";var c=false,d=a.substr(0,10),e=a.substr(11,5),b="";if(a.indexOf("AM")>-1){b="AM";c=true}else b="PM";return d+" "+VETime.ConvertTo12HourFormat(e,c)+" "+b};VETime.ConvertTo12HourFormat=function(d,c){var a=d;try{var b=parseFloat(a.replace(":","."));if(b>12)if(b<13&&c!=true);else b=b-12;a=b.toFixed(2);a=a.replace(".",":")}catch(e){a=""}return a};VETime.FormatPanelTime=function(a,g){if(a==null||a==""||a=="undefined")return"";try{var b=0,d=false,i=a.substr(4,8),h=a.indexOf(":"),f=a.substr(h-2,5),c="";if(a.indexOf("AM")>-1){c="AM";d=true;b=a.indexOf("AM")}else{c="PM";b=a.indexOf("PM")}var e="";if(b>0)e=a.substr(b+3,3);if(g)return i+" "+VETime.ConvertTo12HourFormat(f,d)+" "+c+" "+e;else return VETime.ConvertTo12HourFormat(f,d)+" "+c+" "+e}catch(j){}};VETime.getMonth=function(a){switch(a){case"01":return" Jan";case"02":return" Feb";case"03":return" Mar";case"04":return" Apr";case"05":return" May";case"06":return" Jun";case"07":return" Jul";case"08":return" Aug";case"09":return" Sep";case"10":return" Oct";case"11":return" Nov";case"12":return" Dec"}};VE_SetModuleStatus(VE_ModuleName.APITRAFFIC,"loaded");VEMap.prototype.SetAltitude=function(a){try{VEValidator.ValidateFloat(a,"level");var b=parseFloat(a);this._QueueRequest(this.vemapcontrol.SetAltitude,b)}catch(c){throw c;return}};VEMap.prototype.SetPitch=function(b){try{VEValidator.ValidateFloat(b,"pitch");var a=parseFloat(b);a=a%360;if(a>0)a=a<1?0:-90;if(a<-90)a=-90;this._QueueRequest(this.vemapcontrol.SetTilt,a)}catch(c){throw c;return}};VEMap.prototype.SetHeading=function(b){try{VEValidator.ValidateFloat(b,"heading");var a=parseFloat(b);a=a%360;if(a<0)a=360+a;this._QueueRequest(this.vemapcontrol.SetDirection,a)}catch(c){throw c;return}};VEMap.prototype.GetAltitude=function(){return this.vemapcontrol.GetAltitude()};VEMap.prototype.GetPitch=function(){return this.vemapcontrol.GetTilt()};VEMap.prototype.GetHeading=function(){return this.vemapcontrol.GetDirection()};VEMap.prototype._Toggle3DNavigationControl=function(b){if(this.GetMapMode()==VEMapMode.Mode3D){var a=this.vemapcontrol.Get3DControl();if(a!=null)a.ShowNavigationControl=b}};VEMap.prototype.Show3DNavigationControl=function(){this._Toggle3DNavigationControl(true)};VEMap.prototype.Hide3DNavigationControl=function(){this._Toggle3DNavigationControl(false)};VEMap.prototype.Show3DBirdseye=function(a){VEValidator.ValidateBoolean(a,"birdseyeOption");if(this.GetMapMode()==VEMapMode.Mode3D&&this.vemapcontrol)this.vemapcontrol.Show3DBirdseye(a)};function MVC_Init_AbstractView_Shared(){Msn.MVC.AbstractView.prototype.GetMoveMenuOptionAsHtml=function(a){return a}}function MVC_Init_View3D_Shared(){Msn.MVC.View3D.prototype.GetMoveMenuOptionAsHtml=function(d,c){var e=c.GetPrimitiveCount();for(var a=0;a<e;a++){var b=c.GetPrimitive(a).type;if(b==VEShapeType.Polyline||b==VEShapeType.Polygon)return""}return d}}function MVC_Init_ViewFacade_Shared(){Msn.MVC.ViewFacade.prototype.GetMoveMenuOptionAsHtml=function(a,b){if(this._curMvcView==null)return"";return this._curMvcView.GetMoveMenuOptionAsHtml(a,b)}}function MVC_Init_AbstractView_Drawing(){Msn.MVC.AbstractView.prototype.OnAfterViewChanged=function(){};Msn.MVC.AbstractView.prototype.OnAllCollectionLayersRepaint=function(){this._DrawAllCollectionLayers()};Msn.MVC.AbstractView.prototype.OnAllCollectionLayersClear=function(){this._ClearAllCollectionLayers()};Msn.MVC.AbstractView.prototype.OnCollectionLayerRepaint=function(a){this._DrawCollectionLayer(a)};Msn.MVC.AbstractView.prototype.OnCollectionLayerClear=function(a){this._ClearCollectionLayer(a)};Msn.MVC.AbstractView.prototype.OnEntityRepaint=function(b,a,c,d){this._DrawEntity(b,a,c,d)};Msn.MVC.AbstractView.prototype.OnEntityLabelRepaint=function(a,b){this._DrawEntityLabel(a,b)};Msn.MVC.AbstractView.prototype.OnHighlightEntity=function(b,a){this._HighlightEntity(b,a)};Msn.MVC.AbstractView.prototype.OnEntityClear=function(a){this._ClearEntity(a)};Msn.MVC.AbstractView.prototype.OnEntityPrimitiveRepaint=function(c,a,b){this._DrawEntityPrimitive(c,a,b)};Msn.MVC.AbstractView.prototype.OnEntityPrimitiveClear=function(b,a){this._ClearEntityPrimitive(b,a)};Msn.MVC.AbstractView.prototype.OnContextMenuRemoveContextPin=function(){map.RemovePushpin("context_pin");this._contextPin=null};Msn.MVC.AbstractView.prototype.OnContextMenuPlaceContextPin=function(b,a,c){this._contextPin=map.AddPushpin("context_pin",b,a,7,7,"VE_Pushpin VE_Pushpin_"+c,"",VE_ScratchpadManager.pinZIndex,Msn.VE.PushPinTypes.Context)};Msn.MVC.AbstractView.prototype.GetDefaultMapCoordinatesToPutPushpin=function(){var a=this._contextPin;if(a==null)return[0,0];var c=a.vePushpin.GetLatitude(),b=a.vePushpin.GetLongitude();return[b,c]}}function MVC_Init_FlatlandView_Drawing(){Msn.MVC.FlatlandView.prototype.OnAfterViewChanged=function(){VE_EditControl.DrawUnfinishedGeometry();this._DrawAllCollectionLayers()};Msn.MVC.FlatlandView.prototype._DrawAllCollectionLayers=function(){this._GetMapDrawingView().DrawAll()};Msn.MVC.FlatlandView.prototype._ClearAllCollectionLayers=function(){this._GetMapDrawingView().ClearAll()};Msn.MVC.FlatlandView.prototype._DrawCollectionLayer=function(a){this._GetMapDrawingView().UpdateIndex();this._GetMapDrawingView().DrawLayer(a)};Msn.MVC.FlatlandView.prototype._ClearCollectionLayer=function(a){this._GetMapDrawingView().ClearLayerDom(a)};Msn.MVC.FlatlandView.prototype._DrawEntity=function(b,a,c,d){this._GetMapDrawingView().DrawEntity(b,a,c,d)};Msn.MVC.FlatlandView.prototype._DrawEntityLabel=function(a,b){this._GetMapDrawingView().DrawEntityLabel(a,b)};Msn.MVC.FlatlandView.prototype._HighlightEntity=function(b,a){this._GetMapDrawingView().HighlightEntity(b,a)};Msn.MVC.FlatlandView.prototype._ClearEntity=function(a){this._GetMapDrawingView().ClearEntityDom(a)};Msn.MVC.FlatlandView.prototype._DrawEntityPrimitive=function(c,a,b){this._GetMapDrawingView().DrawPrimitive(c,a,b)};Msn.MVC.FlatlandView.prototype._ClearEntityPrimitive=function(b,a){this._GetMapDrawingView().ClearPrimitiveDom(b,a)};Msn.MVC.FlatlandView.prototype._GetMapDrawingView=function(){if(this._mapDrawingView==null)this._mapDrawingView=new Msn.Drawing.MapFlatlandView;return this._mapDrawingView}}function MVC_Init_View3D_Drawing(){Msn.MVC.View3D.prototype._DrawAllCollectionLayers=function(){var c=VE_MapManager.GetCollectionCount();for(var a=0;a<c;a++){var b=VE_MapManager.GetCollectionByIndex(a);b._index=a;this._DrawCollectionLayer(b)}};Msn.MVC.View3D.prototype._ClearAllCollectionLayers=function(){};Msn.MVC.View3D.prototype._DrawCollectionLayer=function(a){this._ClearCollectionLayer(a);if(a.GetVisibility()){var d=false;if(a.GetType()==MC_COL_TYPE_FAVORITE)d=true;var e=a.GetShapeCount();for(var b=0;b<e;b++){var c=a.Annotations[b];c.SetIndex(b);if(c.GetVisibility())this._DrawEntity(c,null,false,d,a)}}};Msn.MVC.View3D.prototype._ClearCollectionLayer=function(b){var c=b.GetShapeCount();for(var a=0;a<c;a++)this._ClearEntity(b.Annotations[a])};Msn.MVC.View3D.prototype._HighlightEntity=function(a,c){if(a==null)return;var e=a.GetId(),d=a.GetPrimitive(0);if(d.type==VEShapeType.Pushpin)return;var b=e+this._entityIdShapePostfix;this._spacecontrol.SetGeometryHighlight(this._hackUniqueLayerId,b,c)};Msn.MVC.View3D.prototype._DrawEntityLabel=function(d,t){var e=d.GetPrimitive(0),c=t;if(typeof c=="undefined"||c==null){c=new _VE_EntityDrawingState;c.zIndexIcon=this._GetZIndex(null,d);c.zIndexPolyShape=this._GetZIndexPolyShape(null,d);c.minZoomLevel=b(d);c.maxZoomLevel=a(d);c.isShared=false}if(!c.text){if(typeof c.zIndexIcon=="undefined"||c.zIndexIcon==null)c.zIndexIcon=this._GetZIndex(null,d);c.text=this._GetDefautlStyleProperties(d,d.GetIndex()+1,c.zIndexIcon)}var h=c.text,m=this._hackUniqueLayerId,s=d.GetBusinessListingId(),l="title_search3",p=c.isShared,r=d.IsOverlay(),k=d.GetId(),i=null,j=null,o=0,f=e.symbol,g=null;if(p)l="shared";if(d.IsModel())if(p)l="sharemodel";else l="model";else if(e.type==VEShapeType.Pushpin){var q=r?Msn.VE.PushPinTypes.Overlay:Msn.VE.PushPinTypes.Annotation;if(p)g=PushpinURL(q,"shared");else if(typeof s!="undefined"&&parseInt(s)!=0)g=PushpinURL(q,"business");else g=PushpinURL(q)}if(d.IconUrl)g=d.IconUrl;else if(!g)g=PushpinURL(Msn.VE.PushPinTypes.SearchResultPrecise,l);if(e.type==VEShapeType.Pushpin){i=e.points[0];j=e.points[1];if(f==null){e.symbol=VE_MapDispatch_SymbolLib.GetMapSymbolByID(MC_PROPERTY_PUSHPIN);f=e.symbol}}else{f=this._GetPrimitiveSymbolOrDefault(e);i=e.labelPosX;j=e.labelPosY;o=e.labelPosZ}if(f&&r){if(!f.textbox_OffsetX)f.textbox_OffsetX="50%";if(!f.textbox_OffsetY)f.textbox_OffsetY="50%";if(h&&h.indexOf("textoffset")==-1)h+=' textoffset  ="'+f.textbox_OffsetX+","+f.textbox_OffsetY+'" '}var u=typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null;if(u){g=f.imagedata_src;h=this._GetAPIProperties(d,f,c.zIndexIcon,c.minZoomLevel,c.maxZoomLevel)}if(e.type==VEShapeType.Pushpin)if(e.altitudes==null)this._spacecontrol.AddPointWithProperties(m,k,j,i,g,h);else{var n=e.altitudes[0];if(d.IsModel()&&parseFloat(n)<0)n=0;this._spacecontrol.AddPointWithAltitudeAndProperties(m,k,j,i,n,g,h)}else if(e.isLabel)if(o)this._spacecontrol.AddPointWithAltitudeAndProperties(m,k,j,i,o,g,h);else this._spacecontrol.AddPointWithProperties(m,k,j,i,g,h)};Msn.MVC.View3D.prototype._DrawPolyline=function(f,d){var c=f.GetPrimitive(0),l=f.GetId();if(c.type==VEShapeType.Pushpin)return;var g=this._ConvertPointArrayToView3DParameter(c.points,c.altitudes),b=this._GetPrimitiveSymbolOrDefault(c),k=this._ConvertStrokeWeightToView3DParameter(b.stroke_weight),h=d.zIndexPolyShape,j=d.minZoomLevel,i=d.maxZoomLevel,a=[];a.push("Linecolor='");a.push(b.stroke_color);a.push("'");a.push(" Lineweight='");a.push(k);a.push("'");a.push(" zindex='");a.push(h);a.push("'");a.push(" Dashstyle='");a.push(b.stroke_dashstyle);a.push("'");a.push(" minLOD='");a.push(j);a.push("'");a.push(" maxLOD='");a.push(i);a.push("'");a.push(" extruded='");a.push(c.extruded);a.push("'");a.push(" altitudeMode='");a.push(c.altitudeMode);a.push("'");a.push(" Lineopacity='");a.push(b.stroke_opacity);a.push("'");a.push(" highlightlinecolor='");a.push(b.stroke_color2);a.push("'");var e=l+this._entityIdShapePostfix;if(c.type==VEShapeType.Polygon){a.push(" Fillcolor='");a.push(b.fill_color);a.push("'");a.push(" Fillopacity='");a.push(b.fill_opacity);a.push("'");a.push(" highlightfillcolor='");if(b.fill_color2.indexOf("#")==0&&b.fill_color2.length<8)b.fill_color2="#4C"+b.fill_color2.substring(1);a.push(b.fill_color2);a.push("'");this._spacecontrol.AddPolygonWithProperties(this._hackUniqueLayerId,e,g,a.join(""))}else this._spacecontrol.AddPolylineWithProperties(this._hackUniqueLayerId,e,g,a.join(""))};Msn.MVC.View3D.prototype._DrawEntity=function(c,k,n,m,j){if(c==null)return;var g=c.GetId();if(!c.GetVisibility()){this._spacecontrol.DeleteGeometry(this._hackUniqueLayerId,g);return}var e=typeof j!="object"?null:j;if(c.IsModel()){var f="clientid="+c.GetId()+";msnid="+c.GetMsnId();if(!e)e=VE_MapManager.GetSelectedCollection();f=f+";cclientid="+e.GetId()+";cmsnid="+e.GetMsnId();ProcessModelIn3D(VE_ModelActionType.AddModel,f,this._spacecontrol)}var l=c.GetPrimitive(0),d=new _VE_EntityDrawingState;d.minZoomLevel=b(c);d.maxZoomLevel=a(c);d.isShared=m;d.parentEl=k;var h=l.type==VEShapeType.Pushpin?true:false,i=typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null;if(h||i||!i&&VE_MapManager.IsHighlightEntity(g)){d.zIndexIcon=this._GetZIndex(e,c);d.text=this._GetDefautlStyleProperties(c,c.GetIndex()+1,d.zIndexIcon);this._DrawEntityLabel(c,d)}if(!h){d.zIndexPolyShape=this._GetZIndexPolyShape(e,c);this._DrawPolyline(c,d)}};Msn.MVC.View3D.prototype._GetDefautlStyleProperties=function(b,f,e){var c="",d=b.GetPrimitive(0),a=[];if(b.IconUrl){a.push('text=""');a.push('width="32" ');a.push('height="32" ')}else a.push('text="'+(b.GetIndex()+1)+'" ');a.push('altitudeMode="'+d.altitudeMode+'" ');a.push('zindex ="'+e+'" ');c=a.join(" ");return c};Msn.MVC.View3D.prototype._GetStyleProperties=function(f,i){var h="",g="",e=f.GetPrimitive(0),d=e.symbol;if(e.name)g=e.name;var c=[];c.push('text="'+g+'" ');c.push('altitudeMode="'+e.altitudeMode+'" ');c.push('width="'+d.img_width+'" ');c.push('height="'+d.img_height+'" ');c.push('textbold ="'+d.textbox_bold+'" ');c.push('textfont="'+d.textbox_font+'" ');c.push('textitalics="'+d.textbox_italic+'" ');c.push('textunderline ="'+d.textbox_underscore+'" ');c.push('textsize ="'+d.textbox_size+'" ');c.push('minLOD ="'+b(f)+'" ');c.push('maxLOD ="'+a(f)+'" ');c.push('imageoffset ="'+d.img_offsetX+","+d.img_offsetY+'" ');c.push('textoffset  ="'+d.textbox_OffsetX+","+d.textbox_OffsetY+'" ');var k=d.textbox_color.replace("#","#"+parseInt(d.textbox_color_opacity*255).toString(16)),j=d.textbox_backcolor.replace("#","#"+parseInt(d.textbox_backcolor_opacity*255).toString(16));c.push('forecolor="'+k+'" ');c.push('backcolor ="'+j+'" ');c.push('zindex ="'+i+'" ');h=c.join(" ");return h};Msn.MVC.View3D.prototype._GetAPIProperties=function(c,h,d,f,e){var b,g=c.GetPrimitive(0);if(h.isOn)b=this._GetStyleProperties(c,d);else{var a=[];a.push('text=""');a.push('minLOD ="',f,'" ');a.push('maxLOD ="',e,'" ');a.push('altitudeMode ="',g.altitudeMode,'" ');a.push('zindex ="'+d+'" ');b=a.join(" ")}return b};function b(a){var b=a.minZoomLevel;if(Msn.VE.API!=null&&a._shplayer!=null&&b<a._shplayer.MinScale)b=a._shplayer.MinScale;return b}function a(a){var b=a.maxZoomLevel;if(Msn.VE.API!=null&&a._shplayer!=null&&b>a._shplayer.MaxScale)b=a._shplayer.MaxScale;return b}Msn.MVC.View3D.prototype._GetZIndex=function(a,b){var d=60;if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null){if(a==null)a=VE_MapManager.GetCollectionByAnId(b.GetId());if(a!=null)d=c(a,b)}else d=b.GetZIndex();return d};Msn.MVC.View3D.prototype._GetZIndexPolyShape=function(a,b){var d=60;if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null){if(a==null)a=VE_MapManager.GetCollectionByAnId(b.GetId());if(a!=null)d=c(a,b)}else d=b.GetZIndexPolyShape();return d};function c(c,a){var b=VE_MapManager.GetCollectionCount();return(b-c._index)*MC_MAX_COL_SIZE+a.GetIndex()}Msn.MVC.View3D.prototype._ClearEntity=function(a){if(a.IsModel()){var d="clientid="+a.GetId()+";msnid="+a.GetMsnId()+"";ProcessModelIn3D(VE_ModelActionType.DeleteModel,d,this._spacecontrol)}var c=a.GetId();this._spacecontrol.DeleteGeometry(this._hackUniqueLayerId,c);var b=a.GetPrimitive(0);if(b==null||b.type!=VEShapeType.Pushpin){var e=c+this._entityIdShapePostfix;this._spacecontrol.DeleteGeometry(this._hackUniqueLayerId,e)}};Msn.MVC.View3D.prototype._DrawEntityPrimitive=function(){};Msn.MVC.View3D.prototype._ClearEntityPrimitive=function(a,b){if(a==null)return;if(typeof b!="undefined"&&b==true)if(a.type!=VEShapeType.Pushpin){var c=Msn.Drawing.GetEntityUIDByPrimitiveUID(a.iid);this._spacecontrol.DeleteGeometry(this._hackUniqueLayerId,c)}};Msn.MVC.View3D.prototype._ConvertPointArrayToView3DParameter=function(c,b){var a="",d=c.length;for(i=0;i<d;i+=2){var e=c[i],f=c[i+1];if(b==null||b.length!=d/2)a=a.concat(e,",",f," ");else a=a.concat(e,",",f,",",b[i/2]," ")}return a};Msn.MVC.View3D.prototype._ConvertStrokeWeightToView3DParameter=function(a){if(a==null)return"2px";var b=parseInt(a);if(isNaN(b))return"2px";else return b+"px"};Msn.MVC.View3D.prototype._GetPrimitiveSymbolOrDefault=function(b){var a=b.symbol;if(a==null)return VE_MapDispatch_SymbolLib.GetCurrentDefaultSymbol();return a}}function MVC_Init_ViewFacade_Drawing(){}VE_SetModuleStatus(VE_ModuleName.API3D,"loaded");VEMap.prototype.Init3D=function(){MVC_Init_AbstractView_Shared();MVC_Init_ViewFacade_Shared();MVC_Init_View3D_Shared();MVC_Init_AbstractView_Drawing();MVC_Init_ViewFacade_Drawing();MVC_Init_FlatlandView_Drawing();MVC_Init_View3D_Drawing()};if(typeof closeDependency!="undefined")closeDependency("mapcontrol.js")
var Scriptaculous={Version:'1.8.0',require:function(libraryName){document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');},REQUIRED_PROTOTYPE:'1.6.0',load:function(){function convertVersionString(versionString){var r=versionString.split('.');return parseInt(r[0])*100000+parseInt(r[1])*1000+parseInt(r[2]);}
if((typeof Prototype=='undefined')||(typeof Element=='undefined')||(typeof Element.Methods=='undefined')||(convertVersionString(Prototype.Version)<convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))
throw("script.aculo.us requires the Prototype JavaScript framework >= "+
Scriptaculous.REQUIRED_PROTOTYPE);$A(document.getElementsByTagName("script")).findAll(function(s){return(s.src&&s.src.match(/scriptaculous\.js(\?.*)?$/))}).each(function(s){var path=s.src.replace(/scriptaculous\.js(\?.*)?$/,'');var includes=s.src.match(/\?.*load=([a-z,]*)/);(includes?includes[1]:'builder,effects,dragdrop').split(',').each(function(include){Scriptaculous.require(path+include+'.js')});});}}
Scriptaculous.load();
var Builder={NODEMAP:{AREA:'map',CAPTION:'table',COL:'table',COLGROUP:'table',LEGEND:'fieldset',OPTGROUP:'select',OPTION:'select',PARAM:'object',TBODY:'table',TD:'table',TFOOT:'table',TH:'table',THEAD:'table',TR:'table'},node:function(elementName){elementName=elementName.toUpperCase();var parentTag=this.NODEMAP[elementName]||'div';var parentElement=document.createElement(parentTag);try{parentElement.innerHTML="<"+elementName+"></"+elementName+">";}catch(e){}
var element=parentElement.firstChild||null;if(element&&(element.tagName.toUpperCase()!=elementName))
element=element.getElementsByTagName(elementName)[0];if(!element)element=document.createElement(elementName);if(!element)return;if(arguments[1])
if(this._isStringOrNumber(arguments[1])||(arguments[1]instanceof Array)||arguments[1].tagName){this._children(element,arguments[1]);}else{var attrs=this._attributes(arguments[1]);if(attrs.length){try{parentElement.innerHTML="<"+elementName+" "+
attrs+"></"+elementName+">";}catch(e){}
element=parentElement.firstChild||null;if(!element){element=document.createElement(elementName);for(attr in arguments[1])
element[attr=='class'?'className':attr]=arguments[1][attr];}
if(element.tagName.toUpperCase()!=elementName)
element=parentElement.getElementsByTagName(elementName)[0];}}
if(arguments[2])
this._children(element,arguments[2]);return element;},_text:function(text){return document.createTextNode(text);},ATTR_MAP:{'className':'class','htmlFor':'for'},_attributes:function(attributes){var attrs=[];for(attribute in attributes)
attrs.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+attributes[attribute].toString().escapeHTML().gsub(/"/,'&quot;')+'"');return attrs.join(" ");},_children:function(element,children){if(children.tagName){element.appendChild(children);return;}
if(typeof children=='object'){children.flatten().each(function(e){if(typeof e=='object')
element.appendChild(e)
else
if(Builder._isStringOrNumber(e))
element.appendChild(Builder._text(e));});}else
if(Builder._isStringOrNumber(children))
element.appendChild(Builder._text(children));},_isStringOrNumber:function(param){return(typeof param=='string'||typeof param=='number');},build:function(html){var element=this.node('div');$(element).update(html.strip());return element.down();},dump:function(scope){if(typeof scope!='object'&&typeof scope!='function')scope=window;var tags=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY "+"BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET "+"FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+"KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+"PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+"TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);tags.each(function(tag){scope[tag]=function(){return Builder.node.apply(Builder,[tag].concat($A(arguments)));}});}}
String.prototype.parseColor=function(){var color='#';if(this.slice(0,4)=='rgb('){var cols=this.slice(4,this.length-1).split(',');var i=0;do{color+=parseInt(cols[i]).toColorPart()}while(++i<3);}else{if(this.slice(0,1)=='#'){if(this.length==4)for(var i=1;i<4;i++)color+=(this.charAt(i)+this.charAt(i)).toLowerCase();if(this.length==7)color=this.toLowerCase();}}
return(color.length==7?color:(arguments[0]||this));};Element.collectTextNodes=function(element){return $A($(element).childNodes).collect(function(node){return(node.nodeType==3?node.nodeValue:(node.hasChildNodes()?Element.collectTextNodes(node):''));}).flatten().join('');};Element.collectTextNodesIgnoreClass=function(element,className){return $A($(element).childNodes).collect(function(node){return(node.nodeType==3?node.nodeValue:((node.hasChildNodes()&&!Element.hasClassName(node,className))?Element.collectTextNodesIgnoreClass(node,className):''));}).flatten().join('');};Element.setContentZoom=function(element,percent){element=$(element);element.setStyle({fontSize:(percent/100)+'em'});if(Prototype.Browser.WebKit)window.scrollBy(0,0);return element;};Element.getInlineOpacity=function(element){return $(element).style.opacity||'';};Element.forceRerendering=function(element){try{element=$(element);var n=document.createTextNode(' ');element.appendChild(n);element.removeChild(n);}catch(e){}};var Effect={_elementDoesNotExistError:{name:'ElementDoesNotExistError',message:'The specified DOM element does not exist, but is required for this effect to operate'},Transitions:{linear:Prototype.K,sinoidal:function(pos){return(-Math.cos(pos*Math.PI)/2)+0.5;},reverse:function(pos){return 1-pos;},flicker:function(pos){var pos=((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;return pos>1?1:pos;},wobble:function(pos){return(-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;},pulse:function(pos,pulses){pulses=pulses||5;return(((pos%(1/pulses))*pulses).round()==0?((pos*pulses*2)-(pos*pulses*2).floor()):1-((pos*pulses*2)-(pos*pulses*2).floor()));},spring:function(pos){return 1-(Math.cos(pos*4.5*Math.PI)*Math.exp(-pos*6));},none:function(pos){return 0;},full:function(pos){return 1;}},DefaultOptions:{duration:1.0,fps:100,sync:false,from:0.0,to:1.0,delay:0.0,queue:'parallel'},tagifyText:function(element){var tagifyStyle='position:relative';if(Prototype.Browser.IE)tagifyStyle+=';zoom:1';element=$(element);$A(element.childNodes).each(function(child){if(child.nodeType==3){child.nodeValue.toArray().each(function(character){element.insertBefore(new Element('span',{style:tagifyStyle}).update(character==' '?String.fromCharCode(160):character),child);});Element.remove(child);}});},multiple:function(element,effect){var elements;if(((typeof element=='object')||Object.isFunction(element))&&(element.length))
elements=element;else
elements=$(element).childNodes;var options=Object.extend({speed:0.1,delay:0.0},arguments[2]||{});var masterDelay=options.delay;$A(elements).each(function(element,index){new effect(element,Object.extend(options,{delay:index*options.speed+masterDelay}));});},PAIRS:{'slide':['SlideDown','SlideUp'],'blind':['BlindDown','BlindUp'],'appear':['Appear','Fade']},toggle:function(element,effect){element=$(element);effect=(effect||'appear').toLowerCase();var options=Object.extend({queue:{position:'end',scope:(element.id||'global'),limit:1}},arguments[2]||{});Effect[element.visible()?Effect.PAIRS[effect][1]:Effect.PAIRS[effect][0]](element,options);}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null;},_each:function(iterator){this.effects._each(iterator);},add:function(effect){var timestamp=new Date().getTime();var position=Object.isString(effect.options.queue)?effect.options.queue:effect.options.queue.position;switch(position){case'front':this.effects.findAll(function(e){return e.state=='idle'}).each(function(e){e.startOn+=effect.finishOn;e.finishOn+=effect.finishOn;});break;case'with-last':timestamp=this.effects.pluck('startOn').max()||timestamp;break;case'end':timestamp=this.effects.pluck('finishOn').max()||timestamp;break;}
effect.startOn+=timestamp;effect.finishOn+=timestamp;if(!effect.options.queue.limit||(this.effects.length<effect.options.queue.limit))
this.effects.push(effect);if(!this.interval)
this.interval=setInterval(this.loop.bind(this),15);},remove:function(effect){this.effects=this.effects.reject(function(e){return e==effect});if(this.effects.length==0){clearInterval(this.interval);this.interval=null;}},loop:function(){var timePos=new Date().getTime();for(var i=0,len=this.effects.length;i<len;i++)
this.effects[i]&&this.effects[i].loop(timePos);}});Effect.Queues={instances:$H(),get:function(queueName){if(!Object.isString(queueName))return queueName;return this.instances.get(queueName)||this.instances.set(queueName,new Effect.ScopedQueue());}};Effect.Queue=Effect.Queues.get('global');Effect.Base=Class.create({position:null,start:function(options){function codeForEvent(options,eventName){return((options[eventName+'Internal']?'this.options.'+eventName+'Internal(this);':'')+
(options[eventName]?'this.options.'+eventName+'(this);':''));}
if(options&&options.transition===false)options.transition=Effect.Transitions.linear;this.options=Object.extend(Object.extend({},Effect.DefaultOptions),options||{});this.currentFrame=0;this.state='idle';this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;eval('this.render = function(pos){ '+'if (this.state=="idle"){this.state="running";'+
codeForEvent(this.options,'beforeSetup')+
(this.setup?'this.setup();':'')+
codeForEvent(this.options,'afterSetup')+'};if (this.state=="running"){'+'pos=this.options.transition(pos)*'+this.fromToDelta+'+'+this.options.from+';'+'this.position=pos;'+
codeForEvent(this.options,'beforeUpdate')+
(this.update?'this.update(pos);':'')+
codeForEvent(this.options,'afterUpdate')+'}}');this.event('beforeStart');if(!this.options.sync)
Effect.Queues.get(Object.isString(this.options.queue)?'global':this.options.queue.scope).add(this);},loop:function(timePos){if(timePos>=this.startOn){if(timePos>=this.finishOn){this.render(1.0);this.cancel();this.event('beforeFinish');if(this.finish)this.finish();this.event('afterFinish');return;}
var pos=(timePos-this.startOn)/this.totalTime,frame=(pos*this.totalFrames).round();if(frame>this.currentFrame){this.render(pos);this.currentFrame=frame;}}},cancel:function(){if(!this.options.sync)
Effect.Queues.get(Object.isString(this.options.queue)?'global':this.options.queue.scope).remove(this);this.state='finished';},event:function(eventName){if(this.options[eventName+'Internal'])this.options[eventName+'Internal'](this);if(this.options[eventName])this.options[eventName](this);},inspect:function(){var data=$H();for(property in this)
if(!Object.isFunction(this[property]))data.set(property,this[property]);return'#<Effect:'+data.inspect()+',options:'+$H(this.options).inspect()+'>';}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(effects){this.effects=effects||[];this.start(arguments[1]);},update:function(position){this.effects.invoke('render',position);},finish:function(position){this.effects.each(function(effect){effect.render(1.0);effect.cancel();effect.event('beforeFinish');if(effect.finish)effect.finish(position);effect.event('afterFinish');});}});Effect.Tween=Class.create(Effect.Base,{initialize:function(object,from,to){object=Object.isString(object)?$(object):object;var args=$A(arguments),method=args.last(),options=args.length==5?args[3]:null;this.method=Object.isFunction(method)?method.bind(object):Object.isFunction(object[method])?object[method].bind(object):function(value){object[method]=value};this.start(Object.extend({from:from,to:to},options||{}));},update:function(position){this.method(position);}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}));},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element)throw(Effect._elementDoesNotExistError);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout))
this.element.setStyle({zoom:1});var options=Object.extend({from:this.element.getOpacity()||0.0,to:1.0},arguments[1]||{});this.start(options);},update:function(position){this.element.setOpacity(position);}});Effect.Move=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element)throw(Effect._elementDoesNotExistError);var options=Object.extend({x:0,y:0,mode:'relative'},arguments[1]||{});this.start(options);},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle('left')||'0');this.originalTop=parseFloat(this.element.getStyle('top')||'0');if(this.options.mode=='absolute'){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop;}},update:function(position){this.element.setStyle({left:(this.options.x*position+this.originalLeft).round()+'px',top:(this.options.y*position+this.originalTop).round()+'px'});}});Effect.MoveBy=function(element,toTop,toLeft){return new Effect.Move(element,Object.extend({x:toLeft,y:toTop},arguments[3]||{}));};Effect.Scale=Class.create(Effect.Base,{initialize:function(element,percent){this.element=$(element);if(!this.element)throw(Effect._elementDoesNotExistError);var options=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:'box',scaleFrom:100.0,scaleTo:percent},arguments[2]||{});this.start(options);},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle('position');this.originalStyle={};['top','left','width','height','fontSize'].each(function(k){this.originalStyle[k]=this.element.style[k];}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var fontSize=this.element.getStyle('font-size')||'100%';['em','px','%','pt'].each(function(fontSizeType){if(fontSize.indexOf(fontSizeType)>0){this.fontSize=parseFloat(fontSize);this.fontSizeType=fontSizeType;}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=='box')
this.dims=[this.element.offsetHeight,this.element.offsetWidth];if(/^content/.test(this.options.scaleMode))
this.dims=[this.element.scrollHeight,this.element.scrollWidth];if(!this.dims)
this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth];},update:function(position){var currentScale=(this.options.scaleFrom/100.0)+(this.factor*position);if(this.options.scaleContent&&this.fontSize)
this.element.setStyle({fontSize:this.fontSize*currentScale+this.fontSizeType});this.setDimensions(this.dims[0]*currentScale,this.dims[1]*currentScale);},finish:function(position){if(this.restoreAfterFinish)this.element.setStyle(this.originalStyle);},setDimensions:function(height,width){var d={};if(this.options.scaleX)d.width=width.round()+'px';if(this.options.scaleY)d.height=height.round()+'px';if(this.options.scaleFromCenter){var topd=(height-this.dims[0])/2;var leftd=(width-this.dims[1])/2;if(this.elementPositioning=='absolute'){if(this.options.scaleY)d.top=this.originalTop-topd+'px';if(this.options.scaleX)d.left=this.originalLeft-leftd+'px';}else{if(this.options.scaleY)d.top=-topd+'px';if(this.options.scaleX)d.left=-leftd+'px';}}
this.element.setStyle(d);}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element)throw(Effect._elementDoesNotExistError);var options=Object.extend({startcolor:'#ffff99'},arguments[1]||{});this.start(options);},setup:function(){if(this.element.getStyle('display')=='none'){this.cancel();return;}
this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle('background-image');this.element.setStyle({backgroundImage:'none'});}
if(!this.options.endcolor)
this.options.endcolor=this.element.getStyle('background-color').parseColor('#ffffff');if(!this.options.restorecolor)
this.options.restorecolor=this.element.getStyle('background-color');this._base=$R(0,2).map(function(i){return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(i){return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i]}.bind(this));},update:function(position){this.element.setStyle({backgroundColor:$R(0,2).inject('#',function(m,v,i){return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart());}.bind(this))});},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}));}});Effect.ScrollTo=function(element){var options=arguments[1]||{},scrollOffsets=document.viewport.getScrollOffsets(),elementOffsets=$(element).cumulativeOffset(),max=(window.height||document.body.scrollHeight)-document.viewport.getHeight();if(options.offset)elementOffsets[1]+=options.offset;return new Effect.Tween(null,scrollOffsets.top,elementOffsets[1]>max?max:elementOffsets[1],options,function(p){scrollTo(scrollOffsets.left,p.round())});};Effect.Fade=function(element){element=$(element);var oldOpacity=element.getInlineOpacity();var options=Object.extend({from:element.getOpacity()||1.0,to:0.0,afterFinishInternal:function(effect){if(effect.options.to!=0)return;effect.element.hide().setStyle({opacity:oldOpacity});}},arguments[1]||{});return new Effect.Opacity(element,options);};Effect.Appear=function(element){element=$(element);var options=Object.extend({from:(element.getStyle('display')=='none'?0.0:element.getOpacity()||0.0),to:1.0,afterFinishInternal:function(effect){effect.element.forceRerendering();},beforeSetup:function(effect){effect.element.setOpacity(effect.options.from).show();}},arguments[1]||{});return new Effect.Opacity(element,options);};Effect.Puff=function(element){element=$(element);var oldStyle={opacity:element.getInlineOpacity(),position:element.getStyle('position'),top:element.style.top,left:element.style.left,width:element.style.width,height:element.style.height};return new Effect.Parallel([new Effect.Scale(element,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(element,{sync:true,to:0.0})],Object.extend({duration:1.0,beforeSetupInternal:function(effect){Position.absolutize(effect.effects[0].element)},afterFinishInternal:function(effect){effect.effects[0].element.hide().setStyle(oldStyle);}},arguments[1]||{}));};Effect.BlindUp=function(element){element=$(element);element.makeClipping();return new Effect.Scale(element,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(effect){effect.element.hide().undoClipping();}},arguments[1]||{}));};Effect.BlindDown=function(element){element=$(element);var elementDimensions=element.getDimensions();return new Effect.Scale(element,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:elementDimensions.height,originalWidth:elementDimensions.width},restoreAfterFinish:true,afterSetup:function(effect){effect.element.makeClipping().setStyle({height:'0px'}).show();},afterFinishInternal:function(effect){effect.element.undoClipping();}},arguments[1]||{}));};Effect.SwitchOff=function(element){element=$(element);var oldOpacity=element.getInlineOpacity();return new Effect.Appear(element,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(effect){new Effect.Scale(effect.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(effect){effect.element.makePositioned().makeClipping();},afterFinishInternal:function(effect){effect.element.hide().undoClipping().undoPositioned().setStyle({opacity:oldOpacity});}})}},arguments[1]||{}));};Effect.DropOut=function(element){element=$(element);var oldStyle={top:element.getStyle('top'),left:element.getStyle('left'),opacity:element.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(element,{x:0,y:100,sync:true}),new Effect.Opacity(element,{sync:true,to:0.0})],Object.extend({duration:0.5,beforeSetup:function(effect){effect.effects[0].element.makePositioned();},afterFinishInternal:function(effect){effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);}},arguments[1]||{}));};Effect.Shake=function(element){element=$(element);var options=Object.extend({distance:20,duration:0.5},arguments[1]||{});var distance=parseFloat(options.distance);var split=parseFloat(options.duration)/10.0;var oldStyle={top:element.getStyle('top'),left:element.getStyle('left')};return new Effect.Move(element,{x:distance,y:0,duration:split,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:-distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:-distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:-distance,y:0,duration:split,afterFinishInternal:function(effect){effect.element.undoPositioned().setStyle(oldStyle);}})}})}})}})}})}});};Effect.SlideDown=function(element){element=$(element).cleanWhitespace();var oldInnerBottom=element.down().getStyle('bottom');var elementDimensions=element.getDimensions();return new Effect.Scale(element,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:elementDimensions.height,originalWidth:elementDimensions.width},restoreAfterFinish:true,afterSetup:function(effect){effect.element.makePositioned();effect.element.down().makePositioned();if(window.opera)effect.element.setStyle({top:''});effect.element.makeClipping().setStyle({height:'0px'}).show();},afterUpdateInternal:function(effect){effect.element.down().setStyle({bottom:(effect.dims[0]-effect.element.clientHeight)+'px'});},afterFinishInternal:function(effect){effect.element.undoClipping().undoPositioned();effect.element.down().undoPositioned().setStyle({bottom:oldInnerBottom});}},arguments[1]||{}));};Effect.SlideUp=function(element){element=$(element).cleanWhitespace();var oldInnerBottom=element.down().getStyle('bottom');var elementDimensions=element.getDimensions();return new Effect.Scale(element,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:'box',scaleFrom:100,scaleMode:{originalHeight:elementDimensions.height,originalWidth:elementDimensions.width},restoreAfterFinish:true,afterSetup:function(effect){effect.element.makePositioned();effect.element.down().makePositioned();if(window.opera)effect.element.setStyle({top:''});effect.element.makeClipping().show();},afterUpdateInternal:function(effect){effect.element.down().setStyle({bottom:(effect.dims[0]-effect.element.clientHeight)+'px'});},afterFinishInternal:function(effect){effect.element.hide().undoClipping().undoPositioned();effect.element.down().undoPositioned().setStyle({bottom:oldInnerBottom});}},arguments[1]||{}));};Effect.Squish=function(element){return new Effect.Scale(element,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(effect){effect.element.makeClipping();},afterFinishInternal:function(effect){effect.element.hide().undoClipping();}});};Effect.Grow=function(element){element=$(element);var options=Object.extend({direction:'center',moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var oldStyle={top:element.style.top,left:element.style.left,height:element.style.height,width:element.style.width,opacity:element.getInlineOpacity()};var dims=element.getDimensions();var initialMoveX,initialMoveY;var moveX,moveY;switch(options.direction){case'top-left':initialMoveX=initialMoveY=moveX=moveY=0;break;case'top-right':initialMoveX=dims.width;initialMoveY=moveY=0;moveX=-dims.width;break;case'bottom-left':initialMoveX=moveX=0;initialMoveY=dims.height;moveY=-dims.height;break;case'bottom-right':initialMoveX=dims.width;initialMoveY=dims.height;moveX=-dims.width;moveY=-dims.height;break;case'center':initialMoveX=dims.width/2;initialMoveY=dims.height/2;moveX=-dims.width/2;moveY=-dims.height/2;break;}
return new Effect.Move(element,{x:initialMoveX,y:initialMoveY,duration:0.01,beforeSetup:function(effect){effect.element.hide().makeClipping().makePositioned();},afterFinishInternal:function(effect){new Effect.Parallel([new Effect.Opacity(effect.element,{sync:true,to:1.0,from:0.0,transition:options.opacityTransition}),new Effect.Move(effect.element,{x:moveX,y:moveY,sync:true,transition:options.moveTransition}),new Effect.Scale(effect.element,100,{scaleMode:{originalHeight:dims.height,originalWidth:dims.width},sync:true,scaleFrom:window.opera?1:0,transition:options.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(effect){effect.effects[0].element.setStyle({height:'0px'}).show();},afterFinishInternal:function(effect){effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle);}},options))}});};Effect.Shrink=function(element){element=$(element);var options=Object.extend({direction:'center',moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var oldStyle={top:element.style.top,left:element.style.left,height:element.style.height,width:element.style.width,opacity:element.getInlineOpacity()};var dims=element.getDimensions();var moveX,moveY;switch(options.direction){case'top-left':moveX=moveY=0;break;case'top-right':moveX=dims.width;moveY=0;break;case'bottom-left':moveX=0;moveY=dims.height;break;case'bottom-right':moveX=dims.width;moveY=dims.height;break;case'center':moveX=dims.width/2;moveY=dims.height/2;break;}
return new Effect.Parallel([new Effect.Opacity(element,{sync:true,to:0.0,from:1.0,transition:options.opacityTransition}),new Effect.Scale(element,window.opera?1:0,{sync:true,transition:options.scaleTransition,restoreAfterFinish:true}),new Effect.Move(element,{x:moveX,y:moveY,sync:true,transition:options.moveTransition})],Object.extend({beforeStartInternal:function(effect){effect.effects[0].element.makePositioned().makeClipping();},afterFinishInternal:function(effect){effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle);}},options));};Effect.Pulsate=function(element){element=$(element);var options=arguments[1]||{};var oldOpacity=element.getInlineOpacity();var transition=options.transition||Effect.Transitions.sinoidal;var reverser=function(pos){return transition(1-Effect.Transitions.pulse(pos,options.pulses))};reverser.bind(transition);return new Effect.Opacity(element,Object.extend(Object.extend({duration:2.0,from:0,afterFinishInternal:function(effect){effect.element.setStyle({opacity:oldOpacity});}},options),{transition:reverser}));};Effect.Fold=function(element){element=$(element);var oldStyle={top:element.style.top,left:element.style.left,width:element.style.width,height:element.style.height};element.makeClipping();return new Effect.Scale(element,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(effect){new Effect.Scale(element,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(effect){effect.element.hide().undoClipping().setStyle(oldStyle);}});}},arguments[1]||{}));};Effect.Morph=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element)throw(Effect._elementDoesNotExistError);var options=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(options.style))this.style=$H(options.style);else{if(options.style.include(':'))
this.style=options.style.parseStyle();else{this.element.addClassName(options.style);this.style=$H(this.element.getStyles());this.element.removeClassName(options.style);var css=this.element.getStyles();this.style=this.style.reject(function(style){return style.value==css[style.key];});options.afterFinishInternal=function(effect){effect.element.addClassName(effect.options.style);effect.transforms.each(function(transform){effect.element.style[transform.style]='';});}}}
this.start(options);},setup:function(){function parseColor(color){if(!color||['rgba(0, 0, 0, 0)','transparent'].include(color))color='#ffffff';color=color.parseColor();return $R(0,2).map(function(i){return parseInt(color.slice(i*2+1,i*2+3),16)});}
this.transforms=this.style.map(function(pair){var property=pair[0],value=pair[1],unit=null;if(value.parseColor('#zzzzzz')!='#zzzzzz'){value=value.parseColor();unit='color';}else if(property=='opacity'){value=parseFloat(value);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout))
this.element.setStyle({zoom:1});}else if(Element.CSS_LENGTH.test(value)){var components=value.match(/^([\+\-]?[0-9\.]+)(.*)$/);value=parseFloat(components[1]);unit=(components.length==3)?components[2]:null;}
var originalValue=this.element.getStyle(property);return{style:property.camelize(),originalValue:unit=='color'?parseColor(originalValue):parseFloat(originalValue||0),targetValue:unit=='color'?parseColor(value):value,unit:unit};}.bind(this)).reject(function(transform){return((transform.originalValue==transform.targetValue)||(transform.unit!='color'&&(isNaN(transform.originalValue)||isNaN(transform.targetValue))))});},update:function(position){var style={},transform,i=this.transforms.length;while(i--)
style[(transform=this.transforms[i]).style]=transform.unit=='color'?'#'+
(Math.round(transform.originalValue[0]+
(transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart()+
(Math.round(transform.originalValue[1]+
(transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart()+
(Math.round(transform.originalValue[2]+
(transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart():(transform.originalValue+
(transform.targetValue-transform.originalValue)*position).toFixed(3)+
(transform.unit===null?'':transform.unit);this.element.setStyle(style,true);}});Effect.Transform=Class.create({initialize:function(tracks){this.tracks=[];this.options=arguments[1]||{};this.addTracks(tracks);},addTracks:function(tracks){tracks.each(function(track){track=$H(track);var data=track.values().first();this.tracks.push($H({ids:track.keys().first(),effect:Effect.Morph,options:{style:data}}));}.bind(this));return this;},play:function(){return new Effect.Parallel(this.tracks.map(function(track){var ids=track.get('ids'),effect=track.get('effect'),options=track.get('options');var elements=[$(ids)||$$(ids)].flatten();return elements.map(function(e){return new effect(e,Object.extend({sync:true},options))});}).flatten(),this.options);}});Element.CSS_PROPERTIES=$w('backgroundColor backgroundPosition borderBottomColor borderBottomStyle '+'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth '+'borderRightColor borderRightStyle borderRightWidth borderSpacing '+'borderTopColor borderTopStyle borderTopWidth bottom clip color '+'fontSize fontWeight height left letterSpacing lineHeight '+'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+'maxWidth minHeight minWidth opacity outlineColor outlineOffset '+'outlineWidth paddingBottom paddingLeft paddingRight paddingTop '+'right textIndent top width wordSpacing zIndex');Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement('div');String.prototype.parseStyle=function(){var style,styleRules=$H();if(Prototype.Browser.WebKit)
style=new Element('div',{style:this}).style;else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';style=String.__parseStyleElement.childNodes[0].style;}
Element.CSS_PROPERTIES.each(function(property){if(style[property])styleRules.set(property,style[property]);});if(Prototype.Browser.IE&&this.include('opacity'))
styleRules.set('opacity',this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);return styleRules;};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(element){var css=document.defaultView.getComputedStyle($(element),null);return Element.CSS_PROPERTIES.inject({},function(styles,property){styles[property]=css[property];return styles;});};}else{Element.getStyles=function(element){element=$(element);var css=element.currentStyle,styles;styles=Element.CSS_PROPERTIES.inject({},function(results,property){results[property]=css[property];return results;});if(!styles.opacity)styles.opacity=element.getOpacity();return styles;};};Effect.Methods={morph:function(element,style){element=$(element);new Effect.Morph(element,Object.extend({style:style},arguments[2]||{}));return element;},visualEffect:function(element,effect,options){element=$(element)
var s=effect.dasherize().camelize(),klass=s.charAt(0).toUpperCase()+s.substring(1);new Effect[klass](element,options);return element;},highlight:function(element,options){element=$(element);new Effect.Highlight(element,options);return element;}};$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+'pulsate shake puff squish switchOff dropOut').each(function(effect){Effect.Methods[effect]=function(element,options){element=$(element);Effect[effect.charAt(0).toUpperCase()+effect.substring(1)](element,options);return element;}});$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each(function(f){Effect.Methods[f]=Element[f];});Element.addMethods(Effect.Methods);
if(Object.isUndefined(Effect))
throw("dragdrop.js requires including script.aculo.us' effects.js library");var Droppables={drops:[],remove:function(element){this.drops=this.drops.reject(function(d){return d.element==$(element)});},add:function(element){element=$(element);var options=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});if(options.containment){options._containers=[];var containment=options.containment;if(Object.isArray(containment)){containment.each(function(c){options._containers.push($(c))});}else{options._containers.push($(containment));}}
if(options.accept)options.accept=[options.accept].flatten();Element.makePositioned(element);options.element=element;this.drops.push(options);},findDeepestChild:function(drops){deepest=drops[0];for(i=1;i<drops.length;++i)
if(Element.isParent(drops[i].element,deepest.element))
deepest=drops[i];return deepest;},isContained:function(element,drop){var containmentNode;if(drop.tree){containmentNode=element.treeNode;}else{containmentNode=element.parentNode;}
return drop._containers.detect(function(c){return containmentNode==c});},isAffected:function(point,element,drop){return((drop.element!=element)&&((!drop._containers)||this.isContained(element,drop))&&((!drop.accept)||(Element.classNames(element).detect(function(v){return drop.accept.include(v)})))&&Position.within(drop.element,point[0],point[1]));},deactivate:function(drop){if(drop.hoverclass)
Element.removeClassName(drop.element,drop.hoverclass);this.last_active=null;},activate:function(drop){if(drop.hoverclass)
Element.addClassName(drop.element,drop.hoverclass);this.last_active=drop;},show:function(point,element){if(!this.drops.length)return;var drop,affected=[];this.drops.each(function(drop){if(Droppables.isAffected(point,element,drop))
affected.push(drop);});if(affected.length>0)
drop=Droppables.findDeepestChild(affected);if(this.last_active&&this.last_active!=drop)this.deactivate(this.last_active);if(drop){Position.within(drop.element,point[0],point[1]);if(drop.onHover)
drop.onHover(element,drop.element,Position.overlap(drop.overlap,drop.element));if(drop!=this.last_active)Droppables.activate(drop);}},fire:function(event,element){if(!this.last_active)return;Position.prepare();if(this.isAffected([Event.pointerX(event),Event.pointerY(event)],element,this.last_active))
if(this.last_active.onDrop){this.last_active.onDrop(element,this.last_active.element,event);return true;}},reset:function(){if(this.last_active)
this.deactivate(this.last_active);}}
var Draggables={drags:[],observers:[],register:function(draggable){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress);}
this.drags.push(draggable);},unregister:function(draggable){this.drags=this.drags.reject(function(d){return d==draggable});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress);}},activate:function(draggable){if(draggable.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=draggable;}.bind(this),draggable.options.delay);}else{window.focus();this.activeDraggable=draggable;}},deactivate:function(){this.activeDraggable=null;},updateDrag:function(event){if(!this.activeDraggable)return;var pointer=[Event.pointerX(event),Event.pointerY(event)];if(this._lastPointer&&(this._lastPointer.inspect()==pointer.inspect()))return;this._lastPointer=pointer;this.activeDraggable.updateDrag(event,pointer);},endDrag:function(event){if(this._timeout){clearTimeout(this._timeout);this._timeout=null;}
if(!this.activeDraggable)return;this._lastPointer=null;this.activeDraggable.endDrag(event);this.activeDraggable=null;},keyPress:function(event){if(this.activeDraggable)
this.activeDraggable.keyPress(event);},addObserver:function(observer){this.observers.push(observer);this._cacheObserverCallbacks();},removeObserver:function(element){this.observers=this.observers.reject(function(o){return o.element==element});this._cacheObserverCallbacks();},notify:function(eventName,draggable,event){if(this[eventName+'Count']>0)
this.observers.each(function(o){if(o[eventName])o[eventName](eventName,draggable,event);});if(draggable.options[eventName])draggable.options[eventName](draggable,event);},_cacheObserverCallbacks:function(){['onStart','onEnd','onDrag'].each(function(eventName){Draggables[eventName+'Count']=Draggables.observers.select(function(o){return o[eventName];}).length;});}}
var Draggable=Class.create({initialize:function(element){var defaults={handle:false,reverteffect:function(element,top_offset,left_offset){var dur=Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;new Effect.Move(element,{x:-left_offset,y:-top_offset,duration:dur,queue:{scope:'_draggable',position:'end'}});},endeffect:function(element){var toOpacity=Object.isNumber(element._opacity)?element._opacity:1.0;new Effect.Opacity(element,{duration:0.2,from:0.7,to:toOpacity,queue:{scope:'_draggable',position:'end'},afterFinish:function(){Draggable._dragging[element]=false}});},zindex:1000,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!arguments[1]||Object.isUndefined(arguments[1].endeffect))
Object.extend(defaults,{starteffect:function(element){element._opacity=Element.getOpacity(element);Draggable._dragging[element]=true;new Effect.Opacity(element,{duration:0.2,from:element._opacity,to:0.7});}});var options=Object.extend(defaults,arguments[1]||{});this.element=$(element);if(options.handle&&Object.isString(options.handle))
this.handle=this.element.down('.'+options.handle,0);if(!this.handle)this.handle=$(options.handle);if(!this.handle)this.handle=this.element;if(options.scroll&&!options.scroll.scrollTo&&!options.scroll.outerHTML){options.scroll=$(options.scroll);this._isScrollChild=Element.childOf(this.element,options.scroll);}
Element.makePositioned(this.element);this.options=options;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this);},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);Draggables.unregister(this);},currentDelta:function(){return([parseInt(Element.getStyle(this.element,'left')||'0'),parseInt(Element.getStyle(this.element,'top')||'0')]);},initDrag:function(event){if(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element])return;if(Event.isLeftClick(event)){var src=Event.element(event);if((tag_name=src.tagName.toUpperCase())&&(tag_name=='INPUT'||tag_name=='SELECT'||tag_name=='OPTION'||tag_name=='BUTTON'||tag_name=='TEXTAREA'))return;var pointer=[Event.pointerX(event),Event.pointerY(event)];var pos=Position.cumulativeOffset(this.element);this.offset=[0,1].map(function(i){return(pointer[i]-pos[i])});Draggables.activate(this);Event.stop(event);}},startDrag:function(event){this.dragging=true;if(!this.delta)
this.delta=this.currentDelta();if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,'z-index')||0);this.element.style.zIndex=this.options.zindex;}
if(this.options.ghosting){this._clone=this.element.cloneNode(true);this.element._originallyAbsolute=(this.element.getStyle('position')=='absolute');if(!this.element._originallyAbsolute)
Position.absolutize(this.element);this.element.parentNode.insertBefore(this._clone,this.element);}
if(this.options.scroll){if(this.options.scroll==window){var where=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=where.left;this.originalScrollTop=where.top;}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop;}}
Draggables.notify('onStart',this,event);if(this.options.starteffect)this.options.starteffect(this.element);},updateDrag:function(event,pointer){if(!this.dragging)this.startDrag(event);if(!this.options.quiet){Position.prepare();Droppables.show(pointer,this.element);}
Draggables.notify('onDrag',this,event);this.draw(pointer);if(this.options.change)this.options.change(this);if(this.options.scroll){this.stopScrolling();var p;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height];}}else{p=Position.page(this.options.scroll);p[0]+=this.options.scroll.scrollLeft+Position.deltaX;p[1]+=this.options.scroll.scrollTop+Position.deltaY;p.push(p[0]+this.options.scroll.offsetWidth);p.push(p[1]+this.options.scroll.offsetHeight);}
var speed=[0,0];if(pointer[0]<(p[0]+this.options.scrollSensitivity))speed[0]=pointer[0]-(p[0]+this.options.scrollSensitivity);if(pointer[1]<(p[1]+this.options.scrollSensitivity))speed[1]=pointer[1]-(p[1]+this.options.scrollSensitivity);if(pointer[0]>(p[2]-this.options.scrollSensitivity))speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity);if(pointer[1]>(p[3]-this.options.scrollSensitivity))speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity);this.startScrolling(speed);}
if(Prototype.Browser.WebKit)window.scrollBy(0,0);Event.stop(event);},finishDrag:function(event,success){this.dragging=false;if(this.options.quiet){Position.prepare();var pointer=[Event.pointerX(event),Event.pointerY(event)];Droppables.show(pointer,this.element);}
if(this.options.ghosting){if(!this.element._originallyAbsolute)
Position.relativize(this.element);Element.remove(this._clone);this._clone=null;}
var dropped=false;if(success){dropped=Droppables.fire(event,this.element);if(!dropped)dropped=false;}
if(dropped&&this.options.onDropped)this.options.onDropped(this.element);Draggables.notify('onEnd',this,event);var revert=this.options.revert;if(revert&&Object.isFunction(revert))revert=revert(this.element);var d=this.currentDelta();if(revert&&this.options.reverteffect){if(dropped==0||revert!='failure')
this.options.reverteffect(this.element,d[1]-this.delta[1],d[0]-this.delta[0]);}else{this.delta=d;}
if(this.options.zindex)
this.element.style.zIndex=this.originalZ;if(this.options.endeffect)
this.options.endeffect(this.element);Draggables.deactivate(this);Droppables.reset();},keyPress:function(event){if(event.keyCode!=Event.KEY_ESC)return;this.finishDrag(event,false);Event.stop(event);},endDrag:function(event){if(!this.dragging)return;this.stopScrolling();this.finishDrag(event,true);Event.stop(event);},draw:function(point){var pos=Position.cumulativeOffset(this.element);if(this.options.ghosting){var r=Position.realOffset(this.element);pos[0]+=r[0]-Position.deltaX;pos[1]+=r[1]-Position.deltaY;}
var d=this.currentDelta();pos[0]-=d[0];pos[1]-=d[1];if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){pos[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;pos[1]-=this.options.scroll.scrollTop-this.originalScrollTop;}
var p=[0,1].map(function(i){return(point[i]-pos[i]-this.offset[i])}.bind(this));if(this.options.snap){if(Object.isFunction(this.options.snap)){p=this.options.snap(p[0],p[1],this);}else{if(Object.isArray(this.options.snap)){p=p.map(function(v,i){return(v/this.options.snap[i]).round()*this.options.snap[i]}.bind(this))}else{p=p.map(function(v){return(v/this.options.snap).round()*this.options.snap}.bind(this))}}}
var style=this.element.style;if((!this.options.constraint)||(this.options.constraint=='horizontal'))
style.left=p[0]+"px";if((!this.options.constraint)||(this.options.constraint=='vertical'))
style.top=p[1]+"px";if(style.visibility=="hidden")style.visibility="";},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null;}},startScrolling:function(speed){if(!(speed[0]||speed[1]))return;this.scrollSpeed=[speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed];this.lastScrolled=new Date();this.scrollInterval=setInterval(this.scroll.bind(this),10);},scroll:function(){var current=new Date();var delta=current-this.lastScrolled;this.lastScrolled=current;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1000;this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1]);}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1000;this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1000;}
Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify('onDrag',this);if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*delta/1000;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*delta/1000;if(Draggables._lastScrollPointer[0]<0)
Draggables._lastScrollPointer[0]=0;if(Draggables._lastScrollPointer[1]<0)
Draggables._lastScrollPointer[1]=0;this.draw(Draggables._lastScrollPointer);}
if(this.options.change)this.options.change(this);},_getWindowScroll:function(w){var T,L,W,H;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft;}else if(w.document.body){T=body.scrollTop;L=body.scrollLeft;}
if(w.innerWidth){W=w.innerWidth;H=w.innerHeight;}else if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight;}else{W=body.offsetWidth;H=body.offsetHeight}}
return{top:T,left:L,width:W,height:H};}});Draggable._dragging={};var SortableObserver=Class.create({initialize:function(element,observer){this.element=$(element);this.observer=observer;this.lastValue=Sortable.serialize(this.element);},onStart:function(){this.lastValue=Sortable.serialize(this.element);},onEnd:function(){Sortable.unmark();if(this.lastValue!=Sortable.serialize(this.element))
this.observer(this.element)}});var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(element){while(element.tagName.toUpperCase()!="BODY"){if(element.id&&Sortable.sortables[element.id])return element;element=element.parentNode;}},options:function(element){element=Sortable._findRootElement($(element));if(!element)return;return Sortable.sortables[element.id];},destroy:function(element){var s=Sortable.options(element);if(s){Draggables.removeObserver(s.element);s.droppables.each(function(d){Droppables.remove(d)});s.draggables.invoke('destroy');delete Sortable.sortables[s.element.id];}},create:function(element){element=$(element);var options=Object.extend({element:element,tag:'li',dropOnEmpty:false,tree:false,treeTag:'ul',overlap:'vertical',constraint:'vertical',containment:element,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});this.destroy(element);var options_for_draggable={revert:true,quiet:options.quiet,scroll:options.scroll,scrollSpeed:options.scrollSpeed,scrollSensitivity:options.scrollSensitivity,delay:options.delay,ghosting:options.ghosting,constraint:options.constraint,handle:options.handle};if(options.starteffect)
options_for_draggable.starteffect=options.starteffect;if(options.reverteffect)
options_for_draggable.reverteffect=options.reverteffect;else
if(options.ghosting)options_for_draggable.reverteffect=function(element){element.style.top=0;element.style.left=0;};if(options.endeffect)
options_for_draggable.endeffect=options.endeffect;if(options.zindex)
options_for_draggable.zindex=options.zindex;var options_for_droppable={overlap:options.overlap,containment:options.containment,tree:options.tree,hoverclass:options.hoverclass,onHover:Sortable.onHover}
var options_for_tree={onHover:Sortable.onEmptyHover,overlap:options.overlap,containment:options.containment,hoverclass:options.hoverclass}
Element.cleanWhitespace(element);options.draggables=[];options.droppables=[];if(options.dropOnEmpty||options.tree){Droppables.add(element,options_for_tree);options.droppables.push(element);}
(options.elements||this.findElements(element,options)||[]).each(function(e,i){var handle=options.handles?$(options.handles[i]):(options.handle?$(e).select('.'+options.handle)[0]:e);options.draggables.push(new Draggable(e,Object.extend(options_for_draggable,{handle:handle})));Droppables.add(e,options_for_droppable);if(options.tree)e.treeNode=element;options.droppables.push(e);});if(options.tree){(Sortable.findTreeElements(element,options)||[]).each(function(e){Droppables.add(e,options_for_tree);e.treeNode=element;options.droppables.push(e);});}
this.sortables[element.id]=options;Draggables.addObserver(new SortableObserver(element,options.onUpdate));},findElements:function(element,options){return Element.findChildren(element,options.only,options.tree?true:false,options.tag);},findTreeElements:function(element,options){return Element.findChildren(element,options.only,options.tree?true:false,options.treeTag);},onHover:function(element,dropon,overlap){if(Element.isParent(dropon,element))return;if(overlap>.33&&overlap<.66&&Sortable.options(dropon).tree){return;}else if(overlap>0.5){Sortable.mark(dropon,'before');if(dropon.previousSibling!=element){var oldParentNode=element.parentNode;element.style.visibility="hidden";dropon.parentNode.insertBefore(element,dropon);if(dropon.parentNode!=oldParentNode)
Sortable.options(oldParentNode).onChange(element);Sortable.options(dropon.parentNode).onChange(element);}}else{Sortable.mark(dropon,'after');var nextElement=dropon.nextSibling||null;if(nextElement!=element){var oldParentNode=element.parentNode;element.style.visibility="hidden";dropon.parentNode.insertBefore(element,nextElement);if(dropon.parentNode!=oldParentNode)
Sortable.options(oldParentNode).onChange(element);Sortable.options(dropon.parentNode).onChange(element);}}},onEmptyHover:function(element,dropon,overlap){var oldParentNode=element.parentNode;var droponOptions=Sortable.options(dropon);if(!Element.isParent(dropon,element)){var index;var children=Sortable.findElements(dropon,{tag:droponOptions.tag,only:droponOptions.only});var child=null;if(children){var offset=Element.offsetSize(dropon,droponOptions.overlap)*(1.0-overlap);for(index=0;index<children.length;index+=1){if(offset-Element.offsetSize(children[index],droponOptions.overlap)>=0){offset-=Element.offsetSize(children[index],droponOptions.overlap);}else if(offset-(Element.offsetSize(children[index],droponOptions.overlap)/2)>=0){child=index+1<children.length?children[index+1]:null;break;}else{child=children[index];break;}}}
dropon.insertBefore(element,child);Sortable.options(oldParentNode).onChange(element);droponOptions.onChange(element);}},unmark:function(){if(Sortable._marker)Sortable._marker.hide();},mark:function(dropon,position){var sortable=Sortable.options(dropon.parentNode);if(sortable&&!sortable.ghosting)return;if(!Sortable._marker){Sortable._marker=($('dropmarker')||Element.extend(document.createElement('DIV'))).hide().addClassName('dropmarker').setStyle({position:'absolute'});document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);}
var offsets=Position.cumulativeOffset(dropon);Sortable._marker.setStyle({left:offsets[0]+'px',top:offsets[1]+'px'});if(position=='after')
if(sortable.overlap=='horizontal')
Sortable._marker.setStyle({left:(offsets[0]+dropon.clientWidth)+'px'});else
Sortable._marker.setStyle({top:(offsets[1]+dropon.clientHeight)+'px'});Sortable._marker.show();},_tree:function(element,options,parent){var children=Sortable.findElements(element,options)||[];for(var i=0;i<children.length;++i){var match=children[i].id.match(options.format);if(!match)continue;var child={id:encodeURIComponent(match?match[1]:null),element:element,parent:parent,children:[],position:parent.children.length,container:$(children[i]).down(options.treeTag)}
if(child.container)
this._tree(child.container,options,child)
parent.children.push(child);}
return parent;},tree:function(element){element=$(element);var sortableOptions=this.options(element);var options=Object.extend({tag:sortableOptions.tag,treeTag:sortableOptions.treeTag,only:sortableOptions.only,name:element.id,format:sortableOptions.format},arguments[1]||{});var root={id:null,parent:null,children:[],container:element,position:0}
return Sortable._tree(element,options,root);},_constructIndex:function(node){var index='';do{if(node.id)index='['+node.position+']'+index;}while((node=node.parent)!=null);return index;},sequence:function(element){element=$(element);var options=Object.extend(this.options(element),arguments[1]||{});return $(this.findElements(element,options)||[]).map(function(item){return item.id.match(options.format)?item.id.match(options.format)[1]:'';});},setSequence:function(element,new_sequence){element=$(element);var options=Object.extend(this.options(element),arguments[2]||{});var nodeMap={};this.findElements(element,options).each(function(n){if(n.id.match(options.format))
nodeMap[n.id.match(options.format)[1]]=[n,n.parentNode];n.parentNode.removeChild(n);});new_sequence.each(function(ident){var n=nodeMap[ident];if(n){n[1].appendChild(n[0]);delete nodeMap[ident];}});},serialize:function(element){element=$(element);var options=Object.extend(Sortable.options(element),arguments[1]||{});var name=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:element.id);if(options.tree){return Sortable.tree(element,arguments[1]).children.map(function(item){return[name+Sortable._constructIndex(item)+"[id]="+
encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));}).flatten().join('&');}else{return Sortable.sequence(element,arguments[1]).map(function(item){return name+"[]="+encodeURIComponent(item);}).join('&');}}}
Element.isParent=function(child,element){if(!child.parentNode||child==element)return false;if(child.parentNode==element)return true;return Element.isParent(child.parentNode,element);}
Element.findChildren=function(element,only,recursive,tagName){if(!element.hasChildNodes())return null;tagName=tagName.toUpperCase();if(only)only=[only].flatten();var elements=[];$A(element.childNodes).each(function(e){if(e.tagName&&e.tagName.toUpperCase()==tagName&&(!only||(Element.classNames(e).detect(function(v){return only.include(v)}))))
elements.push(e);if(recursive){var grandchildren=Element.findChildren(e,only,recursive,tagName);if(grandchildren)elements.push(grandchildren);}});return(elements.length>0?elements.flatten():[]);}
Element.offsetSize=function(element,type){return element['offset'+((type=='vertical'||type=='height')?'Height':'Width')];}
var Painel=Class.create({initialize:function(){this.Paineis={};this.TituloPaineis=$("TaskHost_WelcomeTask_pc");this.Resizer=$("msve_mapResizer");this.MargemEsquerda=0;},Redimensionar:function(){var a=$("msve_main");var b=$("msve_taskArea");var larguraMapa=oMapa.DivMapa.style.width;var c=20;if(!b.hasClassName("hidden"))
c=b.getDimensions().width+20;b=$("msve_taskArea_data");if(a.style.height!=(GetWindowHeight()-135+"px")||b.style.height!=(GetWindowHeight()-165+"px")||larguraMapa!=(GetWindowWidth()-c+"px")){a.style.height=(GetWindowHeight()-135+"px");b.style.height=(GetWindowHeight()-165+"px");a.style.width=GetWindowWidth();pLista.Posicionar();var offset=0;oMapa.Mapa().Resize(GetWindowWidth()-c,GetWindowHeight()-165-offset);}},MostrarPainel:function(painel){Object.values(this.Paineis).each(function(nome){if(nome!=painel){var idPainelNome=pPainel.ResgatarIDPainel(nome);if(idPainelNome){if(!$(idPainelNome).hasClassName("hidden")){switch(nome){case pPainel.Paineis.BemVindo:pBemVindo.Fechar(true);break;case pPainel.Paineis.ComoChegar:pComoChegar.Fechar(true);break;case pPainel.Paineis.BuscaEndereco:pBusca.Fechar(true);break;case pPainel.Paineis.Transito:pTransito.Fechar(true);break;case pPainel.Paineis.Cinema:pCinema.Fechar(true);break;case pPainel.Paineis.Anuncios:oAds.Fechar(true);break;}}}}
else{var idPainel=pPainel.ResgatarIDPainel(painel);if(idPainel){pPainel.AtualizarTitulo(pPainel.ResgatarDescricaoPainel(painel));$("msve_taskArea").removeClassName("hidden");$("msve_mapResizer").removeClassName("hidden");if(pPainel.MargemEsquerda!=0){$("msve_mapArea").setStyle({marginLeft:pPainel.MargemEsquerda});pPainel.MargemEsquerda=0;}
if($(idPainel).hasClassName("hidden"))
$(idPainel).removeClassName("hidden");pPainel.Redimensionar();}}});},VerificarBarraLateral:function(){$("msve_taskArea").removeClassName("hidden");$("msve_mapResizer").removeClassName("hidden");if(pPainel.MargemEsquerda!=0){$("msve_mapArea").setStyle({marginLeft:pPainel.MargemEsquerda});pPainel.MargemEsquerda=0;}},AtualizarTitulo:function(titulo){pPainel.TituloPaineis.update(titulo);},PainelAtivo:function(){var retorno=null;Object.values(this.Paineis).each(function(nome){var idPainelNome=pPainel.ResgatarIDPainel(nome);if(idPainelNome)
if(!$(idPainelNome).hasClassName("hidden"))
retorno=nome;});return retorno;},FecharPainel:function(painel,naoFecharTask){if(!$(pPainel.ResgatarIDPainel(painel)).hasClassName("hidden"))
$(pPainel.ResgatarIDPainel(painel)).addClassName("hidden");if(!naoFecharTask){if(painel!=pPainel.Paineis.BemVindo){pBemVindo.Abrir();}
else{pPainel.MargemEsquerda=$("msve_mapArea").getStyle('marginLeft');$("msve_taskArea").addClassName("hidden");$("msve_mapArea").setStyle({marginLeft:'0pt'});$("msve_mapResizer").addClassName("hidden");}
pPainel.Redimensionar();}
this.TituloPaineis.update();},ResgatarIDPainel:function(painel){switch(painel){case this.Paineis.BemVindo:return"TaskHost_WelcomeTask";case this.Paineis.ComoChegar:return"TaskHost_DrivingDirections";case this.Paineis.BuscaEndereco:return"TaskHost_Search";case this.Paineis.Transito:return"TaskHost_Transito";case this.Paineis.Cinema:return"TaskHost_Cinema";case this.Paineis.Anuncios:return"TaskHost_Advertisement";}},ResgatarDescricaoPainel:function(painel){switch(painel){case this.Paineis.BemVindo:return L_BemVindoTitulo;case this.Paineis.ComoChegar:return L_ComoChegarTitulo;case this.Paineis.BuscaEndereco:return L_BuscaTitulo;case this.Paineis.Transito:return L_TransitoTitulo;case this.Paineis.Cinema:return L_CinemaTitulo;case this.Paineis.Anunciosn:return L_AdvertisementTitulo;}}});
var Busca=Class.create({initialize:function(){this.containerDisambg=$("TaskHost_disambgid_disambgContainer");this.containerLocal=$("placeSearchBody");this.msgDisambg=$("TaskHost_disambgid_msgTxt");this.taskProgress=$("TaskProgress");this.taskTitle=$("TaskHost_searchTaskToolbar");this.addressListPrincipal=$("TaskHost_disambgid_addressListPrincipal");this.placeTitle=$("TaskHost_placeSearchPanel_placeTitle");this.placeSearch=$("taskBar_placessearch");this.placeDisambg=$("TaskHost_disambgid_disambgParse_whereBox");this.searchToolbar=$("TaskHost_searchTaskToolbar_searchToolbar");this.codigoAtividade=null;this.idEstabelecimento=null;this.atividadeSearch=$("taskBar_qparam");this.search_body=$("search_body");this.search_results=$("ve_search_results");this.search_web=$("ve_search_web");this.search_ads=$("ve_search_ads");this.CamadaPins=null;this.PinsFoco=[];this.BuscarAtividadeApos=false;this.LocalTemp='';this.XTemp='';this.YYemp='';this.atividadeSearch.mascara(L_BuscaMascaraAtividade);this.placeSearch.mascara(L_BuscaMascaraLocal);},BuscaConjugada:function(){var valor=this.ValorEndereco();var ajaxParserTexto=new Ajax.Request('ParserTexto.aspx',{method:'get',parameters:{q:valor},onComplete:function(req){var resultadoParser=eval("("+req.responseText+")");if(resultadoParser.EncontrouEndereco&&resultadoParser.EncontrouAtividade){pBusca.DefinirValorAtividadeEmpresa(resultadoParser.Atividade);pBusca.BuscarEndereco(resultadoParser.EnderecoCompleto,true);return;}
if(resultadoParser.EncontrouEndereco){pBusca.BuscarEndereco(resultadoParser.EnderecoCompleto);}
if(resultadoParser.EncontrouAtividade){pBusca.DefinirValorAtividadeEmpresa(resultadoParser.Atividade);pBusca.BuscarAtividade();}}});},MonitorarEnterEndereco:function(evento){var k=null;if(!evento)
k=(window.event)?window.event.keyCode:window.event.which;else
k=evento.keyCode;if(k==13)
if(this.value!=''&&this.value.length>2)
$("frmBusca").submit();},GerarEmailAtividade:function(){if(this.ValorAtividade()!='')
return"se="+this.ValorAtividade();else
return"";},EfetuarSegundaBusca:function(){var buscaEndereco=true;var atividadeEmpresa='';var atividade=null;var empresa=null;if($("TaskHost_disambgid_disambgParse_scope").options[$("TaskHost_disambgid_disambgParse_scope").options.selectedIndex].value=="Local")
buscaEndereco=false;if(buscaEndereco)
pBusca.BuscarEndereco($('TaskHost_disambgid_disambgParse_whereBox').value);else{atividadeEmpresa=$('TaskHost_disambgid_disambgParse_whereBox').value;if(atividadeEmpresa.indexOf(',')!=-1){var valoresQuebrados=atividadeEmpresa.split(',');atividade=valoresQuebrados[0];empresa=valoresQuebrados[1];}
else{atividade=atividadeEmpresa;}
pBusca.BuscarAtividade(atividade,empresa);}},AbrirDetalhesPOI:function(idPOI,tipo){var url="";if(tipo=="locais_esar"){url="DetalhesPOIEsAr.aspx?c="+idPOI+"&type=local_esar";}
else
url="DetalhesPOI.aspx?c="+idPOI+"&type="+tipo;window.open(url);},EnviarTorpedoPOI:function(idPOI){window.open('http://www.telelistas.net/torpedos/pop_tim.aspx?idrgstr='+idPOI,'torpedo','scrollbars=no,width=448,height=328,resizeable=no,status=yes');},MonitorarEnterAtividade:function(evento){var k=null;if(!evento)
k=(window.event)?window.event.keyCode:window.event.which;else
k=evento.keyCode;if(k==13)
if(this.value!=''&&this.value.length>2)
pBusca.BuscarAtividade();},Abrir:function(){pPainel.MostrarPainel(pPainel.Paineis.BuscaEndereco);this.CamadaPins=oPin.CriarCamadaPins();oMapa.DefinirTituloPagina();},Fechar:function(naoFecharTask){pPainel.FecharPainel(pPainel.Paineis.BuscaEndereco,naoFecharTask);oPin.RemoverPinsCamada(this.CamadaPins);oMapa.DefinirTituloPagina();},MostrarTitulo:function(){this.taskTitle.removeClassName("hidden");},EsconderTitulo:function(){this.taskTitle.addClassName("hidden");this.searchToolbar.addClassName("hidden");},Carregando:function(carregando){if(carregando){this.EsconderTitulo();this.taskProgress.removeClassName("hidden");this.containerDisambg.addClassName("hidden");this.containerLocal.addClassName("hidden");this.addressListPrincipal.addClassName("hidden");this.search_body.addClassName("hidden");this.containerDisambg.removeClassName("disambgError");this.containerDisambg.removeClassName("disambgWarning");}
else{this.MostrarTitulo();this.taskProgress.addClassName("hidden");}},MostrarLinkTodos:function(){this.searchToolbar.removeClassName("hidden");this.searchToolbar.update();this.searchToolbar.appendChild(Builder.node('a',{href:'javascript:void(0);',onclick:"pBusca.MostrarTodos();"},L_BuscaMostrarTodos));},BuscarEndereco:function(endereco,buscarAtividadeApos){if(buscarAtividadeApos)
this.BuscarAtividadeApos=true;else
this.BuscarAtividadeApos=false;oPin.RemoverPinsCamada(this.CamadaPins);this.Abrir();this.Carregando(true);if(!endereco)
endereco=this.ValorEndereco();if(endereco=='')
return;var ajaxBuscaEndereco=new Ajax.Request('BuscaEndereco.aspx',{method:'get',parameters:{e:endereco},onComplete:function(req){var resposta=eval("("+req.responseText+")");if(!resposta.erro&&resposta.recordCount>0){pBusca.MostrarResultadoEndereco(eval("("+req.responseText+")"));pBusca.Carregando(false);}
else{pBusca.BuscarEnderecoOut(endereco);}}});},BuscarEnderecoOut:function(endereco){oMapa.Mapa().Find(null,endereco,null,null,1,5,false,false,false,null,function callback(a,b,c,d,e){pBusca.MostrarResultadoEnderecoOut(c);pBusca.Carregando(false);});},ValorEndereco:function(){if(this.placeSearch.value==L_BuscaMascaraLocal)
return'';return this.placeSearch.value;},ValorAtividade:function(){if(this.atividadeSearch.value==L_BuscaMascaraAtividade)
return'';if(this.atividadeSearch.value.indexOf(',')!=-1){var valoresQuebrados=this.atividadeSearch.value.split(',');return valoresQuebrados[0];}
return this.atividadeSearch.value;},ValorEmpresa:function(){if(this.atividadeSearch.value==L_BuscaMascaraAtividade)
return'';if(this.atividadeSearch.value.indexOf(',')!=-1){var valoresQuebrados=this.atividadeSearch.value.split(',');return valoresQuebrados[1];}
return'';},BuscarEmpresa:function(codigo,atividade,empresa,paginaAtual){oPin.RemoverPinsCamada(this.CamadaPins);this.Abrir();this.Carregando(true);var x=oMapa.ResgatarXY().x;var y=oMapa.ResgatarXY().y;if(!paginaAtual)
paginaAtual=1;var codigoEmpresa=null;if(this.idEstabelecimento!=null)
if(this.idEstabelecimento!=''){codigoEmpresa=this.idEstabelecimento;this.idEstabelecimento=null;}
var ajaxBuscaEmpresa=new Ajax.Request('BuscaEmpresa.aspx',{method:'get',parameters:{ide:codigoEmpresa,ca:codigo,a:atividade,e:empresa,x:x,y:y,pa:paginaAtual,qr:OpcoesNumeroRegistrosBusca},onComplete:function(req){pBusca.MostrarResultadoEmpresa(eval("("+req.responseText+")"),codigo,atividade,empresa,paginaAtual,(codigoEmpresa!=null?true:false));pBusca.Carregando(false);}});},BuscarEmpresaOut:function(atividade,empresa,paginaAtual){oPin.RemoverPinsCamada(this.CamadaPins);this.Abrir();this.Carregando(true);var x=oMapa.ResgatarXY().x;var y=oMapa.ResgatarXY().y;if(!paginaAtual)
paginaAtual=1;var pagina=(paginaAtual*OpcoesNumeroRegistrosBusca)-9;var what=(atividade+" "+empresa);var startIndex=pagina-1;var numberOfResults=OpcoesNumeroRegistrosBusca;var showResult=false;var createResult=false;var disambiguation=false;map.Find(what,new VELatLong(y,x),null,null,startIndex,numberOfResults,showResult,createResult,disambiguation,false,function callback(a,resultado,c,possuiMaisResultados,e){pBusca.MostrarResultadoEmpresaOut(resultado,atividade,empresa,paginaAtual,possuiMaisResultados);pBusca.Carregando(false);});},DefinirValorEndereco:function(endereco){if(endereco!=null&&endereco!=''){this.placeSearch.removeClassName("Watermark");this.placeSearch.value=endereco;}
else{this.placeSearch.addClassName("Watermark");this.placeSearch.value=L_BuscaMascaraLocal;}},DefinirValorAtividadeEmpresa:function(atividade,empresa,codigoAtividade){this.codigoAtividade=codigoAtividade;if((atividade!=null&&atividade!='')||(empresa!=null&&empresa!='')){this.atividadeSearch.removeClassName("Watermark");this.atividadeSearch.value=((atividade)?atividade:"")+((empresa)?(","+empresa):"");}
else{this.atividadeSearch.addClassName("Watermark");this.atividadeSearch.value=L_BuscaMascaraAtividade;}},BuscarAtividade:function(atividade,empresa){oPin.RemoverPinsCamada(this.CamadaPins);this.Abrir();this.Carregando(true);if(!atividade&&!empresa){atividade=this.ValorAtividade();empresa=this.ValorEmpresa();}
if(this.codigoAtividade){this.BuscarEmpresa(this.codigoAtividade,atividade,empresa,null);this.codigoAtividade=null;return;}
var x=oMapa.ResgatarXY().x;var y=oMapa.ResgatarXY().y;if(oMapa.EstaNoBrasil()){var ajaxBuscaAtividade=new Ajax.Request('BuscaAtividade.aspx',{method:'get',parameters:{a:atividade,e:empresa,x:x,y:y,ip:IPUsuario},onComplete:function(req){pBusca.MostrarResultadoAtividade(eval("("+req.responseText+")"),atividade,empresa);pBusca.Carregando(false);}});}
else{var paginaAtual=1;var pagina=(paginaAtual*OpcoesNumeroRegistrosBusca)-9;var what=(atividade+" "+empresa);var startIndex=pagina-1;var numberOfResults=OpcoesNumeroRegistrosBusca;var showResult=false;var createResult=false;var disambiguation=false;map.Find(what,new VELatLong(y,x),null,null,startIndex,numberOfResults,showResult,createResult,disambiguation,false,function callback(a,resultado,c,possuiMaisResultados,e){pBusca.MostrarResultadoEmpresaOut(resultado,atividade,empresa,paginaAtual,possuiMaisResultados);pBusca.Carregando(false);});}},BuscaXY:function(local,x,y,zoom){oPin.RemoverPinsCamada(this.CamadaPins);this.Abrir();this.Carregando(true);this.containerLocal.removeClassName("hidden");var ponto=null;var descricaoLocal=local;this.placeTitle.update(descricaoLocal);ponto=oPin.Adicionar({ponto:{x:x,y:y},titulo:descricaoLocal,tipo:oPin.TipoPin.BuscaExata,camada:this.CamadaPins});$("TaskHost_placeSearchPanel_directionsLink").replace('<a id="TaskHost_placeSearchPanel_directionsLink" href="javascript:void(0);" onclick="pBusca.TratarDefinicaoLocalFinal(\''+descricaoLocal+'\','+x+','+y+');">'+L_ComoChegarTitulo+'</a>');$("plSrchAtoCLnk").replace('<a id="plSrchAtoCLnk" href="javascript:void(0);" onclick="pBusca.TratarPontoExistente(\''+ponto.GetID()+'\');">'+L_ListaAdicionar+'</a>');if(zoom)
oPin.Focar(ponto,zoom);else
oPin.Focar(ponto);oMapa.DefinirTituloPagina(L_BuscaMapaDe+" "+descricaoLocal);this.Carregando(false);if(this.BuscarAtividadeApos)
pBusca.BuscarAtividade();},TratarCityLocation:function(cityLocation){return(cityLocation.city.name+", "+cityLocation.city.state);},TratarAddressLocation:function(addressLocation){var numero="";if(addressLocation.address.houseNumber)
if(addressLocation.address.houseNumber!="")
numero=", "+addressLocation.address.houseNumber;return(addressLocation.address.street+numero+", "+addressLocation.address.city.name+", "+addressLocation.address.city.state);},MostrarTodos:function(){var pins=[];for(var i=0;i<this.CamadaPins.GetShapeCount();i++)
pins[pins.length]=this.CamadaPins.GetShapeByIndex(i).GetIconAnchor();if(pins.length>0)
oMapa.Mapa().SetMapView(pins);return;},FocarByIndex:function(i){if(pBusca!=null){if(pBusca.CamadaPins!=null){if(pBusca.CamadaPins.GetShapeCount()>=i){oPin.Focar(pBusca.CamadaPins.GetShapeByIndex(i),oMapa.ZoomEstabelecimento);oMapa.Mapa().ShowInfoBox(pBusca.CamadaPins.GetShapeByIndex(i));}}}},MouseOverByIndex:function(i){try{if(pBusca!=null){if(pBusca.CamadaPins!=null){var currentShape=pBusca.CamadaPins.GetShapeByIndex(i);var currentIcon=currentShape.GetCustomIcon();currentIcon.CustomHTML=currentIcon.CustomHTML.replace('pin_EstabelecimentoPadrao','pin_EstabelecimentoSelecionado');currentShape.SetCustomIcon(currentIcon);}}}catch(e){}},MouseOutByIndex:function(i){try{if(pBusca!=null){if(pBusca.CamadaPins!=null){var currentShape=pBusca.CamadaPins.GetShapeByIndex(i);var currentIcon=currentShape.GetCustomIcon();currentIcon.CustomHTML=currentIcon.CustomHTML.replace('pin_EstabelecimentoSelecionado','pin_EstabelecimentoPadrao');currentShape.SetCustomIcon(currentIcon);}}}catch(e){}},MostrarResultadoEmpresa:function(resultado,codigo,atividade,empresa,paginaAtual,focarEmpresa){if(resultado.erro||resultado.recordCount==0){this.containerDisambg.removeClassName("hidden");this.containerDisambg.addClassName("disambgError");this.msgDisambg.update(L_BuscaNenhumResultado);return;}
switch(resultado.recordCount){default:this.MostrarLinkTodos();this.search_body.removeClassName("hidden");this.search_results.update();var anuncie=Builder.node('div',{className:'anuncie'},[Builder.node('a',{target:'_blank',href:'http://www.telelistas.net/templates/anuncie.aspx'},'Anuncie aqui pela TeleListas.net')]);var fonteConsulta=Builder.node('div',{className:'anuncie'},[Builder.node('img',{absalign:'middle',src:'img/icn_expander_up_hover.gif'}),Builder.node('span',' Fonte de consulta: '),Builder.node('a',{target:'_blank',href:'http://www.telelistas.net'},'TeleListas.net')]);var titulo=Builder.node('h3',L_BuscaEstabelecimentosEncontrados);var lista=Builder.node('ol',{className:'searchResults'});var nomeLocal=null;var codigoLocal=null;var x=null;var y=null;var registroAtual=1;var i=null;var ptIcon=null;var descricao=null;var telefone=null;for(i=0;i<resultado.poiLocations.length;i++){registroAtual=(OpcoesNumeroRegistrosBusca*(paginaAtual-1))+i+1;nomeLocal=resultado.poiLocations[i].name;codigoLocal=resultado.poiLocations[i].cod;x=resultado.poiLocations[i].point.x;y=resultado.poiLocations[i].point.y;descricao=this.TratarAddressLocation(resultado.poiLocations[i]);telefone=resultado.poiLocations[i].phone;ptIcon=oPin.Adicionar({idPOI:codigoLocal,descricao:descricao+"\n"+telefone,ponto:{x:x,y:y},titulo:nomeLocal,tipo:oPin.TipoPin.EstabelecimentoPadrao,camada:this.CamadaPins,valor:registroAtual});if(focarEmpresa){var pinEmpresaFocada=[];pinEmpresaFocada.push(ptIcon.GetIconAnchor());oMapa.Mapa().SetMapView(pinEmpresaFocada);focarEmpresa=false;}
lista.appendChild(Builder.node('li',{onclick:"oPin.FocarShape('"+ptIcon.GetID()+"')"},[Builder.node('a',{className:'bullet_precise',href:'javascript:void(0);'},registroAtual),Builder.node('h4',[Builder.node('a',{href:'javascript:void(0);'},nomeLocal)]),Builder.node('span',{className:'a'},[Builder.node('span',{className:'address'},descricao),Builder.node('span',{className:'phone bulleted'},telefone)]),Builder.node('ul',[Builder.node('li',{className:'first'},[Builder.node('a',{href:'javascript:void(0);',onclick:"pComoChegar.Abrir(); pComoChegar.DefinirLocalFinal("+nomeLocal.inspect()+",'"+x+"','"+y+"');"},L_ComoChegarTitulo)]),Builder.node('li',[Builder.node('a',{href:'javascript:void(0);',onclick:"oPin.AdicionarJaExistente('"+ptIcon.GetID()+"')"},L_ListaAdicionar)])]),Builder.node('div',{className:'clear'})]));}
var paginacao=Builder.node('div',{className:'pageList'});if(paginaAtual>1){paginacao.appendChild(Builder.node('a',{href:'javascript:void(0);',className:'prevPage',onclick:"pBusca.BuscarEmpresa('"+codigo+"',"+atividade.inspect()+","+empresa.inspect()+", "+(paginaAtual-1)+");"},L_Anterior));}
for(var j=0;(j<resultado.pageCount&&resultado.pageCount>1);j++){if(paginaAtual==(j+1)){paginacao.appendChild(Builder.node('a',{className:'currentPageLink'},(j+1)));}
else{paginacao.appendChild(Builder.node('a',{href:'javascript:void(0);',onclick:"pBusca.BuscarEmpresa('"+codigo+"',"+atividade.inspect()+","+empresa.inspect()+", "+(j+1)+");"},(j+1)));}}
if(paginaAtual!=(resultado.pageCount)&&resultado.pageCount>1){paginacao.appendChild(Builder.node('a',{href:'javascript:void(0);',className:'nextPage',onclick:"pBusca.BuscarEmpresa('"+codigo+"',"+atividade.inspect()+","+empresa.inspect()+", "+(paginaAtual+1)+");"},L_Proxima));}
paginacao.appendChild(Builder.node('div',{className:'clear'}));paginacao.appendChild(Builder.node('br'));this.search_results.appendChild(anuncie);this.search_results.appendChild(titulo);this.search_results.appendChild(lista);this.search_results.appendChild(paginacao);this.search_results.appendChild(fonteConsulta);oAds.MostrarAnuncios(atividade,pBusca.search_ads);this.BuscaWeb(atividade,empresa,paginaAtual,pBusca.search_web);break;}},BuscaWeb:function(atividade,empresa,pagina,divResultado){var ajaxBuscaWeb=new Ajax.Request('BuscaWeb.aspx',{method:'get',parameters:{atv:atividade,nm:empresa,npg:pagina,pt:oMapa.Mapa().GetCenter()},onComplete:function(req){divResultado.update(req.responseText);}});},BuscarAtividadesProximas:function(xCenter,yCenter){$("hfLocalAtividadesProximas").value=Object.toJSON({X:parseFloat(xCenter.toString().replace(',','.')),Y:parseFloat(yCenter.toString().replace(',','.')),L:$('txtNewLocalSearch').value});__doPostBack('btnBuscaAtividadesProximas','');return;},MostrarResultadoEmpresaOut:function(resultado,atividade,empresa,paginaAtual,possuiMaisResultados){$("hfBuscaAtividadeOutState").value=Object.toJSON({Resultado:resultado,Atividade:atividade,Empresa:empresa,PaginaAtual:paginaAtual,PossuiMaisResultados:possuiMaisResultados});__doPostBack('btnBuscaAtividadeOut','');return;if(!resultado||resultado.length==0){this.containerDisambg.removeClassName("hidden");this.containerDisambg.addClassName("disambgError");this.msgDisambg.update(L_BuscaNenhumResultado);return;}
switch(resultado.length){default:this.MostrarLinkTodos();this.search_body.removeClassName("hidden");this.search_results.update();var titulo=Builder.node('h3',L_BuscaEstabelecimentosEncontrados);var lista=Builder.node('ol',{className:'searchResults'});var nomeLocal=null;var descricaoLocal=null;var foneLocal=null;var x=null;var y=null;var registroAtual=1;var i=null;var ptIcon=null;for(i=0;i<resultado.length;i++){registroAtual=(OpcoesNumeroRegistrosBusca*(paginaAtual-1))+i+1;nomeLocal=resultado[i].Name;descricaoLocal=resultado[i].Description;foneLocal=resultado[i].Phone;x=resultado[i].LatLong.Longitude;y=resultado[i].LatLong.Latitude;ptIcon=oPin.Adicionar({ponto:{x:x,y:y},titulo:nomeLocal,tipo:oPin.TipoPin.EstabelecimentoPadrao,camada:this.CamadaPins,valor:registroAtual});lista.appendChild(Builder.node('li',{onclick:"oPin.FocarShape('"+ptIcon.GetID()+"')"},[Builder.node('a',{className:'bullet_precise',href:'javascript:void(0);'},registroAtual),Builder.node('h4',[Builder.node('a',{href:'javascript:void(0);'},nomeLocal)]),Builder.node('span',{className:'a'},[Builder.node('span',{className:'address'},descricaoLocal),Builder.node('span',{className:'phone bulleted'},foneLocal)]),Builder.node('ul',[Builder.node('li',{className:'first'},[Builder.node('a',{href:'javascript:void(0);',onclick:"pComoChegar.Abrir(); pComoChegar.DefinirLocalFinal("+nomeLocal.inspect()+",'"+x+"','"+y+"');"},L_ComoChegarTitulo)]),Builder.node('li',[Builder.node('a',{href:'javascript:void(0);',onclick:"oPin.AdicionarJaExistente('"+ptIcon.GetID()+"')"},L_ListaAdicionar)])]),Builder.node('div',{className:'clear'})]));}
var paginacao=Builder.node('div',{className:'pageList'});if(paginaAtual>1){paginacao.appendChild(Builder.node('a',{href:'javascript:void(0);',className:'prevPage',onclick:"pBusca.BuscarEmpresaOut('"+atividade+"','"+empresa+"', "+(paginaAtual-1)+");"},L_Anterior));}
paginacao.appendChild(Builder.node('a',{className:'currentPageLink'},paginaAtual));if(possuiMaisResultados){paginacao.appendChild(Builder.node('a',{href:'javascript:void(0);',className:'nextPage',onclick:"pBusca.BuscarEmpresaOut('"+atividade+"','"+empresa+"', "+(paginaAtual+1)+");"},L_Proxima));}
paginacao.appendChild(Builder.node('div',{className:'clear'}));this.search_results.appendChild(titulo);this.search_results.appendChild(lista);this.search_results.appendChild(paginacao);break;}},MostrarResultadoAtividade:function(resultado,atividade,empresa){if(resultado.erro||resultado.length==0){this.containerDisambg.removeClassName("hidden");this.containerDisambg.addClassName("disambgError");this.msgDisambg.update(L_BuscaNenhumResultado);return;}
switch(resultado.length){case 1:pBusca.BuscarEmpresa(resultado[0].Code,atividade,empresa);break;default:this.addressListPrincipal.removeClassName("hidden");this.containerDisambg.removeClassName("hidden");this.containerDisambg.addClassName("disambgWarning");this.msgDisambg.update(L_BuscaMaisResultados);this.addressListPrincipal.update();var titulo=Builder.node('div',{className:'disambghilite2'},L_BuscaSugestoesLocal);var lista=Builder.node('ol');var nomeLocal=null;var codigoLocal=null;var i=null;for(i=0;i<resultado.length;i++){nomeLocal=resultado[i].Name;codigoLocal=resultado[i].Code;lista.appendChild(Builder.node('li',[Builder.node('a',{href:'javascript:void(0);',onclick:"pBusca.BuscarEmpresa('"+codigoLocal+"', '"+atividade+"','"+empresa+"');"},[Builder.node('span',{className:'disambgDiff'},nomeLocal)])]));}
this.addressListPrincipal.appendChild(titulo);this.addressListPrincipal.appendChild(lista);break;}},MostrarResultadoEnderecoOut:function(resultado){$("hfBuscaEnderecoOutState").value=Object.toJSON(resultado);__doPostBack('btnBuscaEnderecoOut','');return;if(resultado.length==0){this.containerDisambg.removeClassName("hidden");this.containerDisambg.addClassName("disambgError");this.msgDisambg.update(L_BuscaNenhumResultado);return;}
switch(resultado.length){case 1:this.containerLocal.removeClassName("hidden");var ponto=null;var descricaoLocal=resultado[0].Name;this.placeTitle.update(descricaoLocal);ponto=oPin.Adicionar({ponto:{x:resultado[0].LatLong.Longitude,y:resultado[0].LatLong.Latitude},titulo:descricaoLocal,tipo:oPin.TipoPin.BuscaExata,camada:this.CamadaPins});oPin.Focar(ponto);oMapa.DefinirTituloPagina(L_BuscaMapaDe+" "+descricaoLocal);$("TaskHost_placeSearchPanel_directionsLink").replace('<a id="TaskHost_placeSearchPanel_directionsLink" href="javascript:void(0);" onclick="pBusca.TratarDefinicaoLocalFinal(\''+descricaoLocal+'\','+resultado[0].LatLong.Longitude+','+resultado[0].LatLong.Latitude+');">'+L_ComoChegarTitulo+'</a>');$("plSrchAtoCLnk").replace('<a id="plSrchAtoCLnk" href="javascript:void(0);" onclick="pBusca.TratarPontoExistente(\''+ponto.GetID()+'\');">'+L_ListaAdicionar+'</a>');break;default:this.addressListPrincipal.removeClassName("hidden");this.containerDisambg.removeClassName("hidden");this.containerDisambg.addClassName("disambgWarning");this.msgDisambg.update(L_BuscaMaisResultados);this.addressListPrincipal.update();var titulo=Builder.node('div',{className:'disambghilite2'},L_BuscaSugestoesLocal);var lista=Builder.node('ol');var x=null;var y=null;var nomeLocal=null;var i=null;for(i=0;i<resultado.length;i++){nomeLocal=resultado[i].Name;x=resultado[i].LatLong.Longitude;y=resultado[i].LatLong.Latitude;lista.appendChild(Builder.node('li',[Builder.node('a',{href:'javascript:void(0);',onclick:"pBusca.BuscaXY('"+nomeLocal+"','"+x+"','"+y+"');"},[Builder.node('span',{className:'disambgDiff'},nomeLocal)])]));}
this.addressListPrincipal.appendChild(titulo);this.addressListPrincipal.appendChild(lista);break;}},TratarDefinicaoLocalFinal:function(descricao,valorX,valorY){pComoChegar.Abrir();pComoChegar.DefinirLocalFinal(descricao,valorX,valorY);},TratarPontoExistente:function(valor){oPin.AdicionarJaExistente(valor);},MostrarResultadoEndereco:function(resultado){if(resultado.erro||resultado.recordCount==0){this.containerDisambg.removeClassName("hidden");this.containerDisambg.addClassName("disambgError");this.msgDisambg.update(L_BuscaNenhumResultado);return;}
switch(resultado.recordCount){case 1:this.containerLocal.removeClassName("hidden");var ponto=null;var descricaoLocal='';if(resultado.cityLocation){descricaoLocal=this.TratarCityLocation(resultado.cityLocation[0]);this.placeTitle.update(descricaoLocal);ponto=oPin.Adicionar({ponto:resultado.cityLocation[0].point,titulo:descricaoLocal,tipo:oPin.TipoPin.BuscaExata,camada:this.CamadaPins});oPin.Focar(ponto,oMapa.ZoomCidade);oMapa.DefinirTituloPagina(L_BuscaMapaDe+" "+descricaoLocal);if(this.BuscarAtividadeApos)
pBusca.BuscarAtividade();$("TaskHost_placeSearchPanel_directionsLink").replace('<a id="TaskHost_placeSearchPanel_directionsLink" href="javascript:void(0);" onclick="pBusca.TratarDefinicaoLocalFinal(\''+descricaoLocal+'\','+resultado.cityLocation[0].point.x+','+resultado.cityLocation[0].point.y+');">'+L_ComoChegarTitulo+'</a>');$("plSrchAtoCLnk").replace('<a id="plSrchAtoCLnk" href="javascript:void(0);" onclick="pBusca.TratarPontoExistente(\''+ponto.GetID()+'\');">'+L_ListaAdicionar+'</a>');}
else
if(resultado.addressLocation){descricaoLocal=this.TratarAddressLocation(resultado.addressLocation[0]);this.placeTitle.update(descricaoLocal);ponto=oPin.Adicionar({ponto:resultado.addressLocation[0].point,titulo:descricaoLocal,tipo:oPin.TipoPin.BuscaExata,camada:this.CamadaPins});oPin.Focar(ponto,oMapa.ZoomEndereco);if(this.BuscarAtividadeApos)
pBusca.BuscarAtividade();$("TaskHost_placeSearchPanel_directionsLink").replace('<a id="TaskHost_placeSearchPanel_directionsLink" href="javascript:void(0);" onclick="pBusca.TratarDefinicaoLocalFinal(\''+descricaoLocal+'\','+resultado.addressLocation[0].point.x+','+resultado.addressLocation[0].point.y+');">'+L_ComoChegarTitulo+'</a>');$("plSrchAtoCLnk").replace('<a id="plSrchAtoCLnk" href="javascript:void(0);" onclick="pBusca.TratarPontoExistente(\''+ponto.GetID()+'\');">'+L_ListaAdicionar+'</a>');}
break;default:this.addressListPrincipal.removeClassName("hidden");this.containerDisambg.removeClassName("hidden");this.containerDisambg.addClassName("disambgWarning");this.msgDisambg.update(L_BuscaMaisResultados);this.addressListPrincipal.update();var titulo=Builder.node('div',{className:'disambghilite2'},L_BuscaSugestoesLocal);var lista=Builder.node('ol');var x=null;var y=null;var nomeLocal=null;var i=null;if(resultado.cityLocation){for(i=0;i<resultado.cityLocation.length;i++){nomeLocal=this.TratarCityLocation(resultado.cityLocation[i]);x=resultado.cityLocation[i].point.x;y=resultado.cityLocation[i].point.y;lista.appendChild(Builder.node('li',[Builder.node('a',{href:'javascript:void(0);',onclick:"pBusca.BuscaXY('"+nomeLocal+"','"+x+"','"+y+"', '"+oMapa.ZoomCidade+"');"},[Builder.node('span',{className:'disambgDiff'},nomeLocal)])]));}}
else
if(resultado.addressLocation){for(i=0;i<resultado.addressLocation.length;i++){nomeLocal=this.TratarAddressLocation(resultado.addressLocation[i]);x=resultado.addressLocation[i].point.x;y=resultado.addressLocation[i].point.y;lista.appendChild(Builder.node('li',[Builder.node('a',{href:'javascript:void(0);',onclick:"pBusca.BuscaXY('"+nomeLocal+"','"+x+"','"+y+"','"+oMapa.ZoomEndereco+"');"},[Builder.node('span',{className:'disambgDiff'},nomeLocal)])]));}}
this.addressListPrincipal.appendChild(titulo);this.addressListPrincipal.appendChild(lista);break;}}});
var BemVindo=Class.create({initialize:function(){},Abrir:function(){pPainel.MostrarPainel(pPainel.Paineis.BemVindo);},Fechar:function(naoFecharTask){pPainel.FecharPainel(pPainel.Paineis.BemVindo,naoFecharTask);}});
var Ads=Class.create({initialize:function()
{this.divConteudo=null;this._UrlAnuncieTeleListas='http://www.telelistas.net/templates/anuncie.aspx';this.CamadaPins=null;this.toolbar=$("TaskHost_advertisementTaskToolbar");this.taskTitle=$("TaskHost_Cinema_TaskToolbar");this.taskProgress=$("TaskProgress");this.body=$("advertisement_body");this.ultimoRefresh='';this.centroMapa='';this.timerNokia=null;this.timerGM=null;this.aberto=false;this.CampanhaTIM=null;this.MapaAereo=[];},Abrir:function()
{pPainel.MostrarPainel(pPainel.Paineis.Anuncios);this.MostrarTitulo();this.toolbar.removeClassName("hidden");this.aberto=true;oMapa.Mapa().AttachEvent("onmouseover",oAds.TratarMouseOver);this.CarregarDadosNokia();oMapa.Mapa().AttachEvent("onendpan",oAds.LocalizarEstabelecimentosNokiaPontoCentral);},HabilitarMoveGM:function()
{try{oMapa.Mapa().DetachEvent("onmouseover",oAds.TratarMouseOver);}catch(e){}
try{oMapa.Mapa().DetachEvent("onendpan",oAds.LocalizarEstabelecimentosNokiaPontoCentral);}catch(e){}
oMapa.Mapa().AttachEvent("onmouseover",oAds.TratarMouseOverGM);oMapa.Mapa().AttachEvent("onendpan",oAds.LocalizarEstabelecimentosGMPontoCentral);},HabilitarMoveNokia:function()
{try{oMapa.Mapa().DetachEvent("onmouseover",oAds.TratarMouseOverGM);}catch(e){}
try{oMapa.Mapa().DetachEvent("onendpan",oAds.LocalizarEstabelecimentosGMPontoCentral);}catch(e){}
oMapa.Mapa().AttachEvent("onmouseover",oAds.TratarMouseOver);oMapa.Mapa().AttachEvent("onendpan",oAds.LocalizarEstabelecimentosNokiaPontoCentral);},RecriarControleCampanhaTIM:function()
{},CarregarCampanhaTIM:function()
{},ValidarVisualizacaoCampanhaTIM:function()
{},MostrarCampanhaTIM:function()
{},EsconderCampanhaTIM:function()
{},TratarMouseOverGM:function(e)
{try
{if(e.elementID!=null&&e.eventName=='onmouseover')
{var idAds=oMapa.Mapa().GetShapeByID(e.elementID).Url;var ajaxContabilizarMO=new Ajax.Request('GerarAds.aspx',{method:'get',parameters:{t:'gmmo',id:idAds},onComplete:function(req)
{}});}}
catch(e){}},TratarMouseOver:function(e)
{try
{if(e.elementID!=null&&e.eventName=='onmouseover')
{var idAds=oMapa.Mapa().GetShapeByID(e.elementID).Url;var ajaxContabilizarMO=new Ajax.Request('GerarAds.aspx',{method:'get',parameters:{t:'nokiamo',id:idAds},onComplete:function(req)
{}});}}
catch(e){}},Fechar:function(naoFecharTask)
{this.aberto=false;pPainel.FecharPainel(pPainel.Paineis.Anuncios,naoFecharTask);oPin.RemoverPinsCamada(oAds.CamadaPins);try{oMapa.Mapa().DetachEvent("onendpan",oAds.LocalizarEstabelecimentosNokiaPontoCentral);}catch(e){}
try{oMapa.Mapa().DetachEvent("onendpan",oAds.LocalizarEstabelecimentosGMPontoCentral);}catch(e){}
try{oMapa.Mapa().DetachEvent("onmouseover",oAds.TratarMouseOver);}catch(e){}
try{oMapa.Mapa().DetachEvent("onmouseover",oAds.TratarMouseOverGM);}catch(e){}},MostrarAnuncios:function(pChave,div)
{if(div!='undefined'&&div!=null)
this.divConteudo=div;var ajaxGerarAds=new Ajax.Request('GerarAds.aspx',{method:'get',parameters:{k:pChave},onComplete:function(req)
{var anuncios=eval("("+req.responseText+")");if(anuncios.length>0)
{var conteudoDiv=Builder.node('div',{id:'anuncios',className:'VE_Panel_sponsoredLinks2'});var titulo=Builder.node('h3','By Overture');var lista=Builder.node('ul',{className:'list_sponsoredLinks2'});for(var i=0;i<anuncios.length;i++)
{lista.appendChild(Builder.node('li',[Builder.node('div',[Builder.node('h4',[Builder.node('a',{href:'javascript:void(0);',onclick:'window.open(\''+anuncios[i].Url+'\',\'_blank\')'},[Builder.node('span',anuncios[i].Titulo.stripTags())])]),Builder.node('p',anuncios[i].Descricao.stripTags())])]));}
conteudoDiv.appendChild(titulo);conteudoDiv.appendChild(lista);$(oAds.divConteudo).update();$(oAds.divConteudo).appendChild(conteudoDiv);}}});},Carregando:function(carregando)
{if(carregando)
{this.EsconderTitulo();this.taskProgress.removeClassName("hidden");this.body.addClassName("hidden");}
else
{this.MostrarTitulo();this.taskProgress.addClassName("hidden");this.body.removeClassName("hidden");}},SelecionarCidade:function(cidade)
{if(cidade==null)
cidade="SAOPAULO";else
cidade=cidade.toUpperCase();switch(cidade)
{case"RIODEJANEIRO":map.SetCenterAndZoom(new VELatLong(-22.9035393226554,-43.2095868580659),13);break;default:map.SetCenterAndZoom(new VELatLong(-23.5489432725207,-46.6388182006449),13);break;}
this.CarregarDadosNokia();},LocalizarEstabelecimentosGMPontoCentral:function(recursivo)
{try
{oAds.timerNokia=null;if(oAds.CamadaPins!=null)
oMapa.Mapa().DeleteShapeLayer(this.CamadaPins);}
catch(e){}
if(recursivo!='99')
{if(!recursivo)
recursivo=false;if(oAds.ultimoRefresh!=oMapa.Mapa().GetCenter().toString())
{if(oAds.centroMapa.toString()==oMapa.Mapa().GetCenter().toString())
{oAds.ultimoRefresh=oAds.centroMapa.toString();}
else
{if(recursivo)
{oAds.centroMapa=oMapa.Mapa().GetCenter();clearTimeout(oAds.timerGM);oAds.timerGM=setTimeout("oAds.LocalizarEstabelecimentosGMPontoCentral(true);",2500);}
return;}}}
var cp=escape(oPin.RetornarPontosLinha(oMapa.Mapa().GetCenter()));var ajaxGerarAdsGM=new Ajax.Request('GerarAds.aspx',{method:'get',parameters:{t:'gm',cp:cp},onComplete:function(req)
{var anuncios=eval("("+req.responseText+")");var points=[];if(anuncios.length>0)
{var lista=Builder.node('ol',{className:'searchResults gm'});var ptIcon=null;var x=null;var y=null;var nomeLocal=null;var descricao=null;var telefone=null;var endereco=null;var pos=1;var infoBox=null;var conteudoInfoBox=null;var idAds='';var pins=[];oAds.CamadaPins=oPin.CriarCamadaPins();for(var i=0;i<anuncios.length;i++)
{var conteudoInfoBox='';descricao='';x=anuncios[i].x;y=anuncios[i].y;nomeLocal=anuncios[i].nome;telefone=anuncios[i].telefone;idAds=anuncios[i].id;pos=i+1;if(anuncios[i].endereco!=null)
descricao=descricao+anuncios[i].endereco;infoBox="<div class='cxGM'>"+oAds.MontarHTMLInfoBoxGM(anuncios[i])+"</div>"
ptIcon=oPin.Adicionar({urlInfo:idAds,descricao:infoBox,ponto:{x:x,y:y},titulo:"GM",tipo:oPin.TipoPin.AdsGM,camada:oAds.CamadaPins,valor:pos});pins[pins.length]=ptIcon.GetIconAnchor();lista.appendChild(Builder.node('li',{onclick:"oPin.FocarShape('"+ptIcon.GetID()+"')"},[Builder.node('a',{className:'bullet_gm',href:'javascript:void(0);'},pos),Builder.node('h4',[Builder.node('a',{href:'javascript:void(0);'},nomeLocal)]),Builder.node('span',{className:'a'},[Builder.node('span',{className:'address'},descricao),Builder.node('span',{className:'phone bulleted'},telefone)]),Builder.node('ul',[Builder.node('li',{className:'first'},[Builder.node('a',{href:'javascript:void(0);',onclick:"pComoChegar.DefinirLocalFinal("+nomeLocal.inspect()+",'"+x+"','"+y+"', true);"},L_ComoChegarTitulo)])]),Builder.node('div',{className:'clear'})]));}
$("ve_advertisement_results").update();$("ve_advertisement_results").appendChild(lista);if(pins.length>0&&!recursivo)
oMapa.Mapa().SetMapView(pins);}
else
{oMapa.Mapa().SetCenterAndZoom(new VELatLong(-23.5489432725207,-46.6388182006449),13);oAds.CarregarDadosNokia();}
oAds.Carregando(false);}});},LocalizarEstabelecimentosNokiaPontoCentral:function(recursivo)
{try
{oAds.timerGM=null;if(oAds.CamadaPins!=null)
oMapa.Mapa().DeleteShapeLayer(this.CamadaPins);}
catch(e){}
if(recursivo!='99')
{if(!recursivo)
recursivo=false;if(oAds.ultimoRefresh!=oMapa.Mapa().GetCenter().toString())
{if(oAds.centroMapa.toString()==oMapa.Mapa().GetCenter().toString())
{oAds.ultimoRefresh=oAds.centroMapa.toString();}
else
{if(recursivo)
{oAds.centroMapa=oMapa.Mapa().GetCenter();clearTimeout(oAds.timerNokia);oAds.timerNokia=setTimeout("oAds.LocalizarEstabelecimentosNokiaPontoCentral(true);",2500);}
return;}}}
var cp=escape(oPin.RetornarPontosLinha(oMapa.Mapa().GetCenter()));var ajaxGerarAdsNokia=new Ajax.Request('GerarAds.aspx',{method:'get',parameters:{t:'nokia',cp:cp},onComplete:function(req)
{var anuncios=eval("("+req.responseText+")");var points=[];if(anuncios.length>0)
{var lista=Builder.node('ol',{className:'searchResults nokia'});var ptIcon=null;var x=null;var y=null;var nomeLocal=null;var descricao=null;var telefone=null;var pos=1;var infoBox=null;var conteudoInfoBox=null;var idAds='';var pins=[];oAds.CamadaPins=oPin.CriarCamadaPins();for(var i=0;i<anuncios.length;i++)
{var conteudoInfoBox='';descricao='';x=anuncios[i].x;y=anuncios[i].y;nomeLocal=anuncios[i].nome;telefone=anuncios[i].telefone;idAds=anuncios[i].id;pos=i+1;if(anuncios[i].endereco!=null)
descricao=descricao+anuncios[i].endereco+(anuncios[i].numero?", "+anuncios[i].numero:'');infoBox="<div class='cxNokia'>"+oAds.MontarHTMLInfoBoxNokia(anuncios[i])+"</div>"
ptIcon=oPin.Adicionar({urlInfo:idAds,descricao:infoBox,ponto:{x:x,y:y},titulo:"NOKIA",tipo:oPin.TipoPin.AdsNokia,camada:oAds.CamadaPins,valor:pos});pins[pins.length]=ptIcon.GetIconAnchor();lista.appendChild(Builder.node('li',{onclick:"oPin.FocarShape('"+ptIcon.GetID()+"')"},[Builder.node('a',{className:'bullet_nokia',href:'javascript:void(0);'},pos),Builder.node('h4',[Builder.node('a',{href:'javascript:void(0);'},nomeLocal)]),Builder.node('span',{className:'a'},[Builder.node('span',{className:'address'},descricao),Builder.node('span',{className:'phone bulleted'},telefone)]),Builder.node('ul',[Builder.node('li',{className:'first'},[Builder.node('a',{href:'javascript:void(0);',onclick:"pComoChegar.DefinirLocalFinal("+nomeLocal.inspect()+",'"+x+"','"+y+"', true);"},L_ComoChegarTitulo)])]),Builder.node('div',{className:'clear'})]));}
$("ve_advertisement_results").update();$("ve_advertisement_results").appendChild(lista);if(pins.length>0&&!recursivo)
oMapa.Mapa().SetMapView(pins);}
else
{oMapa.Mapa().SetCenterAndZoom(new VELatLong(-23.5489432725207,-46.6388182006449),13);oAds.CarregarDadosNokia();}
oAds.Carregando(false);}});},CarregarDadosGM:function()
{this.Carregando(true);var latLong=oMapa.Mapa().GetCenter();var ajaxResgatarEndereco=new Ajax.Request('BuscaEndereco.aspx',{method:'get',parameters:{x:latLong.Longitude,y:latLong.Latitude,t:'2'},onComplete:function(req)
{var txt=eval("("+req.responseText+")");if(txt.state!="SP"&&txt.state!="RJ")
oMapa.Mapa().SetCenterAndZoom(new VELatLong(-23.5489432725207,-46.6388182006449),13);oAds.LocalizarEstabelecimentosGMPontoCentral('99');}});},CarregarDadosNokia:function()
{this.Carregando(true);var latLong=oMapa.Mapa().GetCenter();var ajaxResgatarEndereco=new Ajax.Request('BuscaEndereco.aspx',{method:'get',parameters:{x:latLong.Longitude,y:latLong.Latitude,t:'2'},onComplete:function(req)
{var txt=eval("("+req.responseText+")");if(txt.state!="SP"&&txt.state!="RJ")
oMapa.Mapa().SetCenterAndZoom(new VELatLong(-23.5489432725207,-46.6388182006449),13);oAds.LocalizarEstabelecimentosNokiaPontoCentral('99');}});},MontarHTMLInfoBoxGM:function(anuncio)
{var desc="<br />";if(anuncio.nome!=null)
if(anuncio.nome!='')
desc=desc+"<strong>"+anuncio.nome+"</strong><br />"
if(anuncio.endereco!=null)
desc=desc+anuncio.endereco+"<br />";if(anuncio.cidade!=null&&anuncio.estado!=null)
desc=desc+anuncio.cidade+"/"+anuncio.estado+"<br />";if(anuncio.telefone!=null)
desc=desc+"<br />"+anuncio.telefone;return desc;},MontarHTMLInfoBoxNokia:function(anuncio)
{var frases=[];frases.push('');frases.push('Finalmente um celular que te ajuda a chegar lá.');frases.push('Aqui você encontra o Nokia N6110.');frases.push('Procurando balada em SP? N6110, finalmente um celular que te ajuda a chegar lá.');frases.push('Procurando casa de show em SP? N6110, finalmente um celular que te ajuda a chegar lá.');frases.push('Procurando teatro em SP? N6110, finalmente um celular que te ajuda a chegar lá.');frases.push('Procurando balada no RJ? N6110, finalmente um celular que te ajuda a chegar lá.');frases.push('Procurando casa de show no RJ? N6110, finalmente um celular que te ajuda a chegar lá.');frases.push('Procurando teatro no RJ? N6110, finalmente um celular que te ajuda a chegar lá.');var desc="<br />";try{desc=desc+frases[anuncio.tipo]+"<br /><br />";}
catch(e){}
if(anuncio.nome!=null)
if(anuncio.nome!='')
desc=desc+"<strong>"+anuncio.nome+"</strong><br />"
if(anuncio.endereco!=null)
desc=desc+anuncio.endereco+(anuncio.numero?", "+anuncio.numero:'')+"<br />";if(anuncio.cidade!=null&&anuncio.estado!=null)
desc=desc+anuncio.cidade+"/"+anuncio.estado+"<br />";if(anuncio.telefone!=null)
desc=desc+"<br />"+anuncio.telefone;return desc;},MostrarTitulo:function()
{this.taskTitle.removeClassName("hidden");},EsconderTitulo:function()
{this.taskTitle.addClassName("hidden");}});
var ComoChegar=Class.create({initialize:function(){this.taskProgress=$("TaskProgress");this.taskTitle=$("TaskHost_Directions_TaskToolbar");this.inputEnd=$("TaskHost_Directions_WaypointInputEnd");this.inputStart=$("TaskHost_Directions_WaypointInput");this.botaoGerarRota=$("TaskHost_Directions_ShowDirections");this.containerComoChegar=$("TaskHost_Directions_Panel");this.TipoObjeto={Brasil:1,ForaDoBrasil:2};this.ExecutandoBusca=false;this.GerandoRota=false;this.ExecutandoBuscaInicial=false;this.ExecutandoBuscaFinal=false;this.ValidadorBusca=null;this.InitialRouteZoom=99;this.InitialShapeZoom=null;this.UltimaRota1=null;this.containerMensagem=$("ComoChegar_ContainerMensagem");this.caminhoRapido=$("ComoChegar_CaminhoRapido");this.caminhoAPe=$("ComoChegar_CaminhoAPe");this.CamadaPins=null;this.CamapaShape=null;this.IDRota=null;this.UltimaRota=null;this.Buscando=false;this.PontosRota=[];this.InitGetCoords=false;this.containerTrajeto=$("ComoChegar_ContainerTrajeto");this.toolbar=$("ComoChegar_Toolbar");this.PinInicial=null;this.PontoInicial=null;this.mensagemLocalInicial=$("ComoChegar_MensagemLocalInicial");this.escolherUmLocalInicial=$("ComoChegar_EscolherUmLocalInicial");this.containerLocalInicial=$("ComoChegar_ContainerLocalInicial");this.containerEscolherLocalInicial=$("ComoChegar_ContainerEscolherLocalInicial");this.containerLocalInicialDefinido=$("ComoChegar_ContainerLocalInicialDefinido");this.containerLocalInicialNaoDefinido=$("ComoChegar_ContainerLocalInicialNaoDefinido");this.containerLocalInicialDefinidoEditar=$("ComoChegar_ContainerLocalInicialDefinidoEditar");this.PinFinal=null;this.PontoFinal=null;this.mensagemLocalFinal=$("ComoChegar_MensagemLocalFinal");this.escolherUmLocalFinal=$("ComoChegar_EscolherUmLocalFinal");this.containerLocalFinal=$("ComoChegar_ContainerLocalFinal");this.containerEscolherLocalFinal=$("ComoChegar_ContainerEscolherLocalFinal");this.containerLocalFinalDefinido=$("ComoChegar_ContainerLocalFinalDefinido");this.containerLocalFinalNaoDefinido=$("ComoChegar_ContainerLocalFinalNaoDefinido");},RemoverPINInicioRota:function(){try{if(pComoChegar.PinInicial!=null)
oMapa.Mapa().DeleteShape(pComoChegar.PinInicial);}
catch(e){}},RemoverPINFimRota:function(){try{if(pComoChegar.PinFinal!=null)
oMapa.Mapa().DeleteShape(pComoChegar.PinFinal);}
catch(e){}},Abrir:function(){pPainel.MostrarPainel(pPainel.Paineis.ComoChegar);this.containerEscolherLocalFinal.addClassName("hidden");this.containerEscolherLocalInicial.addClassName("hidden");this.containerMensagem.addClassName("hidden");this.containerComoChegar.removeClassName("route");this.MostrarTitulo();this.ValidadorBusca=new PeriodicalExecuter(function(pe){if(!pComoChegar.ExecutandoBuscaInicial&&!pComoChegar.ExecutandoBuscaFinal&&pComoChegar.ExecutandoBusca){pComoChegar.BuscarEnderecoFinal();}
if(pComoChegar.ExecutandoBusca||pComoChegar.GerandoRota||pComoChegar.ExecutandoBuscaFinal||pComoChegar.ExecutandoBuscaInicial)
pComoChegar.Carregando(true);else
pComoChegar.Carregando(false);},1);},NovaRota:function(){this.LimparRota();this.Abrir();},Fechar:function(naoFecharTask){pComoChegar.LimparRota();pPainel.FecharPainel(pPainel.Paineis.ComoChegar,naoFecharTask);},ValorLocalInicial:function(){return(this.inputStart.value==L_ComoChegarMascaraInicio)?'':this.inputStart.value;},DefinirValorLocalInicial:function(valor){if(valor!=null&&valor!=''){this.inputStart.removeClassName("Watermark");this.inputStart.value=valor;}
else{this.inputStart.addClassName("Watermark");this.inputStart.value=L_ComoChegarMascaraInicio;}},DefinirValorLocalFinal:function(valor){if(valor!=null&&valor!=''){this.inputEnd.removeClassName("Watermark");this.inputEnd.value=valor;}
else{this.inputEnd.addClassName("Watermark");this.inputEnd.value=L_ComoChegarMascaraFim;}},ValorLocalFinal:function(){return(this.inputEnd.value==L_ComoChegarMascaraFim)?'':this.inputEnd.value;},TipoRota:function(){if(this.caminhoRapido.getValue())
return 0;if(this.caminhoAPe.getValue())
return 2;return 1;},TratarImagemComando:function(comando){switch(comando){case'Vire à esquerda':return'img/print/TurnLeft.png';break;case'Vire à direita':return'img/print/TurnRight.png';break;case'Siga em frente':return'img/print/KeepStraight.png';break;case'Início da rota':return'img/print/DepartStart.png';break;case'Fim da rota':return'img/print/ArriveFinish.png';break;case'Continue':return'img/print/RoadNameChange.png';break;case'Permaneça à esquerda':return'img/print/KeepLeft.png';break;case'Permaneça à direita':return'img/print/KeepRight.png';break;default:return'';break;}},FocarPontoRota:function(posicao){if(pComoChegar.IDRota=='0'){var j=parseInt(posicao)+1;oMapa.Mapa().SetCenterAndZoom(pComoChegar.PontosRota[j],oMapa.ZoomEstabelecimento);}
else{if(posicao=='ultimo')
posicao=pComoChegar.PontosRota.length-2;var i=parseInt(posicao);oMapa.Mapa().HideInfoBox();oMapa.Mapa().SetCenterAndZoom(pComoChegar.PontosRota[i].GetIconAnchor(),oMapa.ZoomEstabelecimento);oMapa.Mapa().ShowInfoBox(pComoChegar.PontosRota[i]);}},DefinirLocalInicial:function(descricao,x,y,estaNoPaisBase){this.PontoInicial=new ComoChegarLocal();this.PontoInicial.DefinirDescricao(descricao);this.PontoInicial.DefinirX(x);this.PontoInicial.DefinirY(y);if(estaNoPaisBase==null||estaNoPaisBase==undefined)
this.PontoInicial.EstaNoPaisBase=true;else
this.PontoInicial.EstaNoPaisBase=estaNoPaisBase;$("hfLocalInicialState").value=Object.toJSON(this.PontoInicial);__doPostBack('btnRotaInicialState','');},DefinirLocalFinal:function(descricao,x,y,estaNoBrasil){this.PontoFinal=new ComoChegarLocal();this.PontoFinal.DefinirDescricao(descricao);this.PontoFinal.DefinirX(x);this.PontoFinal.DefinirY(y);if(estaNoBrasil==null||estaNoBrasil==undefined)
this.PontoFinal.EstaNoBrasil=true;else
this.PontoFinal.EstaNoBrasil=estaNoBrasil;$("hfLocalFinalState").value=Object.toJSON(this.PontoFinal);__doPostBack('btnRotaFinalState','');},MostrarLinkNovaRota:function(){this.toolbar.removeClassName("hidden");this.toolbar.update();this.toolbar.appendChild(Builder.node('a',{href:'javascript:void(0);',onclick:"pComoChegar.NovaRota();"},L_ComoChegarNova));},FiltrarEnderecoInicialOut:function(enderecoInicial){$("hfLocalInicialBuscaState").value=Object.toJSON(enderecoInicial);__doPostBack('btnBuscaEnderecoInicialOut','');},FiltrarEnderecoFinalOut:function(enderecoFinal){$("hfLocalFinalBuscaState").value=Object.toJSON(enderecoFinal);__doPostBack('btnBuscaEnderecoFinalOut','');},FiltrarEnderecoInicial:function(enderecoInicial){var TipoObjeto=this.TipoObjeto.ForaDoBrasil;if(enderecoInicial.erro||enderecoInicial.recordCount)
TipoObjeto=this.TipoObjeto.Brasil;this.containerLocalInicial.removeClassName("haltingWaypoint");this.containerEscolherLocalInicial.removeClassName("disambgError");this.containerEscolherLocalInicial.removeClassName("disambgWarning");this.escolherUmLocalInicial.update();var validacaoErro=null;var quantidadeRegistros=null;var templateNome=null;var templateX=null;var templateY=null;var estaNoBrasil=null;if(TipoObjeto==this.TipoObjeto.ForaDoBrasil){validacaoErro=(enderecoInicial.length==0);quantidadeRegistros=enderecoInicial.length;templateNome=new Template('#{Name}');templateX=new Template('#{Longitude}');templateY=new Template('#{Latitude}');estaNoBrasil=false;}
else{validacaoErro=(enderecoInicial.erro||enderecoInicial.recordCount==0);quantidadeRegistros=enderecoInicial.recordCount;templateNome=null;templateX=new Template('#{x}');templateY=new Template('#{y}');estaNoBrasil=true;}
if(validacaoErro){this.containerEscolherLocalInicial.removeClassName("hidden");this.containerLocalInicial.addClassName("haltingWaypoint");this.containerEscolherLocalInicial.addClassName("disambgError");this.mensagemLocalInicial.update(L_ComoChegarNenhumResultado);return;}
switch(quantidadeRegistros){case 1:var descricao=null;var x=null;var y=null;if(TipoObjeto==this.TipoObjeto.ForaDoBrasil){descricao=templateNome.evaluate(enderecoInicial[0]);x=templateX.evaluate(enderecoInicial[0].LatLong);y=templateY.evaluate(enderecoInicial[0].LatLong);}
else{if(enderecoInicial.addressLocation){descricao=pBusca.TratarAddressLocation(enderecoInicial.addressLocation[0]);x=templateX.evaluate(enderecoInicial.addressLocation[0].point);y=templateY.evaluate(enderecoInicial.addressLocation[0].point);}
else if(enderecoInicial.cityLocation){descricao=pBusca.TratarCityLocation(enderecoInicial.cityLocation[0]);x=templateX.evaluate(enderecoInicial.cityLocation[0].point);y=templateY.evaluate(enderecoInicial.cityLocation[0].point);}}
this.DefinirLocalInicial(descricao,x,y,estaNoBrasil);break;default:this.mensagemLocalInicial.update(L_BuscaMaisResultados);this.containerEscolherLocalInicial.removeClassName("hidden");this.containerEscolherLocalInicial.addClassName("disambgWarning");this.containerLocalInicial.addClassName("haltingWaypoint");var divSugestoes=Builder.node('div',{className:'disambghilite2'},L_BuscaSugestoesLocal);var olLocais=Builder.node('ol');this.escolherUmLocalInicial.appendChild(divSugestoes);var descricao=null;var x=null;var y=null;var qtdItens=null;if(TipoObjeto==this.TipoObjeto.ForaDoBrasil){qtdItens=enderecoInicial.length;}
else{if(enderecoInicial.addressLocation)
qtdItens=enderecoInicial.addressLocation.length;else if(enderecoInicial.cityLocation)
qtdItens=enderecoInicial.cityLocation.length;}
for(var i=0;i<qtdItens;i++){if(TipoObjeto==this.TipoObjeto.ForaDoBrasil){descricao=templateNome.evaluate(enderecoInicial[i]);x=templateX.evaluate(enderecoInicial[i].LatLong);y=templateY.evaluate(enderecoInicial[i].LatLong);}
else{if(enderecoInicial.addressLocation){descricao=pBusca.TratarAddressLocation(enderecoInicial.addressLocation[i]);x=templateX.evaluate(enderecoInicial.addressLocation[i].point);y=templateY.evaluate(enderecoInicial.addressLocation[i].point);}
else if(enderecoInicial.cityLocation){descricao=pBusca.TratarCityLocation(enderecoInicial.cityLocation[i]);x=templateX.evaluate(enderecoInicial.cityLocation[i].point);y=templateY.evaluate(enderecoInicial.cityLocation[i].point);}}
olLocais.appendChild(Builder.node('li',[Builder.node('a',{href:'javascript:void(0);',onclick:("pComoChegar.DefinirLocalInicial('"+descricao+"','"+x+"','"+y+"', "+estaNoBrasil+");")},[Builder.node('span',{className:'disambgDiff'},descricao)])]));}
this.escolherUmLocalInicial.appendChild(olLocais);break;}},FiltrarEnderecoFinal:function(enderecoFinal){var TipoObjeto=this.TipoObjeto.ForaDoBrasil;if(enderecoFinal.erro||enderecoFinal.recordCount)
TipoObjeto=this.TipoObjeto.Brasil;this.containerLocalFinal.removeClassName("haltingWaypoint");this.containerEscolherLocalFinal.removeClassName("disambgError");this.containerEscolherLocalFinal.removeClassName("disambgWarning");this.escolherUmLocalFinal.update();var validacaoErro=null;var quantidadeRegistros=null;var templateNome=null;var templateX=null;var templateY=null;var estaNoBrasil=null;if(TipoObjeto==this.TipoObjeto.ForaDoBrasil){validacaoErro=(enderecoFinal.length==0);quantidadeRegistros=enderecoFinal.length;templateNome=new Template('#{Name}');templateX=new Template('#{Longitude}');templateY=new Template('#{Latitude}');estaNoBrasil=false;}
else{validacaoErro=(enderecoFinal.erro||enderecoFinal.recordCount==0);quantidadeRegistros=enderecoFinal.recordCount;templateNome=null;templateX=new Template('#{x}');templateY=new Template('#{y}');estaNoBrasil=true;}
if(validacaoErro){this.containerEscolherLocalFinal.removeClassName("hidden");this.containerLocalFinal.addClassName("haltingWaypoint");this.containerEscolherLocalFinal.addClassName("disambgError");this.mensagemLocalFinal.update(L_ComoChegarNenhumResultado);return;}
switch(quantidadeRegistros){case 1:var descricao=null;var x=null;var y=null;if(TipoObjeto==this.TipoObjeto.ForaDoBrasil){descricao=templateNome.evaluate(enderecoFinal[0]);x=templateX.evaluate(enderecoFinal[0].LatLong);y=templateY.evaluate(enderecoFinal[0].LatLong);}
else{if(enderecoFinal.addressLocation){descricao=pBusca.TratarAddressLocation(enderecoFinal.addressLocation[0]);x=templateX.evaluate(enderecoFinal.addressLocation[0].point);y=templateY.evaluate(enderecoFinal.addressLocation[0].point);}
else if(enderecoFinal.cityLocation){descricao=pBusca.TratarCityLocation(enderecoFinal.cityLocation[0]);x=templateX.evaluate(enderecoFinal.cityLocation[0].point);y=templateY.evaluate(enderecoFinal.cityLocation[0].point);}}
this.DefinirLocalFinal(descricao,x,y,estaNoBrasil);break;default:this.mensagemLocalFinal.update(L_BuscaMaisResultados);this.containerEscolherLocalFinal.removeClassName("hidden");this.containerEscolherLocalFinal.addClassName("disambgWarning");this.containerLocalFinal.addClassName("haltingWaypoint");var divSugestoes=Builder.node('div',{className:'disambghilite2'},L_BuscaSugestoesLocal);var olLocais=Builder.node('ol');this.escolherUmLocalFinal.appendChild(divSugestoes);var descricao=null;var x=null;var y=null;var qtdItens=null;if(TipoObjeto==this.TipoObjeto.ForaDoBrasil){qtdItens=enderecoFinal.length;}
else{if(enderecoFinal.addressLocation)
qtdItens=enderecoFinal.addressLocation.length;else if(enderecoFinal.cityLocation)
qtdItens=enderecoFinal.cityLocation.length;}
for(var i=0;i<qtdItens;i++){if(TipoObjeto==this.TipoObjeto.ForaDoBrasil){descricao=templateNome.evaluate(enderecoFinal[i]);x=templateX.evaluate(enderecoFinal[i].LatLong);y=templateY.evaluate(enderecoFinal[i].LatLong);}
else{if(enderecoFinal.addressLocation){descricao=pBusca.TratarAddressLocation(enderecoFinal.addressLocation[i]);x=templateX.evaluate(enderecoFinal.addressLocation[i].point);y=templateY.evaluate(enderecoFinal.addressLocation[i].point);}
else if(enderecoFinal.cityLocation){descricao=pBusca.TratarCityLocation(enderecoFinal.cityLocation[i]);x=templateX.evaluate(enderecoFinal.cityLocation[i].point);y=templateY.evaluate(enderecoFinal.cityLocation[i].point);}}
olLocais.appendChild(Builder.node('li',[Builder.node('a',{href:'javascript:void(0);',onclick:("pComoChegar.DefinirLocalFinal('"+descricao+"','"+x+"','"+y+"', "+estaNoBrasil+");")},[Builder.node('span',{className:'disambgDiff'},descricao)])]));}
this.escolherUmLocalFinal.appendChild(olLocais);break;}},BuscarEnderecoInicial:function(){pComoChegar.ExecutandoBusca=true;pComoChegar.ExecutandoBuscaInicial=true;if(pComoChegar.PontoInicial){if(pComoChegar.PontoInicial.Descricao==pComoChegar.ValorLocalInicial()){pComoChegar.ExecutandoBuscaInicial=false;return;}
else{pComoChegar.PontoInicial=null;}}
var enderecoInicial=pComoChegar.ValorLocalInicial();var ajaxBuscaEnderecoInicial=new Ajax.Request('BuscaEndereco.aspx',{method:'get',parameters:{e:enderecoInicial},onComplete:function(req){var retorno=eval("("+req.responseText+")");if(retorno.erro||retorno.recordCount==0)
pComoChegar.BuscarEnderecoInicialOut();else{pComoChegar.FiltrarEnderecoInicial(retorno);pComoChegar.ExecutandoBuscaInicial=false;}}});},BuscarEnderecoInicialOut:function(){pComoChegar.ExecutandoBusca=true;if(pComoChegar.PontoInicial){if(pComoChegar.PontoInicial.Descricao==pComoChegar.ValorLocalInicial()){pComoChegar.ExecutandoBuscaInicial=false;return;}
else{pComoChegar.PontoInicial=null;}}
var enderecoInicial=pComoChegar.ValorLocalInicial();oMapa.Mapa().Find(null,enderecoInicial,null,null,1,5,false,false,false,null,function cbInicial(a,b,c,d,e){pComoChegar.FiltrarEnderecoInicial(c);pComoChegar.ExecutandoBuscaInicial=false;});},BuscarEnderecoFinal:function(){pComoChegar.ExecutandoBusca=true;pComoChegar.ExecutandoBuscaFinal=true;if(pComoChegar.PontoFinal){if(pComoChegar.PontoFinal.Descricao==pComoChegar.ValorLocalFinal()){pComoChegar.ExecutandoBuscaFinal=false;pComoChegar.ExecutandoBusca=false;return;}
else{pComoChegar.PontoFinal=null;}}
var enderecoFinal=pComoChegar.ValorLocalFinal();var ajaxBuscaEnderecoFinal=new Ajax.Request('BuscaEndereco.aspx',{method:'get',parameters:{e:enderecoFinal},onComplete:function(req2){var retorno=eval("("+req2.responseText+")");if(retorno.erro||retorno.recordCount==0)
pComoChegar.BuscarEnderecoFinalOut();else{pComoChegar.FiltrarEnderecoFinal(retorno);pComoChegar.ExecutandoBuscaFinal=false;pComoChegar.ExecutandoBusca=false;}}});},BuscarEnderecoFinalOut:function(){pComoChegar.ExecutandoBusca=true;if(pComoChegar.PontoFinal){if(pComoChegar.PontoFinal.Descricao==pComoChegar.ValorLocalFinal()){pComoChegar.ExecutandoBusca=false;pComoChegar.ExecutandoBuscaFinal=false;return;}
else{pComoChegar.PontoFinal=null;}}
var enderecoFinal=pComoChegar.ValorLocalFinal();oMapa.Mapa().Find(null,enderecoFinal,null,null,1,5,false,false,false,null,function cbFinal(a,b,c,d,e){pComoChegar.FiltrarEnderecoFinal(c);pComoChegar.ExecutandoBusca=false;pComoChegar.ExecutandoBuscaFinal=false;});},BuscarEnderecos:function(){if(pComoChegar.ValorLocalInicial()==''||pComoChegar.ValorLocalFinal()=='')
return;if(pComoChegar.ValorLocalInicial().length<=2||pComoChegar.ValorLocalFinal().length<=2)
return;pComoChegar.Abrir();pComoChegar.BuscarEnderecoInicial();},MostrarTitulo:function(){this.taskTitle.removeClassName("hidden");},EsconderTitulo:function(){this.taskTitle.addClassName("hidden");},Carregando:function(carregando){if(carregando){$get('updProgTaskHost').style.display="block";try{oMapa.ScrollTop=$("msve_taskArea_data").scrollTop;}catch(e){}
$("msve_taskArea_data").scrollTop=0;$("msve_taskArea_data").style.overflowY='hidden';}
else{$get('updProgTaskHost').style.display="none";if($("msve_taskArea_data").style.overflowY=='hidden')
$("msve_taskArea_data").style.overflowY='scroll';try{$("msve_taskArea_data").scrollTop=oMapa.ScrollTop;}catch(e){}}},MonitorarEnterEndereco:function(evento){var k=null;if(!evento)
k=(window.event)?window.event.keyCode:window.event.which;else
k=evento.keyCode;if(k==13)
pComoChegar.BuscarEnderecos();},ConverterTempo:function(tempo){var t='';t=tempo.replace(/PT/,'');t=t.replace(/DT/,(' '+L_ComoChegarTempoDia+' '));t=t.replace(/H/,(' '+L_ComoChegarTempoHora+' '));t=t.replace(/M/,(' '+L_ComoChegarTempoMinuto+' '));t=t.replace(/S/,(' '+L_ComoChegarTempoSegundo+' '));if(t=='')
return'';return', '+t.substring(0,t.length-1);},ConverterDistancia:function(distancia){try{if(!isNaN(distancia)){var fltDistancia=parseFloat(distancia);if(fltDistancia>=1)
return fltDistancia+" km";else if(fltDistancia==0)
return"";else
return(fltDistancia*1000)+" m";}
else{return"";}}
catch(e){return distancia+" km";}},InverterRota:function(){var pontoTemp=this.PontoInicial;var endInicial=this.ValorLocalInicial();this.PontoInicial=this.PontoFinal;this.PontoFinal=pontoTemp;this.DefinirValorLocalInicial(this.ValorLocalFinal());this.DefinirValorLocalFinal(endInicial);if(this.PontoInicial&&this.PontoFinal)
this.GerarRota();else
this.BuscarEnderecos();},AlterarLocalInicial:function(){this.containerLocalInicialDefinido.childElements()[0].esconder();this.containerLocalInicialDefinido.childElements()[1].mostrar();},AlterarLocalFinal:function(){this.containerLocalFinalDefinido.childElements()[0].esconder();this.containerLocalFinalDefinido.childElements()[1].mostrar();},CancelarAlterarLocalInicial:function(){this.containerLocalInicialDefinido.childElements()[0].mostrar();this.containerLocalInicialDefinido.childElements()[1].esconder();},CancelarAlterarLocalFinal:function(){this.containerLocalFinalDefinido.childElements()[0].mostrar();this.containerLocalFinalDefinido.childElements()[1].esconder();},MostrarRotaOut:function(){oPin.RemoverPinsCamada(this.CamadaPins);this.CamadaPins=oPin.CriarCamadaPins();var rota=this.UltimaRota;if(rota==null){this.containerMensagem.removeClassName("hidden");this.containerMensagem.update(L_ComoChegarProblemas);return;}
var localInicial=this.PontoInicial.Descricao;var localFinal=this.PontoFinal.Descricao;var containerInicialNaoEditar=Builder.node('div',[Builder.node('label',{className:'waypointLabel'},L_ComoChegarInicial+':'),Builder.node('span',{className:'waypointDisplayText'},localInicial),Builder.node('div',{className:'waypointActions'},[Builder.node('a',{href:'javascript:void(0);',onclick:''},L_Alterar)])]);this.containerLocalInicialDefinido.update();this.containerLocalInicialDefinido.appendChild(containerInicialNaoEditar);this.containerLocalInicialDefinido.show();this.containerLocalInicialNaoDefinido.hide();var distanciaTotal=(rota.Itinerary.Distance+rota.Itinerary.DistanceUnit+", ");var tempoTotal=(rota.Itinerary.Time);var sumarioRota=Builder.node('div',{className:'routeSummary',clear:'both'},[Builder.node('span',{className:'directive'},L_ComoChegarTrajeto+': '),Builder.node('span',{className:'distance'},distanciaTotal),Builder.node('span',{className:'time'},tempoTotal)]);this.containerTrajeto.update();this.containerTrajeto.appendChild(sumarioRota);var trajetoRota=Builder.node('div',{className:'itinerary'});var listaTrajetos=Builder.node('ol',{className:'stepsList'});var pos=1;for(var i=2;i<(rota.Itinerary.Segments.length-1);i++){var instrucao=rota.Itinerary.Segments[i].Instruction;var distancia=(rota.Itinerary.Segments[i].Distance!=null)?(rota.Itinerary.Segments[i].Distance+rota.Itinerary.DistanceUnit):"";var descricaoGeral=(instrucao);var itemTrajeto=Builder.node('li',{className:'FullRoute'},[Builder.node('span',{className:'bullet'},pos),Builder.node('span',{className:'instruction'},[Builder.node('span',instrucao)]),Builder.node('span',{className:'distance'},distancia)]);listaTrajetos.appendChild(itemTrajeto);pos++;}
trajetoRota.appendChild(listaTrajetos);this.containerTrajeto.appendChild(trajetoRota);var containerFinalNaoEditar=Builder.node('div',[Builder.node('label',{className:'waypointLabel'},L_ComoChegarFinal+':'),Builder.node('span',{className:'waypointDisplayText'},localFinal),Builder.node('div',{className:'waypointActions'},[Builder.node('a',{href:'javascript:void(0);',onclick:''},L_Alterar)])]);this.containerLocalFinalDefinido.update();this.containerLocalFinalDefinido.appendChild(containerFinalNaoEditar);this.containerLocalFinalDefinido.show();this.containerLocalFinalNaoDefinido.hide();},MostrarRota:function(){oPin.RemoverPinsCamada(this.CamadaPins);this.CamadaPins=oPin.CriarCamadaPins();pComoChegar.PontosRota=[];var rota=this.UltimaRota;if(rota.erro){this.containerMensagem.removeClassName("hidden");this.containerMensagem.update(L_ComoChegarProblemas);return;}
this.IDRota=rota.routeId;var localInicial=rota.routeSummary[0].description;var localFinal=rota.routeSummary[1].description;var pins=[];var containerInicialEditar=Builder.node('div',{id:'ComoChegar_ContainerLocalInicialDefinidoEditar',className:'editDisplayInput hidden'},[Builder.node('label',{className:'waypointLabel'},L_ComoChegarInicial+':'),Builder.node('div',{className:'waypointInput-wrapper'},[Builder.node('input',{type:'text',maxlength:'256',className:'text',value:localInicial,id:'ComoChegar_InicioAlteracao'})]),Builder.node('div',{className:'directionsEditActions'},[Builder.node('input',{value:L_Cancelar,className:'button higButton',type:'button',onclick:'pComoChegar.CancelarAlterarLocalInicial()'}),Builder.node('span',' '),Builder.node('input',{value:L_ComoChegarTitulo,className:'button higButton',type:'button',onclick:'pComoChegar.DefinirValorLocalInicial($("ComoChegar_InicioAlteracao").value);pComoChegar.BuscarEnderecos();'})])]);var containerInicialNaoEditar=Builder.node('div',[Builder.node('label',{className:'waypointLabel'},L_ComoChegarInicial+':'),Builder.node('span',{className:'waypointDisplayText'},localInicial),Builder.node('div',{className:'waypointActions'},[Builder.node('a',{href:'javascript:void(0);',onclick:'pComoChegar.AlterarLocalInicial();'},L_Alterar)])]);this.containerLocalInicialDefinido.update();this.containerLocalInicialDefinido.appendChild(containerInicialNaoEditar);this.containerLocalInicialDefinido.appendChild(containerInicialEditar);this.containerLocalInicialDefinido.show();this.containerLocalInicialNaoDefinido.hide();var distanciaTotal=this.ConverterDistancia(rota.routeTotals.totalDistance);var tempoTotal=this.ConverterTempo(rota.routeTotals.totalTime);var sumarioRota=Builder.node('div',{className:'routeSummary',clear:'both'},[Builder.node('span',{className:'directive'},L_ComoChegarTrajeto+': '),Builder.node('span',{className:'distance'},distanciaTotal),Builder.node('span',{className:'time'},tempoTotal)]);this.containerTrajeto.update();this.containerTrajeto.appendChild(sumarioRota);var trajetoRota=Builder.node('div',{className:'itinerary'});var listaTrajetos=Builder.node('ol',{className:'stepsList'});pComoChegar.PontosRota.push(oPin.Adicionar({ponto:{x:rota.routeSummary[0].point.x,y:rota.routeSummary[0].point.y},titulo:localInicial,tipo:oPin.TipoPin.ComoChegarInicio,camada:pComoChegar.CamadaPins,valor:'0'}));pins.push(new VELatLong(rota.routeSummary[0].point.y,rota.routeSummary[0].point.x));var pos=1;for(var i=1;i<(rota.segDescription.length-1);i++){var pontoX=rota.segDescription[i].point.x;var pontoY=rota.segDescription[i].point.y;var instrucao=rota.segDescription[i].command;var descricaoItem=rota.segDescription[i].description;var distancia=this.ConverterDistancia(rota.segDescription[i].distance);var descricaoGeral=(instrucao+" "+L_AntesDescricao+" "+descricaoItem);var ptAdd=null;if(pontoX!=0&&pontoY!=0){ptAdd=oPin.Adicionar({ponto:{x:pontoX,y:pontoY},titulo:(L_ComoChegarPasso+" "+pos),descricao:descricaoGeral,tipo:oPin.TipoPin.ComoChegar,camada:pComoChegar.CamadaPins,valor:pos});pComoChegar.PontosRota.push(ptAdd);var itemTrajeto=Builder.node('li',{className:'FullRoute',onclick:"oPin.FocarShape('"+ptAdd.GetID()+"'); if (pComoChegar.UltimaRota) { pComoChegar.DesenharRota(); }"},[Builder.node('span',{className:'bullet'},pos),Builder.node('span',{className:'instruction'},[Builder.node('span',instrucao+" "+L_ComoChegarNa+" "),Builder.node('span',{className:'instructionKeyword'},descricaoItem)]),Builder.node('span',{className:'distance'},distancia)]);listaTrajetos.appendChild(itemTrajeto);pComoChegar.PontosRota[pComoChegar.PontosRota.length-1].SetMinZoomLevel(15);pins.push(new VELatLong(pontoY,pontoX));pos++;}}
pComoChegar.PontosRota.push(oPin.Adicionar({ponto:{x:rota.routeSummary[1].point.x,y:rota.routeSummary[1].point.y},titulo:localFinal,tipo:oPin.TipoPin.ComoChegarFim,camada:pComoChegar.CamadaPins,valor:pos}));pins.push(new VELatLong(rota.routeSummary[1].point.y,rota.routeSummary[1].point.x));trajetoRota.appendChild(listaTrajetos);this.containerTrajeto.appendChild(trajetoRota);var containerFinalEditar=Builder.node('div',{id:'ComoChegar_ContainerLocalFinalDefinidoEditar',className:'editDisplayInput hidden'},[Builder.node('label',{className:'waypointLabel'},L_ComoChegarFinal+':'),Builder.node('div',{className:'waypointInput-wrapper'},[Builder.node('input',{type:'text',maxlength:'256',className:'text',value:localFinal,id:'ComoChegar_FinalAlteracao'})]),Builder.node('div',{className:'directionsEditActions'},[Builder.node('input',{value:L_Cancelar,className:'button higButton',type:'button',onclick:'pComoChegar.CancelarAlterarLocalFinal()'}),Builder.node('span',' '),Builder.node('input',{value:L_ComoChegarTitulo,className:'button higButton',type:'button',onclick:'pComoChegar.DefinirValorLocalFinal($("ComoChegar_FinalAlteracao").value);pComoChegar.BuscarEnderecos();'})])]);var containerFinalNaoEditar=Builder.node('div',[Builder.node('label',{className:'waypointLabel'},L_ComoChegarFinal+':'),Builder.node('span',{className:'waypointDisplayText'},localFinal),Builder.node('div',{className:'waypointActions'},[Builder.node('a',{href:'javascript:void(0);',onclick:'pComoChegar.AlterarLocalFinal();'},L_Alterar)])]);this.containerLocalFinalDefinido.update();this.containerLocalFinalDefinido.appendChild(containerFinalNaoEditar);this.containerLocalFinalDefinido.appendChild(containerFinalEditar);this.containerLocalFinalDefinido.show();this.containerLocalFinalNaoDefinido.hide();oMapa.Mapa().InitRouting();oMapa.Mapa().SetMapView(pins);},GerarEmail:function(){if(this.PontoInicial==null||this.PontoFinal==null)
return"";return"rt="+escape(this.PontoInicial.Descricao+'~'+this.PontoFinal.Descricao)+'&rtp='+escape(this.PontoInicial.X+' '+this.PontoInicial.Y)+';'+escape(this.PontoFinal.X+' '+this.PontoFinal.Y);},GerarRota:function(){this.GerandoRota=true;var tipoRota=(this.TipoRota()==0)?VERouteType.Quickest:VERouteType.Shortest;var latLongOrigem=new VELatLong(parseFloat(this.PontoInicial.Y),parseFloat(this.PontoInicial.X));var latLongDestino=new VELatLong(parseFloat(this.PontoFinal.Y),parseFloat(this.PontoFinal.X));oMapa.Mapa().GetRoute(latLongOrigem,latLongDestino,VEDistanceUnit.Kilometers,tipoRota,function onGotRoute(route){pComoChegar.UltimaRota=route;pComoChegar.MostrarRotaOut();pComoChegar.MostrarLinkNovaRota();pComoChegar.GerandoRota=false;});},LimparDesenhoRota:function(){oPin.RemoverPinsCamada(pComoChegar.CamadaShape);pComoChegar.CamadaShape=oPin.CriarCamadaPins();},InserirRotaGravada:function(){var shape=new VEShape(VEShapeType.Polyline,pComoChegar.InitialShapeZoom);shape.SetLineWidth(5);shape.SetLineColor(new VEColor(104,192,221,0.8));shape.HideIcon();pComoChegar.LimparDesenhoRota();pComoChegar.CamadaShape.AddShape(shape);},DesenharRota:function(){if(!pComoChegar.InitGetCoords){pComoChegar.InitGetCoords=true;var rota=this.UltimaRota;var mapView=oMapa.Mapa().GetMapView();var mult=0.5;var lng=(((mapView.BottomRightLatLong.Longitude-mapView.TopLeftLatLong.Longitude)*mult)/2);var lat=(((mapView.TopLeftLatLong.Latitude-mapView.BottomRightLatLong.Latitude)*mult)/2);mapView.TopLeftLatLong.Longitude-=lng;mapView.TopLeftLatLong.Latitude+=lat;mapView.BottomRightLatLong.Longitude+=lng;mapView.BottomRightLatLong.Latitude-=lat;var extentMapa=(mapView.TopLeftLatLong.Longitude+'|'+mapView.BottomRightLatLong.Longitude+'|'+mapView.BottomRightLatLong.Latitude+'|'+mapView.TopLeftLatLong.Latitude);var tamanhoMapa=(oMapa.DivMapa.clientWidth+"|"+oMapa.DivMapa.clientHeight);var ajaxDesenharRota=new Ajax.Request('GerarCoordsRota.aspx',{method:'get',parameters:{id:pComoChegar.IDRota,t:tamanhoMapa,e:extentMapa},onComplete:function(req){pComoChegar.InitGetCoords=false;var objRota=eval("("+req.responseText+")");var pontos=[];for(var i=0;i<objRota.length;i++)
pontos.push(new VELatLong(objRota[i].y,objRota[i].x));if(pontos.length>0){var shape=new VEShape(VEShapeType.Polyline,pontos);shape.SetLineWidth(5);shape.SetLineColor(new VEColor(104,192,221,0.8));shape.HideIcon();pComoChegar.LimparDesenhoRota();pComoChegar.CamadaShape.AddShape(shape);}}});}},LimparRota:function(){this.ValidadorBusca=null;this.PontoInicial=null;this.PontoFinal=null;this.IDRota=null;this.UltimaRota=null;oPin.RemoverPinsCamada(this.CamadaPins);oPin.RemoverPinsCamada(this.CamadaShape);this.PontosRota=[];oMapa.Mapa().DeleteRoute();this.CamadaPins=oPin.CriarCamadaPins();this.CamadaShape=oPin.CriarCamadaPins();},TratarRotaOut:function(route){$("hfUltimaRota").value=Object.toJSON(route);__doPostBack('btnRotaOut','');}});var ComoChegarLocal=Class.create({initialize:function(){this.Descricao=null;this.X=null;this.Y=null;this.EstaNoPaisBase=false;this.Pais="";},DefinirDescricao:function(descricao){this.Descricao=descricao;},DefinirX:function(x){this.X=parseFloat(x.toString().replace(',','.'));},DefinirY:function(y){this.Y=parseFloat(y.toString().replace(',','.'));},ResgatarDados:function(){return(this.Descricao+"|"+this.X+"|"+this.Y);},toString:function(){return(this.X+" "+this.Y);}});
var Lista=Class.create({initialize:function(){this.ListasEditar=new ListaEdit;this.ListasDeletar=new ListaDelete;this.Listas=[];this.ListasGeral=null;this.PrimeiraAbertura=false;this.divLista=$("msve_ScratchPad");this.divContent=$("conteudoScratch");this.divActionMove=$("scratchpadTempTitle");this.tituloLista=$("tituloLista");this.menuLogin=$("menuLogin");this.containerListaVazia=$("containerListaVazia");this.divAvisoListaNaoSalva=$("divAvisoListaNaoSalva");this.ulListas=$("ulListas");this.itensLista=$("sp_collection_list");this.divSalvarLista=$("saveCollectionPanel");this.menu1=$("spMenuStrip");this.menu2=$("spMenuStrip2");this.liSuasListas=$("liSuasListas");this.liNovaLista=$("liNovaLista");this.liImportar=$("liImportar");this.liAcoes=$("liAcoes");this.liSeparador1=$("liSeparador1");this.liSeparador2=$("liSeparador2");this.liSeparador3=$("liSeparador3");this.liSuasListas.onclick=function(){pLista.SuasListas();};this.liNovaLista.onclick=function(){pLista.NovaLista();};this.Drag=null;this.isMaxMode=true;this.IDListaAtiva=0;this.IDAtual=0;this.IDShapeMover=null;},Carregar:function(){this.Posicionar();this.divActionMove.onmousedown=function(){pLista.ListaMoving()};this.NovaListaAtiva(this.IDListaAtiva);this.RetornarListaAtiva().SetTitle(L_ListaNaoSalva);this.ResgatarListas();},NovaLista:function(){pLista.divLista.addClassName("actioning");this.divSalvarLista.style.display='block';this.divSalvarLista.style.visibility='visible';this.divSalvarLista.style.top=pLista.divLista.style.top;this.divSalvarLista.style.left=pLista.divLista.style.left;this.IDEditarLista='';$('annotationFormTitle').value='';$('annotationFormNotes').value='';},MostrarTodos:function(){var pt=[],pts;var qtdPt=this.RetornarListaAtiva().GetShapeCount();for(var i=0;i<qtdPt;i++){pts=this.RetornarListaAtiva().GetShapeByIndex(i).GetPoints();if(pts.length){for(var x=0;x<pts.length;x++)
pt[pt.length]=pts[x];}
else{pt[pt.length]=pts;}}
if(pt.length>0)
oMapa.Mapa().SetMapView(pt);},LimparTodos:function(){var total=this.RetornarListaAtiva().GetShapeCount();if(total==0)
return;this.ListasDeletar.show(L_DesejaApagarItensLista+": "+this.RetornarListaAtiva().GetTitle()+"?","","clearList",null);},AdicionarItemCentro:function(){var et=new VELatLong(popuplat,popuplon);if(et=='undefined'||et==null)
et=oMapa.Mapa().GetCenter();var e=oMapa.Mapa().LatLongToPixel(et);var tit=L_DesenhoSemTitulo;var idNum=this.IDAtual+1;var id=oPin.Adicionar({ponto:et,titulo:tit,tipo:oPin.TipoPin.Padrao,camada:pLista.RetornarListaAtiva(),valor:idNum,numero:idNum}).GetID();pLista.AdicionarScratch(pLista.RetornarListaAtiva().GetShapeByID(id));this.ListasEditar.show(e.x,e.y,tit,'','','',id,idNum,true);EsconderMenuContexto();},EditarItem:function(idShape,nu){var t;var n;var p;var u;var pp;var shape=oMapa.Mapa().GetShapeByID(idShape);oMapa.Mapa().HideInfoBox();pp=oMapa.Mapa().LatLongToPixel(shape.GetIconAnchor());t=shape.GetTitle();n=shape.GetDescription().replace(/\<br\>/g,'');p=shape.GetPhotoURL();u=shape.GetMoreInfoURL();this.ListasEditar.show(pp.x,pp.y,t,n,p,u,idShape,nu);},MoverPin:function(idPin){VE_MessageControl._AddMessage(L_CliqueEmQualquer,3000,true);pLista.IDShapeMover=idPin;oMapa.Mapa().AttachEvent("onmousemove",oDesenho.CrossMap);oMapa.Mapa().AttachEvent("onclick",pLista.DefinirLocalPinMover);},DefinirLocalPinMover:function(e){if(e.leftMouseButton){if(pLista.IDShapeMover){var s=pLista.RetornarListaAtiva().GetShapeByID(pLista.IDShapeMover);var et=oMapa.Mapa().PixelToLatLong(new VEPixel(Math.round(e.mapX),Math.round(e.mapY)));s.Latitude=et.Latitude;s.Longitude=et.Longitude;pLista.ZoomPin(pLista.IDShapeMover);pLista.IDShapeMover=null;}
oMapa.Mapa().DetachEvent("onclick",pLista.DefinirLocalPinMover);oMapa.Mapa().DetachEvent("onmousemove",oDesenho.CrossMap);VE_MessageControl._RemoveMessage();}},ZoomPin:function(i,l)
{var s=oMapa.Mapa().GetShapeByID(i);if(!l)l=oMapa.Mapa().GetZoomLevel();oMapa.Mapa().HideInfoBox();oMapa.Mapa().SetAnimationEnabled(false);oMapa.Mapa().SetCenterAndZoom(s.GetIconAnchor(),l);oMapa.Mapa().SetAnimationEnabled(true);},NovaListaAtiva:function(idLista)
{for(var i=0;i<this.Listas.length;i++)
if(idLista==this.Listas[i].IDLista)
return i;this.Listas[this.Listas.length]=oPin.CriarCamadaPins();this.Listas[this.Listas.length-1].IDLista=idLista;return this.Listas.length-1;},Abrir:function()
{this.Posicionar();this.divLista.style.display="block";if(this.RetornarListaAtiva()!=null)
this.RetornarListaAtiva().Show();['DrawingToolbar_PanZoomTool','DrawingToolbar_PushpinTool','DrawingToolbar_PolylineTool','DrawingToolbar_PolygonTool','DrawingToolbar_FillColorTool','DrawingToolbar_LineColorTool','DrawingToolbar_LineWidthTool','DrawingToolbar_LineDashTool','DrawingToolbar_ModelTool'].each(function(s){Event.observe(s,'mouseover',pLista.TratarMenuDesenho);Event.observe(s,'mouseout',pLista.TratarMenuDesenho);Event.observe(s,'click',pLista.TratarMenuDesenho);});},Propriedades:function()
{pLista.divLista.addClassName("actioning");this.divSalvarLista.style.display='block';this.divSalvarLista.style.visibility='visible';this.divSalvarLista.style.top=pLista.divLista.style.top;this.divSalvarLista.style.left=pLista.divLista.style.left;this.IDEditarLista=this.IDListaAtiva;$('collectionFormTitle').value=this.RetornarListaAtiva().GetTitle();$('collectionFormNotes').value=this.RetornarListaAtiva().GetDescription();},SalvarLista:function(action){var titulo=$('collectionFormTitle').value;var descricao=$('collectionFormNotes').value;if(titulo==""){return;}
var ajaxSalvarLista=new Ajax.Request('GerarLista.aspx',{method:'get',parameters:{t:oUsuario.Token,a:'setCollection',name:titulo,notes:descricao,id:pLista.IDEditarLista},onComplete:function(req){var id=parseInt(req.responseText);if(pLista.IDEditarLista=='')
{pLista.SalvarListaAtiva(id);pLista.SuasListas();pLista.SelecionarLista(id);}
pLista.CancelarEdicaoLista();pLista.ResgatarListas();pLista.IDEditarLista='';$('collectionFormTitle').value='';$('collectionFormNotes').value='';}});},SalvarListaAtiva:function(id)
{if(this.RetornarListaAtiva()!=null)
{var qtdPt=this.RetornarListaAtiva().GetShapeCount();var linha='';for(var i=0;i<qtdPt;i++)
linha=linha+oPin.RetornarDadosShape(this.RetornarListaAtiva().GetShapeByIndex(i))+'|';if(linha!='')
linha=linha.substring(0,linha.length-1);linha=linha.replace(/\&/g,'%26');linha=linha.replace(/\=/g,'%3D');linha=linha.replace(/\?/g,'%3F');var ajaxSalvarListaAtiva=new Ajax.Request('GerarLista.aspx',{method:'get',parameters:{t:oUsuario.Token,a:'setItens',l:linha,id:id},onComplete:function(req)
{var idTemp=pLista.NovaListaAtiva(id);oMapa.Mapa().HideInfoBox();if(pLista.IDEditarLista==0||pLista.IDEditarLista=="")
{oMapa.Mapa().HideInfoBox();var shape=[];var qtdPt2=pLista.RetornarListaAtiva().GetShapeCount();for(var i=0;i<qtdPt2;i++)
{shape[shape.length]=pLista.RetornarListaAtiva().GetShapeByIndex(i);shape[i].Hide();}
if(pLista.IDListaAtiva!=0)
pLista.RemoverDadosLista(shape);else
pLista.AtualizarCookieLista("clearList");for(var x=0;x<qtdPt;x++)
pLista.RetornarListaAtiva().DeleteShape(shape[x]);pLista.AtualizarLista();pLista.IDListaAtiva=parseInt(id);var ajaxItens=new Ajax.Request('GerarLista.aspx',{method:'get',parameters:{t:oUsuario.Token,a:'getItens',id:id},onComplete:function(req){var itensLista=eval("("+req.responseText+")");if(itensLista.length==0){pLista.itensLista.esconder();pLista.containerListaVazia.mostrar();return;}
for(var i=0;i<itensLista.length;i++)
pLista.AdicionarItemLista(itensLista[i]);}});}}});}},CancelarEdicaoLista:function()
{pLista.divLista.removeClassName("actioning");this.divSalvarLista.style.display='none';this.divSalvarLista.style.visibility='hidden';},Esconder:function()
{this.RetornarListaAtiva().Hide();oMapa.Mapa().HideInfoBox();this.divLista.style.display="";pLista.ListaStop();},RetornarListaAtiva:function()
{for(var i=0;i<this.Listas.length;i++)
if(this.IDListaAtiva==this.Listas[i].IDLista)
break;return this.Listas[i];},ResgatarListas:function()
{this.liListaNaoSalva=Builder.node('li',[Builder.node('a',{title:L_ListaNaoSalva,className:'cItemTitle',href:'javascript:void(0);',onclick:'pLista.SelecionarLista(0)'},L_ListaNaoSalva)]);if(this.ulListas.childElements().length==0)
this.ulListas.appendChild(this.liListaNaoSalva);if(oUsuario.Token==null||oUsuario.Token=='')
{this.MostrarMenuLogin();this.divAvisoListaNaoSalva.esconder();this.menu1.mostrar();this.menu2.esconder();}
else
{this.EsconderMenuLogin();var ajaxLista=new Ajax.Request('GerarLista.aspx',{method:'get',parameters:{t:oUsuario.Token,a:'getCollection',rand:Math.floor(Math.random()*11000)},onComplete:function(req)
{pLista.ListasGeral=eval("("+req.responseText+")");if(pLista.ListasGeral.length==0)
{pLista.menu1.mostrar();pLista.menu2.esconder();}
else
{}
pLista.Abrir();pLista.MostrarListas();}});}},MostrarListas:function()
{this.SuasListas();var lista=null;var nome=null;var id=null;this.ulListas.update();pLista.liListaNaoSalva=Builder.node('li',[Builder.node('a',{title:L_ListaNaoSalva,className:'cItemTitle',href:'javascript:void(0);',onclick:'pLista.SelecionarLista(0)'},L_ListaNaoSalva)]);pLista.ulListas.appendChild(pLista.liListaNaoSalva);for(var i=0;i<this.ListasGeral.length;i++){id=this.ListasGeral[i].id;nome=this.ListasGeral[i].name;lista=Builder.node('li',[Builder.node('a',{title:nome,className:'cItemTitle',href:'javascript:void(0);',onclick:'pLista.SelecionarLista(\''+id+'\');'},nome)]);this.ulListas.appendChild(lista);}},SuasListas:function()
{this.containerListaVazia.esconder();this.divAvisoListaNaoSalva.esconder();this.menu1.mostrar();this.menu2.esconder();this.AlterarTitulo(L_ListaSuas);if(this.RetornarListaAtiva()!=null)
this.RetornarListaAtiva().Hide();this.ulListas.mostrar();this.itensLista.update();this.itensLista.esconder();},ResgatarItensLista:function(lista,idLista){this.ulListas.esconder();this.containerListaVazia.esconder();this.itensLista.mostrar();this.itensLista.update();var idTemp,layers;layers=this.Listas.length;if(this.RetornarListaAtiva()!=null)
this.RetornarListaAtiva().Hide();if(lista){idTemp=this.NovaListaAtiva(lista.id);this.IDListaAtiva=parseInt(lista.id);this.RetornarListaAtiva().SetTitle(lista.name);this.RetornarListaAtiva().SetDescription(lista.notes);}
else{idTemp=idLista;this.IDListaAtiva=parseInt(idLista);}
oMapa.Mapa().HideInfoBox();this.RetornarListaAtiva().Show();if(this.Listas.length!=layers){var ajaxItens=new Ajax.Request('GerarLista.aspx',{method:'get',parameters:{t:oUsuario.Token,a:'getItens',id:lista.id},onComplete:function(req){var itensLista=eval("("+req.responseText+")");if(itensLista.length==0){pLista.itensLista.esconder();pLista.containerListaVazia.mostrar();return;}
for(var i=0;i<itensLista.length;i++)
pLista.AdicionarItemLista(itensLista[i]);}});}
else{var qtdPt=this.RetornarListaAtiva().GetShapeCount();var shape;if(qtdPt==0){this.containerListaVazia.mostrar();this.itensLista.esconder();}
for(var i=0;i<qtdPt;i++){shape=this.RetornarListaAtiva().GetShapeByIndex(i);pLista.AdicionarScratch(shape);}}},AdicionarItemLista:function(item){var pt;var pts;var ptVE;if(item.type.toUpperCase()=='polyline'.toUpperCase()||item.type.toUpperCase()=='polygon'.toUpperCase()){ptVE=[];pt=item.points.split(';');for(var i=0;i<pt.length;i++){pts=pt[i].split(' ');ptVE[ptVE.length]=new VELatLong(parseFloat(pts[0]),parseFloat(pts[1]));}}
else{if(item.points)
pts=item.points.split(' ');else
pts=item.point.split(' ');ptVE=new VELatLong(parseFloat(pts[0]),parseFloat(pts[1]));}
var id=oPin.Adicionar({ponto:ptVE,titulo:item.title,descricao:item.notes,urlInfo:item.moreinfourl,urlImagem:item.photourl,tipo:item.type,camada:pLista.RetornarListaAtiva(),valor:item.numberList,numero:item.numberList,paramPoly:item.paramPoly,localID:item.id}).GetID();this.AdicionarScratch(oMapa.Mapa().GetShapeByID(id));},RemocaoLista:function(){this.ListasDeletar.show(L_DesejaApagarLista+": "+this.RetornarListaAtiva().GetTitle()+"?","","delList",null);},RemoverLista:function(){var ajaxItens=new Ajax.Request('GerarLista.aspx',{method:'get',parameters:{t:oUsuario.Token,a:'delCollection',id:pLista.IDListaAtiva},onComplete:function(req)
{pLista.IDListaAtiva=0;pLista.AtualizarLista();pLista.ResgatarListas();}});},AdicionarScratch:function(item){if(item!=null){var title,desc,numberPin,type,idShape,idLi=null,photoURL,infoURL;idShape=item.GetID();title=item.GetTitle();desc=item.GetDescription();numberPin=item.NumberPIN;type=(item.TypePIN)?item.TypePIN:item.Type;photoURL=item.GetPhotoURL();infoURL=item.GetMoreInfoURL();this.IDAtual=parseInt(numberPin);this.Abrir();this.RetornarListaAtiva().Show();this.itensLista.appendChild(Builder.node('li',{id:idShape+'_SP',onclick:'oPin.FocarShape(\''+idShape+'\');'},[Builder.node('div',{className:'scratchPadPOI businessListingPOI'},numberPin),Builder.node('h4',{onmouseover:'pLista'},((title)?title:'')),Builder.node('h5',{className:'msve_ScratchPad_measurement'}),Builder.node('p',((desc)?desc:'')),Builder.node('div',{className:'itemToolbar',visibility:'visible'},[Builder.node('a',{className:'tool toolRemoveItem',href:'javascript:void(0);',onclick:'oPin.RemoverPin(\''+idShape+'\', null);'})])]));}},TratarMenuDesenho:function(evento){var obj=Event.element(evento);var cls2='';switch(evento.type){case'mouseover':if(obj.className!=(obj.id+"_click")){cls2=obj.id+"_hover";obj.removeClassName(obj.className);obj.addClassName(cls2);}
break;case'mouseout':if(obj.className!=(obj.id+"_click")){cls2=obj.id;obj.removeClassName(obj.className);obj.addClassName(cls2);}
break;case'click':pLista.ValidarCliqueDesenho(obj);break;}},ValidarCliqueDesenho:function(objeto){['DrawingToolbar_PanZoomTool','DrawingToolbar_PushpinTool','DrawingToolbar_PolylineTool','DrawingToolbar_PolygonTool','DrawingToolbar_FillColorTool','DrawingToolbar_LineColorTool','DrawingToolbar_LineWidthTool','DrawingToolbar_LineDashTool','DrawingToolbar_ModelTool'].each(function(s){var obj2=$(s);obj2.removeClassName(obj2.className);obj2.addClassName(obj2.id);});cls2=objeto.id+"_click";objeto.removeClassName(objeto.className);objeto.addClassName(cls2);pLista.SelecionarFerramentaDesenho(objeto.id);},SelecionarFerramentaDesenho:function(id){oMapa.Mapa().DetachEvent("onmousemove",oDesenho.CrossMap);oMapa.Mapa().DetachEvent("onclick",oDesenho.AddPush);oMapa.Mapa().DetachEvent("onclick",oDesenho.DrawPolyMouseClick);switch(id){case'DrawingToolbar_PushpinTool':this.addPin=true;oMapa.Mapa().AttachEvent("onclick",oDesenho.AddPush);oMapa.Mapa().AttachEvent("onmousemove",oDesenho.CrossMap);break;case'DrawingToolbar_PolylineTool':oMapa.Mapa().AttachEvent("onmousemove",oDesenho.CrossMap);oDesenho.Draw('polyline');break;case'DrawingToolbar_PolygonTool':oMapa.Mapa().AttachEvent("onmousemove",oDesenho.CrossMap);oDesenho.Draw('polygon');break;case'DrawingToolbar_PanZoomTool':case'DrawingToolbar_FillColorTool':case'DrawingToolbar_LineColorTool':case'DrawingToolbar_LineWidthTool':case'DrawingToolbar_LineDashTool':case'DrawingToolbar_ModelTool':oMapa.Mapa().DetachEvent("onmousemove",oDesenho.CrossMap);oMapa.Mapa().DetachEvent("onclick",oDesenho.AddPush);oMapa.Mapa().DetachEvent("onclick",oDesenho.DrawPolyMouseClick);break;}},SelecionarLista:function(idLista){this.menu2.mostrar();this.menu1.esconder();if(idLista==0){if(oUsuario.Token!=null)
if(oUsuario.Token!='')
this.divAvisoListaNaoSalva.mostrar();}
else{this.divAvisoListaNaoSalva.esconder();}
var listaSelecionada=null;if(this.ListasGeral!=null){for(var i=0;i<this.ListasGeral.length;i++){if(this.ListasGeral[i].id==idLista){listaSelecionada=this.ListasGeral[i];break;}}}
if(listaSelecionada!=null){this.AlterarTitulo(listaSelecionada.name);this.IDListaAtiva=listaSelecionada.id;this.ResgatarItensLista(listaSelecionada,idLista);}
else{this.AlterarTitulo(L_ListaNaoSalva);this.ResgatarItensLista(null,0);}},AlterarTitulo:function(texto){this.tituloLista.update();this.tituloLista.appendChild(Builder.node('p',texto));},RemoverDadosLista:function(shape){var linha='';for(var i=0;i<shape.length;i++)
linha=(linha+oPin.RetornarDadosShape(shape[i])+'|');if(linha==''&&shape.length==undefined)
linha=oPin.RetornarDadosShape(shape);else
linha=linha.substring(0,linha.length-1);if(linha!=null)
{if(linha!=" "&&linha!="")
{var ajaxRemoverItem=new Ajax.Request('GerarLista.aspx',{method:'get',parameters:{t:oUsuario.Token,a:'delItens',id:this.IDListaAtiva,l:linha},onComplete:function(req)
{pLista.SelecionarLista(pLista.RetornarListaAtiva().IDLista);}});}}},AtualizarDadosLista:function(shape){var idListaAdd=pLista.IDListaAtiva;var linha='';for(var i=0;i<shape.length;i++)
linha=(linha+oPin.RetornarDadosShape(shape[i])+'|');if(linha==''&&shape.length==undefined)
linha=oPin.RetornarDadosShape(shape);else
linha=(linha.substring(0,linha.length-1));linha=linha.replace(/\&/g,'%26');linha=linha.replace(/\=/g,'%3D');linha=linha.replace(/\?/g,'%3F');var ajaxAtualizarItem=new Ajax.Request('GerarLista.aspx',{method:'get',parameters:{t:oUsuario.Token,a:'setItens',id:idListaAdd,l:linha},onComplete:function(req){}});},AtualizarLista:function(){this.IDAtual=0;this.itensLista.update();var qtdPt=this.RetornarListaAtiva().GetShapeCount();for(var i=0;i<qtdPt;i++)
this.AdicionarScratch(this.RetornarListaAtiva().GetShapeByIndex(i));this.SelecionarLista(this.RetornarListaAtiva().IDLista);},AtualizarCookieLista:function(a){deleteCookie("scrt");if(a=="clearList")
return;var now=new Date()
fixDate(now)
now.setTime(now.getTime()+365*24*60*60*100);var s=this.GerarEmail();setCookie("scrt",s.replace(/sc\=/g,''),now);},GerarEmail:function(){var qtdPt=this.RetornarListaAtiva().GetShapeCount();var linha='';for(var i=0;i<qtdPt;i++)
linha=(linha+oPin.RetornarDadosShape(this.RetornarListaAtiva().GetShapeByIndex(i))+'|');if(linha==''){if(typeof shape!="undefined"&&shape!=null)
if(shape.length==undefined)
linha=oPin.RetornarDadosShape(shape);}
else
linha=linha.substring(0,linha.length-1);return("sc="+escape(linha));},EditarLista:function(shape){pLista.AtualizarLista();if(pLista.IDListaAtiva!=0)
pLista.AtualizarDadosLista(shape);else
pLista.AtualizarCookieLista();},Posicionar:function(){el_d=Element.getDimensions(this.divLista);map_d=Element.getDimensions(oMapa.DivMapa);map_pos=Element.cumulativeOffset(oMapa.DivMapa);this.divLista.style.left=(map_pos.left+map_d.width-el_d.width-10);this.divLista.style.top=(map_pos.top+10);},ListaMoving:function(){pLista.Drag=new Draggable(pLista.divLista.identify(),{ghosting:true,snap:function(x,y,draggable){function constrain(n,lower,upper){if(n>upper)return upper;else if(n<lower)return lower;else return n;}
e_d=Element.getDimensions(draggable.element);p_d=Element.getDimensions(oMapa.DivMapa);p_p=Element.cumulativeOffset(oMapa.DivMapa);return[constrain(x,p_p.left,(p_d.width-e_d.width)+p_p.left),constrain(y,p_p.top,(p_d.height-e_d.height)+p_p.top)];},onEnd:pLista.ListaStop,revert:false,handler:pLista.divActionMove});},ListaStop:function(){if(pLista.Drag!=null)
pLista.Drag.destroy();pLista.Drag=null;},MinimizarMaximizar:function(){pLista.ListaStop();if(this.isMaxMode){this.isMaxMode=false;new Effect.toggle(pLista.divContent,'blind');window.setTimeout('Element.addClassName(\''+pLista.divLista.identify()+'\',"collapsed");Element.removeClassName(\''+pLista.divLista.identify()+'\',"expanded");',1200);}
else{Element.addClassName(pLista.divLista,"expanded");Element.removeClassName(pLista.divLista,"collapsed");this.isMaxMode=true;new Effect.toggle(pLista.divContent,'blind');}},MostrarMenuLogin:function(){this.menuLogin.mostrar();this.menuLogin.addClassName("infoBar");this.menuLogin.addClassName("infoBar-general");},EsconderMenuLogin:function(){this.menuLogin.esconder();this.menuLogin.removeClassName("infoBar");this.menuLogin.removeClassName("infoBar-general");}});var ListaEdit=Class.create({initialize:function()
{this.edit=null;this.idScracth=null;this.shapePin=null;this.onCancelDel=null;this.load();},load:function()
{this.edit=$("annotationPanel");},clear:function()
{this.idScracth=null;this.shapePin=null;this.onCancelDel=null;},show:function(x,y,ti,n,p,u,id,nu,cdel)
{this.clear();this.idScracth=nu;this.onCancelDel=cdel;this.shapePin=pLista.RetornarListaAtiva().GetShapeByID(id);var xMod=(Math.round(x)+420);var yMod=(Math.round(y)+95);var al=GetWindowHeight();var aa=GetWindowWidth();if(yMod+420>al)
yMod=yMod-((yMod+432)-al);if(xMod+224>aa)
xMod=xMod-((xMod+244)-aa);this.edit.style.left=xMod+"px";this.edit.style.top=yMod+"px";$('annotationFormTitle').value=ti;$('annotationFormNotes').value=n;$('annotationFormPhotoUrl').value=p;if(u!='undefined'&&u!=undefined)
$('annotationFormMoreInfoUrl').value=u;oMapa.Mapa().AttachEvent("onstartpan",this.hide);oMapa.Mapa().AttachEvent("onstartzoom",this.hide);oMapa.Mapa().AttachEvent("onresize",this.hide);this.edit.style.display="block";$('annotationFormTitle').focus();$('annotationFormTitle').select();},hide:function(e)
{pLista.ListasEditar.edit.style.display="none";oMapa.Mapa().DetachEvent("onstartpan",pLista.ListasEditar.hide);oMapa.Mapa().DetachEvent("onstartzoom",pLista.ListasEditar.hide);oMapa.Mapa().DetachEvent("onresize",pLista.ListasEditar.hide);var shps=[];shps[0]=pLista.ListasEditar.shapePin;if(pLista.IDListaAtiva!=0)
pLista.AtualizarDadosLista(shps);else
pLista.AtualizarCookieLista();pLista.SelecionarLista(pLista.RetornarListaAtiva().IDLista);},cancel:function()
{if(this.onCancelDel)
oPin.RemoverPin(null,this.shapePin);this.hide();},save:function()
{var a=$('annotationFormTitle').value;var d=$('annotationFormNotes').value;this.shapePin.SetTitle(a);this.shapePin.SetDescription(d);this.shapePin.SetPhotoURL($('annotationFormPhotoUrl').value);this.shapePin.SetMoreInfoURL($('annotationFormMoreInfoUrl').value);this.hide();pLista.EditarLista(this.shapePin);}});var ListaDelete=Class.create({initialize:function()
{this.scratDelete=null;this.action=null;this.param=null;this.load();},load:function()
{this.scratDelete=$("deleteCollectionPanel");},show:function(message,enfase,action,param)
{this.position();this.action=action;this.param=param;this.scratDelete.style.display='block';this.scratDelete.style.visibility='visible';$('deleteMessage').update(message+"<strong>"+enfase+"</strong>");},position:function()
{this.scratDelete.style.top=pLista.divLista.style.top;this.scratDelete.style.left=pLista.divLista.style.left;pLista.divLista.addClassName("actioning");},actionHide:function(action,param)
{this.action=action;this.param=param;this.Yes();},cancel:function()
{pLista.Abrir();pLista.divLista.removeClassName("actioning");this.scratDelete.style.display='none';this.scratDelete.style.visibility='hidden';},Yes:function()
{this.cancel();var shape=[];if(this.action=="point")
{oMapa.Mapa().HideInfoBox();shape[shape.length]=this.param;this.param.Hide();if(pLista.IDListaAtiva!=0)
pLista.RemoverDadosLista(shape);else
pLista.AtualizarCookieLista();pLista.RetornarListaAtiva().DeleteShape(shape[0]);pLista.AtualizarLista();pLista.AtualizarCookieLista();}
if(this.action=="clearList")
{oMapa.Mapa().HideInfoBox();var qtdPt=pLista.RetornarListaAtiva().GetShapeCount();var line='';for(var i=0;i<qtdPt;i++)
{shape[shape.length]=pLista.RetornarListaAtiva().GetShapeByIndex(i);shape[i].Hide();}
if(pLista.IDListaAtiva!=0)
pLista.RemoverDadosLista(shape);else
pLista.AtualizarCookieLista(this.action);for(var x=0;x<qtdPt;x++)
pLista.RetornarListaAtiva().DeleteShape(shape[x]);pLista.AtualizarLista();}
if(this.action=="delList")
{oMapa.Mapa().HideInfoBox();var qtdPt=pLista.RetornarListaAtiva().GetShapeCount();var line='';for(var i=0;i<qtdPt;i++)
{shape[shape.length]=pLista.RetornarListaAtiva().GetShapeByIndex(i);shape[i].Hide();}
if(pLista.IDListaAtiva!=0)
pLista.RemoverDadosLista(shape);else
pLista.AtualizarCookieLista();for(var x=0;x<qtdPt;x++)
pLista.RetornarListaAtiva().DeleteShape(shape[x]);pLista.RemoverLista();}}});
var Mapa=Class.create({initialize:function(){this.Log={Inicio:1,Transito:2,MSN:3,Locate:4,Rotas:5,Impressao:6,Atividades:7,Estabelecimentos:8,Endereco:9};this.ZoomRegiao=6;this.ZoomCidade=11;this.ZoomEndereco=16;this.ZoomEstabelecimento=16;this.DivMapa=$("msve_mapContainer");this.LayerHibrido=null;this.MapaCarregado=false;this.ProcessandoObjetos=false;this.Center=null;this.ScrollTop=0;if(typeof(pPainel)!='undefined')
this.ValidadorRedimensionamento=new PeriodicalExecuter(function(pe){pPainel.Redimensionar();return false;},1);this.ValidarProcessamentoObjetos=new PeriodicalExecuter(function(pe){if(!oMapa.ProcessandoObjetos){if(typeof ProcessarObjetos!='undefined'){if(ProcessarObjetos.length>0){if(!MapaInicializado)
return;oMapa.ProcessandoObjetos=true;var existeObjetoAProcessar=false;for(var cntPO1=0;cntPO1<ProcessarObjetos.length;cntPO1++)
if(ProcessarObjetos[cntPO1]!=null){existeObjetoAProcessar=true;break;}
if(!existeObjetoAProcessar)
ProcessarObjetos=[];for(var cntPO=0;cntPO<ProcessarObjetos.length;cntPO++){if(ProcessarObjetos[cntPO]!=null){var objValidar=null;try{objValidar=eval(ProcessarObjetos[cntPO].split('|')[0]);}
catch(e){}
if(objValidar!=null){try{ProcessarObjetos[cntPO]=ProcessarObjetos[cntPO].replace(new RegExp("[\\n\\r]+","g"),"");eval(ProcessarObjetos[cntPO].split('|')[1]);if(ProcessarObjetos.length>1){ProcessarObjetos[cntPO]=null;}
else{ProcessarObjetos=[];oMapa.ProcessandoObjetos=false;break;}}
catch(e){oMapa.ProcessandoObjetos=false;}}}}
oMapa.ProcessandoObjetos=false;}}}
return false;},1);},Mapa:function(){return map;},Mostrar:function(){},Focar:function(x,y,zoom){if(zoom)
this.Mapa().SetCenterAndZoom(new VELatLong(y,x),zoom);else
this.Mapa().SetCenter(new VELatLong(y,x));},Carregando:function(carregando){if(carregando){$("taskBar").addClassName("hidden");$("pageContext").addClassName("hidden");$("msve_mapArea").addClassName("hidden");$("msve_taskArea").addClassName("hidden");$("msve_footer").addClassName("hidden");}
else{$("taskBar").removeClassName("hidden");$("pageContext").removeClassName("hidden");$("msve_mapArea").removeClassName("hidden");$("msve_taskArea").removeClassName("hidden");$("msve_footer").removeClassName("hidden");}
return false;},DefinirTituloPagina:function(titulo){if(titulo)
document.title=titulo+" - "+L_TituloSite;else
document.title=$('hfTituloPagina').value;},ResgatarXY:function(){return{x:this.Mapa().GetCenter().Longitude,y:this.Mapa().GetCenter().Latitude};},EstaNoBrasil:function(){var mapView=oMapa.Mapa().GetMapView();var extent={x1:mapView.TopLeftLatLong.Longitude,x2:mapView.BottomRightLatLong.Longitude,y1:mapView.BottomRightLatLong.Latitude,y2:mapView.TopLeftLatLong.Latitude};var LRX=extent.x1;var ULX=extent.x2;var LRY=extent.y1;var ULY=extent.y2;if(((LRX<-73.9914824793718&&ULX<-73.9914824793718)||(LRX>-32.3781865095084&&ULX>-32.3781865095084))||((LRY<-33.7513135626824&&ULY<-33.7513135626824)||(LRY>5.27192072796288&&ULY>5.27192072796288))){return false;}
else{return true;}},GetExtentPaisBase:function(){var ExtentPaisBase=new Array();ExtentPaisBase[0]=new Array(5);ExtentPaisBase[0][0]=-73.9914824793718;ExtentPaisBase[0][1]=-32.3781865095084;ExtentPaisBase[0][2]=-33.7513135626824;ExtentPaisBase[0][3]=5.27192072796288;ExtentPaisBase[0][4]=1.0;ExtentPaisBase[1]=new Array(5);ExtentPaisBase[1][0]=-73.740234375;ExtentPaisBase[1][1]=-53.569335938;ExtentPaisBase[1][2]=-55.042188076;ExtentPaisBase[1][3]=-21.820707854;ExtentPaisBase[0][4]=2.0;return ExtentPaisBase;},GetPaisBase:function(){var mapView=oMapa.Mapa().GetMapView();var extent={x1:mapView.TopLeftLatLong.Longitude,x2:mapView.BottomRightLatLong.Longitude,y1:mapView.BottomRightLatLong.Latitude,y2:mapView.TopLeftLatLong.Latitude};var LRX=extent.x1;var ULX=extent.x2;var LRY=extent.y1;var ULY=extent.y2;var ExtentPaisBase=this.GetExtentPaisBase();var ret="";for(var i=0;i<ExtentPaisBase.length;i++){if(!(((LRX<ExtentPaisBase[i][0]&&ULX<ExtentPaisBase[i][0])||(LRX>ExtentPaisBase[i][1]&&ULX>ExtentPaisBase[i][1]))||((LRY<ExtentPaisBase[i][2]&&ULY<ExtentPaisBase[i][2])||(LRY>ExtentPaisBase[i][3]&&ULY>ExtentPaisBase[i][3])))){if(ExtentPaisBase[i][4]==1.0)
ret="Brasil";else if(ExtentPaisBase[i][4]==2.0)
ret="Argentina";else
ret="";break;}}
return ret;},EstaNoPaisBase:function(){var mapView=oMapa.Mapa().GetMapView();var extent={x1:mapView.TopLeftLatLong.Longitude,x2:mapView.BottomRightLatLong.Longitude,y1:mapView.BottomRightLatLong.Latitude,y2:mapView.TopLeftLatLong.Latitude};var LRX=extent.x1;var ULX=extent.x2;var LRY=extent.y1;var ULY=extent.y2;var ExtentPaisBase=this.GetExtentPaisBase();var ret=false;for(var i=0;i<ExtentPaisBase.length;i++){if(!(((LRX<ExtentPaisBase[i][0]&&ULX<ExtentPaisBase[i][0])||(LRX>ExtentPaisBase[i][1]&&ULX>ExtentPaisBase[i][1]))||((LRY<ExtentPaisBase[i][2]&&ULY<ExtentPaisBase[i][2])||(LRY>ExtentPaisBase[i][3]&&ULY>ExtentPaisBase[i][3])))){ret=true;}}
return ret;},CompartilharEmail:function(){try{var conteudoURL=escape(L_URL+"/?"+pLista.GerarEmail()+"&"+pComoChegar.GerarEmail()+"&"+pBusca.GerarEmailAtividade()+"&z="+oMapa.Mapa().GetZoomLevel()+"&cp="+escape(oPin.RetornarPontosLinha(oMapa.Mapa().GetCenter())));var title=L_TituloEmail;var body=escape(title)+"%0D%0A"+conteudoURL;document.location.href="mailto:?subject="+title+"&body="+body;}
catch(e){}}});
var Desenho=Class.create({initialize:function()
{this.geomType=null;this.currentShape=null;this.points=[];this.distance=0;this.tempShape=null;this.tempPoints=null;this.tempDistance=0;this.i=1;this.ShapeSelecionado=null;this.Cores=[new VEColor(0,0,0,0.5),new VEColor(153,51,0,0.5),new VEColor(51,51,0,0.5),new VEColor(0,51,0,0.5),new VEColor(0,51,102,0.5),new VEColor(0,0,128,0.5),new VEColor(51,51,153,0.5),new VEColor(51,51,51,0.5),new VEColor(128,0,0,0.5),new VEColor(255,102,0,0.5),new VEColor(128,128,0,0.5),new VEColor(0,128,0,0.5),new VEColor(0,128,128,0.5),new VEColor(0,0,255,0.5),new VEColor(102,102,153,0.5),new VEColor(128,128,128,0.5),new VEColor(255,0,0,0.5),new VEColor(255,153,0,0.5),new VEColor(153,204,0,0.5),new VEColor(51,153,102,0.5),new VEColor(51,204,204,0.5),new VEColor(51,102,255,0.5),new VEColor(128,0,128,0.5),new VEColor(153,153,153,0.5),new VEColor(255,0,255,0.5),new VEColor(255,204,0,0.5),new VEColor(255,255,0,0.5),new VEColor(0,255,0,0.5),new VEColor(0,255,255,0.5),new VEColor(0,204,255,0.5),new VEColor(153,51,102,0.5),new VEColor(192,192,192,0.5),new VEColor(255,153,204,0.5),new VEColor(255,204,153,0.5),new VEColor(255,255,153,0.5),new VEColor(204,255,204,0.5),new VEColor(204,255,255,0.5),new VEColor(153,204,255,0.5),new VEColor(204,153,255,0.5),new VEColor(255,255,255,0.5)];this.TiposLinha=["Solid","ShortDash","ShortDot","ShortDashDot","ShortDashDotDot","Dot","Dash","LongDash","DashDot","LongDashDot","LongDashDotDot"];this.PinPrincipalTransito=null;this.CamadaSituacaoTransito=null;this.MovendoPinSituacaoTransito=false;this.PinsRuasSituacaoTransito=[];this.PontosRuasSituacaoTransito=[];this.CamadaRuasSituacaoTransito=null;this.CamadaRotaRuasSituacaoTransito=null;this.CamadaDesenhoRuas=null;this.ObjetoInformarOcorrencia={Ponto:null,PontosRuas:null,RouteID:null};},CrossMap:function(e)
{oMapa.DivMapa.style.cursor="crosshair";},SalvarStateInformarOcorrencia:function()
{if(oDesenho.PinPrincipalTransito!=null)
oDesenho.ObjetoInformarOcorrencia.Ponto=oDesenho.PinPrincipalTransito.GetIconAnchor();else
oDesenho.ObjetoInformarOcorrencia.Ponto=null;oDesenho.ObjetoInformarOcorrencia.PontosRuas=oDesenho.PontosRuasSituacaoTransito;$("hfInformarOcorrencia").value=Object.toJSON(oDesenho.ObjetoInformarOcorrencia);},HabilitarDesenhoSituacaoTransito:function()
{if($("liRuasAfetadasDesenho").hasClassName("sel"))
{$("liRuasAfetadasDesenho").removeClassName("sel");oMapa.Mapa().DetachEvent("onclick",oDesenho.ResgatarClickDesenhoRuasSituacaoTransito);}
if($("liPontoPrincipalDesenho").hasClassName("sel"))
{$("liPontoPrincipalDesenho").removeClassName("sel");oMapa.Mapa().DetachEvent("onclick",oDesenho.ResgatarClickDesenhoSituacaoTransito);oMapa.Mapa().DetachEvent("onmousemove",oDesenho.CrossMap);}
else
{oMapa.Mapa().AttachEvent("onclick",oDesenho.ResgatarClickDesenhoSituacaoTransito);oMapa.Mapa().AttachEvent("onmousemove",oDesenho.CrossMap);this.CamadaSituacaoTransito=oPin.CriarCamadaPins();$("liPontoPrincipalDesenho").addClassName("sel");}},RemoverPontoSituacaoTransito:function()
{if(oDesenho.PinPrincipalTransito!=null)
oMapa.Mapa().DeleteShape(oDesenho.PinPrincipalTransito);oDesenho.PinPrincipalTransito=null;oDesenho.LimparDesenhoRuasSituacaoTransito();if($("spanExcluirPontoPrincipal")!=null)
$("spanExcluirPontoPrincipal").hide();oDesenho.SalvarStateInformarOcorrencia();oMapa.Mapa().HideInfoBox();},LimparPontosRuasAfetadas:function()
{if(oDesenho.PinsRuasSituacaoTransito.length>0)
{oPin.RemoverPinsCamada(oDesenho.CamadaRuasSituacaoTransito);oPin.RemoverPinsCamada(oDesenho.CamadaRotaRuasSituacaoTransito);oPin.RemoverPinsCamada(oDesenho.CamadaDesenhoRuas);oDesenho.CamadaRuasSituacaoTransito=oPin.CriarCamadaPins();oDesenho.CamadaRotaRuasSituacaoTransito=oPin.CriarCamadaPins();oDesenho.CamadaDesenhoRuas=oPin.CriarCamadaPins();oDesenho.PinsRuasSituacaoTransito=[];oDesenho.PontosRuasSituacaoTransito=[];}
$("spanLimparRuasAfetadas").hide();},HabilitarDesenhoRuasAfetadasSituacaoTransito:function()
{if($("liPontoPrincipalDesenho").hasClassName("sel"))
{$("liPontoPrincipalDesenho").removeClassName("sel");oMapa.Mapa().DetachEvent("onclick",oDesenho.ResgatarClickDesenhoSituacaoTransito);}
if($("liRuasAfetadasDesenho").hasClassName("sel"))
{$("liRuasAfetadasDesenho").removeClassName("sel");oMapa.Mapa().DetachEvent("onclick",oDesenho.ResgatarClickDesenhoRuasSituacaoTransito);oMapa.Mapa().DetachEvent("onmousemove",oDesenho.CrossMap);}
else
{oMapa.Mapa().AttachEvent("onclick",oDesenho.ResgatarClickDesenhoRuasSituacaoTransito);oMapa.Mapa().AttachEvent("onmousemove",oDesenho.CrossMap);if(oDesenho.CamadaRuasSituacaoTransito==null)
oDesenho.CamadaRuasSituacaoTransito=oPin.CriarCamadaPins();$("liRuasAfetadasDesenho").addClassName("sel");}},LimparDesenhoRuasSituacaoTransito:function()
{oPin.RemoverPinsCamada(this.CamadaRotaRuasSituacaoTransito);this.CamadaRotaRuasSituacaoTransito=oPin.CriarCamadaPins();},LimparTodosDadosSituacaoTransito:function()
{try{oDesenho.LimparDesenhoRuasSituacaoTransito();}catch(e){}
try{oDesenho.LimparPontosRuasAfetadas();}catch(e){}
try{oDesenho.RemoverPontoSituacaoTransito();}catch(e){}
try{oMapa.Mapa().DetachEvent("onclick",oDesenho.ResgatarClickDesenhoSituacaoTransito);}catch(e){}
try{oMapa.Mapa().DetachEvent("onclick",oDesenho.ResgatarClickDesenhoRuasSituacaoTransito);}catch(e){}
try{oMapa.Mapa().DetachEvent("onmousemove",oDesenho.CrossMap);}catch(e){}
try{oDesenho.SalvarStateInformarOcorrencia();}catch(e){}},RemoverPinRua:function(id)
{for(i=0;i<oDesenho.PontosRuasSituacaoTransito.length;i++)
{var vo=oDesenho.PontosRuasSituacaoTransito[i];var vo2=oDesenho.CamadaRuasSituacaoTransito.GetShapeByID(id).GetIconAnchor();if(vo.Longitude==vo2.Longitude&&vo.Latitude==vo2.Latitude)
{oDesenho.PontosRuasSituacaoTransito.splice(i,1);break;}}
$("hfRuasAfetadasSituacaoTransito").value=Object.toJSON(oDesenho.PontosRuasSituacaoTransito);oDesenho.CamadaRuasSituacaoTransito.DeleteShape(oDesenho.CamadaRuasSituacaoTransito.GetShapeByID(id));if(oDesenho.PontosRuasSituacaoTransito.length==0)
$("spanLimparRuasAfetadas").hide();if(oDesenho.PontosRuasSituacaoTransito.length==1)
oDesenho.LimparDesenhoRuasSituacaoTransito();oDesenho.SalvarStateInformarOcorrencia();__doPostBack('btnStateRuas_Ocorrencia','');oMapa.Mapa().HideInfoBox();},ResgatarClickDesenhoRuasSituacaoTransito:function(e)
{if(e.leftMouseButton)
{var px=new VEPixel(Math.round(e.mapX),Math.round(e.mapY));var et=oMapa.Mapa().PixelToLatLong(px);oDesenho.PinsRuasSituacaoTransito[oDesenho.PinsRuasSituacaoTransito.length]=oPin.Adicionar({ponto:et,titulo:'Rua afetada.',tipo:oPin.TipoPin.PontoAzul,camada:oDesenho.CamadaRuasSituacaoTransito});oDesenho.PontosRuasSituacaoTransito[oDesenho.PontosRuasSituacaoTransito.length]=et;$("hfRuasAfetadasSituacaoTransito").value=Object.toJSON(oDesenho.PontosRuasSituacaoTransito);$("spanLimparRuasAfetadas").show();oDesenho.SalvarStateInformarOcorrencia();__doPostBack('btnStateRuas_Ocorrencia','');oMapa.Mapa().HideInfoBox();}},ResgatarClickDesenhoSituacaoTransito:function(e)
{if(e.leftMouseButton)
{var px=new VEPixel(Math.round(e.mapX),Math.round(e.mapY));var et=oMapa.Mapa().PixelToLatLong(px);if(et=='undefined'||et==null)
et=oMapa.Mapa().GetCenter();if(oDesenho.PinPrincipalTransito!=null)
oMapa.Mapa().DeleteShape(oDesenho.PinPrincipalTransito);oDesenho.PinPrincipalTransito=oPin.Adicionar({ponto:et,titulo:'Ocorrência',tipo:oPin.TipoPin.PontoOcorrencia,camada:oDesenho.CamadaSituacaoTransito});$("spanExcluirPontoPrincipal").show();$("liPontoPrincipalDesenho").removeClassName("sel");oDesenho.SalvarStateInformarOcorrencia();__doPostBack('btnStatePoint_Ocorrencia','');oMapa.Mapa().DetachEvent("onclick",oDesenho.ResgatarClickDesenhoSituacaoTransito);oMapa.Mapa().DetachEvent("onmousemove",oDesenho.CrossMap);}},PlotarDesenhosRuasIncidentes:function(obj)
{oPin.RemoverPinsCamada(oDesenho.CamadaDesenhoRuas);oDesenho.CamadaDesenhoRuas=oPin.CriarCamadaPins();if(obj!=null)
{if(obj.length>0)
{var ptsOBJ=[];for(var j=0;j<obj.length;j++)
{if(obj[j].Pontos!=null)
{ptsOBJ=[];for(var i=0;i<obj[j].Pontos.length;i++)
ptsOBJ.push(new VELatLong(obj[j].Pontos[i].Latitude,obj[j].Pontos[i].Longitude));var shape=new VEShape(VEShapeType.Polyline,ptsOBJ);shape.SetLineWidth(5);shape.SetLineColor(new VEColor(255,0,0,0.5));shape.HideIcon();oDesenho.CamadaDesenhoRuas.AddShape(shape);}}}}},PlotarPontoPrincipalSituacaoTransito:function(x,y)
{var et=new VELatLong(y,x);if(oDesenho.PinPrincipalTransito!=null)
oMapa.Mapa().DeleteShape(oDesenho.PinPrincipalTransito);oDesenho.PinPrincipalTransito=oPin.Adicionar({ponto:et,titulo:'Ocorrência',tipo:oPin.TipoPin.PontoOcorrencia,camada:oDesenho.CamadaSituacaoTransito});$("spanExcluirPontoPrincipal").show();$("liPontoPrincipalDesenho").removeClassName("sel");oDesenho.SalvarStateInformarOcorrencia();__doPostBack('btnStatePoint_Ocorrencia','');try{oMapa.Mapa().DetachEvent("onclick",oDesenho.ResgatarClickDesenhoSituacaoTransito);}catch(e){}
try{oMapa.Mapa().DetachEvent("onmousemove",oDesenho.CrossMap);}catch(e){}},MouseDownHandler:function(e)
{if(e.rightMouseButton&&e.elementID)
{oDesenho.MovendoPinSituacaoTransito=true;}},MouseMoveHandler:function(e)
{var loc=oMapa.Mapa().PixelToLatLong(new VEPixel(e.mapX,e.mapY));if(oDesenho.MovendoPinSituacaoTransito)
{oMapa.Mapa().GetShapeByID(e.elementID).SetPoints(loc);}},MouseUpHandler:function(e)
{if(oDesenho.MovendoPinSituacaoTransito&&e.rightMouseButton)
{oDesenho.MovendoPinSituacaoTransito=false;}},SelecionarShape:function(idShape)
{this.ShapeSelecionado=idShape;},MudarCorLinhaShape:function(cor)
{if(this.ShapeSelecionado!='undefined'&&this.ShapeSelecionado!=null)
{var s=oMapa.Mapa().GetShapeByID(this.ShapeSelecionado.replace('_l',''));if(s!=null)
{s.SetLineColor(this.Cores[cor]);if(pLista.IDListaAtiva!=0)
pLista.AtualizarDadosLista(s);else
pLista.AtualizarCookieLista();}
else
oDesenho.ShapeSelecionado=null;}},MudarCorFundoShape:function(cor)
{if(this.ShapeSelecionado!='undefined'&&this.ShapeSelecionado!=null)
{var s=oMapa.Mapa().GetShapeByID(this.ShapeSelecionado.replace('_l',''));if(s!=null)
{s.SetFillColor(this.Cores[cor]);if(pLista.IDListaAtiva!=0)
pLista.AtualizarDadosLista(s);else
pLista.AtualizarCookieLista();}
else
oDesenho.ShapeSelecionado=null;}},MudarEspessuraLinhaShape:function(tamanho)
{if(this.ShapeSelecionado!='undefined'&&this.ShapeSelecionado!=null)
{var s=oMapa.Mapa().GetShapeByID(this.ShapeSelecionado.replace('_l',''));if(s!=null)
{s.SetLineWidth(tamanho);if(pLista.IDListaAtiva!=0)
pLista.AtualizarDadosLista(s);else
pLista.AtualizarCookieLista();}
else
oDesenho.ShapeSelecionado=null;}},MudarTipoLinhaShape:function(tipo)
{if(this.ShapeSelecionado!='undefined'&&this.ShapeSelecionado!=null)
{var s=oMapa.Mapa().GetShapeByID(this.ShapeSelecionado.replace('_l',''));if(s!=null)
{s.SetDashStyle(this.TiposLinha[tipo]);if(pLista.IDListaAtiva!=0)
pLista.AtualizarDadosLista(s);else
pLista.AtualizarCookieLista();}
else
oDesenho.ShapeSelecionado=null;}},DeselecionarShape:function()
{this.ShapeSelecionado=null;},PickPickersItem:function(tipo,valor)
{switch(tipo)
{case'1':this.MudarCorFundoShape(valor);break;case'2':this.MudarCorLinhaShape(valor);break;case'3':this.MudarEspessuraLinhaShape(valor);break;case'4':this.MudarTipoLinhaShape(valor);break;}},AddPush:function(e)
{if(e.leftMouseButton)
{var px=new VEPixel(Math.round(e.mapX),Math.round(e.mapY));var et=oMapa.Mapa().PixelToLatLong(px);popuplat=et.Latitude;popuplon=et.Longitude;pLista.AdicionarItemCentro();oMapa.Mapa().DetachEvent("onclick",oDesenho.AddPush);oMapa.Mapa().DetachEvent("onmousemove",oDesenho.CrossMap);oMapa.Mapa().DetachEvent("onclick",oDesenho.DrawPolyMouseClick);pLista.SelecionarFerramentaDesenho('DrawingToolbar_PanZoomTool');pLista.ValidarCliqueDesenho($("DrawingToolbar_PanZoomTool"));}},Draw:function(geomType)
{this.clean();this.geomType=geomType;this.CrossMap();oMapa.Mapa().AttachEvent("onclick",oDesenho.DrawPolyMouseClick);},clean:function()
{this.geomType=null;this.currentShape=null;this.points=[];this.distance=0;this.tempShape=null;this.tempPoints=null;this.tempDistance=0;this.i=1;},DrawPolyMouseClick:function(e)
{var LL=oMapa.Mapa().PixelToLatLong(new VEPixel(e.mapX,e.mapY));if(oDesenho.points.length==0&&oDesenho.geomType!="point")
{oMapa.Mapa().AttachEvent("onmousemove",oDesenho.DrawPolyMouseMove);$("divDistance").style.visibility="visible";}
oDesenho.points.push(LL);oDesenho.distance=oDesenho.distance+oDesenho.tempDistance;if(e.rightMouseButton)
{try
{oMapa.Mapa().DetachEvent("onmousemove",oDesenho.DrawPolyMouseMove);oMapa.Mapa().DetachEvent("onclick",oDesenho.DrawPolyMouseClick);$("divDistance").style.visibility="hidden";pLista.RetornarListaAtiva().DeleteShape(oDesenho.tempShape);}
catch(err){}
oDesenho.currentShape="shape"+i;oDesenho.distance=Math.round(oDesenho.distance*1000)/1000;var ms="";switch(oDesenho.geomType)
{case"polygon":ms=L_DesenhoPerimetro+": "+oDesenho.distance+" km";break;case"polyline":ms=L_DesenhoDistancia+": "+oDesenho.distance+" km";break;}
var idNum=pLista.IDAtual+1;var id=oPin.Adicionar({ponto:oDesenho.points,titulo:L_DesenhoSemTitulo,tipo:oDesenho.geomType,descricao:ms.replace(/\./g,','),camada:pLista.RetornarListaAtiva(),valor:idNum,numero:idNum});var s=oMapa.Mapa().GetShapeByID(id.GetID());var px=oMapa.Mapa().LatLongToPixel(s.GetIconAnchor());var et=oMapa.Mapa().PixelToLatLong(px);pLista.ListasEditar.show(px.x,px.y,L_DesenhoSemTitulo,ms,'','',id.GetID(),idNum,true);pLista.ValidarCliqueDesenho($('DrawingToolbar_PanZoomTool'));}
oDesenho.CrossMap();},DrawPolyMouseMove:function(e)
{var LL=oMapa.Mapa().PixelToLatLong(new VEPixel(e.mapX,e.mapY));oDesenho.tempPoints=oDesenho.points.slice(0,oDesenho.points.length);oDesenho.tempPoints.push(LL);oDesenho.tempDistance=oDesenho.getDistance(oDesenho.tempPoints[oDesenho.points.length-1],LL);var posicao=oMapa.DivMapa.cumulativeOffset();var dummy=$("divDistance");dummy.style.left=15+(parseInt(posicao.left)+parseInt(e.mapX))+"px";dummy.style.top=15+(parseInt(posicao.top)+parseInt(e.mapY))+"px";var a=(Math.round((oDesenho.distance+oDesenho.tempDistance)*1000)/1000)+" km";dummy.update(L_DesenhoDistancia+': '+a.replace(/\./g,','));try
{pLista.RetornarListaAtiva().DeleteShape(oDesenho.tempShape);}
catch(err){}
if(oDesenho.tempPoints.length==2)
{oDesenho.tempShape=new VEShape(VEShapeType.Polyline,oDesenho.tempPoints);oDesenho.tempShape.HideIcon();pLista.RetornarListaAtiva().AddShape(oDesenho.tempShape);}
if(oDesenho.tempPoints.length>2)
{switch(oDesenho.geomType)
{case"polygon":oDesenho.tempShape=new VEShape(VEShapeType.Polygon,oDesenho.tempPoints);break;case"polyline":oDesenho.tempShape=new VEShape(VEShapeType.Polyline,oDesenho.tempPoints);break;}
oDesenho.tempShape.HideIcon();pLista.RetornarListaAtiva().AddShape(oDesenho.tempShape);}},getDistance:function(p1,p2)
{p1Lat=this.latLonToRadians(p1.Latitude);p1Lon=this.latLonToRadians(p1.Longitude);p2Lat=this.latLonToRadians(p2.Latitude);p2Lon=this.latLonToRadians(p2.Longitude);var R=6371;var dLat=p2Lat-p1Lat;var dLong=p2Lon-p1Lon;var a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(p1Lat)*Math.cos(p2Lat)*Math.sin(dLong/2)*Math.sin(dLong/2);var c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));var disKm=R*c;return(disKm);},latLonToRadians:function(point)
{return point*Math.PI/180;},Delete:function(shape)
{var delShape=pLista.RetornarListaAtiva().GetShapeByID(shape);pLista.RetornarListaAtiva().DeleteShape(delShape);}});
var Pin=Class.create({initialize:function(){this.TipoPin={Erro:0,BuscaExata:1,Anotacao:2,ComoChegar:3,ComoChegarInicio:4,ComoChegarFim:5,ComoChegarTemp:6,EstabelecimentoPadrao:7,Transito:8,Poligono:9,Cinema:10,AdsNokia:11,TransitoIncidentes:12,TransitoObras:13,TransitoEventos:14,PontoAzul:15,PontoOcorrencia:16,AdsGM:17,EstabelecimentoPadraoEsAr:18,Padrao:99};},AdicionarJaExistente:function(id){var pontoExistente=oMapa.Mapa().GetShapeByID(id);pLista.Abrir();pLista.SelecionarLista(pLista.RetornarListaAtiva());var idNum=pLista.IDAtual+1;oPin.Adicionar({ponto:pontoExistente.GetIconAnchor(),titulo:pontoExistente.GetTitle(),descricao:pontoExistente.GetDescription(),tipo:oPin.TipoPin.Padrao,camada:pLista.RetornarListaAtiva(),valor:idNum,numero:idNum});pLista.SelecionarLista(pLista.RetornarListaAtiva());},Adicionar:function(dados){var ponto=null;var titulo=null;var tipo=null;var camada=null;var valor=null;var descricao=null;var actions=null;var numero=null;var idPOI=null;var urlInfo=null;var urlImagem=null;var paramPoly=null;var localID=null;if(dados.ponto!=null)ponto=dados.ponto;if(dados.titulo!=null)titulo=dados.titulo;if(dados.tipo!=null)tipo=dados.tipo;if(dados.camada!=null)camada=dados.camada;if(dados.valor!=null)valor=dados.valor;if(dados.descricao!=null)descricao=dados.descricao;if(dados.numero!=null)numero=dados.numero;if(dados.idPOI!=null)idPOI=dados.idPOI;if(dados.urlInfo!=null)urlInfo=dados.urlInfo;if(dados.urlImagem!=null)urlImagem=dados.urlImagem;if(dados.paramPoly!=null)paramPoly=dados.paramPoly;if(dados.localID!=null)localID=dados.localID;var pt=null;if(ponto.length>0){if(dados.tipo.toUpperCase()=='polyline'.toUpperCase()){pt=new VEShape(VEShapeType.Polyline,ponto);}
else if(dados.tipo.toUpperCase()=='polygon'.toUpperCase()){pt=new VEShape(VEShapeType.Polygon,ponto);}
else{pt=new VEShape(VEShapeType.Pushpin,ponto);}}
else{if(ponto.Latitude&&ponto.Longitude)
pt=new VEShape(VEShapeType.Pushpin,ponto);else
pt=new VEShape(VEShapeType.Pushpin,new VELatLong(ponto.y,ponto.x));}
if(camada!=null)
camada.AddShape(pt);else
oMapa.Mapa().AddShape(pt);if(titulo!=null)pt.SetTitle(titulo);if(descricao!=null)pt.SetDescription(descricao);actions=this.TratarActionsPin(dados,pt);if(actions!=null)pt.SetActions(actions);if(numero!=null)pt.NumberPIN=numero;if(localID!=null)pt.SetLocalID(localID);if(urlInfo!=null)pt.SetMoreInfoURL(urlInfo);if(urlImagem!=null)pt.SetPhotoURL(urlImagem);var cIcon=new VECustomIconSpecification();if(tipo!=''&&tipo!=null&&tipo!='undefined'){if(tipo==this.TipoPin.Transito){pt.SetTitle(valor.nameCorridor);var se_old=null;var descricaoTrecho='';var descrTransito="";var idTrecho='';var idSentido='';var descTrecho='';var arrayDesc=null;if(CultureInfo["Name"]=="es-AR"){arrayDesc=valor.description.split('===');idTrecho=arrayDesc[1];idSentido=arrayDesc[2];descTrecho=arrayDesc[0];for(var j=0;j<valor.excerptInfo.excerpt.length;j++){if((parseInt(valor.excerptInfo.excerpt[j].codExcerpt)==parseInt(idTrecho))&&(parseInt(valor.excerptInfo.excerpt[j].codDirection)==parseInt(idSentido))){descricaoTrecho=descricaoTrecho+"<br/><strong>"+L_TransitoSentido+": </strong>"+valor.excerptInfo.excerpt[j].direction+"<br/>";iniDescrTransito=(descTrecho.length>150)?"<div style='max-height: 100px; width: 100%; overflow-y: scroll; font-size: 11px;'>":"";fechaDescrTransito=(descTrecho.length>150)?"</div>":"";if(valor.description!=""){descricaoTrecho=descricaoTrecho+"<strong>Trecho: </strong>"+valor.excerptInfo.excerpt[j].nameExcerpt+"<br/>";descricaoTrecho=descricaoTrecho+iniDescrTransito+descTrecho+fechaDescrTransito+"<br/>";}}}}
else{for(var j=0;j<valor.excerptInfo.excerpt.length;j++){if(se_old!=valor.excerptInfo.excerpt[j].direction)
descricaoTrecho=descricaoTrecho+"<br/><strong>"+L_TransitoSentido+": </strong>"+valor.excerptInfo.excerpt[j].direction+"<br/>";descricaoTrecho=descricaoTrecho+""+valor.excerptInfo.excerpt[j].nameExcerpt+"<br/>";se_old=valor.excerptInfo.excerpt[j].direction;}}
pt.SetDescription(descricaoTrecho);}
else if(tipo.toString().toLowerCase()=='polyline'||tipo.toString().toLowerCase()=='polygon'){try{if(paramPoly!=null&&paramPoly!=''){var dadosPoly=paramPoly.split(' ');if(dadosPoly.length>=3){var corFundo=dadosPoly[0].split(':');pt.SetFillColor(new VEColor(corFundo[0],corFundo[1],corFundo[2],0.5));var corLinha=dadosPoly[1].split(':');pt.SetLineColor(new VEColor(corLinha[0],corLinha[1],corLinha[2],0.5));pt.SetLineWidth(dadosPoly[2]);if(dadosPoly.length>=4)
pt.SetDashStyle(dadosPoly[3]);}}}
catch(e){}}
else if(tipo==oPin.TipoPin.TransitoIncidentes||tipo==oPin.TipoPin.TransitoObras||tipo==oPin.TipoPin.TransitoEventos){try{if(valor.Titulo!=null)
pt.SetTitle(valor.Titulo);var descrTransito="<div style='max-height: 200px; width: 100%; overflow-y: scroll; font-size: 11px;'>";if(valor.Categoria!=null&&valor.Subcategoria!=null)
descrTransito=descrTransito+('<strong>'+valor.Categoria+' - '+valor.Subcategoria+'</strong>')+'<br />';if(valor.Local!=null&&valor.UF!=null)
descrTransito=descrTransito+('<strong>Local:</strong> '+valor.Local+' - '+valor.UF)+'<br />';if(valor.PeriodoData!=null)
descrTransito=descrTransito+('<strong>Duração:</strong> '+valor.PeriodoData)+'<br />';if(valor.PeriodoDiasSemana!=null)
descrTransito=descrTransito+('<strong>Dias da semana:</strong> '+valor.PeriodoDiasSemana)+'<br />';if(valor.PeriodoHorario!=null)
descrTransito=descrTransito+('<strong>Horário:</strong> '+valor.PeriodoHorario)+'<br />';if(valor.Texto!=null)
descrTransito=descrTransito+('<br /><br />'+valor.Texto);descrTransito=descrTransito+"</div>";pt.SetDescription(descrTransito);}
catch(e){}}}
cIcon.CustomHTML=oPin.TratarImagemPin(dados);pt.SetCustomIcon(cIcon);return pt;},Focar:function(pin,zoom){if(pin!=null){if(zoom!=null)
map.SetCenterAndZoom(pin.GetIconAnchor(),zoom);else
map.SetCenter(pin.GetIconAnchor());}},FocarShape:function(idShape,zoom){this.Focar(oMapa.Mapa().GetShapeByID(idShape),zoom);},TratarActionsPin:function(dados,pt){switch(dados.tipo){case this.TipoPin.TransitoIncidentes:case this.TipoPin.TransitoObras:case this.TipoPin.TransitoEventos:case this.TipoPin.Anuncios:return null;break;case this.TipoPin.PontoAzul:return"<a href='javascript:void(0);' onclick='oDesenho.RemoverPinRua(\""+pt.GetID()+"\");'>Remover Ponto</a>";break;case this.TipoPin.Transito:return L_PinZoomPara+": <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomEndereco+")'>"+L_Ruas+"</a> %7c <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomCidade+")'>"+L_Cidade+"</a> %7c <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomRegiao+")'>"+L_Regiao+"</a>";break;case this.TipoPin.Cinema:var lat=pt.GetIconAnchor().Latitude;var lon=pt.GetIconAnchor().Longitude;return"<a href='javascript:void(0);' onclick='pComoChegar.DefinirLocalInicial(\""+dados.valor+"\", \""+lon+"\", \""+lat+"\");'>"+L_ComoChegarDirigirDe+"...</a> ou <a href='javascript:void(0);' onclick='pComoChegar.DefinirLocalFinal(\""+dados.valor+"\", \""+lon+"\", \""+lat+"\");'>"+L_ComoChegarDirigirAte+"...</a>|"+L_PinZoomPara+": <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomEndereco+")'>"+L_Ruas+"</a>";break;case this.TipoPin.PontoOcorrencia:return"<a href='javascript:void(0);' onclick='oDesenho.RemoverPontoSituacaoTransito()'>Remover este ponto</a>";break;case this.TipoPin.BuscaExata:var lat=pt.GetIconAnchor().Latitude;var lon=pt.GetIconAnchor().Longitude;if(CultureInfo["Name"]=="es-AR")
return L_PinZoomPara+": <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomEndereco+")'>"+L_Ruas+"</a> %7c <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomCidade+")'>"+L_Cidade+"</a> %7c <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomRegiao+")'>"+L_Regiao+"</a>|"+"<a href='javascript:void(0);' onclick='pComoChegar.DefinirLocalInicial(\""+dados.titulo+"\", \""+lon+"\", \""+lat+"\");'>"+L_ComoChegarDirigirDe+" ...</a> "+L_Ou+" <a href='javascript:void(0);' onclick='pComoChegar.DefinirLocalFinal(\""+dados.titulo+"\", \""+lon+"\", \""+lat+"\");'>"+L_ComoChegarDirigirAte+"...</a>|"+"<a id='SendEmailPin' href='javascript:void(0);' onclick='oPin.EnviarEmail(\""+pt.GetID()+"\")'>"+L_EnviarPorEmail+"</a>| <a id='SearchComercios' href='javascript:void(0);' onclick='javascript:pBusca.BuscarAtividadesProximas(\""+lon+"\",\""+lat+"\");'>"+L_BuscarComercios+"</a>&nbsp;&nbsp;<input type='text' id='txtNewLocalSearch' class='basicInput'/>";else
return L_PinZoomPara+": <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomEndereco+")'>"+L_Ruas+"</a> %7c <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomCidade+")'>"+L_Cidade+"</a> %7c <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomRegiao+")'>"+L_Regiao+"</a>|"+"<a href='javascript:void(0);' onclick='pComoChegar.DefinirLocalInicial(\""+dados.titulo+"\", \""+lon+"\", \""+lat+"\");'>"+L_ComoChegarDirigirDe+" ...</a> ou <a href='javascript:void(0);' onclick='pComoChegar.DefinirLocalFinal(\""+dados.titulo+"\", \""+lon+"\", \""+lat+"\");'>"+L_ComoChegarDirigirAte+"...</a>|"+"<a id='SendEmailPin' href='javascript:void(0);' onclick='oPin.EnviarEmail(\""+pt.GetID()+"\")'>"+L_EnviarPorEmail+"</a>";break;case this.TipoPin.EstabelecimentoPadrao:var lat=pt.GetIconAnchor().Latitude;var lon=pt.GetIconAnchor().Longitude;var retorno="<a href='javascript:void(0);' onclick='oPin.AdicionarJaExistente(\""+pt.GetID()+"\");'>"+L_ListaAdicionar+"</a>|<a href='javascript:void(0);' onclick='pComoChegar.DefinirLocalInicial(\""+dados.titulo+"\", \""+lon+"\", \""+lat+"\");'>"+L_ComoChegarDirigirDe+" ...</a> ou <a href='javascript:void(0);' onclick='pComoChegar.DefinirLocalFinal(\""+dados.titulo+"\", \""+lon+"\", \""+lat+"\");'>"+L_ComoChegarDirigirAte+"...</a>|<a id='SendEmailPin' href='javascript:void(0);' onclick='oPin.EnviarEmail(\""+pt.GetID()+"\")'>"+L_EnviarPorEmail+"</a>|"+L_PinZoomPara+": <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomEndereco+")'>"+L_Ruas+"</a> %7c <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomCidade+")'>"+L_Cidade+"</a> %7c <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomRegiao+")'>"+L_Regiao+"</a>";if(dados.idPOI)
retorno=retorno+"|<a href='javascript:void(0);' onclick='pBusca.AbrirDetalhesPOI(\""+dados.idPOI+"\")'>+ INFO</a> %7c <a href='javascript:void(0);' onclick='pBusca.EnviarTorpedoPOI(\""+dados.idPOI+"\");'>Torpedo</a>";return retorno;break;case this.TipoPin.EstabelecimentoPadraoEsAr:var lat=pt.GetIconAnchor().Latitude;var lon=pt.GetIconAnchor().Longitude;var retorno="<a href='javascript:void(0);' onclick='oPin.AdicionarJaExistente(\""+pt.GetID()+"\");'>"+L_ListaAdicionar+"</a>|<a href='javascript:void(0);' onclick='pComoChegar.DefinirLocalInicial(\""+dados.titulo+"\", \""+lon+"\", \""+lat+"\");'>"+L_ComoChegarDirigirDe+" ...</a> o <a href='javascript:void(0);' onclick='pComoChegar.DefinirLocalFinal(\""+dados.titulo+"\", \""+lon+"\", \""+lat+"\");'>"+L_ComoChegarDirigirAte+"...</a>|<a id='SendEmailPin' href='javascript:void(0);' onclick='oPin.EnviarEmail(\""+pt.GetID()+"\")'>"+L_EnviarPorEmail+"</a>|"+L_PinZoomPara+": <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomEndereco+")'>"+L_Ruas+"</a> %7c <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomCidade+")'>"+L_Cidade+"</a> %7c <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomRegiao+")'>"+L_Regiao+"</a>";if(dados.idPOI)
retorno=retorno+"|<a href='javascript:void(0);' onclick='pBusca.AbrirDetalhesPOI(\""+dados.idPOI+"\",\"locais_esar\")'>+ INFO</a>";return retorno;break;case this.TipoPin.ComoChegarInicio:return"<a href='javascript:void(0);' onclick='pComoChegar.FocarPontoRota(0);'>"+L_Proxima+" <img src='img/next.gif' border='0' align='absmiddle' /></a>";break;case this.TipoPin.ComoChegarFim:return"<a href='javascript:void(0);' onclick='pComoChegar.FocarPontoRota(\"ultimo\");'><img src='img/previous.gif' border='0' align='absmiddle' /> "+L_Anterior+"</a>";break;case this.TipoPin.ComoChegar:var anterior=(parseInt(dados.valor)-1);var proxima=(parseInt(dados.valor)+1);return"<a href='javascript:void(0);' onclick=\"pComoChegar.FocarPontoRota('"+anterior+"');\"><img src='img/previous.gif' border='0' align='absmiddle' /> "+L_Anterior+"</a> - <a href='javascript:void(0);' onclick=\"pComoChegar.FocarPontoRota('"+proxima+"');\">"+L_Proxima+" <img src='img/next.gif' border='0' align='absmiddle' /></a>";break;default:var lat=pt.GetIconAnchor().Latitude;var lon=pt.GetIconAnchor().Longitude;if(CultureInfo["Name"]=="es-AR"){return"<a href='javascript:void(0);' onclick='pLista.EditarItem(\""+pt.GetID()+"\", 1);'>"+L_Editar+"</a>, <a href='javascript:void(0);' onclick='pLista.MoverPin(\""+pt.GetID()+"\");'>"+L_Mover+"</a>, "+L_Ou+" <a href='javascript:void(0);'  onclick='oPin.RemoverPin(\""+pt.GetID()+"\", null);'>"+L_Excluir+"</a> "+L_EsteItem+"|"+L_PinZoomPara+": <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomEndereco+")'>"+L_Ruas+"</a> %7c <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomCidade+")'>"+L_Cidade+"</a> %7c <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomRegiao+")'>"+L_Regiao+"</a>|"+"<a href='javascript:void(0);' onclick='pComoChegar.DefinirLocalInicial(\""+((pt.GetTitle()==L_SemTitulo||pt.GetTitle()=="")?L_Origem:pt.GetTitle())+"\", \""+lon+"\", \""+lat+"\");'>"+L_ComoChegarDirigirDe+" ...</a> "+L_Ou+"  <a href='javascript:void(0);' onclick='pComoChegar.DefinirLocalFinal(\""+((pt.GetTitle()==L_SemTitulo||pt.GetTitle()=="")?L_Destino:pt.GetTitle())+"\", \""+lon+"\", \""+lat+"\");'>"+L_ComoChegarDirigirAte+"...</a>|"+"<a id='SendEmailPin' href='javascript:void(0);' onclick='oPin.EnviarEmail(\""+pt.GetID()+"\")'>"+L_EnviarPorEmail+"</a>";}
else{return"<a href='javascript:void(0);' onclick='pLista.EditarItem(\""+pt.GetID()+"\", 1);'>"+L_Editar+"</a>, <a href='javascript:void(0);' onclick='pLista.MoverPin(\""+pt.GetID()+"\");'>"+L_Mover+"</a>, "+L_Ou+" <a href='javascript:void(0);'  onclick='oPin.RemoverPin(\""+pt.GetID()+"\", null);'>"+L_Excluir+"</a> "+L_EsteItem+"|"+L_PinZoomPara+": <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomEndereco+")'>"+L_Ruas+"</a> %7c <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomCidade+")'>"+L_Cidade+"</a> %7c <a href='javascript:void(0);' onclick='oPin.FocarShape(\""+pt.GetID()+"\", "+oMapa.ZoomRegiao+")'>"+L_Regiao+"</a>|"+"<a href='javascript:void(0);' onclick='pComoChegar.DefinirLocalInicial(\""+((pt.GetTitle()==L_SemTitulo||pt.GetTitle()=="")?L_Origem:pt.GetTitle())+"\", \""+lon+"\", \""+lat+"\");'>"+L_ComoChegarDirigirDe+" ...</a> ou <a href='javascript:void(0);' onclick='pComoChegar.DefinirLocalFinal(\""+((pt.GetTitle()==L_SemTitulo||pt.GetTitle()=="")?L_Destino:pt.GetTitle())+"\", \""+lon+"\", \""+lat+"\");'>"+L_ComoChegarDirigirAte+"...</a>|"+"<a id='SendEmailPin' href='javascript:void(0);' onclick='oPin.EnviarEmail(\""+pt.GetID()+"\")'>"+L_EnviarPorEmail+"</a>";}
break;return null;}},TratarImagemPin:function(dados){var retorno="";switch(dados.tipo){case this.TipoPin.PontoOcorrencia:retorno='<img class="locationPin" src="img/pins/poi_precise_location.gif" alt="" style="top: -10px; border-width: 0px;" align="middle" />';break;case this.TipoPin.BuscaExata:retorno='<img id="TaskHost_placeSearchPanel_pinImage" class="locationPin" src="img/pins/poi_precise_location.gif" alt="" style="top: -10px; border-width: 0px; margin-top:5px; margin-left:5px;" align="middle" />';break;case this.TipoPin.PontoAzul:retorno='<img src="img/pontoParada.png" />';break;case this.TipoPin.Transito:retorno='<img src="img/icn_warning.gif" />';break;case this.TipoPin.Cinema:retorno='<img src="img/pins/icoCinema.png" />';break;case this.TipoPin.ComoChegarInicio:retorno='<img src="img/pins/mapicon_start.gif" border="0" />';break;case this.TipoPin.ComoChegarFim:retorno='<img src="img/pins/mapicon_end.gif" border="0" />';break;case this.TipoPin.ComoChegar:retorno='<span class="bulletRota">'+dados.valor+'</span>';break;case this.TipoPin.EstabelecimentoPadraoEsAr:case this.TipoPin.EstabelecimentoPadrao:retorno='<strong class="pin_EstabelecimentoPadrao">'+((dados.valor!=null)?dados.valor:'')+'</strong>';break;case this.TipoPin.AdsNokia:retorno='<strong class="pin_CampanhaNokia6110">'+((dados.valor!=null)?dados.valor:'')+'</strong>';break;case this.TipoPin.AdsGM:retorno='<strong class="pin_CampanhaGM">'+((dados.valor!=null)?dados.valor:'')+'</strong>';break;case this.TipoPin.TransitoIncidentes:retorno='<img src="img/traffic/mapa_icone_incidentes.gif" border="0" />';break;case this.TipoPin.TransitoEventos:retorno='<img src="img/traffic/mapa_icone_eventos.gif" border="0" />';break;case this.TipoPin.TransitoObras:retorno='<img src="img/traffic/mapa_icone_obras.gif" border="0" />';break;case this.TipoPin.MissingChildren:retorno='<strong class="pin_MissingChildren">&nbsp;</strong>';break;default:retorno='<strong class="pin_Padrao">'+((dados.valor!=null)?dados.valor:'')+'</strong>';}
return retorno;},DesfocarIconComoChegar:function(idShape){},RemoverPinsCamada:function(camada){if(camada){camada.DeleteAllShapes();oMapa.Mapa().DeleteShapeLayer(camada);}},RemoverPin:function(idPin,s){var hide=false;if(idPin!=null)
s=map.GetShapeByID(idPin);else
hide=true;if(hide)
pLista.ListasDeletar.actionHide("point",s);else
pLista.ListasDeletar.show(L_DesejaExcluir+" "+s.GetTitle()+"?","","point",s);},CriarCamadaPins:function(){var camada=new VEShapeLayer();if(oMapa.Mapa())
oMapa.Mapa().AddShapeLayer(camada);return camada;},EnviarEmail:function(i,idPoi){var s=oMapa.Mapa().GetShapeByID(i);if(idPoi){s.TypePIN="business";s.IdPOI=idPoi;s.NumberPIN=1;}
var line=this.RetornarDadosShape(s);var fullContent=escape(L_URL+"/?sc="+escape(line)+"&z="+oMapa.Mapa().GetZoomLevel()+"&cp="+escape(this.RetornarPontosLinha(oMapa.Mapa().GetCenter())));var title=escape(s.GetTitle())+" "+L_AntesTituloEmail+" "+L_TituloSite;var body=escape(s.GetTitle())+"%0D%0A"+escape(s.GetDescription().replace(/\<br\>/g,''))+"%0D%0A"+fullContent;document.location.href=("mailto:?subject="+title+"&body="+body);},RetornarDadosShape:function(shape){var titulo=shape.GetTitle();var descricao=shape.GetDescription();var urlFoto=shape.GetPhotoURL();var urlInfo=shape.GetMoreInfoURL();var pontos=shape.GetPoints();var larguraLinha=shape.GetLineWidth();var corPreenchimento=shape.GetFillColor();var corLinha=shape.GetLineColor();var tipoLinha=shape.GetDashStyle();var tipoPin=(shape.Type)?shape.Type:shape.TypePIN;var numeroPin=shape.NumberPIN;var idPoi=shape.IdPOI;var localID=shape.GetLocalID();var ponto=this.RetornarPontosLinha(pontos);if(descricao)
descricao=descricao.replace(/\<br\>/gi,'');if(!urlInfo)
urlInfo='';if(!urlFoto)
urlFoto='';if(corPreenchimento)
corPreenchimento=(corPreenchimento.R+':'+corPreenchimento.G+':'+corPreenchimento.B+':'+corPreenchimento.A);if(corLinha)
corLinha=(corLinha.R+':'+corLinha.G+':'+corLinha.B+':'+corLinha.A);if(!tipoLinha)
tipoLinha='';var linha=(numeroPin+'~'+tipoPin+'~'+titulo+'~'+descricao+'~'+urlFoto+'~'+urlInfo+'~'+idPoi);linha=(linha+'~'+ponto+'~'+corPreenchimento+' '+corLinha+' '+larguraLinha+' '+tipoLinha+'~'+localID);return linha;},RetornarPontosLinha:function(pontos){var ponto='';if(pontos.length){for(var i=0;i<pontos.length;i++)
ponto=(ponto+pontos[i].Latitude.toString().substring(0,9)+' '+pontos[i].Longitude.toString().substring(0,9)+';');ponto=ponto.substring(0,(ponto.length-1));}
else
ponto=(pontos.Latitude.toString().substring(0,9)+' '+pontos.Longitude.toString().substring(0,9));return ponto;}});
var Transito=Class.create({initialize:function(){this.CamadaTransito=null;this.CamadaPins=null;this.CamadaPinsIncidentes=null;this.CamadaPinsChaveT=null;this.CamadapinsIncidentesChaveT=null;},RemoverLayer:function(){if(this.CamadaTransito!=null){oMapa.Mapa().DeleteTileLayer("Transito");this.CamadaTransito=null;}},FocarByChavet:function(chavet){if(pTransito!=null){if(pTransito.CamadaPins!=null){var i=pTransito.GetShapeIndexByChavet(chavet);if(i>-1){oPin.Focar(pTransito.CamadaPins.GetShapeByIndex(i),oMapa.ZoomEndereco);oMapa.Mapa().ShowInfoBox(pTransito.CamadaPins.GetShapeByIndex(i));}}}},GetShapeIndexByChavet:function(chavet){if((pTransito.CamadaPinsChaveT!=null)&&(pTransito.CamadaPinsChaveT.length>0)){var ret=-1;for(var i=0;i<pTransito.CamadaPinsChaveT.length;i++){if(pTransito.CamadaPinsChaveT[i]==chavet){ret=i
break;}}
return ret;}
else
return-1;},FocarIncidentesByChavet:function(chavet){if(pTransito!=null){if(pTransito.CamadaPinsIncidentes!=null){var i=pTransito.GetShapeIndexIncidentesByChavet(chavet);if(i>-1){oPin.Focar(pTransito.CamadaPinsIncidentes.GetShapeByIndex(i),oMapa.ZoomEndereco);oMapa.Mapa().ShowInfoBox(pTransito.CamadaPinsIncidentes.GetShapeByIndex(i));}}}},GetShapeIndexIncidentesByChavet:function(chavet){if((pTransito.CamadapinsIncidentesChaveT!=null)&&(pTransito.CamadapinsIncidentesChaveT.length>0)){var ret=-1;for(var i=0;i<pTransito.CamadapinsIncidentesChaveT.length;i++){if(pTransito.CamadapinsIncidentesChaveT[i]==chavet){ret=i
break;}}
return ret;}
else
return-1;},MostrarTileTransito:function(date,time){pTransito.CamadaTransito=new VETileSourceSpecification("Transito","http://imakm%2.maplink3.com.br/Traffic/Tile.ashx?s=%6&t=%5&v=%4");pTransito.CamadaTransito.GetTilePath=function(tileContext){var key="";var cell=0;var timestamp="";var valid=false;var local;for(var i=tileContext.ZoomLevel;i>0;i--){cell=0;var mask=1<<(i-1);if((tileContext.XPos&mask)!=0){cell++;}
if((tileContext.YPos&mask)!=0){cell+=2;}
key=key+cell+"";}
var _z=[131072,65536,32768,16384,8192,4096,2048,1024,512,256,128,64,32,16,8,4,2,1];var x=tileContext.XPos*_z[tileContext.ZoomLevel];var y=tileContext.YPos*_z[tileContext.ZoomLevel];if(tileContext.ZoomLevel>=11&&tileContext.ZoomLevel<=17){if(x>=48384&&x<48640&&y>=74240&&y<74496){timestamp=pTransito.M_INFO.spft;valid=true;local="spft";}
else if(x>=49664&&x<49920&&y>=73984&&y<74240){timestamp=pTransito.M_INFO.rjft;valid=true;local="rjft";}
else if(x>=43792&&x<45044&&y>=78694&&y<80592){timestamp=pTransito.M_INFO.ba;valid=true;local="ba";}}
if(valid){return this.SourceName.replace(/%2/g,((cell%4)+1)).replace(/%4/g,key).replace(/%5/g,timestamp).replace(/%6/g,local);}
else{return"http://imak1.maplink3.com.br/spacer.gif";}};pTransito.CamadaTransito.NumServers=4;pTransito.CamadaTransito.MinZoomLevel=10;pTransito.CamadaTransito.MaxZoomLevel=17;pTransito.CamadaTransito.Opacity=0.5;pTransito.CamadaTransito.ZIndex=100;oMapa.Mapa().AddTileLayer(pTransito.CamadaTransito,true);}});
var Cinema=Class.create({initialize:function()
{this.taskTitle=$("TaskHost_Cinema_TaskToolbar");this.toolbar=$("Cinema_Toolbar");this.taskProgress=$("TaskProgress");this.cinemaDiv=$("divCinema");this.divCidadeSelecionada=$("Cinema_NomeCidade");this.CamadaPins=null;this.CidadeSelecionada="SaoPaulo";},Abrir:function()
{if(pCinema.CamadaPins==null)pCinema.CamadaPins=oPin.CriarCamadaPins();pPainel.MostrarPainel(pPainel.Paineis.Cinema);this.toolbar.removeClassName("hidden");this.CarregarCinema(this.CidadeSelecionada);},AbrirLocal:function()
{var pt=oMapa.Mapa().GetCenter();pCinema.Carregando(true);var ajaxCinema=new Ajax.Request('BuscaEndereco.aspx',{method:'get',parameters:{x:pt.Longitude,y:pt.Latitude},onComplete:function(req)
{var ret=eval("("+req.responseText+")");if(ret.erro)
{pCinema.CarregarCinema(null);}
else
{$("txtCidadeCinema").value=(ret.name+'/'+ret.state);pCinema.CarregarCinema(null,true);}
pCinema.Carregando(false);}});},Fechar:function(naoFecharTask)
{if(oPin)
oPin.RemoverPinsCamada(pCinema.CamadaPins);pPainel.FecharPainel(pPainel.Paineis.Cinema,naoFecharTask);},AbrirMapa:function(x,y)
{oMapa.Mapa().SetCenterAndZoom(new VELatLong(y,x),16);},AbrirMapaCidade:function(x,y)
{oMapa.Mapa().SetCenterAndZoom(new VELatLong(y,x),10);},CarregarCinema:function(cidade,semZoom)
{return;pPainel.MostrarPainel(pPainel.Paineis.Cinema);this.toolbar.removeClassName("hidden");this.Carregando(true);var x=null;var y=null;pCinema.Carregando(false);return;switch(cidade.toUpperCase())
{case"BeloHorizonte".toUpperCase():pPainel.AtualizarTitulo("Cinemas em <strong>Belo Horizonte/MG</strong>");x=-43.937778;y=-19.920833;break;case"Curitiba".toUpperCase():pPainel.AtualizarTitulo("Cinemas em <strong>Curitiba/PR</strong>");x=-49.2732515471081;y=-25.4283563375268;break;case"Florianopolis".toUpperCase():pPainel.AtualizarTitulo("Cinemas em <strong>Florianópolis/SC</strong>");x=-48.5481274029165;y=-27.597959955709;break;case"PortoAlegre".toUpperCase():pPainel.AtualizarTitulo("Cinemas em <strong>Porto Alegre/RS</strong>");x=-51.2279756409469;y=-30.0338840961811;break;case"RioDeJaneiro".toUpperCase():pPainel.AtualizarTitulo("Cinemas no <strong>Rio de Janeiro/RJ</strong>");x=-43.2095868580659;y=-22.9035393226554;break;case"Salvador".toUpperCase():pPainel.AtualizarTitulo("Cinemas em <strong>Salvador/BA</strong>");x=-38.5123820371126;y=-12.9703817279192;break;default:pPainel.AtualizarTitulo("Cinemas em <strong>São Paulo/SP</strong>");x=-46.6388182006449;y=-23.5489432725207;break;}},TratarDadosCinema:function(dados)
{this.cinemaDiv.update();$("Cinema_Erro").update("");if(dados.erro)
{$("Cinema_Erro").mostrar();$("Cinema_Erro").update("Dados indisponíveis neste momento. Tente novamente mais tarde.");return;}
$("Cinema_Erro").esconder();var olLista=Builder.node('ol');var nome=null;var link=null;var item=null;var descricao=null;for(var i=0;i<dados.length;i++)
{nome=dados[i].nome;link='javascript:pCinema.AbrirMapa(\''+dados[i].x+'\', \''+dados[i].y+'\');';descricao="<div style='max-width: 300px; width: 300px;'>";descricao+='<strong>Endereço:</strong> '+dados[i].endereco+(dados[i].numero?(', '+dados[i].numero):'');descricao+=(dados[i].bairro?(' - '+dados[i].bairro):'');if(dados[i].telefone)
descricao+='<br /><strong>Fone:</strong> '+dados[i].telefone;if(dados[i].filmes)
descricao+='<br /><br /><strong>Filmes:</strong><br />';for(var j=0;j<dados[i].filmes.length;j++)
descricao+="<a href='http://msn.guiadasemana.com.br/MSN/film.asp?ID="+dados[i].idmsn+"&cd_film="+dados[i].filmes[j].idfilme+"&cd_city="+dados[i].idcidade+"' target='_blank'>"+dados[i].filmes[j].nome+"</a><br>";descricao+="</div>";oPin.Adicionar({ponto:{x:dados[i].x,y:dados[i].y},titulo:"<a href='http://cinema.br.msn.com' target='_blank'><img src='img/MSN_Cinema.gif' border='0' /></a><br/><br/>"+dados[i].nome,descricao:descricao,tipo:oPin.TipoPin.Cinema,camada:this.CamadaPins,valor:dados[i].nome});item=Builder.node('li',[Builder.node('a',{href:'javascript:void(0);',onclick:link},nome)]);olLista.appendChild(item);}
this.cinemaDiv.appendChild(olLista);},Carregando:function(carregando)
{if(carregando)
{this.taskProgress.removeClassName("hidden");this.cinemaDiv.addClassName("hidden");}
else
{this.taskProgress.addClassName("hidden");this.cinemaDiv.removeClassName("hidden");}}});
var Usuario=Class.create({initialize:function()
{this.Token=($('token').value!='')?$('token').value:null;}});
var curWidth=0;var curX=0;var newX=0;var mouseButtonPos="up";function ValidateConcordo(sender,args){args.IsValid=$("chkConcordar_Ocorrencia").checked;}
function clickTracking(source){PageMethods.ClickTracking(source,function(result){return;},function(error){return;});}
function ShowMissingChildren(){__doPostBack('btnShowMissingChildren','');return;}
function AddFavoritos(){var url="";var title="";if(CultureInfo.Name=="es-AR"){url="http://www.msnmapas.com";title="MSN Mapas Argentina";}
else{url="http://www.livemaps.com.br";title="MSN Mapas Brasil";}
if(window.sidebar){window.sidebar.addPanel(title,url,"");}
else if(window.opera&&window.print){var mbm=document.createElement('a');mbm.setAttribute('rel','sidebar');mbm.target='_search';mbm.setAttribute('href',url);mbm.setAttribute('title',title);mbm.click();}
else if(document.all){window.external.AddFavorite(url,title);}}
function ValidatePontoOcorrencia(sender,args){if(oDesenho.ObjetoInformarOcorrencia!=null){if(oDesenho.ObjetoInformarOcorrencia.Ponto!=null)
args.IsValid=true;else
args.IsValid=false;}
else{args.IsValid=false;}}
function ShowFormMissingChildren(idChildren,tipo)
{var query="MissingChildrenInformation.aspx?q="+idChildren+"&t="+tipo;window.open(query,"informationmissingchildren","top=1px,left=10px, width=690px, height=660px, scrollbars=no, status=no, menubar=no, toolbar=no, titlebar=no, location=no");}
function SearchWeb(key){var query="http://search.live.com/results.aspx?q="+key+"&form=MAPWEB";if(CultureInfo["Name"]=="es-AR")
query+="&mkt=es-ar";else
query+="&mkt=pt-br";window.open(query,"buscaweb");}
function actionKeyWeb(event,keyword){if(event.keyCode==13)
{SearchWeb(keyword);}}
function AbrirPoliticaPublicacao(){if(window.all)
window.open("http://maplink.uol.com.br/v2/transito_politica.html",null,"width=529px, height=260px, scrollbars=no, status=no, menubar=no, toolbar=no, titlebar=no, location=no");else
window.open("http://maplink.uol.com.br/v2/transito_politica.html",null,"width=529px, height=237px, scrollbars=no, status=no, menubar=no, toolbar=no, titlebar=no, location=no");}
function resizeShell(){var a=document.getElementById("msve_main"),b=document.getElementById("msve_footer");a.style.height=GetWindowHeight()-a.offsetTop-b.offsetHeight+"px";a.className=a.className;b.className=b.className}
var MapResizer=new function(){var e=null,d=null,b=null,a=null,k=-1,f=400,o=575,l=50,c=false,h=0;this.init=function(){e=g("#msve_mapArea");d=g("#msve_taskArea");b=g("#msve_mapResizer");g("#msve_resizeGlyph").setStyle("visibility","visible");a=b.element().cloneNode(true);a.id="dragBar";a.style.display="none";document.body.appendChild(a);a=g(a);b.addEvent("mousedown",j)};this.destroy=function(){b.removeEvent("mousedown",j);document.body.removeChild(a.element());a=null;b=null;d=null;e=null};this.addShim=function(){a.addShim()};this.removeShim=function(){a.removeShim()};this.toggleTaskArea=function(f){var a=false;if(c&&f){d.setStyle("display","").setStyle("width","");e.setStyle("marginLeft","");b.setStyle("display","");c=false;a=true}
else if(!c&&!f){d.setStyle("display","none");e.setStyle("marginLeft","0");b.setStyle("display","none");c=true;a=true}
if(a){map.Fill();if(map.IsModeEnabled(Msn.VE.MapActionMode.Mode3D))
Resize3DControl();dragController.setBoundingArea(getDragArea(),false)}};function j(d){d.preventDefault();d.stopPropagation();k=document.body.offsetWidth;g("html").addClass("resizing");g(document).addEvent("mousemove",n,true).addEvent("mouseup",m,true);var c=b.getPagePosition();h=Gimme.Screen.getMousePosition(d).x-c.x;a.setStyle("top",c.y+"px");a.setStyle("left",c.x+"px");a.setStyle("height",b.element().offsetHeight+"px");a.setStyle("width",b.element().offsetWidth+"px");a.setStyle("display","block");if(typeof document.body.setCapture!=="undefined")
document.body.setCapture()}
function n(b){b.preventDefault();b.stopPropagation();var c=i(Gimme.Screen.getMousePosition(b).x-h);a.setStyle("left",c+"px")}
function m(f){g("html").removeClass("resizing");var b=i(Gimme.Screen.getMousePosition(f).x-h);c=!Boolean(b);d.setStyle("width",b+"px").setStyle("display",c?"none":"");if(g("#msve_mapArea"))
g("#msve_mapArea").setStyle("marginLeft",b+"px");resizeShell();a.setStyle("display","none");g(document).removeEvent("mousemove",n,true).removeEvent("mouseup",m,true);if(typeof document.body.releaseCapture!=="undefined")
document.body.releaseCapture();}
function i(a){var b=k-o;if(a>b)
a=b;if(c){if(a<=l)
a=0;else if(a<=f)
a=f}
else if(a<=f-l)
a=0;else if(a<=f)
a=f;return a}};function setPos(e){curEvent=((typeof event=="undefined")?e:event);mouseButtonPos="down";curX=curEvent.clientX;var tempWidth=document.getElementById("msve_taskArea_data").style.width;var widthArray=tempWidth.split("p");curWidth=parseInt(widthArray[0]);}
function getPos(e){if(mouseButtonPos=="down"){curEvent=((typeof event=="undefined")?e:event);newX=curEvent.clientX;var pixelMovement=parseInt(newX-curX);var newWidth=parseInt(curWidth+pixelMovement);newWidth=((newWidth<150)?150:newWidth);document.getElementById("msve_taskArea_data").style.width=newWidth+"px";document.getElementById("msve_mapResizer").style.left=parseInt(document.getElementById("msve_taskArea_data").style.width)+10+"px";}}
var map=null;var primeiroRedimensionamento=true;function fixDate(date){var base=new Date(0);var skew=base.getTime();if(skew>0)
date.setTime(date.getTime()-skew);}
function Impressao(){var page="Impressao.aspx?"+pLista.GerarEmail()+"&"+pComoChegar.GerarEmail()+"&z="+oMapa.Mapa().GetZoomLevel()+"&cp="+escape(oPin.RetornarPontosLinha(map.GetCenter()))+"&omap=1";if(pMissingChildren.Need||pMissingChildren.Missing){page+="&mca="+((pMissingChildren.Need)?"need":"missing");}
window.open(page,'printWin','toolbar=yes,status=yes,menubar=yes,scrollbars=yes,location=yes,resizable=yes,height=700,width=820');}
function Feedback()
{window.open('Feedback.aspx','winFeedback','toolbar=no,status=no,menubar=no,scrollbars=yes,location=yes,resizable=yes,height=550,width=700');}
var janelaOpcoes=null;var janelaSobre=null;var janelaMovieMago=null;function Carregar()
{oMapa.Carregando(true);CarregarMapa();var dropAjuda=new DropDown('icoAjuda','divAjuda');var dropLista=new DropDown('taskBar_collectionsAnchor','taskBar_collectionsDropDown');var dropFillColor=new DropDown('DrawingToolbar_FillColorTool','divCorPreenchimento');var dropLineColor=new DropDown('DrawingToolbar_LineColorTool','divCorLinha');var dropSizeLine=new DropDown('DrawingToolbar_LineWidthTool','divEspessuraLinha');var dropTypeLine=new DropDown('DrawingToolbar_LineDashTool','divTipoLinha');var dropCompartilhar=new DropDown('taskBar_shareMenuAnchor','taskBar_shareMenuDropDown');janelaMovieMago=new Control.Modal('lnkTermosMovieMago',{opacity:0.3,iframe:true,width:540,height:300});janelaOpcoes=new Control.Modal('taskBar_optionsBtnLink',{opacity:0.3,iframe:true,width:540,height:180});janelaSobre=new Control.Modal('lnkSobre',{opacity:0.3,iframe:true,width:700,height:400});var lm='';if($("token").value=='')
{$("token").value=getCookie('tk');if($("token").value=='null')
$("token").value='';}
else
{setCookie('tk',$("token").value);}}
function QueryString(name){var qs=new Array();var variaveis=QueryS.replace(/\x3F/,"").replace(/\x2B/g," ").split("&");if(variaveis!=""){for(i=0;i<variaveis.length;i++){nvar=variaveis[i].split("=");qs[nvar[0]]=unescape(nvar[1]);}}
if(qs[name]!=''&&qs[name]!='undefined'&&qs[name]!=null)
return qs[name];else
return"";}
var qsScratch=null;var qsQuery=null;var qsSC=null;function CarregarParametros(){qsScratch=unescape(QueryString('sc'));qsScratch=qsScratch.split('|');var Search=unescape(QueryString('se'));var idEstabelecimento=unescape(QueryString('ide'));qsQuery=false;qsSC=getCookie("scrt");var atv=unescape(QueryString('a').replace(new RegExp("-","g")," ").replace(new RegExp(".htm","g"),""));var nme=unescape(QueryString('n').replace(new RegExp("-","g")," ").replace(new RegExp(".htm","g"),""));var end=unescape(QueryString('e'));var coa=unescape(QueryString('coa'));if(atv=='Atividade'||atv==null)
atv='';if(nme=='Nome'||nme==null)
nme='';if(end=='Entre com a cidade, endereco ou cep'||end==null)
end='';if(coa=='')
coa=null;ReapontarUltimoLocal();}
function MostrarItensScratch(scratch,query,sc){if(scratch==''){if(!query){if(sc){scratch=unescape(sc.replace(/scrt=/,''));scratch=scratch.split('|');}}}
if(scratch!=''){var numberList,type,title,notes,photourl,moreinfourl,idPoi,point,paramPoly,subItem;for(var x=0;x<(scratch.length);x++){subItem=unescape(scratch[x]);subItem=subItem.split('~');numberList=subItem[0];type=subItem[1];title=subItem[2];notes=subItem[3];photourl=subItem[4];moreinfourl=subItem[5];idPoi=subItem[6];point=subItem[7];paramPoly=subItem[8];pLista.AdicionarItemLista({numberList:numberList,type:type,title:title,notes:notes,photourl:photourl,moreinfourl:moreinfourl,idPoi:idPoi,points:point,paramPoly:paramPoly});}
pLista.SelecionarLista(pLista.RetornarListaAtiva().IDLista);}}
var BuscandoIP=false;function BuscaLocalIP(){if(!BuscandoIP){BuscandoIP=true;VE_MessageControl._AddMessage(L_MeEncontre1,0,true);var ajaxBuscaLocalIP=new Ajax.Request('BuscaLocalIP.aspx',{method:'get',onComplete:function(req){var resultadoIP=eval("("+req.responseText+")");if(resultadoIP.erro){BuscandoIP=false;VE_MessageControl._AddMessage(L_MeEncontre2,6000,true);return;}
var p=new VELatLong(resultadoIP.y,resultadoIP.x);oMapa.Mapa().SetCenterAndZoom(p,oMapa.ZoomCidade);VE_MessageControl._RemoveMessage();VE_MessageControl._AddMessage(L_MeEncontre3,4000,true);BuscandoIP=false;}});}}
function ReapontarUltimoLocal(){var ultimoLocal=getCookie("ultimolocal");if(typeof(VEPoint)!='undefined'){oMapa.Mapa().SetCenterAndZoom(new VELatLong(VEPoint.Latitude,VEPoint.Longitude),VEPoint.Zoom);}
else if(ultimoLocal!=null&&ultimoLocal!=''){var centerPoint=unescape(QueryString('cp'));if(centerPoint==''){var local=ultimoLocal.split('@');try{if(local[0]!='null'&&local[1]!='null')
oMapa.Mapa().SetCenterAndZoom(new VELatLong(local[0],local[1]),local[2]);}
catch(exp){}}}}
function fixDate(date){var base=new Date(0);var skew=base.getTime();if(skew>0)
date.setTime(date.getTime()-skew);}
function FecharJanelaOpcoes(){janelaOpcoes.close();}
function FecharJanelaTermos(){janelaMovieMago.close();}
function AlterarIDUsuarioMM(id){$("hdnCDMM").value=id;}
addEvent=function(o,e,f,s){var r=o[r="_"+(e="on"+e)]=o[r]||(o[e]?[[o[e],o]]:[]),a,c,d;r[r.length]=[f,s||o],o[e]=function(e){try{(e=e||event).preventDefault||(e.preventDefault=function(){e.returnValue=false;});e.stopPropagation||(e.stopPropagation=function(){e.cancelBubble=true;});e.target||(e.target=e.srcElement||null);e.key=(e.which+1||e.keyCode+1)-1||0;}catch(f){}
for(d=1,f=r.length;f;r[--f]&&(a=r[f][0],o=r[f][1],a.call?c=a.call(o,e):(o._=a,c=o._(e),o._=null),d&=c!==false));return e=null,!!d;}};removeEvent=function(o,e,f,s){for(var i=(e=o["_on"+e]||[]).length;i;)
if(e[--i]&&e[i][0]==f&&(s||o)==e[i][1])
return delete e[i];return false;};function CarregarMapa(){map=new VEMap("msve_mapContainer");map.onLoadMap=function(){map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);window.onresize=pPainel.Redimensionar;window.onload=pPainel.Redimensionar;MapaInicializado=true;return false;}
map.AttachEvent("onendpan",getEndPan);map.AttachEvent("onchangeview",function(){try{oMapa.Center=oMapa.Mapa().GetCenter();}catch(e){}
try{$('hfLatitude').value=oMapa.Center.Latitude;}catch(e){}
try{$('hfLongitude').value=oMapa.Center.Longitude;}catch(e){}
try{$('hfMapView').value=Object.toJSON(oMapa.Mapa().GetMapView());}catch(e){}
try{$('hfTamanhoMapa').value="{ Largura : '"+oMapa.DivMapa.clientWidth+"', Altura : '"+oMapa.DivMapa.clientHeight+"'}";}catch(e){}
try{if((pComoChegar.IDRota)&&(oMapa.Mapa().GetZoomLevel()>pComoChegar.InitialRouteZoom)){pComoChegar.LimparDesenhoRota();pComoChegar.DesenharRota();}}catch(e){}
return false;});map.AttachEvent("onendzoom",getEndZoom);map.AttachEvent("onchangemapstyle",function(e){if(oMapa!=null){if(e.mapStyle=='h'){oMapa.LayerHibrido=new VETileSourceSpecification("Hibrido","http://imakm%2.maplink3.com.br/maps.ashx?v=%4|h&call="+G_CallTiles);oMapa.LayerHibrido.GetTilePath=function(tileContext){var key="";var cell=0;for(var i=tileContext.ZoomLevel;i>0;i--){cell=0;var mask=1<<(i-1);if((tileContext.XPos&mask)!=0){cell++;}
if((tileContext.YPos&mask)!=0){cell+=2;}
key=key+cell+"";}
return this.SourceName.replace(/%2/g,((cell%4)+1)).replace(/%4/g,key);};oMapa.LayerHibrido.NumServers=4;oMapa.LayerHibrido.MinZoomLevel=10;oMapa.LayerHibrido.MaxZoomLevel=17;oMapa.LayerHibrido.Opacity=0.5;oMapa.LayerHibrido.ZIndex=100;oMapa.Mapa().AddTileLayer(oMapa.LayerHibrido,true);}
else{if(oMapa.LayerHibrido!=null){oMapa.Mapa().DeleteTileLayer("Hibrido");oMapa.LayerHibrido=null;}}}
return false;});map.AttachEvent("onmousedown",EsconderMenuContexto);MapResizer.init();MapResizer.addShim();try{if(CultureInfo["Name"]=="es-AR")
map.LoadMap(new VELatLong(-34.618799752,-58.44657898),11,'r',false);else
map.LoadMap(new VELatLong(-23.56501,-46.65200),11,'r',false);}
catch(e){}}
function EsconderMenuContexto(e){$('menuContext').style.display='none';$('popupmenu').style.display='none';}
function MostrarMenuContexto(e){popuplat=e.view.LatLong.Latitude;popuplon=e.view.LatLong.Longitude;var latlong=map.LatLongToPixel(new VELatLong(popuplat,popuplon));var x=latlong.x;var y=latlong.y;var al=GetWindowHeight();var aa=GetWindowWidth();var icon=$('menuContext');var menuC=$('popupmenu');menuC.style.display='block';icon.style.display='block';menuC.style.left=(x+10)+'px';menuC.style.top=(y+5)+'px';icon.style.left=(x+3)+'px';icon.style.top=(y-14)+'px';}
function getEndPan(){if((pComoChegar.IDRota)&&(oMapa.Mapa().GetZoomLevel()>pComoChegar.InitialRouteZoom)){pComoChegar.LimparDesenhoRota();pComoChegar.DesenharRota();}
if(!oMapa.MapaCarregado){if(primeiroRedimensionamento){primeiroRedimensionamento=false;CarregarParametros();}
if(pPainel.PainelAtivo()==null)
pBemVindo.Abrir();oMapa.MapaCarregado=true;oMapa.Carregando(false);VE_MessageControl._RemoveMessage();pLista.Carregar();MostrarItensScratch(qsScratch,qsQuery,qsSC);}
return false;}
function getStartZoom(){}
function getEndZoom(){if(pComoChegar.UltimaRota)
{if(oMapa.Mapa().GetZoomLevel()>pComoChegar.InitialRouteZoom){pComoChegar.LimparDesenhoRota();pComoChegar.DesenharRota();}
else
pComoChegar.InserirRotaGravada();}}
function SelecionarAba(aba){switch(aba){case"Empresas":$("taskBar_Biz").style.display="";$("taskBar_Places").style.display="none";$("taskBar_Web").style.display="none";if($("taskBar_Biz_link"))
$("taskBar_Biz_link").addClassName("scopeTabsSelected");$("taskBar_Places_link").removeClassName("scopeTabsSelected");$("taskBar_Web_link").removeClassName("scopeTabsSelected");break;case"Locais":$("taskBar_Places").style.display="";$("taskBar_Biz").style.display="none";$("taskBar_Web").style.display="none";if($("taskBar_Biz_link"))
$("taskBar_Biz_link").removeClassName("scopeTabsSelected");$("taskBar_Places_link").addClassName("scopeTabsSelected");$("taskBar_Web_link").removeClassName("scopeTabsSelected");break;case"Web":$("taskBar_Places").style.display="none";$("taskBar_Biz").style.display="none";$("taskBar_Web").style.display="";if($("taskBar_Biz_link"))
$("taskBar_Biz_link").removeClassName("scopeTabsSelected");$("taskBar_Places_link").removeClassName("scopeTabsSelected");$("taskBar_Web_link").addClassName("scopeTabsSelected");break;}}
var DropDown=Class.create();DropDown.prototype={initialize:function(element,dropdown){var options=Object.extend({default_css:false,delta_x:0,delta_y:1,zindex:1000},arguments[1]||{});this.element=$(element);this.dropdown=$(dropdown);this.options=options;this.tempoFechamento=0;this.timeoutFechamento=500;this.itemMostrar=0;this.dropdown.hide();this.eventMouseClick=this.mostrarDropDown.bindAsEventListener(this);this.eventMouseOut=this.esconderDropDown.bindAsEventListener(this);this.eventDDMouseOut=this.esconderDropDown2.bindAsEventListener(this);this.eventDDMouseOver=this.mostrarDropDown2.bindAsEventListener(this);this.eventDDMouseClick=this.esconderDropDown2.bindAsEventListener(this);this.eventFechar=this.fechar.bindAsEventListener(this);this.registerEvents();},destroy:function(){Event.stopObserving(this.element,"click",this.eventMouseClick);Event.stopObserving(this.element,"mouseout",this.eventMouseOut);Event.stopObserving(this.dropdown,"mouseout",this.eventDDMouseOut);Event.stopObserving(this.dropdown,"mouseover",this.eventDDMouseOver);},registerEvents:function(){Event.observe(this.element,"click",this.eventMouseClick);Event.observe(this.element,"mouseout",this.eventMouseOut);Event.observe(this.dropdown,"mouseout",this.eventDDMouseOut);Event.observe(this.dropdown,"mouseover",this.eventDDMouseOver);},cancelarTempoFechamento:function(){if(this.tempoFechamento){window.clearTimeout(this.tempoFechamento);this.tempoFechamento=null;}},mostrarDropDown:function(event){this.cancelarTempoFechamento();if(this.itemMostrar)
new Element.hide(this.dropdown);this.itemMostrar=this.dropdown;Event.stop(event);var dimensionsAnchor=Element.getDimensions(this.element);var positionAnchor=Element.cumulativeOffset(this.element);var element_anchor_width=dimensionsAnchor.width;var element_anchor_height=dimensionsAnchor.height;var element_anchor_top=positionAnchor.top;var element_anchor_left=positionAnchor.left;var mouse_x=element_anchor_left;var mouse_y=element_anchor_top+element_anchor_height;var dimensions=Element.getDimensions(this.dropdown);var element_width=dimensions.width;var element_height=dimensions.height;if((element_width+mouse_x)>=(this.getWindowWidth()-this.options.delta_x)){mouse_x=mouse_x-element_width;mouse_x=mouse_x+element_anchor_width-(this.options.delta_y*2);}
else{mouse_x=mouse_x+this.options.delta_x;}
if((element_height+mouse_y)>=(this.getWindowHeight()-this.options.delta_y)){mouse_y=mouse_y-element_height;mouse_y=mouse_y-this.options.delta_y;}
else{mouse_y=mouse_y+this.options.delta_y;}
if(this.dropdown.id=='taskBar_collectionsDropDown'||this.dropdown.id=='taskBar_shareMenuDropDown'){this.setStyles(mouse_x,mouse_y);}
else if(this.dropdown.id=='taskBar_cidadesDropDown'||this.dropdown.id=='taskBar_cidadesCinemaDropDown'){this.setStyles(8,element_anchor_height+3);}
else if(this.dropdown.id=='divAjuda'){this.setStyles(127,67);}
else if(this.dropdown.id=='divCorPreenchimento'){this.setStyles(42,-element_height);}
else if(this.dropdown.id=='divCorLinha'){this.setStyles(74,-element_height);}
else if(this.dropdown.id=='divEspessuraLinha'){this.setStyles(106,-element_height);}
else if(this.dropdown.id=='divTipoLinha'){this.setStyles(138,-element_height);}
else{this.setStyles(0,element_anchor_height);}
new Element.show(this.dropdown);},setStyles:function(x,y){Element.setStyle(this.dropdown,{position:'absolute',top:y+"px",left:x+"px",zIndex:this.options.zindex});if(this.options.default_css){Element.setStyle(this.dropdown,{margin:this.options.margin,padding:this.options.padding,backgroundColor:this.options.backgroundColor,zindex:this.options.zindex});}},esconderDropDown:function(event){this.timerFechamento();},mostrarDropDown2:function(event){this.cancelarTempoFechamento();},timerFechamento:function(){this.tempoFechamento=window.setTimeout(this.eventFechar,this.timeoutFechamento);},fechar:function(teste){new Element.hide(this.dropdown);},esconderDropDown2:function(event){this.timerFechamento();},verificarDropDownEsconder:function(){new Element.hide(this.dropdown);timeoutmenu=setTimeout("fechaMenu()",this.timeoutFechamento);},getWindowHeight:function(){var innerHeight;if(navigator.appVersion.indexOf('MSIE')>0)
innerHeight=document.body.clientHeight;else
innerHeight=window.innerHeight;return innerHeight;},getWindowWidth:function(){var innerWidth;if(navigator.appVersion.indexOf('MSIE')>0)
innerWidth=document.body.clientWidth;else
innerWidth=window.innerWidth;return innerWidth;}}
var Tooltip=Class.create();Tooltip.prototype={initialize:function(element,tool_tip){var options=Object.extend({default_css:false,margin:"0px",padding:"5px",backgroundColor:"#d6d6fc",delta_x:5,delta_y:5,zindex:1000},arguments[1]||{});this.element=$(element);this.tool_tip=$(tool_tip);this.options=options;this.tool_tip.hide();this.eventMouseOver=this.showTooltip.bindAsEventListener(this);this.eventMouseOut=this.hideTooltip.bindAsEventListener(this);this.registerEvents();},destroy:function(){Event.stopObserving(this.element,"mouseover",this.eventMouseOver);Event.stopObserving(this.element,"mouseout",this.eventMouseOut);},registerEvents:function(){Event.observe(this.element,"mouseover",this.eventMouseOver);Event.observe(this.element,"mouseout",this.eventMouseOut);},showTooltip:function(event){Event.stop(event);var mouse_x=Event.pointerX(event);var mouse_y=Event.pointerY(event);var dimensions=Element.getDimensions(this.tool_tip);var element_width=dimensions.width;var element_height=dimensions.height;if((element_width+mouse_x)>=(this.getWindowWidth()-this.options.delta_x)){mouse_x=mouse_x-element_width;mouse_x=mouse_x-this.options.delta_x;}else{mouse_x=mouse_x+this.options.delta_x;}
if((element_height+mouse_y)>=(this.getWindowHeight()-this.options.delta_y)){mouse_y=mouse_y-element_height;mouse_y=mouse_y-this.options.delta_y;}else{mouse_y=mouse_y+this.options.delta_y;}
this.setStyles(mouse_x,mouse_y);new Element.show(this.tool_tip);},setStyles:function(x,y){Element.setStyle(this.tool_tip,{position:'absolute',top:y+"px",left:x+"px",zindex:this.options.zindex});if(this.options.default_css){Element.setStyle(this.tool_tip,{margin:this.options.margin,padding:this.options.padding,backgroundColor:this.options.backgroundColor,zindex:this.options.zindex});}},hideTooltip:function(event){new Element.hide(this.tool_tip);},getWindowHeight:function(){var innerHeight;if(navigator.appVersion.indexOf('MSIE')>0){innerHeight=document.body.clientHeight;}else{innerHeight=window.innerHeight;}
return innerHeight;},getWindowWidth:function(){var innerWidth;if(navigator.appVersion.indexOf('MSIE')>0){innerWidth=document.body.clientWidth;}else{innerWidth=window.innerWidth;}
return innerWidth;}}
function getCookie(name){var prefix=name+"=";var cookieStartIndex=document.cookie.indexOf(prefix);if(cookieStartIndex==-1)
return null;var cookieEndIndex=document.cookie.indexOf(";",cookieStartIndex+prefix.length);if(cookieEndIndex==-1)
cookieEndIndex=document.cookie.length;return unescape(document.cookie.substring(cookieStartIndex+prefix.length,cookieEndIndex));}
function deleteCookie(name,path,domain){if(getCookie(name))
document.cookie=(name+"="+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT");}
var caution=false;function setCookie(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+
((expires)?"; expires="+expires.toGMTString():"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"")
if(!caution||(name+"="+escape(value)).length<=4000)
document.cookie=curCookie
else
if(confirm("Cookie exceeds 4KB and will be cut!"))
document.cookie=curCookie}
function CentralizarMapa(){oMapa.Mapa().SetCenter(new VELatLong(popuplat,popuplon));EsconderMenuContexto();}
if(typeof(Control)=="undefined")
Control={};Control.Modal=Class.create();Object.extend(Control.Modal,{loaded:false,loading:false,loadingTimeout:false,overlay:false,container:false,current:false,ie:false,effects:{containerFade:false,containerAppear:false,overlayFade:false,overlayAppear:false},targetRegexp:/#(.+)$/,imgRegexp:/\.(jpe?g|gif|png|tiff?)$/i,overlayStyles:{position:'fixed',top:0,left:0,width:'100%',height:'100%',zIndex:9998},overlayIEStyles:{position:'absolute',top:0,left:0,zIndex:9998},disableHoverClose:false,load:function(){if(!Control.Modal.loaded){Control.Modal.loaded=true;Control.Modal.ie=!(typeof document.body.style.maxHeight!='undefined');Control.Modal.overlay=$(document.createElement('div'));Control.Modal.overlay.id='modal_overlay';Object.extend(Control.Modal.overlay.style,Control.Modal['overlay'+(Control.Modal.ie?'IE':'')+'Styles']);Control.Modal.overlay.hide();Control.Modal.container=$(document.createElement('div'));Control.Modal.container.id='modal_container';Control.Modal.container.hide();Control.Modal.loading=$(document.createElement('div'));Control.Modal.loading.id='modal_loading';Control.Modal.loading.hide();var body_tag=document.getElementsByTagName('body')[0];body_tag.appendChild(Control.Modal.overlay);body_tag.appendChild(Control.Modal.container);body_tag.appendChild(Control.Modal.loading);Control.Modal.container.observe('mouseout',function(event){if(!Control.Modal.disableHoverClose&&Control.Modal.current&&Control.Modal.current.options.hover&&!Position.within(Control.Modal.container,Event.pointerX(event),Event.pointerY(event)))
Control.Modal.close();});}},open:function(contents,options){options=options||{};if(!options.contents)
options.contents=contents;var modal_instance=new Control.Modal(false,options);modal_instance.open();return modal_instance;},close:function(force){if(typeof(force)!='boolean')
force=false;if(Control.Modal.current)
Control.Modal.current.close(force);},attachEvents:function(){Event.observe(window,'load',Control.Modal.load);Event.observe(window,'unload',Event.unloadCache,false);},center:function(element){if(!element._absolutized){element.setStyle({position:'absolute'});element._absolutized=true;}
var dimensions=element.getDimensions();Position.prepare();var offset_left=(Position.deltaX+Math.floor((Control.Modal.getWindowWidth()-dimensions.width)/2));var offset_top=(Position.deltaY+((Control.Modal.getWindowHeight()>dimensions.height)?Math.floor((Control.Modal.getWindowHeight()-dimensions.height)/2):0));element.setStyle({top:((dimensions.height<=Control.Modal.getDocumentHeight())?((offset_top!=null&&offset_top>0)?offset_top:'0')+'px':0),left:((dimensions.width<=Control.Modal.getDocumentWidth())?((offset_left!=null&&offset_left>0)?offset_left:'0')+'px':0)});},getWindowWidth:function(){return(self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0);},getWindowHeight:function(){return(self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0);},getDocumentWidth:function(){return Math.min(document.body.scrollWidth,Control.Modal.getWindowWidth());},getDocumentHeight:function(){return Math.max(document.body.scrollHeight,Control.Modal.getWindowHeight());},onKeyDown:function(event){if(event.keyCode==Event.KEY_ESC)
Control.Modal.close();}});Object.extend(Control.Modal.prototype,{mode:'',html:false,href:'',element:false,src:false,imageLoaded:false,ajaxRequest:false,initialize:function(element,options){this.element=$(element);this.options={beforeOpen:Prototype.emptyFunction,afterOpen:Prototype.emptyFunction,beforeClose:Prototype.emptyFunction,afterClose:Prototype.emptyFunction,onSuccess:Prototype.emptyFunction,onFailure:Prototype.emptyFunction,onException:Prototype.emptyFunction,beforeImageLoad:Prototype.emptyFunction,afterImageLoad:Prototype.emptyFunction,autoOpenIfLinked:true,contents:false,loading:false,fade:false,fadeDuration:0.75,image:false,imageCloseOnClick:true,hover:false,iframe:false,iframeTemplate:new Template('<iframe src="#{href}" width="100%" height="100%" frameborder="0" id="#{id}"></iframe>'),evalScripts:true,requestOptions:{},overlayDisplay:true,overlayClassName:'',overlayCloseOnClick:true,containerClassName:'',opacity:0.3,zIndex:9998,width:null,height:null,offsetLeft:0,offsetTop:0,position:'absolute'};Object.extend(this.options,options||{});var target_match=false;var image_match=false;if(this.element){target_match=Control.Modal.targetRegexp.exec(this.element.href);image_match=Control.Modal.imgRegexp.exec(this.element.href);}
if(this.options.position=='mouse')
this.options.hover=true;if(this.options.contents){this.mode='contents';}else if(this.options.image||image_match){this.mode='image';this.src=this.element.href;}else if(target_match){this.mode='named';var x=$(target_match[1]);this.html=x.innerHTML;x.remove();this.href=target_match[1];}else{this.mode=(this.options.iframe)?'iframe':'ajax';this.href=this.element.href;}
if(this.element){if(this.options.hover){this.element.observe('mouseover',this.open.bind(this));this.element.observe('mouseout',function(event){if(!Position.within(Control.Modal.container,Event.pointerX(event),Event.pointerY(event)))
this.close();}.bindAsEventListener(this));}else{this.element.onclick=function(event){this.open();Event.stop(event);return false;}.bindAsEventListener(this);}}
var targets=Control.Modal.targetRegexp.exec(window.location);this.position=function(event){if(this.options.position=='absolute')
Control.Modal.center(Control.Modal.container);else{var xy=(event&&this.options.position=='mouse'?[Event.pointerX(event),Event.pointerY(event)]:Position.cumulativeOffset(this.element));Control.Modal.container.setStyle({position:'absolute',top:xy[1]+(typeof(this.options.offsetTop)=='function'?this.options.offsetTop():this.options.offsetTop)+'px',left:xy[0]+(typeof(this.options.offsetLeft)=='function'?this.options.offsetLeft():this.options.offsetLeft)+'px'});}
if(Control.Modal.ie){Control.Modal.overlay.setStyle({height:Control.Modal.getDocumentHeight()+'px',width:Control.Modal.getDocumentWidth()+'px'});}}.bind(this);if(this.mode=='named'&&this.options.autoOpenIfLinked&&targets&&targets[1]&&targets[1]==this.href)
this.open();},showLoadingIndicator:function(){if(this.options.loading){Control.Modal.loadingTimeout=window.setTimeout(function(){var modal_image=$('modal_image');if(modal_image)
modal_image.hide();Control.Modal.loading.style.zIndex=this.options.zIndex+1;Control.Modal.loading.update('<img id="modal_loading" src="'+this.options.loading+'"/>');Control.Modal.loading.show();Control.Modal.center(Control.Modal.loading);}.bind(this),250);}},hideLoadingIndicator:function(){if(this.options.loading){if(Control.Modal.loadingTimeout)
window.clearTimeout(Control.Modal.loadingTimeout);var modal_image=$('modal_image');if(modal_image)
modal_image.show();Control.Modal.loading.hide();}},open:function(force){if(!force&&this.notify('beforeOpen')===false)
return;if(!Control.Modal.loaded)
Control.Modal.load();Control.Modal.close();if(!this.options.hover)
Event.observe($(document.getElementsByTagName('body')[0]),'keydown',Control.Modal.onKeyDown);Control.Modal.current=this;if(!this.options.hover)
Control.Modal.overlay.setStyle({zIndex:this.options.zIndex,opacity:this.options.opacity});Control.Modal.container.setStyle({zIndex:this.options.zIndex+1,width:(this.options.width?(typeof(this.options.width)=='function'?this.options.width():this.options.width)+'px':null),height:(this.options.height?(typeof(this.options.height)=='function'?this.options.height():this.options.height)+'px':null)});if(Control.Modal.ie&&!this.options.hover){$A(document.getElementsByTagName('select')).each(function(select){select.style.visibility='hidden';});}
Control.Modal.overlay.addClassName(this.options.overlayClassName);Control.Modal.container.addClassName(this.options.containerClassName);switch(this.mode){case'image':this.imageLoaded=false;this.notify('beforeImageLoad');this.showLoadingIndicator();var img=document.createElement('img');img.onload=function(img){this.hideLoadingIndicator();this.update([img]);if(this.options.imageCloseOnClick)
$(img).observe('click',Control.Modal.close);this.position();this.notify('afterImageLoad');img.onload=null;}.bind(this,img);img.src=this.src;img.id='modal_image';break;case'ajax':this.notify('beforeLoad');var options={method:'post',onSuccess:function(request){this.hideLoadingIndicator();this.update(request.responseText);this.notify('onSuccess',request);this.ajaxRequest=false;}.bind(this),onFailure:function(){this.notify('onFailure');}.bind(this),onException:function(){this.notify('onException');}.bind(this)};Object.extend(options,this.options.requestOptions);this.showLoadingIndicator();this.ajaxRequest=new Ajax.Request(this.href,options);break;case'iframe':this.update(this.options.iframeTemplate.evaluate({href:this.href,id:'modal_iframe'}));break;case'contents':this.update((typeof(this.options.contents)=='function'?this.options.contents():this.options.contents));break;case'named':this.update(this.html);break;}
if(!this.options.hover){if(this.options.overlayCloseOnClick&&this.options.overlayDisplay)
Control.Modal.overlay.observe('click',Control.Modal.close);if(this.options.overlayDisplay){if(this.options.fade){if(Control.Modal.effects.overlayFade)
Control.Modal.effects.overlayFade.cancel();Control.Modal.effects.overlayAppear=new Effect.Appear(Control.Modal.overlay,{queue:{position:'front',scope:'Control.Modal'},to:this.options.opacity,duration:this.options.fadeDuration/2});}else
Control.Modal.overlay.show();}}
if(this.options.position=='mouse'){this.mouseHoverListener=this.position.bindAsEventListener(this);this.element.observe('mousemove',this.mouseHoverListener);}
this.notify('afterOpen');},update:function(html){if(typeof(html)=='string')
Control.Modal.container.update(html);else{Control.Modal.container.update('');(html.each)?html.each(function(node){Control.Modal.container.appendChild(node);}):Control.Modal.container.appendChild(node);}
if(this.options.fade){if(Control.Modal.effects.containerFade)
Control.Modal.effects.containerFade.cancel();Control.Modal.effects.containerAppear=new Effect.Appear(Control.Modal.container,{queue:{position:'end',scope:'Control.Modal'},to:1,duration:this.options.fadeDuration/2});}else
Control.Modal.container.show();this.position();Event.observe(window,'resize',this.position,false);Event.observe(window,'scroll',this.position,false);},close:function(force){if(!force&&this.notify('beforeClose')===false)
return;if(this.ajaxRequest)
this.ajaxRequest.transport.abort();this.hideLoadingIndicator();if(this.mode=='image'){var modal_image=$('modal_image');if(this.options.imageCloseOnClick&&modal_image)
modal_image.stopObserving('click',Control.Modal.close);}
if(Control.Modal.ie&&!this.options.hover){$A(document.getElementsByTagName('select')).each(function(select){select.style.visibility='visible';});}
if(!this.options.hover)
Event.stopObserving(window,'keyup',Control.Modal.onKeyDown);Control.Modal.current=false;Event.stopObserving(window,'resize',this.position,false);Event.stopObserving(window,'scroll',this.position,false);if(!this.options.hover){if(this.options.overlayCloseOnClick&&this.options.overlayDisplay)
Control.Modal.overlay.stopObserving('click',Control.Modal.close);if(this.options.overlayDisplay){if(this.options.fade){if(Control.Modal.effects.overlayAppear)
Control.Modal.effects.overlayAppear.cancel();Control.Modal.effects.overlayFade=new Effect.Fade(Control.Modal.overlay,{queue:{position:'end',scope:'Control.Modal'},from:this.options.opacity,to:0,duration:this.options.fadeDuration/2});}else
Control.Modal.overlay.hide();}}
if(this.options.fade){if(Control.Modal.effects.containerAppear)
Control.Modal.effects.containerAppear.cancel();Control.Modal.effects.containerFade=new Effect.Fade(Control.Modal.container,{queue:{position:'front',scope:'Control.Modal'},from:1,to:0,duration:this.options.fadeDuration/2,afterFinish:function(){Control.Modal.container.update('');this.resetClassNameAndStyles();}.bind(this)});}else{Control.Modal.container.hide();Control.Modal.container.update('');this.resetClassNameAndStyles();}
if(this.options.position=='mouse')
this.element.stopObserving('mousemove',this.mouseHoverListener);this.notify('afterClose');},resetClassNameAndStyles:function(){Control.Modal.overlay.removeClassName(this.options.overlayClassName);Control.Modal.container.removeClassName(this.options.containerClassName);Control.Modal.container.setStyle({height:null,width:null,top:null,left:null});},notify:function(event_name){try{if(this.options[event_name])
return[this.options[event_name].apply(this.options[event_name],$A(arguments).slice(1))];}catch(e){if(e!=$break)
throw e;else
return false;}}});if(typeof(Object.Event)!='undefined')
Object.Event.extend(Control.Modal);Control.Modal.attachEvents();
var cookieOptions=getCookie("options");if(cookieOptions!=null&&cookieOptions!='')
{try
{var opts=cookieOptions.split(',');OpcoesSalvarUltimoLocal=(opts[0]=="true");OpcoesNumeroRegistrosBusca=opts[1];}
catch(e){}}
function SalvarUltimaPosicao()
{try
{deleteCookie("ultimoLocal");var now=new Date();fixDate(now);now.setTime(now.getTime()+365*24*60*60*100);if(OpcoesSalvarUltimoLocal)
{var ultimoLocal=oMapa.Mapa().GetCenter();var desc=ultimoLocal.Latitude+"@"+ultimoLocal.Longitude+"@"+oMapa.Mapa().GetZoomLevel();setCookie("ultimolocal",desc,now);}}
catch(e){}}
try
{if(window.attachEvent)
window.attachEvent('onunload',SalvarUltimaPosicao);else if(window.addEventListener)
window.addEventListener('unload',SalvarUltimaPosicao,false);}
catch(e){}
var MissingChildren=Class.create({initialize:function(){this.CamadaMissingChildren=null;this.CamadaPins=null;this.PinsFoco=[];this.Missing=false;this.Need=false;},Fechar:function(naoFecharTask){pPainel.FecharPainel(pPainel.Paineis.BemVindo,naoFecharTask);},FocarByIndex:function(i){if(pMissingChildren!=null){if(pMissingChildren.CamadaPins!=null){if(pMissingChildren.CamadaPins.GetShapeCount()>=i){oPin.Focar(pMissingChildren.CamadaPins.GetShapeByIndex(i),oMapa.ZoomCidade);oMapa.Mapa().ShowInfoBox(pMissingChildren.CamadaPins.GetShapeByIndex(i));}}}},MouseOverByIndex:function(i){try{if(pMissingChildren!=null){if(pMissingChildren.CamadaPins!=null){var currentShape=pMissingChildren.CamadaPins.GetShapeByIndex(i);var currentIcon=currentShape.GetCustomIcon();currentIcon.CustomHTML=currentIcon.CustomHTML.replace('pin_MissingChildren','pin_MissingChildrenSelect');currentShape.SetCustomIcon(currentIcon);}}}catch(e){}},MouseOutByIndex:function(i){try{if(pMissingChildren!=null){if(pMissingChildren.CamadaPins!=null){var currentShape=pMissingChildren.CamadaPins.GetShapeByIndex(i);var currentIcon=currentShape.GetCustomIcon();currentIcon.CustomHTML=currentIcon.CustomHTML.replace('pin_MissingChildrenSelect','pin_MissingChildren');currentShape.SetCustomIcon(currentIcon);}}}catch(e){}}});