| Current Path : /var/www/homesaver/www/local/templates/aspro_next/js/ |
| Current File : /var/www/homesaver/www/local/templates/aspro_next/js/xzoom.min.js |
function detect_old_ie(){if(!/MSIE (\d+\.\d+);/.test(navigator.userAgent))return!1;var o=new Number(RegExp.$1);return o>=9?!1:o>=8?!0:o>=7?!0:o>=6?!0:o>=5?!0:void 0}window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(o){window.setTimeout(o,20)}}(),function(o){function t(t,e){function i(){var o=document.documentElement,t=(window.pageXOffset||o.scrollLeft)-(o.clientLeft||0),e=(window.pageYOffset||o.scrollTop)-(o.clientTop||0);return{left:t,top:e}}function s(){var e=t.offset();if(g="auto"==ro.options.zoomWidth?so:so/eo*ro.options.zoomWidth,m="auto"==ro.options.zoomHeight?no:so/io*ro.options.zoomHeight,"#"==ro.options.position.substr(0,1)?co=o(ro.options.position):co.length=0,0!=co.length)return!0;switch(ao){case"lens":case"inside":return!0;case"top":x=e.top,b=e.left,y=x-no,z=b;break;case"left":x=e.top,b=e.left,y=x,z=b-so;break;case"bottom":x=e.top,b=e.left,y=x+no,z=b;break;case"right":default:x=e.top,b=e.left,y=x,z=b+so}return z+g>oo||0>z?!1:!0}function n(){if("circle"==ro.options.lensShape&&"lens"==ro.options.position){T=E=Math.max(T,E);var o=(T+2*Math.max(Z,L))/2;F.css({"-moz-border-radius":o,"-webkit-border-radius":o,"border-radius":o})}}function a(o,t,e,i){"lens"==ro.options.position?(W.css({top:-(t-x)*_+E/2,left:-(o-b)*D+T/2}),ro.options.bg&&(F.css({"background-image":"url("+W.attr("src")+")","background-repeat":"no-repeat","background-position":-(o-b)*D+T/2+"px "+(-(t-x)*_+E/2)+"px"}),e&&i&&F.css({"background-size":e+"px "+i+"px"}))):W.css({top:-q*_,left:-R*D})}function p(o,t){if(-1>vo&&(vo=-1),vo>1&&(vo=1),N>j)var e=j-(j-1)*vo,i=g*e,s=i/Q;else var e=N-(N-1)*vo,s=m*e,i=s*Q;lo&&G?(go=o,mo=t,wo=i,xo=s):(G||(bo=wo=i,yo=xo=s),D=i/u,_=s/v,T=g/D,E=m/_,n(),l(o,t),W.width(i),W.height(s),F.width(T),F.height(E),F.css({top:q-Z,left:R-L}),I.css({top:-q,left:-R}),a(o,t,i,s))}function d(){var o=zo,t=ko,e=Co,i=Mo,s=bo,p=yo;o+=(go-o)/ro.options.smoothLensMove,t+=(mo-t)/ro.options.smoothLensMove,e+=(go-e)/ro.options.smoothZoomMove,i+=(mo-i)/ro.options.smoothZoomMove,s+=(wo-s)/ro.options.smoothScale,p+=(xo-p)/ro.options.smoothScale,D=s/u,_=p/v,T=g/D,E=m/_,n(),l(o,t),W.width(s),W.height(p),F.width(T),F.height(E),F.css({top:q-Z,left:R-L}),I.css({top:-q,left:-R}),l(e,i),a(o,t,s,p),zo=o,ko=t,Co=e,Mo=i,bo=s,yo=p,G&&requestAnimFrame(d)}function l(o,t){o-=b,t-=x,R=o-T/2,q=t-E/2,"lens"!=ro.options.position&&(0>R&&(R=0),R>u-T&&(R=u-T),0>q&&(q=0),q>v-E&&(q=v-E))}function r(){"undefined"!=typeof M&&M.remove(),"undefined"!=typeof X&&X.remove(),"undefined"!=typeof V&&V.remove()}function c(e,s){switch("fullscreen"==ro.options.position?(u=o(window).width(),v=o(window).height()):(u=t.width(),v=t.height()),Y.css({top:v/2-Y.height()/2,left:u/2-Y.width()/2}),w=ro.options.rootOutput||"fullscreen"==ro.options.position?t.offset():t.position(),w.top=Math.round(w.top),w.left=Math.round(w.left),ro.options.position){case"fullscreen":x=i().top,b=i().left,y=0,z=0;break;case"inside":x=w.top,b=w.left,y=0,z=0;break;case"top":x=w.top,b=w.left,y=x-v,z=b;break;case"left":x=w.top,b=w.left,y=x,z=b-u;break;case"bottom":x=w.top,b=w.left,y=x+v,z=b;break;case"right":default:x=w.top,b=w.left,y=x,z=b+u}x-=M.outerHeight()/2,b-=M.outerWidth()/2,"#"==ro.options.position.substr(0,1)?co=o(ro.options.position):co.length=0,0==co.length&&"inside"!=ro.options.position&&"fullscreen"!=ro.options.position?(ro.options.adaptive&&eo&&io||(eo=u,io=v),g="auto"==ro.options.zoomWidth?u:ro.options.zoomWidth,m="auto"==ro.options.zoomHeight?v:ro.options.zoomHeight,y+=ro.options.Yoffset,z+=ro.options.Xoffset,X.css({width:g+"px",height:m+"px",top:y,left:z}),"lens"!=ro.options.position&&h.append(X)):"inside"==ro.options.position||"fullscreen"==ro.options.position?(g=u,m=v,X.css({width:g+"px",height:m+"px"}),M.append(X)):(g=co.width(),m=co.height(),ro.options.rootOutput?(y=co.offset().top,z=co.offset().left,h.append(X)):(y=co.position().top,z=co.position().left,co.parent().append(X)),y+=(co.outerHeight()-m-X.outerHeight())/2,z+=(co.outerWidth()-g-X.outerWidth())/2,X.css({width:g+"px",height:m+"px",top:y,left:z})),ro.options.title&&""!=Yo&&("inside"==ro.options.position||"lens"==ro.options.position||"fullscreen"==ro.options.position?(k=y,C=z,M.append(V)):(k=y+(X.outerHeight()-m)/2,C=z+(X.outerWidth()-g)/2,h.append(V)),V.css({width:g+"px",height:m+"px",top:k,left:C})),M.css({width:u+"px",height:v+"px",top:x,left:b}),O.css({width:u+"px",height:v+"px"}),ro.options.tint&&"inside"!=ro.options.position&&"fullscreen"!=ro.options.position?O.css("background-color",ro.options.tint):Oo&&O.css({"background-image":"url("+t.attr("src")+")","background-color":"#fff"}),zo=go=e,ko=mo=s,S=new Image;var n="";switch(Xo&&(n="?r="+(new Date).getTime()),S.src=t.attr("xoriginal")+n,W=o(S),W.css("position","absolute"),S=new Image,S.src=t.attr("src"),I=o(S),I.css("position","absolute"),I.width(u),ro.options.position){case"fullscreen":case"inside":X.append(W);break;case"lens":F.append(W),ro.options.bg&&W.css({display:"none"});break;default:X.append(W),F.append(I)}}function f(o){var t=o.attr("title"),e=o.attr("xtitle");return e?e:t?t:""}this.xzoom=!0;var h,u,v,g,m,w,x,b,y,z,k,C,M,O,X,Y,A,H,S,W,F,I,T,E,R,q,L,Z,D,_,j,N,Q,$,B,G,J,K,P,U,V,oo,to,eo,io,so,no,ao,po,lo,ro=this,co={},fo=(new Array,new Array),ho=0,uo=0,vo=0,go=0,mo=0,wo=0,xo=0,bo=0,yo=0,zo=0,ko=0,Co=0,Mo=0,Oo=detect_old_ie(),Xo=/MSIE (\d+\.\d+);/.test(navigator.userAgent),Yo="";this.adaptive=function(){(0==eo||0==io)&&(t.css("width",""),t.css("height",""),eo=t.width(),io=t.height()),r(),oo=o(window).width(),to=o(window).height(),so=t.width(),no=t.height();var e=!1;(eo>oo||io>to)&&(e=!0),so>eo&&(so=eo),no>io&&(no=io),e?t.width("100%"):0!=eo&&t.width(eo),"fullscreen"!=ao&&(s()?ro.options.position=ao:ro.options.position=ro.options.mposition),ro.options.lensReverse||(po=ro.options.adaptiveReverse&&ro.options.position==ro.options.mposition)},this.xscroll=function(o){if(o.preventDefault(),o.xscale){var t=o.pageX||o.originalEvent.pageX,e=o.pageY||o.originalEvent.pageY;vo=o.xscale,p(t,e)}else{var i=-o.originalEvent.detail||o.originalEvent.wheelDelta||o.xdelta,t=o.pageX||o.originalEvent.pageX,e=o.pageY||o.originalEvent.pageY;Oo&&(t=J,e=K),i=i>0?-.05:.05,vo+=i,p(t,e)}},this.openzoom=function(t){switch(ro.options.adaptive&&ro.adaptive(),vo=ro.options.defaultScale,G=!1,M=o("<div></div>"),""!=ro.options.sourceClass&&M.addClass(ro.options.sourceClass),M.css("position","absolute"),Y=o("<div></div>"),""!=ro.options.loadingClass&&Y.addClass(ro.options.loadingClass),Y.css("position","absolute"),O=o('<div style="position: absolute; top: 0; left: 0;"></div>'),M.append(Y),X=o("<div></div>"),""!=ro.options.zoomClass&&"fullscreen"!=ro.options.position&&X.addClass(ro.options.zoomClass),X.css({position:"absolute",overflow:"hidden",opacity:1}),ro.options.title&&""!=Yo&&(V=o("<div></div>"),U=o("<div></div>"),V.css({position:"absolute",opacity:1}),ro.options.titleClass&&U.addClass(ro.options.titleClass),U.html("<span>"+Yo+"</span>"),V.append(U),ro.options.fadeIn&&V.css({opacity:0})),F=o("<div></div>"),""!=ro.options.lensClass&&F.addClass(ro.options.lensClass),F.css({position:"absolute",overflow:"hidden"}),ro.options.lens&&(lenstint=o("<div></div>"),lenstint.css({position:"absolute",background:ro.options.lens,opacity:ro.options.lensOpacity,width:"100%",height:"100%",top:0,left:0,"z-index":9999}),F.append(lenstint)),"inside"!=ro.options.position&&"fullscreen"!=ro.options.position?((ro.options.tint||Oo)&&M.append(O),ro.options.fadeIn&&(O.css({opacity:0}),F.css({opacity:0}),X.css({opacity:0})),h.append(M)):(ro.options.fadeIn&&X.css({opacity:0}),h.append(M)),ro.eventleave(M),c(t.pageX,t.pageY),ro.options.position){case"inside":y-=(X.outerHeight()-X.height())/2,z-=(X.outerWidth()-X.width())/2;break;case"top":y-=X.outerHeight()-X.height(),z-=(X.outerWidth()-X.width())/2;break;case"left":y-=(X.outerHeight()-X.height())/2,z-=X.outerWidth()-X.width();break;case"bottom":z-=(X.outerWidth()-X.width())/2;break;case"right":y-=(X.outerHeight()-X.height())/2}X.css({top:y,left:z}),W.xon("load",function(){Y.remove(),ro.options.scroll&&ro.eventscroll(M),"inside"!=ro.options.position&&"fullscreen"!=ro.options.position?(M.append(F),ro.options.fadeIn?(O.fadeTo(300,ro.options.tintOpacity),F.fadeTo(300,1),X.fadeTo(300,1)):(O.css({opacity:ro.options.tintOpacity}),F.css({opacity:1}),X.css({opacity:1}))):ro.options.fadeIn?X.fadeTo(300,1):X.css({opacity:1}),ro.options.title&&""!=Yo&&(ro.options.fadeIn?V.fadeTo(300,1):V.css({opacity:1})),$=W.width(),B=W.height(),ro.options.adaptive&&(eo>u||io>v)&&(I.width(u),I.height(v),$=u/eo*$,B=v/io*B,W.width($),W.height(B)),bo=wo=$,yo=xo=B,Q=$/B,j=$/g,N=B/m;var o,e=["padding-","border-"];Z=L=0;for(var i=0;i<e.length;i++)o=parseFloat(F.css(e[i]+"top-width")),Z+=o!==o?0:o,o=parseFloat(F.css(e[i]+"bottom-width")),Z+=o!==o?0:o,o=parseFloat(F.css(e[i]+"left-width")),L+=o!==o?0:o,o=parseFloat(F.css(e[i]+"right-width")),L+=o!==o?0:o;Z/=2,L/=2,p(t.pageX,t.pageY),lo&&!ro.options.bg&&(G=!0,requestAnimFrame(d)),ro.eventmove(M),ro.eventclick(M)})},this.movezoom=function(o){Oo&&(J=o.pageX,K=o.pageY);var t=o.pageX-b,e=o.pageY-x;po&&(o.pageX-=2*(t-u/2),o.pageY-=2*(e-v/2)),(0>t||t>u||0>e||e>v)&&M.trigger("mouseleave"),lo&&!ro.options.bg?(go=o.pageX,mo=o.pageY):(n(),l(o.pageX,o.pageY),F.css({top:q-Z,left:R-L}),I.css({top:-q,left:-R}),a(o.pageX,o.pageY,0,0))},this.eventdefault=function(){ro.eventopen=function(o){o.xon("mouseenter",ro.openzoom)},ro.eventleave=function(o){o.xon("mouseleave",ro.closezoom)},ro.eventmove=function(o){o.xon("mousemove",ro.movezoom)},ro.eventscroll=function(o){o.xon("mousewheel DOMMouseScroll",ro.xscroll)},ro.eventclick=function(o){o.xon("click",function(o){t.trigger("click")})}},this.eventunbind=function(){t.xoff("mouseenter"),ro.eventopen=function(o){},ro.eventleave=function(o){},ro.eventmove=function(o){},ro.eventscroll=function(o){},ro.eventclick=function(o){}},this.init=function(e){ro.options=o.extend({},o.fn.xzoom.defaults,e),h=ro.options.rootOutput?o("body"):t.parent(),ao=ro.options.position,po=ro.options.lensReverse&&"inside"==ro.options.position,ro.options.smoothZoomMove<0&&(ro.options.smoothZoomMove=0),ro.options.smoothLensMove<0&&(ro.options.smoothLensMove=0),ro.options.smoothScale<0&&(ro.options.smoothScale=0),lo=ro.options.smoothZoomMove&&ro.options.smoothLensMove&&ro.options.smoothScale,ro.options.adaptive&&o(window).xon("load",function(){eo=t.width(),io=t.height(),ro.adaptive(),o(window).resize(ro.adaptive)}),ro.eventdefault(),ro.eventopen(t)},this.destroy=function(){ro.eventunbind(),delete ro},this.closezoom=function(){G=!1,ro.options.fadeOut?(ro.options.title&&""!=Yo&&V.fadeOut(299),"inside"!=ro.options.position||"fullscreen"!=ro.options.position?(X.fadeOut(299),M.fadeOut(300,function(){r()})):M.fadeOut(300,function(){r()})):r()},this.gallery=function(){var o,t=new Array,e=0;for(o=uo;o<fo.length;o++)t[e]=fo[o],e++;for(o=0;uo>o;o++)t[e]=fo[o],e++;return{index:uo,ogallery:fo,cgallery:t}},this.xappend=function(e){function i(i){r(),i.preventDefault(),ro.options.activeClass&&(P.removeClass(ro.options.activeClass),P=e,P.addClass(ro.options.activeClass)),uo=o(this).data("xindex"),ro.options.fadeTrans&&(H=new Image,H.src=t.attr("src"),A=o(H),A.css({position:"absolute",top:t.offset().top,left:t.offset().left,width:t.width(),height:t.height()}),o(document.body).append(A),A.fadeOut(200,function(){A.remove()}));var n,a=s.attr("href");n=e.attr("xpreview")?e.attr("xpreview"):e.attr("src"),Yo=f(e),e.attr("title")&&t.attr("title",e.attr("title")),t.attr("xoriginal",a),t.attr("src",n)}var s=e.parent();fo[ho]=s.attr("href"),s.data("xindex",ho),0==ho&&ro.options.activeClass&&(P=e,P.addClass(ro.options.activeClass)),0==ho&&ro.options.title&&(Yo=f(e)),ho++,ro.options.hover&&s.xon("mouseenter",s,i),s.xon("click",s,i)},this.init(e)}o.fn.xon=o.fn.on||o.fn.bind,o.fn.xoff=o.fn.off||o.fn.bind,o.fn.xzoom=function(e){var i,s;if(this.selector){var n=this.selector.split(",");for(var a in n)n[a]=o.trim(n[a]);this.each(function(a){if(1==n.length)if(0==a){if(i=o(this),"undefined"!=typeof i.data("xzoom"))return i.data("xzoom");i.x=new t(i,e)}else"undefined"!=typeof i.x&&(s=o(this),i.x.xappend(s));else if(o(this).is(n[0])&&0==a){if(i=o(this),"undefined"!=typeof i.data("xzoom"))return i.data("xzoom");i.x=new t(i,e)}else"undefined"==typeof i.x||o(this).is(n[0])||(s=o(this),i.x.xappend(s))})}else this.each(function(n){if(0==n){if(i=o(this),"undefined"!=typeof i.data("xzoom"))return i.data("xzoom");i.x=new t(i,e)}else"undefined"!=typeof i.x&&(s=o(this),i.x.xappend(s))});return"undefined"==typeof i?!1:(i.data("xzoom",i.x),o(i).trigger("xzoom_ready"),i.x)},o.fn.xzoom.defaults={position:"right",mposition:"inside",rootOutput:!0,Xoffset:0,Yoffset:0,fadeIn:!0,fadeTrans:!0,fadeOut:!1,smoothZoomMove:3,smoothLensMove:1,smoothScale:6,defaultScale:0,scroll:!0,tint:!1,tintOpacity:.5,lens:!1,lensOpacity:.5,lensShape:"box",zoomWidth:"auto",zoomHeight:"auto",sourceClass:"xzoom-source",loadingClass:"xzoom-loading",lensClass:"xzoom-lens",zoomClass:"xzoom-preview",activeClass:"xactive",hover:!1,adaptive:!0,lensReverse:!1,adaptiveReverse:!1,title:!1,titleClass:"xzoom-caption",bg:!1}}(jQuery);