1// FancyZoom.js - v1.1 - http://www.fancyzoom.com 2// 3// Copyright (c) 2008 Cabel Sasser / Panic Inc 4// All rights reserved. 5// 6// Requires: FancyZoomHTML.js 7// Instructions: Include JS files in page, call setupZoom() in onLoad. That's it! 8// Any <a href> links to images will be updated to zoom inline. 9// Add rel="nozoom" to your <a href> to disable zooming for an image. 10// 11// Redistribution and use of this effect in source form, with or without modification, 12// are permitted provided that the following conditions are met: 13// 14// * USE OF SOURCE ON COMMERCIAL (FOR-PROFIT) WEBSITE REQUIRES ONE-TIME LICENSE FEE PER DOMAIN. 15// Reasonably priced! Visit www.fancyzoom.com for licensing instructions. Thanks! 16// 17// * Non-commercial (personal) website use is permitted without license/payment! 18// 19// * Redistribution of source code must retain the above copyright notice, 20// this list of conditions and the following disclaimer. 21// 22// * Redistribution of source code and derived works cannot be sold without specific 23// written prior permission. 24// 25// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 29// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 30// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36var includeCaption=!0,zoomTime=5,zoomSteps=15,includeFade=1,minBorder=90,shadowSettings="0px 5px 25px rgba(0, 0, 0, ",zoomImagesURI="/img/zoom/",myWidth=0,myHeight=0,myScroll=0,zoomOpen=(myScrollWidth=0,myScrollHeight=0,!1),preloadFrame=1,preloadActive=!1,preloadTime=0,imgPreload=new Image,preloadAnimTimer=0,zoomActive=new Array,zoomTimer=new Array,zoomOrigW=new Array,zoomOrigH=new Array,zoomOrigX=new Array,zoomOrigY=new Array,zoomID="ZoomBox",theID="ZoomImage",zoomCaption="ZoomCaption",zoomCaptionDiv="ZoomCapDiv",browserIsIE;function setupZoom(){prepZooms(),insertZoomHTML(),zoomdiv=document.getElementById(zoomID),zoomimg=document.getElementById(theID)}function prepZooms(){if(document.getElementsByTagName){var e=document.getElementsByTagName("a");for(i=0;i<e.length;i++)e[i].getAttribute("href")&&-1!=e[i].getAttribute("href").search(/(.*)\.(jpg|jpeg|gif|png|bmp|tif|tiff)/gi)&&"nozoom"!=e[i].getAttribute("rel")&&(e[i].onclick=function(e){return zoomClick(this,e)},e[i].onmouseover=function(){zoomPreload(this)})}}function zoomPreload(e){var o=e.getAttribute("href");-1==imgPreload.src.indexOf(e.getAttribute("href").substr(e.getAttribute("href").lastIndexOf("/")))&&(preloadActive=!0,(imgPreload=new Image).onload=function(){preloadActive=!1},imgPreload.src=o)}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(e){0!=preloadActive?(document.getElementById("SpinImage").src=zoomImagesURI+"zoom-spin-"+preloadFrame+".png",12<++preloadFrame&&(preloadFrame=1)):(document.getElementById("ZoomSpin").style.visibility="hidden",clearInterval(preloadAnimTimer),preloadAnimTimer=0,zoomIn(preloadFrom))}function zoomClick(e,o){var t=getShift(o);return!(o||!window.event||!window.event.metaKey&&!window.event.altKey)||!(!o||!o.metaKey&&!o.altKey)||(getSize(),1==preloadActive?0==preloadAnimTimer&&(preloadFrom=e,preloadAnimStart()):zoomIn(e,t),!1)}function zoomIn(e,o){zoomimg.src=e.getAttribute("href"),startPos=e.childNodes[0].width?(startW=e.childNodes[0].width,startH=e.childNodes[0].height,findElementPos(e.childNodes[0])):(startW=50,startH=12,findElementPos(e)),hostX=startPos[0],hostY=startPos[1],document.getElementById("scroller")&&(hostX-=document.getElementById("scroller").scrollLeft),endW=imgPreload.width,endH=imgPreload.height,1!=zoomActive[theID]&&(document.getElementById("ShadowBox")?document.getElementById("ShadowBox").style.visibility="hidden":browserIsIE||(fadeActive.ZoomImage&&(clearInterval(fadeTimer.ZoomImage),fadeActive.ZoomImage=!1,fadeTimer.ZoomImage=!1),document.getElementById("ZoomImage").style.webkitBoxShadow=shadowSettings+"0.0)"),document.getElementById("ZoomClose").style.visibility="hidden",includeCaption&&(document.getElementById(zoomCaptionDiv).style.visibility="hidden",e.getAttribute("title")&&includeCaption?document.getElementById(zoomCaption).innerHTML=e.getAttribute("title"):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",1==includeFade&&setOpacity(0,zoomID),zoomdiv.style.visibility="visible",sizeRatio=endW/endH,endW>myWidth-minBorder&&(endW=myWidth-minBorder,endH=endW/sizeRatio),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=o?7*zoomSteps:zoomSteps,zoomCurrent=0,fadeAmount=1==includeFade?(fadeCurrent=0,-100/tempSteps):0,zoomTimer[theID]=setInterval("zoomElement('"+zoomID+"', '"+theID+"', "+zoomCurrent+", "+startW+", "+zoomChangeW+", "+startH+", "+zoomChangeH+", "+hostX+", "+zoomChangeX+", "+hostY+", "+zoomChangeY+", "+tempSteps+", "+includeFade+", "+fadeAmount+", 'zoomDoneIn(zoomID)')",zoomTime),zoomActive[theID]=!0)}function zoomOut(e,o){tempSteps=getShift(o)?7*zoomSteps:zoomSteps,1!=zoomActive[theID]&&(document.getElementById("ShadowBox")?document.getElementById("ShadowBox").style.visibility="hidden":browserIsIE||(fadeActive.ZoomImage&&(clearInterval(fadeTimer.ZoomImage),fadeActive.ZoomImage=!1,fadeTimer.ZoomImage=!1),document.getElementById("ZoomImage").style.webkitBoxShadow=shadowSettings+"0.0)"),document.getElementById("ZoomClose").style.visibility="hidden",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.he
36ight,zoomChangeX=zoomOrigX[theID]-startX,zoomChangeY=zoomOrigY[theID]-startY,zoomChangeW=zoomOrigW[theID]-startW,zoomChangeH=zoomOrigH[theID]-startH,zoomCurrent=0,fadeAmount=1==includeFade?(fadeCurrent=0,100/tempSteps):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]=!0)}function zoomDoneIn(e,o){zoomOpen=!0,e=document.getElementById(e),document.getElementById("ShadowBox")?(setOpacity(0,"ShadowBox"),shadowdiv=document.getElementById("ShadowBox"),shadowLeft=parseInt(e.style.left)-13,shadowTop=parseInt(e.style.top)-8,shadowWidth=e.offsetWidth+26,shadowHeight=e.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)):browserIsIE||fadeElementSetup("ZoomImage",0,.8,5,0,"shadow"),includeCaption&&""!=document.getElementById(zoomCaption).innerHTML&&((zoomcapd=document.getElementById(zoomCaptionDiv)).style.top=parseInt(e.style.top)+(e.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(e,o){zoomOpen=!1,zoomOrigH[o]="",zoomOrigW[o]="",document.getElementById(e).style.visibility="hidden",zoomActive[o],document.onkeypress=null}function zoomElement(zoomdiv,theID,zoomCurrent,zoomStartW,zoomChangeW,zoomStartH,zoomChangeH,zoomStartX,zoomChangeX,zoomStartY,zoomChangeY,zoomSteps,includeFade,fadeAmount,execWhenDone){zoomCurrent==zoomSteps+1?(zoomActive[theID]=!1,clearInterval(zoomTimer[theID]),""!=execWhenDone&&eval(execWhenDone)):(1==includeFade&&setOpacity(fadeAmount<0?Math.abs(zoomCurrent*fadeAmount):100-zoomCurrent*fadeAmount,zoomdiv),moveW=cubicInOut(zoomCurrent,zoomStartW,zoomChangeW,zoomSteps),moveH=cubicInOut(zoomCurrent,zoomStartH,zoomChangeH,zoomSteps),moveX=cubicInOut(zoomCurrent,zoomStartX,zoomChangeX,zoomSteps),moveY=cubicInOut(zoomCurrent,zoomStartY,zoomChangeY,zoomSteps),document.getElementById(zoomdiv).style.left=moveX+"px",document.getElementById(zoomdiv).style.top=moveY+"px",zoomimg.style.width=moveW+"px",zoomimg.style.height=moveH+"px",zoomCurrent++,clearInterval(zoomTimer[theID]),zoomTimer[theID]=setInterval("zoomElement('"+zoomdiv+"', '"+theID+"', "+zoomCurrent+", "+zoomStartW+", "+zoomChangeW+", "+zoomStartH+", "+zoomChangeH+", "+zoomStartX+", "+zoomChangeX+", "+zoomStartY+", "+zoomChangeY+", "+zoomSteps+", "+includeFade+", "+fadeAmount+", '"+execWhenDone+"')",zoomTime))}function getKey(e){27==(theKey=(e||event).keyCode)&&zoomOut(this,e)}function fadeOut(e){e.id&&fadeElementSetup(e.id,100,0,10)}function fadeIn(e){e.id&&fadeElementSetup(e.id,0,100,10)}-1!=navigator.userAgent.indexOf("MSIE")&&(browserIsIE=!0);var fadeActive=new Array,fadeQueue=new Array,fadeTimer=new Array,fadeClose=new Array,fadeMode=new Array;function fadeElementSetup(e,o,t,n,m,i){1==fadeActive[e]?fadeQueue[e]=new Array(e,o,t,n):(fadeSteps=n,fadeCurrent=0,fadeAmount=(o-t)/fadeSteps,fadeTimer[e]=setInterval("fadeElement('"+e+"', '"+fadeCurrent+"', '"+fadeAmount+"', '"+fadeSteps+"')",15),fadeActive[e]=!0,fadeMode[e]=i,fadeClose[e]=1==m)}function fadeElement(e,o,t,n){o==n?(clearInterval(fadeTimer[e]),fadeActive[e]=!1,fadeTimer[e]=!1,1==fadeClose[e]&&(document.getElementById(e).style.visibility="hidden"),fadeQueue[e]&&0!=fadeQueue[e]&&(fadeElementSetup(fadeQueue[e][0],fadeQueue[e][1],fadeQueue[e][2],fadeQueue[e][3]),fadeQueue[e]=!1)):(o++,"shadow"==fadeMode[e]?document.getElementById(e).style.webkitBoxShadow=t<0?shadowSettings+Math.abs(o*t)+")":shadowSettings+(100-o*t)+")":setOpacity(t<0?Math.abs(o*t):100-o*t,e),clearInterval(fadeTimer[e]),fadeTimer[e]=setInterval("fadeElement('"+e+"', '"+o+"', '"+t+"', '"+n+"')",15))}function setOpacity(e,o){o=document.getElementById(o).style;-1!=navigator.userAgent.indexOf("Firefox")&&100==e&&(e=99.9999),o.filter="alpha(opacity="+e+")",o.opacity=e/100}function linear(e,o,t,n){return t*e/n+o}function sineInOut(e,o,t,n){return-t/2*(Math.cos(Math.PI*e/n)-1)+o}function cubicIn(e,o,t,n){return t*(e/=n)*e*e+o}function cubicOut(e,o,t,n){return t*((e=e/n-1)*e*e+1)+o}function cubicInOut(e,o,t,n){return(e/=n/2)<1?t/2*e*e*e+o:t/2*((e-=2)*e*e+2)+o}function bounceOut(e,o,t,n){return(e/=n)<1/2.75?t*(7.5625*e*e)+o:e<2/2.75?t*(7.5625*(e-=1.5/2.75)*e+.75)+o:e<2.5/2.75?t*(7.5625*(e-=2.25/2.75)*e+.9375)+o:t*(7.5625*(e-=2.625/2.75)*e+.984375)+o}
36function getSize(){self.innerHeight?(myWidth=window.innerWidth,myHeight=window.innerHeight,myScroll=window.pageYOffset):document.documentElement&&document.documentElement.clientHeight?(myWidth=document.documentElement.clientWidth,myHeight=document.documentElement.clientHeight,myScroll=document.documentElement.scrollTop):document.body&&(myWidth=document.body.clientWidth,myHeight=document.body.clientHeight,myScroll=document.body.scrollTop),myScrollHeight=window.innerHeight&&window.scrollMaxY?(myScrollWidth=document.body.scrollWidth,window.innerHeight+window.scrollMaxY):document.body.scrollHeight>document.body.offsetHeight?(myScrollWidth=document.body.scrollWidth,document.body.scrollHeight):(myScrollWidth=document.body.offsetWidth,document.body.offsetHeight)}function getShift(e){var o=!1;return!e&&window.event?o=window.event.shiftKey:e&&(o=e.shiftKey)&&e.stopPropagation(),o}function findElementPos(e){for(var o=0,t=0;o+=e.offsetLeft,t+=e.offsetTop,e=e.offsetParent;);return Array(o,t)}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.