function Gallery(B,C){var A=this;this.linkBaseId=B;this.hiding=true;this.emptyThumb=C;JSEvents.AttachEvent(window,"load",function(D){A.onLoad(D);return false},false,false)}Gallery.prototype={onLoad:function(B){if(!document.getElementById){return }var C=this,D=40,A,E,F;this.pictureViewFrame=GetElement("pictureViewFrame");D=40;A=GetPageSize();this.pictureViewFrame.style.position="absolute";this.pictureViewFrame.style.display="none";this.pictureViewFrame.style.top="0px";this.pictureViewFrame.style.left="0px";this.pictureViewFrame.style.zIndex="101";this.pictureViewFrame.style.width=A.width+"px";this.pictureViewFrame.style.height=A.height+"px";this.pictureViewFrame.style.backgroundColor="black";this.pictureViewFrame.style.opacity=D/100;this.pictureViewFrame.style.filter="alpha(opacity="+D+")";this.pictureLayer=GetElement("pictureLayer");this.pictureView=GetElement("pictureView");this.pictureView.style.position="absolute";this.pictureView.visible=false;this.pictureView.style.zIndex="102";this.pictureViewImg=GetElement("pictureViewImg");this.pictureViewImg.visible=false;this.pictureViewImg.style.zIndex="102";this.pictureViewImg.style.cursor="pointer";JSEvents.AttachEvent(this.pictureViewImg,"mouseup",function(G){return C.onPictureViewImgMouseUp(G)},false,false);JSEvents.AttachEvent(this.pictureViewFrame,"mouseup",function(G){C.hide();JSEvents.StopPropagation(G);JSEvents.PreventDefault(G);return false},false,false);JSEvents.AttachEvent("closePicture","click",function(G){C.hide();JSEvents.StopPropagation(G);JSEvents.PreventDefault(G);return false},false,false);for(E=0;E<document.links.length;E++){if(document.links[E].id.search(this.linkBaseId)==0){F=document.links[E];JSEvents.AttachEvent(F,"click",function(G){return C.onLinkClicked(G)},true,false)}}},onLinkClicked:function(A){var B=JSEvents.GetEvtTarget(A);if(!B.url){B.url=B.parentNode.href}this.showPicture(B);JSEvents.StopPropagation(A);JSEvents.PreventDefault(A);return false},onPictureViewImgMouseUp:function(A){this.hide();JSEvents.StopPropagation(A);JSEvents.PreventDefault(A);return false},showImageFrame:function(){var A=GetPageSize();this.pictureViewFrame.style.width=A.width+"px";this.pictureViewFrame.style.height=A.height+"px";this.pictureViewFrame.style.display="block"},hide:function(){this.pictureViewFrame.style.display="none";this.pictureView.style.display="none";this.hiding=true},showPicture:function(G){var C,E,D,F,A,B;this.hiding=false;this.showImageFrame();C=this;E=new Image();this.pictureViewImg.style.display="none";this.pictureViewImg.src=this.emptyThumb;D=GetWinSize();F=GetScrollPos();A=Math.floor(F.scrollLeft+(D.width-50)/2)-20;B=Math.floor(F.scrollTop+(D.height-50)/2)-20;this.pictureLayer.style.height="50px";this.pictureView.style.top=B+"px";this.pictureView.style.left=A+"px";this.pictureView.style.width=80+"px";this.pictureView.style.height=94+"px";this.pictureView.style.display="block";JSEvents.AttachEvent(E,"load",function(){if(C.hiding){return }var J,K,H,I;C.pictureViewImg.src=G.url;J=GetWinSize();K=GetScrollPos();H=Math.floor(K.scrollLeft+(J.width-E.width)/2)-20;I=Math.floor(K.scrollTop+(J.height-E.height)/2)-20;C.pictureView.style.top=I+"px";C.pictureView.style.left=H+"px";C.pictureView.style.width=E.width+20+"px";C.pictureView.style.height=E.height+44+"px";C.pictureLayer.style.height=E.height+"px";C.hiding=false;C.pictureViewImg.style.display="block"},false,false);E.src=G.url}};