      /***************
       * DEFINITIONS *
       ***************/

      /* display names */

      var Centuries = [
        "1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th",
        "11th", "12th", "13th", "14th", "15th", "16th", "17th", "18th", "19th", "20th",
        "21st", "22nd", "23rd", "24th", "25th", "26th", "27th", "28th", "29th", "30th",
        "31st", "32nd", "33rd", "34th", "35th", "36th", "37th", "38th", "39th", "40th",
        "41st", "42nd", "43rd", "44th", "45th", "46th", "47th", "48th", "49th", "50th",
        "51st", "52nd", "53rd", "54th", "55th", "56th", "57th", "58th", "59th", "60th",
        "61st", "62nd", "63rd", "64th", "65th", "66th", "67th", "68th", "69th", "70th",
        "71st", "72nd", "73rd", "74th", "75th", "76th", "77th", "78th", "79th", "80th",
        "81st", "82nd", "83rd", "84th", "85th", "86th", "87th", "88th", "89th", "90th",
        "91st", "92nd", "93rd", "94th", "95th", "96th", "97th", "98th", "99th", "100th"];

      var JewishMonths = [
        "Tishri", "Heshvan", "Kislev", "Tevet", "Shevat", "Adar", "Veadar",
        "Nisan", "Iyyar", "Sivan", "Tamuz", "Ab", "Elul"];

      var EnglishMonths = [
        "January", "February", "March", "April", "May", "June",
        "July", "August", "September", "October", "November", "December"];
//        "Jan", "Feb", "Mar", "Apr", "May", "Jun",
//        "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

      var DaysOfWeek =
//        ["Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri"];
        ["Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"];

      /* internal names (should really be enumeration types) */

      englishCentury = 0;
      jewishCentury = 1;

      tishri = 0;
      heshvan = 1;
      kislev = 2;
      tevet = 3;
      shevat = 4;
      adar = 5
      veadar = 6;
      nisan = 7;
      iyyar = 8;
      sivan = 9;
      tamuz = 10;
      ab = 11;
      elul = 12;

      january = 0;
      february = 1;
      march = 2;
      april = 3;
      may = 4;
      june = 5;
      july = 6;
      august = 7;
      september = 8;
      october = 9;
      november = 10;
      december = 11;

      saturday = 0;
      sunday = 1;
      monday = 2;
      tuesday = 3;
      wednesday = 4;
      thursday = 5;
      friday = 6;

      complete = -1;
      normal = 0;
      defective = 1;

      julian = 0;
      gregorian = 1;

      /*******************
       * STATE VARIABLES *
       *******************/

      var CenturyIndex;
      var CenturyTypeIndex;

      var JewishMonthIndex;
      var JewishDayIndex;
      var JewishYearIndex;
      var JewishYearKind;
      var JewishYearMoladTishri;
      var JewishDelayRule;

      var EnglishMonthIndex;
      var EnglishDayIndex;
      var EnglishYearIndex;

      var DayOfWeekIndex;
      var JewishYearKindForDisplay;

      var CalendarType = gregorian;

      /****************************
       * JEWISH UTILITY FUNCTIONS *
       ****************************/

      function JewishStartYear() {
        year = 100*(CenturyIndex);
        if (CenturyTypeIndex == englishCentury) {
          year += 3760;
        }
        return year;
      }

      function ShowCredit() {
        var location = String(document.location);
        return (location.indexOf("anotherlori") != -1) ||
               (location.indexOf("motola") != -1) ||
//               (location.indexOf("cjf.org") != -1) ||
               (location.indexOf("hopeofisrael") != -1) ||
               0;

      }

      function JewishYear(local) {
        var x = JewishStartYear() + JewishYearIndex;
        if (!local && ShowCredit()) {
          x = "<a href='http://stevemorse.org/jcal/jcal.html' target='_top'>" + x + "</a>";
//          x += "<br>Date courtesy of<br><a href='http://stevemorse.org'>http://stevemorse.org</a>";
//          x += "</td></tr><tr><td align='center'>Date courtesy of</td></tr><tr><td align='center'><a href='http://stevemorse.org'>http://stevemorse.org</a></td></tr></table>";
        }
        return x;
      }

      function DaysInJewishMonth(year, month) {
        if (month == tishri || month == shevat || month == nisan ||
            month == sivan || month == ab) {
          return 30;
        } else if (month == tevet || month == iyyar || month == tamuz || month == elul) {
          return 29;
        } else if (month == heshvan) {
          return (JewishYearKind == complete) ? 30 : 29;
        } else if (month == kislev) {
          return (JewishYearKind == defective) ? 29 : 30;
        } else if (month == adar) {
          return IsJewishLeapYear(year) ? 30 : 29;
        } else if (month == veadar) {
          return IsJewishLeapYear(year) ? 29 : 0;
        }
      }

      function IsJewishLeapYear(year) {
        var y = year%19;
        if (y == 0 || y == 3 || y == 6 || y == 8 || y == 11 || y == 14 || y == 17) {
          return true;
        } else {
          return false;
        }
      }

      function DelayDays(year, len) {
        /*
         * Determine number of days to delay a given year
         *   len: length of time since creation of this year's molad tishri
         *   year: year of interest
         */
        DelaySunWedFri = false;
        Delay18Hour = false;
        DelayCommonYear = false;
        DelayLeapYear = false;

        if ((!IsJewishLeapYear(year)) && (len.day == tuesday) && 
            ((len.hour>9) || ((len.hour == 9) && (len.halaqim>=204)))) {
          x = 1;
          DelayCommonYear = true;
          /*
           * molad tishri of following year occurs sat noon or later and will
           * be delayed to sun to avoid afternoon year starts.  This will require
           * year in question to have 356 days but the most days that a common
           * year can have is 355
           */

        } else if (IsJewishLeapYear(year-1) && (len.day==monday) && 
            ((len.hour>15) || ((len.hour==15) && (len.halaqim>=589)))) {
          x = 1;
          DelayLeapYear = true;
          /*
           * molad tishri of previous year occurs tues noon or later and was
           * delayed to wed to avoid afternoon year starts and then to thurs to
           * avoid starting year on a wed.  This will require preceding year to 
           * have 382 days but the least days that a leapyear can have is 383
           */

        } else if (len.hour>=18) {
          x = 1;
          Delay18Hour = true;
          /* avoid afternoon year starts */

        } else {
          x = 0;
        }

        if (((len.day+x)%7) == sunday || ((len.day+x)%7)== wednesday ||
            ((len.day+x)%7)==friday) {
          if (year != 2 && year != 3) { // does not apply in year 2, see faq question 109
            // but if we suspend WFS rule for year 2,
            //    year 2 would start on a Friday
            //    lastest year 2 would end is Tuesday (if it were complete)
            //    year 3 wants to start on Wed according to its molad
            //    so delaying year 3 by the WFS rule would require too many days in year 2
            //    therefore WFS must be suspended for year 3 as well

            x++;
            DelaySunWedFri = true;
            /* avoid sun, wed, and fri */
          }
        }

        separator = " ";
        JewishDelayRule = ""
        if (DelaySunWedFri) {
          JewishDelayRule += separator + "sun-wed-fri rule";
          separator = ", ";
        }
        if (Delay18Hour) {
          JewishDelayRule += separator + "18-hour rule";
          separator = ", ";
        }
        if (DelayCommonYear) {
          JewishDelayRule += separator + "common-year rule";
          separator = ", ";
        }
        if (DelayLeapYear) {
          JewishDelayRule += separator + "leap-year rule";
          separator = ", ";
        }

        return x;
      }

      /*****************************
       * ENGLISH UTILITY FUNCTIONS *
       *****************************/

      function EnglishStartYear() {
        year = 100*(CenturyIndex);
        if (CenturyTypeIndex == jewishCentury) {
          year -= 3761;
        }
        return year;
      }

      function EnglishYear() {
        return EnglishStartYear() + EnglishYearIndex;
      }

      function DaysInEnglishMonth(year, month) {
        if (month == april || month == june || month == september || month == november) {
          return 30;
        } else if (month != february) {
          return 31;
        } else if (IsEnglishLeapYear(year)) {
          return 29;
        } else {
          return 28;
        }
      }

      function IsEnglishLeapYear(year) {
        if (CalendarType == gregorian) {
          return ((year%4 == 0 && year%100 != 0) || year%400 == 0) ? true : false;
        } else {
          return (year%4 == 0) ? true : false;
        }
      }

      /********************
       * DEFINING OBJECTS *
       ********************/

      Absolute = new LengthObject(0,0,0,0,0);

      JewishOrigin = new LengthObject(204, 5, 2, 0, 0); /* jewish calendar starts here */
      OneDay = new LengthObject(0, 0, 1, 0, 0);

      JewishMonth = new LengthObject(793, 12, 1, 4, 0);
      /* JewishCommonYear = 12*JewishMonth; */
      JewishCommonYear = JewishMonth.multiply(12);
      /* JewishLeapYear = JewishCommonYear + JewishMonth; */
      JewishLeapYear = JewishCommonYear.add(JewishMonth);
      /* JewishCycle = 12*JewishCommonYear + 7*JewishLeapYear; */
      JewishCycle = JewishCommonYear.multiply(12).add(JewishLeapYear.multiply(7));
      /*Jewish15Cycle = 15*JewishCycle; */
      Jewish15Cycle = JewishCycle.multiply(15);
      /*Jewish1500Cycle = 100*Jewish15Cycle; */
      Jewish1500Cycle = Jewish15Cycle.multiply(100);
      /*Jewish150000Cycle = 100*Jewish1500Cycle; */
      Jewish150000Cycle = Jewish1500Cycle.multiply(100);

      FirstMoladTishriGregorian = new DateObject(-3760, 8, 7); /* sep 7*/
      FirstMoladTishriJulian = new DateObject(-3760, 9, 9); /* oct 9*/
      Years_240 = new LengthObject(0, 0, 4, 522, 12);

      EnglishCommonYear = new LengthObject(0, 0, 1, 52, 0);
      /* EnglishSmallCycle = OneDay + 4*EnglishCommonYear */
      EnglishSmallCycle = OneDay.add(EnglishCommonYear.multiply(4));
      /* EnglishMediumCycle = 24*EnglishSmallCycle + 4*EnglishCommonYear; */
      EnglishMediumCycleGregorian = EnglishSmallCycle.multiply(24).add(EnglishCommonYear.multiply(4));
      EnglishMediumCycleJulian = EnglishSmallCycle.multiply(25);
      /* EnglishLargeCycle = OneDay + 4*EnglishMediumCycle; */
      EnglishLargeCycleGregorian = OneDay.add(EnglishMediumCycleGregorian.multiply(4));
      EnglishLargeCycleJulian = EnglishMediumCycleJulian.multiply(4);
      /* EnglishLargerCycle = 100*EnglishLargeCycle; */
      EnglishLargerCycleGregorian = EnglishLargeCycleGregorian.multiply(100);
      EnglishLargerCycleJulian = EnglishLargeCycleJulian.multiply(100);
      /* EnglishLargestCycle = 100*EnglishLargerCycle; */
      EnglishLargestCycleGregorian = EnglishLargerCycleGregorian.multiply(100);
      EnglishLargestCycleJulian = EnglishLargerCycleJulian.multiply(100);

      function DateObject(year, month, day) {
        this.year = year;
        this.month = month;
        this.day = day;
        this.copy = DateCopy;
      }

      function DateCopy(){
        result = new DateObject(0,0,0);
        result.year = this.year;
        result.month = this.month;
        result.day = this.day;
        return result;
      }

      function LengthObject(halaqim, hour, day, week, cycle) {
        this.halaqim = halaqim;
        this.hour = hour;
        this.day = day;
        this.week = week;
        this.cycle = cycle;
        this.multiply = LengthMultiply;
        this.add = LengthAdd;
        this.subtract = LengthSubtract;
        this.copy = LengthCopy;
      }

      function LengthMultiply(multiplier) {
        result = new LengthObject (0,0,0,0,0);
        var i;
        for (i=0; i<multiplier; i++) {
          result = result.add(this);
        }
        return result;
      }

      function LengthAdd(len) {
        result = this.copy();
        result.halaqim += len.halaqim;
        result.hour += len.hour;
        result.day += len.day;
        result.week += len.week;
        result.cycle += len.cycle;
        return LengthNormalize(result);
      }

      function LengthSubtract(len) {
        result = this.copy();
        result.halaqim -= len.halaqim;
        result.hour -= len.hour;
        result.day -= len.day;
        result.week -= len.week;
        result.cycle -= len.cycle;
        return LengthNormalize(result);
      }

      function LengthCopy(){
        result = new LengthObject(0,0,0,0,0);
        result.halaqim = this.halaqim;
        result.hour = this.hour;
        result.day = this.day;
        result.week = this.week;
        result.cycle = this.cycle;
        return result;
      }

      function LengthNormalize(len){
        result = len.copy();

        while (result.halaqim >= 1080) {
          result.hour++;
          result.halaqim -= 1080;
        }
        while (result.halaqim < 0) {
          result.hour--;
          result.halaqim += 1080;
        }

        while (result.hour >= 24) {
          result.day++;
          result.hour -= 24;
        }
        while (result.hour < 0) {
          result.day--;
          result.hour += 24;
        }

        while (result.day >= 7) {
          result.week++;
          result.day -= 7;
        }
        while (result.day < 0) {
          result.week--;
          result.day += 7;
        }

        while (result.week >= 1000) {
          result.cycle++;
          result.week -= 1000;
        }
        while (result.week < 0) {
          result.cycle--;
          result.week += 1000;
        }

        return result;
      }

      /********************************
       * MAIN COMPUTATIONAL FUNCTIONS *
       ********************************/

      function JewishToAbsolute() {
        if (debugging) alert("entering JewishToAbsolute");

        /* start at year 1 */
        Absolute = JewishOrigin.copy();

        /* get to start of current year */

        y = JewishYear(true);
        while (y > (19*150000)) {
          Absolute = Absolute.add(Jewish150000Cycle);
          y -= 150000*19;
        }
        while (y > (19*1500)) {
          Absolute = Absolute.add(Jewish1500Cycle);
          y -= 1500*19;
        }
        while (y > (19*15)) {
          Absolute = Absolute.add(Jewish15Cycle);
          y -= 15*19;
        }
        while (y > 19) {
          Absolute = Absolute.add(JewishCycle);
          y -= 19;
        }
        if (y == 0) {
          /* correction for fictitious year 0 -- i.e., before creation */
          Absolute = Absolute.subtract(JewishLeapYear);
        } else {
          for (k=1; k<y; k++) {
            if (IsJewishLeapYear(k)) {
              Absolute = Absolute.add(JewishLeapYear);
            } else {
              Absolute = Absolute.add(JewishCommonYear);
            }
          }
        }

        JewishYearMoladTishri =
          DaysOfWeek[Absolute.day] + " at " + 
          Absolute.hour + " hour, " + Absolute.halaqim + " halaqim";

        /* get to start of next year */
        AbsoluteNextYear = Absolute.copy();
        if (IsJewishLeapYear(JewishYear(true))) {
          AbsoluteNextYear = AbsoluteNextYear.add(JewishLeapYear);
        } else {
          AbsoluteNextYear = AbsoluteNextYear.add(JewishCommonYear);
        }        

        /* get day on which next year starts */
        d = (AbsoluteNextYear.day + DelayDays(JewishYear(true)+1, AbsoluteNextYear))%7;

        /* get day on which this year starts */
        Absolute = Absolute.add(OneDay.multiply(DelayDays(JewishYear(true), Absolute)));

        /* in order to determine if year is defective, normal, or complete, note:
         *   common year has 353 (defective), 354 (normal), or 355 (complete) days
         *     so day of week between start of current year and start of next year
         *     differ by 3, 4, or 5 days
         *   leap year has 383 (defective), 384 (normal), or 385 (complete) days
         *     so the above difference is 5, 6, or 7 days
         */
        switch ((7+d-Absolute.day)%7) {
          case 3:
            JewishYearKind = defective;
            break;
          case 4:
          case 6:
            JewishYearKind = normal;
            break;
          case 5:
            JewishYearKind = IsJewishLeapYear(JewishYear(true)) ? defective : complete;
            break;
          case 0:
            JewishYearKind = complete;
        }

        JewishYearKindForDisplay = (JewishYearKind==defective)
                 ? "defective" : ((JewishYearKind==normal) ? "normal" : "complete");

        /*
         * now that we know the year type, we know how many days there are in each
         * month so we can add in the number of days in the current year
         */
        d = JewishDayIndex;
        for (k=0; k<JewishMonthIndex; k++) {
          d += DaysInJewishMonth(JewishYear(true), k);
        }
        Absolute = Absolute.add(OneDay.multiply(d));
        DayOfWeekIndex = Absolute.day;
        Absolute = Absolute.subtract(OneDay.multiply(JewishOrigin.day)); /* remove initial offset */

        if (debugging) alert("leaving JewishToAbsolute");
      }

      function AbsoluteToEnglish() {
        var EnglishLargestCycle = (CalendarType == gregorian) ? EnglishLargestCycleGregorian : EnglishLargestCycleJulian;
        var EnglishLargerCycle = (CalendarType == gregorian) ? EnglishLargerCycleGregorian : EnglishLargerCycleJulian;
        var EnglishLargeCycle = (CalendarType == gregorian) ? EnglishLargeCycleGregorian : EnglishLargeCycleJulian;
        var EnglishMediumCycle = (CalendarType == gregorian) ? EnglishMediumCycleGregorian : EnglishMediumCycleJulian;
        if (debugging) alert("entering AbsoluteToEnglish");
        Result = (CalendarType == gregorian) ? FirstMoladTishriGregorian.copy() : FirstMoladTishriJulian.copy();
          /* let's start here and then advance */
        Absolute = Absolute.add(Years_240); /* makes origin divisible by 400 */
        Result.year -= 240;
        do {
          Result.year += 4000000;
          Absolute = Absolute.subtract(EnglishLargestCycle);
        } while (Absolute.cycle >= 0);
        Result.year -= 4000000;
        Absolute = Absolute.add(EnglishLargestCycle);
        do {
          Result.year += 40000;
          Absolute = Absolute.subtract(EnglishLargerCycle);
        } while (Absolute.cycle >= 0);
        Result.year -= 40000;
        Absolute = Absolute.add(EnglishLargerCycle);
        do {
          Result.year += 400;
          Absolute = Absolute.subtract(EnglishLargeCycle);
        } while (Absolute.cycle >= 0);
        Result.year -= 400;
        Absolute = Absolute.add(EnglishLargeCycle);
        do {
          Result.year += 100;
          Absolute = Absolute.subtract(EnglishMediumCycle);
        } while (Absolute.cycle>=0 && Result.year%400 !=0);
        Result.year -= 100;
        Absolute = Absolute.add(EnglishMediumCycle);
        do {
          Result.year += 4;
          Absolute = Absolute.subtract(EnglishSmallCycle);
        } while (Absolute.cycle>=0 && Result.year%100 !=0);
        Result.year -= 4;
        Absolute = Absolute.add(EnglishSmallCycle);
        do {
          Result.year += 1;
          Absolute = Absolute.subtract(EnglishCommonYear);
        } while (Absolute.cycle>=0 && Result.year%4 !=0);
        Result.year -= 1;
        Absolute = Absolute.add(EnglishCommonYear);
        Result.day += Absolute.day + 7*Absolute.week;
        while (Result.day > DaysInEnglishMonth(Result.year, Result.month)) {
          Result.day -= DaysInEnglishMonth(Result.year, Result.month);
          Result.month++;
          if (Result.month>=12) {
            Result.year++;
            Result.month -= 12;
          }
        }
        EnglishYearIndex = Result.year - EnglishStartYear();

        /* make sure century start is ok
         *   note: if the century was specified as being a jewish century, an extra
         *   year was put into the english year list so this conversion can never give an
         *   out-of-bound year.  Problem arises only when an english century was specified.
         */
        if (CenturyTypeIndex == englishCentury) {
          while(EnglishYearIndex>99) {
            EnglishYearIndex -= 100;
            JewishYearIndex -= 100;
            CenturyIndex++;
          }
          while(EnglishYearIndex<0) {
            EnglishYearIndex += 100;
            JewishYearIndex += 100;
            CenturyIndex--;
          }
        }
        EnglishMonthIndex = Result.month;
        EnglishDayIndex = Result.day-1;
        if (debugging) alert("leaving AbsoluteToEnglish");
      }

    function EnglishToJewish() {

      if (debugging) alert("entering EnglishToJewish");

      var i;
      EnglishDate = new DateObject
        (EnglishYear(), EnglishMonthIndex, EnglishDayIndex);

      /* make a good first guess for a jewish date */
      if (EnglishDate.month < 8) {
        JewishYearIndex = EnglishDate.year + 3760 - JewishStartYear();
        JewishMonthIndex = EnglishDate.month + 4;
      } else {
        JewishYearIndex = EnglishDate.year + 3761 - JewishStartYear();
        JewishMonthIndex = EnglishDate.month -8;
      }
      JewishDayIndex = 0;
      if ((JewishMonthIndex >= veadar) && !IsJewishLeapYear(JewishYear(true))) {
        JewishMonthIndex++; /* skip veadar in non leap year */
      }

while (true) {

      /* test out the guess */
      JewishToAbsolute();
      AbsoluteToEnglish();

      /*
       * find the error
       * -- Note that the function DAYS_IN_JEWISH_MONTH is guarenteed to give
       * -- the correct results for month of 2 or 3 only if year is the same
       * -- as it was when JEW_ABS was last called (because that's where
       * -- JEWISH_YEAR_KIND is computed.  In the following algorithm we might
       * -- indeed change the jewish year.  However our initial guess could
       * -- never be so wrong as to be more than two months out so we would
       * -- not go above month of 1 when incrementing the year or below month
       * -- of 12 when decrementing the year.  So there is no problem because
       * -- we will never get to months 2 or 3 when the year changes.
       */

      /*
       * Second Thoughts:
       * -- Due to calendar creep, error will get very large for very large years
       * -- so the assumption that we will never get to months 2 or 3 when year
       * -- changes is incorrect.  To get around this, I added looping code that
       * -- will keep iterating until the error gets down to 0
       */

      error = EnglishDate.day - EnglishDayIndex;
      if (EnglishYear() < EnglishDate.year) {
        for (i=EnglishMonthIndex; i<12; i++) {
          error += DaysInEnglishMonth (EnglishYear(), i);
        }
        for (i=0; i < EnglishDate.month; i++) {
          error += DaysInEnglishMonth (EnglishDate.year, i);
        }
      } else if (EnglishYear() > EnglishDate.year) {
        for (i=EnglishDate.month; i < 12; i++) {
          error -= DaysInEnglishMonth (EnglishDate.year, i);
        }
        for (i=0; i < EnglishMonthIndex; i++) {
          error -= DaysInEnglishMonth (EnglishYear(), i);
        }
      } else if (EnglishMonthIndex  < EnglishDate.month) {
        for (i=EnglishMonthIndex; i<EnglishDate.month; i++) {
          error += DaysInEnglishMonth (EnglishYear(), i);
        }
      } else if (EnglishMonthIndex > EnglishDate.month) {
        for (i=EnglishDate.month; i<EnglishMonthIndex; i++) {
          error -= DaysInEnglishMonth (EnglishYear(), i);
        }
      }

      if (error == 0) {
        break;
      }


      /* correct the jewish date */
      if (error >= 0) {
        for (;;) {
          d = DaysInJewishMonth(JewishYear(true), JewishMonthIndex);
          if (error+JewishDayIndex < d) {
            break;
          }
          error -= d;
          JewishMonthIndex++;
          if ((JewishMonthIndex == veadar) && !IsJewishLeapYear(JewishYear(true))) {
            JewishMonthIndex++;
          }
          if (JewishMonthIndex > elul) {
            JewishMonthIndex = tishri;
            JewishYearIndex++;
          }
        }
        JewishDayIndex += error;
      } else {
        for (;;) {
          JewishMonthIndex--;
          if (JewishMonthIndex < 0) {
            JewishMonthIndex = elul;
            JewishYearIndex--;
          }
          if ((JewishMonthIndex == veadar) && !IsJewishLeapYear(JewishYear(true))) {
            JewishMonthIndex--;
          }
          d = DaysInJewishMonth(JewishYear(true), JewishMonthIndex);
          error += d;
          if (error+JewishDayIndex >= 0) {
            break;
          }
        }
        JewishDayIndex += error;
      }

      /* make sure century start is ok
       *   note: if the century was specified as being an english century, an extra
       *   year was put into the jewish year list so the conversion can never give an
       *   out-of-bound year.  Problem arises only when a jewish century was specified.
       */   
      if (CenturyTypeIndex == jewishCentury) {
        if (JewishYearIndex < 0) {
          JewishYearIndex += 100;
          EnglishYearIndex += 100;
          CenturyIndex--;
        } else if (JewishYearIndex > 99) {
          JewishYearIndex -= 100;
          EnglishYearIndex -= 100;
          CenturyIndex++;
        }
      }
}

      /* recalculate */
      JewishToAbsolute(); /* in order to update line of useful info about current year */
      AbsoluteToEnglish(); /* to get original value back into english date */
      if (debugging) alert("leaving EnglishToJewish");
      if (ShowCredit()) {
        document.write("<table><tr><td align='center'>");
      }
    }

