/**
	categories are as follows
	0 = about
	1 = programs
	2 = careers
	3 = customers
	4 = contact
	5 = technology
	6 = site_map
**/


//declare globals

var categoryTopImage = new Array()  	//refers to top right hand image on pages
var navOn = new Array()			//used to determine if main nav button is in "on" state
var subNavOn = new Array()		//used to determine if main sub nav button is in "on" state
var category;				//declare in case it is not set on page
var subPage;				//declare in case it is not set on page


//top right hand images on sub pages
categoryTopImage[0] = "inner_top_about.jpg";
categoryTopImage[1] = "inner_top_programs.jpg";
categoryTopImage[2] = "inner_top_careers.jpg";
categoryTopImage[3] = "inner_top_customers.jpg";
categoryTopImage[4] = "inner_top_contact.jpg";
categoryTopImage[5] = "inner_top_technology.jpg";
categoryTopImage[6] = "inner_top_site_map.jpg";


//appended to image names for main nav to show "on" state

navOn[0] = ""		//about
navOn[1] = ""		//programs
navOn[2] = ""		//careers
navOn[3] = ""		//customers
navOn[4] = ""		//contact
navOn[5] = ""		//technology
navOn[6] = ""		//site_map



//appended to image names for sub nav to show "on" state. order is by order on page for sub page buttons
subNavOn[0] = ""
subNavOn[1] = ""
subNavOn[2] = ""
subNavOn[3] = ""
subNavOn[4] = ""
subNavOn[5] = ""
subNavOn[6] = ""


function setUp() {

	//first set up top right image
	if (category <= categoryTopImage.length) {
		document.inner_top.src = "/images/" + categoryTopImage[category]
	}

}

function writeNavigation() {
	
	//first find "on" image
	if (category <= categoryTopImage.length) {
		navOn[category] = "_on"
	}

	document.write("<table width='180' cellpadding='0' cellspacing='5' border='0'>")
	document.write("	<tr>")
	document.write("		<td width='20' valign='top'><img src='/images/spacer.gif' width='20' height='1' border='0'></td>\n")
	document.write("		<td width='160' valign='top'><a href='/about/index.shtml'><img src='/images/button_about" + navOn[0] + ".gif' border='0' width='60' height='16'></a></td>\n")
	document.write("	</tr>\n")
	
	if(category==0) writeSubAbout()  //write sub nav for about
	
	document.write("	<tr>\n")
	document.write("		<td colspan='2' width='180' valign='top'><img src='/images/nav_bar.gif' width='154' height='10' border='0' width='154' height='10'></td>\n")
	document.write("	</tr>\n")
	document.write("	<tr>\n")
	document.write("		<td width='20' valign='top'><img src='/images/spacer.gif' width='20' height='1' border='0'></td>\n")
	document.write("		<td width='160' valign='top'><a href='/technology/index.shtml'><img src='/images/button_technology" + navOn[5] + ".gif' border='0' width='98' height='16'></a></td>\n")
	document.write("	</tr>\n")
	document.write("	<tr>\n")
	document.write("		<td colspan='2' width='180' valign='top'><img src='/images/nav_bar.gif' width='154' height='10' border='0' width='154' height='10'></td>\n")
	document.write("	</tr>\n")
	document.write("	<tr>\n")
	document.write("		<td width='20' valign='top'><img src='/images/spacer.gif' width='20' height='1' border='0'></td>\n")
	document.write("		<td width='160' valign='top'><a href='/programs/index.shtml'><img src='/images/button_programs" + navOn[1] + ".gif' border='0' width='84' height='16'></a></td>\n")
	document.write("	</tr>\n")
	
	//if(category==5) writeSubPrograms()  //write sub nav for technology
	
	//document.write("	<tr>\n")
	//document.write("		<td colspan='2' width='180' valign='top'><img src='/images/nav_bar.gif' width='154' height='10' border='0' width='154' widheightth='10'></td>\n")
	//document.write("	</tr>\n")
	//document.write("	<tr>\n")
	//document.write("		<td width='20' valign='top'><img src='/images/spacer.gif' width='20' height='1' border='0'></td>\n")
	//document.write("		<td width='160' valign='top'><a href='/technology/index.shtml'><img src='/images/button_technology" + navOn[5] + ".gif' border='0' width='86' height='17'></a></td>\n")
	//document.write("	</tr>\n")
	
	if(category==1) writeSubPrograms()  //write sub nav for programs
	
	document.write("	<tr>\n")
	document.write("		<td colspan='2' width='180' valign='top'><img src='/images/nav_bar.gif' width='154' height='10' border='0' width='154' widheightth='10'></td>\n")
	document.write("	</tr>\n")
	document.write("	<tr>\n")
	document.write("		<td width='20' valign='top'><img src='/images/spacer.gif' width='20' height='1' border='0'></td>\n")
	document.write("		<td width='160' valign='top'><a href='/careers/index.shtml'><img src='/images/button_careers" + navOn[2] + ".gif' border='0' width='86' height='17'></a></td>\n")
	document.write("	</tr>\n")
	
	if(category==2) writeSubCareers()  //write sub nav for careers
	
	document.write("	<tr>\n")
	document.write("		<td colspan='2' width='180' valign='top'><img src='/images/nav_bar.gif' width='154' height='10' border='0' width='154' height='10'></td>\n")
	document.write("	</tr>\n")
	document.write("	<tr>\n")
	document.write("		<td width='20' valign='top'><img src='/images/spacer.gif' width='20' height='1' border='0'></td>\n")
	document.write("		<td width='160' valign='top'><a href='/customers/index.shtml'><img src='/images/button_customers" + navOn[3] + ".gif' border='0' width='91' height='17'></a></td>\n")
	document.write("		</tr>\n")
	document.write("	<tr>\n")
	document.write("		<td colspan='2' width='180' valign='top'><img src='/images/nav_bar.gif' width='154' height='10' border='0' width='154' height='10'></td>\n")
	document.write("	</tr>\n")
	document.write("</table>\n")


}

function writeSubAbout() {
	//first find "on" image
	if (subPage <= subNavOn.length) {
		subNavOn[subPage] = "_on"
	}

	document.write("	<tr>")
	document.write("		<td width='20' valign='top'><img src='/images/spacer.gif' width='20' height='1' border='0'></td>\n")
	document.write("		<td width='160' valign='top'>\n")
	document.write("			<a href='/about/management.shtml'><img src='/images/button_about_management" + subNavOn[0] + ".gif' border='0' width='102' height='20'></a><br>\n")
	document.write("			<a href='/about/history.shtml'><img src='/images/button_about_history" + subNavOn[1] + ".gif' border='0' width='102' height='20'></a><br>\n")
	document.write("			<a href='/about/facilities.shtml'><img src='/images/button_about_facilities" + subNavOn[2] + ".gif' border='0' width='102' height='20'></a>\n")
	document.write("		</td>\n")
	document.write("	</tr>\n")

}

function writeSubTechnology() {
	//first find "on" image
	if (subPage <= subNavOn.length) {
		subNavOn[subPage] = "_on"
	}

	document.write("	<tr>")
	document.write("		<td width='20' valign='top'><img src='/images/spacer.gif' width='20' height='1' border='0'></td>\n")
	document.write("		<td width='160' valign='top'>\n")
	document.write("			<a href='/technology/tools.shtml'><img src='/images/button_technology_tools" + subNavOn[0] + ".gif' border='0' width='102' height='20'></a><br>\n")
	document.write("		</td>\n")
	document.write("	</tr>\n")

}

function writeSubPrograms() {
	//first find "on" image
	if (subPage <= subNavOn.length) {
		subNavOn[subPage] = "_on"
	}

	document.write("	<tr>")
	document.write("		<td width='20' valign='top'><img src='/images/spacer.gif' width='20' height='1' border='0'></td>\n")
	document.write("		<td width='160' valign='top'>\n")
	document.write("			<a href='/programs/optic.shtml'><img src='/images/button_programs_optic" + subNavOn[0] + ".gif' border='0' width='79' height='20'></a><br>\n")
	document.write("			<a href='/programs/telescopes.shtml'><img src='/images/button_programs_tele" + subNavOn[1] + ".gif' border='0' width='79' height='20'></a><br>\n")
	document.write("			<a href='/programs/eo.shtml'><img src='/images/button_programs_eo" + subNavOn[2] + ".gif' border='0' width='79' height='36'></a><br>\n")
	document.write("			<a href='/programs/fsm.shtml'><img src='/images/button_programs_fsm" + subNavOn[3] + ".gif' border='0' width='79' height='36'></a><br>\n")
	document.write("		</td>\n")
	document.write("	</tr>\n")

}

function writeSubCareers() {
	//first find "on" image
	if (subPage <= subNavOn.length) {
		subNavOn[subPage] = "_on"
	}

	document.write("	<tr>")
	document.write("		<td width='20' valign='top'><img src='/images/spacer.gif' width='20' height='1' border='0'></td>\n")
	document.write("		<td width='160' valign='top'>\n")
	document.write("			<a href='/careers/benefits.shtml'><img src='/images/button_careers_benefits" + subNavOn[0] + ".gif' border='0' width='102' height='20'></a><br>\n")
	document.write("			<a href='/careers/culture.shtml'><img src='/images/button_careers_culture" + subNavOn[1] + ".gif' border='0' width='102' height='20'></a><br>\n")
	document.write("			<a href='/careers/locations.shtml'><img src='/images/button_careers_location" + subNavOn[2] + ".gif' border='0' width='102' height='20'></a>\n")
	document.write("		</td>\n")
	document.write("	</tr>\n")

}