<!--
/*
 -------------------------------------------------------------------------------
|  Copyright (C) 2004 Azalea Technology, LLC. All rights reserved.              |
|-------------------------------------------------------------------------------|
|  Unauthorized removal of this notice is considered a violation of the         |
|  license agreement under which this Code may be used. This work is protected  |
|  under United States copyright law and the similiar law(s) of other countries |
|  under which such as work is afforded legal protection, and upon conviction   |
|  of such a violation in a court of applicable jurisdiction, such person(s)    |
|  may be subject to the maximum allowable penalty as permitted under such law. |
|-------------------------------------------------------------------------------|
|  You acknowledge and agree that information presented to you in this file     |
|  is protected by all applicable copyrights, trademarks, service marks,        |
|  patents or other proprietary rights and laws, and by virute of accessing the |
|  the file, except as expressly authorized by Azalea Technology, LLC., you     |
|  agree not to modify, rent, lease, loan, sell, distribute, store, or create   |
|  derivative works based on the file, in whole or in part.                     |
 -------------------------------------------------------------------------------

 Organization: Sunrise Decks & RV Products
       Domain: www.sunriservproducts.com
         Date: Tuesday, May 18, 2004
      Purpose: Form Validation
   Programmer: B. Roberts
               Azalea Technology, LLC.
			   P.O. Box 131150
			   Tyler, TX 75713-1150
               (903) 581-4448
               broberts@azaleatech.com
			   http://www.azaleatech.com
*/


function validate(form_obj){
	var errors = false;
	var errorcnt = 0;
	var message  = "Error Message\n";
		message += "_______________________________________________\n\n";
		message += "Your information was not submitted because\n";
		message += "of the following errors. Please correct these\n";
		message += "errors and click the \"Submit\" button again.\n\n";

	// Set the status of client-side javascript to "enabled" so that server-side formmail program will accept submission
	// Using this technique eliminates 99.9% of all Web form spam by forcing client-side javascript validation to take place
	if(form_obj._config_javascript_status){
		form_obj._config_javascript_status.value = "enabled";
	}

	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){
		// Set the status of client-side javascript to "disabled"  because there was an error in the form
		// Using this technique eliminates 99.9% of all Web form spam by forcing client-side javascript validation to take place
		if(form_obj._config_javascript_status) form_obj._config_javascript_status.value = "disabled";

		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,\nSunrise Decks & RV Products Support Team\n\n";
			message += "_______________________________________________\n\n";
                        
		if(confirm(message)) return true;
		else return false;	
	}
}
	
//-->