﻿function RegCheck(){
if (document.ThisForm.UserName.value == "" || document.ThisForm.UserName.value == "用来登录系统不公开显示"){
alert("请填写您的EMail，这将作为您的用户名，请确保能收到我们的确认信！");
document.ThisForm.UserName.focus();
return false;}

var filter=/^\s*([A-Za-z0-9_-]+(\.\w+)*@(\w+\.)+\w{2,3})\s*$/;
if (!filter.test(document.ThisForm.UserName.value)) { 
alert("EMail地址不正确,请重新填写！"); 
document.ThisForm.UserName.focus();
return false;}
   
if (document.ThisForm.psw.value ==""){
alert("请填写您的密码！");
document.ThisForm.psw.focus();
return false;}

if (document.ThisForm.psw.value.length<6){
alert("您输入的密码过短，必须大于6个字符！");
document.ThisForm.psw.focus();
return false;}

if (document.ThisForm.psw.value.length>36){
alert("您输入的密码太长，不能超过36个字符！");
document.ThisForm.psw.focus();
return false;}

if (document.ThisForm.psw.value!=document.ThisForm.psw2.value ){
alert("两次填写的密码不一致，请重新填写！"); 
document.ThisForm.psw2.focus();
return false;}

if (document.ThisForm.Question.value ==""){
alert("请选择您的密码保护问题。"); 
document.ThisForm.Question.focus();
return false;} 

if (document.ThisForm.Answer.value =="" || document.ThisForm.Answer.value.length<2){
alert("请正确填写你的密码保护问题答案，必须大于2位。"); 
document.ThisForm.Answer.focus();
return false;} 

if (document.ThisForm.Last_Name.value ==""){
alert("请输入您的姓！"); 
document.ThisForm.Last_Name.focus();
return false;} 

if (document.ThisForm.First_Name.value ==""){
alert("请填写您的名！"); 
document.ThisForm.First_Name.focus();
return false;} 

if (document.ThisForm.Sex.value ==""){
alert("请选择您的性别。"); 
document.ThisForm.Sex.focus();
return false;} 

if (document.ThisForm.PN_Corp_Name.value.length<4) {
alert ("请认真填写[公司名称]，建议使用全称，不是这么短吧！");
document.ThisForm.PN_Corp_Name.focus();
return false;}

if (checkspecchar(document.ThisForm.PN_Corp_Name.value)>0) {
alert ("[公司名称]内包含非法字符！");
document.ThisForm.PN_Corp_Name.focus();
return false;}

if (document.ThisForm.Group_Tel.value=="" && document.ThisForm.Group_Mobile.value==""){
alert("个人电话或手机必须填写一个。"); 
document.ThisForm.Group_Tel.focus();
return false;} 

return true;
}

function checkspecchar(str)
{
	var q=0;
	if (str.indexOf("■")!=-1) {q++;}
	if (str.indexOf("★")!=-1) {q++;}
	if (str.indexOf("●")!=-1) {q++;}
	if (str.indexOf("◆")!=-1) {q++;}
	if (str.indexOf("	")!=-1) {q++;}
	return(q);
}

function checknum1(str)
{
	var n=0;
	for (var i = 0; i < str.length; i++) 
	{
		var ch = str.substring(i, i+1)
		if((ch < "0" || ch > "9") && (ch != '(' && ch != ')' && ch != '-'&& ch != ' '))
		n++;
	}
	return(n);
}

function CardCheck(){
if (document.ThisForm.Area.value ==""){
alert("请选择您所在省市地区。"); 
document.ThisForm.Area.focus();
return false;} 

if (document.ThisForm.Address.value ==""){
alert("请填写你的通信地址。");
document.ThisForm.Address.focus();
return false;}

if (document.ThisForm.Phone.value == ""){
alert("请填写你的固定电话！");
document.ThisForm.Phone.focus();
return false;}

if (checknum1(document.ThisForm.Phone.value)>0) {
alert ("请正确填写[电话号码]！格式：010-88774432")
document.ThisForm.Phone.focus();
return false;}

if (document.ThisForm.EMail.value == ""){
alert("请填写您的EMail！");
document.ThisForm.EMail.focus();
return false;}

var filter=/^\s*([A-Za-z0-9_-]+(\.\w+)*@(\w+\.)+\w{2,3})\s*$/;
if (!filter.test(document.ThisForm.EMail.value)) { 
alert("邮件地址不正确,请重新填写！"); 
document.ThisForm.EMail.focus();
return false;}

if (checknum1(document.ThisForm.EnteFax.value)>0) {
alert ("请正确填写[传真号码]！格式：010-88774432")
document.ThisForm.EnteFax.focus();
return false;
}

return true;
}

//选择地区分类，单选
function SelectArea(ThisForm,Area){
var popupWin = window.open('/Member/Selector_Area.htm?ThisForm='+ThisForm+'&Area='+Area+'', 'SelectFid', 'scrollbars=yes,width=700,height=400');
}

