
    function btnLogin_onclick() 
    {
        if(document.getElementById('txtLoginName').value=="" || document.getElementById('txtPWD').value=="")
        {
            document.getElementById("divError")['style']['display'] = '';
            document.getElementById("divError").innerHTML = '<font color="#F56D09">Please input Username and Password!</font>';
            return;
        }
        PageMethods.UserLogin(document.getElementById('txtLoginName').value,document.getElementById('txtPWD').value,cb_Login);
    }

    function cb_Login(result)
    {        
        if(result=="1")
        {
             self.parent.frames['secFrame'].location.href="/user/LightBoxQuick.aspx";             
            if(document.getElementById('PageBar2_button'))
            {
             closebox();            
    
             document.getElementById('PageBar2_button').click();
             //Ä£ÄâµÇÂ½ÊµÏÖ
             document.getElementById("LeftMenu1_Nlogin").innerHTML='<ul> <li class="l_hasLog"><a href="/MyAccount/Profile.aspx" target="_top">Profile</a></li>      <li class="r_hasLog"><a href="/LogOff.aspx" target="_top">Sign off</a></li>    </ul>';
           }
           else
           {          
            
             document.location.reload();
           }
        }
        else
        {
            document.getElementById("divError")['style']['display'] = '';
            document.getElementById("divError").innerHTML = '<font color="#F56D09">Login failed!</font>';
        }
    }
  
    
    function KeyEvent(event)
    {
        if(event.keyCode == 13)
        {
            document.getElementById("dialogOk").click();
            return false;
        }
    }
