function getBICName(codelist) { //fromlist and tolist need to be arrays strBICNames = "Commerce and Business; Accounting; Commerce; Economics; Industry Work Studies; Legal Studies; Business Studies; English; Dictionaries; Drama; Language and Grammar; Media Studies; Noels and Reading; Poetry; Food Technology; Geography; Atlas; Health and PE; History; Information Technology; LOTE; Mathematics; Reference; Atlas; Dictionaries; Science; Agriculture; Biology; Chemistry; Physics; Psychology; The Arts; Art; Drama; General Issues; Music"; strBICCodes = "K; KF; KB; KC; KN; L; KM; E; GB; AT; CF; GR; F; CSC; VB; RG; RGT; VF; HB; U; CJ; PB; G; RGT; GB; PD; TV; PS; PN; PH; JC; A; AC; AT; AB; AV"; var fromlist = strBICCodes.split('; '); var tolist = strBICNames.split('; '); for (var i = 0; i < fromlist.length; i++ ) { if (0 < codelist.length < 3) { if (fromlist[i] == codelist) { return tolist[i]; } } } return codelist // end funtcion }