$(function () {
responsiveNav ();
});
function responsiveNav () {
var html = '';
var cloned = $('#main-nav > li').clone ();
var container = $('
', { id: 'responsive-nav' });
var items = $('
', { id: 'responsive-nav-items' });
var trigger = $('', { id: 'responsive-nav-trigger', text: 'Navigate...' });
container.appendTo ('#nav .container');
items.appendTo (container);
items.append (cloned);
items.find ('li').removeClass ('dropdown');
items.find ('ul').removeClass ('dropdown-menu');
items.find ('.caret').remove ();
items.append (html);
trigger.bind ('click', function (e) {
items.slideToggle ();
trigger.toggleClass ('open');
});;
trigger.prependTo (container);
}