// JavaScript Document

 <script src="http://www.google.com/jsapi?key=ABQIAAAApowumKyfepAFEzHItgRKZRSkZnRjwByjg3cEkeHhhHRV2xa70BSgFxrWWDTgMOlTSuxIdjqrkxX1RQ"></script>
  <script>
    google.load('earth', '1');
  
var ge = null;
var pnetworkLink = null;
var gehnetworkLink = null;
var wmnetworkLink = null;

function init() {
  google.earth.createInstance("map3d", initCallback, failureCallback);
}


   function initCallback(pluginInstance) {
      ge = pluginInstance;
      ge.getWindow().setVisibility(true);
      
      var kmlObject = ge.parseKml(
        '<?xml version="1.0" encoding="UTF-8"?>'+
'<kml xmlns="http://earth.google.com/kml/2.2">'+
'<Document>'+
'	<name>&quot;Test9&quot; to &quot;test10&quot;</name>'+
'	<open>1</open>'+
'	<Snippet maxLines="2"><![CDATA[<font size=+1><a href='+
'	"http://maps.google.com/maps?saddr=20.0494346016%2C-155.589231687%20'+
'	(%22Test9%22)&daddr=20.0491182359%2C-155.590029492%20(%22test10%22)&ie='+
'	utf-8&v=2.2&cv=4.3.7284.3916&hl=en">Printable view</a></font>]]></Snippet>'+
'	<Style id="roadStyle">'+
'		<LineStyle>'+
'			<color>7fcf0064</color>'+
'			<width>6</width>'+
'		</LineStyle>'+
'	</Style>'+
'<LookAt>'+
'			<longitude>-157.8269859698485</longitude>'+
'			<latitude>21.27572197265932</latitude>'+
'			<altitude>0</altitude>'+
'			<range>186.4261170003527</range>'+
'			<tilt>38.99002784175841</tilt>'+
'			<heading>51.29854648215576</heading>'+
'			<altitudeMode>relativeToGround</altitudeMode>'+
'		</LookAt>'+
'	<Placemark>'+
'		<name>Head southwest on HI-240</name>'+
'		<address>HI-240</address>'+
'		<description>go 276&amp;#160;ft</description>'+
'		<LookAt>'+
'			<longitude>-155.5918</longitude>'+
'			<latitude>20.05097</latitude>'+
'			<altitude>0</altitude>'+
'			<range>100</range>'+
'			<tilt>45</tilt>'+
'			<heading>211.257416</heading>'+
'		</LookAt>'+
'		<StyleMap>'+
'			<Pair>'+
'				<key>normal</key>'+
'				<Style>'+
'					<IconStyle>'+
'						<Icon>'+
'							<href>http://maps.google.com/mapfiles/kml/paddle/go.png</href>'+
'						</Icon>'+
'						<hotSpot x="0.5" y="0" xunits="fraction" yunits="fraction"/>'+
'					</IconStyle>'+
'					<ListStyle>'+
'						<listItemType>check</listItemType>'+
'						<ItemIcon>'+
'							<state>open closed error fetching0 fetching1 fetching2</state>'+
'							<href>http://maps.google.com/mapfiles/kml/paddle/go-lv.png</href>'+
'						</ItemIcon>'+
'						<bgColor>00ffffff</bgColor>'+
'						<maxSnippetLines>2</maxSnippetLines>'+
'					</ListStyle>'+
'				</Style>'+
'			</Pair>'+
'			<Pair>'+
'				<key>highlight</key>'+
'				<Style>'+
'					<IconStyle>'+
'						<scale>1.3</scale>'+
'						<Icon>'+
'							<href>http://maps.google.com/mapfiles/kml/paddle/go.png</href>'+
'						</Icon>'+
'						<hotSpot x="0.5" y="0" xunits="fraction" yunits="fraction"/>'+
'					</IconStyle>'+
'					<ListStyle>'+
'						<listItemType>check</listItemType>'+
'						<ItemIcon>'+
'							<state>open closed error fetching0 fetching1 fetching2</state>'+
'							<href>http://maps.google.com/mapfiles/kml/paddle/go-lv.png</href>'+
'						</ItemIcon>'+
'						<bgColor>00ffffff</bgColor>'+
'						<maxSnippetLines>2</maxSnippetLines>'+
'					</ListStyle>'+
'				</Style>'+
'			</Pair>'+
'		</StyleMap>'+
'		<Point>'+
'			<coordinates>-155.5918,20.05097,0</coordinates>'+
'		</Point>'+
'	</Placemark>'+
'	<Placemark>'+
'		<name>Arrive at: HI-240</name>'+
'		<address>HI-240</address>'+
'		<StyleMap>'+
'			<Pair>'+
'				<key>normal</key>'+
'				<Style>'+
'					<IconStyle>'+
'						<Icon>'+
'							<href>http://maps.google.com/mapfiles/kml/paddle/stop.png</href>'+
'						</Icon>'+
'					</IconStyle>'+
'					<ListStyle>'+
'						<listItemType>check</listItemType>'+
'						<ItemIcon>'+
'							<state>open closed error fetching0 fetching1 fetching2</state>'+
'							<href>http://maps.google.com/mapfiles/kml/paddle/stop-lv.png</href>'+
'						</ItemIcon>'+
'						<bgColor>00ffffff</bgColor>'+
'						<maxSnippetLines>2</maxSnippetLines>'+
'					</ListStyle>'+
'				</Style>'+
'			</Pair>'+
'			<Pair>'+
'				<key>highlight</key>'+
'				<Style>'+
'					<IconStyle>'+
'						<scale>1.3</scale>'+
'						<Icon>'+
'							<href>http://maps.google.com/mapfiles/kml/paddle/stop.png</href>'+
'						</Icon>'+
'					</IconStyle>'+
'					<ListStyle>'+
'						<listItemType>check</listItemType>'+
'						<ItemIcon>'+
'							<state>open closed error fetching0 fetching1 fetching2</state>'+
'							<href>http://maps.google.com/mapfiles/kml/paddle/stop-lv.png</href>'+
'						</ItemIcon>'+
'						<bgColor>00ffffff</bgColor>'+
'						<maxSnippetLines>2</maxSnippetLines>'+
'					</ListStyle>'+
'				</Style>'+
'			</Pair>'+
'		</StyleMap>'+
'		<Point>'+
'			<coordinates>-155.592217,20.050325,0</coordinates>'+
'		</Point>'+
'	</Placemark>'+
'	<Placemark>'+
'		<name>Route</name>'+
'		<description><![CDATA[Distance: 276&#160;ft (about 12 secs)<br/>'+

'		Map data &#169;2009 Tele Atlas]]></description>'+
'		<styleUrl>#roadStyle</styleUrl>'+
'		<MultiGeometry>'+
'			<LineString>'+
'				<coordinates>'+
'-155.5918,20.05097,0 -155.59222,20.05032,0 </coordinates>'+
'			</LineString>'+
'		</MultiGeometry>'+
'	</Placemark>'+
'</Document>'+
'</kml>'
      );
      
      if (kmlObject) {
        ge.getFeatures().appendChild(kmlObject);
      
        if (kmlObject.getAbstractView() !== null)
          ge.getView().setAbstractView(kmlObject.getAbstractView());
      }
    }
 



function jumpto732()
{
  var la = ge.createLookAt('');
  la.set(21.27572197265932, -157.8269859698485, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, //lat,long//
         180.99002784175841, 51.29854648215576, 906.4261170003527); //180(tilt), 60(heading - bird's eye view positioning), 500(range));
  ge.getView().setAbstractView(la); 
  document.getElementById('locdesc').innerHTML="<a href=\"#\" onClick=\"javascript:jumptoSheraton();\"><div style=\"width:500px; float:left; height:240px; border:1px solid red;\"><b>Hyatt Waikiki</b><br>A nearly complete rendition of Experience Hyatt Waikiki Today!.  Click here to view this building in Google Earth!</div></a>";
}

function jumptoSheraton()
{
  var la = ge.createLookAt('');
  la.set(21.27674577655807, -157.8296958249223, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, 
         38.99002056199134, 50.99901665352869, 450.722003379825); //180, 60, 500);
  ge.getView().setAbstractView(la); 
 document.getElementById('locdesc').innerHTML="<div style=\"width:500px; float:left; height:240px;\"><img style=\"float:right;\" class=thumb src=building_test.png width=317 height=233 /><b>Hyatt Waikiki</b><br>A nearly complete rendition of Experience Hyatt Waikiki Today!.  Click here to view this building in Google Earth!</a></div>";
}


function jumptoRoyalHawaiian()
{
  var la = ge.createLookAt('');
  la.set(21.2773825319266, -157.8291099816233, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, 
         38.000000, 9.000000, 508); //180, 60, 500);
  ge.getView().setAbstractView(la); 
 document.getElementById('locdesc').innerHTML="<div style=\"width:500px; float:left; height:240px;\"><img style=\"float:right;\" class=thumb src=building_test.png width=317 height=233 /><b>Hyatt Waikiki</b><br>A nearly complete rendition of Experience Hyatt Waikiki Today!.  Click here to view this building in Google Earth!</a></div>";
}

function jumptoEastWaikiki()
{
  var la = ge.createLookAt('');
  la.set(21.27314829430071, -157.8226564542429, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, 
         63.87443022803954, 46.61629915509909, 2001.731947774133); //180, 60, 500);
  ge.getView().setAbstractView(la); 
 document.getElementById('locdesc').innerHTML="<div style=\"width:500px; float:left; height:240px;\"><img style=\"float:right;\" class=thumb src=building_test.png width=317 height=233 /><b>Hyatt Waikiki</b><br>A nearly complete rendition of Experience Hyatt Waikiki Today!.  Click here to view this building in Google Earth!</a></div>";
}

function jumptoDHead()
{
  var la = ge.createLookAt('');
  la.set(21.26019079364716, -157.8153629843961, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, 
         85.54170602562415, 70.86686818501195, 1975.762602260998); //180, 60, 500);
  ge.getView().setAbstractView(la); 
 document.getElementById('locdesc').innerHTML="<div style=\"width:500px; float:left; height:240px;\"><img style=\"float:right;\" class=thumb src=building_test.png width=317 height=233 /><b>Hyatt Waikiki</b><br>A nearly complete rendition of Experience Hyatt Waikiki Today!.  Click here to view this building in Google Earth!</a></div>";
}

function jumptoDHeadBack()
{
  var la = ge.createLookAt('');
  la.set(21.26479548200435, -157.805095310828, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, 
         44.16022356735671, 78.0, 2567.432232515145); //180, 60, 500);
  ge.getView().setAbstractView(la); 
 document.getElementById('locdesc').innerHTML="<div style=\"width:500px; float:left; height:240px;\"><img style=\"float:right;\" class=thumb src=building_test.png width=317 height=233 /><b>Hyatt Waikiki</b><br>A nearly complete rendition of Experience Hyatt Waikiki Today!.  Click here to view this building in Google Earth!</a></div>";
}

function jumptoHiltonHarbor()
{
  var la = ge.createLookAt('');
  la.set(21.2814799940158, -157.8388359206542, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, 
         35.36630981288827, 54.72489005426105, 714.8745532624802); //180, 60, 500);
  ge.getView().setAbstractView(la); 
 document.getElementById('locdesc').innerHTML="<div style=\"width:500px; float:left; height:240px;\"><img style=\"float:right;\" class=thumb src=building_test.png width=317 height=233 /><b>Hyatt Waikiki</b><br>A nearly complete rendition of Experience Hyatt Waikiki Today!.  Click here to view this building in Google Earth!</a></div>";
}		

		function jumptoMtnRange()
{
  var la = ge.createLookAt('');
  la.set(21.34998582472121, -157.8316954463096, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, 
         390.48601930868215, 9.5261560271192, 20731.234789223); //180, 60, 500);
  ge.getView().setAbstractView(la); 
document.getElementById('locdesc').innerHTML="<div style=\"width:500px; float:left; height:240px;\"><img style=\"float:right;\" class=thumb src=building_test.png width=317 height=233 /><b>Hyatt Waikiki</b><br>A nearly complete rendition of Experience Hyatt Waikiki Today!.  Click here to view this building in Google Earth!</a></div>";
}


    function failureCallback(errorCode) {
    }
	
	function initCallback(object) {
  ge = object;

  ge.getWindow().setVisibility(true);
  var layerRoot = ge.getLayerRoot();
  layerRoot.enableLayerById(ge.LAYER_TERRAIN, true);
  layerRoot.enableLayerById(ge.LAYER_ROADS, false);
  layerRoot.enableLayerById(ge.LAYER_BUILDINGS, true);
  layerRoot.enableLayerById(ge.LAYER_BORDERS, false);
  ge.getOptions().setFlyToSpeed(.5); 

  var navControl = ge.getNavigationControl();
  navControl.setVisibility(ge.VISIBILITY_SHOW);
  
  ge.getOptions().setStatusBarVisibility(false);
  ge.getOptions().setOverviewMapVisibility(false);

  updateOptions();
}


function submitLocation() {
  var address = document.getElementById('address').value;
  geocoder.getLatLng(
    address, 
    function(point) {
      if (point && ge != null) {
        var la = ge.createLookAt('');     
        la.set(point.y, point.x, 100, ge.ALTITUDE_RELATIVE_TO_GROUND, 
               0, 0, 4000);
        ge.getView().setAbstractView(la);
      }
    }
  );
}

  </script>