
function highlightField(field) {
	field.style.border = '1px solid #ee0000';
	field.focus();
}

function isValidEmail(address) {
	if (address.indexOf('@')==-1 || address.indexOf(' ')>=0 || address.length<8) {
		alert("Please enter a valid email address");
		return false;
	}
	return true;
}


function checkForm(mandatoryForm) {
	

	try{
		document.getElementById('subscribe').style.border = '1px solid #ccc';

	}catch (e){}
	
	if (!isValidEmail(document.getElementById('subscribe').value)) {
		highlightField(document.getElementById('subscribe'));
		return false;
	}

	document.subnews.submit();
	return true;
	
}


sfHover = function() {
	// Support the standard menu_nav without a class of menu_nav.
	var el = document.getElementById("menu_nav");
	if(!/\bmenu_nav\b/.test(el.className) && el.tagName == "UL")
		setHover(el);

	// Find all unordered lists.
	var iemenu_navs = document.getElementsByTagName('ul');
	for(i=0; i<iemenu_navs.length; i++) {
		var ul = iemenu_navs[i];
		// If they have a class of menu_nav add the menu hover.
		if(/\bmenu_nav\b/.test(ul.className))
			setHover(ul);
	}

}

function setHover(menu_nav) {
	var ieULs = menu_nav.getElementsByTagName('ul');
	if (navigator.appVersion.substr(22,3)!="5.0") {
		// IE script to cover <select> elements with <iframe>s
		for (j=0; j<ieULs.length; j++) {
			var ieMat=document.createElement('iframe');
			if(document.location.protocol == "https:")
				ieMat.src="//0";
			else if(window.opera != "undefined")
				ieMat.src="";
			else
				ieMat.src="javascript:false";
			ieMat.scrolling="no";
			ieMat.frameBorder="0";
			ieMat.style.width=ieULs[j].offsetWidth+"px";
			ieMat.style.height=ieULs[j].offsetHeight+"px";
			ieMat.style.zIndex="-1";
			ieULs[j].insertBefore(ieMat, ieULs[j].childNodes[0]);
			ieULs[j].style.zIndex="101";
		}
		// IE script to change class on mouseover
		var ieLIs = menu_nav.getElementsByTagName('li');
		for (var i=0; i<ieLIs.length; i++) if (ieLIs[i]) {
			// Add a sfhover class to the li.
			ieLIs[i].onmouseover=function() {
				if(!/\bsfhover\b/.test(this.className))
					this.className+=" sfhover";
			}
			ieLIs[i].onmouseout=function() {
				if(!this.contains(event.toElement))
					this.className=this.className.replace(' sfhover', '');
			}
		}
	} else {
		// IE 5.0 doesn't support iframes so hide the select statements on hover and show on mouse out.
		// IE script to change class on mouseover
		var ieLIs = document.getElementById('menu_nav').getElementsByTagName('li');
		for (var i=0; i<ieLIs.length; i++) if (ieLIs[i]) {
			ieLIs[i].onmouseover=function() {this.className+=" sfhover";hideSelects();}
			ieLIs[i].onmouseout=function() {this.className=this.className.replace(' sfhover', '');showSelects()}
		}
	}
}

// Run this only for IE.
if (window.attachEvent) window.attachEvent('onload', sfHover);
// end





