// Generated by CoffeeScript 1.3.3
(function() {

  this.Logger = (function() {

    function Logger() {}

    Logger.log = function(event_type, data) {
      return $.getWithPrefix('/event', {
        event_type: event_type,
        event: JSON.stringify(data),
        page: window.location.href
      });
    };

    Logger.bind = function() {
      return window.onunload = function() {
        return $.ajax({
          url: "" + Courseware.prefix + "/event",
          data: {
            event_type: 'page_close',
            event: '',
            page: window.location.href
          },
          async: false
        });
      };
    };

    return Logger;

  })();

  this.log_event = Logger.log;

}).call(this);
