//<![CDATA[

    var map;
    var deafIcon= new GIcon();
    deafIcon.image = "http://www.2009deaflympics.org/ezfiles/0/1000/img/30/LOGO090511.png";
    deafIcon.iconSize = new GSize(35, 35);
    deafIcon.iconAnchor = new GPoint(10, 0);
    deafIcon.infoWindowAnchor = new GPoint(15, 1);
	
    function VenuesControl() {}
VenuesControl.prototype = new GControl();

VenuesControl.prototype.initialize = function(map) {
    var venuebutton = document.createElement("div");
	
	var html0 = "<div style='color:#696969;'>競賽項目：馬拉松(競賽/暖身)<br>競賽場地：太平洋翡翠灣至台2線濱海公路石門國中體育館附近折返<br>競賽地址：臺北縣萬里鄉海景路1號至臺北縣石門鄉中央路1-9號折返<br><center><img src='http://www.2009deaflympics.org/ezfiles/0/1000/img/5/pic19.jpg'></center></div>";

	venuebutton.appendChild(this.createButton("北海岸公路", 25.189316, 121.683750, 16, html0));

    map.getContainer().appendChild(venuebutton);
    return venuebutton;
}
// 預設位置
VenuesControl.prototype.getDefaultPosition = function() {
    return new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(10, 50));
}
// 建立按鈕
VenuesControl.prototype.createButton = function(name, lat, lng, zoom, ctxt) {
    var div = document.createElement("div");
    this.setButtonStyle_(div);
    div.appendChild(document.createTextNode(name));
    GEvent.addDomListener(div, "click", function() {
      map.setCenter(new GLatLng(lat, lng), zoom); 
	  map.openInfoWindowHtml (map.getCenter(), ctxt);
    });
    return div;
}
// 設定按鈕樣式
VenuesControl.prototype.setButtonStyle_ = function(button) {
    button.style.textDecoration = "underline";
    button.style.color = "#0000cc";
    button.style.backgroundColor = "white";
    button.style.font = "small Arial";
    button.style.border = "1px solid black";
    button.style.padding = "2px";
    button.style.marginBottom = "3px";
    button.style.textAlign = "center";
    button.style.width = "6em";
    button.style.cursor = "pointer";
}

    function load() {

      if (GBrowserIsCompatible()) {  

        map = new GMap2(document.getElementById("map"));
		map.enableScrollWheelZoom();
		map.addControl(new VenuesControl());
		map.setUIToDefault();
        map.addControl(new GMapTypeControl());
		map.addControl(new GOverviewMapControl(),new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(0,0)));     

        var deafPoint0= new GLatLng(25.189316, 121.683750);
		
        map.setCenter(deafPoint0, 16);

        var marker0 = new GMarker(deafPoint0,{icon: deafIcon});

		var html0 = "<div style='color:#696969;'>競賽項目：馬拉松(競賽/暖身)<br>競賽場地：太平洋翡翠灣至台2線濱海公路石門國中體育館附近折返<br>競賽地址：臺北縣萬里鄉海景路1號至臺北縣石門鄉中央路1-9號折返<br><center><img src='http://www.2009deaflympics.org/ezfiles/0/1000/img/5/pic19.jpg'></center></div>";
		map.openInfoWindowHtml (deafPoint0, html0);
		GEvent.addListener(marker0, "click", function() {marker0.openInfoWindowHtml(html0);})

        map.addOverlay(marker0);

      }
    }
    //]]>


