// JavaScript Document
function createXmlHttpRequestObject(){ //创建 XML Http Request 对象
  var xmlHttp = "";
		 try{
			xmlHttp = new XMLHttpRequest();
			  if(xmlHttp.overrideMimeType)
			  		xmlHttp.overrideMimeType("text/xml");
		 }
		 catch(e){
			 var xmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0",
											  "MSXML2.XMLHTTP.5.0",
											  "MSXML2.XMLHTTP.4.0",
											  "MSXML2.XMLHTTP.3.0",
											  "MSXML2.XMLHTTP",
											  "Microsoft.XMLHTTP");
			 for(var i=0;i<xmlHttpVersions.length && !xmlHttp; i++){
				 try{
					 xmlHttp = new ActiveXObject(xmlHttpVersions[i]);
				 }
				 catch (e) {}
			 }
		 } 
		 return xmlHttp;
}
function  GetInfoYahooeBay(jpnidstr,vcc){ //使用 XML Http Request 对象创建异步HTTP请求


var xmlHttp = createXmlHttpRequestObject();
var DIVBox = ""; 
var ServerPage = "Getinfo_USvsJP.php";


  var QueryStr = "?jpnid="+encodeURIComponent(jpnidstr)+"&cc="+encodeURIComponent(vcc)+"&rnd="+Math.random();
  var url = ServerPage + QueryStr;
	if(xmlHttp.readyState == 4 || xmlHttp.readyState == 0){
		xmlHttp.open("GET",url,true);
		xmlHttp.setRequestHeader("Content-Type","text/xml;charset=utf-8;");
		xmlHttp.onreadystatechange = outdata;
		xmlHttp.send(null);
		DIVBox = "";
 		DIVBox = jpnidstr;

	}
	else{
		setTimeout('GetInfoYahooeBay("'+jpnidstr+'","'+vcc+'")',500);
	}
	
	function outdata()
	{ //获取服务器返回的消息 
     if(xmlHttp.readyState == 4){
	  if (xmlHttp.status == 200){
		  var response = xmlHttp.responseText; 
		 if(typeof(response) != 'null' || typeof(response) != "" )
		 
		  	getID(DIVBox).innerHTML = response;
	  } 
	} 
}
}

 
function getID(a){
	return window.document.getElementById(a);
}
function Split(str,a){
   var tmp;
   tmp = str.split(a);
   return(ss);
}
