/* $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);
;
jQuery(function($) {
	$('ul.megamenu li.has_children').hover( function() {
		$(this).find("ul.megamenu-dropdown").show()
	}, function() {
		$(this).find("ul.megamenu-dropdown").hide()
	})
	// ie fix #2, stops it form jumping about
	.eq(0)
	.mouseover()
	.find("ul.megamenu-dropdown")
	.css("visibility","hidden")
	.hide(1, function() {
		$(this).css("visibility","")
	})

	// fix IE6/7 z-indexing issue by
	// forcing the z-index stack to the DOC root
	// to be strictly increasing with depth
	o = $("ul.megamenu-dropdown")
	i = 100
	while((o = o.parent()).length)
		o.css("z-index", i--)
});

