	//=====================================================
	//google map
	//=====================================================
	//divid = the div's id name where you want add map in.
	function loadmap(num,divid,address,html) {
		if(!document.getElementById(divid)){return false;}
		if (GBrowserIsCompatible()) {
			//create map
			map = new GMap2(document.getElementById(divid));
			//map.addControl(new GLargeMapControl());	//
			map.addControl(new GSmallMapControl ());	//GLargeMapControl, GSmallMapControl, GSmallZoomControl, GScaleControl
			//map.addControl(new GMapTypeControl());	//
			//map.addMapType(G_PHYSICAL_MAP);			//
			//map.addMapType(G_SKY_VISIBLE_MAP);		//
			//map.addControl(new google.maps.LocalSearch());	//添加本地搜索功能
			map.setCenter(new GLatLng(25.045948, 121.53986), 5, G_NORMAL_MAP);	//G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP, G_PHYSICAL_MAP
			
			//make marker + Info Window + Icon + Draggable
			blueIcon = new GIcon(G_DEFAULT_ICON);
			blueIcon.image = "http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png";
			blueIcon.iconSize = new GSize(35, 35);
			blueIcon.iconAnchor = new GPoint(17, 35);
			blueIcon.infoShadowAnchor = new GPoint(10, 0);
			
			//geocoder = new GClientGeocoder();
			showAddress(num,address,html);
		}
    }
	
	//create marker
	function showAddress(num,address,html){
		geocoder = new GClientGeocoder();
		if (geocoder){
			geocoder.getLatLng(
				address,
				function(point){
					if (!point){
						//alert(address + "：找不到呀！");
                    }else{
						map.setCenter(point, 16, G_NORMAL_MAP); 
						//map.setCenter(point, 15, G_PHYSICAL_MAP); 
						var marker = new GMarker(point,{icon:blueIcon}); 
						GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(html);});
						map.addOverlay(marker); 
						//marker.openInfoWindowHtml(html); 
					}
				}
			);
		}
	}
	
	function loadmap0(num,divid,address,html) {
		var map =  null;
		var geocoder = null;
		var blueIcon = null;
		loadmap(num,divid,address,html);
		//showAddress(address,html);
			//sleep(3000);
	}
	function sleep(delay)
	{
	    var start = new Date().getTime();
	    while (new Date().getTime() < start + delay);
	}
	
	//【ajax切換顯示】
	/*function ShowMapInfo(temp_id,temp_name,temp_addr){
		var show_id=temp_id;
		var show_name=temp_name;
		var show_addr=temp_addr;
		var d=document.getElementById('part2_05');
		d.innerHTML='<img src="./images/loading.gif" alt="wait..." border=0 hspace=0 vspace=0>';
		if(show_id){
			var strParams = "id="+show_id+"&name="+encodeURIComponent(show_name)+"&addr="+encodeURIComponent(show_addr)+"";		//url參數
			arrFrclass = new net.ContentLoader("main/showgmap.php",ShowMapInfo2,null,"POST",strParams);	//呼叫net.js函數，載入結果 **
		}
	}
	function ShowMapInfo2(){
        var strText = this.req.responseText;//alert('r');
		//alert(strText);		//返回結果
		var arrObj = eval(strText);			//執行回傳資訊
		var a = arrObj[0];
		var show = ''+a.show+'';
		var d=document.getElementById('part2_05');
		d.innerHTML=show;
		loadmap0("1","church_map",a.tempaddr,a.mapinfo);
	}*/
	
