function checkInput(){
	if(!j_username()||!j_accounts()||!j_email()||!j_text()){
		return;
	}
	if(!valima('valicodes'))
	{
		return;
	}
	//document.le.action="../../web/LeaveWordCommand?types=1";
	//document.le.method="post";
	//document.le.submit();	
	showadd();
}
function j_text()
{
 document.getElementById("contentsError").innerHTML = "";
 var contents = document.getElementById("contents").value;
 if(contents=="")
 {
  document.getElementById("contentsError").innerHTML = "<font color=\"red\">请填写留言内容!<font><br>";
  return false;
 }
 else if(contents.length > 200)
 {
  document.getElementById("contentsError").innerHTML = "<font color=\"red\">你输入的内容长度太长！请控制在200字以内！<font><br>";
  return false;
 }
 return true;
 }
 
 
function j_username()
{
 document.getElementById("NameError").innerHTML = "";
 var name = document.getElementById("name").value;
 if(name=="")
 {
  document.getElementById("NameError").innerHTML = "<font color=\"red\">用户名不能为空!<font><br>";
  return false;
 }
 else if(name.length < 2)
 {
  document.getElementById("NameError").innerHTML = "<font color=\"red\">你输入的用户名长度太短！<font><br>";
  return false;
 }
 return true;
 }
  function j_accounts(){
 document.getElementById("accountsError").innerHTML = "";
 var accounts = document.getElementById("accounts").value;
 if(accounts=="")
 {
  document.getElementById("accountsError").innerHTML = "<font color=\"red\">请输入您的联系方式!<font><br>";
  return false;
 }
 return true;
 }
 //check email
 
 function j_email()
{
	document.getElementById("EmailError").innerHTML = "";
 var email = document.getElementById("email").value;
 var reg = /^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@(([0-9a-zA-Z])+([-\w]*[0-9a-zA-Z])*\.)+[a-zA-Z]{2,9})$/;
 if(!email.match(reg))
 {
  document.getElementById("EmailError").innerHTML = "<font color=\"red\">邮件地址无效!<font>";
  return false;
 }
 return true;
 }