private String useElementVariables(String s) {
		if (!(model instanceof AtomicModel))
			return s;
		int lb = s.indexOf("%element[");
		int rb = s.indexOf("].", lb);
		int lb0 = -1;
		String v;
		int i;
		while (lb != -1 && rb != -1) {
			v = s.substring(lb + 9, rb);
			double x = parseMathExpression(v);
			if (Double.isNaN(x))
				break;
			i = (int) Math.round(x);
			if (i < 0 || i >= 4) {
				out(ScriptEvent.FAILED, i + " is an invalid index: must be between 0 and 3 (inclusive).");
				break;
			}
			v = escapeMetaCharacters(v);
			Element e = ((AtomicModel) model).getElement(i);
			s = replaceAll(s, "%element\\[" + v + "\\]\\.mass", e.getMass() * M_CONVERTER);
			s = replaceAll(s, "%element\\[" + v + "\\]\\.sigma", e.getSigma() * R_CONVERTER);
			s = replaceAll(s, "%element\\[" + v + "\\]\\.epsilon", e.getEpsilon());
			lb0 = lb;
			lb = s.indexOf("%element[");
			if (lb0 == lb) // infinite loop
				break;
			rb = s.indexOf("].", lb);
		}
		return s;
	}