function loadXMLFile(filePath) { if (filePath != "") { var XMLDocument = new ActiveXObject("Microsoft.XMLDOM"); XMLDocument.async = false; XMLDocument.load(filePath); this.syBuffer = XMLDocument.documentElement; this.sySubrc =(this.syBuffer != null) } else this.sySubrc = false } function findChilds (currentNode, childName) { if (currentNode != null && childName != "") { var counter = 0; var syBuffer = new Array(); for (var currentChild = currentNode.firstChild; currentChild != null; currentChild = currentChild.nextSibling) { if (currentChild.nodeName == childName) { syBuffer[counter] = currentChild; counter += 1 } } this.sySubrc = (counter != 0); this.syBuffer = syBuffer } else this.sySubrc = false } function findAttribute (currentNode, attributeName) { if (currentNode != null && attributeName != "") { this.syBuffer = currentNode.getAttribute(attributeName); this.sySubrc = (this.syBuffer != null) } else this.sySubrc = false } function search (codex) { var DB = new loadXMLFile("DB.xml"); if (DB.sySubrc) { var target = new findChilds(DB.syBuffer, codex); if (target.sySubrc) { var ind = new findAttribute(target.syBuffer[0],"ind"); if (ind.sySubrc) { self.location = ind.syBuffer } } } }