// Function: Check if all required fields have been filled in
function checkForm (form)
{
	// Status variables
	var statusName;
	var statusEmail;
	var statusText;
	var statusCaptcha;

	// Check if the name has been filled in correctly
	if (form.sName.value == "") {
		// Make the border of the input field red
		form.sName.style.border="2px solid red";
		statusName = "false";
	} else {
		// Make the border of the input field green
		form.sName.style.border="2px solid green";
		statusName = "true";
	}
  
	// Check if the e-mail has been filled in correctly
	if (form.sEmail.value == "") {
		// Make the border of the input field red
		form.sEmail.style.border="2px solid red";
		statusEmail = "false";
	} else {
		// Make the border of the input field green
		form.sEmail.style.border="2px solid green";
		statusEmail = "true";
	}
	
	// Check if the text has been filled in correctly
	if (form.sText.value == "") {
		// Make the border of the text area red
		form.sText.style.border="2px solid red";
		statusText = "false";
	} else {
		// Make the border of the text area green
		form.sText.style.border="2px solid green";
		statusText = "true";
	}
	
	// Check if the captcha has been filled in correctly
	if (form.sCaptcha.value == "") {
		// Make the border of the input field red
		form.sCaptcha.style.border="2px solid red";
		statusCaptcha = "false";
	} else {
		// Make the border of the input field green
		form.sCaptcha.style.border="2px solid green";
		statusCaptcha = "true";
	}

	// All required fields have been filled in: Run the form processing script
	if (statusName == "true" && statusEmail == "true" && statusText == "true" && statusCaptcha == "true") {
		// Execute the form
		return true;
	} else {
		// Stop the form
		return false;
	}
}
