// JavaScript Document
/* Create a new XMLHttpRequest object to talk to the Web server */
var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
@end @*/
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}




function Ajax_getProductDetail(id,poid) {
  // Only go on if there are values for both fields
  if ((poid == null) || (poid == "")) return;
  if ((id == null) || (id == "")) return;
  // Build the URL to connect to
  var url = "product_info_snap.php/products_id/" + id;
  // Open a connection to the server
  xmlHttp.open("GET", url, true);
  // Setup a function for the server to run when it's done
  xmlHttp.onreadystatechange = function(){updatePage(id);};
  // Send the request
  xmlHttp.send(null);
}

function updatePage(id) {
 	if (xmlHttp.readyState == 4) {
   		 var response = xmlHttp.responseText;
		 document.getElementById('orderLoding'+id).style.display = 'none';
   		 document.getElementById('order'+id).innerHTML = response;
  	}else{
		//显示等待图标
		 document.getElementById('orderLoding'+id).style.display = 'block';
	}
}

