$(document).ready(function() {
  $.inputhelp.init( $("#edit-search-theme-form-keys"), { initClass:"dimmed" } );
});

// add help text into an input box. goes away when focused
$.inputhelp = {
  options : {
    initClass : ""
  },
  
  init : function( inputElement, options ) {
    if(options) {
		    $.inputhelp.options = $.extend($.inputhelp.options, options);
    }
    
    if( inputElement ) {          
      inputElement.focus( 
          function() { 
            if( this.value == this.title ) {
              this.value = "";
            }
            if( $.inputhelp.options.initClass ) {
              $(this).removeClass( $.inputhelp.options.initClass ); 
            }
          } 
        );
      inputElement.blur(
          function() { 
            if( this.value == "" || this.value == this.title ) {
              if( $.inputhelp.options.initClass ) {
                $(this).addClass( $.inputhelp.options.initClass ); 
              }
              this.value = this.title;             
            }
          }           
        );
      inputElement.blur();
    }
  }
};

