window.BeetMapTile={0:"49,-126,46,-118.5",1:"49,-118.5,48.25,-116.625",2:"49,-116.625,48.25,-114.75",3:"48.25,-118.5,47.875,-117.5625",4:"48.25,-117.5625,47.875,-116.625",5:"47.875,-118.5,47.5,-117.5625",6:"47.875,-117.5625,47.6875,-117.09375",7:"47.875,-117.09375,47.6875,-116.625",8:"47.6875,-117.5625,47.5,-117.09375",9:"47.6875,-117.09375,47.5,-116.625",10:"48.25,-116.625,47.5,-114.75",11:"49,-114.75,47.5,-111",12:"47.5,-118.5,46,-114.75",13:"47.5,-114.75,46.75,-112.875",14:"47.5,-112.875,46.75,-111",15:"46.75,-114.75,46,-112.875",16:"46.75,-112.875,46,-111",17:"46,-126,44.5,-122.25",18:"46,-122.25,44.5,-118.5",19:"44.5,-126,43,-122.25",20:"44.5,-122.25,43,-118.5",21:"46,-118.5,43,-111",22:"49,-111,46,-103.5",23:"49,-103.5,47.5,-99.75",24:"49,-99.75,47.5,-96",25:"47.5,-103.5,46,-99.75",26:"47.5,-99.75,46,-96",27:"46,-111,43,-103.5",28:"46,-103.5,43,-96",29:"43,-126,40,-118.5",30:"43,-118.5,40,-111",31:"40,-126,38.5,-122.25",32:"40,-122.25,38.5,-118.5",33:"38.5,-126,37,-122.25",34:"38.5,-122.25,37,-118.5",35:"40,-118.5,37,-111",36:"43,-111,40,-103.5",37:"43,-103.5,40,-96",38:"40,-111,38.5,-107.25",39:"40,-107.25,39.25,-105.375",40:"40,-105.375,39.25,-103.5",41:"39.25,-107.25,38.5,-105.375",42:"39.25,-105.375,38.5,-103.5",43:"38.5,-111,37,-107.25",44:"38.5,-107.25,37,-103.5",45:"40,-103.5,37,-96",46:"49,-96,46,-88.5",47:"49,-88.5,46,-81",48:"46,-96,44.5,-92.25",49:"46,-92.25,44.5,-88.5",50:"44.5,-96,43,-92.25",51:"44.5,-92.25,43,-88.5",52:"46,-88.5,43,-81",53:"49,-81,46,-73.5",54:"49,-73.5,46,-66",55:"46,-81,43,-73.5",56:"46,-73.5,44.5,-69.75",57:"46,-69.75,44.5,-66",58:"44.5,-73.5,43.75,-71.625",59:"44.5,-71.625,43.75,-69.75",60:"43.75,-73.5,43,-71.625",61:"43.75,-71.625,43.375,-70.6875",62:"43.75,-70.6875,43.375,-69.75",63:"43.375,-71.625,43,-70.6875",64:"43.375,-70.6875,43,-69.75",65:"44.5,-69.75,43,-66",66:"43,-96,41.5,-92.25",67:"43,-92.25,41.5,-88.5",68:"41.5,-96,40,-92.25",69:"41.5,-92.25,40,-88.5",70:"43,-88.5,41.5,-84.75",71:"43,-84.75,42.25,-82.875",72:"43,-82.875,42.25,-81",73:"42.25,-84.75,41.5,-82.875",74:"42.25,-82.875,41.5,-81",75:"41.5,-88.5,40,-84.75",76:"41.5,-84.75,40,-81",77:"40,-96,38.5,-92.25",78:"40,-92.25,38.5,-88.5",79:"38.5,-96,37,-92.25",80:"38.5,-92.25,37,-88.5",81:"40,-88.5,38.5,-84.75",82:"40,-84.75,38.5,-81",83:"38.5,-88.5,37,-84.75",84:"38.5,-84.75,37.75,-82.875",85:"38.5,-82.875,37.75,-81",86:"37.75,-84.75,37,-82.875",87:"37.75,-82.875,37,-81",88:"43,-81,41.5,-77.25",89:"43,-77.25,41.5,-73.5",90:"41.5,-81,40,-77.25",91:"41.5,-77.25,40.75,-75.375",92:"41.5,-75.375,40.75,-73.5",93:"40.75,-77.25,40,-75.375",94:"40.75,-75.375,40.375,-74.4375",95:"40.75,-74.4375,40.375,-73.5",96:"40.375,-75.375,40,-74.4375",97:"40.375,-74.4375,40,-73.5",98:"43,-73.5,42.25,-71.625",99:"43,-71.625,42.25,-69.75",100:"42.25,-73.5,41.5,-71.625",101:"42.25,-71.625,41.5,-69.75",102:"43,-69.75,41.5,-66",103:"41.5,-73.5,40,-69.75",104:"41.5,-69.75,40,-66",105:"40,-81,38.5,-77.25",106:"40,-77.25,39.25,-75.375",107:"40,-75.375,39.25,-73.5",108:"39.25,-77.25,38.875,-76.3125",109:"39.25,-76.3125,38.875,-75.375",110:"38.875,-77.25,38.5,-76.3125",111:"38.875,-76.3125,38.5,-75.375",112:"39.25,-75.375,38.5,-73.5",113:"38.5,-81,37,-77.25",114:"38.5,-77.25,37,-73.5",115:"40,-73.5,37,-66",116:"37,-126,34,-118.5",117:"37,-118.5,35.5,-114.75",118:"37,-114.75,35.5,-111",119:"35.5,-118.5,34,-114.75",120:"35.5,-114.75,34,-111",121:"34,-126,31,-118.5",122:"34,-118.5,33.25,-116.625",123:"34,-116.625,33.25,-114.75",124:"33.25,-118.5,32.5,-116.625",125:"33.25,-116.625,32.5,-114.75",126:"34,-114.75,32.5,-111",127:"32.5,-118.5,31,-114.75",128:"32.5,-114.75,31,-111",129:"37,-111,35.5,-107.25",130:"37,-107.25,35.5,-103.5",131:"35.5,-111,34,-107.25",132:"35.5,-107.25,34,-103.5",133:"37,-103.5,34,-96",134:"34,-111,31,-103.5",135:"34,-103.5,31,-96",136:"31,-126,25,-111",137:"31,-111,28,-103.5",138:"31,-103.5,29.5,-99.75",139:"31,-99.75,29.5,-96",140:"29.5,-103.5,28,-99.75",141:"29.5,-99.75,28,-96",142:"28,-111,25,-103.5",143:"28,-103.5,25,-96",144:"37,-96,34,-88.5",145:"37,-88.5,35.5,-84.75",146:"37,-84.75,35.5,-81",147:"35.5,-88.5,34,-84.75",148:"35.5,-84.75,34,-81",149:"34,-96,31,-88.5",150:"34,-88.5,32.5,-84.75",151:"34,-84.75,32.5,-81",152:"32.5,-88.5,31,-84.75",153:"32.5,-84.75,31,-81",154:"37,-81,35.5,-77.25",155:"37,-77.25,35.5,-73.5",156:"35.5,-81,34,-77.25",157:"35.5,-77.25,34,-73.5",158:"37,-73.5,34,-66",159:"34,-81,31,-73.5",160:"34,-73.5,31,-66",161:"31,-96,29.5,-92.25",162:"31,-92.25,29.5,-88.5",163:"29.5,-96,28,-92.25",164:"29.5,-92.25,28,-88.5",165:"31,-88.5,29.5,-84.75",166:"31,-84.75,29.5,-81",167:"29.5,-88.5,28,-84.75",168:"29.5,-84.75,28,-81",169:"28,-96,25,-88.5",170:"28,-88.5,25,-81",171:"31,-81,25,-66"};window.ECSnd2MobiStaticTxt="{0}: {1}, {2}, {3}";window.UserSnd2MobiStaticTxt="{0}: {1}";window.MapViewMailTemplate="mailto:?subject="+escape("Let's hit the road!")+"&body="+escape('Plan a road trip, plus find and share points of interest throughout the United States, at "Appetite for Life".');window.PushPinMailTemplate="mailto:?subject={0}&body="+escape("Check out ")+"{0}"+escape(' and more on "Appetite for Life", starring Andrew Zimmern.');window.SndMobiTerm="Please check this box to accept the <a href='http://tou.live.com/help.aspx?project=tou&market=en-us' target='_blank'>Terms of Service</a>. Std msg charges apply. By submitting the phone number you acknowledge you are the acct holder or have acct holder's permission to do so. To cancel text STOP or for help text HELP to 46676. <a href='http://go.microsoft.com/fwlink/?LinkId=74170'  target='_blank'>Privacy Policy</a>";window.MapApiLoaded=false;window.SendMobileFeedBack={100:"A text message has been sent to your phone.",200:"The phone number you entered is invalid.",201:"The page you requested has expired.",202:"You've sent the maximum number of messages allowed. <br/><br/>Please try again tomorrow.","default":"We are experiencing technical difficulties. Please try again later."};function OnLiveMapApiLoaded(){window.setTimeout("window.MapApiLoaded = true;",1000)}$.ajaxSetup({cache:true});window.BeetLiveMap={SendMeASign:function(a){bMapShow=true;if(window.BeetLiveMap.DynamicLoadJs==null)window.setTimeout("window.BeetLiveMap.SendMeASign('"+a+"')",500);else{BeetLiveMap.bOutSideSign=true;window.BeetLiveMap.DynamicLoadJs(a)}},bOutSideSign:true,bMapLoaded:false,DynamicLoadJs:function(a){if(BeetLiveMap.isJsLoaded()&&BeetLiveMap.bOutSideSign)BeetLiveMap.OnMapApiLoaded(a);else window.setTimeout("BeetLiveMap.DynamicLoadJs('"+a+"')",500)},isJsLoaded:function(){return window.MapApiLoaded},OnMapApiLoaded:function(){},SelectPinsMap:{},SelectPins:[],DirectionSpereChar:"|",LatLonSplitChar:",",IDParaSplitChar:":",siteDomain:null,UserPinIcon:staticImgPath+"UserIcon.gif",ECPintIcon:staticImgPath+"FeaturedIcon.gif",CityPinIcon:staticImgPath+"CityIcon.gif",ToyotaPinsLayer:null,UserPinsLayer:null,CityPinsLayer:null,map:null,CustomRouteManager:null,MapExtent:null,PinsManager:null,PinsZoneLoaded:null,CurrentZones:null,CurrentDeepLinkShape:null,ZonesExtent:{},GetZoneID:function(b,c){for(var a in this.ZonesExtent)if(this.ZonesExtent[a].bPtInEnvelope(b,c))return "u_"+a;return "u_unknow"},InitMap:function(f,e){window.Extent=new VELatLongRectangle(new VELatLong(49,-126),new VELatLong(25,-66));var c=e;this.UrlParameters["maptype"]="road";switch(c.charAt(0).toLowerCase()){case "d":var a=c.substr(2).split(this.IDParaSplitChar);this.UrlParameters["direction"]=a[0];if(a.length>1)this.UrlParameters["routeoptimize"]=a[1];if(a.length>2)this.UrlParameters["usetraffic"]=a[2];if(a.length>3)this.UrlParameters["maptype"]=a[3];if(a.length>4)this.UrlParameters["mapcenter"]=a[4];if(a.length>5)this.UrlParameters["zoomlevel"]=a[5];if(a.length>6)this.UrlParameters["srcSection"]=a[6];if(a.length>7)this.UrlParameters["srcArticle"]=a[7];break;case "m":var a=c.substr(2).split(this.DirectionSpereChar);this.UrlParameters["mapcenter"]=a[0];this.UrlParameters["zoomlevel"]=a[1];if(a.length>2)this.UrlParameters["maptype"]=a[2];break;default:var a=c.split(this.IDParaSplitChar);this.UrlParameters["shapeid"]=a[0];if(a.length>1)this.UrlParameters["maptype"]=a[1];if(a.length>2)this.UrlParameters["mapcenter"]=a[2];if(a.length>3)this.UrlParameters["zoomlevel"]=a[3]}this.PinsManager={};this.ZonesExtent={};this.MapExtentLimite=new VELatLongRectangle(new VELatLong(66,-152),new VELatLong(17,-45));this.PinsZoneLoaded={addpintozone:function(a,c,b){if(this[a]==null)this[a]={};this[a][c]=b}};this.siteDomain=window.location.href.split("/")[2];this.ToyotaPinsLayer=new VEShapeLayer;this.UserPinsLayer=new VEShapeLayer;this.CityPinsLayer=new VEShapeLayer;this.map=new VEMap(f);for(var d in window.BeetMapTile){var b=window.BeetMapTile[d].split(",");this.ZonesExtent["tile"+d]=new VELatLongRectangle(new VELatLong(b[0],b[1]),new VELatLong(b[2],b[3]))}},LoadMap:function(){this.map.AttachEvent("onchangeview",this.OnMapChanged);this.map.AttachEvent("onclick",this.OnMapClick);this.map.AttachEvent("onerror",ShowMapFailedMessage);this.map.AttachEvent("ontokenerror",ShowMapFailedMessage);this.map.AttachEvent("ontokenexpire",ShowMapFailedMessage);var b=this.UrlParameters["mapcenter"],c=this.UrlParameters["zoomlevel"],d=false,e=this.UrlParameters["maptype"]!="aerial"?VEMapStyle.Road:VEMapStyle.Aerial;if(b!=null&c!=null){this.bDeepLinkEventNeeded=true;this.OnDeepLinkingStar();var a=b.split(this.LatLonSplitChar);if(a.length==2){d=true;this.map.SetClientToken(VEServiceToken);this.map.LoadMap(new VELatLong(a[0],a[1]),parseInt(c),e)}}if(!d){this.map.SetClientToken(VEServiceToken);this.map.LoadMap(new VELatLong(DefaultMapView.lat,DefaultMapView.lon),DefaultMapView.zoomlevel,e)}this.map.AddShapeLayer(this.ToyotaPinsLayer);this.map.AddShapeLayer(this.UserPinsLayer);this.map.AddShapeLayer(this.CityPinsLayer);this.DeepLink();this.CallToAddPins("xmlHandler.ashx?mode=RetrieveCityPins",null,this.ParseCityPins);this.bMapLoaded=true},MapExtentLimite:null,MaxZoomLevelLimite:-1,MinZoomLevelLimite:1,OnMapChanged:function(){if(BeetLiveMap.bDeepLinkEventNeeded){BeetLiveMap.onEndDeepLinking();BeetLiveMap.bDeepLinkEventNeeded=false}},AddPins:function(){this.CurrentZones=this.GetCurrentZoneIDs();for(var a=0;a<this.CurrentZones.length;a++)this.AddPinsByZone(this.CurrentZones[a])},OnMapClick:function(){},OnDeepLinkingStar:function(){},UrlParameters:{},bDeepLinkEventNeeded:false,DeepLink:function(){var d=null,e=null,l=null,h=null,p=null,f=null,g=null;if(arguments[0]!=null)switch(arguments[0].charAt(0).toLowerCase()){case "d":var b=arguments[0].substr(2).split(this.IDParaSplitChar);e=b[0];l=b[b.length-2];if(l=="FeaturedTrip")h=b[b.length-1];if(b.length>1)f=b[1];if(b.length>2)g=b[2];if(b.length>3)this.UrlParameters["maptype"]=b[3];if(b.length>6)this.UrlParameters["srcSection"]=b[6];if(b.length>7)this.UrlParameters["srcArticle"]=b[7];break;case "m":var b=arguments[0].substr(2).split(this.DirectionSpereChar),m=b[0],n=b[1],o=b[2]!="aerial"?VEMapStyle.Road:VEMapStyle.Aerial;if(m!=null&n!=null){this.bDeepLinkEventNeeded=true;this.OnDeepLinkingStar();var i=m.split(this.LatLonSplitChar);if(i.length==2)this.map.SetCenterAndZoom(new VELatLong(i[0],i[1]),parseInt(n));this.map.SetMapStyle(o)}return;break;default:var b=arguments[0].split(this.IDParaSplitChar);d=b[0];this.UrlParameters["maptype"]=b[1]}else{d=this.UrlParameters["shapeid"];e=this.UrlParameters["direction"];p=this.UrlParameters["printpins"];f=this.UrlParameters["routeoptimize"];g=this.UrlParameters["usetraffic"];l=this.UrlParameters["srcSection"];h=this.UrlParameters["srcArticle"]}if(this.UrlParameters["maptype"]!=null){var o=this.UrlParameters["maptype"]!="aerial"?VEMapStyle.Road:VEMapStyle.Aerial;this.map.SetMapStyle(o)}if(d!=null||e!=null)this.OnDeepLinkingStar();if(d!=null){d=d.toLowerCase();if(this.PinsManager[d]==null)switch(d.substr(0,1).toLowerCase()){case "u":BeetLiveMap.CallToAddUserPin("xmlHandler.ashx?mode=RetrieveUserPin&id="+d.substr(2),null,this.DoDeepLink);break;case "c":BeetLiveMap.CallToAddCityPin("xmlHandler.ashx?mode=RetrieveCityPin&id="+d.substr(2),null,this.DoDeepLink);break;case "e":BeetLiveMap.CallToAddECPin("xmlHandler.ashx?mode=RetrieveEditorPin&id="+d.substr(2),null,this.DoDeepLink)}else{var r=d.substr(0,1).toLowerCase()=="c"?false:true;BeetLiveMap.DoDeepLink(this.PinsManager[d],r)}}if(e!=null){if(DirectionStatus)SwitchGetDirectionPanelStyles(false);e=unescape(e);var j=[],s=/(-?\d+)(\.\d+)?,(-?\d+)(\.\d+)?/,b=e.split(BeetLiveMap.DirectionSpereChar);for(var k in b)if(s.test(b[k])){var i=b[k].split(BeetLiveMap.LatLonSplitChar);j.push(new VELatLong(i[0],i[1]))}else j.push(b[k]);f=f==null?"":f;g=g==null?"":g;var c=new VERouteOptions;c.DrawRoute=true;c.SetBestMapView=true;c.RouteCallback=this.ShowTurns;c.DistanceUnit=VERouteDistanceUnit.Mile;c.ShowDisambiguation=false;c.RouteOptimize=f.toLowerCase()=="minimizetime"?VERouteOptimize.MinimizeTime:VERouteOptimize.MinimizeDistance;c.UseTraffic=g.toLowerCase()=="true"?true:false;this.OnNewDirectionArrive(j,c.RouteOptimize,c.UseTraffic);$("#preLoaderPanel").show();$("#routeSelection").hide();$("#routeTitle").hide();$("#routeloadingPanel").show();var a="";if(h!=null){var q=staticJSPath+h+".js";switch(h){case "TripArticle_1":if(typeof _f1240415648720!="undefined")a=_f1240415648720();break;case "TripArticle_2":if(typeof _f1240928821158!="undefined")a=_f1240928821158();break;case "TripArticle_3":if(typeof _f1240449984761!="undefined")a=_f1240449984761();break;case "TripArticle_4":if(typeof _f1240928386601!="undefined")a=_f1240928386601();break;case "TripArticle_5":if(typeof _f1240930312255!="undefined")a=_f1240930312255();break;case "TripArticle_6":if(typeof _f1240928705565!="undefined")a=_f1240928705565();break;case "TripArticle_7":if(typeof _f1240929320226!="undefined")a=_f1240929320226();break;case "TripArticle_8":if(typeof _f1240929051060!="undefined")a=_f1240929051060();break;case "TripArticle_9":if(typeof _f1240416347733!="undefined")a=_f1240416347733();break;case "TripArticle_10":if(typeof _f1240416077345!="undefined")a=_f1240416077345();break;case "TripArticle_11":if(typeof _f1240929540854!="undefined")a=_f1240929540854();break;default:a=""}if(a!=null&&a!=""){c.ShowErrorMessages=false;BeetLiveMap.CustomRouteManager=new StaticRouteManager(BeetLiveMap.map);BeetLiveMap.CustomRouteManager.ProcessRoute(a,c)}else $.getScript(q,function(){try{switch(h){case "TripArticle_1":a=_f1240415648720();break;case "TripArticle_2":a=_f1240928821158();break;case "TripArticle_3":a=_f1240449984761();break;case "TripArticle_4":a=_f1240928386601();break;case "TripArticle_5":a=_f1240930312255();break;case "TripArticle_6":a=_f1240928705565();break;case "TripArticle_7":a=_f1240929320226();break;case "TripArticle_8":a=_f1240929051060();break;case "TripArticle_9":a=_f1240416347733();break;case "TripArticle_10":a=_f1240416077345();break;case "TripArticle_11":a=_f1240929540854();break;default:a=""}}catch(e){a=""}if(a!=null&&a!=""){c.ShowErrorMessages=false;BeetLiveMap.CustomRouteManager=new StaticRouteManager(BeetLiveMap.map);BeetLiveMap.CustomRouteManager.ProcessRoute(a,c)}else BeetLiveMap.map.GetDirections(j,c)})}else BeetLiveMap.map.GetDirections(j,c)}},bDirectionOnMap:false,ShowTurns:function(){BeetLiveMap.bDirectionOnMap=true;BeetLiveMap.onEndDeepLinking()},DeleteRoute:function(){BeetLiveMap.map.DeleteRoute();if(BeetLiveMap.CustomRouteManager)BeetLiveMap.CustomRouteManager.ClearRoute();BeetLiveMap.bDirectionOnMap=false},OnNewDirectionArrive:function(){},DoDeepLink:function(a,b){if(DirectionStatus)SwitchGetDirectionPanelStyles(false);$(".routestop").each(function(){$(this).remove()});$("#routeStep > div > span").each(function(a){$(this).html(IndexArray[a])});$("#routeStep > div > div > input").each(function(){$(this).val("")});BeetLiveMap.DeleteRoute();BeetLiveMap.map.DetachEvent("onendpan",BeetLiveMap.onEndPan);BeetLiveMap.map.HideInfoBox();$("#thankPanel").hide();$("#myMap_vemessagepanel").hide();BeetLiveMap.CurrentDeepLinkShape=a;BeetLiveMap.map.AttachEvent("onendpan",BeetLiveMap.onEndPan);BeetLiveMap.ZoomToShape(a,b);BeetLiveMap.onEndDeepLinking()},onEndDeepLinking:function(){},onEndPan:function(){BeetLiveMap.map.DetachEvent("onendpan",BeetLiveMap.onEndPan);BeetLiveMap.onEndDeepLinking();if(BeetLiveMap.CurrentDeepLinkShape==null)return},ZoomToShape:function(a,b){if(a==null)return;BeetLiveMap.map.SetCenterAndZoom(a.GetPoints()[0],12);if(b)window.setTimeout(function(){if(bMapShow&&!bNavagtebarisOpen)BeetLiveMap.map.ShowInfoBox(a)},1000)},AddPinsByZone:function(a){if(this.PinsZoneLoaded[a]==null&&this.map.GetZoomLevel()>=(BeetLiveMap.MaxECPinZoomLevel<BeetLiveMap.MaxUserPinZoomLevel?BeetLiveMap.MaxECPinZoomLevel:BeetLiveMap.MaxUserPinZoomLevel)){this.PinsZoneLoaded[a]={};this.AddMergePinsByZone(a)}},AddMergePinsByZone:function(a){this.CallToAddPins("xmlHandler.ashx?mode=RetrieveToyotaPins&set="+a,a,this.ParseMergerPins)},CallToAddPins:function(c,a,b){$.get(c,null,function(d){var e=false;$(d).find("error").each(function(){e=true});if(e)BeetLiveMap.CallBackUpPlan(c);else $(d).find("Pin").each(function(){if(b!=null)b(this)});if(a!=null&&BeetLiveMap.PinsZoneLoaded[a]==null)BeetLiveMap.PinsZoneLoaded[a]={}})},CallBackUpPlan:function(b){b=b.toLowerCase();var f=b.split("?"),d=f[1].split("&"),a={};for(var c=0;c<d.length;++c){var e=d[c].split("=");a[e[0]]=e[1]}switch(a["mode"]){case "retrievecitypins":BeetLiveMap.CallToAddPins(BackUpPath+"RetrieveCityPins.xml",null,BeetLiveMap.ParseCityPins);break;case "retrievetoyotapins":this.CallToAddPins(BackUpPath+"RetrieveToyotaPins_"+a["set"],a["set"],BeetLiveMap.ParseMergerPins);break;case "retrieveuserpin":BeetLiveMap.CallToAddUserPin(BackUpPath+"RetrieveUserPin.xml",null,BeetLiveMap.DoDeepLink);break;case "retrievecitypin":BeetLiveMap.CallToAddCityPin(BackUpPath+"RetrieveCityPin_"+a["id"]+".xml",null,BeetLiveMap.DoDeepLink);break;case "retrieveeditorpin":BeetLiveMap.CallToAddECPin(BackUpPath+"RetrieveEditorPin.xml",null,BeetLiveMap.DoDeepLink)}},ParseCityPins:function(a){var c=$(a).attr("location").split(","),d=new VELatLong(parseFloat(c[0]),parseFloat(c[1])),b=new VEShape(VEShapeType.Pushpin,d);b.SetDescription(BeetLiveMap.CityInfobox.format($(a).attr("name")+","+$(a).attr("state")));b.SetCustomIcon("<img src='"+BeetLiveMap.CityPinIcon+"' />");b.BeetPinID=$(a).attr("id").toLowerCase();BeetLiveMap.CityPinsLayer.AddShape(b);BeetLiveMap.PinsManager[$(a).attr("id").toLowerCase()]=b},ParseMergerPins:function(a){if(BeetLiveMap.PinsManager[$(a).attr("id").toLowerCase()]==null){var b=$(a).attr("id").toLowerCase().charAt(0);switch(b){case "e":BeetLiveMap.AddParseTxtToECPins(a);break;case "u":BeetLiveMap.AddParseTxtToUserPins(a)}}},MaxECPinZoomLevel:11,MaxUserPinZoomLevel:11,AddParseTxtToECPins:function(a){var d=unescape($(a).attr("location")).split(","),h=new VELatLong(parseFloat(d[0]),parseFloat(d[1])),b=new VEShape(VEShapeType.Pushpin,h),e=$(a).attr("address").toLowerCase()=="n/a"||$(a).attr("address")==""?"":$(a).attr("address")+", ",g=$(a).attr("city").toLowerCase()=="n/a"||$(a).attr("city")==""?"":$(a).attr("city")+", ",f=$(a).attr("state").toLowerCase()=="n/a"||$(a).attr("state")==""?"":$(a).attr("state"),c=e+g+f;c=trim(c,",");b.SetDescription(BeetLiveMap.EditorInfobox.format($(a).attr("name"),c,$(a).attr("phone"),$(a).text(),$(a).attr("id")));b.SetCustomIcon("<img src='"+BeetLiveMap.ECPintIcon+"' />");b.BeetPinID=$(a).attr("id").toLowerCase();b.SetMinZoomLevel(BeetLiveMap.MaxECPinZoomLevel);b.name=$(a).attr("name");b.address=$(a).attr("address");b.city=$(a).attr("city");b.state=$(a).attr("state");BeetLiveMap.ToyotaPinsLayer.AddShape(b);BeetLiveMap.PinsManager[$(a).attr("id").toLowerCase()]=b},AddParseTxtToUserPins:function(a){var d=unescape($(a).attr("location")).split(","),h=new VELatLong(parseFloat(d[0]),parseFloat(d[1])),b=new VEShape(VEShapeType.Pushpin,h),e=$(a).attr("address").toLowerCase()=="n/a"||$(a).attr("address")==""?"":$(a).attr("address")+", ",g=$(a).attr("city").toLowerCase()=="n/a"||$(a).attr("city")==""?"":$(a).attr("city")+", ",f=$(a).attr("state").toLowerCase()=="n/a"||$(a).attr("state")==""?"":$(a).attr("state"),c=e+g+f;c=trim(c,",");b.SetDescription(BeetLiveMap.UserInfobox.format($(a).attr("name"),$(a).text(),$(a).attr("id"),c));b.SetCustomIcon("<img src='"+BeetLiveMap.UserPinIcon+"' />");b.BeetPinID=$(a).attr("id").toLowerCase();b.name=$(a).attr("name");b.city=$(a).attr("city");b.SetMinZoomLevel(BeetLiveMap.MaxUserPinZoomLevel);BeetLiveMap.UserPinsLayer.AddShape(b);BeetLiveMap.PinsManager[$(a).attr("id").toLowerCase()]=b},AddECPinsByZone:function(a){this.CallToAddECPin("xmlHandler.ashx?mode=RetrieveToyotaPins&set="+a,a)},CallToAddECPin:function(b,c,a){$.get(b,null,function(c){var d=false;$(c).find("error").each(function(){d=true});if(d)BeetLiveMap.CallBackUpPlan(b);else $(c).find("Pin").each(function(){var b;if(BeetLiveMap.PinsManager[$(this).attr("id").toLowerCase()]==null){var d=$(this).attr("location").split(","),h=new VELatLong(parseFloat(d[0]),parseFloat(d[1]));b=new VEShape(VEShapeType.Pushpin,h);var e=$(this).attr("address").toLowerCase()=="n/a"||$(this).attr("address")==""?"":$(this).attr("address")+", ",g=$(this).attr("city").toLowerCase()=="n/a"||$(this).attr("city")==""?"":$(this).attr("city")+", ",f=$(this).attr("state").toLowerCase()=="n/a"||$(this).attr("state")==""?"":$(this).attr("state"),c=e+g+f;c=trim(c,",");b.SetDescription(BeetLiveMap.EditorInfobox.format($(this).attr("name"),c,$(this).attr("phone"),$(this).text(),$(this).attr("id")));b.SetCustomIcon("<img src='"+BeetLiveMap.ECPintIcon+"' />");b.BeetPinID=$(this).attr("id").toLowerCase();b.name=$(this).attr("name");b.address=$(this).attr("address");b.city=$(this).attr("city");b.state=$(this).attr("state");BeetLiveMap.ToyotaPinsLayer.AddShape(b);BeetLiveMap.PinsManager[$(this).attr("id").toLowerCase()]=b}else b=BeetLiveMap.PinsManager[$(this).attr("id").toLowerCase()];if(a!=null)a(b,true)})})},AddUserPinsByZone:function(a){this.CallToAddUserPin("xmlHandler.ashx?mode=RetrieveUserPins&set="+a,a)},CallToAddUserPin:function(c,a,b){$.get(c,null,function(d){var e=false;$(d).find("error").each(function(){e=true});if(e)BeetLiveMap.CallBackUpPlan(c);else $(d).find("Pin").each(function(){if(BeetLiveMap.PinsManager[$(this).attr("id").toLowerCase()]==null){var e=$(this).attr("location").split(","),i=new VELatLong(parseFloat(e[0]),parseFloat(e[1])),c=new VEShape(VEShapeType.Pushpin,i),f=$(this).attr("address").toLowerCase()=="n/a"||$(this).attr("address")==""?"":$(this).attr("address")+", ",h=$(this).attr("city").toLowerCase()=="n/a"||$(this).attr("city")==""?"":$(this).attr("city")+", ",g=$(this).attr("state").toLowerCase()=="n/a"||$(this).attr("state")==""?"":$(this).attr("state"),d=f+h+g;d=trim(d,", ");c.SetDescription(BeetLiveMap.UserInfobox.format($(this).attr("name"),$(this).text(),$(this).attr("id"),d));c.SetCustomIcon("<img src='"+BeetLiveMap.UserPinIcon+"' />");c.BeetPinID=$(this).attr("id").toLowerCase();c.SetMinZoomLevel(BeetLiveMap.MaxUserPinZoomLevel);c.name=$(this).attr("name");c.city=$(this).attr("city");BeetLiveMap.UserPinsLayer.AddShape(c);BeetLiveMap.PinsManager[$(this).attr("id").toLowerCase()]=c;if(a!=null)BeetLiveMap.PinsZoneLoaded.addpintozone(a,$(this).attr("id").toLowerCase(),c)}if(b!=null)b(BeetLiveMap.PinsManager[$(this).attr("id").toLowerCase()],true)});if(a!=null&&BeetLiveMap.PinsZoneLoaded[a]==null)BeetLiveMap.PinsZoneLoaded[a]={}})},CallToAddCityPin:function(c,b,a){$.get(c,null,function(d){var e=false;$(d).find("error").each(function(){e=true});if(e)BeetLiveMap.CallBackUpPlan(c);else $(d).find("Pin").each(function(){if(BeetLiveMap.PinsManager[$(this).attr("id").toLowerCase()]==null){var d=$(this).attr("location").split(","),e=new VELatLong(parseFloat(d[0]),parseFloat(d[1])),c=new VEShape(VEShapeType.Pushpin,e);c.SetDescription(BeetLiveMap.CityInfobox.format($(this).attr("name")+","+$(this).attr("state")));c.SetCustomIcon("<img src='"+BeetLiveMap.CityPinIcon+"' />");c.BeetPinID=$(this).attr("id").toLowerCase();BeetLiveMap.CityPinsLayer.AddShape(c);BeetLiveMap.PinsManager[$(this).attr("id").toLowerCase()]=c;if(b!=null)BeetLiveMap.PinsZoneLoaded.addpintozone(b,$(this).attr("id").toLowerCase(),c)}if(a!=null)a(BeetLiveMap.PinsManager[$(this).attr("id").toLowerCase()],false)})})},AddPinByID:function(a,b){a=a.toLowerCase();if(this.PinsManager[a]==null)if(a.indexOf("ec")>-1)return this.AddECPinByID(a,b);else return this.AddUserPinByID(a,b);else if(b!=null)b(this.PinsManager[a])},AddECPinByID:function(b,a){this.CallToAddECPin("xmlHandler.ashx?mode=RetrieveToyotaPin&id="+b,null,a)},AddUserPinByID:function(b,a){this.CallToAddUserPin("xmlHandler.ashx?mode=RetrieveUserPin&id="+b,null,a)},UserInfobox:"<div id='infoBoxWrapper'>"+"<div id='infoBoxContent'>"+"<div id='infoBoxHeader'><span>&nbsp;&nbsp;&nbsp;&nbsp;USER SUBMITTED LOCATION</span></div>"+"<div id='infoBoxHeaderWrapper' >"+"<div id='infoBoxHeaderContainer' >"+"<div id='userInfoBoxThumb' ></div>"+"<div id='infoBoxTopDiv'>"+"<div id='infoBoxTitle' >{0}</div>"+"<div id='infoBoxAddr' >{3}</div>"+"<div id='infoBoxPhone' ></div>"+"</div>"+"<div id='infoBoxDesc' >{1}</div>"+"<div style='width:100%; float:left;'>&nbsp;</div>"+"</div>"+"</div>"+"<div style='position:relative;z-index:2;clear:both;'>"+"<div id='infoBoxReportAbuse' onclick=\"ReportAbuse('{2}');\">&nbsp;</div>"+'<div class="rptrbsfedbk" id="rptrbsfedbk_{2}">'+'<div class="rptrbsfedbkTitle">Thank you!</div>'+'<div class="rptrbsfedbkBdy">This item has been reported to the administrator.</div>'+"</div>"+"</div>"+"<div id='infoBoxFooterWrapper' >"+"<div id='infoBoxFooter' >"+"<div id='infoSendToMobile' onclick=\"$('#infoBoxFooterWrapper').css('z-index',8);showSendMobiPanel('{2}');\" style=\"cursor:pointer;\">&nbsp;</div> "+"<div id='infoSendToEmail' onclick='SendToEmail(\"{2}\")' style=\"cursor:pointer;\">&nbsp;</div> "+"</div>"+'<div class="sendtomobilewrapp" id="sndmobiwrapp_{2}">'+'<div class="sendmobilehead"></div>'+'<div class="sendmobilebody">'+"<span>Enter your mobile number and we'll send this location to your phone.</span>"+'<span>+1 <input id="mobiarea_{2}" onkeyup="isSnedMobiReady(\'{2}\');" onkeypress="return CheckInputDataDigite(event,value,3,this,\'mobiprefix_{2}\');" type="text" style="width:40px;" /> - <input id="mobiprefix_{2}" onkeyup="isSnedMobiReady(\'{2}\');" onkeypress="return CheckInputDataDigite(event,value,3,this,\'mobisuffix_{2}\');" type="text" style="width:40px;"/> - <input id="mobisuffix_{2}" onkeyup="isSnedMobiReady(\'{2}\');" onkeypress="return CheckInputDataDigite(event,value,4,this);" type="text" style="width:55px;"/><a id="mobisendbtn_{2}" class=\'disablelikecss\' href="javascript:SndToFrdByMobi(\'{2}\');">SEND</a></span>'+"</div>"+'<div class="sendmobilefoot">'+'<input id="sendmoblieterm_{2}" onclick="isSnedMobiReady(\'{2}\');"  type="checkbox"  style="float:left;"/> <div style="float:right;width:90%;text-align:left;">'+SndMobiTerm+"</div>"+"</div>"+"</div>"+'<div class="sndmobiinfo" id="sndmobiinfo_{2}">'+'<div class="sendmobilehead"></div>'+'<div class="sndmobiinfoBody" id="sndmobiinfoBody_{2}">'+'<div class="sndmobiinfotitle">Succeed</div>'+'<div class="sndmobiinfoDesc">your message had been send</div>'+"</div>"+"</div>"+"</div>"+"</div>"+"</div>",UnApprovedUserInfobox:"<div id='infoBoxWrapper'>"+"<div id='infoBoxContent'>"+"<div id='infoBoxHeader'><span>&nbsp;&nbsp;&nbsp;&nbsp;USER SUBMITTED LOCATION</span></div>"+"<div id='infoBoxHeaderWrapper' >"+"<div id='infoBoxHeaderContainer' >"+"<div id='userInfoBoxThumb' ></div>"+"<div id='infoBoxTopDiv'>"+"<div id='infoBoxTitle' >{0}</div>"+"<div id='infoBoxAddr' >{3}</div>"+"<div id='infoBoxPhone' ></div>"+"</div>"+"<div id='infoBoxDesc' >{1}</div>"+"<div style='width:100%'>&nbsp;</div>"+"</div>"+"</div>"+"<div style='width:5px;float:left; height:1px;'>&nbsp;</div>"+"<div style='width:5px;float:left;'>&nbsp;</div>"+"</div>"+"<div style='height:5px;width:5px;'>&nbsp;</div>"+"</div>",EditorInfobox:"<div id='infoBoxWrapper'>"+"<div id='infoBoxContent'>"+"<div id='infoBoxHeader'><span>&nbsp;&nbsp;&nbsp;&nbsp;FEATURED LOCATION</span></div>"+"<div id='infoBoxHeaderWrapper' >"+"<div id='infoBoxHeaderContainer' >"+"<div id='editorInfoBoxThumb' ></div>"+"<div id='infoBoxTopDiv'>"+"<div id='infoBoxTitle' >{0}</div>"+"<div id='infoBoxAddr' >{1}</div>"+"<div id='infoBoxPhone' >{2}</div>"+"</div>"+"<div id='infoBoxDesc' >{3}</div>"+"<div style='width:100%; float:left;'>&nbsp;</div>"+"</div>"+"</div>"+"<div id='infoBoxFooterWrapper' >"+"<div id='infoBoxFooter' >"+"<div id='infoSendToMobile' onclick=\"javascript:showSendMobiPanel('{4}')\" style=\"cursor:pointer;\">&nbsp;</div> <div id='infoSendToEmail'  onclick='SendToEmail(\"{4}\")' style=\"cursor:pointer;\">&nbsp;</div><div id='infoSendToDirections' onclick=\"Msn.WebAddress.GetSwfObj('ToyotaSWF').TrackSend('Atlas_147','','','{0}');SendToDirections('{1}')\" style=\"cursor:pointer;\">&nbsp;</div>"+"</div>"+'<div class="sendtomobilewrapp" id="sndmobiwrapp_{4}">'+'<div class="sendmobilehead"></div>'+'<div class="sendmobilebody">'+"<span>Enter your mobile number and we'll send this location to your phone.</span>"+'<span>+1 <input id="mobiarea_{4}" onkeyup="isSnedMobiReady(\'{4}\');" onkeypress="return CheckInputDataDigite(event,value,3,this,\'mobiprefix_{4}\');" type="text" style="width:40px;" /> - <input id="mobiprefix_{4}" onkeyup="isSnedMobiReady(\'{4}\');" onkeypress="return CheckInputDataDigite(event,value,3,this,\'mobisuffix_{4}\');" type="text" style="width:40px;"/> - <input id="mobisuffix_{4}" onkeyup="isSnedMobiReady(\'{4}\');" onkeypress="return CheckInputDataDigite(event,value,4,this);" type="text" style="width:55px;"/><a id="mobisendbtn_{4}" class=\'disablelikecss\' href="javascript:SndToFrdByMobi(\'{4}\');">SEND</a></span>'+"</div>"+'<div class="sendmobilefoot">'+'<input id="sendmoblieterm_{4}" onclick="isSnedMobiReady(\'{4}\');" type="checkbox"  style="float:left;"/> <div style="float:right;width:90%;text-align:left;">'+SndMobiTerm+"</div>"+"</div>"+"</div>"+'<div class="sndmobiinfo" id="sndmobiinfo_{4}">'+'<div class="sendmobilehead"></div>'+'<div class="sndmobiinfoBody" id="sndmobiinfoBody_{4}">'+'<div class="sndmobiinfotitle">Succeed</div>'+'<div class="sndmobiinfoDesc">your message had been send</div>'+"</div>"+"</div>"+"</div>"+"</div>"+"</div>",CityInfobox:"<div id='infoBoxWrapper'>"+"<div style='padding:20px 0px 24px 10px;'>"+"{0}"+"</div>"+"</div>",GetCurrentZoneIDs:function(){if(this.MapExtent==null)return;var b=[];for(var a in this.ZonesExtent)if(this.ZonesExtent[a].intersectsBounds(this.MapExtent))b.push(a);return b},InitMapAPIExtension:function(){VELatLongRectangle.prototype.bottom=function(){return this.BottomRightLatLong.Latitude};VELatLongRectangle.prototype.right=function(){return this.BottomRightLatLong.Longitude};VELatLongRectangle.prototype.top=function(){return this.TopLeftLatLong.Latitude};VELatLongRectangle.prototype.left=function(){return this.TopLeftLatLong.Longitude};VELatLongRectangle.prototype.intersectsBounds=function(a,b){if(b==null)b=true;if(b)return !(this.bottom()>a.top()||a.bottom()>this.top()||this.left()>a.right()||a.left()>this.right());else return !(this.bottom()>=a.top()||a.bottom()>=this.top()||this.left()>=a.right()||a.left()>=this.right())};VELatLongRectangle.prototype.bPtInEnvelope=function(a,b){return b<this.right()&&b>this.left()&&a<this.top()&&a>this.bottom()};VELatLongRectangle.prototype.containsBounds=function(a,g,f){if(g==null)g=false;if(f==null)f=true;var d,e,c,b;if(f){d=a.left()>=this.left()&&a.left()<=this.right();e=a.top()>=this.bottom()&&a.top()<=this.top();c=a.right()>=this.left()&&a.right()<=this.right();b=a.bottom()>=this.bottom()&&a.bottom()<=this.top()}else{d=a.left()>this.left()&&a.left()<this.right();e=a.top()>this.bottom()&&a.top()<this.top();c=a.right()>this.left()&&a.right()<this.right();b=a.bottom()>this.bottom()&&a.bottom()<this.top()}return g?(e||b)&&(d||c):e&&d&&b&&c}}};function trim(b,a){return ltrim(rtrim(b,a),a)}function ltrim(b,a){a=a||"\\s";return b.replace(new RegExp("^["+a+"]+","g"),"")}function rtrim(b,a){a=a||"\\s";return b.replace(new RegExp("["+a+"]+$","g"),"")}function GetTime(c){if(c==null)return "";if(c>=60){var b=c%60,a=c-b;a=a/60;if(a>=60){var d=a%60,e=a-d;e=e/60;return e+" hr "+(d==0?"":d+" min ")+(b==0?"":b+" sec")}else return a+" min "+(b==0?"":b+" sec")}else return c+" sec"}function randomNum(){return Math.random()*.2-.1}function addPins(a,b,e,f,i,h,d,c){var j=new VELatLong(parseFloat(a),parseFloat(b)),g=BeetLiveMap.GetZoneID(a,b);$.post("xmlHandler.ashx?mode=SaveUserPin",{setname:stripHTML(g),name:stripHTML(e),location:stripHTML(a+","+b),address:stripHTML(f),phone:stripHTML(i),image:stripHTML(h),city:stripHTML(d),description:stripHTML(c)},function(f){var b=true;$(f).find("error").each(function(){b=false});if(b){var a=new VEShape(VEShapeType.Pushpin,j);a.SetDescription(BeetLiveMap.UnApprovedUserInfobox.format(stripHTML(e),stripHTML(c),"",stripHTML(d)));a.SetCustomIcon("<img src='"+BeetLiveMap.UserPinIcon+"' />");BeetLiveMap.UserPinsLayer.AddShape(a);$("#thankTitle").html("THANK YOU");$("#thankBody").html("We will review your submission within 48 hours.")}else{$("#thankTitle").html("SORRY");$("#thankBody").html("An error occurred during submission. Please try again.")}if(bMapShow)$("#thankPanel").fadeIn("def",function(){window.setTimeout('$("#thankPanel").fadeOut("def")',5000)})})}function stripHTML(b){if(b){var a=b;a=a.replace(/&(lt|gt);/g,function(b,a){return a=="lt"?"<":">"});var c=a.replace(/\<[^\>]+\>/g,"");return c}return ""}var bNavagtebarisOpen=false,bMapShow=false;function onWindowsResize(){if(this==document.body)if($.browser.msie&&parseInt($.browser.version)<7){if(document.body.clientWidth<1024&&$("#siteWrapper").width()<1024)$("#siteWrapper").width(1024);if(document.body.clientWidth>1024&&$("#siteWrapper").width()<document.body.clientWidth)$("#siteWrapper").width("100%")}if(BeetLiveMap.map)BeetLiveMap.map.HideInfoBox();return false}$(document).ready(function(){BeetLiveMap.bOutSideSign=false;window.onresize=onWindowsResize;onWindowsResize()});BeetLiveMap.OnMapApiLoaded=function(a){if(bMapShow){$("#mapContainer").show();init(a)}};function init(a){if(bMapShow)if(MapAPILoadSucceed){InitalizeMapFunctions();BeetLiveMap.InitMapAPIExtension();BeetLiveMap.InitMap("myMap",a);BeetLiveMap.LoadMap()}else ShowMapFailedMessage()}BeetLiveMap.OnMapChanged=function(){if(BeetLiveMap.bDeepLinkEventNeeded){BeetLiveMap.onEndDeepLinking();BeetLiveMap.bDeepLinkEventNeeded=false}BeetLiveMap.MapExtent=BeetLiveMap.map.GetMapView();BeetLiveMap.AddPins();if(BeetLiveMap.MinZoomLevelLimite!=-1)if(BeetLiveMap.map.GetZoomLevel()<BeetLiveMap.MinZoomLevelLimite){BeetLiveMap.map.SetZoomLevel(BeetLiveMap.MinZoomLevelLimite);return}if(BeetLiveMap.MaxZoomLevelLimite!=-1)if(BeetLiveMap.map.GetZoomLevel()>BeetLiveMap.MaxZoomLevelLimite){BeetLiveMap.map.SetZoomLevel(BeetLiveMap.MaxZoomLevelLimite);return}};BeetLiveMap.onEndDeepLinking=function(){$("#routeSelection").show();$("#routeTitle").show();$("#routeloadingPanel").hide();$("#preLoaderPanel").hide()};BeetLiveMap.OnNewDirectionArrive=function(b,a,d){$(".routestop").each(function(){$(this).remove()});$("#routeStep > div > span").each(function(a){$(this).html(IndexArray[a])});for(var c=0;c<b.length-2;++c)$("#routeAddTrip > a").click();$("#routeStep > div > div > input").each(function(a){$(this).val(b[a]);$(this).keypress(SubmitStops)});$("#TaskHost_Directions_Quickest").attr("checked",a==VERouteOptimize.MinimizeDistance?false:true);$("#TaskHost_Directions_Shortest").attr("checked",a==VERouteOptimize.MinimizeDistance?true:false);$("#routeUseTraffic").attr("checked",d)};BeetLiveMap.startplanning=function(){if(DirectionStatus)SwitchGetDirectionPanelStyles(false);$(".routestop").each(function(){$(this).remove()});$("#routeStep > div > span").each(function(a){$(this).html(IndexArray[a])});$("#routeStep > div > div > input").each(function(){$(this).val("")});BeetLiveMap.DeleteRoute();BeetLiveMap.map.DetachEvent("onendpan",BeetLiveMap.onEndPan);BeetLiveMap.map.HideInfoBox();$("#thankPanel").hide();$("#myMap_vemessagepanel").hide();sidebaranimate(true)};BeetLiveMap.show=function(a){bMapShow=true;if(!BeetLiveMap.bMapLoaded)init(a);else{sidebaranimate(false);$("#routeResult").html("");$("#routeStep > div > div > input").each(function(){$(this).val("");$(this).keypress(SubmitStops)});BeetLiveMap.DeleteRoute();if(BeetLiveMap.CustomRouteManager)BeetLiveMap.CustomRouteManager.ClearRoute();BeetLiveMap.DeepLink(a);$("#mapContainer").show()}};BeetLiveMap.hide=function(){bMapShow=false;$("#rightMenu > span").css("display","none");$("#rightMenu").hide();$("#rightMenu").fadeOut("def");if(DirectionStatus)SwitchGetDirectionPanelStyles(false);$(".routestop").each(function(){$(this).remove()});$("#routeStep > div > span").each(function(a){$(this).html(IndexArray[a])});$("#routeStep > div > div > input").each(function(){$(this).val("")});BeetLiveMap.DeleteRoute();if(BeetLiveMap.CustomRouteManager)BeetLiveMap.CustomRouteManager.ClearRoute();BeetLiveMap.map.DetachEvent("onendpan",BeetLiveMap.onEndPan);BeetLiveMap.map.HideInfoBox();$("#thankPanel").hide();$("#myMap_vemessagepanel").hide();$("#mapContainer").hide();BeetLiveMap.UrlParameters={}};BeetLiveMap.OnMapClick=function(a){if(a.leftMouseButton)CancelContextMenu();if(a.rightMouseButton){var d=a.mapX,c=a.mapY,e=new VEPixel(d,c),b=BeetLiveMap.map.PixelToLatLong(e);if(window.Extent.bPtInEnvelope(b.Latitude,b.Longitude)){if(c>352)c=352;$("#rightMenu").css("left",d);$("#rightMenu").css("top",c);$("#pinLocation").val(b.Latitude+","+b.Longitude);$("#pinTitle").val("MAX. LENGTH: 25 CHARACTERS");$("#pinCity").val("MAX. LENGTH: 25 CHARACTERS");$("#rightMenu > textarea").val("MAX. LENGTH: 600 CHARACTERS");$("#pinTitle, #pinCity, #pinDesc").each(function(){$(this).removeClass("bordred")});$("#rightMenu > span").css("display","none");$("#rightMenu").hide();$("#rightMenu").fadeIn("def")}}};function sidebaranimate(a){BeetLiveMap.map.HideInfoBox();$("#thankPanel").hide();if(a!=null)if(a==bNavagtebarisOpen)return;if(bNavagtebarisOpen){$("#routePanel").animate({width:"25px"},300);$("#routeMainPanel").hide();$("#routePanelWrapper").animate({width:"25px",marginLeft:"0px"},300);$("#routePanelSwitch").css("background-position","-355px -70px")}else{$("#routePanelWrapper").animate({width:"400px",marginLeft:"-375px"},300);$("#routeMainPanel").show();$("#routePanel").animate({width:"400px"},300);$("#routePanelSwitch").css("background-position","-380px -70px")}bNavagtebarisOpen=!bNavagtebarisOpen}function InitalizeMapFunctions(){$("#ToyotaLocations > ul > li > a").click(function(){var a=new VELatLong(parseFloat($(this).attr("latlong").split("|")[0]),parseFloat($(this).attr("latlong").split("|")[1]));map.SetCenterAndZoom(a,12)});$("button").mouseover(function(){$(this).toggleClass("buttonover")}).mouseout(function(){$(this).toggleClass("buttonover")});$("#userPinsChk").click(function(){if($("#userPinsChk").attr("checked"))BeetLiveMap.UserPinsLayer.Show();else BeetLiveMap.UserPinsLayer.Hide()});$("#toyotaPinsChk").click(function(){if($("#toyotaPinsChk").attr("checked"))BeetLiveMap.ToyotaPinsLayer.Show();else BeetLiveMap.ToyotaPinsLayer.Hide()});$("#routePanelSwitch").click(function(){if(bNavagtebarisOpen)Msn.WebAddress.GetSwfObj("ToyotaSWF").TrackSend("Atlas_140","","","");else Msn.WebAddress.GetSwfObj("ToyotaSWF").TrackSend("Atlas_139","","","");sidebaranimate()});$("#routeAddTrip > a").click(function(){if($("#routeStep > div > span").length>=19)$("#routeAddTrip > a").hide();$('<div class="routestop"><span></span><label>Stop:</label><div><input tabindex="1" onkeypress="SubmitStops();"/></div><a href="javascript:void(0);">&nbsp;</a></div>').insertBefore($("#routeEnd"));$("#routeStep > div > span").each(function(a){$(this).html(IndexArray[a])});$("#routeStep > div > a").click(function(){$(this).parent().remove();$("#routeStep > div > span").each(function(a){$(this).html(IndexArray[a])});$("#routeAddTrip > a").show()})});$("#routeGetDirection > #clearRoute").click(function(){$("#routeResult").html("");$("#routeStep > div > div > input").each(function(){$(this).val("")});BeetLiveMap.DeleteRoute();if(BeetLiveMap.CustomRouteManager)BeetLiveMap.CustomRouteManager.ClearRoute();return false});$("#routeGetDirection > #getRoute").click(function(){var c=[],b=true;$("#routeStep > div > div > input").each(function(){if($(this).val().length>0){$(this).removeClass("bordred");c.push(escape($(this).val()))}else{$(this).addClass("bordred");b=false}});if(!b)return;BeetLiveMap.DeleteRoute();Msn.WebAddress.GetSwfObj("ToyotaSWF").TrackSend("Atlas_179","","","");var a=new VERouteOptions;a.DrawRoute=true;a.SetBestMapView=true;a.RouteCallback=BeetLiveMap.ShowTurns;a.DistanceUnit=VERouteDistanceUnit.Mile;a.ShowDisambiguation=false;a.RouteOptimize=$("#TaskHost_Directions_Quickest").attr("checked")?VERouteOptimize.MinimizeTime:VERouteOptimize.MinimizeDistance;a.UseTraffic=$("#routeUseTraffic").attr("checked");BeetLiveMap.map.GetDirections(c,a);$("#preLoaderPanel").show();$("#routeSelection").hide();$("#routeTitle").hide();$("#routeloadingPanel").show();return false});$("#printbtn").click(function(){var a=BeetLiveMap.map.GetCenter();Msn.WebAddress.GetSwfObj("ToyotaSWF").TrackSend("Atlas_149",a.Latitude+BeetLiveMap.LatLonSplitChar+a.Longitude,"","");var b="";for(var d=0;d<BeetLiveMap.SelectPins.length;d++)if(BeetLiveMap.SelectPins[d].BeetPinID!=null)b+=BeetLiveMap.SelectPins[d].BeetPinID+BeetLiveMap.DirectionSpereChar;if(b.length>0)b=b.substring(0,b.length-1);if(BeetLiveMap.bDirectionOnMap){var c="",i=true,g="#routeStep > div > div > input";if(DirectionStatus)g="#routeStep > div > div";$(g).each(function(){var a=DirectionStatus?$(this).html():$(this).val();if(a==""){i=false;return}c+=a+BeetLiveMap.DirectionSpereChar});if(!i){alert("must input direction data");return}if(c.length>0)c=c.substring(0,c.length-1);var e=$("#TaskHost_Directions_Quickest").attr("checked")?"MinimizeTime":"MinimizeDistance",h=$("#routeUseTraffic").attr("checked"),j=BeetLiveMap.UrlParameters["srcSection"],f=BeetLiveMap.UrlParameters["srcArticle"];if(j&&f)window.open("Print.aspx?mapcenter="+a.Latitude+BeetLiveMap.DirectionSpereChar+a.Longitude+"&zoomlevel="+BeetLiveMap.map.GetZoomLevel()+"&direction="+c+"&PrintPins="+b+"&routeoptimize="+e+"&usetraffic="+h+"&maptype="+(BeetLiveMap.map.GetMapStyle()==VEMapStyle.Road?"road":"aerial")+"&srcArticle="+f,"ToyotaVenza","left=200,top=100,width=1024,height=800, toolbar=yes, menubar=no, scrollbars=yes, resizable=no,location=no, status=no");else window.open("Print.aspx?mapcenter="+a.Latitude+BeetLiveMap.DirectionSpereChar+a.Longitude+"&zoomlevel="+BeetLiveMap.map.GetZoomLevel()+"&direction="+c+"&PrintPins="+b+"&routeoptimize="+e+"&usetraffic="+h+"&maptype="+(BeetLiveMap.map.GetMapStyle()==VEMapStyle.Road?"road":"aerial"),"ToyotaVenza","left=200,top=100,width=1024,height=800, toolbar=yes, menubar=no, scrollbars=yes, resizable=no,location=no, status=no")}else window.open("Print.aspx?mapcenter="+a.Latitude+BeetLiveMap.DirectionSpereChar+a.Longitude+"&zoomlevel="+BeetLiveMap.map.GetZoomLevel()+"&PrintPins="+b+"&maptype="+(BeetLiveMap.map.GetMapStyle()==VEMapStyle.Road?"road":"aerial"),"ToyotaVenza","left=200,top=100,width=1024,height=800, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no")});$("#mailbtn").click(function(){var a="http://"+BeetLiveMap.siteDomain+"/default.aspx?section=",b=BeetLiveMap.map.GetCenter();if(BeetLiveMap.bDirectionOnMap){var c="",e=true,d="#routeStep > div > div > input";if(DirectionStatus)d="#routeStep > div > div";$(d).each(function(){var a=DirectionStatus?$(this).html():$(this).val();if(a==""){e=false;return}c+=a+BeetLiveMap.DirectionSpereChar});if(!e){alert("must input direction data");return}if(c.length>0)c=c.substring(0,c.length-1);var f=$("#TaskHost_Directions_Quickest").attr("checked")?"MinimizeTime":"MinimizeDistance",g=$("#routeUseTraffic").attr("checked");a+="hitTheRoad&id=d_"+c+BeetLiveMap.IDParaSplitChar+f+BeetLiveMap.IDParaSplitChar+g;a+=BeetLiveMap.IDParaSplitChar+(BeetLiveMap.map.GetMapStyle()==VEMapStyle.Road?"road":"aerial")+BeetLiveMap.IDParaSplitChar+b.Latitude+BeetLiveMap.LatLonSplitChar+b.Longitude+BeetLiveMap.IDParaSplitChar+BeetLiveMap.map.GetZoomLevel()}else{a+="hitTheRoad&id=m_"+b.Latitude+BeetLiveMap.LatLonSplitChar+b.Longitude+BeetLiveMap.DirectionSpereChar+BeetLiveMap.map.GetZoomLevel();a+=BeetLiveMap.DirectionSpereChar+(BeetLiveMap.map.GetMapStyle()==VEMapStyle.Road?"road":"aerial")}a+="&source=email";a=window.MapViewMailTemplate+" "+escape(a.replace(/ /g,"%20"));Msn.WebAddress.GetSwfObj("ToyotaSWF").TrackSend("Atlas_151",b.Latitude+BeetLiveMap.LatLonSplitChar+b.Longitude,"","");$(this).attr("href",a)});$("#pinTitle").focus(function(){if($("#pinTitle").val()=="MAX. LENGTH: 25 CHARACTERS")$("#pinTitle").val("")}).blur(function(){if($("#pinTitle").val()=="")$("#pinTitle").val("MAX. LENGTH: 25 CHARACTERS")});$("#pinCity").focus(function(){if($("#pinCity").val()=="MAX. LENGTH: 25 CHARACTERS")$("#pinCity").val("")}).blur(function(){if($("#pinCity").val()=="")$("#pinCity").val("MAX. LENGTH: 25 CHARACTERS")});$("#pinDesc").focus(function(){if($("#pinDesc").val()=="MAX. LENGTH: 600 CHARACTERS")$("#pinDesc").val("")}).blur(function(){if($("#pinDesc").val()=="")$("#pinDesc").val("MAX. LENGTH: 600 CHARACTERS")});$("#routeEditTrip").click(function(){if(BeetLiveMap.UrlParameters["srcSection"])BeetLiveMap.UrlParameters["srcSection"]="";if(BeetLiveMap.UrlParameters["srcArticle"])BeetLiveMap.UrlParameters["srcArticle"]="";SwitchGetDirectionPanelStyles(false)})}function SubmitStops(a){if(!a)var a=window.event;if(a.keyCode==13)$("#routeGetDirection > #getRoute").click()}var previousRouteStepID="",stopsStepID=[],IndexArray=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T"];BeetLiveMap.ShowTurns=function(j){if(j==null){BeetLiveMap.onEndDeepLinking();return}BeetLiveMap.bDirectionOnMap=true;var c="<div class='turnTitle'><span>Trip:</span><label>"+j.Distance.toFixed(1)+" mi, "+GetTime(j.Time)+"</label></div>",a=j.RouteLegs,f=null,l=0;if(a.length>=0&&a[0].Itinerary.Items.length>1)previousRouteStepID=a[0].Itinerary.Items[1].Shape.GetID();for(var b=0;b<a.length;b++){f=a[b];var m=b+1,n="Stop:";if(b==0)n="Start:";var i=$("#routeStep > div:eq("+b+") > div > input").val();c+="<DIV class='routeLegStops'><SPAN>"+IndexArray[b]+"</SPAN><LABEL>"+n+"</LABEL><DIV>"+i+"</DIV></DIV>";c+="<div class='turnTitle'><a href='javascript:void(0);'>"+IndexArray[m-1]+"-"+IndexArray[m]+"</a><label>"+f.Distance.toFixed(1)+" mi, "+GetTime(f.Time)+"</label></div>";var e=null,k=null;c+="<div class='turnLegPanel'>";for(var g=0;g<f.Itinerary.Items.length;g++){l++;var h=l-1;e=f.Itinerary.Items[g];if(g==0){if(b==0)h="Start";e.Shape.SetCustomIcon("<span class='routeStopIcon'>"+IndexArray[b]+"</span>");e.Shape.SetDescription(i)}else if(g==f.Itinerary.Items.length-1){if(b==a.length)h="Stop";if(b==a.length-1){e.Shape.SetCustomIcon("<span class='routeStopIcon'>"+IndexArray[b+1]+"</span>");e.Shape.SetDescription($("#routeStep > div:eq("+b+1+") > div > input").val());h="End"}}f.Itinerary.Items[g].Shape.Hide();c+="<div class='turnPoint'><div style='float:left;width:80%;'><div style='float:left;width:15%;'><a href=\"javascript:showRouteStep('"+f.Itinerary.Items[g].Shape.GetID()+"');\">"+h+"</a></div><div style='float:right;width:80%;'>"+e.Text+"</div></div>";k=e.Distance;if(k>0){c+="<div style='padding-left:5px;float:right;width:15%'>"+k.toFixed(1)+" mi";if(e.Time!=null);c+="</div>"}c+="</div>"}c+="</div><div style='clear:both;height:1px;' ></div>"}i=$("#routeStep > div:eq("+a.length+") > div > input").val();c+="<DIV class='routeLegStops'><SPAN>"+IndexArray[a.length]+"</SPAN><LABEL>End:</LABEL><DIV>"+i+"</DIV></DIV>";c+='<div id="disclaimerDiv"><span class="directionsDisclaimer" id="TaskHost_Directions_Disclaimer_disclaimerLabel">These directions are subject to the <a target="_blank" href="http://tou.live.com/en-us/default.aspx">Microsoft&#174; Service Agreement</a> and for informational purposes only. No guarantee is made regarding their completeness or accuracy. Construction projects, traffic, or other events may cause actual conditions to differ from these results. Map and traffic data &copy; 2009 NAVTEQ&trade;, AND&trade;.</span></div>';var d=0;for(;d<a.length;d++){a[d].Itinerary.Items[0].Shape.Show();stopsStepID.push(a[d].Itinerary.Items[0].Shape.GetID())}if(a.length<=IndexArray.length){a[d-1].Itinerary.Items[a[d-1].Itinerary.Items.length-1].Shape.Show();stopsStepID.push(a[d-1].Itinerary.Items[a[d-1].Itinerary.Items.length-1].Shape.GetID())}$("#routeResult").html(c);$(".turnTitle > a").toggle(function(){$(this).css("backgroundPosition","-182px -57px");$(this).parent().next().css("display","none")},function(){$(this).css("backgroundPosition","-182px -70px");$(this).parent().next().css("display","block")});SwitchGetDirectionPanelStyles(true);BeetLiveMap.onEndDeepLinking()};function showRouteStep(a){if(previousRouteStepID!=""){var b=BeetLiveMap.map.GetShapeByID(previousRouteStepID);b.Hide()}if(a){var c=BeetLiveMap.map.GetShapeByID(a);c.Show();if(!(stopsStepID.toString().indexOf(a)>=0))previousRouteStepID=a}}var DirectionStatus=false;function SwitchGetDirectionPanelStyles(a){DirectionStatus=a;if(a){$("#routeStep > div > div").each(function(){$(this).css("border-color","#f3f9fb").css("background-color","#f3f9fb")});$("#routeStep > div > div > input").each(function(){$(this).parent().html($(this).val());$(this).keypress(SubmitStops)});$("#routeStep > div > a").each(function(){$(this).css("visibility","hidden")});$("#routeAddTrip").hide();$("#routeOptions").hide();$("#routeGetDirection").hide();$("#routeStep").hide();$("#routeResult").show();$("#routeEditTrip").show()}else{$("#routeStep > div > div").each(function(){$(this).css("border-color","#CCC").css("background-color","White");$(this).html("<input value='"+$(this).html()+"' onkeypress='SubmitStops();' tabindex=\"1\"/>")});$("#routeStep > div > a").each(function(){if(!($(this).parent().attr("id")=="routeStart"||$(this).parent().attr("id")=="routeEnd"))$(this).css("visibility","visible")});$("#routeAddTrip").show();if($("#routeStep > div > span").length>=19)$("#routeAddTrip > a").hide();else $("#routeAddTrip > a").show();$("#routeOptions").show();$("#routeGetDirection").show();$("#routeStep").show();$("#routeResult").hide();$("#routeEditTrip").hide()}}function OnSaveUserPin(){var a=true;Msn.WebAddress.GetSwfObj("ToyotaSWF").TrackSend("Atlas_148","","","");$("#pinTitle, #pinCity").each(function(){if($.trim($(this).val().replace("MAX. LENGTH: 25 CHARACTERS","")).length==0){$(this).addClass("bordred");a=false}else $(this).removeClass("bordred")});if($.trim($("#pinDesc").val().replace("MAX. LENGTH: 600 CHARACTERS","")).length==0){$("#pinDesc").addClass("bordred");a=false}else $("#pinDesc").removeClass("bordred");if($.trim($("#pinDesc").val()).length>650){$("#pinDesc").addclass("bordred");a=false}if(a){var b=$("#pinLocation").val().split(",");addPins(parseFloat(b[0]),parseFloat(b[1]),$("#pinTitle").val(),"","","",$("#pinCity").val(),$("#pinDesc").val());CancelContextMenu()}return false}function CancelContextMenu(){$("#rightMenu").fadeOut("def")}function checkTextAreaMaxLen(a,b){if(a.value.length>b)a.value=a.value.substring(0,650)}String.prototype.format=function(){var c=r=this,b=/\{\d{1,}\}/g,a;while((a=b.exec(c))!=null){i=parseInt(a.toString().replace("{","").replace("}",""));r=r.replace(a,arguments[i])}return r};function SendToEmail(c){var a=BeetLiveMap.PinsManager[c.toLowerCase()];Msn.WebAddress.GetSwfObj("ToyotaSWF").TrackSend("Atlas_143","","",a.name);var b=a.GetPoints()[0];location.href=window.PushPinMailTemplate.format(escape(a.name))+" "+escape(("http://"+BeetLiveMap.siteDomain+"/default.aspx?section="+"hitTheRoad&id="+c+BeetLiveMap.IDParaSplitChar+(BeetLiveMap.map.GetMapStyle()==VEMapStyle.Road?"road":"aerial")+BeetLiveMap.IDParaSplitChar+b.Latitude+BeetLiveMap.LatLonSplitChar+b.Longitude+BeetLiveMap.IDParaSplitChar+BeetLiveMap.map.GetZoomLevel()+"&source=email").replace(/ /g,"%20"))}function sendTxtToEmail(a){window.location=a}var timeOutID;function isSnedMobiReady(a){if($("#sendmoblieterm_"+a).attr("checked")&&$("#mobiarea_"+a).val().length==3&&$("#mobiprefix_"+a).val().length==3&&$("#mobisuffix_"+a).val().length==4){enablesndmbl(a);return true}disablesndmbl(a);return false}var bsndmblisenable=false;function disablesndmbl(a){bsndmblisenable=false;$("#mobisendbtn_"+a).addClass("disablelikecss");$("#mobisendbtn_"+a).removeClass("enablelikcss");$("#mobisendbtn_"+a).hover(function(){$(this).css("background-color","#f4f4f4")},function(){$(this).css("background-color","")})}function enablesndmbl(a){bsndmblisenable=true;$("#mobisendbtn_"+a).removeClass("disablelikecss");$("#mobisendbtn_"+a).addClass("enablelikcss");$("#mobisendbtn_"+a).hover(function(){$(this).css("background-color","#b49d78")},function(){$(this).css("background-color","")})}function SndToFrdByMobi(a){var b=BeetLiveMap.PinsManager[a.toLowerCase()];if(!bsndmblisenable)return;disablesndmbl(a);Msn.WebAddress.GetSwfObj("ToyotaSWF").TrackSend("Atlas_145","","",b.name);$.get("SendToMobileProxy.ashx?mode=getExpiry&timespan="+randomNum(),null,function(d){var b=BeetLiveMap.PinsManager[a];if(b==null)return;var e="Check out "+(b.BeetPinID.substr(0,1)=="e"?window.ECSnd2MobiStaticTxt.format(b.name,b.address,b.city,b.state):window.UserSnd2MobiStaticTxt.format(b.name,b.city)),c="SendToMobileProxy.ashx?mode=do&area={0}&prefix={1}&suffix={2}&expiry={3}&body_text=".format($("#mobiarea_"+a).val(),$("#mobiprefix_"+a).val(),$("#mobisuffix_"+a).val(),d)+escape(e);sendSmsFunc="SendSms('"+c+"', '"+a+"')";timeOutID=setTimeout(sendSmsFunc,2000)})}function SendSms(b,a){$.ajax({url:b,type:"GET",dataType:"xml",error:function(){$("#sndmobiinfoBody_"+a+" > .sndmobiinfotitle").html("ERROR");$("#sndmobiinfoBody_"+a+" > .sndmobiinfoDesc").html("Your message has not been sent<div>Please try again later</div>");$("#sndmobiinfo_"+a).fadeIn("fast",function(){window.setTimeout('$("#sndmobiinfo_'+a+'").fadeOut("def")',5000)});$("#sndmobiwrapp_"+a).hide();enablesndmbl(a)},success:function(b){$(b).find("result").each(function(){var c=$(this).find("code").text(),b=window.SendMobileFeedBack[c];if(b==null)b=window.SendMobileFeedBack["default"];if(c=="100"){$("#sndmobiinfoBody_"+a+" > .sndmobiinfotitle").html("SUCCESS");$("#sndmobiinfoBody_"+a+" > .sndmobiinfoDesc").html(b)}else{$("#sndmobiinfoBody_"+a+" > .sndmobiinfotitle").html("ERROR");$("#sndmobiinfoBody_"+a+" > .sndmobiinfoDesc").html(b)}$("#sndmobiinfo_"+a).fadeIn("fast",function(){window.setTimeout('$("#sndmobiinfo_'+a+'").fadeOut("def")',5000)});$("#sndmobiwrapp_"+a).hide();enablesndmbl(a)})}});clearTimeout(timeOutID)}function showSendMobiPanel(a){var b=BeetLiveMap.PinsManager[a.toLowerCase()];Msn.WebAddress.GetSwfObj("ToyotaSWF").TrackSend("Atlas_144","","",b.name);$("#sndmobiwrapp_"+a).show();$("#mobiarea_"+a)[0].focus()}function getTextFieldSelection(a){if(a.selectionStart!=undefined&&a.selectionEnd!=undefined){var b=a.selectionStart,c=a.selectionEnd;return a.value.substring(b,c)}else return ""}function CheckInputDataDigite(d,h,g,c,b){d=d||window.event;var a=d.charCode||d.keyCode;if(!(a>=48&&a<=57||a==8||a==46||a==37||a==39))return false;if(c!=null){var e=document.all?c.ownerDocument.selection.createRange().text:c.ownerDocument.getSelection();if(e.length==0)e=getTextFieldSelection(c);if(e.length>0)return true}var f=a==8||a==46?h.length-1:h.length+1;if(a==37||a==39)return true;if(f>g){if(b!=null){$("#"+b)[0].focus();$("#"+b)[0].select()}return false}if(f==g)if(b!=null)window.setTimeout('$("#'+b+'")[0].focus();$("#'+b+'")[0].select();',100);return true}function ReportAbuse(a){var b=BeetLiveMap.PinsManager[a.toLowerCase()];Msn.WebAddress.GetSwfObj("ToyotaSWF").TrackSend("Atlas_146","","",b.name);$.get("xmlHandler.ashx?mode=ReportUserPin&id="+a.substr(2),null,function(c){var b=true;$(c).find("error").each(function(){b=false});if(b){$(".rptrbsfedbkTitle").html("Thank you!");$(".rptrbsfedbkBdy").html("This item has been reported to the administrator.")}else{$(".rptrbsfedbkTitle").html("Sorry");$(".rptrbsfedbkBdy").html("An error occurred and your report was not received. Please try again.")}$("#rptrbsfedbk_"+a).fadeIn("fast",function(){window.setTimeout('$("#rptrbsfedbk_'+a+'").fadeOut("def")',5000)})})}var IsShowAd=true,adTimerout=null;function ShowAD(b,c){IsShowAd=true;var a="";if(b.length>0)a="venzaAd.aspx?pg="+b+"&ap="+c;$("#VenzaAdFrame").attr("src",a);if(adTimerout)window.clearTimeout(adTimerout);adTimerout=window.setTimeout(function(){if(IsShowAd)$("#VenzaAdFrameWrapper").animate({width:"160px",marginLeft:"-160px"},400,function(){if(!IsShowAd)HideAD()})},1500)}function HideAD(){IsShowAd=false;$("#VenzaAdFrameWrapper").css("display","none");$("#VenzaAdFrameWrapper").css("margin-left","160px")}function SendToDirections(b){BeetLiveMap.map.HideInfoBox();if(DirectionStatus)SwitchGetDirectionPanelStyles(false);$(".routestop").each(function(){$(this).remove()});$("#routeStep > div > span").each(function(a){$(this).html(IndexArray[a])});$("#routeStep > div > div > input").each(function(){$(this).val("")});BeetLiveMap.DeleteRoute();BeetLiveMap.map.DetachEvent("onendpan",BeetLiveMap.onEndPan);BeetLiveMap.map.HideInfoBox();$("#thankPanel").hide();$("#myMap_vemessagepanel").hide();var a="#routeStep > div > div > input";if(DirectionStatus)a="#routeStep > div > div";$(a).each(function(){if(DirectionStatus)$(this).html("");else $(this).val("")});$("#routeStart > div > input").val("");$("#routeEnd > div > input").val(b);sidebaranimate(true)}function IMThis(d,b,c,e,f){var a=false;if(d!=null){d=unescape(d);try{if(!f){a=IMThisWithoutActivityID(d);if(!a&&b!=null&&c!=null)a=IMThisActivity(b,c,e)}else if(b!=null&&c!=null)a=IMThisActivity(b,c,e)}catch(g){a=false}if(!a)IMThisActivity("",null,null,true)}}function IMThisWithoutActivityID(c){var a=false;try{var b=new ActiveXObject("MSNMessenger.Hotmail2Control");b.InstantMessage2("",c,0);a=true}catch(d){}return a}function IMThisActivity(a,d,c,f){var e=false;try{var b=new ActiveXObject("MSNMessenger.P4QuickLaunch")}catch(g){b=null}if(b!=null){a=a<=0?"":a;if(d&&c)SaveCookie(d,c,10);b.LaunchApp(a,"");e=true}else if(f)alert("User does not have MSN installed or is not using IE.");return e}function isClientFirstVisiter(){if(getCookie("ToyotaVenza_isClientFirstVisiter")==null){setCookie("ToyotaVenza_isClientFirstVisiter","true");return true}else return false}function getCookie(a){var b=document.cookie.indexOf(a+"="),d=b+a.length+1;if(!b&&a!=document.cookie.substring(0,a.length))return null;if(b==-1)return null;var c=document.cookie.indexOf(";",d);if(c==-1)c=document.cookie.length;return unescape(document.cookie.substring(d,c))}function setCookie(h,g,a,d,c,f){var b=new Date;b.setTime(b.getTime());if(a)a=a*1000*60*60*24;var e=new Date(b.getTime()+a);document.cookie=h+"="+escape(g)+(a?";expires="+e.toGMTString():"")+(d?";path="+d:"")+(c?";domain="+c:"")+(f?";secure":"")}function deleteCookie(b,c,a){if(getCookie(b))document.cookie=b+"="+(c?";path="+c:"")+(a?";domain="+a:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}var language=navigator.browserLanguage?navigator.browserLanguage:navigator.language;function GetResolution(){return window.screen.width+"x"+window.screen.height}function GetLanguage(){return navigator.browserLanguage?navigator.browserLanguage:navigator.language}function GetMarket(){if(GetLanguage().indexOf("-")<0)return "us";return GetLanguage().substr(GetLanguage().indexOf("-")+1)}function ChangeFlashHeight(a){if(a=="")return;$("#flashDiv").height(a+"px");$("#ToyotaSWF").attr("height",a+"px");var b=782-parseInt(a);$("#mapContainer").css("margin-top",-691+b+"px")}var MapAPILoadSucceed=false;function ShowMapFailedMessage(){MapAPILoadSucceed=false;$("#myMap").hide();$("#MapError > div div:last-child").text("Sorry, we seem to be experiencing some technical difficulties. Please refresh the page or try again later.");$("#MapError").show()}function openalert(a){window.open(a,"Alerts","width=830,height=500,scrollbars=yes")}function MapControlInit(a){if(a==null)a="VEMapScriptHandler.ashx?mode=RetrieveVEMapAPI";if(!window.MapApiLoaded)$.get(a,null,function(a){if(a.toString().length<100){window.MapApiLoaded=true;return}registerJS(a.toString());MapAPILoadSucceed=true})}function registerJS(b){var c=document.getElementsByTagName("head")[0],a=document.createElement("script");a.language="javascript";a.type="text/javascript";a.defer=true;a.text=b;c.appendChild(a)}if(!window.Msn)window.Msn={};Msn.Flash=new function(){var c=this,b=null,a=document,d=window;this.Version=function(){return this.flVer()};this.Build=function(k,j,g,f){if(this.VersionIsValid(this.flVer(),j.split("."))){var h=a.getElementById(k),i=' type="application/x-shockwave-flash" ',b=new Array("<object"+i),d=new Array("<embed"+i);for(var e in g){b.push(e+'="'+g[e]+'" ');d.push(e+'="'+g[e]+'" ')}b.push(">");for(var c in f){b.push('<param name="'+c+'" value="'+f[c]+'"/>');if(c=="movie")d.push("src "+'="'+f[c]+'" ');else d.push(c+'="'+f[c]+'" ')}d.push("/>");b.push(d.join(""));b.push("</object>");if(h)h.innerHTML=b.join("");else a.write(b.join(""))}else if(arguments[4])window.location.href=arguments[4];else window.location.href="requirements.xml"};this.flVer=function(){var a=[];if(navigator.plugins&&navigator.mimeTypes.length){var d=navigator.plugins["Shockwave Flash"];if(d&&d.description)a=d.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split(".")}else if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var b=1,c=3;while(b)try{c++;b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+c);a=[c,0,0]}catch(e){b=null}}else{try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a=[6,0,21];b.AllowScriptAccess="always"}catch(f){if(a[0]==6)return a}try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(f){}}if(b!=null)a=b.GetVariable("$version").split(" ")[1].split(",")}return a};this.VersionIsValid=function(b,a){for(var c=0;c<3;c++){b[c]=$D(b[c],0);a[c]=$D(a[c],0);b[c]=parseInt(b[c]);a[c]=parseInt(a[c])}if(b[0]!=a[0])return b[0]>a[0];else if(b[1]!=a[1])return b[1]>a[1];else if(b[2]!=a[2])return b[2]>a[2];return true};return this};function $D(a,b){return !a||typeof a=="undefined"||a==null?b:a}if(!window.Msn)window.Msn={};Msn.Browser=new function(){var b=this,a=window.navigator.userAgent.toLowerCase();b.isIE=function(b){if(b)return a.indexOf("msie "+b)>=0;return a.indexOf("msie")>=0};b.isOpera=function(){return a.indexOf("opera")>=0};b.isMozilla=function(){return a.indexOf("gecko")>=0};b.isNetscape=function(){return a.indexOf("navigator")>=0};b.isFlock=function(){return a.indexOf("flock")>=0};b.isSafari=function(){return a.indexOf("safari")>=0};b.isFirefox=function(){if(Msn.Browser.isNetscape()||Msn.Browser.isFlock()||Msn.Browser.isSafari())return false;if(version)return a.indexOf("firefox/"+version)>=0;return a.indexOf("firefox")>=0}};if(!window.Msn)window.Msn={};Msn.WebAddress=new function(){var h="MSNWebAddress",a,f,g=100,c=true,b="#";this.webAddressUpdatedEvent="webAddressUpdatedEvent";this.SitePageTitle="";this.Init=function(){if(Msn.Browser.isIE()){j();if(document.location.href.split("#").length==2)e(document.location.href.split("#")[1]);else e("");f=setInterval(i,g)}else f=setInterval(k,g)};this.dispose=function(){clearInterval(f)};this.GetSwfObj=function(a){if(document.embeds[a])return document.embeds[a];if(window.document[a])return window.document[a];if(window[a])return window[a];if(document[a])return document[a];return null};this.SetTitle=function(){if(arguments[0]!=null)this.SitePageTitle=arguments[0]};this.go=function(a){var c=this.SitePageTitle;if(arguments.length>1)c=arguments[1];document.title=c;if(Msn.Browser.isIE()){if(Msn.WebAddress.iframeHash()!=a)e(a)}else window.location.href=b+a};this.iframdLoader=function(){if(c){var a="/";if(document.location.href.split("#").length==2)a=document.location.href.split("#")[1];Msn.Delegate.callEvent(Msn.WebAddress.webAddressUpdatedEvent,a);c=false;return}else{Msn.Delegate.callEvent(Msn.WebAddress.webAddressUpdatedEvent,Msn.WebAddress.iframeHash());window.location.hash=b+Msn.WebAddress.iframeHash();window.location.href=b+Msn.WebAddress.iframeHash()}};this.iframeHash=function(){return a.contentWindow.document.title};this.localHash=function(){if(window.location.hash)return window.location.hash.replace(b,"");else return b.replace(b,"")};function i(){document.title=Msn.WebAddress.SitePageTitle;if(Msn.WebAddress.localHash()!=Msn.WebAddress.iframeHash())if(Msn.Browser.isIE(6))window.location.reload();else Msn.WebAddress.go(Msn.WebAddress.localHash())}function j(){var b=document.createElement("div");b.innerHTML="<iframe style='width:0px;height:0px;position:absolute;top:-9999px;' id='"+h+"' frameBorder='0'></iframe>";document.body.appendChild(b);a=document.getElementById(h);if(a.attachEvent)a.attachEvent("onload",Msn.WebAddress.iframdLoader);else a.addEventListener("onload",Msn.WebAddress.iframdLoader,false)}function e(b){a.contentWindow.document.open();a.contentWindow.document.write("<html><head><title>"+b+"</title><body>"+b+"</body></html>");a.contentWindow.document.close()}var d="";function k(){document.title=Msn.WebAddress.SitePageTitle;if(c){c=false;var b="/";if(document.location.href.split("#").length>1){b=document.location.href.split("#")[1];d=b}Msn.Delegate.callEvent(Msn.WebAddress.webAddressUpdatedEvent,b)}var a=Msn.WebAddress.localHash();if(d!=a){d=a;Msn.Delegate.callEvent(Msn.WebAddress.webAddressUpdatedEvent,a)}}};Msn.Delegate=new function(){var a=[];this.addEvent=function(b,e){if(!a[b])a[b]=[];var d=[];if(arguments.length>2)for(var c=2;c<arguments.length;c++)d.push(arguments[c]);a[b].push({f:e,args:d})};this.callEvent=function(c){if(a[c]){var d=[];if(arguments.length>1)for(var b=1;b<arguments.length;b++)d.push(arguments[b]);for(var b=0;b<a[c].length;b++)a[c][b].f(a[c][b].args.concat(d))}}};function WebAddressInit(){Msn.Delegate.addEvent(Msn.WebAddress.webAddressUpdatedEvent,function(a){if(a=="")a="/";Msn.WebAddress.GetSwfObj("ToyotaSWF").CallbackFunction(a.toString())});Msn.WebAddress.SetTitle("Appetite for Life");Msn.WebAddress.Init()}if(!window.Msn)window.Msn={};Msn.Tracking={Action:function(g,f,e){var a=document;if(g.length>0){key=g.split("|")[0];value=g.split("|")[1];var h=a.getElementsByTagName("head")[0],d=a.createElement("script");d.setAttribute("type","text/javascript");d.setAttribute("src",value);d.id=key+"_expose";var c=a.getElementById(key+"_expose");if(c!=null)h.removeChild(c);h.appendChild(d)}if(f.length>0){key=f.split("|")[0];value=f.split("|")[1];var b=a.createElement("div");b.id=key+"_duration";b.innerHTML="<img src='"+value+Math.floor((new Date).getTime()/1000)+"' height='1' width='1' border='0' style='display:none;'>";var c=document.getElementById(key+"_duration");if(c!=null)a.body.removeChild(c);a.body.appendChild(b)}if(e.length>0){key=e.split("|")[0];value=e.split("|")[1];var b=a.createElement("div");b.id=key+"_action";b.innerHTML="<iframe src='"+value+"' width='1' height='1' frameborder='0' scrolling='No' marginheight='0' marginwidth='0' topmargin='0' leftmargin='0' style='display:none;'></iframe>";var c=a.getElementById(key+"_action");if(c!=null)a.body.removeChild(c);a.body.appendChild(b)}}}