function cmdGo(u,sel) {                 // build URL & display window
  i = -1; j = 0;
  while(i < 0) { 
    if (sel.options[j].selected) {
      i = j;
    } else {
      j++;
    };
  };
  URL = u + ".php?c=" + sel.options[j].value;
  if (URL == "") {
    alert('Please select an item');
  } else {
    newWindow = window.open(URL,"_self");
  }
  return true;
}

function selElder(elder,family,list,start,lastname) {
  i = -1; j = 0;
  while(i < 0) { 
    if (elder.options[j].selected) {
      i = j;
    } else {
      j++;
    };
  };
  if (i < 0) {
    alert('Please select an elder');
  } else {
    URL = 'draftedit.php?k=' + elder.options[j].value + '&f=' + family + '&a=d&list=' + list + '&s=' + start + '&ln=' + lastname;
    newWindow = window.open(URL,"_self");
  }
  return true;
}

function openAlbum(x) {
  x = "albumpopup.php?a=" + x + "&p=" + 1;
  newWindow = window.open(x,"popup","width=500,height=390,scrollbars,resizable");
  return true;
  }

function openNews(x) {
  x = "headline.php?e=" + x;
  newWindow = window.open(x,"_self");
  return true;
  }

function openPopup(x,y) { // x=page name, y=query string
  x = x + ".php";
  if (y) {
    x = x + "?" + y;
  }
  newWindow = window.open(x,"popup","width=600,height=400,scrollbars,resizable");
  return true;
  }

function openMessage(x,y) { // x=page name, y=query string
  x = x + ".php";
  if (y) {
    x = x + "?" + y;
  }
  newWindow = window.open(x,"popup","width=600,height=400,scrollbars,resizable");
  return true;
  }

// y=31: NIV; y=47: ESV
function openVerse(x,y) { // x=book, chapter, & verse; y=Bible version
  u =  "<a href='http://www.biblegateway.com/passage/?search=" + x;
  if (!y) { y = 31; }
  if (y) {
   u += ";&version=" + y;
  }
  u += "' target='passage'>" + x;
//  if (y) {
//   u += y;
//  }
  u += "</a>";
  document.write(u);
  return true;
  }

function openWindow(x) {
  newWindow = window.open(x,"_self");
  return true;
}


