function createRequestObject() {
	var ro;
	if (navigator.appName == "Microsoft Internet Explorer") {
		ro = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		ro = new XMLHttpRequest();
	}
	return ro;
	
}

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;
}

var  xmlhttp;



function index_load() {

	 document.getElementById("showData").innerHTML='<div id="wait" align="center"><br><br><br><br><br><br><br><br><br><img src="images/loading.gif"/><br /><br /><img src="images/txt_load.gif"/></div>';
	 xmlhttp = newXmlHttp();
     xmlhttp.onreadystatechange = function () { 
          if (xmlhttp.readyState==4) {
               if (xmlhttp.status==200) {
                    var data=xmlhttp.responseText; //รับค่ากลับมา
                    document.getElementById("showData").innerHTML=data; //แสดงผล แทนรูปรอโหลด
               } 
          } 
     };
	 xmlhttp.open("GET", "index_load.php", true); 
     xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); // set Header
     xmlhttp.send(null); //ส่งค่า
}

