// JavaScript Document

	function validateEmpty(fld) 
	{
	    var error = "";
	
	    if (fld.value.length == 0) 
		{
	        fld.style.background = 'Yellow'; 
	        error = "The " + fld.name + " field is required, and has not been filled in.\n";
	    } 
		else 
		{
	        fld.style.background = 'White';
	    }
	    return error;   
	}
	
	
	function validateform(theForm)
	{
	
		var reason = "";

	  	reason += validateEmpty(theForm.user);
	  	reason += validateEmpty(theForm.subject);
	  	reason += validateEmpty(theForm.message);
      
  		if (reason != "") 
		{
    		alert("Some fields need correction:\n" + reason);
    		return false;
		}
  }

