function hideDivs(exempt)
{
  var divs2hide = new Array("overview", "title", "introduction", "results", "legend", "discussion");
  //array of divs to be hidden
  if (!document.getElementsByTagName) return null;
  if (!exempt) exempt = "";
  var divs = document.getElementsByTagName("div"); 
  for(var x=0; x < divs.length; x++) 
  {
  	var div = divs[x];
  	var id = div.id;

	  for(var i=0; i < divs2hide.length; i++)
	  {
		var hid_id = document.getElementById(divs2hide[i]);
		if (!hid_id) {
		  	hid_id = "";
		}
		else if (hid_id.id != exempt) {
			hid_id.className = "hidden";
		}
	  } 
   }
      iamhere();
}


// this function highlights the current link in the left hand side menu

// this list of IDs is used to highlight the current link in the left hand side menu
var id_list = new Array("over_cont", "over_lang_coh", "over_lang_sci", "over_lang_info", "plagiarism", "title_cont", "title_lang", "title_summary", "intro_bgrnd", "intro_cont", "intro_stud", "intro_lang", "intro_summary", "res_bgrnd", "res_cont", "res_tables", "res_figures", "res_lang", "results_summary", "leg_bgrnd", "leg_cont", "leg_struct", "leg_procedures", "example_legends", "leg_lang_focus", "leg_lang_verbs", "legend_summary", "disc_bgrnd", "disc_cont", "disc_struct", "disc_lang_arg", "disc_lang_coh", "disc_lang_tense", "disc_lang_cert", "discussion_summary", "glossary");

function iamhere() {

  	var url= String(window.location);	
  	for(var i=0; i < id_list.length; i++)
  	{
    	var id = id_list[i];	
		var search_url = url.match(id);	
	if ((search_url == id))
    		{
				var getNode = document.getElementById(search_url);
				    getNode.className = "here";
			}
	
	}

}

<!-- BEGIN SCRIPT THAT OPENS A NEW WINDOW FOR LINKS TO THE GLOSSARY //-->
//http://www.htmlcodetutorial.com/linking/linking_famsupp_71.html
//This script takes the href from the link in the html page and opens a new window of fixed size.
function GlossaryWin(mylink)
{
windowname="Glossary";
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
preview1=window.open(href, windowname, 'width=600,height=150,scrollbars=yes,resizable=yes,status=yes,screenX=10,screenY=10');
preview1.focus();
return false;
// Return false is necessary so that the link only opens in the new window and not the main page.
/* The format for calling this function in the html page is:
<a href="http://www.sample/sample.html" onclick="return GlossaryWin(this)">link text or image here</a>
'this' in the onClick event references the href. */
}
//-->


<!-- BEGIN SCRIPT THAT OPENS A NEW WINDOW FOR VARIOUS INFORMATION //-->
function infoWin(mylink)
{
windowname="Information";
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
preview2 = window.open(href, windowname, 'width=640,height=500,scrollbars=yes,resizable=yes,status=yes,screenX=10,screenY=10');
preview2.focus();
return false;
}
//-->