var zoomTime=5;var zoomSteps=15;var includeFade=1;var minBorder=90;var shadowSettings="0px 5px 25px rgba(0, 0, 0, ";var zoomImagesURI="/zoom/";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";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 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(b){var a=b.getAttribute("href");if(imgPreload.src.indexOf(b.getAttribute("href").substr(b.getAttribute("href").lastIndexOf("/")))==-1){preloadActive=true;imgPreload=new Image();imgPreload.onload=function(){preloadActive=false};imgPreload.src=a}}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(c,b){var a=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=c;preloadAnimStart()}}else{zoomIn(c,a)}return false}function zoomIn(b,a){zoomimg.src=b.getAttribute("href");if(b.childNodes[0].width){startW=b.childNodes[0].width;startH=b.childNodes[0].height;startPos=findElementPos(b.childNodes[0])}else{startW=50;startH=12;startPos=findElementPos(b)}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";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,a){if(getShift(a)){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";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(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{if(!browserIsIE){fadeElementSetup("ZoomImage",0,0.8,5,0,"shadow")}}if(!browserIsIE){setOpacity(0,"ZoomClose")}document.getElementById("ZoomClose").style.visibility="visible";if(!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";zoomActive[b]==false;document.onkeypress=null}function zoomElement(zoomdiv,theID,zoomCurrent,zoomStartW,zoomChangeW,zoomStartH,zoomChangeH,zoomStartX,zoomChangeX,zoomStartY,zoomChangeY,zoomSteps,includeFade,fadeAmount,execWhenDone){if(zoomCurrent==(zoomSteps+1)){zoomActive[theID]=false;clearInterval(zoomTimer[theID]);if(execWhenDone!=""){eval(execWhenDone)}}else{if(includeFade==1){if(fadeAmount<0){setOpacity(Math.abs(zoomCurrent*fadeAmount),zoomdiv)}else{setOpacity(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(a){if(!a){theKey=event.keyCode}else{theKey=a.keyCode}if(theKey==27){zoomOut(this,a)}}function fadeOut(a){if(a.id){fadeElementSetup(a.id,100,0,10)}}function fadeIn(a){if(a.id){fadeElementSetup(a.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(d,f,c,b,e,a){if(fadeActive[d]==true){fadeQueue[d]=new Array(d,f,c,b)}else{fadeSteps=b;fadeCurrent=0;fadeAmount=(f-c)/fadeSteps;fadeTimer[d]=setInterval("fadeElement('"+d+"', '"+fadeCurrent+"', '"+fadeAmount+"', '"+fadeSteps+"')",15);fadeActive[d]=true;fadeMode[d]=a;if(e==1){fadeClose[d]=true}else{fadeClose[d]=false}}}function fadeElement(b,d,a,c){if(d==c){clearInterval(fadeTimer[b]);fadeActive[b]=false;fadeTimer[b]=false;if(fadeClose[b]==true){document.getElementById(b).style.visibility="hidden"}if(fadeQueue[b]&&fadeQueue[b]!=false){fadeElementSetup(fadeQueue[b][0],fadeQueue[b][1],fadeQueue[b][2],fadeQueue[b][3]);fadeQueue[b]=false}}else{d++;if(fadeMode[b]=="shadow"){if(a<0){document.getElementById(b).style.webkitBoxShadow=shadowSettings+(Math.abs(d*a))+")"}else{document.getElementById(b).style.webkitBoxShadow=shadowSettings+(100-(d*a))+")"}}else{if(a<0){setOpacity(Math.abs(d*a),b)}else{setOpacity(100-(d*a),b)}}clearInterval(fadeTimer[b]);fadeTimer[b]=setInterval("fadeElement('"+b+"', '"+d+"', '"+a+"', '"+c+"')",15)}}function setOpacity(c,a){var b=document.getElementById(a).style;if(navigator.userAgent.indexOf("Firefox")!=-1){if(c==100){c=99.9999}}b.filter="alpha(opacity="+c+")";b.opacity=(c/100)}function linear(e,a,g,f){return g*e/f+a}function sineInOut(e,a,g,f){return -g/2*(Math.cos(Math.PI*e/f)-1)+a}function cubicIn(e,a,g,f){return g*(e/=f)*e*e+a}function cubicOut(e,a,g,f){return g*((e=e/f-1)*e*e+1)+a}function cubicInOut(e,a,g,f){if((e/=f/2)<1){return g/2*e*e*e+a}return g/2*((e-=2)*e*e+2)+a}function bounceOut(e,a,g,f){if((e/=f)<(1/2.75)){return g*(7.5625*e*e)+a}else{if(e<(2/2.75)){return g*(7.5625*(e-=(1.5/2.75))*e+0.75)+a}else{if(e<(2.5/2.75)){return g*(7.5625*(e-=(2.25/2.75))*e+0.9375)+a}else{return g*(7.5625*(e-=(2.625/2.75))*e+0.984375)+a}}}}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(b){var a=false;if(!b&&window.event){a=window.event.shiftKey}else{if(b){a=b.shiftKey;if(a){b.stopPropagation()}}}return a}function findElementPos(a){var c=0;var b=0;do{c+=a.offsetLeft;b+=a.offsetTop}while(a=a.offsetParent);return Array(c,b)}function insertZoomHTML(){var g=document.getElementsByTagName("body").item(0);var h=document.createElement("div");h.setAttribute("id","ZoomSpin");h.style.position="absolute";h.style.left="10px";h.style.top="10px";h.style.visibility="hidden";h.style.zIndex="525";g.insertBefore(h,g.firstChild);var d=document.createElement("img");d.setAttribute("id","SpinImage");d.setAttribute("src",zoomImagesURI+"zoom-spin-1.png");h.appendChild(d);var C=document.createElement("div");C.setAttribute("id","ZoomBox");C.style.position="absolute";C.style.left="10px";C.style.top="10px";C.style.visibility="hidden";C.style.zIndex="499";g.insertBefore(C,h.nextSibling);var m=document.createElement("img");m.onclick=function(F){zoomOut(this,F);return false};m.setAttribute("src",zoomImagesURI+"spacer.gif");m.setAttribute("id","ZoomImage");m.setAttribute("border","0");m.setAttribute("style","-webkit-box-shadow: "+shadowSettings+"0.0)");m.style.display="block";m.style.width="10px";m.style.height="10px";m.style.cursor="pointer";C.appendChild(m);var f=document.createElement("div");f.setAttribute("id","ZoomClose");f.style.position="absolute";if(browserIsIE){f.style.left="-1px";f.style.top="0px"}else{f.style.left="-15px";f.style.top="-15px"}f.style.visibility="hidden";C.appendChild(f);var k=document.createElement("img");k.onclick=function(F){zoomOut(this,F);return false};k.setAttribute("src",zoomImagesURI+"closebox.png");k.setAttribute("width","30");k.setAttribute("height","30");k.setAttribute("border","0");k.style.cursor="pointer";f.appendChild(k);if(!document.getElementById("ZoomImage").style.webkitBoxShadow&&!browserIsIE){var v=document.createElement("div");v.setAttribute("id","ShadowBox");v.style.position="absolute";v.style.left="50px";v.style.top="50px";v.style.width="100px";v.style.height="100px";v.style.visibility="hidden";v.style.zIndex="498";g.insertBefore(v,C.nextSibling);var e=document.createElement("table");e.setAttribute("border","0");e.setAttribute("width","100%");e.setAttribute("height","100%");e.setAttribute("cellpadding","0");e.setAttribute("cellspacing","0");v.appendChild(e);var j=document.createElement("tbody");e.appendChild(j);var x=document.createElement("tr");x.style.height="25px";j.appendChild(x);var A=document.createElement("td");A.style.width="27px";x.appendChild(A);var B=document.createElement("img");B.setAttribute("src",zoomImagesURI+"zoom-shadow1.png");B.setAttribute("width","27");B.setAttribute("height","25");B.style.display="block";A.appendChild(B);var y=document.createElement("td");y.setAttribute("background",zoomImagesURI+"zoom-shadow2.png");x.appendChild(y);var c=document.createElement("img");c.setAttribute("src",zoomImagesURI+"spacer.gif");c.setAttribute("height","1");c.setAttribute("width","1");c.style.display="block";y.appendChild(c);var w=document.createElement("td");w.style.width="27px";x.appendChild(w);var z=document.createElement("img");z.setAttribute("src",zoomImagesURI+"zoom-shadow3.png");z.setAttribute("width","27");z.setAttribute("height","25");z.style.display="block";w.appendChild(z);inRow2=document.createElement("tr");j.appendChild(inRow2);var u=document.createElement("td");u.setAttribute("background",zoomImagesURI+"zoom-shadow4.png");inRow2.appendChild(u);var b=document.createElement("img");b.setAttribute("src",zoomImagesURI+"spacer.gif");b.setAttribute("height","1");b.setAttribute("width","1");b.style.display="block";u.appendChild(b);var s=document.createElement("td");s.setAttribute("bgcolor","#ffffff");inRow2.appendChild(s);var a=document.createElement("img");a.setAttribute("src",zoomImagesURI+"spacer.gif");a.setAttribute("height","1");a.setAttribute("width","1");a.style.display="block";s.appendChild(a);var r=document.createElement("td");r.setAttribute("background",zoomImagesURI+"zoom-shadow5.png");inRow2.appendChild(r);var E=document.createElement("img");E.setAttribute("src",zoomImagesURI+"spacer.gif");E.setAttribute("height","1");E.setAttribute("width","1");E.style.display="block";r.appendChild(E);var t=document.createElement("tr");t.style.height="26px";j.appendChild(t);var p=document.createElement("td");p.style.width="27px";t.appendChild(p);var q=document.createElement("img");q.setAttribute("src",zoomImagesURI+"zoom-shadow6.png");q.setAttribute("width","27");q.setAttribute("height","26");q.style.display="block";p.appendChild(q);var o=document.createElement("td");o.setAttribute("background",zoomImagesURI+"zoom-shadow7.png");t.appendChild(o);var D=document.createElement("img");D.setAttribute("src",zoomImagesURI+"spacer.gif");D.setAttribute("height","1");D.setAttribute("width","1");D.style.display="block";o.appendChild(D);var l=document.createElement("td");l.style.width="27px";t.appendChild(l);var n=document.createElement("img");n.setAttribute("src",zoomImagesURI+"zoom-shadow8.png");n.setAttribute("width","27");n.setAttribute("height","26");n.style.display="block";l.appendChild(n)}};