function newXmlHttp(){
	var xmlhttp = false;

	try{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e){
				xmlhttp = false;
			}
		}


	if(!xmlhttp && document.createElement){
		xmlhttp = new XMLHttpRequest();
	}

return xmlhttp;
}

function gettext(id1,id2,id3,id4){
 document.body.style.cursor= 'wait';
//document.body.style.cursor= 'url("doraemon_3a.gif")';

	var url = "gettext.php?act1="+id1+"&act2="+id2+"&act3="+id3+"&act4="+id4

	xmlhttp = newXmlHttp();
	xmlhttp.open("GET", url, false);
	xmlhttp.send(null); 

	document.getElementById("abc").innerHTML= xmlhttp.responseText;
if(id4=='travel'){showAddress(id3)}
document.body.style.cursor= 'default';
}



function popUpWindow(URL, N, W, H, S) { // name, width, height, scrollbars
	var winleft	=	(screen.width - W) / 2;
	var winup	=	(screen.height - H) / 2;
	winProp		=	'width='+W+',height='+H+',left='+winleft+',top='+winup+',scrollbars='+S+',resizable' + ',status=yes'
	Win			=	window.open(URL, N, winProp)
	if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }
}

function popUpTextArea(txt) {
	popUpWindow("http://flash-mini.com/thailand/map.php?act="+txt,'SH1',940,700,'no');
}



 var map = null;
    var geocoder = null;

    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        geocoder = new GClientGeocoder();
		   map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());

      }
    }

    function showAddress(address,address2) {
      if (geocoder) {
        geocoder.getLatLng(address2, function(point) {
            if (!point) {


      geocoder.getLatLng(address, function(point) {
            if (!point) {

            //  alert(address + " not found");
            } else {
              map.setCenter(point, 10);
              var marker = new GMarker(point);
              map.addOverlay(marker);
             marker.openInfoWindowHtml(address+' อยู่ที่นี่');
  GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(address+' อยู่ที่นี่'); });
            }
          }
        );
            //  alert(address + " not found");
            } else {
              map.setCenter(point, 10);
              var marker = new GMarker(point);
              map.addOverlay(marker);
             marker.openInfoWindowHtml(address2+' อยู่ที่นี่');
  GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(address2+' อยู่ที่นี่'); });
            }
          }
        );


      }
    }
