
function base_url() {
  return "http://localhost/~ryan/projects/projects/jesustree_working/";
}

// jQuery wait function
$.fn.wait = function(time, type) {
  time = time || 1000;
  type = type || "fx";
  return this.queue(type, function() {
    var self = this;
    setTimeout(function() {
      $(self).dequeue();
    }, time);
  });
};

// jQuery reverse
jQuery.fn.reverse = [].reverse;


/**
 * Log Message, first version of the to be Logger class
 *
 * The log message will add a log to the server log database based on the error
 * type. It will then notify the user of the error with a suggested action.
 */
function logMessage(message, data, type) {
  
}

/**
 * Quick Help, displays quick help to help clients understand usage of the system
 *
 * Needs to be built from a backend help site to keep all data
 */
$.fn.quickHelp = function(topic) {
  // Display quick help app
  if($('#AppQuickHelp').data('active') != true) {

  }
  // Redirect quick help app
  else {
    
  }
}

/**
 * Common routines
 */
$(document).ready(function() {

  // Message bar
  $('#message_bar').click(function() {
    $(this).queue([]).stop();
    $(this).animate({ top: '-=60'}, 500, function() {
      $(this).css('top', '-60px');
    });
  });

  /**
   * Add quick help links
   */
  $('.quickHelp').click(function(e) {
    e.preventDefault();
    $(this).quickHelp();
  });

});
