	 //The following variables are used in the preload function	
	 	var suffix = new Array('a','i','o'); //Starts new array to preload images; 1st variable is the active state, 2nd variable is the inactive state, 3rd variable is the on state (if needed)
		var loaded = false; //Globally sets the loaded var to false so rollovers do not function until loaded
	 	var uExt = 'gif'; //The file extension of the rollover graphics for the Uroll function
		//var uPath = '';This is the path where the top nav rollover graphics live - it is set on each page
	
	

	//This function preloads rollover images for the dropNav function
	function uPreload(){
  		if(document.images){
    	var uArglen = arguments.length;
    	for(var i = 0; i < uArglen; i++){
      		var uArg = arguments[i];
     		var uSufLen = suffix.length;
      		for(j = 0; j < uSufLen; j++){
        var uSuf = suffix[j];
        uNew = uArg + uSuf + ' = new Image();';  eval(uNew);
        uSrc = uArg + uSuf + '.src = \'' + uPath + 'images' + '/' + uArg + uSuf + '.' + uExt + '\';';  
		eval(uSrc);
	        		}
	        	}   
				loaded = true;
				
			}
		}
		

//This function is for two rollover images and showing/hiding a div layer
	//dnDivstate is the state (hidden or visible) of the div layer mentioned on the next line
	//dnDiv is the div layer to be hidden or shown
	//dnName is name of 1st graphic
	//dndName is name of 2nd graphic
	//dnState is the rollover state of both graphics - active (a), inactive(i) or on(o)
	//uWstat is the browser window status message
	function dropNav(dnDivstate,dnDiv,dnName,dndName,dnState,dnWstat) {
		isNS4 = (document.layers) ? true : false;
		isIE4 = (document.all && !document.getElementById) ? true : false;
		isIE5 = (document.all && document.getElementById) ? true : false;
		isNS6 = (!document.all && document.getElementById) ? true : false;
		if (isIE4) { 
			var dnNavlayer = eval('document.all.'+dnDiv);
			dnNavlayer.style.visibility = dnDivstate;
			if(document.images && loaded) {
	    		document.images[dnName].src = self[dnName + dnState].src;
	   			if(dndName!='x') {
	   				document.images[dndName].src = self[dndName + dnState].src;
	  				}
	  			dnWstat = dnWstat.replace('|',"'");
	  			window.status = dnWstat;
	  		}	
		}else if (isNS4) { 
			var dnNavlayer = eval('document.layers.'+dnDiv);
			dnNavlayer.visibility = dnDivstate;
			if(document.images && loaded) {
	    		document.images[dnName].src = self[dnName + dnState].src;
	   			if(dndName!='x') {
	   				dnNavlayer.document.images[dndName].src = self[dndName + dnState].src;
	  				}
	  			dnWstat = dnWstat.replace('|',"'");
	  			window.status = dnWstat;
	  		}
		}else if (isNS6 || isIE5) { 
			var dnNavlayer = eval('document.getElementById'+'("'+dnDiv+'")');
			dnNavlayer.style.visibility = dnDivstate;
			if(document.images && loaded) {
	    		document.images[dnName].src = self[dnName + dnState].src;
	   			if(dndName!='x') {
	   				document.images[dndName].src = self[dndName + dnState].src;
	  				}
	  			dnWstat = dnWstat.replace('|',"'");
	  			window.status = dnWstat;
				}
	  		}
	  	}
	
	  	
	
		
		
	// This function preloads all of the graphics for the top navigation
	function onLoad() {
  		uPreload('resources','collection','services','news','information','search','ask','wadc','foia','terrorism','sudocs','afghanistan','imagegallery','federal','state','international','instruction','microfichescanning','whatsnew','aboutcollection','hours','staff','facilities','policies','mission','credits');
	}

		window.onload = onLoad;
		
	
// This function builds the dropdown menus for the top nav
function buildNav(){
//		<!--- The following div tags are for the top nav dropdowns --->
//		<!------ resources dropdown start ------>

document.write('		<div id="navresources">');
document.write('			<table border="0" cellpadding="0" cellspacing="0" width="64" height="112">');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'../../wadc/" onmouseover="dropNav(\'visible\',\'navresources\',\'resources\',\'wadc\',\'a\',\'resources - WADC Collection\');return true" onmouseout="dropNav(\'hidden\',\'navresources\',\'resources\',\'wadc\',\'i\',\' \');return true")><img src="'+uPath+'images/wadci.gif" width="104" height="18" alt="WADC Collection" border="0" name="wadc"></a></td>');
document.write('				</tr>');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'foia.html" onmouseover="dropNav(\'visible\',\'navresources\',\'resources\',\'foia\',\'a\',\'resources - FOIA Resources\');return true" onmouseout="dropNav(\'hidden\',\'navresources\',\'resources\',\'foia\',\'i\',\' \');return true")><img src="'+uPath+'images/foiai.gif" width="104" height="18" alt="FOIA Resources" border="0" name="foia"></a></td>');
document.write('				</tr>');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'terrorism.htm" onmouseover="dropNav(\'visible\',\'navresources\',\'resources\',\'terrorism\',\'a\',\'resources - World Terrorism\');return true" onmouseout="dropNav(\'hidden\',\'navresources\',\'resources\',\'terrorism\',\'i\',\' \');return true"><img src="'+uPath+'images/terrorismi.gif" width="104" height="18" alt="World Terrorism" border="0" name="terrorism"></a></td>');
document.write('				</tr>');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'internet/index.html" onmouseover="dropNav(\'visible\',\'navresources\',\'resources\',\'sudocs\',\'a\',\'resources - SuDocs List\');return true" onmouseout="dropNav(\'hidden\',\'navresources\',\'resources\',\'sudocs\',\'i\',\' \');return true"><img src="'+uPath+'images/sudocsi.gif" width="104" height="18" alt="SuDocs List" border="0" name="sudocs"></a></td>');
document.write('				</tr>');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'afghanistan/index.html" onmouseover="dropNav(\'visible\',\'navresources\',\'resources\',\'afghanistan\',\'a\',\'resources - Afghanistan\');return true" onmouseout="dropNav(\'hidden\',\'navresources\',\'resources\',\'afghanistan\',\'i\',\' \');return true"><img src="'+uPath+'images/afghanistani.gif" width="104" height="18" alt="Afghanistan" border="0" name="afghanistan"></a></td>');
document.write('				</tr>');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'../../wadc/features/gallery.html" onmouseover="dropNav(\'visible\',\'navresources\',\'resources\',\'imagegallery\',\'a\',\'resources - Image Gallery\');return true" onmouseout="dropNav(\'hidden\',\'navresources\',\'resources\',\'imagegallery\',\'i\',\' \');return true"><img src="'+uPath+'images/imagegalleryi.gif" width="104" height="18" alt="Image Gallery" border="0" name="imagegallery"></a></td>');
document.write('				</tr>');
document.write('				<tr height="4">');
document.write('					<td width="104" bgcolor="#2d8d97" height="4"><img src="'+uPath+'all/spacer.gif" width="104" height="4" alt="" border="0"></td>');
document.write('				</tr>');
document.write('			</table>');
document.write('		</div>');
//		<!------ resources dropdown end ------>
//		<!------ collection dropdown start ------>
document.write('		<div id="navcollections">');
document.write('			<table border="0" cellpadding="0" cellspacing="0" width="64" height="58">');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'federal.html" onmouseover="dropNav(\'visible\',\'navcollections\',\'collection\',\'federal\',\'a\',\'collection - Federal\');return true" onmouseout="dropNav(\'hidden\',\'navcollections\',\'collection\',\'federal\',\'i\',\' \');return true"><img src="'+uPath+'images/federali.gif" width="104" height="18" alt="Federal" border="0" name="federal"></a></td>');
document.write('				</tr>');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'state.html" onmouseover="dropNav(\'visible\',\'navcollections\',\'collection\',\'state\',\'a\',\'collection - State & Local\');return true" onmouseout="dropNav(\'hidden\',\'navcollections\',\'collection\',\'state\',\'i\',\' \');return true"><img src="'+uPath+'images/statei.gif" width="104" height="18" alt="State & Local" border="0" name="state"></a></td>');
document.write('				</tr>');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'international.html" onmouseover="dropNav(\'visible\',\'navcollections\',\'collection\',\'international\',\'a\',\'collection - International\');return true" onmouseout="dropNav(\'hidden\',\'navcollections\',\'collection\',\'international\',\'i\',\' \');return true"><img src="'+uPath+'images/internationali.gif" width="104" height="18" alt="International" border="0" name="international"></a></td>');
document.write('				</tr>');
document.write('				<tr height="4">');
document.write('					<td width="104" bgcolor="#3f6499" height="4"><img src="'+uPath+'all/spacer.gif" width="104" height="4" alt="" border="0"></td>');
document.write('				</tr>');
document.write('			</table>');
document.write('		</div>');
//		<!------ collection dropdown end ------>
//		<!------ services dropdown start ------>
document.write('		<div id="navservices">');
document.write('			<table border="0" cellpadding="0" cellspacing="0" width="64" height="40">');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'categories.html" onmouseover="dropNav(\'visible\',\'navservices\',\'services\',\'instruction\',\'a\',\'services- Instruction\');return true" onmouseout="dropNav(\'hidden\',\'navservices\',\'services\',\'instruction\',\'i\',\' \');return true"><img src="'+uPath+'images/instructioni.gif" width="104" height="18" alt="Instruction" border="0" name="instruction"></a></td>');
document.write('				</tr>');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'microfichescanning.htm" onmouseover="dropNav(\'visible\',\'navservices\',\'services\',\'microfichescanning\',\'a\',\'services - MicroFiche Scanning\');return true" onmouseout="dropNav(\'hidden\',\'navservices\',\'services\',\'microfichescanning\',\'i\',\' \');return true"><img src="'+uPath+'images/microfichescanningi.gif" width="104" height="18" alt="MicroFiche Scanning" border="0" name="microfichescanning"></a></td>');
document.write('				</tr>');
document.write('				<tr height="4">');
document.write('					<td width="104" bgcolor="#b65e80" height="4"><img src="'+uPath+'all/spacer.gif" width="104" height="4" alt="" border="0"></td>');
document.write('				</tr>');
document.write('			</table>');
document.write('		</div>');
//		<!------ services dropdown end ------>
//		<!------ news dropdown start ------>
document.write('		<div id="navnews">');
document.write('			<table border="0" cellpadding="0" cellspacing="0" width="64" height="22">');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'../../about/news.htm" onmouseover="dropNav(\'visible\',\'navnews\',\'news\',\'whatsnew\',\'a\',\'news - What|s New\');return true" onmouseout="dropNav(\'hidden\',\'navnews\',\'news\',\'whatsnew\',\'i\',\' \');return true"><img src="'+uPath+'images/whatsnewi.gif" width="104" height="18" alt="What\'s New" border="0" name="whatsnew"></a></td>');
document.write('				</tr>');
document.write('				<tr height="4">');
document.write('					<td width="104" bgcolor="#b17743" height="4"><img src="'+uPath+'all/spacer.gif" width="104" height="4" alt="" border="0"></td>');
document.write('				</tr>');
document.write('			</table>');
document.write('		</div>');
//		<!------ news dropdown end ------>
//		<!------ information dropdown start ------>
document.write('		<div id="navinformation">');
document.write('			<table border="0" cellpadding="0" cellspacing="0" width="64" height="130">');

document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'about.html" onmouseover="dropNav(\'visible\',\'navinformation\',\'information\',\'aboutcollection\',\'a\',\'information - About the Collection\');return true" onmouseout="dropNav(\'hidden\',\'navinformation\',\'information\',\'aboutcollection\',\'i\',\' \');return true"><img src="'+uPath+'images/aboutcollectioni.gif" width="104" height="18" alt="About the Collection" border="0" name="aboutcollection"></a></td>');
document.write('				</tr>');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18><a href="'+uPath+'../about/hours.htm" onmouseover="dropNav(\'visible\',\'navinformation\',\'information\',\'hours\',\'a\',\'information - Hours\');return true" onmouseout="dropNav(\'hidden\',\'navinformation\',\'information\',\'hours\',\'i\',\' \');return true"><img src="'+uPath+'images/hoursi.gif" width="104" height="18" alt="Hours" border="0" name="hours"></a></td>');
document.write('				</tr>');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'../../about/direct.htm" onmouseover="dropNav(\'visible\',\'navinformation\',\'information\',\'staff\',\'a\',\'information - Staff\');return true" onmouseout="dropNav(\'hidden\',\'navinformation\',\'information\',\'staff\',\'i\',\' \');return true"><img src="'+uPath+'images/staffi.gif" width="104" height="18" alt="Staff" border="0" name="staff"></a></td>');
document.write('				</tr>');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'../../about/facilities.htm" onmouseover="dropNav(\'visible\',\'navinformation\',\'information\',\'facilities\',\'a\',\'information - Facilities\');return true" onmouseout="dropNav(\'hidden\',\'navinformation\',\'information\',\'facilities\',\'i\',\' \');return true"><img src="'+uPath+'images/facilitiesi.gif" width="104" height="18" alt="Facilities" border="0" name="facilities"></a></td>');
document.write('				</tr>');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'../../about/policy.htm" onmouseover="dropNav(\'visible\',\'navinformation\',\'information\',\'policies\',\'a\',\'information - Policies\');return true" onmouseout="dropNav(\'hidden\',\'navinformation\',\'information\',\'policies\',\'i\',\' \');return true"><img src="'+uPath+'images/policiesi.gif" width="104" height="18" alt="Policies" border="0" name="policies"></a></td>');
document.write('				</tr>');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'../../about/history.html" onmouseover="dropNav(\'visible\',\'navinformation\',\'information\',\'mission\',\'a\',\'information - Mission/History\');return true" onmouseout="dropNav(\'hidden\',\'navinformation\',\'information\',\'mission\',\'i\',\' \');return true"><img src="'+uPath+'images/missioni.gif" width="104" height="18" alt="Mission/History" border="0" name="mission"></a></td>');
document.write('				</tr>');
document.write('				<tr height="18">');
document.write('					<td width="104" height="18"><a href="'+uPath+'credits/" onmouseover="dropNav(\'visible\',\'navinformation\',\'information\',\'credits\',\'a\',\'information - Credits\');return true" onmouseout="dropNav(\'hidden\',\'navinformation\',\'information\',\'credits\',\'i\',\' \');return true"><img src="'+uPath+'images/creditsi.gif" width="104" height="18" alt="Credits" border="0" name="credits"></a></td>');
document.write('				</tr>');
document.write('				<tr height="4">');
document.write('					<td width="104" bgcolor="#bfb364" height="4"><img src="'+uPath+'all/spacer.gif" width="104" height="4" alt="" border="0"></td>');
document.write('				</tr>');
document.write('			</table>');
document.write('		</div>');
}
//		<!------ information dropdown end ------>


// This function randomizes the graphic on the home page
	function random_img(){
	var myimages=new Array()
	myimages[1]="images/usgs.gif" 
	myimages[2]="images/fiche.gif" 
	myimages[3]="images/hyperbolic.gif" 
							
	var ry=Math.floor(Math.random()*myimages.length)
						
	if (ry==0) ry=1
	document['randomimg'].src = myimages[ry]					
	}
