/*///////////////////////////////////////////////////////////
//	FIT NAV ITEMS - ROMAN PACHECO
///////////////////////////////////////////////////////////*/
var fitNav	=	{
	init		:	function() {
		var nav			=	$("#links_top").children("ul"),
			navWidth	=	parseFloat(nav.innerWidth()),
			items		=	nav.children("li");
		if($.browser.mozilla) {
			navWidth -= 2;
		};
		while(fitNav.tallyWidth(items) < navWidth) {
			var activeItem,
				activeSide;
			
			// ADD 1 TO LEFT PADDING
			$.each(items,function(i,e) {
				if(fitNav.tallyWidth(items) < navWidth) {
					activeItem = $(e);
					activeSide = "left";
					var aTag = $(e).children("a");
					aTag.css({
						paddingLeft	:	parseInt(aTag.css("padding-left")) + 1
					});
				} else {
					return false;
				};
			});
			
			// ADD 1 TO RIGHT PADDING
			$.each(items,function(i,e) {
				if(fitNav.tallyWidth(items) < navWidth) {
					activeItem = $(e);
					activeSide = "right";
					var aTag = $(e).children("a");
					aTag.css({
						paddingRight	:	parseInt(aTag.css("padding-right")) + 1
					});
				} else {
					return false;
				};
			});
			
			// IF WE'RE DONE, BACK IT UP ONE
			if(fitNav.tallyWidth(items) == navWidth) {
				activeItem.css("padding-" + activeSide,activeItem.css("padding-" + activeSide) - 1);
			};
		};
	},
	tallyWidth	:	function(items) {
		var totalWidth	=	0;
		$.each(items,function(i,item) {
			totalWidth += $(item).outerWidth(true);
		});
		return totalWidth;
	}
};
$(fitNav.init);

$(document).ready(function() {
	 $(function() {
		$('#lightbox a').lightBox();
	});
});

