var MSIE = navigator.userAgent.indexOf('MSIE')>=0?true:false;
var regExp = new RegExp(".*MSIE ([0-9]\.[0-9]).*","g");
var navigatorVersion = navigator.userAgent.replace(regExp,'$1');



function AJ_AQUA_get_addr(point_x, point_y)
{
	params = "0&X="+point_x+"&Y="+point_y;
	AJ_AQUA_dataReq(params);

}




function AJ_AQUA_dataReq(params)
{
  httpObj = AJ_AQUA_createXMLHttpRequest(AJ_AQUA_displayData);
  if (httpObj)
  {
    point = document.URL.indexOf("https");
    var date = new Date();
    ms = date.getTime();
    if (point < 0){
      httpObj.open("GET","http://aqua.sun.ddns.vc/free/map_point/pg/"+"getadr.php?PM="+params+"&DMY="+ms,true);
    }
    else{
      httpObj.open("GET","https://aqua.sun.ddns.vc/free/map_point/pg/"+"getadr.php?PM="+params+"&DMY="+ms,true);
    }
    //httpObj.open("GET","http://aqua.sun.ddns.vc/free/map_point/pg/"+"getadr.php?PM="+params+"&DMY="+ms,true);
    httpObj.send("");
  }
}

function AJ_AQUA_displayData()
{
  if ((httpObj.readyState == 4) && (httpObj.status == 200)){
    document.getElementById("adr_nm").innerHTML = httpObj.responseText;
  }
  else{
    document.getElementById("adr_nm").innerHTML = "<font color=#808080>Search...</font>";
  }
}


function AJ_AQUA_createXMLHttpRequest(cbFunc)
{

  var XMLhttpObject = null;
  try{
    XMLhttpObject = new XMLHttpRequest();
  }catch(e){
    try{
      XMLhttpObject = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
      try{
        XMLhttpObject = new ActiveXObject("Microsoft.XMLHTTP");
      }catch(e){
        return null;
      }
    }
  }
  if (XMLhttpObject) XMLhttpObject.onreadystatechange = cbFunc;

  return XMLhttpObject;
}
