function setFocus(idToFocus,isSelect){
	var fieldToFocus = document.getElementById(idToFocus);
	fieldToFocus.focus();
	if(isSelect){
		fieldToFocus.select();
	}
	return true;
}

sfHover = function() {
	var sfEls = document.getElementById("navbar").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"), "");
		}
	}
}

function goBox() {
// function for the navigation dropdown box to allow external links. 

	if(document.navForm.navItem.options[document.navForm.navItem.selectedIndex].text == 'Art & Antiques Directory'){
		window.open(document.navForm.navItem.options[document.navForm.navItem.selectedIndex].value,'Greenbee','width=800,height=445,location=yes,scrollbars,status,resizable,toolbar,menubar');
	} else {
		location = ''+document.navForm.navItem.options[document.navForm.navItem.selectedIndex].value; 
	}


}

// Checks if user input has exceeded maximum length for field
function checkFieldLength(field, maxLength) {

	if (field.value.length > maxLength){
	
		alert("Your message should not exceed "+maxLength+" characters, including spaces.");
		return (false);
		
	}
	else return true;
}
