// showNavLinks (C) 2007 Bruce Jamieson
function showNavLinks (from) {
  var navLinks = [
      ["index", "Home"],
      ["about_laurelin", "About Laurelin"],
      ["directions", "Directions"],
      ["brunch", "Pagan Potluck Brunch"],
      ["sabbats", "Sabbats"],
      ["fullmoon", "Full Moons"],
      ["photos", "Photos"],
      ["links", "Links"],
      ["contacts", "Contacts"]
    ];

  var numLinks = navLinks.length; colNumber=0, rowNumber=0;
  var row, cell, text, rowData;
  var theTable=document.getElementById("navLinks");

  for (var i=0; i<numLinks; i++) {
    if (colNumber==0) {
      row = theTable.insertRow(rowNumber++);
    }
 
    cell = row.insertCell(colNumber); 
    cell.style.width="200px";
    rowData = navLinks[i];
    if (from == rowData[0]) {
      cell.innerHTML="<center><font color='#ffffff' size=+1> "+rowData[1]+" </font></center>";
    }
    else {
      cell.innerHTML="<center><a href='"+rowData[0]+".html'> "+rowData[1]+" </a></center>";
    }

    colNumber++;
    if (colNumber==3) colNumber=0;
  }
  theTable.style.display="block";
}
			  

// showSection (C) 2007 Bruce Jamieson
function showSection(section) {
  document.getElementById(active).style.display="none";
  document.getElementById(section).style.display="block";
  active=section; // 'active' is declared on each individual page.  It is the active id.
}

// buildIndex (C) 2007 Bruce Jamieson
function buildIndex(index, thumbs, list, orientation) {
  var text="";
  if (orientation=="vertical")
    space="<br><br>";
  else
    space="&nbsp;";

  for (var i=0; i<list.length; i++) {
    text+="<img src='" + thumbs+list[i][1] + ".bmp' title='" + photoList[i][2] +  "' onClick='pic(" + i + ");'>" + space; 
  }
  document.getElementById(index).innerHTML=text;
}

// pic (C) 2007 Bruce Jamieson
function pic(num) {
  if (cap==null) {
    cap = document.getElementById('caption');
  }
  if (box==null) {
    box = document.getElementById('imgBox');
  }
  if (box!=null) {
    box.innerHTML="<img class=" +photoList[num][0] + " src='" + photoDir+photoList[num][1] + ".jpg'>";
  }
  if (cap!=null) {
    cap.innerHTML = photoList[num][2];
  }
}



