function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

if(!document.getElementById){
  if(document.all)
  document.getElementById=function(){
    if(typeof document.all[arguments[0]]!="undefined")
    return document.all[arguments[0]]
    else
    return null
  }
  else if(document.layers)
  document.getElementById=function(){
    if(typeof document[arguments[0]]!="undefined")
    return document[arguments[0]]
    else
    return null
  }
}

function selectSubnavItem() {
	var test = false;
	if (arguments.length > 0) {
		for (var i = 0; i < arguments.length; i++) {
			var ID = arguments[i];
			//var subnav_id = ID+'_subnav';
			//if (document.getElementById(subnav_id)) { show(subnav_id); } // If the nav item has subnav, display it.
			if (document.getElementById(ID)) { document.getElementById(ID).className='selected'; }
		}
	} else {
		// try to figure out which links to highlight based on directory structure
		var URL = window.location.href;
		var root_url = 'http://' + window.location.host + '/'; // Will need to be updated for launch
		var URL_ARRAY = URL.split(root_url);
		URL = URL_ARRAY[1].split('/');
		var section = URL[0];
		var subsection = URL[1];
		var subsubsection = URL[2];
		var selected_section = section + '_link';
		var selected_subsection = section + '_' + subsection + '_link';
		//var selected_subsubsection = selected_subsection + '_' + subsubsection;
		if (test == true) {
			alert(root_url);
			alert(selected_section);
			alert(selected_subsection);
		}
		selectSubnavItem(selected_section);
		selectSubnavItem(selected_subsection);
	}
}
function hide() {
	for (var i = 0; i < arguments.length; i++) {
		document.getElementById(arguments[i]).style.display='none';
	}
}
function show() {
	for (var i = 0; i < arguments.length; i++) {
		document.getElementById(arguments[i]).style.display='';
	}
}
