function toggleMenu(target, pos) {
	targetMenu = (document.getElementById) ? document.getElementById(target).style : eval("document." + target);
	targetMenu.top = pos;

}

function slideMenu (target) {
	document.getElementById('block1').style.display = 'none';
	document.getElementById('block2').style.display = 'none';
	document.getElementById('block3').style.display = 'none';
	
	if (target == '1') {
		document.getElementById('block1').style.display = 'block';
		document.getElementById('tab1').className = 'menuhover';
		document.getElementById('tab2').className = 'menu_shadow_left';
		document.getElementById('tab3').className = 'menu_shadow_left';
	} 
	if (target == '2') {
		document.getElementById('block2').style.display = 'block';
		document.getElementById('tab2').className = 'menuhover';
		document.getElementById('tab1').className = 'menu_shadow_right';
		document.getElementById('tab3').className = 'menu_shadow_left';
	} 
	if (target == '3') {
		document.getElementById('block3').style.display = 'block';
		document.getElementById('tab3').className = 'menuhover';
		document.getElementById('tab1').className = 'menu_shadow_right';
		document.getElementById('tab2').className = 'menu_shadow_right';
	}
}

function popup(page) {
	newwindow = window.open(page, 'Note','scrollbars, width=450,height=300');
	newwindow.moveTo(200,200);
	newwindow.focus();
}

function moveAnchor () {
	if (window.pageYOffset) { // for safari
		postop = window.pageYOffset;
	}
	else {
		postop = document.documentElement.scrollTop;
	}
	if (postop>500) {
		container.style.top = (25+postop)+"px"; 
	}
	setTimeout("moveAnchor();", 10);
}

	function checkForm(formObj) {
		var formOK = true;
		var info = '';
		if (formObj.name.value == "") { // name field not null
			info += "You must provide your name.\n";
			formOK = false;
		}
		if (formObj.job_title.value == "") { // name field not null
			info += "You must provide your job title.\n";
			formOK = false;
		}
		if (formObj.organisation.value == "") { // name field not null
			info += "You must provide your organisation.\n";
			formOK = false;
		}
		if (formObj.address.value == "") { // name field not null
			info += "You must provide your address.\n";
			formOK = false;
		}
		if (formObj.postcode.value == "") { // name field not null
			info += "You must provide your postcode.\n";
			formOK = false;
		}
		
		formOK = checkEmail(formObj.email.value);  // check email address

		if (formOK == true) {
			formObj.submit();
		} else {
			alert(info);
		}

	}


	function checkEmail(email) {
		if (email.length == 0) {
			window.alert("You must provide your e-mail address.");
			return false;
		}
		if (email.indexOf("/") > -1) {
			window.alert("E-mail address has invalid character: /");
			return false;
		}
		if (email.indexOf(":") > -1) {
			window.alert("E-mail address has invalid character: :");
			return false;
		}
		if (email.indexOf(",") > -1) {
			window.alert("E-mail address has invalid character: ,");
			return false;
		}
		if (email.indexOf(";") > -1) {
			window.alert("E-mail address has invalid character: ;");
			return false;
		}
		if (email.indexOf("@") < 0) {
			window.alert("E-mail address is missing @");
			return false;
		}
		if (email.indexOf("\.") < 0) {
			window.alert("E-mail address is missing .");
			return false;
		}
		return true;
	}
	
