
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('<div class="aoylinks"><a class="');
  if (page=='home')
    document.write('activepage');
  else
    document.write('regularlinks');
  document.write('" href="index.html">AOY Home</a> | <a class="');
  if (page=='about')
    document.write('activepage');
  else
    document.write('regularlinks');
  document.write('" href="aboutus.html">About Us</A> | <A CLASS="');
  if (page=='education')
    document.write('activepage');
  else
    document.write('regularlinks');
  document.write('" href="education/index.html">Education</a>, <a class="');
  if (page=='fallclasses')
    document.write('activepage');
  else
    document.write('regularlinks');
  document.write('" href="education/2010/fallclasses.html">Fall Classes</a>, <a class="');
  if (page=='winterbreakcamp')
    document.write('activepage');
  else
    document.write('regularlinks');
  document.write('" href="education/2010/wintercamp.html">Winter Break Camp</a>, <a class="');
  if (page=='winterclasses')
    document.write('activepage');
  else
    document.write('regularlinks');
  document.write('" href="education/2011/winter_workshops-and-classes.html">Winter Workshops &amp; Classes</a> | <a class="');
  if (page=='letters')
    document.write('activepage');
  else
    document.write('regularlinks');
  document.write('" href="newsletters.html">Newsletters</a> <br /> <a class="');
  if (page=='members')
    document.write('activepage');
  else
    document.write('regularlinks');
  document.write('" href="members.html">Members</a> | <a class="');
  if (page=='events')
    document.write('activepage');
  else
    document.write('regularlinks');
  document.write('" href="Events.html">Events & Exhibitions</a> | <a class="');
  if (page=='min')
    document.write('activepage');
  else
    document.write('regularlinks');
  document.write('" href="minutes.html">Meeting Minutes</a> | <a class="');
  if (page=='cont')
    document.write('activepage');
  else
    document.write('regularlinks');
  document.write('" href="contact.html">Contact Us</a></div>'
    + '<div class="copyright"><span class="text_stronger strongertext">Artists of Yardley</span> &#40;AOY&#41; &copy; 2010</div><div class="footeraddress">Come and enjoy our art classes, workshops, meetings, exhibits and social events.<br />We gather in the Janney House on Patterson Farm in Lower Makefield<br />949 Mirror Lake Road, Yardley Pa. 19067-5514</div><div class="text_smaller textsmaller margin_bottom bottommarginpara">For Web site information contact the ')
	
	var ename = "webmaster"; var domain = "artistsofyardley.org"; document.write('<a href=\"mailto:' + ename + '@' + domain + '\">'); document.write(ename + '@' + domain + '</a>');
	document.write('<br /><!--Design by Bonnie J. Batres<br />--></div><div class="text_emphasized emphasizedtext smallertext text_smaller margin_bottom marginbottompara">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(' by ' + name + '</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);
}

