// JavaScript Document

function validate( )
{
    var valid = true;
	
	/*var x=document.contact_form;
	
	var str="Please fill in the ";
    if ( x.name.value == "" )
    {
         alert ("Please fill in the 'Name' box." );
         valid = false;
		 return valid;
    }
	
	if ( x.email.value == "" )
    {
        alert ("Please fill in the 'Email' box." );
        valid = false;
		return valid;
    }
	
	if ( x.phone.value == "" )
    {
        alert ("Please fill in the 'Phone' box." );
        valid = false;
		 return valid;
    }

    x.focus(); */
	
	var x=document.contact_form;
	var str="Please fill in the ";
	var str1="";
	
	 if ( x.name.value == "" )
     {
		 str1=" Name";
         valid = false;
		 x.name.style.borderColor="red";
     }
	
	 if ( x.email.value == "" )
     {
        if(str1=="")
		  str1=" Email";
		 else 
		   str1=str1+", Email";
        valid = false;
		x.email.style.borderColor="red";
     }
	
	 if ( x.phone.value == "" )
     {
         if(str1=="")
		  str1=" Phone";
		 else 
		   str1=str1+", Phone Number";
        valid = false;
		x.phone.style.borderColor="red";
     }
	
	if(valid==false){
	   alert(str+str1);
	}

    x.focus();

    return valid;
}