function judgeBlank(txtValue,pos)
{
	var text="~`!#$%^&*|\/?<>;:'";
	var checkStr=txtValue.value;
	if(checkStr.length==0 | checkStr==" ")	
	{
			msg="此为必填项!";
			showMsg(msg,pos);
			return false;
	}
	for(i=0;i<=checkStr.length-1;i++) 
	{
		char1=checkStr.charAt(i);
		index=text.indexOf(char1);
		if(index>=0 | char1=='"') 
		{
			msg="不能包含"+char1;
			showMsg(msg,pos);
			return false;
		}
	}
	hideMsg(pos);
	return true;
}

function judgeLength(txtValue,pos)
{
	var checkStr=txtValue.value;
	if (checkStr.length<6)
	{
			msg="至少要有6位字符组成";
			showMsg(msg,pos);
			return false;

	}
				hideMsg(pos);
	return true;
}

function comed(v1,v2,pos)

{
	var c1=v1.value;
     var c2=v2.value;
	if (c1!=c2)
	{
			msg="两次密码输入不一致!";
			showMsg(msg,pos);
			return false;

	}
				hideMsg(pos);
	return true;
}
function mcheck(v1,pos)
{
			msg="对不起，该邮箱已被注册!";
			showMsg(hcw.userclass.mailcheck(v1).value,pos);
			return false;

}

var multiChar=new Array("０","１","２","３","４","５","６","７","８","９","Ｑ","Ｗ","Ｅ","Ｒ","Ｔ","Ｙ","Ｕ","Ｉ","Ｏ","Ｐ","Ａ","Ｓ","Ｄ","Ｆ","Ｇ","Ｈ","Ｊ","Ｋ","Ｌ","Ｚ","Ｘ","Ｃ","Ｖ","Ｂ","Ｎ","Ｍ","ｑ","ｗ","ｅ","ｒ","ｔ","ｙ","ｕ","ｉ","ｏ","ｐ","ａ","ｓ","ｄ","ｆ","ｇ","ｈ","ｊ","ｋ","ｌ","ｚ","ｘ","ｃ","ｖ","ｂ","ｎ","ｍ","．","－","＿","＠"," ","　");
var asciiChar=new Array("0","1","2","3","4","5","6","7","8","9","q","w","e","r","t","y","u","i","o","p","a","s","d","f","g","h","j","k","l","z","x","c","v","b","n","m","q","w","e","r","t","y","u","i","o","p","a","s","d","f","g","h","j","k","l","z","x","c","v","b","n","m",".","-","_","@","","");

function replaceAll(str, strFrom, strTo)
{
	return str.replace(new RegExp(strFrom, "g"), strTo);
}

function multi2ascii(TxtValue,WareName,theForm)
{
	for (var i=0;i<multiChar.length;++i)
	TxtValue=replaceAll(TxtValue, multiChar[i], asciiChar[i]);
	eval("window."+theForm+"."+WareName).value=TxtValue;
	return true;
}
function checkrname(rnameStr,pos)
{return true;}
function checkEmailFormat(emailStr,pos)
{

	var checkTLD=1;
	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
	var validChars="\[^\\s" + specialChars + "\]";
	var quotedUser="(\"[^\"]*\")";
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	var atom=validChars + '+';
	var word="(" + atom + "|" + quotedUser + ")";
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	var emailPat=/^(.+)@(.+)$/;
	var matchArray=emailStr.match(emailPat);



		if(matchArray==null)
		{
			msg="邮件地址错误 (请检查@ 和 .)";
			showMsg(msg,pos);
			return false;
		}

	else
	{
		if(matchArray==null)
		{
			return false;
		}		
	}
	var user=matchArray[1];
	var domain=matchArray[2];

	for (i=0; i<user.length; i++)
	{
		if (user.charCodeAt(i)>127)
		{
			msg="您输入的邮箱地址中用户名包含非法字符";
			showMsg(msg,pos);
			return false;
		}
	}
	for (i=0; i<domain.length; i++)
	{
		if (domain.charCodeAt(i)>127)
		{
			msg="您输入的邮箱地址中包含非法字符";
			showMsg(msg,pos);
			return false;
		}
	}
	if (user.match(userPat)==null)
	{
		msg="请正确输入您的邮箱地址";
		showMsg(msg,pos);
		return false;
	}
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for (i=0;i<len;i++)
	{
		if (domArr[i].search(atomPat)==-1)
		{
			msg="您输入的邮箱地址不正确";
			showMsg(msg,pos);
			return false;
		}
	}
	if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1)
	{
		msg="您输入的邮件域名不正确";
		showMsg(msg,pos);
		return false;
	}
	if (len<2)
	{
		msg="这个邮件地址没有主机名";
		showMsg(msg,pos);
		return false;
	}

	return true;
}

function SelOption(theForm,txtValue,emailValue)
{
	if(eval("window."+theForm+"."+txtValue).value=="other")
	{
		charAddr.style.display='none';
		eval("window."+theForm+"."+txtValue).style.display='none';
		eval("window."+theForm+"."+emailValue).focus();
	}
}


function showMsg(msg,pos)
{
	document.getElementById('WarnMsg'+pos).innerHTML="<div id='TipError' nowrap='nowrap'>"+msg+"</div><img id='ErrorPointer' src='/images/ae.gif' />";
	document.getElementById('WarnMsg'+pos).style.visibility="visible";
}
function hideMsg(pos)
{
	document.getElementById('WarnMsg'+pos).style.visibility="hidden";
}

function sTip(j)
{
	for (i=1;i<11;i++)
	{
		i=i+"";
		document.getElementById("Dt"+i).style.border="1px solid #fff";
		document.getElementById("Dt"+i).style.background="#fff";
		document.getElementById("Dt"+i).style.color="#999";
	}
	document.getElementById("Dt"+j).style.border="1px solid #8cbfce";
	document.getElementById("Dt"+j).style.color="#000";
	document.getElementById("Dt"+j).style.background="#ebfafe";
	document.getElementById("Dt"+j).style.backgroundImage="url(/images/tip.gif)";
	document.getElementById("Dt"+j).style.backgroundRepeat="no-repeat";
	document.getElementById("Dt"+j).style.backgroundPosition="10px 10px";
}
function ssTip(j)
{
	for (i=1;i<7;i++)
	{
		i=i+"";
		document.getElementById("Dt"+i).style.border="1px solid #fff";
		document.getElementById("Dt"+i).style.background="#fff";
		document.getElementById("Dt"+i).style.color="#999";
	}
	document.getElementById("Dt"+j).style.border="1px solid #8cbfce";
	document.getElementById("Dt"+j).style.color="#000";
	document.getElementById("Dt"+j).style.background="#ebfafe";
	document.getElementById("Dt"+j).style.backgroundImage="url(/images/tip.gif)";
	document.getElementById("Dt"+j).style.backgroundRepeat="no-repeat";
	document.getElementById("Dt"+j).style.backgroundPosition="10px 10px";
}

function haveYet(pam)
{
	document.getElementById("Tra").style.display=pam;
	document.getElementById("Trb").style.display=pam;
	document.getElementById("Trc").style.display=pam;
}


		function GetObj(objName){
			if(document.getElementById){
				return eval('document.getElementById("' + objName + '")');
			}else if(document.layers){
				return eval("document.layers['" + objName +"']");
			}else{
				return eval('document.all.' + objName);
			}
		}
		function AADmenu(index,a,flag){
			for(var i=a;i<flag;i++){/* 最多支持9个标签 */
				if(GetObj("AADcon"+i)&&GetObj("AADm"+i)){
					GetObj("AADcon"+i).style.display = 'none';
					GetObj("AADm"+i).className = "AADmenuOff"+i;
				}
			}
			if(GetObj("AADcon"+index)&&GetObj("AADm"+index)){
				GetObj("AADcon"+index).style.display = 'block';
				GetObj("AADm"+index).className = "AADmenuOn"+index;
			}
		}
