      function test()
	     {alert("-------------");}
		 
  function load(x,y,title,tel,zlink,address) {
      if (GBrowserIsCompatible()) {
	    var pos_x=x;
	    var pos_y=y;
        var map = new GMap2(document.getElementById('map'));
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		map.addControl(new GScaleControl());
		
		GEvent.addListener(map, 'moveend', function() {  var center = map.getCenter();});
		 var point =new GLatLng(parseFloat(pos_x), parseFloat(pos_y));
         map.setCenter(point, 16);
		infoHTML="<table style=\"margin:0px;border=1px\" width='200'  cellspacing='2' cellpadding='0'>";
        infoHTML+="<tr>";
        infoHTML+="<td width='62' align='left' class='Word12B'><img src='../_img/_layout/tip_07.gif' width='12' height='12' />建案名稱</td>";
        infoHTML+="<td width='12' align='center'><img src='../_img/_layout/tip_06.gif' width='12' height='12' /></td>";
        infoHTML+="<td align='left' class='NewWord'><a href="+zlink+" TARGET='_BLANK'>"+title+"</a></td>";
        infoHTML+="</tr>";
        infoHTML+="<tr>";
        infoHTML+="<td align='left' class='Word12B'><img src='../_img/_layout/tip_07.gif' width='12' height='12' />服務電話</td>";
        infoHTML+="<td><img src='../_img/_layout/tip_06.gif' width='12' height='12' /></td>";
        infoHTML+="<td align='left' class='NewWord'>"+tel+"</td>";
        infoHTML+="</tr>";
        infoHTML+="<tr>";
        infoHTML+="<td align='left' valign='top' class='Word12B'><img src='../_img/_layout/tip_07.gif' width='12' height='12' />接待中心</td>";
        infoHTML+="<td valign='top'><img src='../_img/_layout/tip_06.gif' width='12' height='12' /></td>";
        infoHTML+="<td  align='left' valign='top' class='NewWord'>"+address+"</td>";
        infoHTML+="</tr>";
        infoHTML+="</table>";
		//map.openInfoWindowHtml(map.getCenter(),infoHTML);
		
		var baseIcon = new GIcon();
		
		baseIcon.iconAnchor = new GPoint(20,50);
		baseIcon.infoWindowAnchor = new GPoint(9, 2);
		
		var icon = new GIcon(baseIcon); 
	    icon.image = "../_img/map/tip.gif";
		icon.iconSize = new GSize(67, 47);   
		function createMarker(point, number) {
		  var marker = new GMarker(point,icon); 
		    GEvent.addListener(marker, "click", function(){marker.openInfoWindowHtml(infoHTML);  });
		    return marker;
		}
		map.addOverlay(createMarker(point,1));
													   
      }
    }
	
	
	
	
	
	function load_bu_life(str) {
      if (GBrowserIsCompatible()) {
	    obj_arr = new Array();
		obj_arr=StrToAry(str);
		var map = new GMap2(document.getElementById('map'));
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		map.addControl(new GScaleControl());
		
		GEvent.addListener(map, 'moveend', function() {  var center = map.getCenter();});
		var point =new GLatLng(parseFloat(obj_arr[0][3]), parseFloat(obj_arr[0][4]));
        map.setCenter(point, 16);
		infoHTML=show_build_html(obj_arr[0][1],obj_arr[0][2],obj_arr[0][5],obj_arr[0][6]);
		var opts = { maxWidth : 150 };
		map.openInfoWindowHtml(map.getCenter(),infoHTML,opts);
		
		var baseIcon = new GIcon(G_DEFAULT_ICON);
		//baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
        baseIcon.iconSize = new GSize(20, 34);
        baseIcon.shadowSize = new GSize(37, 34);
        baseIcon.iconAnchor = new GPoint(20,50);
        baseIcon.infoWindowAnchor = new GPoint(9, 2);
		var icon = new GIcon(baseIcon); 
				
	    icon.image = obj_arr[0][7];
		icon.iconSize = new GSize(67, 47);
		
		map.addOverlay(createMarker(point,infoHTML,icon));
		var icon2 = new GIcon(baseIcon); 
		if (obj_arr.length>1){
		  for (i = 1; i < obj_arr.length; i++){
		    infoHTML="";
		    point =new GLatLng(parseFloat(obj_arr[i][3]), parseFloat(obj_arr[i][4]));
			infoHTML=show_life_html(obj_arr[i][1],obj_arr[i][2],obj_arr[i][5],obj_arr[i][6]);
			
			
			icon2.iconAnchor = new GPoint(15,30);
		    icon2.infoWindowAnchor = new GPoint(9, 2);
			icon2.image =obj_arr[i][7];
			icon2.iconSize = new GSize(30,30);
		    map.addOverlay(createMarker(point,infoHTML,icon2));
		  }}
		
	 
	  function createMarker(point,infoHTML,icon) {
	     //var opts = { maxWidth : 100};
		  var marker = new GMarker(point,icon); 
		    GEvent.addListener(marker, "mouseover", function(){marker.openInfoWindowHtml(infoHTML,{ maxWidth : 100});  });
		    return marker;
		}
	  
	 } 
	
    }
	
	//-------------------------1---2----5----6
	function show_life_html(title,tel,zlink,address) {
	    var strr="";
	    strr="<table width='150' border='0' cellspacing='2' cellpadding='0'>";
        strr+="<tr>";
        strr+="<td width='62' align='right' class='Word12B'><img src='../_img/_layout/tip_07.gif' width='12' height='12' />地點名稱</td>";
        strr+="<td width='12' align='center'><img src='../_img/_layout/tip_06.gif' width='12' height='12' /></td>";
        strr+="<td align='left' class='NewWord'><a href="+zlink+" TARGET='_BLANK'>"+title+"</a></td>";
        strr+="</tr>";
       
        strr+="</table>";
		return strr;
	}
	
	function show_build_html(title,tel,zlink,address) {
	    var infoHTML="";
	    infoHTML="<table style=\"margin:0px;border=1px\" width='200'  cellspacing='2' cellpadding='0'>";
        infoHTML+="<tr>";
        infoHTML+="<td width='62' align='left' class='Word12B'><img src='../_img/_layout/tip_07.gif' width='12' height='12' />建案名稱</td>";
        infoHTML+="<td width='12' align='center'><img src='../_img/_layout/tip_06.gif' width='12' height='12' /></td>";
        infoHTML+="<td align='left' class='NewWord'><a href="+zlink+" TARGET='_BLANK'>"+title+"</a></td>";
        infoHTML+="</tr>";
        infoHTML+="<tr>";
        infoHTML+="<td align='left' class='Word12B'><img src='../_img/_layout/tip_07.gif' width='12' height='12' />服務電話</td>";
        infoHTML+="<td><img src='../_img/_layout/tip_06.gif' width='12' height='12' /></td>";
        infoHTML+="<td align='left' class='NewWord'>"+tel+"</td>";
        infoHTML+="</tr>";
        infoHTML+="<tr>";
        infoHTML+="<td align='left' valign='top' class='Word12B'><img src='../_img/_layout/tip_07.gif' width='12' height='12' />接待中心</td>";
        infoHTML+="<td valign='top'><img src='../_img/_layout/tip_06.gif' width='12' height='12' /></td>";
        infoHTML+="<td  align='left' valign='top' class='NewWord'>"+address+"</td>";
        infoHTML+="</tr>";
        infoHTML+="</table>";;
		return infoHTML;
	}
	
	 function StrToAry(str){
    //規則str=  xxxx|xxxx|xxx&xxxx|xxxx|xxx&xxxx|xxxx|xxx&.....
    var ipt = new Array();
    post1=str.split("∫");
	count_rec=post1.length;
	
	var i=0;
	var info="";
	for (i = 0; i <count_rec; i++){
	   ipt[i]= new Array();
	   inner_y=post1[i].split("|");
	   ipt[i]=inner_y;
	 }
	// dump(ipt);
     return ipt;
   
  }
  
 
  
  function sh_array(ary){
 
    count_rec=ary.length;
	if (count_rec>0){
	   for (i = 0; i <=count_rec-1; i++){
         document.write(ary[i].toString()+"<br>");
	   }
	   	//document.write(ary[0].toString()+"<br>"); 
	}
  }
   
			 
		 
  
