﻿<!--
function checkreg()
{
  if (document.all("uid").value=="")
	{
	alert("请填写用户名！");
	document.all("uid").focus();
	return false;
	}
  else
    {
	document.reg.CheckName.value=document.all("uid").value;
	var popupWin = window.open('about:blank', 'CheckName', 'scrollbars=no,width=300,height=150');
	document.reg.submit();
	}
}
function del_space(s)
{
	for(i=0;i<s.length;++i)
	{
	 if(s.charAt(i)!=" ")
		break;
	}

	for(j=s.length-1;j>=0;--j)
	{
	 if(s.charAt(j)!=" ")
		break;
	}

	return s.substring(i,++j);
}

function VerifySubmit()
{
    leixing = del_space(document.all("leixing").value);
     if (leixing.length == 0)
     {
        alert("请选择用户类型!");
        document.all("leixing").focus();
	return false;
     }
	uid = del_space(document.all("uid").value);
     if (uid.length == 0)
     {
        alert("请填写用户名！");
        document.all("uid").focus();
	return false;
     }
	pwd = document.all("pwd").value;
     if (pwd.length == 0)
     {
        alert("请填写密码！");
        document.all("pwd").focus();
	return false;
     }
	pwd2 = document.all("pwd2").value;
     if (pwd2!=pwd)
     {
        alert("两次输入的密码不相同，请重新填写！");
        document.all("pwd2").focus();
		return false;
     }
	 tishi = del_space(document.all("tishi").value);
     if (tishi.length == 0)
     {
        alert("请选择密码提示问题！");
        document.all("tishi").focus();
        return false;
     }
	 tsda = del_space(document.all("tsda").value);
     if (tsda.length == 0)
     {
        alert("请填写密码提示答案！");
        document.all("tsda").focus();
        return false;
     }
	uname = del_space(document.all("uname").value);
     if (uname.length == 0)
     {
        alert("请填写您的姓名！");
        document.all("uname").focus();
        return false;
     }
	tel = del_space(document.all("tel").value);
     if (tel.length !== 8&&tel.length !== 11&&tel.length !== 12)
     {
        alert("联系电话的位数不正确，请重新填写！");
        document.all("tel").focus();
        return false;
     }
	return true;
}

//设置用户类型区分
function Leixing(){
if (document.regform.leixing.options[document.regform.leixing.selectedIndex].value!=='中介'){
document.getElementById("AgentName").style.display="none";
document.getElementById("AgentAddress").style.display="none";
document.getElementById("Content").innerHTML=document.getElementById("code1").innerHTML;
}else{
document.getElementById("AgentName").style.display="block";
document.getElementById("AgentAddress").style.display="block";
document.getElementById("Content").innerHTML=document.getElementById("code2").innerHTML;
}
}

//-->