/*showDiv
 * Written by Mike McNeil
 * July 1st, 2009
 * University of Texas at Austin
 * 
 * Run this script onClick.  Changes the alpha of divs with
 * id="main" to be transluscent when all the menus are closed
 * and opaque when any main menu opens.
 */

function showDiv(objectID){
	var elem = document.getElementById(objectID);
	var melem = document.getElementById('main');
	
	if (elem.style.display == "none") // if opening a question
	{
		if (elem.className != "submenu"){//if this isn't a submenu
		window.opendoors += 1;			//add this to tally
		}
										//either way
		elem.style.display = "block"; 	//show div
		melem.style.opacity = .99;		//and remove translusence
	}									//so pictures are visible
	
	else 								// if closing a question
	{
		
		if (objectID != "toShow10") { 	//if this isn't a submenu
		window.opendoors -= 1;		  	//subtract from tally
		}
									 	//either way...
		elem.style.display = "none";  	//hide div
	}
	
	
	if (window.opendoors<1)				//if this is the last question open
	melem.style.opacity = .8;			//add translusence again
}