/*
   The isEmpty and isWhitespace functions were taken straight from Netscape's JavaScript development site, http://developer.netscape.com.
*/
// whitespace characters
var whitespace = " \t\n\r";

/****************************************************************/

// Check whether string s is empty.
function isEmpty(s) { 
	return ((s == null) || (s.length == 0)) 
}

/****************************************************************/

function isWhitespace (s) {
	var i;

	// Is s empty?
	if (isEmpty(s)) return true;

	// Search through string's characters one by one
	// until we find a non-whitespace character.
	// When we do, return false; if we don't, return true.

	for (i = 0; i < s.length; i++) {
		// Check that current character isn't whitespace.
		var c = s.charAt(i);
		if (whitespace.indexOf(c) == -1) return false;
	}

	// All characters are whitespace.
	return true;
}

function ValidateVolunteerData() {
		// Check to make sure that the full name field is not empty.
	if (document.forms[0].name.value == '') {
		alert("Please provide your name.");
		document.forms[0].name.focus();
		return false;
	}
		// Check to make sure that the email field is not empty.
	if (document.forms[0].email.value == '') {
		alert("Please provide your email.");
		document.forms[0].email.focus();
		return false;
	}
		// Check to make sure that the phone field is not empty.
	if (document.forms[0].phone.value == '') {
		alert("Please provide your phone.");
		document.forms[0].phone.focus();
		return false;
	}
	return true;
}

function ValidateCompanyData() {
		// Check to make sure that the full name field is not empty.
	if (document.forms[0].name.value == '') {
		alert("Please provide your name.");
		document.forms[0].name.focus();
		return false;
	}
		// Check to make sure that the email field is not empty.
	if (document.forms[0].email.value == '') {
		alert("Please provide your email.");
		document.forms[0].email.focus();
		return false;
	}
		// Check to make sure that the phone field is not empty.
	if (document.forms[0].phone.value == '') {
		alert("Please provide your phone.");
		document.forms[0].phone.focus();
		return false;
	}
		// Check to make sure that the URI field is not empty.
	if (document.forms[0].uri.value == '') {
		alert("Please provide your URI.");
		document.forms[0].uri.focus();
		return false;
	}
	return true;
}