var default_value = new Class.create();

default_value.prototype = {
  field: null,
  value: null,

  initialize: function(field, value) {
    this.field = $(field);
    this.value = value;

    this.field.observe('blur', function() {
      this.on_blur();
    }.bind(this));
    this.field.observe('focus', function() {
      this.on_focus();
    }.bind(this));

    this.on_blur();
  },

  on_blur: function(){
    if (this.field.value == "") {
      this.field.value = this.value;
    }
  },

  on_focus: function(){
    if (this.field.value == this.value) {
      this.field.value = "";
    }
  }
}
