function validate(){
	var realname=document.getElementById("rn").value
	var email=document.getElementById("addy").value
	var mesg=document.getElementById("mesg").value
	var nameIsGood = 'no';
	var emailIsGood = 'no';

	var myNameRegex = /^[a-z\s'-]*$/i;
	var matchPos1 = realname.search(myNameRegex);
	if (realname !== ''){
		if (matchPos1 !== -1) {
			document.getElementById("name-status").style.color = '#66cc66';
			nameIsGood = 'yes';
		}else{
			document.getElementById("name-status").style.color = '#ff0000';
			nameIsGood = 'no';
		}
	}else{
		document.getElementById("name-status").style.color = '#ff0000';
		nameIsGood = 'no';
	}

	var myEmailRegex = /^(?:^[A-Z0-9._%-]+@[A-Z0-9.-]+\.(?:[A-Z]{2}|com|org|net|biz|info|name|aero|gov|mobi|tv|biz|info|jobs|museum|edu)$)$/i;
	var matchPos2 = email.search(myEmailRegex);
	if (email !== ''){
		if (matchPos2 !== -1) {
			document.getElementById("email-status").style.color = '#66cc66';
			emailIsGood = 'yes';
		}else{
			document.getElementById("email-status").style.color = '#ff0000';
			emailIsGood = 'no';
		}
	}else{
		document.getElementById("email-status").style.color = '#ff0000';
		emailIsGood = 'no';
	}

	
	var myMesgRegex = /<+|>+/;
	var matchPos3 = mesg.search(myMesgRegex);
	if (mesg !== ''){
		if (matchPos3 == -1 && nameIsGood == 'yes' && emailIsGood == 'yes'){
			document.getElementById("button").disabled = '';
			document.getElementById("notags").innerHTML = '<span>&nbsp;</span>';
		}else if (matchPos3 !== -1){
			document.getElementById("button").disabled = 'disabled';
			document.getElementById("notags").innerHTML = '<span>*</span> Error: No < or > symbols allowed in message body!';
		}else{
			document.getElementById("button").disabled = 'disabled';
			document.getElementById("notags").innerHTML = '<span>*</span> Either your name or email address is not valid!';
		}
	}else{
		document.getElementById("button").disabled = 'disabled';
		document.getElementById("notags").innerHTML = '<span>*</span> All Form Fields Are Required !';
	}

}
