var current = "0";
function workSwitch(id){
	if(!document.getElementById) return false;
	var work = document.getElementById("work"+String(id));
	var curWork = document.getElementById("work"+current);
	if(curWork && (current!="0")){
		curWork.style.display = "none";
	}
	if(current==id){
		work.style.display = "none";
		current = "0";
	} else {
		work.style.display = "block";
		current = String(id);
	}
}

/**
 * hideWork
 * 
 * runs onload of window. if there are work elements that require hiding onload there should be an array
 * of integers called workToHide on the window relating to the ids of elements to be hidden.
 * 
 * e.g. var workToHide = [1,2];
 * will hide elements with ids "work1" and "work2" onload
 * 
 */
function hideWork() {
	
	if (workToHide) {
		
		for (var  i = 0; i < workToHide.length; i++) {
			current = workToHide[i];
			workSwitch(workToHide[i]);
		}
	}
}

if (window.attachEvent) {
	window.attachEvent('onload', hideWork);
}
else {
	window.addEventListener('load', hideWork, false);
}