function adjacent(parm,chrs) {
return(parm.indexOf(chrs,0) != -1);
} 

function stripBlanks(fld) {
var result = "";
var c = 0;
for (i=0; i<fld.length; i++) {
if (fld.charAt(i) != " " || c > 0) {
result += fld.charAt(i);
if (fld.charAt(i) != " ") c = result.length;
}
}
return result.substr(0,c);
} 

function validField(fld) {
fld = stripBlanks(fld);
if (fld == '') return false; // test mandatory
if (adjacent(fld,':/') || adjacent(fld,'//') || adjacent(fld,'.h')
|| adjacent(fld,'/w') || adjacent(fld,'w.') || adjacent(fld,'p:'))
return false; // test that .@ @. and .. do not occur
//
return true;
} 
