function isNumberString (InString,RefString)
{
if(InString.length==0) return (false);
for (Count=0; Count < InString.length; Count++)  {
	TempChar= InString.substring (Count, Count+1);
	if (RefString.indexOf (TempChar, 0)==-1)  
	return (false);
}
return (true);
}
function yhzc_check(theForm)
{
if (theForm.zname.value == "" || theForm.zname.value.length<6){
   alert("用户名不能为空且不能于少6个字符！");
   theForm.zname.focus();
   return (false);	 
}
if (theForm.zname.value.length>16){
   alert("用户名不能多于32位！");
   theForm.zname.focus();
   return (false);	 
}
for (i=1;i<theForm.zname.value.length;i++){
    ct=theForm.zname.value.charAt(i);
    if (!((ct>='0'&&ct<='9')||(ct>='a'&&ct<='z')||(ct>='A'&&ct<='Z')||ct=='_')){
	alert("会员名称只允许使用英文字符和数字以及字符\'_\'");
        theForm.zname.focus();
	return(false);
    }
}
if (theForm.zpass.value == "" || theForm.zpass.value.length<6){		  		
	alert("密码不能少于6位！");
        theForm.zpass.focus();
	return (false);	 
}
for (i=1;i<theForm.zpass.value.length;i++){
    ct=theForm.zpass.value.charAt(i);
    if (!((ct>='0'&&ct<='9')||(ct>='a'&&ct<='z')||(ct>='A'&&ct<='Z')||ct=='_')){
        alert("密码只允许使用英文字符和数字以及字符\'_\'");
	theForm.zpass.focus();
	return(false);
	}
}
if (theForm.ypass.value == "" || theForm.ypass.value.length<6){
    alert("请输入确认密码");
    theForm.jsspass.focus();
    return (false);	 
}
if (theForm.zpass.value !=theForm.ypass.value){
   alert("确认密码和密码不符,请重新输入");
   theForm.zpass.focus();
   return (false);	 
}		   
if (theForm.ztswt.value == "" || theForm.ztswt.value.length>30){
   alert("请您输入密码提示问题且不能多于30字！");
   theForm.ztswt.focus();
   return (false);	 
}
if (theForm.zwtda.value == "" || theForm.zwtda.value.length>30){
   alert("请您输入密码提示问题答案且不能多于30字！");
   theForm.zwtda.focus();
   return (false);	 
}
if (theForm.ztswt.value ==theForm.zwtda.value){
   alert("问题和答案不允许相同,请重新输入");
   theForm.zwtda.focus();
   return (false);	 
   }		
    if (theForm.zxm.value == "")
     {
	  alert("真实姓名为必填项！");
	  theForm.zxm.focus();
	  return (false);		
     }
    tempstr = "";
    for (i = 1; i <= theForm.zxm.value.length; i++)
    {
       tempstr += " ";
	if (tempstr == theForm.zxm.value)
    	{
       	alert ("对不起，真实姓名不能全为空格!");
       	theForm.zxm.focus();
       	return false
    	}
    }
   if (theForm.zemail.value=="")
    {
       alert ("请输入电子邮件!");
       theForm.zemail.focus();
       return false;
    }
    if (theForm.zemail.value.indexOf('@',0)==-1 || theForm.zemail.value == "" || theForm.zemail.value.indexOf('.',0)==-1) 
    {
        alert("请重新输入正确的电子邮件地址!");
        theForm.zemail.focus();
        return false;
    }
    Str = theForm.zemail.value
    thePos = Str.indexOf('@',0) + 1
    if (Str.indexOf('@', thePos) != -1 || Str.indexOf(';', thePos) != -1 || Str.indexOf(',', thePos) != -1 || Str.indexOf(' ', thePos) != -1 || Str.indexOf('。', thePos) != -1 || Str.indexOf('，', thePos) != -1) 
    {
        alert("请重新输入正确的电子邮件地址!");
        theForm.zemail.focus();
        return false;
    }

      if (theForm.qq.value!=""){
    	if (theForm.qq.value.length<5 || isNumberString(theForm.qq.value,"1234567890")!=1)
	{
		alert("QQ号码为数字！");
		theForm.qq.focus();
		return (false);
	}
     }
    	if (theForm.zdh.value.length<7 || isNumberString(theForm.zdh.value,"1234567890-")!=1)
	{
		alert("请输入联系电话(区号和分机号用减号隔开，并确保电话号码为数字！");
		theForm.zdh.focus();
		return (false);
	}

}
function help_check(theForm){
if (theForm.qtitle.value == "" || theForm.qtitle.value.length>30){
   alert("请您用不多于30字描述求助主题！");
   theForm.qtitle.focus();
   return (false);	 
}
if (theForm.qtitle.value == "" || theForm.qtitle.value.length>30){
   alert("请您用不多于30字描述求助主题！");
   theForm.qtitle.focus();
   return (false);	 
}

}

