function GET_AJAX() {
	try { return new ActiveXObject("Msxml2.XMLHTTP");  } catch(e) {
		try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {
			try { return new XMLHttpRequest();          } catch(e) {}
		}
	}
	
	return null;
}

function getHTML(_url) {
	var _ajax = GET_AJAX();
	if (!_ajax) {
		return '';
	}
	
	var _html = '';
	try {
		_ajax.open("GET",_url,false);
		_ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=GB2312"); 
		_ajax.send(null);
		if (_ajax.readyState == 4 && _ajax.status == 200) {
			_html = _ajax.responseText;
		}
	} catch(e) {}
	
	return _html;
}

function getObjsByFix(theform,_id) {
	var _boxes = [];
	var _n = theform.length;
	
	var _pat = "^"+_id+"_\\w+$";
	var rege = new RegExp(_pat);
	
	for (var i = 0; i < _n; i++) {
		if (rege.test(theform[i].id)) {
			_boxes.push(theform[i]);
		}
	}
	
	return _boxes;
}

function openWnd() {
	var args = arguments;
	var n = args.length;
	
	url = args[0];
	
	var width = 500;
	if (n >= 2) {
		width = args[1];
	}
	
	var height = 500;
	if (n >= 3) {
		height = args[2];
	}
	
	window.open(url,null,'width='+width+', height='+height+', directories=no,  location=no,  menubar=no, resizable=no, scrollbars=1,  status=no,  toolbar=no');
	return false;
}

function SELECT_ALL(me,_id) {
	var theform = me.form;
	
	var _boxes = getObjsByFix(theform,_id);
	
	_n = _boxes.length;
	for (var i = 0; i < _n; i++) {
		try {
			_boxes[i].checked = me.checked;
		} catch(e) {}
	}
	
	return true;
}
