// JavaScript Document
var EnlargeImage=new Class({initialize:function(element,options){this.element=element;this.options=options;this.enlarge()},enlarge:function(){if($("EnlargedImage")){$("EnlargedImage").remove()}var coordinates=$(this.element).getCoordinates();var coordinatesTop=coordinates.top;var coordinatesLeft=coordinates.left;var coordinatesWidth=coordinates.width;var coordinatesHeight=coordinates.height;var image=new Element("img",{styles:{left:"10px",position:"absolute",top:"0px","z-index":"-99",cursor:"pointer"},src:this.element.getProperty("main"),id:"EnlargedImage"});if(document.body.appendChild(image)){imageWidth=this.element.getProperty("real_width");imageHeight=this.element.getProperty("real_height");var browserWidth=window.getWidth();image.setStyles({top:coordinatesTop+"px",left:coordinatesLeft+"px",width:coordinatesWidth+"px",height:coordinatesHeight+"px",border:"0px solid silver","z-index":"+99"});var position;if(this.options.position=="this"){position=(coordinatesTop-(imageHeight/2)+(coordinatesHeight/2))}else{position=this.options.position+"px"}var animationDuration=this.options.duration;var transStyle=Fx.Transitions.Back.easeInOut;var enlargeImage=new Fx.Styles(image,{duration:animationDuration,transition:transStyle,onComplete:function(){image.addEvent("click",function(){var contractImage=new Fx.Styles(image,{duration:animationDuration,transition:transStyle,onComplete:function(){image.remove()}});contractImage.start({top:[position,coordinatesTop],left:[((browserWidth/2)-(imageWidth/2)),coordinatesLeft],width:[imageWidth,coordinatesWidth],height:[imageHeight,coordinatesHeight]})})}});if(browserWidth<400){browserWidth=1000;};enlargeImage.start({top:[coordinatesTop,position],left:[coordinatesLeft,((browserWidth/2)-(imageWidth/2))],width:[coordinatesWidth,imageWidth],height:[coordinatesHeight,imageHeight]})}}});