
function IsDigit(cCheck) { return (('0'<=cCheck) && (cCheck<='9')); }

function IsAlpha(cCheck) { return ((('a'<=cCheck) && (cCheck<='z')) || (('A'<=cCheck) && (cCheck<='Z'))) }
function changebrow()
{
   document.images.browimg.src="images/brow/"+document.myform.brow.options[document.myform.brow.selectedIndex].value;
}
function checklogin()
{
	if (document.zixunform.username.value == '')
	{       
		alert("请输入姓名！");
		document.zixunform.username.focus();
		return false;
	}
	
	if (document.zixunform.subject.value == '')
	{       
		alert("请输入留言主题！");
		document.zixunform.subject.focus();
		return false;
	}
		if ( document.zixunform.tel.value == '' )
		{
			alert("电话不能为空");
			document.zixunform.tel.focus();
			return false;
		}
	for (nIndex=0; nIndex< document.zixunform.tel.value.length; nIndex++)
	{
		cCheck = document.zixunform.tel.value.charAt(nIndex);
		if (!(IsDigit(cCheck)))
		{
			alert("电话只能使用数字");
			document.zixunform.tel.focus();
			return false;
		}
	}
	for (nIndex=0; nIndex< document.zixunform.mobile.value.length; nIndex++)
	{
		cCheck = document.zixunform.mobile.value.charAt(nIndex);
		if (!(IsDigit(cCheck)))
		{
			alert("手机只能使用数字");
			document.zixunform.mobile.focus();
			return false;
		}
	}
	for (nIndex=0; nIndex< document.zixunform.zipcode.value.length; nIndex++)
	{
		cCheck = document.zixunform.zipcode.value.charAt(nIndex);
		if (!(IsDigit(cCheck)))
		{
			alert("邮编只能使用数字");
			document.zixunform.zipcode.focus();
			return false;
		}
	}
	
	if (document.zixunform.content.value == '')
	{
		alert("请输入内容！");
		document.zixunform.content.focus();
		return false;
	}
	  if(document.zixunform.email.value.length < 1)
	  {
		alert("请填写您的电子邮件地址!")
		document.zixunform.email.focus()
		return false
	  }
	  if(document.zixunform.email.value.indexOf("@") == -1)
	  {
		alert("请填写正确的电子邮件地址!")
		document.zixunform.email.focus()
		return false
	  }
	for (nIndex=0; nIndex< document.zixunform.qq.value.length; nIndex++)
	{
		cCheck = document.zixunform.qq.value.charAt(nIndex);
		if (!(IsDigit(cCheck)))
		{
			alert("QQ只能使用数字");
			document.zixunform.qq.focus();
			return false;
		}
	}
	return true;
}
