jQuery.noConflict();
var trackel = (function($) {

  var that = typeof trackel === 'undefined' ? {} : trackel,
      config = {};
  
  that.domLoaded = false; //indicates whether dom:ready / dom:loaded event has already been fired or not
  that.windowLoaded = false; //indicates whether window.load event has already been fired or not
  that.initialized = false; //indicates whether trackel objects have been initialized or not
  
  that.showLoading = function (container) {
    if (container) {
      $(container).addClass('loading');
    }
    
    if (window.jfPD) {
      jfPD.controller.showMessageLoading();
    }
  };
  
  that.hideLoading = function (container) {
    if (container) {
      $(container).removeClass('loading');
    }
    
    if (window.jfPD) {
      jfPD.controller.hideMessageLoading();
    }
  };
  
  that.log = function(message) {
    if (typeof console !== 'undefined') {
      console.log(message);
    }
  };
  
  $(document).ready(function() { 
    that.initialized = true;
    that.domLoaded = true;
    $(document).trigger('trackel:init');
  });
  $(window).load(function() { that.windowLoaded = true; });
  
  return that;
  
})(jQuery);

