<!--
/*

 -------------------------------------------------------
 |                                                     |
 |  All Code contained herein and that contained       |
 |  in the same directory location as this file or     |
 |  script including this script are the property and  |
 |  creation of DigitallyDistinct.com. If you wish to  |
 |  use and or copy that property in part or in whole, |
 |  please request permission to do so by sending an   |
 |  e-mail request to codeuse@digitallydistinct.com.   |
 |  Wait for a confirmation reply email granting       |
 |  such permission before preceding to use and/or     |
 |  copy the above described property. 2000.           |
 |                                                     |
 -------------------------------------------------------

 DigitallyDistinct.com
 Programmer: Ben Roberts
 Date: December 27, 2001 
 Purpose: Form validation functions

*/

function validate(form_obj){
	var errors = false;
	var message = "";
		message +=  "Error Message\n";
		message += "_____________________________________________________\n\n";
		message += "Your information was not submitted because of the \n";
		message += "following errors. Please correct these errors and \n";
		message += "click the send button again. Thank you.\n\n"; 

	if (isSpace(form_obj.Name.value)){
		message += "\n - Invalid name";
		form_obj.Name.focus();
		form_obj.Name.select();
		errors=true;
	}
	else form_obj.Name.value=toProperCase(form_obj.Name.value);
		
	if (!validEmail(form_obj.Email.value)){
		message += "\n - Invalid email address";
		form_obj.Email.focus();
		form_obj.Email.select();
		errors=true;
	}
	else form_obj.Email.value=form_obj.Email.value.toLowerCase().replace(/ /g,"");
		
	if(errors){
		alert(message);
		return false;
	}
	else if(!(errors)){
		var message;
			message  = "Reply-to Email Address Confirmation\n";
			message += "_______________________________________________\n\n";
			message += "Please confirm that:\n\n";
			message +=  form_obj.Email.value + " \n\n";
			message += "is your correct email address. Please note that\n";
			message += "this email address MUST be able to receive incoming\n";
			message += "internet email or you will NOT receive a reply to\n";
			message += "your message. Enter only ONE email address.\n\n";
			message += "Thank you,\nTP's Handi-People\n\n";
			message += "_______________________________________________\n\n";
                        
		if(confirm(message)) return true;
		else return false;	
	}
}
	
//-->