// JavaScript Document
function checkForm(form) {

	// THIS CHECKS HTML ISN'T ENTERED INTO COMMENTS
	var tmptext = form.comments.value;
	if (tmptext.indexOf("<") >= 0) {
		alert("ERROR: you can not enter HTML code in the message.");
		return false;
 	}

	// THIS CHECKS FULL NAME ISNT EMPTY

	if (!form.fullname.value) {
		alert("Please enter your name");
		form.fullname.focus();
		return false;
	}

	// THIS CHECKS EMAIL ISNT EMPTY

	if (!form.email.value) {
		alert("Please enter your email address");
		form.email.focus();
		return false;
	}

	// THIS CHECKS IF ITS A VALID EMAIL ADDRESS

	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(form.email.value)==false){
		alert("Please enter a valid email address");
		form.email.focus();
		return false;
	}

	// THIS CHECKS PHONE ISNT EMPTY

	if (!form.phone.value) {
		alert("Please enter your phone number");
		form.phone.focus();
		return false;
	}

	// THIS CHECKS COMMENTS ISNT EMPTY

	if (!form.comments.value) {
		alert("Please enter some comments");
		form.comments.focus();
		return false;
	}

        // THIS CHECKS VALIDATION CODE ISNT EMPTY

        if (!form.number.value) {
                alert("Please enter the validation code");
                form.number.focus();
                return false;
        }

	
	return true;
}
