﻿<!--
// text counter
function textCounter(field, countfield, maxlimit) { 
	if (document.getElementById(field).value.length > maxlimit) { document.getElementById(field).value=document.getElementById(field).value.substring(0, maxlimit); } else { document.getElementById(countfield).value=maxlimit - document.getElementById(field).value.length; }
}

// replace
function trim(eString) { return eString.replace(/(^[\s\u3000]*)|([\s\u3000]*$)/g, ""); } //判断全半角空格

// eecheck
function eecheck() {
if (document.formadd.cctitle.value.length < 1) {
	alert("提示:主题不能为空!");
	document.formadd.cctitle.focus();
	return false;
}
if (document.formadd.ccname.value.length < 1) {
	alert("提示:留言人不能为空!");
	document.formadd.ccname.focus();
	return false;
}
if (document.formadd.ccmail.value.length < 50 && !document.formadd.ccmail.value.match("^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$") || (document.formadd.ccmail.value.length > 0 && document.formadd.ccmail.value.length < 8)) {
	alert("提示:联系邮箱填写有错误!");
	document.formadd.ccmail.focus();
	return false;
}
if (document.formadd.ccccc.value.length < 1) {
	alert("提示:留言内容不能为空!");
	document.formadd.ccccc.focus();
	return false;
}
document.formadd.elements["Submit"].disabled=true;
document.formadd.elements["Submit"].value="提交中";
document.formadd.submit()
}
//-->

