var _LN_ID;
var _LP_ID;

$(document).ready(initLogin);

function initLogin()
{
    _LN_ID = '#ctl00_C_N';
    _LP_ID = '#ctl00_C_P';
    if($(_LN_ID)[0].value!='')
        clearLogin(_LN_ID);
    else
        clearTimer();	
    $('#_js_chk')[0].value='_js_chk';
}

function clearLogin(id) 
{
    var el=$(id);
    if(el.attr('cleared')!='t')
    {
        el.attr( {'class':'LoginActive'} ); 
        el.attr('cleared', 't');
    }
}
function setLogin(id)
{
    var el=$(id);
    if(el[0].value=='')
    {
        el.attr( {'class':'LoginInactive'} ); 
        el.attr('cleared', 'f');
    }
}

function clearPassword(id) 
{
    var el=$(id);
    if(el.attr('cleared')!='t')
    {
        el.attr( {'class':'PasswordActive'} );
        el.attr('cleared', 't');
    }
}

function setPassword(id) 
{
    var el=$(id);
    if(el[0].value=='')
    {
        el.attr( {'class':'PasswordInactive'} );
        el.attr( 'cleared', 'f' );
    }
}

function clearTimer() 
{
    var el=$(_LN_ID);
    if (el.attr('cleared') != 't' && el[0].value!='') 
    {
        clearLogin(_LN_ID);
    }
    
    var el2=$(_LP_ID);
    if (el2.attr('cleared') != 't' && el2[0].value!='') 
    {
        clearPassword(_LP_ID);
    }
    if (el.cleared != 't') 
    {
        setTimeout('clearTimer()' , 200);        
    }
}