<!--
// Auto-menu highlighter. Copyright Cayenne Web Development 2003 - www.cayenne.co.uk


	function getPathPositions(url) {
		var pos = 0;
		positions = new Array();
		pathParts = url.split("/");
		count = pathParts.length;
		for (x = 0; x < count; x++) {
			pos = pos + pathParts[x].length + 1;
			positions[x] = pos;
		}
		return positions;
	}


	function urlsMatch(url, testUrl, level, positions) {
		if (testUrl.substr(0,1) == "/") {
			testUrl = testUrl.substr( 1 );
		}
		if(level == 0) {
			return (url.substr(1) == testUrl);
		} else {
			return (url.substr(1, positions[level]-1) == testUrl.substr(0, positions[level]-1))
		}
	}


// set highlight styles for menus

function linkHighlight( links, depth ) {
	var positions = getPathPositions(location.pathname);
	for (i = 0; i < links.length; i++) {
		thisLink = links[i];
		if (urlsMatch(location.pathname, thisLink.pathname, depth, positions)) {
			thisLink.className = thisLink.className + " selected";
			continue;
		}
	}
}

// Contact form validation (/contact/enquiry.html)
function validate(form) {
	if (form.name.value == "") {
		form.name.focus();
		alert ("Please enter your name.");
		return false;
	}
	if (form.otherquestion.value == "") {
		form.otherquestion.focus();
		alert ("Please tell us more about your enquiry.");
		return false;
	}
	if (form.address.value == "" && form.email.value == "" && form.tel.value == "" && form.fax.value == "") {
		form.address.focus();
		alert ("Please tell us your address, email address, telephone or fax number so that we can contact you.");
		return false;
	}
	return true;
}

//-->