var menu_status = 'visible';
var phase_array = ['phase_one','phase_two','phase_three'];
var phase_btn_array = ['phase_one_btn','phase_two_btn','phase_three_btn'];
//end of initialization

//simply toggles the recent updates box and expands the
//content to fit accordingly
function showHideUpdates(header,bar,txt_holder)
	{
		if(document.getElementById)
		{
			var switch_header = document.getElementById(header);
			var switch_bar = document.getElementById(bar);
			var switch_content = document.getElementById(txt_holder);
			//var java_loader = document.getElementById("java_loader");
			
			if(menu_status == 'hidden')
			{	//updates are invisible - display and update bool
				switch_header.className 	= 'recent_updates_img';				
				switch_bar.className 		= 'recent_updates_show';
				switch_content.style.width = '450px';
				
				//java_loader.innerHTML = "http://www.medfordcommons.com/javascript/php_session.php?state=1";									
				menu_status = 'visible';
			}
			else
			{	//updates are visible - hide them
				switch_header.className 	= 'recent_updates_img_hide';				
				switch_bar.className 		= 'nodisp';
				switch_content.style.width = '680px';
				
				//java_loader.innerHTML = "http://www.medfordcommons.com/javascript/php_session.php?state=0";								
				menu_status = 'hidden';
			}
		}
			
	}

//this function very simply swaps the phase view of the project progress
//as well as toggling the phase btn's above the map
//uses global array 'phase_array' and 'phase_btn_array'
function changePhase(id,id_btn)
	{
		if(document.getElementById)
		{
			var display_object = document.getElementById(id);
			var display_btn = document.getElementById(id_btn);
			//grab object to display
			//also grab btn to activate
			
			for(var i = 0; i < phase_array.length; i++)
			{
				document.getElementById(phase_array[i]).style.display = 'none';
			}
			//invis all id's prior to showing recently clicked
			
			for(var i = 0; i < phase_btn_array.length; i++)
			{
				document.getElementById(phase_btn_array[i]).className = '';
			}
			//default all phase btns to inactive
			
			display_object.style.display = 'block';
			display_btn.className = 'active';
			//display specifided piece
			//as well as activated btn
			
		}	
	}
	
//toggles any item by id	
function toggleId(id)
{
	if(document.getElementById)
	{
		var switch_id = document.getElementById(id);
		if(switch_id.style.display == 'none' || switch_id.style.display != 'block')
		{ //element is invisible -> show it
			switch_id.style.display = 'block';
		}
		else
		{ //element is visible -> hide it
			switch_id.style.display = 'none';
		}
	}
}
