var meetingMonth;
var suffix;

var month = new NameArray(12);
month[1] = "January";
month[2] = "February";
month[3] = "March";
month[4] = "April";
month[5] = "May";
month[6] = "June";
month[7] = "July";
month[8] = "August";
month[9] = "September";
month[10] = "October";
month[11] = "November";
month[12] = "December";

var weekDay = new NameArray(7);
weekDay[1] = "Sunday;"
weekDay[2] = "Monday";
weekDay[3] = "Tuesday";
weekDay[4] = "Wednesday";
weekDay[5] = "Thursday";
weekDay[6] = "Friday";
weekDay[7] = "Saturday";

var locations=new NameArray(12);
locations[1] = '<a href="http://www.mountainhomebrew.com/" target="_top"><b>Mountain Homebrew</a></p>';
locations[2] = '<a href="http://www.mountainhomebrew.com/" target="_top"><b>Mountain Homebrew</a></p>';
locations[3] = '<a href="http://www.mountainhomebrew.com/" target="_top"><b>Mountain Homebrew</a></p>';
locations[4] = '<a href="http://maps.google.com/maps?hl=en&um=1&ie=UTF-8&q=12520+101st+way+ne+apt.1+Kirkland,WA+98034&fb=1&split=1&gl=us&cid=0,0,8302469399893117231&ei=a4_OSYmVBZK6tQPtyLCgAw&sa=X&oi=local_result&resnum=1&ct=image" target="_top"><b>The Klinck Residence</a></p>';
locations[5] = '<a href="http://www.mountainhomebrew.com/" target="_top"><b>Mountain Homebrew</a></p>';
locations[6] = '<a href="http://maps.google.com/maps?hl=en&um=1&ie=UTF-8&q=black+raven+brewing&near=Bothell,+WA&fb=1&split=1&gl=us&cid=0,0,6107502298109456769&ei=ruwhSoDiG4S8tAOFxJ3zAw&sa=X&oi=local_result&ct=image&resnum=2" target="_top"><b>Black Raven Brewing Co.</a></p>';
locations[7] = '<a href="http://www.mountainhomebrew.com/" target="_top"><b>Mountain Homebrew</a></p>';
locations[8] = '<a href="http://www.mountainhomebrew.com/" target="_top"><b>Mountain Homebrew</a></p>';
locations[9] = '<a href="http://www.mountainhomebrew.com/" target="_top"><b>Mountain Homebrew</a></p>';
locations[10] = '<a href="http://www.mountainhomebrew.com/" target="_top"><b>Mountain Homebrew</a></p>';
locations[11] = '<a href="http://www.mountainhomebrew.com/" target="_top"><b>Mountain Homebrew</a></p>';
locations[12] = '<a href="http://www.mountainhomebrew.com/" target="_top"><b>Mountain Homebrew</a></p>';

var firstTuesday=new NumberArray(12);
firstTuesday[1] = "8";
firstTuesday[2] = "3";
firstTuesday[3] = "3";
firstTuesday[4] = "7";
firstTuesday[5] = "5";
firstTuesday[6] = "2";
firstTuesday[7] = "1";
firstTuesday[8] = "7";
firstTuesday[9] = "1";
firstTuesday[10] = "6";
firstTuesday[11] = "3";
firstTuesday[12] = "1";

function NameArray(item)
{
  this.length = item;
  return this;
}

function NumberArray(item)
{
  this.length = item;
  return this;
}

function LongDate(currentDate)
{
  var currentweekDay = weekDay[currentDate.getDay() + 1];
  var currentMonth = month[currentDate.getMonth() + 1];
  var currentYear = currentDate.getFullYear();
  return currentweekDay + "<br>" + currentMonth + " " + currentDate.getDate() + ", " + currentYear;
}

function SetupMeetingDate()
{
  var today=new Date();
  var thisMonth=today.getMonth() + 1;

  if (today.getDate() + 1 > firstTuesday[thisMonth] )
  {
    meetingMonth = thisMonth + 1;
  }
  else
  {
    meetingMonth = thisMonth;
  }
  if (meetingMonth > 12 )
  {
    meetingMonth = meetingMonth - 12;
  }



  suffix = "th";
  switch (firstTuesday[meetingMonth])
  {
  case "1":
    suffix = "st"
    break
  case "2":
    suffix = "nd"
    break
  case "3":
    suffix = "rd"
    break
  }
}