/*
 * Supersubs v0.2b - jQuery plugin
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 *
 * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of
 * their longest list item children. If you use this, please expect bugs and report them
 * to the jQuery Google Group with the word 'Superfish' in the subject line.
 *
 */

;(function(a){a.fn.supersubs=function(i){var g=a.extend({},a.fn.supersubs.defaults,i);return this.each(function(){var e=a(this);var c=a.meta?a.extend({},g,e.data()):g;var j=a('<li id="menu-fontsize">&#8212;</li>').css({'padding':0,'position':'absolute','top':'-999em','width':'auto'}).appendTo(e).width();a('#menu-fontsize').remove();$ULs=e.find('ul');$ULs.each(function(k){var f=$ULs.eq(k);var d=f.children();var l=d.children('a');var m=d.css('white-space','nowrap').css('float');var b=f.add(d).add(l).css({'float':'none','width':'auto'}).end().end()[0].clientWidth/j;b+=c.extraWidth;if(b>c.maxWidth){b=c.maxWidth}else if(b<c.minWidth){b=c.minWidth}b+='em';f.css('width',b);d.css({'float':m,'width':'100%','white-space':'normal'}).each(function(){var h=a('>ul',this);var n=h.css('left')!==undefined?'left':'right';h.css(n,b)})})})};a.fn.supersubs.defaults={minWidth:9,maxWidth:25,extraWidth:0}})(jQuery);