// jquery script to evenly space main navigtion bar

function spaceEvenly(container, elements, adjust) {
			// Get the total available space
			var total = $(container).width();

			// Element width counter
			var counter = 0;
			//alert(total +' total div container width');

			// Calculate element space usage
			$(elements).each(function() {
				counter += $(this).width();
				//  counter += parseInt($(this).css('padding-left'));
				//  counter += parseInt($(this).css('padding-right'));
			});
			//alert(counter +' total space used');

			// If elements use more space than available there«s nothing to do
			if (counter > total)
				return false;

			// Calculate the space to add to each element (excepto first and last element)
			// var spacing = Math.ceil((total - counter) / ($(elements).length));
			var spacing = ((total - counter) / ($(elements).length));
			//alert(spacing +' extra space per item');

			// Asign the calculated spacing to each element
			$(elements).each(function(index) {
				// if((index + 1) != $(elements).length){
				//	alert($(this).css('width'));
				var mywidth = $(this).width();
				var totalWidth = (mywidth + spacing)
				//alert(totalWidth);
				// NEED TO ADJUST THIS HARD VALUE '-XX' IF AN li ITEM IS ADDED OR REMOVED
				$(this).css('width', (totalWidth - 2) + 'px');

				// counter now holds full amount of occupied space
				counter += spacing;
				//alert(counter + ' counter stuff');
				//}
			});

			// Center elements so it doesn't look too weird
			// (we need to adjust due to rounding functions)
			var center = Math.floor((total - counter) * 0.5);

			// Center and adjust
			//$(elements + ':eq(0)').css('margin-left', (center - adjust) + 'px');
			//alert("hello");
			return true;
		}
