
function formatNumber(number, pattern) {
	var str = number.toString();
	var strInt;
	var strFloat;
	var formatInt;
	var formatFloat;
	if (/\./g.test(pattern)) {
		formatInt = pattern.split(".")[0];
		formatFloat = pattern.split(".")[1];
	} else {
		formatInt = pattern;
		formatFloat = null;
	}
	if (/\./g.test(str)) {
		if (formatFloat != null) {
			var tempFloat = Math.round(parseFloat("0." + str.split(".")[1]) * Math.pow(10, formatFloat.length)) / Math.pow(10, formatFloat.length);
			strInt = (Math.floor(number) + Math.floor(tempFloat)).toString();
			strFloat = /\./g.test(tempFloat.toString()) ? tempFloat.toString().split(".")[1] : "0";
		} else {
			strInt = Math.round(number).toString();
			strFloat = "0";
		}
	} else {
		strInt = str;
		strFloat = "0";
	}
	if (formatInt != null) {
		var outputInt = "";
		var zero = formatInt.match(/0*$/)[0].length;
		var comma = null;
		if (/,/g.test(formatInt)) {
			comma = formatInt.match(/,[^,]*/)[0].length - 1;
		}
		var newReg = new RegExp("(\\d{" + comma + "})", "g");
		if (strInt.length < zero) {
			outputInt = new Array(zero + 1).join("0") + strInt;
			outputInt = outputInt.substr(outputInt.length - zero, zero);
		} else {
			outputInt = strInt;
		}
		var outputInt = outputInt.substr(0, outputInt.length % comma) + outputInt.substring(outputInt.length % comma).replace(newReg, (comma != null ? "," : "") + "$1");
		outputInt = outputInt.replace(/^,/, "");
		strInt = outputInt;
	}
	if (formatFloat != null) {
		var outputFloat = "";
		var zero = formatFloat.match(/^0*/)[0].length;
		if (strFloat.length < zero) {
			outputFloat = strFloat + new Array(zero + 1).join("0");
			//outputFloat        = outputFloat.substring(0,formatFloat.length);
			var outputFloat1 = outputFloat.substring(0, zero);
			var outputFloat2 = outputFloat.substring(zero, formatFloat.length);
			outputFloat = outputFloat1 + outputFloat2.replace(/0*$/, "");
		} else {
			outputFloat = strFloat.substring(0, formatFloat.length);
		}
		strFloat = outputFloat;
	} else {
		if (pattern != "" || (pattern == "" && strFloat == "0")) {
			strFloat = "";
		}
	}
	return strInt + (strFloat == "" ? "" : "." + strFloat);
}
function checkFloat(number) {
	if (isNaN(number)) {
		alert("\u8bf7\u8f93\u5165\u6570\u5b57");
		return false;
	} else {
		return true;
	}
}
function checkInt(number) {
	var re = new RegExp("^-?\\d+$");
	if (!re.test(number)) {
		alert("\u8bf7\u8f93\u5165\u6574\u6570");
		return false;
	} else {
		return true;
	}
}
function convertToWeight(pm, number) {
	if (number.toString().indexOf(",") >= 0) {
		number = number.toString().replace(new RegExp(",", "gm"), "");
	}
	if (!checkFloat(number)) {
		return false;
	}
	var str = number.toString();
	var strFloat = str.substring(str.indexOf(".") + 4, str.indexOf(".") + 8);
	if ("" == strFloat || null == strFloat || "000" == strFloat || "00" == strFloat || "0" == strFloat) {
		return parseFloat(Math.round(number * 1000) / 1000).toFixed(3);
	} else {
		return parseFloat(Math.round(number * 1000000) / 1000000).toFixed(6);
	}
}
function convertToNumber(pm, number) {
	if (!checkInt(number)) {
		return false;
	}
	return number;
}
function convertToPrice(number) {
	if (!checkFloat(number)) {
		return false;
	}
	var str = number.toString();
	return parseFloat(Math.round(number * 100) / 100).toFixed(2);
}
//转换大写金额
function convertCurrency(currencyDigits) {
	var MAXIMUM_NUMBER = 99999999999.99;
	var CN_ZERO = "\u96f6";
	var CN_ONE = "\u58f9";
	var CN_TWO = "\u8d30";
	var CN_THREE = "\u53c1";
	var CN_FOUR = "\u8086";
	var CN_FIVE = "\u4f0d";
	var CN_SIX = "\u9646";
	var CN_SEVEN = "\u67d2";
	var CN_EIGHT = "\u634c";
	var CN_NINE = "\u7396";
	var CN_TEN = "\u62fe";
	var CN_HUNDRED = "\u4f70";
	var CN_THOUSAND = "\u4edf";
	var CN_TEN_THOUSAND = "\u4e07";
	var CN_HUNDRED_MILLION = "\u4ebf";
	//var CN_SYMBOL = "￥:";
	var CN_SYMBOL = "";
	var CN_DOLLAR = "\u5143";
	var CN_TEN_CENT = "\u89d2";
	var CN_CENT = "\u5206";
	var CN_INTEGER = "\u6574";
	
// Variables:
	var integral;	// Represent integral part of digit number.
	var decimal;	// Represent decimal part of digit number.
	var outputCharacters;	// The output result.
	var parts;
	var digits, radices, bigRadices, decimals;
	var zeroCount;
	var i, p, d;
	var quotient, modulus;

// Validate input string:
	currencyDigits = currencyDigits.toString();
	if (currencyDigits == "") {
		//alert("请输入要转换的数字!");
		return "";
	}
	if (currencyDigits.match(/[^,.\d]/) != null) {
		alert("\u6570\u5b57\u4e2d\u542b\u6709\u975e\u6cd5\u5b57\u7b26!");
		return "";
	}
	if ((currencyDigits).match(/^((\d{1,3}(,\d{3})*(.((\d{3},)*\d{1,3}))?)|(\d+(.\d+)?))$/) == null) {
		//alert("错误的数字格式!"); 
		return "";
	}
	
// Normalize the format of input digits:
	currencyDigits = currencyDigits.replace(/,/g, "");	// Remove comma delimiters.
	currencyDigits = currencyDigits.replace(/^0+/, "");	// Trim zeros at the beginning.
	// Assert the number is not greater than the maximum number.
	if (Number(currencyDigits) > MAXIMUM_NUMBER) {
		alert("\u8d85\u51fa\u8f6c\u6362\u6700\u5927\u8303\u56f4!");
		return "";
	}
	
// Process the coversion from currency digits to characters:
	// Separate integral and decimal parts before processing coversion:
	parts = currencyDigits.split(".");
	if (parts.length > 1) {
		integral = parts[0];
		decimal = parts[1];
		// Cut down redundant decimal digits that are after the second.
		decimal = decimal.substr(0, 2);
	} else {
		integral = parts[0];
		decimal = "";
	}
	// Prepare the characters corresponding to the digits:
	digits = new Array(CN_ZERO, CN_ONE, CN_TWO, CN_THREE, CN_FOUR, CN_FIVE, CN_SIX, CN_SEVEN, CN_EIGHT, CN_NINE);
	radices = new Array("", CN_TEN, CN_HUNDRED, CN_THOUSAND);
	bigRadices = new Array("", CN_TEN_THOUSAND, CN_HUNDRED_MILLION);
	decimals = new Array(CN_TEN_CENT, CN_CENT);
	// Start processing:
	outputCharacters = "";
	// Process integral part if it is larger than 0:
	if (Number(integral) > 0) {
		zeroCount = 0;
		for (i = 0; i < integral.length; i++) {
			p = integral.length - i - 1;
			d = integral.substr(i, 1);
			quotient = p / 4;
			modulus = p % 4;
			if (d == "0") {
				zeroCount++;
			} else {
				if (zeroCount > 0) {
					outputCharacters += digits[0];
				}
				zeroCount = 0;
				outputCharacters += digits[Number(d)] + radices[modulus];
			}
			if (modulus == 0 && zeroCount < 4) {
				outputCharacters += bigRadices[quotient];
			}
		}
		outputCharacters += CN_DOLLAR;
	}
	// Process decimal part if there is:
	if (decimal != "") {
		for (i = 0; i < decimal.length; i++) {
			d = decimal.substr(i, 1);
			if (d != "0") {
				outputCharacters += digits[Number(d)] + decimals[i];
			}
		}
	}
	// Confirm and return the final output string:
	if (outputCharacters == "") {
		outputCharacters = CN_ZERO + CN_DOLLAR;
	}
	if (decimal == "") {
		outputCharacters += CN_INTEGER;
	}
	outputCharacters = CN_SYMBOL + outputCharacters;
	return outputCharacters;
}
//打开对话框帮助
function do_help(url) {
	window.open(url, "help");
}
function useGlassLayer(v) { //v6.0
	v = (v == "show") ? "visible" : (v == "hide") ? "hidden" : v;
	var lyr = document.getElementById("body");
	var layerStyle = lyr.style;
	layerStyle.width = document.body.clientWidth;
	layerStyle.height = document.body.clientHeight;
	if (v == "visible") {
		moveGlassLayer();
	}
	layerStyle.visibility = v;
}
function moveGlassLayer() {
	var lyr = document.getElementById("body");
	lyr.style.top = document.body.scrollTop + document.body.offsetHeight - document.body.clientHeight - 10;
	lyr.style.left = document.body.scrollLeft + document.body.offsetWidth - document.body.clientWidth - 30;
	setTimeout("moveGlassLayer();", 80);
}
function resizeGlassLayer() {
	var lyr = document.getElementById("body");
	var layerStyle = lyr.style;
	layerStyle.width = document.body.clientWidth;
	layerStyle.height = document.body.clientHeight;
}
function showGlass(msg) {
	if (msg == null) {
		msg = "";
	}
	document.getElementById("tip").innerHTML = msg;
	useGlassLayer("show");
}
function hideGlass() {
	useGlassLayer("hidden");
}
function openModalDialog(url, width, height) {
	return window.showModalDialog(url, "", "dialogWidth:" + width + ";dialogHeight:" + height + ";dialogTop:scree.height/2-60;dialogLeft:scree.width/2-150;status:no;resizable=yes");
	var sWidth = new String(width);
	if (sWidth.indexOf("p") < 0) {
		sWidth += "pt";
	}
	var sHeight = new String(height);
	if (sHeight.indexOf("p") < 0) {
		sHeight += "pt";
	}
	var sFeatures = "dialogHeight:" + sHeight;
	//sFeatures+=";dialogLeft:"+iXPos;
	//sFeatures+=";dialogTop:"+iYPos;
	sFeatures += ";dialogWidth:" + sWidth;
	sFeatures += ";center:yes";	//{ yes | no | 1 | 0 } The default is yes.
	sFeatures += ";help:no";		//{ yes | no | 1 | 0 } The default is yes.
	sFeatures += ";resizable:no";	//{ yes | no | 1 | 0 } The default is no.
	sFeatures += ";status:no";	//{ yes | no | 1 | 0 } The default is yes for untrusted and no for trusted dialog windows
	sWidth = null;
	sHeight = null;
	var result = window.showModalDialog(url, "", sFeatures);
	return result;
}
function MM_openBrWindow(theURL, winName, features) {
	window.open(theURL, winName, features);
}
function openModalDlgDefW(url) {
	return openModalDialog(url, "350pt", "300pt");
}
function openModalDlgDefH(url) {
	return openModalDialog(url, "300pt", "350pt");
}
function openModalDialogMap(url, width, height) {
	return openModalDialog(url, width, height);
}
/**/
/*
 *    消息构造  
 */
function CLASS_MSN_MESSAGE(id, width, height, caption, title, message, target, action) {
	this.id = id;
	this.title = title;
	this.caption = caption;
	this.message = message;
	this.target = target;
	this.action = action;
	this.width = width ? width : 200;
	this.height = height ? height : 120;
	this.timeout = 150;
	this.speed = 20;
	this.step = 1;
	this.right = screen.width - 1;
	this.bottom = screen.height;
	this.left = this.right - this.width;
	this.top = this.bottom - this.height;
	this.timer = 0;
	this.pause = false;
	this.close = false;
	this.autoHide = false;
}
/**/
/*  
 *    隐藏消息方法  
 */
CLASS_MSN_MESSAGE.prototype.hide = function () {
	if (this.onunload()) {
		var offset = this.height > this.bottom - this.top ? this.height : this.bottom - this.top;
		var me = this;
		if (this.timer > 0) {
			window.clearInterval(me.timer);
		}
		var fun = function () {
			if (me.pause == false || me.close) {
				var x = me.left;
				var y = 0;
				var width = me.width;
				var height = 0;
				if (me.offset > 0) {
					height = me.offset;
				}
				y = me.bottom - height;
				if (y >= me.bottom) {
					window.clearInterval(me.timer);
					me.Pop.hide();
				} else {
					me.offset = me.offset - me.step;
				}
				me.Pop.show(x, y, width, height);
			}
		};
		this.timer = window.setInterval(fun, this.speed);
	}
};
/**/
/*  
 *    消息卸载事件，可以重写  
 */
CLASS_MSN_MESSAGE.prototype.onunload = function () {
	return true;
};
/**/
/*  
 *    消息命令事件，要实现自己的连接，请重写它  
 *  
 */
//CLASS_MSN_MESSAGE.prototype.oncommand = function(){
//  if(this.action!="")
//     window.parent.location.href=this.action;
//CLASS_MSN_MESSAGE.prototype.oncommand = function(){
//   window.parent.location.href=this.action;
//}  
/**/
/*  
 *    消息显示方法  
 */
CLASS_MSN_MESSAGE.prototype.show = function () {
	var oPopup = window.createPopup(); //IE5.5+  
	this.Pop = oPopup;
	var w = this.width;
	var h = this.height;
	var str = "<DIV style='BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX: 99999; LEFT: 0px; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: " + w + "px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: " + h + "px; BACKGROUND-COLOR:#e6e6fa'>";
	str += "<TABLE style='BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid' cellSpacing=0 cellPadding=0 width='100%' bgColor=#e6e6fa border=0>";
	str += "<TR>";
	str += "<TD style='FONT-SIZE: 12px;COLOR: #0f2c8c' width=30 height=24></TD>";
	str += "<TD style='PADDING-LEFT: 4px; FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: #1f336b; PADDING-TOP: 4px' vAlign=center width='100%'>" + this.caption + "</TD>";
	str += "<TD style='PADDING-RIGHT: 2px; PADDING-TOP: 2px' vAlign=center align=right width=19>";
	str += "<SPAN title=\u5173\u95ed style='FONT-WEIGHT: bold; FONT-SIZE: 12px; CURSOR: hand; COLOR: red; MARGIN-RIGHT: 4px' id='btSysClose' >\xd7</SPAN></TD>";
	str += "</TR>";
	str += "<TR>";
	str += "<TD style='PADDING-RIGHT: 1px;PADDING-BOTTOM: 1px' colSpan=3 height=" + (h - 28) + ">";
	str += "<DIV style='BORDER-RIGHT: #b9c9ef 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #728eb8 1px solid; PADDING-LEFT: 8px; FONT-SIZE: 12px; PADDING-BOTTOM: 8px; BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 8px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%'>" + this.title + "<BR><BR>";
	str += "<DIV style='WORD-BREAK: break-all' align=left id='btCommand'><FONT color=#ff0000 >" + this.message + "</FONT></DIV>";
	str += "</DIV>";
	str += "</TD>";
	str += "</TR>";
	str += "</TABLE>";
	str += "</DIV>";
	oPopup.document.body.innerHTML = str;
	this.offset = 0;
	var me = this;
	oPopup.document.body.onmouseover = function () {
		me.pause = true;
	};
	oPopup.document.body.onmouseout = function () {
		me.pause = false;
	};
	var fun = function () {
		var x = me.left;
		var y = 0;
		var width = me.width;
		var height = me.height;
		if (me.offset > me.height) {
			height = me.height;
		} else {
			height = me.offset;
		}
		y = me.bottom - me.offset;
		if (y <= me.top) {
			me.timeout--;
			if (me.timeout == 0) {
				window.clearInterval(me.timer);
				if (me.autoHide) {
					me.hide();
				}
			}
		} else {
			me.offset = me.offset + me.step;
		}
		me.Pop.show(x, y, width, height);
	};
	this.timer = window.setInterval(fun, this.speed);
	var btClose = oPopup.document.getElementById("btSysClose");
	btClose.onclick = function () {
		me.close = true;
		me.hide();
	};
	var btCommand = oPopup.document.getElementById("btCommand");
		///btCommand.onclick = function()
		//{
		//  me.oncommand();
		//}    
};
/**/
/* 
 ** 设置速度方法 
 **/
CLASS_MSN_MESSAGE.prototype.speed = function (s) {
	var t = 20;
	try {
		t = praseInt(s);
	}
	catch (e) {
	}
	this.speed = t;
};
/**/
/* 
 ** 设置步长方法 
 **/
CLASS_MSN_MESSAGE.prototype.step = function (s) {
	var t = 1;
	try {
		t = praseInt(s);
	}
	catch (e) {
	}
	this.step = t;
};
CLASS_MSN_MESSAGE.prototype.rect = function (left, right, top, bottom) {
	try {
		this.left = left != null ? left : this.right - this.width;
		this.right = right != null ? right : this.left + this.width;
		this.bottom = bottom != null ? (bottom > screen.height ? screen.height : bottom) : screen.height;
		this.top = top != null ? top : this.bottom - this.height;
	}
	catch (e) {
	}
};
function showDiscussMsg(msg, href) {
	var x = new CLASS_MSN_MESSAGE("1", 200, 120, "\u7cfb\u7edf\u63d0\u793a\u6846", "\u6d3d\u8c08\u4fe1\u606f", msg, "", href);
	x.speed = 20;
	x.step = 5;
	x.show();
}
function selectList(selectName, selectedValue) {
	for (var i = 0; i < selectName.options.length; i++) {
		if (selectName.options[i].value == selectedValue) {
			selectName.options.selectedIndex = i;
		}
	}
}
function isNullOrBlank(inputName) {
	if (inputName == null || inputName.value == "" || inputName.value == "null") {
		return true;
	} else {
		return false;
	}
}
function isNotSelected(checkBoxName) {
	if (checkBoxName.length == null) {
		if (checkBoxName.checked == false) {
			return true;
		}
	} else {
		var num = -1;
		for (var i = 0; i < checkBoxName.length; i++) {
			if (checkBoxName[i].checked) {
				num = num + 1;
			}
		}
		if (num == -1) {
			return true;
		}
	}
	return false;
}
function isNotNumber(arrayName) {
	for (var i = 0; i < arrayName.length; i++) {
		if (isNaN(arrayName[i].value)) {
			alert("\ufffd\ubc34\ufffd\ufffd\u0237\ufffd\ufffd\ufffd\ufffd\u0778\ufffd\u02bd\ufffd\ufffd\ufffd\ufffd!");
			arrayName[i].focus();
			return false;
		}
	}
}
function isDate(dateStr) {
	if (dateStr == null || dateStr == "") {
		return false;
	}
	if (isNaN(dateStr)) {
		return false;
	}
	if (dateStr.length != 8) {
		return false;
	}
	var yearStr = dateStr.substring(0, 4);
	var monthStr = dateStr.substring(4, 6);
	var dayStr = dateStr.substring(6);
	var month_val, year_val, day_val;
	year_val = parseInt(yearStr, 10);
	month_val = parseInt(monthStr, 10);
	day_val = parseInt(dayStr, 10);
	if (year_val < 1900 || year_val > 3000) {
		return false;
	}
	if (month_val < 1 || month_val > 12) {
		return false;
	}
	switch (month_val) {
	  case 1:
	  case 3:
	  case 5:
	  case 7:
	  case 8:
	  case 10:
	  case 12:
		if (day_val < 1 || day_val > 31) {
			return false;
		}
		break;
	  case 4:
	  case 6:
	  case 9:
	  case 11:
		if (day_val < 1 || day_val > 30) {
			return false;
		}
		break;
	  case 2:
		if ((year_val % 4 == 0 && year_val % 100 != 0) || year_val % 400 == 0) {
			if (day_val < 1 || day_val > 29) {
				return false;
			}
		} else {
			if (day_val < 1 || day_val > 28) {
				return false;
			}
		}
		break;
	  default:
	}
	return true;
}
function check_number(field, len1, len2) {
	var re = /^[0-9]{1,}\.{0,1}[0-9]{0,}0*$/;
	var js_value = field.value;
	if (js_value.length == 0) {
		return true;
	}
	if (js_value.match(re)) {
		var dot_position = js_value.indexOf(".");
		var int_value, dec_value;
		if (dot_position >= 0) {
			int_value = js_value.substring(0, dot_position);
			dec_value = js_value.substring(dot_position + 1);
		} else {
			int_value = js_value;
			dec_value = "";
		}
		if (int_value.length > len1) {
			alert("The integer digits are too long! It should be " + len1 + "digits");
			field.value = "";
			field.focus();
			return false;
		}
		if (dec_value.length > len2) {
			alert("The decimal digits are too long! It should be " + len2 + "digits");
			field.value = "";
			field.focus();
			return false;
		}
		return true;
	}
	alert("Please input a number!");
	field.value = "";
	field.focus();
	return false;
}
function not_null(js_obj) {
	var re, i;
	re = /^\s*$/;
	if (js_obj.length) {
		if (js_obj[0].type == "checkbox") {
			for (i = 0; i < js_obj.length; i++) {
				if (js_obj[i].checked == true) {
					return true;
				}
			}
			return false;
		} else {
			if (js_obj[0].type == "radio") {
				for (i = 0; i < js_obj.length; i++) {
					if (js_obj[i].checked == true) {
						return true;
					}
				}
				return false;
			}
		}
	} else {
		if (js_obj.type == "select-multiple") {
			if (js_obj.selectedIndex < 0) {
				return false;
			}
		} else {
			if (js_obj.type == "select-one") {
				if (js_obj.selectedIndex < 0) {
					return false;
				}
			} else {
				if (js_obj.type == "text") {
					if (js_obj.value.match(re)) {
						return false;
					}
				} else {
					if (js_obj.type == "checkbox") {
						if (js_obj.checked == false) {
							return false;
						}
					} else {
						if (js_obj.type == "radio") {
							if (js_obj.checked == false) {
								return false;
							}
						} else {
							if (js_obj.value.match(re)) {
								return false;
							}
						}
					}
				}
			}
		}
	}
	return true;
}
function is_number(js_value) {
	var re;
	re = /^\s*$/;
	if (js_value.match(re)) {
		return true;
	}
	if (isNaN(js_value)) {
		return false;
	}
	return true;
}
function is_integer(js_value) {
	var re;
	re = /^\s*$/;
	if (js_value.match(re)) {
		return true;
	}
	if (isNaN(js_value) || js_value.indexOf(".", 0) >= 0) {
		return false;
	}
	return true;
}
function is_phone(js_value) {
	var re = /^[0-9\*\-( )]*$/;
	if (js_value.match(re)) {
		return true;
	}
	return false;
}
function is_natural(js_value) {
	var re;
	re = /^\s*$/;
	if (js_value.match(re)) {
		return true;
	}
	re = /^\+{0,1}[0-9]*$/;
	if (!js_value.match(re)) {
		return false;
	}
	return true;
}
function is_zip(js_value) {
	var re;
	re = /^\s*$/;
	if (js_value.match(re)) {
		return true;
	}
	if (!is_natural(js_value) || js_value.length != 6) {
		return false;
	}
	return true;
}
function is_id_card(js_value) {
	var re;
	re = /^\s*$/;
	if (js_value.match(re)) {
		return true;
	}
	if (!is_natural(js_value) || (js_value.length != 15 && js_value.length != 18)) {
		return false;
	}
	return true;
}
function is_date(y_val, m_val, d_val, h_val, mi_val, s_val) {
	var month_val, year_val, day_val;
	var hour_val, minute_val, second_val;
	var re;
	re = /^\s*$/;
	if (y_val.match(re) && m_val.match(re) && d_val.match(re) && h_val.match(re) && mi_val.match(re) && s_val.match(re)) {
		return true;
	}
	if (!is_natural(y_val) || !is_natural(m_val) || !is_natural(d_val)) {
		return false;
	}
	if (!is_natural(h_val) || !is_natural(mi_val) || !is_natural(s_val)) {
		return false;
	}
	year_val = parseInt(y_val, 10);
	month_val = parseInt(m_val, 10);
	day_val = parseInt(d_val, 10);
	hour_val = parseInt(h_val, 10);
	minute_val = parseInt(mi_val, 10);
	second_val = parseInt(s_val, 10);
	if (isNaN(year_val) || isNaN(month_val) || isNaN(day_val)) {
		return false;
	}
	if (year_val < 1900 || year_val > 3000) {
		return false;
	}
	if (month_val < 1 || month_val > 12) {
		return false;
	}
	switch (month_val) {
	  case 1:
	  case 3:
	  case 5:
	  case 7:
	  case 8:
	  case 10:
	  case 12:
		if (day_val < 1 || day_val > 31) {
			return false;
		}
		break;
	  case 4:
	  case 6:
	  case 9:
	  case 11:
		if (day_val < 1 || day_val > 30) {
			return false;
		}
		break;
	  case 2:
		if ((year_val % 4 == 0 && year_val % 100 != 0) || year_val % 400 == 0) {
			if (day_val < 1 || day_val > 29) {
				return false;
			}
		} else {
			if (day_val < 1 || day_val > 28) {
				return false;
			}
		}
		break;
	  default:
	}
	if (hour_val < 0 || hour_val > 23) {
		return false;
	}
	if (minute_val < 0 || minute_val > 59) {
		return false;
	}
	if (second_val < 0 || second_val > 59) {
		return false;
	}
	return true;
}
function is_age(js_value) {
	var re;
	re = /^\s*$/;
	if (js_value.match(re)) {
		return true;
	}
	if (!is_natural(js_value)) {
		return false;
	}
	if (parseInt(js_value, 10) <= 0 || parseInt(js_value, 10) >= 200) {
		return false;
	}
	return true;
}
function is_price(js_value) {
	var re = /^\s*$/;
	var re1 = /^[0-9]{1,}\.{0,1}[0-9]{0,2}0*$/;
	if (js_value.match(re)) {
		return true;
	}
	if (js_value.match(re1)) {
		return true;
	}
	return false;
}
function is_double(js_value) {
	var re = /^\s*$/;
	var re1 = /^[0-9]{1,}\.{0,1}[0-9]{0,4}0*$/;
	if (js_value.match(re)) {
		return true;
	}
	if (js_value.match(re1)) {
		return true;
	}
	return false;
}
function is_email(js_value) {
	var pos;
	var re;
	re = /^\s*$/;
	if (js_value.match(re)) {
		return true;
	}
	pos = js_value.indexOf("@", 0);
	if (js_value.length <= 5) {
		return false;
	}
	if (pos == -1 || pos == 0 || pos == (js_value.length - 1)) {
		return false;
	}
	pos = js_value.indexOf(".", 0);
	if (pos <= 0 || pos == (js_value.length - 1)) {
		return false;
	}
	return true;
}
function is_gendre(js_value) {
	return true;
	var re;
	re = /^\s*$/;
	if (js_value.match(re)) {
		return true;
	}
	if (js_value != "N" && js_value != "M" && js_value != "F") {
		return false;
	}
	return true;
}
function is_url(js_value) {
	var pos, posdot;
	var re;
	re = /^\s*$/;
	if (js_value.match(re)) {
		return true;
	}
	pos = js_value.indexOf("://", 0);
	if (pos < 0) {
		return false;
	}
	posdot = js_value.lastIndexOf(".");
	if (posdot < pos) {
		return false;
	}
	if (posdot == js_value.length - 1) {
		return false;
	}
	return true;
}
function is_equal(js_value, confm) {
	if (js_value != confm.value) {
		return false;
	}
	return true;
}
function is_date_period(s_y_val, s_m_val, s_d_val, s_h_val, s_mi_val, s_s_val, e_y_val, e_m_val, e_d_val, e_h_val, e_mi_val, e_s_val) {
	if (!(is_date(s_y_val, s_m_val, s_d_val, s_h_val, s_mi_val, s_s_val) && is_date(e_y_val, e_m_val, e_d_val, e_h_val, e_mi_val, e_s_val))) {
		return false;
	}
	if (parseInt(s_y_val, 10) > parseInt(e_y_val, 10)) {
		return false;
	} else {
		if (parseInt(s_y_val, 10) == parseInt(e_y_val, 10)) {
			if (parseInt(s_m_val, 10) > parseInt(e_m_val, 10)) {
				return false;
			} else {
				if (parseInt(s_m_val, 10) == parseInt(e_m_val, 10)) {
					if (parseInt(s_d_val, 10) > parseInt(e_d_val, 10)) {
						return false;
					} else {
						if (parseInt(s_d_val, 10) == parseInt(e_d_val, 10)) {
							if (parseInt(s_h_val, 10) > parseInt(e_h_val, 10)) {
								return false;
							} else {
								if (parseInt(s_h_val, 10) == parseInt(e_h_val, 10)) {
									if (parseInt(s_mi_val, 10) > parseInt(e_mi_val, 10)) {
										return false;
									} else {
										if (parseInt(s_mi_val, 10) == parseInt(e_mi_val, 10)) {
											if (parseInt(s_s_val, 10) > parseInt(e_s_val, 10)) {
												return false;
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	return true;
}
function is_password(js_value) {
	var pass_length, i;
	var parsed_char;
	pass_length = js_value.length;

	//	check length first
	if (pass_length < 4 || pass_length > 30) {
		return false;
	}

	//	check characters should be alphabet or numeric or under_score
	for (i = 0; i < pass_length; i++) {
		parsed_char = js_value.toUpperCase().charAt(i);
		if (parsed_char >= "A" && parsed_char <= "Z") {
			continue;
		}
		if (parsed_char >= "0" && parsed_char <= "9") {
			continue;
		}

		//		if ( parsed_char == '_' )
		//			continue;
		if (parsed_char == "-") {
			continue;
		}
		return false;
	}
	return true;
}
function is_loginname(js_value) {
	var login_length, i;
	var parsed_char;
	login_length = js_value.length;

	//	check length first
	if (login_length < 4 || login_length > 30) {
		return false;
	}

	//	check characters should be alphabet or numeric or under_score
	for (i = 0; i < login_length; i++) {
		parsed_char = js_value.toUpperCase().charAt(i);
		if (parsed_char >= "A" && parsed_char <= "Z") {
			continue;
		}
		if (parsed_char >= "0" && parsed_char <= "9") {
			continue;
		}

		//		if ( parsed_char == '_' )
		//			continue;
		if (parsed_char == "-") {
			continue;
		}
		return false;
	}
	return true;
}
function select_all(js_obj) {
	var i;
	if (typeof (js_obj) == "object") {
		for (i = 0; i < js_obj.length; i++) {
			js_obj[i].checked = true;
		}
	}
	return true;
}
function cancel_all(js_obj) {
	var i;
	if (typeof (js_obj) == "object") {
		for (i = 0; i < js_obj.length; i++) {
			js_obj[i].checked = false;
		}
	}
	return true;
}
function window_open(url, win_name, win_prop) {
	tmp = window.open(url, win_name, win_prop);
	tmp.opener = window;
	tmp.focus();
}
function changeorder(obj) {
	document.all.order1.style.display = "none";
	document.all.order2.style.display = "none";
	if (obj.select3.value == 1) {
		document.all.order1.style.display = "";
	} else {
		if (obj.select3.value == 2) {
			document.all.order2.style.display = "";
		}
	}
}
function turnon(obj1) {
	obj1.style.background = "#F1E9D6";
}
function turnoff(obj1) {
	obj1.style.background = "#F8F3E9";
}
function MM_swapImgRestore() { //v3.0
	var i, x, a = document.MM_sr;
	for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) {
		x.src = x.oSrc;
	}
}
function MM_preloadImages() { //v3.0
	var d = document;
	if (d.images) {
		if (!d.MM_p) {
			d.MM_p = new Array();
		}
		var i, j = d.MM_p.length, a = MM_preloadImages.arguments;
		for (i = 0; i < a.length; i++) {
			if (a[i].indexOf("#") != 0) {
				d.MM_p[j] = new Image;
				d.MM_p[j++].src = a[i];
			}
		}
	}
}
function MM_findObj(n, d) { //v3.0
	var p, i, x;
	if (!d) {
		d = document;
	}
	if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
		d = parent.frames[n.substring(p + 1)].document;
		n = n.substring(0, p);
	}
	if (!(x = d[n]) && d.all) {
		x = d.all[n];
	}
	for (i = 0; !x && i < d.forms.length; i++) {
		x = d.forms[i][n];
	}
	for (i = 0; !x && d.layers && i < d.layers.length; i++) {
		x = MM_findObj(n, d.layers[i].document);
	}
	return x;
}
function MM_swapImage() { //v3.0
	var i, j = 0, x, a = MM_swapImage.arguments;
	document.MM_sr = new Array;
	for (i = 0; i < (a.length - 2); i += 3) {
		if ((x = MM_findObj(a[i])) != null) {
			document.MM_sr[j++] = x;
			if (!x.oSrc) {
				x.oSrc = x.src;
			}
			x.src = a[i + 2];
		}
	}
}
var click_no;
function Config_Submit_Page(p_cmd, inform) {
	if (click_no == "2") {
		alert("\ufffd\u047e\ufffd\ufffd\ufffd\ufffd\ufffd\u04bb\ufffd\ufffd\ufffd\ufffd!");
	} else {
		inform.cmd.value = p_cmd;
		if (check_valid(inform)) {
			click_no = "2";
			inform.submit();
		}
	}
}
function open_help(url) {
	window.open(url, "help", "menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=1,resizable=1,height=190,width=350");
}
//取模
function accMode(arg1, arg2) {
	var t1 = 0, t2 = 0, r1, r2;
	with (Math) {
		arg1 = parseFloat(arg1);
		arg2 = parseFloat(arg2);
		r1 = Number(arg1.toString().replace(".", ""));
		r2 = Number(arg2.toString().replace(".", ""));
		return (r1 % r2);
	}
}
			
//除法函数，用来得到精确的除法结果
//返回值：arg1除以arg2的精确结果 
function accDiv(arg1, arg2) {
	var t1 = 0, t2 = 0, r1, r2;
	try {
		t1 = arg1.toString().split(".")[1].length;
	}
	catch (e) {
	}
	try {
		t2 = arg2.toString().split(".")[1].length;
	}
	catch (e) {
	}
	with (Math) {
		r1 = Number(arg1.toString().replace(".", ""));
		r2 = Number(arg2.toString().replace(".", ""));
		return (r1 / r2) * pow(10, t2 - t1);
	}
}
//乘法
function accMul(arg1, arg2) {
	var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
	try {
		m += s1.split(".")[1].length;
	}
	catch (e) {
	}
	try {
		m += s2.split(".")[1].length;
	}
	catch (e) {
	}
	return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
}
//加法
function accAdd(arg1, arg2) {
	var r1, r2, m;
	try {
		r1 = arg1.toString().split(".")[1].length;
	}
	catch (e) {
		r1 = 0;
	}
	try {
		r2 = arg2.toString().split(".")[1].length;
	}
	catch (e) {
		r2 = 0;
	}
	m = Math.pow(10, Math.max(r1, r2));
	return (arg1 * m + arg2 * m) / m;
}
//减法
function accSubtr(arg1,arg2){
     var r1,r2,m,n;
     try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0}
     try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0}
     m=Math.pow(10,Math.max(r1,r2));
     //last modify by deeka
     //动态控制精度长度
     n=(r1>=r2)?r1:r2;
     return ((arg1*m-arg2*m)/m).toFixed(n);
}
 
function substringTwo(value){
 	 var r1,r2;
	 try{r1=value.toString().split(".")[0].length}catch(e){r1=0}
	 try{r2=value.toString().split(".")[1].length}catch(e){r2=0}
	 if(r2>2){
	 	return value.substring(0,r1+3);
	 }else{
	 	return value;
	 }
}
