Contact_XML = '/lfg/uni/cus/content.xml';

var sMyStreetscapeID = "The myStreetscape ID field must be a valid number.";
var sAccountPrefix = "The first 3 characters of the account field must be alphanumeric.";
var sAccountSuffix = "The last 6 characters of the account field must be a valid number.";


function warnInvalidLFA(theField, s){   
    theField.value = "";
    theField.focus();
    alert(s);
    return false
}

function checkLFANumber(theField, s, emptyOK){   
    if (checkLFANumber.arguments.length == 2) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(theField.value))) return true;
    if (!isInteger(theField.value) || theField.value.length < 6) 
       return warnInvalidLFA (theField, s);
    else return true;
}

function checkLFAAlphanumeric(theField, s, emptyOK){   
    if (checkLFAAlphanumeric.arguments.length == 2) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(theField.value))) return true;
    if (!isAlphanumeric(theField.value)) 
       return warnInvalidLFA (theField, s);
    else return true;
}

function checkAccount(thePreField, theAcctField, notEmptyOk){   
    if (checkAccount.arguments.length == 2) notEmptyOk = true;
    if(notEmptyOk && isEmpty(thePreField.value) && isEmpty(theAcctField.value))
    	return true;
    else if(!checkLFAAlphanumeric(thePreField,sAccountPrefix) || !checkLFANumber(theAcctField,sAccountSuffix))
    	return false;
    else return true;
}