var xmlHttp = false;
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}

function changeNum(godId,salePrice) //change the num
{
  var num = document.getElementById("num").value;
  var curr = document.getElementById("curr").value;
  var url = "updatepro1.asp?godId="+godId+"&num="+num+"&curr="+curr+"&salePrice="+salePrice;
  xmlHttp.open("GET", url, true);
  xmlHttp.onreadystatechange = updateNum;
  xmlHttp.send(null);  
}

function updateNum() //update the num
{
  if (xmlHttp.readyState < 4) {
	document.getElementById("str1").innerHTML="<font style='color:#ff0000;'>正在更新价格,请稍等</font>";
	document.getElementById("str2").innerHTML="<font style='color:#ff0000;'>正在更新价格,请稍等</font>";
	document.getElementById("str3").innerHTML="<font style='color:#ff0000;'>正在更新价格,请稍等</font>";
	document.getElementById("str4").innerHTML="<font style='color:#ff0000;'>正在更新价格,请稍等</font>";
	document.getElementById("str5").innerHTML="<font style='color:#ff0000;'>正在更新价格,请稍等</font>";
	document.getElementById("str6").innerHTML="<font style='color:#ff0000;'>正在更新价格,请稍等</font>";
  }
  if (xmlHttp.readyState == 4) {
    var response = xmlHttp.responseText.split("|");
	document.getElementById("str1").innerHTML=response[0];
	document.getElementById("str2").innerHTML=response[1];
	document.getElementById("str3").innerHTML=response[2];
	document.getElementById("str4").innerHTML=response[3];
	document.getElementById("str5").innerHTML=response[4];
	document.getElementById("str6").innerHTML=response[5];
	document.getElementById("payUnit").value=response[6];
	document.getElementById("foreignPrice").value=response[7];
	document.getElementById("totalFund").value=response[8];
  }
}
