document.write('<STYLE TYPE="text/css"> #elZoom {position: absolute;visibility: hidden;} #elMessage {position: absolute; left:0; top:0; width:220; visibility:hidden; text-align:center; color:black; font-size:10pt; font-weight:bold; font-family:Arial;}</STYLE>');

var bV=parseInt(navigator.appVersion);
var NS4=(document.layers) ? true : false;
var IE4=((document.all)&&(bV>=4))?true:false;
var ver4 = (NS4 || IE4) ? true : false;
var DOM = document.getElementById;

var zoomed = false;
var scale = 4;
var firstZoom = true;
document.write('<div id="elZoom"></div>');
document.write('<div id="elMessage"> &nbsp;</div>');

var elZoom = document.getElementById('elZoom');
var elMessage = document.getElementById('elMessage');

function zoomMe(onepic)
{
if (zoomed) {zoomIn(); return true; }
else {zoomOut(onepic); return false }
}

function zoomIn()
{
if (firstZoom)
  {
  elMessage.style.visibility = "hidden";
  firstZoom = false;
  }
elZoom.style.visibility='hidden';
zoomed=false;
} //end ZoomIn

function zoomOut(whichImg)
{
if (zoomed) {zoomIn(); return}

var newWidth  = parseInt(whichImg.width * scale);
var newHeight = parseInt(whichImg.height * scale);
var bigImStr  = "<a href='javascript:zoomIn()'>";
bigImStr += '<img name="imBig" src="' + whichImg.src + '" width="' + newWidth + '" height="' + newHeight + '" border="0">';
bigImStr += "</a>";

elZoom.innerHTML = bigImStr;

var winWidth;
var winHeight;
var winPosEl;

if (IE4)
  {
  var Xoffset= 170, Yoffset = 219;
  elZoom.style.left = whichImg.offsetLeft + Xoffset;
  elZoom.style.top = whichImg.offsetTop + Yoffset;
  winWidth = document.body.clientWidth;
  winHeight = document.body.clientHeight;
  winPosEl = elZoom.style.offsetTop - document.body.scrollTop;
  }
else
  {
  elZoom.style.left = whichImg.x;
  elZoom.style.top = whichImg.y;
  winWidth = innerWidth;
  winHeight = innerHeight;
  winPosEl = elZoom.style.top - pageYOffset;
  }


if (parseInt(elZoom.style.left) + newWidth > winWidth)
  {elZoom.style.left = (winWidth - newWidth - 30) }

if (winPosEl + newHeight > winHeight)
  {
  newPos = (winHeight - (winPosEl + newHeight) - 10);
  elZoom.style.top = parseInt(elZoom.style.top) + newPos;
  }

elZoom.style.visibility = "visible";
zoomed = true;
} //end zoomOut


