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 checkDropdown(choice, errormsg) {
    var error = "";
    if (choice == "NULL") {
       error = errormsg;
    }    
return error;
} 

function checkCheckbox(choice, errormsg) {
    var error = "";
    if (choice == false) {
       error = errormsg;
    }    
return error;
}

function checkRadio(checkvalue, errormsg) {
var error = "";
   if (!(checkvalue)) {
       error = errormsg;
    }
return error;    
}

function checkForm(theForm) {
	var why = "";
	var why_errors = "";
	why_errors += checkTextField(theForm.name.value, "- your full name\n");
	why_errors += checkEmail(theForm.epos.value, "- a valid email address\n");
	why_errors += checkTextField(theForm.message.value, "- your enquiry/message\n");

    if (why_errors != "") {
       why = "Please fill in:\n"+why_errors;
       alert(why);
       return false;
    }	
}

function checkProducts(theForm) {

	var car = document.getElementById("districts").name;
	alert(car);
	return false;
}



