function check()
   check=false
end function


sub queryenter()
	if window.event.keyCode = "13" then
		
		SubmitCheck()
		
    end if
end sub

function SubmitCheck()
	key = trim(form.LabelKey.value)

	keylen = Len(key)
	i = 1
	do while i <= keylen
		code = Asc(Mid(key,i,1))
		if (code >= 0 AND code < 65 OR code > 90 AND code < 97 OR code > 122 or code = 32)    then   'AND code <> 33  43
			MsgBox "标题关键字中含有非法字符"+chr(code)+"，"+chr(13)+"请输入汉字或英文字母。"+chr(13)+"请参阅帮助文档。", vbOKOnly, "警告"
			SubmitCheck=false
			exit function
		end if
		i = i+1
	loop


	fullkey = trim(form.TextKey.value)
	keylen = Len(fullkey)
	i = 1
	do while i <= keylen
		code = Asc(Mid(fullkey,i,1))
		if (code >= 0 AND code < 65 OR code > 90 AND code < 97 OR code > 122) or code = 32  then   'AND code <> 33 
			MsgBox "*** 全文关键字中含有非法字符  "+chr(code)+"  "+chr(13)+"*** 您只能输入汉字或英文字母"+chr(13)+"*** 若多个词查询，请直接输入，无须空格和标点符号。", vbOKOnly, "警告"
			SubmitCheck=false
			exit function
		end if
		i=i+1
	loop

	'otherdept check
	if  (form.LawbaseSelect.value = "c") and (form.promulgate_dept.value = 6) then
	        otherkey = trim(form.otherdept.value)
			keylen = Len(otherkey)
			i = 1
			do while i <= keylen
				code = Asc(Mid(otherkey,i,1))
				if (code >= 0 AND code < 65 OR code > 90 AND code < 97 OR code > 122) or code = 32  then   'AND code <>33
					MsgBox "输入的颁布部门中含有非法字符"+chr(code)+"，"+chr(13)+"您只能输入汉字或英文字母。"+chr(13)+"请参阅帮助文档。", vbOKOnly, "警告"
					SubmitCheck=false
					exit function
				end if
                i=i+1	
			loop
	
	end if
	

    
end function
