
function formsubmit() {
	document.registerquery.submit();
}
function IsDigit(cCheck)
	{
	return (('0'<=cCheck) && (cCheck<='9'));
	}

function IsAlpha(cCheck)
	{
	return ((('a'<=cCheck) && (cCheck<='z')) || (('A'<=cCheck) && (cCheck<='Z')))
	}
function VerifyInput()
	{
    if (document.form.replyname.value == "")
		{
		alert("请输入姓名！");
		document.form.replyname.focus();
		return(false);
		}
    if(document.form.replymail.value != ""){
	    var strmailadd=document.form.replymail.value;
        var temp="";
		var temp1="";
        for(var nIndex=0; nIndex<strmailadd.length; nIndex++){
            var cCheck = strmailadd.charAt(nIndex);
            if(cCheck=='@') temp="verify";
			if(cCheck=='.') temp1="verify";
            if(!(IsDigit(cCheck) || IsAlpha(cCheck)|| cCheck=='-' || cCheck=='_' || cCheck=='.' || cCheck=='@' )){
             	alert("邮件地址只能使用字母、数字、-、_、.、@，并且不能使用中文");
				document.form.replymail.select();
				return(false);
	    	}
                                 
        }
        if(temp!="verify" || temp1!="verify"){
           alert("邮件地址无效");
		   document.form.replymail.select();
    	   return(false);
        }
    }else{
		//alert("邮件地址不能为空");
		//document.form.replymail.focus();
		//return false;
	}	

    if (document.form.replybody.value.length>250)
		{
		alert("您正文不超过250个字符！");
		document.form.replybody.focus();
		return(false);
		}	

    if (document.form.replybody.value == "")
		{
		alert("您正文不得为空！");
		document.form.replybody.focus();
		return(false);
		}
	document.form.submit();
	}

function showhint(F) {
	var num = 250 - self.document.form.replybody.value.length;
	var num1 = "";
	var key = self.event.keyCode;
	if(num <= 0 && key != 8 && key != 46 && !(key >= 33 && key <=40) && F == 1) {
		alert("内容超长(250个汉字，包括空格和回车)，请修改！");
	}
	var col = "";
	if(num >= 0) {
		num1 = "剩余字符长度：" + num;
		if(num <= 10){col = "#CC3300";}else{col = "";}
	} 
	else { num2 = (-1) * num;
		num1 = "内容超长" + num2 + "字符";
		col = "#FF0000";
	}
	document.all.charleft.innerHTML = num1;
	document.all.charleft.style.color = col;
}
