//---------------------------------------------------------------------------
//  Set defaults that go away for input forms.  This requires setting the
//  class of the form to "default-value".
//---------------------------------------------------------------------------
var active_color = '#000000'; // Colour of user provided text
var inactive_color = '#9a9a9a'; // Colour of default text

//---------------------------------------------------------------------------
//  jQuery function definition.
//---------------------------------------------------------------------------
$(document).ready(
function() 
{
  $("input.default-value").css("color", inactive_color);
  var default_values = new Array();
  $("input.default-value").focus(function() 
                                 {
                                   if (!default_values[this.id]) 
                                   {
                                    default_values[this.id] = this.value;
                                   }
                                   if (this.value == default_values[this.id]) 
                                   {
                                     this.value = '';
                                     this.style.color = active_color;
                                   } 
                                   $(this).blur(function() 
                                                {
                                                  if (this.value == '') 
                                                  {
                                                    this.style.color = inactive_color;
                                                    this.value = default_values[this.id];
                                                  }
                                                }
                                               );
                                 }
                                );
}
);

