var mainWidth = $('.container').width();
var menuWidth = 0;
var countItems = 0;
$('nav li').each(function() {
menuWidth += $(this).width();
countItems++;
});
countItems--;
var marginItems = (mainWidth-menuWidth)/countItems;
$('nav li').css('margin-right', marginItems);
$('nav li:last-child').css('margin-right', 0);