function EnterForCode (evt)
{
    if (evt.keyCode == 13)
    {
        evt.keyCode = 0;
        OrtFocusControl (m_strCTLTextBoxUserPass, true);
    }
}

function EnterForPass (evt)
{
    if (evt.keyCode == 13)
    {
        evt.keyCode = 0;

        if (m_Validate)
            OrtFocusControl (m_strCTLTextBoxValidate, true);
        else
            Logon ();
    }
}

function EnterForValidate (evt)
{
    if (evt.keyCode == 13)
    {
        evt.keyCode = 0;

        Logon ();
        return;
    }
}

function CheckMindCode ()
{
    var eCheckMindCode = document.getElementById (m_strCTLCheckBoxMindCode);
    var eCheckMindPass = document.getElementById (m_strCTLCheckBoxMindPass);

    if (!eCheckMindCode.checked)
        eCheckMindPass.checked = false;
}

function CheckMindPass ()
{
    var eCheckMindCode = document.getElementById (m_strCTLCheckBoxMindCode);
    var eCheckMindPass = document.getElementById (m_strCTLCheckBoxMindPass);

    if (eCheckMindPass.checked)
        eCheckMindCode.checked = true;
}

function Logon ()
{
    var eCode = document.getElementById (m_strCTLTextBoxUserCode);
    eCode.value = OrtTrimString (eCode.value);
    if (eCode.value.length == 0)
    {
        alert (m_strResUser_emptycode);
        eCode.focus ();
        return;
    }

    if (m_Validate)
    {
        var eValidate = document.getElementById (m_strCTLTextBoxValidate);
        eValidate.value = OrtTrimString (eValidate.value);
        if (eValidate.value.length == 0)
        {
            alert (m_strResUser_emptyvalidate);
            eValidate.focus ();
            return;
        }
    }

    var strStatue = m_strOnDongle;

    if (strStatue == "1")
    {
        var objAllrunNox = document.getElementById ("AllrunNox");
        objAllrunNox.InitData ();
        document.getElementById (m_strCTLHiddenId).value=objAllrunNox.UniqueGuid;
        document.getElementById (m_strCTLHiddenOpen).value=objAllrunNox.IsOpen;
        document.getElementById (m_strCTLHiddenFind).value=objAllrunNox.IsFind;
    }

    document.formLogon.submit ();
}

function GetPassword ()
{
    OrtOpenCenterWindow ("getpassword.aspx", "",
        "toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=no,width=380,height=200");
}

function FunInit ()
{
    var strStatue = m_strOnDongle;

    if (strStatue == "1")
    {
        var strGuid=document.getElementById (m_strCTLHiddenGuid).value;
        if (strGuid != "")
        {
            var objAllrunNox = document.getElementById ("AllrunNox");
            objAllrunNox.InitData ();
            if (objAllrunNox.IsFind != true || objAllrunNox.IsOpen != true)
            {
                alert (m_strResUser_dog);
                return;
            }
        }
    }
}

function FunOpenDown ()
{
    OrtOpenCenterWindow ("basic/filedown.aspx", "",
        "toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=no,width=640,height=480");
}
