   
var map;
var geoXml = new GGeoXml("http://www.villabigbear.com/google/Villa-Big-Bear-Bulgaria.kml");
var toggleState = 1;


function onLoad() {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map")); 
    map.addControl(new GMapTypeControl());
    map.addControl(new GLargeMapControl());
    //map.addControl(new GSmallMapControl());
    map.setCenter(new GLatLng(42.386951440524854, 27.443161010742188), 8); 
	
    map.addOverlay(geoXml);
    GEvent.addListener(map, "moveend", function() {
        var center = map.getCenter();
        //document.getElementById("message").innerHTML = center.toString();
    });
	
	// Creates a marker at the given point with the given number label
    function createMarker(point, number) {
      var marker = new GMarker(point);
      GEvent.addListener(marker, "click", function() {
	    if(number == 1){		
        	marker.openInfoWindowHtml("<img style='width:190px;height:127px;' src='http://www.villabigbear.com/google/01.jpg'><br><br>Villa Big Bear, Strandja, Bulgaria");
	    } else {
			marker.openInfoWindowHtml("<img style='width:190px' src='http://www.villabigbear.com/google/02.jpg'><br><br>Bourgas, Bulgaria");
	    }
	  });
      return marker;
    }

    var pointVilla = new GLatLng(42.260858594921864, 27.379254698753357);
    var pointBourgas = new GLatLng(42.501971743191135, 27.4713134765625);
    map.addOverlay(createMarker(pointVilla, 1));
    map.addOverlay(createMarker(pointBourgas, 2));	
  }
} 



/*
function toggleMyKml() {
  if (toggleState == 1) {
    map.removeOverlay(geoXml);
    toggleState = 0;
  } else {
    map.addOverlay(geoXml);
    toggleState = 1;
  }
}*/