
currentSection = null;
currentSubSection = null;

/*======================================================================
   updateTitleNav(newSection)
   Description: 
       Updates image sources in the title frame.

   newSection: Name of image being turned 'on'.
====================================================================== */
function updateTitleNav(newSection){
	if (top.primary.title){
		if (top.primary.title.document){
			if (top.primary.title.document[newSection]){
				// As long as the frame, page and image are loaded, set the
				// appropriate button to it's on state.
				if (newSection != "main"){
					// Swap the appropriate image to its on state as long as
					// the user hasn't clicked on the link to the main page.
					var navOn = eval(newSection + "_on.src")
					top.primary.title.document[newSection].src = navOn
				}
				if (currentSection != newSection && currentSection != null && currentSection != "main"){
					var navOff = eval(currentSection + "_off.src");
					top.primary.title.document[currentSection].src = navOff;
				}
				currentSection = newSection;
			}else{
				// Otherwise, set a delay to call this script again in one second
				// to give the image time to load.
				eval("setTimeout(\"updateTitleNav('" + newSection + "')\",1000)")
			}
		}else{
			// Otherwise, set a delay to call this script again in one second
			// to give the document time to load.
			eval("setTimeout(\"updateTitleNav('" + newSection + "')\",1000)")
		}
	}else{
		// Otherwise, set a delay to call this script again in one second
		// to give the frame time to load.
		eval("setTimeout(\"updateTitleNav('" + newSection + "')\",1000)")
	}
}

/*======================================================================
   updateSectionNav(newSection)
   Description: 
       Updates image sources in the sectionnav frame.

   newSection: Name of image being turned 'on'.
====================================================================== */
function updateSectionNav(newSection){
//	if (top.getCookies('SectionNavLoaded') == "true"){
//	if (top.primary.section.sectionnav.document[newSection]){
	if (top.primary.section.sectionnav){
		if (top.primary.section.sectionnav.document){
			if (top.primary.section.sectionnav.document[newSection]){
				// As long as the appropriate sectionnav.html document is loaded in
				// the sectionnav frame, set the appropriate button to it's on state.
				var navOn = eval(newSection + "_on.src")
				top.primary.section.sectionnav.document[newSection].src = navOn
				if (currentSubSection != newSection && currentSubSection != null){
					var navOff = eval(currentSubSection + "_off.src");
					if(top.primary.section.sectionnav.document[currentSubSection]){
					top.primary.section.sectionnav.document[currentSubSection].src = navOff;
					}
				}
				currentSubSection = newSection;
			}else{
				// Otherwise, set a delay to call this script again in one second
				// to give the image time to load.
				eval("setTimeout(\"updateSectionNav('" + newSection + "')\",1000)")
			}
		}else{
			// Otherwise, set a delay to call this script again in one second
			// to give the page time to load.
			eval("setTimeout(\"updateSectionNav('" + newSection + "')\",1000)")
		}
	}else{
		// Otherwise, set a delay to call this script again in one second
		// to give the frame time to load.
		eval("setTimeout(\"updateSectionNav('" + newSection + "')\",1000)")
	}
}


/*======================================================================
   imgAct(imgName, path)
   Description: 
       Swaps source of 'imgName' in 'path' frame to its 'on' or 'over' state.

   imgName: Name of image being turned 'on' or 'over'.
	path:		path to frame where image being swapped exists.
====================================================================== */
function imgAct(imgName, path, state) {
	if (document.images){
		if (imgName != currentSubSection){
			var navOn = eval(imgName + "_" + state + ".src")
			eval("top." + path + ".document[imgName].src = navOn")
		}
	}
}

/*======================================================================
   imgInact(imgName, path)
   Description: 
       Swaps source of 'imgName' in 'path' frame to its 'off' state.

   imgName: Name of image being turned 'off'.
	path:		path to frame where image being swapped exists.
====================================================================== */
function imgInact(imgName, path) {
   if (document.images){
      if (imgName != currentSection && imgName != currentSubSection){
         var navOff = eval(imgName + "_off.src");
         eval("top." + path + ".document[imgName].src = navOff");
      }
   }
}
