/* sfHover function that helps make the suckerfish style menus backwards *
 * compatible for some browsers.                                         */

sfHover = function() {
  var sfEls = document.getElementById("leftNavLinks").getElementsByTagName("LI");
  for (var i=0; i<sfEls.length; i++) {
    sfEls[i].onmouseover=function() { this.className+=" sfhover"; }
    sfEls[i].onmouseout=function() {this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); }
  }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);	 

//if (!HTMLElement) {
if (typeof HTMLElement != "undefined" && 
    typeof HTMLElement == "object" &&
    ! HTMLElement.prototype.innerText ) {
  HTMLElement.prototype.__defineSetter__("innerText",function(txt){
	  var rng=document.createRange()
		rng.selectNodeContents(this)
		rng.deleteContents()
		var newText = document.createTextNode(txt)
		this.appendChild(newText)
		return txt
	})
	HTMLElement.prototype.__defineGetter__("innerText",function() {
	  var rng = document.createRange()
		rng.selectNode(this)
		return rng.toString()
	})
}
function youAreHere() {
/* &nbsp; can be interpreted as fromCharCode(32)<normal blank> or fromCharCode(160) <160 is correct> */
/* to be sure you cover both bases, you need to put both possibilities in as arguments */
/* ie, youAreHere('Staff Resources   =>','Staff Resources'+String.fromCharCode(160,160,160)+'=>'); */
/* in the above there 3 &nbsp; entries 'Staff Resources&nbsp;&nbsp;&nbsp;=&gt;', so there are 3 spaces */
/* in the first youAreHere argument and why there are 3 '160' entries in the second youAreHere argument */
/* the &gt; translates only as the expected ">" symbol */
  if (youAreHere.arguments.length == 0) return;
	if (!document.getElementById("leftNavLinks")) return;
  var args = youAreHere.arguments;
	var argLn = args.length;
  var navEls = document.getElementById("leftNavLinks").getElementsByTagName("A");	
	if (!navEls[0].innerText) {
//	  alert ('exiting youAreHere - innerText not supported');
	  return; }
	var navLn = navEls.length;
	for (var x = 0; x < navLn; x++) {	
	  for (var n = 0; n < argLn; n++) {
	    if ((args[n]).toUpperCase() == (navEls[x].innerText).toUpperCase()) navEls[x].className = "activeMenu";
	} }
  }	  
