var includeCaption=true;var zoomTime=5;var zoomSteps=15;var includeFade=1;var minBorder=90;var shadowSettings="0px 5px 25px rgba(0, 0, 0, ";var zoomImagesURI="/images/zoom/";var myWidth=0,myHeight=0,myScroll=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 zoomBrowser={Version:(navigator.userAgent.match(/.+(?:rv|it|ra|IE)[\/: ]([\d.]+)/)||[])[1],IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/),IsOldIE:function(){return this.IE&&parseInt(this.Version)<7}};if(zoomBrowser.IE){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)(\?\d+)?/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";if(includeCaption){document.getElementById(zoomCaptionDiv).style.visibility="hidden";if(B.getAttribute("title")&&includeCaption){document.getElementById(zoomCaption).innerHTML=B.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}zoomChangeX=((myWidth/2)-(endW/2)-hostX);zoomChangeY=((Math.max(minBorder/2,(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";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(A,B){zoomOpen=true;A=document.getElementById(A);A.style.left=Math.round(parseFloat(A.style.left))+"px";A.style.top=Math.round(parseFloat(A.style.top))+"px";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(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"}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(B,A,D,C){return D*B/C+A}function sineInOut(B,A,D,C){return -D/2*(Math.cos(Math.PI*B/C)-1)+A}function cubicIn(B,A,D,C){return D*(B/=C)*B*B+A}function cubicOut(B,A,D,C){return D*((B=B/C-1)*B*B+1)+A}function cubicInOut(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B+A}return D/2*((B-=2)*B*B+2)+A}function bounceOut(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A}else{return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A}}}}function getSize(){if(zoomBrowser.WebKit&&!document.evaluate){myWidth=window.innerWidth;myHeight=window.innerHeight}else{if(zoomBrowser.Opera){myWidth=document.body.clientWidth;myHeight=document.body.clientHeight}else{myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight}}myScroll=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop}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 M=document.getElementsByTagName("body").item(0);var j=document.createElement("div");j.setAttribute("id","ZoomSpin");j.style.position="absolute";j.style.left="10px";j.style.top="10px";j.style.visibility="hidden";j.style.zIndex="525";M.insertBefore(j,M.firstChild);var U=document.createElement("img");U.setAttribute("id","SpinImage");U.setAttribute("src",zoomImagesURI+"zoom-spin-1.png");j.appendChild(U);var L=document.createElement("div");L.setAttribute("id","ZoomBox");L.style.position="absolute";L.style.left="10px";L.style.top="10px";L.style.visibility="hidden";L.style.zIndex="499";M.insertBefore(L,j.nextSibling);var V=document.createElement("img");V.onclick=function(q){zoomOut(this,q);return false};V.setAttribute("src",zoomImagesURI+"spacer.gif");V.setAttribute("id","ZoomImage");V.setAttribute("border","0");V.setAttribute("style","-webkit-box-shadow: "+shadowSettings+"0.0)");V.style.display="block";V.style.width="10px";V.style.height="10px";V.style.cursor="pointer";L.appendChild(V);var R=document.createElement("div");R.setAttribute("id","ZoomClose");R.style.position="absolute";if(browserIsIE){R.style.left="-1px";R.style.top="0px"}else{R.style.left="-15px";R.style.top="-15px"}R.style.visibility="hidden";L.appendChild(R);var S=document.createElement("img");S.onclick=function(q){zoomOut(this,q);return false};if(zoomBrowser.IsOldIE()){S.setAttribute("src",zoomImagesURI+"closebox-alt.png");S.setAttribute("width","89");S.setAttribute("height","31")}else{S.setAttribute("src",zoomImagesURI+"closebox.png");S.setAttribute("width","30");S.setAttribute("height","30")}S.setAttribute("border","0");S.style.cursor="pointer";R.appendChild(S);if(!document.getElementById("ZoomImage").style.webkitBoxShadow&&!browserIsIE){var Q=document.createElement("div");Q.setAttribute("id","ShadowBox");Q.style.position="absolute";Q.style.left="50px";Q.style.top="50px";Q.style.width="100px";Q.style.height="100px";Q.style.visibility="hidden";Q.style.zIndex="498";M.insertBefore(Q,L.nextSibling);var T=document.createElement("table");T.setAttribute("border","0");T.setAttribute("width","100%");T.setAttribute("height","100%");T.setAttribute("cellpadding","0");T.setAttribute("cellspacing","0");Q.appendChild(T);var D=document.createElement("tbody");T.appendChild(D);var P=document.createElement("tr");P.style.height="25px";D.appendChild(P);var n=document.createElement("td");n.style.width="27px";P.appendChild(n);var f=document.createElement("img");f.setAttribute("src",zoomImagesURI+"zoom-shadow1.png");f.setAttribute("width","27");f.setAttribute("height","25");f.style.display="block";n.appendChild(f);var m=document.createElement("td");m.setAttribute("background",zoomImagesURI+"zoom-shadow2.png");P.appendChild(m);var C=document.createElement("img");C.setAttribute("src",zoomImagesURI+"spacer.gif");C.setAttribute("height","1");C.setAttribute("width","1");C.style.display="block";m.appendChild(C);var l=document.createElement("td");l.style.width="27px";P.appendChild(l);var c=document.createElement("img");c.setAttribute("src",zoomImagesURI+"zoom-shadow3.png");c.setAttribute("width","27");c.setAttribute("height","25");c.style.display="block";l.appendChild(c);inRow2=document.createElement("tr");D.appendChild(inRow2);var k=document.createElement("td");k.setAttribute("background",zoomImagesURI+"zoom-shadow4.png");inRow2.appendChild(k);var B=document.createElement("img");B.setAttribute("src",zoomImagesURI+"spacer.gif");B.setAttribute("height","1");B.setAttribute("width","1");B.style.display="block";k.appendChild(B);var h=document.createElement("td");h.setAttribute("bgcolor","#ffffff");inRow2.appendChild(h);var A=document.createElement("img");A.setAttribute("src",zoomImagesURI+"spacer.gif");A.setAttribute("height","1");A.setAttribute("width","1");A.style.display="block";h.appendChild(A);var g=document.createElement("td");g.setAttribute("background",zoomImagesURI+"zoom-shadow5.png");inRow2.appendChild(g);var p=document.createElement("img");p.setAttribute("src",zoomImagesURI+"spacer.gif");p.setAttribute("height","1");p.setAttribute("width","1");p.style.display="block";g.appendChild(p);var O=document.createElement("tr");O.style.height="26px";D.appendChild(O);var e=document.createElement("td");e.style.width="27px";O.appendChild(e);var a=document.createElement("img");a.setAttribute("src",zoomImagesURI+"zoom-shadow6.png");a.setAttribute("width","27");a.setAttribute("height","26");a.style.display="block";e.appendChild(a);var d=document.createElement("td");d.setAttribute("background",zoomImagesURI+"zoom-shadow7.png");O.appendChild(d);var o=document.createElement("img");o.setAttribute("src",zoomImagesURI+"spacer.gif");o.setAttribute("height","1");o.setAttribute("width","1");o.style.display="block";d.appendChild(o);var b=document.createElement("td");b.style.width="27px";O.appendChild(b);var Z=document.createElement("img");Z.setAttribute("src",zoomImagesURI+"zoom-shadow8.png");Z.setAttribute("width","27");Z.setAttribute("height","26");Z.style.display="block";b.appendChild(Z)}if(includeCaption){var F=document.createElement("div");F.setAttribute("id","ZoomCapDiv");F.style.position="absolute";F.style.visibility="hidden";F.style.marginLeft="auto";F.style.marginRight="auto";F.style.paddingBottom="15px";F.style.zIndex="501";M.insertBefore(F,L.nextSibling);var H=document.createElement("table");H.setAttribute("border","0");H.setAttribute("cellPadding","0");H.setAttribute("cellSpacing","0");F.appendChild(H);var N=document.createElement("tbody");H.appendChild(N);var K=document.createElement("tr");N.appendChild(K);var Y=document.createElement("td");Y.setAttribute("align","right");K.appendChild(Y);if(zoomBrowser.IsOldIE()){var J=document.createElement("div");J.style.width="13px";J.style.height="26px";J.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+zoomImagesURI+"zoom-caption-l.png',sizingMethod='scale')";Y.appendChild(J)}else{var G=document.createElement("img");G.setAttribute("src",zoomImagesURI+"zoom-caption-l.png");G.setAttribute("width","13");G.setAttribute("height","26");G.style.display="block";Y.appendChild(G)}var X=document.createElement("td");X.setAttribute("background",zoomImagesURI+"zoom-caption-fill.png");X.setAttribute("id","ZoomCaption");X.setAttribute("valign","middle");X.style.fontSize="14px";X.style.fontFamily="Helvetica";X.style.fontWeight="bold";X.style.color="#ffffff";X.style.textShadow="0px 2px 4px #000000";X.style.whiteSpace="nowrap";K.appendChild(X);var W=document.createElement("td");K.appendChild(W);if(zoomBrowser.IsOldIE()){var I=document.createElement("div");I.style.width="13px";I.style.height="26px";I.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+zoomImagesURI+"zoom-caption-r.png',sizingMethod='scale')";W.appendChild(I)}else{var E=document.createElement("img");E.setAttribute("src",zoomImagesURI+"zoom-caption-r.png");E.setAttribute("width","13");E.setAttribute("height","26");E.style.display="block";W.appendChild(E)}}};