// collapsing menu by Jim Chestnutt

// this is a minor netscape workaround, just to make the page partially functional
// a complete ns4.x compatible menu would require extensive script & html workarounds.

// css information for the collapsed menu blocks. update as necessary
document.write('<style type="text/css">');
if (document.layers) {
	// ns4.x style
	document.write('#sub1 {display:block}');
	document.write('#sub2 {display:block}');
	document.write('#sub3 {display:block}');
}
else {
	// standards compatible style
	document.write('#sub1 {display:none}');
	document.write('#sub2 {display:none}');
	document.write('#sub3 {display:none}');
}
document.write('</style>');

// define the submenus here(re:css & div tags). Arrays start from 0, so remember to call the correct array.
// i.e. toggleSub(1) for the first menu
subArray = new Array('sub1','sub2','sub3');

// autoclose open submenus? 1 for yes, 0 for no
autoclose = 0

// dynamic css-positioned menu.
// developed by Jim Chestnutt Nov. 2002

var currentSub = -1;
var displayType = 'none';

function toggleSub(target) {
	obj2 = subArray[target];
	if(autoclose != 1) { // run non-auto code
		if((document.getElementById(obj2).style.display != 'block')) {
			displayType='block';
		}
		else {
			displayType='none';
		}
		if (document.all) {
			eval(obj2+'.style.display = "'+ displayType +'"');
		}
		else {
	  		document.getElementById(obj2).style.display = displayType;
		}
	}

	else { // run auto code
	if(currentSub == target){
			currentSub = -1;
		if (document.layers) {
	   		eval('document.'+obj2+'.display = "none"');
		}
		else if (document.all) {
	   		eval(obj2+'.style.display = "none"');
		}
		else {
	  	 	document.getElementById(obj2).style.display = 'none';
		}
	}
	else{
		for(i=0;i<subArray.length;i++) {
			obj2 = subArray[i];
			if(i == target) {
				if (document.layers) {
	  	 			eval('document.'+obj2+'.display = "block"');
				}
				else if (document.all) {
					eval(obj2+'.style.display = "block"');
				}
				else {
	  			 	document.getElementById(obj2).style.display = 'block';
				}
			}
			else {
			// hide
			if (document.layers) {
	  	 		eval('document.'+obj2+'.display = "none"');
			}
			else if (document.all) {
				eval(obj2+'.style.display = "none"');
			}
			else {
	  		 	document.getElementById(obj2).style.display = 'none';
			}
			}
		}
		currentSub = target;
	}
	}
}

function closeToggle() { // something extra to show the difference between autoclose and no autoclose. omit from script for a standard menu.
	autoclose == 1 ? autoclose = 0 : autoclose = 1;
}