// JavaScript Document
//XMLHttpRequestオブジェクト生成
function createHttpRequest(){

  //Win ie用
  if(window.ActiveXObject){
      try {
          //MSXML2以降用
          return new ActiveXObject("Msxml2.XMLHTTP") //[1]'
      } catch (e) {
          try {
              //旧MSXML用
              return new ActiveXObject("Microsoft.XMLHTTP") //[1]'
          } catch (e2) {
              return null
          }
       }
  } else if(window.XMLHttpRequest){
      //Win ie以外のXMLHttpRequestオブジェクト実装ブラウザ用
      return new XMLHttpRequest() //[1]'
  } else {
      return null
  }
}


  //ファイルにアクセスし受信内容を確認します
 function asyncGet( targetObj ,  url  )
 {
	//XMLHttpRequestオブジェクト生成
	var xmlReq = createHttpRequest() //[1]
	
	xmlReq.onreadystatechange = function() 
	{
		var textValue = document.getElementById(targetObj);
		
		if(textValue != null)
		{
			if (xmlReq.readyState == 4) 
			{
		    	if (xmlReq.status == 200) 
		    	{
		        	textValue.innerHTML = xmlReq.responseText;
		      	} 
		      	else 
		      	{
		        	textValue.innerHTML = "通信に失敗しました。"+url;
		      	}
		    } 
		    else 
		    {
		    	textValue.innerHTML = "";
		    }
		}
  	}

  	xmlReq.open("GET", url, true);
  	xmlReq.send(null);	
    
 }

 //URLにアクセスし受信内容を確認します
 function asyncGetValue(url)
  {
  	//XMLHttpRequestオブジェクト生成
 	var xmlReq = createHttpRequest() //[1]
 	xmlReq = new XMLHttpRequest();
 	xmlReq.open("GET", url, false);
 	xmlReq.send(null);

 	return xmlReq.responseText;
     
  }

