<!--
var current = 0;	// current image

focus();		// grab the focus

/*
 * Insert the thunmbnails to be displayed to the incident page
 */
function insertThumbnails(path, image_count, wide) {
  var h = Math.floor(image_count) / wide;
  var percent = 100 / wide;
  
  document.write("<table border='0' cellspacing='0' cellpadding='10'>");

  for (var r = 0; r < h; r++) {
    document.write("<tr>");
    for (var c = 0; c < wide; c++) {
      var count = (r * wide) + (c + 1);
      if (count <= (h * wide)) {
        document.write("<td width='" + percent + "%' align='center'>");
        document.write("<a href=\"");

        if (parseInt(navigator.appVersion)>3) {
          if (navigator.appName.indexOf("Microsoft")!=-1) {
              document.write("#\" onClick=\"");
          }
        }

        document.write("javascript:window.open('../../display.htm?image=" + count + "&path=" + path + "&count=" + image_count + "','RecentActivities','height=560,width=665,scrollbars=1,menubar=0,locationbar=0,statusbar=0,resizable=1');void 0;");
        document.write("\">");

        if (count < 10)
		{
          document.write("<img border='0' src='./images/thumbnails/0" + count + ".jpg'></a></td>");
		}
        else
		{
          document.write("<img border='0' src='./images/thumbnails/" + count + ".jpg'></a></td>");
		}
      }
    }
    document.write("</tr>");
  }

  document.write("</table>");
}



/*
 * Set the actual image to be displayed
 */
function setImage() {
  var image = getValue("image");
  var path = getValue("path");
  document.write("<img border='0' name='incidentImage' src='./" + path + "/images/");
  if (image < 10) {
    document.write("0");
  }
  document.write(image + ".jpg' alt=\"" + image + "\">");
  current = Number(image);
  return image;
}


/*
 * set the links, previous, images, next
 */
function setLinks() {
  var path = getValue("path");
  var count = getValue("count");
  setBack();
  document.write(" ");
  for (var i = 1; i <= count; i++) {
    if (i != current)
      document.write("&nbsp;<b><a href='display.htm?image=" + i + "&path=" + path + "&count=" + count + "' style='text-decoration:none'>" + i + "</a></b>&nbsp;");
    else
      document.write("&nbsp;<font color='bbbbbb'>" + i + "</font>&nbsp;");
    if (i % 20 == 0)
      document.write("<br>");
  }
  document.write(" ");
  setForward();
}


/*
 * set the previous link
 */
function setBack() {
  var path = getValue("path");
  var count = Number(getValue("count"));
  if (current > 1) {
    var previous = current - 1;
    document.write("<b><a href='display.htm?image=" + previous + "&path=" + path + "&count=" + count + "' style='text-decoration:none'>&lt;&lt;</a></b>");
  } else {
    document.write("<font color='bbbbbb'>&lt;&lt;</font>");  
  }
}


/*
 * set the forward link
 */
function setForward() {
  var path = getValue("path");
  var count = Number(getValue("count"));
  if (current < count) {
    var next = current + 1;
    document.write("<b><a href='display.htm?image=" + next + "&path=" + path + "&count=" + count + "' style='text-decoration:none'>&gt;&gt;</a></b>");
  } else {
    document.write("<font color='bbbbbb'>&gt;&gt;</font>");  
  }
}


/*
 * get the value from the arguments of the url
 */
function getValue(key) {
  var start = document.location.href.indexOf('?');
  var args = document.location.href.substring(start+1);
  var comb = args.substring(args.indexOf(key + "="));

  var value;
  start = comb.indexOf("=") + 1;
  if (comb.indexOf("&") > 0)
    value = comb.substring(start, comb.indexOf("&"));
  else
    value = comb.substring(start);

  return value;
}


var documentWidthExtra=35;
var documentHeightExtra=60;

if (parseInt(navigator.appVersion)>3) {
  if (navigator.appName.indexOf("Microsoft")!=-1) {
    documentWidthExtra=110;
  }
}

/*
 * Check to see if needing to resize window
 */
function adjustSize() {
  var winW = 630, winH = 460;

  if (parseInt(navigator.appVersion)>3) {
    if (navigator.appName=="Netscape") {
      winW = window.innerWidth;
      winH = window.innerHeight;
    }

    if (navigator.appName.indexOf("Microsoft")!=-1) {
      winW = document.body.offsetWidth;
      winH = document.body.offsetHeight;
    }
  }

  if ((document.incidentImage.width + documentWidthExtra) != winW ||
      (document.incidentImage.height + documentHeightExtra) != winH) {

    if (parseInt(navigator.appVersion)>3) {
      winW = document.incidentImage.width + documentWidthExtra+50;
      winH = document.incidentImage.height + documentHeightExtra;

      if (navigator.appName=="Netscape") {
        window.innerWidth = winW;
        window.innerHeight = winH;
      }

      if (navigator.appName.indexOf("Microsoft")!=-1) {
        if (document.documentElement && document.documentElement.offsetWidth) {
//          if (parseInt(navigator.appVersion)>6) {
//		  } else {
//alert(document.documentElement.offsetWidth + ", " + document.documentElement.offsetHeight);
//alert(winW + ", " + winH);
            document.documentElement.clientWidth = winW;
//alert(document.documentElement.offsetWidth + ", " + document.documentElement.offsetHeight);
            document.documentElement.offsetHeight = winH;
//		  }
        } else if (document.body) {
          document.body.offsetWidth = winW;
          document.body.offsetHeight = winH;
        }
      }
    }

    var left = (screen.width - winW) / 2;
    var top = (screen.height - winH) / 3;
    self.moveTo(left, top);
  }
}
-->