// Functions to show/hide page index

function showHideSiteIndex(s)
 {
   e = document.getElementById('siteindex');	// use W3C DOM, global e
   if (!e) e = document.all['siteindex'];	// Use IE4 DOM
   if (e)
   // if browser is compliant, ...
   {
     //e.style.position   = 'relative';
     //e.style.visibility = s;
     if (s == 'off') e.style.display = 'none';
     if (s == 'on')  e.style.display = '';
     
     document.cookie = 'idx=' + s + '; path=/';
   }
 }

function toggleSiteIndex()
{
  if (document.cookie.indexOf('idx=on') != -1)		{ showHideSiteIndex('off')  }
  else if (document.cookie.indexOf('idx=off') != -1)	{ showHideSiteIndex('on') }
  else
  {
     q = window.confirm ('Your browser is reporting that Cookies\n' +
    			 'are not available, so this option of \n' +
    			 'hiding the site index cannot be applied \n' +
    			 'automatically to the next page you view. \n' +
    			 'Do you wish to view further information \n' +
    			 'about this problem?');
    if (q) location.href = '/nocookies.html';
  }
}

function retrieveSiteIndexState(s)
{
  // window.alert(s);
  if (document.cookie.indexOf('idx=off') != -1) 	{ showHideSiteIndex('off');  }
  else							{ showHideSiteIndex('on');  }
  if (s == 'pub')	{ e.style.display = 'none'; } // force this without altering cookie

}

function showFontInfo()
{
  window.alert( 'Your browser probably has shortcut keys to \n' +
  		'change the size of the text it displays. \n' +
  		' \n' +
  		'Try pressing the Control key and the Plus key \n' +
  		'to enlarge the text, or Control and Minus to \n' +
  		'make it smaller. Control and Zero should \n' +
  		'reset it to the default. \n' +
  		' \n' +
  		'If this does not work, use the Help function\n' +
  		'in your browser and look under Accessibility.');
}