// JavaScript Document

window.onload = function()	{
addCatClass();	
}

function addCatClass()	{
var list = document.getElementById('categories');	//get the ul with categories
list.style.display = 'none';   					//hide the javascript working
var listItem = list.getElementsByTagName('li');		//grab all the category titles

	for (var i=0;i<listItem.length;i++)	{						
			var a = listItem[i].lastChild;			//get the postCount ex. '(10)'
			var txt = document.createTextNode(a.nodeValue);		//take the postCounts value, store it in new txtnode
			var span = document.createElement('span');			//create a span to hold the txtNode
			span.className = 'catPostCount';					//set it's classname for styling
			span.appendChild(txt);								//build the element
			a.parentNode.removeChild(a);						
			listItem[i].firstChild.appendChild(span);			//append it after the anchor
			
	}
list.style.display = 'inline'; 					//show the list after it's been spanified
}