google.load("earth", "1");

var ge = null;


function init() {
  google.earth.createInstance("map3d", initCallback, failureCallback);
}

function initCallback(object) {
  ge = object;
  ge.getWindow().setVisibility(true);
  var options = ge.getOptions();
  setOptions();
  setTimeout('lookAT()', 15000);
}

function failureCallback(object) {
}

function setOptions(){
 options = ge.getOptions();
 options.setFlyToSpeed(0.15);
 ge.getLayerRoot().enableLayerById(ge.LAYER_BUILDINGS, true);
        ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
        ge.getLayerRoot().enableLayerById(ge.LAYER_TERRAIN, true);
        ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);
 var la = ge.createLookAt('');
 la.set(52.28, 9.81,50000,ge.ALTITUDE_ABSOLUTE,0,20,0);
 ge.getView().setAbstractView(la);
 //options.setGridVisibility(true);
 //options.setStatusBarVisibility(true);
}

    function lookAT(){
      var la = ge.createLookAt('');
          la.set(52.319582909, 9.81761362,150,ge.ALTITUDE_ABSOLUTE,-60,75,0);
          ge.getView().setAbstractView(la);
     }


function wOpen(w){

 if(w=="geBeispiel1"){
  window.open('internet/geBeispiel1.htm','Beispiel1','width=600,height=500,left=100,top=100,resizable=yes');
  //window.open('internet/geBeispiel1.htm',"Beispiel1","width=200,height=200,left=100,top=100");
 }

 if(w=="geBeispiel2"){
  window.open("internet/geBeispiel2.htm","Beispiel2","width=600,height=500,left=100,top=100,resizable=yes");
 }

 if(w=="geBeispiel3"){
  window.open("internet/geBeispiel3.htm","Beispiel3","width=600,height=500,left=100,top=100,resizable=yes");
 }

 if(w=="geBeispiel4"){
  window.open("internet/geBeispiel4.htm","Beispiel4","width=600,height=500,left=100,top=100,resizable=yes");
 }

}
