
function displayChangeAlert(ordinance, page) {
  var a = document.createElement("a");
  a.appendChild(document.createTextNode('Go to new ordinance.'));
  a.setAttribute("href", page);
  var s = document.createTextNode('This section has been affected by a recently passed ordinance, ' + ordinance + '. ');
  var p = document.createElement("p");
  p.style.color = "#FF0000";
  p.appendChild(s);
  p.appendChild(a);
  if (document.getElementsByTagName('p').length > 1)
    document.body.insertBefore(p, document.getElementsByTagName('p')[1]);
  else
    document.body.appendChild(p);
}

function initDisplay() {
  var s = "";
  var r = "";
  var filename = location.pathname.slice(location.pathname.length - 21, location.pathname.length - 4);
  if (parent.newOrdinance != undefined) {
    for (var i = 0; i < parent.newOrdinance.length; i++) {
      if (parent.newOrdinance[i][0] == filename)
        displayChangeAlert(parent.newOrdinance[i][1], parent.newOrdinance[i][2] + '.htm');
    }
  }

  if (filename == "00000000000000000") {
    s = String(parent.location.hash);
    if (s.length > 0) {
      r = /#/;
      s = s.replace(r, '');
      r = /%20/g;
      s = s.replace(r, ' ');
      var tmp = '\\b' + s
      r = new RegExp(tmp);
      for (var i = 0; i < parent.docList.length; i += 2) {
        if (r.test(parent.docList[i])) {
          location.href = parent.docList[i+1];
          parent.doSync = true;
        }
      }
    }
  }

  parent.highlightdoc();
  parent.delaySync();
  if (parent.printFolder)
    parent.writeToDoc();
}

function displayVersion() {
  document.write('<center><p>');
  document.write('This code was last updated by ');
  if (ordStr != '')
    document.write(ordStr + ' passed ');
  document.write(dateStr + '.');
  document.write('</p></center>');

  document.write('<p><br><br><br><br><br><br><br>');
  document.write('<b>Note: </b>');
  document.write('The document for folder entries (');
  document.write('<img border="0" src="../../images/folderopen.gif" alt="folder icon">');
  document.write(') in the table of contents (TOC) may ');
  document.write('not have any text under the heading. To view a text ');
  document.write('document (');
  document.write('<img border="0" src="../../images/doc.gif" alt="document icon">');
  document.write(') click on the folder in the TOC to reveal the documents ');
  document.write('within the folder. This process may be repeated until you ');
  document.write('locate the document you wish to view.');
  document.write('</p>');

  document.write('<p>For additional information try ');
  document.write('<a href="../../help.htm" target="_blank">Help.</a></p>');

  document.write('<p><font color="blue"><b>Disclaimer:</b><br>');
  document.write('This code is provided for informational purposes only.  The formatting of this document varies from ');
  document.write('the official hard copy of the code. In the case of any discrepancy between this version and the ');
  document.write('official hard copy, the official hard copy will prevail.  This web version of the code may not ');
  document.write('reflect all of, or the most current, legislation that has been passed.</font></p>');
}

