if (typeof(jQuery) != 'undefined') {

  (function($) {
    $(function() {

      // setup our drop-downs
      $('#nav-primary ul').dropMenu({
        'droppedChild': '> div',
        'fadeInSpeed': 100,
        'fadeOutSpeed': 200
      });

      // clear our inputs
      function clearInput(evt) {
        var $this = $(this);

        if (!$this.prop('has_setup')) {
          $this.prop('init_val', $this.val());
          $this.prop('has_setup', true);
        }

        if ($this.val() == $this.prop('init_val')) $this.val('');

        $(this).val('').addClass('has_focus');
      }

      function resetInput(evt) {
        var $this = $(this);

        if (!$this.val()) $this.val($this.prop('init_val'));

        $this.removeClass('has_focus');
      }

      $('#site-search input[type=text]').focus(clearInput);
      $('#site-search input[type=text]').blur(resetInput);
      $('.newsletter form input[type=text]').focus(clearInput);
      $('.newsletter form input[type=text]').blur(resetInput);
      $('#contact_support_newsletter input[type=text]').focus(clearInput);
      $('#contact_support_newsletter input[type=text]').blur(resetInput);

    });

  })(jQuery);
}

