/* $Id: admin_devel.js,v 1.2 2010/03/12 22:54:41 sun Exp $ */
(function($) {

/**
 * jQuery debugging helper.
 *
 * Invented for Dreditor.
 *
 * @usage
 *   $.debug(var [, name]);
 *   $variable.debug( [name] );
 */
jQuery.extend({
  debug: function () {
    // Setup debug storage in global window. We want to look into it.
    window.debug = window.debug || [];

    args = jQuery.makeArray(arguments);
    // Determine data source; this is an object for $variable.debug().
    // Also determine the identifier to store data with.
    if (typeof this == 'object') {
      var name = (args.length ? args[0] : window.debug.length);
      var data = this;
    }
    else {
      var name = (args.length > 1 ? args.pop() : window.debug.length);
      var data = args[0];
    }
    // Store data.
    window.debug[name] = data;
    // Dump data into Firebug console.
    if (typeof console != 'undefined') {
      console.log(name, data);
    }
    return this;
  }
});
// @todo Is this the right way?
jQuery.fn.debug = jQuery.debug;

})(jQuery);
;
(function ($) {

  Drupal.behaviors.apba_protect_images = {
    attach: function(context) {
      $("img", context).bind("contextmenu",function(e){ return false; });
    }
  };

})(jQuery);
;
(function ($) {

/**
 * Media Colorbox behavior.
 */
Drupal.behaviors.initMediaColorbox = {
  attach: function (context, settings) {
    if (!$.isFunction($.colorbox)) {
      return;
    }
    $('a.media-colorbox', context).once('init-media-colorbox', function() {
      // Merge Colorbox settings with Media Colorbox settings from data attributes.
      var mediaColorboxSettings = {initialWidth: String($(this).data('mediaColorboxInitialWidth')), 
        initialHeight: String($(this).data('mediaColorboxInitialHeight'))};
      var options = jQuery.extend({}, settings.colorbox);
      jQuery.extend(options, mediaColorboxSettings);
      $(this).colorbox(options);
    });
  }
};

})(jQuery);
;

