rusauto = {
    login: function(show,div)
    {
        div = div || 'login_div';
        show = show || ($(div).style.display=='block')?false:true;
        $(div).style.display=(show)?'block':'none';
    },
    logout: function(){
        var req = new Request({
            url: SITE_URL+'account.htmlXML/a/lo/',
            onSuccess: function(txt){
                eval(txt);
            },
            onFailure: function(){
                //ask?
            }
        }).send();
    },
    closewindow: function(div_id)
    {
        $(div_id).style.display = 'none';
        //to close some windows
    },
    showWAccount: function(show)
    {
        this.login(undefined,'pers_div')
    },
    loginSubmit: function()
    {
        //when loginForm submit, if ok - go to the account.html
        $('login_submit').disabled = true;
        var req = new Request({
            url: SITE_URL+'account.htmlXML/a/l/',
            method: 'post',
            data: $('login_form').toQueryString(),
            onSuccess: function(txt){
                eval(txt);
                $('login_submit').disabled = false;
            },
            onFailure: function(){
                $('login_submit').disabled = false;
            }
        }).send();
        return false;
    }
}
