public String executeMwScripts(String str) {
		str = str.trim();
		if (str.equals(""))
			return "";
		String output = "";
		synchronized (scriptLock) {
			String[] token = str.split(":");
			if (token.length >= 3) {
				// reconnect "http://......" and others that should not have been broken up
				if (token.length >= 4) {
					for (int k = 3; k < token.length; k++)
						token[2] += ":" + token[k];
				}
				String t0 = token[0].trim().intern();
				if (t0 == "jmol")
					output = sendScript(token, PageMolecularViewer.class);
				else if (t0 == "mw" || t0 == "mw2d")
					output = sendScript(token, ModelCanvas.class);
				else if (t0 == "mw3d")
					output = sendScript(token, PageMd3d.class);
				else if (t0 == "textbox")
					output = sendScript(token, PageTextBox.class);
				else if (t0 == "colorbar")
					output = sendScript(token, IconWrapper.class);
				else if (t0 == "bargraph")
					output = sendScript(token, PageBarGraph.class);
				else if (t0 == "gauge")
					output = sendScript(token, PageGauge.class);
				else if (t0 == "xygraph")
					output = sendScript(token, PageXYGraph.class);
				else if (t0 == "energylevel")
					output = sendScript(token, PageElectronicStructureViewer.class);
				else if (t0 == "spectrometer")
					output = sendScript(token, PagePhotonSpectrometer.class);
				else if (t0 == "applet")
					output = sendScript(token, PageApplet.class);
				else if (t0 == "plugin")
					output = sendScript(token, PageJContainer.class);
				else if (t0 == "page") {
					int n = 0;
					try {
						n = Integer.valueOf(token[1].trim());
					} catch (NumberFormatException nfe) {
						nfe.printStackTrace();
						n = 0;
						System.out.println(n);
					}
					if (token[2] != null && token[2].trim().length() > 0) {
						runScript(token[2].trim());
					}
				}
			}
		}
		return output;
	}