(function(){var O=window,I=O.document,N=I.getElementById("holds_menu"),M=I.getElementById("holds_submenu"),D=new RegExp("^(function|object)$","i"),L=[],J,H,F,A,E=new O.Image();function B(Q,R){var P=typeof Q[R];return !!((D.test(P)&&Q[R])||P==="unknown");}function K(P){P=P||O.event;return P.target||P.srcElement;}function G(){M.style.display="block";}function C(){N.className="";M.style.display="none";}I.body.onclick=function(Q){var P=K(Q);if(P.id==="holds_menu"){if(N.className==="menu_out"){C();}else{N.className="menu_out";G();}return false;}else{C();return true;}};if(I.body.id==="holds"){J=I.getElementsByTagName("div");for(F=0;F<J.length;F+=1){if(J[F].className==="hold_category"){L.push(J[F]);}}H=L.length;I.getElementById("categories").style.display="block";I.getElementById("category").onchange=function(){var P;if(this.value==="all"){for(P=0;P<H;P+=1){L[P].style.display="block";}}else{for(P=0;P<H;P+=1){if(L[P].id!==this.value){L[P].style.display="none";}else{L[P].style.display="block";}}}};}if(I.getElementById("images")){E.src="/images/loading.gif";E.src="/images/close.png";I.getElementById("images").onclick=function(R){var Q=K(R),P;if(Q.parentNode.href){if(B(I,"clientWidth")){if(typeof I.clientWidth==="number"){A={width:I.clientWidth,height:I.clientHeight};}}else{if(B(I,"documentElement")){if(typeof I.documentElement.clientWidth==="number"){A={width:I.documentElement.clientWidth,height:I.documentElement.clientHeight};}}else{if(B(O,"innerWidth")){A={width:O.innerWidth,height:O.innerHeight};}}}P=I.createElement("div");P.id="overlay";P.style.backgroundPosition=(((A.width/2)-16)+"px ")+(((A.height/2)-16)+"px");I.body.style.overflow="hidden";I.body.appendChild(P);P.onclick=function(){I.body.removeChild(P);I.body.removeChild(I.getElementById("overlay_image"));I.body.removeChild(I.getElementById("close"));};E.src=Q.parentNode.href;E.onload=function(){P.style.backgroundImage="none";var U=E.width,S=E.height,V=I.createElement("img"),T,W;V.id="overlay_image";V.src=E.src;if(U<A.width&&S<A.height){V.style.top=(A.height-S)/2+"px";V.style.left=(A.width-U)/2+"px";I.body.appendChild(V);}else{T=U/S;if(U>A.width){U=A.width-100;S=U/T;V.style.width=U+"px";V.style.top=(A.height-S)/2+"px";V.style.left=(A.width-U)/2+"px";}else{if(S>A.height){S=A.height-100;U=S*T;V.style.height=S+"px";V.style.top=(A.height-S)/2+"px";V.style.left=(A.width-U)/2+"px";}}I.body.appendChild(V);}W=I.createElement("div");W.id="close";W.style.top=((A.height-S)/2)+"px";W.style.left=((A.width-U)/2)+"px";I.body.appendChild(W);W.onclick=function(){I.body.removeChild(P);I.body.removeChild(V);I.body.removeChild(W);};};}return false;};}}());

