
<!-- Copyright 2005 Bontrager Connection, LLC
//
// Two places need to be customized.
//
//
// Place 1:
// Between the quotation marks, specify the name of 
//    your form.

var FormName = "DONATE";


// Place 2:
// Between the quotation marks, specify the field names 
//    that are required. List the field name separated 
//    with a comma.

var RequiredFields = "Name,email,Phone,Mobile";


//
// No other customization of this JavaScript is required.
//
/////////////////////////////////////////////////////////

function ValidateRequiredFields()
{
	var FieldList = RequiredFields.split(",")
	var BadList = new Array();
	for(var i = 0; i < FieldList.length; i++) {
		var s = eval('document.' + FormName + '.' + FieldList[i] + '.value');
		s = StripSpacesFromEnds(s);
		if(s.length < 1) { BadList.push(FieldList[i]); }
		}
	if(BadList.length < 4) { return true; }

	if(BadList.length > 3) {  
	var message = new String('\n\nPlease enter at least one of these fields:\n');
	for(var i = 0; i < BadList.length; i++) { message += '\n' + BadList[i]; }
	alert(message);
	return false;  
	}
}

function StripSpacesFromEnds(s)
{
while((s.indexOf(' ',0) == 0) && (s.length> 1)) {
	s = s.substring(1,s.length);
	}
while((s.lastIndexOf(' ') == (s.length - 1)) && (s.length> 1)) {
	s = s.substring(0,(s.length - 1));
	}
if((s.indexOf(' ',0) == 0) && (s.length == 1)) { s = ''; }
return s;
}
// -->


