// Form Validator With HighLight
// Written By Mike Bruneau
// www.compu-guy.com

function CheckTheForm() { 
    var result = true; 
    var msg=""; 
        
if (document.appoint.Name.value=="") { 
msg+="Please Enter Your Name! \n"; 
document.appoint.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.appoint.Email.value=="") { 
msg+="Please Enter Your Email Address! \n"; 
document.appoint.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.appoint.Phone.value=="") { 
msg+="Please Enter Your Phone Number! \n"; 
document.appoint.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.appoint.zip.value=="") { 
msg+="Please Enter Your Zip Code! \n"; 
document.appoint.zip.focus(); 
document.getElementById('zip2').style.color="red"; 
document.getElementById('zip').style.backgroundColor="yellow";
result = false; 
    }	
	    else {
		document.getElementById('zip2').style.color="black";
		document.getElementById('zip').style.backgroundColor="";
	}
	
	if (document.appoint.days.value=="") { 
msg+="Please Tell Us Why You Are Contacting Us! \n"; 
document.appoint.days.focus(); 
document.getElementById('days2').style.color="red"; 
document.getElementById('days').style.backgroundColor="yellow";
result = false; 
    }	
	    else {
		document.getElementById('days2').style.color="black";
		document.getElementById('days').style.backgroundColor="";
	}
		
	if (document.appoint.time.value=="") { 
msg+="Please Tell Us When You are Available! \n"; 
document.appoint.time.focus(); 
document.getElementById('time2').style.color="red"; 
document.getElementById('time').style.backgroundColor="yellow";
result = false; 
    }	
	    else {
		document.getElementById('time2').style.color="black";
		document.getElementById('time').style.backgroundColor="";
	}
			
	if (document.appoint.Message.value=="") { 
msg+="Please Tell Us What the problems You Are Having! \n"; 
document.appoint.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.appoint.security_code.value=="") { 
msg+="Please Enter The Security Code! \n"; 
document.appoint.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; 
    } 
} 