(function () {
    var autoClear = {
        init : function () {
            $$('input.auto-clear').each(function (that) {
                that.defaultValue = that.value;
                that.observe('focus', autoClear.focus);
                that.observe('blur', autoClear.blur);
            });
        },
        
        focus : function () {
            if (this.value === this.defaultValue) {
                this.value = '';
            }
        },
        
        blur : function () {
            if (this.value === '') {
                this.value = this.defaultValue;
            }
        }
    };
    
    document.observe('dom:loaded', function () {
        autoClear.init();
    });
})();