// JavaScript Document
//check Form
function checkform()
{
if (document.myform.accout.value.length < 6){
	  alert(" 帐号为空或长度小于6\n");
	  document.myform.accout.focus();
	  return false;
}
if (document.myform.password.value.length < 6){
	  alert(" 密码项为空或者长度小于6\n");
	  document.myform.password.focus();
	  return false;
}
if (document.myform.password1.value != document.myform.password.value){
	  alert(" 两次输入密码不一样\n");
	  document.myform.password1.focus();
	  return false;
}
/*
if (document.myform.password.value == document.myform.accout.value){
	  alert(" 登陆名不能与密码一样\n");
	  document.myform.accout.focus();
	  return false;
}
*/
if (document.myform.nickname.value.length < 2){
	  alert(" 姓名项为空或者格式不对\n");
	  document.myform.nickname.focus();
	  return false;
}
if ((document.myform.email.value.indexOf("@") == -1)||(document.myform.email.value.indexOf(".")== -1)){
	  alert(" Email格式不对\n");
	  document.myform.email.focus();
	  return false;
}
if ((document.myform.ProvinceID.options[document.myform.ProvinceID.selectedIndex].value =="0")||(document.myform.ProvinceID.options[document.myform.ProvinceID.selectedIndex].value =="")){
	  alert(" 所在地区未选择\n");
	  document.myform.ProvinceID.focus();
	  return false;
}
if ((document.myform.CityID.options[document.myform.CityID.selectedIndex].value =="0")||(document.myform.CityID.options[document.myform.CityID.selectedIndex].value =="")){
	  alert(" 所在地区未选择\n");
	  document.myform.CityID.focus();
	  return false;
}
if (document.myform.address.value == ""){
	  alert(" 公司所在街道地址为空\n");
	  document.myform.address.focus();
	  return false;
}
if (document.myform.postcode.value == ""){
	  alert(" 邮政编码为空\n");
	  document.myform.postcode.focus();
	  return false;
}
if (document.myform.telephone.value == ""){
	  alert(" 联系电话为空\n");
	  document.myform.telephone.focus();
	  return false;
}
if (document.myform.corpname.value == ""){
	  alert(" 企业名称项为空\n");
	  document.myform.corpname.focus();
	  return false;
}
if ((document.myform.ClassID.options[document.myform.ClassID.selectedIndex].value =="0")||(document.myform.ClassID.options[document.myform.ClassID.selectedIndex].value =="")){
	  alert(" 行业类型大类未选择\n");
	  document.myform.ClassID.focus();
	  return false;
}
if ((document.myform.NClassID.options[document.myform.NClassID.selectedIndex].value =="0")||(document.myform.NClassID.options[document.myform.NClassID.selectedIndex].value =="")){
	  alert(" 行业类型小类未选择\n");
	  document.myform.NClassID.focus();
	  return false;
}
if (document.myform.servicearea.value == ""){
	  alert(" 产品与服务内容为空\n");
	  document.myform.servicearea.focus();
	  return false;
}
if (document.myform.introduce.value == ""){
	  alert(" 公司简介为空\n");
	  document.myform.introduce.focus();
	  return false;
}
if (document.myform.myposition.value == ""){
	  alert(" 担任职务为空\n");
	  document.myform.myposition.focus();
	  return false;
}
//if (document.myform.CheckCode.value == ""){
//	  alert(" 验证码为空或者格式不对\n");
//	  document.myform.CheckCode.focus();
//	  return false;
//}
return true;
}

function CheckRegUser()
{
	if (document.myform.accout.value == "")        
	{        
		alert("用户名不能为空！");        
		document.myform.accout.focus();        
		return (false);        
	}
	else
	{
		//检查id值里是否有特殊字符
		var checkOKpass = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-";
		var checkStrpass = document.myform.accout.value;
		var allValidpass = true;
		for (i = 0;  i < checkStrpass.length;  i++)
		{
			ch = checkStrpass.charAt(i);
			for (j = 0;  j < checkOKpass.length;  j++)
			if (ch == checkOKpass.charAt(j))
				break;
				
			if (j == checkOKpass.length)
			{
				allValidpass = false;
				break;
			}
		}
		
		if (!allValidpass)
		{
			alert("您输入的用户名包含无效字符!");
			document.myform.accout.focus();
			return (false);
		}
	   
		if(document.myform.accout.value.length > 16 || document.myform.accout.value.length < 3 )
		{
			alert("您输入的用户名长度不符合要求(3-16位)!");
			document.myform.accout.focus();
			return (false);
		}
	}  
	window.open('CheckRegUser.asp?Accout='+document.myform.accout.value,'检测账号','resizable=0,scrollbars,left=300,top=200,width=600x,height=230px');
}

