// Mobile Loaves and Fishes
// Bulletin Board Messages
// 
var messages = new Array(16)
var nMessages = 0
//
function messageObject(date,title)
{
  splitDate=date.split('/')
  this.month = splitDate[0]
  this.day   = splitDate[1]
  this.year  = splitDate[2]
  this.title  = title
}
//
function isActiveToday(msgObj)
{
  now       = new Date()
  now_day   = now.getDate()
  now_month = now.getMonth()+1
  now_year  = now.getFullYear()

//alert(now_day +"/"+ msgObj.day +"/"+ now_month +"/"+ msgObj.month +"/"+ now_year +"/"+ msgObj.year)

  if (now_day == msgObj.day && now_month == msgObj.month && now_year == msgObj.year)
	return true
  return false
}

function generateBuletinButton()
{
  isButtonActive = false

  for (i=0;i<nMessages;i++)
    if (isActiveToday(messages[i]))
        isButtonActive = true

  if (isButtonActive)
    document.write("<A HREF='javascript:open_bulletin()'><IMG SRC='/images/icon_buletin_on.gif' BORDER=0></A>")

}

function open_bulletin()
{
  window.open("/bulletin_board.htm","bulletin","width=300,height=200,scrollbars=1")
}

// Repeat the following line like:
// messages[nMessages++] = new messageObject("mm/dd/yyyy","the complete message")
// 
// mm/dd/yyyy is the days when the buletin message will be activated
// nDays      how many days the message will be activated
//
messages[nMessages++] = new messageObject("12/27/2000","This message is a bulletin information that is displayed only on the 12/27/2000. It will not be available tomorrow.")

messages[nMessages++] = new messageObject("1/23/2001",'<p style="line-height: 100%" align="center"><b><u>COLD WEATHER SHELTERS</u></b></p>'+
'<p style="line-height: 100%" align="center"><b><u>FRIDAY JANUARY 19, 2001</u></b></p>'+
'<p>&nbsp;</p><p><b><u>Youth Shelter</u></b> at University Baptist Church 2130 Guadalupe Street; MUST sign up by 6 PM at Lifeworks Hot dinner &amp; Breakfast;</p>'+
'<p><b><u>Women &amp; Family Shelter </u></b> at Central Presbyterian Church 201 East 8th'+
'Street, Hot dinner &amp; Breakfast</p>'+
'<p><b><u>Adult Shelter</u></b> at First Unitarian Church 4700 Grover St. (West of Lamar) Open at 7:00 PM Hot meal &amp; Breakfast.</p>'+
'<p><b><u>TRANSPORTATION IS FREE </u></b> ON CAPITAL METRO IF YOU TELL THEM YOU ARE GOING TO A SHELTER.</p>')

//
// End of File
