function checkForm(){
	var hasError = 0;
	var hasError2 = 0;
	var hasError3 = 0;
	var missingFields = "";

	highlightColor = "#DEAB71";
	defaultColor = "#ffffff";
	thisForm = document.newsletter

	var arrFields = new Array("email");
	var arrTitles = new Array("Email");

	for(i=0; i<arrFields.length; i++){
		theField = arrFields[i]
		theTitle = arrTitles[i]
		if(thisForm[theField].value == ""){
			missingFields += theTitle + "\n";
			thisForm[theField].style.background = highlightColor;
			if(hasError == 0){thisForm[theField].focus()}
			hasError = 1;
		}else{
			thisForm[theField].style.background = defaultColor;
		}
	}

	thisEmail = document.newsletter.email
	mail=thisEmail.value;
	atloc=(mail.indexOf("@"));
	if (atloc==-1) {
		thisEmail.style.background = highlightColor;
		thisEmail.focus();
		hasError = 1;
	}else if (mail.indexOf(".",atloc)==-1) {
		thisEmail.style.background = highlightColor;
		thisEmail.focus();
		hasError = 1;
	}else if (mail.indexOf(' ') > 0){
		thisEmail.style.background = highlightColor;
		thisEmail.focus();
		hasError3 = 1;
	}


	if(hasError == 1){
		alert('Please enter a valid e-mail address.')
		return false;
	}else if (hasError3 == 1){
		alert('Please ensure that your email address does not contain spaces.')
		return false;
	}else{
		return true;
	}

}
