function CheckRequiredFields() {
var errormessage = new String();
// Put field checks below this point.
if(WithoutContent(document.members.corp_name.value))
	{ errormessage += "\nYou did not enter a Corporation Name."; }
if(WithoutContent(document.members.incorp_place.value))
	{ errormessage += "\nYou did not enter the Place of Incorporation."; }
if(WithoutContent(document.members.incorp_date.value))
	{ errormessage += "\nYou did not enter the Date of Incorporation."; }	
if(WithoutContent(document.members.registered_address.value))
	{ errormessage += "\nYou did not enter the Registered Address."; }
if(WithoutContent(document.members.business_description.value))
	{ errormessage += "\nYou did not enter a Brief Business Description."; }
if(WithoutContent(document.members.contact_name.value))
	{ errormessage += "\nYou did not enter the Name of a Contact Person."; }
if(WithoutContent(document.members.contact_title.value))
	{ errormessage += "\nYou did not enter the Contact Person's Title."; }	
if(WithoutContent(document.members.contact_address.value))
	{ errormessage += "\nYou did not enter the Contact Person's Address."; }
if(WithoutContent(document.members.contact_phone.value))
	{ errormessage += "\nYou did not enter the Contact Person's Phone Number."; }	
if(WithoutContent(document.members.contact_email.value))
	{ errormessage += "\nYou did not enter the Contact Person's E-Mail Address."; }	
if(WithoutCheck(document.members.declare1) || WithoutCheck(document.members.declare2) || WithoutCheck(document.members.declare3))
	{ errormessage += "\nYou must confirm that you have read and understood each of the three declarations."; }
	
if(WithoutContent(document.members.applicant_name.value))
	{ errormessage += "\nYou did not enter the Applicant Name."; }	

//Put field checks above this point.
if(errormessage.length > 2) {
	alert('NOTE:\n' + errormessage + '\n\nPlease correct these errors and try again.');
	return false;
	}
return true;
} // end of function CheckRequiredFields()

function CheckEmail(s_email)
{
	var i = s_email.indexOf(' ',0);
	while(i > -1)
	{
		s_email = s_email.substring(0,i) + 
			s_email.substring((i + 1),s_email.length);
		i = s_email.indexOf(' ',0);
	}
	if((s_email.length < 6) ||
	   (s_email.indexOf('@',0) < 1) ||
	   (s_email.lastIndexOf('@') != s_email.indexOf('@',0)) ||
	   (s_email.lastIndexOf('@') > (s_email.length - 5)) ||
	   (s_email.lastIndexOf('.') > (s_email.length - 3)) ||
	   (s_email.lastIndexOf('.') < (s_email.length - 4)) ||
	   (s_email.indexOf('..',0) > -1) ||
	   (s_email.indexOf('@.',0) > -1) ||
	   (s_email.indexOf('.@',0) > -1) ||
	   (s_email.indexOf(',',0) > -1))
	{
		return false;
	}
	return true;
}

function WithContent(ss) {
if(ss.length = 0) { return false; }
return true;
}
function WithoutContent(ss) {
if(ss.length > 0) { return false; }
return true;
}

function NoneWithContent(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].value.length > 0) { return false; }
	}
return true;
}

function NoneWithCheck(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].checked) { return false; }
	}
return true;
}

function WithoutCheck(ss) {
if(ss.checked) { return false; }
return true;
}

function WithoutSelectionValue(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].selected) {
		if(ss[i].value.length) { return false; }
		}
	}
return true;
}

