function openPhoto(location, 
                   photoName,
                   picWidth,
                   picHeight) {
  var source = location + photoName;

  var width = 600;  //default
  var height = 400; //default

  if((picWidth!=null)&&(picHeight!=null)) {
    width = picWidth;
    height = picHeight;
  }

  var windowWidth = width + 36;
  var windowHeight = height + 70;

  var param = "width="
              + windowWidth
              + ",height="
              + windowHeight
              + ",menubar=no";
  var w = window.open("", "", param, true);
  
  w.document.writeln("<html>");
  w.document.writeln("<title>"+photoName+"</title>");
  w.document.writeln("</html>");

  w.document.write("<body bgcolor='#ffffff'>");
  w.document.writeln("<p align='center'>");
  w.document.writeln("<img src='" 
                     + source
                     + "' width='"
                     + width
                     + "' height='"
                     + height
                     + "' alt='"
                     + photoName
                     + "'>");
  w.document.writeln("</p>");
  
  w.document.writeln("<p align='right'>");
  w.document.write("<a href='javascript:void(0);' ");
  w.document.write("style='color: #326eaa; ");
  w.document.write("text-decoration: none; ");
  w.document.write("font-style: arial; ");
  w.document.write("font-size: 10pt;' ");
  w.document.write("onClick='window.close();'>");
  w.document.write("[ close this window ]");
  w.document.writeln("</a>");
  w.document.writeln("</p>");

  w.document.writeln("</body>");
  w.document.writeln("</html>");
}

function openPhotoWithCaption(location, 
                   photoName,
                   picWidth,
                   picHeight,
                   caption) {
  var source = location + photoName;

  var width = 600;  //default
  var height = 400; //default

  if((picWidth!=null)&&(picHeight!=null)) {
    width = picWidth;
    height = picHeight;
  }

  var windowWidth = width + 0;
  var windowHeight = height + 80;

  var param = "width="
              + windowWidth
              + ",height="
              + windowHeight
              + ",menubar=no";
  var w = window.open("", "", param, true);
  
  w.document.writeln("<html>");
  w.document.writeln("<title>"+photoName+"</title>");
  w.document.writeln("</html>");

  w.document.write("<body bgcolor='#ffffff' ");
  w.document.write("style='margin: 0px;'>");
  w.document.writeln("<p align='center'>");
  w.document.writeln("<img src='" 
                     + source
                     + "' width='"
                     + width
                     + "' height='"
                     + height
                     + "' alt='"
                     + photoName
                     + "'>");
  w.document.writeln("</p>");
  
  w.document.writeln("<p align='center' ");
  w.document.writeln("style='color: #405060; ");
  w.document.write("text-decoration: none; ");
  w.document.write("font-style: arial; ");
  w.document.write("font-size: 10pt;' ");
  w.document.write(">");
  w.document.write(caption);
  w.document.writeln("</p>");
  w.document.writeln("<p align='right'>");
  w.document.write("<a href='javascript:void(0);' ");
  w.document.write("style='color: #326eaa; ");
  w.document.write("text-decoration: none; ");
  w.document.write("font-style: arial; ");
  w.document.write("font-size: 10pt;' ");
  w.document.write("onClick='window.close();'>");
  w.document.write("[ close this window ]");
  w.document.writeln("</a>");
  w.document.writeln("</p>");

  w.document.writeln("</body>");
  w.document.writeln("</html>");
}

function addBodyBGImage(location, imageName) {
  var ie = "Microsoft Internet Explorer";
  var ns = "Netscape";

  var an = navigator.appName;
  var av = parseInt(navigator.appVersion);

  if(((an==ns)&&(av>=4)) || ((an==ie)&&(av>=4)))
    if(document.body) {
      document.body.background = location + imageName;
    }
}

function setStatus(string) {
  window.status=string;
  return true;
}

function setPhotoStatus() {
  return setStatus("Please click on the thumbnail to view photo");
}

function popup(filename, width, height) {
  var param = "width="
              + width
              + ",height="
              + height
              + ",menubar=no";
  var w = window.open(filename, "", param, true);
}