// JScript 文件

function SetUserName4Pwd()
{
    var lvUserName=document.getElementById("username").value;
    lvPwdStrenth.setUserName(lvUserName);
}

function HideVerifySection()
{
    document.getElementById("VerifyPicSection").style.display="none";
    document.getElementById("attcode2").value="123456";
}
function  showEmailInfo4PT()
{
}

function WindowResizeHandle()
{
    SndaDragable_Instance.Resize();
	setTimeout("ShowTopIcon()",50);
}

function ShowTopIcon()
{
    var obj=document.getElementById("topImg");
    if (document.all)
    {
        var ua = navigator.userAgent.toLowerCase();
        if("6.0"==ua.match(/msie ([\d.]+)/)[1])
        {
            obj.style.top=document.documentElement.scrollTop+"px";
            obj.style.left=document.documentElement.scrollLeft+"px";
        }
    }
}
function confirmExit() 
{
    if(lvShowDiaocha)
    {
        return "您尚未完成注册，按取消继续停留本页面填写完成注册。";
    }
    else
    {
        return "";
    }
}        
function openDiaocha()
{
    if(lvShowDiaocha)
    {
        window.open(" http://diaocha.sdo.com/vote/9/809.aspx");
    }
}
function PTSelectClick(pvType)
{
    document.getElementById("ptType_"+pvType).click();
}

function DisablePTSelectClick(pvEvent)
{        
    window.open("http://ecard.sdo.com/ecard/help/ecar_product.asp","_blank");
    if (pvEvent==null || pvEvent=="")
    {
        pvEvent=window.event;
    }  
    if(pvEvent.cancelable)  //FireFox
    {
        pvEvent.preventDefault();
        pvEvent.returnValue =false;
        pvEvent.cancel = true;
    }
    else                   // IE
    {
        pvEvent.cancelBubble =true;
        pvEvent.returnValue =false;
        pvEvent.cancel = true;
    }     
}        
function ReflactClick(pvType)
{
    document.getElementById("ptType_"+pvType).click();
}
function BackRegHome()
{
    document.getElementById("PanelMobileRegInfo").style.display="none";
    document.getElementById("BackRegLink").style.display="none";
    document.getElementById("spanPTType").style.display="none";
    document.getElementById("PTAccountShowRecommandSection").style.display="";  
    document.getElementById("PanelMain").style.display="none";
    document.getElementById("TitleSpan").innerHTML="欢迎注册盛大通行证，请选择您喜欢的通行证帐号类型";
    if(document.getElementById("NewCon")!=null)
    {
        document.getElementById("NewCon").style.display="none";
    }
    if(document.getElementById("TableBorderDynaChange")!=null)
    {
        document.getElementById("TableBorderDynaChange").className="TableDynamicNoBottomBorder";
    }
}
function FieldFocus_ChangeBkground(pvObj,pvChangeIcon,pvIconObj)
{
    if (pvObj.tagName.toLowerCase()=="select")
        pvObj.className="BigForSel";
    else{
		if(pvObj.id == "familyname" || pvObj.id == "givenname"){
			document.getElementById("familyname").className = "BigFocus";
			document.getElementById("givenname").className = "BigFocus";
		}else{
        	pvObj.className="BigFocus";
        }
    }
    if(pvChangeIcon)
    {
        pvIconObj.style.marginTop="0px";
        pvIconObj.src="images/arrow2.gif";
    }
}
function FieldLostFocus_ChangeBkground(pvObj,pvOk,pvChangeIcon,pvIconObj)
{
    if (pvObj.tagName.toLowerCase()=="select"){
        pvObj.className="";
    }else{
		if(pvObj.id == "familyname" || pvObj.id == "givenname"){
			document.getElementById("familyname").className = (pvOk?"BigText":"BigWrong");
			document.getElementById("givenname").className = (pvOk?"BigText":"BigWrong");
		}else{
			pvObj.className=(pvOk?"BigText":"BigWrong");
		}
	} 
    if(pvChangeIcon)
    {
        if(pvOk)
        {
            if (pvIconObj.id &&  pvIconObj.id!="UserPTTipArrow")
                pvIconObj.style.marginTop="-3px";
                
            pvIconObj.src="images/Gright.jpg";
            if(pvIconObj.parentNode && pvIconObj.parentNode.parentNode)
            {
                pvIconObj.parentNode.parentNode.style.display="block";
            }
        }
        else
        {
            pvIconObj.style.marginTop="-3px";
            pvIconObj.src="images/Rwrong.jpg";
        }
    }
}
function CheckEmail4JJWXC()
{
    var lvEmail=document.getElementById("PTUserEmailId").value;
    if(lvEmail!=null && lvEmail!="")
    {
        var lvUrl="http://register.sdo.com/sdo/reg/jjwxc/checkemail.asp?email="+escape(lvEmail);
        var sRet = AjaxRequest(lvUrl);
        return sRet=="0";
    }
    return false;
}
function ChangeUI4JJWXC()
{
    if(gvCheckEMAIL4JJWXC)
    {
        document.getElementById("lblJJWXCRequired").style.display="";
        document.getElementById("tblJJWXCRequired").style.borderBottom="none";
        document.getElementById("tblJJWXCRequired").style.marginBottom="0px";
    }
}
function ChangRegUI4139()
{
    if(document.getElementById("RecommandSection")!=null)
    {
        document.getElementById("RecommandSection").style.display="none";
    }
    document.getElementById("PTRegTable_0").style.display="none";
    document.getElementById("PTRegTable_2").style.display="none";
    document.getElementById("PTEmailRegSection").style.display="none";
    document.getElementById("PTEmailRegSection4139").style.display="";
    
	document.getElementById("ptType_0").checked=false;
	document.getElementById("ptType_1").checked=true;
	document.getElementById("ptType_2").checked=false;
	SelectPTType('1');
}
function Mail139FieldBlur()
{
    var lvUserMailObject=document.getElementById("UserEmail139Id");
    var lvUserEmalTipArrow=document.getElementById("UserEmail139TipArrow");
    var lvUserEmail139Id=lvUserMailObject.value;
    if(lvUserEmail139Id=="")
    {
        document.getElementById("UserEmailId").value="";
        showtip("mailaccount139","<b><font color=#CC0000>输入您的139邮箱地址</font></b>")
        FieldLostFocus_ChangeBkground(lvUserMailObject,false,true,lvUserEmalTipArrow);
    }
    else
    {
        var sPtid=lvUserEmail139Id+"@139.com";
        document.getElementById("UserEmailId").value=sPtid;
        var lvCheckRegMailResut=CheckRegEmail(sPtid);
        if(lvCheckRegMailResut!=0)
        {
            var lvMsg="对不起，请正确输入您的139邮箱地址";
            if(lvCheckRegMailResut==1)
            {
                lvMsg="对不起，请正确输入您的139邮箱地址";
            }
            else if(lvCheckRegMailResut==2)
            {
                lvMsg="邮箱通行证帐号应在50个字符以内";
            }
            else if(lvCheckRegMailResut==3)
            {
                lvMsg="邮箱后缀应为COM、NET、ORG、CN";
            }
            else if(lvCheckRegMailResut==4)
            {
                lvMsg="该邮件帐号已被注册或不存在";
            }
            showtip("mailaccount139","<b><font color=#CC0000>"+lvMsg+"</font></b>");
            FieldLostFocus_ChangeBkground(lvUserMailObject,false,true,lvUserEmalTipArrow);
        }
        else
        {
            if(isExistEmail('yes'))
            {
                showtip("mailaccount139","<b><font color=#CC0000>该邮件帐号已被注册或不存在</font></b>");
                FieldLostFocus_ChangeBkground(lvUserMailObject,false,true,lvUserEmalTipArrow);
            }
            else
            {
                showtip("mailaccount139","");
                hidetip("mailaccount139");
                FieldLostFocus_ChangeBkground(lvUserMailObject,true,true,lvUserEmalTipArrow);
            }
        }                
    }
}

function NccClose(evt)
{
    evt = window.event?window.event:evt;
    document.getElementById('floatimg').style.display="none";
}
    	
function NccOpen()
{

    if(!window.oswin || window.oswin.closed)
    {
        window.oswin=window.open('http://iq.sdrs.sdo.com:8088/gotoNCC.aspx?type=reg&ar=0&t=' + escape('注册入口问题。'), '', 'toolbar=no,location=no,left='+(window.screen.width - 640) / 2+',top='+(window.screen.height - 480) / 2+',directories=no,scrollbars=no,menubar=no,width=465,height=455,resizable=no,status=no');
    }
    else
    {
        alert('您已经打开了一个对话');
    } 	    
}
