//	trim functions:
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}


function validate_contacting()
{
	var cError_string = "";

	if( trim( document.contacting.from.value) == "")
		cError_string += "- your NAME.\n";

	var str_email = trim( document.contacting.from_email.value);
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	if( reg.test( str_email) == false)
		cError_string += "- a valid E-MAIL address.\n";

	if( trim( document.contacting.msg.value) == "")
		cError_string += "- your MESSAGE.\n";

	if( cError_string == "") return true;
	else
	{
		cError_string = "The following errors or omissions of required input were found:\n\n" + cError_string;
		cError_string = cError_string + "\nPlease make the necessary correction(s) in order to submit your details.";
		alert( cError_string);
		return false;
	}
}

