sfHover = function() {
	var sfEls = document.getElementById("navigation").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);


//disable auto enter event for IE and firefox
function disableEnterKey(e)
{
     var key;

     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox
    
 
    
     if(key == 13)
          return false;
     else
          return true;
}

// trim all leading and trailing spaces from a string
// 2008 Nov 5 added 
function allTrim(string) {
	while (string.charAt(0) == " ") {
		string = string.substr(1);
	}
	while (string.charAt(string.length - 1) == " ") {
		string = string.slice(0,string.length - 1);
	}
	return string;
}

// trim all leading spaces from a string
function leftTrim(string) {
	while (string.charAt(0) == " ") {
		string = string.substr(1);
	}
	return string;
}

// trim all trailing spaces from a string
function rightTrim(string) {
	while (string.charAt(string.length - 1) == " ") {
		string = string.slice(0,string.length - 1);
	}
	return string;
}

// check if a string variable is empty, i.e. a blank string
function isEmpty(string) {
	string = allTrim(string);
	if (string == "") {
		return true;
	}
	return false;
}