﻿function InitExprSignUp() {
    var txtPwd = document.getElementById("txtLogPwd");
    var td = txtPwd.parentNode;
    td.innerHTML = "<input id='txtLogPassword' onfocus='PwdOnFocus(this.id)' type='text' class='input_01' style='width:200px; height:20px;' maxlength='20' value='Password' />";
}


function btnsubmit() {
    if (event.keyCode == 13) {
        document.getElementById('ImageButton1').click();
    }
}

function PwdOnFocus(txtPwdID) {
    var txtPwd = document.getElementById(txtPwdID);
    var td = txtPwd.parentNode;
    td.innerHTML = "<input id='txtLogPassword' name='txtLogPassword' onblur='PwdOnBlur(this.id)' type='password' class='input_01' style='width:200px; height:20px;' maxlength='20' />";
    document.getElementById("txtLogPassword").focus();
    document.getElementById("txtLogPassword").focus(); //2个focus(),保证该文本框获得焦点
}

function PwdOnBlur(txtPwdID) {
    var txtPwd = document.getElementById(txtPwdID);
    if (txtPwd.value == "") {
        var td = txtPwd.parentNode;
        td.innerHTML = "<input id='txtLogPassword' onfocus='PwdOnFocus(this.id)' type='text' class='input_01'  style='width:200px; height:20px;' maxlength='20' value='Password' />";
    }
}
function InitSignUp() {
    var txtPwd = document.getElementById("cspassword");
    var td = txtPwd.parentNode;
    td.innerHTML = "<input id='cspwd' onfocus='PasswordOnFocus(this.id)' type='text' class='input' maxlength='20' style='width:200px; height:20px;' value='Password' />";
}

function PasswordOnFocus(txtPwdID) {
    var txtPwd = document.getElementById(txtPwdID);
    var td = txtPwd.parentNode;
    td.innerHTML = "<input id='cspwd' name='cspwd' onblur='PasswordOnBlur(this.id)' type='password' class='input' maxlength='20' style='width:200px; height:20px;' />";
    document.getElementById("cspwd").focus();
    document.getElementById("cspwd").focus(); //2个focus(),保证该文本框获得焦点
}

function PasswordOnBlur(txtPwdID) {
    var txtPwd = document.getElementById(txtPwdID);
    if (txtPwd.value == "") {
        var td = txtPwd.parentNode;
        td.innerHTML = "<input id='cspwd' onfocus='PasswordOnFocus(this.id)' type='text' class='input' maxlength='20' style='width:200px; height:20px;' value='Password' />";
    }
}

function InitSignUp1() {
    var txtPwd = document.getElementById("cspassword1");
    var td = txtPwd.parentNode;
    td.innerHTML = "<input id='cspwd1' onfocus='PasswordOnFocus1(this.id)' type='text' class='input' maxlength='20' style='width:200px; height:20px;' value='Password' />";
}

function PasswordOnFocus1(txtPwdID) {
    var txtPwd = document.getElementById(txtPwdID);
    var td = txtPwd.parentNode;
    td.innerHTML = "<input id='cspwd1' runat='server' name='cspwd1' onblur='PasswordOnBlur1(this.id)' type='password' class='input' maxlength='20' style='width:200px; height:20px;' onkeydown='javascript:btnsubmit()' />";
    document.getElementById("cspwd1").focus();
    document.getElementById("cspwd1").focus(); //2个focus(),保证该文本框获得焦点
}

function PasswordOnBlur1(txtPwdID) {
    var txtPwd = document.getElementById(txtPwdID);
    if (txtPwd.value == "") {
        var td = txtPwd.parentNode;
        td.innerHTML = "<input id='cspwd1' onfocus='PasswordOnFocus1(this.id)' type='text' class='input' maxlength='20' style='width:200px; height:20px;' value='Password' />";
    }
}
