function checkFrom(){
	if(!test_name(document.getElementById('name').value)){
		alert("姓名不能小于2或大于20，请重新输入!");
		return false;
	}
	if(!test_company(document.getElementById('company').value)){
		alert("公司名不能大于40，请重新输入!");
		return false;
	}
	if(!test_content(document.getElementById('content').value)){
		alert("留言信息不能小于5或大于200，请重新输入!");
		return false;
	}
	if(!test_email(document.getElementById('email').value)){
		alert("电邮信息有误，请重新输入!");
		return false;
	}
}
function test_name(str_name){
	if(str_name.length < 2 || str_name.length >20){
		return false;
	} else {
		return true;	
	}
}
function test_company(str_company){
	if(str_company.length > 40){
		return false;
	} else {
		return true;	
	}
}
function test_email(str_email){
	if(str_email.length > 20){
		return false;
	} else {
		return true;	
	}
}
function test_content(str_content){
	if(str_content.length > 200 || str_content.length < 5){
		return false;
	} else {
		return true;	
	}
}

