﻿$(function(){
$("#content ul:not(.sitemapWidget):not(.noFloat)").each(function(){
   var liCount = $(this).children().size();
   if (liCount >= 6) {
           var firstList = this;
           $(firstList).wrap("<div class='colContainer'><div class='twoCols'></div></div>");
           var colContainer = $(firstList).parent().parent();
           $(colContainer).append("<div class='twoCols next'><ul></ul></div>");
           var secondList = $(".twoCols:last ul", colContainer);
           var secondListLIs = $(firstList).children().slice(Math.ceil(liCount/2));
           $(secondList).append(secondListLIs);
           $("div.colContainer").next().addClass("clear");
           if ( $(this).hasClass("noStyle") ) { $(this).parent().parent().find(".twoCols.next ul").addClass("noStyle"); } 
            
   };//close if nonsense
 
}); //closing the each-thingy
});//jQ
