var activations = [];

var activate = function (scope) {
  if (!scope) scope = document;
  activations.each(function (fun) { fun.run(scope); });
};

window.addEvent('domready', function(){
  activate();
});

var fadeNotices = function () {
  $$('div.notice, div.error').fade('out');
};

activations.push(function (scope) {
  fadeNotices.delay(3000);
});





// some useful extensions

var top_z = null;
var topZ = function () {
  if (top_z) return top_z;
  $$('*').each(function (element) {
    z = parseInt(element.getStyle('z-index'), 10);
    if (z > top_z) top_z = z;
  });
  return top_z;
};

Element.implement({
  bringForward: function () {
    top_z = topZ() + 1;
    this.setStyle('z-index', top_z);
  }
});

var unevent = function (e) {
  if (e) {
    new Event(e).stop();
    if (e.target) e.target.blur();
  }
};









// and some functionality that I seem to use a lot

var Bouncer = new Class({
  initialize: function (element) { 
    this.container = element;
    this.delay_before_hiding = 750;
    this.shower = null;
    this.hider = null;
    this.timer = null;
    this.when_hiding = {};
    this.when_showing = {};
    this.setShownAndHiddenStates();
    this.setTriggers();
    this.afterInitialize();
    this.visible = false;
  },
  setShownAndHiddenStates: function () {
    this.when_hiding = {'opacity' : 0};
    this.when_showing = {'opacity' : 1};
  },
  setTriggers: function () {
    this.container.addEvent('mouseenter', this.show.bindWithEvent(this));
    this.container.addEvent('mouseleave', this.hideSoon.bindWithEvent(this));
  },
  lazyGetShower: function () { if (!this.shower) this.getShower(); return this.shower; },
  getShower: function () { this.shower = new Fx.Morph(this.container, {duration: this.durationIn(), transition: this.transitionIn(), onComplete : this.afterShowing.bind(this)}); },
  lazyGetHider: function () { if (!this.hider) this.getHider(); return this.hider; },
  getHider: function () { this.hider = new Fx.Morph(this.container, {duration: this.durationOut(), transition: this.transitionOut(), onComplete : this.afterHiding.bind(this)}); },
  transitionIn: function () { return Fx.Transitions.Cubic.easeOut; },
  transitionOut: function () { return Fx.Transitions.Cubic.easeOut; },
  durationIn: function () { return 'short'; },
  durationOut: function () { return 'long'; },
  show: function (e) {
    unevent(e);
    this.interrupt();
    this.beforeShowing();
    if (this.lazyGetShower()) this.lazyGetShower().start(this.when_showing);
  },
  hide: function (e) {
    unevent(e);
    this.interrupt();
    this.beforeHiding();
    if (this.lazyGetHider()) this.lazyGetHider().start(this.when_hiding);
  },
  hideSoon: function (e) {
    unevent(e);
    this.timer = this.hide.bind(this).delay(this.delay_before_hiding);
  },
  interrupt: function () {
    $clear(this.timer);
    if (this.hider) this.hider.cancel();
    if (this.shower) this.shower.cancel();
  },
  afterInitialize: function () {},
  beforeShowing: function () { this.container.bringForward(); this.visible = true; },
  afterShowing: function () { },
  beforeHiding: function () { },
  afterHiding: function () { this.visible = false;  }
});

@@ -614,28 +614,21 @@
 ent(%7B%0A  
-bringForward
+front
 : functi
@@ -742,22 +742,16 @@
   if (e)
- %7B%0A   
  new Eve
@@ -768,2402 +768,6 @@
 ();%0A
-    if (e.target) e.target.blur();%0A  %7D%0A%7D;%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A// and some functionality that I seem to use a lot%0A%0Avar Bouncer = new Class(%7B%0A  initialize: function (element) %7B %0A    this.container = element;%0A    this.delay_before_hiding = 750;%0A    this.shower = null;%0A    this.hider = null;%0A    this.timer = null;%0A    this.when_hiding = %7B%7D;%0A    this.when_showing = %7B%7D;%0A    this.setShownAndHiddenStates();%0A    this.setTriggers();%0A    this.afterInitialize();%0A    this.visible = false;%0A  %7D,%0A  setShownAndHiddenStates: function () %7B%0A    this.when_hiding = %7B'opacity' : 0%7D;%0A    this.when_showing = %7B'opacity' : 1%7D;%0A  %7D,%0A  setTriggers: function () %7B%0A    this.container.addEvent('mouseenter', this.show.bindWithEvent(this));%0A    this.container.addEvent('mouseleave', this.hideSoon.bindWithEvent(this));%0A  %7D,%0A  lazyGetShower: function () %7B if (!this.shower) this.getShower(); return this.shower; %7D,%0A  getShower: function () %7B this.shower = new Fx.Morph(this.container, %7Bduration: this.durationIn(), transition: this.transitionIn(), onComplete : this.afterShowing.bind(this)%7D); %7D,%0A  lazyGetHider: function () %7B if (!this.hider) this.getHider(); return this.hider; %7D,%0A  getHider: function () %7B this.hider = new Fx.Morph(this.container, %7Bduration: this.durationOut(), transition: this.transitionOut(), onComplete : this.afterHiding.bind(this)%7D); %7D,%0A  transitionIn: function () %7B return Fx.Transitions.Cubic.easeOut; %7D,%0A  transitionOut: function () %7B return Fx.Transitions.Cubic.easeOut; %7D,%0A  durationIn: function () %7B return 'short'; %7D,%0A  durationOut: function () %7B return 'long'; %7D,%0A  show: function (e) %7B%0A    unevent(e);%0A    this.interrupt();%0A    this.beforeShowing();%0A    if (this.lazyGetShower()) this.lazyGetShower().start(this.when_showing);%0A  %7D,%0A  hide: function (e) %7B%0A    unevent(e);%0A    this.interrupt();%0A    this.beforeHiding();%0A    if (this.lazyGetHider()) this.lazyGetHider().start(this.when_hiding);%0A  %7D,%0A  hideSoon: function (e) %7B%0A    unevent(e);%0A    this.timer = this.hide.bind(this).delay(this.delay_before_hiding);%0A  %7D,%0A  interrupt: function () %7B%0A    $clear(this.timer);%0A    if (this.hider) this.hider.cancel();%0A    if (this.shower) this.shower.cancel();%0A  %7D,%0A  afterInitialize: function () %7B%7D,%0A  beforeShowing: function () %7B this.container.bringForward(); this.visible = true; %7D,%0A  afterShowing: function () %7B %7D,%0A  beforeHiding: function () %7B %7D,%0A  afterHiding: function () %7B this.visible = false;  %7D%0A%7D);%0A
+%7D;

Update reader assets.