
function chgSortOrder(lastOrder) {
	var newOrder = "";
	if (lastOrder != "") {
		if (lastOrder == "asc") {
			newOrder = "desc";
		} else {
			if (lastOrder == "desc") {
				newOrder = "asc";
			}
		}
	} else { //first time order is asc(default)
		newOrder = "asc";
	}
	return newOrder;
}
function ChineseLenLimit(str, maxLen) {
	var Strs = str;
	var strlength = 0;
	var i;
	for (i = 0; i < str.length; i++) {
		if (str.charCodeAt(i) >= 1000) {
			strlength += 2;
		} else {
			strlength += 1;
		}
	}
	if (strlength > maxLen) {
		return false;
	}
	return true;
}
function isEmail(theStr) {
	var atIndex = theStr.indexOf("@");
	var dotIndex = theStr.indexOf(".", atIndex);
	var flag = true;
	var theSub = theStr.substring(0, dotIndex + 1);
	if ((atIndex < 1) || (atIndex != theStr.lastIndexOf("@")) || (dotIndex < atIndex + 2) || (theStr.length <= theSub.length)) {
		flag = false;
	} else {
		flag = true;
	}
	return (flag);
}
function openwindow(url, winname) {
	window.open(url, winname, "width=800,height=600,toolbar=no,directories=no,menubar=no");
}
function show_waiting_window(message) {
	if (message + "." == "undefined." || message == "") {
		message = "\u6b63\u5728\u767b\u5f55\u4e2d\uff0c\u8bf7\u7a0d\u5019 .....";
	}
	document.all["Waiting_Window"].style.display = "block"; //show the window
	document.getElementById("Waiting_Msg").innerText = message; //display the message
}
function hide_waiting_window() {
	document.all["Waiting_Window"].style.display = "none"; //hide the window
}

