﻿function handleClick(id)
{
    var txtUserName = document.getElementById(txtUserNameCI);
    var txtPassword = document.getElementById(txtPasswordCI);
    
    if (event.keyCode == 13)
    {            
        if(id == txtUserNameCI)
        {
            if(txtPassword.value == 'Password')   
            {             
                txtPassword.select();  
                txtPassword.value = '';                         
            }
            else
                document.getElementById(lnkbtnLoginCI).click();                
        }
        else if(id == txtPasswordCI)
        {
            if(txtUserName.value == 'User Name')
            {                                
                txtUserName.select(); 
                txtUserName.value = '';                         
            }
            else
                document.getElementById(lnkbtnLoginCI).click();                
        }
    }
}
function validateLogIn()
{
    var txtUserName = document.getElementById(txtUserNameCI);
    var txtPassword = document.getElementById(txtPasswordCI);        
    var userName = trimStr(txtUserName.value);
    var password = trimStr(txtPassword.value);        
    if(userName == '' || userName == 'User Name') { alert('Please, specify User Name.'); txtUserName.select(); return false; }
    if(password == '' || password == 'Password') { alert('Please, specify Password.'); txtPassword.select(); return false; }        
    return true;
}
