// Process links with @type = 'popup'.
// Cause them to raise a popup instead.
// NOTE: Not currently used.
function setupPopups() {
  var links = document.getElementsByTagName('a');
  for (var i = 0; i < links.length; i++) {
    if (links[i].getAttribute('type') == 'popup') {
      var href = links[i].href;
      links[i].onclick = function() {
        this.temp = this.href;
        this.href = "javascript:void(0)";
        popup(this.temp);
        this.href = this.temp;
      }
      links[i].title += '(Popup)';
    }
  }
}

// Popup a window.
function popup(href) {
  //console.log(href);
  var title = "";
  var style = 
    "width = 600," + 
    "height = 700," + 
    "scrollbars = yes," +
    "resizeable = true";
  window.open(href, title, style);
}