<!--

	// MENU EXPANDER		
	// Created by Rob Reynolds, April 2004.
	// Copyright 2004 by KDOT.
	//   This program allows you to display a subsection of an item.
	//	1. To reference one of the blocks you will want to set an "a" tag around the link you want for each section.
	//		Ex. 1 - <a href="javascript:MenuChange('LETTER');"></a>
	//	2. Set up the sections with div tags that are not displayed.
	//      Ex. 2 - <div id="LETTERdiv" style="DISPLAY: none"></div>
	//  3. You can also set up the top template if you want.  That allows someone to expand all columns at once.
	//      There is some extra set up coding required in the function MenuChange(divSection).
	//       It is at the bottom of the function.

/*

	//  Table setup:
		<table summary='This is a table that contains information about...' cellpadding='2' width='100%' border='0'>
			<!-- TOP TEMPLATE -->
			<tr>
				<td style="FONT-SIZE: xx-small" align="right" colSpan="2"><br>
					<br> <!-- document.execCommand('Print')-->
					<A href="javascript:window.print();" tabindex="2"><img src="images/printer.gif" border="0">Print 
					this page</A><br>
					<A href="javascript:AllChange();" tabindex="2"><span id="Allspan">Expand</span> All 
					columns</A>
					<BR /><BR /><BR />
				</td>
			</tr>
			<!-- END TOP TEMPLATE -->
			<!-- ITEM TEMPLATE -->		
			<tr>
				<td colspan=2>
					<A href="javascript:MenuChange('LETTER')">Link Here</A>
					&nbsp;&nbsp;&nbsp;&nbsp;<span style="FONT-SIZE: xx-small">(Click 
					to <span id="LETTERspan">Expand</span>)</span>
				</td>
			</tr>
			<tr>
				<td width=10%></td>
				<td>
					<div id='LETTERdiv' style='DISPLAY: none'>
					</div>
				</td>
			</tr>
			<!-- END ITEM TEMPLATE -->
		</table>
*/			
			function MenuChange(divSection) {
				if (document.getElementById(divSection + 'div') != null) {
					//alert(document.getElementById(divSection + 'div').style.display);
					if (document.getElementById(divSection + 'div').style.display == "none") {
						//alert("displaying");
						document.getElementById(divSection + 'div').style.display= "block";
						if (document.getElementById(divSection + 'span') != null) {
							document.getElementById(divSection + 'span').innerText='Collapse';
							//document.getElementById(divSection + 'span').innerText='Expand';
						} 
					} else {
						//alert("hiding");
						document.getElementById(divSection + 'div').style.display= "none";
						if (document.getElementById(divSection + 'span') != null) {
							//document.getElementById(divSection + 'span').innerText='Collapse';
							document.getElementById(divSection + 'span').innerText='Expand';
						}
					}
				}
				
				//This section is for an expand all columns section to change the text from "Expand" to "Collapse" and vice versa.
				// Add an '&& Letter=="none"' for each variable your application uses.
				/*
				if (A=="none" && B=="none" && C=="none" && D=="none" && E=="none" && F=="none") {
					if (document.getElementById('Allspan') != null) {
						document.getElementById('Allspan').innerText='Collapse';
					}
				} else {
					if (document.getElementById('Allspan') != null) {
						document.getElementById('Allspan').innerText='Expand';
					}
				}*/
			}
			
				
			function AllChange() {
				var strAll = document.getElementById('Allspan').innerText;
				//Main
				if (document.getElementById('Mainspan') !=null) {
					if (document.getElementById('Mainspan').innerText == strAll){
						MenuChange('Main');
					}
				}
				//For the rest of the alphabet
				var strAlphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
				for (strLetter=0;strLetter<=25;strLetter++) {
					AllChange2(strAlphabet.charAt(strLetter),strAll);
				}
				//Changes the text in the Allspan Span Tag.
				if (strAll == 'Expand') {
					document.getElementById('Allspan').innerText='Collapse';
				} else {
					document.getElementById('Allspan').innerText='Expand';
				}
			}
			
			function AllChange2(strLetter,strAll){
				if (document.getElementById(strLetter + 'div') !=null) {
					//if (document.getElementById(strLetter + 'span').innerText == strAll){
						MenuChange(strLetter);
					//}
				}
			}
			
	//-->