<!--
//check browser
if (navigator.userAgent.indexOf("Opera")!=-1
    && document.getElementById) type="OP";
if (document.all) type="IE";
if (document.layers) type="NN";
if (!document.all && document.getElementById) type="MO";
//alert(type);

//eraseCookie('menuopen');
//eraseCookie('mainmenuopen');  

function hs(startnum){
//pass start number of element and clear/show up to end of this level
var i,tempnum,tempstring,savestatus,tempcookie,limit;
savestatus = document.getElementById(startnum).style.display;
//alert('savestatus='+savestatus);
// close all other menus at this level
tempstring = startnum.substr(1,startnum.length);   //numeric part
//alert('startnum='+startnum+'  tempstring='+tempstring);
if (tempstring.length == 5) {
	lower = parseInt(startnum.substr(1,1)) * 10000;
	}
if (tempstring.length == 6) {
	lower = parseInt(startnum.substr(1,2)) * 10000;
	}
//alert('lower='+lower);
limit=9999;

if (readCookie('menuopen')) {   //only use if cookie is set or available
	tempcookie = readCookie('menuopen');
	lower=parseInt(tempcookie.substr(1,tempcookie.length));   //numeric part
	limit=99;

//alert('lower='+lower+'  limit='+limit);
for(i=lower;i<(lower+limit);i++) {
tempstring='m'+i.toString();
if (document.getElementById(tempstring)) {
//...if the last two digits aren't '00', then close it
  lasttwo = i.toString().substr(i.toString().length-2,i.toString().length);
//alert(tempstring+' '+lasttwo);
  if (!(lasttwo=='00')) {
//	alert(i);
	document.getElementById(tempstring).style.display="none";
	}   //if lasttwo not 00
}   //if doc.getelement(tempstring)
}   //for i
}   //if readcookie               
//alert('now starting open routine');
//now open this one
tempnum = parseInt(startnum.substr(1,startnum.length));
createCookie('menuopen',startnum,1);
//alert(readCookie('menuopen'));
//alert(tempnum+' '+startnum);
for(i=tempnum;i<tempnum+99;i++) {
tempstring='m'+i.toString();
//alert(i);

if (document.getElementById(tempstring)) {
//alert(tempstring+' '+document.getElementById(tempstring).style.display);
if (savestatus=="")
document.getElementById(tempstring).style.display="none"
else
document.getElementById(tempstring).style.display="" 
} //if doc.getelement(tempstring)
} //for 1
} //end of hs()

function hsm(startnum){
var i,tempnum,tempstring,savestatus,tempcookie,limit;
//...not used...savestatus = document.getElementById(startnum).style.display;
//alert('savestatus='+savestatus);
// close all other menus at this level
if (readCookie('mainmenuopen')) {   //only use if cookie is set or available
	tempcookie = readCookie('mainmenuopen');
//	limit=2299 - in each routing set this to be larger than max number of sub levels (information menu at present - 22 items)
//alert('tempcookie='+tempcookie+'   startnum='+startnum);
	if (tempcookie == startnum) {  //just close startnum and set cookie to none
		lower=parseInt(tempcookie.substr(1,tempcookie.length));   //numeric part
		limit=2299;
//##		for(i=(lower+10);i<(lower+limit);i=i+10) {
//alert(i);
		for(i=(lower+10);i<(lower+limit);i++) {
		tempstring='m'+i.toString();
		if (document.getElementById(tempstring)) {
			document.getElementById(tempstring).style.display="none";
		}   //if doc.getelement(tempstring)
		}   //for i           
		createCookie('mainmenuopen','none',10000);
	} // if tempcookie=startnum
	if (tempcookie=='none') {  //just open startnum
		lower=parseInt(startnum.substr(1,startnum.length));   //numeric part
		limit=2299;
//##		for(i=(lower+10);i<(lower+limit);i=i+10) {
		for(i=(lower+10);i<(lower+limit);i++) {
		tempstring='m'+i.toString();
		if (document.getElementById(tempstring)) {
			//...if the last two digits are '00', then open it
  			lasttwo = i.toString().substr(i.toString().length-2,i.toString().length);
			//alert(tempstring+' '+lasttwo);
  			if (lasttwo=='00') {
				//	alert(i);
				document.getElementById(tempstring).style.display="";
			}   //if lasttwo are 00
		}   //if doc.getelement(tempstring)
		}   //for i           
		createCookie('mainmenuopen',startnum,10000);
	} //if tempcookie=none
	if ((!(tempcookie == startnum)) && (!(tempcookie=='none'))) {
	// tempcookie isn't startnum, so close tempcookie menu and open startnum
		lower=parseInt(tempcookie.substr(1,tempcookie.length));   //numeric part
		limit=2299;
//##		for(i=(lower+10);i<(lower+limit);i=i+10) {   
		for(i=(lower+10);i<(lower+limit);i++) {   
		//close tempcookie menu
		tempstring='m'+i.toString();
		if (document.getElementById(tempstring)) {
			document.getElementById(tempstring).style.display="none";
		}   //if doc.getelement(tempstring)
		}   //for i           
		lower=parseInt(startnum.substr(1,startnum.length));   //numeric part
//##		for(i=(lower+10);i<(lower+limit);i=i+10) {   
		for(i=(lower+10);i<(lower+limit);i++) {   
		//open startnum menu
		tempstring='m'+i.toString();
		if (document.getElementById(tempstring)) {
			//...if the last two digits are '00', then open it
  			lasttwo = i.toString().substr(i.toString().length-2,i.toString().length);
			//alert(tempstring+' '+lasttwo);
  			if (lasttwo=='00') {
				//	alert(i);
				document.getElementById(tempstring).style.display="";
			}   //if lasttwo are 00
		}   //if doc.getelement(tempstring)
		}   //for i           
		createCookie('mainmenuopen',startnum,10000);
	} //tempcookie <> startnum and <> 'none'

}   //if readcookie exists
else
{  //readcookie doesn't exist
//if no cookie, close all main menus and open/close startnum depending on status of 1st element in menu
		tempnum=parseInt(startnum.substr(1,startnum.length));   //numeric part
		tempnum=tempnum+100;
		tempstring='m'+tempnum.toString();
		savestatus = document.getElementById(tempstring).style.display;
//alert('savestatus='+savestatus);
		lower=10000;   //numeric part
		limit=999999;
		for(i=(lower+100);i<(lower+limit);i=i+100) {
//alert('i='+i);   
//original		for(i=(lower+10);i<(lower+limit);i++) {   
		//close tempcookie menu
		tempstring='m'+i.toString();
		if (document.getElementById(tempstring)) {
			//...if the last four digits aren't '0000' (ie not a main menu), then close it
  			lastfour = i.toString().substr(i.toString().length-4,i.toString().length);
//alert(tempstring+' '+lastfour);
  			if (!(lastfour=='0000')) {
				//alert(i);
				document.getElementById(tempstring).style.display="none";
			}   //if lastfour aren't 0000
			//for every item, check elementbyid+1 to see if submenu. If there is, close all sub entries
			tempstring2 = 'm'+(i+1).toString();
			if (document.getElementById(tempstring2)) {
				j = i;
				for (j+1;j<i+20;j++) {  //close down sub menu entries
					tempstring3 = 'm'+j.toString();
//alert('tempstring3='+tempstring3);
					if (document.getElementById(tempstring3)) {
					document.getElementById(tempstring3).style.display="none";
					}// if doc.getelement(tempstring3)
				}//for loop
			}// if element(tempstring2) exists
		}   //if doc.getelement(tempstring)
		}   //for i           
		lower=parseInt(startnum.substr(1,startnum.length));   //numeric part
		for(i=(lower+100);i<(lower+10000);i=i+100) {   
//original		for(i=(lower+10);i<(lower+limit);i++) {   
		//open startnum menu
		tempstring='m'+i.toString();
		if (document.getElementById(tempstring)) {
			//...if the last two digits are '00', then open it
  			lasttwo = i.toString().substr(i.toString().length-2,i.toString().length);
//alert(tempstring+' '+lasttwo);
  			if (lasttwo=='00') {
				//	alert(i);
				if (savestatus == "none") {
				document.getElementById(tempstring).style.display=""
				} else {
				document.getElementById(tempstring).style.display="none"
				}
			}   //if lasttwo are 00
		}   //if doc.getelement(tempstring)
		}   //for i           
		createCookie('mainmenuopen',startnum,10000);
} //if readcookie exists else
}  //end of hsm()


function bodyonload() { //body onload statements
//scrap this and use cookie to open previously open menu
if (readCookie('mainmenuopen') && (!(readCookie('mainmenuopen') == "none"))) {   //only use if cookie is set or available, and not 'none'
	tempcookie = readCookie('mainmenuopen');
	lower=parseInt(tempcookie.substr(1,tempcookie.length));   //numeric part
//alert('mainmenuopen='+tempcookie);
	// now open this main menu
		lower=parseInt(tempcookie.substr(1,tempcookie.length));   //numeric part
		limit=2299;
		for(i=(lower+1);i<(lower+limit);i++) {
		tempstring='m'+i.toString();
		if (document.getElementById(tempstring)) {
			//...if the last two digits are '00', then open it
  			lasttwo = i.toString().substr(i.toString().length-2,i.toString().length);
			//alert(tempstring+' '+lasttwo);
  			if (lasttwo=='00') {
				//	alert(i);
				document.getElementById(tempstring).style.display="";
			}   //if lasttwo are 00
		}   //if doc.getelement(tempstring)
		}   //for i           
		createCookie('mainmenuopen',tempcookie,10000);
	if (readCookie('menuopen')) {   //only use if cookie is set or available, AND menuopen is part of mainmenuopen
		// set up variables for beginning of mainmenuopen and menuopen
		menulevel = readCookie('menuopen').substr(1,readCookie('menuopen').length-5);
		mainmenulevel = readCookie('mainmenuopen').substr(1,readCookie('mainmenuopen').length-5);
//alert('menulevel='+menulevel+'   mainmenulevel='+mainmenulevel);
		if (menulevel == mainmenulevel) {   //menuopen part of mainmenuopen
		tempcookie = readCookie('menuopen');
		lower=parseInt(tempcookie.substr(1,tempcookie.length));   //numeric part
//alert('menuopen='+tempcookie);
		//now open this sub menu
		tempcookie = readCookie('menuopen');
		lower=parseInt(tempcookie.substr(1,tempcookie.length));   //numeric part
		limit=99;
		//alert('lower='+lower+'  limit='+limit);
		for(i=lower;i<(lower+limit);i++) {
		tempstring='m'+i.toString();
		if (document.getElementById(tempstring)) {
			//...if the last two digits aren't '00', then close it
  			lasttwo = i.toString().substr(i.toString().length-2,i.toString().length);
			//alert(tempstring+' '+lasttwo);
  			if (!(lasttwo=='00')) {
			//	alert(i);
				document.getElementById(tempstring).style.display="";
			}   //if lasttwo not 00
		}   //if doc.getelement(tempstring)
		}   //for i
		}   //if (menuopen part of mainmenuopen)
	}   //if menuopen cookie exists
}  //if mainmenuopen cookie exists
}  //onbodyload


function createCookie(name, value, days)
{
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
    }
  else var expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
  var ca = document.cookie.split(';');
  var nameEQ = name + "=";
  for(var i=0; i < ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    }
  return null;
}

function eraseCookie(name)
{
  createCookie(name, "", -1);
}

function copy_hs(){   //backup of routine
var i,args=hs.arguments;
//alert(args.length);
for(i=0;i<args.length;i++) {

if (!document.getElementById)
return
if (document.getElementById(args[i]).style.display=="table-row")
document.getElementById(args[i]).style.display="none"
else
document.getElementById(args[i]).style.display="table-row"
}
}


//-->
