﻿		
		//* BEGIN CHECKFIELDS: PREVENTS SPAM IN WEBMAIL FORMS *//
		function checkfields(){ 

		/* Getting values and making it all lower case so it cannotnget past the checking system */
		var box1=document.required.realname.value.toLowerCase();
		var box2=document.required.email.value.toLowerCase();
		var box3=document.required.message.value.toLowerCase();

		// Spam that a user might enter
		var spam1="href=";
		var spam2="http:";
		var spam3="<";
		var spam4=">";

		/* Determining if the boxes are empty or if they contain spam */

		// .indexOf() checks all of the text in a box for any matches
		if (box1.indexOf(spam1) > -1 || box1.indexOf(spam2) > -1 || box1.indexOf(spam3) > -1 || box1.indexOf(spam4) > -1 ){alert('To discourage abuse by spammers, the following characters and combinations are not allowed: "<", ">", "http:" and "href=". Please re-type your NAME and submit again. ');return false;}
		if (box2.indexOf(spam1) > -1 || box2.indexOf(spam2) > -1 || box2.indexOf(spam3) > -1 || box2.indexOf(spam4) > -1 ){alert('To discourage abuse by spammers, the following characters and combinations are not allowed: "<", ">", "http:" and "href=". Please re-type your EMAIL and submit again. ');return false;}
		if (box3.indexOf(spam1) > -1 || box3.indexOf(spam2) > -1 || box3.indexOf(spam3) > -1 || box3.indexOf(spam4) > -1 ){alert('To discourage abuse by spammers, the following characters and combinations are not allowed: "<", ">", "http:" and "href=". Please re-type your MESSAGE and submit again. ');return false;}
		}
		//* END CHECKFIELDS: PREVENTS SPAM IN WEBMAIL FORMS *//

