AC.ViewMaster.ZoomViewer=Class.create({defaultOptions:{ViewerType:"Viewer",ZoomViewerType:"Viewer",ZoomAnimationDuration:0.4,ZoomViewerPadding:0,ZoomViewerOptions:{},hideNavBarForMobile:true,zoomString:"-zoomed",centerZoomedImage:false,fitToAxis:"x",minimumWidth:200,minimumHeight:50,makeZoomViewAsWideAsAllSections:false,localText:{close:"Close",next:"Next",previous:"Previous"}},initialize:function(d,a,f,b,e){this.delegate={};
this.view=null;this.zoom={};this.options=null;this.isZoomed=false;this.triggerClass=f;
this.options=Object.extend(Object.clone(this.defaultOptions),b);this.zoom.options=this.options.ZoomViewerOptions;
this.zoom.obj=(typeof e==="object"&&e.length>0)?e.slice(0):false;this._isMobile=AC.Detector.isMobile();
this._isiOS=AC.Detector.isiPad()||this._isMobile;this._supportsThreeD=AC.Detector.supportsThreeD();
this._isCSSAvailableTransition=AC.Detector.isCSSAvailable("transition");this._screenSize=this.getScreenSize();
this._viewportSize=this.getViewportSize();if(this._isiOS){document.body.addClassName("isiOS");
this.meta={};this.meta.width=this.getMetaViewportProperty("width");if(this.meta.width=="device-width"){this.meta.width==(this._screenSize[0]<this._screenSize[1])?this._screenSize[0]:this._screenSize[1]
}if(this.meta.width=="device-height"){this.meta.width==(this._screenSize[0]>this._screenSize[1])?this._screenSize[0]:this._screenSize[1]
}this.meta["maximum-scale-default"]=this.getMetaViewportProperty("maximum-scale")||"1.6";
this.meta["minimum-scale-default"]=this.getMetaViewportProperty("minimum-scale")||".25"
}this.options.ZoomViewerPadding=this._parsePadding(this.options.ZoomViewerPadding);
this._boundDidResizeWindow=this._didResizeWindow.bindAsEventListener(this);Event.observe(window,"resize",this._boundDidResizeWindow);
if(this._isiOS){this._boundDidChangeOrientation=this._didChangeOrientation.bindAsEventListener(this);
Event.observe(window,"orientationchange",this._boundDidChangeOrientation)}this._boundZoomTriggerClicked=this._zoomTriggerClicked.bindAsEventListener(this);
Event.observe(document.body,"click",this._boundZoomTriggerClicked);if(typeof this.options.ViewerType==="string"&&this.options.ViewerType in AC.ViewMaster){this.view=new AC.ViewMaster[this.options.ViewerType](d,a,this.triggerClass,this.options);
this.view.setDelegate(this);var c=navigator.userAgent.toLocaleLowerCase();if((/msie 6/.test(c))||(AC.Detector.isWebKit()&&c.indexOf("version/")!==-1&&parseFloat(c[c.indexOf("version/")+8])<4)){document.body.addClassName("noZoomView");
return false}if(this.zoom.obj){this._createZoom()}this._setViewEvents()}else{return false
}},setDelegate:function(a){this.delegate=a;if("shouldAnimateContentChange" in this.delegate){this.shouldAnimateContentChange=this.delegate.shouldAnimateContentChange
}if("willAnimate" in this.delegate){this.willAnimate=this.delegate.willAnimate}if("didAppendContent" in this.delegate){this.didAppendContent=this.delegate.didAppendContent
}},getScreenSize:function(){if(this._isiOS){this._orientation=(window.orientation==0||window.orientation==180)?"portrait":"landscape";
return(this._orientation=="landscape")?[window.screen.height,window.screen.width]:[window.screen.width,window.screen.height]
}else{return[window.screen.width,window.screen.height]}},getViewportSize:function(){var b=document.viewport.getDimensions();
if(this._isiOS){if(this._isMobile&&this.options.hideNavBarForMobile==true){var a=(this._orientation=="portrait")?1.3:0.555;
b.height=b.width*a}}return[b.width,b.height]},sectionObjectWidthId:function(c){var b=false;
if(typeof this.zoom.objects=="undefined"){return false}for(var a=0;a<this.zoom.objects.length;
a++){if(this.zoom.objects[a].id===c){return this.zoom.objects[a]}}return b},convertCurrentWidthAndHeightToEms:function(){var a=parseFloat(this.zoom.currentSectionObject.element.getStyle("font-size"));
this.zoom.currentSectionObject.element.setStyle("width: "+this.currentImageDimensions[0]/a+"em;");
this.zoom.currentSectionObject.element.setStyle("height: "+this.currentImageDimensions[1]/a+"em;")
},sort:function(c,b,a){function d(g,f){var e=a?f:g;var h=a?g:f;e=(e[b]==undefined)?-1:isNaN(e[b])?e[b].toLowerCase():e[b];
h=(h[b]==undefined)?-1:isNaN(h[b])?h[b].toLowerCase():h[b];return((e<h)?-1:((e>h)?1:0))
}c.sort(d);return c},getMetaViewportProperty:function(c){if(!this.meta.tag){this.meta.tag=Element.getElementsBySelector(document,'meta[name="viewport"]')[0]
}if(typeof this.meta.tag=="undefined"){delete this.meta.tag}else{var b=this.meta.tag.getAttribute("content");
if(b){b=b.split(",");for(var a=0;a<b.length;a++){b[a]=b[a].split("=");if(b[a][0]==c){return parseFloat(b[a][1])
}}}}return null},setMetaViewportProperty:function(c,b){if(!this.meta.tag){this.meta.tag=Element.getElementsBySelector(document,'meta[name="viewport"]');
this.meta.tag=this.meta.tag[this.meta.tag.length-1]}if(typeof this.meta.tag=="undefined"){delete this.meta.tag
}else{var a=this.meta.tag.getAttribute("content");if(a){this.meta.tag.remove();
a=a.replace(new RegExp(c+"=(.)*,","i"),"");a=a.replace(new RegExp(","+c+"=(.)*(^,|$)","i"),"");
a+=(a=="")?"":",";a+=c+"="+b;this.meta[c]=b;this.meta.tag.setAttribute("content",a);
Element.insert(document.body,this.meta.tag);return true}}return false},zoomInCurrentSection:function(a){var b=this.sectionObjectWidthId(this.view.currentSection.id);
if(b!==false){this.zoomIn(b)}},zoomIn:function(a){if(this.isZoomed===true){return false
}this._willZoomIn(a);this._willAnimateZoomIn();this._didZoomIn()},zoomOut:function(){if(this.isZoomed===false){return false
}this._willZoomOut();this._willAnimateZoomOut();this._didZoomOut()},willShow:function(b,c,a){if("willShow" in this.delegate){return this.delegate.willShow(b,c,a)
}},didShow:function(b,c,a){if("didShow" in this.delegate){return this.delegate.didShow(b,c,a)
}},_willZoomIn:function(a){this.isZoomed=true;this.view._locked=true;this.zoom.view._locked=false;
Element.addClassName(document.documentElement,"ZoomViewActive");if(this._isiOS){document.body.setStyle("height: "+this._viewportSize[1]+"px; overflow: hidden;");
this.setMetaViewportProperty("maximum-scale",1);if(this._isMobile&&this.options.hideNavBarForMobile==true){this.zoom.container.setStyle("height: "+this._viewportSize[1]+"px;");
(function(){window.scrollTo(0,1)}).delay(0.01)}}if(this.zoom.currentSectionObject.id!==this.view.currentSection.id){this.zoom.view.options.shouldAnimateContentChangeDefault=this.zoom.view.options.shouldAnimateContentChange||true;
this.zoom.view.options.shouldAnimateContentChange=false;this.zoom._removeOldContent=true;
this.zoom.view.show(this.zoom.view.sectionWithId(a.id+this.options.zoomString),true);
(function(){this.zoom.view.options.shouldAnimateContentChange=this.zoom.view.options.shouldAnimateContentChangeDefault;
delete this.zoom.view.options.shouldAnimateContentChangeDefault}.bind(this)).delay(this.options.ZoomAnimationDuration)
}this.zoom.currentSectionObject=a;this._setImageDimensions(a);if("willZoomIn" in this.delegate){return this.delegate.willZoomIn(this.view,this.zoom.view)
}},_didZoomIn:function(){if("didZoomIn" in this.delegate){return this.delegate.didZoomIn(this.view,this.zoom.view)
}},_willZoomOut:function(){this.isZoomed=false;this.zoom.view._locked=true;this.view._locked=false;
this._viewportSize=this.getViewportSize();Element.removeClassName(document.documentElement,"ZoomViewActive");
if(this._isiOS){document.body.setStyle("height: auto; overflow: auto;")}if(this.view.currentSection.id!==this.zoom.currentSectionObject.id){this.view.options.shouldAnimateContentChangeDefault=this.view.options.shouldAnimateContentChange||true;
this.view.options.shouldAnimateContentChange=false;this.view.show(this.view.sectionWithId(this.zoom.currentSectionObject.id),true);
(function(){this.view.options.shouldAnimateContentChange=this.view.options.shouldAnimateContentChangeDefault;
delete this.view.options.shouldAnimateContentChangeDefault}.bind(this)).delay(this.options.ZoomAnimationDuration)
}if("willZoomOut" in this.delegate){return this.delegate.willZoomOut(this.view,this.zoom.view)
}},_didZoomOut:function(){if(this._isiOS){this.setMetaViewportProperty("maximum-scale",this.meta["maximum-scale-default"])
}if("didZoomOut" in this.delegate){return this.delegate.didZoomOut(this.view,this.zoom.view)
}},_didChangeOrientation:function(a){this._screenSize=this.getScreenSize();this._viewportSize=this.getViewportSize();
if(this.isZoomed===true){this._didResizeWindow(a);document.body.setStyle("height: "+this._viewportSize[1]+"px; overflow: hidden;");
if(this._isMobile&&this.options.hideNavBarForMobile==true){this.zoom.container.setStyle("height: "+this._viewportSize[1]+"px;");
(function(){window.scrollTo(0,1)}).delay(0.01)}}if("didChangeOrientation" in this.delegate){return this.delegate.didChangeOrientation(this.view,this.zoom.view)
}},_didResizeWindow:function(a){delete this._relativeViewportSize;this._viewportSize=this.getViewportSize();
if(!this.zoom.currentSectionObject){return false}this._setImageDimensions(this.zoom.currentSectionObject);
if(this.options.makeZoomViewAsWideAsAllSections){this._setViewDimensions()}if("didResizeWindow" in this.delegate){return this.delegate.didResizeWindow(this.view,this.zoom.view)
}},_zoomTriggerClicked:function(a){if((this.isZoomed===false)){var b;if(b=a.findElement("a."+this.triggerClass+this.options.zoomString)){this.zoom.currentSectionObject=this.sectionObjectWidthId(b.getAttribute("href").split("#")[1]);
this.zoomInCurrentSection()}else{if(b=a.findElement("a."+this.triggerClass+this.options.zoomString+"-current")){if(this.zoom.options.silentTriggers==true){a.stop()
}this.zoom.view.show(this.zoom.view.sectionWithId(this.view.currentSection.id+this.options.zoomString),true);
this.zoomInCurrentSection()}}}},_zoomWillShow:function(a){this.zoom.currentSectionObject=this.sectionObjectWidthId(a.memo[2].id.replace(this.options.zoomString,""));
this._didResizeWindow();if(!this._isiOS){var b=this.getViewportSize();if(b[0]>this._viewportSize[0]){this._viewportSize=b;
this._setImageDimensions(this.zoom.currentSectionObject);delete b}}if("zoomWillShow" in this.delegate){return this.delegate.zoomWillShow.apply(a.memo)
}},_zoomDidShow:function(a){if(this.zoom._removeOldContent===true){if(a.memo[1].content.parentNode!==null){a.memo[1].content.remove()
}delete this.zoom._removeOldContent}if("zoomDidShow" in this.delegate){return this.delegate.zoomDidShow.apply(a.memo)
}},_willAnimateZoomIn:function(){if("willAnimateZoomIn" in this.delegate){return this.delegate.willAnimateZoomIn(this.view,this.zoom.view,this._didZoomIn.bind(this))
}this._animateZoomIn()},_willAnimateZoomOut:function(){if("willAnimateZoomOut" in this.delegate){return this.delegate.willAnimateZoomOut(this.view,this.zoom.view,this._didZoomOut.bind(this))
}this._animateZoomOut()},_zoomedDelegate:{willShow:function(b,c,a){b.view.view().fire("zoom:willShow",arguments)
},didShow:function(b,c,a){b.view.view().fire("zoom:didShow",arguments)}},_setZoomDelegate:function(){this.zoom.view.setDelegate(this._zoomedDelegate);
this._boundZoomWillShow=this._zoomWillShow.bindAsEventListener(this);this.zoom.view.view.view().observe("zoom:willShow",this._boundZoomWillShow);
this._boundZoomDidShow=this._zoomDidShow.bindAsEventListener(this);this.zoom.view.view.view().observe("zoom:didShow",this._boundZoomDidShow)
},_parsePadding:function(b){if(typeof b=="number"){var a=[b,b,b,b]}else{if(typeof b[0]=="number"){if(b.length<4){if(b.length==1){var a=[parseFloat(b[0]),parseFloat(b[0]),parseFloat(b[0]),parseFloat(b[0])]
}else{if(b.length==2){var a=[parseFloat(b[0]),parseFloat(b[1]),parseFloat(b[0]),parseFloat(b[1])]
}else{if(b.length==3){var a=[parseFloat(b[0]),parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[1])]
}}}}else{var a=[parseFloat(b[0]),parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3])]
}}}return a||[0,0,0,0]},_createClose:function(){this.zoom.close=new Element("a",{"class":"ZoomViewClose",href:"#close"}).update(this.options.localText.close);
var a=function(b){b.stop();this.zoomOut()};this._boundClose=a.bindAsEventListener(this);
this.zoom.close.observe("click",this._boundClose);return this.zoom.close},_createNav:function(){this.zoom.nav={};
this.zoom.nav.container=new Element("ul",{"class":"ZoomViewNav"});this.zoom.nav.previous=new Element("a",{href:"#previous","class":"arrow left "+this.triggerClass+this.options.zoomString}).update("<span>"+this.options.localText.previous+"</span>");
this.zoom.nav.next=new Element("a",{href:"#next","class":"arrow right "+this.triggerClass+this.options.zoomString}).update("<span>"+this.options.localText.next+"</span>");
this.zoom.nav.container.insert(new Element("li").insert(this.zoom.nav.previous));
this.zoom.nav.container.insert(new Element("li").insert(this.zoom.nav.next));return this.zoom.nav.container
},_createDots:function(){this.zoom.dots=new Element("ul",{"class":"ZoomViewDots simple-nav"});
this.zoom.objects.each(this._createDot.bind(this));return this.zoom.dots},_createDot:function(b){var a=new Element("a",{href:"#"+b.id+this.options.zoomString,"class":this.triggerClass+this.options.zoomString});
this.zoom.dots.insert(new Element("li").insert(a))},_createZoom:function(){this.zoom.id=this.view.view.view().id+this.options.zoomString;
this.zoom.container=new Element("div",{id:this.zoom.id+"-container","class":"ZoomViewContainer",style:"display: none;"});
this.zoom.viewElement=new Element("div",{id:this.zoom.id,"class":"ZoomView"});this.zoom.objects=[];
this.zoom.sectionElements=[];this.zoom.obj.each(this._createZoomSection.bind(this));
this.zoom.container.insert(this.zoom.viewElement);this.zoom.container.insert(this._createClose());
this.zoom.container.insert(this._createNav());this.zoom.container.insert(this._createDots());
document.body.insert(this.zoom.container);switch(this.options.fitToAxis){case"x":this.zoom.container.addClassName("fixedToX");
break;case"y":this.zoom.container.addClassName("fixedToY");break;case true:this.zoom.container.addClassName("fixedToBoth");
break;default:break}if(this.options.makeZoomViewAsWideAsAllSections){this._setViewDimensions()
}this.zoom.currentSectionObject=this.sectionObjectWidthId(this.view.currentSection.id);
this.zoom.view=new AC.ViewMaster[this.options.ZoomViewerType](this.zoom.sectionElements,this.zoom.viewElement,this.triggerClass+this.options.zoomString,this.zoom.options);
this._setZoomDelegate();if(this.zoom.view.options.useKeyboardNav===true){var a=function(c){if(c.memo==="escape"){this.zoomOut()
}};var b=a.bindAsEventListener(this);this.zoom.viewElement.observe("AC.ViewMaster.Viewer:usedKeyboardNav",b)
}},_createZoomSection:function(a){if(this.view.sectionWithId(a.id)){var b=Object.clone(a);
b.images=this.sort(b.images,"width",true);b.wrapper=new Element("div",{"class":"ZoomViewSection "+b.id,id:b.id+this.options.zoomString});
b.element=new Element("div",{"class":"ZoomViewElement"});b.image=new Element("img",{"class":"ZoomViewImage"});
if(b.caption!==null&&typeof b.caption==="string"){b.caption=b.caption.replace(/<\/?p>/gi,"");
b.captionElement=new Element("p",{"class":"caption"}).update(b.caption)}b.element.insert(b.image);
if(typeof b.caption!=="undefined"){b.element.insert(b.caption)}b.wrapper.insert(b.element);
this.zoom.objects.push(b);this.zoom.sectionElements.push(b.wrapper);this.zoom.viewElement.insert(b.wrapper)
}},_getBestSizeImage:function(d,c){if(typeof c=="undefined"){c=this._viewportSize
}var e=d.images[d.images.length-1];var b=false;for(var a=0;a<d.images.length&&b==false;
a++){switch(this.options.fitToAxis){case"x":if(d.images[a].width<c[0]){if(a!==0){e=d.images[a-1]
}else{e=d.images[a]}b=true}break;case"y":if(d.images[a].height<c[1]){if(a!==0){e=d.images[a-1]
}else{e=d.images[a]}b=true}break;default:if(d.images[a].width<c[0]&&d.images[a].height<c[1]){if(a!==0){e=d.images[a-1]
}else{e=d.images[a]}b=true}break}}return e},_setViewEvents:function(){this._boundZoomIn=this.zoomInCurrentSection.bindAsEventListener(this);
this.view.view.view().observe("click",this._boundZoomIn)},_definePadding:function(a){if(typeof a.padding!=="undefined"){return this._parsePadding(a.padding)
}else{return this.options.ZoomViewerPadding}},_adjustForPadding:function(a,c){if(typeof c=="undefined"){var c=this._definePadding(this.zoom.currentSectionObject)
}var b=Object.clone(a);b[0]=b[0]-(c[1]+c[3]);b[1]=b[1]-(c[0]+c[2]);return b},_setImageDimensions:function(k,j,d){var i=this._definePadding(k);
if(typeof d=="undefined"){var d=this._adjustForPadding(this._viewportSize,i)}var h=k.currentImage;
k.currentImage=this._getBestSizeImage(k,d);if(h!==k.currentImage){var g=true}delete h;
switch(this.options.fitToAxis){case"x":var c=d[0];var l=Math.floor((d[0]*k.currentImage.height)/k.currentImage.width);
break;case"y":var c=Math.floor((d[1]*k.currentImage.width)/k.currentImage.height);
var l=d[1];break;case true:if(k.currentImage.width/d[0]>k.currentImage.height/d[1]){var c=d[0];
var l=Math.floor((d[0]*k.currentImage.height)/k.currentImage.width)}else{var c=Math.floor((d[1]*k.currentImage.width)/k.currentImage.height);
var l=d[1]}break;default:break}if(c>k.currentImage.width){d[0]=k.currentImage.width;
delete k.currentImage;return this._setImageDimensions(k,j,d)}if(l>k.currentImage.height){d[1]=k.currentImage.height;
delete k.currentImage;return this._setImageDimensions(k,j,d)}if(l<this.options.minimumHeight||c<this.options.minimumWidth){this.currentImageDimensions=[c,l];
return false}else{}if(g==true){this._loadImage(k)}if(typeof c=="number"&&typeof l=="number"){k.wrapper.setStyle("width: "+this._viewportSize[0]+"px");
k.wrapper.setStyle("height: "+this._viewportSize[1]+"px");k.element.setStyle("width: "+c+"px");
k.element.setStyle("height: "+l+"px");var a=(typeof k.center=="undefined")?this.options.centerZoomedImage:k.center;
var f=this._adjustForPadding(this._viewportSize,i);switch(a){case"horizontally":var e=(f[0]-c)/2+i[3];
var b=i[0];break;case"vertically":var e=i[3];var b=(f[1]-l)/2+i[0];break;case true:var e=(f[0]-c)/2+i[3];
var b=(f[1]-l)/2+i[0];break;default:var e=i[3];var b=i[0];break}delete f;if(e<i[3]){e=i[3]
}if(b<i[0]){b=i[0]}k.element.setStyle("padding-left: "+e+"px");k.element.setStyle("padding-top: "+b+"px");
this.currentImageDimensions=[c,l]}else{this.currentImageDimensions=[k.currentImage.width,k.currentImage.height]
}},_loadImage:function(c){c.currentImage.isLoading=true;var b=function(d){c.currentImage.isLoaded=true;
c.currentImage.isLoading=false;c.image.setAttribute("src",c.currentImage.src);c.wrapper.removeClassName("loading");
delete a};if(c.image.getAttribute("src")==null){c.wrapper.addClassName("loading")
}var a=new Image();a.onload=b;a.src=c.currentImage.src},_setViewDimensions:function(){this.zoom.viewElement.setStyle("width: "+this._viewportSize[0]*this.zoom.objects.length+"px")
},_animateZoomIn:function(){var a=this.view.currentSection.content.getDimensions();
var b=a.width/this.currentImageDimensions[0];if(typeof this.options.ZoomAnimationDuration==="number"&&this.options.ZoomAnimationDuration>0){if(this._isCSSAvailableTransition){this.zoom.container.setStyle("opacity: 0; display: block;");
this.zoom.container.setVendorPrefixStyle("transition",this.options.ZoomAnimationDuration+"s opacity ease-in");
if(this._supportsThreeD){this.zoom.viewElement.setVendorPrefixStyle("transform","scale3d("+b+","+b+",1)");
this.zoom.viewElement.setVendorPrefixStyle("transition",this.options.ZoomAnimationDuration+"s -vendor-transform ease-out");
(function(){this.zoom.container.setStyle("opacity: 1");this.zoom.viewElement.setVendorPrefixStyle("transform","scale3d(1,1,1)")
}.bind(this)).delay(0)}else{this.zoom.viewElement.setVendorPrefixStyle("transform","scale("+b+")");
this.zoom.viewElement.setVendorPrefixStyle("transition",this.options.ZoomAnimationDuration+"s -vendor-transform ease-out");
(function(){this.zoom.container.setStyle("opacity: 1");this.zoom.viewElement.setVendorPrefixStyle("transform","scale(1,1)")
}.bind(this)).delay(0)}}else{this.convertCurrentWidthAndHeightToEms(this.zoom.currentSectionObject.element);
this.zoom.container.setStyle("display: block;");new Effect.Opacity(this.zoom.container,{to:1,duration:this.options.ZoomAnimationDuration,afterFinish:function(c){}});
new Effect.Scale(this.zoom.viewElement,100,{scaleFromCenter:true,scaleFrom:b*100,duration:this.options.ZoomAnimationDuration})
}(function(){Element.addClassName(document.documentElement,"ZoomViewDidShow");this.zoom.container.style.display="block"
}.bind(this)).delay(this.options.ZoomAnimationDuration)}else{this.zoom.container.show();
Element.addClassName(document.documentElement,"ZoomViewDidShow")}},_animateZoomOut:function(){var a=this.view.currentSection.content.getDimensions();
var d=a.width/this.currentImageDimensions[0];Element.removeClassName(document.documentElement,"ZoomViewDidShow");
if(typeof this.options.ZoomAnimationDuration==="number"&&this.options.ZoomAnimationDuration>0){if(this._isCSSAvailableTransition){var e=function(f){this.zoom.container.setStyle("display: none;");
this.zoom.container.setVendorPrefixStyle("transition","none");this.zoom.viewElement.setVendorPrefixStyle("transition","none");
f.target.removeVendorEventListener("transitionEnd",b);e=function(){}};var b=e.bindAsEventListener(this);
e.bind(this).delay(this.options.ZoomAnimationDuration+0.01,{target:this.zoom.viewElement});
if(d!==1){this.zoom.viewElement.addVendorEventListener("transitionEnd",b)}else{this.zoom.container.addVendorEventListener("transitionEnd",b)
}this.zoom.container.setStyle("opacity: 0;");if(this._supportsThreeD){this.zoom.viewElement.setVendorPrefixStyle("transform","scale3d("+d+","+d+",1)")
}else{this.zoom.viewElement.setVendorPrefixStyle("transform","scale("+d+")")}}else{this.convertCurrentWidthAndHeightToEms(this.zoom.currentSectionObject.element);
var c=function(){this.zoom.container.hide()};new Effect.Opacity(this.zoom.container,{to:0,duration:this.options.ZoomAnimationDuration});
new Effect.Scale(this.zoom.viewElement,d*100,{scaleFromCenter:true,scaleFrom:100,duration:this.options.ZoomAnimationDuration,afterFinish:c.bind(this)})
}}else{this.zoom.container.hide()}}});
