  var gvCurrentUIRecordIndex=0;
  function UI_Record_Send(pvUrl)
  {
    if(gvDiableUIActiongLog==true)
    {
        return;
    }
    if(gvCurrentUIRecordIndex>9)
    {
        gvCurrentUIRecordIndex=0;
    }
    var lvImgObj=document.getElementById("UIActionImg"+gvCurrentUIRecordIndex);
    if(lvImgObj!=null)
    {
        lvImgObj.src=pvUrl+"&rand="+Math.random();
        gvCurrentUIRecordIndex++;
    }
  }
  function GetRegType()
  {
    if(document.getElementById("ptType_0").checked)
    {
        return "0";
    }
    else if(document.getElementById("ptType_1").checked)
    {
        return "1";
    }
    else if(document.getElementById("ptType_2").checked)
    {
        return "2";
    }
    return "0";
  }    
  function IsNotEmptyField(pvFieldName)
  {
    return  (document.getElementById(pvFieldName)!=null &&  document.getElementById(pvFieldName).value!="");
  }
  var gvPwdNeedRecord=new Array(); gvPwdNeedRecord[0]=true;gvPwdNeedRecord[1]=true;gvPwdNeedRecord[2]=true;
  function UI_Record_Pwd()
  {
    var lvRegType=GetRegType();
    if(gvPwdNeedRecord[parseInt(lvRegType)] && IsNotEmptyField("password"))
    {
        var url = "DataRec.ashx?type=10005&regtype="+lvRegType;
        UI_Record_Send(url);
        gvPwdNeedRecord[parseInt(lvRegType)]=false;
    }
  }
  var gvRPwdNeedRecord=new Array(); gvRPwdNeedRecord[0]=true;gvRPwdNeedRecord[1]=true;gvRPwdNeedRecord[2]=true;
  function UI_Record_RPwd()
  {
    var lvRegType="0";
    if(gvRPwdNeedRecord[parseInt(lvRegType)]  && IsNotEmptyField("repassword"))
    {
        var url = "DataRec.ashx?type=10006&regtype="+lvRegType;
        UI_Record_Send(url);
        gvRPwdNeedRecord[parseInt(lvRegType)] =false;
    }
  }
  var gvEmailNeedRecord=new Array(); gvEmailNeedRecord[0]=true;gvEmailNeedRecord[1]=true;gvEmailNeedRecord[2]=true;
  function UI_Record_Email()
  {
    var lvRegType=GetRegType();
    if(gvEmailNeedRecord[parseInt(lvRegType)] && IsNotEmptyField("PTUserEmailId"))
    {
        var url = "DataRec.ashx?type=10007&regtype="+lvRegType;
        UI_Record_Send(url);
        gvEmailNeedRecord[parseInt(lvRegType)]=false;
    }
  }
  var gvMobileNeedRecord=new Array(); gvMobileNeedRecord[0]=true;gvMobileNeedRecord[1]=true;gvMobileNeedRecord[2]=true;
  function UI_Record_Mobile()
  {
    var lvRegType=GetRegType();
    if(gvMobileNeedRecord[parseInt(lvRegType)] && IsNotEmptyField("mobile"))
    {
        var url = "DataRec.ashx?type=10008&regtype="+lvRegType;
        UI_Record_Send(url);
        gvMobileNeedRecord[parseInt(lvRegType)]=false;
    }
  }  
  var gvPromotorNeedRecord=new Array(); gvPromotorNeedRecord[0]=true;gvPromotorNeedRecord[1]=true;gvPromotorNeedRecord[2]=true;
  function UI_Record_Promotor()
  {
    var lvRegType=GetRegType();
    if(gvPromotorNeedRecord[parseInt(lvRegType)] && IsNotEmptyField("PromoterID"))
    {
        var url = "DataRec.ashx?type=10009&regtype="+lvRegType;
        UI_Record_Send(url);
        gvPromotorNeedRecord[parseInt(lvRegType)]=false;
    }
  }    
  var gvVerifyCodeNeedRecord=new Array();gvVerifyCodeNeedRecord[0]=true;gvVerifyCodeNeedRecord[1]=true;gvVerifyCodeNeedRecord[2]=true;
  function UI_Record_VerifyCode()
  {
    var lvRegType=GetRegType();
    if(gvVerifyCodeNeedRecord[parseInt(lvRegType)] && IsNotEmptyField("attcode2"))
    {
        var url = "DataRec.ashx?type=10011&regtype="+lvRegType;
        UI_Record_Send(url);
        gvVerifyCodeNeedRecord[parseInt(lvRegType)]=false;
    }
  }
  function UI_Record_ShowVerifyCodeImg()
  {
    if(document.getElementById("VerifyPicSection").style.display!="none" && document.getElementById("numimg").style.display!="none")
    {
        var url = "DataRec.ashx?type=10010&regtype="+GetRegType();
        UI_Record_Send(url);
    }
  }
  function UI_Record_ShowRecommandDlg()
  {
    var url = "DataRec.ashx?type=10012&regtype="+GetRegType();
    UI_Record_Send(url);
  }
  function UI_Record_RecommandUserNameClick()
  {
    var url = "DataRec.ashx?type=10013&regtype="+GetRegType();
    UI_Record_Send(url);
  }
  
    function CheckNewRegForm()
    {
        if(gvIPCanReg==false)
        {
            alert("对不起，今天您的IP注册数量已经达到上限，请明天尝试");
            return false;
        }
        var lvRet=false;
	    if(document.getElementById("chkAgreement").checked==false)
	    {
		    alert("请先看过并同意《盛大通行证用户服务协议》");
		    return false;
	    }
	    if(document.getElementById("chkPromoRegSpreadr")!=null)
	    {
	        if(document.getElementById("chkPromoRegSpreadr").checked==false)
	        {
		        alert("请先看过并同意《盛大推广员协议》");
		        return false;
	        }
	    }	    
	    if(document.getElementById("ptType_0").checked)
	    {
	        lvRet=CheckForm4PT();
	    }
	    else if(document.getElementById("ptType_1").checked)
	    {
	        lvRet=CheckForm4Email();
	    }
	    else if(document.getElementById("ptType_2").checked)
	    {
	        lvRet=CheckForm4Mobile();
	    }
	    else
	    {
	        return false;
	    }
	    if(lvRet)
	    {
            document.body.onbeforeunload=function(){};
	        lvShowDiaocha=false;	        
	    }
	    return lvRet;
  }
  function Check4BtnStatus()
  {
        return;
        var lvBtnSubmit=document.getElementById("btnSubmit");
        if(gvIPCanReg==false || document.getElementById("chkAgreement").checked==false )
        {
            lvBtnSubmit.value="请正确填写您的注册资料";
            lvBtnSubmit.disabled="disabled";
            return;
        }
	    if(document.getElementById("ptType_0").checked)
	    {
	        if(CheckForm4PTNoAlert())
	        {
                lvBtnSubmit.value="创建我的盛大通行证";
                lvBtnSubmit.disabled="";
	        }
	        else
	        {
                lvBtnSubmit.value="请正确填写您的注册资料";
                lvBtnSubmit.disabled="disabled";
	        }
	    }
	    else if(document.getElementById("ptType_1").checked)
	    {
	        if(CheckForm4EmailNoAlert())
	        {
                lvBtnSubmit.value="创建我的盛大通行证";
                lvBtnSubmit.disabled="";
	        }
	        else
	        {
                lvBtnSubmit.value="请正确填写您的注册资料";
                lvBtnSubmit.disabled="disabled";
	        }
	    }
	    else if(document.getElementById("ptType_2").checked)
	    {
	        if(CheckForm4MobileNoAlert())
	        {
                lvBtnSubmit.value="创建我的盛大通行证";
                lvBtnSubmit.disabled="";
	        }
	        else
	        {
                lvBtnSubmit.value="请正确填写您的注册资料";
                lvBtnSubmit.disabled="disabled";
	        }
	    }
  }
  function PromterFieldFocus()
  {
        if(document.getElementById("PromoterID").value=="若您已经被推荐人推广请正确填写，无则不填")
        {
            document.getElementById("PromoterID").style.color="black";
            document.getElementById("PromoterID").value="";
        }
  }
  function PromoterLostFocus()
  {
        if(document.getElementById("PromoterID").value=="")
        {
            document.getElementById("PromoterID").style.color="gray";
            document.getElementById("PromoterID").value="若您已经被推荐人推广请正确填写，无则不填";
        }
  }
  function RegEmailFieldFocus()
  {
        if(document.getElementById("UserEmailId").value=="注册后该邮箱地址可用于今后的密码找回")
        {
            document.getElementById("UserEmailId").style.color="black";
            document.getElementById("UserEmailId").value="";
        }
  }
  function RegEmailFieldLostFocus()
  {
        if(document.getElementById("UserEmailId").value=="")
        {
            document.getElementById("UserEmailId").style.color="gray";
            document.getElementById("UserEmailId").value="注册后该邮箱地址可用于今后的密码找回";
        }
  }    
  function RegPhoneFieldFocus()
  {
        if(document.getElementById("UserCellphoneId").value=="注册后该手机号码可用于今后的密码找回")
        {
            document.getElementById("UserCellphoneId").style.color="black";
            document.getElementById("UserCellphoneId").value="";
        }
  }
  function RegPhoneFieldLostFocus()
  {
        if(document.getElementById("UserCellphoneId").value=="")
        {
            document.getElementById("UserCellphoneId").style.color="gray";
            document.getElementById("UserCellphoneId").value="注册后该手机号码可用于今后的密码找回";
        }
  }  
  function MobileKeyDownCheck(pvTxtId,pvEvent)
  {
    if (pvEvent==null || pvEvent=="")
	{
        pvEvent=window.event;
    }  
    var obj= pvEvent.target || pvEvent.srcElement;  
    if(document.selection)
    {      
        if(obj.tagName!=undefined&&obj.tagName=='INPUT')
        {    
            var  s=document.selection.createRange();     
            s.setEndPoint("StartToStart",obj.createTextRange());    
            var pos=s.text.length;   
        }
        else
        {    
            var rng = obj.createTextRange();    
            rng.moveToPoint(pvEvent.x,pvEvent.y);
            rng.moveStart("character",-obj.value.length);    
            var pos=rng.text.length ;   
        }  
    }
    else
    {     
        var pos=obj.selectionStart;  
    }
     var key   = pvEvent.keyCode;  
     var lvValue=document.getElementById(pvTxtId).value;    
     var lvSelectionText="";
     var lvContinueEvent=true;
     if(obj.selectionStart!= undefined)  //FireFox
     {
        lvSelectionText=obj.value.substr(obj.selectionStart, obj.selectionEnd - obj.selectionStart);
     }
     else                               //IE
     {
        lvSelectionText=document.selection.createRange().text
     }
     if(key==8 && pos==1 && lvValue.length>1)
     {
        lvContinueEvent=false;
     }
     else if(key==46 && pos==0 && lvValue.length>1)
     {
        lvContinueEvent=false;
     }
     else if(key==8 || key==9 || key==13 || key==20 || key==17 || key==18 || key==92 || key==93 || key==45 || key==46 || (key>32 && key <41))
     {
        lvContinueEvent=true;
     }
     else
     {
         if(pos==0)
         {
            lvContinueEvent=(key==49 || key==97);
         }
         else
         {
         
            if(lvValue!="" && lvSelectionText!="" && lvValue.substring(0,lvSelectionText.length)==lvSelectionText)
            {
                lvContinueEvent=(key==49 || key==97);
            }
            else
            {
                lvContinueEvent=(( key>47 && key <58) || (key>95 && key<106));
            }
         }
     }
     if(lvContinueEvent==false)
     {
		if(pvEvent.cancelable)  //FireFox
		{
		    pvEvent.preventDefault();
		    pvEvent.returnValue =false;
		    pvEvent.cancel = true;
		}
		else                   // IE
		{
		    pvEvent.cancelBubble =true;
		    pvEvent.returnValue =false;
		    pvEvent.cancel = true;
		}     
     }
  }
  function RestoreUI()
  {
    try
    {
        body_onload();
        RestoreLastUI();
    }
    catch(e)
    {
    }
  }
  function SelectPTTypeEx(pvPTType)
  {
       document.getElementById("ptType_0").checked=true;
       window.open("CellphoneInfo.htm","_blank");
  }
  function EmailPVRec()
  {
    if(gvDiableUIActiongLog==true)
    {
        return;
    }
    var url = "EMailPV.ashx?pv_rec=1";
	var sRet = AjaxRequest(url);
  }
  function PhonePVRec()
  {
    if(gvDiableUIActiongLog==true)
    {
        return;
    }
    var url = "PhonePV.ashx?pv_rec=1";
	var sRet = AjaxRequest(url);
  }
  function PTAccountPVRec()
  {
    if(gvDiableUIActiongLog==true)
    {
        return;
    }
    var url = "PTAccountPV.ashx?pv_rec=1";
	var sRet = AjaxRequest(url);
  }
  function RegMaxShownPageRec()
  {
    if(gvDiableUIActiongLog==true)
    {
        return;
    }
    var url = "DataRec.ashx?type=10002";
    var sRet = AjaxRequest(url);
  }
  function EmailRecommandClick()
  {
    if(gvDiableUIActiongLog==true)
    {
        return;
    }
    var url = "DataRec.ashx?type=10003";
    var sRet = AjaxRequest(url);
  }
  function PhoneRecommandClick()
  {
    if(gvDiableUIActiongLog==true)
    {
        return;
    }
    var url = "DataRec.ashx?type=10004";
    var sRet = AjaxRequest(url);
  }
  function ShowPTTypeFlow(pvPTType)
  {
    if(pvPTType=="0")
    {
        if(gvRegPage=="IGW")
        {
            document.getElementById("spanPTType").innerHTML='<table width="100%" border="0" cellspacing="0" cellpadding="0" id="guildbar"><tr><td>&nbsp;</td><td width="110px" height="30" align="center" bgcolor="white"><img src="images/num1.gif" width="13" height="13" align="absmiddle"><b>填写注册信息</b></td><td width="15px" align="center" bgcolor="#FFFFFF"><img src="images/arrow.gif" width="10" height="9" style="margin-right: 0px"></td><td width="110px" align="center" bgcolor="#ffffff" class="grey"><img src="images/num2.gif" width="13" height="13" align="absmiddle"><font color=gray>确认注册成功</font></td><td>&nbsp;</td></tr><tr><td colspan="5"><img height=5 src="images/pix.gif" width=1></td></tr></table>';
        }
        else
        {
            document.getElementById("spanPTType").innerHTML='<table width="100%" border="0" cellspacing="0" cellpadding="0" id="guildbar"><tr><td>&nbsp;</td><td width="110px" height="30" align="center" bgcolor="white"><img src="images/num1.gif" width="13" height="13" align="absmiddle"><b>填写注册信息</b></td><td width="15px" align="center" bgcolor="#FFFFFF"><img src="images/arrow.gif" width="10" height="9" style="margin-right: 0px"></td><td width="110px" align="center" bgcolor="#ffffff" class="grey"><img src="images/num2.gif" width="13" height="13" align="absmiddle"><font color=gray>确认注册成功</font></td><td>&nbsp;</td></tr><tr><td colspan="5"><img height=5 src="images/pix.gif" width=1></td></tr></table>';
        }        
        document.getElementById("spanPTType").style.display="";
    }
    else if(pvPTType=="1")
    {
        document.getElementById("spanPTType").innerHTML='<table  width="100%" border="0" cellspacing="0" cellpadding="0" id="guildbar"><tr><td>&nbsp;</td><td width="110px" height="30" align="center" bgcolor="white"><img src="images/num1.gif" width="13" height="13" align="absmiddle"><b>填写常用邮箱</b></td><td width="15px" align="center" bgcolor="#FFFFFF"><img src="images/arrow.gif" width="10" height="9" style="margin-right: 0px"></td><td width="110px" align="center" bgcolor="#ffffff" class="grey"><img src="images/num2.gif" width="13" height="13" align="absmiddle"><font color=gray>绑定注册邮箱</font></td><td width="15px" align="center" bgcolor="#ffffff"><img src="images/arrow.gif" width="10" height="9" style="margin-right: 0px"></td><td width="110px" align="center" bgcolor="#ffffff" class="grey"><img src="images/num3.gif" width="13" height="13" align="absmiddle"><font color=gray>帐号注册成功</font></td><td>&nbsp;</td></tr><tr><td colspan="7"><img height=5 src="images/pix.gif" width=1></td></tr></table>';
        document.getElementById("spanPTType").style.display="";
    }
    else if(pvPTType=="2")
    {
        document.getElementById("spanPTType").innerHTML='<table  width="100%" border="0" cellspacing="0" cellpadding="0" id="guildbar"><tr><td>&nbsp;</td><td width="110px" height="30" align="center" bgcolor="white"><img src="images/num1.gif" width="13" height="13" align="absmiddle"><b>填写常用手机</b></td><td width="15px" align="center" bgcolor="#FFFFFF"><img src="images/arrow.gif" width="10" height="9" style="margin-right: 0px"></td><td width="110px" align="center" bgcolor="#ffffff" class="grey"><img src="images/num2.gif" width="13" height="13" align="absmiddle"><font color=gray>绑定注册手机</font></td><td width="15px" align="center" bgcolor="#ffffff"><img src="images/arrow.gif" width="10" height="9" style="margin-right: 0px"></td><td width="110px" align="center" bgcolor="#ffffff" class="grey"><img src="images/num3.gif" width="13" height="13" align="absmiddle"><font color=gray>帐号注册成功</font></td><td>&nbsp;</td></tr><tr><td colspan="7"><img height=5 src="images/pix.gif" width=1></td></tr></table>';
        document.getElementById("spanPTType").style.display="";
    }
  }
  function HideRecommandPTSection()
  {
    document.getElementById("PTAccountShowRecommandSection").style.display="none";  
  }
  function ShowPTInfoSectionEx()
  {
	if(document.getElementById("txtRegisterFrom").value=="91")
	{
	   if(document.getElementById("chkPtInfoSec").checked==false)
	   {
		    document.getElementById("chkPtInfoSec").click();	
       }
	   else
       {
		    document.getElementById("chkPtInfoSec").click();
		    document.getElementById("chkPtInfoSec").click();
	   }
	}
  }
  function TabPageControlShowAway()
  {
    var lvShowAwayFlag=document.getElementById("ui_type");
    if(lvShowAwayFlag!=null && lvShowAwayFlag.value=="0")
    {
        return true;
    }
    return false;
  }
  function HideBtnSwitchRegTypeInRegSection()
  {
    if(document.getElementById("btnSwitchRegType_1")!=null)
    {
        document.getElementById("btnSwitchRegType_1").style.display="none";
    }
    if(document.getElementById("btnSwitchRegType_2")!=null)
    {
        document.getElementById("btnSwitchRegType_2").style.display="none";
    }
    if(document.getElementById("btnSwitchRegType_3")!=null)
    {
        document.getElementById("btnSwitchRegType_3").style.display="none";
    }
  }
  function ShowTabPageControl(pvPTType)
  {
    if(TabPageControlShowAway())
    {
        HideBtnSwitchRegTypeInRegSection();        
    }
    else
    {
        var lvShowId="PTRegTable_"+pvPTType;
        for(var i=0;i<3;i++)
        {
           if(("PTRegTable_"+i)==lvShowId)
           {
                if(document.getElementById(lvShowId)!=null)
                {
                    document.getElementById(lvShowId).style.display="";
                }
           }
           else
           {
                if(document.getElementById("PTRegTable_"+i)!=null)
                {
                    document.getElementById("PTRegTable_"+i).style.display="none";
                }
           }
        }
    }
  }
  function SelectPTType(pvPTType)
  {
    if(gvIPCanReg==false)
    {
        HideRecommandPTSection();
        document.getElementById("PTSection").style.display="none";
	    document.getElementById("RegEmailSection").style.display="none";
	    document.getElementById("RegEmailSectionDiv").style.display="none";
	    document.getElementById("RegPhoneSectionDiv").style.display="none";
	    document.getElementById("RegCellphoneSection").style.display="none";
	    document.getElementById("BackRegLink").style.display="none";
	    
        if(gvEmailRegType=="none")
        {
            document.getElementById("BackRegLink").innerHTML="<a href='#' onclick='BackRegHome();'>更换注册方式</a>：<input onclick='ReflactClick(0);' class='ChangeReg' type='button' value='普通帐号' />";
        }
        else
        {
	        document.getElementById("BackRegLink").innerHTML="<a href='#' onclick='BackRegHome();'>更换注册方式</a>：<input onclick='ReflactClick(0);' class='ChangeReg' type='button' value='普通帐号' />&nbsp;<input onclick='ReflactClick(1);' class='ChangeReg' type='button' value='邮箱帐号' />";
	    }
	    if(document.getElementById("TitleSpan")!=null)
	    {
	        document.getElementById("TitleSpan").innerHTML="欢迎您注册手机帐号注册";
	    }
        document.getElementById("PanelMobileRegInfo").style.display="";    
        setTimeout(RegMaxShownPageRec,1000);
        return;
    }
    if(document.getElementById("PanelMobileRegInfo")!=null)
    {
        document.getElementById("PanelMobileRegInfo").style.display="none"; 
    }
    
	hidetip('password');
  	hidetip('repassword');
    document.getElementById("UserEmailShow").style.visibility="hidden";
    document.getElementById("PTUserEmailShow").style.visibility="hidden";

    if(document.getElementById("PTRegTable_0")!=null)
    {    
        document.getElementById("PTRegTable_0").className="";
        document.getElementById("PTRegTable_1").className="";
        document.getElementById("PTRegTable_2").className="";
        document.getElementById("PTRegTable_"+pvPTType).className="cur";
    }
    if(document.getElementById("TableBorderDynaChange")!=null)
    {
        document.getElementById("TableBorderDynaChange").className="TableDynamicBottomBorder";
    }
    
    ShowTabPageControl(pvPTType);
  	if(pvPTType=="0")
  	{  	    
  	    document.getElementById("PanelMain").style.display="";
  	    if(document.getElementById("NewCon")!=null)
  	    {
  	        document.getElementById("NewCon").style.display="block";
  	    }
  		document.getElementById("PTSection").style.display="";
  		document.getElementById("RegEmailSection").style.display="none";
  		document.getElementById("RegEmailSectionDiv").style.display="none";
  		document.getElementById("RegPhoneSectionDiv").style.display="none";
  		document.getElementById("RegCellphoneSection").style.display="none";
  		document.getElementById("ptRegMail").style.display="";
  		document.getElementById("ptRegCellphone").style.display="";
  		hidetip('mailaccount');
  		if(gvRegPage=="IGW")
  		{
  		    //showtip('MailInfo','请填写您真实的邮箱'); 
  		}
  		else  		
  		{
  		    //showtip('MailInfo','注册后30分钟内认证邮箱或手机将直接赠送您价值10元的盛大安全卡，以保护帐号'); 
  		    hidetip('mobile');
  		}
  		ShowPTTypeFlow("0");
  		HideRecommandPTSection();
  		ShowPTInfoSectionEx();
  		
  		if(gvEmailRegType=="none")
  		{
  		    document.getElementById("BackRegLink").innerHTML="<a href='#' onclick='BackRegHome();'>更换注册方式</a>：<input onclick='ReflactClick(2);' class='ChangeReg' type='button' value='手机帐号'/>";
  		}
  		else
  		{
  		    document.getElementById("BackRegLink").innerHTML="<a href='#' onclick='BackRegHome();'>更换注册方式</a>：<input onclick='ReflactClick(1);' class='ChangeReg' type='button' value='邮箱帐号' />&nbsp;<input onclick='ReflactClick(2);' class='ChangeReg' type='button' value='手机帐号' />";
  		}
  		document.getElementById("BackRegLink").style.display="";  
  		if(document.getElementById("TitleSpan")!=null)
  		{
  		    document.getElementById("TitleSpan").innerHTML="欢迎您注册普通帐号注册";
  		}
  		document.getElementById("lblBtnSumbmit").innerHTML="创建盛大通行证";
        if(document.getElementById("username").value=="")
        {
            document.getElementById("username").focus();
        }
  	}
  	else if(pvPTType=="1")
  	{
  		hidetip('MailInfo');
  		hidetip('mobile');
  		document.getElementById("PanelMain").style.display="";
  	    if(document.getElementById("NewCon")!=null)
  	    {
  	        document.getElementById("NewCon").style.display="block";
  	    }
  		document.getElementById("RegEmailSection").style.display="";
  		var lvHideRegEmailSectionDiv=document.getElementById("cus_section_1");
        if(lvHideRegEmailSectionDiv!=null && lvHideRegEmailSectionDiv.value=="0")
        {
            document.getElementById("RegEmailSectionDiv").style.display="none";    
        }
        else
        {
            document.getElementById("RegEmailSectionDiv").style.display="";
        }
  		
  		document.getElementById("RegPhoneSectionDiv").style.display="none";
  		document.getElementById("PTSection").style.display="none";
  		document.getElementById("RegCellphoneSection").style.display="none";
  		document.getElementById("ptRegMail").style.display="none";
  		document.getElementById("ptRegCellphone").style.display="";
  		showtip('mailaccount','请填您<span style="color:black;"><strong>常用</strong></span>的邮箱地址，<span style="color:black;"><strong>认证通过</strong></span>后完成注册');
  		//showtip('mobile','请填写您真实的手机,认证后将随短信赠送您价值10元的盛大安全卡,以保护帐号');
  		
  		ShowPTTypeFlow("1");
  		HideRecommandPTSection();
  		ShowPTInfoSectionEx();
  		document.getElementById("BackRegLink").innerHTML="<a href='#' onclick='BackRegHome();'>更换注册方式</a>：<input onclick='ReflactClick(0);' class='ChangeReg' type='button' value='普通帐号' />&nbsp;<input onclick='ReflactClick(2);' class='ChangeReg' type='button' value='手机帐号' />";
  		document.getElementById("BackRegLink").style.display="";
  		if(document.getElementById("TitleSpan")!=null)
  		{
  		    document.getElementById("TitleSpan").innerHTML="欢迎您注册邮箱帐号注册";
        }
        document.getElementById("lblBtnSumbmit").innerHTML="下一步";
        if(document.getElementById("UserEmailId").value=="")
        {
            if(document.getElementById("PTEmailRegSection").style.display=="none")
            {
                setTimeout("document.getElementById('UserEmail139Id').focus();",400);   
            }
            else
            {
                document.getElementById("UserEmailId").focus();
            }
        }
        
  	}	
  	else if(pvPTType=="2")
  	{
  	    document.getElementById("PanelMain").style.display="";
  	    if(document.getElementById("NewCon")!=null)
  	    {
  	        document.getElementById("NewCon").style.display="block";
  	    }
  		document.getElementById("RegCellphoneSection").style.display="";
  		document.getElementById("PTSection").style.display="none";
  		document.getElementById("RegEmailSection").style.display="none";
  		document.getElementById("RegEmailSectionDiv").style.display="none";
  		document.getElementById("RegPhoneSectionDiv").style.display="";
  		document.getElementById("ptRegMail").style.display="";
  		document.getElementById("ptRegCellphone").style.display="none";
  		hidetip('mobile');
  		hidetip('mailaccount');
  		showtip('mobileaccount','请填您<span style="color:black;"><strong>常用</strong></span>的手机号码，<span style="color:black;"><strong>认证通过</strong></span>后完成注册');
  		//showtip('MailInfo','请填写您真实的邮箱,认证后将随邮件赠送您价值10元的盛大安全卡,以保护帐号');
  		ShowPTTypeFlow("2");
  		HideRecommandPTSection();
  		ShowPTInfoSectionEx();
        if(gvEmailRegType=="none")
        {
            document.getElementById("BackRegLink").innerHTML="<a href='#' onclick='BackRegHome();'>更换注册方式</a>：<input onclick='ReflactClick(0);' class='ChangeReg' type='button' value='普通帐号' />";
        }
        else
        {
  		    document.getElementById("BackRegLink").innerHTML="<a href='#' onclick='BackRegHome();'>更换注册方式</a>：<input onclick='ReflactClick(0);' class='ChangeReg' type='button' value='普通帐号' />&nbsp;<input onclick='ReflactClick(1);' class='ChangeReg' type='button' value='邮箱帐号' />";
  		}
  		document.getElementById("BackRegLink").style.display="";
  		if(document.getElementById("PTUserEmailId").value!="")
  		{
  		    document.getElementById("PTUserEmailId").onfocus();
  		    document.getElementById("PTUserEmailId").onblur();
        }
  		if(document.getElementById("TitleSpan")!=null)
  		{
  		    document.getElementById("TitleSpan").innerHTML="欢迎您注册手机帐号注册";
        }
        document.getElementById("lblBtnSumbmit").innerHTML="下一步";
        if(document.getElementById("UserCellphoneId").value=="")
        {
            document.getElementById("UserCellphoneId").focus();
        }
  	}
  	setTimeout(Check4BtnStatus,100);
  }
  function SelectPT(sSelectedPTAccount,fcheckSdid)
  {
    document.getElementById("chksdid").value=fcheckSdid;
  	document.getElementById("username").value=sSelectedPTAccount;
    lvShowRecommand=false;
    lvShowPwdLevel=false;
    lvLastLevel=-1;    
  	PTChangeHandle();
  	
  	if(fcheckSdid=="true")
  	{
  	    document.getElementById("username").readOnly=true;
  	}
  } 
  function ShowPTHelp(){
    if(lvShowRecommand==false)
    {
        showtipEx("username","帐号由4-16位字母、数字、下划线组成，首位为字母",false);
    }
  } 
  function ShowServerHelp(){
    if(lvShowRecommand==false)
    {
        showtipEx("server","服务器格式为域名或ip地址，如um800.com或192.168.0.105",false);
    }
  }
  function HidePTEmail(pvMailDiv)
  {
    setTimeout("MailChangeHandle('"+pvMailDiv+"');",300);
  }
  function MailChangeHandle(pvMailDiv)
  {
    document.getElementById(pvMailDiv).style.display='none';
    var lvUserMailObject=document.getElementById("UserEmailId");
    var lvUserEmalTipArrow=document.getElementById("UserEmalTipArrow");
    var sPtid = lvUserMailObject.value;
    if(sPtid=="注册后该邮箱地址可用于今后的密码找回")
    {
        sPtid="";
    }
    if(sPtid=="")
    {
        showtip("mailaccount","<b><font color=#CC0000>输入您真实的邮箱地址</font></b>")
        FieldLostFocus_ChangeBkground(lvUserMailObject,false,true,lvUserEmalTipArrow);
        return;
    }
    var lvCheckRegMailResut=CheckRegEmail(sPtid);
    if(lvCheckRegMailResut!=0)
    {
        var lvMsg="对不起，请正确输入您的邮箱地址";
        if(lvCheckRegMailResut==1)
        {
            lvMsg="对不起，请正确输入您的邮箱地址";
        }
        else if(lvCheckRegMailResut==2)
        {
            lvMsg="邮箱通行证帐号应在50个字符以内";
        }
        else if(lvCheckRegMailResut==3)
        {
            lvMsg="邮箱后缀应为COM、NET、ORG、CN";
        }
        else if(lvCheckRegMailResut==4)
        {
            //lvMsg="邮箱"+sPtid.substring(sPtid.indexOf("@"))+"不被支持";
            lvMsg="该邮件帐号已被注册或不存在";
        }
        showtip("mailaccount","<b><font color=#CC0000>"+lvMsg+"</font></b>");
        FieldLostFocus_ChangeBkground(lvUserMailObject,false,true,lvUserEmalTipArrow);
    }
    else
    {
        if(isExistEmail('yes'))
        {
            showtip("mailaccount","<b><font color=#CC0000>该邮件帐号已被注册或不存在</font></b>");
            FieldLostFocus_ChangeBkground(lvUserMailObject,false,true,lvUserEmalTipArrow);
        }
        else
        {
            showtip("mailaccount","");
            hidetip("mailaccount");
            FieldLostFocus_ChangeBkground(lvUserMailObject,true,true,lvUserEmalTipArrow);
        }
    }
  }
  function REmailChangeHandle()
  {
    var sPtid=document.getElementById("UserEmailId2").value;
    if(sPtid=="")
    {
        showtip("mail2account","<b><font color=#CC0000>请再次输入邮箱地址</font></b>")
        return;
    }
    var sPtid2=document.getElementById("UserEmailId").value;
    if(sPtid2=="注册后该邮箱地址可用于今后的密码找回")
    {
        sPtid2="";
    }
    if(sPtid2!=sPtid)
    {
        showtip("mail2account","<b><font color=#CC0000>两次邮箱地址输入内容不匹配</font></b>");        
    }
    else        
    {
        hidetip("mail2account");
    }  
  }
  function RMobileChangeHandle()
  {
    var sPtid=document.getElementById("UserCellphoneId2").value;
    if(sPtid=="")
    {
        showtip("mobile2account","<b><font color=#CC0000>请再次输入手机号码</font></b>")
        return;
    }
    var sPtid2=document.getElementById("UserCellphoneId").value;    
    if(sPtid2=="注册后该手机号码可用于今后的密码找回")
    {
        sPtid2="";
    }
    if(sPtid2!=sPtid)
    {
        showtip("mobile2account","<b><font color=#CC0000>两次手机帐号输入内容不匹配</font></b>");        
    }
    else        
    {
        hidetip("mobile2account");
    }
  }
  function MobileChangeHandle()
  {
    var lvUserPhoneObject=document.getElementById("UserCellphoneId");
    var sPtid=lvUserPhoneObject.value;
    if(sPtid=="注册后该手机号码可用于今后的密码找回")
    {
        sPtid="";
    }
    var lvUserPhoneTipArrowObj=document.getElementById("UserPhoneTipArrow");    
    if(sPtid=="")
    {
        showtip("mobileaccount","<b><font color=#CC0000>请输入您真实的手机号码</font></b>");
        FieldLostFocus_ChangeBkground(lvUserPhoneObject,false,true,lvUserPhoneTipArrowObj);
        return;
    }
    var reg1=/^1[3][0-9]\d{8}$/;
    var reg2=/^1[5][089]\d{8}$/;
    
    if(reg1.test(sPtid) || reg2.test(sPtid) )
    {
        if(isExistMobile())
        {
            showtip("mobileaccount","<b><font color=#CC0000>手机号码已被注册</font></b>");
            FieldLostFocus_ChangeBkground(lvUserPhoneObject,false,true,lvUserPhoneTipArrowObj);
        }
        else
        {
           hidetip("mobileaccount");
           showtip("mobileaccount","");
           FieldLostFocus_ChangeBkground(lvUserPhoneObject,true,true,lvUserPhoneTipArrowObj);
        }
    }
    else
    {
        if(sPtid.length==11)
        {
            showtip("mobileaccount","<b><font color=#CC0000>抱歉，目前只支持130-139,150,158,159</font></b>");
        }
        else
        {
            showtip("mobileaccount","<b><font color=#CC0000>请您填写真实的手机号码</font></b>");
        }
        FieldLostFocus_ChangeBkground(lvUserPhoneObject,false,true,lvUserPhoneTipArrowObj);
    }
  }
  var lvShowRecommand=false;
  var lvShowPwdLevel=false;
  var lvLastPtAccount="";
  var lvLastLevel=-1;
  function PTChangeHandle()
  {
        var lvUserObject=document.getElementById("username");
        var sPtid = trim(lvUserObject.value);
        var lvMsg="";
		var reg = /^[a-z0-9_]{4,16}$/i;
        if(lvShowRecommand)
        {
            return true;
        }
		var lvCheckResult = true;
		if(sPtid == ""){
			lvMsg="<b><font color=#CC0000>请输入帐号</font></b>";
			lvCheckResult = false;
		}else{
		    var lvFirstChar=sPtid.substring(0,1);
		    if(lvFirstChar=="0" || lvFirstChar=="1" || lvFirstChar=="2" || lvFirstChar=="3" || lvFirstChar=="4" || lvFirstChar=="5" || lvFirstChar=="6" || lvFirstChar=="7" || lvFirstChar=="8" || lvFirstChar=="9")
		    {
		        lvMsg="<b><font color=#CC0000>首字符必须用字母</font></b>";
		        lvCheckResult = false;
		    }else  if( sPtid.length<4){
		       lvMsg="<b><font color=#CC0000>帐号长度为4-16位字符</font></b>";
		       lvCheckResult = false;
		    }else if (!reg.test(sPtid)){
		        lvMsg="<b><font color=#CC0000>帐号由4-16位字母、数字、下划线组成</font></b>";
		        lvCheckResult = false;
			}
		}
		if(lvCheckResult == false)
		{			    
		    showtipEx("username",lvMsg,false);
			FieldLostFocus_ChangeBkground(lvUserObject,false,false);
		}else{
			hidetip("username");
			FieldLostFocus_ChangeBkground(lvUserObject,true,false);
		}
		return lvCheckResult;
  }
  function RPWDChangeHandle()
  {
        var lvRepwdObject=document.getElementById("repassword");
        var lvRUserPwdTipArrow=document.getElementById("RUserPwdTipArrow");
  	    if(CheckRePassword()==false){     	
  	        if(lvRepwdObject.value=="")
  	        {
  	            if(lvShowRecommand==false)
  	            {
  	                showtip("repassword","<b><font color=#CC0000>请再次输入密码</font></b>");
  	            }
  	        }
  	        else
  	        {
  	            if(lvShowRecommand==false)
  	            {
  	                if(lvRepwdObject.value.length>10)
  	                {
  	                    showtip("repassword","<b><font color=#CC0000>您输入的密码超过最大长度10位，请重新输入<font></b>");
  	                }
  	                else
  	                {
  	                    showtip("repassword","<b><font color=#CC0000>两次密码输入内容不一致<font></b>");
  	                }
  	            }
  	        }
  	        FieldLostFocus_ChangeBkground(lvRepwdObject,false,false,lvRUserPwdTipArrow);
  	        return false;
  	    }else{
  		    if(CheckPassword() && lvShowPwdLevel==false)
  		    {
  		        hidetip("password");
  		    }
  	      	if(lvRepwdObject.value=="")
  	        {
                if(lvShowRecommand==false)
  	            {
  	                showtip("repassword","<b><font color=#CC0000>请再次输入密码</font></b>");
  	                FieldLostFocus_ChangeBkground(lvRepwdObject,false,false,lvRUserPwdTipArrow);
  	                return false;
  	            }
  	        }else{
  	            hidetip("repassword");
  	            FieldLostFocus_ChangeBkground(lvRepwdObject,true,false,lvRUserPwdTipArrow);
  	            return true;
  	        }
  	    }
  }
  function PwdStrengthUpdate()
  {
     var lvPwd=document.getElementById("password").value;
     var lvPwdLevel=lvPwdStrenth.getLevel(lvPwd);
     switch(lvPwdLevel) { 
	     case 1:
	         if(lvShowRecommand==false && (lvLastLevel!=1 ||  document.getElementById("passwordtip").style.display=="none"  ))
	         {
	            lvShowPwdLevel=true;
	            lvLastLevel=1;
	            showtip("password","");
	            if(document.getElementById("PwdStrongDiv")!=null)
	            {
	                document.getElementById("PwdStrongDiv").innerHTML="<b>安全级别：<img src='umservice/images/RuoPas.jpg' align='absmiddle' /></b>";
                }
                else
                {
                    showtip("password","<b>密码为<font color=\"Blue;\">弱</font>，建议用8位以上的英文数字组合</b>");
                }
	         }
		     break;
	     case 2:
	         if(lvShowRecommand==false && (lvLastLevel!=2 ||  document.getElementById("passwordtip").style.display=="none"))
	         {
	            lvShowPwdLevel=true;
	            lvLastLevel=2;
	            showtip("password","");
	            if(document.getElementById("PwdStrongDiv")!=null)
	            {
	                document.getElementById("PwdStrongDiv").innerHTML="<b>安全级别：<img src='umservice/images/MidPas.jpg' align='absmiddle' /></b>";
                }
                else
                {
                    showtip("password","<b>密码为<font color=\"#999999;\">中</font>，建议用8位以上的英文数字组合</b>");
                }
		     }
		     break;
        case 3:
             if(lvShowRecommand==false && (lvLastLevel!=3 || document.getElementById("passwordtip").style.display=="none"))
             {
	            lvLastLevel=3;
	            showtip("password","");
                if(document.getElementById("PwdStrongDiv")!=null)
                {
	                document.getElementById("PwdStrongDiv").innerHTML="<b>安全级别：<img src='umservice/images/QiaPas.jpg' align='absmiddle' /></b>";
                }
                else
                {
                    showtip("password","<b>密码强度为<font color=\"Green;\">强</font></b>");
                }
		     }
		     break;
		case 0:
	         if(lvShowRecommand==false && (lvLastLevel!=0 ||  document.getElementById("passwordtip").style.display=="none"))
	         {
	            lvShowPwdLevel=true;
	            lvLastLevel=0;
	            if(lvPwdStrenth.getErrorId()==2)
	            {
	                showtip("password","<b><font color=#CC0000>你不能使用该密码，非常容易被猜测！</font></b>");
	            }
	            else
	            {
		            showtip("password","<b><font color=#CC0000>"+lvPwdStrenth.getDescription()+"</font></b>");
		        }
		     }
		    break;
     }
     return lvPwdLevel;
  }
  function PWDChangeHandle()
  {
        var lvPwdLevel=PwdStrengthUpdate();
        var lvPwdObject=document.getElementById("password");
  	    if(CheckPassword()==false){
  	        lvShowPwdLevel=false;
  	        if(lvPwdObject.value=="")
  	        {
                if(lvShowRecommand==false)
  	            {
  	                showtip("password","<b><font color=#CC0000>请输入密码</font></b>");
  	            }
  	        }
  	        else
  	        {
  	            if(lvPwdObject.value.length<6)
  	            {
                    if(lvShowRecommand==false)
  	                {
  	                    showtip("password","<b><font color=#CC0000>密码长度为6-10个字符</font></b>");
  	                }
  	            }
  	            else
  	            {
		  	        if(lvShowPwdLevel==false)
		  	        {
		  	            hidetip("password");
		  	        }
		  		    if(CheckRePassword())
		  		    {
		  		        hidetip("repassword");
		  		    }
		  		    FieldLostFocus_ChangeBkground(lvPwdObject,true,false,document.getElementById("UserPwdTipArrow"));
		  		    return true;
  	            }
  	        }
  	        FieldLostFocus_ChangeBkground(lvPwdObject,false,false,document.getElementById("UserPwdTipArrow"));
  	        return false;
  	    }else{
  	        if(lvShowPwdLevel==false)
  	        {
  	            hidetip("password");
  	        }
  		    if(CheckRePassword())
  		    {
  		        hidetip("repassword");
  		    }
  		    FieldLostFocus_ChangeBkground(lvPwdObject,true,false,document.getElementById("UserPwdTipArrow"));
  		    return true;
  	    }
 	}
  	function ServerChangeHandle(){
        var lvServerObject=document.getElementById("server");
  	    if(lvServerObject.value==""){
            if(lvShowRecommand==false){
                showtip("server","<b><font color=#CC0000>请输入服务器地址</font></b>");
            }
  	        FieldLostFocus_ChangeBkground(lvServerObject,false,false);
  	        return false;
  	    }else{
  		    hidetip("server");
  		    FieldLostFocus_ChangeBkground(lvServerObject,true,false);
  		    return true;
  	    }
 	}  
 	function ShowRePwdHelp()
 	{
        if(lvShowRecommand==false)
  	    {
 	        showtip("repassword","请再次输入密码");
 	    }
 	}

  function ShowPwdHelp()
  {
    if(lvShowRecommand==false && lvShowPwdLevel==false)
    {
        if(document.getElementById("password").value!="" && CheckPassword())
        {
            lvLastLevel=-1;
            //ps.update(document.getElementById("password").value);
            PwdStrengthUpdate();
        }
        else
        {
            lvLastLevel=-1;
            showtip("password","密码由6-10位字符组成");
        }
    }
  }
  function ExCodeChange()
  {
  	if(CheckExcode()==false)
  	{
			if(document.getElementById("attcode2").value=="")
			{
			    showtip("attcode2","<b><font color=#CC0000>请输入验证图片上的六位数字</font></b>");
			}					  	
			else
			{ 
			    showtip("attcode2","<b><font color=#CC0000>请输入验证图片上的六位数字</font></b>");
			}
			if(gvRegPage!="IGW")
			{
			    FieldLostFocus_ChangeBkground(document.getElementById("attcode2"),false,true,document.getElementById("AttCodeTipArrow"));
            }
  	}
  	else
  	{
  	    showtip("attcode2","");
  	    hidetip("attcode2");
  	    if(gvRegPage!="IGW")
  	    {
  	        FieldLostFocus_ChangeBkground(document.getElementById("attcode2"),true,true,document.getElementById("AttCodeTipArrow"));
        }
  	}
  }
  function ShowCodeHelp()
  {
    showtip("attcode2","请输入验证图片上的六位数字");
  }
  function showValidateCode()
  {
    document.getElementById("numimg").src = "ValidateCode.ashx?rand=" + Math.random();
    setTimeout(UI_Record_ShowVerifyCodeImg,400);
  }  