var rightIcon="../images/icon.gif"
var loading="../images/loading.gif"
function of_huiyuan(thisname){
	
    var msg = document.getElementById("result");
        msg.innerHTML = "<font color=#999999>会员登录名只能由6-20个英文字母和数字组成</font>"
  }

//验证真实用户名开始
  function ob_name(thisname)
  {
	  var msg = document.getElementById("zsmc");
	if ( thisname.value!="" ){
document.getElementById("zsname").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "	
 msg.innerHTML = "<font color=#999999>输入符合规范</font>"
		}else
		{document.getElementById("zsname").innerHTML=""
		 msg.innerHTML = ""
			}
  }
  
  //验证用户名结束 
  //验证邮箱开始
   function ob_email(thisname){
	   websen[0]=0
   var re = /^[_a-zA-Z0-9\-\.]+@([\-_a-zA-Z0-9]+\.)+[a-zA-Z0-9]{2,3}$/;
 var msg = document.getElementById("email1");
    if ( thisname.value == "" ) {
	  msg.innerHTML = " <table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>邮箱地址不能为空!</font></td></tr></table>"
	   }
	   else if (!thisname.value.match(re)) {
		   websen[0]=16
	
	msg.innerHTML = " <table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>输入不符合规范 格式如下:b2b@websen.com!</font></td></tr></table>"
	document.getElementById("yx").innerHTML=""
  }
  else 
  {
  msg.innerHTML = "<font color=#999999>输入符合规范</font>"
  document.getElementById("yx").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "
  }
  }
   function of_email(thisname){
	   websen[0]=0
    var msg = document.getElementById("email1");
	document.getElementById("yx").innerHTML=""
       msg.innerHTML = "<font color=#999999>这是客户与您联系的首选方式,请务必填写真实,并确认是您最常用的电子邮件.</font>"
  }
    //验证邮箱结束
	///////////////TM
	function ob_tm(thisname){
		websen[0]=0
		var msg = document.getElementById("tm1");
		if (thisname.value!="" && thisname.value.length > 4){
			 msg.innerHTML = "<font color=#999999>输入符合规范</font>"
  document.getElementById("websentm").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "
			}
			else
			{ websen[0]=17
				document.getElementById("websentm").innerHTML=""
			msg.innerHTML = ""
				}
		}
	///////////////TM
function isNumberContinue(str){
	
	var patn1 =   /^[0-9_]+$/;
	var ascendNumber=0;
	var descendNumber=0;
	
	for (var i = 1; i < str.length; i++) {
		if (str.charAt(i).charCodeAt() != (str.charAt(i-1).charCodeAt() + 1)) {
			ascendNumber = 1;
			break;
		}
	}	
	
	for (i = 0; i < (str.length - 1); i++) {
		if (str.charAt(i).charCodeAt() != (str.charAt(i+1).charCodeAt() + 1)) {
			descendNumber = 1;
			break;
		}
	}
	if(descendNumber == 0 || ascendNumber == 0){
		return 1;
	}else{
		return 0;
	}
}
	 ////////////////// //验证密码开始
 function ob_pswd1(thisname){
	 websen[1]=0
	   var re = /^[a-zA-Z0-9]$/; 
  var msg = document.getElementById("psw1");
  var pass1=document.getElementById("password")
  var user1=document.getElementById("username")
  var firstCode = thisname.value.substring(0,1);
  var exp = new RegExp(firstCode, "ig"); 
  if ( thisname.value == "" )
  {websen[1]="5";
    
	 msg.innerHTML = "<table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>密码不能为空,请重新设置密码！</font></td></tr></table>"
	 document.getElementById("mima").innerHTML=""
  }	   
  else
  {
	if (thisname.value.length < 6)
	{
		websen[1]="4";
	 msg.innerHTML = "<table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>输入密码不能小于6位</font></td></tr></table>"
	  document.getElementById("mima").innerHTML=""
    }
	 else
	 {
	     if (isNumberContinue(thisname.value) == 1) 
		{websen[1]="6";
		    msg.innerHTML = "<table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>为安全起见，密码不能用同一个数字或字母，请重新设置密码！</font></td></tr></table>"
		   document.getElementById("mima").innerHTML=""
		}
	    else 
		{
		   if (document.form_reg.password.value==document.form_reg.username.value)
           { websen[1]="7";
		    msg.innerHTML = "<table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>为安全起见，密码不能与会员登录名相同，请重新设置密码！</font></td></tr></table>"
             document.getElementById("mima").innerHTML=""
           }else if (thisname.value.match(exp) && thisname.value.match(exp).length==thisname.value.length)
		   {
	    msg.innerHTML = "<table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>为安全起见，密码不能用同一个数字或字母，请重新设置密码！</font></td></tr></table>"
	  
             document.getElementById("mima").innerHTML=""
			   }
		   else 
           {
             msg.innerHTML = "<font color=#999999>输入符合规范</font>"
             document.getElementById("mima").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "
           }
		 }
	  }
  }
 
 
 }
 function of_pswd1(thisname){
	
    var msg = document.getElementById("psw1");
        msg.innerHTML = "<font color=#999999>密码为6到14位字符或数字</font>"
  }
  //////////////////////////
  function ob_pswd2(thisname){
	  websen[0]=0
  var msg = document.getElementById("psw2");
  if(thisname.value==""){
	  websen[0]="8";
	   msg.innerHTML = "<table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>确认密码不能为空，请重新设置密码！</font></td></tr></table>"
	  }
 else if (thisname.value != document.form_reg.password.value) {
	 websen[0]="9";
	    msg.innerHTML = "<table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>密码与确认密码输入不一致，请重新设置密码！</font></td></tr></table>"
		document.getElementById("mima2").innerHTML=""
  }
  else 
  {
  msg.innerHTML = "<font color=#999999>输入符合规范</font>"
  document.getElementById("mima2").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "
  }
  
  }
   function of_pswd2(thisname){
	  
    var msg = document.getElementById("psw2");
        msg.innerHTML = "<font color=#999999>密码为6到14位字符或数字</font>"}
  //////////////////////////////////验证密码结束
    
	
	 function ob_wt(thisname){
		
	  var tswt= document.getElementById("tswt");
	  var tsda= document.getElementById("tsda");
 if(document.form_reg.question.options.selectedIndex==0 ){
	  
	  
	    tswt.innerHTML = "<table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>请选择密码提示问题!</font></td></tr></table>"
	 document.getElementById("wt").innerHTML=""}
	
 else{

	 document.getElementById("wt").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\">"
 tswt.innerHTML = "<font color=#999999>输入符合规范</font>"
     }
 }
 ///////////////////
  function ob_da(thisname){
	  
	   var tsda= document.getElementById("tsda");
	  if(document.form_reg.answer.value==""){
		    tsda.innerHTML = "<table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>请输入密码提示答案!</font></td></tr></table>"
		   document.getElementById("da").innerHTML=""
		  } 
		  else{tsda.innerHTML = "<font color=#999999>输入符合规范</font>"
		  document.getElementById("da").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\">"
		  }
		  
	  }
  /////////////////////////msn
function ob_MSN(thisname)
{ 
websen[0]=0
	 var re=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	 var msg = document.getElementById("MSN2");
		if (thisname.value ==""){
			websen[0]="23"
			 msg.innerHTML = "<a href='https://accountservices.passport.net/reg.srf?id=9&cbid=956&sl=1&lc=2052' target=_blank><font color=#006699>注册MSN</font></a>"
document.getElementById("websenMSN").innerHTML=""

			}
		else if	 (!thisname.value.match(re))
		{ websen[0]="23"
		
		msg.innerHTML = "<table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>输入不符合 格式如下:yourname@example.com</font></td></tr></table>"
			
			document.getElementById("websenMSN").innerHTML=""
			}
			else
			{ 
			msg.innerHTML = "<font color=#999999>输入符合规范</font>"
			  document.getElementById("websenMSN").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "
				}
	
	}
  
	/////////电话/////////////
	function tot(mobnumber){                        
	while(mobnumber.indexOf("０")!=-1){           
		mobnumber = mobnumber.replace("０","0");}                                               
	while(mobnumber.indexOf("１")!=-1){             
	mobnumber = mobnumber.replace("１","1");}       
	while(mobnumber.indexOf("２")!=-1){             
	mobnumber = mobnumber.replace("２","2");}       
	while(mobnumber.indexOf("３")!=-1){             
	mobnumber = mobnumber.replace("３","3");}       
	while(mobnumber.indexOf("４")!=-1){             
	mobnumber = mobnumber.replace("４","4");}       
	while(mobnumber.indexOf("５")!=-1){             
	mobnumber = mobnumber.replace("５","5");}       
	while(mobnumber.indexOf("６")!=-1){             
	mobnumber = mobnumber.replace("６","6");}       
	while(mobnumber.indexOf("７")!=-1){             
	mobnumber = mobnumber.replace("７","7");}       
	while(mobnumber.indexOf("８")!=-1){             
	mobnumber = mobnumber.replace("８","8");}       
	while(mobnumber.indexOf("９")!=-1){             
	mobnumber = mobnumber.replace("９","9");}       
	return mobnumber;                               
}
	function validateArea(obj){
	var str1 = obj.value;
	var str = tot(str1); 
	obj.value = str;
	if(str.length == 0){
	return -1;
	
	}
	var patn = /^[0-9]+$/;
	if(!obj.value.match(patn)) return 1;   
	return 0; 
}
function validateNumber(obj){
	var str1 = obj.value;
	var str = tot(str1); 
	obj.value = str;
	if(str.length == 0){
		return -1;
	}
	var patn = /^[0-9-\/]+$/;
	if(!patn.test(str)) return 1;
	return 0;
}
	function ob_dh(thisname){
		websen[0]=0
		var re = /^[0-9-\/]+$/;

		var msg = document.getElementById("gddh");
		if((document.form_reg.phone_number.value.length ==7 || document.form_reg.phone_number.value.length ==8 )&&document.form_reg.CountryCode.value=="86"&&(document.form_reg.CityCode.value.length ==3 || document.form_reg.CityCode.value.length ==4))
	
		{
			msg.innerHTML = "<font color=#999999>输入符合规范</font>"
			  document.getElementById("dh").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "
			}else
			
			{  
			websen[0]="18"
			  document.getElementById("dh").innerHTML=""
			 msg.innerHTML = " <table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>输入不符合规范!</font></td></tr></table>"
			  
			  
				}
		}
		function of_dh(thisname){
			var msg = document.getElementById("gddh");
			
			msg.innerHTML = "<font color=#999999>国家代码－区号－电话号码-分机(非必填)</font>"
			}
	
	//////////公司所在//////////////
	function ob_shi(thisname){
		websen[0]=0
		var msg = document.getElementById("city4");
	if(document.form_reg.country1.options.value=="中国香港" ||document.form_reg.country1.options.value=="中国台湾" ||document.form_reg.country1.options.value=="中国澳门" || document.form_reg.country1.options.value=="其他国家")
		{
		msg.innerHTML = "<font color=#999999>输入符合规范</font>"
document.getElementById("websengs").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "			
			}
		
	else if(document.form_reg.country1.options.value=="" || document.form_reg.province.options.value=="" || document.form_reg.city.options.value=="")
 {   document.getElementById("websengs").innerHTML=""
	msg.innerHTML = " <table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>请输入公司所在！</font></td></tr></table>"
		 
 }  else{
	msg.innerHTML = "<font color=#999999>输入符合规范</font>"
document.getElementById("websengs").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "	

	
           }
		


		
		
		                       }
	/////////	
function OutputNewsCode1(Val){
	
	//var obj = document.form_reg.Newscode.value;
//    var bjo=document.form_reg.city1.options[document.form_reg.city1.options.selectedIndex].value+","+document.form_reg.city2.options[document.form_reg.city2.options.selectedIndex].value+","+document.form_reg.city3.options[document.form_reg.city3.options.selectedIndex].value;
//	if (document.form_reg.city1.options.selectedIndex==0 )	
//	{
//		document.form_reg.Newscode.value=""
//	}else if (document.form_reg.city2.options.selectedIndex==0)
//	{document.form_reg.Newscode.value=""
//		}
//	else {
//	document.form_reg.Newscode.value="中国,"+bjo;}
	
}
				   
	////街道判断//////////
	function ob_jd(thisname){
		var msg = document.getElementById("jd");
		
		if (thisname.value !="")
		{msg.innerHTML = "<font color=#999999>输入符合规范</font>"
		document.getElementById("websenjd").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "
			}else
			{document.getElementById("websenjd").innerHTML=""
			msg.innerHTML = ""}
		}
		
		function of_jd(thisname){
			
			var msg = document.getElementById("jd");
			
			msg.innerHTML = "<font color=#999999>请补充后面的详细街道地址!</font>"
			}
			function oc_jd(thisname){
			var msg = document.getElementById("jd");
			
			msg.innerHTML = ""
			}
	/////////手机//////////////
	function of_sj(thisname){
		websen[0]=0
	var re = /13\d{9}/;
	var msg = document.getElementById("sj");
	if (!thisname.value.match(re) || thisname.value.length>11) {
		msg.innerHTML = ""
		websen[0]="25"
		}else{msg.innerHTML = "<font color=#999999>输入符合规范</font>"
		document.getElementById("websensj").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "
		}
	
	}
	function ob_sj(thisname)
	{
		websen[0]=0
		var msg = document.getElementById("sj");
	document.getElementById("websensj").innerHTML=""
		msg.innerHTML = "<font color=#999999>格式如下:13*********</font>"
		}
	/////////////邮政/////////////
	function ob_yz(thisname)
{	var re = /^[0-9]{6}$/;
    var msg = document.getElementById("yz");
	if (!thisname.value.match(re))
	{
	websen[0]="27"
	document.getElementById("websenyz").innerHTML=""
	msg.innerHTML = ""
	
		}else
	{
		msg.innerHTML = "<font color=#999999>输入符合规范</font>"
		document.getElementById("websenyz").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "}
}
function of_yz(thisname)
{
	var msg = document.getElementById("yz");
	document.getElementById("websenyz").innerHTML=""
		msg.innerHTML = "<font color=#999999>格式如下:100000</font>"
		
	
	}
//////////公司名称///////////////////

function ob_gsmc(thisname)
{
	websen[0]=0
	var firstCode = thisname.value.substring(0,1);
  var exp = new RegExp(firstCode, "ig");
	var msg = document.getElementById("GSMC");
if (isNumberContinue(thisname.value) == 1)
{       websen[0]="30"
	    msg.innerHTML = ""
		document.getElementById("websenGSMC").innerHTML=""
	   msg.innerHTML = "<table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>公司名称不能用连续的字符或完全使用数字表示!</font></td></tr></table>"
} 
else if(thisname.value.match(exp) && thisname.value.match(exp).length==thisname.value.length)
{   websen[0]="30"
	msg.innerHTML = ""
		document.getElementById("websenGSMC").innerHTML=""
	  msg.innerHTML = "<table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>公司名称不能用连续的字符或完全使用数字表示!</font></td></tr></table>"
	}
else {
msg.innerHTML = "<font color=#999999>输入符合规范</font>"
		document.getElementById("websenGSMC").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "
  }
  
}

function of_gsmc(thisname)
	{
		
		var msg = document.getElementById("GSMC");
	document.getElementById("websenGSMC").innerHTML=""
		msg.innerHTML = "公司名称不能用连续的字符或完全使用数字表示. 格式如下:**B2B科技"
		}
///////////职位//////////////////


function ob_gszw(thisname){
	   var tsda= document.getElementById("gszw");
	  if(thisname.value==""){
		   tsda.innerHTML = ""
		   document.getElementById("websengszw").innerHTML=""
		  }
		  else{tsda.innerHTML = "<font color=#999999>输入符合规范</font>"
		  document.getElementById("websengszw").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\">"
		  }
		  
	  }



////////////行业/////////////////
function ob_zyhe(thisname){
	 var msg= document.getElementById("GShy");
if(document.form_reg.p_z_Z_RootCategory.options.selectedIndex==0 || document.form_reg.p_z_Z_CategoryId1.options.selectedIndex==0)

	{msg.innerHTML = ""
		document.getElementById("websenGShy").innerHTML=""
		}else{
			msg.innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#999999>输入符合规范</font>"
document.getElementById("websenGShy").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "
			}
	}

///////////j经营产品//////////////////
 function ob_zycp(thisname){
   	var msg= document.getElementById("zycp");
if (document.form_reg.productionService.value==""&& document.form_reg.productionService2.value==""&&document.form_reg.productionService3.value=="")
	{msg.innerHTML = ""
		document.getElementById("websenzycp").innerHTML=""}else
		{msg.innerHTML = "<font color=#999999>输入符合规范</font>"
document.getElementById("websenzycp").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "}
	
	}
//////////////经营模式////////////////////////
function ob_ms()
{	var msg= document.getElementById("changpingms");
	 var  check=true;
      for(var i=0;i<document.form_reg.qylb.length;i++)
	  {
 	 if (document.form_reg.qylb[i].checked) 
	 {
		 check=false;
		break;
        }	
       }
	 if (check)
	 {
      msg.innerHTML = ""
	  document.getElementById("ms").innerHTML=""
          document.form_reg.qylb[0].focus();
          return (false);
		  
       }else
	   {
		   msg.innerHTML = "&nbsp;<font color=#999999>输入符合规范</font>"
document.getElementById("ms").innerHTML="&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "
		   }
	
	}

//////////////////////////////////////
function check_content(value)//验证公司简介信息
	{
		var msg= document.getElementById("contentdiv");
	 if(value.replace(/\s+/g,"")!="")
	 {
 	  if((value.replace(/\s+/g,"")).length<50||(value.replace(/\s+/g,"")).length>2000)
		{
msg.innerHTML = "<table   border=1 cellpadding=0 cellspacing=0 ><tr><td valign=middle bordercolor=#FF0000 bgcolor=#FFF5D8><img src='../images/websen.gif' width=16 height=16><font color=#000000>温馨提示：对不起！您输入的字数不符合要求！公司简介的字数应大于50，小于2000!</font></td></tr></table>" 
	      document.form_reg.qyjj.focus();
	      document.form_reg.qyjj.select();
		  document.getElementById("websengsjj").innerHTML=""
 		  return false;
	    }
		else
		 {
		     document.all("contentdiv").style.color='#8F8F8F';
 			 document.all("contentdiv").innerText="经济全球化的时代，谁的企业声誉高，谁就是商界的强者!请认真填写公司简介，让客户有信任感，而不是虚假性信息，使公司形象受到影响！从现在开始树立企业的良好声誉！此处禁止填写联系人、电话、传真、地址、网址、email等信息。不要使用广告词或夸大性的语句，不要加图片及Html代码。   "; 
			 document.getElementById("websengsjj").innerHTML="&nbsp;<br>&nbsp;<img src="+rightIcon+" width=\"19\" height=\"16\" align=\"absmiddle\"> "
		 }
  	  }
   	}
///////////////////////////////////////验证提交开始 

//////////////////////表单验证////////////////////////////////////  

 function checkcontent() //提交时统一验证内容不能为空
   {websen[0]=0
	  if (websen[0]=="1")
	   {
		    alert("会员名称不能为空！");
	  document.form_reg.username.focus();
	  websen[0]=0
	  return false;
		   }
		   if (websen[0]=="2")
	   {
		    alert("会员名称最少6位！");
	  document.form_reg.username.focus();
	  websen[0]=0
	  return false;
		   }
		   if (websen[0]=="3")
	   {
		    alert("会员不能重名！");
			websen[0]=0
	       document.form_reg.username.focus();
	       return false;
	   }
///////////////////////////////////////////////////
  if (websen[1]=="4")
	   {
		    alert("输入不能小于6位！");
			websen[1]=0
	       document.form_reg.password.focus();
	       return false;
	   }
	    if (websen[1]=="5")
	   {
		    alert("密码不能为空 ！");
			websen[1]=0
	       document.form_reg.password.focus();
	       return false;
	   }
	    if (websen[1]=="6")
	   {
		    alert("为安全起见，密码不能用同一个数字或字母，请重新设置密码！ ！");
			websen[1]=0
	       document.form_reg.password.focus();
	       return false;
	   }
	    if (websen[1]=="7")
	   {
		    alert("为安全起见，密码不能与会员登录名相同，请重新设置密码！ ");
			websen[1]=0
	       document.form_reg.password.focus();
	       return false;
	   }
/////////////////////////////
 if (websen[0]=="8")
	   {
		    alert("请输入会员确认密码！");
			websen[0]=0
	       document.form_reg.confirmpassword.focus();
	       return false;
	   }
	   if (websen[0]=="9")
	   {
		    alert("密码与确认密码输入不一致");
			websen[0]=0
	       document.form_reg.confirmpassword.focus();
	       return false;
	   }
////////////////////////////
 if (websen[0]=="16")
	   {
		    alert("输入不符合规范 格式如下:b2b@websen.com.");
			websen[0]=0
      
	       document.form_reg.email.focus();
	       return false;
	   }
if (websen[0]=="17")
	   {
		    alert("即时通讯TM号最少5位");
			websen[0]=0;
	       document.form_reg.tm.focus();
	       return false;
	   }
if (websen[0]=="23")
	   {
		    alert("MSN格式有误！");
			websen[0]=0;
	       document.form_reg.msn.focus();
	       return false;
	   }
if (websen[0]=="25")
	   {
		    alert("手机格式有误！");
			websen[0]=0;
	       document.form_reg.mobile.focus();
	       return false;
	   }	   	  
if (websen[0]=="27")
	   {
		    alert("邮政格式有误！");
			websen[0]=0;
	       document.form_reg.post.focus();
	       return false;
	   }
if (websen[0]=="30")
	   {
		    alert("公司名称不能用连续的字符或完全使用数字表示！");
			websen[0]=0;
	       document.form_reg.qymc.focus();
	       return false;
	   }	  
////////////////////////////	
if(document.all("cYanNum").style.display!="none")
	  {  
	 
	  
     if(document.form_reg.wentiname.value.replace(/\s+/g,"")=="")
	   {
	    alert("请输入验证问题！");
	    document.form_reg.wentiname.focus();
	    return false;
	   }
	   var xmlResult = xmlHttp1.responseXML;
       var str = xmlResult.getElementsByTagName("mssg")[0];
	   var yz=str.childNodes[0].nodeValue
	    if (yz==3)
	   { alert("验证问题有误！");
	    document.form_reg.wentiname.focus();
	    return false;
		   }
	   
     }
 if(document.form_reg.username.value.replace(/\s+/g,"")=="")
	 {
	  alert("请输入会员登录名！");
	  document.form_reg.username.focus();
	  return false;
	 }
	 if( document.form_reg.password.value.replace(/\s+/g,"")=="")
	 {
	  alert("请输入会员密码！");
	  document.form_reg.password.focus();
	  return false;
	 }
	 if(document.form_reg.confirmpassword.value.replace(/\s+/g,"")=="")
	 {alert("请输入会员确认密码！");
	  document.form_reg.confirmpassword.focus();
	  return false;
		 }
	if(document.all("quesb").style.display!="none")
	  {
   	     if(document.form_reg.question.options.selectedIndex==0)
	   {
	    alert("请选择密码提示问题！");
        document.form_reg.question.focus();
	     return  false;
	    }	
	  } 	
	
	if(document.all("ansb").style.display!="none")
     {
   	    if(document.form_reg.answer.value.replace(/\s+/g,"")=="")
	    {
	      alert("请输入密码提示答案！");
          document.form_reg.answer.focus();
	      return  false;
	     }	
	 }
	 
 if(document.all("usertrueb").style.display!="none")
	  {
	 if(document.form_reg.name.value.replace(/\s+/g,"")=="")
	  {
	   alert("请输入真实姓名！");
	   document.form_reg.name.focus();
	   return false;
	  }   
	  }
	  if(document.form_reg.email.value.replace(/\s+/g,"")=="")
	  {
	   alert("请输入电子邮箱地址！");
	   document.form_reg.email.focus();
	   return false;
 	  }
	  if(document.all("tmb").style.display!="none")
	  {
	     if(document.form_reg.tm.value.replace(/\s+/g,"")=="")
	    {
	      alert("请输入即时通讯TM号！");
	      document.form_reg.tm.focus();
	      return false;
	    }   
	  } 
	   if(document.all("telb").style.display!="none")
	  { 	  
	 if(document.form_reg.CountryCode.value.replace(/\s+/g,"")=="")
	  {
	   alert("请输入国家区号！");
	   document.form_reg.CountryCode.focus();
	   return false;
	  }
	  if((document.form_reg.phone_number.value.length !=7 || document.form_reg.phone_number.value.length !=8 )&&document.form_reg.CountryCode.value!="86"&&(document.form_reg.CityCode.value.length !=3 || document.form_reg.CityCode.value.length !=4))
	  { alert("固定电话格式有误！");
	   document.form_reg.CountryCode.focus();
	   return false;
		  }
	 if(document.form_reg.CityCode.value.replace(/\s+/g,"")=="")
	  {
	   alert("请输入城市区号！");
	   document.form_reg.CityCode.focus();
	   return false;
	  }	  
     if(document.form_reg.phone_number.value.replace(/\s+/g,"")=="")
	  {
	   alert("请输入号码！");
	   document.form_reg.phone_number.focus();
	   return false;
	  }
	   }
	  
	 if(document.all("comaddrb").style.display!="none")
    {
		//if(document.form_reg.city1.options.selectedIndex==0)
//	    {   
//	       alert("请你选择省/直辖市!");
//		   document.form_reg.city1.focus();
//		    return false;
//	    } 
//	    else
//	   {
//		   if(document.form_reg.city1.options.value!="台湾省" && document.form_reg.city1.options.value!="香港特区" &&document.form_reg.city1.options.value!="澳门特区" )
//		  {
//	         if(document.form_reg.city2.options.selectedIndex==0)
//		     {
//		        alert("请你选择公司所在地的所在地区 !");
//		        document.form_reg.city2.focus();
//		        return false;
//		     }
//		     if(document.form_reg.city3.options.selectedIndex==0)
//		     {
//		        alert("请你选择公司所在地的所在城市！");
//		        document.form_reg.city3.focus();
//		        return false;
//		     } 
//		  }
//	   }
 if(document.form_reg.country1.options.selectedIndex==0)
	  {
		if(document.form_reg.province.options.selectedIndex==0)
		{
		alert("请你选择公司所在地的所在省市或地区 !");
		  document.form_reg.province.focus();
		return false;
		}
		if(document.form.city.options.selectedIndex==0)
		{
		alert("请你选择公司所在地的所在城市！");
		  document.form_reg.city.focus();
		return false;
		}
	  }  
	  }
	  
	  if(document.all("streetb").style.display!="none")
	   {
 	     if(document.form_reg.address.value.replace(/\s+/g,"")=="")
	    {
	        alert("请输入街道地址！");
	        document.form_reg.address.focus();
	        return false;
	    }
	   }
	   
	 if(document.all("msnb").style.display!="none")
	  {
	    if(document.form_reg.msn.value.replace(/\s+/g,"")=="")
	   {
	     alert("请输入MSN帐号！");
	     document.form_reg.msn.focus();
	     return false;
	   }   
	  } 
     if(document.all("mobileb").style.display!="none")
	  { 	 
	    if(document.form_reg.mobile.value.replace(/\s+/g,"")=="")
	    {
	   alert("请输入手机号码！");
	   document.form_reg.mobile.focus();
	   return false;
	    } 	  
	  }
	 if(document.all("postb").style.display!="none")
	  { 	  
	   if(document.form_reg.post.value.replace(/\s+/g,"")=="")
	   {
	     alert("请输入邮政编码！");
	     document.form_reg.post.focus();
	     return false;
	   } 	  
	  }
   if(document.all("workb").style.display!="none")
	  { 	  
	 if(document.form_reg.zw.value.replace(/\s+/g,"")=="")
	  {
	   alert("请输入您的职位！");
	   document.form_reg.zw.focus();
	   return false;
	  } 	  
	  }	
if(document.form_reg.qymc.value.replace(/\s+/g,"")=="")
	 {
	  alert("请输入贵公司名称！");
	  document.form_reg.qymc.focus();
	  return false;
	 }
  if(document.all("mainkindb").style.display!="none")
   {
	if(document.form_reg.p_z_Z_RootCategory.options.selectedIndex==0)
	  {
	    alert("请选择主营行业大类！");
        document.form_reg.p_z_Z_RootCategory.focus();
	    return  false;
	  }	
	  if(document.form_reg.p_z_Z_RootCategory.options.selectedIndex!=0 && document.form_reg.p_z_Z_CategoryId1.options.selectedIndex==0)
	  {
	    alert("请选择主营行业子类！");
        document.form_reg.p_z_Z_CategoryId1.focus();
	    return  false;
	  }	
	}
	
	if(document.all("mainprob").style.display!="none")
   {	
	 if(document.form_reg.productionService.value=="")
	 {
	 alert("请填写主营产品/服务！");
	 document.form_reg.productionService.focus();
	 return false;
	 }	 
 	}
  if(document.all("moshib").style.display!="none")
   {	
	  var  check=true;
      for(var i=0;i<document.form_reg.qylb.length;i++)
	  {
 	 if (document.form_reg.qylb[i].checked) 
	 {
		 check=false;
		break;
        }	
       }
	 if (check)
	 {
          alert("请选择经营模式！");
          document.form_reg.qylb[0].focus();
          return (false);
       }  
  	}
	
	 if(document.all("comdesb").style.display!="none")
   {	
    if((document.form_reg.qyjj.value.replace(/\s+/g,"")).length<50||(document.form_reg.qyjj.value.replace(/\s+/g,"")).length>2000)
	   {
	    alert("请输入公司简介内容!");
	    document.form_reg.qyjj.focus();
 	    return false;
 	    }
	 }
	 if(document.all("yzmb").style.display!="none")
	  {
       if(document.form_reg.Verifycode.value.replace(/\s+/g,"")=="")
	  {
	   alert("请输入验证码！");
	   document.form_reg.Verifycode.focus();
	   return false;
	  }
	 }
	
}

//验证提交结束


 











