function ExpandPicture(name) {
  window.location.assign("bigpic.html?i=" + name);
  return;

  HidePicture();

  imgnode = document.getElementById('imgpopup');
  imgnode.setAttribute("src", "images/" + name);
  imgnode.style.height = "93%";

  divnode = document.getElementById('divpopup');
  divnode.style.top = GetScrollY();
  divnode.style.height = GetWindowHeight();
  //divnode.style.width = "100%";
  window.setTimeout('divnode.style.visibility = "visible" ', 200);
}

function HidePicture() {
  divnode = document.getElementById('divpopup');
  divnode.style.visibility = "hidden";

  imgnode = document.getElementById('imgpopup');
  //imgnode.setAttribute("src", "");
}


function FillThumbnails() {
  imgnodes = document.getElementsByTagName('img');
  for (i = 0; i < imgnodes.length; i++) {
    if (imgnodes[i].getAttribute("src")) continue;
    name = imgnodes[i].getAttribute("name");
    if (!name) continue;  // <img> didn't have a name=

    imgnodes[i].setAttribute("src", "thumbnails/" + name);
    imgnodes[i].style.cursor = "hand";
    imgnodes[i].style.cursor = "pointer";

    if (!imgnodes[i].getAttribute("class")) {
      xAddEventListener(imgnodes[i], "click", new Function("ExpandPicture('" + name + "')"));
      //imgnodes[i].onclick = "ExpandPicture('" + name + "')";
      //imgnodes[i].setAttribute("onclick", "ExpandPicture('" + name + "')");
    }

    if (!imgs[name]) continue;  // img is not in imgdata.js
    imgnodes[i].setAttribute("width", imgs[name].width);
    imgnodes[i].setAttribute("height", imgs[name].height);
    imgnodes[i].setAttribute("title", imgs[name].caption);
  }
}

function PrintFooters(day) {
  Print('<br clear=all><center><table width=50% style="text-color: gray; color: gray;"><tr>');
  Print('<td width=25%>&nbsp;');
  if (day > 1) Print('<a  style="text-color: gray; color: gray;" href="day' + (day-1) + '.html">&lt; Previous Day</a>');
  Print('</td>');
  
  Print('<td width=50% align=center>');
  Print('<a href="index.html"><img border=0 src="collage28thumb.jpg"><br>');
  Print('<font style="font-family: verdana" color="gray">Front Page</font></a>');
  Print('</td>');

  Print('<td align=right width=25%>');
  if (day < 7) Print('<a style="text-color: gray; color: gray;" href="day' + (day+1) + '.html">Next Day &gt;</a>');
  Print('</td>');


  Print('</tr></table></center>');
}

function Print(str) {
  document.writeln(str);
}

function GetScrollY() {
  if (self.pageYOffset) // all except Explorer
    return self.pageYOffset;
  else if (document.documentElement && document.documentElement.scrollTop) // Explorer 6 Strict
    return document.documentElement.scrollTop;
  else if (document.body) // all other Explorers
    return document.body.scrollTop;
}

function GetWindowHeight() {
  if (self.innerHeight) // all except Explorer
    return self.innerHeight;
  else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
    return document.documentElement.clientHeight;
  else if (document.body) // other Explorers
    return document.body.clientHeight;
}

function PrintDayMenu(day) {
  Print('<center><span class="textbg">Each Day In Costa Rica was a New Adventure...</span></center>');

  Print("<table cellpadding=5 cellspacing=5 width=100%><tr style='font-weight: bold'>");
  dayimgs = [ "", "melissaeye.jpg", "agathazipdone.jpg", "jensurferboy.jpg", "jenmelumbrella1.jpg",
              "meljenvillainside.jpg", "flowerredvelvetbirds.jpg", "butterflylonelyplanet.jpg" ]
  for(d = 1; d <= 7; d++) {
    Print("<td width=13% valign=bottom align=center>");
    Print('<a href="day' + d + '.html">');
    Print('<img border=0 name="' + dayimgs[d] + '" class="daymenu"><br>');
    if (d != day) Print("<u>");
    Print("Day " + d);
    //Print("&nbsp;&nbsp;&nbsp;&nbsp;");
    if (d != day) Print("</u>");
    Print("</td>");
  }

  Print("</tr></table>");

  Print('<div id="divpopup" onclick="HidePicture()" style="margin: 0px; padding: 10px; background-color: white; border: 0px solid red; visibility: hidden; text-align: center; vertical-align: middle; width: 98%; position: absolute; left: 0px"> <img id="imgpopup" style="border: 0px solid black" /> </div>');
}

