var images = new Array(12)

images[0] = new Array("snpl/2002-03-02_11-47-50-icon.jpg", "Snowy Plover",
                   "basa/2002-07-29_17-50-41-icon.jpg", "Bairds Sandpiper",
                   "leye/2003-08-18_17-51-23-icon.jpg", "Lesser Yellowlegs",
                   "rutu/2003-05-06_15-15-29-icon.jpg", "Ruddy Turnstone",
                   "busa/2003-09-05_15-03-22.jpg", "Buff-breasted Sandpiper")

images[1] = new Array("snpl/2002-03-02_11-47-50-icon.jpg", "Snowy Plover",
                   "basa/2002-07-29_17-50-41-icon.jpg", "Baird's Sandpiper",
                   "leye/2003-08-18_17-51-23-icon.jpg", "Lesser Yellowlegs",
                   "rutu/2003-05-06_15-15-29-icon.jpg", "Ruddy Turnstone",
                   "busa/2003-09-05_15-03-22.jpg", "Buff-breasted Sandpiper")

images[2] = new Array("snpl/2002-03-02_11-47-50-icon.jpg", "Snowy Plover",
                   "basa/2002-07-29_17-50-41-icon.jpg", "Baird's Sandpiper",
                   "leye/2003-08-18_17-51-23-icon.jpg", "Lesser Yellowlegs",
                   "rutu/2003-05-06_15-15-29-icon.jpg", "Ruddy Turnstone",
                   "busa/2003-09-05_15-03-22.jpg", "Buff-breasted Sandpiper")

images[3] = new Array("snpl/2002-03-02_11-47-50-icon.jpg", "Snowy Plover",
                   "basa/2002-07-29_17-50-41-icon.jpg", "Baird's Sandpiper",
                   "leye/2003-08-18_17-51-23-icon.jpg", "Lesser Yellowlegs",
                   "rutu/2003-05-06_15-15-29-icon.jpg", "Ruddy Turnstone",
                   "busa/2003-09-05_15-03-22.jpg", "Buff-breasted Sandpiper")

images[4] = new Array("snpl/2002-03-02_11-47-50-icon.jpg", "Snowy Plover",
                   "basa/2002-07-29_17-50-41-icon.jpg", "Baird's Sandpiper",
                   "leye/2003-08-18_17-51-23-icon.jpg", "Lesser Yellowlegs",
                   "rutu/2003-05-06_15-15-29-icon.jpg", "Ruddy Turnstone",
                   "busa/2003-09-05_15-03-22.jpg", "Buff-breasted Sandpiper")

images[5] = new Array("snpl/2002-03-02_11-47-50-icon.jpg", "Snowy Plover",
                   "basa/2002-07-29_17-50-41-icon.jpg", "Baird's Sandpiper",
                   "leye/2003-08-18_17-51-23-icon.jpg", "Lesser Yellowlegs",
                   "rutu/2003-05-06_15-15-29-icon.jpg", "Ruddy Turnstone",
                   "busa/2003-09-05_15-03-22.jpg", "Buff-breasted Sandpiper")

images[6] = new Array("wesa/2002-08-04_17-10-53-icon.jpg", "Western Sandpiper",
                   "lesa/2003-08-09_15-58-09-icon.jpg", "Least Sandpiper",
                   "kill/2003-07-09_07-46-36-icon.jpg", "Killdeer",
                   "leye/2003-08-12_17-25-56-icon.jpg", "Lesser Yellowlegs",
                   "spsa/2003-08-26_17-45-08.jpg", "Spotted Sandpiper")

images[7] = new Array("snpl/2002-03-02_11-47-50-icon.jpg", "Snowy Plover",
                   "basa/2002-07-29_17-50-41-icon.jpg", "Baird's Sandpiper",
                   "leye/2003-08-18_17-51-23-icon.jpg", "Lesser Yellowlegs",
                   "rutu/2003-05-06_15-15-29-icon.jpg", "Ruddy Turnstone",
                   "busa/2003-09-05_15-03-22.jpg", "Buff-breasted Sandpiper")

images[8] = new Array("snpl/2002-03-02_11-47-50-icon.jpg", "Snowy Plover",
                   "basa/2002-07-29_17-50-41-icon.jpg", "Baird's Sandpiper",
                   "leye/2003-08-18_17-51-23-icon.jpg", "Lesser Yellowlegs",
                   "rutu/2003-05-06_15-15-29-icon.jpg", "Ruddy Turnstone",
                   "busa/2003-09-05_15-03-22.jpg", "Buff-breasted Sandpiper")

images[9] = new Array("snpl/2002-03-02_11-47-50-icon.jpg", "Snowy Plover",
                   "basa/2002-07-29_17-50-41-icon.jpg", "Baird's Sandpiper",
                   "leye/2003-08-18_17-51-23-icon.jpg", "Lesser Yellowlegs",
                   "rutu/2003-05-06_15-15-29-icon.jpg", "Ruddy Turnstone",
                   "busa/2003-09-05_15-03-22.jpg", "Buff-breasted Sandpiper")

images[10] = new Array("snpl/2002-03-02_11-47-50-icon.jpg", "Snowy Plover",
                   "basa/2002-07-29_17-50-41-icon.jpg", "Baird's Sandpiper",
                   "leye/2003-08-18_17-51-23-icon.jpg", "Lesser Yellowlegs",
                   "rutu/2003-05-06_15-15-29-icon.jpg", "Ruddy Turnstone",
                   "busa/2003-09-05_15-03-22.jpg", "Buff-breasted Sandpiper")

images[11] = new Array("snpl/2002-03-02_11-47-50-icon.jpg", "Snowy Plover",
                   "basa/2002-07-29_17-50-41-icon.jpg", "Baird's Sandpiper",
                   "leye/2003-08-18_17-51-23-icon.jpg", "Lesser Yellowlegs",
                   "rutu/2003-05-06_15-15-29-icon.jpg", "Ruddy Turnstone",
                   "busa/2003-09-05_15-03-22.jpg", "Buff-breasted Sandpiper")
                   
var thisMonth = new Date().getMonth();

var months = new Array(12)

months[0] = 'January'
months[1] = 'February'
months[2] = 'March'
months[3] = 'April'
months[4] = 'May'
months[5] = 'June'
months[6] = 'July'
months[7] = 'August'
months[8] = 'September'
months[9] = 'October'
months[10] = 'November'
months[11] = 'December'

var days = new Array(32)

days[0] = '1st'
days[1] = '1st'
days[2] = '2nd'
days[3] = '3rd'
days[4] = '4th'
days[5] = '5th'
days[6] = '6th'
days[7] = '7th'
days[8] = '8th'
days[9] = '9th'
days[10] = '10th'
days[11] = '11th'
days[12] = '12th'
days[13] = '13th'
days[14] = '14th'
days[15] = '15th'
days[16] = '16th'
days[17] = '17th'
days[18] = '18th'
days[19] = '19th'
days[20] = '20th'
days[21] = '21st'
days[22] = '22nd'
days[23] = '23rd'
days[24] = '24th'
days[25] = '25th'
days[26] = '26th'
days[27] = '27th'
days[28] = '28th'
days[29] = '29th'
days[30] = '30th'
days[31] = '31st'


function formattedDate(image)
{
  var year = image.substring(0,4)
  var month = image.substring(5,7) * 1
  var day = image.substring(8,10) * 1

  return days[day]+' '+months[month]+' '+year
}

function formattedLocation(city, state, country)
{
  var result = ""

  if (city.length > 0)
  {
    result = result + city
  }
  
  if (state.length > 0)
  {
    result = result + ", " + state
  }

  if (country.length > 0)
  {
    result = result + ", " + country
  }

  return result
}

function camera(model)
{
  var str = ''

  if (model == 'E995')
  {
    str = 'Taken with Kowa TSN-4 77mm spotting scope with Nikon Coolpix 995'
  }
  if (model == 'Elan')
  {
    str = 'Taken with Canon EOS Elan II with 400mm f5.6 lens.'
  }
  return str
}

function indexPage(url, min, max)
{
  var i = url.indexOf("?")
  var page = 0

  if (i > 0)
  {
    page = url.substring(i+1, url.length)

    if (page < min) page = min
    if (page > max) page = max
  }
  return page
}

function thumbnail(imageNumber, caption, url, image, width, height, file, numRows, numColumns)
{
  w=width-10
  h=height-11

  if ((imageNumber-1) % numColumns == 0)
    document.write('<tr align="center"><td><table><tr>')

  document.write('<td><table border="0" cellpadding="0" cellspacing="0"><tr>')
  document.write('<td><a href="'+url+'"><img src="'+image+'" width="'+width+'" height="'+height+'" alt="'+caption+'" border="0"></a></td>')
  document.write('<td valign="top"><img src="/images/whitesquare.gif" width="8" height="3"><br>')
  document.write('<img src="/images/tntopright.gif" width="8" height="8"><br>')
  document.write('<img src="/images/tnright.gif" width="8" height="' + h + '"></td>')
  document.write('</tr><tr><td valign="top"><img src="/images/whitesquare.gif" width="2" height="7">')
  document.write('<img src="/images/tnbottomleft.gif" width="8" height="7">')
  document.write('<img src="/images/tnbottom.gif" width="' + w + '" height="7"></td>')
  document.write('<td valign="top"><img src="/images/tnbottomright.gif" width="8" height="7"></td></tr></table></td>')

  if ((imageNumber-1) % numColumns == (numColumns-1))
    document.write('</tr></table></td></tr>')
}


