var dat = new Date();
var day = dat.getDate();
var month = dat.getMonth();
var year = dat.getFullYear();
var enabled = 1;

function checkEnabled(m, y) {
  if (y != year || m != month+1)
    {enabled = 0;}
}
function dayCheck(d) {
  if (enabled && day == d)
    {document.write("<td bgcolor='#004000'>")}
  else
    {document.write("<td>")}
}
function dayCheckS(d) {
  if (enabled && day == d)
    {document.write("<td bgcolor='#500060'>")}
  else
    {document.write("<td bgcolor='#222255'>")}
}
function dayCheckH(d) {
  if (enabled && day == d)
    {document.write("<td bgcolor='#660066'>")}
  else
    {document.write("<td bgcolor='#330033'>")}
}
function read(ref) {
  var url = "http://";
  if (document.myform.cjbversion && document.myform.cjbversion.checked)
    {url = url + "bible.crosswalk.com/OnlineStudyBible/bible.cgi?new=1&section=0&version=cjb&language=en&showtools=0&word=" + ref;}
  else {
    url = url + "www.biblegateway.com/passage/index.php?x=12";
    url = url + "&version=" + document.myform.version.value;
    //alert(document.myformB.printview.checked);
    if (document.myform.printview.checked)
      {url = url + "&interface=print";}
    url = url + "&search=" + ref;
  }
  //alert(url);
  if (document.myform.openwin.checked)
    {var win = window.open(url);}
  else
    {location.href = url;}
}
// For when the CJB is like the Jewish Bibles and different from English Bibles
function readCJB(jewishCJBref,nonjewishref) {
  if (document.myform.version.value==81 || (document.myform.cjbversion && document.myform.cjbversion.checked))
    {read(jewishCJBref);}                  //show Jewish-Bible verse numbering
  else                                    // for both Hebrew and CJB
    {read(nonjewishref);}
}
// For when the CJB is different from Jewish Bibles and like the English Bibles
function readTanach(jewishref,nonjewishCJBref) {
  if (document.myform.version.value==81)   //only show Jewish-Bible verse numbering
    {read(jewishref);}                     // when viewing Hebrew
  else
    {read(nonjewishCJBref);}
}

function updateboxes() {
  if (document.myform.cjbversion.checked) {
    document.myform.printview.disabled = true;
    document.myform.version.disabled = true;
    document.all.pview.style.color="gray";
  } else {
    document.all.pview.style.color="#FFEF66";
    document.myform.printview.disabled = false;
    document.myform.version.disabled = false;
  }
}

function showCJBcheckbox() {
  document.writeln("<small><small> <input type='checkbox' name='cjbversion' value='0' onclick='updateboxes();'> Complete<br>Jewish Bible<br>version </small></small>");
}

function showcheckbox12() {
  document.writeln("<small><small><input type='checkbox' name='openwin' value='0'> Links open new window </small></small>");
  document.writeln("&nbsp;<SPAN id=pview><small><small><input type='checkbox' name='printview' value='1' checked> Printer-friendly </small></small></SPAN>");
}

function showcheckbox1() {
  document.writeln("<small><small><input type='checkbox' name='openwin' value='0'> Open links in new window </small></small>");
}

function showcheckbox2() {
  document.writeln("<SPAN id=pview><small><small><input type='checkbox' name='printview' value='1' checked> Printer-friendly </small></small></SPAN>");
}

function showlistbox() {
  document.writeln("<select name='version' style='margin-bottom: 0px; margin-top: 4px;'>");
  document.writeln("<OPTION class=lang value=28>&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577; (AR)</OPTION>");
  document.writeln("<OPTION value=28>&nbsp; &nbsp; &nbsp;Arabic Life Application Bible</OPTION>");
  document.writeln("<OPTION class=lang value=21>&#1041;&#1098;&#1083;&#1075;&#1072;&#1088;&#1089;&#1082;&#1080; (BG)</OPTION>");
  document.writeln("<OPTION value=21>&nbsp; &nbsp; &nbsp;Bulgarian Bible</OPTION>");
  document.writeln("<OPTION value=82>&nbsp; &nbsp; &nbsp;1940 Bulgarian Bible</OPTION>");
  document.writeln("<OPTION class=lang value=23>Kreyol (CPF)</OPTION>");
  document.writeln("<OPTION value=23>&nbsp; &nbsp; &nbsp;Haitian Creole Version</OPTION>");
  document.writeln("<OPTION class=lang value=29>&#268;eština (CS)</OPTION>");
  document.writeln("<OPTION value=29>&nbsp; &nbsp; &nbsp;Slovo na cestu</OPTION>");
  document.writeln("<OPTION class=lang value=11>Dansk (DA)</OPTION>");
  document.writeln("<OPTION value=11>&nbsp; &nbsp; &nbsp;Dette er Biblen pÃ¥ dansk</OPTION>");
  document.writeln("<OPTION class=lang value=54>Deutsch (DE)</OPTION>");
  document.writeln("<OPTION value=54>&nbsp; &nbsp; &nbsp;Elberfelder</OPTION>");
  document.writeln("<OPTION value=33>&nbsp; &nbsp; &nbsp;Hoffnung für Alle</OPTION>");
  document.writeln("<OPTION value=10>&nbsp; &nbsp; &nbsp;Luther Bibel 1545</OPTION>");
  document.writeln("<OPTION class=lang value=31>English (EN)</OPTION>");
  document.writeln("<OPTION value=31>&nbsp; &nbsp; &nbsp;New International Version</OPTION>");
  document.writeln("<OPTION value=49>&nbsp; &nbsp; &nbsp;New American Standard Bible</OPTION>");
  document.writeln("<OPTION value=65>&nbsp; &nbsp; &nbsp;The Message</OPTION>");
  document.writeln("<OPTION value=45>&nbsp; &nbsp; &nbsp;Amplified Bible</OPTION>");
  document.writeln("<OPTION value=51>&nbsp; &nbsp; &nbsp;New Living Translation</OPTION>");
  document.writeln("<OPTION value=9>&nbsp; &nbsp; &nbsp;King James Version</OPTION>");
  document.writeln("<OPTION value=47>&nbsp; &nbsp; &nbsp;English Standard Version</OPTION>");
  document.writeln("<OPTION value=46>&nbsp; &nbsp; &nbsp;Contemporary English Version</OPTION>");
  document.writeln("<OPTION value=50 selected>&nbsp; &nbsp; &nbsp;New King James Version</OPTION>");
  document.writeln("<OPTION value=48>&nbsp; &nbsp; &nbsp;21st Century King James Version</OPTION>");
  document.writeln("<OPTION value=8>&nbsp; &nbsp; &nbsp;American Standard Version</OPTION>");
  document.writeln("<OPTION value=15>&nbsp; &nbsp; &nbsp;Young's Literal Translation</OPTION>");
  document.writeln("<OPTION value=16>&nbsp; &nbsp; &nbsp;Darby Translation</OPTION>");
  document.writeln("<OPTION value=74>&nbsp; &nbsp; &nbsp;New Life Version</OPTION>");
  document.writeln("<OPTION value=77>&nbsp; &nbsp; &nbsp;Holman Christian Standard Bible</OPTION>");
  document.writeln("<OPTION value=76>&nbsp; &nbsp; &nbsp;New International Reader's Version</OPTION>");
  document.writeln("<OPTION value=53>&nbsp; &nbsp; &nbsp;Wycliffe New Testament</OPTION>");
  document.writeln("<OPTION value=73>&nbsp; &nbsp; &nbsp;Worldwide English (New Testament)</OPTION>");
  document.writeln("<OPTION value=64>&nbsp; &nbsp; &nbsp;New International Version - UK</OPTION>");
  document.writeln("<OPTION class=lang value=60>Español (ES)</OPTION>");
  document.writeln("<OPTION value=60>&nbsp; &nbsp; &nbsp;Reina-Valera 1960</OPTION>");
  document.writeln("<OPTION value=42>&nbsp; &nbsp; &nbsp;Nueva Versión Internacional</OPTION>");
  document.writeln("<OPTION value=61>&nbsp; &nbsp; &nbsp;Reina-Valera 1995</OPTION>");
  document.writeln("<OPTION value=41>&nbsp; &nbsp; &nbsp;Castillian</OPTION>");
  document.writeln("<OPTION value=6>&nbsp; &nbsp; &nbsp;Reina-Valera Antigua</OPTION>");
  document.writeln("<OPTION value=57>&nbsp; &nbsp; &nbsp;Biblia en Lenguaje Sencillo</OPTION>");
  document.writeln("<OPTION value=59>&nbsp; &nbsp; &nbsp;La Biblia de las Américas</OPTION>");
  document.writeln("<OPTION class=lang value=2>Français (FR)</OPTION>");
  document.writeln("<OPTION value=2>&nbsp; &nbsp; &nbsp;Louis Segond</OPTION>");
  document.writeln("<OPTION value=32>&nbsp; &nbsp; &nbsp;La Bible du Semeur</OPTION>");
  document.writeln("<OPTION class=lang value=68>&#922;&#959;&#953;&#957;&#951; (GRC)</OPTION>");
  document.writeln("<OPTION value=68>&nbsp; &nbsp; &nbsp;1881 Westcott-Hort New Testament</OPTION>");
  document.writeln("<OPTION value=69>&nbsp; &nbsp; &nbsp;1550 Stephanus New Testament</OPTION>");
  document.writeln("<OPTION value=70>&nbsp; &nbsp; &nbsp;1894 Scrivener New Testament</OPTION>");
  document.writeln("<OPTION class=lang value=81>&#1514;&#1497;&#1512;&#1489;&#1497;&#1506; (HE)</OPTION>");
  document.writeln("<OPTION value=81>&nbsp; &nbsp; &nbsp;The Westminster Leningrad Codex</OPTION>");
  document.writeln("<OPTION class=lang value=71>Ilonggo (HIL)</OPTION>");
  document.writeln("<OPTION value=71>&nbsp; &nbsp; &nbsp;Hiligaynon Bible</OPTION>");
  document.writeln("<OPTION class=lang value=62>Hrvatski (HR)</OPTION>");
  document.writeln("<OPTION value=62>&nbsp; &nbsp; &nbsp;Croatian Bible</OPTION>");
  document.writeln("<OPTION class=lang value=17>Magyar (HU)</OPTION>");
  document.writeln("<OPTION value=17>&nbsp; &nbsp; &nbsp;Hungarian KÃ¡roli</OPTION>");
  document.writeln("<OPTION class=lang value=18>Íslenska (IS)</OPTION>");
  document.writeln("<OPTION value=18>&nbsp; &nbsp; &nbsp;Icelandic Bible</OPTION>");
  document.writeln("<OPTION class=lang value=55>Italiano (IT)</OPTION>");
  document.writeln("<OPTION value=55>&nbsp; &nbsp; &nbsp;La Nuova Diodati</OPTION>");
  document.writeln("<OPTION value=34>&nbsp; &nbsp; &nbsp;La Parola è Vita</OPTION>");
  document.writeln("<OPTION class=lang value=20>&#54620;&#44397;&#50612; (KO)</OPTION>");
  document.writeln("<OPTION value=20>&nbsp; &nbsp; &nbsp;Korean Bible</OPTION>");
  document.writeln("<OPTION class=lang value=24>M&#257;ori (MI)</OPTION>");
  document.writeln("<OPTION value=24>&nbsp; &nbsp; &nbsp;Maori Bible</OPTION>");
  document.writeln("<OPTION class=lang value=56>Plautdietsch (NDS)</OPTION>");
  document.writeln("<OPTION value=56>&nbsp; &nbsp; &nbsp;Reimer 2001</OPTION>");
  document.writeln("<OPTION class=lang value=30>Nederlands (NL)</OPTION>");
  document.writeln("<OPTION value=30>&nbsp; &nbsp; &nbsp;Het Boek</OPTION>");
  document.writeln("<OPTION class=lang value=5>Norsk (NO)</OPTION>");
  document.writeln("<OPTION value=5>&nbsp; &nbsp; &nbsp;Det Norsk Bibelselskap 1930</OPTION>");
  document.writeln("<OPTION value=35>&nbsp; &nbsp; &nbsp;Levande Bibeln</OPTION>");
  document.writeln("<OPTION class=lang value=36>Português (PT)</OPTION>");
  document.writeln("<OPTION value=36>&nbsp; &nbsp; &nbsp;Nova Versão Internacional</OPTION>");
  document.writeln("<OPTION value=37>&nbsp; &nbsp; &nbsp;O Livro</OPTION>");
  document.writeln("<OPTION value=25>&nbsp; &nbsp; &nbsp;João Ferreira de Almeida Atualizada&nbsp;&nbsp;</OPTION>");
  document.writeln("<OPTION class=lang value=14>Român&#259; (RO)</OPTION>");
  document.writeln("<OPTION value=14>&nbsp; &nbsp; &nbsp;Romanian</OPTION>");
  document.writeln("<OPTION value=26>&nbsp; &nbsp; &nbsp;Romanian Cornilescu Version</OPTION>");
  document.writeln("<OPTION value=38>&nbsp; &nbsp; &nbsp;Romanian</OPTION>");
  document.writeln("<OPTION class=lang value=13>&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081; (RU)</OPTION>");
  document.writeln("<OPTION value=13>&nbsp; &nbsp; &nbsp;Russian Synodal Version</OPTION>");
  document.writeln("<OPTION value=39>&nbsp; &nbsp; &nbsp;Slovo Zhizny</OPTION>");
  document.writeln("<OPTION class=lang value=40>Sloven&#269;ina (SK)</OPTION>");
  document.writeln("<OPTION value=40>&nbsp; &nbsp; &nbsp;Nádej pre kazdého</OPTION>");
  document.writeln("<OPTION class=lang value=1>Shqip (SQ)</OPTION>");
  document.writeln("<OPTION value=1>&nbsp; &nbsp; &nbsp;Albanian Bible</OPTION>");
  document.writeln("<OPTION class=lang value=44>Svenska (SV)</OPTION>");
  document.writeln("<OPTION value=44>&nbsp; &nbsp; &nbsp;Levande Bibeln</OPTION>");
  document.writeln("<OPTION value=7>&nbsp; &nbsp; &nbsp;Svenska 1917</OPTION>");
  document.writeln("<OPTION class=lang value=75>Kiswahili (SW)</OPTION>");
  document.writeln("<OPTION value=75>&nbsp; &nbsp; &nbsp;Swahili New Testament</OPTION>");
  document.writeln("<OPTION class=lang value=43>Tagalog (TL)</OPTION>");
  document.writeln("<OPTION value=43>&nbsp; &nbsp; &nbsp;Ang Salita ng Diyos</OPTION>");
  document.writeln("<OPTION class=lang value=19>Tiêng Viêt (VI)</OPTION>");
  document.writeln("<OPTION value=19>&nbsp; &nbsp; &nbsp;1934 Vietnamese Bible</OPTION>");
  document.writeln("<OPTION class=lang value=22>&#27721;&#35821; (ZH)</OPTION>");
  document.writeln("<OPTION value=22>&nbsp; &nbsp; &nbsp;Chinese Union Version (Traditional)</OPTION>");
  document.writeln("<OPTION value=80>&nbsp; &nbsp; &nbsp;Chinese Union Version (Simplified)</OPTION>");
  document.writeln("</select>");
}
