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(theform) {
	if(theform.yourname.value=='') {
		alert('Sorry, something\'s not quite right.\n\nPlease can you enter your name.');
		theform.yourname.focus();
		theform.yourname.style.backgroundColor='yellow';
		return false;
	} else if(!check_email(theform.email.value.replace(/^\s+|\s+$/g,""))) {
		alert('Sorry, something\'s not quite right.\n\nPlease can you check that your e-mail address is right.\n\nYou might have missed a dot or an @ sign.');
		theform.email.focus();
		theform.email.style.backgroundColor='yellow';
		return false;
	} else if(theform.yourmessage.value=='') {
		alert('Sorry, something\'s not quite right.\n\nPlease enter your message for Tracey ');
		theform.yourmessage.focus();
		theform.yourmessage.style.backgroundColor='yellow';
		return false;
	} else if(theform.captchatext.value=='') {
		alert('Please answer the question');
		theform.captchatext.style.backgroundColor='yellow';
		theform.captchatext.focus();
		return false;
	} else {
		theform.doit.value='Please Wait...';
		theform.doit.disabled=true;
		return true;
	}
}