
<!-- // hide script
// Zoom In/Zoom Out izPart1 (14-03-2005)
// by Vic Phillips http://www.vicsjavascripts.org.uk
// Customising Variables
var izLoading='Loading.gif'; // the image to display as large images are loading
var izZIndex=0;              // the base Z-Index for the images
//-->
<!-- // hide script
// Zoom In/Zoom Out izPart2 (14-03-2005)
// by Vic Phillips http://www.vicsjavascripts.org.uk
//

// No Need to Change
// Set Arrays and Initial Conditions for izLk & ThisPhoto
var izObjAry=new Array()
var izObjNu=0;
var izLk=0;
var izInc,izAdd;
var izCursor='pointer';
if (document.all){ izCursor='hand'; }

//PreLoad Loading Image
var Loading = new Image();
 Loading.src=izLoading;

function izClick(izobj,izphoto,izmw,izmh,izspd){
 izobj.style.cursor='hand';
 if (!izobj.getAttribute('title')){
  izobj.title='Click to Zoom In/Click to Zoom Out';
 }
// Set izspd to 1 if izspd is not set in Zoom function call
 if (izspd==null){ izobj.izspd=1;}
 izobj.onclick=function(){ izZoom(izobj,izphoto,izmw,izmh,izspd); }
}

function izZoom(izobj,izphoto,izmw,izmh,izspd){
 if (izLk){ return; }
// prevents re-Zoom while Zooming
 izLk=1;
// Convert Local Variables to Global
 izObj=izobj;
 if (izspd==null){ izObj.izspd=5;}
// izspd of Zoom
// Check izObjAry for izObj and add if required
 izAdd=1;
 for (var iz0=0;iz0<izObjAry.length;iz0++){
  if (izObjAry[iz0]==izObj){
   izObj.src=izObj.large.src;
   izAdd=0;
  }
 }
 if (izAdd){
  izObj.clone=izObj.cloneNode(true);
  if (!izObj.izspd){ izObj.izspd=izspd; }
  izObj.izt=zxcTop(izObj);
  izObj.izl=zxcLeft(izObj);
  izObjAry[izObjNu]=izObj;
  izObj.style.position='absolute';
  izObj.style.zIndex=izZIndex+1;
  izObj.style.top=izObj.izt+'px';
  izObj.style.left=izObj.izl+'px';
  izObj.minw=izObj.offsetWidth;
  izObj.minh=izObj.offsetHeight;
  izObj.maxh=izmh;
  izObj.maxw=izmw;
  izObj.thumb=izObj.src;
  izObj.src=Loading.src; // change Thumb Image to 'Loading' Large Image
  izObj.zoom='In';
  izObj.large=new Image();
  izObj.large.obj=izObj;
  izObj.large.onload=function(){ izObj.large.obj.src=this.src; }
  izObj.large.src=izphoto;
  izObj.parentNode.insertBefore(izObj.clone,izObj);
  izObjNu++;
 }

// izspd of Zoom
 izInc=((izObj.maxw-izObj.minw)/100);   // Account for Zoom In size
 izInc=izInc*izObj.izspd;           // Speed specified in Local variable
 // Calculate Ratios
 izRatio=(izObj.maxh/izObj.maxw);

// Establish Photo and Zoom
 if (izObj.zoom=='Out'){
  izZoomOut();
  izObj.zoom='In';
 }
 else {
  izZoomIn();
  izObj.zoom='Out';
 }
}

function izZoomIn(){
 izObj.width=izObj.offsetWidth+izInc;
 izObj.height=izObj.offsetWidth*izRatio;
 izObj.style.top=(izObj.izt-(izObj.offsetHeight-izObj.minh)/2)+'px';
 //izObj.style.left=(izObj.izl-(izObj.offsetWidth-izObj.minw)/2)+'px';

 if (izObj.offsetWidth<izObj.maxw){ setTimeout('izZoomIn();',10); }
 else {
  izLk=0;
  izObj.width=izObj.maxw;
  izObj.height=izObj.maxh;
 }
}

function izZoomOut(){
 izObj.width=izObj.offsetWidth-izInc;
 izObj.height=izObj.offsetWidth*izRatio;
 izObj.style.top=((izObj.izt+izObj.minh/2)-(izObj.offsetHeight/2))+'px';
 //izObj.style.left=((izObj.izl+izObj.minw/2)-(izObj.offsetWidth/2))+'px';
 if (izObj.offsetWidth>izObj.minw){ setTimeout('izZoomOut()',10); }
  else {
   izLk=0;
   izObj.width=izObj.minw;
   izObj.height=izObj.minh;
   izObj.style.zIndex=izZIndex;
   izObj.style.top=(izObj.izt)+'px';
   izObj.style.left=(izObj.izl)+'px';
   izObj.src=izObj.thumb;
  }
}

function zxcLeft(zxc){
 zxcObjLeft=zxc.offsetLeft;
 while(zxc.offsetParent!=null){
  zxcObjParent=zxc.offsetParent;
  zxcObjLeft+=zxcObjParent.offsetLeft;
  zxc=zxcObjParent;
 }
 return zxcObjLeft;
}

function zxcTop(zxc){
 zxcObjTop=zxc.offsetTop;
 while(zxc.offsetParent!=null){
  zxcObjParent=zxc.offsetParent;
  zxcObjTop+=zxcObjParent.offsetTop;
  zxc=zxcObjParent;
 }
 return zxcObjTop;
}

// finish hiding script -->
