function check(form) {
var fn = form.CONTACT_First_Name;
var fnv = form.CONTACT_First_Name.value;
fnv = fnv.replace(/\s+/g,"");  // strip all spaces;
if ((fnv.length < 3) || (/[^a-z\-\']/gi.test(fnv))) {  // only a-z hyphen and apostophe allowed in proper name
// a proper name as opposed to an initial must have at least two characters
form.CONTACT_First_Name.value= "";  // clear the invalid field
alert("Please enter your first name");
myfield = fn;  // note myfield must be a global variable
setTimeout('myfield.focus();myfield.select();' , 10);  // to overcome bug in Firefox
return false;
}

var ln = form.Last_Name;
var lnv = form.Last_Name.value;
lnv = lnv.replace(/\s+/g,"");  // strip all spaces;
if ((lnv.length < 3) || (/[^a-z\-\']/gi.test(lnv))) {  // only a-z hyphen and apostophe allowed in proper name
form.Last_Name.value= "";  // clear the invalid field
alert("Please enter your last name");
myfield = ln;  // note myfield must be a global variable
setTimeout('myfield.focus();myfield.select();' , 10);  // to overcome bug in Firefox
return false;
}

var cnp = form.Company_Name;
var cnv = form.Company_Name.value;
cnv = cnv.replace(/\s+/g,"");  // strip all spaces;
if ((cnv.length < 3) || (/[^0-9\-\']/gi.test(cnv))) {  // only a-z hyphen and apostophe allowed in proper name
form.Company_Name.value= "";  // clear the invalid field
alert("Please enter your company name");
myfield = cn;  // note myfield must be a global variable
setTimeout('myfield.focus();myfield.select();' , 10);  // to overcome bug in Firefox
return false;
}

var em = form.EmailAddress;
var emv = form.EmailAddress.value;
emv = emv.replace(/\s+/g,"");  // strip all spaces;
if ((emv.length < 3) || (/[^a-z\0-9\-\_\@\.']/gi.test(emv))) {  // only a-z hyphen and apostophe allowed in proper name
form.EmailAddress.value= "";  // clear the invalid field
alert("Please enter your email");
myfield = em;  // note myfield must be a global variable
setTimeout('myfield.focus();myfield.select();' , 10);  // to overcome bug in Firefox
return false;
}

var msf = form.Message;
var msv = form.Message.value;
msv = msv.replace(/\s+/g,"");  // strip all spaces;
if ((msv.length < 3) || (/[^0-9\-\']/gi.test(msv))) {  // only a-z hyphen and apostophe allowed in proper name
form.Message.value= "";  // clear the invalid field
alert("Please enter your message");
myfield = ms;  // note myfield must be a global variable
setTimeout('myfield.focus();myfield.select();' , 10);  // to overcome bug in Firefox
return false;
}

}
