/*
  suckerfish hover effect from htmldog.com/articles/suckerfish/
  applies the sfhover to elements that get hovered for browsers that
	do not fully support :hover pseudo-class;
*/
sfHover = function() {
	var sfEls = document.getElementById("nav").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);

/* 
  set display:inline if the element with the specified id 
	only if compare1 and compare2 are equal strings. Otherwise 
	set display:none on the element. When set to none, the 
	element is hidden from view, and all surrounding content 
	cinches up to occupy whatever space the element would 
	normally occupy. This is different from the visibility 
	attribute, which reserves space for the element while 
	hiding it from view.
*/
function displayIfTrue(elementID, compare1, compare2) {
	var eid=elementID.toString()
	if (compare1.toString() == compare2.toString()) {
			document.getElementById(eid).style.display="inline";
	} else {
		document.getElementById(eid).style.display="none";
	}
}
/* 
  Show the element with the specified id only if compare1 and 
  compare2 are equal strings. Otherwise hide the element.
*/
function visibleIfTrue(elementID, compare1, compare2) {
	var eid=elementID.toString()
	if (compare1.toString() == compare2.toString()) {
			document.getElementById(eid).style.visibility="visible";
	} else {
		document.getElementById(eid).style.visibility="hidden";
	}
}