!function($){for(var t,supportedCSS,supportedCSSOrigin,styles=document.getElementsByTagName("head")[0].style,toCheck="transformProperty WebkitTransform OTransform msTransform MozTransform".split(" "),a=0;ac;c++){var b=this.get(c);if(b.Wilq32&&b.Wilq32.PhotoEffect)b.Wilq32.PhotoEffect._handleRotation(a);else{var f=$.extend(!0,{},a),g=new Wilq32.PhotoEffect(b,f)._rootObj;d.push($(g))}}return d}},getRotateAngle:function(){for(var c=[],a=0,d=this.length;d>a;a++){var b=this.get(a);b.Wilq32&&b.Wilq32.PhotoEffect&&(c[a]=b.Wilq32.PhotoEffect._angle)}return c},stopRotate:function(){for(var a=0,c=this.length;c>a;a++){var b=this.get(a);b.Wilq32&&b.Wilq32.PhotoEffect&&clearTimeout(b.Wilq32.PhotoEffect._timer)}}}),(Wilq32=window.Wilq32||{}).PhotoEffect=supportedCSS?function(a,b){a.Wilq32={PhotoEffect:this},this._img=this._rootObj=this._eventObj=a,this._handleRotation(b)}:function(a,b){if(this._img=a,this._onLoadDelegate=[b],this._rootObj=document.createElement("span"),this._rootObj.style.display="inline-block",this._rootObj.Wilq32={PhotoEffect:this},a.parentNode.insertBefore(this._rootObj,a),a.complete)this._Loader();else{var c=this;jQuery(this._img).bind("load",function(){c._Loader()})}},Wilq32.PhotoEffect.prototype={_setupParameters:function(a){this._parameters=this._parameters||{},"number"!=typeof this._angle&&(this._angle=0),"number"==typeof a.angle&&(this._angle=a.angle),this._parameters.animateTo="number"==typeof a.animateTo?a.animateTo:this._angle,this._parameters.step=a.step||this._parameters.step||null,this._parameters.easing=a.easing||this._parameters.easing||this._defaultEasing,this._parameters.duration="duration"in a?a.duration:a.duration||this._parameters.duration||1e3,this._parameters.callback=a.callback||this._parameters.callback||this._emptyFunction,this._parameters.center=a.center||this._parameters.center||["50%","50%"],"string"==typeof this._parameters.center[0]?this._rotationCenterX=parseInt(this._parameters.center[0],10)/100*this._imgWidth*this._aspectW:this._rotationCenterX=this._parameters.center[0],"string"==typeof this._parameters.center[1]?this._rotationCenterY=parseInt(this._parameters.center[1],10)/100*this._imgHeight*this._aspectH:this._rotationCenterY=this._parameters.center[1],a.bind&&a.bind!=this._parameters.bind&&this._BindEvents(a.bind)},_emptyFunction:function(){},_defaultEasing:function(e,a,b,c,d){return-c*((a=a/d-1)*a*a*a-1)+b},_handleRotation:function(a,b){return supportedCSS||this._img.complete||b?(this._setupParameters(a),void(this._angle==this._parameters.animateTo?this._rotate(this._angle):this._animateStart())):void this._onLoadDelegate.push(a)},_BindEvents:function(b){if(b&&this._eventObj){if(this._parameters.bind){var c=this._parameters.bind;for(var a in c)c.hasOwnProperty(a)&&jQuery(this._eventObj).unbind(a,c[a])}for(var a in this._parameters.bind=b,b)b.hasOwnProperty(a)&&jQuery(this._eventObj).bind(a,b[a])}},_Loader:IE?function(){var c,a=this._img.width,b=this._img.height;for(this._imgWidth=a,this._imgHeight=b,this._img.parentNode.removeChild(this._img),this._vimage=this.createVMLNode("image"),this._vimage.src=this._img.src,this._vimage.style.height=b+"px",this._vimage.style.width=a+"px",this._vimage.style.position="absolute",this._vimage.style.top="0px",this._vimage.style.left="0px",this._aspectW=this._aspectH=1,this._container=this.createVMLNode("group"),this._container.style.width=a,this._container.style.height=b,this._container.style.position="absolute",this._container.style.top="0px",this._container.style.left="0px",this._container.setAttribute("coordsize",a-1+","+(b-1)),this._container.appendChild(this._vimage),this._rootObj.appendChild(this._container),this._rootObj.style.position="relative",this._rootObj.style.width=a+"px",this._rootObj.style.height=b+"px",this._rootObj.setAttribute("id",this._img.getAttribute("id")),this._rootObj.className=this._img.className,this._eventObj=this._rootObj;c=this._onLoadDelegate.shift();)this._handleRotation(c,!0)}:function(){this._rootObj.setAttribute("id",this._img.getAttribute("id")),this._rootObj.className=this._img.className,this._imgWidth=this._img.naturalWidth,this._imgHeight=this._img.naturalHeight;var a,b=Math.sqrt(this._imgHeight*this._imgHeight+this._imgWidth*this._imgWidth);for(this._width=3*b,this._height=3*b,this._aspectW=this._img.offsetWidth/this._img.naturalWidth,this._aspectH=this._img.offsetHeight/this._img.naturalHeight,this._img.parentNode.removeChild(this._img),this._canvas=document.createElement("canvas"),this._canvas.setAttribute("width",this._width),this._canvas.style.position="relative",this._canvas.style.left=-this._img.height*this._aspectW+"px",this._canvas.style.top=-this._img.width*this._aspectH+"px",this._canvas.Wilq32=this._rootObj.Wilq32,this._rootObj.appendChild(this._canvas),this._rootObj.style.width=this._img.width*this._aspectW+"px",this._rootObj.style.height=this._img.height*this._aspectH+"px",this._eventObj=this._canvas,this._cnv=this._canvas.getContext("2d");a=this._onLoadDelegate.shift();)this._handleRotation(a,!0)},_animateStart:function(){this._timer&&clearTimeout(this._timer),this._animateStartTime=+new Date,this._animateStartAngle=this._angle,this._animate()},_animate:function(){var a=+new Date,b=a-this._animateStartTime>this._parameters.duration;if(b&&!this._parameters.animatedGif)clearTimeout(this._timer);else{if(this._canvas||this._vimage||this._img){var c=this._parameters.easing(0,a-this._animateStartTime,this._animateStartAngle,this._parameters.animateTo-this._animateStartAngle,this._parameters.duration);this._rotate(~~(10*c)/10)}this._parameters.step&&this._parameters.step(this._angle);var d=this;this._timer=setTimeout(function(){d._animate.call(d)},10)}this._parameters.callback&&b&&(this._angle=this._parameters.animateTo,this._rotate(this._angle),this._parameters.callback.call(this._rootObj))},_rotate:(t=Math.PI/180,IE?function(a){this._angle=a,this._container.style.rotation=a%360+"deg",this._vimage.style.top=-(this._rotationCenterY-this._imgHeight/2)+"px",this._vimage.style.left=-(this._rotationCenterX-this._imgWidth/2)+"px",this._container.style.top=this._rotationCenterY-this._imgHeight/2+"px",this._container.style.left=this._rotationCenterX-this._imgWidth/2+"px"}:supportedCSS?function(a){this._angle=a,this._img.style[supportedCSS]="rotate("+a%360+"deg)",this._img.style[supportedCSSOrigin]=this._parameters.center.join(" ")}:function(a){this._angle=a,a=a%360*t,this._canvas.width=this._width,this._canvas.height=this._height,this._cnv.translate(this._imgWidth*this._aspectW,this._imgHeight*this._aspectH),this._cnv.translate(this._rotationCenterX,this._rotationCenterY),this._cnv.rotate(a),this._cnv.translate(-this._rotationCenterX,-this._rotationCenterY),this._cnv.scale(this._aspectW,this._aspectH),this._cnv.drawImage(this._img,0,0)})},IE&&(Wilq32.PhotoEffect.prototype.createVMLNode=function(){document.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{return document.namespaces.rvml||document.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),function(a){return document.createElement("')}}catch(a){return function(a){return document.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}}())}(jQuery)