var includeCaption=true,zoomTime=5,zoomSteps=15,includeFade=1,minBorder=90,shadowSettings="0px 5px 25px rgba(0, 0, 0, ",zoomImagesURI="images-global/zoom/",myWidth=0,myHeight=0,myScroll=0;myScrollHeight=myScrollWidth=0;var zoomOpen=false,preloadFrame=1,preloadActive=false,preloadTime=0,imgPreload=new Image,preloadAnimTimer=0,zoomActive=[],zoomTimer=[],zoomOrigW=[],zoomOrigH=[],zoomOrigX=[],zoomOrigY=[],zoomID="ZoomBox",theID="ZoomImage",zoomCaption="ZoomCaption",zoomCaptionDiv="ZoomCapDiv";
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){var a=document.getElementsByTagName("a");for(i=0;i<a.length;i++)if(a[i].getAttribute("href"))if(a[i].getAttribute("href").search(/(.*)\.(jpg|jpeg|gif|png|bmp|tif|tiff)/gi)!=-1)if(a[i].getAttribute("rel")!="nozoom"){a[i].onclick=function(b){return zoomClick(this,b)};a[i].onmouseover=function(){zoomPreload(this)}}}}
function zoomPreload(a){var b=a.getAttribute("href");if(imgPreload.src.indexOf(a.getAttribute("href").substr(a.getAttribute("href").lastIndexOf("/")))==-1){preloadActive=true;imgPreload=new Image;imgPreload.onload=function(){preloadActive=false};imgPreload.src=b}}
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=zoomImagesURI+"zoom-spin-"+preloadFrame+".png";preloadAnimTimer=setInterval("preloadAnim()",100)}
function preloadAnim(a){if(preloadActive!=false){document.getElementById("SpinImage").src=zoomImagesURI+"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(a,b){var c=getShift(b);if(!b&&window.event&&(window.event.metaKey||window.event.altKey))return true;else if(b&&(b.metaKey||b.altKey))return true;getSize();if(preloadActive==true){if(preloadAnimTimer==0){preloadFrom=a;preloadAnimStart()}}else zoomIn(a,c);return false}
function zoomIn(a,b){zoomimg.src=a.getAttribute("href");if(a.childNodes[0].width){startW=a.childNodes[0].width;startH=a.childNodes[0].height;startPos=findElementPos(a.childNodes[0])}else{startW=50;startH=12;startPos=findElementPos(a)}hostX=startPos[0];hostY=startPos[1];if(document.getElementById("scroller"))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(a.getAttribute("title")&&includeCaption)document.getElementById(zoomCaption).innerHTML=a.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";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;tempSteps=b?zoomSteps*7:zoomSteps;zoomCurrent=0;if(includeFade==1){fadeCurrent=0;fadeAmount=-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(a,b){tempSteps=getShift(b)?zoomSteps*7: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/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(a,b){zoomOpen=true;a=document.getElementById(a);if(document.getElementById("ShadowBox")){setOpacity(0,"ShadowBox");shadowdiv=document.getElementById("ShadowBox");shadowLeft=parseInt(a.style.left)-13;shadowTop=parseInt(a.style.top)-8;shadowWidth=a.offsetWidth+26;shadowHeight=a.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 browserIsIE||fadeElementSetup("ZoomImage",0,0.8,5,0,"shadow");if(includeCaption&&document.getElementById(zoomCaption).innerHTML!=""){zoomcapd=document.getElementById(zoomCaptionDiv);zoomcapd.style.top=parseInt(a.style.top)+(a.offsetHeight+15)+"px";zoomcapd.style.left=myWidth/2-zoomcapd.offsetWidth/2+"px";zoomcapd.style.visibility="visible"}browserIsIE||setOpacity(0,"ZoomClose");document.getElementById("ZoomClose").style.visibility="visible";browserIsIE||
fadeElementSetup("ZoomClose",0,100,5);document.onkeypress=getKey}function zoomDone(a,b){zoomOpen=false;zoomOrigH[b]="";zoomOrigW[b]="";document.getElementById(a).style.visibility="hidden";document.onkeypress=null}
function zoomElement(a,b,c,d,f,g,k,l,m,n,o,e,p,h,j){if(c==e+1){zoomActive[b]=false;clearInterval(zoomTimer[b]);j!=""&&eval(j)}else{if(p==1)h<0?setOpacity(Math.abs(c*h),a):setOpacity(100-c*h,a);moveW=cubicInOut(c,d,f,e);moveH=cubicInOut(c,g,k,e);moveX=cubicInOut(c,l,m,e);moveY=cubicInOut(c,n,o,e);document.getElementById(a).style.left=moveX+"px";document.getElementById(a).style.top=moveY+"px";zoomimg.style.width=moveW+"px";zoomimg.style.height=moveH+"px";c++;clearInterval(zoomTimer[b]);zoomTimer[b]=
setInterval("zoomElement('"+a+"', '"+b+"', "+c+", "+d+", "+f+", "+g+", "+k+", "+l+", "+m+", "+n+", "+o+", "+e+", "+p+", "+h+", '"+j+"')",zoomTime)}}function getKey(a){theKey=a?a.keyCode:event.keyCode;theKey==27&&zoomOut(this,a)}function fadeOut(a){a.id&&fadeElementSetup(a.id,100,0,10)}function fadeIn(a){a.id&&fadeElementSetup(a.id,0,100,10)}var fadeActive=[],fadeQueue=[],fadeTimer=[],fadeClose=[],fadeMode=[];
function fadeElementSetup(a,b,c,d,f,g){if(fadeActive[a]==true)fadeQueue[a]=new Array(a,b,c,d);else{fadeSteps=d;fadeCurrent=0;fadeAmount=(b-c)/fadeSteps;fadeTimer[a]=setInterval("fadeElement('"+a+"', '"+fadeCurrent+"', '"+fadeAmount+"', '"+fadeSteps+"')",15);fadeActive[a]=true;fadeMode[a]=g;fadeClose[a]=f==1?true:false}}
function fadeElement(a,b,c,d){if(b==d){clearInterval(fadeTimer[a]);fadeActive[a]=false;fadeTimer[a]=false;if(fadeClose[a]==true)document.getElementById(a).style.visibility="hidden";if(fadeQueue[a]&&fadeQueue[a]!=false){fadeElementSetup(fadeQueue[a][0],fadeQueue[a][1],fadeQueue[a][2],fadeQueue[a][3]);fadeQueue[a]=false}}else{b++;if(fadeMode[a]=="shadow")if(c<0)document.getElementById(a).style.webkitBoxShadow=shadowSettings+Math.abs(b*c)+")";else document.getElementById(a).style.webkitBoxShadow=shadowSettings+
(100-b*c)+")";else c<0?setOpacity(Math.abs(b*c),a):setOpacity(100-b*c,a);clearInterval(fadeTimer[a]);fadeTimer[a]=setInterval("fadeElement('"+a+"', '"+b+"', '"+c+"', '"+d+"')",15)}}function setOpacity(a,b){b=document.getElementById(b).style;if(navigator.userAgent.indexOf("Firefox")!=-1)if(a==100)a=99.9999;b.filter="alpha(opacity="+a+")";b.opacity=a/100}function linear(a,b,c,d){return c*a/d+b}function sineInOut(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b}
function cubicIn(a,b,c,d){return c*(a/=d)*a*a+b}function cubicOut(a,b,c,d){return c*((a=a/d-1)*a*a+1)+b}function cubicInOut(a,b,c,d){if((a/=d/2)<1)return c/2*a*a*a+b;return c/2*((a-=2)*a*a+2)+b}function bounceOut(a,b,c,d){return(a/=d)<1/2.75?c*7.5625*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+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(a){var b=false;if(!a&&window.event)b=window.event.shiftKey;else if(a)(b=a.shiftKey)&&a.stopPropagation();return b}
function findElementPos(a){var b=0,c=0;do{b+=a.offsetLeft;c+=a.offsetTop}while(a=a.offsetParent);return Array(b,c)};