 function validateForm(theForm) {
 	
 	var isValid = true;
 	
 	if(!validateName(theForm.name.value))
 		isValid = false;
 	
 	if(!validateEmail(theForm.email1.value)) 
 		isValid = false;

	if(!validateSecurity(theForm.security.value)) 
 		isValid = false;
 	
 	return isValid;
 	
 }
 
 
 function validateName(value) {
 	
 	if(value == '' || typeof(value) == 'undefined') {
 		document.getElementById('contact_error').style.display = 'inline';
 		return false;
 	}else {
		document.getElementById('contact_error').style.display = 'none';
		return true;
	}
		
}


function validateEmail(value) {
 	
 	emailRX = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/;
 	
 	if (!emailRX.test(value)) {
 		document.getElementById('email_error').style.display = 'inline';
 		return false;
 	}else {
		document.getElementById('email_error').style.display = 'none';
		return true;
	}	
		
}


function validateSecurity(value) {
 	
 	
 	if (value != 4) {
 		document.getElementById('security_error').style.display = 'inline';
 		return false;
 	}else {
		document.getElementById('security_error').style.display = 'none';
		return true;
	}	
		
}