// JavaScript Document

function showSubNav(thisitem) {
	var divname = "subnav"+thisitem;
	var thediv = document.getElementById(divname);
	thediv.style.visibility = 'visible';
}
	
function hideSubNav(thisitem) {
	var divname = "subnav"+thisitem;
	var thediv = document.getElementById(divname);
	thediv.style.visibility = 'hidden';
}

// Preload and image swap functions
function preloadImage(name, on_image, off_image) {

	eval(
		name + "_on = new Image();" + 
		name + "_on.src = \"" + on_image + "\";" + 
		name + "_off = new Image();" + 
		name + "_off.src = \"" + off_image + "\";"
	);
}

function swapImage(name, img) {
	if (document.images) {
		document.images[name].src = img.src;
	}
}

// Header1 Help method
function help(a) {
  var lang = getCookie("amslang");
  var ancre = a;
  var helpURL;
  
  if (lang == "jp" || lang == "JP") {
	  helpURL = "/amsweb/help/help_ja.jsp" + "#" + ancre;
  } else {
	  helpURL = "/amsweb/help/help.jsp" + "#" + ancre;
  }
	
  window.open(helpURL,'Help','width=535,height=600,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,left=300,top=50,screenX=300,screenY=150');
}

// Header1 drop-down methods
function changeForm(theValue) {
	document.searchSym.filter.value = theValue;
}



//call the preloadImage function
preloadImage("gh1_arrow", "/amsweb/images/header/gh1_arrow_on.jpg", "/amsweb/images/header/gh1_arrow_off.jpg");



