﻿var map=null,Kihei=new VELatLong(20.7475,-156.4539),KiheiSurfside=new VELatLong(20.70595,-156.44652),Keawakapu=new VELatLong(20.70449,-156.44651),rainbowMall=new VELatLong(20.719029184918924,-156.44619226455691),kamaoleShopping=new VELatLong(20.718356840733929,-1.5644607424736e2),dolphinCenter=new VELatLong(20.719982503647753,-156.44650340080261),kamaoleBeachCenter=new VELatLong(20.719440617948361,-156.4464282989502),moose=new VELatLong(20.716871651957735,-156.44600987434387),fivePalms=new VELatLong(20.704738,-156.44662),sarentos=new VELatLong(20.70385,-156.4460849),KiheiTownCenter=new VELatLong(20.73468,-156.452393),KiheiKalamaVillage=new VELatLong(20.73168274,-156.451578),PiilaniVillageShoppingCenter=new VELatLong(20.75222121,-156.448338),KukuiMall=new VELatLong(20.733107587194787,-156.45185708999634),AlohaOpenMarket=new VELatLong(20.735174583797157,-156.45339131355288),walkingDistanceCenter=new VELatLong(20.71044,-156.44634),pinPoint=null,pinPixel=null;function CenterZoomMaui(){map.SetCenterAndZoom(Kihei,9)}function CenterZoomSurfside(){map.SetCenterAndZoom(Keawakapu,17)}function CenterZoomKihei(){map.SetCenterAndZoom(Kihei,12)}function CenterZoomAirportDrive(){var a=new VELatLong(20.75611,-156.44222);map.SetCenterAndZoom(a,11)}function AddPin(b,c,a){p1Shape=new VEShape(VEShapeType.Pushpin,c);p1Shape.SetTitle(b);p1Shape.SetDescription(a);map.AddShape(p1Shape)}function GetMap(){GetMap2(Keawakapu,"myMap",17,VEMapStyle.Hybrid);AddPin("Kihei Surfside",KiheiSurfside,"Kihei Surfside condo");AddPin("Keawakapu beach",Keawakapu,"One of the top beaches in the world - just a few steps away")}function GetMapAirport(){var a=new VELatLong(20.75611,-156.44222);GetMap2(Kihei,"myMap",11,VEMapStyle.Road);AirportDirections()}function GetMapMaui(){GetMap2(Kihei,"myMap",9,VEMapStyle.Hybrid)}function GetMapKihei(){GetMap2(Kihei,"myMap",13,VEMapStyle.Road);AddPin("Kihei Surfside",KiheiSurfside,"Kihei Surfside condo");AddPin("Shopping and restaurants",rainbowMall,"Shops and restaurants at the Dolphin Center, Rainbow mall, Kamaole Beach Center, and Kamaole Shopping Center ");AddPin("Kihei Town Center",KiheiTownCenter,"Foodland");AddPin("Kihei Kalama Village",KiheiKalamaVillage,"Restaurants and open air shops");AddPin("Piilani Village Shopping Center",PiilaniVillageShoppingCenter,"Safeway, Starbucks, Blockbuster and much more");AddPin("Kukui Mall",KukuiMall,"");AddPin("Aloha Open Market",AlohaOpenMarket,"")}function GetMapKeawakapu(){GetMap2(Keawakapu,"myMap",17,VEMapStyle.Hybrid);AddPin("Kihei Surfside",KiheiSurfside,"Our condo - the tip of this push pin is at the lanai of unit #108");AddPin("Keawakapu beach",Keawakapu,"One of the top beaches in the world - just a few steps away")}function GetMapWalkingDistance(){GetMap2(walkingDistanceCenter,"myMap",15,VEMapStyle.Hybrid);AddPin("Kihei Surfside",KiheiSurfside,"Our condo - the tip of this push pin is at the lanai of unit #108");AddPin("Rainbow mall",rainbowMall,"shops");AddPin("Kamaole Shopping Center",kamaoleShopping,"shops");AddPin("Dolphin Center",dolphinCenter,"shops");AddPin("Kamaole Beach Center",kamaoleBeachCenter,"shops");AddPin("Moose McGillicuddy's",moose,"Restaurant");AddPin("Five Palms restaurant",fivePalms,"We love to have breakfast here");AddPin("Sarento's On The Beach restaurant",sarentos,"Five-star dining")}function GetMap2(d,b,c,a){map=new VEMap(b);map.LoadMap(d,c,a,false,VEMapMode.Mode2D,true,1)}function getInfo(){var a;if(map.IsBirdseyeAvailable()){var b=map.GetBirdseyeScene();a="ID: "+b.GetID()+"\n";a+="orientation: "+b.GetOrientation()+"\n";a+="height: "+b.GetHeight()+"\n";a+="width: "+b.GetWidth()+"\n";var c=b.LatLongToPixel(map.GetCenter(),map.GetZoomLevel());a+="LatLongToPixel: "+c.x+", "+c.y+"\n";a+="contains pixel "+pinPixel.x+", "+pinPixel.y+": "+b.ContainsPixel(pinPixel.x,pinPixel.y,map.GetZoomLevel())+"\n";a+="contains latlong "+pinPoint+": "+b.ContainsLatLong(pinPoint)+"\n";a+="latlong: "+map.PixelToLatLong(c);alert(a)}else{var d=map.GetCenter();a="Zoom level:\t"+map.GetZoomLevel()+"\n";a+="Latitude:\t"+d.Latitude+"\n";a+="Longitude:\t"+d.Longitude;alert(a)}}function SetInner(b,c){var a;if(document.getElementById)a=document.getElementById(b);else if(document.all)a=document.all[PopupID];else if(document.layers)a=document.layers[PopupID];a.innerHTML=c}function myRouteHandler(j){var i=j.RouteLegs,a="Turn-by-Turn Directions<br/>",d=null,h=0,g=0;for(var e=0;e<i.length;e++){d=i[e];var c=null,b=null;for(var f=0;f<d.Itinerary.Items.length;f++){h++;c=d.Itinerary.Items[f];a+=h+":  "+c.Text;b=c.Distance;g+=b;a+=" ("+b.toFixed(1)+" miles)<br/>"}}a+="Total distance:  "+g.toFixed(1)+" miles\n";SetInner("directions",a)}function AirportDirections(){var a=new VERouteOptions;a.SetBestMapView=true;map.GetDirections(["OGG","2936 South Kihei Rd, Kihei, HI"],a)}