private String useElementVariables(String s) {
		int lb = s.indexOf("%element[");
		int rb = s.indexOf("].", lb);
		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);
			String symbol = model.getSymbol(i);
			if (symbol == null) {
				out(ScriptEvent.FAILED, i + " is an invalid element id.");
				break;
			}
			v = escapeMetaCharacters(v);
			s = s.replaceAll("(?i)%element\\[" + v + "\\]\\.mass", "" + model.getElementMass(symbol));
			s = s.replaceAll("(?i)%element\\[" + v + "\\]\\.sigma", "" + model.getElementSigma(symbol));
			s = s.replaceAll("(?i)%element\\[" + v + "\\]\\.epsilon", "" + model.getElementEpsilon(symbol));
			lb = s.indexOf("%element[");
			rb = s.indexOf("].", lb);
		}
		return s;
	}