window.__$ = function(id, tagName) {
	if (!tagName) {
		return document.getElementById(id);
	} else {
		return document.getElementById(id).getElementsByTagName(tagName);
	}
};
function Loading(id) {
	if (id)
		this.fid = id;
};
Loading.prototype = {
	open : function(d) {
		if (d)
			__$(d).style.display = "none";
		__$(this.fid).style.display = "block";
	},
	closed : function(c) {
		__$(this.fid).style.display = "none";
		if (c)
			__$(c).style.display = "block";
	}
};
var pjtName = "clstest1";
function MyAjax(url) {
	this.url = url;
	this.xmlHttp = {};
};
// 给MyAjax加方法

MyAjax.prototype.createXMLHttpRequest = function() {
	if (window.XMLHttpRequest) {
		this.xmlHttp = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		this.xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
};
MyAjax.prototype.sendPostRequest = function(queryString, handle) {
	this.createXMLHttpRequest();
	this.xmlHttp.open("POST", this.url, true);
	this.xmlHttp.onreadystatechange = handle;
	this.xmlHttp.setRequestHeader("Content-Type",
			"application/x-www-form-urlencoded; charset=UTF-8");
	this.xmlHttp.send(queryString);
};
MyAjax.prototype.sendPostRequest = function(queryString, url, winnercallback) {
	this.createXMLHttpRequest();
	this.xmlHttp.open("POST", url, true);
	this.xmlHttp.onreadystatechange = winnercallback;
	this.xmlHttp.setRequestHeader("Content-Type",
			"application/x-www-form-urlencoded; charset=UTF-8");
	this.xmlHttp.send(queryString);
};
function pagesSplit(obj, page) {
	var ma = new MyAjax(obj.urr + "&split=1");
	document.getElementById(obj.divId).innerHTML = '<table width="100%" height="100%"><tr><td align="center" valign="middle"><img src="images/loading.gif" /></td></tr></table>';
	ma
			.sendPostRequest(
					obj.params + "&" + page,
					function() {
						if (ma.xmlHttp.readyState == 4) {
							if (ma.xmlHttp.status == 200) {
								document.getElementById(obj.divId).innerHTML = ma.xmlHttp.responseText;
							} else {
								alert("ma.xmlHttp.status=" + ma.xmlHttp.status);
							}
						} else {
						}
					});
}
function inputFocus(obj) {
	if (!obj)
		obj = this;
	obj.className = obj.className.replace(/xW_line/, "");
	obj.nextSibling.style.display = "none";
}
function ch(ary) {
	var flag = true;
	try {
		for ( var i = 0; i < ary.length; i++) {
			var input = __$(ary[i]);
			var label = input.nextSibling;
			label.style.display = "none";
			input.className = input.className.replace(/xW_line/, "");
			if (!(new RegExp("^" + label.getAttribute('regex') + "$"))
					.test(input.value)) {
				label.style.display = "block";
				input.className = "xW_line" + " " + input.className;
				flag = false;
			}
		}
	} catch (e) {
		return false;
	}
	return flag;
}