/*

	startList makes the dropdown menus work in IE
	
*/

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', '' );
				}
				
			}
			
		}
		
	}
	
}


/*

	fixNav removes the drop-downs for older versions of Safari

*/

function fixNav() {

	var browser = window.navigator.userAgent;
	
	// if this browser is Safari
	if( browser.search(/Safari/gi) )
	{
	
		var SafariVersion = parseFloat( browser.split( 'Safari/' )[1] );
		
		// if this version of Safari is 1.0 or 1.2
		if( SafariVersion < 312 )
		{
		
			// find all of the top-level #nav LIs
			var navAr = getElementsByClassName( document , 'li' , 'top' );
			
			for( var a = 0 ; a < navAr.length ; a ++ ) {
			
				// find all of the ULs that are children of the top-level #nav LIs
				var ulAr = navAr[a].getElementsByTagName('UL');
				
				for( var b = 0 ; b < ulAr.length ; b ++ ) {
					
					// remove each UL
					navAr[a].removeChild( ulAr[b] );
				
				}
			
			}
		}
	
	}
	
}


/*

	Attach our functions to the onload event
	
*/

window.onload = function() {

	startList();
	
	fixNav();

}