// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

var ElementUtils =
    {
        /* The opposite of Element.visible(). */
        invisible: function( element, length ) { return ! $(element).visible(); }
    };

Element.addMethods( ElementUtils );

var elt = document.createElement( 'input' );

/* Superhack to get rid of special delegations temporarily. */
Event.addBehavior({
      'div#delegation_groups': function()
        {
          this.immediateDescendants().find(function(elt) {
            return elt.match('.delegation_group') &&
              /Special Delegations/.test(
                elt.getElementsBySelector('h3')[0].innerHTML); }).hide();
        },
      'div#numbers': function()
        {
          this.immediateDescendants().find(function(elt) {
            return /special delegations/.test(
                elt.getElementsBySelector('label')[0].innerHTML); }).hide();
        }
    });
