OverlayInput = Class.create({
  
  initialize: function(input) {
    this.input = $(input);
    this.text = $(input + '-help');
    
    this.input.observe('focus', this.focus.bind(this));
    this.input.observe('blur', this.blur.bind(this));
    this.text.observe('click', this.click.bind(this));
  },
  
  focus: function() {
    this.text.hide();
  },
  
  blur: function() {
    if (this.input.value == '') {
      this.text.show();
    }
  },
  
  click: function() {
    this.input.focus();
  }
  
});

Event.observe(window, 'load', function() {
  new OverlayInput('username');
  new OverlayInput('password');
});