function checkform(){
	if(theForm.username.value.length < 4 || theForm.username.value.length > 20 ) {
                alert("“用户名”要4-20字符，且只能是A-Za-z0-9和下划线_  ")
		theForm.username.focus();
                return false;
	}

	if(theForm.password.value.length < 4 || theForm.password.value.length > 20 ) {
                alert("“密码”要4-20字符，且只能是A-Za-z0-9和下划线_  ")
		theForm.password.focus();
                return false;
	}

	if(theForm.password.value != theForm.password2.value) {
                alert("\“重复密码”与“密码”不同！")
		theForm.password2.focus();
		theForm.password2.select();
                return false;
	}

	if(theForm.nickname.value.length < 1 || theForm.nickname.value.length > 6 ) {
                alert("\“会员昵称”长度在1-6位之间！")
		theForm.nickname.focus();
                return false;
	}

	if(theForm.realname.value.length < 1 || theForm.realname.value.length > 6 ) {
                alert("\“真实姓名”长度在1-6位之间！")
		theForm.realname.focus();
                return false;
	}

	if(theForm.realnameOpenRank.value==""){
		alert("您没有设置“真实姓名”公开级别！");
		theForm.realnameOpenRank.focus();
		return false;
	}

	if(theForm.tel.value.length < 8){
		alert("“联系电话”长度在8位以上！");
		theForm.tel.focus();
		return false;
	}

	if(theForm.telOpenRank.value==""){
		alert("您没有设置“联系电话”公开级别！");
		theForm.telOpenRank.focus();
		return false;
	}

	if(theForm.oicq.value.length < 5 || theForm.oicq.value.length > 10){
		alert("“QQ号码”长度在5-10位之间！");
		theForm.oicq.focus();
		return false;
	}

	if(theForm.oicqOpenRank.value==""){
		alert("您没有设置“QQ号码”公开级别！");
		theForm.oicqOpenRank.focus();
		return false;
	}

	if(theForm.email.value == ""){
                alert("\请输入“电子信箱”！")
		theForm.email.focus();
                return false;
        }

	if(!is_email(theForm.email.value)){
		alert("非法的“电子信箱”地址！");
		theForm.email.select();
		return false;
	}

	if(theForm.emailOpenRank.value==""){
		alert("您没有设置“电子信箱”公开级别！");
		theForm.emailOpenRank.focus();
		return false;
	}

	if(!(theForm.IdentityCard.value.length == 15 || theForm.IdentityCard.value.length == 18)){
		alert("“身份证号”是15位或者18位！");
		theForm.IdentityCard.focus();
		return false;
	}

	if(theForm.IdentityCardOpenRank.value==""){
		alert("您没有设置“身份证号”公开级别！");
		theForm.IdentityCardOpenRank.focus();
		return false;
	}

	if(theForm.Address.value.length < 4){
                alert("\“详细地址”在4位以上 ！")
		theForm.Address.focus();
                return false;
        }

	if(theForm.AddressOpenRank.value==""){
		alert("您没有设置“详细地址”公开级别！");
		theForm.AddressOpenRank.focus();
		return false;
	}

	if(theForm.height.value == ""){
		alert("您没有选择“身高”！");
		theForm.height.focus();
		return false;
	}

	if(theForm.weight.value==""){
		alert("您没有选择“体重”！");
		theForm.weight.focus();
		return false;
	}

	if(theForm.shape.value==""){
		alert("您没有选择“体形”！");
		theForm.shape.focus();
		return false;
	}

	if(theForm.appearance.value==""){
		alert("您没有选择“相貌自评”！");
		theForm.appearance.focus();
		return false;
	}

	if(theForm.nation.value == ""){
		alert("您没有选择“民族”！");
		theForm.nation.focus();
		return false;
	}

	if(theForm.marry.value == ""){
		alert("您没有选择“婚姻状况”！");
		theForm.marry.focus();
		return false;
	}

	if(theForm.FriendType.value == ""){
		alert("您没有选择“交友类型”！");
		theForm.FriendType.focus();
		return false;
	}

	if(theForm.Character.value==""){
		alert("您没有选择“我的性格”！");
		theForm.Character.focus();
		return false;
	}

	if(theForm.religion.value==""){
		alert("您没有选择“宗教信仰”！");
		theForm.religion.focus();
		return false;
	}

	if(theForm.family.value==""){
		alert("您没有选择“家庭成员”！");
		theForm.family.focus();
		return false;
	}

	if(theForm.health.value==""){
		alert("您没有选择“健康状况”！");
		theForm.health.focus();
		return false;
	}

	if(theForm.province2.value==0){
		alert("您没有选择“籍贯”所在省！");
		theForm.province2.focus();
		return false;
	}

	if(theForm.city2.value==""){
		alert("您没有选择“籍贯”所在市县！");
		theForm.city2.focus();
		return false;
	}

	if(theForm.degree.value==""){
		alert("您没有选择“学历”！");
		theForm.degree.focus();
		return false;
	}

	if(theForm.province.value==0){
		alert("您没有选择“居住地”所在省！");
		theForm.province.focus();
		return false;
	}

	if(theForm.city.value==""){
		alert("您没有选择“居住地”所在市县！");
		theForm.city.focus();
		return false;
	}

	if(theForm.unit.value==""){
		alert("您没有选择“单位性质”！");
		theForm.unit.focus();
		return false;
	}

	if(theForm.vehicle.value==""){
		alert("您没有选择“交通工具”！");
		theForm.vehicle.focus();
		return false;
	}

	if(theForm.job.value==""){
		alert("您没有选择“职业类别”！");
		theForm.job.focus();
		return false;
	}

	if(theForm.house.value==""){
		alert("您没有选择“住房情况”！");
		theForm.house.focus();
		return false;
	}

	if(theForm.income.value==""){
		alert("您没有选择“年总收入”！");
		theForm.income.focus();
		return false;
	}

	if(theForm.smoking.value==""){
		alert("您没有选择“是否吸烟”！");
		theForm.smoking.focus();
		return false;
	}

	if(theForm.drinking.value==""){
		alert("您没有选择“是否喝酒”！");
		theForm.drinking.focus();
		return false;
	}

	if(theForm.SelfIntro.value.length < 10 || theForm.SelfIntro.value.length > 200 ) {
                alert("“个人独白”限10-200字！")
		theForm.SelfIntro.focus();
                return false;
	}

	return true;
}

function is_email(str){
	if((str.indexOf("@")==-1)||(str.indexOf(".")==-1)){	
		return false;
	}
	return true;
}
