sfHover = function() {
	var sfEl = document.getElementById("nav");
	if (sfEl) {
		var sfEls = sfEl.getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
				/* hide SELECT tags which peer through menu - IE 5.0 doesnt like it */
				var allSelects = document.getElementsByTagName('select');
				
				for (var i=0; i<allSelects.length; i++) {
					if (allSelects[i].id != "publicationChooser") allSelects[i].style.visibility="hidden";
				}
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				/* show SELECT tags which peer through menu - IE 5.0 doesnt like it */

				var allSelects = document.getElementsByTagName('select');
				for (var i=0; i<allSelects.length; i++) {
					allSelects[i].style.visibility = "visible";
				}

			}
		}
	}
}

pubDropdown = function() {
	var pC = document.getElementById("publicationChooser");
	if (pC) {
		pC.onchange = function() {
			top.location.href = this.options[this.selectedIndex].value;
		}
	}
}

selectPicker = function() {
	var slPi = document.getElementById("picker");
	if (slPi) {
		slPi.onchange = function() {
			var slCur = this.options[this.selectedIndex].value;
			showTArea(slCur);
		}
	}
}

function showTArea(slCur) {
	var slDivs = document.getElementsByTagName("DIV");
	for (var i=0; i<slDivs.length; i++) {
		var re = new RegExp(/tarea/);
		if ( slDivs[i].className.match(re) ) {
			if (slDivs[i].className == "tarea " + slCur) {	
				slDivs[i].style.display = "block";
			// Added by Barry Hughes
			} else if (slCur == "ALL") {
				slDivs[i].style.display = "block";
			} else {
				slDivs[i].style.display = "none";
			}
		}
	}
}

/* IE only */
if (window.attachEvent) window.attachEvent("onload", sfHover);

/* all JS capable browsers */
window.onload = function() {
	selectPicker();
	pubDropdown();
}



