function check_email(e) {
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	for(i=0; i < e.length ;i++){
		if(ok.indexOf(e.charAt(i))<0){ 
			return (false);
		}
	} 
	if (document.images) {
		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
		re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
		if (!e.match(re) && e.match(re_two)) {
			return (-1);		
		} 
	}
}

function check_form(f) {
	if(!check_email(f.email.value)||(f.email.disabled==false && !check_email(f.email.value))){
		alert("Please enter a valid email address.");
		return false;
	}
}
	
function CheckSuggestion() {
	if(document.sug.email.value=='') {
		if(document.sug.suggestion.value.length < 10) {
			alert('Please enter your suggestion.');
			return false;
		} else {
			return confirm('You haven\'t entered an email address! If you need a response from us, please click \'Cancel\' and enter an address. Otherwise click \'OK\' to send your message.');
		}
	} else {
		if(document.sug.suggestion.value.length < 10) {
			alert('Please enter your suggestion.');
			return false;
		} else {
			return check_form(document.sug)
		}
	}
}