BDG Scenario 3

LocationList.js

window.onload = window_onLoad;
document.onkeypress = document_onKeyPress;

function window_onLoad() {
   var xml = '../Scripts/viewData.asp?tableName=location&fieldList=LocationId,Name&sortBy=Name';
   var id = getParam('id');
   if (id) xml = xml + '&whereID=' + id;
   xmldso.XMLDocument.ondataavailable = doLoad;
   xmldso.XMLDocument.load(xml);
}

function formatCell(row) {
   return '<SPAN STYLE="display:none">' + row.cells[0].innerText + '</SPAN>' +
          '<IMG border="0" width="24" height="24" src="../images/audit.gif" align="left" hspace="4">' +
          '<SPAN>' + row.cells[1].innerText + '</SPAN>';
}

function selectCell(elem) {
   var id = elem.firstChild.innerText;
   parent.frames("RIGHTPANE").window.load(id);
}

function search() {
   var term = frmSearch.searchTerm.value;
   if (term != "") {
      resetRows();
      var xml = '../Scripts/viewData.asp?tableName=location&fieldList=LocationId,Name&sortBy=Name&search=' + term;
      xmldso.XMLDocument.ondataavailable = noOp; // won't accept null
      xmldso.XMLDocument.onreadystatechange = dataAvailable;
      xmldso.XMLDocument.load(xml);
   }
   return false;
}

function document_onKeyPress() {
   // capture ENTER key, and call search function
   if (window.event.keyCode == 13)
      return search();
}