<!--
function setScrollValues(strForm) {
 	var X = (window.pageXOffset?window.pageXOffset:(window.document.body.scrollLeft?window.document.body.scrollLeft:window.document.documentElement.scrollLeft));
 	var Y = (window.pageYOffset?window.pageYOffset:(window.document.body.scrollTop?window.document.body.scrollTop:window.document.documentElement.scrollTop));
	
	if (strForm) {
	}

	strForm.y_scroll.value = Y;
	if (strForm.x_scroll) {
		strForm.x_scroll.value = X;
	}
}

function confirmAction(what) {
	switch (what) {
		case 'delete article':
			return confirm('Are you sure you want to delete this article?');
		default:
			return confirm('Are you sure?');
	}
}

function validate(strForm, pwrequired) {
	var errorText = "";
	
	if (strForm.first_name) {
		if (strForm.first_name.value == "") {
			errorText += "You must enter enter your first name.\n";
		}
		if (strForm.surname.value == "") {
			errorText += "You must enter enter your surname.\n";
		}
		if (strForm.email.value == "") {
			errorText += "You must enter your email address.\n";
		}
		
		if ((strForm.subject) && (strForm.subject.value == "")) {
			errorText += "Please enter the subject of the email.\n";
		}
	
		if ((strForm.message) && (strForm.message.value == "")) {
			errorText += "Please type in your message before sending.\n";
		}
	}
	
	if (strForm.firstname) {
		if  ((strForm.username) && (strForm.username.value == "")) {
			errorText += "Please enter a username.\n";
		}
		if  ((strForm.centrename) && (strForm.centrename.value == "")) {
			errorText += "Please enter the name of the centre.\n";
		}

		if  ((strForm.area) && (strForm.area.value == "")) {
			errorText += "Please select South, Mid or North Wales.\n";
		}

		if (strForm.password)  {
			if ((strForm.password) && (strForm.password.value == "") && (pwrequired == 1)) {
				errorText += "Password is required.\n";
			}
	
			if ((strForm.password.value != "") && (strForm.password_conf.value == "")) {
				errorText += "Please confirm the password.";
			} else if (strForm.password.value != strForm.password_conf.value) {
				errorText += "The passwords do not match. Please try again.";
			}
		}
	}

	if (errorText != "") {
		alert(errorText);
		return false;
	} else {
		setScrollValues(strForm);
		return true;
	}
}	
	
startList = function() {
		if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		if (node.nodeName=="LI") {
		node.onmouseover=function() {
		this.className+="over";
  		}
 		 node.onmouseout=function() {
  		this.className=this.className.replace("over", "");
   }
   }
  }
 }
}
window.onload=startList;

//-->