﻿// Functions for displaying events in the events section

var eventsArray = new Array();

function events()
{
  this.title = '';
  this.shortDescription = '';
  this.dateShowing = '';
  this.dateOpening = '';
  this.locationAddress = '';
  this.locationMap = '';
  this.locationAddressExtra = '';
  this.webAddress = '';
  this.hours = '';
}

function listEvents(n)
{
  document.write('\n<br />');
  if (n == 0 || n > eventsArray.length)
    n = eventsArray.length;
  for (var i = 0; i < n; i++)
  {
    document.write('\n<p><strong>' + eventsArray[i].title + '</strong>');
    if( eventsArray[i].shortDescription.length > 0 )
    {
      document.write('\n<br />' + eventsArray[i].shortDescription);
    }
    if( eventsArray[i].dateShowing.length > 0 )
    {
      document.write('\n<br />' + eventsArray[i].dateShowing);
    }
    if( eventsArray[i].dateOpening.length > 0 )
    {
      document.write('\n<br />' + eventsArray[i].dateOpening);
    }
    if( eventsArray[i].hours.length > 0 )
    {
      document.write('\n<br />' + eventsArray[i].hours);
    }
    if( eventsArray[i].locationAddress.length > 0 )
    {
      document.write('\n<br />' + eventsArray[i].locationAddress);
    }
    if( eventsArray[i].locationMap.length > 0 )
    {
      document.write(' [ <a target="_blank" href="' + eventsArray[i].locationMap + '">map</a> ]');
    }
    if( eventsArray[i].locationAddressExtra.length > 0 )
    {
      document.write('\n<br />' + eventsArray[i].locationAddressExtra);
    }
    if( eventsArray[i].webAddress.length > 0 )
    {
      document.write('\n<br />[ <a target="_blank" href="' + eventsArray[i].webAddress + '">' + eventsArray[i].webAddress + '</a> ]');
    }
    document.write('</p><br />');
  }
}

