function fnCheckField() {
var errMssg = new String();
var theForm = document.appFrm;
var nameValue = theForm.appName.value;
var add1Value = theForm.appAdd1.value;
var add3Value = theForm.appAdd3.value;
var add4Value = theForm.appAdd4.value;
var phoneValue = theForm.appPhone.value.replace(/ /g, "");;
var emailValue = theForm.appEmail.value;

if(fnWithoutContent(emailValue)) {
errMssg = "Please enter your Email Address.";
fnToggleStars('f6');
theForm.appEmail.focus();
}
if (phoneValue.length < 11 || !fnIsNumeric(phoneValue)) {
errMssg = "Please check your Phone Number. It appears incorrect.";
fnToggleStars('f5');
theForm.appPhone.focus();
}
if(fnWithoutContent(phoneValue)) {
errMssg = "Please enter your Phone Number.";
fnToggleStars('f5');
theForm.appPhone.focus();
}
if(fnWithoutContent(add4Value)) {
errMssg = "Please enter your Post Code.";
fnToggleStars('f4');
theForm.appAdd4.focus();
}
if(fnWithoutContent(add3Value)) {
errMssg = "Please enter your Town / City.";
fnToggleStars('f3');
theForm.appAdd3.focus();
}
if(fnWithoutContent(add1Value)) {
errMssg = "Please enter the first line of your address.";
fnToggleStars('f2');
theForm.appAdd1.focus();
}
if(fnWithoutContent(nameValue)) {
errMssg = "Please enter your name.";
fnToggleStars('f1');
theForm.appName.focus();
}

if(errMssg.length > 2) {
document.getElementById('showInfo').innerHTML = errMssg;
return false;
}
document.getElementById('showInfo').innerHTML = "&nbsp;";
return true;
}

function fnWithoutContent(ss) {
if(ss.length > 0) { return false; }
return true;
}

function fnIsNumeric(sText) {
var ValidChars = "0123456789.";
var IsNumber=true;
var Char;
for (i = 0; i < sText.length && IsNumber == true; i++) 
{ 
Char = sText.charAt(i); 
if (ValidChars.indexOf(Char) == -1) 
{ IsNumber = false; }
}
return IsNumber;
}

function fnToggleStars(obj) {
var el = document.getElementById(obj);
el.style.color = "#D41366";
var elArr = new Array("f1","f2","f3","f4","f5","f6")
var x
for (x in elArr)
{
var el = elArr[x];
if ( el != obj ) {
document.getElementById(elArr[x]).style.color = "#333333";
}
}
}
