


function checkstr(str,digit){
	var n=0;
	for(i=0;i<str.length;i++){
		var leg=str.charCodeAt(i);
		if(leg>255){
		   	n+=2;
		}else {
			n+=1;
		}
	}
	if (n>digit){
		return true;
	}else {
		return false;
	}	 	 
}	
function checkfk(){
var name5=fkinfo.fkleixing.value;
	if(name5=="0"){
		alert("请先选择反馈类型");
		fkinfo.fkleixing.focus();
		return;
	}
	var name=fkinfo.fksubject.value;
	if(name==""){
		alert("标题不能为空");
		fkinfo.fksubject.focus();
		return;
	}else{
		if(checkstr(name,30)){
			alert("标题长度不能超过30个字符，请重新输入！");
			fkinfo.fksubject.focus();
			return;
		}
	}
	var name1=fkinfo.fkusername.value;
	if(name1==""){
		alert("姓名不能为空");
		fkinfo.fkusername.focus();
		return;
	}else{
		if(checkstr(name1,20)){
			alert("姓名长度不能超过20个字符，请重新输入！");
			fkinfo.fkusername.focus();
			return;
		}
	}
	var name2=fkinfo.fktel.value;
	if(name2==""){
		alert("电话不能为空");
		fkinfo.fktel.focus();
		return;
	}else{
		if(checkstr(name2,20)){
			alert("电话号码长度不能超过20个字符，请重新输入！");
			fkinfo.fktel.focus();
			return;
		}
	}

var name3=fkinfo.fklaizi.value;
	if(name3==""){
		alert("地址不能为空");
		fkinfo.fklaizi.focus();
		return;
	}else{
		if(checkstr(name3,100)){
			alert("地址长度不能超过100个字符，请重新输入！");
			fkinfo.fklaizi.focus();
			return;
		}
	}
	var name4=fkinfo.fkcontent.value;
	if(name4==""){
		alert("反馈不能为空");
		fkinfo.fkcontent.focus();
		return;
	}else{
		if(checkstr(name4,600)){
			alert("反馈不能超过600个字符，请重新输入！");
			fkinfo.fkcontent.focus();
			return;
		}
	}
	var name500=fkinfo.SafeCode.value;
	if(name500==""){
		alert("验证码不能为空");
		fkinfo.SafeCode.focus();
		return;
	}
	fkinfo.submit();
}				     
