// ###############################################################################
// #
// #      PopZoom v1.0
// #      by Richard L. Trethewey
// #      rick@rainbo.net
// #      http://www.rainbo.net/pub/index.html
// #      Installation Instructions and Documentation
// #
// ###############################################################################

// Copyright (C) January 13, 2003 by Richard L. Trethewey.  All rights reserved.

// NOTICE: This software is published without warranty of any kind.  By
// using the software you agree to assume all risks and to hold Richard L.
// Trethewey and his agents harmless for any damages.

var baseZoomURL = "http://www.kusunensemble.com/";  // base URL for image files
var zoomGIF = "";          // Optionally set this to: baseZoomURL + "images/zoom1.gif";
var zoomGIFWidth = 19;
var zoomGIFHeight = 20;
var zoomAutoClose = false;

 function zoomLink(thumb, tWidth, tHeight, bigPict, bigWidth, bigHeight, altText) {
   thumb = baseZoomURL + thumb;
   bigPict = baseZoomURL + bigPict;
   if((altText == "") || (altText == null)) { altText = "Click on the image to see a larger view"; }

  zRef = "<a href=\"javascript:popZoom('" + bigPict + "', " + bigWidth + ", " + bigHeight + ")\">";
   document.write(zRef + "<img src=\"" + thumb + "\" " +
        "width=\"" + tWidth + "\" height=\"" + tHeight + "\" " +
        "alt=\"" + altText + "\" title=\"" + altText + "\" /><br />\n");
     if (zoomGIF != "" ) {
    document.write("&nbsp;<img src=\"" + zoomGIF + "\" width=\"" + zoomGIFWidth + "\" height=\"" + zoomGIFHeight + "\" border=\"0\" alt=\"\" />&nbsp;");
         }
     document.write("</a>\n");
   }

 function popZoom(pictURL, pWidth, pHeight) {
  var zoomWidth = getTZWindowWidth();
  var x1 = pWidth+30;
  var y1 = pHeight+30;
  var pZoomStr = "height=" + y1 + ",width=" + x1 + ",left=" + ((zoomWidth-x1)/2) + ",top=60,scrollbars=0,menubar=0";
    pZoom = window.open("","", pZoomStr);
    pZoom.document.open();
    pZoom.document.writeln("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
    pZoom.document.writeln("<html>\n<head>\n<title>Zoom View of " + pictURL + "</title>");
    pZoom.document.writeln("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />");
    pZoom.document.write("</head>\n<body bgcolor=\"black\"");
  if (zoomAutoClose) {
    pZoom.document.write(" onblur='self.close();'");
       }
    pZoom.document.writeln(">");
    pZoom.document.writeln("<center><img src=\"" + pictURL + "\" width=\"" + pWidth + "\" height=\"" + pHeight + "\" alt=\"" + pictURL + "\" title=\"" + pictURL + "\" />");
    pZoom.document.writeln("</center></body>\n</html>\n");
    pZoom.document.close();

 } // end popZoom

function getTZWindowWidth() {
  var myWidth = 640;
    if( document.documentElement &&
        ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      myWidth = document.documentElement.clientWidth;
    } else {
      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
      }
    }
  return myWidth;
} // end getTZWindowWidth

function getTZWindowHeight() {
  var myHeight = 480;
    if( document.documentElement &&
        ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      myHeight = document.documentElement.clientHeight;
    } else {
      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
      }
    }
  return myHeight;
} // end getTZWindowHeight



