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=Settings.Host+"share/js/fancyzoom/img/";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";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";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;}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";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);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(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 l=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";l.insertBefore(H,l.firstChild);var t=document.createElement("img");t.setAttribute("id","SpinImage");t.setAttribute("src",zoomImagesURI+"zoom-spin-1.png");H.appendChild(t);var k=document.createElement("div");k.setAttribute("id","ZoomBox");k.style.position="absolute";k.style.left="10px";k.style.top="10px";k.style.visibility="hidden";k.style.zIndex="499";l.insertBefore(k,H.nextSibling);var u=document.createElement("img");u.onclick=function(O){zoomOut(this,O);return false;};u.setAttribute("src",zoomImagesURI+"spacer.gif");u.setAttribute("id","ZoomImage");u.setAttribute("border","0");u.setAttribute("style","-webkit-box-shadow: "+shadowSettings+"0.0)");u.style.display="block";u.style.width="10px";u.style.height="10px";u.style.cursor="pointer";k.appendChild(u);var q=document.createElement("div");q.setAttribute("id","ZoomClose");q.style.position="absolute";if(browserIsIE){q.style.left="-1px";q.style.top="0px";}else{q.style.left="-15px";q.style.top="-15px";}q.style.visibility="hidden";k.appendChild(q);var r=document.createElement("img");r.onclick=function(O){zoomOut(this,O);return false;};r.setAttribute("src",zoomImagesURI+"closebox.png");r.setAttribute("width","30");r.setAttribute("height","30");r.setAttribute("border","0");r.style.cursor="pointer";q.appendChild(r);if(!document.getElementById("ZoomImage").style.webkitBoxShadow&&!browserIsIE){var p=document.createElement("div");p.setAttribute("id","ShadowBox");p.style.position="absolute";p.style.left="50px";p.style.top="50px";p.style.width="100px";p.style.height="100px";p.style.visibility="hidden";p.style.zIndex="498";l.insertBefore(p,k.nextSibling);var s=document.createElement("table");s.setAttribute("border","0");s.setAttribute("width","100%");s.setAttribute("height","100%");s.setAttribute("cellpadding","0");s.setAttribute("cellspacing","0");p.appendChild(s);var d=document.createElement("tbody");s.appendChild(d);var o=document.createElement("tr");o.style.height="25px";d.appendChild(o);var L=document.createElement("td");L.style.width="27px";o.appendChild(L);var E=document.createElement("img");E.setAttribute("src",zoomImagesURI+"zoom-shadow1.png");E.setAttribute("width","27");E.setAttribute("height","25");E.style.display="block";L.appendChild(E);var K=document.createElement("td");K.setAttribute("background",zoomImagesURI+"zoom-shadow2.png");o.appendChild(K);var c=document.createElement("img");c.setAttribute("src",zoomImagesURI+"spacer.gif");c.setAttribute("height","1");c.setAttribute("width","1");c.style.display="block";K.appendChild(c);var J=document.createElement("td");J.style.width="27px";o.appendChild(J);var B=document.createElement("img");B.setAttribute("src",zoomImagesURI+"zoom-shadow3.png");B.setAttribute("width","27");B.setAttribute("height","25");B.style.display="block";J.appendChild(B);inRow2=document.createElement("tr");d.appendChild(inRow2);var I=document.createElement("td");I.setAttribute("background",zoomImagesURI+"zoom-shadow4.png");inRow2.appendChild(I);var b=document.createElement("img");b.setAttribute("src",zoomImagesURI+"spacer.gif");b.setAttribute("height","1");b.setAttribute("width","1");b.style.display="block";I.appendChild(b);var G=document.createElement("td");G.setAttribute("bgcolor","#ffffff");inRow2.appendChild(G);var a=document.createElement("img");a.setAttribute("src",zoomImagesURI+"spacer.gif");a.setAttribute("height","1");a.setAttribute("width","1");a.style.display="block";G.appendChild(a);var F=document.createElement("td");F.setAttribute("background",zoomImagesURI+"zoom-shadow5.png");inRow2.appendChild(F);var N=document.createElement("img");N.setAttribute("src",zoomImagesURI+"spacer.gif");N.setAttribute("height","1");N.setAttribute("width","1");N.style.display="block";F.appendChild(N);var n=document.createElement("tr");n.style.height="26px";d.appendChild(n);var D=document.createElement("td");D.style.width="27px";n.appendChild(D);var z=document.createElement("img");z.setAttribute("src",zoomImagesURI+"zoom-shadow6.png");z.setAttribute("width","27");z.setAttribute("height","26");z.style.display="block";D.appendChild(z);var C=document.createElement("td");C.setAttribute("background",zoomImagesURI+"zoom-shadow7.png");n.appendChild(C);var M=document.createElement("img");M.setAttribute("src",zoomImagesURI+"spacer.gif");M.setAttribute("height","1");M.setAttribute("width","1");M.style.display="block";C.appendChild(M);var A=document.createElement("td");A.style.width="27px";n.appendChild(A);var y=document.createElement("img");y.setAttribute("src",zoomImagesURI+"zoom-shadow8.png");y.setAttribute("width","27");y.setAttribute("height","26");y.style.display="block";A.appendChild(y);}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.zIndex="501";l.insertBefore(f,k.nextSibling);var h=document.createElement("table");h.setAttribute("border","0");h.setAttribute("cellPadding","0");h.setAttribute("cellSpacing","0");f.appendChild(h);var m=document.createElement("tbody");h.appendChild(m);var j=document.createElement("tr");m.appendChild(j);var x=document.createElement("td");x.setAttribute("align","right");j.appendChild(x);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";x.appendChild(g);var w=document.createElement("td");w.setAttribute("background",zoomImagesURI+"zoom-caption-fill.png");w.setAttribute("id","ZoomCaption");w.setAttribute("valign","middle");w.style.fontSize="14px";w.style.fontFamily="Helvetica";w.style.fontWeight="bold";w.style.color="#ffffff";w.style.textShadow="0px 2px 4px #000000";w.style.whiteSpace="nowrap";j.appendChild(w);var v=document.createElement("td");j.appendChild(v);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";v.appendChild(e);}}document.observe("dom:loaded",setupZoom);
