/* * Copyright (C) 2009 Bruno Prémont * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; only version 2 of the License is applicable. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // Toggle visibility of a div function toggleDiv(divID) { var div = document.getElementById(divID); var label = document.getElementById(divID+'_sw'); var label_txt = null; if (div) { if (div.style.display == 'none') { div.style.display = 'block'; label_txt = 'Hide'; } else { div.style.display = 'none'; label_txt = 'Show'; } } if (label_txt && label) { var childCnt = label.childNodes.length; while (childCnt > 0) label.removeChild(label.childNodes[--childCnt]); label.appendChild(document.createTextNode(label_txt)); } GraphPositionToolbox(null); } var req = null; // DHTML helper code to asynchronous loading of content function loadXMLDoc(url, query) { if (window.XMLHttpRequest) { req = new XMLHttpRequest(); req.onreadystatechange = processReqChange; req.open('POST', url, true); req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); req.send(query); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); if (req) { req.onreadystatechange = processReqChange; req.open('POST', url, true); req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); req.send(query); } } } // DHTML new-content dispatcher function processReqChange(evt) { if (req.readyState == 4) { if (req.status == 200) { var response = req.responseXML.documentElement; var method = response.getElementsByTagName('method')[0].firstChild.data; var result = response.getElementsByTagName('result')[0]; req = null; eval(method + '(result)'); } } } // Update contents of a