function checkOtherField (strng, errormsg) {
	 var error = "";
	 if (strng == "") {
		error = errormsg;
	 }
	 return error;
}

function checkTextField (strng, errormsg) {
 var error = "";
 if (strng == "") {
    error = errormsg;
 }
 return error;
}

function checkEmail (strng, errormsg) {
	var error = "";
	var emailFilter=/^[\w\.\-]+@([\w\-]+\.)+[a-zA-Z]+$/;
	if (!(emailFilter.test(strng))) {
	       error = errormsg;
	}
	return error;
}
function checkPhone (strng, errormsg) {
	var error = "";
	var stripped = strng.replace(/[\(\)\.\-\ ]/g, '');
	//strip out acceptable non-numeric characters
	if (isNaN(parseInt(stripped))) {
	       error = errormsg;
	}
	return error;
}
function checkRadio (checkvalue, errormsg) {
	var error = "";
	if (checkvalue == "Short term loan") {
	  return "check8and9";
	}
	   if (!(checkvalue)) {
		   error = errormsg;
		}
	return error;
}

function checkForm(theForm) {
	var why = "";
	var why_errors = "";

	why_errors += checkTextField(theForm.firstname.value, "\n- your first name");
	why_errors += checkTextField(theForm.surname.value, "\n- your surname");
	why_errors += checkEmail(theForm.epos.value, "\n- a valid email address");

    if (why_errors != "") {
       why = "Please fill in:"+why_errors;
       alert(why);
       return false;
    }
}