
var id;

function retrieveURL(url,sid){
		//调用AJAX
		id = sid;
		if (window.XMLHttpRequest) {
			// 非IE浏览器
			req = new XMLHttpRequest();
			req.onreadystatechange = processStateChange;
			
			try {
				req.open("POST", url, true);
			} catch (e) {
			alert("Server Communication Problem\n"+e);
			}
			req.send(null);
		} else if (window.ActiveXObject) {
			// IE
			req = new ActiveXObject("Microsoft.XMLHTTP");
			
			if (req) {
				req.onreadystatechange=processStateChange;
				req.open("POST", url, true);
				req.send();
			}
	
		}
	}

	function processStateChange() {
		if (req.readyState == 4) { // 完成
			if (req.status == 200) { // 响应正常
				//将响应的文本分割成Span元素
				//alert(req.responseText);
				document.getElementById(id).innerHTML = req.responseText;
				
			} else {
				alert("Problem with server response:\n "+ req.statusText);
			}
		}
	}