//============================================================================== // // Purpose: Root page support. // //============================================================================== /* eslint no-unused-vars: "off" */ /*global */ /*-----------------------------------------------*/ function getObj(name, alertIfNotThere_) { var rc; if (document.getElementById) { rc = document.getElementById(name); } else if (document.all) { rc = document.all[name]; } else if (document.layers) { rc = document.layers[name]; } if (alertIfNotThere_ && !rc) { alert('Object not found for id="' + name + '"'); } return rc; } /*-----------------------------------------------*/ function trim(str_) { var startPos; var endPos; if (typeof str_ !== 'string') { alert('Invalid data type passed to trim() function: ' + typeof (str_)); return str_; } if (str_.length === 0) { return str_; } for (startPos = 0; startPos < str_.length; startPos++) { if (str_.charAt(startPos) !== " " && str_.charAt(startPos) !== "\t") { break; } } for (endPos = str_.length - 1; endPos > startPos; endPos--) { if (str_.charAt(endPos) !== " " && str_.charAt(endPos) !== "\\t") { break; } } return str_.substring(startPos, endPos + 1); } function launchOther(path_) { var objOther = getObj('txtOther'), strText = objOther.value; if (!trim(strText)) { alert('Specify a DB!'); objOther.focus(); return; } window.location = path_ + '/' + strText; }