function runScript() { toggleMsg(sysmsg[0]); var commands = []; commands.push(document.getElementById("cmds").value); statefunc = function(req) { document.getElementById("output").innerHTML = req.responseText; document.getElementsByClassName("hidden")[0].style.display = "inline"; toggleMsg(); } runCommand(commands.join("\n"), statefunc, false); }