	//Used to collapse and expand the timeline display.
	//Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec, enablepersist(true/fase), [initialstate] )

	var GLOBALexternalXML="";
	
	function hideFlash(){
			document.getElementById('flashintro').style.display="none";
	}
	
	function showFlash(){
			document.getElementById('flashintro').style.display="block";
	}


	
	function expandAndDisplay(whichHighLevel){
		//Used to call the function to show the selected mid level contents.
		hideFlash();
		createMidLevel(whichHighLevel)
	}
	
	function createLowLevel(highLevel,midLevel)
	{ 
		var req = null; 
		document.getElementById("errorMessage").innerHTML="Started...";
		if(window.XMLHttpRequest){req = new XMLHttpRequest();}
		else if (window.ActiveXObject){
			req  = new ActiveXObject("Microsoft.XMLHttp");
		} 
		req.onreadystatechange = function(){ 
			document.getElementById("errorMessage").innerHTML="Wait server...";
			if(req.readyState == 4){
				if(req.status == 200){
					//Set the basic variables.
					var doc = req.responseXML; // Assign the XML file to a variable.
					var rootTimeLine=doc.getElementsByTagName('entries')[0]; //Set the root tag.
					var newText="";  //Initiate the text string.
					//The following determines the current entry.
						highLevelEntry=rootTimeLine.childNodes[highLevel];
						midLevelEntry=highLevelEntry.getElementsByTagName('entry')[midLevel];
						//Set the current sub entry header, copy, and flash contents to variables.
						midLevelEntryHeader=midLevelEntry.getElementsByTagName('header')[0].firstChild.nodeValue;
						midLevelEntryCopy=midLevelEntry.getElementsByTagName('copy')[0].firstChild.nodeValue;
						midLevelEntryFlash=midLevelEntry.getElementsByTagName('flash')[0].firstChild.nodeValue;
							//Set the current entry header, copy, and flash contents to string.
						document.getElementById('timelineLowLevelHeader').innerHTML=midLevelEntryHeader;
						document.getElementById('timelineLowLevelCopy').innerHTML=midLevelEntryCopy
						document.getElementById('timelineLowLevelFlash').innerHTML=midLevelEntryFlash;
						document.getElementById("errorMessage").innerHTML="Success... Loaded the Low Level menu items.";
				}	
				else{ //Return an error code if necessary.
					document.getElementById("errorMessage").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
				}	
			} 
		} 
		req.open("GET", GLOBALexternalXML, true); 
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		req.send(null); 
	} 

	function createMidLevel(highLevel){ 
		var req = null; 
		document.getElementById("errorMessage").innerHTML="Started...";
		if(window.XMLHttpRequest){req = new XMLHttpRequest();}
		else if (window.ActiveXObject){
			req  = new ActiveXObject("Microsoft.XMLHttp");
		} 
		req.onreadystatechange = function(){ 
			document.getElementById("errorMessage").innerHTML="Wait server...";
			if(req.readyState == 4){
				if(req.status == 200){
					//Set the basic variables.
					var doc = req.responseXML; // Assign the XML file to a variable.
					var rootTimeLine=doc.getElementsByTagName('entries')[0]; //Set the root tag.
					var newText="";  //Initiate the text string.
					//The following for loop grabs the header, copy and flash of the current entry.
						//highLevelEntry=rootTimeLine.childNodes[highLevel];
						
						highLevelEntry=rootTimeLine.childNodes[highLevel];

						if (highLevelEntry.nodeName=="entry"){
						var highLevelEntryHeader=highLevelEntry.getElementsByTagName('header')[0].firstChild.nodeValue;
						var highLevelEntryCopy=highLevelEntry.getElementsByTagName('copy')[0].firstChild.nodeValue;
						var highLevelEntryFlash=highLevelEntry.getElementsByTagName('flash')[0].firstChild.nodeValue;
							//Begin Looping through any sub entries...
							midLevelEntry=highLevelEntry.getElementsByTagName('entry');
								//The following for loop grabs the header, copy and flash of the current sub entry.
								newText+="<ul class=\"timelineMidLevelDates\">"
								for (midLevel=0;midLevel<midLevelEntry.length;midLevel++){
									//Set the current sub entry header, copy, and flash contents to variables.
									midLevelEntryHeader=midLevelEntry[midLevel].getElementsByTagName('header')[0].firstChild.nodeValue;
									//Set the current sub entry header, copy, and flash contents to the text string.
									newText+="<li><a href=\"javascript:createLowLevel('"+highLevel+"','"+midLevel+"');\">"+midLevelEntryHeader+"</a></li>";
								} //End inner for loop.
								newText+="</ul>";
								//Used to show the selected mid level contents based on the high level content ID.
								document.getElementById('timelineMidLevelHeader').innerHTML="More Highlights from " + highLevelEntryHeader;
								document.getElementById('timelineMidLevelCopy').innerHTML=newText;
								//Used to show the selected low level contents based on the high level content ID.
								document.getElementById('timelineLowLevelHeader').innerHTML=highLevelEntryHeader;
								document.getElementById('timelineLowLevelCopy').innerHTML=highLevelEntryCopy
								document.getElementById('timelineLowLevelFlash').innerHTML=highLevelEntryFlash;
						} //End if statement.
						document.getElementById("errorMessage").innerHTML="Success... Loaded the Mid Level menu items.";
				}	
				else{ //Return an error code if necessary.
					document.getElementById("errorMessage").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
				}	
			} 
		} 
		req.open("GET", GLOBALexternalXML, true); 
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		req.send(null); 
	} 

	function createHighLevel(externalXML){
	var externalXML=externalXML;
	//This function creates the buttons used as the base of the navigation.
		var req = null; 
		document.getElementById("errorMessage").innerHTML="Started...";
		if(window.XMLHttpRequest){req = new XMLHttpRequest();}
		else if (window.ActiveXObject){
			req  = new ActiveXObject("Microsoft.XMLHttp");
		} 
		req.onreadystatechange = function(){ 
			document.getElementById("errorMessage").innerHTML="Wait server...";
			if(req.readyState == 4){
				if(req.status == 200){
					//Set the basic variables.
					var doc = req.responseXML; // Assign the XML file to a variable.
					var rootTimeLine=doc.getElementsByTagName('entries')[0]; //Set the root tag.
					var highLevelCopy="";  //Initiate the text string.
					highLevelCopy+="<span><a href=\"javascript:showFlash();\">Intro</a></span>";
					//The following for loop grabs the header, copy and flash of the current entry.
					for (highLevel=0;highLevel<rootTimeLine.childNodes.length;highLevel++){
						highLevelEntry=rootTimeLine.childNodes[highLevel];
						if (highLevelEntry.nodeName=="entry"){
							//Set the current entry header, copy, and flash contents to variables.
							var highLevelEntryHeader=highLevelEntry.getElementsByTagName('header')[0].firstChild.nodeValue;
							highLevelCopy+="<span><a href=\"javascript:expandAndDisplay('"+highLevel+"');\">"+highLevelEntryHeader+"</a></span>";
							document.getElementById("trueContainer").innerHTML=highLevelCopy;
						} //End if statement.
					} //End outer for loop.
					document.getElementById("errorMessage").innerHTML="Success... Loaded the High Level menu items.";
					GLOBALexternalXML=externalXML;
				}	
				else{ //Return an error code if necessary.
					document.getElementById("errorMessage").innerHTML="Error: returned status code " + req.status + " " + req.statusText;
				}	
			} 
		} 
		req.open("GET", externalXML, true); 
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		req.send(null); 

		
	}
	
	//Start the initial data pull...
	
	

function initializePage(){
	GLOBALexternalXML="timeline/timeline.xml";
	createHighLevel(GLOBALexternalXML);
}
initializePage();

