var includeCaption=true;
var zoomTime=2;
var zoomSteps=6;
var includeFade=0;
var minBorder=90;
var shadowSettings="0px 5px 25px rgba(0, 0, 0, ";
var zoomImagesURI="";
var myWidth=0,myHeight=0,myScroll=0;
myScrollWidth=0;
myScrollHeight=0;
var zoomOpen=false,preloadFrame=1,preloadActive=false,preloadTime=0,imgPreload=new Image();
var preloadAnimTimer=0;
var zoomActive=new Array();
var zoomTimer=new Array();
var zoomOrigW=new Array();
var zoomOrigH=new Array();
var zoomOrigX=new Array();
var zoomOrigY=new Array();
var zoomID="ZoomBox";
var theID="ZoomImage";
var zoomCaption="ZoomCaption";
var zoomCaptionDiv="ZoomCapDiv";
var src_img_closebox="js/photoLayerRes/closebox.gif";
var src_zoom_shadow1="js/photoLayerRes/empty.gif";
var src_zoom_shadow2="js/photoLayerRes/empty.gif";
var src_zoom_shadow3="js/photoLayerRes/empty.gif";
var src_zoom_shadow4="js/photoLayerRes/empty.gif";
var src_zoom_shadow5="js/photoLayerRes/empty.gif";
var src_zoom_shadow6="js/photoLayerRes/empty.gif";
var src_zoom_shadow7="js/photoLayerRes/empty.gif";
var src_zoom_shadow8="js/photoLayerRes/empty.gif";

if(navigator.userAgent.indexOf("MSIE")!=-1){
var browserIsIE=true;
}
function setupZoom(){
prepZooms();
insertZoomHTML();
zoomdiv=document.getElementById(zoomID);
zoomimg=document.getElementById(theID);
};
function prepZooms(){
if(!document.getElementsByTagName){
return;
}
var _1=document.getElementsByTagName("a");
for(i=0;i<_1.length;i++){
if(_1[i].getAttribute("href")){
if(_1[i].getAttribute("href").search(/(.*)\.(jpg|jpeg|gif|png|bmp|tif|tiff)/gi)!=-1){
if(_1[i].getAttribute("rel")!="nozoom"){
_1[i].onclick=function(_2){
return zoomClick(this,_2);
};
_1[i].onmouseover=function(){
zoomPreload(this);
};
}
}
}
}
};
function zoomPreload(_3){
var _4=_3.getAttribute("href");
if(imgPreload.src.indexOf(_3.getAttribute("href").substr(_3.getAttribute("href").lastIndexOf("/")))==-1){
preloadActive=true;
imgPreload=new Image();
imgPreload.onload=function(){
preloadActive=false;
};
imgPreload.src=_4;
}
};
function preloadAnimStart(){
preloadTime=new Date();
document.getElementById("ZoomSpin").style.left=(myWidth/2)+"px";
document.getElementById("ZoomSpin").style.top=((myHeight/2)+myScroll)+"px";
document.getElementById("ZoomSpin").style.visibility="visible";
preloadFrame=1;
document.getElementById("SpinImage").src="zoom-spin-"+preloadFrame+".png";
preloadAnimTimer=setInterval("preloadAnim()",100);
};
function preloadAnim(_5){
if(preloadActive!=false){
document.getElementById("SpinImage").src="zoom-spin-"+preloadFrame+".png";
preloadFrame++;
if(preloadFrame>12){
preloadFrame=1;
}
}else{
document.getElementById("ZoomSpin").style.visibility="hidden";
clearInterval(preloadAnimTimer);
preloadAnimTimer=0;
zoomIn(preloadFrom);
}
};
function zoomClick(_6,_7){
var _8=getShift(_7);
if(!_7&&window.event&&(window.event.metaKey||window.event.altKey)){
return true;
}else{
if(_7&&(_7.metaKey||_7.altKey)){
return true;
}
}
getSize();
if(preloadActive==true){
if(preloadAnimTimer==0){
preloadFrom=_6;
preloadAnimStart();
}
}else{
zoomIn(_6,_8);
}
return false;
};
function zoomIn(_9,_a){
zoomimg.src=_9.getAttribute("href");
if(_9.childNodes[0].width){
startW=_9.childNodes[0].width;
startH=_9.childNodes[0].height;
startPos=findElementPos(_9.childNodes[0]);
}else{
startW=50;
startH=12;
startPos=findElementPos(_9);
}
hostX=startPos[0];
hostY=startPos[1];
if(document.getElementById("scroller")){
hostX=hostX-document.getElementById("scroller").scrollLeft;
}
endW=imgPreload.width;
endH=imgPreload.height;
if(zoomActive[theID]!=true){
if(document.getElementById("ShadowBox")){
document.getElementById("ShadowBox").style.visibility="hidden";
}else{
if(!browserIsIE){
if(fadeActive["ZoomImage"]){
clearInterval(fadeTimer["ZoomImage"]);
fadeActive["ZoomImage"]=false;
fadeTimer["ZoomImage"]=false;
}
document.getElementById("ZoomImage").style.webkitBoxShadow=shadowSettings+"0.0)";
}
}
document.getElementById("ZoomClose").style.visibility="hidden";
if(includeCaption){
document.getElementById(zoomCaptionDiv).style.visibility="hidden";
if(_9.getAttribute("title")&&includeCaption){
document.getElementById(zoomCaption).innerHTML=_9.getAttribute("title");
}else{
document.getElementById(zoomCaption).innerHTML="";
}
}
zoomOrigW[theID]=startW;
zoomOrigH[theID]=startH;
zoomOrigX[theID]=hostX;
zoomOrigY[theID]=hostY;
zoomimg.style.width=startW+"px";
zoomimg.style.height=startH+"px";
zoomdiv.style.left=hostX+"px";
zoomdiv.style.top=hostY+"px";
if(includeFade==1){
setOpacity(0,zoomID);
}
zoomdiv.style.visibility="visible";
sizeRatio=endW/endH;
if(endW>myWidth-minBorder){
endW=myWidth-minBorder;
endH=endW/sizeRatio;
}
if(endH>myHeight-minBorder){
endH=myHeight-minBorder;
endW=endH*sizeRatio;
}
zoomChangeX=((myWidth/2)-(endW/2)-hostX);
zoomChangeY=(((myHeight/2)-(endH/2)-hostY)+myScroll);
zoomChangeW=(endW-startW);
zoomChangeH=(endH-startH);
if(_a){
tempSteps=zoomSteps*7;
}else{
tempSteps=zoomSteps;
}
zoomCurrent=0;
if(includeFade==1){
fadeCurrent=0;
fadeAmount=(0-100)/tempSteps;
}else{
fadeAmount=0;
}
zoomTimer[theID]=setInterval("zoomElement('"+zoomID+"', '"+theID+"', "+zoomCurrent+", "+startW+", "+zoomChangeW+", "+startH+", "+zoomChangeH+", "+hostX+", "+zoomChangeX+", "+hostY+", "+zoomChangeY+", "+tempSteps+", "+includeFade+", "+fadeAmount+", 'zoomDoneIn(zoomID)')",zoomTime);
zoomActive[theID]=true;
}
};
function zoomOut(_b,_c){
if(getShift(_c)){
tempSteps=zoomSteps*7;
}else{
tempSteps=zoomSteps;
}
if(zoomActive[theID]!=true){
if(document.getElementById("ShadowBox")){
document.getElementById("ShadowBox").style.visibility="hidden";
}else{
if(!browserIsIE){
if(fadeActive["ZoomImage"]){
clearInterval(fadeTimer["ZoomImage"]);
fadeActive["ZoomImage"]=false;
fadeTimer["ZoomImage"]=false;
}
document.getElementById("ZoomImage").style.webkitBoxShadow=shadowSettings+"0.0)";
}
}
document.getElementById("ZoomClose").style.visibility="hidden";
if(includeCaption&&document.getElementById(zoomCaption).innerHTML!=""){
document.getElementById(zoomCaptionDiv).style.visibility="hidden";
}
startX=parseInt(zoomdiv.style.left);
startY=parseInt(zoomdiv.style.top);
startW=zoomimg.width;
startH=zoomimg.height;
zoomChangeX=zoomOrigX[theID]-startX;
zoomChangeY=zoomOrigY[theID]-startY;
zoomChangeW=zoomOrigW[theID]-startW;
zoomChangeH=zoomOrigH[theID]-startH;
zoomCurrent=0;
if(includeFade==1){
fadeCurrent=0;
fadeAmount=(100-0)/tempSteps;
}else{
fadeAmount=0;
}
zoomTimer[theID]=setInterval("zoomElement('"+zoomID+"', '"+theID+"', "+zoomCurrent+", "+startW+", "+zoomChangeW+", "+startH+", "+zoomChangeH+", "+startX+", "+zoomChangeX+", "+startY+", "+zoomChangeY+", "+tempSteps+", "+includeFade+", "+fadeAmount+", 'zoomDone(zoomID, theID)')",zoomTime);
zoomActive[theID]=true;
}
};
function zoomDoneIn(_d,_e){
zoomOpen=true;
_d=document.getElementById(_d);
if(document.getElementById("ShadowBox")){
setOpacity(0,"ShadowBox");
shadowdiv=document.getElementById("ShadowBox");
shadowLeft=parseInt(_d.style.left)-13;
shadowTop=parseInt(_d.style.top)-8;
shadowWidth=_d.offsetWidth+26;
shadowHeight=_d.offsetHeight+26;
shadowdiv.style.width=shadowWidth+"px";
shadowdiv.style.height=shadowHeight+"px";
shadowdiv.style.left=shadowLeft+"px";
shadowdiv.style.top=shadowTop+"px";
document.getElementById("ShadowBox").style.visibility="visible";
fadeElementSetup("ShadowBox",0,100,5);
}else{
if(!browserIsIE){
fadeElementSetup("ZoomImage",0,0.8,5,0,"shadow");
}
}
if(includeCaption&&document.getElementById(zoomCaption).innerHTML!=""){
zoomcapd=document.getElementById(zoomCaptionDiv);
zoomcapd.style.top=parseInt(_d.style.top)+(_d.offsetHeight+15)+"px";
zoomcapd.style.left=(myWidth/2)-(zoomcapd.offsetWidth/2)+"px";
zoomcapd.style.visibility="visible";
}
if(!browserIsIE){
setOpacity(0,"ZoomClose");
}
document.getElementById("ZoomClose").style.visibility="visible";
if(!browserIsIE){
fadeElementSetup("ZoomClose",0,100,5);
}
document.onkeypress=getKey;
};
function zoomDone(_f,_10){
zoomOpen=false;
zoomOrigH[_10]="";
zoomOrigW[_10]="";
document.getElementById(_f).style.visibility="hidden";
zoomActive[_10]==false;
document.onkeypress=null;
};
function zoomElement(_11,_12,_13,_14,_15,_16,_17,_18,_19,_1a,_1b,_1c,_1d,_1e,_1f){
if(_13==(_1c+1)){
zoomActive[_12]=false;
clearInterval(zoomTimer[_12]);
if(_1f!=""){
eval(_1f);
}
}else{
if(_1d==1){
if(_1e<0){
setOpacity(Math.abs(_13*_1e),_11);
}else{
setOpacity(100-(_13*_1e),_11);
}
}
moveW=cubicInOut(_13,_14,_15,_1c);
moveH=cubicInOut(_13,_16,_17,_1c);
moveX=cubicInOut(_13,_18,_19,_1c);
moveY=cubicInOut(_13,_1a,_1b,_1c);
document.getElementById(_11).style.left=moveX+"px";
document.getElementById(_11).style.top=moveY+"px";
zoomimg.style.width=moveW+"px";
zoomimg.style.height=moveH+"px";
_13++;
clearInterval(zoomTimer[_12]);
zoomTimer[_12]=setInterval("zoomElement('"+_11+"', '"+_12+"', "+_13+", "+_14+", "+_15+", "+_16+", "+_17+", "+_18+", "+_19+", "+_1a+", "+_1b+", "+_1c+", "+_1d+", "+_1e+", '"+_1f+"')",zoomTime);
}
};
function getKey(evt){
if(!evt){
theKey=event.keyCode;
}else{
theKey=evt.keyCode;
}
if(theKey==27){
zoomOut(this,evt);
}
};
function fadeOut(_21){
if(_21.id){
fadeElementSetup(_21.id,100,0,10);
}
};
function fadeIn(_22){
if(_22.id){
fadeElementSetup(_22.id,0,100,10);
}
};
var fadeActive=new Array();
var fadeQueue=new Array();
var fadeTimer=new Array();
var fadeClose=new Array();
var fadeMode=new Array();
function fadeElementSetup(_23,_24,_25,_26,_27,_28){
if(fadeActive[_23]==true){
fadeQueue[_23]=new Array(_23,_24,_25,_26);
}else{
fadeSteps=_26;
fadeCurrent=0;
fadeAmount=(_24-_25)/fadeSteps;
fadeTimer[_23]=setInterval("fadeElement('"+_23+"', '"+fadeCurrent+"', '"+fadeAmount+"', '"+fadeSteps+"')",15);
fadeActive[_23]=true;
fadeMode[_23]=_28;
if(_27==1){
fadeClose[_23]=true;
}else{
fadeClose[_23]=false;
}
}
};
function fadeElement(_29,_2a,_2b,_2c){
if(_2a==_2c){
clearInterval(fadeTimer[_29]);
fadeActive[_29]=false;
fadeTimer[_29]=false;
if(fadeClose[_29]==true){
document.getElementById(_29).style.visibility="hidden";
}
if(fadeQueue[_29]&&fadeQueue[_29]!=false){
fadeElementSetup(fadeQueue[_29][0],fadeQueue[_29][1],fadeQueue[_29][2],fadeQueue[_29][3]);
fadeQueue[_29]=false;
}
}else{
_2a++;
if(fadeMode[_29]=="shadow"){
if(_2b<0){
document.getElementById(_29).style.webkitBoxShadow=shadowSettings+(Math.abs(_2a*_2b))+")";
}else{
document.getElementById(_29).style.webkitBoxShadow=shadowSettings+(100-(_2a*_2b))+")";
}
}else{
if(_2b<0){
setOpacity(Math.abs(_2a*_2b),_29);
}else{
setOpacity(100-(_2a*_2b),_29);
}
}
clearInterval(fadeTimer[_29]);
fadeTimer[_29]=setInterval("fadeElement('"+_29+"', '"+_2a+"', '"+_2b+"', '"+_2c+"')",15);
}
};
function setOpacity(_2d,_2e){
var _2f=document.getElementById(_2e).style;
if(navigator.userAgent.indexOf("Firefox")!=-1){
if(_2d==100){
_2d=99.9999;
}
}
_2f.filter="alpha(opacity="+_2d+")";
_2f.opacity=(_2d/100);
};
function linear(t,b,c,d){
return c*t/d+b;
};
function sineInOut(t,b,c,d){
return -c/2*(Math.cos(Math.PI*t/d)-1)+b;
};
function cubicIn(t,b,c,d){
return c*(t/=d)*t*t+b;
};
function cubicOut(t,b,c,d){
return c*((t=t/d-1)*t*t+1)+b;
};
function cubicInOut(t,b,c,d){
if((t/=d/2)<1){
return c/2*t*t*t+b;
}
return c/2*((t-=2)*t*t+2)+b;
};
function bounceOut(t,b,c,d){
if((t/=d)<(1/2.75)){
return c*(7.5625*t*t)+b;
}else{
if(t<(2/2.75)){
return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b;
}else{
if(t<(2.5/2.75)){
return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b;
}else{
return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b;
}
}
}
};
function getSize(){
if(self.innerHeight){
myWidth=window.innerWidth;
myHeight=window.innerHeight;
myScroll=window.pageYOffset;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
myWidth=document.documentElement.clientWidth;
myHeight=document.documentElement.clientHeight;
myScroll=document.documentElement.scrollTop;
}else{
if(document.body){
myWidth=document.body.clientWidth;
myHeight=document.body.clientHeight;
myScroll=document.body.scrollTop;
}
}
}
if(window.innerHeight&&window.scrollMaxY){
myScrollWidth=document.body.scrollWidth;
myScrollHeight=window.innerHeight+window.scrollMaxY;
}else{
if(document.body.scrollHeight>document.body.offsetHeight){
myScrollWidth=document.body.scrollWidth;
myScrollHeight=document.body.scrollHeight;
}else{
myScrollWidth=document.body.offsetWidth;
myScrollHeight=document.body.offsetHeight;
}
}
};
function getShift(evt){
var _49=false;
if(!evt&&window.event){
_49=window.event.shiftKey;
}else{
if(evt){
_49=evt.shiftKey;
if(_49){
evt.stopPropagation();
}
}
}
return _49;
};
function findElementPos(_4a){
var _4b=0;
var _4c=0;
do{
_4b+=_4a.offsetLeft;
_4c+=_4a.offsetTop;
}while(_4a=_4a.offsetParent);
return Array(_4b,_4c);
};
function insertZoomHTML(){
var _1=document.getElementsByTagName("body").item(0);
var _2=document.createElement("div");
_2.setAttribute("id","ZoomSpin");
_2.style.position="absolute";
_2.style.left="10px";
_2.style.top="10px";
_2.style.visibility="hidden";
_2.style.zIndex="525";
_1.insertBefore(_2,_1.firstChild);
var _3=document.createElement("img");
_3.setAttribute("id","SpinImage");
_3.setAttribute("src","zoom-spin-1.png");
_2.appendChild(_3);
var _4=document.createElement("div");
_4.setAttribute("id","ZoomBox");
_4.style.position="absolute";
_4.style.left="10px";
_4.style.top="10px";
_4.style.visibility="hidden";
_4.style.zIndex="499";
_1.insertBefore(_4,_2.nextSibling);
var _5=document.createElement("img");
_5.onclick=function(_6){
zoomOut(this,_6);
return false;
};
_5.setAttribute("src","spacer.gif");
_5.setAttribute("id","ZoomImage");
_5.setAttribute("border","0");
_5.setAttribute("style","-webkit-box-shadow: "+shadowSettings+"0.0)");
_5.style.display="block";
_5.style.width="10px";
_5.style.height="10px";
_5.style.cursor="pointer";
_4.appendChild(_5);
var _7=document.createElement("div");
_7.setAttribute("id","ZoomClose");
_7.style.position="absolute";
if(browserIsIE){
_7.style.left="-1px";
_7.style.top="0px";
}else{
_7.style.left="-15px";
_7.style.top="-15px";
}
_7.style.visibility="hidden";
_4.appendChild(_7);
var _8=document.createElement("img");
_8.onclick=function(_9){
zoomOut(this,_9);
return false;
};
_8.setAttribute("src",src_img_closebox);
_8.setAttribute("width","30");
_8.setAttribute("height","30");
_8.setAttribute("border","0");
_8.style.cursor="pointer";
_7.appendChild(_8);
if(!document.getElementById("ZoomImage").style.webkitBoxShadow&&!browserIsIE){
var _a=document.createElement("div");
_a.setAttribute("id","ShadowBox");
_a.style.position="absolute";
_a.style.left="50px";
_a.style.top="50px";
_a.style.width="100px";
_a.style.height="100px";
_a.style.visibility="hidden";
_a.style.zIndex="498";
_1.insertBefore(_a,_4.nextSibling);
var _b=document.createElement("table");
_b.setAttribute("border","0");
_b.setAttribute("width","100%");
_b.setAttribute("height","100%");
_b.setAttribute("cellpadding","0");
_b.setAttribute("cellspacing","0");
_a.appendChild(_b);
var _c=document.createElement("tbody");
_b.appendChild(_c);
var _d=document.createElement("tr");
_d.style.height="25px";
_c.appendChild(_d);
var _e=document.createElement("td");
_e.style.width="27px";
_d.appendChild(_e);
var _f=document.createElement("img");
_f.setAttribute("src",src_zoom_shadow1);
_f.setAttribute("width","27");
_f.setAttribute("height","25");
_f.style.display="block";
_e.appendChild(_f);
var _10=document.createElement("td");
_10.setAttribute("background",src_zoom_shadow2);
_d.appendChild(_10);
var _11=document.createElement("img");
_11.setAttribute("src","spacer.gif");
_11.setAttribute("height","1");
_11.setAttribute("width","1");
_11.style.display="block";
_10.appendChild(_11);
var _12=document.createElement("td");
_12.style.width="27px";
_d.appendChild(_12);
var _13=document.createElement("img");
_13.setAttribute("src",src_zoom_shadow3);
_13.setAttribute("width","27");
_13.setAttribute("height","25");
_13.style.display="block";
_12.appendChild(_13);
inRow2=document.createElement("tr");
_c.appendChild(inRow2);
var _14=document.createElement("td");
_14.setAttribute("background",src_zoom_shadow4);
inRow2.appendChild(_14);
var _15=document.createElement("img");
_15.setAttribute("src","spacer.gif");
_15.setAttribute("height","1");
_15.setAttribute("width","1");
_15.style.display="block";
_14.appendChild(_15);
var _16=document.createElement("td");
_16.setAttribute("bgcolor","#ffffff");
inRow2.appendChild(_16);
var _17=document.createElement("img");
_17.setAttribute("src","spacer.gif");
_17.setAttribute("height","1");
_17.setAttribute("width","1");
_17.style.display="block";
_16.appendChild(_17);
var _18=document.createElement("td");
_18.setAttribute("background",src_zoom_shadow5);
inRow2.appendChild(_18);
var _19=document.createElement("img");
_19.setAttribute("src","spacer.gif");
_19.setAttribute("height","1");
_19.setAttribute("width","1");
_19.style.display="block";
_18.appendChild(_19);
var _1a=document.createElement("tr");
_1a.style.height="26px";
_c.appendChild(_1a);
var _1b=document.createElement("td");
_1b.style.width="27px";
_1a.appendChild(_1b);
var _1c=document.createElement("img");
_1c.setAttribute("src",src_zoom_shadow6);
_1c.setAttribute("width","27");
_1c.setAttribute("height","26");
_1c.style.display="block";
_1b.appendChild(_1c);
var _1d=document.createElement("td");
_1d.setAttribute("background",src_zoom_shadow7);
_1a.appendChild(_1d);
var _1e=document.createElement("img");
_1e.setAttribute("src","spacer.gif");
_1e.setAttribute("height","1");
_1e.setAttribute("width","1");
_1e.style.display="block";
_1d.appendChild(_1e);
var _1f=document.createElement("td");
_1f.style.width="27px";
_1a.appendChild(_1f);
var _20=document.createElement("img");
_20.setAttribute("src",src_zoom_shadow8);
_20.setAttribute("width","27");
_20.setAttribute("height","26");
_20.style.display="block";
_1f.appendChild(_20);
}
if(includeCaption){
var _21=document.createElement("div");
_21.setAttribute("id","ZoomCapDiv");
_21.style.position="absolute";
_21.style.visibility="hidden";
_21.style.marginLeft="auto";
_21.style.marginRight="auto";
_21.style.zIndex="501";
_1.insertBefore(_21,_4.nextSibling);
var _22=document.createElement("table");
_22.setAttribute("border","0");
_22.setAttribute("cellPadding","0");
_22.setAttribute("cellSpacing","0");
_21.appendChild(_22);
var _23=document.createElement("tbody");
_22.appendChild(_23);
var _24=document.createElement("tr");
_23.appendChild(_24);
var _25=document.createElement("td");
_25.setAttribute("align","right");
_24.appendChild(_25);
var _26=document.createElement("img");
_26.setAttribute("src","zoom-caption-l.png");
_26.setAttribute("width","13");
_26.setAttribute("height","26");
_26.style.display="block";
_25.appendChild(_26);
var _27=document.createElement("td");
_27.setAttribute("background","zoom-caption-fill.png");
_27.setAttribute("id","ZoomCaption");
_27.setAttribute("valign","middle");
_27.style.fontSize="14px";
_27.style.fontFamily="Helvetica";
_27.style.fontWeight="bold";
_27.style.color="#ffffff";
_27.style.textShadow="0px 2px 4px #000000";
_27.style.whiteSpace="nowrap";
_24.appendChild(_27);
var _28=document.createElement("td");
_24.appendChild(_28);
var _29=document.createElement("img");
_29.setAttribute("src","zoom-caption-r.png");
_29.setAttribute("width","13");
_29.setAttribute("height","26");
_29.style.display="block";
_28.appendChild(_29);
}
};
