// *This file was Modified by Rob Gravelle (Vizimetrics, Inc) in January 2009 to use MooTools instead of Prototype.
// *All modified code is released under the LGPL, Copyright 2009 Vizimetrics, Inc.  <tim@vizimetrics.com>
var DetectActivity = new Class({
  
  initialize: function(subject)
  {
    this.onunactivate = function() {};
    this.onactivate   = function() {};
    this.subject = subject;
    this.isactive = true;
    subject.addEvent('mousemove', this._OnFocus.bindWithEvent(this));

    subject.addEvent('mouseout', this._OnBlur.bindWithEvent(this));	

  },
  _OnFocus: function(e)
  {
    this.isactive = true;
    if (this.onactivate) this.onactivate();
  },
  _OnBlur: function(e)
  {
    this.isactive = false;
    if (this.onunactivate) this.onunactivate();
  },
  isActive: function()
  {
    return this.isactive;
  }
});



