// ---------------------------------------------------------------------
//                  function.apply (if unsupported)
//           Courtesy of Aaron Boodman - http://youngpup.net
// ---------------------------------------------------------------------
if (!Function.prototype.apply) {
  Function.prototype.apply = function(oScope, args) {
    var sarg = [];
    var rtrn, call;
    if (!oScope) oScope = window;
    if (!args) args = [];
    for (var i = 0; i < args.length; i++) {
      sarg[i] = "args["+i+"]";
    };
    call = "oScope.__applyTemp__(" + sarg.join(",") + ");";
    oScope.__applyTemp__ = this;
    rtrn = eval(call);
    oScope.__applyTemp__ = null;
	return rtrn;
  };
};

// ---------------------------------------------------------------------
//                             addClass()
//                 appends the specified class to the object
//                  modified by Florian Hoech (setAttribute)
// ---------------------------------------------------------------------
function addClass(theClass) {
  if (this.className || this.getAttribute('class')) {
    this.setAttribute('class', this.className += ' ' + theClass);
  } else {
    this.className = theClass;
    this.setAttribute('class', theClass);
  };
};
