var show_hint = newObject({
    autoInit : true,

    onready : function()
    {
        var email = this.$(this.config.email);
        this.hint  = this.$(this.config.hint);
        if (email && this.hint) {
            email.addListener(this, 'onFocus', 'initTimer');
            email.addListener(this, 'onBlur', 'hideHint');
            email.addListener(this, 'onKeyPress', 'showHint');
        }
    },
    
    // main public methods
    initTimer : function()
    {
        this._setTimer(true);
    },
    showHint : function()
    {
        this.hint.show();
    },

    hideHint : function()
    {
        this.hint.hide();
        this._setTimer(false);
    },

//private methods
    _setTimer : function (isStart)
    {
        if (this.curTimer) clearTimeout(this.curTimer);
        if (isStart) {
            this.curTimer = this.setTimeout(this.config.delay, this, "showHint");
        } else {
            this.curTimer = null;
        }

    },
    
    config : {
        "delay" : 900,
        "email" : "#registration #email",
        "hint"  : "#email_hint"
    }

});
