function isChn(str)
{ 
	var badChar ="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
		badChar += "abcdefghijklmnopqrstuvwxyz"; 
		badChar += "0123456789"; 
		badChar += " "+"　";//半角与全角空格 
		badChar += "`~!@#$%^&()-_=+]\\|:;\"\\'<,>?/";//不包含*或.的英文符号 
	if(""==str)
	{ 
		return false; 
	} 
	
	var i; 
	var c;
	for(i=0;i<str.length;i++)
	{
		c=str.charAt(i);//字符串str中的字符 
		if (badChar.indexOf(c)==-1) 
		{ 
			return false; 
		}
	}
	return true; 
}



function check()
{
	with(this.form1){
	if(txtLCName.value.Trim().length==0)
	{
		alert("请输入注册的用户名!");
		txtLCName.focus();
		return false;
	}
	
	if (!isChn(txtLCName.value))
	{
		alert("用户名只能使用字母、数字以及-、_，并且不能使用中文."); 
		txtLCName.value="";
		txtLCName.focus();
		return false;
	}
	
	if(txtPWD.value.Trim().length==0)
	{
		alert("请输入用户密码!");
		txtPWD.focus();
		return false;
	}	
	if(txtPWD1.value.Trim().length==0)
	{
		alert("请输入确认密码!");
		txtPWD1.focus();
		return false;
	}
	if(txtPWD.value!=txtPWD1.value)
	{
		alert("您两次输入的密码不相同,请重新输入!");
		txtPWD.value="";
		txtPWD1.value="";
		txtPWD.focus();
		return false;
	}
	
	if(txtCompanyName.value.Trim().length==0)
	{
		alert("请输入公司名称!")
		txtCompanyName.focus();
		return false;
	}
	
	if(txtAddress.value.Trim().length==0)
	{
		alert("请输入通讯地址!");
		txtAddress.focus();
		return false;
	}
	
	if(txtPostCode.value=="")
	{
		alert("请输入邮政编码!");
		txtPostCode.focus();
		return false;
	}
	
	if(!isnum(txtPostCode.value))
	{
		alert("请输入正确的邮政编码!");
		txtPostCode.focus();
		txtPostCode.value="";
		return false;
	}
	
	if (province.value==""){
			alert("请选择省份！");
			return false;
	}
	
//	if (city.value==""){
//			alert("请选择城市！");
//			return false;
//	}
	
	if(txtContact.value.Trim().length==0)
	{
		alert("请输入业务联系人!");
		txtContact.focus();
		return false;
	}
	
	if(txtTel.value.Trim().length==0)
	{
		alert("请输入联系电话!");
		txtTel.focus();
		return false;
	}
	if(txtEmail.value.Trim().length==0)
	{
		alert("请正确填写您的邮箱，方便享受我们更好的服务");
		txtEmail.focus();
		return false;
	}
	if(txtEmail.value!="" && !isemail(txtEmail.value))
	{
		alert("您填写了Email，请填写正确的Email。");
		txtEmail.value="";
		txtEmail.focus();
		return false;
	}
	
	if(qq.value!="" && !isnum(qq.value))
	{
		alert("您填写了qq号码，请填写正确的qq号。否则请留空。");
		qq.value="";
		qq.focus();
		return false;
	}
	
	if(txtJianJie.value.Trim().length==0)
	{
		alert("请输入公司简介!");
		txtJianJie.focus();
		return false;
	}
	
	if(code.value.length==0)
	{
		alert('请填写验证码');
		code.focus();
		code.value="";
		return false;
	}
}
}

function check_click(){
if(document.form1.txtLCName.value.Trim().length==0)
{
	alert("请先输入您要注册的用户名");
	document.form1.txtLCName.focus();
	return false;
}

if (!isChn(document.form1.txtLCName.value))
{   
	alert("用户名只能使用字母、数字以及-、_，并且不能使用中文.");
	document.form1.txtLCName.value=''; 
  	document.form1.txtLCName.focus();   
  	return  false;
} 
	
window.open('user-check.asp?user='+document.form1.txtLCName.value);
}

function login()
{
	with (this.loginform){
	if (txtUserName.value == '') //这个是登录使用
	{
		txtLCName.focus();
		alert('请输入登录用户名！');
		return false;
	}
	
	if(txtPwd.value == '') 
	{
		txtPwd.focus();
		alert('请输入登录密码！');
		return false;
	}
	
//	if (txtcode.value.length!=4 || !isnum(txtcode.value))
//	{
//		txtcode.value="";
//		txtcode.focus();
//		alert("请输入正确的验证码");
//		return false;
//	}

	return	true;
	
	}
}