/* Sections Names Used for this external Javascript File are shwon below. */
var sections = new Array;
sections[0] = 'get_involved_body';
sections[1] = 'member_tools_body';
sections[2] = 'about_us_body';
sections[3] = 'nurc_body';

function toggleSection(the_Section) {
	// Parameters:
	//		the_Scope ( the_Section or the_Entirety )
	//		the_DisplayType
			
	// Calling Usage:
	//		toggleSection('<sectionID>')          -> show/hide sectionID
	//		toggleSection('<sectionID', 'show')   -> show sectionID
	//		toggleSection('<sectionID', 'hide')   -> hide sectionID
	//		toggleSection('all')                  -> show/hide all sections
	//		toggleSection('all', 'show')          -> show all sections
	//		toggleSection('all', 'hide')          -> hide all sections

	var the_DisplayType = '';
	
	if(the_Section == 'all') {
		// All Sections
		var i = 0;
		if(arguments.length > 1) {
			// All Sections, Show/Hide Property Given
			the_DisplayType = arguments[1];
			var displayType = ((the_DisplayType == 'show') ? '' : 'none') 
			for(i=0; i<sections.length; i++) {
				if(document.getElementById(sections[i]))
					document.getElementById(sections[i]).style.display = displayType;
			}
			return
		} else {
			// All Sections, Toggle, No Show/Hide Property Given
			for(i=0; i<sections.length; i++) {
				if (document.getElementById(sections[i]).style.display=="") {
					displayType = 'none';
				} else {
					displayType = '';
				}
				if(document.getElementById(sections[i]))
					document.getElementById(sections[i]).style.display = displayType;
			}
			return
		}
	} else {
		// One Section
		if(arguments.length > 1) {
			// One Section, Show/Hide Property Given
			the_DisplayType = arguments[1];
	
			//alert("Open setSectionDisplay "+the_section+ " " + the_displayType);
			if(document.getElementById(the_Section)) {  // the_section must exist
				if(the_DisplayType == 'show') {
					/* Open */
					//alert("Showing "+the_section+ " " + the_displayType);
					document.getElementById(the_Section).style.display = '';
					//if(document.getElementById(the_Section + '_anchor')) {
						//document.getElementById(the_Section + '_anchor').innerText = '-';
					//}
					//getFocus(the_Section + '_link');
					return
				} 
				//alert("Hiding "+the_Section+ " " + the_DisplayType);
				/* Close */
				document.getElementById(the_Section).style.display = "none";
				//if(document.getElementById(the_Section + '_anchor')) {  // Anchor section must exist
					//document.getElementById(the_Section + '_anchor').innerText = "+";
				//}
				// loseFocus(the_Section + '_link');
			}
			return
		} else {
			// One Section, Toggle, No Show/Hide Property Given
			if(document.getElementById(the_Section)) {
				if (document.getElementById(the_Section).style.display=="") {
					/* Close */
					document.getElementById(the_Section).style.display = "none";
					//document.getElementById(the_Section + '_anchor').innerText = "+";
					//loseFocus(the_Section + '_link');
				} else {
					/* Open */
					document.getElementById(the_Section).style.display = "";
					//document.getElementById(the_Section + '_anchor').innerText = "-";
					//getFocus(the_Section + '_link');
				}
			}
			return
		}
	}
}	