// JavaScript Document
//var Lang="gb" //定义语种,不同时必改

/* Create a new XMLHttpRequest object to talk to the Web server */
var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
@end @*/
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}
var chk
function chkUserReg(Num,Lang)
{
	//var Lang;
	switch(Lang)
	{
		case "GbXt598_T":Lang="gb";break;
		case "EnXt598_T":Lang="en";break;
		case "Big5Xt598_T":Lang="big5";break;
	}


	var rc=document.check;
	var showtxt=new Array(12);
	var i,ppstring;
switch(Num)
{
	case 1:
	var gm;
	var num = rc.m1.value;
	var partten = /^1[3,5,8]\d{9}$/;
	
	if(rc.ML_UserPasswordOLd==null)
	{	gm=true;}else{gm=false;
		if(rc.ML_UserPasswordOLd.value!=''){gm=true;}	}
	if(gm){
		if(rc.m1.value=='')
		{showtxt[1]='<div class="ErrMsg">手机号码不能为空!</div>|<div class="ErrMsg"></div>|<div class="ErrMsg"></div>';chk=false;}
		else if(rc.m1.value.length!=11)
		{showtxt[1]='<div class="ErrMsg">手机号码必须是11数字组成.</div>|<div class="ErrMsg"></div>|<div class="ErrMsg"></div>';chk=false;}
		else 
		{
			if(partten.test(num))
			{showtxt[1]='';}
			else
			{showtxt[1]='<div class="ErrMsg">手机号码为13,15或18开头</div>|<div class="ErrMsg"></div>|<div class="ErrMsg"></div>';chk=false;}
		}
	}
	break;
	case 2:
	var gm;
	if(rc.ML_UserPasswordOLd==null)
	{	gm=true;}else{gm=false;
		if(rc.ML_UserPasswordOLd.value!=''){gm=true;}	}
	if(gm)
	{if(rc.m1.value==''||rc.m1.value!=rc.m2.value)
	{showtxt[2]='<div class="ErrMsg">确认号码不相同，请重新输入</div>|<div class="ErrMsg"></div>|<div class="ErrMsg"></div>';chk=false;}
	else
	{showtxt[2]='';}}
	break;
	

}
	var dinobj
	for(i=1; i<=12; i++)
	{
		
		if(showtxt[i]!=null)
		{
			ppstring=("0000"+i)
			ppstring=ppstring.substr(ppstring.length-2,2);
			dinobj=document.getElementById('r'+ppstring);
			switch(Lang)
				{
					case "gb":
					if(showtxt[i].length<33){dinobj.innerHTML=showtxt[i];}else{dinobj.innerHTML=showtxt[i].split("|")[0];}
					break;
					case "en":
					if(showtxt[i].length<33){dinobj.innerHTML=showtxt[i];}else{dinobj.innerHTML=showtxt[i].split("|")[1];}
					break;
					case "big5":
					if(showtxt[i].length<33){dinobj.innerHTML=showtxt[i];}else{dinobj.innerHTML=showtxt[i].split("|")[2];}
					break;
				}
		}
	}
}
	
	

	function chkall(Lang)
	{
		var k;
		chk=true
		for(k=1;k<=2;k++)
		{
			
			chkUserReg(k,Lang);
			//alert(chk);
			}
			//alert(chk);
		return chk;
		
		
		}
