
function validate_questionform()
{
	if (document.questionform.name.value == "")
	{
		alert ("Please fill in the 'Name'.");
		document.questionform.name.focus();
		return false;
	}
	if (document.questionform.email.value == "")
	{
		alert ("Please fill in the 'Email'.");
		document.questionform.email.focus();
		return false;
	}
	if (document.questionform.question.value == "")
	{
		alert ("Please fill in the 'Question'.");
		document.questionform.question.focus();
		return false;
	}

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

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"), "");
		}
	}
}

sfHover2 = function() {
	// Peter
	var over = false;
	if(document.getElementById("menu")) {
		var sfEls = document.getElementById("menu").getElementsByTagName("li");
		for (var i=0; i<sfEls.length; i++) {
			if (!over) {
				sfEls[i].onmouseover=function() {
					this.className += " sfhover";
					//alert(over);
					over = true;
				}
			}
			if (!over) {
				sfEls[i].onmouseout=function() {
					this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
					//alert('mouseout');
					over = false;
				}
			}
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover2);

function sendNewsletter(){
	
	//var params = Form.serialize($('nForm'));
	//new Ajax.Updater('updateDiv', '/submitnewsletter.php', {asynchronous:true, parameters:params});
}

function popupWindow(url) {
	window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=500,height=320,screenX=150,screenY=150,top=150,left=150')
}


function toggleLayer(layerStyle,layerClass,mode){

	if (document.getElementById){
		// this is the way the standards work
		if(layerClass){var thisLayer = document.getElementById(layerClass);}
		else{var thisLayer = document.getElementById(layerStyle).style;}
	}
	else if (document.all){
		// this is the way old msie versions work
		if(layerClass){var thisLayer = document.all[layerClass];}
		else{var thisLayer = document.all[layerStyle].style;}
	}
	else if (document.layers){
		// this is the way nn4 works
		if(layerClass){var thisLayer = document.layers[layerClass];}
		else{var thisLayer = document.layers[layerStyle].style;}
	}

	if(layerClass){
		if(mode=='close'){thisLayer.className = 'block-hide';}
		else if(mode=='open'){thisLayer.className = 'block-show';}
		else{thisLayer.className = thisLayer.className=="block-hide"?"block-show":"block-hide";}
	}
	else{
		if(mode=='close'){thisLayer.display = "none";}
		else if(mode=='open'){thisLayer.display = "block";}
		else{thisLayer.display = thisLayer.display=="block"?"none":"block";}
	}

}