window.onload = function() {
	init();
}

function init() {
}

var req;
function send(url) {
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}

	if (req) {
		req.open("GET", url, true);
		req.onreadystatechange = callback;
		req.setRequestHeader("Content-Type", "text/html;charset='utf-8'");
		req.send(null);
	}
}

function callback() {
	if (req.readyState == 4) {
		if (req.status == 200) {
			parseMessage();
		} else {
		}
	}
}

function send(url, pram) {
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (req) {
		req.open("GET", url, true);
		req.onreadystatechange = function() {
			callback2(pram);
		}
		req.setRequestHeader("Content-Type", "text/html;charset='utf-8'");
		req.send(null);
	}
}

function callback2(pram) {
	if (req.readyState == 4) {
		if (req.status == 200) {
			var xmlDoc = req.responseXML.documentElement;
			var xSel = xmlDoc.getElementsByTagName('values');
			var input_root = document.getElementsByName(pram)[0];
			var selectString = defaultOption();
			input_root.length = 0;
			if (pram != 'label')
				input_root.options.add(new Option(selectString, '-1'));
			for ( var i = 0; i < xSel.length; i++) {
				var xValue = xSel[i].childNodes[0].firstChild.nodeValue;
				var xText = xSel[i].childNodes[1].firstChild.nodeValue;
				input_root.options.add(new Option(xText, xValue));
			}
			load(pram);
		} else {
		}
	}
}

function defaultOption() {
	return '----请选择----';
}

function load(pram) {
}

