
var CurrMonth = 8;
var CurrYear = 6;

//*******************************************************
//Script from Stefan Koch - Voodoo's Intro to JavaScript
//      http://rummelplatz.uni-mannheim.de/~skoch/js/
//        JS-book: http://www.dpunkt.de/javascript
//      You can use this code if you leave this message
//*******************************************************
//ok, we have a JavaScript browser
var browserOK = false;
var pics;

//JavaScript 1.1 bowser - oh yes!
browserOK = true;
pics = new Array();

var objCount = 0; // number of (changing) images on web-page

function preload(name, first, second)
{  
  // preload images and place them in an array
  if (browserOK)
  {
    pics[objCount] = new Array(3);
    pics[objCount][0] = new Image();
    pics[objCount][0].src = first;
    pics[objCount][1] = new Image();
    pics[objCount][1].src = second;
    pics[objCount][2] = name;
    objCount++;
  }
}

function on(name)
{
  if (browserOK)
  {
    for (i = 0; i < objCount; i++)
    {
      if (document.images[pics[i][2]] != null)
      {
        if (name != pics[i][2])
          document.images[pics[i][2]].src = pics[i][0].src;
        else
          document.images[pics[i][2]].src = pics[i][1].src;
      }
    }
  }
}

function off()
{
  if (browserOK)
  {
    for (i = 0; i < objCount; i++)
    {
      if (document.images[pics[i][2]] != null) 
        document.images[pics[i][2]].src = pics[i][0].src;
    }
  }
}

//*******************************************************
// Scripts below added by Michael A. Stickles
//*******************************************************

function print_footer(page, name)
{  
  // print the footer according to page name
  document.write('<P><DIV CLASS="pfbclinks"><A CLASS="');
  if (page=='home')
    document.write('activepage');
  else
    document.write('lightlinks');
  document.write('" HREF="../index.html">PFBC HOME</A> | <A CLASS="');
  if (page=='gen')
    document.write('activepage');
  else
    document.write('lightlinks');
  document.write('" HREF="../General/general.html">General Info.</A> | <A CLASS="');
  if (page=='serv')
    document.write('activepage');
  else
    document.write('lightlinks');
  document.write('" HREF="../Services/services.html">Services</A> | <A CLASS="');
  if (page=='mini')
    document.write('activepage');
  else
    document.write('lightlinks');
  document.write('" HREF="../Ministry/ministry.html">Ministries</A> | <A CLASS="');
  if (page=='bull')
    document.write('activepage');
  else
    document.write('lightlinks');
  document.write('" HREF="../Bulletin/bulletin.html">Bulletin</A> <BR> <A CLASS="');
  if (page=='cal')
    document.write('activepage');
  else
    document.write('lightlinks');
  document.write('" HREF="../Calendar/calendar.html">Calendar</A> | <A CLASS="');
  if (page=='news')
    document.write('activepage');
  else
    document.write('lightlinks');
  document.write('" HREF="../News/news.html">Newsletter</A> | <A CLASS="');
  if (page=='othr')
    document.write('activepage');
  else
    document.write('lightlinks');
  document.write('" HREF="../OthrSite/othrsite.html">Other Sites</A> | <A CLASS="');
  if (page=='info')
    document.write('activepage');
  else
    document.write('lightlinks');
  document.write('" HREF="../SiteInfo/siteinfo.html">About This Site</A> | <A CLASS="');
  if (page=='cont')
    document.write('activepage');
  else
    document.write('lightlinks');
  document.write('" HREF="../Contacts/contacts.html">Contact Us</A></DIV><P>'
    + '<DIV CLASS="copyright"><B>Park Forest Baptist Church &copy; 2000-2004</B><BR>For Web site information contact the <A CLASS="lightlinks" HREF="mailto:webmaster@'
    + 'parkforestbaptist.org">Webmaster</A><BR>Design by <A CLASS="lightlinks" HREF="../SiteInfo/siteinfo.html">Bonnie J. Batres</A><BR></DIV><P><DIV CLASS="modification">Last updated on ');

// This script and many more are available free online at
// The JavaScript Source!! http://javascript.internet.com
// Begin
var days = new Array(8);
days[1] = "Sunday";
days[2] = "Monday";
days[3] = "Tuesday";
days[4] = "Wednesday";
days[5] = "Thursday";
days[6] = "Friday";
days[7] = "Saturday";
var months = new Array(13);
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October";
months[11] = "November";
months[12] = "December";
var dateObj = new Date(document.lastModified);
var wday = days[dateObj.getDay() + 1];
var lmonth = months[dateObj.getMonth() + 1];
var date = dateObj.getDate();
var fyear = dateObj.getYear();
if (fyear < 2000) 
fyear = fyear + 1900;
document.write(wday + ", " + lmonth + " " + date + ", " + fyear);
// End

  document.write('.<BR>By ' + name + '<BR></DIV>');
}


function print_month_index(pgname, yr, month)
{  
  var MoAbbrs = new Array(13);
  var bBegun = false
  MoAbbrs[1] = "Jan";
  MoAbbrs[2] = "Feb";
  MoAbbrs[3] = "Mar";
  MoAbbrs[4] = "Apr";
  MoAbbrs[5] = "May";
  MoAbbrs[6] = "Jun";
  MoAbbrs[7] = "Jul";
  MoAbbrs[8] = "Aug";
  MoAbbrs[9] = "Sep";
  MoAbbrs[10] = "Oct";
  MoAbbrs[11] = "Nov";
  MoAbbrs[12] = "Dec";

  CurrMoIdx = (CurrYear * 12) + CurrMonth
  if (yr > 2000)
    {
    PageMoIdx = ((yr-2000) * 12) + month;
    NextJanIdx = ((yr-2000) * 12) + 13;
    }
  else
    {
    PageMoIdx = (yr * 12) + month;
    NextJanIdx = (yr * 12) + 13;
    }

  for (MoIdx = NextJanIdx; MoIdx >= NextJanIdx - 13; MoIdx-- )
    {
    if (MoIdx <= CurrMoIdx)
      {
      if (bBegun == true)
        document.write(' | ');
      MoNum = ((MoIdx-1)%12)+1;
      YrNum = (MoIdx - MoNum) / 12;
      if ((MoIdx == NextJanIdx) || (MoIdx == (NextJanIdx - 13)))
        MoAbbr = '&#039;' + min_len_num(YrNum,2);
      else
        MoAbbr = MoAbbrs[(MoIdx - NextJanIdx + 13)];
      if (MoIdx == PageMoIdx)
        document.write('<SPAN CLASS="activepage">' + MoAbbr + '</SPAN>');
      else
        {
        if (MoIdx == CurrMoIdx)
          {
          document.write('<A HREF="' + pgname + '.html">' + MoAbbr + '</A>');
          }
        else
          {
          document.write('<A HREF="' + dated_filename(pgname, YrNum, MoNum) + '.html">' + MoAbbr + '</A>');
          }
        }
      bBegun = true;
      }
    }
}

function yr_string(yr)
{
  if (yr > 9)
    return '20' + yr;
  else
    return '200' + yr;
}

function dated_filename(pgname, yr, month)
{
  var PgStr = new String(pgname);
  return PgStr.substring(0,4) + min_len_num(yr,2) + min_len_num(month,2);
}

function min_len_num(num, minlen)
{
  var numstr = new String(num);
  var digcount = numstr.length;
  var zerostr = '';
  var currnum = num;

  while (digcount < minlen)
    {
    zerostr += '0';
    digcount++;
    }

  return (zerostr + numstr);
}

