// add ability to pull param off query string and set category
function buildCategoryNav(categoryArray)
{
	categoryArray.unshift("All");
	var navBlock = document.getElementById("categoryNavBlock");
	var navItems = new Array(); 
	for(var i = 0; i < categoryArray.length; i++)
	{
		var navItem = document.createElement("a");
		navItem.navItemCollection = navItems;
		navItem.setAttribute("href", "");
		navItem.setAttribute("title", categoryArray[i]);
		navItem.className = (categoryArray[i] == "All") ? "navItem selected" : "navItem";
		//FIX: make selected category a property of the projectObject
		//pull off param
		
		navItem.selected = (categoryArray[i] == "All") ? true : false;
		
		
		
		
		navItem.innerHTML = categoryArray[i];
		navItem.onfocus = function(){this.blur();}
		navItem.onclick = function()
									{
										if(this.className.indexOf("selected") == -1)
										{
											for(var i = 0; i < this.navItemCollection.length; i++)
											{
												this.navItemCollection[i].className = "navItem";
												this.selected = false;
											}
											this.selected = true;
											this.className = this.className + " selected";
											// return an array of objects from the web config that match the selected category 
											if(this.innerHTML == "All")
											{
												projectHandler.getAllProjects();
												projectHandler.loadProject();
											}
											else 
											{
												projectHandler.getCategory(this.innerHTML);
												projectHandler.loadProject();
											}	
										}
										else return false;
										return false
									}
		navBlock.appendChild(navItem);
		navItems.push(navItem);
	}
	
	projectCH = new ConfigHandler();
	projectCH.getSection("projectSection", createProjectsObj);//create createPortfolioObj
	
}

