/**
 *
 * Copyright Richard Sheppard
 * form-password-value.js
 *
 * Variation on Rob Schmitt's default value jquery niftiness.
 *
 */

/**
 * The following variables may be adjusted
 */
var active_background = 'none'; // background-image of user provided text
var inactive_background = 'url(/sites/all/themes/zen/tfd/images/pw_bg.gif)'; // background-image of default text

/**
 * Do not modify anything below this line
 */

if (Drupal.jsEnabled) {

  $(document).ready(function() {

    $("input#edit-pass").css('backgroundImage', inactive_background);

    var edit_pass_values = new Array();

    $("input#edit-pass").focus(function() {

      if (!edit_pass_values[this.id]) {
        edit_pass_values[this.id] = this.value;
      }

      if (this.value == edit_pass_values[this.id]) {
        this.value = '';
        this.style.backgroundImage = active_background;
      }

      $(this).blur(function() {

        if (this.value == '') {
          this.style.backgroundImage = inactive_background;
          this.value = edit_pass_values[this.id];
        }

      });

    });

  });

}

