function $(id){ return document.getElementById(id); } function pathSplit(path){ var s = path.split("/"); if (s[0] == ""){ s.splice(0,1); } return s; } function pathJoin(path){ return path.join("/"); } function callURL(url, content, asyncReceiver = null, method = "GET"){ var r = new XMLHttpRequest(); var async = asyncReceiver != null; r.open(method,url,async); if (async) { r.onload = asyncReceiver; } r.send(content); if (!async){ return r.response; } } function callJson(method, parameters, asyncReceiver = null){ var url = "<%=request.self(0)%>_hm_json"; var reply = callURL(url, JSON.stringify( { "method": method, "parameters": parameters } ), null, "POST" ); return JSON.parse( reply ); } function loadHTML(container,source){ container.innerHTML = source; var scripts = container.getElementsByTagName("script"); for (var n=0;n" + objPath); } } function onRemoveButton(button,objPath){ var reply = objRemove( pathSplit(objPath) ); if (reply.result == true){ var path = pathSplit(objPath); path.splice(path.length-1, 1); treeRefresh("<%=request.SCRIPT_NAME%>" + pathJoin( path ) ); } else { alert("The request didn't return success.\n" + reply.exception); } }