function fourCols(src, type)
{
var origList = src;

var listOne = document.createElement(type);
var listTwo = document.createElement(type);
var listThree = document.createElement(type);
var listFour = document.createElement(type);
var container = document.createElement('div');

var items = origList.getElementsByTagName('LI');
//
var itemsLength = items.length/4;
for (i = 0; i < itemsLength; i++)
{
listOne.appendChild(items[0]);
}

itemsLength = items.length/3;
for (i = 0; i < itemsLength; i++)
{
listTwo.appendChild(items[0]);
}

itemsLength = items.length/2;
for (i = 0; i < itemsLength; i++)
{
listThree.appendChild(items[0]);
}
itemsLength = items.length;
for (i = 0; i < itemsLength; i++)
{
listFour.appendChild(items[0]);
}
//
container.appendChild(listOne);
container.appendChild(listTwo);
container.appendChild(listThree);
container.appendChild(listFour);

listOne.setAttribute('class', 'left');
listTwo.setAttribute('class', 'center');
listThree.setAttribute('class', 'right');
listFour.setAttribute('class', 'right');
container.setAttribute('class','threecol');
if (document.all)
{
listOne.setAttribute('className', 'left');
listTwo.setAttribute('className', 'center');
listThree.setAttribute('className', 'right');
listFour.setAttribute('className', 'right');
container.setAttribute('className','threecol');
}
if (type == 'ol')
{
listTwo.setAttribute('start', listOne.getElementsByTagName('LI').length + 1 );
listThree.setAttribute('start', listTwo.getElementsByTagName('LI').length + 1 );
}
origList.parentNode.replaceChild(container, origList);
}

function allFourCols (whichclass, type)
{
var uls = document.getElementsByTagName(type);
for (var i=0; i< uls.length; i++)
{
if (uls[i].getAttribute('class') == whichclass ||
uls[i].getAttribute('className') == whichclass)
{
fourCols(uls[i], type.toLowerCase());
}
}
}

