startList = function () {
	if ( document.all && document.getElementById ) {
		navRoot = document.getElementById ( "nav" );
		for ( i = 0; i < navRoot.childNodes.length; i++ ) {
			node = navRoot.childNodes [ i ];
			if ( node.nodeName == "LI" ) {
				node.onmouseover = function () {
					this.className += " over";
				}
				node.onmouseout = function() {
					this.className = this.className.replace ( " over", "" );
				}
			}
		}
	}
	// Included in clock.js
	setInterval ( "getdatestring ()", 500 );
}

window.onload = startList;

//window.onload = function StartTimerRoutine ()
//	startList;
	//if ( document.all || document.getElementById ) {
	//	startList;
	//	setInterval ( "getdatestring()", 500 );
	//}
//}

function resetSubmenus () {
	if ( objRoot = document.getElementById ( 'submenu1' ) ) {
		objRoot.style.display = '';
	}
	
	if ( objRoot = document.getElementById ( 'submenu2' ) ) {
		objRoot.style.display = '';
	}
	
	if ( objRoot = document.getElementById ( 'submenu3' ) ) {
		objRoot.style.display = '';
	}
	
	if ( objRoot = document.getElementById ( 'submenu4' ) ) {
		objRoot.style.display = '';
	}
}

var xmlHttp

function changePage ( fileName, submenu ) {
	// FileName is in the form of http://www.domain.sub/directory/filename
	// Example http://biz.dohrenburg.net/changePage.php

	// Remove the submenu
	if ( submenu != "" ) {
		objRoot = document.getElementById ( submenu );
		objRoot.style.display = 'none';
	}
	//

	// OPTION 1 START USING XMLHttpRequest
	var oRequest = new XMLHttpRequest ();
	var sURL  = fileName;

	oRequest.open ( "GET", sURL, false );
	oRequest.setRequestHeader ( "User-Agent", navigator.userAgent );
	oRequest.send ( null );

	//if ( oRequest.status == 200 ) alert ( oRequest.responseText );
	//	else alert ( "Error executing XMLHttpRequest call!" );

	if ( oRequest.status == 200 ) {
		if ( document.all ) {
			document.all.pagetext.innerHTML = oRequest.responseText;
		} else if ( document.getElementById ) {
			document.getElementById("pagetext").innerHTML = oRequest.responseText;
			} else {
				document.write ( oRequest.responseText );
			}
		return;
	}	
	// OPTION 1 END USING XMLHttpRequest
	
	// OPTION 2 START USING AJAX
	// If browser does not support AJAX just return
	//xmlHttp = GetXmlHttpObject ();
	//if ( xmlHttp == null )
	//{
	//	alert ( "Your browser does not support AJAX!" );
	//	return;
	//} 
	//
	
	// Get ready to call the php function by constructing the url ie. gethint.php?q=hint and adding a random number
	//var url = "http://biz.dohrenburg.net/changePage.php";
	//url = url + "?q=" + fileName;
	//url = url + "&sid=" + Math.random ();
	//xmlHttp.onreadystatechange = stateChanged;
	//xmlHttp.open ( "GET", url, true );
	//xmlHttp.send ( null );
	// OPTION 2 END USING AJAX
}

// Functions used in AJAX option START
function stateChanged ()
{ 
	if ( xmlHttp.readyState == 4 )
	{ 
		document.getElementById( "pagetext" ).innerHTML = xmlHttp.responseText;
	}
}

function GetXmlHttpObject ()
{
	var xmlHttp = null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp = new XMLHttpRequest ();
	}
	catch ( e )
	{
		// Internet Explorer
		try
    	{
	    	xmlHttp = new ActiveXObject ( "Msxml2.XMLHTTP" );
	    }
		catch ( e )
		{
			xmlHttp = new ActiveXObject ( "Microsoft.XMLHTTP" );
		}
	}
	
	return xmlHttp;
}
// Functions used in AJAX option END