/*
AUTHOR: Jedediah Holler
CREATED: 31-Mar-2011
LAST MODIFIED: 31-Mar-2011

Insures that the list items in a given div don't wrap to a new line

DODO:
-Dynamically change font size
-Make sure it works on nested lists/divs

This won't work if you're using a background image that doesn't use repeat-x
*/
(function($) {
	$.fn.navResize = function() {
		return this.each(function() {
			var items = $("li", $(this));
			var as = $("a", $(this))
			as.css("padding-right", "0");
			as.css("padding-left", "0");
			as.css("margin-right", "0");
			as.css("margin-left", "0");
			//as.css("background", 'none');
			var parentWidth = $(this).width();
			var childCnt = $("ul", $(this)).children().size();
			var newSize = parentWidth / childCnt;
			items.each(function() {
				$(this).width(newSize);
			});
		});
	};
})(jQuery);
