
document.getElementsByClassName = function(cl) {
var retnode = [];
var myclass = new RegExp('\\b'+cl+'\\b');
var elem = this.getElementsByTagName('*');
for (var i = 0; i < elem.length; i++) {
var classes = elem[i].className;
if (myclass.test(classes)) retnode.push(elem[i]);
}
return retnode;
};

function checkAll(checkname, exby) {
  for (i = 0; i < checkname.length; i++)
  checkname[i].checked = exby.checked? true:false
}

function toggleFillDivChangeClass(d,c,t)
{
 if (document.getElementById(d).innerHTML=="")
 {
  fillDivChangeClass(d,c,t);
 } 
 else
 {
  fillDivChangeClass(d,c,"");
  document.getElementById(d).className = "";
 }
}

function fillDivChangeClass(d,c,t)
{
 document.getElementById(d).innerHTML = t;
 document.getElementById(d).className = c;
}

function toggleFillDiv(d,t)
{
 if (document.getElementById(d).innerHTML=="")
 {
  fillDiv(d,t);
 } 
 else
 {
  fillDiv(d,"");
 }
}

function fillDiv(d,t)
{
 document.getElementById(d).innerHTML = t;
}

/* -------------------- BEGIN AJAX FUNCTIONS --------------------------- */
var xmlHttp
var outputField;
function ajax(mode,callScript,fieldID)
{
 outputField = fieldID;
 var url = callScript;		// <-- defines the backend script location
 if (mode=="active")
 {
  xmlHttp=GetXmlHttpObject(stateChanged);	// <-- (See below)
 }
 else
 {
  xmlHttp=GetXmlHttpObject(emptyFunction);	// <-- (See below)
 }
 xmlHttp.open("GET", url , true);		// <-- Gets the output from the server-side script (url)
 xmlHttp.send(null);				// <-- Doesn't send anything (must just be a required command to wrap up the sequence)
}
function stateChanged() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")	// <-- if the xmlHttp object is 'ready'
 { 
  document.getElementById(outputField).innerHTML=xmlHttp.responseText ;	// <-- Replaces the HTML inside the tags ID'd inputField value
 }
} 
function emptyFunction()
{
}
/*
While this function is carried out, the 'handler' (i.e. stateChanged) is set as the onload/onerror function
So when XmlHttp object is loaded (i.e. the page is opened), its responseText value is used to change the value of innerHTML
*/
function GetXmlHttpObject(handler)
{
 var objXmlHttp=null
 if (navigator.userAgent.indexOf("Opera")>=0)
 {
//  alert("This example doesn't work in Opera");
//  return;
  objXmlHttp=new XMLHttpRequest();
  objXmlHttp.onload=handler;
  objXmlHttp.onerror=handler; 
  return objXmlHttp;
 }
 if (navigator.userAgent.indexOf("MSIE")>=0)
 { 
  var strName="Msxml2.XMLHTTP";
  if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
  {
   strName="Microsoft.XMLHTTP";
  }
  try
  { 
   objXmlHttp=new ActiveXObject(strName);
   objXmlHttp.onreadystatechange=handler;
   return objXmlHttp;
  }
  catch(e)
  {
   alert("Error. Scripting for ActiveX might be disabled");
   return;
  } 
 } 
 if (navigator.userAgent.indexOf("Mozilla")>=0)
 {
  objXmlHttp=new XMLHttpRequest();
  objXmlHttp.onload=handler;
  objXmlHttp.onerror=handler; 
  return objXmlHttp;
 }
}
/* -------------------- END AJAX FUNCTIONS --------------------------- */





/* --- BEGIN MENU JAVASCRIPT --- */
var hoveringon = "";
function syncMenus(m)
{
 if (m=="subsubmenu_LSSSE2006") { document.getElementById('submenu_Archives').style.visibility = "visible;" }
 if (m=="subsubmenu_LSSSE2005") { document.getElementById('submenu_Archives').style.visibility = "visible;" }
 if (m=="subsubmenu_LSSSE2004") { document.getElementById('submenu_Archives').style.visibility = "visible;" }
 if (m=="subsubmenu_LSSSE2003") { document.getElementById('submenu_Archives').style.visibility = "visible;" }

 if (m=="subsubmenu_AnnualReports") { document.getElementById('submenu_Reports_and_Services').style.visibility = "visible;" }

}
function closeMenus()
{
 if (hoveringon=="")
 { 
  var closeSubmenus = document.getElementsByClassName('submenu');
  for ( var i=0, len=closeSubmenus.length ; i<len ; i++ )
  {
   closeSubmenus[i].style.visibility = "hidden";
  }
 }
 closeSubMenus();
}

function closeSubMenus()
{
 if (hoveringon=="")
 { 
  var closeSubSubmenus = document.getElementsByClassName('subsubmenu');
  for ( var i=0, len=closeSubSubmenus.length ; i<len ; i++ )
  {
   closeSubSubmenus[i].style.visibility = "hidden";
  }
 }
}

function openMenu(m)
{
 closeMenus();
 document.getElementById(m).style.visibility = "visible";
 syncMenus(m);
 enterMenu(m);
 hoveringon = m;
}

function openSubMenu(m)
{
 closeSubMenus();
 document.getElementById(m).style.visibility = "visible";
 syncMenus(m);
 enterMenu(m);
 hoveringon = m;
}

function enterMenu(m)
{
 hoveringon = m;
}
function leaveMenu()
{
 hoveringon = "";
 setTimeout("closeMenus()", 1000);
}

/* --- END MENU JAVASCRIPT --- */



