CommandoGroup.Resize=new Class({element:null,image:{width:0,height:0},options:{offset:0,minWidth:480,minHeight:326},initialize:function(C,D,A,B){this.setOptions(B);this.element=C;this.image.width=D;this.image.height=A;this.options.minWidth-=this.options.offset;},calculateSize:function(B,E,D,G){var C=D,F=G,A=0,H=0;if((B<E)||((B==E)&&(D>G))){F=this.eqs(D,B,E);}else{if((B>E)||((B==E)&&(D<G))){C=this.eqs(G,E,B);}}if(F<G){C=this.eqs(G,E,B);F=G;}else{if(C<D){F=this.eqs(D,B,E);C=D;}}C=Math.round(C);F=Math.round(F);var A=0,H=0;if(C>D){A=this.med(D,C);}if(F>G){H=this.med(G,F);}return{width:C,height:F,left:A,top:H};},eqs:function(B,A,C){return((((100*B)/A)*C)/100);},med:function(B,A){return Math.round((B-A)/2);},resize:function(){var C=window.getSize().size,E=this.options.minWidth,B=this.options.minHeight,A=this.image.width,D=this.image.height;C.x-=this.options.offset;C.x=(C.x>E?C.x:E);C.y=(C.y>B?C.y:B);C=this.calculateSize(A,D,C.x,C.y);$(this.element).setProperty("width",C.width);$(this.element).setProperty("height",C.height);$(this.element).setStyles({top:C.top,left:C.left});}});CommandoGroup.Resize.implement(new Events,new Options);
