// Form Validator With HighLight
// Written By Mike Bruneau
// www.compu-guy.com

function CheckTheForm() { 
    var result = true; 
    var msg=""; 
        
if (document.contact.Name.value=="") { 
msg+="Please Enter Your Name! \n"; 
document.contact.Name.focus(); 
document.getElementById('Name2').style.color="red"; 
document.getElementById('Name').style.backgroundColor="yellow"; 
result = false;      
	}
	else {
		document.getElementById('Name2').style.color="black";
		document.getElementById('Name').style.backgroundColor=""; 
	}
if (document.contact.Email.value=="") { 
msg+="Please Enter Your Email Address! \n"; 
document.contact.Email.focus(); 
document.getElementById('Email2').style.color="red";
document.getElementById('Email').style.backgroundColor="yellow";
result = false;
   }
   	else {
		document.getElementById('Email2').style.color="black";
		document.getElementById('Email').style.backgroundColor="";
	} 
if (document.contact.Phone.value=="") { 
msg+="Please Enter Your Phone Number! \n"; 
document.contact.Phone.focus(); 
document.getElementById('Phone2').style.color="red";
document.getElementById('Phone').style.backgroundColor="yellow";
result = false;
    } 
		else {
		document.getElementById('Phone2').style.color="black";
		document.getElementById('Phone').style.backgroundColor="";
	}
 
if (document.contact.Message.value=="") { 
msg+="Please Tell Us Why You Are Contacting Us! \n"; 
document.contact.Message.focus(); 
document.getElementById('Message2').style.color="red"; 
document.getElementById('Message').style.backgroundColor="yellow";
result = false; 
    }	
	    else {
		document.getElementById('Message2').style.color="black";
		document.getElementById('Message').style.backgroundColor="";
	}
	if (document.contact.security_code.value=="") { 
msg+="Please Enter The Security Code! \n"; 
document.contact.security_code.focus(); 
document.getElementById('security_code2').style.color="red"; 
document.getElementById('security_code').style.backgroundColor="yellow";
result = false; 
    }	
	    else {
		document.getElementById('security_code2').style.color="black";
		document.getElementById('security_code').style.backgroundColor="";
	}
	
    if(msg==""){ 
    return result; 
    }{ 
    alert(msg) 
    return result; 
    } 
} 
