pic_dir="../~illusionoverflow/images/";                   // Assume that all images are stored in this directory:
pg_size=400;                                              // Size (in pixels) of a "page" in the photo album (assumes a square page)
pic_size=Math.round(pg_size*.90);                         // Maximum height and width of picture that you'll put on the page
page_style="width: "+pg_size+"px; height: "+pg_size+"px;" // This just simplifies construction of part of the style tag when display the album
spine_style="width: 36px; height: "+pg_size+"px;"         // This just simplifies construction of part of the style tag when display the album

// Object Fix 
function Fix(DatVal, PicVal, TitVal, TxtVal) { 
   this.DatVal = DatVal 
   this.PicVal = pic_dir + PicVal 
   this.TitVal = TitVal 
   this.TxtVal = TxtVal 

   var tmpImg = new Image();
   tmpImg.src = this.PicVal
   this.wVal  = tmpImg.width
   this.hVal  = tmpImg.height
   bigger=this.wVal;
   if (bigger<this.hVal) bigger=this.hVal;
   this.wVal = Math.round(this.wVal*pic_size/bigger);
   this.hVal = Math.round(this.hVal*pic_size/bigger);
}

function ShowPic(newpic) {
  current = newpic;
  SelectionBox = document.PhotoAlbum.PicList;
  SelectionBox.options[current].selected = true;
  // Display the photo on the left page
  document.getElementById("PhotoPage").innerHTML = '<img name="PicShowing" src=' + ListOfPix[current].PicVal + ' border=0 height=' + 
                                                                                   ListOfPix[current].hVal + ' width=' + ListOfPix[current].wVal +'>';

  // Build a "journal" entry for the right page
  document.getElementById("Journal").outerHTML = '<div id=journal><br>' + ListOfPix[current].DatVal + '<p style="text-align:justify; text-indent:25px">' + 
                                                                          ListOfPix[current].TxtVal + '</div>';
}

function RandomPic() {
  randompic = Math.floor(Math.random()*PicVar);
  last = current;
  ShowPic(randompic);
}

function PreviousPic() {
  last = current;
  current--;
  if(current<0) current = PicVar - 1;
  ShowPic(current);
}

function NextPic() {
  last = current;
  TotalImages = document.PhotoAlbum.PicList.options.length;
  current++;
  if (current>=PicVar) current = 0;
  ShowPic(current);
}

var months = new Array(13);
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October";
months[11] = "November";
months[12] = "December";
var dateObj = new Date(document.lastModified)
var lmonth = months[dateObj.getMonth() + 1]
var date = dateObj.getDate()
var fyear = dateObj.getYear()
