 
var ge;      
google.load("earth", "1");      
function init() {         google.earth.createInstance('map3d', initCB, failureCB);      }      
function initCB(instance) {         
ge = instance;         
ge.getWindow().setVisibility(true); 
// add a navigation control
  ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);

  // add some layers
  ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
  ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);
     
// in this sample we will attempt
  // to fetch a  KML file and show it

  function finished(object) {
    if (!object) {
      // wrap alerts in API callbacks and event handlers
      // in a setTimeout to prevent deadlock in some browsers
      setTimeout(function() {
        alert('Bad or null KML.');
      }, 0);
      return;
    }
    ge.getFeatures().appendChild(object);
    var la = ge.createLookAt('');
    la.set(45.584828, 3.05470, 0, ge.ALTITUDE_RELATIVE_TO_GROUND,
           0, 0, 1600000);
    ge.getView().setAbstractView(la);

  }

  // fetch the KML
  var url = 'http://www.fxmotors.fr/cross-gps/Motocross_Fr.kml';
  google.earth.fetchKml(ge, url, finished);

  document.getElementById('installed-plugin-version').innerHTML =
    ge.getPluginVersion().toString();


}      
function failureCB(errorCode) {      }      google.setOnLoadCallback(init); 
var writing_on=false;
function erase_search(){
if(!writing_on)
	{
	document.getElementById('vmlp_search_str').value='';
	writing_on=true;
	}
}  

