/*
	// IMAGE PRELOADER 
	// Created by Rob Reynolds, May 2004.
	// This program allows you to preload images on a page.  
	// Set the number as low as the highest number of images you will be sending in from a page.
	
	// Sending the information in
	<script Language="JavaScript">
		var	image = new Array("image1","image2");
		var imageON = new Array("image1ON","image2ON");
		preloadPageImages(image,imageON,intNumberImages);
		var imageName = new Array("name1");
		var imageAlt = new Array("Alt1","Alt2");
		var imageHeight = new Array(25,25);
		var imageWidth = new Array(184,184);
		var imageHREF = new Array("1_overview.htm","anotherpage.htm");
		
	</script>
	
	// REFER TO IT - 
		SetUpButtons(0);
	
	//  DONE HERE
	<script Language="Javascript">
		document.write("<A onblur=\"document." + imageName[0] + ".src=img[0].src;\" onmouseout=\"document." + imageName[0] + ".src=img[0].src\" onmouseover=\"document." + imageName[0] + ".src=imgON[0].src\" onfocus=\"document." + imageName[0] + ".src=imgON[0].src;\" href=\"" + imageHREF[0] + "\">");
		document.write("<IMG src=" + img[0].src + " alt='" + imageAlt[0] + "' width='" + imageWidth[0] + "' height='" + imageHeight[0] + "' border='" + imageBorder[0] + "' name='" + imageName[0] + "'>");
		document.write("</A>");
	</script>
	
	//OR 
	<A onblur="document.IMAGENAME.src=img[0].src;" 
	   onmouseout="document.IMAGENAME.src=img[0].src" 
	   onmouseover="document.IMAGENAME.src=imgON[0].src" 
	   onfocus="document.IMAGENAME.src=imgON[0].src;" 
	   href="SOMEPAGE.HTM">
		<IMG src="ACTUAL IMAGE SOURCE HERE" alt='Image Information' width="" height="" border="0" name="IMAGENAME" />
	</A>
	
*/

/*This is where we will Preload the images */
		
//Declare the global variables
var img = new Array();
var imgON = new Array();
							
	 		
function preloadPageImages(image,imageON,intNumImages) {
	for (i=0;i<=intNumImages-1;i++) {
		img[i]= new Image();
		imgON[i] = new Image();
		//SET SOURCES
		img[i].src ="images/" + image[i] + ".gif";
		imgON[i].src="images/" + imageON[i] + ".gif";
	}
}	

// Not fully using this.
function TurnOnAndOff(imgName,imgNumber){
	var boolOn=false;
	if (document[imgName].src==img[imgNumber].src){
		document[imgName].src==imgON[imgNumber].src;
	} else {
		document[imgName].src==img[imgNumber].src;
	}
}

						
function SetUpButtons(numButtons){
	var strPageURLParentMenuGray
	/*
	EachButton(0,false);
	if (strWinLoc.indexOf("1")!=-1  && strWinLoc.indexOf("1d") < 0){
		for (i=1;i<=3;i++){
			EachButton(i,true);
		}
	}
	EachButton(4,false);
	if (strWinLoc.indexOf("2")!=-1){
		for (i=5;i<=7;i++){
			EachButton(i,true);
		}
	}
	EachButton(8,false);
	*/
	
	//Set up Parent Button to be Clickable but Gray
	if (strWinLoc.indexOf("1")!=-1  && strWinLoc.indexOf("1d") < 0){ //Make first button gray but clickable.
			strPageURLParentMenuGray="1_overview.htm";
	} else if (strWinLoc == "2_community.htm" || strWinLoc == "2a_consultation.htm") {
		strPageURLParentMenuGray="2_community.htm";
	} else if (strWinLoc == "1d_environments.htm" || strWinLoc == "1d1_impact.htm" || strWinLoc == "1d2_wetlands.htm"){
		strPageURLParentMenuGray="1d_environments.htm";
	}
	
		
	for (k=0;k<=numButtons-0;k++){
			if (k==1 || k==2){ //Display SubSections only if the user is on a page that should display one.
			if (strWinLoc.indexOf("1")!=-1  && strWinLoc.indexOf("1d") < 0){ //Display First SubSection
				//alert(k + "\n Location: " + strWinLoc + "\n Eval: " + strWinLoc.indexOf("1") );
				EachButton(k,true,"");
			} 
		} else if (k==5) {
			if (strWinLoc == "2_community.htm" || strWinLoc == "2a_consultation.htm") { //Display Second SubSection
				//alert(k + "\n Location: " + strWinLoc + "\n Eval: " + strWinLoc.indexOf("2") );
				EachButton(k,true,"");
			}
		} else if (k==9 || k==10){
			if (strWinLoc == "1d_environments.htm" || strWinLoc == "1d1_impact.htm" || strWinLoc == "1d2_wetlands.htm"){ //Display Third SubSection
				EachButton(k,true,"");	
			}
		} else { //It is not a spacer button
				EachButton(k,false,strPageURLParentMenuGray);
		}		
	}
}


function EachButton(j,boolSeparator,strPageURLParentMenu){
	if (boolSeparator) {
		LinkSeparator();
	}
	// Display the button on or off
	if (strWinLoc != imageHREF[j] && strPageURLParentMenu != imageHREF[j]){	//Shows the button turned off
		document.write("<A onblur=\"document." + imageName[j] + ".src='" +img[j].src + "';\" onmouseout=\"TurnOnAndOff('" + imageName[j] + "'," + j + ")\" onmouseover=\"TurnOnAndOff('" + imageName[j] + "'," + j + ")\" onfocus=\"document." + imageName[j] + ".src='" +imgON[j].src + "';\" href=\"" + imageHREF[j] + "\"");
		/* if (imageHREF[j] == "2_comments.aspx"){ //ADD The Popups
		   AddPopupInfo(j);
		}*/
		document.write(">");
		document.write("<IMG src=");
		document.write(img[j].src)
		document.write(" alt='" + imageAlt[j] + "' width='" + imageWidth[j] + "' height='" + imageHeight[j] + "' border='" + imageBorder[j] + "' name='" + imageName[j] + "'>");
		document.write("</A>");
	} else { //Shows the button turned on
		if (strPageURLParentMenu == imageHREF[j] ){
			document.write("<A href=\"" + imageHREF[j] + "\">");
		}/**/
		document.write("<IMG src=" + imgON[j].src + " alt='" + imageAlt[j] + "' width='" + imageWidth[j] + "' height='" + imageHeight[j] + "' border='" + imageBorder[j] + "' name='" + imageName[j] + "'>");
		if (strPageURLParentMenu == imageHREF[j] ){
			document.write("</A>");
		}/**/
	}
	document.write("<br>");
}

function AddPopupInfo(intWinNumber){
	var strKeyFunctions = new Array ("onKeyPress","onSelect","onClick");
	for (i=0;i<=3;i++){
		document.write(strKeyFunctions[i] + "=\"MyWindow" + intWinNumber + "=window.open('" + imageHREF[intWinNumber] + "','MyWindow" + intWinNumber + "','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=490,height=610,left=10,top=10'); return false;\"");
	}
}


function LinkSeparator() {  //width="55" height="8"
	document.write("<IMG height='8' alt=' ' src='images/spacer.gif' width='55' name='link_separator'><img src='images/shim.gif' alt='  ' width='6' height='8'>");
}

/*
 //ADA COMPLIANCE FOR BLIND PEOPLE
 
<div style="display:none;">
	<!-- <p>If you are blind, you may have trouble with the section below this for the buttons
		I have included a bulleted list of links for you instead.  -->
		<ul>
			<li><a href="index.htm">Home</a></li>
			<li><a href="1_overview.htm">Project Overview</a>
				<ul>
					<li><a href="1a_concept.htm">Concept Map</a></li>
					<li><a href="1b_faqs.aspx">Frequently Asked Questions</a></li>
					<li><a href="1c_schedule.htm">Project Schedule</a></li>
				</ul>
			</li>
			<li><a href="2_community.htm">Community Involvement</a>
				<ul>
				<!--	<li><a href="2_comments.jsp" onKeypress="MyWindow2=window.open('2_comments.jsp','MyWindow2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=490,height=535,left=10,top=10'); return false;" onSelect="MyWindow2=window.open('2_comments.jsp','MyWindow2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=490,height=535,left=10,top=10'); return false;" onClick="MyWindow2=window.open('2_comments.jsp','MyWindow2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=490,height=535,left=10,top=10'); return false;">Comments 
							Form</a></li> -->
					<li><a href="2a_consultation.htm">Consultation and Outreach</a></li>
				</ul>
			</li>
			<li><a href="3_projectnews.aspx">Project 
					News</a></li>
			<li><a href="1d3_historical.htm" class="linklarge">Cultural Resources</a></li>
			<li><a href="1d_environments.htm">Environment Resources</a>
				<ul>
					<li><a href="1d1_impact.htm">Environmental Impact Statement</a></li>
					<li><a href="1d2_wetlands.htm">The Baker University Wetlands</a></li>
				</ul>
			</li>
		</ul>
	</p>
	<a href="#content">To Main Content</a>
</div>

A little further down on the page

<a name="content"></a>

*/	