(function() {
  var lastTime, vendors, x, _i, _len, _ref;

  lastTime = 0;

  vendors = ['ms', 'moz', 'webkit', 'o'];

  _ref = vendors && !window.requestAnimationFrame;
  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
    x = _ref[_i];
    window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
    window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
  }

  if (!window.requestAnimationFrame) {
    window.requestAnimationFrame = function(callback, element) {
      var currTime, id, timeToCall;
      currTime = new Date().getTime();
      timeToCall = Math.max(0, 16 - (currTime - lastTime));
      id = window.setTimeout(function() {
        return callback(currTime + timeToCall);
      }, timeToCall);
      lastTime = currTime + timeToCall;
      return id;
    };
  }

}).call(this);

// Generated by CoffeeScript 1.5.0-pre
