curr_open = null;

function toggle(obj) {
	//document.write("\nLOG: ln4 - obj clicked and set to 'clicked' var");
try{
	var clicked = document.getElementById(obj);

	//check to see if curr_selected holds an object
	if(curr_open != null)
	{
		//document.write("\nLOG: ln10 - there is an object currently open");
		
		//check curr_selected is not the same as clicked
		if(clicked == curr_open)
		{
			curr_open = null;
			
			if(clicked.style.display == '')
				clicked.style.display = 'none';
		}
		else
		{
			if(curr_open != null)
			{
				//then close the open object
				if(curr_open.style.display == '')
					curr_open.style.display = 'none'
			}
			
			if(clicked.style.display == 'none')
				clicked.style.display = '';
				
			curr_open = clicked;
		}
	}
	
	else
	{
		//document.write("\nLOG: ln32 - no object open :: open this object and set to curr_open.");
		//curr_open is null meaning there is no object currently in the open state, just open the clicked obj
		
		if(clicked.style.display == 'none'){
			clicked.style.display = '';
		}
		
		//set object opened as the curr_open
		curr_open = clicked;
	}
}
catch(err)
{
	//do nothing with the error
}
}