function createXMLHttpRequest(){
	var xmlHttp;
	if(window.XMLHttpRequest){ //Mozilla浏览器
		xmlHttp = new XMLHttpRequest();
	}else if (window.ActiveXObject){ // IE浏览器
		try{
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(err){
			try {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(err){
				return false;
			}
		}
	}
	return xmlHttp;
}

var xhttp = createXMLHttpRequest();

function getoid(pmethod,ooid){
	xhttp.open("GET",'/getoid.php?pm='+pmethod+'&id='+ooid,true);
	xhttp.onreadystatechange=callback;
	xhttp.send(null);
}

function callback(){
	if(xhttp.readyState == 4){
		if(xhttp.status == 200){
			var html = xhttp.responseText;
			document.getElementById("newdiv").innerHTML = html;
			window.alert("请注意,你重新支付的订单号为:"+document.getElementById("nid").value);
			document.getElementById("repay").submit();

			/*
			var ary;
			if(ary = html.substr(3).split("||")){
				document.getElementById(ary[0]+"ooid").value = ary[1];
				window.alert("请注意,你重新支付的订单号为:"+ary[1]);
				document.getElementById(ary[0]).submit();
			}
			*/
			delete xhttp;
		}
	}
}